@nuxt/ui 3.2.0 → 3.3.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/button.ts +42 -42
- package/.nuxt/ui/command-palette.ts +2 -1
- package/.nuxt/ui/file-upload.ts +290 -0
- package/.nuxt/ui/index.ts +1 -0
- package/.nuxt/ui/kbd.ts +167 -3
- package/.nuxt/ui/table.ts +8 -0
- package/.nuxt/ui/tabs.ts +4 -2
- package/.nuxt/ui/toast.ts +8 -15
- package/.nuxt/ui/tooltip.ts +1 -1
- package/cli/templates.mjs +4 -3
- package/dist/module.d.mts +15 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +3 -3
- package/dist/runtime/components/Accordion.vue.d.ts +1 -1
- package/dist/runtime/components/Alert.vue.d.ts +2 -2
- package/dist/runtime/components/App.vue.d.ts +1 -1
- package/dist/runtime/components/Avatar.vue.d.ts +1 -1
- package/dist/runtime/components/AvatarGroup.vue.d.ts +1 -1
- package/dist/runtime/components/Badge.vue.d.ts +1 -1
- package/dist/runtime/components/Breadcrumb.vue.d.ts +1 -1
- package/dist/runtime/components/Button.vue +6 -6
- package/dist/runtime/components/Button.vue.d.ts +1 -5
- package/dist/runtime/components/ButtonGroup.vue.d.ts +1 -1
- package/dist/runtime/components/Calendar.vue.d.ts +1 -1
- package/dist/runtime/components/Card.vue.d.ts +1 -1
- package/dist/runtime/components/Carousel.vue +18 -14
- package/dist/runtime/components/Carousel.vue.d.ts +1 -1
- package/dist/runtime/components/Checkbox.vue.d.ts +1 -1
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +1 -1
- package/dist/runtime/components/Chip.vue.d.ts +2 -2
- package/dist/runtime/components/Collapsible.vue.d.ts +1 -1
- package/dist/runtime/components/ColorPicker.vue +1 -2
- package/dist/runtime/components/ColorPicker.vue.d.ts +1 -1
- package/dist/runtime/components/CommandPalette.vue +4 -0
- package/dist/runtime/components/CommandPalette.vue.d.ts +6 -1
- package/dist/runtime/components/Container.vue.d.ts +1 -1
- package/dist/runtime/components/ContextMenu.vue.d.ts +1 -1
- package/dist/runtime/components/ContextMenuContent.vue.d.ts +1 -1
- package/dist/runtime/components/Drawer.vue +4 -4
- package/dist/runtime/components/Drawer.vue.d.ts +6 -1
- package/dist/runtime/components/DropdownMenu.vue.d.ts +1 -1
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +8 -5
- package/dist/runtime/components/FileUpload.vue +242 -0
- package/dist/runtime/components/FileUpload.vue.d.ts +167 -0
- package/dist/runtime/components/Form.vue.d.ts +6 -5
- package/dist/runtime/components/FormField.vue +2 -2
- package/dist/runtime/components/FormField.vue.d.ts +4 -4
- package/dist/runtime/components/Icon.vue.d.ts +1 -1
- package/dist/runtime/components/Input.vue +10 -7
- package/dist/runtime/components/Input.vue.d.ts +9 -9
- package/dist/runtime/components/InputMenu.vue +17 -10
- package/dist/runtime/components/InputMenu.vue.d.ts +15 -12
- package/dist/runtime/components/InputNumber.vue.d.ts +4 -4
- package/dist/runtime/components/InputTags.vue +2 -0
- package/dist/runtime/components/InputTags.vue.d.ts +5 -3
- package/dist/runtime/components/Kbd.vue +2 -1
- package/dist/runtime/components/Kbd.vue.d.ts +5 -1
- package/dist/runtime/components/Link.vue +6 -5
- package/dist/runtime/components/Link.vue.d.ts +1 -3
- package/dist/runtime/components/LinkBase.vue.d.ts +1 -1
- package/dist/runtime/components/Modal.vue.d.ts +2 -2
- package/dist/runtime/components/NavigationMenu.vue +3 -2
- package/dist/runtime/components/NavigationMenu.vue.d.ts +1 -1
- package/dist/runtime/components/OverlayProvider.vue.d.ts +1 -1
- package/dist/runtime/components/Pagination.vue.d.ts +1 -1
- package/dist/runtime/components/PinInput.vue.d.ts +1 -1
- package/dist/runtime/components/Popover.vue +2 -1
- package/dist/runtime/components/Popover.vue.d.ts +8 -2
- package/dist/runtime/components/Progress.vue.d.ts +1 -1
- package/dist/runtime/components/RadioGroup.vue +1 -1
- package/dist/runtime/components/RadioGroup.vue.d.ts +5 -4
- package/dist/runtime/components/Select.vue.d.ts +1 -1
- package/dist/runtime/components/SelectMenu.vue +9 -6
- package/dist/runtime/components/SelectMenu.vue.d.ts +1 -1
- package/dist/runtime/components/Separator.vue.d.ts +1 -1
- package/dist/runtime/components/Skeleton.vue.d.ts +1 -1
- package/dist/runtime/components/Slideover.vue.d.ts +2 -2
- package/dist/runtime/components/Slider.vue.d.ts +5 -5
- package/dist/runtime/components/Stepper.vue.d.ts +1 -1
- package/dist/runtime/components/Switch.vue.d.ts +1 -1
- package/dist/runtime/components/Table.vue +83 -8
- package/dist/runtime/components/Table.vue.d.ts +20 -4
- package/dist/runtime/components/Tabs.vue +11 -2
- package/dist/runtime/components/Tabs.vue.d.ts +8 -3
- package/dist/runtime/components/Textarea.vue +10 -7
- package/dist/runtime/components/Textarea.vue.d.ts +10 -9
- package/dist/runtime/components/Timeline.vue.d.ts +1 -1
- package/dist/runtime/components/Toast.vue +12 -4
- package/dist/runtime/components/Toast.vue.d.ts +14 -13
- package/dist/runtime/components/Toaster.vue.d.ts +1 -1
- package/dist/runtime/components/Tooltip.vue +2 -1
- package/dist/runtime/components/Tooltip.vue.d.ts +8 -2
- package/dist/runtime/components/Tree.vue +3 -2
- package/dist/runtime/components/Tree.vue.d.ts +1 -1
- package/dist/runtime/composables/defineShortcuts.js +5 -3
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useComponentIcons.d.ts +1 -1
- package/dist/runtime/composables/useFileUpload.d.ts +19 -0
- package/dist/runtime/composables/useFileUpload.js +63 -0
- package/dist/runtime/composables/useFormField.d.ts +3 -6
- package/dist/runtime/composables/useFormField.js +5 -2
- package/dist/runtime/composables/useKbd.d.ts +1 -1
- package/dist/runtime/composables/useLocale.js +2 -2
- package/dist/runtime/composables/useOverlay.d.ts +28 -1
- package/dist/runtime/composables/useOverlay.js +4 -4
- package/dist/runtime/composables/usePortal.d.ts +1 -1
- package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
- package/dist/runtime/inertia/components/LinkBase.vue.d.ts +1 -1
- package/dist/runtime/inertia/stubs.d.ts +1 -0
- package/dist/runtime/inertia/stubs.js +4 -2
- package/dist/runtime/locale/ar.js +2 -1
- package/dist/runtime/locale/az.js +1 -0
- package/dist/runtime/locale/bg.js +1 -0
- package/dist/runtime/locale/bn.js +1 -0
- package/dist/runtime/locale/ca.js +1 -0
- package/dist/runtime/locale/ckb.js +2 -1
- package/dist/runtime/locale/cs.js +1 -0
- package/dist/runtime/locale/da.js +1 -0
- package/dist/runtime/locale/de.js +1 -0
- package/dist/runtime/locale/el.js +1 -0
- package/dist/runtime/locale/en.js +1 -0
- package/dist/runtime/locale/es.js +1 -0
- package/dist/runtime/locale/et.js +1 -0
- package/dist/runtime/locale/fa_ir.js +1 -0
- package/dist/runtime/locale/fi.js +1 -0
- package/dist/runtime/locale/fr.js +1 -0
- package/dist/runtime/locale/he.js +1 -0
- package/dist/runtime/locale/hi.js +2 -1
- package/dist/runtime/locale/hu.js +1 -0
- package/dist/runtime/locale/hy.js +1 -0
- package/dist/runtime/locale/id.js +1 -0
- package/dist/runtime/locale/it.js +1 -0
- package/dist/runtime/locale/ja.js +1 -0
- package/dist/runtime/locale/kk.js +1 -0
- package/dist/runtime/locale/km.js +2 -1
- package/dist/runtime/locale/ko.js +1 -0
- package/dist/runtime/locale/ky.js +1 -0
- package/dist/runtime/locale/lb.js +1 -0
- package/dist/runtime/locale/lt.js +1 -0
- package/dist/runtime/locale/mn.js +1 -0
- package/dist/runtime/locale/ms.js +1 -0
- package/dist/runtime/locale/nb_no.js +1 -0
- package/dist/runtime/locale/nl.js +1 -0
- package/dist/runtime/locale/pl.js +1 -0
- package/dist/runtime/locale/pt.js +1 -0
- package/dist/runtime/locale/pt_br.js +1 -0
- package/dist/runtime/locale/ro.js +1 -0
- package/dist/runtime/locale/ru.js +1 -0
- package/dist/runtime/locale/sk.js +1 -0
- package/dist/runtime/locale/sl.js +1 -0
- package/dist/runtime/locale/sv.js +1 -0
- package/dist/runtime/locale/th.js +1 -0
- package/dist/runtime/locale/tj.js +1 -0
- package/dist/runtime/locale/tr.js +1 -0
- package/dist/runtime/locale/ug_cn.js +1 -0
- package/dist/runtime/locale/uk.js +1 -0
- package/dist/runtime/locale/ur.js +1 -0
- package/dist/runtime/locale/uz.js +1 -0
- package/dist/runtime/locale/vi.js +1 -0
- package/dist/runtime/locale/zh_cn.js +1 -0
- package/dist/runtime/locale/zh_tw.js +1 -0
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/locale.d.ts +1 -0
- package/dist/runtime/utils/index.d.ts +1 -0
- package/dist/runtime/utils/index.js +9 -0
- package/dist/runtime/vue/components/Icon.vue.d.ts +1 -1
- package/dist/runtime/vue/components/Link.vue.d.ts +1 -1
- package/dist/runtime/vue/stubs.d.ts +1 -0
- package/dist/runtime/vue/stubs.js +3 -1
- package/dist/shared/{ui.BPVxSPGY.mjs → ui.BkSj2DmF.mjs} +278 -29
- package/dist/unplugin.d.mts +2 -0
- package/dist/unplugin.mjs +6 -3
- package/dist/vite.mjs +1 -1
- package/package.json +24 -24
|
@@ -16,6 +16,7 @@ const props = defineProps({
|
|
|
16
16
|
content: { type: Object, required: false },
|
|
17
17
|
arrow: { type: [Boolean, Object], required: false },
|
|
18
18
|
portal: { type: [Boolean, String], required: false, skipCheck: true, default: true },
|
|
19
|
+
reference: { type: null, required: false },
|
|
19
20
|
dismissible: { type: Boolean, required: false, default: true },
|
|
20
21
|
class: { type: null, required: false },
|
|
21
22
|
ui: { type: null, required: false },
|
|
@@ -54,7 +55,7 @@ const Component = computed(() => props.mode === "hover" ? HoverCard : Popover);
|
|
|
54
55
|
|
|
55
56
|
<template>
|
|
56
57
|
<Component.Root v-slot="{ open }" v-bind="rootProps">
|
|
57
|
-
<Component.Trigger v-if="!!slots.default" as-child :class="props.class">
|
|
58
|
+
<Component.Trigger v-if="!!slots.default || !!reference" as-child :reference="reference" :class="props.class">
|
|
58
59
|
<slot :open="open" />
|
|
59
60
|
</Component.Trigger>
|
|
60
61
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Popover } from 'reka-ui/namespaced';
|
|
2
|
-
import type { PopoverRootProps, HoverCardRootProps, PopoverRootEmits, PopoverContentProps, PopoverContentEmits, PopoverArrowProps } from 'reka-ui';
|
|
2
|
+
import type { PopoverRootProps, HoverCardRootProps, PopoverRootEmits, PopoverContentProps, PopoverContentEmits, PopoverArrowProps, HoverCardTriggerProps } from 'reka-ui';
|
|
3
3
|
import type { AppConfig } from '@nuxt/schema';
|
|
4
4
|
import theme from '#build/ui/popover';
|
|
5
5
|
import type { EmitsToProps, ComponentConfig } from '../types/utils';
|
|
@@ -25,6 +25,12 @@ export interface PopoverProps extends PopoverRootProps, Pick<HoverCardRootProps,
|
|
|
25
25
|
* @defaultValue true
|
|
26
26
|
*/
|
|
27
27
|
portal?: boolean | string | HTMLElement;
|
|
28
|
+
/**
|
|
29
|
+
* The reference (or anchor) element that is being referred to for positioning.
|
|
30
|
+
*
|
|
31
|
+
* If not provided will use the current component as anchor.
|
|
32
|
+
*/
|
|
33
|
+
reference?: HoverCardTriggerProps['reference'];
|
|
28
34
|
/**
|
|
29
35
|
* When `false`, the popover will not close when clicking outside or pressing escape.
|
|
30
36
|
* @defaultValue true
|
|
@@ -43,7 +49,7 @@ export interface PopoverSlots {
|
|
|
43
49
|
content(props?: {}): any;
|
|
44
50
|
anchor(props?: {}): any;
|
|
45
51
|
}
|
|
46
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PopoverProps,
|
|
52
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PopoverProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
47
53
|
"update:open": (value: boolean) => any;
|
|
48
54
|
"close:prevent": () => any;
|
|
49
55
|
}, string, import("vue").PublicProps, Readonly<PopoverProps> & Readonly<{
|
|
@@ -47,7 +47,7 @@ export type ProgressSlots = {
|
|
|
47
47
|
step: number;
|
|
48
48
|
}) => any;
|
|
49
49
|
};
|
|
50
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProgressProps,
|
|
50
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProgressProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
51
51
|
"update:modelValue": (value: string[] | undefined) => any;
|
|
52
52
|
"update:max": (value: number) => any;
|
|
53
53
|
}, string, import("vue").PublicProps, Readonly<ProgressProps> & Readonly<{
|
|
@@ -54,7 +54,7 @@ function normalizeItem(item) {
|
|
|
54
54
|
label: void 0
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
if (typeof item === "string" || typeof item === "number") {
|
|
57
|
+
if (typeof item === "string" || typeof item === "number" || typeof item === "bigint") {
|
|
58
58
|
return {
|
|
59
59
|
id: `${id}:${item}`,
|
|
60
60
|
value: String(item),
|
|
@@ -64,10 +64,11 @@ export interface RadioGroupProps<T extends RadioGroupItem = RadioGroupItem> exte
|
|
|
64
64
|
export type RadioGroupEmits = RadioGroupRootEmits & {
|
|
65
65
|
change: [payload: Event];
|
|
66
66
|
};
|
|
67
|
+
type NormalizeItem<T extends RadioGroupItem> = Exclude<T & {
|
|
68
|
+
id: string;
|
|
69
|
+
}, RadioGroupValue>;
|
|
67
70
|
type SlotProps<T extends RadioGroupItem> = (props: {
|
|
68
|
-
item: T
|
|
69
|
-
id: string;
|
|
70
|
-
};
|
|
71
|
+
item: NormalizeItem<T>;
|
|
71
72
|
modelValue?: RadioGroupValue;
|
|
72
73
|
}) => any;
|
|
73
74
|
export interface RadioGroupSlots<T extends RadioGroupItem = RadioGroupItem> {
|
|
@@ -89,5 +90,5 @@ declare const _default: <T extends RadioGroupItem>(__VLS_props: NonNullable<Awai
|
|
|
89
90
|
};
|
|
90
91
|
export default _default;
|
|
91
92
|
type __VLS_PrettifyLocal<T> = {
|
|
92
|
-
[K in keyof T]: T[K];
|
|
93
|
+
[K in keyof T as K]: T[K];
|
|
93
94
|
} & {};
|
|
@@ -93,10 +93,7 @@ function displayValue(value) {
|
|
|
93
93
|
const values = value.map((v) => displayValue(v)).filter(Boolean);
|
|
94
94
|
return values?.length ? values.join(", ") : void 0;
|
|
95
95
|
}
|
|
96
|
-
|
|
97
|
-
return value && (typeof value === "object" ? get(value, props.labelKey) : value);
|
|
98
|
-
}
|
|
99
|
-
const item = items.value.find((item2) => compare(typeof item2 === "object" ? get(item2, props.valueKey) : item2, value));
|
|
96
|
+
const item = items.value.find((item2) => compare(typeof item2 === "object" && props.valueKey ? get(item2, props.valueKey) : item2, value));
|
|
100
97
|
return item && (typeof item === "object" ? get(item, props.labelKey) : item);
|
|
101
98
|
}
|
|
102
99
|
const groups = computed(
|
|
@@ -109,13 +106,19 @@ const filteredGroups = computed(() => {
|
|
|
109
106
|
}
|
|
110
107
|
const fields = Array.isArray(props.filterFields) ? props.filterFields : [props.labelKey];
|
|
111
108
|
return groups.value.map((items2) => items2.filter((item) => {
|
|
112
|
-
if (
|
|
109
|
+
if (item === void 0 || item === null) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
if (typeof item !== "object") {
|
|
113
113
|
return contains(String(item), searchTerm.value);
|
|
114
114
|
}
|
|
115
115
|
if (item.type && ["label", "separator"].includes(item.type)) {
|
|
116
116
|
return true;
|
|
117
117
|
}
|
|
118
|
-
return fields.some((field) =>
|
|
118
|
+
return fields.some((field) => {
|
|
119
|
+
const value = get(item, field);
|
|
120
|
+
return value !== void 0 && value !== null && contains(String(value), searchTerm.value);
|
|
121
|
+
});
|
|
119
122
|
})).filter((group) => group.filter(
|
|
120
123
|
(item) => !isSelectItem(item) || (!item.type || !["label", "separator"].includes(item.type))
|
|
121
124
|
).length > 0);
|
|
@@ -43,7 +43,7 @@ export interface SeparatorProps extends Pick<_SeparatorProps, 'decorative'> {
|
|
|
43
43
|
export interface SeparatorSlots {
|
|
44
44
|
default(props?: {}): any;
|
|
45
45
|
}
|
|
46
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SeparatorProps,
|
|
46
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SeparatorProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SeparatorProps> & Readonly<{}>, {
|
|
47
47
|
orientation: "horizontal" | "vertical";
|
|
48
48
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SeparatorSlots>;
|
|
49
49
|
export default _default;
|
|
@@ -6,7 +6,7 @@ export interface SkeletonProps {
|
|
|
6
6
|
as?: any;
|
|
7
7
|
class?: any;
|
|
8
8
|
}
|
|
9
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SkeletonProps,
|
|
9
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SkeletonProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SkeletonProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
10
10
|
default?: (props: {}) => any;
|
|
11
11
|
}>;
|
|
12
12
|
export default _default;
|
|
@@ -80,7 +80,7 @@ export interface SlideoverSlots {
|
|
|
80
80
|
close: () => void;
|
|
81
81
|
}): any;
|
|
82
82
|
}
|
|
83
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SlideoverProps,
|
|
83
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SlideoverProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
84
84
|
"update:open": (value: boolean) => any;
|
|
85
85
|
"after:leave": () => any;
|
|
86
86
|
"after:enter": () => any;
|
|
@@ -93,9 +93,9 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SlideoverP
|
|
|
93
93
|
}>, {
|
|
94
94
|
close: boolean | Partial<ButtonProps>;
|
|
95
95
|
modal: boolean;
|
|
96
|
+
transition: boolean;
|
|
96
97
|
portal: boolean | string | HTMLElement;
|
|
97
98
|
overlay: boolean;
|
|
98
|
-
transition: boolean;
|
|
99
99
|
side: Slideover["variants"]["side"];
|
|
100
100
|
dismissible: boolean;
|
|
101
101
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SlideoverSlots>;
|
|
@@ -35,24 +35,24 @@ export interface SliderProps extends Pick<SliderRootProps, 'name' | 'disabled' |
|
|
|
35
35
|
ui?: Slider['slots'];
|
|
36
36
|
}
|
|
37
37
|
export interface SliderEmits<T extends number | number[] = number | number[]> {
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
'update:modelValue': [payload: T];
|
|
39
|
+
'change': [payload: Event];
|
|
40
40
|
}
|
|
41
41
|
declare const _default: <T extends number | number[]>(__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<{
|
|
42
42
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
43
43
|
readonly onChange?: ((payload: Event) => any) | undefined;
|
|
44
|
-
readonly "onUpdate:modelValue"?: ((
|
|
44
|
+
readonly "onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
|
|
45
45
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onChange" | "onUpdate:modelValue"> & (SliderProps & {
|
|
46
46
|
modelValue?: T;
|
|
47
47
|
}) & Partial<{}>> & import("vue").PublicProps;
|
|
48
48
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
49
49
|
attrs: any;
|
|
50
50
|
slots: {};
|
|
51
|
-
emit:
|
|
51
|
+
emit: (((evt: "change", payload: Event) => void) & ((evt: "update:modelValue", payload: T) => void)) & ((evt: "update:modelValue", value: T | undefined) => void);
|
|
52
52
|
}>) => import("vue").VNode & {
|
|
53
53
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
54
54
|
};
|
|
55
55
|
export default _default;
|
|
56
56
|
type __VLS_PrettifyLocal<T> = {
|
|
57
|
-
[K in keyof T]: T[K];
|
|
57
|
+
[K in keyof T as K]: T[K];
|
|
58
58
|
} & {};
|
|
@@ -53,7 +53,7 @@ export interface SwitchSlots {
|
|
|
53
53
|
}
|
|
54
54
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SwitchProps & {
|
|
55
55
|
modelValue?: boolean;
|
|
56
|
-
},
|
|
56
|
+
}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
57
57
|
change: (payload: Event) => any;
|
|
58
58
|
"update:modelValue": (value: boolean) => any;
|
|
59
59
|
}, string, import("vue").PublicProps, Readonly<SwitchProps & {
|
|
@@ -18,7 +18,7 @@ const props = defineProps({
|
|
|
18
18
|
caption: { type: String, required: false },
|
|
19
19
|
meta: { type: Object, required: false },
|
|
20
20
|
empty: { type: String, required: false },
|
|
21
|
-
sticky: { type: Boolean, required: false },
|
|
21
|
+
sticky: { type: [Boolean, String], required: false },
|
|
22
22
|
loading: { type: Boolean, required: false },
|
|
23
23
|
loadingColor: { type: null, required: false },
|
|
24
24
|
loadingAnimation: { type: null, required: false },
|
|
@@ -38,6 +38,8 @@ const props = defineProps({
|
|
|
38
38
|
paginationOptions: { type: Object, required: false },
|
|
39
39
|
facetedOptions: { type: Object, required: false },
|
|
40
40
|
onSelect: { type: Function, required: false },
|
|
41
|
+
onHover: { type: Function, required: false },
|
|
42
|
+
onContextmenu: { type: [Function, Array], required: false },
|
|
41
43
|
class: { type: null, required: false },
|
|
42
44
|
ui: { type: null, required: false },
|
|
43
45
|
state: { type: Object, required: false },
|
|
@@ -69,6 +71,20 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.table || {} }
|
|
|
69
71
|
loadingColor: props.loadingColor,
|
|
70
72
|
loadingAnimation: props.loadingAnimation
|
|
71
73
|
}));
|
|
74
|
+
const hasFooter = computed(() => {
|
|
75
|
+
function hasFooterRecursive(columns2) {
|
|
76
|
+
for (const column of columns2) {
|
|
77
|
+
if ("footer" in column) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
if ("columns" in column && hasFooterRecursive(column.columns)) {
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
return hasFooterRecursive(columns.value);
|
|
87
|
+
});
|
|
72
88
|
const globalFilterState = defineModel("globalFilter", { type: String, ...{ default: void 0 } });
|
|
73
89
|
const columnFiltersState = defineModel("columnFilters", { type: Array, ...{ default: [] } });
|
|
74
90
|
const columnOrderState = defineModel("columnOrder", { type: Array, ...{ default: [] } });
|
|
@@ -86,7 +102,9 @@ const tableRef = ref(null);
|
|
|
86
102
|
const tableApi = useVueTable({
|
|
87
103
|
...reactiveOmit(props, "as", "data", "columns", "caption", "sticky", "loading", "loadingColor", "loadingAnimation", "class", "ui"),
|
|
88
104
|
data,
|
|
89
|
-
columns
|
|
105
|
+
get columns() {
|
|
106
|
+
return columns.value;
|
|
107
|
+
},
|
|
90
108
|
meta: meta.value,
|
|
91
109
|
getCoreRowModel: getCoreRowModel(),
|
|
92
110
|
...props.globalFilterOptions || {},
|
|
@@ -162,7 +180,7 @@ const tableApi = useVueTable({
|
|
|
162
180
|
function valueUpdater(updaterOrValue, ref2) {
|
|
163
181
|
ref2.value = typeof updaterOrValue === "function" ? updaterOrValue(ref2.value) : updaterOrValue;
|
|
164
182
|
}
|
|
165
|
-
function
|
|
183
|
+
function onRowSelect(e, row) {
|
|
166
184
|
if (!props.onSelect) {
|
|
167
185
|
return;
|
|
168
186
|
}
|
|
@@ -175,6 +193,28 @@ function handleRowSelect(row, e) {
|
|
|
175
193
|
e.stopPropagation();
|
|
176
194
|
props.onSelect(row, e);
|
|
177
195
|
}
|
|
196
|
+
function onRowHover(e, row) {
|
|
197
|
+
if (!props.onHover) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
props.onHover(e, row);
|
|
201
|
+
}
|
|
202
|
+
function onRowContextmenu(e, row) {
|
|
203
|
+
if (!props.onContextmenu) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
if (Array.isArray(props.onContextmenu)) {
|
|
207
|
+
props.onContextmenu.forEach((fn) => fn(e, row));
|
|
208
|
+
} else {
|
|
209
|
+
props.onContextmenu(e, row);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
function resolveValue(prop, arg) {
|
|
213
|
+
if (typeof prop === "function") {
|
|
214
|
+
return prop(arg);
|
|
215
|
+
}
|
|
216
|
+
return prop;
|
|
217
|
+
}
|
|
178
218
|
watch(
|
|
179
219
|
() => props.data,
|
|
180
220
|
() => {
|
|
@@ -203,11 +243,13 @@ defineExpose({
|
|
|
203
243
|
v-for="header in headerGroup.headers"
|
|
204
244
|
:key="header.id"
|
|
205
245
|
:data-pinned="header.column.getIsPinned()"
|
|
246
|
+
:scope="header.colSpan > 1 ? 'colgroup' : 'col'"
|
|
206
247
|
:colspan="header.colSpan > 1 ? header.colSpan : void 0"
|
|
248
|
+
:rowspan="header.rowSpan > 1 ? header.rowSpan : void 0"
|
|
207
249
|
:class="ui.th({
|
|
208
250
|
class: [
|
|
209
251
|
props.ui?.th,
|
|
210
|
-
|
|
252
|
+
resolveValue(header.column.columnDef.meta?.class?.th, header)
|
|
211
253
|
],
|
|
212
254
|
pinned: !!header.column.getIsPinned()
|
|
213
255
|
})"
|
|
@@ -228,29 +270,36 @@ defineExpose({
|
|
|
228
270
|
<template v-for="row in tableApi.getRowModel().rows" :key="row.id">
|
|
229
271
|
<tr
|
|
230
272
|
:data-selected="row.getIsSelected()"
|
|
231
|
-
:data-selectable="!!props.onSelect"
|
|
273
|
+
:data-selectable="!!props.onSelect || !!props.onHover || !!props.onContextmenu"
|
|
232
274
|
:data-expanded="row.getIsExpanded()"
|
|
233
275
|
:role="props.onSelect ? 'button' : void 0"
|
|
234
276
|
:tabindex="props.onSelect ? 0 : void 0"
|
|
235
277
|
:class="ui.tr({
|
|
236
278
|
class: [
|
|
237
279
|
props.ui?.tr,
|
|
238
|
-
|
|
280
|
+
resolveValue(tableApi.options.meta?.class?.tr, row)
|
|
239
281
|
]
|
|
240
282
|
})"
|
|
241
|
-
|
|
283
|
+
:style="resolveValue(tableApi.options.meta?.style?.tr, row)"
|
|
284
|
+
@click="onRowSelect($event, row)"
|
|
285
|
+
@pointerenter="onRowHover($event, row)"
|
|
286
|
+
@pointerleave="onRowHover($event, null)"
|
|
287
|
+
@contextmenu="onRowContextmenu($event, row)"
|
|
242
288
|
>
|
|
243
289
|
<td
|
|
244
290
|
v-for="cell in row.getVisibleCells()"
|
|
245
291
|
:key="cell.id"
|
|
246
292
|
:data-pinned="cell.column.getIsPinned()"
|
|
293
|
+
:colspan="resolveValue(cell.column.columnDef.meta?.colspan?.td, cell)"
|
|
294
|
+
:rowspan="resolveValue(cell.column.columnDef.meta?.rowspan?.td, cell)"
|
|
247
295
|
:class="ui.td({
|
|
248
296
|
class: [
|
|
249
297
|
props.ui?.td,
|
|
250
|
-
|
|
298
|
+
resolveValue(cell.column.columnDef.meta?.class?.td, cell)
|
|
251
299
|
],
|
|
252
300
|
pinned: !!cell.column.getIsPinned()
|
|
253
301
|
})"
|
|
302
|
+
:style="resolveValue(cell.column.columnDef.meta?.style?.td, cell)"
|
|
254
303
|
>
|
|
255
304
|
<slot :name="`${cell.column.id}-cell`" v-bind="cell.getContext()">
|
|
256
305
|
<FlexRender :render="cell.column.columnDef.cell" :props="cell.getContext()" />
|
|
@@ -281,6 +330,32 @@ defineExpose({
|
|
|
281
330
|
|
|
282
331
|
<slot name="body-bottom" />
|
|
283
332
|
</tbody>
|
|
333
|
+
|
|
334
|
+
<tfoot v-if="hasFooter" :class="ui.tfoot({ class: [props.ui?.tfoot] })">
|
|
335
|
+
<tr :class="ui.separator({ class: [props.ui?.separator] })" />
|
|
336
|
+
|
|
337
|
+
<tr v-for="footerGroup in tableApi.getFooterGroups()" :key="footerGroup.id" :class="ui.tr({ class: [props.ui?.tr] })">
|
|
338
|
+
<th
|
|
339
|
+
v-for="header in footerGroup.headers"
|
|
340
|
+
:key="header.id"
|
|
341
|
+
:data-pinned="header.column.getIsPinned()"
|
|
342
|
+
:colspan="header.colSpan > 1 ? header.colSpan : void 0"
|
|
343
|
+
:rowspan="header.rowSpan > 1 ? header.rowSpan : void 0"
|
|
344
|
+
:class="ui.th({
|
|
345
|
+
class: [
|
|
346
|
+
props.ui?.th,
|
|
347
|
+
resolveValue(header.column.columnDef.meta?.class?.th, header)
|
|
348
|
+
],
|
|
349
|
+
pinned: !!header.column.getIsPinned()
|
|
350
|
+
})"
|
|
351
|
+
:style="resolveValue(header.column.columnDef.meta?.style?.th, header)"
|
|
352
|
+
>
|
|
353
|
+
<slot :name="`${header.id}-footer`" v-bind="header.getContext()">
|
|
354
|
+
<FlexRender v-if="!header.isPlaceholder" :render="header.column.columnDef.footer" :props="header.getContext()" />
|
|
355
|
+
</slot>
|
|
356
|
+
</th>
|
|
357
|
+
</tr>
|
|
358
|
+
</tfoot>
|
|
284
359
|
</table>
|
|
285
360
|
</Primitive>
|
|
286
361
|
</template>
|
|
@@ -10,11 +10,24 @@ declare module '@tanstack/table-core' {
|
|
|
10
10
|
th?: string | ((cell: Header<TData, TValue>) => string);
|
|
11
11
|
td?: string | ((cell: Cell<TData, TValue>) => string);
|
|
12
12
|
};
|
|
13
|
+
style?: {
|
|
14
|
+
th?: string | Record<string, string> | ((cell: Header<TData, TValue>) => string | Record<string, string>);
|
|
15
|
+
td?: string | Record<string, string> | ((cell: Cell<TData, TValue>) => string | Record<string, string>);
|
|
16
|
+
};
|
|
17
|
+
colspan?: {
|
|
18
|
+
td?: string | ((cell: Cell<TData, TValue>) => string);
|
|
19
|
+
};
|
|
20
|
+
rowspan?: {
|
|
21
|
+
td?: string | ((cell: Cell<TData, TValue>) => string);
|
|
22
|
+
};
|
|
13
23
|
}
|
|
14
24
|
interface TableMeta<TData> {
|
|
15
25
|
class?: {
|
|
16
26
|
tr?: string | ((row: Row<TData>) => string);
|
|
17
27
|
};
|
|
28
|
+
style?: {
|
|
29
|
+
tr?: string | Record<string, string> | ((row: Row<TData>) => string | Record<string, string>);
|
|
30
|
+
};
|
|
18
31
|
}
|
|
19
32
|
}
|
|
20
33
|
type Table = ComponentConfig<typeof theme, AppConfig, 'table'>;
|
|
@@ -42,10 +55,10 @@ export interface TableProps<T extends TableData = TableData> extends TableOption
|
|
|
42
55
|
*/
|
|
43
56
|
empty?: string;
|
|
44
57
|
/**
|
|
45
|
-
* Whether the table should have a sticky header.
|
|
58
|
+
* Whether the table should have a sticky header or footer. True for both, 'header' for header only, 'footer' for footer only.
|
|
46
59
|
* @defaultValue false
|
|
47
60
|
*/
|
|
48
|
-
sticky?: boolean;
|
|
61
|
+
sticky?: boolean | 'header' | 'footer';
|
|
49
62
|
/** Whether the table should be in loading state. */
|
|
50
63
|
loading?: boolean;
|
|
51
64
|
/**
|
|
@@ -124,10 +137,13 @@ export interface TableProps<T extends TableData = TableData> extends TableOption
|
|
|
124
137
|
*/
|
|
125
138
|
facetedOptions?: FacetedOptions<T>;
|
|
126
139
|
onSelect?: (row: TableRow<T>, e?: Event) => void;
|
|
140
|
+
onHover?: (e: Event, row: TableRow<T> | null) => void;
|
|
141
|
+
onContextmenu?: ((e: Event, row: TableRow<T>) => void) | Array<((e: Event, row: TableRow<T>) => void)>;
|
|
127
142
|
class?: any;
|
|
128
143
|
ui?: Table['slots'];
|
|
129
144
|
}
|
|
130
145
|
type DynamicHeaderSlots<T, K = keyof T> = Record<string, (props: HeaderContext<T, unknown>) => any> & Record<`${K extends string ? K : never}-header`, (props: HeaderContext<T, unknown>) => any>;
|
|
146
|
+
type DynamicFooterSlots<T, K = keyof T> = Record<string, (props: HeaderContext<T, unknown>) => any> & Record<`${K extends string ? K : never}-footer`, (props: HeaderContext<T, unknown>) => any>;
|
|
131
147
|
type DynamicCellSlots<T, K = keyof T> = Record<string, (props: CellContext<T, unknown>) => any> & Record<`${K extends string ? K : never}-cell`, (props: CellContext<T, unknown>) => any>;
|
|
132
148
|
export type TableSlots<T extends TableData = TableData> = {
|
|
133
149
|
'expanded': (props: {
|
|
@@ -138,7 +154,7 @@ export type TableSlots<T extends TableData = TableData> = {
|
|
|
138
154
|
'caption': (props?: {}) => any;
|
|
139
155
|
'body-top': (props?: {}) => any;
|
|
140
156
|
'body-bottom': (props?: {}) => any;
|
|
141
|
-
} & DynamicHeaderSlots<T> & DynamicCellSlots<T>;
|
|
157
|
+
} & DynamicHeaderSlots<T> & DynamicFooterSlots<T> & DynamicCellSlots<T>;
|
|
142
158
|
declare const _default: <T extends TableData>(__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<{
|
|
143
159
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
144
160
|
readonly "onUpdate:globalFilter"?: ((value: string) => any) | undefined;
|
|
@@ -181,5 +197,5 @@ declare const _default: <T extends TableData>(__VLS_props: NonNullable<Awaited<t
|
|
|
181
197
|
};
|
|
182
198
|
export default _default;
|
|
183
199
|
type __VLS_PrettifyLocal<T> = {
|
|
184
|
-
[K in keyof T]: T[K];
|
|
200
|
+
[K in keyof T as K]: T[K];
|
|
185
201
|
} & {};
|
|
@@ -60,14 +60,23 @@ defineExpose({
|
|
|
60
60
|
>
|
|
61
61
|
<slot name="leading" :item="item" :index="index">
|
|
62
62
|
<UIcon v-if="item.icon" :name="item.icon" :class="ui.leadingIcon({ class: [props.ui?.leadingIcon, item.ui?.leadingIcon] })" />
|
|
63
|
-
<UAvatar v-else-if="item.avatar" :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="item.avatar" :class="ui.leadingAvatar({ class: [props.ui?.leadingAvatar, item.ui?.leadingAvatar] })" />
|
|
63
|
+
<UAvatar v-else-if="item.avatar" :size="item.ui?.leadingAvatarSize || props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="item.avatar" :class="ui.leadingAvatar({ class: [props.ui?.leadingAvatar, item.ui?.leadingAvatar] })" />
|
|
64
64
|
</slot>
|
|
65
65
|
|
|
66
66
|
<span v-if="get(item, props.labelKey) || !!slots.default" :class="ui.label({ class: [props.ui?.label, item.ui?.label] })">
|
|
67
67
|
<slot :item="item" :index="index">{{ get(item, props.labelKey) }}</slot>
|
|
68
68
|
</span>
|
|
69
69
|
|
|
70
|
-
<slot name="trailing" :item="item" :index="index"
|
|
70
|
+
<slot name="trailing" :item="item" :index="index">
|
|
71
|
+
<UBadge
|
|
72
|
+
v-if="item.badge !== void 0"
|
|
73
|
+
color="neutral"
|
|
74
|
+
variant="outline"
|
|
75
|
+
:size="item.ui?.trailingBadgeSize || props.ui?.trailingBadgeSize || ui.trailingBadgeSize()"
|
|
76
|
+
v-bind="typeof item.badge === 'string' || typeof item.badge === 'number' ? { label: item.badge } : item.badge"
|
|
77
|
+
:class="ui.trailingBadge({ class: [props.ui?.trailingBadge, item.ui?.trailingBadge] })"
|
|
78
|
+
/>
|
|
79
|
+
</slot>
|
|
71
80
|
</TabsTrigger>
|
|
72
81
|
|
|
73
82
|
<slot name="list-trailing" />
|
|
@@ -2,7 +2,7 @@ import type { ComponentPublicInstance } from 'vue';
|
|
|
2
2
|
import type { TabsRootProps, TabsRootEmits } from 'reka-ui';
|
|
3
3
|
import type { AppConfig } from '@nuxt/schema';
|
|
4
4
|
import theme from '#build/ui/tabs';
|
|
5
|
-
import type { AvatarProps } from '../types';
|
|
5
|
+
import type { AvatarProps, BadgeProps } from '../types';
|
|
6
6
|
import type { DynamicSlots, ComponentConfig } from '../types/utils';
|
|
7
7
|
type Tabs = ComponentConfig<typeof theme, AppConfig, 'tabs'>;
|
|
8
8
|
export interface TabsItem {
|
|
@@ -12,13 +12,18 @@ export interface TabsItem {
|
|
|
12
12
|
*/
|
|
13
13
|
icon?: string;
|
|
14
14
|
avatar?: AvatarProps;
|
|
15
|
+
/**
|
|
16
|
+
* Display a badge on the item.
|
|
17
|
+
* `{ size: 'sm', color: 'neutral', variant: 'outline' }`{lang="ts-type"}
|
|
18
|
+
*/
|
|
19
|
+
badge?: string | number | BadgeProps;
|
|
15
20
|
slot?: string;
|
|
16
21
|
content?: string;
|
|
17
22
|
/** A unique value for the tab item. Defaults to the index. */
|
|
18
23
|
value?: string | number;
|
|
19
24
|
disabled?: boolean;
|
|
20
25
|
class?: any;
|
|
21
|
-
ui?: Pick<Tabs['slots'], 'trigger' | 'leadingIcon' | 'leadingAvatar' | 'label' | 'content'>;
|
|
26
|
+
ui?: Pick<Tabs['slots'], 'trigger' | 'leadingIcon' | 'leadingAvatar' | 'leadingAvatarSize' | 'label' | 'trailingBadge' | 'trailingBadgeSize' | 'content'>;
|
|
22
27
|
[key: string]: any;
|
|
23
28
|
}
|
|
24
29
|
export interface TabsProps<T extends TabsItem = TabsItem> extends Pick<TabsRootProps<string | number>, 'defaultValue' | 'modelValue' | 'activationMode' | 'unmountOnHide'> {
|
|
@@ -89,5 +94,5 @@ declare const _default: <T extends TabsItem>(__VLS_props: NonNullable<Awaited<ty
|
|
|
89
94
|
};
|
|
90
95
|
export default _default;
|
|
91
96
|
type __VLS_PrettifyLocal<T> = {
|
|
92
|
-
[K in keyof T]: T[K];
|
|
97
|
+
[K in keyof T as K]: T[K];
|
|
93
98
|
} & {};
|
|
@@ -5,6 +5,7 @@ import theme from "#build/ui/textarea";
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { ref, computed, onMounted, nextTick, watch } from "vue";
|
|
7
7
|
import { Primitive } from "reka-ui";
|
|
8
|
+
import { useVModel } from "@vueuse/core";
|
|
8
9
|
import { useAppConfig } from "#imports";
|
|
9
10
|
import { useComponentIcons } from "../composables/useComponentIcons";
|
|
10
11
|
import { useFormField } from "../composables/useFormField";
|
|
@@ -30,6 +31,8 @@ const props = defineProps({
|
|
|
30
31
|
rows: { type: Number, required: false, default: 3 },
|
|
31
32
|
maxrows: { type: Number, required: false, default: 0 },
|
|
32
33
|
highlight: { type: Boolean, required: false },
|
|
34
|
+
modelValue: { type: null, required: false },
|
|
35
|
+
defaultValue: { type: null, required: false },
|
|
33
36
|
modelModifiers: { type: Object, required: false },
|
|
34
37
|
class: { type: null, required: false },
|
|
35
38
|
ui: { type: null, required: false },
|
|
@@ -44,7 +47,7 @@ const props = defineProps({
|
|
|
44
47
|
});
|
|
45
48
|
const emits = defineEmits(["update:modelValue", "blur", "change"]);
|
|
46
49
|
const slots = defineSlots();
|
|
47
|
-
const
|
|
50
|
+
const modelValue = useVModel(props, "modelValue", emits, { defaultValue: props.defaultValue });
|
|
48
51
|
const appConfig = useAppConfig();
|
|
49
52
|
const { emitFormFocus, emitFormBlur, emitFormInput, emitFormChange, size, color, id, name, highlight, disabled, ariaAttrs } = useFormField(props, { deferInputValidation: true });
|
|
50
53
|
const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(props);
|
|
@@ -60,13 +63,13 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.textarea || {
|
|
|
60
63
|
}));
|
|
61
64
|
const textareaRef = ref(null);
|
|
62
65
|
function updateInput(value) {
|
|
63
|
-
if (modelModifiers
|
|
66
|
+
if (props.modelModifiers?.trim) {
|
|
64
67
|
value = value?.trim() ?? null;
|
|
65
68
|
}
|
|
66
|
-
if (modelModifiers
|
|
69
|
+
if (props.modelModifiers?.number) {
|
|
67
70
|
value = looseToNumber(value);
|
|
68
71
|
}
|
|
69
|
-
if (modelModifiers
|
|
72
|
+
if (props.modelModifiers?.nullify) {
|
|
70
73
|
value ||= null;
|
|
71
74
|
}
|
|
72
75
|
modelValue.value = value;
|
|
@@ -74,16 +77,16 @@ function updateInput(value) {
|
|
|
74
77
|
}
|
|
75
78
|
function onInput(event) {
|
|
76
79
|
autoResize();
|
|
77
|
-
if (!modelModifiers
|
|
80
|
+
if (!props.modelModifiers?.lazy) {
|
|
78
81
|
updateInput(event.target.value);
|
|
79
82
|
}
|
|
80
83
|
}
|
|
81
84
|
function onChange(event) {
|
|
82
85
|
const value = event.target.value;
|
|
83
|
-
if (modelModifiers
|
|
86
|
+
if (props.modelModifiers?.lazy) {
|
|
84
87
|
updateInput(value);
|
|
85
88
|
}
|
|
86
|
-
if (modelModifiers
|
|
89
|
+
if (props.modelModifiers?.trim) {
|
|
87
90
|
event.target.value = value.trim();
|
|
88
91
|
}
|
|
89
92
|
emitFormChange();
|