@nuxt/ui 3.1.0 → 3.1.2
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/accordion.ts +2 -23
- package/.nuxt/ui/alert.ts +2 -28
- package/.nuxt/ui/avatar-group.ts +2 -23
- package/.nuxt/ui/avatar.ts +2 -23
- package/.nuxt/ui/badge.ts +32 -30
- package/.nuxt/ui/breadcrumb.ts +2 -23
- package/.nuxt/ui/button-group.ts +2 -36
- package/.nuxt/ui/button.ts +4 -30
- package/.nuxt/ui/calendar.ts +4 -25
- package/.nuxt/ui/card.ts +2 -23
- package/.nuxt/ui/carousel.ts +2 -28
- package/.nuxt/ui/checkbox-group.ts +146 -24
- package/.nuxt/ui/checkbox.ts +2 -23
- package/.nuxt/ui/chip.ts +2 -23
- package/.nuxt/ui/collapsible.ts +2 -23
- package/.nuxt/ui/color-picker.ts +4 -25
- package/.nuxt/ui/command-palette.ts +2 -23
- package/.nuxt/ui/container.ts +2 -23
- package/.nuxt/ui/context-menu.ts +2 -23
- package/.nuxt/ui/drawer.ts +2 -23
- package/.nuxt/ui/dropdown-menu.ts +2 -23
- package/.nuxt/ui/form-field.ts +2 -23
- package/.nuxt/ui/form.ts +2 -23
- package/.nuxt/ui/input-menu.ts +4 -34
- package/.nuxt/ui/input-number.ts +12 -23
- package/.nuxt/ui/input.ts +4 -34
- package/.nuxt/ui/kbd.ts +2 -23
- package/.nuxt/ui/link.ts +14 -28
- package/.nuxt/ui/modal.ts +2 -23
- package/.nuxt/ui/navigation-menu.ts +3 -24
- package/.nuxt/ui/pagination.ts +2 -23
- package/.nuxt/ui/pin-input.ts +2 -23
- package/.nuxt/ui/popover.ts +2 -23
- package/.nuxt/ui/progress.ts +2 -23
- package/.nuxt/ui/radio-group.ts +2 -23
- package/.nuxt/ui/select-menu.ts +4 -34
- package/.nuxt/ui/select.ts +4 -34
- package/.nuxt/ui/separator.ts +2 -23
- package/.nuxt/ui/skeleton.ts +2 -23
- package/.nuxt/ui/slideover.ts +2 -23
- package/.nuxt/ui/slider.ts +2 -23
- package/.nuxt/ui/stepper.ts +2 -23
- package/.nuxt/ui/switch.ts +2 -23
- package/.nuxt/ui/table.ts +2 -23
- package/.nuxt/ui/tabs.ts +6 -26
- package/.nuxt/ui/textarea.ts +4 -34
- package/.nuxt/ui/toast.ts +2 -28
- package/.nuxt/ui/toaster.ts +2 -23
- package/.nuxt/ui/tooltip.ts +2 -23
- package/.nuxt/ui/tree.ts +2 -23
- package/.nuxt/ui.css +15 -8
- package/README.md +4 -0
- package/cli/templates.mjs +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +15 -5
- package/dist/runtime/components/Accordion.vue +9 -9
- package/dist/runtime/components/Accordion.vue.d.ts +6 -20
- package/dist/runtime/components/Alert.vue +1 -1
- package/dist/runtime/components/Alert.vue.d.ts +7 -22
- package/dist/runtime/components/App.vue.d.ts +2 -2
- package/dist/runtime/components/Avatar.vue +2 -2
- package/dist/runtime/components/Avatar.vue.d.ts +4 -25
- package/dist/runtime/components/AvatarGroup.vue +1 -1
- package/dist/runtime/components/AvatarGroup.vue.d.ts +2 -11
- package/dist/runtime/components/Badge.vue +5 -3
- package/dist/runtime/components/Badge.vue.d.ts +5 -24
- package/dist/runtime/components/Breadcrumb.vue +8 -8
- package/dist/runtime/components/Breadcrumb.vue.d.ts +4 -20
- package/dist/runtime/components/Button.vue +2 -3
- package/dist/runtime/components/Button.vue.d.ts +4 -29
- package/dist/runtime/components/ButtonGroup.vue.d.ts +3 -24
- package/dist/runtime/components/Calendar.vue +2 -1
- package/dist/runtime/components/Calendar.vue.d.ts +6 -2
- package/dist/runtime/components/Card.vue +1 -1
- package/dist/runtime/components/Card.vue.d.ts +2 -11
- package/dist/runtime/components/Carousel.vue +5 -2
- package/dist/runtime/components/Carousel.vue.d.ts +10 -3
- package/dist/runtime/components/Checkbox.vue +2 -2
- package/dist/runtime/components/Checkbox.vue.d.ts +10 -13
- package/dist/runtime/components/CheckboxGroup.vue +8 -5
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +12 -3
- package/dist/runtime/components/Chip.vue +1 -1
- package/dist/runtime/components/Chip.vue.d.ts +10 -24
- package/dist/runtime/components/Collapsible.vue +1 -1
- package/dist/runtime/components/Collapsible.vue.d.ts +7 -22
- package/dist/runtime/components/ColorPicker.vue +1 -1
- package/dist/runtime/components/ColorPicker.vue.d.ts +9 -24
- package/dist/runtime/components/CommandPalette.vue +17 -17
- package/dist/runtime/components/CommandPalette.vue.d.ts +17 -27
- package/dist/runtime/components/Container.vue.d.ts +2 -11
- package/dist/runtime/components/ContextMenu.vue.d.ts +6 -24
- package/dist/runtime/components/ContextMenuContent.vue +15 -15
- package/dist/runtime/components/ContextMenuContent.vue.d.ts +17 -57
- package/dist/runtime/components/Drawer.vue.d.ts +17 -27
- package/dist/runtime/components/DropdownMenu.vue.d.ts +6 -28
- package/dist/runtime/components/DropdownMenuContent.vue +15 -15
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +19 -6
- package/dist/runtime/components/Form.vue.d.ts +5 -2
- package/dist/runtime/components/FormField.vue +5 -5
- package/dist/runtime/components/FormField.vue.d.ts +2 -11
- package/dist/runtime/components/Icon.vue.d.ts +1 -10
- package/dist/runtime/components/Input.vue +2 -2
- package/dist/runtime/components/Input.vue.d.ts +20 -41
- package/dist/runtime/components/InputMenu.vue +17 -17
- package/dist/runtime/components/InputMenu.vue.d.ts +227 -5
- package/dist/runtime/components/InputNumber.vue +13 -7
- package/dist/runtime/components/InputNumber.vue.d.ts +90 -23
- package/dist/runtime/components/Kbd.vue.d.ts +3 -24
- package/dist/runtime/components/Link.vue +5 -14
- package/dist/runtime/components/Link.vue.d.ts +3 -34
- package/dist/runtime/components/LinkBase.vue.d.ts +4 -27
- package/dist/runtime/components/Modal.vue.d.ts +12 -28
- package/dist/runtime/components/NavigationMenu.vue +35 -28
- package/dist/runtime/components/NavigationMenu.vue.d.ts +24 -26
- package/dist/runtime/components/Pagination.vue +1 -1
- package/dist/runtime/components/Pagination.vue.d.ts +9 -33
- package/dist/runtime/components/PinInput.vue +1 -1
- package/dist/runtime/components/PinInput.vue.d.ts +13 -24
- package/dist/runtime/components/Popover.vue.d.ts +9 -26
- package/dist/runtime/components/Progress.vue +1 -1
- package/dist/runtime/components/Progress.vue.d.ts +10 -41
- package/dist/runtime/components/RadioGroup.vue +8 -8
- package/dist/runtime/components/RadioGroup.vue.d.ts +8 -3
- package/dist/runtime/components/Select.vue +12 -12
- package/dist/runtime/components/Select.vue.d.ts +11 -3
- package/dist/runtime/components/SelectMenu.vue +13 -13
- package/dist/runtime/components/SelectMenu.vue.d.ts +19 -5
- package/dist/runtime/components/Separator.vue +1 -1
- package/dist/runtime/components/Separator.vue.d.ts +3 -24
- package/dist/runtime/components/Skeleton.vue.d.ts +3 -12
- package/dist/runtime/components/Slideover.vue.d.ts +12 -29
- package/dist/runtime/components/Slider.vue +16 -4
- package/dist/runtime/components/Slider.vue.d.ts +23 -36
- package/dist/runtime/components/Stepper.vue +10 -10
- package/dist/runtime/components/Stepper.vue.d.ts +10 -14
- package/dist/runtime/components/Switch.vue +1 -1
- package/dist/runtime/components/Switch.vue.d.ts +10 -13
- package/dist/runtime/components/Table.vue +2 -2
- package/dist/runtime/components/Table.vue.d.ts +17 -17
- package/dist/runtime/components/Tabs.vue +6 -6
- package/dist/runtime/components/Tabs.vue.d.ts +6 -20
- package/dist/runtime/components/Textarea.vue +3 -3
- package/dist/runtime/components/Textarea.vue.d.ts +20 -44
- package/dist/runtime/components/Toast.vue +3 -2
- package/dist/runtime/components/Toast.vue.d.ts +92 -24
- package/dist/runtime/components/Toaster.vue +4 -4
- package/dist/runtime/components/Toaster.vue.d.ts +9 -28
- package/dist/runtime/components/Tooltip.vue.d.ts +7 -22
- package/dist/runtime/components/Tree.vue +10 -10
- package/dist/runtime/components/Tree.vue.d.ts +7 -22
- package/dist/runtime/composables/defineShortcuts.js +6 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useButtonGroup.d.ts +1 -1
- package/dist/runtime/composables/useFormField.d.ts +2 -2
- package/dist/runtime/composables/useFormField.js +2 -1
- package/dist/runtime/composables/useKbd.d.ts +1 -0
- package/dist/runtime/composables/useKbd.js +4 -3
- package/dist/runtime/composables/useOverlay.d.ts +9 -10
- package/dist/runtime/composables/useOverlay.js +11 -6
- package/dist/runtime/inertia/components/Link.vue +46 -60
- package/dist/runtime/inertia/components/Link.vue.d.ts +4 -33
- 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 +1 -0
- package/dist/runtime/locale/index.js +1 -0
- package/dist/runtime/locale/sl.d.ts +3 -0
- package/dist/runtime/locale/sl.js +54 -0
- package/dist/runtime/types/tv.d.ts +53 -0
- package/dist/runtime/types/tv.js +0 -0
- package/dist/runtime/types/utils.d.ts +2 -52
- package/dist/runtime/types/utils.js +1 -0
- package/dist/runtime/utils/link.d.ts +1 -0
- package/dist/runtime/utils/link.js +12 -0
- package/dist/runtime/vue/components/Icon.vue.d.ts +1 -10
- package/dist/runtime/vue/components/Link.vue +27 -40
- package/dist/runtime/vue/components/Link.vue.d.ts +3 -34
- 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.D7lOOabO.mjs → ui.BvUP-pSb.mjs} +120 -27
- package/dist/unplugin.d.mts +2 -2
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +2 -2
- package/package.json +28 -27
|
@@ -47,51 +47,20 @@ export type ProgressSlots = {
|
|
|
47
47
|
step: number;
|
|
48
48
|
}) => any;
|
|
49
49
|
};
|
|
50
|
-
declare const _default:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProgressProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
51
|
+
"update:modelValue": (value: string[] | undefined) => any;
|
|
52
|
+
"update:max": (value: number) => any;
|
|
53
|
+
}, string, import("vue").PublicProps, Readonly<ProgressProps> & Readonly<{
|
|
54
|
+
"onUpdate:modelValue"?: ((value: string[] | undefined) => any) | undefined;
|
|
55
|
+
"onUpdate:max"?: ((value: number) => any) | undefined;
|
|
56
|
+
}>, {
|
|
55
57
|
orientation: Progress["variants"]["orientation"];
|
|
56
|
-
inverted: boolean;
|
|
57
58
|
modelValue: number | null;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
percent?: number;
|
|
61
|
-
}): any;
|
|
62
|
-
} & {
|
|
63
|
-
[key: string]: (props: {
|
|
64
|
-
step: number;
|
|
65
|
-
}) => any;
|
|
66
|
-
}> & {
|
|
67
|
-
status(props: {
|
|
68
|
-
percent?: number;
|
|
69
|
-
}): any;
|
|
70
|
-
} & {
|
|
71
|
-
[key: string]: (props: {
|
|
72
|
-
step: number;
|
|
73
|
-
}) => any;
|
|
74
|
-
}>;
|
|
59
|
+
inverted: boolean;
|
|
60
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ProgressSlots>;
|
|
75
61
|
export default _default;
|
|
76
|
-
type
|
|
77
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
78
|
-
default: D[K];
|
|
79
|
-
}> : P[K];
|
|
80
|
-
};
|
|
81
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
82
|
-
type __VLS_TypePropsToOption<T> = {
|
|
83
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
84
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
85
|
-
} : {
|
|
86
|
-
type: import('vue').PropType<T[K]>;
|
|
87
|
-
required: true;
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
62
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
91
63
|
new (): {
|
|
92
64
|
$slots: S;
|
|
93
65
|
};
|
|
94
66
|
};
|
|
95
|
-
type __VLS_PrettifyLocal<T> = {
|
|
96
|
-
[K in keyof T]: T[K];
|
|
97
|
-
} & {};
|
|
@@ -93,7 +93,7 @@ function onUpdate(value) {
|
|
|
93
93
|
v-bind="rootProps"
|
|
94
94
|
:name="name"
|
|
95
95
|
:disabled="disabled"
|
|
96
|
-
:class="ui.root({ class: [props.
|
|
96
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
97
97
|
@update:model-value="onUpdate"
|
|
98
98
|
>
|
|
99
99
|
<fieldset :class="ui.fieldset({ class: props.ui?.fieldset })" v-bind="ariaAttrs">
|
|
@@ -103,25 +103,25 @@ function onUpdate(value) {
|
|
|
103
103
|
</slot>
|
|
104
104
|
</legend>
|
|
105
105
|
|
|
106
|
-
<component :is="variant === 'list' ? 'div' : Label" v-for="item in normalizedItems" :key="item.value" :class="ui.item({ class: props.ui?.item })">
|
|
107
|
-
<div :class="ui.container({ class: props.ui?.container })">
|
|
106
|
+
<component :is="!variant || variant === 'list' ? 'div' : Label" v-for="item in normalizedItems" :key="item.value" :class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })">
|
|
107
|
+
<div :class="ui.container({ class: [props.ui?.container, item.ui?.container] })">
|
|
108
108
|
<RadioGroupItem
|
|
109
109
|
:id="item.id"
|
|
110
110
|
:value="item.value"
|
|
111
111
|
:disabled="item.disabled"
|
|
112
|
-
:class="ui.base({ class: props.ui?.base, disabled: item.disabled })"
|
|
112
|
+
:class="ui.base({ class: [props.ui?.base, item.ui?.base], disabled: item.disabled })"
|
|
113
113
|
>
|
|
114
|
-
<RadioGroupIndicator :class="ui.indicator({ class: props.ui?.indicator })" />
|
|
114
|
+
<RadioGroupIndicator :class="ui.indicator({ class: [props.ui?.indicator, item.ui?.indicator] })" />
|
|
115
115
|
</RadioGroupItem>
|
|
116
116
|
</div>
|
|
117
117
|
|
|
118
|
-
<div v-if="item.label || !!slots.label || (item.description || !!slots.description)" :class="ui.wrapper({ class: props.ui?.wrapper })">
|
|
119
|
-
<component :is="variant === 'list' ? Label : 'p'" v-if="item.label || !!slots.label" :for="item.id" :class="ui.label({ class: props.ui?.label })">
|
|
118
|
+
<div v-if="item.label || !!slots.label || (item.description || !!slots.description)" :class="ui.wrapper({ class: [props.ui?.wrapper, item.ui?.wrapper] })">
|
|
119
|
+
<component :is="!variant || variant === 'list' ? Label : 'p'" v-if="item.label || !!slots.label" :for="item.id" :class="ui.label({ class: [props.ui?.label, item.ui?.label] })">
|
|
120
120
|
<slot name="label" :item="item" :model-value="modelValue">
|
|
121
121
|
{{ item.label }}
|
|
122
122
|
</slot>
|
|
123
123
|
</component>
|
|
124
|
-
<p v-if="item.description || !!slots.description" :class="ui.description({ class: props.ui?.description })">
|
|
124
|
+
<p v-if="item.description || !!slots.description" :class="ui.description({ class: [props.ui?.description, item.ui?.description] })">
|
|
125
125
|
<slot name="description" :item="item" :model-value="modelValue">
|
|
126
126
|
{{ item.description }}
|
|
127
127
|
</slot>
|
|
@@ -8,7 +8,9 @@ export type RadioGroupItem = {
|
|
|
8
8
|
label?: string;
|
|
9
9
|
description?: string;
|
|
10
10
|
disabled?: boolean;
|
|
11
|
-
value?:
|
|
11
|
+
value?: RadioGroupValue;
|
|
12
|
+
class?: any;
|
|
13
|
+
ui?: Pick<RadioGroup['slots'], 'item' | 'container' | 'base' | 'indicator' | 'wrapper' | 'label' | 'description'>;
|
|
12
14
|
[key: string]: any;
|
|
13
15
|
} | RadioGroupValue;
|
|
14
16
|
export interface RadioGroupProps<T extends RadioGroupItem = RadioGroupItem> extends Pick<RadioGroupRootProps, 'defaultValue' | 'disabled' | 'loop' | 'modelValue' | 'name' | 'required'> {
|
|
@@ -74,10 +76,13 @@ export interface RadioGroupSlots<T extends RadioGroupItem = RadioGroupItem> {
|
|
|
74
76
|
description: SlotProps<T>;
|
|
75
77
|
}
|
|
76
78
|
declare const _default: <T extends RadioGroupItem>(__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<{
|
|
77
|
-
props: __VLS_PrettifyLocal<
|
|
79
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
80
|
+
readonly onChange?: ((payload: Event) => any) | undefined;
|
|
81
|
+
readonly "onUpdate:modelValue"?: ((payload: string) => any) | undefined;
|
|
82
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onChange" | "onUpdate:modelValue"> & RadioGroupProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
78
83
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
79
84
|
attrs: any;
|
|
80
|
-
slots:
|
|
85
|
+
slots: RadioGroupSlots<T>;
|
|
81
86
|
emit: ((evt: "change", payload: Event) => void) & ((evt: "update:modelValue", payload: string) => void);
|
|
82
87
|
}>) => import("vue").VNode & {
|
|
83
88
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
@@ -118,7 +118,7 @@ function isSelectItem(item) {
|
|
|
118
118
|
@update:model-value="onUpdate"
|
|
119
119
|
@update:open="onUpdateOpen"
|
|
120
120
|
>
|
|
121
|
-
<SelectTrigger :id="id" :class="ui.base({ class: [props.
|
|
121
|
+
<SelectTrigger :id="id" :class="ui.base({ class: [props.ui?.base, props.class] })" v-bind="{ ...$attrs, ...ariaAttrs }">
|
|
122
122
|
<span v-if="isLeading || !!avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
123
123
|
<slot name="leading" :model-value="modelValue" :open="open" :ui="ui">
|
|
124
124
|
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
@@ -132,7 +132,7 @@ function isSelectItem(item) {
|
|
|
132
132
|
{{ displayedModelValue }}
|
|
133
133
|
</span>
|
|
134
134
|
<span v-else :class="ui.placeholder({ class: props.ui?.placeholder })">
|
|
135
|
-
{{ placeholder ??
|
|
135
|
+
{{ placeholder ?? "\xA0" }}
|
|
136
136
|
</span>
|
|
137
137
|
</template>
|
|
138
138
|
</slot>
|
|
@@ -151,44 +151,44 @@ function isSelectItem(item) {
|
|
|
151
151
|
<SelectViewport :class="ui.viewport({ class: props.ui?.viewport })">
|
|
152
152
|
<SelectGroup v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" :class="ui.group({ class: props.ui?.group })">
|
|
153
153
|
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
154
|
-
<SelectLabel v-if="isSelectItem(item) && item.type === 'label'" :class="ui.label({ class: props.ui?.label })">
|
|
154
|
+
<SelectLabel v-if="isSelectItem(item) && item.type === 'label'" :class="ui.label({ class: [props.ui?.label, item.ui?.label, item.class] })">
|
|
155
155
|
{{ get(item, props.labelKey) }}
|
|
156
156
|
</SelectLabel>
|
|
157
157
|
|
|
158
|
-
<SelectSeparator v-else-if="isSelectItem(item) && item.type === 'separator'" :class="ui.separator({ class: props.ui?.separator })" />
|
|
158
|
+
<SelectSeparator v-else-if="isSelectItem(item) && item.type === 'separator'" :class="ui.separator({ class: [props.ui?.separator, item.ui?.separator, item.class] })" />
|
|
159
159
|
|
|
160
160
|
<SelectItem
|
|
161
161
|
v-else
|
|
162
|
-
:class="ui.item({ class: props.ui?.item })"
|
|
162
|
+
:class="ui.item({ class: [props.ui?.item, isSelectItem(item) && item.ui?.item, isSelectItem(item) && item.class] })"
|
|
163
163
|
:disabled="isSelectItem(item) && item.disabled"
|
|
164
164
|
:value="isSelectItem(item) ? get(item, props.valueKey) : item"
|
|
165
165
|
@select="isSelectItem(item) && item.onSelect?.($event)"
|
|
166
166
|
>
|
|
167
167
|
<slot name="item" :item="item" :index="index">
|
|
168
168
|
<slot name="item-leading" :item="item" :index="index">
|
|
169
|
-
<UIcon v-if="isSelectItem(item) && item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: props.ui?.itemLeadingIcon })" />
|
|
170
|
-
<UAvatar v-else-if="isSelectItem(item) && item.avatar" :size="props.ui?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: props.ui?.itemLeadingAvatar })" />
|
|
169
|
+
<UIcon v-if="isSelectItem(item) && item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: [props.ui?.itemLeadingIcon, item.ui?.itemLeadingIcon] })" />
|
|
170
|
+
<UAvatar v-else-if="isSelectItem(item) && 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] })" />
|
|
171
171
|
<UChip
|
|
172
172
|
v-else-if="isSelectItem(item) && item.chip"
|
|
173
|
-
:size="props.ui?.itemLeadingChipSize || ui.itemLeadingChipSize()"
|
|
173
|
+
:size="item.ui?.itemLeadingChipSize || props.ui?.itemLeadingChipSize || ui.itemLeadingChipSize()"
|
|
174
174
|
inset
|
|
175
175
|
standalone
|
|
176
176
|
v-bind="item.chip"
|
|
177
|
-
:class="ui.itemLeadingChip({ class: props.ui?.itemLeadingChip })"
|
|
177
|
+
:class="ui.itemLeadingChip({ class: [props.ui?.itemLeadingChip, item.ui?.itemLeadingChip] })"
|
|
178
178
|
/>
|
|
179
179
|
</slot>
|
|
180
180
|
|
|
181
|
-
<SelectItemText :class="ui.itemLabel({ class: props.ui?.itemLabel })">
|
|
181
|
+
<SelectItemText :class="ui.itemLabel({ class: [props.ui?.itemLabel, isSelectItem(item) && item.ui?.itemLabel] })">
|
|
182
182
|
<slot name="item-label" :item="item" :index="index">
|
|
183
183
|
{{ isSelectItem(item) ? get(item, props.labelKey) : item }}
|
|
184
184
|
</slot>
|
|
185
185
|
</SelectItemText>
|
|
186
186
|
|
|
187
|
-
<span :class="ui.itemTrailing({ class: props.ui?.itemTrailing })">
|
|
187
|
+
<span :class="ui.itemTrailing({ class: [props.ui?.itemTrailing, isSelectItem(item) && item.ui?.itemTrailing] })">
|
|
188
188
|
<slot name="item-trailing" :item="item" :index="index" />
|
|
189
189
|
|
|
190
190
|
<SelectItemIndicator as-child>
|
|
191
|
-
<UIcon :name="selectedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: props.ui?.itemTrailingIcon })" />
|
|
191
|
+
<UIcon :name="selectedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: [props.ui?.itemTrailingIcon, isSelectItem(item) && item.ui?.itemTrailingIcon] })" />
|
|
192
192
|
</SelectItemIndicator>
|
|
193
193
|
</span>
|
|
194
194
|
</slot>
|
|
@@ -18,9 +18,11 @@ interface SelectItemBase {
|
|
|
18
18
|
* @defaultValue 'item'
|
|
19
19
|
*/
|
|
20
20
|
type?: 'label' | 'separator' | 'item';
|
|
21
|
-
value?:
|
|
21
|
+
value?: AcceptableValue | boolean;
|
|
22
22
|
disabled?: boolean;
|
|
23
23
|
onSelect?(e?: Event): void;
|
|
24
|
+
class?: any;
|
|
25
|
+
ui?: Pick<Select['slots'], 'label' | 'separator' | 'item' | 'itemLeadingIcon' | 'itemLeadingAvatarSize' | 'itemLeadingAvatar' | 'itemLeadingChipSize' | 'itemLeadingChip' | 'itemLabel' | 'itemTrailing' | 'itemTrailingIcon'>;
|
|
24
26
|
[key: string]: any;
|
|
25
27
|
}
|
|
26
28
|
export type SelectItem = SelectItemBase | AcceptableValue | boolean;
|
|
@@ -125,10 +127,16 @@ export interface SelectSlots<A extends ArrayOrNested<SelectItem> = ArrayOrNested
|
|
|
125
127
|
'content-bottom': (props?: {}) => any;
|
|
126
128
|
}
|
|
127
129
|
declare const _default: <T extends ArrayOrNested<SelectItem>, VK extends GetItemKeys<T> = "value", M extends boolean = false>(__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<{
|
|
128
|
-
props: __VLS_PrettifyLocal<
|
|
130
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
131
|
+
readonly onBlur?: ((payload: FocusEvent) => any) | undefined;
|
|
132
|
+
readonly onChange?: ((payload: Event) => any) | undefined;
|
|
133
|
+
readonly onFocus?: ((payload: FocusEvent) => any) | undefined;
|
|
134
|
+
readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
135
|
+
readonly "onUpdate:modelValue"?: ((payload: GetModelValue<T, VK, M>) => any) | undefined;
|
|
136
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onFocus" | "onBlur" | "onChange" | "onUpdate:open" | "onUpdate:modelValue"> & SelectProps<T, VK, M> & Partial<{}>> & import("vue").PublicProps;
|
|
129
137
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
130
138
|
attrs: any;
|
|
131
|
-
slots:
|
|
139
|
+
slots: SelectSlots<T, VK, M, NestedItem<T>>;
|
|
132
140
|
emit: ((evt: "blur", payload: FocusEvent) => void) & ((evt: "change", payload: Event) => void) & ((evt: "focus", payload: FocusEvent) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "update:modelValue", payload: GetModelValue<T, VK, M>) => void);
|
|
133
141
|
}>) => import("vue").VNode & {
|
|
134
142
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
@@ -185,7 +185,7 @@ function isSelectItem(item) {
|
|
|
185
185
|
>
|
|
186
186
|
<span :class="ui.itemLabel({ class: props.ui?.itemLabel })">
|
|
187
187
|
<slot name="create-item-label" :item="searchTerm">
|
|
188
|
-
{{ t(
|
|
188
|
+
{{ t("selectMenu.create", { label: searchTerm }) }}
|
|
189
189
|
</slot>
|
|
190
190
|
</span>
|
|
191
191
|
</ComboboxItem>
|
|
@@ -204,7 +204,7 @@ function isSelectItem(item) {
|
|
|
204
204
|
@update:open="onUpdateOpen"
|
|
205
205
|
>
|
|
206
206
|
<ComboboxAnchor as-child>
|
|
207
|
-
<ComboboxTrigger :class="ui.base({ class: [props.
|
|
207
|
+
<ComboboxTrigger :class="ui.base({ class: [props.ui?.base, props.class] })" tabindex="0">
|
|
208
208
|
<span v-if="isLeading || !!avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
209
209
|
<slot name="leading" :model-value="modelValue" :open="open" :ui="ui">
|
|
210
210
|
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
@@ -218,7 +218,7 @@ function isSelectItem(item) {
|
|
|
218
218
|
{{ displayedModelValue }}
|
|
219
219
|
</span>
|
|
220
220
|
<span v-else :class="ui.placeholder({ class: props.ui?.placeholder })">
|
|
221
|
-
{{ placeholder ??
|
|
221
|
+
{{ placeholder ?? "\xA0" }}
|
|
222
222
|
</span>
|
|
223
223
|
</template>
|
|
224
224
|
</slot>
|
|
@@ -242,7 +242,7 @@ function isSelectItem(item) {
|
|
|
242
242
|
|
|
243
243
|
<ComboboxEmpty :class="ui.empty({ class: props.ui?.empty })">
|
|
244
244
|
<slot name="empty" :search-term="searchTerm">
|
|
245
|
-
{{ searchTerm ? t(
|
|
245
|
+
{{ searchTerm ? t("selectMenu.noMatch", { searchTerm }) : t("selectMenu.noData") }}
|
|
246
246
|
</slot>
|
|
247
247
|
</ComboboxEmpty>
|
|
248
248
|
|
|
@@ -251,44 +251,44 @@ function isSelectItem(item) {
|
|
|
251
251
|
|
|
252
252
|
<ComboboxGroup v-for="(group, groupIndex) in filteredGroups" :key="`group-${groupIndex}`" :class="ui.group({ class: props.ui?.group })">
|
|
253
253
|
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
254
|
-
<ComboboxLabel v-if="isSelectItem(item) && item.type === 'label'" :class="ui.label({ class: props.ui?.label })">
|
|
254
|
+
<ComboboxLabel v-if="isSelectItem(item) && item.type === 'label'" :class="ui.label({ class: [props.ui?.label, item.ui?.label, item.class] })">
|
|
255
255
|
{{ get(item, props.labelKey) }}
|
|
256
256
|
</ComboboxLabel>
|
|
257
257
|
|
|
258
|
-
<ComboboxSeparator v-else-if="isSelectItem(item) && item.type === 'separator'" :class="ui.separator({ class: props.ui?.separator })" />
|
|
258
|
+
<ComboboxSeparator v-else-if="isSelectItem(item) && item.type === 'separator'" :class="ui.separator({ class: [props.ui?.separator, item.ui?.separator, item.class] })" />
|
|
259
259
|
|
|
260
260
|
<ComboboxItem
|
|
261
261
|
v-else
|
|
262
|
-
:class="ui.item({ class: props.ui?.item })"
|
|
262
|
+
:class="ui.item({ class: [props.ui?.item, isSelectItem(item) && item.ui?.item, isSelectItem(item) && item.class] })"
|
|
263
263
|
:disabled="isSelectItem(item) && item.disabled"
|
|
264
264
|
:value="props.valueKey && isSelectItem(item) ? get(item, props.valueKey) : item"
|
|
265
265
|
@select="onSelect($event, item)"
|
|
266
266
|
>
|
|
267
267
|
<slot name="item" :item="item" :index="index">
|
|
268
268
|
<slot name="item-leading" :item="item" :index="index">
|
|
269
|
-
<UIcon v-if="isSelectItem(item) && item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: props.ui?.itemLeadingIcon })" />
|
|
270
|
-
<UAvatar v-else-if="isSelectItem(item) && item.avatar" :size="props.ui?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: props.ui?.itemLeadingAvatar })" />
|
|
269
|
+
<UIcon v-if="isSelectItem(item) && item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: [props.ui?.itemLeadingIcon, item.ui?.itemLeadingIcon] })" />
|
|
270
|
+
<UAvatar v-else-if="isSelectItem(item) && 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] })" />
|
|
271
271
|
<UChip
|
|
272
272
|
v-else-if="isSelectItem(item) && item.chip"
|
|
273
273
|
:size="props.ui?.itemLeadingChipSize || ui.itemLeadingChipSize()"
|
|
274
274
|
inset
|
|
275
275
|
standalone
|
|
276
276
|
v-bind="item.chip"
|
|
277
|
-
:class="ui.itemLeadingChip({ class: props.ui?.itemLeadingChip })"
|
|
277
|
+
:class="ui.itemLeadingChip({ class: [props.ui?.itemLeadingChip, item.ui?.itemLeadingChip] })"
|
|
278
278
|
/>
|
|
279
279
|
</slot>
|
|
280
280
|
|
|
281
|
-
<span :class="ui.itemLabel({ class: props.ui?.itemLabel })">
|
|
281
|
+
<span :class="ui.itemLabel({ class: [props.ui?.itemLabel, isSelectItem(item) && item.ui?.itemLabel] })">
|
|
282
282
|
<slot name="item-label" :item="item" :index="index">
|
|
283
283
|
{{ isSelectItem(item) ? get(item, props.labelKey) : item }}
|
|
284
284
|
</slot>
|
|
285
285
|
</span>
|
|
286
286
|
|
|
287
|
-
<span :class="ui.itemTrailing({ class: props.ui?.itemTrailing })">
|
|
287
|
+
<span :class="ui.itemTrailing({ class: [props.ui?.itemTrailing, isSelectItem(item) && item.ui?.itemTrailing] })">
|
|
288
288
|
<slot name="item-trailing" :item="item" :index="index" />
|
|
289
289
|
|
|
290
290
|
<ComboboxItemIndicator as-child>
|
|
291
|
-
<UIcon :name="selectedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: props.ui?.itemTrailingIcon })" />
|
|
291
|
+
<UIcon :name="selectedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: [props.ui?.itemTrailingIcon, isSelectItem(item) && item.ui?.itemTrailingIcon] })" />
|
|
292
292
|
</ComboboxItemIndicator>
|
|
293
293
|
</span>
|
|
294
294
|
</slot>
|
|
@@ -20,6 +20,8 @@ interface _SelectMenuItem {
|
|
|
20
20
|
type?: 'label' | 'separator' | 'item';
|
|
21
21
|
disabled?: boolean;
|
|
22
22
|
onSelect?(e?: Event): void;
|
|
23
|
+
class?: any;
|
|
24
|
+
ui?: Pick<SelectMenu['slots'], 'label' | 'separator' | 'item' | 'itemLeadingIcon' | 'itemLeadingAvatarSize' | 'itemLeadingAvatar' | 'itemLeadingChipSize' | 'itemLeadingChip' | 'itemLabel' | 'itemTrailing' | 'itemTrailingIcon'>;
|
|
23
25
|
[key: string]: any;
|
|
24
26
|
}
|
|
25
27
|
export type SelectMenuItem = _SelectMenuItem | AcceptableValue | boolean;
|
|
@@ -165,16 +167,28 @@ export interface SelectMenuSlots<A extends ArrayOrNested<SelectMenuItem> = Array
|
|
|
165
167
|
}): any;
|
|
166
168
|
}
|
|
167
169
|
declare const _default: <T extends ArrayOrNested<SelectMenuItem>, VK extends GetItemKeys<T> | undefined = undefined, M extends boolean = false>(__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<{
|
|
168
|
-
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
170
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
171
|
+
readonly onBlur?: ((payload: FocusEvent) => any) | undefined;
|
|
172
|
+
readonly onChange?: ((payload: Event) => any) | undefined;
|
|
173
|
+
readonly onFocus?: ((payload: FocusEvent) => any) | undefined;
|
|
174
|
+
readonly onCreate?: ((item: string) => any) | undefined;
|
|
175
|
+
readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
176
|
+
readonly "onUpdate:modelValue"?: ((payload: GetModelValue<T, VK, M>) => any) | undefined;
|
|
177
|
+
readonly onHighlight?: ((payload: {
|
|
178
|
+
ref: HTMLElement;
|
|
179
|
+
value: GetModelValue<T, VK, M>;
|
|
180
|
+
} | undefined) => any) | undefined;
|
|
181
|
+
readonly "onUpdate:searchTerm"?: ((value: string) => any) | undefined;
|
|
182
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onFocus" | "onBlur" | "onChange" | "onUpdate:open" | "onUpdate:modelValue" | "onHighlight" | "onUpdate:searchTerm" | "onCreate"> & (SelectMenuProps<T, VK, M> & {
|
|
169
183
|
searchTerm?: string;
|
|
170
|
-
}
|
|
184
|
+
}) & Partial<{}>> & import("vue").PublicProps;
|
|
171
185
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
172
186
|
attrs: any;
|
|
173
|
-
slots:
|
|
174
|
-
emit: (((evt: "blur", payload: FocusEvent) => void) & ((evt: "change", payload: Event) => void) & ((evt: "focus", payload: FocusEvent) => void) & ((evt: "create", item: string) => void) & ((evt: "highlight", payload: {
|
|
187
|
+
slots: SelectMenuSlots<T, VK, M, NestedItem<T>>;
|
|
188
|
+
emit: (((evt: "blur", payload: FocusEvent) => void) & ((evt: "change", payload: Event) => void) & ((evt: "focus", payload: FocusEvent) => void) & ((evt: "create", item: string) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "update:modelValue", payload: GetModelValue<T, VK, M>) => void) & ((evt: "highlight", payload: {
|
|
175
189
|
ref: HTMLElement;
|
|
176
190
|
value: GetModelValue<T, VK, M>;
|
|
177
|
-
} | undefined) => void)
|
|
191
|
+
} | undefined) => void)) & ((evt: "update:searchTerm", value: string) => void);
|
|
178
192
|
}>) => import("vue").VNode & {
|
|
179
193
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
180
194
|
};
|
|
@@ -35,7 +35,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.separator ||
|
|
|
35
35
|
</script>
|
|
36
36
|
|
|
37
37
|
<template>
|
|
38
|
-
<Separator v-bind="rootProps" :class="ui.root({ class: [props.
|
|
38
|
+
<Separator v-bind="rootProps" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
39
39
|
<div :class="ui.border({ class: props.ui?.border })" />
|
|
40
40
|
|
|
41
41
|
<template v-if="label || icon || avatar || !!slots.default">
|
|
@@ -43,33 +43,12 @@ export interface SeparatorProps extends Pick<_SeparatorProps, 'decorative'> {
|
|
|
43
43
|
export interface SeparatorSlots {
|
|
44
44
|
default(props?: {}): any;
|
|
45
45
|
}
|
|
46
|
-
declare const _default:
|
|
47
|
-
orientation: string;
|
|
48
|
-
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<SeparatorProps>, {
|
|
49
|
-
orientation: string;
|
|
50
|
-
}>>> & Readonly<{}>, {
|
|
46
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SeparatorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SeparatorProps> & Readonly<{}>, {
|
|
51
47
|
orientation: "horizontal" | "vertical";
|
|
52
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions,
|
|
48
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SeparatorSlots>;
|
|
53
49
|
export default _default;
|
|
54
|
-
type
|
|
55
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
56
|
-
default: D[K];
|
|
57
|
-
}> : P[K];
|
|
58
|
-
};
|
|
59
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
60
|
-
type __VLS_TypePropsToOption<T> = {
|
|
61
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
62
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
63
|
-
} : {
|
|
64
|
-
type: import('vue').PropType<T[K]>;
|
|
65
|
-
required: true;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
50
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
69
51
|
new (): {
|
|
70
52
|
$slots: S;
|
|
71
53
|
};
|
|
72
54
|
};
|
|
73
|
-
type __VLS_PrettifyLocal<T> = {
|
|
74
|
-
[K in keyof T]: T[K];
|
|
75
|
-
} & {};
|
|
@@ -6,20 +6,11 @@ export interface SkeletonProps {
|
|
|
6
6
|
as?: any;
|
|
7
7
|
class?: any;
|
|
8
8
|
}
|
|
9
|
-
declare const _default:
|
|
10
|
-
default
|
|
9
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SkeletonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SkeletonProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
10
|
+
default?: (props: {}) => any;
|
|
11
11
|
}>;
|
|
12
12
|
export default _default;
|
|
13
|
-
type
|
|
14
|
-
type __VLS_TypePropsToOption<T> = {
|
|
15
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
16
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
17
|
-
} : {
|
|
18
|
-
type: import('vue').PropType<T[K]>;
|
|
19
|
-
required: true;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
14
|
new (): {
|
|
24
15
|
$slots: S;
|
|
25
16
|
};
|
|
@@ -69,43 +69,26 @@ export interface SlideoverSlots {
|
|
|
69
69
|
body(props?: {}): any;
|
|
70
70
|
footer(props?: {}): any;
|
|
71
71
|
}
|
|
72
|
-
declare const _default:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
72
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SlideoverProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
73
|
+
"update:open": (value: boolean) => any;
|
|
74
|
+
"after:leave": () => any;
|
|
75
|
+
"close:prevent": () => any;
|
|
76
|
+
}, string, import("vue").PublicProps, Readonly<SlideoverProps> & Readonly<{
|
|
77
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
78
|
+
"onAfter:leave"?: (() => any) | undefined;
|
|
79
|
+
"onClose:prevent"?: (() => any) | undefined;
|
|
80
|
+
}>, {
|
|
81
81
|
close: boolean | Partial<ButtonProps>;
|
|
82
82
|
modal: boolean;
|
|
83
|
-
transition: boolean;
|
|
84
83
|
portal: boolean | string | HTMLElement;
|
|
85
84
|
overlay: boolean;
|
|
85
|
+
transition: boolean;
|
|
86
86
|
side: Slideover["variants"]["side"];
|
|
87
87
|
dismissible: boolean;
|
|
88
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions,
|
|
88
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SlideoverSlots>;
|
|
89
89
|
export default _default;
|
|
90
|
-
type
|
|
91
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
92
|
-
default: D[K];
|
|
93
|
-
}> : P[K];
|
|
94
|
-
};
|
|
95
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
96
|
-
type __VLS_TypePropsToOption<T> = {
|
|
97
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
98
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
99
|
-
} : {
|
|
100
|
-
type: import('vue').PropType<T[K]>;
|
|
101
|
-
required: true;
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
90
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
105
91
|
new (): {
|
|
106
92
|
$slots: S;
|
|
107
93
|
};
|
|
108
94
|
};
|
|
109
|
-
type __VLS_PrettifyLocal<T> = {
|
|
110
|
-
[K in keyof T]: T[K];
|
|
111
|
-
} & {};
|
|
@@ -9,11 +9,13 @@ import { reactivePick } from "@vueuse/core";
|
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
10
|
import { useFormField } from "../composables/useFormField";
|
|
11
11
|
import { tv } from "../utils/tv";
|
|
12
|
+
import UTooltip from "./Tooltip.vue";
|
|
12
13
|
const props = defineProps({
|
|
13
14
|
as: { type: null, required: false },
|
|
14
15
|
size: { type: null, required: false },
|
|
15
16
|
color: { type: null, required: false },
|
|
16
17
|
orientation: { type: null, required: false, default: "horizontal" },
|
|
18
|
+
tooltip: { type: [Boolean, Object], required: false },
|
|
17
19
|
defaultValue: { type: [Number, Array], required: false },
|
|
18
20
|
class: { type: null, required: false },
|
|
19
21
|
ui: { type: null, required: false },
|
|
@@ -26,7 +28,7 @@ const props = defineProps({
|
|
|
26
28
|
minStepsBetweenThumbs: { type: Number, required: false }
|
|
27
29
|
});
|
|
28
30
|
const emits = defineEmits(["update:modelValue", "change"]);
|
|
29
|
-
const modelValue = defineModel({ type:
|
|
31
|
+
const modelValue = defineModel({ type: null });
|
|
30
32
|
const appConfig = useAppConfig();
|
|
31
33
|
const rootProps = useForwardPropsEmits(reactivePick(props, "as", "orientation", "min", "max", "step", "minStepsBetweenThumbs", "inverted"), emits);
|
|
32
34
|
const { id, emitFormChange, emitFormInput, size, color, name, disabled, ariaAttrs } = useFormField(props);
|
|
@@ -47,7 +49,7 @@ const sliderValue = computed({
|
|
|
47
49
|
modelValue.value = value?.length !== 1 ? value : value[0];
|
|
48
50
|
}
|
|
49
51
|
});
|
|
50
|
-
const
|
|
52
|
+
const thumbs = computed(() => sliderValue.value?.length ?? 1);
|
|
51
53
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.slider || {} })({
|
|
52
54
|
disabled: disabled.value,
|
|
53
55
|
size: size.value,
|
|
@@ -68,7 +70,7 @@ function onChange(value) {
|
|
|
68
70
|
v-model="sliderValue"
|
|
69
71
|
:name="name"
|
|
70
72
|
:disabled="disabled"
|
|
71
|
-
:class="ui.root({ class: [props.
|
|
73
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
72
74
|
:default-value="defaultSliderValue"
|
|
73
75
|
@update:model-value="emitFormInput()"
|
|
74
76
|
@value-commit="onChange"
|
|
@@ -77,6 +79,16 @@ function onChange(value) {
|
|
|
77
79
|
<SliderRange :class="ui.range({ class: props.ui?.range })" />
|
|
78
80
|
</SliderTrack>
|
|
79
81
|
|
|
80
|
-
<
|
|
82
|
+
<template v-for="thumb in thumbs" :key="thumb">
|
|
83
|
+
<UTooltip
|
|
84
|
+
v-if="!!tooltip"
|
|
85
|
+
:text="thumbs > 1 ? String(sliderValue?.[thumb - 1]) : String(sliderValue)"
|
|
86
|
+
disable-closing-trigger
|
|
87
|
+
v-bind="typeof tooltip === 'object' ? tooltip : {}"
|
|
88
|
+
>
|
|
89
|
+
<SliderThumb :class="ui.thumb({ class: props.ui?.thumb })" />
|
|
90
|
+
</UTooltip>
|
|
91
|
+
<SliderThumb v-else :class="ui.thumb({ class: props.ui?.thumb })" />
|
|
92
|
+
</template>
|
|
81
93
|
</SliderRoot>
|
|
82
94
|
</template>
|