Компоненти
Бічна панель
Панель, що виїжджає з будь-якого краю екрана.
Використання
Основне
Edit profile
Make changes to your profile here, then save when you are done.
<bs:bsui-drawer position="right">
<bs:bsui-drawer-trigger trigger_label="Open drawer" trigger_variant="outline" />
<bs:bsui-drawer-backdrop />
<bs:bsui-drawer-popup>
<bs:bsui-text content="Edit profile" variant="title" tag="h3" />
<bs:bsui-text content="Make changes to your profile here, then save when you are done." variant="muted" />
<bs:bsui-field>
<bs:bsui-field-label text="Name" />
<bs:bsui-input defaultValue="Pedro Duarte" />
</bs:bsui-field>
<bs:bsui-field>
<bs:bsui-field-label text="Username" />
<bs:bsui-input defaultValue="@peduarte" />
</bs:bsui-field>
<bs:bsui-drawer-footer>
<bs:bsui-drawer-close label="Save changes" variant="default" />
<bs:bsui-drawer-close label="Close" variant="outline" />
</bs:bsui-drawer-footer>
</bs:bsui-drawer-popup>
</bs:bsui-drawer>Підтвердження з бічної панелі
Діалог попередження відкривається зсередини панелі, тож руйнівну дію можна підтвердити, не втрачаючи панель позаду.
Billing details
Discard your edits?
The company name and VAT number go back to what they were.
<bs:bsui-drawer position="right">
<bs:bsui-drawer-trigger trigger_label="Edit billing" trigger_variant="outline" />
<bs:bsui-drawer-backdrop />
<bs:bsui-drawer-popup>
<bs:bsui-text content="Billing details" variant="title" tag="h3" />
<bs:bsui-field>
<bs:bsui-field-label text="Company" />
<bs:bsui-input defaultValue="Northwind Ltd" />
</bs:bsui-field>
<bs:bsui-field>
<bs:bsui-field-label text="VAT number" />
<bs:bsui-input defaultValue="GB123456789" />
</bs:bsui-field>
<bs:bsui-drawer-footer>
<bs:bsui-drawer-close label="Save billing details" variant="default" />
<bs:bsui-alert-dialog>
<bs:bsui-alert-dialog-trigger trigger_label="Discard changes" trigger_variant="ghost" />
<bs:bsui-alert-dialog-backdrop />
<bs:bsui-alert-dialog-popup>
<bs:bsui-text content="Discard your edits?" variant="title" tag="h3" />
<bs:bsui-text content="The company name and VAT number go back to what they were." variant="muted" />
<bs:bsui-alert-dialog-footer>
<bs:bsui-alert-dialog-close label="Keep editing" variant="outline" />
<bs:bsui-alert-dialog-close label="Discard" variant="destructive" />
</bs:bsui-alert-dialog-footer>
</bs:bsui-alert-dialog-popup>
</bs:bsui-alert-dialog>
</bs:bsui-drawer-footer>
</bs:bsui-drawer-popup>
</bs:bsui-drawer>Нижня панель
Позиція внизу перетворює бічну панель на нижню; тут вона містить повну форму вибору часу доставки.
Delivery window
<bs:bsui-drawer position="bottom">
<bs:bsui-drawer-trigger trigger_label="Choose delivery slot" />
<bs:bsui-drawer-backdrop />
<bs:bsui-drawer-popup>
<bs:bsui-text content="Delivery window" variant="title" tag="h3" />
<bs:bsui-radio-group defaultValue="afternoon">
<bs:bsui-radio value="morning" label="Morning, 8 to 12" />
<bs:bsui-radio value="afternoon" label="Afternoon, 12 to 17" />
<bs:bsui-radio value="evening" label="Evening, 17 to 21" />
</bs:bsui-radio-group>
<bs:bsui-field>
<bs:bsui-field-label text="Note for the driver" />
<bs:bsui-textarea rows="3" placeholder="Leave it with the neighbour at number 14" />
</bs:bsui-field>
<bs:bsui-drawer-footer>
<bs:bsui-drawer-close label="Confirm slot" variant="default" />
</bs:bsui-drawer-footer>
</bs:bsui-drawer-popup>
</bs:bsui-drawer>Панель без відступів
Режим без відступів прибирає внутрішні відступи спливного вікна, щоб смугаста таблиця простягалася від краю до краю під плаваючою кнопкою закриття.
| Invoice | Total |
|---|---|
|
INV-1041
|
49.00
|
|
INV-1038
|
49.00
|
|
INV-1029
|
129.00
|
<bs:bsui-drawer position="right">
<bs:bsui-drawer-trigger trigger_label="Recent invoices" trigger_variant="outline" />
<bs:bsui-drawer-backdrop />
<bs:bsui-drawer-popup flush="true">
<bs:bsui-drawer-close x="true" />
<bs:bsui-table striped="true" sortable="false">
<bs:bsui-table-header>
<bs:bsui-table-header-cell columnId="invoice" label="Invoice" sortable="false" />
<bs:bsui-table-header-cell columnId="total" label="Total" sortable="false" />
</bs:bsui-table-header>
<bs:bsui-table-body>
<bs:bsui-table-row>
<bs:bsui-table-cell>INV-1041</bs:bsui-table-cell>
<bs:bsui-table-cell>49.00</bs:bsui-table-cell>
</bs:bsui-table-row>
<bs:bsui-table-row>
<bs:bsui-table-cell>INV-1038</bs:bsui-table-cell>
<bs:bsui-table-cell>49.00</bs:bsui-table-cell>
</bs:bsui-table-row>
<bs:bsui-table-row>
<bs:bsui-table-cell>INV-1029</bs:bsui-table-cell>
<bs:bsui-table-cell>129.00</bs:bsui-table-cell>
</bs:bsui-table-row>
</bs:bsui-table-body>
</bs:bsui-table>
</bs:bsui-drawer-popup>
</bs:bsui-drawer>Не можна закрити натисканням поза діалогом
Якщо вимкнути можливість закриття, натискання Escape і кліки на тлі ігноруються, тож запущений імпорт не можна випадково перервати.
Importing 240 members
Leaving now would leave half the team without an invite.
<bs:bsui-drawer position="right" dismissable="false">
<bs:bsui-drawer-trigger trigger_label="Import members" />
<bs:bsui-drawer-backdrop />
<bs:bsui-drawer-popup>
<bs:bsui-text content="Importing 240 members" variant="title" tag="h3" />
<bs:bsui-progress value="38" max="100" label="Matching email addresses" />
<bs:bsui-text content="Leaving now would leave half the team without an invite." variant="muted" />
<bs:bsui-drawer-footer>
<bs:bsui-drawer-close label="Run in background" variant="default" />
</bs:bsui-drawer-footer>
</bs:bsui-drawer-popup>
</bs:bsui-drawer>Структура
Бічна панель складається з блоків нижче. Кожен із них є окремим блоком, який відображається лише всередині батьківського.
bsui/drawerbsui/drawer-backdropbsui/drawer-popupbsui/drawer-closebsui/drawer-footerbsui/drawer-trigger
Атрибути
| Атрибут | Тип | За замовчуванням |
|---|---|---|
position | left | |
dismissable | toggle | true |
bsui/drawer-backdrop
Цей блок не приймає атрибутів.
bsui/drawer-popup
| Атрибут | Тип | За замовчуванням |
|---|---|---|
flush | toggle | false |
bsui/drawer-close
| Атрибут | Тип | За замовчуванням |
|---|---|---|
label | richtext | — |
variant | outline | |
x | toggle | false |
bsui/drawer-footer
Цей блок не приймає атрибутів.
bsui/drawer-trigger
| Атрибут | Тип | За замовчуванням |
|---|---|---|
trigger | text | — |
trigger_block | text | bsui/button |
trigger_label | richtext | — |
trigger_icon | icon | — |
trigger_iconPosition | left | |
trigger_href | text | — |
trigger_variant | default | |
trigger_size | default | |
trigger_disabled | toggle | false |