@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
|
@@ -13,6 +13,7 @@ export interface FormProps<S extends FormSchema, T extends boolean = true> {
|
|
|
13
13
|
validate?: (state: Partial<InferInput<S>>) => Promise<FormError[]> | FormError[];
|
|
14
14
|
/**
|
|
15
15
|
* The list of input events that trigger the form validation.
|
|
16
|
+
* @remarks The form always validates on submit.
|
|
16
17
|
* @defaultValue `['blur', 'change', 'input']`
|
|
17
18
|
*/
|
|
18
19
|
validateOn?: FormInputEvents[];
|
|
@@ -43,8 +44,8 @@ export interface FormProps<S extends FormSchema, T extends boolean = true> {
|
|
|
43
44
|
onSubmit?: ((event: FormSubmitEvent<FormData<S, T>>) => void | Promise<void>) | (() => void | Promise<void>);
|
|
44
45
|
}
|
|
45
46
|
export interface FormEmits<S extends FormSchema, T extends boolean = true> {
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
submit: [payload: FormSubmitEvent<FormData<S, T>>];
|
|
48
|
+
error: [payload: FormErrorEvent];
|
|
48
49
|
}
|
|
49
50
|
export interface FormSlots {
|
|
50
51
|
default(props?: {
|
|
@@ -56,15 +57,15 @@ declare const _default: <S extends FormSchema, T extends boolean = true>(__VLS_p
|
|
|
56
57
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
57
58
|
readonly onError?: ((payload: FormErrorEvent) => any) | undefined;
|
|
58
59
|
readonly onSubmit?: ((payload: FormSubmitEvent<FormData<S, T>>) => any) | undefined;
|
|
59
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "
|
|
60
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onSubmit" | "onError"> & FormProps<S, T> & Partial<{}>> & import("vue").PublicProps;
|
|
60
61
|
expose(exposed: import("vue").ShallowUnwrapRef<Form<S>>): void;
|
|
61
62
|
attrs: any;
|
|
62
63
|
slots: FormSlots;
|
|
63
|
-
emit:
|
|
64
|
+
emit: ((evt: "error", payload: FormErrorEvent) => void) & ((evt: "submit", payload: FormSubmitEvent<FormData<S, T>>) => void);
|
|
64
65
|
}>) => import("vue").VNode & {
|
|
65
66
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
66
67
|
};
|
|
67
68
|
export default _default;
|
|
68
69
|
type __VLS_PrettifyLocal<T> = {
|
|
69
|
-
[K in keyof T]: T[K];
|
|
70
|
+
[K in keyof T as K]: T[K];
|
|
70
71
|
} & {};
|
|
@@ -15,7 +15,7 @@ const props = defineProps({
|
|
|
15
15
|
label: { type: String, required: false },
|
|
16
16
|
description: { type: String, required: false },
|
|
17
17
|
help: { type: String, required: false },
|
|
18
|
-
error: { type: [
|
|
18
|
+
error: { type: [Boolean, String], required: false },
|
|
19
19
|
hint: { type: String, required: false },
|
|
20
20
|
size: { type: null, required: false },
|
|
21
21
|
required: { type: Boolean, required: false },
|
|
@@ -80,7 +80,7 @@ provide(formFieldInjectionKey, computed(() => ({
|
|
|
80
80
|
{{ error }}
|
|
81
81
|
</slot>
|
|
82
82
|
</div>
|
|
83
|
-
<div v-else-if="help || !!slots.help" :class="ui.help({ class: props.ui?.help })">
|
|
83
|
+
<div v-else-if="help || !!slots.help" :id="`${ariaId}-help`" :class="ui.help({ class: props.ui?.help })">
|
|
84
84
|
<slot name="help" :help="help">
|
|
85
85
|
{{ help }}
|
|
86
86
|
</slot>
|
|
@@ -15,7 +15,7 @@ export interface FormFieldProps {
|
|
|
15
15
|
label?: string;
|
|
16
16
|
description?: string;
|
|
17
17
|
help?: string;
|
|
18
|
-
error?:
|
|
18
|
+
error?: boolean | string;
|
|
19
19
|
hint?: string;
|
|
20
20
|
/**
|
|
21
21
|
* @defaultValue 'md'
|
|
@@ -46,13 +46,13 @@ export interface FormFieldSlots {
|
|
|
46
46
|
help?: string;
|
|
47
47
|
}): any;
|
|
48
48
|
error(props: {
|
|
49
|
-
error?:
|
|
49
|
+
error?: boolean | string;
|
|
50
50
|
}): any;
|
|
51
51
|
default(props: {
|
|
52
|
-
error?:
|
|
52
|
+
error?: boolean | string;
|
|
53
53
|
}): any;
|
|
54
54
|
}
|
|
55
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<FormFieldProps,
|
|
55
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<FormFieldProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FormFieldProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, FormFieldSlots>;
|
|
56
56
|
export default _default;
|
|
57
57
|
type __VLS_WithSlots<T, S> = T & {
|
|
58
58
|
new (): {
|
|
@@ -4,5 +4,5 @@ export interface IconProps {
|
|
|
4
4
|
size?: string | number;
|
|
5
5
|
customize?: (content: string, name?: string, prefix?: string, provider?: string) => string;
|
|
6
6
|
}
|
|
7
|
-
declare const _default: import("vue").DefineComponent<IconProps,
|
|
7
|
+
declare const _default: import("vue").DefineComponent<IconProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
8
|
export default _default;
|
|
@@ -5,6 +5,7 @@ import theme from "#build/ui/input";
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { ref, computed, onMounted } from "vue";
|
|
7
7
|
import { Primitive } from "reka-ui";
|
|
8
|
+
import { useVModel } from "@vueuse/core";
|
|
8
9
|
import { useAppConfig } from "#imports";
|
|
9
10
|
import { useButtonGroup } from "../composables/useButtonGroup";
|
|
10
11
|
import { useComponentIcons } from "../composables/useComponentIcons";
|
|
@@ -29,6 +30,8 @@ const props = defineProps({
|
|
|
29
30
|
autofocusDelay: { type: Number, required: false, default: 0 },
|
|
30
31
|
disabled: { type: Boolean, required: false },
|
|
31
32
|
highlight: { type: Boolean, required: false },
|
|
33
|
+
modelValue: { type: null, required: false },
|
|
34
|
+
defaultValue: { type: null, required: false },
|
|
32
35
|
modelModifiers: { type: Object, required: false },
|
|
33
36
|
class: { type: null, required: false },
|
|
34
37
|
ui: { type: null, required: false },
|
|
@@ -43,7 +46,7 @@ const props = defineProps({
|
|
|
43
46
|
});
|
|
44
47
|
const emits = defineEmits(["update:modelValue", "blur", "change"]);
|
|
45
48
|
const slots = defineSlots();
|
|
46
|
-
const
|
|
49
|
+
const modelValue = useVModel(props, "modelValue", emits, { defaultValue: props.defaultValue });
|
|
47
50
|
const appConfig = useAppConfig();
|
|
48
51
|
const { emitFormBlur, emitFormInput, emitFormChange, size: formGroupSize, color, id, name, highlight, disabled, emitFormFocus, ariaAttrs } = useFormField(props, { deferInputValidation: true });
|
|
49
52
|
const { orientation, size: buttonGroupSize } = useButtonGroup(props);
|
|
@@ -62,29 +65,29 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.input || {} }
|
|
|
62
65
|
}));
|
|
63
66
|
const inputRef = ref(null);
|
|
64
67
|
function updateInput(value) {
|
|
65
|
-
if (modelModifiers
|
|
68
|
+
if (props.modelModifiers?.trim) {
|
|
66
69
|
value = value?.trim() ?? null;
|
|
67
70
|
}
|
|
68
|
-
if (modelModifiers
|
|
71
|
+
if (props.modelModifiers?.number || props.type === "number") {
|
|
69
72
|
value = looseToNumber(value);
|
|
70
73
|
}
|
|
71
|
-
if (modelModifiers
|
|
74
|
+
if (props.modelModifiers?.nullify) {
|
|
72
75
|
value ||= null;
|
|
73
76
|
}
|
|
74
77
|
modelValue.value = value;
|
|
75
78
|
emitFormInput();
|
|
76
79
|
}
|
|
77
80
|
function onInput(event) {
|
|
78
|
-
if (!modelModifiers
|
|
81
|
+
if (!props.modelModifiers?.lazy) {
|
|
79
82
|
updateInput(event.target.value);
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
85
|
function onChange(event) {
|
|
83
86
|
const value = event.target.value;
|
|
84
|
-
if (modelModifiers
|
|
87
|
+
if (props.modelModifiers?.lazy) {
|
|
85
88
|
updateInput(value);
|
|
86
89
|
}
|
|
87
|
-
if (modelModifiers
|
|
90
|
+
if (props.modelModifiers?.trim) {
|
|
88
91
|
event.target.value = value.trim();
|
|
89
92
|
}
|
|
90
93
|
emitFormChange();
|
|
@@ -4,7 +4,7 @@ import theme from '#build/ui/input';
|
|
|
4
4
|
import type { UseComponentIconsProps } from '../composables/useComponentIcons';
|
|
5
5
|
import type { AcceptableValue, ComponentConfig } from '../types/utils';
|
|
6
6
|
type Input = ComponentConfig<typeof theme, AppConfig, 'input'>;
|
|
7
|
-
export interface InputProps extends UseComponentIconsProps {
|
|
7
|
+
export interface InputProps<T extends AcceptableValue = AcceptableValue> extends UseComponentIconsProps {
|
|
8
8
|
/**
|
|
9
9
|
* The element or component this component should render as.
|
|
10
10
|
* @defaultValue 'div'
|
|
@@ -34,6 +34,8 @@ export interface InputProps extends UseComponentIconsProps {
|
|
|
34
34
|
disabled?: boolean;
|
|
35
35
|
/** Highlight the ring color like a focus state. */
|
|
36
36
|
highlight?: boolean;
|
|
37
|
+
modelValue?: T;
|
|
38
|
+
defaultValue?: T;
|
|
37
39
|
modelModifiers?: {
|
|
38
40
|
string?: boolean;
|
|
39
41
|
number?: boolean;
|
|
@@ -45,9 +47,9 @@ export interface InputProps extends UseComponentIconsProps {
|
|
|
45
47
|
ui?: Input['slots'];
|
|
46
48
|
}
|
|
47
49
|
export interface InputEmits<T extends AcceptableValue = AcceptableValue> {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
'update:modelValue': [payload: T];
|
|
51
|
+
'blur': [event: FocusEvent];
|
|
52
|
+
'change': [event: Event];
|
|
51
53
|
}
|
|
52
54
|
export interface InputSlots {
|
|
53
55
|
leading(props?: {}): any;
|
|
@@ -59,19 +61,17 @@ declare const _default: <T extends AcceptableValue>(__VLS_props: NonNullable<Awa
|
|
|
59
61
|
readonly onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
60
62
|
readonly onChange?: ((event: Event) => any) | undefined;
|
|
61
63
|
readonly "onUpdate:modelValue"?: ((payload: T) => any) | undefined;
|
|
62
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onBlur" | "onChange" | "onUpdate:modelValue"> &
|
|
63
|
-
modelValue?: T;
|
|
64
|
-
}) & Partial<{}>> & import("vue").PublicProps;
|
|
64
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onBlur" | "onChange" | "onUpdate:modelValue"> & InputProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
65
65
|
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
66
66
|
inputRef: import("vue").Ref<HTMLInputElement | null, HTMLInputElement | null>;
|
|
67
67
|
}>): void;
|
|
68
68
|
attrs: any;
|
|
69
69
|
slots: InputSlots;
|
|
70
|
-
emit:
|
|
70
|
+
emit: ((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", payload: T) => void);
|
|
71
71
|
}>) => import("vue").VNode & {
|
|
72
72
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
73
73
|
};
|
|
74
74
|
export default _default;
|
|
75
75
|
type __VLS_PrettifyLocal<T> = {
|
|
76
|
-
[K in keyof T]: T[K];
|
|
76
|
+
[K in keyof T as K]: T[K];
|
|
77
77
|
} & {};
|
|
@@ -3,7 +3,7 @@ import theme from "#build/ui/input-menu";
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
|
-
import { computed, ref, toRef, onMounted, toRaw } from "vue";
|
|
6
|
+
import { computed, ref, toRef, onMounted, toRaw, nextTick } from "vue";
|
|
7
7
|
import { ComboboxRoot, ComboboxArrow, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxPortal, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxLabel, ComboboxSeparator, ComboboxItem, ComboboxItemIndicator, TagsInputRoot, TagsInputItem, TagsInputItemText, TagsInputItemDelete, TagsInputInput, useForwardPropsEmits, useFilter } from "reka-ui";
|
|
8
8
|
import { defu } from "defu";
|
|
9
9
|
import { isEqual } from "ohash/utils";
|
|
@@ -64,7 +64,7 @@ const props = defineProps({
|
|
|
64
64
|
loading: { type: Boolean, required: false },
|
|
65
65
|
loadingIcon: { type: String, required: false }
|
|
66
66
|
});
|
|
67
|
-
const emits = defineEmits(["update:open", "change", "blur", "focus", "create", "highlight", "update:modelValue"]);
|
|
67
|
+
const emits = defineEmits(["update:open", "change", "blur", "focus", "create", "highlight", "remove-tag", "update:modelValue"]);
|
|
68
68
|
const slots = defineSlots();
|
|
69
69
|
const searchTerm = defineModel("searchTerm", { type: String, ...{ default: "" } });
|
|
70
70
|
const { t } = useLocale();
|
|
@@ -91,10 +91,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.inputMenu ||
|
|
|
91
91
|
buttonGroup: orientation.value
|
|
92
92
|
}));
|
|
93
93
|
function displayValue(value) {
|
|
94
|
-
|
|
95
|
-
return value && (typeof value === "object" ? get(value, props.labelKey) : value);
|
|
96
|
-
}
|
|
97
|
-
const item = items.value.find((item2) => compare(typeof item2 === "object" ? get(item2, props.valueKey) : item2, value));
|
|
94
|
+
const item = items.value.find((item2) => compare(typeof item2 === "object" && props.valueKey ? get(item2, props.valueKey) : item2, value));
|
|
98
95
|
return item && (typeof item === "object" ? get(item, props.labelKey) : item);
|
|
99
96
|
}
|
|
100
97
|
const groups = computed(
|
|
@@ -106,14 +103,20 @@ const filteredGroups = computed(() => {
|
|
|
106
103
|
return groups.value;
|
|
107
104
|
}
|
|
108
105
|
const fields = Array.isArray(props.filterFields) ? props.filterFields : [props.labelKey];
|
|
109
|
-
return groups.value.map((
|
|
110
|
-
if (
|
|
106
|
+
return groups.value.map((items2) => items2.filter((item) => {
|
|
107
|
+
if (item === void 0 || item === null) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
if (typeof item !== "object") {
|
|
111
111
|
return contains(String(item), searchTerm.value);
|
|
112
112
|
}
|
|
113
113
|
if (item.type && ["label", "separator"].includes(item.type)) {
|
|
114
114
|
return true;
|
|
115
115
|
}
|
|
116
|
-
return fields.some((field) =>
|
|
116
|
+
return fields.some((field) => {
|
|
117
|
+
const value = get(item, field);
|
|
118
|
+
return value !== void 0 && value !== null && contains(String(value), searchTerm.value);
|
|
119
|
+
});
|
|
117
120
|
})).filter((group) => group.filter(
|
|
118
121
|
(item) => !isInputItem(item) || (!item.type || !["label", "separator"].includes(item.type))
|
|
119
122
|
).length > 0);
|
|
@@ -137,6 +140,9 @@ function autoFocus() {
|
|
|
137
140
|
}
|
|
138
141
|
}
|
|
139
142
|
onMounted(() => {
|
|
143
|
+
nextTick(() => {
|
|
144
|
+
searchTerm.value = "";
|
|
145
|
+
});
|
|
140
146
|
setTimeout(() => {
|
|
141
147
|
autoFocus();
|
|
142
148
|
}, props.autofocusDelay);
|
|
@@ -185,6 +191,7 @@ function onRemoveTag(event) {
|
|
|
185
191
|
const modelValue = props.modelValue;
|
|
186
192
|
const filteredValue = modelValue.filter((value) => !isEqual(value, event));
|
|
187
193
|
emits("update:modelValue", filteredValue);
|
|
194
|
+
emits("remove-tag", event);
|
|
188
195
|
onUpdate(filteredValue);
|
|
189
196
|
}
|
|
190
197
|
}
|
|
@@ -252,7 +259,7 @@ defineExpose({
|
|
|
252
259
|
<TagsInputItem v-for="(item, index) in tags" :key="index" :value="item" :class="ui.tagsItem({ class: [props.ui?.tagsItem, isInputItem(item) && item.ui?.tagsItem] })">
|
|
253
260
|
<TagsInputItemText :class="ui.tagsItemText({ class: [props.ui?.tagsItemText, isInputItem(item) && item.ui?.tagsItemText] })">
|
|
254
261
|
<slot name="tags-item-text" :item="item" :index="index">
|
|
255
|
-
{{ displayValue(item) }}
|
|
262
|
+
{{ displayValue(item) ?? item }}
|
|
256
263
|
</slot>
|
|
257
264
|
</TagsInputItemText>
|
|
258
265
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { nextTick } from 'vue';
|
|
1
2
|
import type { InputHTMLAttributes } from 'vue';
|
|
2
3
|
import type { ComboboxRootProps, ComboboxRootEmits, ComboboxContentProps, ComboboxContentEmits, ComboboxArrowProps } from 'reka-ui';
|
|
3
4
|
import type { AppConfig } from '@nuxt/schema';
|
|
@@ -126,17 +127,18 @@ export interface InputMenuProps<T extends ArrayOrNested<InputMenuItem> = ArrayOr
|
|
|
126
127
|
ui?: InputMenu['slots'];
|
|
127
128
|
}
|
|
128
129
|
export type InputMenuEmits<A extends ArrayOrNested<InputMenuItem>, VK extends GetItemKeys<A> | undefined, M extends boolean> = Pick<ComboboxRootEmits, 'update:open'> & {
|
|
129
|
-
change: [payload: Event];
|
|
130
|
-
blur: [payload: FocusEvent];
|
|
131
|
-
focus: [payload: FocusEvent];
|
|
132
|
-
create: [item: string];
|
|
130
|
+
'change': [payload: Event];
|
|
131
|
+
'blur': [payload: FocusEvent];
|
|
132
|
+
'focus': [payload: FocusEvent];
|
|
133
|
+
'create': [item: string];
|
|
133
134
|
/** Event handler when highlighted element changes. */
|
|
134
|
-
highlight: [
|
|
135
|
+
'highlight': [
|
|
135
136
|
payload: {
|
|
136
137
|
ref: HTMLElement;
|
|
137
138
|
value: GetModelValue<A, VK, M>;
|
|
138
139
|
} | undefined
|
|
139
140
|
];
|
|
141
|
+
'remove-tag': [item: GetModelValue<A, VK, M>];
|
|
140
142
|
} & GetModelValueEmits<A, VK, M>;
|
|
141
143
|
type SlotProps<T extends InputMenuItem> = (props: {
|
|
142
144
|
item: T;
|
|
@@ -185,7 +187,8 @@ declare const _default: <T extends ArrayOrNested<InputMenuItem>, VK extends GetI
|
|
|
185
187
|
value: GetModelValue<T, VK, M>;
|
|
186
188
|
} | undefined) => any) | undefined;
|
|
187
189
|
readonly "onUpdate:searchTerm"?: ((value: string) => any) | undefined;
|
|
188
|
-
|
|
190
|
+
readonly "onRemove-tag"?: ((item: GetModelValue<T, VK, M>) => any) | undefined;
|
|
191
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onFocus" | "onBlur" | "onChange" | "onUpdate:open" | "onUpdate:modelValue" | "onHighlight" | "onUpdate:searchTerm" | "onCreate" | "onRemove-tag"> & (InputMenuProps<T, VK, M> & {
|
|
189
192
|
searchTerm?: string;
|
|
190
193
|
}) & Partial<{}>> & import("vue").PublicProps;
|
|
191
194
|
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
@@ -293,7 +296,7 @@ declare const _default: <T extends ArrayOrNested<InputMenuItem>, VK extends GetI
|
|
|
293
296
|
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
294
297
|
};
|
|
295
298
|
$forceUpdate: () => void;
|
|
296
|
-
$nextTick: typeof
|
|
299
|
+
$nextTick: typeof nextTick;
|
|
297
300
|
$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;
|
|
298
301
|
} & Readonly<{
|
|
299
302
|
as: import("reka-ui").AsTag | import("vue").Component;
|
|
@@ -343,7 +346,7 @@ declare const _default: <T extends ArrayOrNested<InputMenuItem>, VK extends GetI
|
|
|
343
346
|
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
344
347
|
};
|
|
345
348
|
$forceUpdate: () => void;
|
|
346
|
-
$nextTick: typeof
|
|
349
|
+
$nextTick: typeof nextTick;
|
|
347
350
|
$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;
|
|
348
351
|
} & Readonly<{
|
|
349
352
|
as: import("reka-ui").AsTag | import("vue").Component;
|
|
@@ -457,7 +460,7 @@ declare const _default: <T extends ArrayOrNested<InputMenuItem>, VK extends GetI
|
|
|
457
460
|
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
458
461
|
};
|
|
459
462
|
$forceUpdate: () => void;
|
|
460
|
-
$nextTick: typeof
|
|
463
|
+
$nextTick: typeof nextTick;
|
|
461
464
|
$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;
|
|
462
465
|
} & Readonly<{
|
|
463
466
|
as: import("reka-ui").AsTag | import("vue").Component;
|
|
@@ -507,7 +510,7 @@ declare const _default: <T extends ArrayOrNested<InputMenuItem>, VK extends GetI
|
|
|
507
510
|
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
508
511
|
};
|
|
509
512
|
$forceUpdate: () => void;
|
|
510
|
-
$nextTick: typeof
|
|
513
|
+
$nextTick: typeof nextTick;
|
|
511
514
|
$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;
|
|
512
515
|
} & Readonly<{
|
|
513
516
|
as: import("reka-ui").AsTag | import("vue").Component;
|
|
@@ -524,11 +527,11 @@ declare const _default: <T extends ArrayOrNested<InputMenuItem>, VK extends GetI
|
|
|
524
527
|
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: {
|
|
525
528
|
ref: HTMLElement;
|
|
526
529
|
value: GetModelValue<T, VK, M>;
|
|
527
|
-
} | undefined) => void)) & ((evt: "update:searchTerm", value: string) => void);
|
|
530
|
+
} | undefined) => void) & ((evt: "remove-tag", item: GetModelValue<T, VK, M>) => void)) & ((evt: "update:searchTerm", value: string) => void);
|
|
528
531
|
}>) => import("vue").VNode & {
|
|
529
532
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
530
533
|
};
|
|
531
534
|
export default _default;
|
|
532
535
|
type __VLS_PrettifyLocal<T> = {
|
|
533
|
-
[K in keyof T]: T[K];
|
|
536
|
+
[K in keyof T as K]: T[K];
|
|
534
537
|
} & {};
|
|
@@ -59,9 +59,9 @@ export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue
|
|
|
59
59
|
ui?: InputNumber['slots'];
|
|
60
60
|
}
|
|
61
61
|
export interface InputNumberEmits {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
'update:modelValue': [payload: number];
|
|
63
|
+
'blur': [event: FocusEvent];
|
|
64
|
+
'change': [payload: Event];
|
|
65
65
|
}
|
|
66
66
|
export interface InputNumberSlots {
|
|
67
67
|
increment(props?: {}): any;
|
|
@@ -241,7 +241,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<InputNumbe
|
|
|
241
241
|
default?(_: {}): any;
|
|
242
242
|
};
|
|
243
243
|
}) | null>;
|
|
244
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
244
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
245
245
|
blur: (event: FocusEvent) => any;
|
|
246
246
|
change: (payload: Event) => any;
|
|
247
247
|
"update:modelValue": (payload: number) => any;
|
|
@@ -17,6 +17,7 @@ defineOptions({ inheritAttrs: false });
|
|
|
17
17
|
const props = defineProps({
|
|
18
18
|
as: { type: null, required: false },
|
|
19
19
|
placeholder: { type: String, required: false },
|
|
20
|
+
maxLength: { type: Number, required: false },
|
|
20
21
|
color: { type: null, required: false },
|
|
21
22
|
variant: { type: null, required: false },
|
|
22
23
|
size: { type: null, required: false },
|
|
@@ -138,6 +139,7 @@ defineExpose({
|
|
|
138
139
|
ref="inputRef"
|
|
139
140
|
v-bind="{ ...$attrs, ...ariaAttrs }"
|
|
140
141
|
:placeholder="placeholder"
|
|
142
|
+
:max-length="maxLength"
|
|
141
143
|
:class="ui.input({ class: props.ui?.input })"
|
|
142
144
|
/>
|
|
143
145
|
|
|
@@ -13,6 +13,8 @@ export interface InputTagsProps<T extends InputTagItem = InputTagItem> extends P
|
|
|
13
13
|
as?: any;
|
|
14
14
|
/** The placeholder text when the input is empty. */
|
|
15
15
|
placeholder?: string;
|
|
16
|
+
/** The maximum number of character allowed. */
|
|
17
|
+
maxLength?: number;
|
|
16
18
|
/**
|
|
17
19
|
* @defaultValue 'primary'
|
|
18
20
|
*/
|
|
@@ -61,8 +63,8 @@ declare const _default: <T extends InputTagItem>(__VLS_props: NonNullable<Awaite
|
|
|
61
63
|
readonly onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
62
64
|
readonly onInvalid?: ((payload: T) => any) | undefined;
|
|
63
65
|
readonly "onUpdate:modelValue"?: ((payload: T[]) => any) | undefined;
|
|
64
|
-
readonly onRemoveTag?: ((payload: T) => any) | undefined;
|
|
65
66
|
readonly onAddTag?: ((payload: T) => any) | undefined;
|
|
67
|
+
readonly onRemoveTag?: ((payload: T) => any) | undefined;
|
|
66
68
|
} & 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
69
|
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
68
70
|
inputRef: import("vue").Ref<({
|
|
@@ -173,11 +175,11 @@ declare const _default: <T extends InputTagItem>(__VLS_props: NonNullable<Awaite
|
|
|
173
175
|
}>): void;
|
|
174
176
|
attrs: any;
|
|
175
177
|
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: "
|
|
178
|
+
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: "addTag", payload: T) => void) & ((evt: "removeTag", payload: T) => void);
|
|
177
179
|
}>) => import("vue").VNode & {
|
|
178
180
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
179
181
|
};
|
|
180
182
|
export default _default;
|
|
181
183
|
type __VLS_PrettifyLocal<T> = {
|
|
182
|
-
[K in keyof T]: T[K];
|
|
184
|
+
[K in keyof T as K]: T[K];
|
|
183
185
|
} & {};
|
|
@@ -11,6 +11,7 @@ import { tv } from "../utils/tv";
|
|
|
11
11
|
const props = defineProps({
|
|
12
12
|
as: { type: null, required: false, default: "kbd" },
|
|
13
13
|
value: { type: null, required: false },
|
|
14
|
+
color: { type: null, required: false },
|
|
14
15
|
variant: { type: null, required: false },
|
|
15
16
|
size: { type: null, required: false },
|
|
16
17
|
class: { type: null, required: false }
|
|
@@ -22,7 +23,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.kbd || {} }))
|
|
|
22
23
|
</script>
|
|
23
24
|
|
|
24
25
|
<template>
|
|
25
|
-
<Primitive :as="as" :class="ui({
|
|
26
|
+
<Primitive :as="as" :class="ui({ class: props.class, color: props.color, variant: props.variant, size: props.size })">
|
|
26
27
|
<slot>
|
|
27
28
|
{{ getKbdKey(value) }}
|
|
28
29
|
</slot>
|
|
@@ -10,6 +10,10 @@ export interface KbdProps {
|
|
|
10
10
|
*/
|
|
11
11
|
as?: any;
|
|
12
12
|
value?: KbdKey | string;
|
|
13
|
+
/**
|
|
14
|
+
* @defaultValue 'neutral'
|
|
15
|
+
*/
|
|
16
|
+
color?: Kbd['variants']['color'];
|
|
13
17
|
/**
|
|
14
18
|
* @defaultValue 'outline'
|
|
15
19
|
*/
|
|
@@ -23,7 +27,7 @@ export interface KbdProps {
|
|
|
23
27
|
export interface KbdSlots {
|
|
24
28
|
default(props?: {}): any;
|
|
25
29
|
}
|
|
26
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<KbdProps,
|
|
30
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<KbdProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KbdProps> & Readonly<{}>, {
|
|
27
31
|
as: any;
|
|
28
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, KbdSlots>;
|
|
29
33
|
export default _default;
|
|
@@ -4,11 +4,12 @@ import theme from "#build/ui/link";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed } from "vue";
|
|
7
|
-
import { defu } from "defu";
|
|
8
7
|
import { isEqual } from "ohash/utils";
|
|
9
8
|
import { useForwardProps } from "reka-ui";
|
|
9
|
+
import { defu } from "defu";
|
|
10
10
|
import { reactiveOmit } from "@vueuse/core";
|
|
11
11
|
import { useRoute, useAppConfig } from "#imports";
|
|
12
|
+
import { mergeClasses } from "../utils";
|
|
12
13
|
import { tv } from "../utils/tv";
|
|
13
14
|
import { isPartiallyEqual } from "../utils/link";
|
|
14
15
|
import ULinkBase from "./LinkBase.vue";
|
|
@@ -21,7 +22,7 @@ const props = defineProps({
|
|
|
21
22
|
exact: { type: Boolean, required: false },
|
|
22
23
|
exactQuery: { type: [Boolean, String], required: false },
|
|
23
24
|
exactHash: { type: Boolean, required: false },
|
|
24
|
-
inactiveClass: { type: String, required: false
|
|
25
|
+
inactiveClass: { type: String, required: false },
|
|
25
26
|
custom: { type: Boolean, required: false },
|
|
26
27
|
raw: { type: Boolean, required: false },
|
|
27
28
|
class: { type: null, required: false },
|
|
@@ -35,7 +36,7 @@ const props = defineProps({
|
|
|
35
36
|
prefetch: { type: Boolean, required: false },
|
|
36
37
|
prefetchOn: { type: [String, Object], required: false },
|
|
37
38
|
noPrefetch: { type: Boolean, required: false },
|
|
38
|
-
activeClass: { type: String, required: false
|
|
39
|
+
activeClass: { type: String, required: false },
|
|
39
40
|
exactActiveClass: { type: String, required: false },
|
|
40
41
|
ariaCurrentValue: { type: String, required: false, default: "page" },
|
|
41
42
|
viewTransition: { type: Boolean, required: false },
|
|
@@ -50,8 +51,8 @@ const ui = computed(() => tv({
|
|
|
50
51
|
...defu({
|
|
51
52
|
variants: {
|
|
52
53
|
active: {
|
|
53
|
-
true: props.activeClass,
|
|
54
|
-
false: props.inactiveClass
|
|
54
|
+
true: mergeClasses(appConfig.ui?.link?.variants?.active?.true, props.activeClass),
|
|
55
|
+
false: mergeClasses(appConfig.ui?.link?.variants?.active?.false, props.inactiveClass)
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
}, appConfig.ui?.link || {})
|
|
@@ -77,13 +77,11 @@ export interface LinkSlots {
|
|
|
77
77
|
active: boolean;
|
|
78
78
|
}): any;
|
|
79
79
|
}
|
|
80
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<LinkProps,
|
|
80
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<LinkProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkProps> & Readonly<{}>, {
|
|
81
81
|
type: "reset" | "submit" | "button";
|
|
82
82
|
as: any;
|
|
83
|
-
activeClass: string;
|
|
84
83
|
ariaCurrentValue: "page" | "step" | "location" | "date" | "time" | "true" | "false";
|
|
85
84
|
active: boolean;
|
|
86
|
-
inactiveClass: string;
|
|
87
85
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, LinkSlots>;
|
|
88
86
|
export default _default;
|
|
89
87
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -11,7 +11,7 @@ export interface LinkBaseProps {
|
|
|
11
11
|
active?: boolean;
|
|
12
12
|
isExternal?: boolean;
|
|
13
13
|
}
|
|
14
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<LinkBaseProps,
|
|
14
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<LinkBaseProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkBaseProps> & Readonly<{}>, {
|
|
15
15
|
type: string;
|
|
16
16
|
as: string;
|
|
17
17
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
@@ -80,7 +80,7 @@ export interface ModalSlots {
|
|
|
80
80
|
close: () => void;
|
|
81
81
|
}): any;
|
|
82
82
|
}
|
|
83
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ModalProps,
|
|
83
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ModalProps, 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<ModalProps
|
|
|
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
|
dismissible: boolean;
|
|
100
100
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ModalSlots>;
|
|
101
101
|
export default _default;
|
|
@@ -18,6 +18,7 @@ import UIcon from "./Icon.vue";
|
|
|
18
18
|
import UBadge from "./Badge.vue";
|
|
19
19
|
import UPopover from "./Popover.vue";
|
|
20
20
|
import UTooltip from "./Tooltip.vue";
|
|
21
|
+
defineOptions({ inheritAttrs: false });
|
|
21
22
|
const props = defineProps({
|
|
22
23
|
as: { type: null, required: false },
|
|
23
24
|
trailingIcon: { type: String, required: false },
|
|
@@ -121,7 +122,7 @@ function getAccordionDefaultValue(list, level = 0) {
|
|
|
121
122
|
<component :is="orientation === 'vertical' && item.children?.length && !collapsed ? AccordionTrigger : 'span'" v-if="(!collapsed || orientation !== 'vertical') && (item.badge || orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) || orientation === 'vertical' && item.children?.length || item.trailingIcon || !!slots[item.slot ? `${item.slot}-trailing` : 'item-trailing'])" as="span" :class="ui.linkTrailing({ class: [props.ui?.linkTrailing, item.ui?.linkTrailing] })" @click.stop.prevent>
|
|
122
123
|
<slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="active" :index="index">
|
|
123
124
|
<UBadge
|
|
124
|
-
v-if="item.badge"
|
|
125
|
+
v-if="item.badge !== void 0"
|
|
125
126
|
color="neutral"
|
|
126
127
|
variant="outline"
|
|
127
128
|
:size="item.ui?.linkTrailingBadgeSize || props.ui?.linkTrailingBadgeSize || ui.linkTrailingBadgeSize()"
|
|
@@ -243,7 +244,7 @@ function getAccordionDefaultValue(list, level = 0) {
|
|
|
243
244
|
</component>
|
|
244
245
|
</DefineItemTemplate>
|
|
245
246
|
|
|
246
|
-
<NavigationMenuRoot v-bind="rootProps" :data-collapsed="collapsed" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
247
|
+
<NavigationMenuRoot v-bind="{ ...rootProps, ...$attrs }" :data-collapsed="collapsed" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
247
248
|
<slot name="list-leading" />
|
|
248
249
|
|
|
249
250
|
<template v-for="(list, listIndex) in lists" :key="`list-${listIndex}`">
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{},
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
2
|
export default _default;
|
|
@@ -95,7 +95,7 @@ export interface PaginationSlots {
|
|
|
95
95
|
index: number;
|
|
96
96
|
}): any;
|
|
97
97
|
}
|
|
98
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PaginationProps,
|
|
98
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PaginationProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
99
99
|
"update:page": (value: number) => any;
|
|
100
100
|
}, string, import("vue").PublicProps, Readonly<PaginationProps> & Readonly<{
|
|
101
101
|
"onUpdate:page"?: ((value: number) => any) | undefined;
|