@nuxt/ui 3.3.4 → 3.3.6
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/drawer.ts +23 -0
- package/.nuxt/ui/progress.ts +3 -3
- package/README.md +10 -10
- package/dist/module.d.mts +6 -6
- package/dist/module.json +2 -2
- package/dist/module.mjs +3 -3
- package/dist/runtime/components/Accordion.d.vue.ts +78 -0
- package/dist/runtime/components/Accordion.vue.d.ts +6 -5
- package/dist/runtime/components/Alert.d.vue.ts +82 -0
- package/dist/runtime/components/Alert.vue.d.ts +2 -1
- package/dist/runtime/components/App.d.vue.ts +25 -0
- package/dist/runtime/components/App.vue +1 -1
- package/dist/runtime/components/App.vue.d.ts +5 -4
- package/dist/runtime/components/Avatar.d.vue.ts +42 -0
- package/dist/runtime/components/Avatar.vue.d.ts +2 -1
- package/dist/runtime/components/AvatarGroup.d.vue.ts +32 -0
- package/dist/runtime/components/AvatarGroup.vue.d.ts +2 -1
- package/dist/runtime/components/Badge.d.vue.ts +44 -0
- package/dist/runtime/components/Badge.vue.d.ts +2 -1
- package/dist/runtime/components/Breadcrumb.d.vue.ts +67 -0
- package/dist/runtime/components/Breadcrumb.vue.d.ts +4 -3
- package/dist/runtime/components/Button.d.vue.ts +45 -0
- package/dist/runtime/components/Button.vue.d.ts +2 -1
- package/dist/runtime/components/ButtonGroup.d.vue.ts +35 -0
- package/dist/runtime/components/ButtonGroup.vue.d.ts +2 -1
- package/dist/runtime/components/Calendar.d.vue.ts +113 -0
- package/dist/runtime/components/Calendar.vue.d.ts +9 -8
- package/dist/runtime/components/Card.d.vue.ts +30 -0
- package/dist/runtime/components/Card.vue.d.ts +2 -1
- package/dist/runtime/components/Carousel.d.vue.ts +128 -0
- package/dist/runtime/components/Carousel.vue +32 -12
- package/dist/runtime/components/Carousel.vue.d.ts +7 -6
- package/dist/runtime/components/Checkbox.d.vue.ts +74 -0
- package/dist/runtime/components/Checkbox.vue.d.ts +2 -1
- package/dist/runtime/components/CheckboxGroup.d.vue.ts +85 -0
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +7 -6
- package/dist/runtime/components/Chip.d.vue.ts +58 -0
- package/dist/runtime/components/Chip.vue.d.ts +2 -1
- package/dist/runtime/components/Collapsible.d.vue.ts +36 -0
- package/dist/runtime/components/Collapsible.vue.d.ts +2 -1
- package/dist/runtime/components/ColorPicker.d.vue.ts +49 -0
- package/dist/runtime/components/ColorPicker.vue.d.ts +2 -1
- package/dist/runtime/components/CommandPalette.d.vue.ts +193 -0
- package/dist/runtime/components/CommandPalette.vue.d.ts +13 -12
- package/dist/runtime/components/Container.d.vue.ts +19 -0
- package/dist/runtime/components/Container.vue.d.ts +2 -1
- package/dist/runtime/components/ContextMenu.d.vue.ts +110 -0
- package/dist/runtime/components/ContextMenu.vue.d.ts +6 -5
- package/dist/runtime/components/ContextMenuContent.d.vue.ts +50 -0
- package/dist/runtime/components/ContextMenuContent.vue.d.ts +10 -9
- package/dist/runtime/components/Drawer.d.vue.ts +87 -0
- package/dist/runtime/components/Drawer.vue +19 -5
- package/dist/runtime/components/Drawer.vue.d.ts +5 -1
- package/dist/runtime/components/DropdownMenu.d.vue.ts +120 -0
- package/dist/runtime/components/DropdownMenu.vue.d.ts +6 -5
- package/dist/runtime/components/DropdownMenuContent.d.vue.ts +56 -0
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +10 -9
- package/dist/runtime/components/FileUpload.d.vue.ts +167 -0
- package/dist/runtime/components/FileUpload.vue.d.ts +9 -8
- package/dist/runtime/components/Form.d.vue.ts +72 -0
- package/dist/runtime/components/Form.vue.d.ts +7 -6
- package/dist/runtime/components/FormField.d.vue.ts +62 -0
- package/dist/runtime/components/FormField.vue.d.ts +2 -1
- package/dist/runtime/components/Icon.d.vue.ts +9 -0
- package/dist/runtime/components/Icon.vue.d.ts +2 -1
- package/dist/runtime/components/Input.d.vue.ts +78 -0
- package/dist/runtime/components/Input.vue.d.ts +9 -8
- package/dist/runtime/components/InputMenu.d.vue.ts +330 -0
- package/dist/runtime/components/InputMenu.vue +1 -1
- package/dist/runtime/components/InputMenu.vue.d.ts +19 -24
- package/dist/runtime/components/InputNumber.d.vue.ts +187 -0
- package/dist/runtime/components/InputNumber.vue.d.ts +2 -1
- package/dist/runtime/components/InputTags.d.vue.ts +186 -0
- package/dist/runtime/components/InputTags.vue +2 -2
- package/dist/runtime/components/InputTags.vue.d.ts +13 -12
- package/dist/runtime/components/Kbd.d.vue.ts +39 -0
- package/dist/runtime/components/Kbd.vue.d.ts +2 -1
- package/dist/runtime/components/Link.d.vue.ts +92 -0
- package/dist/runtime/components/Link.vue.d.ts +2 -1
- package/dist/runtime/components/LinkBase.d.vue.ts +26 -0
- package/dist/runtime/components/LinkBase.vue.d.ts +2 -1
- package/dist/runtime/components/Modal.d.vue.ts +107 -0
- package/dist/runtime/components/Modal.vue.d.ts +4 -3
- package/dist/runtime/components/NavigationMenu.d.vue.ts +171 -0
- package/dist/runtime/components/NavigationMenu.vue.d.ts +6 -5
- package/dist/runtime/components/OverlayProvider.d.vue.ts +3 -0
- package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -1
- package/dist/runtime/components/Pagination.d.vue.ts +119 -0
- package/dist/runtime/components/Pagination.vue +4 -4
- package/dist/runtime/components/Pagination.vue.d.ts +2 -1
- package/dist/runtime/components/PinInput.d.vue.ts +61 -0
- package/dist/runtime/components/PinInput.vue.d.ts +10 -9
- package/dist/runtime/components/Popover.d.vue.ts +71 -0
- package/dist/runtime/components/Popover.vue.d.ts +2 -1
- package/dist/runtime/components/Progress.d.vue.ts +67 -0
- package/dist/runtime/components/Progress.vue +2 -3
- package/dist/runtime/components/Progress.vue.d.ts +2 -1
- package/dist/runtime/components/RadioGroup.d.vue.ts +95 -0
- package/dist/runtime/components/RadioGroup.vue.d.ts +7 -6
- package/dist/runtime/components/Select.d.vue.ts +254 -0
- package/dist/runtime/components/Select.vue.d.ts +11 -10
- package/dist/runtime/components/SelectMenu.d.vue.ts +303 -0
- package/dist/runtime/components/SelectMenu.vue.d.ts +16 -15
- package/dist/runtime/components/Separator.d.vue.ts +55 -0
- package/dist/runtime/components/Separator.vue.d.ts +2 -1
- package/dist/runtime/components/Skeleton.d.vue.ts +18 -0
- package/dist/runtime/components/Skeleton.vue.d.ts +2 -1
- package/dist/runtime/components/Slideover.d.vue.ts +108 -0
- package/dist/runtime/components/Slideover.vue.d.ts +4 -3
- package/dist/runtime/components/Slider.d.vue.ts +58 -0
- package/dist/runtime/components/Slider.vue.d.ts +8 -7
- package/dist/runtime/components/Stepper.d.vue.ts +86 -0
- package/dist/runtime/components/Stepper.vue.d.ts +10 -9
- package/dist/runtime/components/Switch.d.vue.ts +71 -0
- package/dist/runtime/components/Switch.vue.d.ts +2 -1
- package/dist/runtime/components/Table.d.vue.ts +202 -0
- package/dist/runtime/components/Table.vue +19 -1
- package/dist/runtime/components/Table.vue.d.ts +20 -19
- package/dist/runtime/components/Tabs.d.vue.ts +99 -0
- package/dist/runtime/components/Tabs.vue +2 -2
- package/dist/runtime/components/Tabs.vue.d.ts +7 -6
- package/dist/runtime/components/Textarea.d.vue.ts +80 -0
- package/dist/runtime/components/Textarea.vue.d.ts +9 -8
- package/dist/runtime/components/Timeline.d.vue.ts +71 -0
- package/dist/runtime/components/Timeline.vue.d.ts +7 -6
- package/dist/runtime/components/Toast.d.vue.ts +165 -0
- package/dist/runtime/components/Toast.vue.d.ts +2 -1
- package/dist/runtime/components/Toaster.d.vue.ts +45 -0
- package/dist/runtime/components/Toaster.vue.d.ts +2 -1
- package/dist/runtime/components/Tooltip.d.vue.ts +57 -0
- package/dist/runtime/components/Tooltip.vue.d.ts +2 -1
- package/dist/runtime/components/Tree.d.vue.ts +115 -0
- package/dist/runtime/components/Tree.vue.d.ts +7 -6
- package/dist/runtime/composables/useKbd.js +1 -1
- package/dist/runtime/composables/usePortal.d.ts +3 -3
- package/dist/runtime/composables/usePortal.js +5 -10
- package/dist/runtime/inertia/components/Link.d.vue.ts +64 -0
- package/dist/runtime/inertia/components/Link.vue.d.ts +2 -1
- package/dist/runtime/inertia/components/LinkBase.d.vue.ts +26 -0
- package/dist/runtime/inertia/components/LinkBase.vue.d.ts +2 -1
- package/dist/runtime/types/tv.d.ts +9 -2
- package/dist/runtime/vue/components/Icon.d.vue.ts +6 -0
- package/dist/runtime/vue/components/Icon.vue.d.ts +2 -1
- package/dist/runtime/vue/components/Link.d.vue.ts +94 -0
- package/dist/runtime/vue/components/Link.vue.d.ts +2 -1
- package/dist/shared/{ui.BTUFJHYJ.mjs → ui.DBpKc5X3.mjs} +100 -68
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +18 -18
|
@@ -9,7 +9,8 @@ export interface ContainerProps {
|
|
|
9
9
|
export interface ContainerSlots {
|
|
10
10
|
default(props?: {}): any;
|
|
11
11
|
}
|
|
12
|
-
declare const
|
|
12
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ContainerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ContainerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ContainerSlots>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
13
14
|
export default _default;
|
|
14
15
|
type __VLS_WithSlots<T, S> = T & {
|
|
15
16
|
new (): {
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { ContextMenuRootProps, ContextMenuRootEmits, ContextMenuContentProps, ContextMenuContentEmits } from 'reka-ui';
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
3
|
+
import theme from '#build/ui/context-menu';
|
|
4
|
+
import type { AvatarProps, KbdProps, LinkProps } from '../types';
|
|
5
|
+
import type { ArrayOrNested, DynamicSlots, MergeTypes, NestedItem, EmitsToProps, ComponentConfig } from '../types/utils';
|
|
6
|
+
type ContextMenu = ComponentConfig<typeof theme, AppConfig, 'contextMenu'>;
|
|
7
|
+
export interface ContextMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custom'> {
|
|
8
|
+
label?: string;
|
|
9
|
+
/**
|
|
10
|
+
* @IconifyIcon
|
|
11
|
+
*/
|
|
12
|
+
icon?: string;
|
|
13
|
+
color?: ContextMenu['variants']['color'];
|
|
14
|
+
avatar?: AvatarProps;
|
|
15
|
+
content?: Omit<ContextMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<ContextMenuContentEmits>>;
|
|
16
|
+
kbds?: KbdProps['value'][] | KbdProps[];
|
|
17
|
+
/**
|
|
18
|
+
* The item type.
|
|
19
|
+
* @defaultValue 'link'
|
|
20
|
+
*/
|
|
21
|
+
type?: 'label' | 'separator' | 'link' | 'checkbox';
|
|
22
|
+
slot?: string;
|
|
23
|
+
loading?: boolean;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
checked?: boolean;
|
|
26
|
+
open?: boolean;
|
|
27
|
+
defaultOpen?: boolean;
|
|
28
|
+
children?: ArrayOrNested<ContextMenuItem>;
|
|
29
|
+
onSelect?(e: Event): void;
|
|
30
|
+
onUpdateChecked?(checked: boolean): void;
|
|
31
|
+
class?: any;
|
|
32
|
+
ui?: Pick<ContextMenu['slots'], 'item' | 'label' | 'separator' | 'itemLeadingIcon' | 'itemLeadingAvatarSize' | 'itemLeadingAvatar' | 'itemLabel' | 'itemLabelExternalIcon' | 'itemTrailing' | 'itemTrailingIcon' | 'itemTrailingKbds' | 'itemTrailingKbdsSize'>;
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}
|
|
35
|
+
export interface ContextMenuProps<T extends ArrayOrNested<ContextMenuItem> = ArrayOrNested<ContextMenuItem>> extends Omit<ContextMenuRootProps, 'dir'> {
|
|
36
|
+
/**
|
|
37
|
+
* @defaultValue 'md'
|
|
38
|
+
*/
|
|
39
|
+
size?: ContextMenu['variants']['size'];
|
|
40
|
+
items?: T;
|
|
41
|
+
/**
|
|
42
|
+
* The icon displayed when an item is checked.
|
|
43
|
+
* @defaultValue appConfig.ui.icons.check
|
|
44
|
+
* @IconifyIcon
|
|
45
|
+
*/
|
|
46
|
+
checkedIcon?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The icon displayed when an item is loading.
|
|
49
|
+
* @defaultValue appConfig.ui.icons.loading
|
|
50
|
+
* @IconifyIcon
|
|
51
|
+
*/
|
|
52
|
+
loadingIcon?: string;
|
|
53
|
+
/**
|
|
54
|
+
* The icon displayed when the item is an external link.
|
|
55
|
+
* Set to `false` to hide the external icon.
|
|
56
|
+
* @defaultValue appConfig.ui.icons.external
|
|
57
|
+
* @IconifyIcon
|
|
58
|
+
*/
|
|
59
|
+
externalIcon?: boolean | string;
|
|
60
|
+
/** The content of the menu. */
|
|
61
|
+
content?: Omit<ContextMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<ContextMenuContentEmits>>;
|
|
62
|
+
/**
|
|
63
|
+
* Render the menu in a portal.
|
|
64
|
+
* @defaultValue true
|
|
65
|
+
*/
|
|
66
|
+
portal?: boolean | string | HTMLElement;
|
|
67
|
+
/**
|
|
68
|
+
* The key used to get the label from the item.
|
|
69
|
+
* @defaultValue 'label'
|
|
70
|
+
*/
|
|
71
|
+
labelKey?: keyof NestedItem<T>;
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
class?: any;
|
|
74
|
+
ui?: ContextMenu['slots'];
|
|
75
|
+
}
|
|
76
|
+
export interface ContextMenuEmits extends ContextMenuRootEmits {
|
|
77
|
+
}
|
|
78
|
+
type SlotProps<T extends ContextMenuItem> = (props: {
|
|
79
|
+
item: T;
|
|
80
|
+
active?: boolean;
|
|
81
|
+
index: number;
|
|
82
|
+
}) => any;
|
|
83
|
+
export type ContextMenuSlots<A extends ArrayOrNested<ContextMenuItem> = ArrayOrNested<ContextMenuItem>, T extends NestedItem<A> = NestedItem<A>> = {
|
|
84
|
+
'default'(props?: {}): any;
|
|
85
|
+
'item': SlotProps<T>;
|
|
86
|
+
'item-leading': SlotProps<T>;
|
|
87
|
+
'item-label': SlotProps<T>;
|
|
88
|
+
'item-trailing': SlotProps<T>;
|
|
89
|
+
'content-top': (props?: {}) => any;
|
|
90
|
+
'content-bottom': (props?: {}) => any;
|
|
91
|
+
} & DynamicSlots<MergeTypes<T>, 'leading' | 'label' | 'trailing', {
|
|
92
|
+
active?: boolean;
|
|
93
|
+
index: number;
|
|
94
|
+
}>;
|
|
95
|
+
declare const __VLS_export: <T extends ArrayOrNested<ContextMenuItem>>(__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<{
|
|
96
|
+
props: __VLS_PrettifyLocal<ContextMenuProps<T> & {
|
|
97
|
+
"onUpdate:open"?: ((payload: boolean) => any) | undefined;
|
|
98
|
+
}> & import("vue").PublicProps;
|
|
99
|
+
expose: (exposed: {}) => void;
|
|
100
|
+
attrs: any;
|
|
101
|
+
slots: ContextMenuSlots<T, NestedItem<T>>;
|
|
102
|
+
emit: (evt: "update:open", payload: boolean) => void;
|
|
103
|
+
}>) => import("vue").VNode & {
|
|
104
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
105
|
+
};
|
|
106
|
+
declare const _default: typeof __VLS_export;
|
|
107
|
+
export default _default;
|
|
108
|
+
type __VLS_PrettifyLocal<T> = {
|
|
109
|
+
[K in keyof T as K]: T[K];
|
|
110
|
+
} & {};
|
|
@@ -92,17 +92,18 @@ export type ContextMenuSlots<A extends ArrayOrNested<ContextMenuItem> = ArrayOrN
|
|
|
92
92
|
active?: boolean;
|
|
93
93
|
index: number;
|
|
94
94
|
}>;
|
|
95
|
-
declare const
|
|
96
|
-
props: __VLS_PrettifyLocal<
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
expose(exposed:
|
|
95
|
+
declare const __VLS_export: <T extends ArrayOrNested<ContextMenuItem>>(__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<{
|
|
96
|
+
props: __VLS_PrettifyLocal<ContextMenuProps<T> & {
|
|
97
|
+
"onUpdate:open"?: ((payload: boolean) => any) | undefined;
|
|
98
|
+
}> & import("vue").PublicProps;
|
|
99
|
+
expose: (exposed: {}) => void;
|
|
100
100
|
attrs: any;
|
|
101
101
|
slots: ContextMenuSlots<T, NestedItem<T>>;
|
|
102
102
|
emit: (evt: "update:open", payload: boolean) => void;
|
|
103
103
|
}>) => import("vue").VNode & {
|
|
104
104
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
105
105
|
};
|
|
106
|
+
declare const _default: typeof __VLS_export;
|
|
106
107
|
export default _default;
|
|
107
108
|
type __VLS_PrettifyLocal<T> = {
|
|
108
109
|
[K in keyof T as K]: T[K];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ContextMenu } from 'reka-ui/namespaced';
|
|
2
|
+
import type { ContextMenuContentProps as RekaContextMenuContentProps } from 'reka-ui';
|
|
3
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
4
|
+
import type theme from '#build/ui/context-menu';
|
|
5
|
+
import type { ContextMenuItem, ContextMenuSlots } from '../types';
|
|
6
|
+
import type { ArrayOrNested, NestedItem, ComponentConfig } from '../types/utils';
|
|
7
|
+
type ContextMenu = ComponentConfig<typeof theme, AppConfig, 'contextMenu'>;
|
|
8
|
+
interface ContextMenuContentProps<T extends ArrayOrNested<ContextMenuItem>> extends Omit<RekaContextMenuContentProps, 'as' | 'asChild' | 'forceMount'> {
|
|
9
|
+
items?: T;
|
|
10
|
+
portal?: boolean | string | HTMLElement;
|
|
11
|
+
sub?: boolean;
|
|
12
|
+
labelKey: keyof NestedItem<T>;
|
|
13
|
+
/**
|
|
14
|
+
* @IconifyIcon
|
|
15
|
+
*/
|
|
16
|
+
checkedIcon?: string;
|
|
17
|
+
/**
|
|
18
|
+
* @IconifyIcon
|
|
19
|
+
*/
|
|
20
|
+
loadingIcon?: string;
|
|
21
|
+
/**
|
|
22
|
+
* @IconifyIcon
|
|
23
|
+
*/
|
|
24
|
+
externalIcon?: boolean | string;
|
|
25
|
+
class?: any;
|
|
26
|
+
ui: {
|
|
27
|
+
[K in keyof Required<ContextMenu['slots']>]: (props?: Record<string, any>) => string;
|
|
28
|
+
};
|
|
29
|
+
uiOverride?: ContextMenu['slots'];
|
|
30
|
+
}
|
|
31
|
+
declare const __VLS_export: <T extends ArrayOrNested<ContextMenuItem>>(__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<{
|
|
32
|
+
props: __VLS_PrettifyLocal<ContextMenuContentProps<T> & {
|
|
33
|
+
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
34
|
+
onPointerDownOutside?: ((event: import("reka-ui").PointerDownOutsideEvent) => any) | undefined;
|
|
35
|
+
onFocusOutside?: ((event: import("reka-ui").FocusOutsideEvent) => any) | undefined;
|
|
36
|
+
onInteractOutside?: ((event: import("reka-ui").PointerDownOutsideEvent | import("reka-ui").FocusOutsideEvent) => any) | undefined;
|
|
37
|
+
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
38
|
+
}> & import("vue").PublicProps;
|
|
39
|
+
expose: (exposed: {}) => void;
|
|
40
|
+
attrs: any;
|
|
41
|
+
slots: ContextMenuSlots<T>;
|
|
42
|
+
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);
|
|
43
|
+
}>) => import("vue").VNode & {
|
|
44
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
45
|
+
};
|
|
46
|
+
declare const _default: typeof __VLS_export;
|
|
47
|
+
export default _default;
|
|
48
|
+
type __VLS_PrettifyLocal<T> = {
|
|
49
|
+
[K in keyof T as K]: T[K];
|
|
50
|
+
} & {};
|
|
@@ -28,21 +28,22 @@ interface ContextMenuContentProps<T extends ArrayOrNested<ContextMenuItem>> exte
|
|
|
28
28
|
};
|
|
29
29
|
uiOverride?: ContextMenu['slots'];
|
|
30
30
|
}
|
|
31
|
-
declare const
|
|
32
|
-
props: __VLS_PrettifyLocal<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
expose(exposed:
|
|
31
|
+
declare const __VLS_export: <T extends ArrayOrNested<ContextMenuItem>>(__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<{
|
|
32
|
+
props: __VLS_PrettifyLocal<ContextMenuContentProps<T> & {
|
|
33
|
+
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
34
|
+
onPointerDownOutside?: ((event: import("reka-ui").PointerDownOutsideEvent) => any) | undefined;
|
|
35
|
+
onFocusOutside?: ((event: import("reka-ui").FocusOutsideEvent) => any) | undefined;
|
|
36
|
+
onInteractOutside?: ((event: import("reka-ui").PointerDownOutsideEvent | import("reka-ui").FocusOutsideEvent) => any) | undefined;
|
|
37
|
+
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
38
|
+
}> & import("vue").PublicProps;
|
|
39
|
+
expose: (exposed: {}) => void;
|
|
40
40
|
attrs: any;
|
|
41
41
|
slots: ContextMenuSlots<T>;
|
|
42
42
|
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);
|
|
43
43
|
}>) => import("vue").VNode & {
|
|
44
44
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
45
45
|
};
|
|
46
|
+
declare const _default: typeof __VLS_export;
|
|
46
47
|
export default _default;
|
|
47
48
|
type __VLS_PrettifyLocal<T> = {
|
|
48
49
|
[K in keyof T as K]: T[K];
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { DrawerRootProps, DrawerRootEmits } from 'vaul-vue';
|
|
2
|
+
import type { DialogContentProps, DialogContentEmits } from 'reka-ui';
|
|
3
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
4
|
+
import theme from '#build/ui/drawer';
|
|
5
|
+
import type { EmitsToProps, ComponentConfig } from '../types/utils';
|
|
6
|
+
type Drawer = ComponentConfig<typeof theme, AppConfig, 'drawer'>;
|
|
7
|
+
export interface DrawerProps extends Pick<DrawerRootProps, 'activeSnapPoint' | 'closeThreshold' | 'shouldScaleBackground' | 'setBackgroundColorOnScale' | 'scrollLockTimeout' | 'fixed' | 'dismissible' | 'modal' | 'open' | 'defaultOpen' | 'nested' | 'direction' | 'noBodyStyles' | 'handleOnly' | 'preventScrollRestoration' | 'snapPoints'> {
|
|
8
|
+
/**
|
|
9
|
+
* The element or component this component should render as.
|
|
10
|
+
* @defaultValue 'div'
|
|
11
|
+
*/
|
|
12
|
+
as?: any;
|
|
13
|
+
title?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Whether to inset the drawer from the edges.
|
|
17
|
+
* @defaultValue false
|
|
18
|
+
*/
|
|
19
|
+
inset?: boolean;
|
|
20
|
+
/** The content of the drawer. */
|
|
21
|
+
content?: Omit<DialogContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<DialogContentEmits>>;
|
|
22
|
+
/**
|
|
23
|
+
* Render an overlay behind the drawer.
|
|
24
|
+
* @defaultValue true
|
|
25
|
+
*/
|
|
26
|
+
overlay?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Render a handle on the drawer.
|
|
29
|
+
* @defaultValue true
|
|
30
|
+
*/
|
|
31
|
+
handle?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Render the drawer in a portal.
|
|
34
|
+
* @defaultValue true
|
|
35
|
+
*/
|
|
36
|
+
portal?: boolean | string | HTMLElement;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the drawer is nested in another drawer.
|
|
39
|
+
* @defaultValue false
|
|
40
|
+
*/
|
|
41
|
+
nested?: boolean;
|
|
42
|
+
class?: any;
|
|
43
|
+
ui?: Drawer['slots'];
|
|
44
|
+
}
|
|
45
|
+
export interface DrawerEmits extends DrawerRootEmits {
|
|
46
|
+
(e: 'close:prevent'): void;
|
|
47
|
+
}
|
|
48
|
+
export interface DrawerSlots {
|
|
49
|
+
default(props?: {}): any;
|
|
50
|
+
content(props?: {}): any;
|
|
51
|
+
header(props?: {}): any;
|
|
52
|
+
title(props?: {}): any;
|
|
53
|
+
description(props?: {}): any;
|
|
54
|
+
body(props?: {}): any;
|
|
55
|
+
footer(props?: {}): any;
|
|
56
|
+
}
|
|
57
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DrawerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
58
|
+
close: () => any;
|
|
59
|
+
drag: (percentageDragged: number) => any;
|
|
60
|
+
"update:open": (open: boolean) => any;
|
|
61
|
+
"close:prevent": () => any;
|
|
62
|
+
release: (open: boolean) => any;
|
|
63
|
+
"update:activeSnapPoint": (val: string | number) => any;
|
|
64
|
+
animationEnd: (open: boolean) => any;
|
|
65
|
+
}, string, import("vue").PublicProps, Readonly<DrawerProps> & Readonly<{
|
|
66
|
+
onClose?: (() => any) | undefined;
|
|
67
|
+
onDrag?: ((percentageDragged: number) => any) | undefined;
|
|
68
|
+
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
69
|
+
"onClose:prevent"?: (() => any) | undefined;
|
|
70
|
+
onRelease?: ((open: boolean) => any) | undefined;
|
|
71
|
+
"onUpdate:activeSnapPoint"?: ((val: string | number) => any) | undefined;
|
|
72
|
+
onAnimationEnd?: ((open: boolean) => any) | undefined;
|
|
73
|
+
}>, {
|
|
74
|
+
modal: boolean;
|
|
75
|
+
portal: boolean | string | HTMLElement;
|
|
76
|
+
overlay: boolean;
|
|
77
|
+
direction: import("vaul-vue").DrawerDirection;
|
|
78
|
+
dismissible: boolean;
|
|
79
|
+
handle: boolean;
|
|
80
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, DrawerSlots>;
|
|
81
|
+
declare const _default: typeof __VLS_export;
|
|
82
|
+
export default _default;
|
|
83
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
84
|
+
new (): {
|
|
85
|
+
$slots: S;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
@@ -38,18 +38,32 @@ const props = defineProps({
|
|
|
38
38
|
preventScrollRestoration: { type: Boolean, required: false },
|
|
39
39
|
snapPoints: { type: Array, required: false }
|
|
40
40
|
});
|
|
41
|
-
const emits = defineEmits(["drag", "release", "close", "update:open", "update:activeSnapPoint", "animationEnd"]);
|
|
41
|
+
const emits = defineEmits(["close:prevent", "drag", "release", "close", "update:open", "update:activeSnapPoint", "animationEnd"]);
|
|
42
42
|
const slots = defineSlots();
|
|
43
43
|
const appConfig = useAppConfig();
|
|
44
44
|
const rootProps = useForwardPropsEmits(reactivePick(props, "activeSnapPoint", "closeThreshold", "shouldScaleBackground", "setBackgroundColorOnScale", "scrollLockTimeout", "fixed", "dismissible", "modal", "open", "defaultOpen", "nested", "direction", "noBodyStyles", "handleOnly", "preventScrollRestoration", "snapPoints"), emits);
|
|
45
45
|
const portalProps = usePortal(toRef(() => props.portal));
|
|
46
46
|
const contentProps = toRef(() => props.content);
|
|
47
|
-
const contentEvents = {
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
const contentEvents = computed(() => {
|
|
48
|
+
const defaultEvents = {
|
|
49
|
+
closeAutoFocus: (e) => e.preventDefault()
|
|
50
|
+
};
|
|
51
|
+
if (!props.dismissible) {
|
|
52
|
+
const events = ["pointerDownOutside", "interactOutside", "escapeKeyDown"];
|
|
53
|
+
return events.reduce((acc, curr) => {
|
|
54
|
+
acc[curr] = (e) => {
|
|
55
|
+
e.preventDefault();
|
|
56
|
+
emits("close:prevent");
|
|
57
|
+
};
|
|
58
|
+
return acc;
|
|
59
|
+
}, defaultEvents);
|
|
60
|
+
}
|
|
61
|
+
return defaultEvents;
|
|
62
|
+
});
|
|
50
63
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.drawer || {} })({
|
|
51
64
|
direction: props.direction,
|
|
52
|
-
inset: props.inset
|
|
65
|
+
inset: props.inset,
|
|
66
|
+
snapPoints: props.snapPoints && props.snapPoints.length > 0
|
|
53
67
|
}));
|
|
54
68
|
</script>
|
|
55
69
|
|
|
@@ -43,6 +43,7 @@ export interface DrawerProps extends Pick<DrawerRootProps, 'activeSnapPoint' | '
|
|
|
43
43
|
ui?: Drawer['slots'];
|
|
44
44
|
}
|
|
45
45
|
export interface DrawerEmits extends DrawerRootEmits {
|
|
46
|
+
(e: 'close:prevent'): void;
|
|
46
47
|
}
|
|
47
48
|
export interface DrawerSlots {
|
|
48
49
|
default(props?: {}): any;
|
|
@@ -53,10 +54,11 @@ export interface DrawerSlots {
|
|
|
53
54
|
body(props?: {}): any;
|
|
54
55
|
footer(props?: {}): any;
|
|
55
56
|
}
|
|
56
|
-
declare const
|
|
57
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DrawerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
57
58
|
close: () => any;
|
|
58
59
|
drag: (percentageDragged: number) => any;
|
|
59
60
|
"update:open": (open: boolean) => any;
|
|
61
|
+
"close:prevent": () => any;
|
|
60
62
|
release: (open: boolean) => any;
|
|
61
63
|
"update:activeSnapPoint": (val: string | number) => any;
|
|
62
64
|
animationEnd: (open: boolean) => any;
|
|
@@ -64,6 +66,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<DrawerProp
|
|
|
64
66
|
onClose?: (() => any) | undefined;
|
|
65
67
|
onDrag?: ((percentageDragged: number) => any) | undefined;
|
|
66
68
|
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
69
|
+
"onClose:prevent"?: (() => any) | undefined;
|
|
67
70
|
onRelease?: ((open: boolean) => any) | undefined;
|
|
68
71
|
"onUpdate:activeSnapPoint"?: ((val: string | number) => any) | undefined;
|
|
69
72
|
onAnimationEnd?: ((open: boolean) => any) | undefined;
|
|
@@ -75,6 +78,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<DrawerProp
|
|
|
75
78
|
dismissible: boolean;
|
|
76
79
|
handle: boolean;
|
|
77
80
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, DrawerSlots>;
|
|
81
|
+
declare const _default: typeof __VLS_export;
|
|
78
82
|
export default _default;
|
|
79
83
|
type __VLS_WithSlots<T, S> = T & {
|
|
80
84
|
new (): {
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { DropdownMenuRootProps, DropdownMenuRootEmits, DropdownMenuContentProps, DropdownMenuContentEmits, DropdownMenuArrowProps } from 'reka-ui';
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
3
|
+
import theme from '#build/ui/dropdown-menu';
|
|
4
|
+
import type { AvatarProps, KbdProps, LinkProps } from '../types';
|
|
5
|
+
import type { ArrayOrNested, DynamicSlots, MergeTypes, NestedItem, EmitsToProps, ComponentConfig } from '../types/utils';
|
|
6
|
+
type DropdownMenu = ComponentConfig<typeof theme, AppConfig, 'dropdownMenu'>;
|
|
7
|
+
export interface DropdownMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custom'> {
|
|
8
|
+
label?: string;
|
|
9
|
+
/**
|
|
10
|
+
* @IconifyIcon
|
|
11
|
+
*/
|
|
12
|
+
icon?: string;
|
|
13
|
+
color?: DropdownMenu['variants']['color'];
|
|
14
|
+
avatar?: AvatarProps;
|
|
15
|
+
content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<DropdownMenuContentEmits>>;
|
|
16
|
+
kbds?: KbdProps['value'][] | KbdProps[];
|
|
17
|
+
/**
|
|
18
|
+
* The item type.
|
|
19
|
+
* @defaultValue 'link'
|
|
20
|
+
*/
|
|
21
|
+
type?: 'label' | 'separator' | 'link' | 'checkbox';
|
|
22
|
+
slot?: string;
|
|
23
|
+
loading?: boolean;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
checked?: boolean;
|
|
26
|
+
open?: boolean;
|
|
27
|
+
defaultOpen?: boolean;
|
|
28
|
+
children?: ArrayOrNested<DropdownMenuItem>;
|
|
29
|
+
onSelect?(e: Event): void;
|
|
30
|
+
onUpdateChecked?(checked: boolean): void;
|
|
31
|
+
class?: any;
|
|
32
|
+
ui?: Pick<DropdownMenu['slots'], 'item' | 'label' | 'separator' | 'itemLeadingIcon' | 'itemLeadingAvatarSize' | 'itemLeadingAvatar' | 'itemLabel' | 'itemLabelExternalIcon' | 'itemTrailing' | 'itemTrailingIcon' | 'itemTrailingKbds' | 'itemTrailingKbdsSize'>;
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}
|
|
35
|
+
export interface DropdownMenuProps<T extends ArrayOrNested<DropdownMenuItem> = ArrayOrNested<DropdownMenuItem>> extends Omit<DropdownMenuRootProps, 'dir'> {
|
|
36
|
+
/**
|
|
37
|
+
* @defaultValue 'md'
|
|
38
|
+
*/
|
|
39
|
+
size?: DropdownMenu['variants']['size'];
|
|
40
|
+
items?: T;
|
|
41
|
+
/**
|
|
42
|
+
* The icon displayed when an item is checked.
|
|
43
|
+
* @defaultValue appConfig.ui.icons.check
|
|
44
|
+
* @IconifyIcon
|
|
45
|
+
*/
|
|
46
|
+
checkedIcon?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The icon displayed when an item is loading.
|
|
49
|
+
* @defaultValue appConfig.ui.icons.loading
|
|
50
|
+
* @IconifyIcon
|
|
51
|
+
*/
|
|
52
|
+
loadingIcon?: string;
|
|
53
|
+
/**
|
|
54
|
+
* The icon displayed when the item is an external link.
|
|
55
|
+
* Set to `false` to hide the external icon.
|
|
56
|
+
* @defaultValue appConfig.ui.icons.external
|
|
57
|
+
* @IconifyIcon
|
|
58
|
+
*/
|
|
59
|
+
externalIcon?: boolean | string;
|
|
60
|
+
/**
|
|
61
|
+
* The content of the menu.
|
|
62
|
+
* @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8 }
|
|
63
|
+
*/
|
|
64
|
+
content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<DropdownMenuContentEmits>>;
|
|
65
|
+
/**
|
|
66
|
+
* Display an arrow alongside the menu.
|
|
67
|
+
* @defaultValue false
|
|
68
|
+
*/
|
|
69
|
+
arrow?: boolean | Omit<DropdownMenuArrowProps, 'as' | 'asChild'>;
|
|
70
|
+
/**
|
|
71
|
+
* Render the menu in a portal.
|
|
72
|
+
* @defaultValue true
|
|
73
|
+
*/
|
|
74
|
+
portal?: boolean | string | HTMLElement;
|
|
75
|
+
/**
|
|
76
|
+
* The key used to get the label from the item.
|
|
77
|
+
* @defaultValue 'label'
|
|
78
|
+
*/
|
|
79
|
+
labelKey?: keyof NestedItem<T>;
|
|
80
|
+
disabled?: boolean;
|
|
81
|
+
class?: any;
|
|
82
|
+
ui?: DropdownMenu['slots'];
|
|
83
|
+
}
|
|
84
|
+
export interface DropdownMenuEmits extends DropdownMenuRootEmits {
|
|
85
|
+
}
|
|
86
|
+
type SlotProps<T extends DropdownMenuItem> = (props: {
|
|
87
|
+
item: T;
|
|
88
|
+
active?: boolean;
|
|
89
|
+
index: number;
|
|
90
|
+
}) => any;
|
|
91
|
+
export type DropdownMenuSlots<A extends ArrayOrNested<DropdownMenuItem> = ArrayOrNested<DropdownMenuItem>, T extends NestedItem<A> = NestedItem<A>> = {
|
|
92
|
+
'default'(props: {
|
|
93
|
+
open: boolean;
|
|
94
|
+
}): any;
|
|
95
|
+
'item': SlotProps<T>;
|
|
96
|
+
'item-leading': SlotProps<T>;
|
|
97
|
+
'item-label': SlotProps<T>;
|
|
98
|
+
'item-trailing': SlotProps<T>;
|
|
99
|
+
'content-top': (props?: {}) => any;
|
|
100
|
+
'content-bottom': (props?: {}) => any;
|
|
101
|
+
} & DynamicSlots<MergeTypes<T>, 'leading' | 'label' | 'trailing', {
|
|
102
|
+
active?: boolean;
|
|
103
|
+
index: number;
|
|
104
|
+
}>;
|
|
105
|
+
declare const __VLS_export: <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<{
|
|
106
|
+
props: __VLS_PrettifyLocal<DropdownMenuProps<T> & {
|
|
107
|
+
"onUpdate:open"?: ((payload: boolean) => any) | undefined;
|
|
108
|
+
}> & import("vue").PublicProps;
|
|
109
|
+
expose: (exposed: {}) => void;
|
|
110
|
+
attrs: any;
|
|
111
|
+
slots: DropdownMenuSlots<T, NestedItem<T>>;
|
|
112
|
+
emit: (evt: "update:open", payload: boolean) => void;
|
|
113
|
+
}>) => import("vue").VNode & {
|
|
114
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
115
|
+
};
|
|
116
|
+
declare const _default: typeof __VLS_export;
|
|
117
|
+
export default _default;
|
|
118
|
+
type __VLS_PrettifyLocal<T> = {
|
|
119
|
+
[K in keyof T as K]: T[K];
|
|
120
|
+
} & {};
|
|
@@ -102,17 +102,18 @@ export type DropdownMenuSlots<A extends ArrayOrNested<DropdownMenuItem> = ArrayO
|
|
|
102
102
|
active?: boolean;
|
|
103
103
|
index: number;
|
|
104
104
|
}>;
|
|
105
|
-
declare const
|
|
106
|
-
props: __VLS_PrettifyLocal<
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
expose(exposed:
|
|
105
|
+
declare const __VLS_export: <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<{
|
|
106
|
+
props: __VLS_PrettifyLocal<DropdownMenuProps<T> & {
|
|
107
|
+
"onUpdate:open"?: ((payload: boolean) => any) | undefined;
|
|
108
|
+
}> & import("vue").PublicProps;
|
|
109
|
+
expose: (exposed: {}) => void;
|
|
110
110
|
attrs: any;
|
|
111
111
|
slots: DropdownMenuSlots<T, NestedItem<T>>;
|
|
112
112
|
emit: (evt: "update:open", payload: boolean) => void;
|
|
113
113
|
}>) => import("vue").VNode & {
|
|
114
114
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
115
115
|
};
|
|
116
|
+
declare const _default: typeof __VLS_export;
|
|
116
117
|
export default _default;
|
|
117
118
|
type __VLS_PrettifyLocal<T> = {
|
|
118
119
|
[K in keyof T as K]: T[K];
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { DropdownMenu } from 'reka-ui/namespaced';
|
|
2
|
+
import type { DropdownMenuContentProps as RekaDropdownMenuContentProps } from 'reka-ui';
|
|
3
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
4
|
+
import type theme from '#build/ui/dropdown-menu';
|
|
5
|
+
import type { DropdownMenuItem, DropdownMenuSlots, DynamicSlots, MergeTypes } from '../types';
|
|
6
|
+
import type { ArrayOrNested, NestedItem, ComponentConfig } from '../types/utils';
|
|
7
|
+
type DropdownMenu = ComponentConfig<typeof theme, AppConfig, 'dropdownMenu'>;
|
|
8
|
+
interface DropdownMenuContentProps<T extends ArrayOrNested<DropdownMenuItem>> extends Omit<RekaDropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> {
|
|
9
|
+
items?: T;
|
|
10
|
+
portal?: boolean | string | HTMLElement;
|
|
11
|
+
sub?: boolean;
|
|
12
|
+
labelKey: keyof NestedItem<T>;
|
|
13
|
+
/**
|
|
14
|
+
* @IconifyIcon
|
|
15
|
+
*/
|
|
16
|
+
checkedIcon?: string;
|
|
17
|
+
/**
|
|
18
|
+
* @IconifyIcon
|
|
19
|
+
*/
|
|
20
|
+
loadingIcon?: string;
|
|
21
|
+
/**
|
|
22
|
+
* @IconifyIcon
|
|
23
|
+
*/
|
|
24
|
+
externalIcon?: boolean | string;
|
|
25
|
+
class?: any;
|
|
26
|
+
ui: {
|
|
27
|
+
[K in keyof Required<DropdownMenu['slots']>]: (props?: Record<string, any>) => string;
|
|
28
|
+
};
|
|
29
|
+
uiOverride?: DropdownMenu['slots'];
|
|
30
|
+
}
|
|
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
|
+
default(props?: {}): any;
|
|
33
|
+
} & DynamicSlots<MergeTypes<T>, 'leading' | 'label' | 'trailing', {
|
|
34
|
+
active?: boolean;
|
|
35
|
+
index: number;
|
|
36
|
+
}>;
|
|
37
|
+
declare const __VLS_export: <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<{
|
|
38
|
+
props: __VLS_PrettifyLocal<DropdownMenuContentProps<T> & {
|
|
39
|
+
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
40
|
+
onPointerDownOutside?: ((event: import("reka-ui").PointerDownOutsideEvent) => any) | undefined;
|
|
41
|
+
onFocusOutside?: ((event: import("reka-ui").FocusOutsideEvent) => any) | undefined;
|
|
42
|
+
onInteractOutside?: ((event: import("reka-ui").PointerDownOutsideEvent | import("reka-ui").FocusOutsideEvent) => any) | undefined;
|
|
43
|
+
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
44
|
+
}> & import("vue").PublicProps;
|
|
45
|
+
expose: (exposed: {}) => void;
|
|
46
|
+
attrs: any;
|
|
47
|
+
slots: DropdownMenuContentSlots<T, NestedItem<T>>;
|
|
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);
|
|
49
|
+
}>) => import("vue").VNode & {
|
|
50
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
51
|
+
};
|
|
52
|
+
declare const _default: typeof __VLS_export;
|
|
53
|
+
export default _default;
|
|
54
|
+
type __VLS_PrettifyLocal<T> = {
|
|
55
|
+
[K in keyof T as K]: T[K];
|
|
56
|
+
} & {};
|
|
@@ -34,21 +34,22 @@ type DropdownMenuContentSlots<A extends ArrayOrNested<DropdownMenuItem> = ArrayO
|
|
|
34
34
|
active?: boolean;
|
|
35
35
|
index: number;
|
|
36
36
|
}>;
|
|
37
|
-
declare const
|
|
38
|
-
props: __VLS_PrettifyLocal<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
expose(exposed:
|
|
37
|
+
declare const __VLS_export: <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<{
|
|
38
|
+
props: __VLS_PrettifyLocal<DropdownMenuContentProps<T> & {
|
|
39
|
+
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
40
|
+
onPointerDownOutside?: ((event: import("reka-ui").PointerDownOutsideEvent) => any) | undefined;
|
|
41
|
+
onFocusOutside?: ((event: import("reka-ui").FocusOutsideEvent) => any) | undefined;
|
|
42
|
+
onInteractOutside?: ((event: import("reka-ui").PointerDownOutsideEvent | import("reka-ui").FocusOutsideEvent) => any) | undefined;
|
|
43
|
+
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
44
|
+
}> & import("vue").PublicProps;
|
|
45
|
+
expose: (exposed: {}) => void;
|
|
46
46
|
attrs: any;
|
|
47
47
|
slots: DropdownMenuContentSlots<T, NestedItem<T>>;
|
|
48
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);
|
|
49
49
|
}>) => import("vue").VNode & {
|
|
50
50
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
51
51
|
};
|
|
52
|
+
declare const _default: typeof __VLS_export;
|
|
52
53
|
export default _default;
|
|
53
54
|
type __VLS_PrettifyLocal<T> = {
|
|
54
55
|
[K in keyof T as K]: T[K];
|