@nuxt/ui 4.6.1 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -4
- package/cli/package.json +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +3 -2
- package/dist/runtime/components/Accordion.d.vue.ts +6 -1
- package/dist/runtime/components/Accordion.vue +1 -1
- package/dist/runtime/components/Accordion.vue.d.ts +6 -1
- package/dist/runtime/components/AuthForm.d.vue.ts +22 -29
- package/dist/runtime/components/AuthForm.vue +8 -6
- package/dist/runtime/components/AuthForm.vue.d.ts +22 -29
- package/dist/runtime/components/Calendar.vue +4 -4
- package/dist/runtime/components/Card.d.vue.ts +4 -0
- package/dist/runtime/components/Card.vue +16 -2
- package/dist/runtime/components/Card.vue.d.ts +4 -0
- package/dist/runtime/components/ChatMessage.d.vue.ts +27 -17
- package/dist/runtime/components/ChatMessage.vue +10 -16
- package/dist/runtime/components/ChatMessage.vue.d.ts +27 -17
- package/dist/runtime/components/ChatMessages.d.vue.ts +27 -21
- package/dist/runtime/components/ChatMessages.vue +22 -23
- package/dist/runtime/components/ChatMessages.vue.d.ts +27 -21
- package/dist/runtime/components/ChatPromptSubmit.vue +3 -1
- package/dist/runtime/components/Checkbox.vue +5 -3
- package/dist/runtime/components/CommandPalette.d.vue.ts +18 -3
- package/dist/runtime/components/CommandPalette.vue +11 -7
- package/dist/runtime/components/CommandPalette.vue.d.ts +18 -3
- package/dist/runtime/components/ContextMenuContent.vue +68 -65
- package/dist/runtime/components/DashboardSearch.d.vue.ts +8 -37
- package/dist/runtime/components/DashboardSearch.vue +11 -10
- package/dist/runtime/components/DashboardSearch.vue.d.ts +8 -37
- package/dist/runtime/components/DashboardSidebar.vue +1 -5
- package/dist/runtime/components/Drawer.vue +44 -41
- package/dist/runtime/components/DropdownMenuContent.vue +90 -87
- package/dist/runtime/components/EditorEmojiMenu.d.vue.ts +1 -1
- package/dist/runtime/components/EditorEmojiMenu.vue +2 -0
- package/dist/runtime/components/EditorEmojiMenu.vue.d.ts +1 -1
- package/dist/runtime/components/EditorMentionMenu.d.vue.ts +1 -1
- package/dist/runtime/components/EditorMentionMenu.vue +2 -0
- package/dist/runtime/components/EditorMentionMenu.vue.d.ts +1 -1
- package/dist/runtime/components/EditorSuggestionMenu.d.vue.ts +1 -1
- package/dist/runtime/components/EditorSuggestionMenu.vue +2 -0
- package/dist/runtime/components/EditorSuggestionMenu.vue.d.ts +1 -1
- package/dist/runtime/components/FileUpload.vue +7 -5
- package/dist/runtime/components/Header.vue +1 -5
- package/dist/runtime/components/Input.vue +2 -2
- package/dist/runtime/components/InputDate.vue +6 -6
- package/dist/runtime/components/InputMenu.d.vue.ts +3 -3
- package/dist/runtime/components/InputMenu.vue +40 -38
- package/dist/runtime/components/InputMenu.vue.d.ts +3 -3
- package/dist/runtime/components/InputNumber.vue +2 -2
- package/dist/runtime/components/InputTags.vue +2 -2
- package/dist/runtime/components/InputTime.vue +2 -2
- package/dist/runtime/components/Link.vue +64 -8
- package/dist/runtime/components/Listbox.d.vue.ts +228 -0
- package/dist/runtime/components/Listbox.vue +242 -0
- package/dist/runtime/components/Listbox.vue.d.ts +228 -0
- package/dist/runtime/components/Modal.vue +13 -10
- package/dist/runtime/components/Popover.vue +7 -4
- package/dist/runtime/components/PricingTable.vue +60 -58
- package/dist/runtime/components/RadioGroup.vue +5 -3
- package/dist/runtime/components/Select.d.vue.ts +1 -1
- package/dist/runtime/components/Select.vue +84 -73
- package/dist/runtime/components/Select.vue.d.ts +1 -1
- package/dist/runtime/components/SelectMenu.d.vue.ts +3 -3
- package/dist/runtime/components/SelectMenu.vue +54 -52
- package/dist/runtime/components/SelectMenu.vue.d.ts +3 -3
- package/dist/runtime/components/Sidebar.vue +1 -4
- package/dist/runtime/components/Slideover.vue +67 -64
- package/dist/runtime/components/Table.d.vue.ts +1 -2
- package/dist/runtime/components/Table.vue +17 -29
- package/dist/runtime/components/Table.vue.d.ts +1 -2
- package/dist/runtime/components/Tabs.d.vue.ts +5 -1
- package/dist/runtime/components/Tabs.vue +2 -2
- package/dist/runtime/components/Tabs.vue.d.ts +5 -1
- package/dist/runtime/components/Textarea.d.vue.ts +1 -0
- package/dist/runtime/components/Textarea.vue +2 -1
- package/dist/runtime/components/Textarea.vue.d.ts +1 -0
- package/dist/runtime/components/Tooltip.vue +12 -9
- package/dist/runtime/components/content/ContentSearch.d.vue.ts +19 -35
- package/dist/runtime/components/content/ContentSearch.vue +10 -9
- package/dist/runtime/components/content/ContentSearch.vue.d.ts +19 -35
- package/dist/runtime/components/content/ContentToc.vue +19 -9
- package/dist/runtime/components/prose/Img.vue +2 -1
- package/dist/runtime/components/prose/Pre.vue +8 -3
- package/dist/runtime/components/prose/Prompt.d.vue.ts +32 -0
- package/dist/runtime/components/prose/Prompt.vue +88 -0
- package/dist/runtime/components/prose/Prompt.vue.d.ts +32 -0
- package/dist/runtime/composables/index.d.ts +1 -0
- package/dist/runtime/composables/index.js +1 -0
- package/dist/runtime/composables/useContentSearch.js +19 -5
- package/dist/runtime/composables/useEditorMenu.d.ts +5 -0
- package/dist/runtime/composables/useEditorMenu.js +3 -1
- package/dist/runtime/composables/useFieldGroup.d.ts +3 -0
- package/dist/runtime/composables/useFieldGroup.js +11 -1
- package/dist/runtime/composables/useResolvedVariants.d.ts +21 -0
- package/dist/runtime/composables/useResolvedVariants.js +14 -0
- package/dist/runtime/locale/ar.js +9 -0
- package/dist/runtime/locale/az.js +9 -0
- package/dist/runtime/locale/be.js +9 -0
- package/dist/runtime/locale/bg.js +9 -0
- package/dist/runtime/locale/bn.js +9 -0
- package/dist/runtime/locale/ca.js +9 -0
- package/dist/runtime/locale/ckb.js +10 -1
- package/dist/runtime/locale/cs.js +9 -0
- package/dist/runtime/locale/da.js +9 -0
- package/dist/runtime/locale/de.js +9 -0
- package/dist/runtime/locale/de_ch.js +9 -0
- package/dist/runtime/locale/el.js +9 -0
- package/dist/runtime/locale/en.js +10 -1
- package/dist/runtime/locale/es.js +9 -0
- package/dist/runtime/locale/et.js +9 -0
- package/dist/runtime/locale/eu.js +11 -2
- package/dist/runtime/locale/fa_ir.js +9 -0
- package/dist/runtime/locale/fi.js +9 -0
- package/dist/runtime/locale/fr.js +9 -0
- package/dist/runtime/locale/gl.js +9 -0
- package/dist/runtime/locale/he.js +9 -0
- package/dist/runtime/locale/hi.js +9 -0
- package/dist/runtime/locale/hr.js +9 -0
- package/dist/runtime/locale/hu.js +9 -0
- package/dist/runtime/locale/hy.js +9 -0
- package/dist/runtime/locale/id.js +9 -0
- package/dist/runtime/locale/is.js +9 -0
- package/dist/runtime/locale/it.js +9 -0
- package/dist/runtime/locale/ja.js +9 -0
- package/dist/runtime/locale/ka.js +9 -0
- package/dist/runtime/locale/kk.js +9 -0
- package/dist/runtime/locale/km.js +9 -0
- package/dist/runtime/locale/ko.js +9 -0
- package/dist/runtime/locale/ky.js +9 -0
- package/dist/runtime/locale/lb.js +11 -2
- package/dist/runtime/locale/lo.js +15 -6
- package/dist/runtime/locale/lt.js +9 -0
- package/dist/runtime/locale/mn.js +9 -0
- package/dist/runtime/locale/ms.js +9 -0
- package/dist/runtime/locale/nb_no.js +9 -0
- package/dist/runtime/locale/nl.js +9 -0
- package/dist/runtime/locale/pl.js +9 -0
- package/dist/runtime/locale/pt.js +9 -0
- package/dist/runtime/locale/pt_br.js +9 -0
- package/dist/runtime/locale/ro.js +9 -0
- package/dist/runtime/locale/ru.js +9 -0
- package/dist/runtime/locale/sk.js +9 -0
- package/dist/runtime/locale/sl.js +9 -0
- package/dist/runtime/locale/sq.js +9 -0
- package/dist/runtime/locale/sv.js +9 -0
- package/dist/runtime/locale/th.js +9 -0
- package/dist/runtime/locale/tj.js +9 -0
- package/dist/runtime/locale/tr.js +9 -0
- package/dist/runtime/locale/ug_cn.js +9 -0
- package/dist/runtime/locale/uk.js +9 -0
- package/dist/runtime/locale/ur.js +9 -0
- package/dist/runtime/locale/uz.js +9 -0
- package/dist/runtime/locale/vi.js +9 -0
- package/dist/runtime/locale/zh_cn.js +9 -0
- package/dist/runtime/locale/zh_tw.js +9 -0
- package/dist/runtime/plugins/colors.js +1 -1
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/locale.d.ts +9 -0
- package/dist/runtime/types/prose.d.ts +1 -0
- package/dist/runtime/types/prose.js +1 -0
- package/dist/runtime/vue/overrides/inertia/Link.vue +3 -3
- package/dist/runtime/vue/overrides/none/Link.vue +3 -2
- package/dist/runtime/vue/overrides/vue-router/Link.vue +27 -31
- package/dist/shared/{ui.DJUbBpE2.mjs → ui.BIQuJqNV.mjs} +186 -34
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +48 -39
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
import type { ListboxRootEmits, ListboxRootProps } from 'reka-ui';
|
|
3
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
4
|
+
import theme from '#build/ui/listbox';
|
|
5
|
+
import type { AvatarProps, ChipProps, IconProps, InputProps } from '../types';
|
|
6
|
+
import type { ModelModifiers, ApplyModifiers } from '../types/input';
|
|
7
|
+
import type { ArrayOrNested, GetItemKeys, GetModelValue, NestedItem } from '../types/utils';
|
|
8
|
+
import type { ComponentConfig } from '../types/tv';
|
|
9
|
+
type Listbox = ComponentConfig<typeof theme, AppConfig, 'listbox'>;
|
|
10
|
+
export interface ListboxItem {
|
|
11
|
+
label?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
/**
|
|
14
|
+
* @IconifyIcon
|
|
15
|
+
*/
|
|
16
|
+
icon?: IconProps['name'];
|
|
17
|
+
avatar?: AvatarProps;
|
|
18
|
+
chip?: ChipProps;
|
|
19
|
+
/**
|
|
20
|
+
* The item type.
|
|
21
|
+
* @defaultValue 'item'
|
|
22
|
+
*/
|
|
23
|
+
type?: 'label' | 'separator' | 'item';
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
onSelect?: (e: Event) => void;
|
|
26
|
+
class?: any;
|
|
27
|
+
ui?: Pick<Listbox['slots'], 'label' | 'separator' | 'item' | 'itemLeadingIcon' | 'itemLeadingAvatar' | 'itemLeadingAvatarSize' | 'itemLeadingChip' | 'itemLeadingChipSize' | 'itemWrapper' | 'itemLabel' | 'itemDescription' | 'itemTrailing' | 'itemTrailingIcon'>;
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
}
|
|
30
|
+
export interface ListboxProps<T extends ArrayOrNested<ListboxItem> = ArrayOrNested<ListboxItem>, VK extends GetItemKeys<T> | undefined = undefined, M extends boolean = false, Mod extends Omit<ModelModifiers, 'lazy'> = Omit<ModelModifiers, 'lazy'>> extends Pick<ListboxRootProps, 'by' | 'disabled' | 'highlightOnHover' | 'name' | 'orientation' | 'required' | 'selectionBehavior'> {
|
|
31
|
+
id?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The element or component this component should render as.
|
|
34
|
+
* @defaultValue 'div'
|
|
35
|
+
*/
|
|
36
|
+
as?: any;
|
|
37
|
+
/**
|
|
38
|
+
* @defaultValue 'md'
|
|
39
|
+
*/
|
|
40
|
+
size?: Listbox['variants']['size'];
|
|
41
|
+
/**
|
|
42
|
+
* The items to display in the list.
|
|
43
|
+
*/
|
|
44
|
+
items?: T;
|
|
45
|
+
/**
|
|
46
|
+
* The controlled value of the Listbox. Can be bound with `v-model`.
|
|
47
|
+
*/
|
|
48
|
+
modelValue?: ApplyModifiers<GetModelValue<T, VK, M>, Mod>;
|
|
49
|
+
modelModifiers?: Mod;
|
|
50
|
+
/**
|
|
51
|
+
* The default value when not controlled.
|
|
52
|
+
*/
|
|
53
|
+
defaultValue?: ApplyModifiers<GetModelValue<T, VK, M>, Mod>;
|
|
54
|
+
/**
|
|
55
|
+
* Whether multiple items can be selected.
|
|
56
|
+
* @defaultValue false
|
|
57
|
+
*/
|
|
58
|
+
multiple?: M & boolean;
|
|
59
|
+
/**
|
|
60
|
+
* When `items` is an array of objects, select the field to use as the value instead of the object itself.
|
|
61
|
+
* @defaultValue undefined
|
|
62
|
+
*/
|
|
63
|
+
valueKey?: VK;
|
|
64
|
+
/**
|
|
65
|
+
* The key used to get the label from the item.
|
|
66
|
+
* @defaultValue 'label'
|
|
67
|
+
*/
|
|
68
|
+
labelKey?: GetItemKeys<T>;
|
|
69
|
+
/**
|
|
70
|
+
* The key used to get the description from the item.
|
|
71
|
+
* @defaultValue 'description'
|
|
72
|
+
*/
|
|
73
|
+
descriptionKey?: GetItemKeys<T>;
|
|
74
|
+
/**
|
|
75
|
+
* Whether the list is in a loading state.
|
|
76
|
+
*/
|
|
77
|
+
loading?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* The icon displayed when loading.
|
|
80
|
+
* @defaultValue appConfig.ui.icons.loading
|
|
81
|
+
* @IconifyIcon
|
|
82
|
+
*/
|
|
83
|
+
loadingIcon?: IconProps['name'];
|
|
84
|
+
/**
|
|
85
|
+
* Whether to display a filter input or not.
|
|
86
|
+
* Can be an object to pass additional props to the input.
|
|
87
|
+
* `{ placeholder: 'Search...', variant: 'none' }`{lang="ts-type"}
|
|
88
|
+
* @defaultValue false
|
|
89
|
+
*/
|
|
90
|
+
filter?: boolean | Omit<InputProps, 'modelValue' | 'defaultValue'>;
|
|
91
|
+
/**
|
|
92
|
+
* The fields to filter by.
|
|
93
|
+
* @defaultValue [labelKey]
|
|
94
|
+
*/
|
|
95
|
+
filterFields?: string[];
|
|
96
|
+
/**
|
|
97
|
+
* When `true`, disable the default filters, useful for custom filtering (useAsyncData, useFetch, etc.).
|
|
98
|
+
* @defaultValue false
|
|
99
|
+
*/
|
|
100
|
+
ignoreFilter?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* The icon displayed when an item is selected.
|
|
103
|
+
* @defaultValue appConfig.ui.icons.check
|
|
104
|
+
* @IconifyIcon
|
|
105
|
+
*/
|
|
106
|
+
selectedIcon?: IconProps['name'];
|
|
107
|
+
/**
|
|
108
|
+
* Enable virtualization for large lists.
|
|
109
|
+
* @defaultValue false
|
|
110
|
+
*/
|
|
111
|
+
virtualize?: boolean | {
|
|
112
|
+
/**
|
|
113
|
+
* Number of items rendered outside the visible area
|
|
114
|
+
* @defaultValue 12
|
|
115
|
+
*/
|
|
116
|
+
overscan?: number;
|
|
117
|
+
/**
|
|
118
|
+
* Estimated size (in px) of each item, or a function that returns the size for a given index
|
|
119
|
+
* @defaultValue 32
|
|
120
|
+
*/
|
|
121
|
+
estimateSize?: number | ((index: number) => number);
|
|
122
|
+
};
|
|
123
|
+
/** Highlight the ring color like a focus state. */
|
|
124
|
+
highlight?: boolean;
|
|
125
|
+
autofocus?: boolean;
|
|
126
|
+
autofocusDelay?: number;
|
|
127
|
+
class?: any;
|
|
128
|
+
ui?: Listbox['slots'];
|
|
129
|
+
}
|
|
130
|
+
export type ListboxEmits<T extends ArrayOrNested<ListboxItem> = ArrayOrNested<ListboxItem>, VK extends GetItemKeys<T> | undefined = undefined, M extends boolean = false, Mod extends Omit<ModelModifiers, 'lazy'> = Omit<ModelModifiers, 'lazy'>> = Pick<ListboxRootEmits, 'entryFocus' | 'highlight' | 'leave'> & {
|
|
131
|
+
'change': [event: Event];
|
|
132
|
+
'update:modelValue': [value: ApplyModifiers<GetModelValue<T, VK, M>, Mod>];
|
|
133
|
+
};
|
|
134
|
+
type SlotProps<T> = (props: {
|
|
135
|
+
item: T;
|
|
136
|
+
index: number;
|
|
137
|
+
ui: Listbox['ui'];
|
|
138
|
+
}) => VNode[];
|
|
139
|
+
export type ListboxSlots<T extends ArrayOrNested<ListboxItem> = ArrayOrNested<ListboxItem>> = {
|
|
140
|
+
'loading'?(props?: {}): VNode[];
|
|
141
|
+
'empty'?(props: {
|
|
142
|
+
searchTerm: string;
|
|
143
|
+
}): VNode[];
|
|
144
|
+
'item'?: SlotProps<NestedItem<T>>;
|
|
145
|
+
'item-leading'?: SlotProps<NestedItem<T>>;
|
|
146
|
+
'item-label'?(props: {
|
|
147
|
+
item: NestedItem<T>;
|
|
148
|
+
index: number;
|
|
149
|
+
}): VNode[];
|
|
150
|
+
'item-description'?(props: {
|
|
151
|
+
item: NestedItem<T>;
|
|
152
|
+
index: number;
|
|
153
|
+
}): VNode[];
|
|
154
|
+
'item-trailing'?: SlotProps<NestedItem<T>>;
|
|
155
|
+
};
|
|
156
|
+
declare const _default: typeof __VLS_export;
|
|
157
|
+
export default _default;
|
|
158
|
+
declare const __VLS_export: <T extends ArrayOrNested<ListboxItem>, VK extends GetItemKeys<T> | undefined = undefined, M extends boolean = false, Mod extends Omit<ModelModifiers, "lazy"> = Omit<ModelModifiers, "lazy">>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
159
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(ListboxProps<T, VK, M, Mod> & {
|
|
160
|
+
searchTerm?: string;
|
|
161
|
+
}) & {
|
|
162
|
+
onChange?: ((event: Event) => any) | undefined;
|
|
163
|
+
onHighlight?: ((payload: {
|
|
164
|
+
ref: HTMLElement;
|
|
165
|
+
value: import("reka-ui").AcceptableValue;
|
|
166
|
+
} | undefined) => any) | undefined;
|
|
167
|
+
"onUpdate:modelValue"?: ((value: Mod extends {
|
|
168
|
+
number: true;
|
|
169
|
+
} ? (Mod extends {
|
|
170
|
+
optional: true;
|
|
171
|
+
} ? (Mod extends {
|
|
172
|
+
nullable: true;
|
|
173
|
+
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) | undefined : Mod extends {
|
|
174
|
+
nullable: true;
|
|
175
|
+
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) extends infer T_1 ? T_1 extends (Mod extends {
|
|
176
|
+
optional: true;
|
|
177
|
+
} ? (Mod extends {
|
|
178
|
+
nullable: true;
|
|
179
|
+
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) | undefined : Mod extends {
|
|
180
|
+
nullable: true;
|
|
181
|
+
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) ? T_1 extends string ? number | T_1 : T_1 : never : never : Mod extends {
|
|
182
|
+
optional: true;
|
|
183
|
+
} ? (Mod extends {
|
|
184
|
+
nullable: true;
|
|
185
|
+
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) | undefined : Mod extends {
|
|
186
|
+
nullable: true;
|
|
187
|
+
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) => any) | undefined;
|
|
188
|
+
"onUpdate:searchTerm"?: ((value: string) => any) | undefined;
|
|
189
|
+
onEntryFocus?: ((event: CustomEvent<any>) => any) | undefined;
|
|
190
|
+
onLeave?: ((event: Event) => any) | undefined;
|
|
191
|
+
}> & (typeof globalThis extends {
|
|
192
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
193
|
+
} ? P : {});
|
|
194
|
+
expose: (exposed: {}) => void;
|
|
195
|
+
attrs: any;
|
|
196
|
+
slots: ListboxSlots<T>;
|
|
197
|
+
emit: (((evt: "change", event: Event) => void) & ((evt: "highlight", payload: {
|
|
198
|
+
ref: HTMLElement;
|
|
199
|
+
value: import("reka-ui").AcceptableValue;
|
|
200
|
+
} | undefined) => void) & ((evt: "update:modelValue", value: Mod extends {
|
|
201
|
+
number: true;
|
|
202
|
+
} ? (Mod extends {
|
|
203
|
+
optional: true;
|
|
204
|
+
} ? (Mod extends {
|
|
205
|
+
nullable: true;
|
|
206
|
+
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) | undefined : Mod extends {
|
|
207
|
+
nullable: true;
|
|
208
|
+
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) extends infer T_1 ? T_1 extends (Mod extends {
|
|
209
|
+
optional: true;
|
|
210
|
+
} ? (Mod extends {
|
|
211
|
+
nullable: true;
|
|
212
|
+
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) | undefined : Mod extends {
|
|
213
|
+
nullable: true;
|
|
214
|
+
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) ? T_1 extends string ? number | T_1 : T_1 : never : never : Mod extends {
|
|
215
|
+
optional: true;
|
|
216
|
+
} ? (Mod extends {
|
|
217
|
+
nullable: true;
|
|
218
|
+
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) | undefined : Mod extends {
|
|
219
|
+
nullable: true;
|
|
220
|
+
} ? GetModelValue<T, VK, M, undefined> | null : GetModelValue<T, VK, M, undefined>) => void) & ((evt: "entryFocus", event: CustomEvent<any>) => void) & ((evt: "leave", event: Event) => void)) & ((event: "update:searchTerm", value: string) => void);
|
|
221
|
+
}>) => import("vue").VNode & {
|
|
222
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
223
|
+
};
|
|
224
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
225
|
+
[K in keyof T]: T[K];
|
|
226
|
+
} : {
|
|
227
|
+
[K in keyof T as K]: T[K];
|
|
228
|
+
}) & {};
|
|
@@ -8,6 +8,7 @@ import { DialogRoot, DialogTrigger, DialogPortal, DialogOverlay, DialogContent,
|
|
|
8
8
|
import { reactivePick, createReusableTemplate } from "@vueuse/core";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
10
|
import { useComponentUI } from "../composables/useComponentUI";
|
|
11
|
+
import { FieldGroupReset } from "../composables/useFieldGroup";
|
|
11
12
|
import { useLocale } from "../composables/useLocale";
|
|
12
13
|
import { usePortal } from "../composables/usePortal";
|
|
13
14
|
import { pointerDownOutside } from "../utils/overlay";
|
|
@@ -93,7 +94,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.modal || {} }
|
|
|
93
94
|
<slot name="content" :close="close">
|
|
94
95
|
<div v-if="!!slots.header || (title || !!slots.title) || (description || !!slots.description) || (props.close || !!slots.close)" data-slot="header" :class="ui.header({ class: uiProp?.header })">
|
|
95
96
|
<slot name="header" :close="close">
|
|
96
|
-
<div data-slot="wrapper" :class="ui.wrapper({ class: uiProp?.wrapper })">
|
|
97
|
+
<div v-if="title || !!slots.title || description || !!slots.description" data-slot="wrapper" :class="ui.wrapper({ class: uiProp?.wrapper })">
|
|
97
98
|
<DialogTitle v-if="title || !!slots.title" data-slot="title" :class="ui.title({ class: uiProp?.title })">
|
|
98
99
|
<slot name="title">
|
|
99
100
|
{{ title }}
|
|
@@ -142,17 +143,19 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.modal || {} }
|
|
|
142
143
|
</DialogTrigger>
|
|
143
144
|
|
|
144
145
|
<DialogPortal v-bind="portalProps">
|
|
145
|
-
<
|
|
146
|
-
<
|
|
147
|
-
<
|
|
148
|
-
|
|
149
|
-
|
|
146
|
+
<FieldGroupReset>
|
|
147
|
+
<template v-if="scrollable">
|
|
148
|
+
<DialogOverlay data-slot="overlay" :class="ui.overlay({ class: uiProp?.overlay })">
|
|
149
|
+
<ReuseContentTemplate />
|
|
150
|
+
</DialogOverlay>
|
|
151
|
+
</template>
|
|
150
152
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
+
<template v-else>
|
|
154
|
+
<DialogOverlay v-if="overlay" data-slot="overlay" :class="ui.overlay({ class: uiProp?.overlay })" />
|
|
153
155
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
+
<ReuseContentTemplate />
|
|
157
|
+
</template>
|
|
158
|
+
</FieldGroupReset>
|
|
156
159
|
</DialogPortal>
|
|
157
160
|
</DialogRoot>
|
|
158
161
|
</template>
|
|
@@ -10,6 +10,7 @@ import { Popover, HoverCard } from "reka-ui/namespaced";
|
|
|
10
10
|
import { reactivePick } from "@vueuse/core";
|
|
11
11
|
import { useAppConfig } from "#imports";
|
|
12
12
|
import { useComponentUI } from "../composables/useComponentUI";
|
|
13
|
+
import { FieldGroupReset } from "../composables/useFieldGroup";
|
|
13
14
|
import { usePortal } from "../composables/usePortal";
|
|
14
15
|
import { pointerDownOutside } from "../utils/overlay";
|
|
15
16
|
import { tv } from "../utils/tv";
|
|
@@ -69,11 +70,13 @@ const Component = computed(() => props.mode === "hover" ? HoverCard : Popover);
|
|
|
69
70
|
</Component.Anchor>
|
|
70
71
|
|
|
71
72
|
<Component.Portal v-bind="portalProps">
|
|
72
|
-
<
|
|
73
|
-
<
|
|
73
|
+
<FieldGroupReset>
|
|
74
|
+
<Component.Content v-bind="contentProps" data-slot="content" :class="ui.content({ class: [!slots.default && props.class, uiProp?.content] })" v-on="contentEvents">
|
|
75
|
+
<slot name="content" v-bind="close ? { close } : {}" />
|
|
74
76
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
<Component.Arrow v-if="!!arrow" v-bind="arrowProps" data-slot="arrow" :class="ui.arrow({ class: uiProp?.arrow })" />
|
|
78
|
+
</Component.Content>
|
|
79
|
+
</FieldGroupReset>
|
|
77
80
|
</Component.Portal>
|
|
78
81
|
</Component.Root>
|
|
79
82
|
</template>
|
|
@@ -46,80 +46,82 @@ const [DefineFeatureTemplate, ReuseFeatureTemplate] = createReusableTemplate({
|
|
|
46
46
|
|
|
47
47
|
<template>
|
|
48
48
|
<DefineTierTemplate v-slot="{ tier }">
|
|
49
|
-
<slot :
|
|
50
|
-
<slot name="tier" :tier="tier">
|
|
51
|
-
<
|
|
52
|
-
<div data-slot="
|
|
53
|
-
<slot :
|
|
54
|
-
<slot name="tier-title" :tier="tier">
|
|
55
|
-
|
|
49
|
+
<div data-slot="tierWrapper" :class="ui.tierWrapper({ class: uiProp?.tierWrapper })">
|
|
50
|
+
<slot :name="tier.id" :tier="tier">
|
|
51
|
+
<slot name="tier" :tier="tier">
|
|
52
|
+
<div data-slot="tierTitleWrapper" :class="ui.tierTitleWrapper({ class: uiProp?.tierTitleWrapper })">
|
|
53
|
+
<div data-slot="tierTitle" :class="ui.tierTitle({ class: uiProp?.tierTitle })">
|
|
54
|
+
<slot :name="`${tier.id}-title`" :tier="tier">
|
|
55
|
+
<slot name="tier-title" :tier="tier">
|
|
56
|
+
{{ tier.title }}
|
|
57
|
+
</slot>
|
|
56
58
|
</slot>
|
|
57
|
-
</
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
<slot :name="`${tier.id}-badge`" :tier="tier">
|
|
61
|
-
<slot name="tier-badge" :tier="tier">
|
|
62
|
-
<UBadge
|
|
63
|
-
v-if="tier.badge"
|
|
64
|
-
color="primary"
|
|
65
|
-
variant="subtle"
|
|
66
|
-
v-bind="typeof tier.badge === 'string' ? { label: tier.badge } : tier.badge"
|
|
67
|
-
data-slot="tierBadge"
|
|
68
|
-
:class="ui.tierBadge({ class: uiProp?.tierBadge })"
|
|
69
|
-
/>
|
|
70
|
-
</slot>
|
|
71
|
-
</slot>
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
<div v-if="tier.description || !!slots['tier-description'] || !!slots[`${tier.id}-description`]" data-slot="tierDescription" :class="ui.tierDescription({ class: uiProp?.tierDescription })">
|
|
75
|
-
<slot :name="`${tier.id}-description`" :tier="tier">
|
|
76
|
-
<slot name="tier-description" :tier="tier">
|
|
77
|
-
{{ tier.description }}
|
|
78
|
-
</slot>
|
|
79
|
-
</slot>
|
|
80
|
-
</div>
|
|
59
|
+
</div>
|
|
81
60
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
61
|
+
<slot :name="`${tier.id}-badge`" :tier="tier">
|
|
62
|
+
<slot name="tier-badge" :tier="tier">
|
|
63
|
+
<UBadge
|
|
64
|
+
v-if="tier.badge"
|
|
65
|
+
color="primary"
|
|
66
|
+
variant="subtle"
|
|
67
|
+
v-bind="typeof tier.badge === 'string' ? { label: tier.badge } : tier.badge"
|
|
68
|
+
data-slot="tierBadge"
|
|
69
|
+
:class="ui.tierBadge({ class: uiProp?.tierBadge })"
|
|
70
|
+
/>
|
|
87
71
|
</slot>
|
|
88
72
|
</slot>
|
|
89
73
|
</div>
|
|
90
74
|
|
|
91
|
-
<div
|
|
92
|
-
<slot :name="`${tier.id}-
|
|
93
|
-
<slot name="tier-
|
|
94
|
-
{{ tier.
|
|
75
|
+
<div data-slot="tierDescription" :class="ui.tierDescription({ class: uiProp?.tierDescription })">
|
|
76
|
+
<slot :name="`${tier.id}-description`" :tier="tier">
|
|
77
|
+
<slot name="tier-description" :tier="tier">
|
|
78
|
+
{{ tier.description }}
|
|
95
79
|
</slot>
|
|
96
80
|
</slot>
|
|
97
81
|
</div>
|
|
98
82
|
|
|
99
|
-
<div
|
|
100
|
-
<
|
|
101
|
-
<slot name="tier-
|
|
102
|
-
<
|
|
103
|
-
{{ tier.
|
|
104
|
-
</
|
|
83
|
+
<div data-slot="tierPriceWrapper" :class="ui.tierPriceWrapper({ class: uiProp?.tierPriceWrapper })">
|
|
84
|
+
<div v-if="tier.discount && tier.price || !!slots[`${tier.id}-discount`] || !!slots['tier-discount']" data-slot="tierDiscount" :class="ui.tierDiscount({ class: uiProp?.tierDiscount })">
|
|
85
|
+
<slot :name="`${tier.id}-discount`" :tier="tier">
|
|
86
|
+
<slot name="tier-discount" :tier="tier">
|
|
87
|
+
{{ tier.price }}
|
|
88
|
+
</slot>
|
|
89
|
+
</slot>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<div v-if="tier.discount || tier.price || !!slots[`${tier.id}-price`] || !!slots['tier-price']" data-slot="tierPrice" :class="ui.tierPrice({ class: uiProp?.tierPrice })">
|
|
93
|
+
<slot :name="`${tier.id}-price`" :tier="tier">
|
|
94
|
+
<slot name="tier-price" :tier="tier">
|
|
95
|
+
{{ tier.discount || tier.price }}
|
|
96
|
+
</slot>
|
|
97
|
+
</slot>
|
|
98
|
+
</div>
|
|
105
99
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
100
|
+
<div v-if="tier.billingCycle || tier.billingPeriod || !!slots[`${tier.id}-billing`] || !!slots['tier-billing']" data-slot="tierBilling" :class="ui.tierBilling({ class: uiProp?.tierBilling })">
|
|
101
|
+
<slot :name="`${tier.id}-billing`" :tier="tier">
|
|
102
|
+
<slot name="tier-billing" :tier="tier">
|
|
103
|
+
<span data-slot="tierBillingPeriod" :class="ui.tierBillingPeriod({ class: uiProp?.tierBillingPeriod })">
|
|
104
|
+
{{ tier.billingPeriod || "\xA0" }}
|
|
105
|
+
</span>
|
|
106
|
+
|
|
107
|
+
<span v-if="tier.billingCycle" data-slot="tierBillingCycle" :class="ui.tierBillingCycle({ class: uiProp?.tierBillingCycle })">
|
|
108
|
+
{{ tier.billingCycle }}
|
|
109
|
+
</span>
|
|
110
|
+
</slot>
|
|
109
111
|
</slot>
|
|
110
|
-
</
|
|
112
|
+
</div>
|
|
111
113
|
</div>
|
|
112
|
-
</div>
|
|
113
114
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
<div v-if="!!slots[`${tier.id}-button`] || !!slots['tier-button'] || tier.button" data-slot="tierButton" :class="ui.tierButton({ class: uiProp?.tierButton })">
|
|
116
|
+
<slot :name="`${tier.id}-button`" :tier="tier">
|
|
117
|
+
<slot name="tier-button" :tier="tier">
|
|
118
|
+
<UButton v-if="tier.button" block size="lg" v-bind="tier.button" />
|
|
119
|
+
</slot>
|
|
118
120
|
</slot>
|
|
119
|
-
</
|
|
120
|
-
</
|
|
121
|
+
</div>
|
|
122
|
+
</slot>
|
|
121
123
|
</slot>
|
|
122
|
-
</
|
|
124
|
+
</div>
|
|
123
125
|
</DefineTierTemplate>
|
|
124
126
|
|
|
125
127
|
<DefineFeatureTemplate v-slot="{ feature, tier }">
|
|
@@ -8,6 +8,7 @@ import { RadioGroupRoot, RadioGroupItem as RRadioGroupItem, RadioGroupIndicator,
|
|
|
8
8
|
import { reactivePick } from "@vueuse/core";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
10
|
import { useComponentUI } from "../composables/useComponentUI";
|
|
11
|
+
import { useResolvedVariants } from "../composables/useResolvedVariants";
|
|
11
12
|
import { useFormField } from "../composables/useFormField";
|
|
12
13
|
import { get } from "../utils";
|
|
13
14
|
import { tv } from "../utils/tv";
|
|
@@ -39,13 +40,14 @@ const uiProp = useComponentUI("radioGroup", props);
|
|
|
39
40
|
const rootProps = useForwardPropsEmits(reactivePick(props, "as", "loop", "required"), emits);
|
|
40
41
|
const { emitFormChange, emitFormInput, color, name, size, id: _id, disabled, ariaAttrs } = useFormField(props, { bind: false });
|
|
41
42
|
const id = _id.value ?? useId();
|
|
43
|
+
const { variant } = useResolvedVariants("radioGroup", props, theme, ["variant"]);
|
|
42
44
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.radioGroup || {} })({
|
|
43
45
|
size: size.value,
|
|
44
46
|
color: color.value,
|
|
45
47
|
disabled: disabled.value,
|
|
46
48
|
required: props.required,
|
|
47
49
|
orientation: props.orientation,
|
|
48
|
-
variant:
|
|
50
|
+
variant: variant.value,
|
|
49
51
|
indicator: props.indicator
|
|
50
52
|
}));
|
|
51
53
|
function normalizeItem(item) {
|
|
@@ -108,7 +110,7 @@ function onUpdate(value) {
|
|
|
108
110
|
</slot>
|
|
109
111
|
</legend>
|
|
110
112
|
|
|
111
|
-
<component :is="
|
|
113
|
+
<component :is="variant === 'list' ? 'div' : Label" v-for="item in normalizedItems" :key="item.value" data-slot="item" :class="ui.item({ class: [uiProp?.item, item.ui?.item, item.class], disabled: item.disabled || disabled })">
|
|
112
114
|
<div data-slot="container" :class="ui.container({ class: [uiProp?.container, item.ui?.container] })">
|
|
113
115
|
<RRadioGroupItem
|
|
114
116
|
:id="item.id"
|
|
@@ -122,7 +124,7 @@ function onUpdate(value) {
|
|
|
122
124
|
</div>
|
|
123
125
|
|
|
124
126
|
<div v-if="item.label || !!slots.label || (item.description || !!slots.description)" data-slot="wrapper" :class="ui.wrapper({ class: [uiProp?.wrapper, item.ui?.wrapper] })">
|
|
125
|
-
<component :is="
|
|
127
|
+
<component :is="variant === 'list' ? Label : 'p'" v-if="item.label || !!slots.label" :for="item.id" data-slot="label" :class="ui.label({ class: [uiProp?.label, item.ui?.label], disabled: item.disabled || disabled })">
|
|
126
128
|
<slot name="label" :item="item" :model-value="modelValue">
|
|
127
129
|
{{ item.label }}
|
|
128
130
|
</slot>
|
|
@@ -183,7 +183,7 @@ declare const __VLS_export: <T extends ArrayOrNested<SelectItem>, VK extends Get
|
|
|
183
183
|
} ? P : {});
|
|
184
184
|
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
185
185
|
triggerRef: Readonly<import("vue").Ref<HTMLButtonElement, HTMLButtonElement>>;
|
|
186
|
-
viewportRef: Readonly<import("vue").Ref<
|
|
186
|
+
viewportRef: Readonly<import("vue").Ref<HTMLElement | null, HTMLElement | null>>;
|
|
187
187
|
}>) => void;
|
|
188
188
|
attrs: any;
|
|
189
189
|
slots: SelectSlots<T, VK, M, Mod, NestedItem<T>>;
|