Μετάβαση στο περιεχόμενο

Στοιχεία

Διάλογος ειδοποίησης

Ένα παράθυρο διαλόγου που διακόπτει τη ροή και απαιτεί απάντηση πριν κλείσει.

Χρήση

Βασικό

HTML
<bs:bsui-alert-dialog>
  <bs:bsui-alert-dialog-trigger trigger_label="Delete project" trigger_variant="outline" />
  <bs:bsui-alert-dialog-backdrop />
  <bs:bsui-alert-dialog-popup>
    <bs:bsui-text content="Delete this project?" variant="title" tag="h3" />
    <bs:bsui-text content="This action cannot be undone. The project and every build it produced are removed." variant="muted" />
    <bs:bsui-alert-dialog-footer>
      <bs:bsui-alert-dialog-close label="Cancel" variant="outline" />
      <bs:bsui-alert-dialog-close label="Delete" variant="destructive" />
    </bs:bsui-alert-dialog-footer>
  </bs:bsui-alert-dialog-popup>
</bs:bsui-alert-dialog>

Κλείσιμο από τη γωνία

Το κλείσιμο με x εμφανίζει ένα διακριτικό κουμπί μόνο με εικονίδιο στη γωνία του αναδυόμενου παραθύρου, αντί για κουμπί με ετικέτα.

HTML
<bs:bsui-alert-dialog>
  <bs:bsui-alert-dialog-trigger trigger_label="Revoke API key" trigger_variant="outline" />
  <bs:bsui-alert-dialog-backdrop />
  <bs:bsui-alert-dialog-popup>
    <bs:bsui-alert-dialog-close x="true" />
    <bs:bsui-text content="Revoke the production key?" variant="title" tag="h3" />
    <bs:bsui-text content="Any service still holding it starts failing within a minute." variant="muted" />
    <bs:bsui-alert-dialog-footer>
      <bs:bsui-alert-dialog-close label="Revoke key" variant="destructive" />
    </bs:bsui-alert-dialog-footer>
  </bs:bsui-alert-dialog-popup>
</bs:bsui-alert-dialog>

Επικίνδυνες ενέργειες

Δύο παράθυρα διαλόγου ειδοποίησης δίπλα δίπλα στο υποσέλιδο μιας κάρτας, καθένα για διαφορετική μη αναστρέψιμη ενέργεια.

Danger zone

Nothing here can be undone afterwards.

HTML
<bs:bsui-card>
  <bs:bsui-card-header>
    <bs:bsui-card-title label="Danger zone" />
    <bs:bsui-card-description label="Nothing here can be undone afterwards." />
  </bs:bsui-card-header>
  <bs:bsui-card-footer>
    <bs:bsui-alert-dialog>
      <bs:bsui-alert-dialog-trigger trigger_label="Transfer ownership" trigger_variant="outline" />
      <bs:bsui-alert-dialog-backdrop />
      <bs:bsui-alert-dialog-popup>
        <bs:bsui-text content="Transfer this workspace?" variant="title" tag="h3" />
        <bs:bsui-text content="You keep admin access until the new owner accepts." variant="muted" />
        <bs:bsui-alert-dialog-footer>
          <bs:bsui-alert-dialog-close label="Cancel" variant="outline" />
          <bs:bsui-alert-dialog-close label="Transfer" variant="default" />
        </bs:bsui-alert-dialog-footer>
      </bs:bsui-alert-dialog-popup>
    </bs:bsui-alert-dialog>
    <bs:bsui-alert-dialog>
      <bs:bsui-alert-dialog-trigger trigger_label="Delete workspace" trigger_variant="destructive" />
      <bs:bsui-alert-dialog-backdrop />
      <bs:bsui-alert-dialog-popup>
        <bs:bsui-text content="Delete this workspace?" variant="title" tag="h3" />
        <bs:bsui-text content="Nine projects and every build log are removed immediately." variant="muted" />
        <bs:bsui-alert-dialog-footer>
          <bs:bsui-alert-dialog-close label="Cancel" variant="outline" />
          <bs:bsui-alert-dialog-close label="Delete" variant="destructive" />
        </bs:bsui-alert-dialog-footer>
      </bs:bsui-alert-dialog-popup>
    </bs:bsui-alert-dialog>
  </bs:bsui-card-footer>
</bs:bsui-card>

Ενέργεια γραμμής

