@nuxt/ui 3.1.1 → 3.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/.nuxt/ui/alert.ts +0 -5
- package/.nuxt/ui/badge.ts +30 -7
- package/.nuxt/ui/button-group.ts +0 -13
- package/.nuxt/ui/button.ts +2 -7
- package/.nuxt/ui/calendar.ts +1 -1
- package/.nuxt/ui/carousel.ts +0 -5
- package/.nuxt/ui/checkbox-group.ts +144 -1
- package/.nuxt/ui/color-picker.ts +2 -2
- package/.nuxt/ui/context-menu.ts +2 -1
- package/.nuxt/ui/dropdown-menu.ts +2 -1
- package/.nuxt/ui/input-menu.ts +4 -13
- package/.nuxt/ui/input-number.ts +10 -0
- package/.nuxt/ui/input.ts +2 -11
- package/.nuxt/ui/link.ts +12 -5
- package/.nuxt/ui/navigation-menu.ts +43 -34
- package/.nuxt/ui/radio-group.ts +1 -1
- package/.nuxt/ui/select-menu.ts +4 -13
- package/.nuxt/ui/select.ts +4 -13
- package/.nuxt/ui/tabs.ts +4 -3
- package/.nuxt/ui/textarea.ts +2 -11
- package/.nuxt/ui/toast.ts +0 -5
- package/.nuxt/ui/tooltip.ts +1 -1
- package/.nuxt/ui.css +4 -1
- package/cli/templates.mjs +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +14 -5
- package/dist/runtime/components/Accordion.vue +9 -9
- package/dist/runtime/components/Accordion.vue.d.ts +2 -0
- package/dist/runtime/components/Alert.vue +1 -1
- package/dist/runtime/components/Avatar.vue +2 -2
- 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/Breadcrumb.vue +8 -8
- package/dist/runtime/components/Breadcrumb.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 +2 -1
- package/dist/runtime/components/Card.vue +1 -1
- package/dist/runtime/components/Carousel.vue +5 -2
- package/dist/runtime/components/Carousel.vue.d.ts +6 -1
- package/dist/runtime/components/Checkbox.vue +2 -2
- package/dist/runtime/components/CheckboxGroup.vue +8 -5
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +7 -1
- package/dist/runtime/components/Chip.vue +1 -1
- package/dist/runtime/components/Collapsible.vue +1 -1
- package/dist/runtime/components/ColorPicker.vue +1 -1
- package/dist/runtime/components/CommandPalette.vue +18 -18
- package/dist/runtime/components/CommandPalette.vue.d.ts +2 -0
- package/dist/runtime/components/ContextMenu.vue.d.ts +2 -0
- package/dist/runtime/components/ContextMenuContent.vue +69 -67
- package/dist/runtime/components/Drawer.vue +15 -1
- package/dist/runtime/components/DropdownMenu.vue.d.ts +2 -0
- package/dist/runtime/components/DropdownMenuContent.vue +71 -69
- package/dist/runtime/components/FormField.vue +5 -5
- package/dist/runtime/components/Input.vue +3 -2
- package/dist/runtime/components/Input.vue.d.ts +30 -29
- package/dist/runtime/components/InputMenu.vue +20 -20
- package/dist/runtime/components/InputMenu.vue.d.ts +210 -0
- package/dist/runtime/components/InputNumber.vue +13 -7
- package/dist/runtime/components/InputNumber.vue.d.ts +78 -0
- package/dist/runtime/components/Link.vue +5 -14
- package/dist/runtime/components/Modal.vue +2 -2
- package/dist/runtime/components/Modal.vue.d.ts +3 -0
- package/dist/runtime/components/NavigationMenu.vue +106 -41
- package/dist/runtime/components/NavigationMenu.vue.d.ts +38 -7
- package/dist/runtime/components/Pagination.vue +1 -1
- package/dist/runtime/components/PinInput.vue +1 -1
- package/dist/runtime/components/Popover.vue +4 -0
- package/dist/runtime/components/Popover.vue.d.ts +1 -0
- package/dist/runtime/components/Progress.vue +1 -1
- package/dist/runtime/components/RadioGroup.vue +8 -8
- package/dist/runtime/components/RadioGroup.vue.d.ts +2 -0
- package/dist/runtime/components/Select.vue +15 -15
- package/dist/runtime/components/Select.vue.d.ts +3 -1
- package/dist/runtime/components/SelectMenu.vue +16 -16
- package/dist/runtime/components/SelectMenu.vue.d.ts +2 -0
- package/dist/runtime/components/Separator.vue +1 -1
- package/dist/runtime/components/Slideover.vue +9 -2
- package/dist/runtime/components/Slideover.vue.d.ts +3 -0
- package/dist/runtime/components/Slider.vue +16 -4
- package/dist/runtime/components/Slider.vue.d.ts +26 -20
- package/dist/runtime/components/Stepper.vue +10 -10
- package/dist/runtime/components/Stepper.vue.d.ts +2 -0
- package/dist/runtime/components/Switch.vue +1 -1
- package/dist/runtime/components/Table.vue +2 -2
- package/dist/runtime/components/Tabs.vue +6 -6
- package/dist/runtime/components/Tabs.vue.d.ts +2 -0
- package/dist/runtime/components/Textarea.vue +7 -4
- package/dist/runtime/components/Textarea.vue.d.ts +30 -31
- package/dist/runtime/components/Toast.vue +3 -2
- 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/Tree.vue +10 -10
- package/dist/runtime/components/Tree.vue.d.ts +2 -0
- package/dist/runtime/composables/useFormField.d.ts +1 -1
- package/dist/runtime/composables/useFormField.js +2 -1
- package/dist/runtime/inertia/components/Link.vue +46 -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/locale/index.d.ts +7 -2
- package/dist/runtime/locale/index.js +7 -2
- package/dist/runtime/locale/ky.d.ts +3 -0
- package/dist/runtime/locale/ky.js +54 -0
- package/dist/runtime/locale/lt.d.ts +3 -0
- package/dist/runtime/locale/lt.js +54 -0
- package/dist/runtime/locale/mn.d.ts +3 -0
- package/dist/runtime/locale/mn.js +54 -0
- package/dist/runtime/locale/ms.d.ts +3 -0
- package/dist/runtime/locale/ms.js +54 -0
- package/dist/runtime/locale/sl.d.ts +3 -0
- package/dist/runtime/locale/sl.js +54 -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 +27 -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/{ui.CbtTMMzt.mjs → ui.Bix4DSU4.mjs} +153 -52
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +28 -28
|
@@ -10,9 +10,11 @@ export type CheckboxGroupItem = {
|
|
|
10
10
|
description?: string;
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
value?: string;
|
|
13
|
+
class?: any;
|
|
14
|
+
ui?: Pick<CheckboxGroup['slots'], 'item'> & Omit<Required<CheckboxProps>['ui'], 'root'>;
|
|
13
15
|
[key: string]: any;
|
|
14
16
|
} | CheckboxGroupValue;
|
|
15
|
-
export interface CheckboxGroupProps<T extends CheckboxGroupItem = CheckboxGroupItem> extends Pick<CheckboxGroupRootProps, 'defaultValue' | 'disabled' | 'loop' | 'modelValue' | 'name' | 'required'>, Pick<CheckboxProps, 'color' | '
|
|
17
|
+
export interface CheckboxGroupProps<T extends CheckboxGroupItem = CheckboxGroupItem> extends Pick<CheckboxGroupRootProps, 'defaultValue' | 'disabled' | 'loop' | 'modelValue' | 'name' | 'required'>, Pick<CheckboxProps, 'color' | 'indicator' | 'icon'> {
|
|
16
18
|
/**
|
|
17
19
|
* The element or component this component should render as.
|
|
18
20
|
* @defaultValue 'div'
|
|
@@ -39,6 +41,10 @@ export interface CheckboxGroupProps<T extends CheckboxGroupItem = CheckboxGroupI
|
|
|
39
41
|
* @defaultValue 'md'
|
|
40
42
|
*/
|
|
41
43
|
size?: CheckboxGroup['variants']['size'];
|
|
44
|
+
/**
|
|
45
|
+
* @defaultValue 'list'
|
|
46
|
+
*/
|
|
47
|
+
variant?: CheckboxGroup['variants']['variant'];
|
|
42
48
|
/**
|
|
43
49
|
* The orientation the checkbox buttons are laid out.
|
|
44
50
|
* @defaultValue 'vertical'
|
|
@@ -34,7 +34,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.chip || {} })
|
|
|
34
34
|
</script>
|
|
35
35
|
|
|
36
36
|
<template>
|
|
37
|
-
<Primitive :as="as" :class="ui.root({ class: [props.
|
|
37
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
38
38
|
<Slot v-bind="$attrs">
|
|
39
39
|
<slot />
|
|
40
40
|
</Slot>
|
|
@@ -25,7 +25,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.collapsible |
|
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
27
|
<template>
|
|
28
|
-
<CollapsibleRoot v-slot="{ open }" v-bind="rootProps" :class="ui.root({ class: [props.
|
|
28
|
+
<CollapsibleRoot v-slot="{ open }" v-bind="rootProps" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
29
29
|
<CollapsibleTrigger v-if="!!slots.default" as-child>
|
|
30
30
|
<slot :open="open" />
|
|
31
31
|
</CollapsibleTrigger>
|
|
@@ -179,7 +179,7 @@ const trackThumbStyle = computed(() => ({
|
|
|
179
179
|
</script>
|
|
180
180
|
|
|
181
181
|
<template>
|
|
182
|
-
<Primitive :as="as" :class="ui.root({ class: [props.
|
|
182
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })" :data-disabled="disabled ? true : void 0">
|
|
183
183
|
<div :class="ui.picker({ class: props.ui?.picker })">
|
|
184
184
|
<div
|
|
185
185
|
ref="selectorRef"
|
|
@@ -112,7 +112,7 @@ const groups = computed(() => {
|
|
|
112
112
|
</script>
|
|
113
113
|
|
|
114
114
|
<template>
|
|
115
|
-
<ListboxRoot v-bind="rootProps" :class="ui.root({ class: [props.
|
|
115
|
+
<ListboxRoot v-bind="rootProps" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
116
116
|
<ListboxFilter v-model="searchTerm" as-child>
|
|
117
117
|
<UInput
|
|
118
118
|
:placeholder="placeholder || t('commandPalette.placeholder')"
|
|
@@ -141,7 +141,7 @@ const groups = computed(() => {
|
|
|
141
141
|
</ListboxFilter>
|
|
142
142
|
|
|
143
143
|
<ListboxContent :class="ui.content({ class: props.ui?.content })">
|
|
144
|
-
<div v-if="groups?.length" :class="ui.viewport({ class: props.ui?.viewport })">
|
|
144
|
+
<div v-if="groups?.length" role="presentation" :class="ui.viewport({ class: props.ui?.viewport })">
|
|
145
145
|
<ListboxGroup v-for="group in groups" :key="`group-${group.id}`" :class="ui.group({ class: props.ui?.group })">
|
|
146
146
|
<ListboxGroupLabel v-if="get(group, props.labelKey)" :class="ui.label({ class: props.ui?.label })">
|
|
147
147
|
{{ get(group, props.labelKey) }}
|
|
@@ -156,42 +156,42 @@ const groups = computed(() => {
|
|
|
156
156
|
@select="item.onSelect"
|
|
157
157
|
>
|
|
158
158
|
<ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
|
|
159
|
-
<ULinkBase v-bind="slotProps" :class="ui.item({ class: props.ui?.item, active: active || item.active })">
|
|
159
|
+
<ULinkBase v-bind="slotProps" :class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class], active: active || item.active })">
|
|
160
160
|
<slot :name="item.slot || group.slot || 'item'" :item="item" :index="index">
|
|
161
161
|
<slot :name="item.slot ? `${item.slot}-leading` : group.slot ? `${group.slot}-leading` : `item-leading`" :item="item" :index="index">
|
|
162
|
-
<UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: props.ui?.itemLeadingIcon, loading: true })" />
|
|
163
|
-
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: props.ui?.itemLeadingIcon, active: active || item.active })" />
|
|
164
|
-
<UAvatar v-else-if="item.avatar" :size="props.ui?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: props.ui?.itemLeadingAvatar, active: active || item.active })" />
|
|
162
|
+
<UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: [props.ui?.itemLeadingIcon, item.ui?.itemLeadingIcon], loading: true })" />
|
|
163
|
+
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: [props.ui?.itemLeadingIcon, item.ui?.itemLeadingIcon], active: active || item.active })" />
|
|
164
|
+
<UAvatar v-else-if="item.avatar" :size="item.ui?.itemLeadingAvatarSize || props.ui?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: [props.ui?.itemLeadingAvatar, item.ui?.itemLeadingAvatar], active: active || item.active })" />
|
|
165
165
|
<UChip
|
|
166
166
|
v-else-if="item.chip"
|
|
167
|
-
:size="props.ui?.itemLeadingChipSize || ui.itemLeadingChipSize()"
|
|
167
|
+
:size="item.ui?.itemLeadingChipSize || props.ui?.itemLeadingChipSize || ui.itemLeadingChipSize()"
|
|
168
168
|
inset
|
|
169
169
|
standalone
|
|
170
170
|
v-bind="item.chip"
|
|
171
|
-
:class="ui.itemLeadingChip({ class: props.ui?.itemLeadingChip, active: active || item.active })"
|
|
171
|
+
:class="ui.itemLeadingChip({ class: [props.ui?.itemLeadingChip, item.ui?.itemLeadingChip], active: active || item.active })"
|
|
172
172
|
/>
|
|
173
173
|
</slot>
|
|
174
174
|
|
|
175
|
-
<span v-if="item.labelHtml || get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : group.slot ? `${group.slot}-label` : `item-label`]" :class="ui.itemLabel({ class: props.ui?.itemLabel, active: active || item.active })">
|
|
175
|
+
<span v-if="item.labelHtml || get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : group.slot ? `${group.slot}-label` : `item-label`]" :class="ui.itemLabel({ class: [props.ui?.itemLabel, item.ui?.itemLabel], active: active || item.active })">
|
|
176
176
|
<slot :name="item.slot ? `${item.slot}-label` : group.slot ? `${group.slot}-label` : `item-label`" :item="item" :index="index">
|
|
177
|
-
<span v-if="item.prefix" :class="ui.itemLabelPrefix({ class: props.ui?.itemLabelPrefix })">{{ item.prefix }}</span>
|
|
177
|
+
<span v-if="item.prefix" :class="ui.itemLabelPrefix({ class: [props.ui?.itemLabelPrefix, item.ui?.itemLabelPrefix] })">{{ item.prefix }}</span>
|
|
178
178
|
|
|
179
|
-
<span :class="ui.itemLabelBase({ class: props.ui?.itemLabelBase, active: active || item.active })" v-html="item.labelHtml || get(item, props.labelKey)" />
|
|
179
|
+
<span :class="ui.itemLabelBase({ class: [props.ui?.itemLabelBase, item.ui?.itemLabelBase], active: active || item.active })" v-html="item.labelHtml || get(item, props.labelKey)" />
|
|
180
180
|
|
|
181
|
-
<span :class="ui.itemLabelSuffix({ class: props.ui?.itemLabelSuffix, active: active || item.active })" v-html="item.suffixHtml || item.suffix" />
|
|
181
|
+
<span :class="ui.itemLabelSuffix({ class: [props.ui?.itemLabelSuffix, item.ui?.itemLabelSuffix], active: active || item.active })" v-html="item.suffixHtml || item.suffix" />
|
|
182
182
|
</slot>
|
|
183
183
|
</span>
|
|
184
184
|
|
|
185
|
-
<span :class="ui.itemTrailing({ class: props.ui?.itemTrailing })">
|
|
185
|
+
<span :class="ui.itemTrailing({ class: [props.ui?.itemTrailing, item.ui?.itemTrailing] })">
|
|
186
186
|
<slot :name="item.slot ? `${item.slot}-trailing` : group.slot ? `${group.slot}-trailing` : `item-trailing`" :item="item" :index="index">
|
|
187
|
-
<span v-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: props.ui?.itemTrailingKbds })">
|
|
188
|
-
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="props.ui?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
187
|
+
<span v-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: [props.ui?.itemTrailingKbds, item.ui?.itemTrailingKbds] })">
|
|
188
|
+
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="item.ui?.itemTrailingKbdsSize || props.ui?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
189
189
|
</span>
|
|
190
|
-
<UIcon v-else-if="group.highlightedIcon" :name="group.highlightedIcon" :class="ui.itemTrailingHighlightedIcon({ class: props.ui?.itemTrailingHighlightedIcon })" />
|
|
190
|
+
<UIcon v-else-if="group.highlightedIcon" :name="group.highlightedIcon" :class="ui.itemTrailingHighlightedIcon({ class: [props.ui?.itemTrailingHighlightedIcon, item.ui?.itemTrailingHighlightedIcon] })" />
|
|
191
191
|
</slot>
|
|
192
192
|
|
|
193
193
|
<ListboxItemIndicator as-child>
|
|
194
|
-
<UIcon :name="selectedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: props.ui?.itemTrailingIcon })" />
|
|
194
|
+
<UIcon :name="selectedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: [props.ui?.itemTrailingIcon, item.ui?.itemTrailingIcon] })" />
|
|
195
195
|
</ListboxItemIndicator>
|
|
196
196
|
</span>
|
|
197
197
|
</slot>
|
|
@@ -203,7 +203,7 @@ const groups = computed(() => {
|
|
|
203
203
|
|
|
204
204
|
<div v-else :class="ui.empty({ class: props.ui?.empty })">
|
|
205
205
|
<slot name="empty" :search-term="searchTerm">
|
|
206
|
-
{{ searchTerm ? t(
|
|
206
|
+
{{ searchTerm ? t("commandPalette.noMatch", { searchTerm }) : t("commandPalette.noData") }}
|
|
207
207
|
</slot>
|
|
208
208
|
</div>
|
|
209
209
|
</ListboxContent>
|
|
@@ -22,6 +22,8 @@ export interface CommandPaletteItem extends Omit<LinkProps, 'type' | 'raw' | 'cu
|
|
|
22
22
|
disabled?: boolean;
|
|
23
23
|
slot?: string;
|
|
24
24
|
onSelect?(e?: Event): void;
|
|
25
|
+
class?: any;
|
|
26
|
+
ui?: Pick<CommandPalette['slots'], 'item' | 'itemLeadingIcon' | 'itemLeadingAvatarSize' | 'itemLeadingAvatar' | 'itemLeadingChipSize' | 'itemLeadingChip' | 'itemLabel' | 'itemLabelPrefix' | 'itemLabelBase' | 'itemLabelSuffix' | 'itemTrailing' | 'itemTrailingKbds' | 'itemTrailingKbdsSize' | 'itemTrailingHighlightedIcon' | 'itemTrailingIcon'>;
|
|
25
27
|
[key: string]: any;
|
|
26
28
|
}
|
|
27
29
|
export interface CommandPaletteGroup<T> {
|
|
@@ -28,6 +28,8 @@ export interface ContextMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custo
|
|
|
28
28
|
children?: ArrayOrNested<ContextMenuItem>;
|
|
29
29
|
onSelect?(e: Event): void;
|
|
30
30
|
onUpdateChecked?(checked: boolean): void;
|
|
31
|
+
class?: any;
|
|
32
|
+
ui?: Pick<ContextMenu['slots'], 'item' | 'label' | 'separator' | 'itemLeadingIcon' | 'itemLeadingAvatarSize' | 'itemLeadingAvatar' | 'itemLabel' | 'itemLabelExternalIcon' | 'itemTrailing' | 'itemTrailingIcon' | 'itemTrailingKbds' | 'itemTrailingKbdsSize'>;
|
|
31
33
|
[key: string]: any;
|
|
32
34
|
}
|
|
33
35
|
export interface ContextMenuProps<T extends ArrayOrNested<ContextMenuItem> = ArrayOrNested<ContextMenuItem>> extends Omit<ContextMenuRootProps, 'dir'> {
|
|
@@ -59,29 +59,29 @@ const groups = computed(
|
|
|
59
59
|
<DefineItemTemplate v-slot="{ item, active, index }">
|
|
60
60
|
<slot :name="item.slot || 'item'" :item="item" :index="index">
|
|
61
61
|
<slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="item" :active="active" :index="index">
|
|
62
|
-
<UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, color: item?.color, loading: true })" />
|
|
63
|
-
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, color: item?.color, active })" />
|
|
64
|
-
<UAvatar v-else-if="item.avatar" :size="props.uiOverride?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: uiOverride?.itemLeadingAvatar, active })" />
|
|
62
|
+
<UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: [uiOverride?.itemLeadingIcon, item.ui?.itemLeadingIcon], color: item?.color, loading: true })" />
|
|
63
|
+
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: [uiOverride?.itemLeadingIcon, item.ui?.itemLeadingIcon], color: item?.color, active })" />
|
|
64
|
+
<UAvatar v-else-if="item.avatar" :size="item.ui?.itemLeadingAvatarSize || props.uiOverride?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: [uiOverride?.itemLeadingAvatar, item.ui?.itemLeadingAvatar], active })" />
|
|
65
65
|
</slot>
|
|
66
66
|
|
|
67
|
-
<span v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.itemLabel({ class: uiOverride?.itemLabel, active })">
|
|
67
|
+
<span v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.itemLabel({ class: [uiOverride?.itemLabel, item.ui?.itemLabel], active })">
|
|
68
68
|
<slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="active" :index="index">
|
|
69
69
|
{{ get(item, props.labelKey) }}
|
|
70
70
|
</slot>
|
|
71
71
|
|
|
72
|
-
<UIcon v-if="item.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" :class="ui.itemLabelExternalIcon({ class: uiOverride?.itemLabelExternalIcon, color: item?.color, active })" />
|
|
72
|
+
<UIcon v-if="item.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" :class="ui.itemLabelExternalIcon({ class: [uiOverride?.itemLabelExternalIcon, item.ui?.itemLabelExternalIcon], color: item?.color, active })" />
|
|
73
73
|
</span>
|
|
74
74
|
|
|
75
|
-
<span :class="ui.itemTrailing({ class: uiOverride?.itemTrailing })">
|
|
75
|
+
<span :class="ui.itemTrailing({ class: [uiOverride?.itemTrailing, item.ui?.itemTrailing] })">
|
|
76
76
|
<slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="active" :index="index">
|
|
77
|
-
<UIcon v-if="item.children?.length" :name="childrenIcon" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon, color: item?.color, active })" />
|
|
78
|
-
<span v-else-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: uiOverride?.itemTrailingKbds })">
|
|
79
|
-
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="props.uiOverride?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
77
|
+
<UIcon v-if="item.children?.length" :name="childrenIcon" :class="ui.itemTrailingIcon({ class: [uiOverride?.itemTrailingIcon, item.ui?.itemTrailingIcon], color: item?.color, active })" />
|
|
78
|
+
<span v-else-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: [uiOverride?.itemTrailingKbds, item.ui?.itemTrailingKbds] })">
|
|
79
|
+
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="item.ui?.itemTrailingKbdsSize || props.uiOverride?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
80
80
|
</span>
|
|
81
81
|
</slot>
|
|
82
82
|
|
|
83
83
|
<ContextMenu.ItemIndicator as-child>
|
|
84
|
-
<UIcon :name="checkedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon, color: item?.color })" />
|
|
84
|
+
<UIcon :name="checkedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: [uiOverride?.itemTrailingIcon, item.ui?.itemTrailingIcon], color: item?.color })" />
|
|
85
85
|
</ContextMenu.ItemIndicator>
|
|
86
86
|
</span>
|
|
87
87
|
</slot>
|
|
@@ -91,68 +91,70 @@ const groups = computed(
|
|
|
91
91
|
<component :is="sub ? ContextMenu.SubContent : ContextMenu.Content" :class="props.class" v-bind="contentProps">
|
|
92
92
|
<slot name="content-top" />
|
|
93
93
|
|
|
94
|
-
<
|
|
95
|
-
<
|
|
96
|
-
<
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
<ContextMenu.
|
|
102
|
-
|
|
103
|
-
|
|
94
|
+
<div role="presentation" :class="ui.viewport({ class: props.ui?.viewport })">
|
|
95
|
+
<ContextMenu.Group v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" :class="ui.group({ class: uiOverride?.group })">
|
|
96
|
+
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
97
|
+
<ContextMenu.Label v-if="item.type === 'label'" :class="ui.label({ class: [uiOverride?.label, item.ui?.label, item.class] })">
|
|
98
|
+
<ReuseItemTemplate :item="item" :index="index" />
|
|
99
|
+
</ContextMenu.Label>
|
|
100
|
+
<ContextMenu.Separator v-else-if="item.type === 'separator'" :class="ui.separator({ class: [uiOverride?.separator, item.ui?.separator, item.class] })" />
|
|
101
|
+
<ContextMenu.Sub v-else-if="item?.children?.length" :open="item.open" :default-open="item.defaultOpen">
|
|
102
|
+
<ContextMenu.SubTrigger
|
|
103
|
+
as="button"
|
|
104
|
+
type="button"
|
|
105
|
+
:disabled="item.disabled"
|
|
106
|
+
:text-value="get(item, props.labelKey)"
|
|
107
|
+
:class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], color: item?.color })"
|
|
108
|
+
>
|
|
109
|
+
<ReuseItemTemplate :item="item" :index="index" />
|
|
110
|
+
</ContextMenu.SubTrigger>
|
|
111
|
+
|
|
112
|
+
<UContextMenuContent
|
|
113
|
+
sub
|
|
114
|
+
:class="props.class"
|
|
115
|
+
:ui="ui"
|
|
116
|
+
:ui-override="uiOverride"
|
|
117
|
+
:portal="portal"
|
|
118
|
+
:items="item.children"
|
|
119
|
+
:align-offset="-4"
|
|
120
|
+
:label-key="labelKey"
|
|
121
|
+
:checked-icon="checkedIcon"
|
|
122
|
+
:loading-icon="loadingIcon"
|
|
123
|
+
:external-icon="externalIcon"
|
|
124
|
+
v-bind="item.content"
|
|
125
|
+
>
|
|
126
|
+
<template v-for="(_, name) in proxySlots" #[name]="slotData">
|
|
127
|
+
<slot :name="name" v-bind="slotData" />
|
|
128
|
+
</template>
|
|
129
|
+
</UContextMenuContent>
|
|
130
|
+
</ContextMenu.Sub>
|
|
131
|
+
<ContextMenu.CheckboxItem
|
|
132
|
+
v-else-if="item.type === 'checkbox'"
|
|
133
|
+
:model-value="item.checked"
|
|
104
134
|
:disabled="item.disabled"
|
|
105
135
|
:text-value="get(item, props.labelKey)"
|
|
106
|
-
:class="ui.item({ class: uiOverride?.item, color: item?.color })"
|
|
136
|
+
:class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], color: item?.color })"
|
|
137
|
+
@update:model-value="item.onUpdateChecked"
|
|
138
|
+
@select="item.onSelect"
|
|
107
139
|
>
|
|
108
140
|
<ReuseItemTemplate :item="item" :index="index" />
|
|
109
|
-
</ContextMenu.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
:
|
|
114
|
-
:
|
|
115
|
-
|
|
116
|
-
:portal="portal"
|
|
117
|
-
:items="item.children"
|
|
118
|
-
:align-offset="-4"
|
|
119
|
-
:label-key="labelKey"
|
|
120
|
-
:checked-icon="checkedIcon"
|
|
121
|
-
:loading-icon="loadingIcon"
|
|
122
|
-
:external-icon="externalIcon"
|
|
123
|
-
v-bind="item.content"
|
|
141
|
+
</ContextMenu.CheckboxItem>
|
|
142
|
+
<ContextMenu.Item
|
|
143
|
+
v-else
|
|
144
|
+
as-child
|
|
145
|
+
:disabled="item.disabled"
|
|
146
|
+
:text-value="get(item, props.labelKey)"
|
|
147
|
+
@select="item.onSelect"
|
|
124
148
|
>
|
|
125
|
-
<
|
|
126
|
-
<
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
:text-value="get(item, props.labelKey)"
|
|
135
|
-
:class="ui.item({ class: [uiOverride?.item, item.class], color: item?.color })"
|
|
136
|
-
@update:model-value="item.onUpdateChecked"
|
|
137
|
-
@select="item.onSelect"
|
|
138
|
-
>
|
|
139
|
-
<ReuseItemTemplate :item="item" :index="index" />
|
|
140
|
-
</ContextMenu.CheckboxItem>
|
|
141
|
-
<ContextMenu.Item
|
|
142
|
-
v-else
|
|
143
|
-
as-child
|
|
144
|
-
:disabled="item.disabled"
|
|
145
|
-
:text-value="get(item, props.labelKey)"
|
|
146
|
-
@select="item.onSelect"
|
|
147
|
-
>
|
|
148
|
-
<ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
|
|
149
|
-
<ULinkBase v-bind="slotProps" :class="ui.item({ class: [uiOverride?.item, item.class], active, color: item?.color })">
|
|
150
|
-
<ReuseItemTemplate :item="item" :active="active" :index="index" />
|
|
151
|
-
</ULinkBase>
|
|
152
|
-
</ULink>
|
|
153
|
-
</ContextMenu.Item>
|
|
154
|
-
</template>
|
|
155
|
-
</ContextMenu.Group>
|
|
149
|
+
<ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
|
|
150
|
+
<ULinkBase v-bind="slotProps" :class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], active, color: item?.color })">
|
|
151
|
+
<ReuseItemTemplate :item="item" :active="active" :index="index" />
|
|
152
|
+
</ULinkBase>
|
|
153
|
+
</ULink>
|
|
154
|
+
</ContextMenu.Item>
|
|
155
|
+
</template>
|
|
156
|
+
</ContextMenu.Group>
|
|
157
|
+
</div>
|
|
156
158
|
|
|
157
159
|
<slot />
|
|
158
160
|
|
|
@@ -4,7 +4,7 @@ import theme from "#build/ui/drawer";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed, toRef } from "vue";
|
|
7
|
-
import { useForwardPropsEmits } from "reka-ui";
|
|
7
|
+
import { VisuallyHidden, useForwardPropsEmits } from "reka-ui";
|
|
8
8
|
import { DrawerRoot, DrawerTrigger, DrawerPortal, DrawerOverlay, DrawerContent, DrawerTitle, DrawerDescription, DrawerHandle } from "vaul-vue";
|
|
9
9
|
import { reactivePick } from "@vueuse/core";
|
|
10
10
|
import { useAppConfig } from "#imports";
|
|
@@ -65,6 +65,20 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.drawer || {}
|
|
|
65
65
|
<DrawerContent :class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })" v-bind="contentProps" v-on="contentEvents">
|
|
66
66
|
<DrawerHandle v-if="handle" :class="ui.handle({ class: props.ui?.handle })" />
|
|
67
67
|
|
|
68
|
+
<VisuallyHidden v-if="!!slots.content && (title || !!slots.title || (description || !!slots.description))">
|
|
69
|
+
<DrawerTitle v-if="title || !!slots.title">
|
|
70
|
+
<slot name="title">
|
|
71
|
+
{{ title }}
|
|
72
|
+
</slot>
|
|
73
|
+
</DrawerTitle>
|
|
74
|
+
|
|
75
|
+
<DrawerDescription v-if="description || !!slots.description">
|
|
76
|
+
<slot name="description">
|
|
77
|
+
{{ description }}
|
|
78
|
+
</slot>
|
|
79
|
+
</DrawerDescription>
|
|
80
|
+
</VisuallyHidden>
|
|
81
|
+
|
|
68
82
|
<slot name="content">
|
|
69
83
|
<div :class="ui.container({ class: props.ui?.container })">
|
|
70
84
|
<div v-if="!!slots.header || (title || !!slots.title) || (description || !!slots.description)" :class="ui.header({ class: props.ui?.header })">
|
|
@@ -28,6 +28,8 @@ export interface DropdownMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'cust
|
|
|
28
28
|
children?: ArrayOrNested<DropdownMenuItem>;
|
|
29
29
|
onSelect?(e: Event): void;
|
|
30
30
|
onUpdateChecked?(checked: boolean): void;
|
|
31
|
+
class?: any;
|
|
32
|
+
ui?: Pick<DropdownMenu['slots'], 'item' | 'label' | 'separator' | 'itemLeadingIcon' | 'itemLeadingAvatarSize' | 'itemLeadingAvatar' | 'itemLabel' | 'itemLabelExternalIcon' | 'itemTrailing' | 'itemTrailingIcon' | 'itemTrailingKbds' | 'itemTrailingKbdsSize'>;
|
|
31
33
|
[key: string]: any;
|
|
32
34
|
}
|
|
33
35
|
export interface DropdownMenuProps<T extends ArrayOrNested<DropdownMenuItem> = ArrayOrNested<DropdownMenuItem>> extends Omit<DropdownMenuRootProps, 'dir'> {
|
|
@@ -64,29 +64,29 @@ const groups = computed(
|
|
|
64
64
|
<DefineItemTemplate v-slot="{ item, active, index }">
|
|
65
65
|
<slot :name="item.slot || 'item'" :item="item" :index="index">
|
|
66
66
|
<slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="item" :active="active" :index="index">
|
|
67
|
-
<UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, color: item?.color, loading: true })" />
|
|
68
|
-
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, color: item?.color, active })" />
|
|
69
|
-
<UAvatar v-else-if="item.avatar" :size="props.uiOverride?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: uiOverride?.itemLeadingAvatar, active })" />
|
|
67
|
+
<UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: [uiOverride?.itemLeadingIcon, item.ui?.itemLeadingIcon], color: item?.color, loading: true })" />
|
|
68
|
+
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: [uiOverride?.itemLeadingIcon, item.ui?.itemLeadingIcon], color: item?.color, active })" />
|
|
69
|
+
<UAvatar v-else-if="item.avatar" :size="item.ui?.itemLeadingAvatarSize || props.uiOverride?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: [uiOverride?.itemLeadingAvatar, item.ui?.itemLeadingAvatar], active })" />
|
|
70
70
|
</slot>
|
|
71
71
|
|
|
72
|
-
<span v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.itemLabel({ class: uiOverride?.itemLabel, active })">
|
|
72
|
+
<span v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.itemLabel({ class: [uiOverride?.itemLabel, item.ui?.itemLabel], active })">
|
|
73
73
|
<slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="active" :index="index">
|
|
74
74
|
{{ get(item, props.labelKey) }}
|
|
75
75
|
</slot>
|
|
76
76
|
|
|
77
|
-
<UIcon v-if="item.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" :class="ui.itemLabelExternalIcon({ class: uiOverride?.itemLabelExternalIcon, color: item?.color, active })" />
|
|
77
|
+
<UIcon v-if="item.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" :class="ui.itemLabelExternalIcon({ class: [uiOverride?.itemLabelExternalIcon, item.ui?.itemLabelExternalIcon], color: item?.color, active })" />
|
|
78
78
|
</span>
|
|
79
79
|
|
|
80
|
-
<span :class="ui.itemTrailing({ class: uiOverride?.itemTrailing })">
|
|
80
|
+
<span :class="ui.itemTrailing({ class: [uiOverride?.itemTrailing, item.ui?.itemTrailing] })">
|
|
81
81
|
<slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="active" :index="index">
|
|
82
|
-
<UIcon v-if="item.children?.length" :name="childrenIcon" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon, color: item?.color, active })" />
|
|
83
|
-
<span v-else-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: uiOverride?.itemTrailingKbds })">
|
|
84
|
-
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="props.uiOverride?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
82
|
+
<UIcon v-if="item.children?.length" :name="childrenIcon" :class="ui.itemTrailingIcon({ class: [uiOverride?.itemTrailingIcon, item.ui?.itemTrailingIcon], color: item?.color, active })" />
|
|
83
|
+
<span v-else-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: [uiOverride?.itemTrailingKbds, item.ui?.itemTrailingKbds] })">
|
|
84
|
+
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="item.ui?.itemTrailingKbdsSize || props.uiOverride?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
85
85
|
</span>
|
|
86
86
|
</slot>
|
|
87
87
|
|
|
88
88
|
<DropdownMenu.ItemIndicator as-child>
|
|
89
|
-
<UIcon :name="checkedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon, color: item?.color })" />
|
|
89
|
+
<UIcon :name="checkedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: [uiOverride?.itemTrailingIcon, item.ui?.itemTrailingIcon], color: item?.color })" />
|
|
90
90
|
</DropdownMenu.ItemIndicator>
|
|
91
91
|
</span>
|
|
92
92
|
</slot>
|
|
@@ -96,70 +96,72 @@ const groups = computed(
|
|
|
96
96
|
<component :is="sub ? DropdownMenu.SubContent : DropdownMenu.Content" :class="props.class" v-bind="contentProps">
|
|
97
97
|
<slot name="content-top" />
|
|
98
98
|
|
|
99
|
-
<
|
|
100
|
-
<
|
|
101
|
-
<
|
|
102
|
-
<
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
<DropdownMenu.
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
<div role="presentation" :class="ui.viewport({ class: props.ui?.viewport })">
|
|
100
|
+
<DropdownMenu.Group v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" :class="ui.group({ class: uiOverride?.group })">
|
|
101
|
+
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
102
|
+
<DropdownMenu.Label v-if="item.type === 'label'" :class="ui.label({ class: [uiOverride?.label, item.ui?.label, item.class] })">
|
|
103
|
+
<ReuseItemTemplate :item="item" :index="index" />
|
|
104
|
+
</DropdownMenu.Label>
|
|
105
|
+
<DropdownMenu.Separator v-else-if="item.type === 'separator'" :class="ui.separator({ class: [uiOverride?.separator, item.ui?.separator, item.class] })" />
|
|
106
|
+
<DropdownMenu.Sub v-else-if="item?.children?.length" :open="item.open" :default-open="item.defaultOpen">
|
|
107
|
+
<DropdownMenu.SubTrigger
|
|
108
|
+
as="button"
|
|
109
|
+
type="button"
|
|
110
|
+
:disabled="item.disabled"
|
|
111
|
+
:text-value="get(item, props.labelKey)"
|
|
112
|
+
:class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], color: item?.color })"
|
|
113
|
+
>
|
|
114
|
+
<ReuseItemTemplate :item="item" :index="index" />
|
|
115
|
+
</DropdownMenu.SubTrigger>
|
|
116
|
+
|
|
117
|
+
<UDropdownMenuContent
|
|
118
|
+
sub
|
|
119
|
+
:class="props.class"
|
|
120
|
+
:ui="ui"
|
|
121
|
+
:ui-override="uiOverride"
|
|
122
|
+
:portal="portal"
|
|
123
|
+
:items="item.children"
|
|
124
|
+
align="start"
|
|
125
|
+
:align-offset="-4"
|
|
126
|
+
:side-offset="3"
|
|
127
|
+
:label-key="labelKey"
|
|
128
|
+
:checked-icon="checkedIcon"
|
|
129
|
+
:loading-icon="loadingIcon"
|
|
130
|
+
:external-icon="externalIcon"
|
|
131
|
+
v-bind="item.content"
|
|
132
|
+
>
|
|
133
|
+
<template v-for="(_, name) in proxySlots" #[name]="slotData">
|
|
134
|
+
<slot :name="name" v-bind="slotData" />
|
|
135
|
+
</template>
|
|
136
|
+
</UDropdownMenuContent>
|
|
137
|
+
</DropdownMenu.Sub>
|
|
138
|
+
<DropdownMenu.CheckboxItem
|
|
139
|
+
v-else-if="item.type === 'checkbox'"
|
|
140
|
+
:model-value="item.checked"
|
|
109
141
|
:disabled="item.disabled"
|
|
110
142
|
:text-value="get(item, props.labelKey)"
|
|
111
|
-
:class="ui.item({ class: uiOverride?.item, color: item?.color })"
|
|
143
|
+
:class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], color: item?.color })"
|
|
144
|
+
@update:model-value="item.onUpdateChecked"
|
|
145
|
+
@select="item.onSelect"
|
|
112
146
|
>
|
|
113
147
|
<ReuseItemTemplate :item="item" :index="index" />
|
|
114
|
-
</DropdownMenu.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
:
|
|
119
|
-
:
|
|
120
|
-
|
|
121
|
-
:portal="portal"
|
|
122
|
-
:items="item.children"
|
|
123
|
-
align="start"
|
|
124
|
-
:align-offset="-4"
|
|
125
|
-
:side-offset="3"
|
|
126
|
-
:label-key="labelKey"
|
|
127
|
-
:checked-icon="checkedIcon"
|
|
128
|
-
:loading-icon="loadingIcon"
|
|
129
|
-
:external-icon="externalIcon"
|
|
130
|
-
v-bind="item.content"
|
|
148
|
+
</DropdownMenu.CheckboxItem>
|
|
149
|
+
<DropdownMenu.Item
|
|
150
|
+
v-else
|
|
151
|
+
as-child
|
|
152
|
+
:disabled="item.disabled"
|
|
153
|
+
:text-value="get(item, props.labelKey)"
|
|
154
|
+
@select="item.onSelect"
|
|
131
155
|
>
|
|
132
|
-
<
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
:text-value="get(item, props.labelKey)"
|
|
142
|
-
:class="ui.item({ class: [uiOverride?.item, item.class], color: item?.color })"
|
|
143
|
-
@update:model-value="item.onUpdateChecked"
|
|
144
|
-
@select="item.onSelect"
|
|
145
|
-
>
|
|
146
|
-
<ReuseItemTemplate :item="item" :index="index" />
|
|
147
|
-
</DropdownMenu.CheckboxItem>
|
|
148
|
-
<DropdownMenu.Item
|
|
149
|
-
v-else
|
|
150
|
-
as-child
|
|
151
|
-
:disabled="item.disabled"
|
|
152
|
-
:text-value="get(item, props.labelKey)"
|
|
153
|
-
@select="item.onSelect"
|
|
154
|
-
>
|
|
155
|
-
<ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
|
|
156
|
-
<ULinkBase v-bind="slotProps" :class="ui.item({ class: [uiOverride?.item, item.class], color: item?.color, active })">
|
|
157
|
-
<ReuseItemTemplate :item="item" :active="active" :index="index" />
|
|
158
|
-
</ULinkBase>
|
|
159
|
-
</ULink>
|
|
160
|
-
</DropdownMenu.Item>
|
|
161
|
-
</template>
|
|
162
|
-
</DropdownMenu.Group>
|
|
156
|
+
<ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
|
|
157
|
+
<ULinkBase v-bind="slotProps" :class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], color: item?.color, active })">
|
|
158
|
+
<ReuseItemTemplate :item="item" :active="active" :index="index" />
|
|
159
|
+
</ULinkBase>
|
|
160
|
+
</ULink>
|
|
161
|
+
</DropdownMenu.Item>
|
|
162
|
+
</template>
|
|
163
|
+
</DropdownMenu.Group>
|
|
164
|
+
</div>
|
|
163
165
|
|
|
164
166
|
<slot />
|
|
165
167
|
|
|
@@ -50,7 +50,7 @@ provide(formFieldInjectionKey, computed(() => ({
|
|
|
50
50
|
</script>
|
|
51
51
|
|
|
52
52
|
<template>
|
|
53
|
-
<Primitive :as="as" :class="ui.root({ class: [props.
|
|
53
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
54
54
|
<div :class="ui.wrapper({ class: props.ui?.wrapper })">
|
|
55
55
|
<div v-if="label || !!slots.label" :class="ui.labelWrapper({ class: props.ui?.labelWrapper })">
|
|
56
56
|
<Label :for="id" :class="ui.label({ class: props.ui?.label })">
|
|
@@ -75,16 +75,16 @@ provide(formFieldInjectionKey, computed(() => ({
|
|
|
75
75
|
<div :class="[(label || !!slots.label || description || !!slots.description) && ui.container({ class: props.ui?.container })]">
|
|
76
76
|
<slot :error="error" />
|
|
77
77
|
|
|
78
|
-
<
|
|
78
|
+
<div v-if="typeof error === 'string' && error || !!slots.error" :id="`${ariaId}-error`" :class="ui.error({ class: props.ui?.error })">
|
|
79
79
|
<slot name="error" :error="error">
|
|
80
80
|
{{ error }}
|
|
81
81
|
</slot>
|
|
82
|
-
</
|
|
83
|
-
<
|
|
82
|
+
</div>
|
|
83
|
+
<div v-else-if="help || !!slots.help" :class="ui.help({ class: props.ui?.help })">
|
|
84
84
|
<slot name="help" :help="help">
|
|
85
85
|
{{ help }}
|
|
86
86
|
</slot>
|
|
87
|
-
</
|
|
87
|
+
</div>
|
|
88
88
|
</div>
|
|
89
89
|
</Primitive>
|
|
90
90
|
</template>
|
|
@@ -29,6 +29,7 @@ const props = defineProps({
|
|
|
29
29
|
autofocusDelay: { type: Number, required: false, default: 0 },
|
|
30
30
|
disabled: { type: Boolean, required: false },
|
|
31
31
|
highlight: { type: Boolean, required: false },
|
|
32
|
+
modelModifiers: { type: Object, required: false },
|
|
32
33
|
class: { type: null, required: false },
|
|
33
34
|
ui: { type: null, required: false },
|
|
34
35
|
icon: { type: String, required: false },
|
|
@@ -42,7 +43,7 @@ const props = defineProps({
|
|
|
42
43
|
});
|
|
43
44
|
const emits = defineEmits(["update:modelValue", "blur", "change"]);
|
|
44
45
|
const slots = defineSlots();
|
|
45
|
-
const [modelValue, modelModifiers] = defineModel({ type:
|
|
46
|
+
const [modelValue, modelModifiers] = defineModel({ type: null });
|
|
46
47
|
const appConfig = useAppConfig();
|
|
47
48
|
const { emitFormBlur, emitFormInput, emitFormChange, size: formGroupSize, color, id, name, highlight, disabled, emitFormFocus, ariaAttrs } = useFormField(props, { deferInputValidation: true });
|
|
48
49
|
const { orientation, size: buttonGroupSize } = useButtonGroup(props);
|
|
@@ -109,7 +110,7 @@ defineExpose({
|
|
|
109
110
|
</script>
|
|
110
111
|
|
|
111
112
|
<template>
|
|
112
|
-
<Primitive :as="as" :class="ui.root({ class: [props.
|
|
113
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
113
114
|
<input
|
|
114
115
|
:id="id"
|
|
115
116
|
ref="inputRef"
|