@nuxt/ui 3.1.3 → 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/command-palette.ts +1 -0
- package/.nuxt/ui/drawer.ts +1 -1
- package/.nuxt/ui/index.ts +2 -0
- package/.nuxt/ui/input-menu.ts +24 -10
- package/.nuxt/ui/input-tags.ts +310 -0
- package/.nuxt/ui/modal.ts +1 -1
- package/.nuxt/ui/navigation-menu.ts +1 -1
- package/.nuxt/ui/select-menu.ts +11 -6
- package/.nuxt/ui/select.ts +11 -6
- package/.nuxt/ui/table.ts +3 -2
- package/.nuxt/ui/timeline.ts +321 -0
- package/.nuxt/ui/toaster.ts +1 -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.d.ts +4 -20
- 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/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 +14 -13
- package/dist/runtime/components/Modal.vue.d.ts +14 -4
- package/dist/runtime/components/NavigationMenu.vue +16 -15
- 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/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 +23 -4
- package/dist/runtime/components/Select.vue.d.ts +107 -1
- package/dist/runtime/components/SelectMenu.vue +24 -5
- package/dist/runtime/components/SelectMenu.vue.d.ts +105 -1
- package/dist/runtime/components/Slideover.vue +14 -13
- package/dist/runtime/components/Slideover.vue.d.ts +14 -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.d.ts +4 -3
- 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 +1 -0
- package/dist/runtime/locale/index.js +1 -0
- 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.js +2 -1
- package/dist/runtime/locale/lb.d.ts +3 -0
- package/dist/runtime/locale/lb.js +55 -0
- package/dist/runtime/locale/lt.js +2 -1
- package/dist/runtime/locale/mn.js +2 -1
- package/dist/runtime/locale/ms.js +2 -1
- 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.Bix4DSU4.mjs → ui.BPVxSPGY.mjs} +282 -26
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +28 -29
|
@@ -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>
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
+
import type { TagsInputRootProps, TagsInputRootEmits, AcceptableInputValue } from 'reka-ui';
|
|
3
|
+
import theme from '#build/ui/input-tags';
|
|
4
|
+
import type { UseComponentIconsProps } from '../composables/useComponentIcons';
|
|
5
|
+
import type { ComponentConfig } from '../types/utils';
|
|
6
|
+
type InputTags = ComponentConfig<typeof theme, AppConfig, 'inputTags'>;
|
|
7
|
+
export type InputTagItem = AcceptableInputValue;
|
|
8
|
+
export interface InputTagsProps<T extends InputTagItem = InputTagItem> extends Pick<TagsInputRootProps<T>, 'modelValue' | 'defaultValue' | 'addOnPaste' | 'addOnTab' | 'addOnBlur' | 'duplicate' | 'disabled' | 'delimiter' | 'max' | 'id' | 'convertValue' | 'displayValue' | 'name' | 'required'>, UseComponentIconsProps {
|
|
9
|
+
/**
|
|
10
|
+
* The element or component this component should render as.
|
|
11
|
+
* @defaultValue 'div'
|
|
12
|
+
*/
|
|
13
|
+
as?: any;
|
|
14
|
+
/** The placeholder text when the input is empty. */
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
/**
|
|
17
|
+
* @defaultValue 'primary'
|
|
18
|
+
*/
|
|
19
|
+
color?: InputTags['variants']['color'];
|
|
20
|
+
/**
|
|
21
|
+
* @defaultValue 'outline'
|
|
22
|
+
*/
|
|
23
|
+
variant?: InputTags['variants']['variant'];
|
|
24
|
+
/**
|
|
25
|
+
* @defaultValue 'md'
|
|
26
|
+
*/
|
|
27
|
+
size?: InputTags['variants']['size'];
|
|
28
|
+
autofocus?: boolean;
|
|
29
|
+
autofocusDelay?: number;
|
|
30
|
+
/**
|
|
31
|
+
* The icon displayed to delete a tag.
|
|
32
|
+
* @defaultValue appConfig.ui.icons.close
|
|
33
|
+
* @IconifyIcon
|
|
34
|
+
*/
|
|
35
|
+
deleteIcon?: string;
|
|
36
|
+
/** Highlight the ring color like a focus state. */
|
|
37
|
+
highlight?: boolean;
|
|
38
|
+
class?: any;
|
|
39
|
+
ui?: InputTags['slots'];
|
|
40
|
+
}
|
|
41
|
+
export interface InputTagsEmits<T extends InputTagItem> extends TagsInputRootEmits<T> {
|
|
42
|
+
change: [event: Event];
|
|
43
|
+
blur: [event: FocusEvent];
|
|
44
|
+
focus: [event: FocusEvent];
|
|
45
|
+
}
|
|
46
|
+
type SlotProps<T extends InputTagItem> = (props: {
|
|
47
|
+
item: T;
|
|
48
|
+
index: number;
|
|
49
|
+
}) => any;
|
|
50
|
+
export interface InputTagsSlots<T extends InputTagItem = InputTagItem> {
|
|
51
|
+
'leading'(props?: {}): any;
|
|
52
|
+
'default'(props?: {}): any;
|
|
53
|
+
'trailing'(props?: {}): any;
|
|
54
|
+
'item-text': SlotProps<T>;
|
|
55
|
+
'item-delete': SlotProps<T>;
|
|
56
|
+
}
|
|
57
|
+
declare const _default: <T extends InputTagItem>(__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<{
|
|
58
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
59
|
+
readonly onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
60
|
+
readonly onChange?: ((event: Event) => any) | undefined;
|
|
61
|
+
readonly onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
62
|
+
readonly onInvalid?: ((payload: T) => any) | undefined;
|
|
63
|
+
readonly "onUpdate:modelValue"?: ((payload: T[]) => any) | undefined;
|
|
64
|
+
readonly onRemoveTag?: ((payload: T) => any) | undefined;
|
|
65
|
+
readonly onAddTag?: ((payload: T) => any) | undefined;
|
|
66
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onFocus" | "onBlur" | "onChange" | "onInvalid" | "onUpdate:modelValue" | "onRemoveTag" | "onAddTag"> & InputTagsProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
67
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
68
|
+
inputRef: import("vue").Ref<({
|
|
69
|
+
$: import("vue").ComponentInternalInstance;
|
|
70
|
+
$data: {};
|
|
71
|
+
$props: {
|
|
72
|
+
readonly placeholder?: string | undefined;
|
|
73
|
+
readonly autoFocus?: boolean | undefined;
|
|
74
|
+
readonly maxLength?: number | undefined;
|
|
75
|
+
readonly asChild?: boolean | undefined;
|
|
76
|
+
readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
|
|
77
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
78
|
+
$attrs: {
|
|
79
|
+
[x: string]: unknown;
|
|
80
|
+
};
|
|
81
|
+
$refs: {
|
|
82
|
+
[x: string]: unknown;
|
|
83
|
+
};
|
|
84
|
+
$slots: Readonly<{
|
|
85
|
+
[name: string]: import("vue").Slot<any> | undefined;
|
|
86
|
+
}>;
|
|
87
|
+
$root: import("vue").ComponentPublicInstance | null;
|
|
88
|
+
$parent: import("vue").ComponentPublicInstance | null;
|
|
89
|
+
$host: Element | null;
|
|
90
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
91
|
+
$el: any;
|
|
92
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").TagsInputInputProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
93
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
94
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
95
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
96
|
+
created?: (() => void) | (() => void)[];
|
|
97
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
98
|
+
mounted?: (() => void) | (() => void)[];
|
|
99
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
100
|
+
updated?: (() => void) | (() => void)[];
|
|
101
|
+
activated?: (() => void) | (() => void)[];
|
|
102
|
+
deactivated?: (() => void) | (() => void)[];
|
|
103
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
104
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
105
|
+
destroyed?: (() => void) | (() => void)[];
|
|
106
|
+
unmounted?: (() => void) | (() => void)[];
|
|
107
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
108
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
109
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
110
|
+
};
|
|
111
|
+
$forceUpdate: () => void;
|
|
112
|
+
$nextTick: typeof import("vue").nextTick;
|
|
113
|
+
$watch<T_1 extends string | ((...args: any) => any)>(source: T_1, cb: T_1 extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
|
|
114
|
+
} & Readonly<{
|
|
115
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
116
|
+
}> & Omit<Readonly<import("reka-ui").TagsInputInputProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
117
|
+
$slots: {
|
|
118
|
+
default?(_: {}): any;
|
|
119
|
+
};
|
|
120
|
+
}) | null, ({
|
|
121
|
+
$: import("vue").ComponentInternalInstance;
|
|
122
|
+
$data: {};
|
|
123
|
+
$props: {
|
|
124
|
+
readonly placeholder?: string | undefined;
|
|
125
|
+
readonly autoFocus?: boolean | undefined;
|
|
126
|
+
readonly maxLength?: number | undefined;
|
|
127
|
+
readonly asChild?: boolean | undefined;
|
|
128
|
+
readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
|
|
129
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
130
|
+
$attrs: {
|
|
131
|
+
[x: string]: unknown;
|
|
132
|
+
};
|
|
133
|
+
$refs: {
|
|
134
|
+
[x: string]: unknown;
|
|
135
|
+
};
|
|
136
|
+
$slots: Readonly<{
|
|
137
|
+
[name: string]: import("vue").Slot<any> | undefined;
|
|
138
|
+
}>;
|
|
139
|
+
$root: import("vue").ComponentPublicInstance | null;
|
|
140
|
+
$parent: import("vue").ComponentPublicInstance | null;
|
|
141
|
+
$host: Element | null;
|
|
142
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
143
|
+
$el: any;
|
|
144
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").TagsInputInputProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
145
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
146
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
147
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
148
|
+
created?: (() => void) | (() => void)[];
|
|
149
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
150
|
+
mounted?: (() => void) | (() => void)[];
|
|
151
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
152
|
+
updated?: (() => void) | (() => void)[];
|
|
153
|
+
activated?: (() => void) | (() => void)[];
|
|
154
|
+
deactivated?: (() => void) | (() => void)[];
|
|
155
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
156
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
157
|
+
destroyed?: (() => void) | (() => void)[];
|
|
158
|
+
unmounted?: (() => void) | (() => void)[];
|
|
159
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
160
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
161
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
162
|
+
};
|
|
163
|
+
$forceUpdate: () => void;
|
|
164
|
+
$nextTick: typeof import("vue").nextTick;
|
|
165
|
+
$watch<T_1 extends string | ((...args: any) => any)>(source: T_1, cb: T_1 extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
|
|
166
|
+
} & Readonly<{
|
|
167
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
168
|
+
}> & Omit<Readonly<import("reka-ui").TagsInputInputProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
169
|
+
$slots: {
|
|
170
|
+
default?(_: {}): any;
|
|
171
|
+
};
|
|
172
|
+
}) | null>;
|
|
173
|
+
}>): void;
|
|
174
|
+
attrs: any;
|
|
175
|
+
slots: InputTagsSlots<T>;
|
|
176
|
+
emit: ((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "invalid", payload: T) => void) & ((evt: "update:modelValue", payload: T[]) => void) & ((evt: "removeTag", payload: T) => void) & ((evt: "addTag", payload: T) => void);
|
|
177
|
+
}>) => import("vue").VNode & {
|
|
178
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
179
|
+
};
|
|
180
|
+
export default _default;
|
|
181
|
+
type __VLS_PrettifyLocal<T> = {
|
|
182
|
+
[K in keyof T]: T[K];
|
|
183
|
+
} & {};
|
|
@@ -40,14 +40,14 @@ const contentEvents = computed(() => {
|
|
|
40
40
|
closeAutoFocus: (e) => e.preventDefault()
|
|
41
41
|
};
|
|
42
42
|
if (!props.dismissible) {
|
|
43
|
-
const events = ["pointerDownOutside", "interactOutside", "escapeKeyDown"
|
|
43
|
+
const events = ["pointerDownOutside", "interactOutside", "escapeKeyDown"];
|
|
44
44
|
return events.reduce((acc, curr) => {
|
|
45
45
|
acc[curr] = (e) => {
|
|
46
46
|
e.preventDefault();
|
|
47
47
|
emits("close:prevent");
|
|
48
48
|
};
|
|
49
49
|
return acc;
|
|
50
|
-
},
|
|
50
|
+
}, defaultEvents);
|
|
51
51
|
}
|
|
52
52
|
return defaultEvents;
|
|
53
53
|
});
|
|
@@ -58,7 +58,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.modal || {} }
|
|
|
58
58
|
</script>
|
|
59
59
|
|
|
60
60
|
<template>
|
|
61
|
-
<DialogRoot v-slot="{ open }" v-bind="rootProps">
|
|
61
|
+
<DialogRoot v-slot="{ open, close }" v-bind="rootProps">
|
|
62
62
|
<DialogTrigger v-if="!!slots.default" as-child :class="props.class">
|
|
63
63
|
<slot :open="open" />
|
|
64
64
|
</DialogTrigger>
|
|
@@ -81,9 +81,9 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.modal || {} }
|
|
|
81
81
|
</DialogDescription>
|
|
82
82
|
</VisuallyHidden>
|
|
83
83
|
|
|
84
|
-
<slot name="content">
|
|
85
|
-
<div v-if="!!slots.header || (title || !!slots.title) || (description || !!slots.description) || (close || !!slots.close)" :class="ui.header({ class: props.ui?.header })">
|
|
86
|
-
<slot name="header">
|
|
84
|
+
<slot name="content" :close="close">
|
|
85
|
+
<div v-if="!!slots.header || (title || !!slots.title) || (description || !!slots.description) || (props.close || !!slots.close)" :class="ui.header({ class: props.ui?.header })">
|
|
86
|
+
<slot name="header" :close="close">
|
|
87
87
|
<div :class="ui.wrapper({ class: props.ui?.wrapper })">
|
|
88
88
|
<DialogTitle v-if="title || !!slots.title" :class="ui.title({ class: props.ui?.title })">
|
|
89
89
|
<slot name="title">
|
|
@@ -98,16 +98,17 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.modal || {} }
|
|
|
98
98
|
</DialogDescription>
|
|
99
99
|
</div>
|
|
100
100
|
|
|
101
|
-
<
|
|
102
|
-
|
|
101
|
+
<slot name="actions" />
|
|
102
|
+
|
|
103
|
+
<DialogClose v-if="props.close || !!slots.close" as-child>
|
|
104
|
+
<slot name="close" :close="close" :ui="ui">
|
|
103
105
|
<UButton
|
|
104
|
-
v-if="close"
|
|
106
|
+
v-if="props.close"
|
|
105
107
|
:icon="closeIcon || appConfig.ui.icons.close"
|
|
106
|
-
size="md"
|
|
107
108
|
color="neutral"
|
|
108
109
|
variant="ghost"
|
|
109
110
|
:aria-label="t('modal.close')"
|
|
110
|
-
v-bind="typeof close === 'object' ? close : {}"
|
|
111
|
+
v-bind="typeof props.close === 'object' ? props.close : {}"
|
|
111
112
|
:class="ui.close({ class: props.ui?.close })"
|
|
112
113
|
/>
|
|
113
114
|
</slot>
|
|
@@ -116,11 +117,11 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.modal || {} }
|
|
|
116
117
|
</div>
|
|
117
118
|
|
|
118
119
|
<div v-if="!!slots.body" :class="ui.body({ class: props.ui?.body })">
|
|
119
|
-
<slot name="body" />
|
|
120
|
+
<slot name="body" :close="close" />
|
|
120
121
|
</div>
|
|
121
122
|
|
|
122
123
|
<div v-if="!!slots.footer" :class="ui.footer({ class: props.ui?.footer })">
|
|
123
|
-
<slot name="footer" />
|
|
124
|
+
<slot name="footer" :close="close" />
|
|
124
125
|
</div>
|
|
125
126
|
</slot>
|
|
126
127
|
</DialogContent>
|
|
@@ -58,17 +58,27 @@ export interface ModalSlots {
|
|
|
58
58
|
default(props: {
|
|
59
59
|
open: boolean;
|
|
60
60
|
}): any;
|
|
61
|
-
content(props
|
|
62
|
-
|
|
61
|
+
content(props: {
|
|
62
|
+
close: () => void;
|
|
63
|
+
}): any;
|
|
64
|
+
header(props: {
|
|
65
|
+
close: () => void;
|
|
66
|
+
}): any;
|
|
63
67
|
title(props?: {}): any;
|
|
64
68
|
description(props?: {}): any;
|
|
69
|
+
actions(props?: {}): any;
|
|
65
70
|
close(props: {
|
|
71
|
+
close: () => void;
|
|
66
72
|
ui: {
|
|
67
73
|
[K in keyof Required<Modal['slots']>]: (props?: Record<string, any>) => string;
|
|
68
74
|
};
|
|
69
75
|
}): any;
|
|
70
|
-
body(props
|
|
71
|
-
|
|
76
|
+
body(props: {
|
|
77
|
+
close: () => void;
|
|
78
|
+
}): any;
|
|
79
|
+
footer(props: {
|
|
80
|
+
close: () => void;
|
|
81
|
+
}): any;
|
|
72
82
|
}
|
|
73
83
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ModalProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
74
84
|
"update:open": (value: boolean) => any;
|
|
@@ -88,19 +88,13 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.navigationMen
|
|
|
88
88
|
const lists = computed(
|
|
89
89
|
() => props.items?.length ? isArrayOfArray(props.items) ? props.items : [props.items] : []
|
|
90
90
|
);
|
|
91
|
-
function getAccordionDefaultValue(list) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
acc.push(...findItemsWithDefaultOpen(item.children, level + 1));
|
|
99
|
-
}
|
|
100
|
-
return acc;
|
|
101
|
-
}, []);
|
|
102
|
-
}
|
|
103
|
-
const indexes = findItemsWithDefaultOpen(list);
|
|
91
|
+
function getAccordionDefaultValue(list, level = 0) {
|
|
92
|
+
const indexes = list.reduce((acc, item, index) => {
|
|
93
|
+
if (item.defaultOpen || item.open) {
|
|
94
|
+
acc.push(item.value || (level > 0 ? `item-${level}-${index}` : `item-${index}`));
|
|
95
|
+
}
|
|
96
|
+
return acc;
|
|
97
|
+
}, []);
|
|
104
98
|
return props.type === "single" ? indexes[0] : indexes;
|
|
105
99
|
}
|
|
106
100
|
</script>
|
|
@@ -228,7 +222,14 @@ function getAccordionDefaultValue(list) {
|
|
|
228
222
|
</ULink>
|
|
229
223
|
|
|
230
224
|
<AccordionContent v-if="orientation === 'vertical' && item.children?.length && !collapsed" :class="ui.content({ class: [props.ui?.content, item.ui?.content] })">
|
|
231
|
-
<
|
|
225
|
+
<AccordionRoot
|
|
226
|
+
v-bind="{
|
|
227
|
+
...accordionProps,
|
|
228
|
+
defaultValue: getAccordionDefaultValue(item.children, level + 1)
|
|
229
|
+
}"
|
|
230
|
+
as="ul"
|
|
231
|
+
:class="ui.childList({ class: props.ui?.childList })"
|
|
232
|
+
>
|
|
232
233
|
<ReuseItemTemplate
|
|
233
234
|
v-for="(childItem, childIndex) in item.children"
|
|
234
235
|
:key="childIndex"
|
|
@@ -237,7 +238,7 @@ function getAccordionDefaultValue(list) {
|
|
|
237
238
|
:level="level + 1"
|
|
238
239
|
:class="ui.childItem({ class: [props.ui?.childItem, childItem.ui?.childItem] })"
|
|
239
240
|
/>
|
|
240
|
-
</
|
|
241
|
+
</AccordionRoot>
|
|
241
242
|
</AccordionContent>
|
|
242
243
|
</component>
|
|
243
244
|
</DefineItemTemplate>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { useOverlay } from "../composables/useOverlay";
|
|
4
|
-
const { overlays,
|
|
4
|
+
const { overlays, unmount, close } = useOverlay();
|
|
5
5
|
const mountedOverlays = computed(() => overlays.filter((overlay) => overlay.isMounted));
|
|
6
6
|
const onAfterLeave = (id) => {
|
|
7
7
|
close(id);
|
|
8
|
-
|
|
8
|
+
unmount(id);
|
|
9
9
|
};
|
|
10
10
|
const onClose = (id, value) => {
|
|
11
11
|
close(id, value);
|
|
@@ -22,7 +22,7 @@ const props = defineProps({
|
|
|
22
22
|
activeColor: { type: null, required: false, default: "primary" },
|
|
23
23
|
activeVariant: { type: null, required: false, default: "solid" },
|
|
24
24
|
showControls: { type: Boolean, required: false, default: true },
|
|
25
|
-
size: { type: null, required: false
|
|
25
|
+
size: { type: null, required: false },
|
|
26
26
|
to: { type: Function, required: false },
|
|
27
27
|
class: { type: null, required: false },
|
|
28
28
|
ui: { type: null, required: false },
|
|
@@ -100,7 +100,6 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Pagination
|
|
|
100
100
|
}, string, import("vue").PublicProps, Readonly<PaginationProps> & Readonly<{
|
|
101
101
|
"onUpdate:page"?: ((value: number) => any) | undefined;
|
|
102
102
|
}>, {
|
|
103
|
-
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
104
103
|
color: "error" | "info" | "primary" | "secondary" | "success" | "warning" | "neutral";
|
|
105
104
|
activeColor: "error" | "info" | "primary" | "secondary" | "success" | "warning" | "neutral";
|
|
106
105
|
variant: "link" | "solid" | "outline" | "soft" | "subtle" | "ghost";
|
|
@@ -25,16 +25,16 @@ const props = defineProps({
|
|
|
25
25
|
disabled: { type: Boolean, required: false },
|
|
26
26
|
id: { type: String, required: false },
|
|
27
27
|
mask: { type: Boolean, required: false },
|
|
28
|
-
modelValue: { type:
|
|
28
|
+
modelValue: { type: null, required: false },
|
|
29
29
|
name: { type: String, required: false },
|
|
30
30
|
otp: { type: Boolean, required: false },
|
|
31
31
|
placeholder: { type: String, required: false },
|
|
32
32
|
required: { type: Boolean, required: false },
|
|
33
|
-
type: { type:
|
|
33
|
+
type: { type: null, required: false, default: "text" }
|
|
34
34
|
});
|
|
35
35
|
const emits = defineEmits(["update:modelValue", "complete", "change", "blur"]);
|
|
36
36
|
const appConfig = useAppConfig();
|
|
37
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, "defaultValue", "disabled", "id", "mask", "modelValue", "name", "otp", "
|
|
37
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, "defaultValue", "disabled", "id", "mask", "modelValue", "name", "otp", "required", "type"), emits);
|
|
38
38
|
const { emitFormInput, emitFormFocus, emitFormChange, emitFormBlur, size, color, id, name, highlight, disabled, ariaAttrs } = useFormField(props);
|
|
39
39
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.pinInput || {} })({
|
|
40
40
|
color: color.value,
|
|
@@ -75,6 +75,7 @@ defineExpose({
|
|
|
75
75
|
v-bind="{ ...rootProps, ...ariaAttrs }"
|
|
76
76
|
:id="id"
|
|
77
77
|
:name="name"
|
|
78
|
+
:placeholder="placeholder"
|
|
78
79
|
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
79
80
|
@update:model-value="emitFormInput()"
|
|
80
81
|
@complete="onComplete"
|
|
@@ -4,7 +4,8 @@ import type { AppConfig } from '@nuxt/schema';
|
|
|
4
4
|
import theme from '#build/ui/pin-input';
|
|
5
5
|
import type { ComponentConfig } from '../types/utils';
|
|
6
6
|
type PinInput = ComponentConfig<typeof theme, AppConfig, 'pinInput'>;
|
|
7
|
-
|
|
7
|
+
type PinInputType = 'text' | 'number';
|
|
8
|
+
export interface PinInputProps<T extends PinInputType = 'text'> extends Pick<PinInputRootProps<T>, 'defaultValue' | 'disabled' | 'id' | 'mask' | 'modelValue' | 'name' | 'otp' | 'placeholder' | 'required' | 'type'> {
|
|
8
9
|
/**
|
|
9
10
|
* The element or component this component should render as.
|
|
10
11
|
* @defaultValue 'div'
|
|
@@ -33,25 +34,27 @@ export interface PinInputProps extends Pick<PinInputRootProps, 'defaultValue' |
|
|
|
33
34
|
class?: any;
|
|
34
35
|
ui?: PinInput['slots'];
|
|
35
36
|
}
|
|
36
|
-
export type PinInputEmits = PinInputRootEmits & {
|
|
37
|
+
export type PinInputEmits<T extends PinInputType = 'text'> = PinInputRootEmits<T> & {
|
|
37
38
|
change: [payload: Event];
|
|
38
39
|
blur: [payload: Event];
|
|
39
40
|
};
|
|
40
|
-
declare const _default:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
41
|
+
declare const _default: <T extends PinInputType = "text">(__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
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
43
|
+
readonly onBlur?: ((payload: Event) => any) | undefined;
|
|
44
|
+
readonly onComplete?: ((value: T extends "number" ? number[] : string[]) => any) | undefined;
|
|
45
|
+
readonly onChange?: ((payload: Event) => any) | undefined;
|
|
46
|
+
readonly "onUpdate:modelValue"?: ((value: T extends "number" ? number[] : string[]) => any) | undefined;
|
|
47
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onBlur" | "onChange" | "onUpdate:modelValue" | "onComplete"> & PinInputProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
48
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
49
|
+
inputsRef: import("vue").Ref<ComponentPublicInstance[], ComponentPublicInstance[]>;
|
|
50
|
+
}>): void;
|
|
51
|
+
attrs: any;
|
|
52
|
+
slots: {};
|
|
53
|
+
emit: ((evt: "blur", payload: Event) => void) & ((evt: "complete", value: T extends "number" ? number[] : string[]) => void) & ((evt: "change", payload: Event) => void) & ((evt: "update:modelValue", value: T extends "number" ? number[] : string[]) => void);
|
|
54
|
+
}>) => import("vue").VNode & {
|
|
55
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
56
|
+
};
|
|
57
57
|
export default _default;
|
|
58
|
+
type __VLS_PrettifyLocal<T> = {
|
|
59
|
+
[K in keyof T]: T[K];
|
|
60
|
+
} & {};
|
|
@@ -21,13 +21,14 @@ const props = defineProps({
|
|
|
21
21
|
class: { type: null, required: false },
|
|
22
22
|
ui: { type: null, required: false },
|
|
23
23
|
getValueLabel: { type: Function, required: false },
|
|
24
|
+
getValueText: { type: Function, required: false },
|
|
24
25
|
modelValue: { type: [Number, null], required: false, default: null }
|
|
25
26
|
});
|
|
26
27
|
const emits = defineEmits(["update:modelValue", "update:max"]);
|
|
27
28
|
const slots = defineSlots();
|
|
28
29
|
const { dir } = useLocale();
|
|
29
30
|
const appConfig = useAppConfig();
|
|
30
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, "getValueLabel", "modelValue"), emits);
|
|
31
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, "getValueLabel", "getValueText", "modelValue"), emits);
|
|
31
32
|
const isIndeterminate = computed(() => rootProps.value.modelValue === null);
|
|
32
33
|
const hasSteps = computed(() => Array.isArray(props.max));
|
|
33
34
|
const realMax = computed(() => {
|