@nuxt/ui 4.0.0-alpha.1 → 4.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nuxt/ui/content/content-navigation.ts +2 -1
- package/.nuxt/ui/marquee.ts +1 -1
- package/.nuxt/ui/progress.ts +3 -3
- package/.nuxt/ui/prose/code-tree.ts +1 -1
- package/.nuxt/ui/tree.ts +1 -1
- package/README.md +13 -1
- package/dist/module.d.mts +6 -6
- package/dist/module.json +2 -2
- package/dist/module.mjs +8 -6
- package/dist/runtime/components/Accordion.d.vue.ts +79 -0
- package/dist/runtime/components/Accordion.vue +3 -3
- package/dist/runtime/components/Accordion.vue.d.ts +2 -2
- package/dist/runtime/components/Alert.d.vue.ts +81 -0
- package/dist/runtime/components/App.d.vue.ts +25 -0
- package/dist/runtime/components/AuthForm.d.vue.ts +128 -0
- package/dist/runtime/components/AuthForm.vue.d.ts +39 -1
- package/dist/runtime/components/Avatar.d.vue.ts +41 -0
- package/dist/runtime/components/AvatarGroup.d.vue.ts +31 -0
- package/dist/runtime/components/Badge.d.vue.ts +43 -0
- package/dist/runtime/components/Banner.d.vue.ts +72 -0
- package/dist/runtime/components/Banner.vue +1 -1
- package/dist/runtime/components/BlogPost.d.vue.ts +60 -0
- package/dist/runtime/components/BlogPosts.d.vue.ts +31 -0
- package/dist/runtime/components/Breadcrumb.d.vue.ts +67 -0
- package/dist/runtime/components/Breadcrumb.vue +1 -1
- package/dist/runtime/components/Breadcrumb.vue.d.ts +2 -2
- package/dist/runtime/components/Button.d.vue.ts +44 -0
- package/dist/runtime/components/Calendar.d.vue.ts +112 -0
- package/dist/runtime/components/Card.d.vue.ts +29 -0
- package/dist/runtime/components/Carousel.d.vue.ts +127 -0
- package/dist/runtime/components/Carousel.vue.d.ts +10 -10
- package/dist/runtime/components/ChangelogVersion.d.vue.ts +59 -0
- package/dist/runtime/components/ChangelogVersions.d.vue.ts +78 -0
- package/dist/runtime/components/ChangelogVersions.vue +2 -2
- package/dist/runtime/components/ChatMessage.d.vue.ts +67 -0
- package/dist/runtime/components/ChatMessages.d.vue.ts +83 -0
- package/dist/runtime/components/ChatMessages.vue +2 -2
- package/dist/runtime/components/ChatPalette.d.vue.ts +24 -0
- package/dist/runtime/components/ChatPrompt.d.vue.ts +61 -0
- package/dist/runtime/components/ChatPrompt.vue +2 -2
- package/dist/runtime/components/ChatPromptSubmit.d.vue.ts +100 -0
- package/dist/runtime/components/Checkbox.d.vue.ts +74 -0
- package/dist/runtime/components/CheckboxGroup.d.vue.ts +89 -0
- package/dist/runtime/components/CheckboxGroup.vue +8 -8
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +17 -13
- package/dist/runtime/components/Chip.d.vue.ts +57 -0
- package/dist/runtime/components/Collapsible.d.vue.ts +35 -0
- package/dist/runtime/components/ColorPicker.d.vue.ts +48 -0
- package/dist/runtime/components/CommandPalette.d.vue.ts +193 -0
- package/dist/runtime/components/CommandPalette.vue +5 -4
- package/dist/runtime/components/CommandPalette.vue.d.ts +2 -1
- package/dist/runtime/components/Container.d.vue.ts +18 -0
- package/dist/runtime/components/ContextMenu.d.vue.ts +110 -0
- package/dist/runtime/components/ContextMenu.vue +2 -2
- package/dist/runtime/components/ContextMenu.vue.d.ts +2 -2
- package/dist/runtime/components/ContextMenuContent.d.vue.ts +50 -0
- package/dist/runtime/components/ContextMenuContent.vue +2 -2
- package/dist/runtime/components/ContextMenuContent.vue.d.ts +2 -2
- package/dist/runtime/components/DashboardGroup.d.vue.ts +24 -0
- package/dist/runtime/components/DashboardNavbar.d.vue.ts +52 -0
- package/dist/runtime/components/DashboardPanel.d.vue.ts +30 -0
- package/dist/runtime/components/DashboardResizeHandle.d.vue.ts +18 -0
- package/dist/runtime/components/DashboardSearch.d.vue.ts +91 -0
- package/dist/runtime/components/DashboardSearch.vue +2 -2
- package/dist/runtime/components/DashboardSearchButton.d.vue.ts +59 -0
- package/dist/runtime/components/DashboardSearchButton.vue +2 -2
- package/dist/runtime/components/DashboardSidebar.d.vue.ts +75 -0
- package/dist/runtime/components/DashboardSidebarCollapse.d.vue.ts +19 -0
- package/dist/runtime/components/DashboardSidebarToggle.d.vue.ts +19 -0
- package/dist/runtime/components/DashboardToolbar.d.vue.ts +25 -0
- package/dist/runtime/components/Drawer.d.vue.ts +84 -0
- package/dist/runtime/components/DropdownMenu.d.vue.ts +120 -0
- package/dist/runtime/components/DropdownMenu.vue +2 -2
- package/dist/runtime/components/DropdownMenu.vue.d.ts +2 -2
- package/dist/runtime/components/DropdownMenuContent.d.vue.ts +56 -0
- package/dist/runtime/components/DropdownMenuContent.vue +2 -2
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +2 -2
- package/dist/runtime/components/Error.d.vue.ts +47 -0
- package/dist/runtime/components/FieldGroup.d.vue.ts +34 -0
- package/dist/runtime/components/FileUpload.d.vue.ts +166 -0
- package/dist/runtime/components/FileUpload.vue +1 -0
- package/dist/runtime/components/Footer.d.vue.ts +29 -0
- package/dist/runtime/components/FooterColumns.d.vue.ts +57 -0
- package/dist/runtime/components/Form.d.vue.ts +114 -0
- package/dist/runtime/components/Form.vue +111 -52
- package/dist/runtime/components/Form.vue.d.ts +54 -11
- package/dist/runtime/components/FormField.d.vue.ts +61 -0
- package/dist/runtime/components/Header.d.vue.ts +68 -0
- package/dist/runtime/components/Icon.d.vue.ts +8 -0
- package/dist/runtime/components/Input.d.vue.ts +74 -0
- package/dist/runtime/components/Input.vue.d.ts +4 -3
- 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 +4 -4
- package/dist/runtime/components/InputNumber.d.vue.ts +188 -0
- package/dist/runtime/components/InputNumber.vue +2 -2
- package/dist/runtime/components/InputNumber.vue.d.ts +0 -2
- package/dist/runtime/components/InputTags.d.vue.ts +186 -0
- package/dist/runtime/components/Kbd.d.vue.ts +38 -0
- package/dist/runtime/components/Link.d.vue.ts +91 -0
- package/dist/runtime/components/LinkBase.d.vue.ts +25 -0
- package/dist/runtime/components/Main.d.vue.ts +20 -0
- package/dist/runtime/components/Marquee.d.vue.ts +32 -0
- package/dist/runtime/components/Marquee.vue +1 -1
- package/dist/runtime/components/Modal.d.vue.ts +107 -0
- package/dist/runtime/components/NavigationMenu.d.vue.ts +171 -0
- package/dist/runtime/components/NavigationMenu.vue.d.ts +2 -2
- package/dist/runtime/components/OverlayProvider.d.vue.ts +2 -0
- package/dist/runtime/components/Page.d.vue.ts +25 -0
- package/dist/runtime/components/PageAnchors.d.vue.ts +47 -0
- package/dist/runtime/components/PageAside.d.vue.ts +27 -0
- package/dist/runtime/components/PageBody.d.vue.ts +18 -0
- package/dist/runtime/components/PageCTA.d.vue.ts +56 -0
- package/dist/runtime/components/PageCard.d.vue.ts +72 -0
- package/dist/runtime/components/PageColumns.d.vue.ts +18 -0
- package/dist/runtime/components/PageFeature.d.vue.ts +44 -0
- package/dist/runtime/components/PageGrid.d.vue.ts +18 -0
- package/dist/runtime/components/PageHeader.d.vue.ts +36 -0
- package/dist/runtime/components/PageHero.d.vue.ts +53 -0
- package/dist/runtime/components/PageLinks.d.vue.ts +49 -0
- package/dist/runtime/components/PageList.d.vue.ts +21 -0
- package/dist/runtime/components/PageLogos.d.vue.ts +33 -0
- package/dist/runtime/components/PageSection.d.vue.ts +68 -0
- package/dist/runtime/components/Pagination.d.vue.ts +118 -0
- package/dist/runtime/components/PinInput.d.vue.ts +60 -0
- package/dist/runtime/components/Popover.d.vue.ts +71 -0
- package/dist/runtime/components/PricingPlan.d.vue.ts +112 -0
- package/dist/runtime/components/PricingPlans.d.vue.ts +44 -0
- package/dist/runtime/components/PricingTable.d.vue.ts +105 -0
- package/dist/runtime/components/Progress.d.vue.ts +66 -0
- package/dist/runtime/components/Progress.vue +2 -3
- package/dist/runtime/components/RadioGroup.d.vue.ts +99 -0
- package/dist/runtime/components/RadioGroup.vue +13 -11
- package/dist/runtime/components/RadioGroup.vue.d.ts +17 -13
- package/dist/runtime/components/Select.d.vue.ts +254 -0
- package/dist/runtime/components/Select.vue +3 -3
- package/dist/runtime/components/Select.vue.d.ts +5 -5
- package/dist/runtime/components/SelectMenu.d.vue.ts +303 -0
- package/dist/runtime/components/SelectMenu.vue.d.ts +4 -4
- package/dist/runtime/components/Separator.d.vue.ts +54 -0
- package/dist/runtime/components/Skeleton.d.vue.ts +17 -0
- package/dist/runtime/components/Slideover.d.vue.ts +108 -0
- package/dist/runtime/components/Slider.d.vue.ts +57 -0
- package/dist/runtime/components/Stepper.d.vue.ts +87 -0
- package/dist/runtime/components/Switch.d.vue.ts +71 -0
- package/dist/runtime/components/Table.d.vue.ts +201 -0
- package/dist/runtime/components/Table.vue.d.ts +26 -26
- package/dist/runtime/components/Tabs.d.vue.ts +99 -0
- package/dist/runtime/components/Tabs.vue +10 -3
- package/dist/runtime/components/Tabs.vue.d.ts +2 -2
- package/dist/runtime/components/Textarea.d.vue.ts +74 -0
- package/dist/runtime/components/Timeline.d.vue.ts +71 -0
- package/dist/runtime/components/Toast.d.vue.ts +165 -0
- package/dist/runtime/components/Toaster.d.vue.ts +44 -0
- package/dist/runtime/components/Tooltip.d.vue.ts +57 -0
- package/dist/runtime/components/Tree.d.vue.ts +116 -0
- package/dist/runtime/components/Tree.vue +68 -40
- package/dist/runtime/components/Tree.vue.d.ts +1 -1
- package/dist/runtime/components/User.d.vue.ts +47 -0
- package/dist/runtime/components/color-mode/ColorModeAvatar.d.vue.ts +7 -0
- package/dist/runtime/components/color-mode/ColorModeButton.d.vue.ts +23 -0
- package/dist/runtime/components/color-mode/ColorModeImage.d.vue.ts +6 -0
- package/dist/runtime/components/color-mode/ColorModeSelect.d.vue.ts +5 -0
- package/dist/runtime/components/color-mode/ColorModeSwitch.d.vue.ts +5 -0
- package/dist/runtime/components/content/ContentNavigation.d.vue.ts +102 -0
- package/dist/runtime/components/content/ContentNavigation.vue +5 -4
- package/dist/runtime/components/content/ContentNavigation.vue.d.ts +2 -2
- package/dist/runtime/components/content/ContentSearch.d.vue.ts +114 -0
- package/dist/runtime/components/content/ContentSearch.vue +2 -2
- package/dist/runtime/components/content/ContentSearchButton.d.vue.ts +59 -0
- package/dist/runtime/components/content/ContentSearchButton.vue +2 -2
- package/dist/runtime/components/content/ContentSurround.d.vue.ts +59 -0
- package/dist/runtime/components/content/ContentToc.d.vue.ts +88 -0
- package/dist/runtime/components/locale/LocaleSelect.d.vue.ts +15 -0
- package/dist/runtime/components/prose/A.d.vue.ts +15 -0
- package/dist/runtime/components/prose/Accordion.d.vue.ts +16 -0
- package/dist/runtime/components/prose/AccordionItem.d.vue.ts +15 -0
- package/dist/runtime/components/prose/Badge.d.vue.ts +13 -0
- package/dist/runtime/components/prose/Blockquote.d.vue.ts +13 -0
- package/dist/runtime/components/prose/Callout.d.vue.ts +26 -0
- package/dist/runtime/components/prose/Card.d.vue.ts +29 -0
- package/dist/runtime/components/prose/CardGroup.d.vue.ts +13 -0
- package/dist/runtime/components/prose/Code.d.vue.ts +22 -0
- package/dist/runtime/components/prose/CodeCollapse.d.vue.ts +47 -0
- package/dist/runtime/components/prose/CodeGroup.d.vue.ts +37 -0
- package/dist/runtime/components/prose/CodeIcon.d.vue.ts +7 -0
- package/dist/runtime/components/prose/CodePreview.d.vue.ts +19 -0
- package/dist/runtime/components/prose/CodeTree.d.vue.ts +28 -0
- package/dist/runtime/components/prose/CodeTree.vue +38 -31
- package/dist/runtime/components/prose/Collapsible.d.vue.ts +39 -0
- package/dist/runtime/components/prose/Em.d.vue.ts +13 -0
- package/dist/runtime/components/prose/Field.d.vue.ts +39 -0
- package/dist/runtime/components/prose/FieldGroup.d.vue.ts +18 -0
- package/dist/runtime/components/prose/H1.d.vue.ts +19 -0
- package/dist/runtime/components/prose/H2.d.vue.ts +19 -0
- package/dist/runtime/components/prose/H3.d.vue.ts +19 -0
- package/dist/runtime/components/prose/H4.d.vue.ts +19 -0
- package/dist/runtime/components/prose/Hr.d.vue.ts +5 -0
- package/dist/runtime/components/prose/Icon.d.vue.ts +6 -0
- package/dist/runtime/components/prose/Img.d.vue.ts +21 -0
- package/dist/runtime/components/prose/Kbd.d.vue.ts +6 -0
- package/dist/runtime/components/prose/Li.d.vue.ts +13 -0
- package/dist/runtime/components/prose/Ol.d.vue.ts +13 -0
- package/dist/runtime/components/prose/P.d.vue.ts +13 -0
- package/dist/runtime/components/prose/Pre.d.vue.ts +26 -0
- package/dist/runtime/components/prose/Script.d.vue.ts +5 -0
- package/dist/runtime/components/prose/Steps.d.vue.ts +22 -0
- package/dist/runtime/components/prose/Strong.d.vue.ts +13 -0
- package/dist/runtime/components/prose/Table.d.vue.ts +18 -0
- package/dist/runtime/components/prose/Tabs.d.vue.ts +36 -0
- package/dist/runtime/components/prose/TabsItem.d.vue.ts +15 -0
- package/dist/runtime/components/prose/Tbody.d.vue.ts +13 -0
- package/dist/runtime/components/prose/Td.d.vue.ts +13 -0
- package/dist/runtime/components/prose/Th.d.vue.ts +13 -0
- package/dist/runtime/components/prose/Thead.d.vue.ts +13 -0
- package/dist/runtime/components/prose/Tr.d.vue.ts +13 -0
- package/dist/runtime/components/prose/Ul.d.vue.ts +13 -0
- package/dist/runtime/components/prose/callout/Caution.d.vue.ts +14 -0
- package/dist/runtime/components/prose/callout/Note.d.vue.ts +14 -0
- package/dist/runtime/components/prose/callout/Tip.d.vue.ts +14 -0
- package/dist/runtime/components/prose/callout/Warning.d.vue.ts +14 -0
- package/dist/runtime/composables/useFormField.d.ts +1 -0
- package/dist/runtime/composables/useFormField.js +1 -0
- package/dist/runtime/inertia/components/Link.d.vue.ts +63 -0
- package/dist/runtime/inertia/components/LinkBase.d.vue.ts +25 -0
- package/dist/runtime/locale/de_ch.d.ts +3 -0
- package/dist/runtime/locale/de_ch.js +129 -0
- package/dist/runtime/locale/id.js +1 -1
- package/dist/runtime/locale/index.d.ts +2 -0
- package/dist/runtime/locale/index.js +2 -0
- package/dist/runtime/locale/ka.d.ts +3 -0
- package/dist/runtime/locale/ka.js +132 -0
- package/dist/runtime/types/form.d.ts +9 -8
- package/dist/runtime/types/form.js +1 -3
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/utils.d.ts +7 -3
- package/dist/runtime/utils/form.d.ts +2 -0
- package/dist/runtime/utils/form.js +28 -0
- package/dist/runtime/utils/fuse.d.ts +2 -1
- package/dist/runtime/utils/index.d.ts +3 -3
- package/dist/runtime/utils/index.js +6 -3
- package/dist/runtime/vue/components/Icon.d.vue.ts +6 -0
- package/dist/runtime/vue/components/Link.d.vue.ts +93 -0
- package/dist/runtime/vue/components/color-mode/ColorModeButton.d.vue.ts +16 -0
- package/dist/runtime/vue/components/color-mode/ColorModeSelect.d.vue.ts +5 -0
- package/dist/runtime/vue/components/color-mode/ColorModeSwitch.d.vue.ts +5 -0
- package/dist/shared/{ui.BEZXPd3d.mjs → ui.Bs5uUhtm.mjs} +17 -12
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +21 -34
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { CheckboxGroupRootProps, CheckboxGroupRootEmits } from 'reka-ui';
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
3
|
+
import theme from '#build/ui/checkbox-group';
|
|
4
|
+
import type { CheckboxProps } from '../types';
|
|
5
|
+
import type { AcceptableValue, GetItemKeys, GetModelValue } from '../types/utils';
|
|
6
|
+
import type { ComponentConfig } from '../types/tv';
|
|
7
|
+
type CheckboxGroup = ComponentConfig<typeof theme, AppConfig, 'checkboxGroup'>;
|
|
8
|
+
export type CheckboxGroupValue = AcceptableValue;
|
|
9
|
+
export type CheckboxGroupItem = CheckboxGroupValue | {
|
|
10
|
+
label?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
value?: string;
|
|
14
|
+
class?: any;
|
|
15
|
+
ui?: Pick<CheckboxGroup['slots'], 'item'> & Omit<Required<CheckboxProps>['ui'], 'root'>;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
|
+
export interface CheckboxGroupProps<T extends CheckboxGroupItem[] = CheckboxGroupItem[], VK extends GetItemKeys<T> = 'value'> extends Pick<CheckboxGroupRootProps, 'disabled' | 'loop' | 'name' | 'required'>, Pick<CheckboxProps, 'color' | 'indicator' | 'icon'> {
|
|
19
|
+
/**
|
|
20
|
+
* The element or component this component should render as.
|
|
21
|
+
* @defaultValue 'div'
|
|
22
|
+
*/
|
|
23
|
+
as?: any;
|
|
24
|
+
legend?: string;
|
|
25
|
+
/**
|
|
26
|
+
* When `items` is an array of objects, select the field to use as the value.
|
|
27
|
+
* @defaultValue 'value'
|
|
28
|
+
*/
|
|
29
|
+
valueKey?: VK;
|
|
30
|
+
/**
|
|
31
|
+
* When `items` is an array of objects, select the field to use as the label.
|
|
32
|
+
* @defaultValue 'label'
|
|
33
|
+
*/
|
|
34
|
+
labelKey?: GetItemKeys<T>;
|
|
35
|
+
/**
|
|
36
|
+
* When `items` is an array of objects, select the field to use as the description.
|
|
37
|
+
* @defaultValue 'description'
|
|
38
|
+
*/
|
|
39
|
+
descriptionKey?: GetItemKeys<T>;
|
|
40
|
+
items?: T;
|
|
41
|
+
/** The controlled value of the CheckboxGroup. Can be bind as `v-model`. */
|
|
42
|
+
modelValue?: GetModelValue<T, VK, true>;
|
|
43
|
+
/** The value of the CheckboxGroup when initially rendered. Use when you do not need to control the state of the CheckboxGroup. */
|
|
44
|
+
defaultValue?: GetModelValue<T, VK, true>;
|
|
45
|
+
/**
|
|
46
|
+
* @defaultValue 'md'
|
|
47
|
+
*/
|
|
48
|
+
size?: CheckboxGroup['variants']['size'];
|
|
49
|
+
/**
|
|
50
|
+
* @defaultValue 'list'
|
|
51
|
+
*/
|
|
52
|
+
variant?: CheckboxGroup['variants']['variant'];
|
|
53
|
+
/**
|
|
54
|
+
* The orientation the checkbox buttons are laid out.
|
|
55
|
+
* @defaultValue 'vertical'
|
|
56
|
+
*/
|
|
57
|
+
orientation?: CheckboxGroupRootProps['orientation'];
|
|
58
|
+
class?: any;
|
|
59
|
+
ui?: CheckboxGroup['slots'] & CheckboxProps['ui'];
|
|
60
|
+
}
|
|
61
|
+
export type CheckboxGroupEmits = CheckboxGroupRootEmits & {
|
|
62
|
+
change: [event: Event];
|
|
63
|
+
};
|
|
64
|
+
type SlotProps<T extends CheckboxGroupItem> = (props: {
|
|
65
|
+
item: T & {
|
|
66
|
+
id: string;
|
|
67
|
+
};
|
|
68
|
+
}) => any;
|
|
69
|
+
export interface CheckboxGroupSlots<T extends CheckboxGroupItem[] = CheckboxGroupItem[]> {
|
|
70
|
+
legend(props?: {}): any;
|
|
71
|
+
label: SlotProps<T[number]>;
|
|
72
|
+
description: SlotProps<T[number]>;
|
|
73
|
+
}
|
|
74
|
+
declare const _default: <T extends CheckboxGroupItem[], VK extends GetItemKeys<T> = "value">(__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<{
|
|
75
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
76
|
+
readonly onChange?: ((event: Event) => any) | undefined;
|
|
77
|
+
readonly "onUpdate:modelValue"?: ((value: import("reka-ui").AcceptableValue[]) => any) | undefined;
|
|
78
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onChange" | "onUpdate:modelValue"> & CheckboxGroupProps<T, VK> & {}> & import("vue").PublicProps;
|
|
79
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
80
|
+
attrs: any;
|
|
81
|
+
slots: CheckboxGroupSlots<T>;
|
|
82
|
+
emit: ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", value: import("reka-ui").AcceptableValue[]) => void);
|
|
83
|
+
}>) => import("vue").VNode & {
|
|
84
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
85
|
+
};
|
|
86
|
+
export default _default;
|
|
87
|
+
type __VLS_PrettifyLocal<T> = {
|
|
88
|
+
[K in keyof T as K]: T[K];
|
|
89
|
+
} & {};
|
|
@@ -14,19 +14,19 @@ import UCheckbox from "./Checkbox.vue";
|
|
|
14
14
|
const props = defineProps({
|
|
15
15
|
as: { type: null, required: false },
|
|
16
16
|
legend: { type: String, required: false },
|
|
17
|
-
valueKey: { type:
|
|
18
|
-
labelKey: { type:
|
|
19
|
-
descriptionKey: { type:
|
|
20
|
-
items: { type:
|
|
17
|
+
valueKey: { type: null, required: false, default: "value" },
|
|
18
|
+
labelKey: { type: null, required: false, default: "label" },
|
|
19
|
+
descriptionKey: { type: null, required: false, default: "description" },
|
|
20
|
+
items: { type: null, required: false },
|
|
21
|
+
modelValue: { type: null, required: false },
|
|
22
|
+
defaultValue: { type: null, required: false },
|
|
21
23
|
size: { type: null, required: false },
|
|
22
24
|
variant: { type: null, required: false },
|
|
23
25
|
orientation: { type: null, required: false, default: "vertical" },
|
|
24
26
|
class: { type: null, required: false },
|
|
25
27
|
ui: { type: void 0, required: false },
|
|
26
|
-
defaultValue: { type: Array, required: false },
|
|
27
28
|
disabled: { type: Boolean, required: false },
|
|
28
29
|
loop: { type: Boolean, required: false },
|
|
29
|
-
modelValue: { type: Array, required: false },
|
|
30
30
|
name: { type: String, required: false },
|
|
31
31
|
required: { type: Boolean, required: false },
|
|
32
32
|
color: { type: null, required: false },
|
|
@@ -38,7 +38,7 @@ const slots = defineSlots();
|
|
|
38
38
|
const appConfig = useAppConfig();
|
|
39
39
|
const rootProps = useForwardPropsEmits(reactivePick(props, "as", "modelValue", "defaultValue", "orientation", "loop", "required"), emits);
|
|
40
40
|
const checkboxProps = useForwardProps(reactivePick(props, "variant", "indicator", "icon"));
|
|
41
|
-
const
|
|
41
|
+
const getProxySlots = () => omit(slots, ["legend"]);
|
|
42
42
|
const { emitFormChange, emitFormInput, color, name, size, id: _id, disabled, ariaAttrs } = useFormField(props, { bind: false });
|
|
43
43
|
const id = _id.value ?? useId();
|
|
44
44
|
const ui = computed(() => tv({ extend: theme, ...appConfig.ui?.checkboxGroup || {} })({
|
|
@@ -115,7 +115,7 @@ function onUpdate(value) {
|
|
|
115
115
|
:ui="{ ...props.ui ? omit(props.ui, ['root']) : void 0, ...item.ui || {} }"
|
|
116
116
|
:class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })"
|
|
117
117
|
>
|
|
118
|
-
<template v-for="(_, name) in
|
|
118
|
+
<template v-for="(_, name) in getProxySlots()" #[name]>
|
|
119
119
|
<slot :name="name" :item="item" />
|
|
120
120
|
</template>
|
|
121
121
|
</UCheckbox>
|
|
@@ -2,11 +2,11 @@ import type { CheckboxGroupRootProps, CheckboxGroupRootEmits } from 'reka-ui';
|
|
|
2
2
|
import type { AppConfig } from '@nuxt/schema';
|
|
3
3
|
import theme from '#build/ui/checkbox-group';
|
|
4
4
|
import type { CheckboxProps } from '../types';
|
|
5
|
-
import type { AcceptableValue } from '../types/utils';
|
|
5
|
+
import type { AcceptableValue, GetItemKeys, GetModelValue } from '../types/utils';
|
|
6
6
|
import type { ComponentConfig } from '../types/tv';
|
|
7
7
|
type CheckboxGroup = ComponentConfig<typeof theme, AppConfig, 'checkboxGroup'>;
|
|
8
8
|
export type CheckboxGroupValue = AcceptableValue;
|
|
9
|
-
export type CheckboxGroupItem = {
|
|
9
|
+
export type CheckboxGroupItem = CheckboxGroupValue | {
|
|
10
10
|
label?: string;
|
|
11
11
|
description?: string;
|
|
12
12
|
disabled?: boolean;
|
|
@@ -14,8 +14,8 @@ export type CheckboxGroupItem = {
|
|
|
14
14
|
class?: any;
|
|
15
15
|
ui?: Pick<CheckboxGroup['slots'], 'item'> & Omit<Required<CheckboxProps>['ui'], 'root'>;
|
|
16
16
|
[key: string]: any;
|
|
17
|
-
}
|
|
18
|
-
export interface CheckboxGroupProps<T extends CheckboxGroupItem = CheckboxGroupItem> extends Pick<CheckboxGroupRootProps, '
|
|
17
|
+
};
|
|
18
|
+
export interface CheckboxGroupProps<T extends CheckboxGroupItem[] = CheckboxGroupItem[], VK extends GetItemKeys<T> = 'value'> extends Pick<CheckboxGroupRootProps, 'disabled' | 'loop' | 'name' | 'required'>, Pick<CheckboxProps, 'color' | 'indicator' | 'icon'> {
|
|
19
19
|
/**
|
|
20
20
|
* The element or component this component should render as.
|
|
21
21
|
* @defaultValue 'div'
|
|
@@ -26,18 +26,22 @@ export interface CheckboxGroupProps<T extends CheckboxGroupItem = CheckboxGroupI
|
|
|
26
26
|
* When `items` is an array of objects, select the field to use as the value.
|
|
27
27
|
* @defaultValue 'value'
|
|
28
28
|
*/
|
|
29
|
-
valueKey?:
|
|
29
|
+
valueKey?: VK;
|
|
30
30
|
/**
|
|
31
31
|
* When `items` is an array of objects, select the field to use as the label.
|
|
32
32
|
* @defaultValue 'label'
|
|
33
33
|
*/
|
|
34
|
-
labelKey?:
|
|
34
|
+
labelKey?: GetItemKeys<T>;
|
|
35
35
|
/**
|
|
36
36
|
* When `items` is an array of objects, select the field to use as the description.
|
|
37
37
|
* @defaultValue 'description'
|
|
38
38
|
*/
|
|
39
|
-
descriptionKey?:
|
|
40
|
-
items?: T
|
|
39
|
+
descriptionKey?: GetItemKeys<T>;
|
|
40
|
+
items?: T;
|
|
41
|
+
/** The controlled value of the CheckboxGroup. Can be bind as `v-model`. */
|
|
42
|
+
modelValue?: GetModelValue<T, VK, true>;
|
|
43
|
+
/** The value of the CheckboxGroup when initially rendered. Use when you do not need to control the state of the CheckboxGroup. */
|
|
44
|
+
defaultValue?: GetModelValue<T, VK, true>;
|
|
41
45
|
/**
|
|
42
46
|
* @defaultValue 'md'
|
|
43
47
|
*/
|
|
@@ -62,16 +66,16 @@ type SlotProps<T extends CheckboxGroupItem> = (props: {
|
|
|
62
66
|
id: string;
|
|
63
67
|
};
|
|
64
68
|
}) => any;
|
|
65
|
-
export interface CheckboxGroupSlots<T extends CheckboxGroupItem = CheckboxGroupItem> {
|
|
69
|
+
export interface CheckboxGroupSlots<T extends CheckboxGroupItem[] = CheckboxGroupItem[]> {
|
|
66
70
|
legend(props?: {}): any;
|
|
67
|
-
label: SlotProps<T>;
|
|
68
|
-
description: SlotProps<T>;
|
|
71
|
+
label: SlotProps<T[number]>;
|
|
72
|
+
description: SlotProps<T[number]>;
|
|
69
73
|
}
|
|
70
|
-
declare const _default: <T extends CheckboxGroupItem>(__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<{
|
|
74
|
+
declare const _default: <T extends CheckboxGroupItem[], VK extends GetItemKeys<T> = "value">(__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<{
|
|
71
75
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
72
76
|
readonly onChange?: ((event: Event) => any) | undefined;
|
|
73
77
|
readonly "onUpdate:modelValue"?: ((value: import("reka-ui").AcceptableValue[]) => any) | undefined;
|
|
74
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onChange" | "onUpdate:modelValue"> & CheckboxGroupProps<T> & {}> & import("vue").PublicProps;
|
|
78
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onChange" | "onUpdate:modelValue"> & CheckboxGroupProps<T, VK> & {}> & import("vue").PublicProps;
|
|
75
79
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
76
80
|
attrs: any;
|
|
77
81
|
slots: CheckboxGroupSlots<T>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
+
import theme from '#build/ui/chip';
|
|
3
|
+
import type { ComponentConfig } from '../types/tv';
|
|
4
|
+
type Chip = ComponentConfig<typeof theme, AppConfig, 'chip'>;
|
|
5
|
+
export interface ChipProps {
|
|
6
|
+
/**
|
|
7
|
+
* The element or component this component should render as.
|
|
8
|
+
* @defaultValue 'div'
|
|
9
|
+
*/
|
|
10
|
+
as?: any;
|
|
11
|
+
/** Display some text inside the chip. */
|
|
12
|
+
text?: string | number;
|
|
13
|
+
/**
|
|
14
|
+
* @defaultValue 'primary'
|
|
15
|
+
*/
|
|
16
|
+
color?: Chip['variants']['color'];
|
|
17
|
+
/**
|
|
18
|
+
* @defaultValue 'md'
|
|
19
|
+
*/
|
|
20
|
+
size?: Chip['variants']['size'];
|
|
21
|
+
/**
|
|
22
|
+
* The position of the chip.
|
|
23
|
+
* @defaultValue 'top-right'
|
|
24
|
+
*/
|
|
25
|
+
position?: Chip['variants']['position'];
|
|
26
|
+
/** When `true`, keep the chip inside the component for rounded elements. */
|
|
27
|
+
inset?: boolean;
|
|
28
|
+
/** When `true`, render the chip relatively to the parent. */
|
|
29
|
+
standalone?: boolean;
|
|
30
|
+
class?: any;
|
|
31
|
+
ui?: Chip['slots'];
|
|
32
|
+
}
|
|
33
|
+
export interface ChipEmits {
|
|
34
|
+
'update:show': [value: boolean];
|
|
35
|
+
}
|
|
36
|
+
export interface ChipSlots {
|
|
37
|
+
default(props?: {}): any;
|
|
38
|
+
content(props?: {}): any;
|
|
39
|
+
}
|
|
40
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ChipProps & {
|
|
41
|
+
show?: boolean;
|
|
42
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
43
|
+
"update:show": (value: boolean) => any;
|
|
44
|
+
}, string, import("vue").PublicProps, Readonly<ChipProps & {
|
|
45
|
+
show?: boolean;
|
|
46
|
+
}> & Readonly<{
|
|
47
|
+
"onUpdate:show"?: ((value: boolean) => any) | undefined;
|
|
48
|
+
}>, {
|
|
49
|
+
inset: boolean;
|
|
50
|
+
standalone: boolean;
|
|
51
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ChipSlots>;
|
|
52
|
+
export default _default;
|
|
53
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
54
|
+
new (): {
|
|
55
|
+
$slots: S;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CollapsibleRootProps, CollapsibleRootEmits } from 'reka-ui';
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
3
|
+
import theme from '#build/ui/collapsible';
|
|
4
|
+
import type { ComponentConfig } from '../types/tv';
|
|
5
|
+
type Collapsible = ComponentConfig<typeof theme, AppConfig, 'collapsible'>;
|
|
6
|
+
export interface CollapsibleProps extends Pick<CollapsibleRootProps, 'defaultOpen' | 'open' | 'disabled' | 'unmountOnHide'> {
|
|
7
|
+
/**
|
|
8
|
+
* The element or component this component should render as.
|
|
9
|
+
* @defaultValue 'div'
|
|
10
|
+
*/
|
|
11
|
+
as?: any;
|
|
12
|
+
class?: any;
|
|
13
|
+
ui?: Collapsible['slots'];
|
|
14
|
+
}
|
|
15
|
+
export interface CollapsibleEmits extends CollapsibleRootEmits {
|
|
16
|
+
}
|
|
17
|
+
export interface CollapsibleSlots {
|
|
18
|
+
default(props: {
|
|
19
|
+
open: boolean;
|
|
20
|
+
}): any;
|
|
21
|
+
content(props?: {}): any;
|
|
22
|
+
}
|
|
23
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<CollapsibleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
24
|
+
"update:open": (value: boolean) => any;
|
|
25
|
+
}, string, import("vue").PublicProps, Readonly<CollapsibleProps> & Readonly<{
|
|
26
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
27
|
+
}>, {
|
|
28
|
+
unmountOnHide: boolean;
|
|
29
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, CollapsibleSlots>;
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
32
|
+
new (): {
|
|
33
|
+
$slots: S;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
+
import theme from '#build/ui/color-picker';
|
|
3
|
+
import type { ComponentConfig } from '../types/tv';
|
|
4
|
+
type ColorPicker = ComponentConfig<typeof theme, AppConfig, 'colorPicker'>;
|
|
5
|
+
export type ColorPickerProps = {
|
|
6
|
+
/**
|
|
7
|
+
* The element or component this component should render as.
|
|
8
|
+
* @defaultValue 'div'
|
|
9
|
+
*/
|
|
10
|
+
as?: any;
|
|
11
|
+
/**
|
|
12
|
+
* Throttle time in ms for the color picker
|
|
13
|
+
*/
|
|
14
|
+
throttle?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Disable the color picker
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The default value of the color picker
|
|
21
|
+
*/
|
|
22
|
+
defaultValue?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Format of the color
|
|
25
|
+
* @defaultValue 'hex'
|
|
26
|
+
*/
|
|
27
|
+
format?: 'hex' | 'rgb' | 'hsl' | 'cmyk' | 'lab';
|
|
28
|
+
/**
|
|
29
|
+
* @defaultValue 'md'
|
|
30
|
+
*/
|
|
31
|
+
size?: ColorPicker['variants']['size'];
|
|
32
|
+
class?: any;
|
|
33
|
+
ui?: ColorPicker['slots'];
|
|
34
|
+
};
|
|
35
|
+
declare const _default: import("vue").DefineComponent<ColorPickerProps & {
|
|
36
|
+
modelValue?: string;
|
|
37
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
38
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
39
|
+
}, string, import("vue").PublicProps, Readonly<ColorPickerProps & {
|
|
40
|
+
modelValue?: string;
|
|
41
|
+
}> & Readonly<{
|
|
42
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
43
|
+
}>, {
|
|
44
|
+
defaultValue: string;
|
|
45
|
+
format: "hex" | "rgb" | "hsl" | "cmyk" | "lab";
|
|
46
|
+
throttle: number;
|
|
47
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
48
|
+
export default _default;
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import type { ListboxRootProps, ListboxRootEmits } from 'reka-ui';
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
3
|
+
import type { UseFuseOptions } from '@vueuse/integrations/useFuse';
|
|
4
|
+
import theme from '#build/ui/command-palette';
|
|
5
|
+
import type { UseComponentIconsProps } from '../composables/useComponentIcons';
|
|
6
|
+
import type { AvatarProps, ButtonProps, ChipProps, KbdProps, InputProps, LinkProps, IconProps } from '../types';
|
|
7
|
+
import type { GetItemKeys } from '../types/utils';
|
|
8
|
+
import type { ComponentConfig } from '../types/tv';
|
|
9
|
+
type CommandPalette = ComponentConfig<typeof theme, AppConfig, 'commandPalette'>;
|
|
10
|
+
export interface CommandPaletteItem extends Omit<LinkProps, 'type' | 'raw' | 'custom'> {
|
|
11
|
+
prefix?: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
suffix?: string;
|
|
14
|
+
/**
|
|
15
|
+
* @IconifyIcon
|
|
16
|
+
*/
|
|
17
|
+
icon?: IconProps['name'];
|
|
18
|
+
avatar?: AvatarProps;
|
|
19
|
+
chip?: ChipProps;
|
|
20
|
+
kbds?: KbdProps['value'][] | KbdProps[];
|
|
21
|
+
active?: boolean;
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
slot?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The placeholder to display when the item has children.
|
|
27
|
+
*/
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
children?: CommandPaletteItem[];
|
|
30
|
+
onSelect?(e?: Event): void;
|
|
31
|
+
class?: any;
|
|
32
|
+
ui?: Pick<CommandPalette['slots'], 'item' | 'itemLeadingIcon' | 'itemLeadingAvatarSize' | 'itemLeadingAvatar' | 'itemLeadingChipSize' | 'itemLeadingChip' | 'itemLabel' | 'itemLabelPrefix' | 'itemLabelBase' | 'itemLabelSuffix' | 'itemTrailing' | 'itemTrailingKbds' | 'itemTrailingKbdsSize' | 'itemTrailingHighlightedIcon' | 'itemTrailingIcon'>;
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}
|
|
35
|
+
export interface CommandPaletteGroup<T extends CommandPaletteItem = CommandPaletteItem> {
|
|
36
|
+
id: string;
|
|
37
|
+
label?: string;
|
|
38
|
+
slot?: string;
|
|
39
|
+
items?: T[];
|
|
40
|
+
/**
|
|
41
|
+
* Whether to filter group items with [useFuse](https://vueuse.org/integrations/useFuse).
|
|
42
|
+
* When `true`, items will not be filtered which is useful for custom filtering (useAsyncData, useFetch, etc.).
|
|
43
|
+
* @defaultValue false
|
|
44
|
+
*/
|
|
45
|
+
ignoreFilter?: boolean;
|
|
46
|
+
/** Filter group items after the search happened. */
|
|
47
|
+
postFilter?: (searchTerm: string, items: T[]) => T[];
|
|
48
|
+
/**
|
|
49
|
+
* The icon displayed when an item is highlighted.
|
|
50
|
+
* @IconifyIcon
|
|
51
|
+
*/
|
|
52
|
+
highlightedIcon?: IconProps['name'];
|
|
53
|
+
}
|
|
54
|
+
export interface CommandPaletteProps<G extends CommandPaletteGroup<T> = CommandPaletteGroup<any>, T extends CommandPaletteItem = CommandPaletteItem> extends Pick<ListboxRootProps, 'multiple' | 'disabled' | 'modelValue' | 'defaultValue' | 'highlightOnHover' | 'selectionBehavior'>, Pick<UseComponentIconsProps, 'loading' | 'loadingIcon'> {
|
|
55
|
+
/**
|
|
56
|
+
* The element or component this component should render as.
|
|
57
|
+
* @defaultValue 'div'
|
|
58
|
+
*/
|
|
59
|
+
as?: any;
|
|
60
|
+
/**
|
|
61
|
+
* The icon displayed in the input.
|
|
62
|
+
* @defaultValue appConfig.ui.icons.search
|
|
63
|
+
* @IconifyIcon
|
|
64
|
+
*/
|
|
65
|
+
icon?: IconProps['name'];
|
|
66
|
+
/**
|
|
67
|
+
* The icon displayed when an item is selected.
|
|
68
|
+
* @defaultValue appConfig.ui.icons.check
|
|
69
|
+
* @IconifyIcon
|
|
70
|
+
*/
|
|
71
|
+
selectedIcon?: IconProps['name'];
|
|
72
|
+
/**
|
|
73
|
+
* The icon displayed when an item has children.
|
|
74
|
+
* @defaultValue appConfig.ui.icons.chevronRight
|
|
75
|
+
* @IconifyIcon
|
|
76
|
+
*/
|
|
77
|
+
trailingIcon?: IconProps['name'];
|
|
78
|
+
/**
|
|
79
|
+
* The placeholder text for the input.
|
|
80
|
+
* @defaultValue t('commandPalette.placeholder')
|
|
81
|
+
*/
|
|
82
|
+
placeholder?: InputProps['placeholder'];
|
|
83
|
+
/**
|
|
84
|
+
* Automatically focus the input when component is mounted.
|
|
85
|
+
* @defaultValue true
|
|
86
|
+
*/
|
|
87
|
+
autofocus?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Display a close button in the input (useful when inside a Modal for example).
|
|
90
|
+
* `{ size: 'md', color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
|
|
91
|
+
* @emits 'update:open'
|
|
92
|
+
* @defaultValue false
|
|
93
|
+
*/
|
|
94
|
+
close?: boolean | Partial<ButtonProps>;
|
|
95
|
+
/**
|
|
96
|
+
* The icon displayed in the close button.
|
|
97
|
+
* @defaultValue appConfig.ui.icons.close
|
|
98
|
+
* @IconifyIcon
|
|
99
|
+
*/
|
|
100
|
+
closeIcon?: IconProps['name'];
|
|
101
|
+
/**
|
|
102
|
+
* Display a button to navigate back in history.
|
|
103
|
+
* `{ size: 'md', color: 'neutral', variant: 'link' }`{lang="ts-type"}
|
|
104
|
+
* @defaultValue true
|
|
105
|
+
*/
|
|
106
|
+
back?: boolean | ButtonProps;
|
|
107
|
+
/**
|
|
108
|
+
* The icon displayed in the back button.
|
|
109
|
+
* @defaultValue appConfig.ui.icons.arrowLeft
|
|
110
|
+
* @IconifyIcon
|
|
111
|
+
*/
|
|
112
|
+
backIcon?: IconProps['name'];
|
|
113
|
+
groups?: G[];
|
|
114
|
+
/**
|
|
115
|
+
* Options for [useFuse](https://vueuse.org/integrations/useFuse).
|
|
116
|
+
* @defaultValue {
|
|
117
|
+
fuseOptions: {
|
|
118
|
+
ignoreLocation: true,
|
|
119
|
+
threshold: 0.1,
|
|
120
|
+
keys: ['label', 'suffix']
|
|
121
|
+
},
|
|
122
|
+
resultLimit: 12,
|
|
123
|
+
matchAllWhenSearchEmpty: true
|
|
124
|
+
}
|
|
125
|
+
*/
|
|
126
|
+
fuse?: UseFuseOptions<T>;
|
|
127
|
+
/**
|
|
128
|
+
* The key used to get the label from the item.
|
|
129
|
+
* @defaultValue 'label'
|
|
130
|
+
*/
|
|
131
|
+
labelKey?: GetItemKeys<T>;
|
|
132
|
+
class?: any;
|
|
133
|
+
ui?: CommandPalette['slots'];
|
|
134
|
+
}
|
|
135
|
+
export type CommandPaletteEmits<T extends CommandPaletteItem = CommandPaletteItem> = ListboxRootEmits<T> & {
|
|
136
|
+
'update:open': [value: boolean];
|
|
137
|
+
};
|
|
138
|
+
type SlotProps<T> = (props: {
|
|
139
|
+
item: T;
|
|
140
|
+
index: number;
|
|
141
|
+
}) => any;
|
|
142
|
+
export type CommandPaletteSlots<G extends CommandPaletteGroup<T> = CommandPaletteGroup<any>, T extends CommandPaletteItem = CommandPaletteItem> = {
|
|
143
|
+
'empty'(props: {
|
|
144
|
+
searchTerm?: string;
|
|
145
|
+
}): any;
|
|
146
|
+
'footer'(props: {
|
|
147
|
+
ui: {
|
|
148
|
+
[K in keyof Required<CommandPalette['slots']>]: (props?: Record<string, any>) => string;
|
|
149
|
+
};
|
|
150
|
+
}): any;
|
|
151
|
+
'back'(props: {
|
|
152
|
+
ui: {
|
|
153
|
+
[K in keyof Required<CommandPalette['slots']>]: (props?: Record<string, any>) => string;
|
|
154
|
+
};
|
|
155
|
+
}): any;
|
|
156
|
+
'close'(props: {
|
|
157
|
+
ui: {
|
|
158
|
+
[K in keyof Required<CommandPalette['slots']>]: (props?: Record<string, any>) => string;
|
|
159
|
+
};
|
|
160
|
+
}): any;
|
|
161
|
+
'item': SlotProps<T>;
|
|
162
|
+
'item-leading': SlotProps<T>;
|
|
163
|
+
'item-label': SlotProps<T>;
|
|
164
|
+
'item-trailing': SlotProps<T>;
|
|
165
|
+
} & Record<string, SlotProps<G>> & Record<string, SlotProps<T>>;
|
|
166
|
+
declare const _default: <G extends CommandPaletteGroup<T>, T extends CommandPaletteItem>(__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<{
|
|
167
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
168
|
+
readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
169
|
+
readonly "onUpdate:modelValue"?: ((value: T) => any) | undefined;
|
|
170
|
+
readonly onHighlight?: ((payload: {
|
|
171
|
+
ref: HTMLElement;
|
|
172
|
+
value: T;
|
|
173
|
+
} | undefined) => any) | undefined;
|
|
174
|
+
readonly "onUpdate:searchTerm"?: ((value: string) => any) | undefined;
|
|
175
|
+
readonly onEntryFocus?: ((event: CustomEvent<any>) => any) | undefined;
|
|
176
|
+
readonly onLeave?: ((event: Event) => any) | undefined;
|
|
177
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:open" | "onUpdate:modelValue" | "onHighlight" | "onUpdate:searchTerm" | "onEntryFocus" | "onLeave"> & (CommandPaletteProps<G, T> & {
|
|
178
|
+
searchTerm?: string;
|
|
179
|
+
}) & {}> & import("vue").PublicProps;
|
|
180
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
181
|
+
attrs: any;
|
|
182
|
+
slots: CommandPaletteSlots<G, T>;
|
|
183
|
+
emit: (((evt: "update:open", value: boolean) => void) & ((evt: "update:modelValue", value: T) => void) & ((evt: "highlight", payload: {
|
|
184
|
+
ref: HTMLElement;
|
|
185
|
+
value: T;
|
|
186
|
+
} | undefined) => void) & ((evt: "entryFocus", event: CustomEvent<any>) => void) & ((evt: "leave", event: Event) => void)) & ((evt: "update:searchTerm", value: string) => void);
|
|
187
|
+
}>) => import("vue").VNode & {
|
|
188
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
189
|
+
};
|
|
190
|
+
export default _default;
|
|
191
|
+
type __VLS_PrettifyLocal<T> = {
|
|
192
|
+
[K in keyof T as K]: T[K];
|
|
193
|
+
} & {};
|
|
@@ -35,7 +35,7 @@ const props = defineProps({
|
|
|
35
35
|
backIcon: { type: [String, Object], required: false },
|
|
36
36
|
groups: { type: Array, required: false },
|
|
37
37
|
fuse: { type: Object, required: false },
|
|
38
|
-
labelKey: { type:
|
|
38
|
+
labelKey: { type: null, required: false, default: "label" },
|
|
39
39
|
class: { type: null, required: false },
|
|
40
40
|
ui: { type: null, required: false },
|
|
41
41
|
multiple: { type: Boolean, required: false },
|
|
@@ -52,8 +52,8 @@ const slots = defineSlots();
|
|
|
52
52
|
const searchTerm = defineModel("searchTerm", { type: String, ...{ default: "" } });
|
|
53
53
|
const { t } = useLocale();
|
|
54
54
|
const appConfig = useAppConfig();
|
|
55
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, "as", "disabled", "multiple", "modelValue", "defaultValue", "highlightOnHover"
|
|
56
|
-
const inputProps = useForwardProps(reactivePick(props, "loading"
|
|
55
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, "as", "disabled", "multiple", "modelValue", "defaultValue", "highlightOnHover"), emits);
|
|
56
|
+
const inputProps = useForwardProps(reactivePick(props, "loading"));
|
|
57
57
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.commandPalette || {} })());
|
|
58
58
|
const fuse = computed(() => defu({}, props.fuse, {
|
|
59
59
|
fuseOptions: {
|
|
@@ -155,13 +155,14 @@ function onSelect(e, item) {
|
|
|
155
155
|
</script>
|
|
156
156
|
|
|
157
157
|
<template>
|
|
158
|
-
<ListboxRoot v-bind="rootProps" ref="listboxRootRef" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
158
|
+
<ListboxRoot v-bind="rootProps" ref="listboxRootRef" :selection-behavior="selectionBehavior" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
159
159
|
<ListboxFilter v-model="searchTerm" as-child>
|
|
160
160
|
<UInput
|
|
161
161
|
:placeholder="placeholder"
|
|
162
162
|
variant="none"
|
|
163
163
|
:autofocus="autofocus"
|
|
164
164
|
v-bind="inputProps"
|
|
165
|
+
:loading-icon="loadingIcon"
|
|
165
166
|
:icon="icon || appConfig.ui.icons.search"
|
|
166
167
|
:class="ui.input({ class: props.ui?.input })"
|
|
167
168
|
@keydown.backspace="onBackspace"
|
|
@@ -4,6 +4,7 @@ import type { UseFuseOptions } from '@vueuse/integrations/useFuse';
|
|
|
4
4
|
import theme from '#build/ui/command-palette';
|
|
5
5
|
import type { UseComponentIconsProps } from '../composables/useComponentIcons';
|
|
6
6
|
import type { AvatarProps, ButtonProps, ChipProps, KbdProps, InputProps, LinkProps, IconProps } from '../types';
|
|
7
|
+
import type { GetItemKeys } from '../types/utils';
|
|
7
8
|
import type { ComponentConfig } from '../types/tv';
|
|
8
9
|
type CommandPalette = ComponentConfig<typeof theme, AppConfig, 'commandPalette'>;
|
|
9
10
|
export interface CommandPaletteItem extends Omit<LinkProps, 'type' | 'raw' | 'custom'> {
|
|
@@ -127,7 +128,7 @@ export interface CommandPaletteProps<G extends CommandPaletteGroup<T> = CommandP
|
|
|
127
128
|
* The key used to get the label from the item.
|
|
128
129
|
* @defaultValue 'label'
|
|
129
130
|
*/
|
|
130
|
-
labelKey?:
|
|
131
|
+
labelKey?: GetItemKeys<T>;
|
|
131
132
|
class?: any;
|
|
132
133
|
ui?: CommandPalette['slots'];
|
|
133
134
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface ContainerProps {
|
|
2
|
+
/**
|
|
3
|
+
* The element or component this component should render as.
|
|
4
|
+
* @defaultValue 'div'
|
|
5
|
+
*/
|
|
6
|
+
as?: any;
|
|
7
|
+
class?: any;
|
|
8
|
+
}
|
|
9
|
+
export interface ContainerSlots {
|
|
10
|
+
default(props?: {}): any;
|
|
11
|
+
}
|
|
12
|
+
declare const _default: __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
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|