@bitrix24/b24ui-nuxt 0.6.8 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nuxt/b24ui/accordion.ts +20 -0
- package/.nuxt/b24ui/advice.ts +2 -10
- package/.nuxt/b24ui/alert.ts +2 -15
- package/.nuxt/b24ui/avatar-group.ts +2 -10
- package/.nuxt/b24ui/avatar.ts +3 -11
- package/.nuxt/b24ui/badge.ts +48 -13
- package/.nuxt/b24ui/button-group.ts +2 -22
- package/.nuxt/b24ui/button.ts +4 -17
- package/.nuxt/b24ui/calendar.ts +3 -11
- package/.nuxt/b24ui/checkbox.ts +75 -11
- package/.nuxt/b24ui/chip.ts +2 -10
- package/.nuxt/b24ui/collapsible.ts +2 -10
- package/.nuxt/b24ui/container.ts +2 -10
- package/.nuxt/b24ui/countdown.ts +2 -10
- package/.nuxt/b24ui/description-list.ts +2 -15
- package/.nuxt/b24ui/dropdown-menu.ts +4 -11
- package/.nuxt/b24ui/form-field.ts +3 -10
- package/.nuxt/b24ui/form.ts +2 -10
- package/.nuxt/b24ui/index.ts +1 -0
- package/.nuxt/b24ui/input-menu.ts +6 -30
- package/.nuxt/b24ui/input-number.ts +15 -10
- package/.nuxt/b24ui/input.ts +4 -17
- package/.nuxt/b24ui/kbd.ts +2 -10
- package/.nuxt/b24ui/link.ts +11 -17
- package/.nuxt/b24ui/modal.ts +3 -11
- package/.nuxt/b24ui/navbar-divider.ts +2 -10
- package/.nuxt/b24ui/navbar-section.ts +2 -10
- package/.nuxt/b24ui/navbar-spacer.ts +2 -10
- package/.nuxt/b24ui/navbar.ts +2 -10
- package/.nuxt/b24ui/navigation-menu.ts +69 -60
- package/.nuxt/b24ui/popover.ts +2 -10
- package/.nuxt/b24ui/progress.ts +2 -10
- package/.nuxt/b24ui/radio-group.ts +3 -11
- package/.nuxt/b24ui/range.ts +2 -10
- package/.nuxt/b24ui/select-menu.ts +10 -40
- package/.nuxt/b24ui/select.ts +10 -40
- package/.nuxt/b24ui/separator.ts +2 -10
- package/.nuxt/b24ui/sidebar-body.ts +2 -10
- package/.nuxt/b24ui/sidebar-footer.ts +2 -10
- package/.nuxt/b24ui/sidebar-header.ts +2 -10
- package/.nuxt/b24ui/sidebar-heading.ts +2 -10
- package/.nuxt/b24ui/sidebar-layout.ts +3 -11
- package/.nuxt/b24ui/sidebar-section.ts +2 -10
- package/.nuxt/b24ui/sidebar-spacer.ts +2 -10
- package/.nuxt/b24ui/sidebar.ts +2 -10
- package/.nuxt/b24ui/skeleton.ts +2 -10
- package/.nuxt/b24ui/slideover.ts +2 -10
- package/.nuxt/b24ui/stacked-layout.ts +2 -10
- package/.nuxt/b24ui/switch.ts +2 -10
- package/.nuxt/b24ui/tabs.ts +6 -13
- package/.nuxt/b24ui/textarea.ts +4 -17
- package/.nuxt/b24ui/toast.ts +2 -15
- package/.nuxt/b24ui/toaster.ts +3 -11
- package/.nuxt/b24ui/tooltip.ts +3 -11
- package/.nuxt/b24ui.css +1 -1
- package/cli/templates.mjs +2 -2
- package/dist/meta.d.mts +35333 -15836
- package/dist/meta.mjs +35333 -15836
- package/dist/module.json +1 -1
- package/dist/module.mjs +11 -3
- package/dist/runtime/air-design-tokens.css +1 -0
- package/dist/runtime/components/Accordion.vue +96 -0
- package/dist/runtime/components/Accordion.vue.d.ts +78 -0
- package/dist/runtime/components/Advice.vue +1 -1
- package/dist/runtime/components/Alert.vue +1 -1
- package/dist/runtime/components/App.vue +1 -1
- package/dist/runtime/components/Avatar.vue +11 -3
- package/dist/runtime/components/Avatar.vue.d.ts +2 -1
- package/dist/runtime/components/AvatarGroup.vue +1 -1
- package/dist/runtime/components/Badge.vue +5 -3
- package/dist/runtime/components/Badge.vue.d.ts +2 -0
- package/dist/runtime/components/Button.vue +2 -3
- package/dist/runtime/components/Button.vue.d.ts +1 -1
- package/dist/runtime/components/Calendar.vue +1 -1
- package/dist/runtime/components/Checkbox.vue +13 -4
- package/dist/runtime/components/Checkbox.vue.d.ts +9 -0
- package/dist/runtime/components/Chip.vue +1 -1
- package/dist/runtime/components/Collapsible.vue +1 -1
- package/dist/runtime/components/Countdown.vue +1 -1
- package/dist/runtime/components/Countdown.vue.d.ts +2 -2
- package/dist/runtime/components/DescriptionList.vue +3 -2
- package/dist/runtime/components/DescriptionList.vue.d.ts +1 -1
- package/dist/runtime/components/DropdownMenu.vue +1 -1
- package/dist/runtime/components/DropdownMenu.vue.d.ts +2 -0
- package/dist/runtime/components/DropdownMenuContent.vue +74 -72
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +4 -20
- package/dist/runtime/components/Form.vue +6 -6
- package/dist/runtime/components/Form.vue.d.ts +12 -11
- package/dist/runtime/components/FormField.vue +4 -4
- package/dist/runtime/components/Input.vue +12 -8
- package/dist/runtime/components/Input.vue.d.ts +31 -30
- package/dist/runtime/components/InputMenu.vue +23 -20
- package/dist/runtime/components/InputMenu.vue.d.ts +6 -4
- package/dist/runtime/components/InputNumber.vue +17 -10
- package/dist/runtime/components/InputNumber.vue.d.ts +6 -3
- package/dist/runtime/components/Link.vue +5 -13
- package/dist/runtime/components/Modal.vue +22 -14
- package/dist/runtime/components/Modal.vue.d.ts +18 -5
- package/dist/runtime/components/Navbar.vue +1 -1
- package/dist/runtime/components/NavbarDivider.vue +1 -1
- package/dist/runtime/components/NavbarSection.vue +1 -1
- package/dist/runtime/components/NavbarSpacer.vue +1 -1
- package/dist/runtime/components/NavigationMenu.vue +186 -44
- package/dist/runtime/components/NavigationMenu.vue.d.ts +39 -8
- package/dist/runtime/components/OverlayProvider.vue +2 -2
- package/dist/runtime/components/Popover.vue +4 -0
- package/dist/runtime/components/Popover.vue.d.ts +2 -1
- package/dist/runtime/components/Progress.vue +3 -2
- package/dist/runtime/components/Progress.vue.d.ts +2 -2
- package/dist/runtime/components/RadioGroup.vue +24 -8
- package/dist/runtime/components/RadioGroup.vue.d.ts +3 -1
- package/dist/runtime/components/Range.vue +2 -2
- package/dist/runtime/components/Range.vue.d.ts +19 -20
- package/dist/runtime/components/Select.vue +57 -31
- package/dist/runtime/components/Select.vue.d.ts +110 -2
- package/dist/runtime/components/SelectMenu.vue +77 -23
- package/dist/runtime/components/SelectMenu.vue.d.ts +111 -5
- package/dist/runtime/components/Separator.vue +3 -3
- package/dist/runtime/components/Sidebar.vue +1 -1
- package/dist/runtime/components/SidebarBody.vue +1 -1
- package/dist/runtime/components/SidebarFooter.vue +1 -1
- package/dist/runtime/components/SidebarHeader.vue +1 -1
- package/dist/runtime/components/SidebarHeading.vue +1 -1
- package/dist/runtime/components/SidebarLayout.vue +1 -1
- package/dist/runtime/components/SidebarSection.vue +1 -1
- package/dist/runtime/components/SidebarSpacer.vue +1 -1
- package/dist/runtime/components/Slideover.vue +23 -15
- package/dist/runtime/components/Slideover.vue.d.ts +18 -5
- package/dist/runtime/components/StackedLayout.vue +1 -1
- package/dist/runtime/components/Switch.vue +1 -1
- package/dist/runtime/components/Tabs.vue +28 -7
- package/dist/runtime/components/Tabs.vue.d.ts +6 -1
- package/dist/runtime/components/Textarea.vue +13 -9
- package/dist/runtime/components/Textarea.vue.d.ts +31 -30
- package/dist/runtime/components/Toast.vue +7 -6
- package/dist/runtime/components/Toast.vue.d.ts +6 -0
- package/dist/runtime/components/Toaster.vue +4 -4
- package/dist/runtime/components/Toaster.vue.d.ts +6 -0
- package/dist/runtime/components/Tooltip.vue +9 -2
- package/dist/runtime/components/Tooltip.vue.d.ts +2 -1
- package/dist/runtime/components/content/TableWrapper.vue +1 -1
- package/dist/runtime/composables/defineLocale.d.ts +2 -0
- package/dist/runtime/composables/defineLocale.js +4 -0
- package/dist/runtime/composables/defineShortcuts.js +8 -2
- package/dist/runtime/composables/useFormField.d.ts +1 -1
- package/dist/runtime/composables/useFormField.js +2 -1
- package/dist/runtime/composables/useKbd.d.ts +1 -0
- package/dist/runtime/composables/useKbd.js +4 -3
- package/dist/runtime/composables/useOverlay.d.ts +11 -11
- package/dist/runtime/composables/useOverlay.js +17 -11
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/inertia/components/Link.vue +45 -60
- package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
- package/dist/runtime/inertia/components/LinkBase.vue +68 -0
- package/dist/runtime/inertia/components/LinkBase.vue.d.ts +25 -0
- package/dist/runtime/inertia/stubs.d.ts +1 -1
- package/dist/runtime/inertia/stubs.js +1 -1
- package/dist/runtime/prose/A.vue +1 -1
- package/dist/runtime/prose/Blockquote.vue +1 -1
- package/dist/runtime/prose/Code.vue +1 -1
- package/dist/runtime/prose/Em.vue +1 -1
- package/dist/runtime/prose/H1.vue +1 -1
- package/dist/runtime/prose/H2.vue +1 -1
- package/dist/runtime/prose/H3.vue +1 -1
- package/dist/runtime/prose/H4.vue +1 -1
- package/dist/runtime/prose/H5.vue +1 -1
- package/dist/runtime/prose/H6.vue +1 -1
- package/dist/runtime/prose/Hr.vue +1 -1
- package/dist/runtime/prose/Img.vue +1 -1
- package/dist/runtime/prose/Li.vue +1 -1
- package/dist/runtime/prose/Ol.vue +1 -1
- package/dist/runtime/prose/P.vue +1 -1
- package/dist/runtime/prose/Pre.vue +1 -1
- package/dist/runtime/prose/Strong.vue +1 -1
- package/dist/runtime/prose/Table.vue +1 -1
- package/dist/runtime/prose/Tbody.vue +1 -1
- package/dist/runtime/prose/Td.vue +1 -1
- package/dist/runtime/prose/Th.vue +1 -1
- package/dist/runtime/prose/Thead.vue +1 -1
- package/dist/runtime/prose/Tr.vue +1 -1
- package/dist/runtime/prose/Ul.vue +1 -1
- package/dist/runtime/types/form.d.ts +11 -10
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/locale.d.ts +1 -0
- package/dist/runtime/types/tv.d.ts +53 -0
- package/dist/runtime/types/tv.js +0 -0
- package/dist/runtime/types/utils.d.ts +4 -51
- package/dist/runtime/types/utils.js +1 -0
- package/dist/runtime/utils/link.d.ts +1 -0
- package/dist/runtime/utils/link.js +12 -0
- package/dist/runtime/vue/components/Link.vue +26 -40
- package/dist/runtime/vue/composables/useAppConfig.js +3 -1
- package/dist/runtime/vue/stubs.d.ts +1 -1
- package/dist/runtime/vue/stubs.js +1 -1
- package/dist/shared/{b24ui-nuxt.jU270f-Q.mjs → b24ui-nuxt.CxsFEY3M.mjs} +268 -122
- package/dist/unplugin.d.mts +2 -2
- package/dist/unplugin.mjs +6 -3
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +2 -2
- package/package.json +30 -29
|
@@ -3,7 +3,7 @@ import theme from "#build/b24ui/select-menu";
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
|
-
import { computed, toRef, toRaw } from "vue";
|
|
6
|
+
import { ref, computed, onMounted, toRef, toRaw } from "vue";
|
|
7
7
|
import {
|
|
8
8
|
ComboboxRoot,
|
|
9
9
|
ComboboxArrow,
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
ComboboxTrigger,
|
|
13
13
|
ComboboxPortal,
|
|
14
14
|
ComboboxContent,
|
|
15
|
-
ComboboxViewport,
|
|
16
15
|
ComboboxEmpty,
|
|
17
16
|
ComboboxGroup,
|
|
18
17
|
ComboboxLabel,
|
|
@@ -67,6 +66,8 @@ const props = defineProps({
|
|
|
67
66
|
createItem: { type: [Boolean, String, Object], required: false },
|
|
68
67
|
filterFields: { type: Array, required: false },
|
|
69
68
|
ignoreFilter: { type: Boolean, required: false },
|
|
69
|
+
autofocus: { type: Boolean, required: false },
|
|
70
|
+
autofocusDelay: { type: Number, required: false, default: 0 },
|
|
70
71
|
class: { type: null, required: false },
|
|
71
72
|
b24ui: { type: null, required: false },
|
|
72
73
|
open: { type: Boolean, required: false },
|
|
@@ -119,7 +120,8 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.selectM
|
|
|
119
120
|
}));
|
|
120
121
|
function displayValue(value) {
|
|
121
122
|
if (props.multiple && Array.isArray(value)) {
|
|
122
|
-
|
|
123
|
+
const values = value.map((v) => displayValue(v)).filter(Boolean);
|
|
124
|
+
return values?.length ? values.join(", ") : void 0;
|
|
123
125
|
}
|
|
124
126
|
if (!props.valueKey) {
|
|
125
127
|
return value && (typeof value === "object" ? get(value, props.labelKey) : value);
|
|
@@ -160,6 +162,19 @@ const createItem = computed(() => {
|
|
|
160
162
|
return !filteredItems.value.length;
|
|
161
163
|
});
|
|
162
164
|
const createItemPosition = computed(() => typeof props.createItem === "object" ? props.createItem.position : "bottom");
|
|
165
|
+
const triggerRef = ref(null);
|
|
166
|
+
function autoFocus() {
|
|
167
|
+
if (props.autofocus) {
|
|
168
|
+
triggerRef.value?.$el?.focus({
|
|
169
|
+
focusVisible: true
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
onMounted(() => {
|
|
174
|
+
setTimeout(() => {
|
|
175
|
+
autoFocus();
|
|
176
|
+
}, props.autofocusDelay);
|
|
177
|
+
});
|
|
163
178
|
function onUpdate(value) {
|
|
164
179
|
if (toRaw(props.modelValue) === value) {
|
|
165
180
|
return;
|
|
@@ -206,6 +221,9 @@ function onSelect(e, item) {
|
|
|
206
221
|
function isSelectItem(item) {
|
|
207
222
|
return typeof item === "object" && item !== null;
|
|
208
223
|
}
|
|
224
|
+
defineExpose({
|
|
225
|
+
triggerRef
|
|
226
|
+
});
|
|
209
227
|
</script>
|
|
210
228
|
|
|
211
229
|
<template>
|
|
@@ -223,7 +241,7 @@ function isSelectItem(item) {
|
|
|
223
241
|
:is="icons.plus"
|
|
224
242
|
:class="b24ui.itemLeadingIcon({ addNew: true, class: props.b24ui?.itemLeadingIcon })"
|
|
225
243
|
/>
|
|
226
|
-
{{ t(
|
|
244
|
+
{{ t("selectMenu.create", { label: searchTerm }) }}
|
|
227
245
|
</slot>
|
|
228
246
|
</span>
|
|
229
247
|
</ComboboxItem>
|
|
@@ -242,7 +260,11 @@ function isSelectItem(item) {
|
|
|
242
260
|
@update:open="onUpdateOpen"
|
|
243
261
|
>
|
|
244
262
|
<ComboboxAnchor as-child>
|
|
245
|
-
<ComboboxTrigger
|
|
263
|
+
<ComboboxTrigger
|
|
264
|
+
ref="triggerRef"
|
|
265
|
+
:class="b24ui.base({ class: [props.b24ui?.base, props.class] })"
|
|
266
|
+
tabindex="0"
|
|
267
|
+
>
|
|
246
268
|
<div v-if="isTag" :class="b24ui.tag({ class: props.b24ui?.tag })">
|
|
247
269
|
{{ props.tag }}
|
|
248
270
|
</div>
|
|
@@ -259,11 +281,17 @@ function isSelectItem(item) {
|
|
|
259
281
|
|
|
260
282
|
<slot :model-value="modelValue" :open="open">
|
|
261
283
|
<template v-for="displayedModelValue in [displayValue(modelValue)]" :key="displayedModelValue">
|
|
262
|
-
<span
|
|
284
|
+
<span
|
|
285
|
+
v-if="displayedModelValue !== void 0 && displayedModelValue !== null"
|
|
286
|
+
:class="b24ui.value({ class: props.b24ui?.value })"
|
|
287
|
+
>
|
|
263
288
|
{{ displayedModelValue }}
|
|
264
289
|
</span>
|
|
265
|
-
<span
|
|
266
|
-
|
|
290
|
+
<span
|
|
291
|
+
v-else
|
|
292
|
+
:class="b24ui.placeholder({ class: props.b24ui?.placeholder })"
|
|
293
|
+
>
|
|
294
|
+
{{ placeholder ?? "\xA0" }}
|
|
267
295
|
</span>
|
|
268
296
|
</template>
|
|
269
297
|
</slot>
|
|
@@ -285,30 +313,51 @@ function isSelectItem(item) {
|
|
|
285
313
|
<FocusScope trapped :class="b24ui.focusScope({ class: props.b24ui?.focusScope })">
|
|
286
314
|
<slot name="content-top" />
|
|
287
315
|
|
|
288
|
-
<ComboboxInput
|
|
289
|
-
|
|
316
|
+
<ComboboxInput
|
|
317
|
+
v-if="!!searchInput"
|
|
318
|
+
v-model="searchTerm"
|
|
319
|
+
:display-value="() => searchTerm"
|
|
320
|
+
as-child
|
|
321
|
+
>
|
|
322
|
+
<B24Input
|
|
323
|
+
no-border
|
|
324
|
+
autofocus
|
|
325
|
+
autocomplete="off"
|
|
326
|
+
:size="size"
|
|
327
|
+
v-bind="searchInputProps"
|
|
328
|
+
:class="b24ui.input({ class: props.b24ui?.input })"
|
|
329
|
+
/>
|
|
290
330
|
</ComboboxInput>
|
|
291
331
|
|
|
292
332
|
<ComboboxEmpty :class="b24ui.empty({ class: props.b24ui?.empty })">
|
|
293
333
|
<slot name="empty" :search-term="searchTerm">
|
|
294
|
-
{{ searchTerm ? t(
|
|
334
|
+
{{ searchTerm ? t("selectMenu.noMatch", { searchTerm }) : t("selectMenu.noData") }}
|
|
295
335
|
</slot>
|
|
296
336
|
</ComboboxEmpty>
|
|
297
337
|
|
|
298
|
-
<
|
|
338
|
+
<div
|
|
339
|
+
role="presentation"
|
|
340
|
+
:class="b24ui.viewport({ class: props.b24ui?.viewport })"
|
|
341
|
+
>
|
|
299
342
|
<ReuseCreateItemTemplate v-if="createItem && createItemPosition === 'top'" />
|
|
300
343
|
|
|
301
344
|
<ComboboxGroup v-for="(group, groupIndex) in filteredGroups" :key="`group-${groupIndex}`" :class="b24ui.group({ class: props.b24ui?.group })">
|
|
302
345
|
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
303
|
-
<ComboboxLabel
|
|
346
|
+
<ComboboxLabel
|
|
347
|
+
v-if="isSelectItem(item) && item.type === 'label'"
|
|
348
|
+
:class="b24ui.label({ class: [props.b24ui?.label, item.b24ui?.label, item.class] })"
|
|
349
|
+
>
|
|
304
350
|
{{ get(item, props.labelKey) }}
|
|
305
351
|
</ComboboxLabel>
|
|
306
352
|
|
|
307
|
-
<ComboboxSeparator
|
|
353
|
+
<ComboboxSeparator
|
|
354
|
+
v-else-if="isSelectItem(item) && item.type === 'separator'"
|
|
355
|
+
:class="b24ui.separator({ class: [props.b24ui?.separator, item.b24ui?.separator, item.class] })"
|
|
356
|
+
/>
|
|
308
357
|
|
|
309
358
|
<ComboboxItem
|
|
310
359
|
v-else
|
|
311
|
-
:class="b24ui.item({ class: props.b24ui?.item, colorItem: isSelectItem(item)
|
|
360
|
+
:class="b24ui.item({ class: [props.b24ui?.item, isSelectItem(item) && item.b24ui?.item, isSelectItem(item) && item.class], colorItem: isSelectItem(item) && item?.color || void 0 })"
|
|
312
361
|
:disabled="isSelectItem(item) && item.disabled"
|
|
313
362
|
:value="props.valueKey && isSelectItem(item) ? get(item, props.valueKey) : item"
|
|
314
363
|
@select="onSelect($event, item)"
|
|
@@ -318,32 +367,37 @@ function isSelectItem(item) {
|
|
|
318
367
|
<Component
|
|
319
368
|
:is="item.icon"
|
|
320
369
|
v-if="isSelectItem(item) && item.icon"
|
|
321
|
-
:class="b24ui.itemLeadingIcon({ class: props.b24ui?.itemLeadingIcon, colorItem: item?.color })"
|
|
370
|
+
:class="b24ui.itemLeadingIcon({ class: [props.b24ui?.itemLeadingIcon, item.b24ui?.itemLeadingIcon], colorItem: item?.color })"
|
|
371
|
+
/>
|
|
372
|
+
<B24Avatar
|
|
373
|
+
v-else-if="isSelectItem(item) && item.avatar"
|
|
374
|
+
:size="item.b24ui?.itemLeadingAvatarSize || props.b24ui?.itemLeadingAvatarSize || b24ui.itemLeadingAvatarSize()"
|
|
375
|
+
v-bind="item.avatar"
|
|
376
|
+
:class="b24ui.itemLeadingAvatar({ class: [props.b24ui?.itemLeadingAvatar, item.b24ui?.itemLeadingAvatar], colorItem: item?.color })"
|
|
322
377
|
/>
|
|
323
|
-
<B24Avatar v-else-if="isSelectItem(item) && item.avatar" :size="props.b24ui?.itemLeadingAvatarSize || b24ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="b24ui.itemLeadingAvatar({ class: props.b24ui?.itemLeadingAvatar, colorItem: item?.color })" />
|
|
324
378
|
<B24Chip
|
|
325
379
|
v-else-if="isSelectItem(item) && item.chip"
|
|
326
|
-
:size="props.b24ui?.itemLeadingChipSize || b24ui.itemLeadingChipSize()"
|
|
380
|
+
:size="item.b24ui?.itemLeadingChipSize || props.b24ui?.itemLeadingChipSize || b24ui.itemLeadingChipSize()"
|
|
327
381
|
inset
|
|
328
382
|
standalone
|
|
329
383
|
v-bind="item.chip"
|
|
330
|
-
:class="b24ui.itemLeadingChip({ class: props.b24ui?.itemLeadingChip, colorItem: item?.color })"
|
|
384
|
+
:class="b24ui.itemLeadingChip({ class: [props.b24ui?.itemLeadingChip, item.b24ui?.itemLeadingChip], colorItem: item?.color })"
|
|
331
385
|
/>
|
|
332
386
|
</slot>
|
|
333
387
|
|
|
334
|
-
<span :class="b24ui.itemLabel({ class: props.b24ui?.itemLabel })">
|
|
388
|
+
<span :class="b24ui.itemLabel({ class: [props.b24ui?.itemLabel, isSelectItem(item) && item.b24ui?.itemLabel] })">
|
|
335
389
|
<slot name="item-label" :item="item" :index="index">
|
|
336
390
|
{{ isSelectItem(item) ? get(item, props.labelKey) : item }}
|
|
337
391
|
</slot>
|
|
338
392
|
</span>
|
|
339
393
|
|
|
340
|
-
<span :class="b24ui.itemTrailing({ class: props.b24ui?.itemTrailing, colorItem: isSelectItem(item)
|
|
394
|
+
<span :class="b24ui.itemTrailing({ class: [props.b24ui?.itemTrailing, isSelectItem(item) && item.b24ui?.itemTrailing], colorItem: isSelectItem(item) && item?.color || void 0 })">
|
|
341
395
|
<slot name="item-trailing" :item="item" :index="index" />
|
|
342
396
|
|
|
343
397
|
<ComboboxItemIndicator as-child>
|
|
344
398
|
<Component
|
|
345
399
|
:is="selectedIcon || icons.check"
|
|
346
|
-
:class="b24ui.itemTrailingIcon({ class: props.b24ui?.itemTrailingIcon, colorItem: isSelectItem(item)
|
|
400
|
+
:class="b24ui.itemTrailingIcon({ class: [props.b24ui?.itemTrailingIcon, isSelectItem(item) && item.b24ui?.itemTrailingIcon], colorItem: isSelectItem(item) && item?.color || void 0 })"
|
|
347
401
|
/>
|
|
348
402
|
</ComboboxItemIndicator>
|
|
349
403
|
</span>
|
|
@@ -353,7 +407,7 @@ function isSelectItem(item) {
|
|
|
353
407
|
</ComboboxGroup>
|
|
354
408
|
|
|
355
409
|
<ReuseCreateItemTemplate v-if="createItem && createItemPosition === 'bottom'" />
|
|
356
|
-
</
|
|
410
|
+
</div>
|
|
357
411
|
|
|
358
412
|
<slot name="content-bottom" />
|
|
359
413
|
</FocusScope>
|
|
@@ -22,6 +22,8 @@ interface _SelectMenuItem {
|
|
|
22
22
|
type?: 'label' | 'separator' | 'item';
|
|
23
23
|
disabled?: boolean;
|
|
24
24
|
onSelect?(e?: Event): void;
|
|
25
|
+
class?: any;
|
|
26
|
+
b24ui?: Pick<SelectMenu['slots'], 'label' | 'separator' | 'item' | 'itemLeadingIcon' | 'itemLeadingAvatarSize' | 'itemLeadingAvatar' | 'itemLeadingChipSize' | 'itemLeadingChip' | 'itemLabel' | 'itemTrailing' | 'itemTrailingIcon'>;
|
|
25
27
|
[key: string]: any;
|
|
26
28
|
}
|
|
27
29
|
export type SelectMenuItem = _SelectMenuItem | AcceptableValue | boolean;
|
|
@@ -147,6 +149,8 @@ export interface SelectMenuProps<T extends ArrayOrNested<SelectMenuItem> = Array
|
|
|
147
149
|
* @defaultValue false
|
|
148
150
|
*/
|
|
149
151
|
ignoreFilter?: boolean;
|
|
152
|
+
autofocus?: boolean;
|
|
153
|
+
autofocusDelay?: number;
|
|
150
154
|
class?: any;
|
|
151
155
|
b24ui?: SelectMenu['slots'];
|
|
152
156
|
}
|
|
@@ -205,23 +209,125 @@ declare const _default: <T extends ArrayOrNested<SelectMenuItem>, VK extends Get
|
|
|
205
209
|
readonly onChange?: ((payload: Event) => any) | undefined;
|
|
206
210
|
readonly onFocus?: ((payload: FocusEvent) => any) | undefined;
|
|
207
211
|
readonly onCreate?: ((item: string) => any) | undefined;
|
|
212
|
+
readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
213
|
+
readonly "onUpdate:modelValue"?: ((payload: GetModelValue<T, VK, M>) => any) | undefined;
|
|
208
214
|
readonly onHighlight?: ((payload: {
|
|
209
215
|
ref: HTMLElement;
|
|
210
216
|
value: GetModelValue<T, VK, M>;
|
|
211
217
|
} | undefined) => any) | undefined;
|
|
212
|
-
readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
213
|
-
readonly "onUpdate:modelValue"?: ((payload: GetModelValue<T, VK, M>) => any) | undefined;
|
|
214
218
|
readonly "onUpdate:searchTerm"?: ((value: string) => any) | undefined;
|
|
215
219
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onFocus" | "onBlur" | "onChange" | "onUpdate:open" | "onUpdate:modelValue" | "onCreate" | "onHighlight" | "onUpdate:searchTerm"> & (SelectMenuProps<T, VK, M> & {
|
|
216
220
|
searchTerm?: string;
|
|
217
221
|
}) & Partial<{}>> & import("vue").PublicProps;
|
|
218
|
-
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
222
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
223
|
+
triggerRef: import("vue").Ref<({
|
|
224
|
+
$: import("vue").ComponentInternalInstance;
|
|
225
|
+
$data: {};
|
|
226
|
+
$props: {
|
|
227
|
+
readonly disabled?: boolean | undefined;
|
|
228
|
+
readonly asChild?: boolean | undefined;
|
|
229
|
+
readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
|
|
230
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
231
|
+
$attrs: {
|
|
232
|
+
[x: string]: unknown;
|
|
233
|
+
};
|
|
234
|
+
$refs: {
|
|
235
|
+
[x: string]: unknown;
|
|
236
|
+
};
|
|
237
|
+
$slots: Readonly<{
|
|
238
|
+
[name: string]: import("vue").Slot<any> | undefined;
|
|
239
|
+
}>;
|
|
240
|
+
$root: import("vue").ComponentPublicInstance | null;
|
|
241
|
+
$parent: import("vue").ComponentPublicInstance | null;
|
|
242
|
+
$host: Element | null;
|
|
243
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
244
|
+
$el: any;
|
|
245
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").ComboboxTriggerProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
246
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
247
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
248
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
249
|
+
created?: (() => void) | (() => void)[];
|
|
250
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
251
|
+
mounted?: (() => void) | (() => void)[];
|
|
252
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
253
|
+
updated?: (() => void) | (() => void)[];
|
|
254
|
+
activated?: (() => void) | (() => void)[];
|
|
255
|
+
deactivated?: (() => void) | (() => void)[];
|
|
256
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
257
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
258
|
+
destroyed?: (() => void) | (() => void)[];
|
|
259
|
+
unmounted?: (() => void) | (() => void)[];
|
|
260
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
261
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
262
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
263
|
+
};
|
|
264
|
+
$forceUpdate: () => void;
|
|
265
|
+
$nextTick: typeof import("vue").nextTick;
|
|
266
|
+
$watch<T_1 extends string | ((...args: any) => any)>(source: T_1, cb: T_1 extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
|
|
267
|
+
} & Readonly<{
|
|
268
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
269
|
+
}> & Omit<Readonly<import("reka-ui").ComboboxTriggerProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
270
|
+
$slots: {
|
|
271
|
+
default?(_: {}): any;
|
|
272
|
+
};
|
|
273
|
+
}) | null, ({
|
|
274
|
+
$: import("vue").ComponentInternalInstance;
|
|
275
|
+
$data: {};
|
|
276
|
+
$props: {
|
|
277
|
+
readonly disabled?: boolean | undefined;
|
|
278
|
+
readonly asChild?: boolean | undefined;
|
|
279
|
+
readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
|
|
280
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
281
|
+
$attrs: {
|
|
282
|
+
[x: string]: unknown;
|
|
283
|
+
};
|
|
284
|
+
$refs: {
|
|
285
|
+
[x: string]: unknown;
|
|
286
|
+
};
|
|
287
|
+
$slots: Readonly<{
|
|
288
|
+
[name: string]: import("vue").Slot<any> | undefined;
|
|
289
|
+
}>;
|
|
290
|
+
$root: import("vue").ComponentPublicInstance | null;
|
|
291
|
+
$parent: import("vue").ComponentPublicInstance | null;
|
|
292
|
+
$host: Element | null;
|
|
293
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
294
|
+
$el: any;
|
|
295
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").ComboboxTriggerProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
296
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
297
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
298
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
299
|
+
created?: (() => void) | (() => void)[];
|
|
300
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
301
|
+
mounted?: (() => void) | (() => void)[];
|
|
302
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
303
|
+
updated?: (() => void) | (() => void)[];
|
|
304
|
+
activated?: (() => void) | (() => void)[];
|
|
305
|
+
deactivated?: (() => void) | (() => void)[];
|
|
306
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
307
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
308
|
+
destroyed?: (() => void) | (() => void)[];
|
|
309
|
+
unmounted?: (() => void) | (() => void)[];
|
|
310
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
311
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
312
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
313
|
+
};
|
|
314
|
+
$forceUpdate: () => void;
|
|
315
|
+
$nextTick: typeof import("vue").nextTick;
|
|
316
|
+
$watch<T_1 extends string | ((...args: any) => any)>(source: T_1, cb: T_1 extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
|
|
317
|
+
} & Readonly<{
|
|
318
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
319
|
+
}> & Omit<Readonly<import("reka-ui").ComboboxTriggerProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
320
|
+
$slots: {
|
|
321
|
+
default?(_: {}): any;
|
|
322
|
+
};
|
|
323
|
+
}) | null>;
|
|
324
|
+
}>): void;
|
|
219
325
|
attrs: any;
|
|
220
326
|
slots: SelectMenuSlots<T, VK, M, NestedItem<T>>;
|
|
221
|
-
emit: (((evt: "blur", payload: FocusEvent) => void) & ((evt: "change", payload: Event) => void) & ((evt: "focus", payload: FocusEvent) => void) & ((evt: "create", item: string) => void) & ((evt: "highlight", payload: {
|
|
327
|
+
emit: (((evt: "blur", payload: FocusEvent) => void) & ((evt: "change", payload: Event) => void) & ((evt: "focus", payload: FocusEvent) => void) & ((evt: "create", item: string) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "update:modelValue", payload: GetModelValue<T, VK, M>) => void) & ((evt: "highlight", payload: {
|
|
222
328
|
ref: HTMLElement;
|
|
223
329
|
value: GetModelValue<T, VK, M>;
|
|
224
|
-
} | undefined) => void)
|
|
330
|
+
} | undefined) => void)) & ((evt: "update:searchTerm", value: string) => void);
|
|
225
331
|
}>) => import("vue").VNode & {
|
|
226
332
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
227
333
|
};
|
|
@@ -34,13 +34,13 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.separat
|
|
|
34
34
|
</script>
|
|
35
35
|
|
|
36
36
|
<template>
|
|
37
|
-
<Separator v-bind="rootProps" :class="b24ui.root({ class: [props.
|
|
37
|
+
<Separator v-bind="rootProps" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
38
38
|
<div :class="b24ui.border({ class: props.b24ui?.border })" />
|
|
39
39
|
|
|
40
|
-
<template v-if="label || icon || avatar || !!slots.default">
|
|
40
|
+
<template v-if="label !== void 0 && label !== null || icon || avatar || !!slots.default">
|
|
41
41
|
<div :class="b24ui.container({ class: props.b24ui?.container })">
|
|
42
42
|
<slot>
|
|
43
|
-
<span v-if="label" :class="b24ui.label({ class: props.b24ui?.label })">{{ label }}</span>
|
|
43
|
+
<span v-if="label !== void 0 && label !== null" :class="b24ui.label({ class: props.b24ui?.label })">{{ label }}</span>
|
|
44
44
|
<Component :is="icon" v-else-if="icon" :class="b24ui.icon({ class: props.b24ui?.icon })" />
|
|
45
45
|
<B24Avatar v-else-if="avatar" :size="props.b24ui?.avatarSize || b24ui.avatarSize()" v-bind="avatar" :class="b24ui.avatar({ class: props.b24ui?.avatar })" />
|
|
46
46
|
</slot>
|
|
@@ -19,7 +19,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.sidebar
|
|
|
19
19
|
|
|
20
20
|
<template>
|
|
21
21
|
<!-- Sidebar -->
|
|
22
|
-
<Primitive :as="as" :class="b24ui.root({ class: [props.
|
|
22
|
+
<Primitive :as="as" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
23
23
|
<slot />
|
|
24
24
|
</Primitive>
|
|
25
25
|
</template>
|
|
@@ -21,7 +21,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.sidebar
|
|
|
21
21
|
</script>
|
|
22
22
|
|
|
23
23
|
<template>
|
|
24
|
-
<Primitive :as="as" :class="b24ui.root({ class: [props.
|
|
24
|
+
<Primitive :as="as" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
25
25
|
<slot />
|
|
26
26
|
</Primitive>
|
|
27
27
|
</template>
|
|
@@ -18,7 +18,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.sidebar
|
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
20
|
<template>
|
|
21
|
-
<Primitive :as="as" :class="b24ui.root({ class: [props.
|
|
21
|
+
<Primitive :as="as" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
22
22
|
<slot />
|
|
23
23
|
</Primitive>
|
|
24
24
|
</template>
|
|
@@ -18,7 +18,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.sidebar
|
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
20
|
<template>
|
|
21
|
-
<Primitive :as="as" :class="b24ui.root({ class: [props.
|
|
21
|
+
<Primitive :as="as" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
22
22
|
<slot />
|
|
23
23
|
</Primitive>
|
|
24
24
|
</template>
|
|
@@ -18,7 +18,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.sidebar
|
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
20
|
<template>
|
|
21
|
-
<Primitive :as="as" :class="b24ui.root({ class: [props.
|
|
21
|
+
<Primitive :as="as" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
22
22
|
<slot />
|
|
23
23
|
</Primitive>
|
|
24
24
|
</template>
|
|
@@ -48,7 +48,7 @@ const handleNavigationClick = () => {
|
|
|
48
48
|
</script>
|
|
49
49
|
|
|
50
50
|
<template>
|
|
51
|
-
<Primitive :as="as" :class="b24ui.root({ class: [props.
|
|
51
|
+
<Primitive :as="as" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
52
52
|
<template v-if="isUseSideBar">
|
|
53
53
|
<div :class="b24ui.sidebar({ class: props.b24ui?.sidebar })">
|
|
54
54
|
<B24Sidebar>
|
|
@@ -20,7 +20,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.sidebar
|
|
|
20
20
|
<template>
|
|
21
21
|
<Primitive
|
|
22
22
|
:as="as"
|
|
23
|
-
:class="b24ui.root({ class: [props.
|
|
23
|
+
:class="b24ui.root({ class: [props.b24ui?.root, props.class] })"
|
|
24
24
|
data-slot="section"
|
|
25
25
|
>
|
|
26
26
|
<slot />
|
|
@@ -18,7 +18,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.sidebar
|
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
20
|
<template>
|
|
21
|
-
<Primitive :as="as" aria-hidden="true" :class="b24ui.root({ class: [props.
|
|
21
|
+
<Primitive :as="as" aria-hidden="true" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
22
22
|
<slot />
|
|
23
23
|
</Primitive>
|
|
24
24
|
</template>
|
|
@@ -31,7 +31,7 @@ const props = defineProps({
|
|
|
31
31
|
defaultOpen: { type: Boolean, required: false },
|
|
32
32
|
modal: { type: Boolean, required: false, default: true }
|
|
33
33
|
});
|
|
34
|
-
const emits = defineEmits(["after:leave", "close:prevent", "update:open"]);
|
|
34
|
+
const emits = defineEmits(["after:leave", "after:enter", "close:prevent", "update:open"]);
|
|
35
35
|
const slots = defineSlots();
|
|
36
36
|
const { t } = useLocale();
|
|
37
37
|
const appConfig = useAppConfig();
|
|
@@ -43,14 +43,14 @@ const contentEvents = computed(() => {
|
|
|
43
43
|
closeAutoFocus: (e) => e.preventDefault()
|
|
44
44
|
};
|
|
45
45
|
if (!props.dismissible) {
|
|
46
|
-
const events = ["pointerDownOutside", "interactOutside", "escapeKeyDown"
|
|
46
|
+
const events = ["pointerDownOutside", "interactOutside", "escapeKeyDown"];
|
|
47
47
|
return events.reduce((acc, curr) => {
|
|
48
48
|
acc[curr] = (e) => {
|
|
49
49
|
e.preventDefault();
|
|
50
50
|
emits("close:prevent");
|
|
51
51
|
};
|
|
52
52
|
return acc;
|
|
53
|
-
},
|
|
53
|
+
}, defaultEvents);
|
|
54
54
|
}
|
|
55
55
|
return defaultEvents;
|
|
56
56
|
});
|
|
@@ -62,7 +62,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.slideov
|
|
|
62
62
|
</script>
|
|
63
63
|
|
|
64
64
|
<template>
|
|
65
|
-
<DialogRoot v-slot="{ open }" v-bind="rootProps">
|
|
65
|
+
<DialogRoot v-slot="{ open, close }" v-bind="rootProps">
|
|
66
66
|
<DialogTrigger v-if="!!slots.default" as-child :class="props.class">
|
|
67
67
|
<slot :open="open" />
|
|
68
68
|
</DialogTrigger>
|
|
@@ -70,7 +70,14 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.slideov
|
|
|
70
70
|
<DialogPortal v-bind="portalProps">
|
|
71
71
|
<DialogOverlay v-if="overlay" :class="b24ui.overlay({ class: props.b24ui?.overlay })" />
|
|
72
72
|
|
|
73
|
-
<DialogContent
|
|
73
|
+
<DialogContent
|
|
74
|
+
:data-side="side"
|
|
75
|
+
:class="b24ui.content({ class: [!slots.default && props.class, props.b24ui?.content] })"
|
|
76
|
+
v-bind="contentProps"
|
|
77
|
+
@after-enter="emits('after:enter')"
|
|
78
|
+
@after-leave="emits('after:leave')"
|
|
79
|
+
v-on="contentEvents"
|
|
80
|
+
>
|
|
74
81
|
<VisuallyHidden v-if="!!slots.content && (title || !!slots.title || (description || !!slots.description))">
|
|
75
82
|
<DialogTitle v-if="title || !!slots.title">
|
|
76
83
|
<slot name="title">
|
|
@@ -85,9 +92,9 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.slideov
|
|
|
85
92
|
</DialogDescription>
|
|
86
93
|
</VisuallyHidden>
|
|
87
94
|
|
|
88
|
-
<slot name="content">
|
|
89
|
-
<div v-if="!!slots.header || (title || !!slots.title) || (description || !!slots.description) || (close || !!slots.close)" :class="b24ui.header({ class: props.b24ui?.header })">
|
|
90
|
-
<slot name="header">
|
|
95
|
+
<slot name="content" :close="close">
|
|
96
|
+
<div v-if="!!slots.header || (title || !!slots.title) || (description || !!slots.description) || (props.close || !!slots.close)" :class="b24ui.header({ class: props.b24ui?.header })">
|
|
97
|
+
<slot name="header" :close="close">
|
|
91
98
|
<div :class="b24ui.wrapper({ class: props.b24ui?.wrapper })">
|
|
92
99
|
<DialogTitle v-if="title || !!slots.title" :class="b24ui.title({ class: props.b24ui?.title })">
|
|
93
100
|
<slot name="title">
|
|
@@ -102,19 +109,20 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.slideov
|
|
|
102
109
|
</DialogDescription>
|
|
103
110
|
</div>
|
|
104
111
|
|
|
105
|
-
<
|
|
106
|
-
|
|
112
|
+
<slot name="actions" />
|
|
113
|
+
|
|
114
|
+
<DialogClose v-if="props.close || !!slots.close" as-child>
|
|
115
|
+
<slot name="close" :close="close" :b24ui="b24ui">
|
|
107
116
|
<B24Button
|
|
108
|
-
v-if="close"
|
|
117
|
+
v-if="props.close"
|
|
109
118
|
:icon="closeIcon || icons.close"
|
|
110
|
-
size="md"
|
|
111
119
|
class="group"
|
|
112
120
|
:color="['left', 'right'].includes(props?.side) ? 'primary' : 'link'"
|
|
113
121
|
:aria-label="t('slideover.close')"
|
|
114
122
|
:b24ui="{
|
|
115
123
|
leadingIcon: ['left', 'right'].includes(props?.side) ? 'group-hover:rounded-full group-hover:border-1 group-hover:border-current' : ''
|
|
116
124
|
}"
|
|
117
|
-
v-bind="typeof close === 'object' ? close : {}"
|
|
125
|
+
v-bind="typeof props.close === 'object' ? props.close : {}"
|
|
118
126
|
:class="b24ui.close({ class: props.b24ui?.close })"
|
|
119
127
|
/>
|
|
120
128
|
</slot>
|
|
@@ -123,11 +131,11 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.slideov
|
|
|
123
131
|
</div>
|
|
124
132
|
|
|
125
133
|
<div :class="b24ui.body({ class: props.b24ui?.body, scrollbarThin: Boolean(props.scrollbarThin) })">
|
|
126
|
-
<slot name="body" />
|
|
134
|
+
<slot name="body" :close="close" />
|
|
127
135
|
</div>
|
|
128
136
|
|
|
129
137
|
<div v-if="!!slots.footer" :class="b24ui.footer({ class: props.b24ui?.footer })">
|
|
130
|
-
<slot name="footer" />
|
|
138
|
+
<slot name="footer" :close="close" />
|
|
131
139
|
</div>
|
|
132
140
|
</slot>
|
|
133
141
|
</DialogContent>
|
|
@@ -64,40 +64,53 @@ export interface SlideoverProps extends DialogRootProps {
|
|
|
64
64
|
}
|
|
65
65
|
export interface SlideoverEmits extends DialogRootEmits {
|
|
66
66
|
'after:leave': [];
|
|
67
|
+
'after:enter': [];
|
|
67
68
|
'close:prevent': [];
|
|
68
69
|
}
|
|
69
70
|
export interface SlideoverSlots {
|
|
70
71
|
default(props: {
|
|
71
72
|
open: boolean;
|
|
72
73
|
}): any;
|
|
73
|
-
content(props
|
|
74
|
-
|
|
74
|
+
content(props: {
|
|
75
|
+
close: () => void;
|
|
76
|
+
}): any;
|
|
77
|
+
header(props: {
|
|
78
|
+
close: () => void;
|
|
79
|
+
}): any;
|
|
75
80
|
title(props?: {}): any;
|
|
76
81
|
description(props?: {}): any;
|
|
82
|
+
actions(props?: {}): any;
|
|
77
83
|
close(props: {
|
|
84
|
+
close: () => void;
|
|
78
85
|
b24ui: {
|
|
79
86
|
[K in keyof Required<Slideover['slots']>]: (props?: Record<string, any>) => string;
|
|
80
87
|
};
|
|
81
88
|
}): any;
|
|
82
|
-
body(props
|
|
83
|
-
|
|
89
|
+
body(props: {
|
|
90
|
+
close: () => void;
|
|
91
|
+
}): any;
|
|
92
|
+
footer(props: {
|
|
93
|
+
close: () => void;
|
|
94
|
+
}): any;
|
|
84
95
|
}
|
|
85
96
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SlideoverProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
86
97
|
"update:open": (value: boolean) => any;
|
|
87
98
|
"after:leave": () => any;
|
|
99
|
+
"after:enter": () => any;
|
|
88
100
|
"close:prevent": () => any;
|
|
89
101
|
}, string, import("vue").PublicProps, Readonly<SlideoverProps> & Readonly<{
|
|
90
102
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
91
103
|
"onAfter:leave"?: (() => any) | undefined;
|
|
104
|
+
"onAfter:enter"?: (() => any) | undefined;
|
|
92
105
|
"onClose:prevent"?: (() => any) | undefined;
|
|
93
106
|
}>, {
|
|
94
107
|
close: boolean | Partial<ButtonProps>;
|
|
95
108
|
modal: boolean;
|
|
96
|
-
transition: boolean;
|
|
97
109
|
portal: boolean | string | HTMLElement;
|
|
98
110
|
overlay: boolean;
|
|
99
111
|
side: Slideover["variants"]["side"];
|
|
100
112
|
overlayBlur: Slideover["variants"]["overlayBlur"];
|
|
113
|
+
transition: boolean;
|
|
101
114
|
dismissible: boolean;
|
|
102
115
|
scrollbarThin: boolean;
|
|
103
116
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SlideoverSlots>;
|
|
@@ -48,7 +48,7 @@ const handleNavigationClick = () => {
|
|
|
48
48
|
</script>
|
|
49
49
|
|
|
50
50
|
<template>
|
|
51
|
-
<Primitive :as="as" :class="b24ui.root({ class: [props.
|
|
51
|
+
<Primitive :as="as" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
52
52
|
<header :class="b24ui.header({ class: props.b24ui?.header })">
|
|
53
53
|
<div
|
|
54
54
|
v-if="isUseSideBar"
|