@bitrix24/b24ui-nuxt 2.1.2 → 2.1.3
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/cli/templates.mjs +2 -2
- package/dist/meta.d.mts +1301 -178
- package/dist/meta.mjs +1301 -178
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/Accordion.vue +9 -4
- package/dist/runtime/components/Advice.vue +9 -5
- package/dist/runtime/components/Alert.vue +9 -7
- package/dist/runtime/components/Avatar.vue +4 -2
- package/dist/runtime/components/AvatarGroup.vue +3 -3
- package/dist/runtime/components/Badge.vue +6 -1
- package/dist/runtime/components/Banner.vue +9 -8
- package/dist/runtime/components/Breadcrumb.vue +9 -4
- package/dist/runtime/components/Button.vue +12 -9
- package/dist/runtime/components/Calendar.vue +11 -5
- package/dist/runtime/components/Card.vue +4 -4
- package/dist/runtime/components/ChatMessage.vue +7 -5
- package/dist/runtime/components/ChatMessages.vue +4 -2
- package/dist/runtime/components/ChatPalette.vue +3 -3
- package/dist/runtime/components/ChatPrompt.vue +4 -3
- package/dist/runtime/components/ChatPromptSubmit.vue +1 -0
- package/dist/runtime/components/Checkbox.vue +9 -7
- package/dist/runtime/components/CheckboxGroup.vue +4 -2
- package/dist/runtime/components/Chip.vue +3 -0
- package/dist/runtime/components/Collapsible.vue +2 -2
- package/dist/runtime/components/ColorPicker.vue +7 -3
- package/dist/runtime/components/CommandPalette.vue +60 -21
- package/dist/runtime/components/ContextMenu.vue +1 -0
- package/dist/runtime/components/ContextMenuContent.vue +19 -6
- package/dist/runtime/components/Countdown.vue +8 -1
- package/dist/runtime/components/DashboardSearch.vue +1 -0
- package/dist/runtime/components/DashboardSearchButton.vue +2 -1
- package/dist/runtime/components/DescriptionList.vue +12 -4
- package/dist/runtime/components/DropdownMenu.vue +2 -1
- package/dist/runtime/components/DropdownMenuContent.vue +21 -7
- package/dist/runtime/components/Empty.vue +9 -8
- package/dist/runtime/components/Error.vue +5 -5
- package/dist/runtime/components/FileUpload.vue +15 -8
- package/dist/runtime/components/FormField.vue +11 -11
- package/dist/runtime/components/Input.vue +8 -3
- package/dist/runtime/components/InputDate.vue +9 -2
- package/dist/runtime/components/InputMenu.vue +35 -19
- package/dist/runtime/components/InputNumber.vue +5 -2
- package/dist/runtime/components/InputTags.vue +12 -3
- package/dist/runtime/components/InputTime.vue +8 -2
- package/dist/runtime/components/Kbd.vue +1 -1
- package/dist/runtime/components/Modal.vue +11 -8
- package/dist/runtime/components/Navbar.vue +1 -1
- package/dist/runtime/components/NavbarDivider.vue +1 -1
- package/dist/runtime/components/NavbarSection.vue +2 -1
- package/dist/runtime/components/NavbarSpacer.vue +1 -1
- package/dist/runtime/components/NavigationMenu.vue +43 -12
- package/dist/runtime/components/PageCard.vue +10 -9
- package/dist/runtime/components/PageLinks.vue +9 -7
- package/dist/runtime/components/Pagination.vue +8 -8
- package/dist/runtime/components/PinInput.vue +2 -0
- package/dist/runtime/components/Popover.vue +2 -2
- package/dist/runtime/components/Progress.vue +6 -6
- package/dist/runtime/components/RadioGroup.d.vue.ts +2 -2
- package/dist/runtime/components/RadioGroup.vue +10 -4
- package/dist/runtime/components/RadioGroup.vue.d.ts +2 -2
- package/dist/runtime/components/Range.vue +5 -4
- package/dist/runtime/components/Select.vue +25 -11
- package/dist/runtime/components/SelectMenu.vue +33 -14
- package/dist/runtime/components/Separator.vue +7 -7
- 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 +18 -13
- package/dist/runtime/components/SidebarSection.vue +2 -1
- package/dist/runtime/components/SidebarSpacer.vue +1 -1
- package/dist/runtime/components/Skeleton.vue +1 -0
- package/dist/runtime/components/Slideover.vue +10 -7
- package/dist/runtime/components/Stepper.vue +12 -9
- package/dist/runtime/components/Switch.vue +10 -6
- package/dist/runtime/components/Table.vue +18 -13
- package/dist/runtime/components/TableWrapper.vue +1 -0
- package/dist/runtime/components/Tabs.d.vue.ts +3 -3
- package/dist/runtime/components/Tabs.vue +24 -15
- package/dist/runtime/components/Tabs.vue.d.ts +3 -3
- package/dist/runtime/components/Textarea.vue +8 -3
- package/dist/runtime/components/Timeline.vue +9 -6
- package/dist/runtime/components/Toast.vue +10 -6
- package/dist/runtime/components/Toaster.vue +2 -0
- package/dist/runtime/components/Tooltip.vue +4 -4
- package/dist/runtime/components/User.vue +13 -6
- package/dist/runtime/components/content/ContentSearch.vue +59 -68
- package/dist/runtime/components/content/ContentSearchButton.vue +2 -1
- package/dist/runtime/components/content/ContentSurround.vue +6 -4
- package/dist/runtime/components/content/ContentToc.vue +13 -10
- package/dist/runtime/components/prose/A.vue +1 -1
- package/dist/runtime/components/prose/Blockquote.vue +1 -1
- package/dist/runtime/components/prose/Callout.vue +4 -1
- package/dist/runtime/components/prose/Card.vue +5 -3
- package/dist/runtime/components/prose/Code.vue +1 -0
- package/dist/runtime/components/prose/CodeCollapse.vue +3 -2
- package/dist/runtime/components/prose/CodeGroup.vue +6 -6
- package/dist/runtime/components/prose/CodePreview.vue +3 -3
- package/dist/runtime/components/prose/Collapsible.vue +3 -2
- package/dist/runtime/components/prose/Em.vue +1 -1
- package/dist/runtime/components/prose/Field.vue +7 -7
- package/dist/runtime/components/prose/H1.vue +1 -0
- package/dist/runtime/components/prose/H2.vue +4 -2
- package/dist/runtime/components/prose/H3.vue +4 -2
- package/dist/runtime/components/prose/H4.vue +4 -2
- package/dist/runtime/components/prose/H5.vue +1 -0
- package/dist/runtime/components/prose/H6.vue +1 -0
- package/dist/runtime/components/prose/Hr.vue +1 -1
- package/dist/runtime/components/prose/Img.vue +4 -0
- package/dist/runtime/components/prose/Li.vue +1 -1
- package/dist/runtime/components/prose/Ol.vue +1 -1
- package/dist/runtime/components/prose/P.vue +1 -1
- package/dist/runtime/components/prose/Pre.vue +6 -5
- package/dist/runtime/components/prose/Strong.vue +1 -1
- package/dist/runtime/components/prose/Table.d.vue.ts +0 -3
- package/dist/runtime/components/prose/Table.vue +2 -1
- package/dist/runtime/components/prose/Table.vue.d.ts +0 -3
- package/dist/runtime/components/prose/Tbody.vue +1 -1
- package/dist/runtime/components/prose/Td.vue +1 -1
- package/dist/runtime/components/prose/Th.vue +1 -1
- package/dist/runtime/components/prose/Thead.vue +1 -1
- package/dist/runtime/components/prose/Tr.vue +1 -1
- package/dist/runtime/components/prose/Ul.vue +1 -1
- package/dist/runtime/composables/useContentSearch.d.ts +5 -0
- package/dist/runtime/composables/useContentSearch.js +30 -1
- package/dist/runtime/inertia/stubs.js +1 -1
- package/dist/runtime/types/index.d.ts +3 -0
- package/dist/runtime/types/index.js +3 -0
- package/dist/shared/{b24ui-nuxt.B9uYyQGR.mjs → b24ui-nuxt.mq1NUekN.mjs} +3 -3
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +11 -11
|
@@ -57,8 +57,8 @@ defineExpose({
|
|
|
57
57
|
</script>
|
|
58
58
|
|
|
59
59
|
<template>
|
|
60
|
-
<Primitive :as="as" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })" @submit.prevent="submit">
|
|
61
|
-
<div v-if="!!slots.header" :class="b24ui.header({ class: props.b24ui?.header })">
|
|
60
|
+
<Primitive :as="as" data-slot="root" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })" @submit.prevent="submit">
|
|
61
|
+
<div v-if="!!slots.header" data-slot="header" :class="b24ui.header({ class: props.b24ui?.header })">
|
|
62
62
|
<slot name="header" />
|
|
63
63
|
</div>
|
|
64
64
|
|
|
@@ -70,6 +70,7 @@ defineExpose({
|
|
|
70
70
|
no-border
|
|
71
71
|
v-bind="{ ...textareaProps, ...$attrs }"
|
|
72
72
|
:b24ui="transformUI(omit(b24ui, ['root', 'body', 'header', 'footer']), props.b24ui)"
|
|
73
|
+
data-slot="body"
|
|
73
74
|
:class="b24ui.body({ class: props.b24ui?.body })"
|
|
74
75
|
@keydown.enter.exact.prevent="submit"
|
|
75
76
|
@keydown.esc="blur"
|
|
@@ -79,7 +80,7 @@ defineExpose({
|
|
|
79
80
|
</template>
|
|
80
81
|
</B24Textarea>
|
|
81
82
|
|
|
82
|
-
<div :class="b24ui.footer({ class: props.b24ui?.footer })">
|
|
83
|
+
<div data-slot="footer" :class="b24ui.footer({ class: props.b24ui?.footer })">
|
|
83
84
|
<slot name="footer" />
|
|
84
85
|
<slot name="default" :b24ui="transformUI(omit(b24ui, ['root', 'body', 'header', 'footer']), props.b24ui)" />
|
|
85
86
|
</div>
|
|
@@ -112,6 +112,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.chatPro
|
|
|
112
112
|
...$attrs
|
|
113
113
|
}"
|
|
114
114
|
:aria-label="t('chatPromptSubmit.label')"
|
|
115
|
+
data-slot="base"
|
|
115
116
|
:class="b24ui.base({ class: [props.b24ui?.base, props.class] })"
|
|
116
117
|
:b24ui="transformUI(b24ui, props.b24ui)"
|
|
117
118
|
>
|
|
@@ -53,38 +53,40 @@ function onUpdate(value) {
|
|
|
53
53
|
</script>
|
|
54
54
|
|
|
55
55
|
<template>
|
|
56
|
-
<Primitive :as="!variant || variant === 'list' ? as : Label" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
57
|
-
<div :class="b24ui.container({ class: props.b24ui?.container })">
|
|
56
|
+
<Primitive :as="!variant || variant === 'list' ? as : Label" data-slot="root" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
57
|
+
<div data-slot="container" :class="b24ui.container({ class: props.b24ui?.container })">
|
|
58
58
|
<CheckboxRoot
|
|
59
59
|
:id="id"
|
|
60
60
|
v-bind="{ ...rootProps, ...$attrs, ...ariaAttrs }"
|
|
61
61
|
v-model="modelValue"
|
|
62
62
|
:name="name"
|
|
63
63
|
:disabled="disabled"
|
|
64
|
+
data-slot="base"
|
|
64
65
|
:class="b24ui.base({ class: props.b24ui?.base })"
|
|
65
66
|
@update:model-value="onUpdate"
|
|
66
67
|
>
|
|
67
68
|
<template #default="{ modelValue }">
|
|
68
|
-
<CheckboxIndicator :class="b24ui.indicator({ class: props.b24ui?.indicator })">
|
|
69
|
-
<Minus20Icon v-if="modelValue === 'indeterminate'" :class="b24ui.icon({ class: props.b24ui?.icon })" />
|
|
70
|
-
<CheckIcon v-else :class="b24ui.icon({ class: props.b24ui?.icon })" />
|
|
69
|
+
<CheckboxIndicator data-slot="indicator" :class="b24ui.indicator({ class: props.b24ui?.indicator })">
|
|
70
|
+
<Minus20Icon v-if="modelValue === 'indeterminate'" data-slot="icon" :class="b24ui.icon({ class: props.b24ui?.icon })" />
|
|
71
|
+
<CheckIcon v-else data-slot="icon" :class="b24ui.icon({ class: props.b24ui?.icon })" />
|
|
71
72
|
</CheckboxIndicator>
|
|
72
73
|
</template>
|
|
73
74
|
</CheckboxRoot>
|
|
74
75
|
</div>
|
|
75
76
|
|
|
76
|
-
<div v-if="label || !!slots.label || (description || !!slots.description)" :class="b24ui.wrapper({ class: props.b24ui?.wrapper })">
|
|
77
|
+
<div v-if="label || !!slots.label || (description || !!slots.description)" data-slot="wrapper" :class="b24ui.wrapper({ class: props.b24ui?.wrapper })">
|
|
77
78
|
<component
|
|
78
79
|
:is="!variant || variant === 'list' ? Label : 'p'"
|
|
79
80
|
v-if="label || !!slots.label"
|
|
80
81
|
:for="id"
|
|
82
|
+
data-slot="label"
|
|
81
83
|
:class="b24ui.label({ class: props.b24ui?.label })"
|
|
82
84
|
>
|
|
83
85
|
<slot name="label" :label="label">
|
|
84
86
|
{{ label }}
|
|
85
87
|
</slot>
|
|
86
88
|
</component>
|
|
87
|
-
<p v-if="description || !!slots.description" :class="b24ui.description({ class: props.b24ui?.description })">
|
|
89
|
+
<p v-if="description || !!slots.description" data-slot="description" :class="b24ui.description({ class: props.b24ui?.description })">
|
|
88
90
|
<slot name="description" :description="description">
|
|
89
91
|
{{ description }}
|
|
90
92
|
</slot>
|
|
@@ -93,11 +93,12 @@ function onUpdate(value) {
|
|
|
93
93
|
v-bind="rootProps"
|
|
94
94
|
:name="name"
|
|
95
95
|
:disabled="disabled"
|
|
96
|
+
data-slot="root"
|
|
96
97
|
:class="b24ui.root({ class: [props.b24ui?.root, props.class] })"
|
|
97
98
|
@update:model-value="onUpdate"
|
|
98
99
|
>
|
|
99
|
-
<fieldset :class="b24ui.fieldset({ class: props.b24ui?.fieldset })" v-bind="ariaAttrs">
|
|
100
|
-
<legend v-if="legend || !!slots.legend" :class="b24ui.legend({ class: props.b24ui?.legend })">
|
|
100
|
+
<fieldset data-slot="fieldset" :class="b24ui.fieldset({ class: props.b24ui?.fieldset })" v-bind="ariaAttrs">
|
|
101
|
+
<legend v-if="legend || !!slots.legend" data-slot="legend" :class="b24ui.legend({ class: props.b24ui?.legend })">
|
|
101
102
|
<slot name="legend">
|
|
102
103
|
{{ legend }}
|
|
103
104
|
</slot>
|
|
@@ -111,6 +112,7 @@ function onUpdate(value) {
|
|
|
111
112
|
:name="name"
|
|
112
113
|
:disabled="item.disabled || disabled"
|
|
113
114
|
:b24ui="{ ...props.b24ui ? omit(props.b24ui, ['root']) : void 0, ...item.b24ui || {} }"
|
|
115
|
+
data-slot="item"
|
|
114
116
|
:class="b24ui.item({ class: [props.b24ui?.item, item.b24ui?.item, item.class] })"
|
|
115
117
|
>
|
|
116
118
|
<template v-for="(_, name) in getProxySlots()" #[name]>
|
|
@@ -44,6 +44,7 @@ const value = computed(() => {
|
|
|
44
44
|
<template>
|
|
45
45
|
<Primitive
|
|
46
46
|
:as="as"
|
|
47
|
+
data-slot="root"
|
|
47
48
|
:class="b24ui.root({ class: [props.b24ui?.root, props.class] })"
|
|
48
49
|
>
|
|
49
50
|
<Slot v-bind="$attrs">
|
|
@@ -52,6 +53,7 @@ const value = computed(() => {
|
|
|
52
53
|
|
|
53
54
|
<span
|
|
54
55
|
v-if="show"
|
|
56
|
+
data-slot="base"
|
|
55
57
|
:class="b24ui.base({ class: props.b24ui?.base })"
|
|
56
58
|
:data-value="value"
|
|
57
59
|
>
|
|
@@ -61,6 +63,7 @@ const value = computed(() => {
|
|
|
61
63
|
<slot name="trailing">
|
|
62
64
|
<Component
|
|
63
65
|
:is="trailingIcon"
|
|
66
|
+
data-slot="trailingIcon"
|
|
64
67
|
:class="b24ui.trailingIcon({ class: props.b24ui?.trailingIcon })"
|
|
65
68
|
/>
|
|
66
69
|
</slot>
|
|
@@ -25,12 +25,12 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.collaps
|
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
27
|
<template>
|
|
28
|
-
<CollapsibleRoot v-slot="{ open }" v-bind="rootProps" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
28
|
+
<CollapsibleRoot v-slot="{ open }" v-bind="rootProps" data-slot="root" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
29
29
|
<CollapsibleTrigger v-if="!!slots.default" as-child>
|
|
30
30
|
<slot :open="open" />
|
|
31
31
|
</CollapsibleTrigger>
|
|
32
32
|
|
|
33
|
-
<CollapsibleContent :class="b24ui.content({ class: props.b24ui?.content })">
|
|
33
|
+
<CollapsibleContent data-slot="content" :class="b24ui.content({ class: props.b24ui?.content })">
|
|
34
34
|
<slot name="content" />
|
|
35
35
|
</CollapsibleContent>
|
|
36
36
|
</CollapsibleRoot>
|
|
@@ -178,16 +178,18 @@ const trackThumbStyle = computed(() => ({
|
|
|
178
178
|
</script>
|
|
179
179
|
|
|
180
180
|
<template>
|
|
181
|
-
<Primitive :as="as" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })" :data-disabled="disabled ? true : void 0">
|
|
182
|
-
<div :class="b24ui.picker({ class: props.b24ui?.picker })">
|
|
181
|
+
<Primitive :as="as" data-slot="root" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })" :data-disabled="disabled ? true : void 0">
|
|
182
|
+
<div data-slot="picker" :class="b24ui.picker({ class: props.b24ui?.picker })">
|
|
183
183
|
<div
|
|
184
184
|
ref="selectorRef"
|
|
185
|
+
data-slot="selector"
|
|
185
186
|
:class="b24ui.selector({ class: props.b24ui?.selector })"
|
|
186
187
|
:style="selectorStyle"
|
|
187
188
|
>
|
|
188
|
-
<div :class="b24ui.selectorBackground({ class: props.b24ui?.selectorBackground })" data-color-picker-background>
|
|
189
|
+
<div data-slot="selectorBackground" :class="b24ui.selectorBackground({ class: props.b24ui?.selectorBackground })" data-color-picker-background>
|
|
189
190
|
<div
|
|
190
191
|
ref="selectorThumbRef"
|
|
192
|
+
data-slot="selectorThumb"
|
|
191
193
|
:class="b24ui.selectorThumb({ class: props.b24ui?.selectorThumb })"
|
|
192
194
|
:style="selectorThumbStyle"
|
|
193
195
|
:data-disabled="disabled ? true : void 0"
|
|
@@ -196,11 +198,13 @@ const trackThumbStyle = computed(() => ({
|
|
|
196
198
|
</div>
|
|
197
199
|
<div
|
|
198
200
|
ref="trackRef"
|
|
201
|
+
data-slot="track"
|
|
199
202
|
:class="b24ui.track({ class: props.b24ui?.track })"
|
|
200
203
|
data-color-picker-track
|
|
201
204
|
>
|
|
202
205
|
<div
|
|
203
206
|
ref="trackThumbRef"
|
|
207
|
+
data-slot="trackThumb"
|
|
204
208
|
:class="b24ui.trackThumb({ class: props.b24ui?.trackThumb })"
|
|
205
209
|
:style="trackThumbStyle"
|
|
206
210
|
:data-disabled="disabled ? true : void 0"
|
|
@@ -6,7 +6,7 @@ import theme from "#build/b24ui/command-palette";
|
|
|
6
6
|
import { computed, ref, useTemplateRef, toRef } from "vue";
|
|
7
7
|
import { ListboxRoot, ListboxFilter, ListboxContent, ListboxGroup, ListboxGroupLabel, ListboxVirtualizer, ListboxItem, ListboxItemIndicator, useForwardProps, useForwardPropsEmits } from "reka-ui";
|
|
8
8
|
import { defu } from "defu";
|
|
9
|
-
import { reactivePick, createReusableTemplate } from "@vueuse/core";
|
|
9
|
+
import { reactivePick, createReusableTemplate, refThrottled } from "@vueuse/core";
|
|
10
10
|
import { useFuse } from "@vueuse/integrations/useFuse";
|
|
11
11
|
import { useAppConfig } from "#imports";
|
|
12
12
|
import { useLocale } from "../composables/useLocale";
|
|
@@ -101,13 +101,15 @@ const items = computed(() => groups.value?.filter((group) => {
|
|
|
101
101
|
return true;
|
|
102
102
|
})?.flatMap((group) => group.items?.map((item) => ({ ...item, group: group.id })) || []) || []);
|
|
103
103
|
const { results: fuseResults } = useFuse(searchTerm, items, fuse);
|
|
104
|
-
|
|
104
|
+
const throttledFuseResults = refThrottled(fuseResults, 16, true);
|
|
105
|
+
function processGroupItems(group, items2) {
|
|
106
|
+
let processedItems = items2;
|
|
105
107
|
if (group?.postFilter && typeof group.postFilter === "function") {
|
|
106
|
-
|
|
108
|
+
processedItems = group.postFilter(searchTerm.value, processedItems);
|
|
107
109
|
}
|
|
108
110
|
return {
|
|
109
111
|
...group,
|
|
110
|
-
items:
|
|
112
|
+
items: processedItems.slice(0, fuse.value.resultLimit).map((item) => {
|
|
111
113
|
return {
|
|
112
114
|
...item,
|
|
113
115
|
labelHtml: highlight(item, searchTerm.value, props.labelKey),
|
|
@@ -117,7 +119,8 @@ function getGroupWithItems(group, items2) {
|
|
|
117
119
|
};
|
|
118
120
|
}
|
|
119
121
|
const filteredGroups = computed(() => {
|
|
120
|
-
const
|
|
122
|
+
const currentGroups = groups.value;
|
|
123
|
+
const groupsById = throttledFuseResults.value.reduce((acc, result) => {
|
|
121
124
|
const { item, matches } = result;
|
|
122
125
|
if (!item.group) {
|
|
123
126
|
return acc;
|
|
@@ -128,25 +131,33 @@ const filteredGroups = computed(() => {
|
|
|
128
131
|
}, {});
|
|
129
132
|
if (props.preserveGroupOrder) {
|
|
130
133
|
const processedGroups = [];
|
|
131
|
-
for (const group of
|
|
134
|
+
for (const group of currentGroups || []) {
|
|
132
135
|
if (!group.items?.length) {
|
|
133
136
|
continue;
|
|
134
137
|
}
|
|
135
138
|
const items2 = group.ignoreFilter ? group.items : groupsById[group.id];
|
|
136
|
-
if (items2?.length) {
|
|
137
|
-
|
|
139
|
+
if (!items2?.length) {
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
const processedGroup = processGroupItems(group, items2);
|
|
143
|
+
if (processedGroup.items?.length) {
|
|
144
|
+
processedGroups.push(processedGroup);
|
|
138
145
|
}
|
|
139
146
|
}
|
|
140
147
|
return processedGroups;
|
|
141
148
|
}
|
|
142
149
|
const fuseGroups = Object.entries(groupsById).map(([id, items2]) => {
|
|
143
|
-
const group =
|
|
150
|
+
const group = currentGroups?.find((group2) => group2.id === id);
|
|
144
151
|
if (!group) {
|
|
145
152
|
return;
|
|
146
153
|
}
|
|
147
|
-
|
|
154
|
+
const processedGroup = processGroupItems(group, items2);
|
|
155
|
+
return processedGroup.items?.length ? processedGroup : void 0;
|
|
148
156
|
}).filter((group) => !!group);
|
|
149
|
-
const nonFuseGroups =
|
|
157
|
+
const nonFuseGroups = currentGroups?.map((group, index) => ({ ...group, index }))?.filter((group) => group.ignoreFilter && group.items?.length)?.map((group) => {
|
|
158
|
+
const processedGroup = processGroupItems(group, group.items || []);
|
|
159
|
+
return { ...processedGroup, index: group.index };
|
|
160
|
+
})?.filter((group) => group.items?.length) || [];
|
|
150
161
|
return nonFuseGroups.reduce((acc, group) => {
|
|
151
162
|
acc.splice(group.index, 0, group);
|
|
152
163
|
return acc;
|
|
@@ -202,6 +213,7 @@ function onSelect(e, item) {
|
|
|
202
213
|
<B24Link v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
|
|
203
214
|
<B24LinkBase
|
|
204
215
|
v-bind="slotProps"
|
|
216
|
+
data-slot="item"
|
|
205
217
|
:class="b24ui.item({ class: [props.b24ui?.item, item.b24ui?.item, item.class], active: active || item.active })"
|
|
206
218
|
>
|
|
207
219
|
<slot
|
|
@@ -219,17 +231,20 @@ function onSelect(e, item) {
|
|
|
219
231
|
<Component
|
|
220
232
|
:is="icons.loading"
|
|
221
233
|
v-if="item.loading"
|
|
234
|
+
data-slot="itemLeadingIcon"
|
|
222
235
|
:class="b24ui.itemLeadingIcon({ class: [props.b24ui?.itemLeadingIcon, item.b24ui?.itemLeadingIcon], loading: true })"
|
|
223
236
|
/>
|
|
224
237
|
<Component
|
|
225
238
|
:is="item.icon"
|
|
226
239
|
v-else-if="item.icon"
|
|
240
|
+
data-slot="itemLeadingIcon"
|
|
227
241
|
:class="b24ui.itemLeadingIcon({ class: [props.b24ui?.itemLeadingIcon, item.b24ui?.itemLeadingIcon], active: active || item.active })"
|
|
228
242
|
/>
|
|
229
243
|
<B24Avatar
|
|
230
244
|
v-else-if="item.avatar"
|
|
231
245
|
:size="item.b24ui?.itemLeadingAvatarSize || props.b24ui?.itemLeadingAvatarSize || b24ui.itemLeadingAvatarSize()"
|
|
232
246
|
v-bind="item.avatar"
|
|
247
|
+
data-slot="itemLeadingAvatar"
|
|
233
248
|
:class="b24ui.itemLeadingAvatar({ class: [props.b24ui?.itemLeadingAvatar, item.b24ui?.itemLeadingAvatar], active: active || item.active })"
|
|
234
249
|
/>
|
|
235
250
|
<B24Chip
|
|
@@ -238,15 +253,17 @@ function onSelect(e, item) {
|
|
|
238
253
|
inset
|
|
239
254
|
standalone
|
|
240
255
|
v-bind="item.chip"
|
|
256
|
+
data-slot="itemLeadingChip"
|
|
241
257
|
:class="b24ui.itemLeadingChip({ class: [props.b24ui?.itemLeadingChip, item.b24ui?.itemLeadingChip], active: active || item.active })"
|
|
242
258
|
/>
|
|
243
259
|
</slot>
|
|
244
260
|
|
|
245
261
|
<span
|
|
246
262
|
v-if="item.prefix || (item.labelHtml || get(item, props.labelKey)) || (item.suffixHtml || item.suffix) || !!slots[item.slot ? `${item.slot}-label` : group?.slot ? `${group.slot}-label` : `item-label`] || (get(item, props.descriptionKey) || !!slots[item.slot ? `${item.slot}-description` : group?.slot ? `${group.slot}-description` : `item-description`])"
|
|
263
|
+
data-slot="itemWrapper"
|
|
247
264
|
:class="b24ui.itemWrapper({ class: [props.b24ui?.itemWrapper, item.b24ui?.itemWrapper] })"
|
|
248
265
|
>
|
|
249
|
-
<span :class="b24ui.itemLabel({ class: [props.b24ui?.itemLabel, item.b24ui?.itemLabel], active: active || item.active })">
|
|
266
|
+
<span data-slot="itemLabel" :class="b24ui.itemLabel({ class: [props.b24ui?.itemLabel, item.b24ui?.itemLabel], active: active || item.active })">
|
|
250
267
|
<slot
|
|
251
268
|
:name="item.slot ? `${item.slot}-label` : group?.slot ? `${group.slot}-label` : `item-label`"
|
|
252
269
|
:item="item"
|
|
@@ -255,23 +272,39 @@ function onSelect(e, item) {
|
|
|
255
272
|
>
|
|
256
273
|
<span
|
|
257
274
|
v-if="item.prefix"
|
|
275
|
+
data-slot="itemLabelPrefix"
|
|
258
276
|
:class="b24ui.itemLabelPrefix({ class: [props.b24ui?.itemLabelPrefix, item.b24ui?.itemLabelPrefix] })"
|
|
259
277
|
>{{ item.prefix }}</span>
|
|
260
278
|
|
|
261
279
|
<span
|
|
280
|
+
v-if="item.labelHtml"
|
|
281
|
+
data-slot="itemLabelBase"
|
|
262
282
|
:class="b24ui.itemLabelBase({ class: [props.b24ui?.itemLabelBase, item.b24ui?.itemLabelBase], active: active || item.active })"
|
|
263
283
|
v-html="item.labelHtml || get(item, props.labelKey)"
|
|
264
284
|
/>
|
|
285
|
+
<span
|
|
286
|
+
v-else
|
|
287
|
+
data-slot="itemLabelBase"
|
|
288
|
+
:class="b24ui.itemLabelBase({ class: [props.b24ui?.itemLabelBase, item.b24ui?.itemLabelBase], active: active || item.active })"
|
|
289
|
+
>{{ get(item, props.labelKey) }}</span>
|
|
265
290
|
|
|
266
291
|
<span
|
|
292
|
+
v-if="item.suffixHtml"
|
|
293
|
+
data-slot="itemLabelSuffix"
|
|
267
294
|
:class="b24ui.itemLabelSuffix({ class: [props.b24ui?.itemLabelSuffix, item.b24ui?.itemLabelSuffix], active: active || item.active })"
|
|
268
295
|
v-html="item.suffixHtml || item.suffix"
|
|
269
296
|
/>
|
|
297
|
+
<span
|
|
298
|
+
v-else-if="item.suffix"
|
|
299
|
+
data-slot="itemLabelSuffix"
|
|
300
|
+
:class="b24ui.itemLabelSuffix({ class: [props.b24ui?.itemLabelSuffix, item.b24ui?.itemLabelSuffix], active: active || item.active })"
|
|
301
|
+
>{{ item.suffix }}</span>
|
|
270
302
|
</slot>
|
|
271
303
|
</span>
|
|
272
304
|
|
|
273
305
|
<span
|
|
274
306
|
v-if="get(item, props.descriptionKey)"
|
|
307
|
+
data-slot="itemDescription"
|
|
275
308
|
:class="b24ui.itemDescription({ class: [props.b24ui?.itemDescription, item.b24ui?.itemDescription] })"
|
|
276
309
|
>
|
|
277
310
|
<slot
|
|
@@ -285,7 +318,7 @@ function onSelect(e, item) {
|
|
|
285
318
|
</span>
|
|
286
319
|
</span>
|
|
287
320
|
|
|
288
|
-
<span :class="b24ui.itemTrailing({ class: [props.b24ui?.itemTrailing, item.b24ui?.itemTrailing] })">
|
|
321
|
+
<span data-slot="itemTrailing" :class="b24ui.itemTrailing({ class: [props.b24ui?.itemTrailing, item.b24ui?.itemTrailing] })">
|
|
289
322
|
<slot
|
|
290
323
|
:name="item.slot ? `${item.slot}-trailing` : group?.slot ? `${group.slot}-trailing` : `item-trailing`"
|
|
291
324
|
:item="item"
|
|
@@ -295,10 +328,11 @@ function onSelect(e, item) {
|
|
|
295
328
|
<Component
|
|
296
329
|
:is="childrenIcon || icons.chevronRight"
|
|
297
330
|
v-if="item.children && item.children.length > 0"
|
|
331
|
+
data-slot="itemTrailingIcon"
|
|
298
332
|
:class="b24ui.itemTrailingIcon({ class: [props.b24ui?.itemTrailingIcon, item.b24ui?.itemTrailingIcon] })"
|
|
299
333
|
/>
|
|
300
334
|
|
|
301
|
-
<span v-else-if="item.kbds?.length" :class="b24ui.itemTrailingKbds({ class: [props.b24ui?.itemTrailingKbds, item.b24ui?.itemTrailingKbds] })">
|
|
335
|
+
<span v-else-if="item.kbds?.length" data-slot="itemTrailingKbds" :class="b24ui.itemTrailingKbds({ class: [props.b24ui?.itemTrailingKbds, item.b24ui?.itemTrailingKbds] })">
|
|
302
336
|
<B24Kbd
|
|
303
337
|
v-for="(kbd, kbdIndex) in item.kbds"
|
|
304
338
|
:key="kbdIndex"
|
|
@@ -310,6 +344,7 @@ function onSelect(e, item) {
|
|
|
310
344
|
<Component
|
|
311
345
|
:is="group.highlightedIcon"
|
|
312
346
|
v-else-if="group?.highlightedIcon"
|
|
347
|
+
data-slot="itemTrailingHighlightedIcon"
|
|
313
348
|
:class="b24ui.itemTrailingHighlightedIcon({ class: [props.b24ui?.itemTrailingHighlightedIcon, item.b24ui?.itemTrailingHighlightedIcon] })"
|
|
314
349
|
/>
|
|
315
350
|
</slot>
|
|
@@ -317,6 +352,7 @@ function onSelect(e, item) {
|
|
|
317
352
|
<ListboxItemIndicator v-if="!item.children?.length" as-child>
|
|
318
353
|
<Component
|
|
319
354
|
:is="selectedIcon || icons.check"
|
|
355
|
+
data-slot="itemTrailingIcon"
|
|
320
356
|
:class="b24ui.itemTrailingIcon({ class: [props.b24ui?.itemTrailingIcon, item.b24ui?.itemTrailingIcon] })"
|
|
321
357
|
/>
|
|
322
358
|
</ListboxItemIndicator>
|
|
@@ -327,7 +363,7 @@ function onSelect(e, item) {
|
|
|
327
363
|
</ListboxItem>
|
|
328
364
|
</DefineItemTemplate>
|
|
329
365
|
|
|
330
|
-
<ListboxRoot v-bind="{ ...rootProps, ...$attrs }" ref="rootRef" :selection-behavior="selectionBehavior" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
366
|
+
<ListboxRoot v-bind="{ ...rootProps, ...$attrs }" ref="rootRef" :selection-behavior="selectionBehavior" data-slot="root" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
331
367
|
<ListboxFilter v-model="searchTerm" as-child>
|
|
332
368
|
<B24Input
|
|
333
369
|
:placeholder="placeholder"
|
|
@@ -338,6 +374,7 @@ function onSelect(e, item) {
|
|
|
338
374
|
size="xl"
|
|
339
375
|
:trailing-icon="trailingIcon"
|
|
340
376
|
:icon="icon || icons.search"
|
|
377
|
+
data-slot="input"
|
|
341
378
|
:class="b24ui.input({ class: props.b24ui?.input })"
|
|
342
379
|
@keydown.backspace="onBackspace"
|
|
343
380
|
>
|
|
@@ -349,6 +386,7 @@ function onSelect(e, item) {
|
|
|
349
386
|
color="air-selection"
|
|
350
387
|
:aria-label="t('commandPalette.back')"
|
|
351
388
|
v-bind="typeof back === 'object' ? back : {}"
|
|
389
|
+
data-slot="back"
|
|
352
390
|
:class="b24ui.back({ class: props.b24ui?.back })"
|
|
353
391
|
@click="navigateBack"
|
|
354
392
|
/>
|
|
@@ -364,6 +402,7 @@ function onSelect(e, item) {
|
|
|
364
402
|
color="air-tertiary-no-accent"
|
|
365
403
|
:aria-label="t('commandPalette.close')"
|
|
366
404
|
v-bind="typeof close === 'object' ? close : {}"
|
|
405
|
+
data-slot="close"
|
|
367
406
|
:class="b24ui.close({ class: props.b24ui?.close })"
|
|
368
407
|
@click="emits('update:open', false)"
|
|
369
408
|
/>
|
|
@@ -372,8 +411,8 @@ function onSelect(e, item) {
|
|
|
372
411
|
</B24Input>
|
|
373
412
|
</ListboxFilter>
|
|
374
413
|
|
|
375
|
-
<ListboxContent :class="b24ui.content({ class: props.b24ui?.content })">
|
|
376
|
-
<div v-if="filteredGroups?.length" role="presentation" :class="b24ui.viewport({ class: props.b24ui?.viewport })">
|
|
414
|
+
<ListboxContent data-slot="content" :class="b24ui.content({ class: props.b24ui?.content })">
|
|
415
|
+
<div v-if="filteredGroups?.length" role="presentation" data-slot="viewport" :class="b24ui.viewport({ class: props.b24ui?.viewport })">
|
|
377
416
|
<ListboxVirtualizer
|
|
378
417
|
v-if="!!virtualize"
|
|
379
418
|
v-slot="{ option: item, virtualItem }"
|
|
@@ -385,8 +424,8 @@ function onSelect(e, item) {
|
|
|
385
424
|
</ListboxVirtualizer>
|
|
386
425
|
|
|
387
426
|
<template v-else>
|
|
388
|
-
<ListboxGroup v-for="group in filteredGroups" :key="`group-${group.id}`" :class="b24ui.group({ class: props.b24ui?.group })">
|
|
389
|
-
<ListboxGroupLabel v-if="get(group, props.labelKey)" :class="b24ui.label({ class: props.b24ui?.label })">
|
|
427
|
+
<ListboxGroup v-for="group in filteredGroups" :key="`group-${group.id}`" data-slot="group" :class="b24ui.group({ class: props.b24ui?.group })">
|
|
428
|
+
<ListboxGroupLabel v-if="get(group, props.labelKey)" data-slot="label" :class="b24ui.label({ class: props.b24ui?.label })">
|
|
390
429
|
{{ get(group, props.labelKey) }}
|
|
391
430
|
</ListboxGroupLabel>
|
|
392
431
|
|
|
@@ -401,14 +440,14 @@ function onSelect(e, item) {
|
|
|
401
440
|
</template>
|
|
402
441
|
</div>
|
|
403
442
|
|
|
404
|
-
<div v-else :class="b24ui.empty({ class: props.b24ui?.empty })">
|
|
443
|
+
<div v-else data-slot="empty" :class="b24ui.empty({ class: props.b24ui?.empty })">
|
|
405
444
|
<slot name="empty" :search-term="searchTerm">
|
|
406
445
|
{{ searchTerm ? t("commandPalette.noMatch", { searchTerm }) : t("commandPalette.noData") }}
|
|
407
446
|
</slot>
|
|
408
447
|
</div>
|
|
409
448
|
</ListboxContent>
|
|
410
449
|
|
|
411
|
-
<div v-if="!!slots.footer" :class="b24ui.footer({ class: props.b24ui?.footer })">
|
|
450
|
+
<div v-if="!!slots.footer" data-slot="footer" :class="b24ui.footer({ class: props.b24ui?.footer })">
|
|
412
451
|
<slot name="footer" :b24ui="b24ui" />
|
|
413
452
|
</div>
|
|
414
453
|
</ListboxRoot>
|
|
@@ -41,6 +41,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.context
|
|
|
41
41
|
</ContextMenuTrigger>
|
|
42
42
|
|
|
43
43
|
<B24ContextMenuContent
|
|
44
|
+
data-slot="content"
|
|
44
45
|
:class="b24ui.content({ class: [!slots.default && props.class, props.b24ui?.content] })"
|
|
45
46
|
:b24ui="b24ui"
|
|
46
47
|
:b24ui-override="props.b24ui"
|
|
@@ -75,15 +75,17 @@ const groups = computed(
|
|
|
75
75
|
v-if="item.avatar"
|
|
76
76
|
:size="item.b24ui?.itemLeadingAvatarSize || b24uiOverride?.itemLeadingAvatarSize || b24ui.itemLeadingAvatarSize()"
|
|
77
77
|
v-bind="item.avatar"
|
|
78
|
+
data-slot="itemLeadingAvatar"
|
|
78
79
|
:class="b24ui.itemLeadingAvatar({ class: [b24uiOverride?.itemLeadingAvatar, item.b24ui?.itemLeadingAvatar], active })"
|
|
79
80
|
/>
|
|
80
81
|
</slot>
|
|
81
82
|
|
|
82
83
|
<span
|
|
83
84
|
v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label'] || (get(item, props.descriptionKey) || !!slots[item.slot ? `${item.slot}-description` : 'item-description'])"
|
|
85
|
+
data-slot="itemWrapper"
|
|
84
86
|
:class="b24ui.itemWrapper({ class: [b24uiOverride?.itemWrapper, item.b24ui?.itemWrapper] })"
|
|
85
87
|
>
|
|
86
|
-
<span :class="b24ui.itemLabel({ class: [b24uiOverride?.itemLabel, item.b24ui?.itemLabel], active })">
|
|
88
|
+
<span data-slot="itemLabel" :class="b24ui.itemLabel({ class: [b24uiOverride?.itemLabel, item.b24ui?.itemLabel], active })">
|
|
87
89
|
<slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="active" :index="index">
|
|
88
90
|
{{ get(item, props.labelKey) }}
|
|
89
91
|
</slot>
|
|
@@ -91,6 +93,7 @@ const groups = computed(
|
|
|
91
93
|
|
|
92
94
|
<span
|
|
93
95
|
v-if="get(item, props.descriptionKey)"
|
|
96
|
+
data-slot="itemDescription"
|
|
94
97
|
:class="b24ui.itemDescription({ class: [b24uiOverride?.itemDescription, item.b24ui?.itemDescription] })"
|
|
95
98
|
>
|
|
96
99
|
<slot
|
|
@@ -104,10 +107,11 @@ const groups = computed(
|
|
|
104
107
|
</span>
|
|
105
108
|
</span>
|
|
106
109
|
|
|
107
|
-
<span :class="b24ui.itemTrailing({ class: [b24uiOverride?.itemTrailing, item.b24ui?.itemTrailing] })">
|
|
110
|
+
<span data-slot="itemTrailing" :class="b24ui.itemTrailing({ class: [b24uiOverride?.itemTrailing, item.b24ui?.itemTrailing] })">
|
|
108
111
|
<ContextMenu.ItemIndicator as-child>
|
|
109
112
|
<Component
|
|
110
113
|
:is="checkedIcon || icons.check"
|
|
114
|
+
data-slot="itemTrailingIcon"
|
|
111
115
|
:class="b24ui.itemTrailingIcon({ class: [b24uiOverride?.itemTrailingIcon, item.b24ui?.itemTrailingIcon], color: item?.color })"
|
|
112
116
|
/>
|
|
113
117
|
</ContextMenu.ItemIndicator>
|
|
@@ -122,24 +126,28 @@ const groups = computed(
|
|
|
122
126
|
<Component
|
|
123
127
|
:is="loadingIcon || icons.loading"
|
|
124
128
|
v-if="item.loading"
|
|
129
|
+
data-slot="itemLeadingIcon"
|
|
125
130
|
:class="b24ui.itemLeadingIcon({ class: [b24uiOverride?.itemLeadingIcon, item.b24ui?.itemLeadingIcon], color: item?.color, loading: true })"
|
|
126
131
|
/>
|
|
127
132
|
<Component
|
|
128
133
|
:is="childrenIcon"
|
|
129
134
|
v-else-if="item.children?.length"
|
|
135
|
+
data-slot="itemTrailingIcon"
|
|
130
136
|
:class="b24ui.itemTrailingIcon({ class: [b24uiOverride?.itemTrailingIcon, item.b24ui?.itemTrailingIcon], color: item?.color, active })"
|
|
131
137
|
/>
|
|
132
138
|
<Component
|
|
133
139
|
:is="typeof externalIcon !== 'boolean' ? externalIcon : icons.external"
|
|
134
140
|
v-else-if="item.target === '_blank' && externalIcon !== false"
|
|
141
|
+
data-slot="itemLabelExternalIcon"
|
|
135
142
|
:class="b24ui.itemLabelExternalIcon({ class: [b24uiOverride?.itemLabelExternalIcon, item.b24ui?.itemLabelExternalIcon], color: item?.color, active })"
|
|
136
143
|
/>
|
|
137
144
|
<Component
|
|
138
145
|
:is="item.icon"
|
|
139
146
|
v-else-if="item.icon"
|
|
147
|
+
data-slot="itemLeadingIcon"
|
|
140
148
|
:class="b24ui.itemLeadingIcon({ class: [b24uiOverride?.itemLeadingIcon, item.b24ui?.itemLeadingIcon], color: item?.color, active })"
|
|
141
149
|
/>
|
|
142
|
-
<span v-else-if="item.kbds?.length" :class="b24ui.itemTrailingKbds({ class: [b24uiOverride?.itemTrailingKbds, item.b24ui?.itemTrailingKbds] })">
|
|
150
|
+
<span v-else-if="item.kbds?.length" data-slot="itemTrailingKbds" :class="b24ui.itemTrailingKbds({ class: [b24uiOverride?.itemTrailingKbds, item.b24ui?.itemTrailingKbds] })">
|
|
143
151
|
<B24Kbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="item.b24ui?.itemTrailingKbdsSize || b24uiOverride?.itemTrailingKbdsSize || b24ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
144
152
|
</span>
|
|
145
153
|
</slot>
|
|
@@ -150,22 +158,24 @@ const groups = computed(
|
|
|
150
158
|
<ContextMenu.Portal v-bind="portalProps">
|
|
151
159
|
<component
|
|
152
160
|
:is="sub ? ContextMenu.SubContent : ContextMenu.Content"
|
|
161
|
+
data-slot="content"
|
|
153
162
|
:class="b24ui.content({ class: [b24uiOverride?.content, props.class] })"
|
|
154
163
|
v-bind="contentProps"
|
|
155
164
|
>
|
|
156
165
|
<slot name="content-top" />
|
|
157
166
|
|
|
158
|
-
<div role="presentation" :class="b24ui.viewport({ class: b24uiOverride?.viewport })">
|
|
167
|
+
<div role="presentation" data-slot="viewport" :class="b24ui.viewport({ class: b24uiOverride?.viewport })">
|
|
159
168
|
<ContextMenu.Group
|
|
160
169
|
v-for="(group, groupIndex) in groups"
|
|
161
170
|
:key="`group-${groupIndex}`"
|
|
171
|
+
data-slot="group"
|
|
162
172
|
:class="b24ui.group({ class: b24uiOverride?.group })"
|
|
163
173
|
>
|
|
164
174
|
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
165
|
-
<ContextMenu.Label v-if="item.type === 'label'" :class="b24ui.label({ class: [b24uiOverride?.label, item.b24ui?.label, item.class] })">
|
|
175
|
+
<ContextMenu.Label v-if="item.type === 'label'" data-slot="label" :class="b24ui.label({ class: [b24uiOverride?.label, item.b24ui?.label, item.class] })">
|
|
166
176
|
<ReuseItemTemplate :item="item" :index="index" />
|
|
167
177
|
</ContextMenu.Label>
|
|
168
|
-
<ContextMenu.Separator v-else-if="item.type === 'separator'" :class="b24ui.separator({ class: [b24uiOverride?.separator, item.b24ui?.separator, item.class] })" />
|
|
178
|
+
<ContextMenu.Separator v-else-if="item.type === 'separator'" data-slot="separator" :class="b24ui.separator({ class: [b24uiOverride?.separator, item.b24ui?.separator, item.class] })" />
|
|
169
179
|
<ContextMenu.Sub
|
|
170
180
|
v-else-if="item?.children?.length"
|
|
171
181
|
:open="item.open"
|
|
@@ -176,6 +186,7 @@ const groups = computed(
|
|
|
176
186
|
type="button"
|
|
177
187
|
:disabled="item.disabled"
|
|
178
188
|
:text-value="get(item, props.labelKey)"
|
|
189
|
+
data-slot="item"
|
|
179
190
|
:class="b24ui.item({ class: [b24uiOverride?.item, item.b24ui?.item, item.class], color: item?.color })"
|
|
180
191
|
>
|
|
181
192
|
<ReuseItemTemplate :item="item" :index="index" />
|
|
@@ -206,6 +217,7 @@ const groups = computed(
|
|
|
206
217
|
:model-value="item.checked"
|
|
207
218
|
:disabled="item.disabled"
|
|
208
219
|
:text-value="get(item, props.labelKey)"
|
|
220
|
+
data-slot="item"
|
|
209
221
|
:class="b24ui.item({ class: [b24uiOverride?.item, item.b24ui?.item, item.class], color: item?.color })"
|
|
210
222
|
@update:model-value="item.onUpdateChecked"
|
|
211
223
|
@select="item.onSelect"
|
|
@@ -222,6 +234,7 @@ const groups = computed(
|
|
|
222
234
|
<B24Link v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
|
|
223
235
|
<B24LinkBase
|
|
224
236
|
v-bind="slotProps"
|
|
237
|
+
data-slot="item"
|
|
225
238
|
:class="b24ui.item({ class: [b24uiOverride?.item, item.b24ui?.item, item.class], color: item?.color, active })"
|
|
226
239
|
>
|
|
227
240
|
<ReuseItemTemplate :item="item" :active="active" :index="index" />
|
|
@@ -238,24 +238,29 @@ defineExpose({
|
|
|
238
238
|
<Primitive
|
|
239
239
|
:as="as"
|
|
240
240
|
v-bind="$attrs"
|
|
241
|
+
data-slot="base"
|
|
241
242
|
:class="b24ui.base({ class: [props.b24ui?.base, props.class] })"
|
|
242
243
|
>
|
|
243
244
|
<svg
|
|
244
245
|
v-if="props.useCircle"
|
|
246
|
+
data-slot="circleBase"
|
|
245
247
|
:class="b24ui.circleBase({ class: [props.b24ui?.circleBase] })"
|
|
246
248
|
viewBox="0 0 100 100"
|
|
247
249
|
xmlns="http://www.w3.org/2000/svg"
|
|
248
250
|
>
|
|
249
251
|
<g
|
|
252
|
+
data-slot="circleGroup"
|
|
250
253
|
:class="b24ui.circleGroup({ class: [props.b24ui?.circleGroup] })"
|
|
251
254
|
>
|
|
252
255
|
<circle
|
|
256
|
+
data-slot="circleElement"
|
|
253
257
|
:class="b24ui.circleElement({ class: [props.b24ui?.circleElement] })"
|
|
254
258
|
cx="50"
|
|
255
259
|
cy="50"
|
|
256
260
|
r="45"
|
|
257
261
|
/>
|
|
258
262
|
<path
|
|
263
|
+
data-slot="circlePath"
|
|
259
264
|
:class="b24ui.circlePath({ class: [props.b24ui?.circlePath] })"
|
|
260
265
|
:stroke-dasharray="fullDashArray"
|
|
261
266
|
d="M 50, 50 m -45, 0 a 45,45 0 1,0 90,0 a 45,45 0 1,0 -90,0"
|
|
@@ -266,12 +271,14 @@ defineExpose({
|
|
|
266
271
|
<Component
|
|
267
272
|
:is="leadingIconName"
|
|
268
273
|
v-if="isLeading && typeof leadingIconName !== 'undefined'"
|
|
274
|
+
data-slot="leadingIcon"
|
|
269
275
|
:class="b24ui.leadingIcon({ class: props.b24ui?.leadingIcon })"
|
|
270
276
|
/>
|
|
271
277
|
<B24Avatar
|
|
272
278
|
v-else-if="!!avatar"
|
|
273
279
|
:size="props.b24ui?.leadingAvatarSize || b24ui.leadingAvatarSize()"
|
|
274
280
|
v-bind="avatar"
|
|
281
|
+
data-slot="leadingAvatar"
|
|
275
282
|
:class="b24ui.leadingAvatar({ class: props.b24ui?.leadingAvatar })"
|
|
276
283
|
/>
|
|
277
284
|
</slot>
|
|
@@ -289,7 +296,7 @@ defineExpose({
|
|
|
289
296
|
:format-time="formatTime"
|
|
290
297
|
:b24ui="b24ui"
|
|
291
298
|
>
|
|
292
|
-
<span :class="b24ui.label({ class: props.b24ui?.label })">
|
|
299
|
+
<span data-slot="label" :class="b24ui.label({ class: props.b24ui?.label })">
|
|
293
300
|
{{ formatTime }}
|
|
294
301
|
</span>
|
|
295
302
|
</slot>
|