@nuxt/ui 3.2.0 → 3.3.1
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/drawer.ts +1 -1
- package/.nuxt/ui/file-upload.ts +290 -0
- package/.nuxt/ui/index.ts +1 -0
- package/.nuxt/ui/input.ts +1 -1
- package/.nuxt/ui/kbd.ts +167 -3
- package/.nuxt/ui/select.ts +7 -7
- package/.nuxt/ui/table.ts +8 -0
- package/.nuxt/ui/tabs.ts +4 -2
- package/.nuxt/ui/textarea.ts +1 -1
- package/.nuxt/ui/toast.ts +8 -15
- package/.nuxt/ui/tooltip.ts +1 -1
- package/cli/templates.mjs +8 -3
- package/dist/module.d.mts +15 -1
- package/dist/module.json +2 -2
- 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 +5 -3
- 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 +5 -3
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +8 -5
- package/dist/runtime/components/FileUpload.vue +248 -0
- package/dist/runtime/components/FileUpload.vue.d.ts +167 -0
- package/dist/runtime/components/Form.vue +3 -3
- 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 +25 -13
- package/dist/runtime/components/InputMenu.vue.d.ts +16 -221
- package/dist/runtime/components/InputNumber.vue +3 -2
- package/dist/runtime/components/InputNumber.vue.d.ts +7 -81
- package/dist/runtime/components/InputTags.vue +2 -0
- package/dist/runtime/components/InputTags.vue.d.ts +7 -5
- 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 +3 -1
- package/dist/runtime/components/PinInput.vue.d.ts +5 -5
- 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 +16 -6
- package/dist/runtime/components/Select.vue.d.ts +3 -3
- package/dist/runtime/components/SelectMenu.vue +18 -10
- package/dist/runtime/components/SelectMenu.vue.d.ts +3 -3
- 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 +12 -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 +4 -3
- package/dist/runtime/components/Tooltip.vue.d.ts +8 -2
- package/dist/runtime/components/Tree.vue +31 -28
- package/dist/runtime/components/Tree.vue.d.ts +2 -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 +69 -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 +29 -2
- package/dist/runtime/composables/useOverlay.js +8 -7
- 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 +5 -1
- package/dist/runtime/locale/az.js +4 -0
- package/dist/runtime/locale/bg.js +4 -0
- package/dist/runtime/locale/bn.js +4 -0
- package/dist/runtime/locale/ca.js +4 -0
- package/dist/runtime/locale/ckb.js +5 -1
- package/dist/runtime/locale/cs.js +4 -0
- package/dist/runtime/locale/da.js +4 -0
- package/dist/runtime/locale/de.js +4 -0
- package/dist/runtime/locale/el.js +4 -0
- package/dist/runtime/locale/en.js +4 -0
- package/dist/runtime/locale/es.js +4 -0
- package/dist/runtime/locale/et.js +4 -0
- package/dist/runtime/locale/fa_ir.js +4 -0
- package/dist/runtime/locale/fi.js +4 -0
- package/dist/runtime/locale/fr.js +4 -0
- package/dist/runtime/locale/he.js +4 -0
- package/dist/runtime/locale/hi.js +5 -1
- package/dist/runtime/locale/hu.js +4 -0
- package/dist/runtime/locale/hy.js +4 -0
- package/dist/runtime/locale/id.js +4 -0
- package/dist/runtime/locale/it.js +4 -0
- package/dist/runtime/locale/ja.js +4 -0
- package/dist/runtime/locale/kk.js +4 -0
- package/dist/runtime/locale/km.js +5 -1
- package/dist/runtime/locale/ko.js +4 -0
- package/dist/runtime/locale/ky.js +4 -0
- package/dist/runtime/locale/lb.js +4 -0
- package/dist/runtime/locale/lt.js +4 -0
- package/dist/runtime/locale/mn.js +4 -0
- package/dist/runtime/locale/ms.js +4 -0
- package/dist/runtime/locale/nb_no.js +4 -0
- package/dist/runtime/locale/nl.js +4 -0
- package/dist/runtime/locale/pl.js +4 -0
- package/dist/runtime/locale/pt.js +4 -0
- package/dist/runtime/locale/pt_br.js +4 -0
- package/dist/runtime/locale/ro.js +4 -0
- package/dist/runtime/locale/ru.js +4 -0
- package/dist/runtime/locale/sk.js +4 -0
- package/dist/runtime/locale/sl.js +4 -0
- package/dist/runtime/locale/sv.js +4 -0
- package/dist/runtime/locale/th.js +4 -0
- package/dist/runtime/locale/tj.js +4 -0
- package/dist/runtime/locale/tr.js +4 -0
- package/dist/runtime/locale/ug_cn.js +4 -0
- package/dist/runtime/locale/uk.js +4 -0
- package/dist/runtime/locale/ur.js +4 -0
- package/dist/runtime/locale/uz.js +4 -0
- package/dist/runtime/locale/vi.js +4 -0
- package/dist/runtime/locale/zh_cn.js +4 -0
- package/dist/runtime/locale/zh_tw.js +4 -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 +4 -0
- package/dist/runtime/utils/index.d.ts +6 -0
- package/dist/runtime/utils/index.js +27 -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.BTUFJHYJ.mjs} +299 -36
- package/dist/unplugin.d.mts +2 -0
- package/dist/unplugin.mjs +6 -3
- package/dist/vite.mjs +1 -1
- package/package.json +31 -27
|
@@ -6,7 +6,7 @@ import theme from "#build/ui/carousel";
|
|
|
6
6
|
import { computed, ref, watch, onMounted } from "vue";
|
|
7
7
|
import useEmblaCarousel from "embla-carousel-vue";
|
|
8
8
|
import { Primitive, useForwardProps } from "reka-ui";
|
|
9
|
-
import { reactivePick
|
|
9
|
+
import { reactivePick } from "@vueuse/core";
|
|
10
10
|
import { useAppConfig } from "#imports";
|
|
11
11
|
import { useLocale } from "../composables/useLocale";
|
|
12
12
|
import { tv } from "../utils/tv";
|
|
@@ -62,34 +62,36 @@ const options = computed(() => ({
|
|
|
62
62
|
axis: props.orientation === "horizontal" ? "x" : "y",
|
|
63
63
|
direction: dir.value === "rtl" ? "rtl" : "ltr"
|
|
64
64
|
}));
|
|
65
|
-
const plugins =
|
|
66
|
-
|
|
65
|
+
const plugins = ref([]);
|
|
66
|
+
async function loadPlugins() {
|
|
67
|
+
const emblaPlugins = [];
|
|
67
68
|
if (props.autoplay) {
|
|
68
69
|
const AutoplayPlugin = await import("embla-carousel-autoplay").then((r) => r.default);
|
|
69
|
-
|
|
70
|
+
emblaPlugins.push(AutoplayPlugin(typeof props.autoplay === "boolean" ? {} : props.autoplay));
|
|
70
71
|
}
|
|
71
72
|
if (props.autoScroll) {
|
|
72
73
|
const AutoScrollPlugin = await import("embla-carousel-auto-scroll").then((r) => r.default);
|
|
73
|
-
|
|
74
|
+
emblaPlugins.push(AutoScrollPlugin(typeof props.autoScroll === "boolean" ? {} : props.autoScroll));
|
|
74
75
|
}
|
|
75
76
|
if (props.autoHeight) {
|
|
76
77
|
const AutoHeightPlugin = await import("embla-carousel-auto-height").then((r) => r.default);
|
|
77
|
-
|
|
78
|
+
emblaPlugins.push(AutoHeightPlugin(typeof props.autoHeight === "boolean" ? {} : props.autoHeight));
|
|
78
79
|
}
|
|
79
80
|
if (props.classNames) {
|
|
80
81
|
const ClassNamesPlugin = await import("embla-carousel-class-names").then((r) => r.default);
|
|
81
|
-
|
|
82
|
+
emblaPlugins.push(ClassNamesPlugin(typeof props.classNames === "boolean" ? {} : props.classNames));
|
|
82
83
|
}
|
|
83
84
|
if (props.fade) {
|
|
84
85
|
const FadePlugin = await import("embla-carousel-fade").then((r) => r.default);
|
|
85
|
-
|
|
86
|
+
emblaPlugins.push(FadePlugin(typeof props.fade === "boolean" ? {} : props.fade));
|
|
86
87
|
}
|
|
87
88
|
if (props.wheelGestures) {
|
|
88
89
|
const { WheelGesturesPlugin } = await import("embla-carousel-wheel-gestures");
|
|
89
|
-
|
|
90
|
+
emblaPlugins.push(WheelGesturesPlugin(typeof props.wheelGestures === "boolean" ? {} : props.wheelGestures));
|
|
90
91
|
}
|
|
91
|
-
|
|
92
|
-
}
|
|
92
|
+
plugins.value = emblaPlugins;
|
|
93
|
+
}
|
|
94
|
+
watch(() => [props.autoplay, props.autoScroll, props.autoHeight, props.classNames, props.fade, props.wheelGestures], loadPlugins, { immediate: true });
|
|
93
95
|
const [emblaRef, emblaApi] = useEmblaCarousel(options.value, plugins.value);
|
|
94
96
|
watch([options, plugins], () => {
|
|
95
97
|
emblaApi.value?.reInit(options.value, plugins.value);
|
|
@@ -162,8 +164,7 @@ defineExpose({
|
|
|
162
164
|
<div
|
|
163
165
|
v-for="(item, index) in items"
|
|
164
166
|
:key="index"
|
|
165
|
-
|
|
166
|
-
aria-roledescription="slide"
|
|
167
|
+
v-bind="dots ? { role: 'tabpanel' } : { 'role': 'group', 'aria-roledescription': 'slide' }"
|
|
167
168
|
:class="ui.item({ class: [props.ui?.item, isCarouselItem(item) && item.ui?.item, isCarouselItem(item) && item.class] })"
|
|
168
169
|
>
|
|
169
170
|
<slot :item="item" :index="index" />
|
|
@@ -195,10 +196,13 @@ defineExpose({
|
|
|
195
196
|
/>
|
|
196
197
|
</div>
|
|
197
198
|
|
|
198
|
-
<div v-if="dots" :class="ui.dots({ class: props.ui?.dots })">
|
|
199
|
+
<div v-if="dots" role="tablist" :aria-label="t('carousel.dots')" :class="ui.dots({ class: props.ui?.dots })">
|
|
199
200
|
<template v-for="(_, index) in scrollSnaps" :key="index">
|
|
200
201
|
<button
|
|
202
|
+
type="button"
|
|
203
|
+
role="tab"
|
|
201
204
|
:aria-label="t('carousel.goto', { slide: index + 1 })"
|
|
205
|
+
:aria-selected="selectedIndex === index"
|
|
202
206
|
:class="ui.dot({ class: props.ui?.dot, active: selectedIndex === index })"
|
|
203
207
|
:data-state="selectedIndex === index ? 'active' : void 0"
|
|
204
208
|
@click="scrollTo(index)"
|
|
@@ -56,7 +56,7 @@ export interface CheckboxSlots {
|
|
|
56
56
|
}
|
|
57
57
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<CheckboxProps & {
|
|
58
58
|
modelValue?: boolean | "indeterminate";
|
|
59
|
-
},
|
|
59
|
+
}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
60
60
|
change: (payload: Event) => any;
|
|
61
61
|
"update:modelValue": (value: boolean | "indeterminate") => any;
|
|
62
62
|
}, string, import("vue").PublicProps, Readonly<CheckboxProps & {
|
|
@@ -31,7 +31,7 @@ export interface ChipProps {
|
|
|
31
31
|
ui?: Chip['slots'];
|
|
32
32
|
}
|
|
33
33
|
export interface ChipEmits {
|
|
34
|
-
|
|
34
|
+
'update:show': [payload: boolean];
|
|
35
35
|
}
|
|
36
36
|
export interface ChipSlots {
|
|
37
37
|
default(props?: {}): any;
|
|
@@ -39,7 +39,7 @@ export interface ChipSlots {
|
|
|
39
39
|
}
|
|
40
40
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ChipProps & {
|
|
41
41
|
show?: boolean;
|
|
42
|
-
},
|
|
42
|
+
}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
43
43
|
"update:show": (value: boolean) => any;
|
|
44
44
|
}, string, import("vue").PublicProps, Readonly<ChipProps & {
|
|
45
45
|
show?: boolean;
|
|
@@ -20,7 +20,7 @@ export interface CollapsibleSlots {
|
|
|
20
20
|
}): any;
|
|
21
21
|
content(props?: {}): any;
|
|
22
22
|
}
|
|
23
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<CollapsibleProps,
|
|
23
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<CollapsibleProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
24
24
|
"update:open": (value: boolean) => any;
|
|
25
25
|
}, string, import("vue").PublicProps, Readonly<CollapsibleProps> & Readonly<{
|
|
26
26
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
@@ -14,7 +14,7 @@ function HSVtoHSL(hsv) {
|
|
|
14
14
|
return {
|
|
15
15
|
H: hsv.h,
|
|
16
16
|
S: x === 0 || x === 200 ? 0 : Math.round(hsv.s * hsv.v / (x <= 100 ? x : 200 - x)),
|
|
17
|
-
L:
|
|
17
|
+
L: x / 2
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
</script>
|
|
@@ -53,7 +53,6 @@ const pickedColor = computed({
|
|
|
53
53
|
},
|
|
54
54
|
set(value) {
|
|
55
55
|
const color = new ColorTranslator(HSVtoHSL(value), {
|
|
56
|
-
decimals: 2,
|
|
57
56
|
labUnit: "percent",
|
|
58
57
|
cmykUnit: "percent",
|
|
59
58
|
cmykFunction: "cmyk"
|
|
@@ -34,7 +34,7 @@ export type ColorPickerProps = {
|
|
|
34
34
|
};
|
|
35
35
|
declare const _default: import("vue").DefineComponent<ColorPickerProps & {
|
|
36
36
|
modelValue?: string;
|
|
37
|
-
},
|
|
37
|
+
}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
38
38
|
"update:modelValue": (value: string | undefined) => any;
|
|
39
39
|
}, string, import("vue").PublicProps, Readonly<ColorPickerProps & {
|
|
40
40
|
modelValue?: string;
|
|
@@ -142,6 +142,11 @@ export type CommandPaletteSlots<G extends CommandPaletteGroup<T> = CommandPalett
|
|
|
142
142
|
'empty'(props: {
|
|
143
143
|
searchTerm?: string;
|
|
144
144
|
}): any;
|
|
145
|
+
'footer'(props: {
|
|
146
|
+
ui: {
|
|
147
|
+
[K in keyof Required<CommandPalette['slots']>]: (props?: Record<string, any>) => string;
|
|
148
|
+
};
|
|
149
|
+
}): any;
|
|
145
150
|
'back'(props: {
|
|
146
151
|
ui: {
|
|
147
152
|
[K in keyof Required<CommandPalette['slots']>]: (props?: Record<string, any>) => string;
|
|
@@ -183,5 +188,5 @@ declare const _default: <G extends CommandPaletteGroup<T>, T extends CommandPale
|
|
|
183
188
|
};
|
|
184
189
|
export default _default;
|
|
185
190
|
type __VLS_PrettifyLocal<T> = {
|
|
186
|
-
[K in keyof T]: T[K];
|
|
191
|
+
[K in keyof T as K]: T[K];
|
|
187
192
|
} & {};
|
|
@@ -9,7 +9,7 @@ export interface ContainerProps {
|
|
|
9
9
|
export interface ContainerSlots {
|
|
10
10
|
default(props?: {}): any;
|
|
11
11
|
}
|
|
12
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ContainerProps,
|
|
12
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ContainerProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ContainerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ContainerSlots>;
|
|
13
13
|
export default _default;
|
|
14
14
|
type __VLS_WithSlots<T, S> = T & {
|
|
15
15
|
new (): {
|
|
@@ -30,7 +30,9 @@ const props = defineProps({
|
|
|
30
30
|
ui: { type: null, required: true },
|
|
31
31
|
uiOverride: { type: null, required: false },
|
|
32
32
|
loop: { type: Boolean, required: false },
|
|
33
|
+
sideFlip: { type: Boolean, required: false },
|
|
33
34
|
alignOffset: { type: Number, required: false },
|
|
35
|
+
alignFlip: { type: Boolean, required: false },
|
|
34
36
|
avoidCollisions: { type: Boolean, required: false },
|
|
35
37
|
collisionBoundary: { type: null, required: false },
|
|
36
38
|
collisionPadding: { type: [Number, Object], required: false },
|
|
@@ -61,7 +63,7 @@ const groups = computed(
|
|
|
61
63
|
<slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="item" :active="active" :index="index">
|
|
62
64
|
<UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: [uiOverride?.itemLeadingIcon, item.ui?.itemLeadingIcon], color: item?.color, loading: true })" />
|
|
63
65
|
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: [uiOverride?.itemLeadingIcon, item.ui?.itemLeadingIcon], color: item?.color, active })" />
|
|
64
|
-
<UAvatar v-else-if="item.avatar" :size="item.ui?.itemLeadingAvatarSize ||
|
|
66
|
+
<UAvatar v-else-if="item.avatar" :size="item.ui?.itemLeadingAvatarSize || uiOverride?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: [uiOverride?.itemLeadingAvatar, item.ui?.itemLeadingAvatar], active })" />
|
|
65
67
|
</slot>
|
|
66
68
|
|
|
67
69
|
<span v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.itemLabel({ class: [uiOverride?.itemLabel, item.ui?.itemLabel], active })">
|
|
@@ -76,7 +78,7 @@ const groups = computed(
|
|
|
76
78
|
<slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="active" :index="index">
|
|
77
79
|
<UIcon v-if="item.children?.length" :name="childrenIcon" :class="ui.itemTrailingIcon({ class: [uiOverride?.itemTrailingIcon, item.ui?.itemTrailingIcon], color: item?.color, active })" />
|
|
78
80
|
<span v-else-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: [uiOverride?.itemTrailingKbds, item.ui?.itemTrailingKbds] })">
|
|
79
|
-
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="item.ui?.itemTrailingKbdsSize ||
|
|
81
|
+
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="item.ui?.itemTrailingKbdsSize || uiOverride?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
80
82
|
</span>
|
|
81
83
|
</slot>
|
|
82
84
|
|
|
@@ -91,7 +93,7 @@ const groups = computed(
|
|
|
91
93
|
<component :is="sub ? ContextMenu.SubContent : ContextMenu.Content" :class="props.class" v-bind="contentProps">
|
|
92
94
|
<slot name="content-top" />
|
|
93
95
|
|
|
94
|
-
<div role="presentation" :class="ui.viewport({ class:
|
|
96
|
+
<div role="presentation" :class="ui.viewport({ class: uiOverride?.viewport })">
|
|
95
97
|
<ContextMenu.Group v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" :class="ui.group({ class: uiOverride?.group })">
|
|
96
98
|
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
97
99
|
<ContextMenu.Label v-if="item.type === 'label'" :class="ui.label({ class: [uiOverride?.label, item.ui?.label, item.class] })">
|
|
@@ -5,7 +5,7 @@ import theme from "#build/ui/drawer";
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed, toRef } from "vue";
|
|
7
7
|
import { VisuallyHidden, useForwardPropsEmits } from "reka-ui";
|
|
8
|
-
import { DrawerRoot, DrawerTrigger, DrawerPortal, DrawerOverlay, DrawerContent, DrawerTitle, DrawerDescription, DrawerHandle } from "vaul-vue";
|
|
8
|
+
import { DrawerRoot, DrawerRootNested, DrawerTrigger, DrawerPortal, DrawerOverlay, DrawerContent, DrawerTitle, DrawerDescription, DrawerHandle } from "vaul-vue";
|
|
9
9
|
import { reactivePick } from "@vueuse/core";
|
|
10
10
|
import { useAppConfig } from "#imports";
|
|
11
11
|
import { usePortal } from "../composables/usePortal";
|
|
@@ -19,6 +19,7 @@ const props = defineProps({
|
|
|
19
19
|
overlay: { type: Boolean, required: false, default: true },
|
|
20
20
|
handle: { type: Boolean, required: false, default: true },
|
|
21
21
|
portal: { type: [Boolean, String], required: false, skipCheck: true, default: true },
|
|
22
|
+
nested: { type: Boolean, required: false },
|
|
22
23
|
class: { type: null, required: false },
|
|
23
24
|
ui: { type: null, required: false },
|
|
24
25
|
activeSnapPoint: { type: [Number, String, null], required: false },
|
|
@@ -31,7 +32,6 @@ const props = defineProps({
|
|
|
31
32
|
modal: { type: Boolean, required: false, default: true },
|
|
32
33
|
open: { type: Boolean, required: false },
|
|
33
34
|
defaultOpen: { type: Boolean, required: false },
|
|
34
|
-
nested: { type: Boolean, required: false },
|
|
35
35
|
direction: { type: String, required: false, default: "bottom" },
|
|
36
36
|
noBodyStyles: { type: Boolean, required: false },
|
|
37
37
|
handleOnly: { type: Boolean, required: false },
|
|
@@ -54,7 +54,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.drawer || {}
|
|
|
54
54
|
</script>
|
|
55
55
|
|
|
56
56
|
<template>
|
|
57
|
-
<DrawerRoot v-bind="rootProps">
|
|
57
|
+
<component :is="nested ? DrawerRootNested : DrawerRoot" v-bind="rootProps">
|
|
58
58
|
<DrawerTrigger v-if="!!slots.default" as-child :class="props.class">
|
|
59
59
|
<slot />
|
|
60
60
|
</DrawerTrigger>
|
|
@@ -108,5 +108,5 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.drawer || {}
|
|
|
108
108
|
</slot>
|
|
109
109
|
</DrawerContent>
|
|
110
110
|
</DrawerPortal>
|
|
111
|
-
</
|
|
111
|
+
</component>
|
|
112
112
|
</template>
|
|
@@ -34,6 +34,11 @@ export interface DrawerProps extends Pick<DrawerRootProps, 'activeSnapPoint' | '
|
|
|
34
34
|
* @defaultValue true
|
|
35
35
|
*/
|
|
36
36
|
portal?: boolean | string | HTMLElement;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the drawer is nested in another drawer.
|
|
39
|
+
* @defaultValue false
|
|
40
|
+
*/
|
|
41
|
+
nested?: boolean;
|
|
37
42
|
class?: any;
|
|
38
43
|
ui?: Drawer['slots'];
|
|
39
44
|
}
|
|
@@ -48,7 +53,7 @@ export interface DrawerSlots {
|
|
|
48
53
|
body(props?: {}): any;
|
|
49
54
|
footer(props?: {}): any;
|
|
50
55
|
}
|
|
51
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<DrawerProps,
|
|
56
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<DrawerProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
52
57
|
close: () => any;
|
|
53
58
|
drag: (percentageDragged: number) => any;
|
|
54
59
|
"update:open": (open: boolean) => any;
|
|
@@ -32,8 +32,10 @@ const props = defineProps({
|
|
|
32
32
|
loop: { type: Boolean, required: false },
|
|
33
33
|
side: { type: null, required: false },
|
|
34
34
|
sideOffset: { type: Number, required: false },
|
|
35
|
+
sideFlip: { type: Boolean, required: false },
|
|
35
36
|
align: { type: null, required: false },
|
|
36
37
|
alignOffset: { type: Number, required: false },
|
|
38
|
+
alignFlip: { type: Boolean, required: false },
|
|
37
39
|
avoidCollisions: { type: Boolean, required: false },
|
|
38
40
|
collisionBoundary: { type: null, required: false },
|
|
39
41
|
collisionPadding: { type: [Number, Object], required: false },
|
|
@@ -66,7 +68,7 @@ const groups = computed(
|
|
|
66
68
|
<slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="item" :active="active" :index="index">
|
|
67
69
|
<UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: [uiOverride?.itemLeadingIcon, item.ui?.itemLeadingIcon], color: item?.color, loading: true })" />
|
|
68
70
|
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: [uiOverride?.itemLeadingIcon, item.ui?.itemLeadingIcon], color: item?.color, active })" />
|
|
69
|
-
<UAvatar v-else-if="item.avatar" :size="item.ui?.itemLeadingAvatarSize ||
|
|
71
|
+
<UAvatar v-else-if="item.avatar" :size="item.ui?.itemLeadingAvatarSize || uiOverride?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: [uiOverride?.itemLeadingAvatar, item.ui?.itemLeadingAvatar], active })" />
|
|
70
72
|
</slot>
|
|
71
73
|
|
|
72
74
|
<span v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.itemLabel({ class: [uiOverride?.itemLabel, item.ui?.itemLabel], active })">
|
|
@@ -81,7 +83,7 @@ const groups = computed(
|
|
|
81
83
|
<slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="active" :index="index">
|
|
82
84
|
<UIcon v-if="item.children?.length" :name="childrenIcon" :class="ui.itemTrailingIcon({ class: [uiOverride?.itemTrailingIcon, item.ui?.itemTrailingIcon], color: item?.color, active })" />
|
|
83
85
|
<span v-else-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: [uiOverride?.itemTrailingKbds, item.ui?.itemTrailingKbds] })">
|
|
84
|
-
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="item.ui?.itemTrailingKbdsSize ||
|
|
86
|
+
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="item.ui?.itemTrailingKbdsSize || uiOverride?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
85
87
|
</span>
|
|
86
88
|
</slot>
|
|
87
89
|
|
|
@@ -96,7 +98,7 @@ const groups = computed(
|
|
|
96
98
|
<component :is="sub ? DropdownMenu.SubContent : DropdownMenu.Content" :class="props.class" v-bind="contentProps">
|
|
97
99
|
<slot name="content-top" />
|
|
98
100
|
|
|
99
|
-
<div role="presentation" :class="ui.viewport({ class:
|
|
101
|
+
<div role="presentation" :class="ui.viewport({ class: uiOverride?.viewport })">
|
|
100
102
|
<DropdownMenu.Group v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" :class="ui.group({ class: uiOverride?.group })">
|
|
101
103
|
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
102
104
|
<DropdownMenu.Label v-if="item.type === 'label'" :class="ui.label({ class: [uiOverride?.label, item.ui?.label, item.class] })">
|
|
@@ -2,7 +2,7 @@ import { DropdownMenu } from 'reka-ui/namespaced';
|
|
|
2
2
|
import type { DropdownMenuContentProps as RekaDropdownMenuContentProps } from 'reka-ui';
|
|
3
3
|
import type { AppConfig } from '@nuxt/schema';
|
|
4
4
|
import type theme from '#build/ui/dropdown-menu';
|
|
5
|
-
import type { DropdownMenuItem, DropdownMenuSlots } from '../types';
|
|
5
|
+
import type { DropdownMenuItem, DropdownMenuSlots, DynamicSlots, MergeTypes } from '../types';
|
|
6
6
|
import type { ArrayOrNested, NestedItem, ComponentConfig } from '../types/utils';
|
|
7
7
|
type DropdownMenu = ComponentConfig<typeof theme, AppConfig, 'dropdownMenu'>;
|
|
8
8
|
interface DropdownMenuContentProps<T extends ArrayOrNested<DropdownMenuItem>> extends Omit<RekaDropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> {
|
|
@@ -28,9 +28,12 @@ interface DropdownMenuContentProps<T extends ArrayOrNested<DropdownMenuItem>> ex
|
|
|
28
28
|
};
|
|
29
29
|
uiOverride?: DropdownMenu['slots'];
|
|
30
30
|
}
|
|
31
|
-
type DropdownMenuContentSlots<
|
|
31
|
+
type DropdownMenuContentSlots<A extends ArrayOrNested<DropdownMenuItem> = ArrayOrNested<DropdownMenuItem>, T extends NestedItem<A> = NestedItem<A>> = Pick<DropdownMenuSlots<A>, 'item' | 'item-leading' | 'item-label' | 'item-trailing' | 'content-top' | 'content-bottom'> & {
|
|
32
32
|
default(props?: {}): any;
|
|
33
|
-
}
|
|
33
|
+
} & DynamicSlots<MergeTypes<T>, 'leading' | 'label' | 'trailing', {
|
|
34
|
+
active?: boolean;
|
|
35
|
+
index: number;
|
|
36
|
+
}>;
|
|
34
37
|
declare const _default: <T extends ArrayOrNested<DropdownMenuItem>>(__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<{
|
|
35
38
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
36
39
|
readonly onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
@@ -41,12 +44,12 @@ declare const _default: <T extends ArrayOrNested<DropdownMenuItem>>(__VLS_props:
|
|
|
41
44
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onEscapeKeyDown" | "onPointerDownOutside" | "onFocusOutside" | "onInteractOutside" | "onCloseAutoFocus"> & DropdownMenuContentProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
42
45
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
43
46
|
attrs: any;
|
|
44
|
-
slots: DropdownMenuContentSlots<T
|
|
47
|
+
slots: DropdownMenuContentSlots<T, NestedItem<T>>;
|
|
45
48
|
emit: ((evt: "escapeKeyDown", event: KeyboardEvent) => void) & ((evt: "pointerDownOutside", event: import("reka-ui").PointerDownOutsideEvent) => void) & ((evt: "focusOutside", event: import("reka-ui").FocusOutsideEvent) => void) & ((evt: "interactOutside", event: import("reka-ui").PointerDownOutsideEvent | import("reka-ui").FocusOutsideEvent) => void) & ((evt: "closeAutoFocus", event: Event) => void);
|
|
46
49
|
}>) => import("vue").VNode & {
|
|
47
50
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
48
51
|
};
|
|
49
52
|
export default _default;
|
|
50
53
|
type __VLS_PrettifyLocal<T> = {
|
|
51
|
-
[K in keyof T]: T[K];
|
|
54
|
+
[K in keyof T as K]: T[K];
|
|
52
55
|
} & {};
|