@nuxt/ui 3.1.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nuxt/ui/accordion.ts +2 -23
- package/.nuxt/ui/alert.ts +2 -28
- package/.nuxt/ui/avatar-group.ts +2 -23
- package/.nuxt/ui/avatar.ts +2 -23
- package/.nuxt/ui/badge.ts +32 -30
- package/.nuxt/ui/breadcrumb.ts +2 -23
- package/.nuxt/ui/button-group.ts +2 -36
- package/.nuxt/ui/button.ts +4 -30
- package/.nuxt/ui/calendar.ts +4 -25
- package/.nuxt/ui/card.ts +2 -23
- package/.nuxt/ui/carousel.ts +2 -28
- package/.nuxt/ui/checkbox-group.ts +146 -24
- package/.nuxt/ui/checkbox.ts +2 -23
- package/.nuxt/ui/chip.ts +2 -23
- package/.nuxt/ui/collapsible.ts +2 -23
- package/.nuxt/ui/color-picker.ts +4 -25
- package/.nuxt/ui/command-palette.ts +2 -23
- package/.nuxt/ui/container.ts +2 -23
- package/.nuxt/ui/context-menu.ts +2 -23
- package/.nuxt/ui/drawer.ts +2 -23
- package/.nuxt/ui/dropdown-menu.ts +2 -23
- package/.nuxt/ui/form-field.ts +2 -23
- package/.nuxt/ui/form.ts +2 -23
- package/.nuxt/ui/input-menu.ts +4 -34
- package/.nuxt/ui/input-number.ts +12 -23
- package/.nuxt/ui/input.ts +4 -34
- package/.nuxt/ui/kbd.ts +2 -23
- package/.nuxt/ui/link.ts +14 -28
- package/.nuxt/ui/modal.ts +2 -23
- package/.nuxt/ui/navigation-menu.ts +3 -24
- package/.nuxt/ui/pagination.ts +2 -23
- package/.nuxt/ui/pin-input.ts +2 -23
- package/.nuxt/ui/popover.ts +2 -23
- package/.nuxt/ui/progress.ts +2 -23
- package/.nuxt/ui/radio-group.ts +2 -23
- package/.nuxt/ui/select-menu.ts +4 -34
- package/.nuxt/ui/select.ts +4 -34
- package/.nuxt/ui/separator.ts +2 -23
- package/.nuxt/ui/skeleton.ts +2 -23
- package/.nuxt/ui/slideover.ts +2 -23
- package/.nuxt/ui/slider.ts +2 -23
- package/.nuxt/ui/stepper.ts +2 -23
- package/.nuxt/ui/switch.ts +2 -23
- package/.nuxt/ui/table.ts +2 -23
- package/.nuxt/ui/tabs.ts +6 -26
- package/.nuxt/ui/textarea.ts +4 -34
- package/.nuxt/ui/toast.ts +2 -28
- package/.nuxt/ui/toaster.ts +2 -23
- package/.nuxt/ui/tooltip.ts +2 -23
- package/.nuxt/ui/tree.ts +2 -23
- package/.nuxt/ui.css +15 -8
- package/README.md +4 -0
- package/cli/templates.mjs +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +15 -5
- package/dist/runtime/components/Accordion.vue +9 -9
- package/dist/runtime/components/Accordion.vue.d.ts +6 -20
- package/dist/runtime/components/Alert.vue +1 -1
- package/dist/runtime/components/Alert.vue.d.ts +7 -22
- package/dist/runtime/components/App.vue.d.ts +2 -2
- package/dist/runtime/components/Avatar.vue +2 -2
- package/dist/runtime/components/Avatar.vue.d.ts +4 -25
- package/dist/runtime/components/AvatarGroup.vue +1 -1
- package/dist/runtime/components/AvatarGroup.vue.d.ts +2 -11
- package/dist/runtime/components/Badge.vue +5 -3
- package/dist/runtime/components/Badge.vue.d.ts +5 -24
- package/dist/runtime/components/Breadcrumb.vue +8 -8
- package/dist/runtime/components/Breadcrumb.vue.d.ts +4 -20
- package/dist/runtime/components/Button.vue +2 -3
- package/dist/runtime/components/Button.vue.d.ts +4 -29
- package/dist/runtime/components/ButtonGroup.vue.d.ts +3 -24
- package/dist/runtime/components/Calendar.vue +2 -1
- package/dist/runtime/components/Calendar.vue.d.ts +6 -2
- package/dist/runtime/components/Card.vue +1 -1
- package/dist/runtime/components/Card.vue.d.ts +2 -11
- package/dist/runtime/components/Carousel.vue +5 -2
- package/dist/runtime/components/Carousel.vue.d.ts +10 -3
- package/dist/runtime/components/Checkbox.vue +2 -2
- package/dist/runtime/components/Checkbox.vue.d.ts +10 -13
- package/dist/runtime/components/CheckboxGroup.vue +8 -5
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +12 -3
- package/dist/runtime/components/Chip.vue +1 -1
- package/dist/runtime/components/Chip.vue.d.ts +10 -24
- package/dist/runtime/components/Collapsible.vue +1 -1
- package/dist/runtime/components/Collapsible.vue.d.ts +7 -22
- package/dist/runtime/components/ColorPicker.vue +1 -1
- package/dist/runtime/components/ColorPicker.vue.d.ts +9 -24
- package/dist/runtime/components/CommandPalette.vue +17 -17
- package/dist/runtime/components/CommandPalette.vue.d.ts +17 -27
- package/dist/runtime/components/Container.vue.d.ts +2 -11
- package/dist/runtime/components/ContextMenu.vue.d.ts +6 -24
- package/dist/runtime/components/ContextMenuContent.vue +15 -15
- package/dist/runtime/components/ContextMenuContent.vue.d.ts +17 -57
- package/dist/runtime/components/Drawer.vue.d.ts +17 -27
- package/dist/runtime/components/DropdownMenu.vue.d.ts +6 -28
- package/dist/runtime/components/DropdownMenuContent.vue +15 -15
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +19 -6
- package/dist/runtime/components/Form.vue.d.ts +5 -2
- package/dist/runtime/components/FormField.vue +5 -5
- package/dist/runtime/components/FormField.vue.d.ts +2 -11
- package/dist/runtime/components/Icon.vue.d.ts +1 -10
- package/dist/runtime/components/Input.vue +2 -2
- package/dist/runtime/components/Input.vue.d.ts +20 -41
- package/dist/runtime/components/InputMenu.vue +17 -17
- package/dist/runtime/components/InputMenu.vue.d.ts +227 -5
- package/dist/runtime/components/InputNumber.vue +13 -7
- package/dist/runtime/components/InputNumber.vue.d.ts +90 -23
- package/dist/runtime/components/Kbd.vue.d.ts +3 -24
- package/dist/runtime/components/Link.vue +5 -14
- package/dist/runtime/components/Link.vue.d.ts +3 -34
- package/dist/runtime/components/LinkBase.vue.d.ts +4 -27
- package/dist/runtime/components/Modal.vue.d.ts +12 -28
- package/dist/runtime/components/NavigationMenu.vue +35 -28
- package/dist/runtime/components/NavigationMenu.vue.d.ts +24 -26
- package/dist/runtime/components/Pagination.vue +1 -1
- package/dist/runtime/components/Pagination.vue.d.ts +9 -33
- package/dist/runtime/components/PinInput.vue +1 -1
- package/dist/runtime/components/PinInput.vue.d.ts +13 -24
- package/dist/runtime/components/Popover.vue.d.ts +9 -26
- package/dist/runtime/components/Progress.vue +1 -1
- package/dist/runtime/components/Progress.vue.d.ts +10 -41
- package/dist/runtime/components/RadioGroup.vue +8 -8
- package/dist/runtime/components/RadioGroup.vue.d.ts +8 -3
- package/dist/runtime/components/Select.vue +12 -12
- package/dist/runtime/components/Select.vue.d.ts +11 -3
- package/dist/runtime/components/SelectMenu.vue +13 -13
- package/dist/runtime/components/SelectMenu.vue.d.ts +19 -5
- package/dist/runtime/components/Separator.vue +1 -1
- package/dist/runtime/components/Separator.vue.d.ts +3 -24
- package/dist/runtime/components/Skeleton.vue.d.ts +3 -12
- package/dist/runtime/components/Slideover.vue.d.ts +12 -29
- package/dist/runtime/components/Slider.vue +16 -4
- package/dist/runtime/components/Slider.vue.d.ts +23 -36
- package/dist/runtime/components/Stepper.vue +10 -10
- package/dist/runtime/components/Stepper.vue.d.ts +10 -14
- package/dist/runtime/components/Switch.vue +1 -1
- package/dist/runtime/components/Switch.vue.d.ts +10 -13
- package/dist/runtime/components/Table.vue +2 -2
- package/dist/runtime/components/Table.vue.d.ts +17 -17
- package/dist/runtime/components/Tabs.vue +6 -6
- package/dist/runtime/components/Tabs.vue.d.ts +6 -20
- package/dist/runtime/components/Textarea.vue +3 -3
- package/dist/runtime/components/Textarea.vue.d.ts +20 -44
- package/dist/runtime/components/Toast.vue +3 -2
- package/dist/runtime/components/Toast.vue.d.ts +92 -24
- package/dist/runtime/components/Toaster.vue +4 -4
- package/dist/runtime/components/Toaster.vue.d.ts +9 -28
- package/dist/runtime/components/Tooltip.vue.d.ts +7 -22
- package/dist/runtime/components/Tree.vue +10 -10
- package/dist/runtime/components/Tree.vue.d.ts +7 -22
- package/dist/runtime/composables/defineShortcuts.js +6 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useButtonGroup.d.ts +1 -1
- package/dist/runtime/composables/useFormField.d.ts +2 -2
- package/dist/runtime/composables/useFormField.js +2 -1
- package/dist/runtime/composables/useKbd.d.ts +1 -0
- package/dist/runtime/composables/useKbd.js +4 -3
- package/dist/runtime/composables/useOverlay.d.ts +9 -10
- package/dist/runtime/composables/useOverlay.js +11 -6
- package/dist/runtime/inertia/components/Link.vue +46 -60
- package/dist/runtime/inertia/components/Link.vue.d.ts +4 -33
- package/dist/runtime/inertia/components/LinkBase.vue +68 -0
- package/dist/runtime/inertia/components/LinkBase.vue.d.ts +25 -0
- package/dist/runtime/inertia/stubs.d.ts +1 -1
- package/dist/runtime/inertia/stubs.js +1 -1
- package/dist/runtime/locale/index.d.ts +1 -0
- package/dist/runtime/locale/index.js +1 -0
- package/dist/runtime/locale/sl.d.ts +3 -0
- package/dist/runtime/locale/sl.js +54 -0
- package/dist/runtime/types/tv.d.ts +53 -0
- package/dist/runtime/types/tv.js +0 -0
- package/dist/runtime/types/utils.d.ts +2 -52
- package/dist/runtime/types/utils.js +1 -0
- package/dist/runtime/utils/link.d.ts +1 -0
- package/dist/runtime/utils/link.js +12 -0
- package/dist/runtime/vue/components/Icon.vue.d.ts +1 -10
- package/dist/runtime/vue/components/Link.vue +27 -40
- package/dist/runtime/vue/components/Link.vue.d.ts +3 -34
- package/dist/runtime/vue/composables/useAppConfig.js +3 -1
- package/dist/runtime/vue/stubs.d.ts +1 -1
- package/dist/runtime/vue/stubs.js +1 -1
- package/dist/shared/{ui.D7lOOabO.mjs → ui.BvUP-pSb.mjs} +120 -27
- package/dist/unplugin.d.mts +2 -2
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +2 -2
- package/package.json +28 -27
|
@@ -5,11 +5,12 @@ import theme from "#build/ui/link";
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed } from "vue";
|
|
7
7
|
import { defu } from "defu";
|
|
8
|
-
import { isEqual
|
|
8
|
+
import { isEqual } from "ohash/utils";
|
|
9
9
|
import { useForwardProps } from "reka-ui";
|
|
10
10
|
import { reactiveOmit } from "@vueuse/core";
|
|
11
11
|
import { useRoute, useAppConfig } from "#imports";
|
|
12
12
|
import { tv } from "../utils/tv";
|
|
13
|
+
import { isPartiallyEqual } from "../utils/link";
|
|
13
14
|
import ULinkBase from "./LinkBase.vue";
|
|
14
15
|
defineOptions({ inheritAttrs: false });
|
|
15
16
|
const props = defineProps({
|
|
@@ -43,7 +44,7 @@ const props = defineProps({
|
|
|
43
44
|
defineSlots();
|
|
44
45
|
const route = useRoute();
|
|
45
46
|
const appConfig = useAppConfig();
|
|
46
|
-
const nuxtLinkProps = useForwardProps(reactiveOmit(props, "as", "type", "disabled", "active", "exact", "exactQuery", "exactHash", "activeClass", "inactiveClass", "raw", "class"));
|
|
47
|
+
const nuxtLinkProps = useForwardProps(reactiveOmit(props, "as", "type", "disabled", "active", "exact", "exactQuery", "exactHash", "activeClass", "inactiveClass", "to", "href", "raw", "custom", "class"));
|
|
47
48
|
const ui = computed(() => tv({
|
|
48
49
|
extend: tv(theme),
|
|
49
50
|
...defu({
|
|
@@ -55,17 +56,7 @@ const ui = computed(() => tv({
|
|
|
55
56
|
}
|
|
56
57
|
}, appConfig.ui?.link || {})
|
|
57
58
|
}));
|
|
58
|
-
|
|
59
|
-
const diffedKeys = diff(item1, item2).reduce((filtered, q) => {
|
|
60
|
-
if (q.type === "added") {
|
|
61
|
-
filtered.add(q.key);
|
|
62
|
-
}
|
|
63
|
-
return filtered;
|
|
64
|
-
}, /* @__PURE__ */ new Set());
|
|
65
|
-
const item1Filtered = Object.fromEntries(Object.entries(item1).filter(([key]) => !diffedKeys.has(key)));
|
|
66
|
-
const item2Filtered = Object.fromEntries(Object.entries(item2).filter(([key]) => !diffedKeys.has(key)));
|
|
67
|
-
return isEqual(item1Filtered, item2Filtered);
|
|
68
|
-
}
|
|
59
|
+
const to = computed(() => props.to ?? props.href);
|
|
69
60
|
function isLinkActive({ route: linkRoute, isActive, isExactActive }) {
|
|
70
61
|
if (props.active !== void 0) {
|
|
71
62
|
return props.active;
|
|
@@ -96,7 +87,7 @@ function resolveLinkClass({ route: route2, isActive, isExactActive }) {
|
|
|
96
87
|
</script>
|
|
97
88
|
|
|
98
89
|
<template>
|
|
99
|
-
<NuxtLink v-slot="{ href, navigate, route: linkRoute, rel, target, isExternal, isActive, isExactActive }" v-bind="nuxtLinkProps" custom>
|
|
90
|
+
<NuxtLink v-slot="{ href, navigate, route: linkRoute, rel, target, isExternal, isActive, isExactActive }" v-bind="nuxtLinkProps" :to="to" custom>
|
|
100
91
|
<template v-if="custom">
|
|
101
92
|
<slot
|
|
102
93
|
v-bind="{
|
|
@@ -77,48 +77,17 @@ export interface LinkSlots {
|
|
|
77
77
|
active: boolean;
|
|
78
78
|
}): any;
|
|
79
79
|
}
|
|
80
|
-
declare const _default:
|
|
81
|
-
as: string;
|
|
82
|
-
type: string;
|
|
83
|
-
ariaCurrentValue: string;
|
|
84
|
-
active: undefined;
|
|
85
|
-
activeClass: string;
|
|
86
|
-
inactiveClass: string;
|
|
87
|
-
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<LinkProps>, {
|
|
88
|
-
as: string;
|
|
89
|
-
type: string;
|
|
90
|
-
ariaCurrentValue: string;
|
|
91
|
-
active: undefined;
|
|
92
|
-
activeClass: string;
|
|
93
|
-
inactiveClass: string;
|
|
94
|
-
}>>> & Readonly<{}>, {
|
|
80
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<LinkProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkProps> & Readonly<{}>, {
|
|
95
81
|
type: "reset" | "submit" | "button";
|
|
96
82
|
as: any;
|
|
97
83
|
activeClass: string;
|
|
98
84
|
ariaCurrentValue: "page" | "step" | "location" | "date" | "time" | "true" | "false";
|
|
99
85
|
active: boolean;
|
|
100
86
|
inactiveClass: string;
|
|
101
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions,
|
|
87
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, LinkSlots>;
|
|
102
88
|
export default _default;
|
|
103
|
-
type
|
|
104
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
105
|
-
default: D[K];
|
|
106
|
-
}> : P[K];
|
|
107
|
-
};
|
|
108
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
109
|
-
type __VLS_TypePropsToOption<T> = {
|
|
110
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
111
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
112
|
-
} : {
|
|
113
|
-
type: import('vue').PropType<T[K]>;
|
|
114
|
-
required: true;
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
89
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
118
90
|
new (): {
|
|
119
91
|
$slots: S;
|
|
120
92
|
};
|
|
121
93
|
};
|
|
122
|
-
type __VLS_PrettifyLocal<T> = {
|
|
123
|
-
[K in keyof T]: T[K];
|
|
124
|
-
} & {};
|
|
@@ -11,38 +11,15 @@ export interface LinkBaseProps {
|
|
|
11
11
|
active?: boolean;
|
|
12
12
|
isExternal?: boolean;
|
|
13
13
|
}
|
|
14
|
-
declare const _default:
|
|
15
|
-
as: string;
|
|
16
|
-
type: string;
|
|
17
|
-
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<LinkBaseProps>, {
|
|
18
|
-
as: string;
|
|
19
|
-
type: string;
|
|
20
|
-
}>>> & Readonly<{}>, {
|
|
14
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<LinkBaseProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkBaseProps> & Readonly<{}>, {
|
|
21
15
|
type: string;
|
|
22
16
|
as: string;
|
|
23
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions,
|
|
24
|
-
default
|
|
17
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
18
|
+
default?: (props: {}) => any;
|
|
25
19
|
}>;
|
|
26
20
|
export default _default;
|
|
27
|
-
type
|
|
28
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
29
|
-
default: D[K];
|
|
30
|
-
}> : P[K];
|
|
31
|
-
};
|
|
32
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
33
|
-
type __VLS_TypePropsToOption<T> = {
|
|
34
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
35
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
36
|
-
} : {
|
|
37
|
-
type: import('vue').PropType<T[K]>;
|
|
38
|
-
required: true;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
42
22
|
new (): {
|
|
43
23
|
$slots: S;
|
|
44
24
|
};
|
|
45
25
|
};
|
|
46
|
-
type __VLS_PrettifyLocal<T> = {
|
|
47
|
-
[K in keyof T]: T[K];
|
|
48
|
-
} & {};
|
|
@@ -69,41 +69,25 @@ export interface ModalSlots {
|
|
|
69
69
|
body(props?: {}): any;
|
|
70
70
|
footer(props?: {}): any;
|
|
71
71
|
}
|
|
72
|
-
declare const _default:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ModalProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
73
|
+
"update:open": (value: boolean) => any;
|
|
74
|
+
"after:leave": () => any;
|
|
75
|
+
"close:prevent": () => any;
|
|
76
|
+
}, string, import("vue").PublicProps, Readonly<ModalProps> & Readonly<{
|
|
77
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
78
|
+
"onAfter:leave"?: (() => any) | undefined;
|
|
79
|
+
"onClose:prevent"?: (() => any) | undefined;
|
|
80
|
+
}>, {
|
|
80
81
|
close: boolean | Partial<ButtonProps>;
|
|
81
82
|
modal: boolean;
|
|
82
|
-
transition: boolean;
|
|
83
83
|
portal: boolean | string | HTMLElement;
|
|
84
84
|
overlay: boolean;
|
|
85
|
+
transition: boolean;
|
|
85
86
|
dismissible: boolean;
|
|
86
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions,
|
|
87
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ModalSlots>;
|
|
87
88
|
export default _default;
|
|
88
|
-
type
|
|
89
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
90
|
-
default: D[K];
|
|
91
|
-
}> : P[K];
|
|
92
|
-
};
|
|
93
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
94
|
-
type __VLS_TypePropsToOption<T> = {
|
|
95
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
96
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
97
|
-
} : {
|
|
98
|
-
type: import('vue').PropType<T[K]>;
|
|
99
|
-
required: true;
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
89
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
103
90
|
new (): {
|
|
104
91
|
$slots: S;
|
|
105
92
|
};
|
|
106
93
|
};
|
|
107
|
-
type __VLS_PrettifyLocal<T> = {
|
|
108
|
-
[K in keyof T]: T[K];
|
|
109
|
-
} & {};
|
|
@@ -16,6 +16,7 @@ import UAvatar from "./Avatar.vue";
|
|
|
16
16
|
import UIcon from "./Icon.vue";
|
|
17
17
|
import UBadge from "./Badge.vue";
|
|
18
18
|
import UCollapsible from "./Collapsible.vue";
|
|
19
|
+
import UTooltip from "./Tooltip.vue";
|
|
19
20
|
const props = defineProps({
|
|
20
21
|
as: { type: null, required: false },
|
|
21
22
|
trailingIcon: { type: String, required: false },
|
|
@@ -84,34 +85,34 @@ const lists = computed(
|
|
|
84
85
|
<DefineLinkTemplate v-slot="{ item, active, index }">
|
|
85
86
|
<slot :name="item.slot || 'item'" :item="item" :index="index">
|
|
86
87
|
<slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="item" :active="active" :index="index">
|
|
87
|
-
<UAvatar v-if="item.avatar" :size="props.ui?.linkLeadingAvatarSize || ui.linkLeadingAvatarSize()" v-bind="item.avatar" :class="ui.linkLeadingAvatar({ class: props.ui?.linkLeadingAvatar, active, disabled: !!item.disabled })" />
|
|
88
|
-
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.linkLeadingIcon({ class: props.ui?.linkLeadingIcon, active, disabled: !!item.disabled })" />
|
|
88
|
+
<UAvatar v-if="item.avatar" :size="item.ui?.linkLeadingAvatarSize || props.ui?.linkLeadingAvatarSize || ui.linkLeadingAvatarSize()" v-bind="item.avatar" :class="ui.linkLeadingAvatar({ class: [props.ui?.linkLeadingAvatar, item.ui?.linkLeadingAvatar], active, disabled: !!item.disabled })" />
|
|
89
|
+
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon], active, disabled: !!item.disabled })" />
|
|
89
90
|
</slot>
|
|
90
91
|
|
|
91
92
|
<span
|
|
92
93
|
v-if="(!collapsed || orientation !== 'vertical') && (get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label'])"
|
|
93
|
-
:class="ui.linkLabel({ class: props.ui?.linkLabel })"
|
|
94
|
+
:class="ui.linkLabel({ class: [props.ui?.linkLabel, item.ui?.linkLabel] })"
|
|
94
95
|
>
|
|
95
96
|
<slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="active" :index="index">
|
|
96
97
|
{{ get(item, props.labelKey) }}
|
|
97
98
|
</slot>
|
|
98
99
|
|
|
99
|
-
<UIcon v-if="item.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" :class="ui.linkLabelExternalIcon({ class: props.ui?.linkLabelExternalIcon, active })" />
|
|
100
|
+
<UIcon v-if="item.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" :class="ui.linkLabelExternalIcon({ class: [props.ui?.linkLabelExternalIcon, item.ui?.linkLabelExternalIcon], active })" />
|
|
100
101
|
</span>
|
|
101
102
|
|
|
102
|
-
<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'])" :class="ui.linkTrailing({ class: props.ui?.linkTrailing })">
|
|
103
|
+
<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'])" :class="ui.linkTrailing({ class: [props.ui?.linkTrailing, item.ui?.linkTrailing] })">
|
|
103
104
|
<slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="active" :index="index">
|
|
104
105
|
<UBadge
|
|
105
106
|
v-if="item.badge"
|
|
106
107
|
color="neutral"
|
|
107
108
|
variant="outline"
|
|
108
|
-
:size="props.ui?.linkTrailingBadgeSize || ui.linkTrailingBadgeSize()"
|
|
109
|
+
:size="item.ui?.linkTrailingBadgeSize || props.ui?.linkTrailingBadgeSize || ui.linkTrailingBadgeSize()"
|
|
109
110
|
v-bind="typeof item.badge === 'string' || typeof item.badge === 'number' ? { label: item.badge } : item.badge"
|
|
110
|
-
:class="ui.linkTrailingBadge({ class: props.ui?.linkTrailingBadge })"
|
|
111
|
+
:class="ui.linkTrailingBadge({ class: [props.ui?.linkTrailingBadge, item.ui?.linkTrailingBadge] })"
|
|
111
112
|
/>
|
|
112
113
|
|
|
113
|
-
<UIcon v-if="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) || orientation === 'vertical' && item.children?.length" :name="item.trailingIcon || trailingIcon || appConfig.ui.icons.chevronDown" :class="ui.linkTrailingIcon({ class: props.ui?.linkTrailingIcon, active })" />
|
|
114
|
-
<UIcon v-else-if="item.trailingIcon" :name="item.trailingIcon" :class="ui.linkTrailingIcon({ class: props.ui?.linkTrailingIcon, active })" />
|
|
114
|
+
<UIcon v-if="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) || orientation === 'vertical' && item.children?.length && item.collapsible !== false" :name="item.trailingIcon || trailingIcon || appConfig.ui.icons.chevronDown" :class="ui.linkTrailingIcon({ class: [props.ui?.linkTrailingIcon, item.ui?.linkTrailingIcon], active })" />
|
|
115
|
+
<UIcon v-else-if="item.trailingIcon" :name="item.trailingIcon" :class="ui.linkTrailingIcon({ class: [props.ui?.linkTrailingIcon, item.ui?.linkTrailingIcon], active })" />
|
|
115
116
|
</slot>
|
|
116
117
|
</span>
|
|
117
118
|
</slot>
|
|
@@ -119,17 +120,18 @@ const lists = computed(
|
|
|
119
120
|
|
|
120
121
|
<DefineItemTemplate v-slot="{ item, index, level = 0 }">
|
|
121
122
|
<component
|
|
122
|
-
:is="orientation === 'vertical' && item.children?.length
|
|
123
|
+
:is="orientation === 'vertical' && item.children?.length ? UCollapsible : NavigationMenuItem"
|
|
123
124
|
as="li"
|
|
124
|
-
:value="item.value ||
|
|
125
|
+
:value="item.value || `item-${index}`"
|
|
125
126
|
:default-open="item.defaultOpen"
|
|
126
|
-
:
|
|
127
|
+
:disabled="orientation === 'vertical' && item.children?.length ? item.collapsible === false : void 0"
|
|
128
|
+
:unmount-on-hide="orientation === 'vertical' && item.children?.length ? unmountOnHide : void 0"
|
|
127
129
|
:open="item.open"
|
|
128
130
|
>
|
|
129
|
-
<div v-if="orientation === 'vertical' && item.type === 'label'" :class="ui.label({ class: props.ui?.label })">
|
|
131
|
+
<div v-if="orientation === 'vertical' && item.type === 'label'" :class="ui.label({ class: [props.ui?.label, item.ui?.label, item.class] })">
|
|
130
132
|
<ReuseLinkTemplate :item="item" :index="index" />
|
|
131
133
|
</div>
|
|
132
|
-
<ULink v-else-if="item.type !== 'label'" v-slot="{ active, ...slotProps }" v-bind="orientation === 'vertical' && item.children?.length &&
|
|
134
|
+
<ULink v-else-if="item.type !== 'label'" v-slot="{ active, ...slotProps }" v-bind="orientation === 'vertical' && item.children?.length && item.collapsible !== false ? {} : pickLinkProps(item)" custom>
|
|
133
135
|
<component
|
|
134
136
|
:is="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) ? NavigationMenuTrigger : NavigationMenuLink"
|
|
135
137
|
as-child
|
|
@@ -137,27 +139,32 @@ const lists = computed(
|
|
|
137
139
|
:disabled="item.disabled"
|
|
138
140
|
@select="item.onSelect"
|
|
139
141
|
>
|
|
140
|
-
<
|
|
142
|
+
<UTooltip v-if="!!item.tooltip" :content="{ side: 'right' }" v-bind="item.tooltip">
|
|
143
|
+
<ULinkBase v-bind="slotProps" :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], active: active || item.active, disabled: !!item.disabled, level: orientation === 'horizontal' || level > 0 })">
|
|
144
|
+
<ReuseLinkTemplate :item="item" :active="active || item.active" :index="index" />
|
|
145
|
+
</ULinkBase>
|
|
146
|
+
</UTooltip>
|
|
147
|
+
<ULinkBase v-else v-bind="slotProps" :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], active: active || item.active, disabled: !!item.disabled, level: orientation === 'horizontal' || level > 0 })">
|
|
141
148
|
<ReuseLinkTemplate :item="item" :active="active || item.active" :index="index" />
|
|
142
149
|
</ULinkBase>
|
|
143
150
|
</component>
|
|
144
151
|
|
|
145
|
-
<NavigationMenuContent v-if="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content'])" v-bind="contentProps" :class="ui.content({ class: props.ui?.content })">
|
|
152
|
+
<NavigationMenuContent v-if="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content'])" v-bind="contentProps" :class="ui.content({ class: [props.ui?.content, item.ui?.content] })">
|
|
146
153
|
<slot :name="item.slot ? `${item.slot}-content` : 'item-content'" :item="item" :active="active" :index="index">
|
|
147
|
-
<ul :class="ui.childList({ class: props.ui?.childList })">
|
|
148
|
-
<li v-for="(childItem, childIndex) in item.children" :key="childIndex" :class="ui.childItem({ class: props.ui?.childItem })">
|
|
154
|
+
<ul :class="ui.childList({ class: [props.ui?.childList, item.ui?.childList] })">
|
|
155
|
+
<li v-for="(childItem, childIndex) in item.children" :key="childIndex" :class="ui.childItem({ class: [props.ui?.childItem, item.ui?.childItem] })">
|
|
149
156
|
<ULink v-slot="{ active: childActive, ...childSlotProps }" v-bind="pickLinkProps(childItem)" custom>
|
|
150
157
|
<NavigationMenuLink as-child :active="childActive" @select="childItem.onSelect">
|
|
151
|
-
<ULinkBase v-bind="childSlotProps" :class="ui.childLink({ class: [props.ui?.childLink, childItem.class], active: childActive })">
|
|
152
|
-
<UIcon v-if="childItem.icon" :name="childItem.icon" :class="ui.childLinkIcon({ class: props.ui?.childLinkIcon, active: childActive })" />
|
|
158
|
+
<ULinkBase v-bind="childSlotProps" :class="ui.childLink({ class: [props.ui?.childLink, item.ui?.childLink, childItem.class], active: childActive })">
|
|
159
|
+
<UIcon v-if="childItem.icon" :name="childItem.icon" :class="ui.childLinkIcon({ class: [props.ui?.childLinkIcon, item.ui?.childLinkIcon], active: childActive })" />
|
|
153
160
|
|
|
154
|
-
<div :class="ui.childLinkWrapper({ class: props.ui?.childLinkWrapper })">
|
|
155
|
-
<p :class="ui.childLinkLabel({ class: props.ui?.childLinkLabel, active: childActive })">
|
|
161
|
+
<div :class="ui.childLinkWrapper({ class: [props.ui?.childLinkWrapper, item.ui?.childLinkWrapper] })">
|
|
162
|
+
<p :class="ui.childLinkLabel({ class: [props.ui?.childLinkLabel, item.ui?.childLinkLabel], active: childActive })">
|
|
156
163
|
{{ get(childItem, props.labelKey) }}
|
|
157
164
|
|
|
158
|
-
<UIcon v-if="childItem.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" :class="ui.childLinkLabelExternalIcon({ class: props.ui?.childLinkLabelExternalIcon, active: childActive })" />
|
|
165
|
+
<UIcon v-if="childItem.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" :class="ui.childLinkLabelExternalIcon({ class: [props.ui?.childLinkLabelExternalIcon, item.ui?.childLinkLabelExternalIcon], active: childActive })" />
|
|
159
166
|
</p>
|
|
160
|
-
<p v-if="childItem.description" :class="ui.childLinkDescription({ class: props.ui?.childLinkDescription, active: childActive })">
|
|
167
|
+
<p v-if="childItem.description" :class="ui.childLinkDescription({ class: [props.ui?.childLinkDescription, item.ui?.childLinkDescription], active: childActive })">
|
|
161
168
|
{{ childItem.description }}
|
|
162
169
|
</p>
|
|
163
170
|
</div>
|
|
@@ -170,7 +177,7 @@ const lists = computed(
|
|
|
170
177
|
</NavigationMenuContent>
|
|
171
178
|
</ULink>
|
|
172
179
|
|
|
173
|
-
<template v-if="orientation === 'vertical' && item.children?.length
|
|
180
|
+
<template v-if="orientation === 'vertical' && item.children?.length" #content>
|
|
174
181
|
<ul :class="ui.childList({ class: props.ui?.childList })">
|
|
175
182
|
<ReuseItemTemplate
|
|
176
183
|
v-for="(childItem, childIndex) in item.children"
|
|
@@ -178,19 +185,19 @@ const lists = computed(
|
|
|
178
185
|
:item="childItem"
|
|
179
186
|
:index="childIndex"
|
|
180
187
|
:level="level + 1"
|
|
181
|
-
:class="ui.childItem({ class: props.ui?.childItem })"
|
|
188
|
+
:class="ui.childItem({ class: [props.ui?.childItem, childItem.ui?.childItem] })"
|
|
182
189
|
/>
|
|
183
190
|
</ul>
|
|
184
191
|
</template>
|
|
185
192
|
</component>
|
|
186
193
|
</DefineItemTemplate>
|
|
187
194
|
|
|
188
|
-
<NavigationMenuRoot v-bind="rootProps" :data-collapsed="collapsed" :class="ui.root({ class: [props.
|
|
195
|
+
<NavigationMenuRoot v-bind="rootProps" :data-collapsed="collapsed" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
189
196
|
<slot name="list-leading" />
|
|
190
197
|
|
|
191
198
|
<template v-for="(list, listIndex) in lists" :key="`list-${listIndex}`">
|
|
192
199
|
<NavigationMenuList :class="ui.list({ class: props.ui?.list })">
|
|
193
|
-
<ReuseItemTemplate v-for="(item, index) in list" :key="`list-${listIndex}-${index}`" :item="item" :index="index" :class="ui.item({ class: props.ui?.item })" />
|
|
200
|
+
<ReuseItemTemplate v-for="(item, index) in list" :key="`list-${listIndex}-${index}`" :item="item" :index="index" :class="ui.item({ class: [props.ui?.item, item.ui?.item] })" />
|
|
194
201
|
</NavigationMenuList>
|
|
195
202
|
|
|
196
203
|
<div v-if="orientation === 'vertical' && listIndex < lists.length - 1" :class="ui.separator({ class: props.ui?.separator })" />
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { NavigationMenuRootProps, NavigationMenuRootEmits, NavigationMenuContentProps, NavigationMenuContentEmits, CollapsibleRootProps } from 'reka-ui';
|
|
2
2
|
import type { AppConfig } from '@nuxt/schema';
|
|
3
3
|
import theme from '#build/ui/navigation-menu';
|
|
4
|
-
import type { AvatarProps, BadgeProps, LinkProps } from '../types';
|
|
4
|
+
import type { AvatarProps, BadgeProps, LinkProps, TooltipProps } from '../types';
|
|
5
5
|
import type { ArrayOrNested, DynamicSlots, MergeTypes, NestedItem, EmitsToProps, ComponentConfig } from '../types/utils';
|
|
6
6
|
type NavigationMenu = ComponentConfig<typeof theme, AppConfig, 'navigationMenu'>;
|
|
7
|
-
export interface NavigationMenuChildItem extends Omit<NavigationMenuItem, 'type'> {
|
|
7
|
+
export interface NavigationMenuChildItem extends Omit<NavigationMenuItem, 'type' | 'ui'> {
|
|
8
8
|
/** Description is only used when `orientation` is `horizontal`. */
|
|
9
9
|
description?: string;
|
|
10
10
|
[key: string]: any;
|
|
@@ -21,6 +21,12 @@ export interface NavigationMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'cu
|
|
|
21
21
|
* `{ size: 'sm', color: 'neutral', variant: 'outline' }`{lang="ts-type"}
|
|
22
22
|
*/
|
|
23
23
|
badge?: string | number | BadgeProps;
|
|
24
|
+
/**
|
|
25
|
+
* Display a tooltip on the item.
|
|
26
|
+
* Only works when `type` is `link`.
|
|
27
|
+
* `{ content: { side: 'right' } }`{lang="ts-type"}
|
|
28
|
+
*/
|
|
29
|
+
tooltip?: TooltipProps;
|
|
24
30
|
/**
|
|
25
31
|
* @IconifyIcon
|
|
26
32
|
*/
|
|
@@ -32,9 +38,21 @@ export interface NavigationMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'cu
|
|
|
32
38
|
*/
|
|
33
39
|
type?: 'label' | 'link';
|
|
34
40
|
slot?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The value of the item. Avoid using `index` as the value to prevent conflicts in horizontal orientation with Reka UI.
|
|
43
|
+
* @defaultValue `item-${index}`
|
|
44
|
+
*/
|
|
35
45
|
value?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Make the item collapsible.
|
|
48
|
+
* Only works when `orientation` is `vertical`.
|
|
49
|
+
* @defaultValue true
|
|
50
|
+
*/
|
|
51
|
+
collapsible?: boolean;
|
|
36
52
|
children?: NavigationMenuChildItem[];
|
|
37
53
|
onSelect?(e: Event): void;
|
|
54
|
+
class?: any;
|
|
55
|
+
ui?: Pick<NavigationMenu['slots'], 'item' | 'linkLeadingAvatarSize' | 'linkLeadingAvatar' | 'linkLeadingIcon' | 'linkLabel' | 'linkLabelExternalIcon' | 'linkTrailing' | 'linkTrailingBadgeSize' | 'linkTrailingBadge' | 'linkTrailingIcon' | 'label' | 'link' | 'content' | 'childList' | 'childItem' | 'childLink' | 'childLinkIcon' | 'childLinkWrapper' | 'childLinkLabel' | 'childLinkLabelExternalIcon' | 'childLinkDescription'>;
|
|
38
56
|
[key: string]: any;
|
|
39
57
|
}
|
|
40
58
|
export interface NavigationMenuProps<T extends ArrayOrNested<NavigationMenuItem> = ArrayOrNested<NavigationMenuItem>> extends Pick<NavigationMenuRootProps, 'modelValue' | 'defaultValue' | 'delayDuration' | 'disableClickTrigger' | 'disableHoverTrigger' | 'skipDelayDuration' | 'disablePointerLeaveClose' | 'unmountOnHide'> {
|
|
@@ -123,32 +141,12 @@ export type NavigationMenuSlots<A extends ArrayOrNested<NavigationMenuItem> = Ar
|
|
|
123
141
|
active?: boolean;
|
|
124
142
|
}>;
|
|
125
143
|
declare const _default: <T extends ArrayOrNested<NavigationMenuItem>>(__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<{
|
|
126
|
-
props: __VLS_PrettifyLocal<
|
|
144
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
145
|
+
readonly "onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
146
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue"> & NavigationMenuProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
127
147
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
128
148
|
attrs: any;
|
|
129
|
-
slots:
|
|
130
|
-
item: SlotProps<NestedItem<T>>;
|
|
131
|
-
'item-leading': SlotProps<NestedItem<T>>;
|
|
132
|
-
'item-label': SlotProps<NestedItem<T>>;
|
|
133
|
-
'item-trailing': SlotProps<NestedItem<T>>;
|
|
134
|
-
'item-content': SlotProps<NestedItem<T>>;
|
|
135
|
-
'list-leading': (props?: {}) => any;
|
|
136
|
-
'list-trailing': (props?: {}) => any;
|
|
137
|
-
} & DynamicSlots<MergeTypes<NestedItem<T>>, "trailing" | "leading" | "content" | "label", {
|
|
138
|
-
index: number;
|
|
139
|
-
active?: boolean;
|
|
140
|
-
}>> & {
|
|
141
|
-
item: SlotProps<NestedItem<T>>;
|
|
142
|
-
'item-leading': SlotProps<NestedItem<T>>;
|
|
143
|
-
'item-label': SlotProps<NestedItem<T>>;
|
|
144
|
-
'item-trailing': SlotProps<NestedItem<T>>;
|
|
145
|
-
'item-content': SlotProps<NestedItem<T>>;
|
|
146
|
-
'list-leading': (props?: {}) => any;
|
|
147
|
-
'list-trailing': (props?: {}) => any;
|
|
148
|
-
} & DynamicSlots<MergeTypes<NestedItem<T>>, "trailing" | "leading" | "content" | "label", {
|
|
149
|
-
index: number;
|
|
150
|
-
active?: boolean;
|
|
151
|
-
}>;
|
|
149
|
+
slots: NavigationMenuSlots<T, NestedItem<T>>;
|
|
152
150
|
emit: (evt: "update:modelValue", value: string) => void;
|
|
153
151
|
}>) => import("vue").VNode & {
|
|
154
152
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
@@ -47,7 +47,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.pagination ||
|
|
|
47
47
|
</script>
|
|
48
48
|
|
|
49
49
|
<template>
|
|
50
|
-
<PaginationRoot v-slot="{ page, pageCount }" v-bind="rootProps" :class="ui.root({ class: [props.
|
|
50
|
+
<PaginationRoot v-slot="{ page, pageCount }" v-bind="rootProps" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
51
51
|
<PaginationList v-slot="{ items }" :class="ui.list({ class: props.ui?.list })">
|
|
52
52
|
<PaginationFirst v-if="showControls || !!slots.first" as-child :class="ui.first({ class: props.ui?.first })">
|
|
53
53
|
<slot name="first">
|
|
@@ -95,49 +95,25 @@ export interface PaginationSlots {
|
|
|
95
95
|
index: number;
|
|
96
96
|
}): any;
|
|
97
97
|
}
|
|
98
|
-
declare const _default:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
showControls: boolean;
|
|
105
|
-
showEdges: boolean;
|
|
106
|
-
itemsPerPage: number;
|
|
107
|
-
siblingCount: number;
|
|
108
|
-
total: number;
|
|
109
|
-
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {
|
|
110
|
-
size: "md" | "xs" | "sm" | "lg" | "xl";
|
|
98
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PaginationProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
99
|
+
"update:page": (value: number) => any;
|
|
100
|
+
}, string, import("vue").PublicProps, Readonly<PaginationProps> & Readonly<{
|
|
101
|
+
"onUpdate:page"?: ((value: number) => any) | undefined;
|
|
102
|
+
}>, {
|
|
103
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
111
104
|
color: "error" | "info" | "primary" | "secondary" | "success" | "warning" | "neutral";
|
|
112
|
-
variant: "link" | "solid" | "outline" | "soft" | "subtle" | "ghost";
|
|
113
105
|
activeColor: "error" | "info" | "primary" | "secondary" | "success" | "warning" | "neutral";
|
|
106
|
+
variant: "link" | "solid" | "outline" | "soft" | "subtle" | "ghost";
|
|
114
107
|
activeVariant: "link" | "solid" | "outline" | "soft" | "subtle" | "ghost";
|
|
115
108
|
itemsPerPage: number;
|
|
116
109
|
showEdges: boolean;
|
|
117
110
|
siblingCount: number;
|
|
118
111
|
total: number;
|
|
119
112
|
showControls: boolean;
|
|
120
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions,
|
|
113
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, PaginationSlots>;
|
|
121
114
|
export default _default;
|
|
122
|
-
type
|
|
123
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
124
|
-
default: D[K];
|
|
125
|
-
}> : P[K];
|
|
126
|
-
};
|
|
127
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
128
|
-
type __VLS_TypePropsToOption<T> = {
|
|
129
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
130
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
131
|
-
} : {
|
|
132
|
-
type: import('vue').PropType<T[K]>;
|
|
133
|
-
required: true;
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
115
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
137
116
|
new (): {
|
|
138
117
|
$slots: S;
|
|
139
118
|
};
|
|
140
119
|
};
|
|
141
|
-
type __VLS_PrettifyLocal<T> = {
|
|
142
|
-
[K in keyof T]: T[K];
|
|
143
|
-
} & {};
|
|
@@ -75,7 +75,7 @@ defineExpose({
|
|
|
75
75
|
v-bind="{ ...rootProps, ...ariaAttrs }"
|
|
76
76
|
:id="id"
|
|
77
77
|
:name="name"
|
|
78
|
-
:class="ui.root({ class: [props.
|
|
78
|
+
:class="ui.root({ class: [props.ui?.root, props.class] })"
|
|
79
79
|
@update:model-value="emitFormInput()"
|
|
80
80
|
@complete="onComplete"
|
|
81
81
|
>
|
|
@@ -37,32 +37,21 @@ export type PinInputEmits = PinInputRootEmits & {
|
|
|
37
37
|
change: [payload: Event];
|
|
38
38
|
blur: [payload: Event];
|
|
39
39
|
};
|
|
40
|
-
declare const _default: import("vue").DefineComponent<
|
|
41
|
-
type: string;
|
|
42
|
-
length: number;
|
|
43
|
-
autofocusDelay: number;
|
|
44
|
-
}>>, {
|
|
40
|
+
declare const _default: import("vue").DefineComponent<PinInputProps, {
|
|
45
41
|
inputsRef: import("vue").Ref<ComponentPublicInstance[], ComponentPublicInstance[]>;
|
|
46
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
42
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
43
|
+
blur: (payload: Event) => any;
|
|
44
|
+
complete: (value: string[]) => any;
|
|
45
|
+
change: (payload: Event) => any;
|
|
46
|
+
"update:modelValue": (value: string[]) => any;
|
|
47
|
+
}, string, import("vue").PublicProps, Readonly<PinInputProps> & Readonly<{
|
|
48
|
+
onBlur?: ((payload: Event) => any) | undefined;
|
|
49
|
+
onComplete?: ((value: string[]) => any) | undefined;
|
|
50
|
+
onChange?: ((payload: Event) => any) | undefined;
|
|
51
|
+
"onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
52
|
+
}>, {
|
|
47
53
|
length: number | string;
|
|
48
54
|
type: "text" | "number";
|
|
49
55
|
autofocusDelay: number;
|
|
50
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions,
|
|
56
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
51
57
|
export default _default;
|
|
52
|
-
type __VLS_WithDefaults<P, D> = {
|
|
53
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
54
|
-
default: D[K];
|
|
55
|
-
}> : P[K];
|
|
56
|
-
};
|
|
57
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
58
|
-
type __VLS_TypePropsToOption<T> = {
|
|
59
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
60
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
61
|
-
} : {
|
|
62
|
-
type: import('vue').PropType<T[K]>;
|
|
63
|
-
required: true;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
type __VLS_PrettifyLocal<T> = {
|
|
67
|
-
[K in keyof T]: T[K];
|
|
68
|
-
} & {};
|
|
@@ -42,39 +42,22 @@ export interface PopoverSlots {
|
|
|
42
42
|
}): any;
|
|
43
43
|
content(props?: {}): any;
|
|
44
44
|
}
|
|
45
|
-
declare const _default:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
45
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PopoverProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
46
|
+
"update:open": (value: boolean) => any;
|
|
47
|
+
"close:prevent": () => any;
|
|
48
|
+
}, string, import("vue").PublicProps, Readonly<PopoverProps> & Readonly<{
|
|
49
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
50
|
+
"onClose:prevent"?: (() => any) | undefined;
|
|
51
|
+
}>, {
|
|
52
52
|
mode: "click" | "hover";
|
|
53
53
|
portal: boolean | string | HTMLElement;
|
|
54
54
|
dismissible: boolean;
|
|
55
55
|
openDelay: number;
|
|
56
56
|
closeDelay: number;
|
|
57
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions,
|
|
57
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, PopoverSlots>;
|
|
58
58
|
export default _default;
|
|
59
|
-
type
|
|
60
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
61
|
-
default: D[K];
|
|
62
|
-
}> : P[K];
|
|
63
|
-
};
|
|
64
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
65
|
-
type __VLS_TypePropsToOption<T> = {
|
|
66
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
67
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
68
|
-
} : {
|
|
69
|
-
type: import('vue').PropType<T[K]>;
|
|
70
|
-
required: true;
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
59
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
74
60
|
new (): {
|
|
75
61
|
$slots: S;
|
|
76
62
|
};
|
|
77
63
|
};
|
|
78
|
-
type __VLS_PrettifyLocal<T> = {
|
|
79
|
-
[K in keyof T]: T[K];
|
|
80
|
-
} & {};
|
|
@@ -109,7 +109,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.progress || {
|
|
|
109
109
|
</script>
|
|
110
110
|
|
|
111
111
|
<template>
|
|
112
|
-
<Primitive :as="as" :class="ui.root({ class: [props.
|
|
112
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
113
113
|
<div v-if="!isIndeterminate && (status || !!slots.status)" :class="ui.status({ class: props.ui?.status })" :style="statusStyle">
|
|
114
114
|
<slot name="status" :percent="percent">
|
|
115
115
|
{{ percent }}%
|