Ένα παράθυρο διαλόγου ειδοποίησης για κάθε γραμμή πίνακα, ώστε να ζητείται επιβεβαίωση πριν από μια καταστροφική ενέργεια ακόμη και σε μια πυκνή λίστα.

Member
Role
Actions
Ada Lovelace
Owner
Grace Hopper
Editor
HTML
<bs:bsui-table>
  <bs:bsui-table-header>
    <bs:bsui-table-header-cell columnId="member" label="Member" />
    <bs:bsui-table-header-cell columnId="role" label="Role" />
    <bs:bsui-table-header-cell columnId="actions" label="Actions" sortable="false" />
  </bs:bsui-table-header>
  <bs:bsui-table-body>
    <bs:bsui-table-row>
      <bs:bsui-table-cell>Ada Lovelace</bs:bsui-table-cell>
        <bs:bsui-table-cell>Owner</bs:bsui-table-cell>
          <bs:bsui-table-cell>
            <bs:bsui-alert-dialog>
              <bs:bsui-alert-dialog-trigger trigger_label="Remove" trigger_variant="ghost" trigger_size="sm" />
              <bs:bsui-alert-dialog-backdrop />
              <bs:bsui-alert-dialog-popup>
                <bs:bsui-text content="Remove Ada from the workspace?" variant="title" tag="h3" />
                <bs:bsui-text content="She loses access to nine projects the moment you confirm." variant="muted" />
                <bs:bsui-alert-dialog-footer>
                  <bs:bsui-alert-dialog-close label="Cancel" variant="outline" />
                  <bs:bsui-alert-dialog-close label="Remove" variant="destructive" />
                </bs:bsui-alert-dialog-footer>
              </bs:bsui-alert-dialog-popup>
            </bs:bsui-alert-dialog>
          </bs:bsui-table-cell>
        </bs:bsui-table-row>
        <bs:bsui-table-row>
          <bs:bsui-table-cell>Grace Hopper</bs:bsui-table-cell>
            <bs:bsui-table-cell>Editor</bs:bsui-table-cell>
              <bs:bsui-table-cell>
                <bs:bsui-alert-dialog>
                  <bs:bsui-alert-dialog-trigger trigger_label="Remove" trigger_variant="ghost" trigger_size="sm" />
                  <bs:bsui-alert-dialog-backdrop />
                  <bs:bsui-alert-dialog-popup>
                    <bs:bsui-text content="Remove Grace from the workspace?" variant="title" tag="h3" />
                    <bs:bsui-text content="Her drafts stay, but she can no longer edit them." variant="muted" />
                    <bs:bsui-alert-dialog-footer>
                      <bs:bsui-alert-dialog-close label="Cancel" variant="outline" />
                      <bs:bsui-alert-dialog-close label="Remove" variant="destructive" />
                    </bs:bsui-alert-dialog-footer>
                  </bs:bsui-alert-dialog-popup>
                </bs:bsui-alert-dialog>
              </bs:bsui-table-cell>
            </bs:bsui-table-row>
          </bs:bsui-table-body>
        </bs:bsui-table>

Δομή

Το Διάλογος ειδοποίησης αποτελείται από τα παρακάτω μπλοκ. Καθένα είναι ξεχωριστό μπλοκ που αποδίδεται μόνο μέσα στο γονικό του.

  • bsui/alert-dialog
  • bsui/alert-dialog-backdrop
  • bsui/alert-dialog-popup
  • bsui/alert-dialog-close
  • bsui/alert-dialog-footer
  • bsui/alert-dialog-trigger

Χαρακτηριστικά

Αυτό το μπλοκ δεν δέχεται χαρακτηριστικά.

bsui/alert-dialog-backdrop

Αυτό το μπλοκ δεν δέχεται χαρακτηριστικά.

bsui/alert-dialog-popup

Αυτό το μπλοκ δεν δέχεται χαρακτηριστικά.

bsui/alert-dialog-close

ΙδιότηταΤύποςΠροεπιλογή
label richtext —
variant default secondary outline ghost destructive outline
x toggle false

Αυτό το μπλοκ δεν δέχεται χαρακτηριστικά.

bsui/alert-dialog-trigger

ΙδιότηταΤύποςΠροεπιλογή
trigger text —
trigger_block text bsui/button
trigger_label richtext —
trigger_icon icon —
trigger_iconPosition left right left
trigger_href text —
trigger_variant default secondary outline ghost link destructive default
trigger_size default sm lg icon icon-sm default
trigger_disabled toggle false