@nuxt/ui 3.1.2 → 3.2.0
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/avatar.ts +1 -1
- package/.nuxt/ui/card.ts +1 -1
- package/.nuxt/ui/carousel.ts +1 -1
- package/.nuxt/ui/checkbox-group.ts +1 -1
- package/.nuxt/ui/command-palette.ts +1 -0
- package/.nuxt/ui/context-menu.ts +2 -1
- package/.nuxt/ui/drawer.ts +1 -1
- package/.nuxt/ui/dropdown-menu.ts +2 -1
- package/.nuxt/ui/index.ts +2 -0
- package/.nuxt/ui/input-menu.ts +26 -12
- package/.nuxt/ui/input-tags.ts +310 -0
- package/.nuxt/ui/modal.ts +1 -1
- package/.nuxt/ui/navigation-menu.ts +43 -34
- package/.nuxt/ui/radio-group.ts +1 -1
- package/.nuxt/ui/select-menu.ts +13 -8
- package/.nuxt/ui/select.ts +13 -8
- package/.nuxt/ui/table.ts +3 -2
- package/.nuxt/ui/timeline.ts +321 -0
- package/.nuxt/ui/toaster.ts +1 -1
- package/.nuxt/ui/tooltip.ts +1 -1
- package/.nuxt/ui.css +4 -1
- package/cli/templates.mjs +7 -4
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -2
- package/dist/runtime/components/Alert.vue +0 -1
- package/dist/runtime/components/Avatar.vue +10 -2
- package/dist/runtime/components/Avatar.vue.d.ts +2 -0
- package/dist/runtime/components/Calendar.vue +4 -1
- package/dist/runtime/components/Carousel.vue +1 -2
- package/dist/runtime/components/Checkbox.vue +1 -1
- package/dist/runtime/components/CommandPalette.vue +80 -16
- package/dist/runtime/components/CommandPalette.vue.d.ts +32 -8
- package/dist/runtime/components/ContextMenuContent.vue +58 -56
- package/dist/runtime/components/ContextMenuContent.vue.d.ts +4 -20
- package/dist/runtime/components/Drawer.vue +15 -1
- package/dist/runtime/components/DropdownMenuContent.vue +60 -58
- 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/Input.vue +1 -0
- package/dist/runtime/components/Input.vue.d.ts +7 -0
- package/dist/runtime/components/InputMenu.vue +3 -3
- package/dist/runtime/components/InputMenu.vue.d.ts +4 -4
- package/dist/runtime/components/InputNumber.vue +3 -2
- package/dist/runtime/components/InputNumber.vue.d.ts +1 -1
- package/dist/runtime/components/InputTags.vue +159 -0
- package/dist/runtime/components/InputTags.vue.d.ts +183 -0
- package/dist/runtime/components/Modal.vue +16 -15
- package/dist/runtime/components/Modal.vue.d.ts +17 -4
- package/dist/runtime/components/NavigationMenu.vue +85 -26
- package/dist/runtime/components/NavigationMenu.vue.d.ts +30 -17
- package/dist/runtime/components/OverlayProvider.vue +2 -2
- package/dist/runtime/components/Pagination.vue +1 -1
- package/dist/runtime/components/Pagination.vue.d.ts +0 -1
- package/dist/runtime/components/PinInput.vue +4 -3
- package/dist/runtime/components/PinInput.vue.d.ts +22 -19
- package/dist/runtime/components/Popover.vue +4 -0
- package/dist/runtime/components/Popover.vue.d.ts +1 -0
- package/dist/runtime/components/Progress.vue +2 -1
- package/dist/runtime/components/Progress.vue.d.ts +1 -1
- package/dist/runtime/components/RadioGroup.vue +2 -2
- package/dist/runtime/components/Select.vue +26 -7
- package/dist/runtime/components/Select.vue.d.ts +107 -1
- package/dist/runtime/components/SelectMenu.vue +27 -8
- package/dist/runtime/components/SelectMenu.vue.d.ts +105 -1
- package/dist/runtime/components/Slideover.vue +23 -15
- package/dist/runtime/components/Slideover.vue.d.ts +17 -4
- package/dist/runtime/components/Table.vue +7 -1
- package/dist/runtime/components/Table.vue.d.ts +10 -8
- package/dist/runtime/components/Tabs.vue +13 -2
- package/dist/runtime/components/Tabs.vue.d.ts +4 -1
- package/dist/runtime/components/Textarea.vue +4 -1
- package/dist/runtime/components/Textarea.vue.d.ts +11 -4
- package/dist/runtime/components/Timeline.vue +92 -0
- package/dist/runtime/components/Timeline.vue.d.ts +70 -0
- package/dist/runtime/components/Toast.vue +4 -5
- package/dist/runtime/components/Tree.vue +3 -2
- package/dist/runtime/components/Tree.vue.d.ts +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 +2 -2
- package/dist/runtime/composables/useOverlay.d.ts +2 -1
- package/dist/runtime/composables/useOverlay.js +7 -6
- package/dist/runtime/locale/ar.js +2 -1
- package/dist/runtime/locale/az.js +2 -1
- package/dist/runtime/locale/bg.js +2 -1
- package/dist/runtime/locale/bn.js +2 -1
- package/dist/runtime/locale/ca.js +2 -1
- package/dist/runtime/locale/ckb.js +2 -1
- package/dist/runtime/locale/cs.js +2 -1
- package/dist/runtime/locale/da.js +2 -1
- package/dist/runtime/locale/de.js +2 -1
- package/dist/runtime/locale/el.js +2 -1
- package/dist/runtime/locale/en.js +2 -1
- package/dist/runtime/locale/es.js +2 -1
- package/dist/runtime/locale/et.js +2 -1
- package/dist/runtime/locale/fa_ir.js +2 -1
- package/dist/runtime/locale/fi.js +2 -1
- package/dist/runtime/locale/fr.js +2 -1
- package/dist/runtime/locale/he.js +2 -1
- package/dist/runtime/locale/hi.js +2 -1
- package/dist/runtime/locale/hu.js +2 -1
- package/dist/runtime/locale/hy.js +2 -1
- package/dist/runtime/locale/id.js +2 -1
- package/dist/runtime/locale/index.d.ts +7 -2
- package/dist/runtime/locale/index.js +7 -2
- package/dist/runtime/locale/it.js +2 -1
- package/dist/runtime/locale/ja.js +2 -1
- package/dist/runtime/locale/kk.js +2 -1
- package/dist/runtime/locale/km.js +2 -1
- package/dist/runtime/locale/ko.js +2 -1
- package/dist/runtime/locale/ky.d.ts +3 -0
- package/dist/runtime/locale/ky.js +55 -0
- package/dist/runtime/locale/lb.d.ts +3 -0
- package/dist/runtime/locale/lb.js +55 -0
- package/dist/runtime/locale/lt.d.ts +3 -0
- package/dist/runtime/locale/lt.js +55 -0
- package/dist/runtime/locale/mn.d.ts +3 -0
- package/dist/runtime/locale/mn.js +55 -0
- package/dist/runtime/locale/ms.d.ts +3 -0
- package/dist/runtime/locale/ms.js +55 -0
- package/dist/runtime/locale/nb_no.js +2 -1
- package/dist/runtime/locale/nl.js +2 -1
- package/dist/runtime/locale/pl.js +2 -1
- package/dist/runtime/locale/pt.js +2 -1
- package/dist/runtime/locale/pt_br.js +2 -1
- package/dist/runtime/locale/ro.js +2 -1
- package/dist/runtime/locale/ru.js +2 -1
- package/dist/runtime/locale/sk.js +2 -1
- package/dist/runtime/locale/sl.js +2 -1
- package/dist/runtime/locale/sv.js +2 -1
- package/dist/runtime/locale/th.js +2 -1
- package/dist/runtime/locale/tj.js +2 -1
- package/dist/runtime/locale/tr.js +2 -1
- package/dist/runtime/locale/ug_cn.js +2 -1
- package/dist/runtime/locale/uk.js +2 -1
- package/dist/runtime/locale/ur.js +2 -1
- package/dist/runtime/locale/uz.js +2 -1
- package/dist/runtime/locale/vi.js +2 -1
- package/dist/runtime/locale/zh_cn.js +2 -1
- package/dist/runtime/locale/zh_tw.js +2 -1
- package/dist/runtime/types/form.d.ts +11 -10
- package/dist/runtime/types/index.d.ts +2 -0
- package/dist/runtime/types/index.js +2 -0
- package/dist/runtime/types/locale.d.ts +1 -0
- package/dist/runtime/types/utils.d.ts +3 -0
- package/dist/shared/{ui.BvUP-pSb.mjs → ui.BPVxSPGY.mjs} +332 -62
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +35 -36
|
@@ -31,31 +31,15 @@ interface ContextMenuContentProps<T extends ArrayOrNested<ContextMenuItem>> exte
|
|
|
31
31
|
declare const _default: <T extends ArrayOrNested<ContextMenuItem>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
32
32
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
33
33
|
readonly onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
34
|
-
readonly onPointerDownOutside?: ((event:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
readonly onFocusOutside?: ((event: CustomEvent<{
|
|
38
|
-
originalEvent: FocusEvent;
|
|
39
|
-
}>) => any) | undefined;
|
|
40
|
-
readonly onInteractOutside?: ((event: CustomEvent<{
|
|
41
|
-
originalEvent: PointerEvent;
|
|
42
|
-
}> | CustomEvent<{
|
|
43
|
-
originalEvent: FocusEvent;
|
|
44
|
-
}>) => any) | undefined;
|
|
34
|
+
readonly onPointerDownOutside?: ((event: import("reka-ui").PointerDownOutsideEvent) => any) | undefined;
|
|
35
|
+
readonly onFocusOutside?: ((event: import("reka-ui").FocusOutsideEvent) => any) | undefined;
|
|
36
|
+
readonly onInteractOutside?: ((event: import("reka-ui").PointerDownOutsideEvent | import("reka-ui").FocusOutsideEvent) => any) | undefined;
|
|
45
37
|
readonly onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
46
38
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onEscapeKeyDown" | "onPointerDownOutside" | "onFocusOutside" | "onInteractOutside" | "onCloseAutoFocus"> & ContextMenuContentProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
47
39
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
48
40
|
attrs: any;
|
|
49
41
|
slots: ContextMenuSlots<T>;
|
|
50
|
-
emit: ((evt: "escapeKeyDown", event: KeyboardEvent) => void) & ((evt: "pointerDownOutside", event:
|
|
51
|
-
originalEvent: PointerEvent;
|
|
52
|
-
}>) => void) & ((evt: "focusOutside", event: CustomEvent<{
|
|
53
|
-
originalEvent: FocusEvent;
|
|
54
|
-
}>) => void) & ((evt: "interactOutside", event: CustomEvent<{
|
|
55
|
-
originalEvent: PointerEvent;
|
|
56
|
-
}> | CustomEvent<{
|
|
57
|
-
originalEvent: FocusEvent;
|
|
58
|
-
}>) => void) & ((evt: "closeAutoFocus", event: Event) => void);
|
|
42
|
+
emit: ((evt: "escapeKeyDown", event: KeyboardEvent) => void) & ((evt: "pointerDownOutside", event: import("reka-ui").PointerDownOutsideEvent) => void) & ((evt: "focusOutside", event: import("reka-ui").FocusOutsideEvent) => void) & ((evt: "interactOutside", event: import("reka-ui").PointerDownOutsideEvent | import("reka-ui").FocusOutsideEvent) => void) & ((evt: "closeAutoFocus", event: Event) => void);
|
|
59
43
|
}>) => import("vue").VNode & {
|
|
60
44
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
61
45
|
};
|
|
@@ -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 })">
|
|
@@ -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
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.ui?.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.ui?.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
|
|
|
@@ -34,31 +34,15 @@ type DropdownMenuContentSlots<T extends ArrayOrNested<DropdownMenuItem>> = Omit<
|
|
|
34
34
|
declare const _default: <T extends ArrayOrNested<DropdownMenuItem>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
35
35
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
36
36
|
readonly onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
37
|
-
readonly onPointerDownOutside?: ((event:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
readonly onFocusOutside?: ((event: CustomEvent<{
|
|
41
|
-
originalEvent: FocusEvent;
|
|
42
|
-
}>) => any) | undefined;
|
|
43
|
-
readonly onInteractOutside?: ((event: CustomEvent<{
|
|
44
|
-
originalEvent: PointerEvent;
|
|
45
|
-
}> | CustomEvent<{
|
|
46
|
-
originalEvent: FocusEvent;
|
|
47
|
-
}>) => any) | undefined;
|
|
37
|
+
readonly onPointerDownOutside?: ((event: import("reka-ui").PointerDownOutsideEvent) => any) | undefined;
|
|
38
|
+
readonly onFocusOutside?: ((event: import("reka-ui").FocusOutsideEvent) => any) | undefined;
|
|
39
|
+
readonly onInteractOutside?: ((event: import("reka-ui").PointerDownOutsideEvent | import("reka-ui").FocusOutsideEvent) => any) | undefined;
|
|
48
40
|
readonly onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
49
41
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onEscapeKeyDown" | "onPointerDownOutside" | "onFocusOutside" | "onInteractOutside" | "onCloseAutoFocus"> & DropdownMenuContentProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
50
42
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
51
43
|
attrs: any;
|
|
52
44
|
slots: DropdownMenuContentSlots<T>;
|
|
53
|
-
emit: ((evt: "escapeKeyDown", event: KeyboardEvent) => void) & ((evt: "pointerDownOutside", event:
|
|
54
|
-
originalEvent: PointerEvent;
|
|
55
|
-
}>) => void) & ((evt: "focusOutside", event: CustomEvent<{
|
|
56
|
-
originalEvent: FocusEvent;
|
|
57
|
-
}>) => void) & ((evt: "interactOutside", event: CustomEvent<{
|
|
58
|
-
originalEvent: PointerEvent;
|
|
59
|
-
}> | CustomEvent<{
|
|
60
|
-
originalEvent: FocusEvent;
|
|
61
|
-
}>) => void) & ((evt: "closeAutoFocus", event: Event) => void);
|
|
45
|
+
emit: ((evt: "escapeKeyDown", event: KeyboardEvent) => void) & ((evt: "pointerDownOutside", event: import("reka-ui").PointerDownOutsideEvent) => void) & ((evt: "focusOutside", event: import("reka-ui").FocusOutsideEvent) => void) & ((evt: "interactOutside", event: import("reka-ui").PointerDownOutsideEvent | import("reka-ui").FocusOutsideEvent) => void) & ((evt: "closeAutoFocus", event: Event) => void);
|
|
62
46
|
}>) => import("vue").VNode & {
|
|
63
47
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
64
48
|
};
|
|
@@ -3,7 +3,7 @@ import theme from "#build/ui/form";
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
|
-
import { provide, inject, nextTick, ref, onUnmounted, onMounted, computed, useId, readonly } from "vue";
|
|
6
|
+
import { provide, inject, nextTick, ref, onUnmounted, onMounted, computed, useId, readonly, reactive } from "vue";
|
|
7
7
|
import { useEventBus } from "@vueuse/core";
|
|
8
8
|
import { useAppConfig } from "#imports";
|
|
9
9
|
import { formOptionsInjectionKey, formInputsInjectionKey, formBusInjectionKey, formLoadingInjectionKey } from "../composables/useFormField";
|
|
@@ -20,7 +20,7 @@ const props = defineProps({
|
|
|
20
20
|
} },
|
|
21
21
|
disabled: { type: Boolean, required: false },
|
|
22
22
|
validateOnInputDelay: { type: Number, required: false, default: 300 },
|
|
23
|
-
transform: { type:
|
|
23
|
+
transform: { type: null, required: false, default: () => true },
|
|
24
24
|
attach: { type: Boolean, required: false, default: true },
|
|
25
25
|
loadingAuto: { type: Boolean, required: false, default: true },
|
|
26
26
|
class: { type: null, required: false },
|
|
@@ -80,9 +80,9 @@ const errors = ref([]);
|
|
|
80
80
|
provide("form-errors", errors);
|
|
81
81
|
const inputs = ref({});
|
|
82
82
|
provide(formInputsInjectionKey, inputs);
|
|
83
|
-
const dirtyFields = /* @__PURE__ */ new Set();
|
|
84
|
-
const touchedFields = /* @__PURE__ */ new Set();
|
|
85
|
-
const blurredFields = /* @__PURE__ */ new Set();
|
|
83
|
+
const dirtyFields = reactive(/* @__PURE__ */ new Set());
|
|
84
|
+
const touchedFields = reactive(/* @__PURE__ */ new Set());
|
|
85
|
+
const blurredFields = reactive(/* @__PURE__ */ new Set());
|
|
86
86
|
function resolveErrorIds(errs) {
|
|
87
87
|
return errs.map((err) => ({
|
|
88
88
|
...err,
|
|
@@ -205,6 +205,6 @@ defineExpose({
|
|
|
205
205
|
:class="ui({ class: props.class })"
|
|
206
206
|
@submit.prevent="onSubmitWrapper"
|
|
207
207
|
>
|
|
208
|
-
<slot :errors="errors" />
|
|
208
|
+
<slot :errors="errors" :loading="loading" />
|
|
209
209
|
</component>
|
|
210
210
|
</template>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FormSchema, FormError, FormInputEvents, FormErrorEvent, FormSubmitEvent, Form, InferInput,
|
|
2
|
-
export interface FormProps<S extends FormSchema> {
|
|
1
|
+
import type { FormSchema, FormError, FormInputEvents, FormErrorEvent, FormSubmitEvent, Form, InferInput, FormData } from '../types/form';
|
|
2
|
+
export interface FormProps<S extends FormSchema, T extends boolean = true> {
|
|
3
3
|
id?: string | number;
|
|
4
4
|
/** Schema to validate the form state. Supports Standard Schema objects, Yup, Joi, and Superstructs. */
|
|
5
5
|
schema?: S;
|
|
@@ -27,7 +27,7 @@ export interface FormProps<S extends FormSchema> {
|
|
|
27
27
|
* If true, schema transformations will be applied to the state on submit.
|
|
28
28
|
* @defaultValue `true`
|
|
29
29
|
*/
|
|
30
|
-
transform?:
|
|
30
|
+
transform?: T;
|
|
31
31
|
/**
|
|
32
32
|
* If true, this form will attach to its parent Form (if any) and validate at the same time.
|
|
33
33
|
* @defaultValue `true`
|
|
@@ -40,26 +40,27 @@ export interface FormProps<S extends FormSchema> {
|
|
|
40
40
|
*/
|
|
41
41
|
loadingAuto?: boolean;
|
|
42
42
|
class?: any;
|
|
43
|
-
onSubmit?: ((event: FormSubmitEvent<
|
|
43
|
+
onSubmit?: ((event: FormSubmitEvent<FormData<S, T>>) => void | Promise<void>) | (() => void | Promise<void>);
|
|
44
44
|
}
|
|
45
|
-
export interface FormEmits<S extends FormSchema> {
|
|
46
|
-
(e: 'submit', payload: FormSubmitEvent<
|
|
45
|
+
export interface FormEmits<S extends FormSchema, T extends boolean = true> {
|
|
46
|
+
(e: 'submit', payload: FormSubmitEvent<FormData<S, T>>): void;
|
|
47
47
|
(e: 'error', payload: FormErrorEvent): void;
|
|
48
48
|
}
|
|
49
49
|
export interface FormSlots {
|
|
50
50
|
default(props?: {
|
|
51
51
|
errors: FormError[];
|
|
52
|
+
loading: boolean;
|
|
52
53
|
}): any;
|
|
53
54
|
}
|
|
54
|
-
declare const _default: <S extends FormSchema>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
55
|
+
declare const _default: <S extends FormSchema, T extends boolean = true>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
55
56
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
56
57
|
readonly onError?: ((payload: FormErrorEvent) => any) | undefined;
|
|
57
|
-
readonly onSubmit?: ((payload: FormSubmitEvent<
|
|
58
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onError" | "onSubmit"> & FormProps<S> & Partial<{}>> & import("vue").PublicProps;
|
|
59
|
-
expose(exposed: import("vue").ShallowUnwrapRef<Form<
|
|
58
|
+
readonly onSubmit?: ((payload: FormSubmitEvent<FormData<S, T>>) => any) | undefined;
|
|
59
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onError" | "onSubmit"> & FormProps<S, T> & Partial<{}>> & import("vue").PublicProps;
|
|
60
|
+
expose(exposed: import("vue").ShallowUnwrapRef<Form<S>>): void;
|
|
60
61
|
attrs: any;
|
|
61
62
|
slots: FormSlots;
|
|
62
|
-
emit: FormEmits<S>;
|
|
63
|
+
emit: FormEmits<S, T>;
|
|
63
64
|
}>) => import("vue").VNode & {
|
|
64
65
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
65
66
|
};
|
|
@@ -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 },
|
|
@@ -34,6 +34,13 @@ export interface InputProps extends UseComponentIconsProps {
|
|
|
34
34
|
disabled?: boolean;
|
|
35
35
|
/** Highlight the ring color like a focus state. */
|
|
36
36
|
highlight?: boolean;
|
|
37
|
+
modelModifiers?: {
|
|
38
|
+
string?: boolean;
|
|
39
|
+
number?: boolean;
|
|
40
|
+
trim?: boolean;
|
|
41
|
+
lazy?: boolean;
|
|
42
|
+
nullify?: boolean;
|
|
43
|
+
};
|
|
37
44
|
class?: any;
|
|
38
45
|
ui?: Input['slots'];
|
|
39
46
|
}
|
|
@@ -4,7 +4,7 @@ import theme from "#build/ui/input-menu";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed, ref, toRef, onMounted, toRaw } from "vue";
|
|
7
|
-
import { ComboboxRoot, ComboboxArrow, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxPortal, ComboboxContent,
|
|
7
|
+
import { ComboboxRoot, ComboboxArrow, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxPortal, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxLabel, ComboboxSeparator, ComboboxItem, ComboboxItemIndicator, TagsInputRoot, TagsInputItem, TagsInputItemText, TagsInputItemDelete, TagsInputInput, useForwardPropsEmits, useFilter } from "reka-ui";
|
|
8
8
|
import { defu } from "defu";
|
|
9
9
|
import { isEqual } from "ohash/utils";
|
|
10
10
|
import { reactivePick, createReusableTemplate } from "@vueuse/core";
|
|
@@ -311,7 +311,7 @@ defineExpose({
|
|
|
311
311
|
</slot>
|
|
312
312
|
</ComboboxEmpty>
|
|
313
313
|
|
|
314
|
-
<
|
|
314
|
+
<div role="presentation" :class="ui.viewport({ class: props.ui?.viewport })">
|
|
315
315
|
<ReuseCreateItemTemplate v-if="createItem && createItemPosition === 'top'" />
|
|
316
316
|
|
|
317
317
|
<ComboboxGroup v-for="(group, groupIndex) in filteredGroups" :key="`group-${groupIndex}`" :class="ui.group({ class: props.ui?.group })">
|
|
@@ -362,7 +362,7 @@ defineExpose({
|
|
|
362
362
|
</ComboboxGroup>
|
|
363
363
|
|
|
364
364
|
<ReuseCreateItemTemplate v-if="createItem && createItemPosition === 'bottom'" />
|
|
365
|
-
</
|
|
365
|
+
</div>
|
|
366
366
|
|
|
367
367
|
<slot name="content-bottom" />
|
|
368
368
|
|
|
@@ -301,11 +301,11 @@ declare const _default: <T extends ArrayOrNested<InputMenuItem>, VK extends GetI
|
|
|
301
301
|
"onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
|
|
302
302
|
}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
303
303
|
$slots: Readonly<{
|
|
304
|
-
default
|
|
304
|
+
default?: (props: {
|
|
305
305
|
modelValue: string | undefined;
|
|
306
306
|
}) => any;
|
|
307
307
|
}> & {
|
|
308
|
-
default
|
|
308
|
+
default?: (props: {
|
|
309
309
|
modelValue: string | undefined;
|
|
310
310
|
}) => any;
|
|
311
311
|
};
|
|
@@ -465,11 +465,11 @@ declare const _default: <T extends ArrayOrNested<InputMenuItem>, VK extends GetI
|
|
|
465
465
|
"onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
|
|
466
466
|
}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
467
467
|
$slots: Readonly<{
|
|
468
|
-
default
|
|
468
|
+
default?: (props: {
|
|
469
469
|
modelValue: string | undefined;
|
|
470
470
|
}) => any;
|
|
471
471
|
}> & {
|
|
472
|
-
default
|
|
472
|
+
default?: (props: {
|
|
473
473
|
modelValue: string | undefined;
|
|
474
474
|
}) => any;
|
|
475
475
|
};
|
|
@@ -43,13 +43,14 @@ const props = defineProps({
|
|
|
43
43
|
id: { type: String, required: false },
|
|
44
44
|
name: { type: String, required: false },
|
|
45
45
|
formatOptions: { type: null, required: false },
|
|
46
|
-
disableWheelChange: { type: Boolean, required: false }
|
|
46
|
+
disableWheelChange: { type: Boolean, required: false },
|
|
47
|
+
invertWheelChange: { type: Boolean, required: false }
|
|
47
48
|
});
|
|
48
49
|
const emits = defineEmits(["update:modelValue", "blur", "change"]);
|
|
49
50
|
defineSlots();
|
|
50
51
|
const { t, code: codeLocale } = useLocale();
|
|
51
52
|
const appConfig = useAppConfig();
|
|
52
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, "as", "modelValue", "defaultValue", "min", "max", "step", "stepSnapping", "formatOptions", "disableWheelChange"), emits);
|
|
53
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, "as", "modelValue", "defaultValue", "min", "max", "step", "stepSnapping", "formatOptions", "disableWheelChange", "invertWheelChange"), emits);
|
|
53
54
|
const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, id, color, size: formGroupSize, name, highlight, disabled, ariaAttrs } = useFormField(props);
|
|
54
55
|
const { orientation, size: buttonGroupSize } = useButtonGroup(props);
|
|
55
56
|
const locale = computed(() => props.locale || codeLocale.value);
|
|
@@ -4,7 +4,7 @@ import theme from '#build/ui/input-number';
|
|
|
4
4
|
import type { ButtonProps } from '../types';
|
|
5
5
|
import type { ComponentConfig } from '../types/utils';
|
|
6
6
|
type InputNumber = ComponentConfig<typeof theme, AppConfig, 'inputNumber'>;
|
|
7
|
-
export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue' | 'defaultValue' | 'min' | 'max' | 'step' | 'stepSnapping' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions' | 'disableWheelChange'> {
|
|
7
|
+
export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue' | 'defaultValue' | 'min' | 'max' | 'step' | 'stepSnapping' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions' | 'disableWheelChange' | 'invertWheelChange'> {
|
|
8
8
|
/**
|
|
9
9
|
* The element or component this component should render as.
|
|
10
10
|
* @defaultValue 'div'
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/input-tags";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed, ref, onMounted, toRaw } from "vue";
|
|
7
|
+
import { TagsInputRoot, TagsInputItem, TagsInputItemText, TagsInputItemDelete, TagsInputInput, useForwardPropsEmits } from "reka-ui";
|
|
8
|
+
import { reactivePick } from "@vueuse/core";
|
|
9
|
+
import { useAppConfig } from "#imports";
|
|
10
|
+
import { useButtonGroup } from "../composables/useButtonGroup";
|
|
11
|
+
import { useComponentIcons } from "../composables/useComponentIcons";
|
|
12
|
+
import { useFormField } from "../composables/useFormField";
|
|
13
|
+
import { tv } from "../utils/tv";
|
|
14
|
+
import UIcon from "./Icon.vue";
|
|
15
|
+
import UAvatar from "./Avatar.vue";
|
|
16
|
+
defineOptions({ inheritAttrs: false });
|
|
17
|
+
const props = defineProps({
|
|
18
|
+
as: { type: null, required: false },
|
|
19
|
+
placeholder: { type: String, required: false },
|
|
20
|
+
color: { type: null, required: false },
|
|
21
|
+
variant: { type: null, required: false },
|
|
22
|
+
size: { type: null, required: false },
|
|
23
|
+
autofocus: { type: Boolean, required: false },
|
|
24
|
+
autofocusDelay: { type: Number, required: false, default: 0 },
|
|
25
|
+
deleteIcon: { type: String, required: false },
|
|
26
|
+
highlight: { type: Boolean, required: false },
|
|
27
|
+
class: { type: null, required: false },
|
|
28
|
+
ui: { type: null, required: false },
|
|
29
|
+
modelValue: { type: [Array, null], required: false },
|
|
30
|
+
defaultValue: { type: Array, required: false },
|
|
31
|
+
addOnPaste: { type: Boolean, required: false },
|
|
32
|
+
addOnTab: { type: Boolean, required: false },
|
|
33
|
+
addOnBlur: { type: Boolean, required: false },
|
|
34
|
+
duplicate: { type: Boolean, required: false },
|
|
35
|
+
disabled: { type: Boolean, required: false },
|
|
36
|
+
delimiter: { type: null, required: false },
|
|
37
|
+
max: { type: Number, required: false },
|
|
38
|
+
id: { type: String, required: false },
|
|
39
|
+
convertValue: { type: Function, required: false },
|
|
40
|
+
displayValue: { type: Function, required: false },
|
|
41
|
+
name: { type: String, required: false },
|
|
42
|
+
required: { type: Boolean, required: false },
|
|
43
|
+
icon: { type: String, required: false },
|
|
44
|
+
avatar: { type: Object, required: false },
|
|
45
|
+
leading: { type: Boolean, required: false },
|
|
46
|
+
leadingIcon: { type: String, required: false },
|
|
47
|
+
trailing: { type: Boolean, required: false },
|
|
48
|
+
trailingIcon: { type: String, required: false },
|
|
49
|
+
loading: { type: Boolean, required: false },
|
|
50
|
+
loadingIcon: { type: String, required: false }
|
|
51
|
+
});
|
|
52
|
+
const emits = defineEmits(["change", "blur", "focus", "update:modelValue", "invalid", "addTag", "removeTag"]);
|
|
53
|
+
const slots = defineSlots();
|
|
54
|
+
const appConfig = useAppConfig();
|
|
55
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, "as", "addOnPaste", "addOnTab", "addOnBlur", "duplicate", "delimiter", "max", "convertValue", "displayValue", "required"), emits);
|
|
56
|
+
const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, size: formGroupSize, color, id, name, highlight, disabled, ariaAttrs } = useFormField(props);
|
|
57
|
+
const { orientation, size: buttonGroupSize } = useButtonGroup(props);
|
|
58
|
+
const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(props);
|
|
59
|
+
const inputSize = computed(() => buttonGroupSize.value || formGroupSize.value);
|
|
60
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.inputTags || {} })({
|
|
61
|
+
color: color.value,
|
|
62
|
+
variant: props.variant,
|
|
63
|
+
size: inputSize?.value,
|
|
64
|
+
loading: props.loading,
|
|
65
|
+
highlight: highlight.value,
|
|
66
|
+
leading: isLeading.value || !!props.avatar || !!slots.leading,
|
|
67
|
+
trailing: isTrailing.value || !!slots.trailing,
|
|
68
|
+
buttonGroup: orientation.value
|
|
69
|
+
}));
|
|
70
|
+
const inputRef = ref(null);
|
|
71
|
+
onMounted(() => {
|
|
72
|
+
setTimeout(() => {
|
|
73
|
+
autoFocus();
|
|
74
|
+
}, props.autofocusDelay);
|
|
75
|
+
});
|
|
76
|
+
function autoFocus() {
|
|
77
|
+
if (props.autofocus) {
|
|
78
|
+
inputRef.value?.$el?.focus();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function onUpdate(value) {
|
|
82
|
+
if (toRaw(props.modelValue) === value) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const event = new Event("change", { target: { value } });
|
|
86
|
+
emits("change", event);
|
|
87
|
+
emitFormChange();
|
|
88
|
+
emitFormInput();
|
|
89
|
+
}
|
|
90
|
+
function onBlur(event) {
|
|
91
|
+
emits("blur", event);
|
|
92
|
+
emitFormBlur();
|
|
93
|
+
}
|
|
94
|
+
function onFocus(event) {
|
|
95
|
+
emits("focus", event);
|
|
96
|
+
emitFormFocus();
|
|
97
|
+
}
|
|
98
|
+
defineExpose({
|
|
99
|
+
inputRef
|
|
100
|
+
});
|
|
101
|
+
</script>
|
|
102
|
+
|
|
103
|
+
<template>
|
|
104
|
+
<TagsInputRoot
|
|
105
|
+
:id="id"
|
|
106
|
+
v-slot="{ modelValue: tags }"
|
|
107
|
+
:model-value="modelValue"
|
|
108
|
+
:default-value="defaultValue"
|
|
109
|
+
:class="ui.root({ class: [ui.base({ class: props.ui?.base }), props.ui?.root, props.class] })"
|
|
110
|
+
v-bind="rootProps"
|
|
111
|
+
:name="name"
|
|
112
|
+
:disabled="disabled"
|
|
113
|
+
@update:model-value="onUpdate"
|
|
114
|
+
@blur="onBlur"
|
|
115
|
+
@focus="onFocus"
|
|
116
|
+
>
|
|
117
|
+
<TagsInputItem
|
|
118
|
+
v-for="(item, index) in tags"
|
|
119
|
+
:key="index"
|
|
120
|
+
:value="item"
|
|
121
|
+
:class="ui.item({ class: [props.ui?.item] })"
|
|
122
|
+
>
|
|
123
|
+
<TagsInputItemText :class="ui.itemText({ class: [props.ui?.itemText] })">
|
|
124
|
+
<slot v-if="!!slots['item-text']" name="item-text" :item="item" :index="index" />
|
|
125
|
+
</TagsInputItemText>
|
|
126
|
+
|
|
127
|
+
<TagsInputItemDelete
|
|
128
|
+
:class="ui.itemDelete({ class: [props.ui?.itemDelete] })"
|
|
129
|
+
:disabled="disabled"
|
|
130
|
+
>
|
|
131
|
+
<slot name="item-delete" :item="item" :index="index">
|
|
132
|
+
<UIcon :name="deleteIcon || appConfig.ui.icons.close" :class="ui.itemDeleteIcon({ class: [props.ui?.itemDeleteIcon] })" />
|
|
133
|
+
</slot>
|
|
134
|
+
</TagsInputItemDelete>
|
|
135
|
+
</TagsInputItem>
|
|
136
|
+
|
|
137
|
+
<TagsInputInput
|
|
138
|
+
ref="inputRef"
|
|
139
|
+
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
140
|
+
:placeholder="placeholder"
|
|
141
|
+
:class="ui.input({ class: props.ui?.input })"
|
|
142
|
+
/>
|
|
143
|
+
|
|
144
|
+
<slot />
|
|
145
|
+
|
|
146
|
+
<span v-if="isLeading || !!avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
147
|
+
<slot name="leading">
|
|
148
|
+
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
149
|
+
<UAvatar v-else-if="!!avatar" :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="avatar" :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })" />
|
|
150
|
+
</slot>
|
|
151
|
+
</span>
|
|
152
|
+
|
|
153
|
+
<span v-if="isTrailing || !!slots.trailing" :class="ui.trailing({ class: props.ui?.trailing })">
|
|
154
|
+
<slot name="trailing">
|
|
155
|
+
<UIcon v-if="trailingIconName" :name="trailingIconName" :class="ui.trailingIcon({ class: props.ui?.trailingIcon })" />
|
|
156
|
+
</slot>
|
|
157
|
+
</span>
|
|
158
|
+
</TagsInputRoot>
|
|
159
|
+
</template>
|