SusBottomSheet

Нижний action sheet с backdrop, высотой и слотами header / body / footer.
Пакет
SusKit · Молекулы (коммерческий)
Свойства
| Имя | Тип | По умолчанию | |
|---|---|---|---|
Model | Prop<bool> | false | v-model |
Persistent | Prop<bool> | false | v-model |
Inset | Prop<bool> | false | v-model |
Height | Prop<float> | 280f | v-model |
Слоты
| Имя |
|---|
header |
(по умолчанию) |
footer |
События
| Имя | Поле | Payload |
|---|---|---|
Opened | OnOpened | — |
Closed | OnClosed | — |
BackdropClick | OnBackdropClick | — |
Хуки стиля
Контракт USS-классов — внешний вид переопределяется без правки C#. Состояния переключаются этими классами:
sus-bottom-sheetsus-bottom-sheet__backdropsus-bottom-sheet__bodysus-bottom-sheet__footersus-bottom-sheet__handlesus-bottom-sheet__headersus-bottom-sheet__panelsus-bottom-sheet--insetsus-bottom-sheet--opensus-slot
Использование
xml
<template>
<sus:SusBottomSheet :Model="Open.Value"
Height="200"
:Persistent="Persistent.Value"
@opened="OnOpened"
@closed="OnClosed">
<template #header>
<ui:Label text="Quick actions" />
</template>
<ui:Label text="Trade · Invite · Report" />
<template #footer>
<sus:SusButton Text="Close" Variant="text" @click="Open.Value = false" />
</template>
</sus:SusBottomSheet>
</template>
<script>
public Prop<bool> Open = new(false);
public Prop<bool> Persistent = new(false);
void OnOpened() { }
void OnClosed() { }
</script>csharp
var sheet = new SusBottomSheet();
sheet.Model.Value = true;
sheet.Height.Value = 200f;
sheet.OnOpened += () => { /* … */ };
sheet.Slot("header")?.Add(new Label("Quick actions"));
sheet.Slot("default")?.Add(new Label("Trade · Invite · Report"));
// Prefer Slot("default") over Add() — Add() lands on the overlay root.
sheet.Open(); // or sheet.Model.Value = true;Заметки
Persistentоставляет sheet открытым при клике на backdrop / нажатии Escape.Insetподтягивает панель внутрь от краёв экрана.