@nuxt/ui 3.1.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nuxt/ui/accordion.ts +2 -23
- package/.nuxt/ui/alert.ts +2 -28
- package/.nuxt/ui/avatar-group.ts +2 -23
- package/.nuxt/ui/avatar.ts +2 -23
- package/.nuxt/ui/badge.ts +32 -30
- package/.nuxt/ui/breadcrumb.ts +2 -23
- package/.nuxt/ui/button-group.ts +2 -36
- package/.nuxt/ui/button.ts +4 -30
- package/.nuxt/ui/calendar.ts +4 -25
- package/.nuxt/ui/card.ts +2 -23
- package/.nuxt/ui/carousel.ts +2 -28
- package/.nuxt/ui/checkbox-group.ts +146 -24
- package/.nuxt/ui/checkbox.ts +2 -23
- package/.nuxt/ui/chip.ts +2 -23
- package/.nuxt/ui/collapsible.ts +2 -23
- package/.nuxt/ui/color-picker.ts +4 -25
- package/.nuxt/ui/command-palette.ts +2 -23
- package/.nuxt/ui/container.ts +2 -23
- package/.nuxt/ui/context-menu.ts +2 -23
- package/.nuxt/ui/drawer.ts +2 -23
- package/.nuxt/ui/dropdown-menu.ts +2 -23
- package/.nuxt/ui/form-field.ts +2 -23
- package/.nuxt/ui/form.ts +2 -23
- package/.nuxt/ui/input-menu.ts +4 -34
- package/.nuxt/ui/input-number.ts +12 -23
- package/.nuxt/ui/input.ts +4 -34
- package/.nuxt/ui/kbd.ts +2 -23
- package/.nuxt/ui/link.ts +14 -28
- package/.nuxt/ui/modal.ts +2 -23
- package/.nuxt/ui/navigation-menu.ts +3 -24
- package/.nuxt/ui/pagination.ts +2 -23
- package/.nuxt/ui/pin-input.ts +2 -23
- package/.nuxt/ui/popover.ts +2 -23
- package/.nuxt/ui/progress.ts +2 -23
- package/.nuxt/ui/radio-group.ts +2 -23
- package/.nuxt/ui/select-menu.ts +4 -34
- package/.nuxt/ui/select.ts +4 -34
- package/.nuxt/ui/separator.ts +2 -23
- package/.nuxt/ui/skeleton.ts +2 -23
- package/.nuxt/ui/slideover.ts +2 -23
- package/.nuxt/ui/slider.ts +2 -23
- package/.nuxt/ui/stepper.ts +2 -23
- package/.nuxt/ui/switch.ts +2 -23
- package/.nuxt/ui/table.ts +2 -23
- package/.nuxt/ui/tabs.ts +6 -26
- package/.nuxt/ui/textarea.ts +4 -34
- package/.nuxt/ui/toast.ts +2 -28
- package/.nuxt/ui/toaster.ts +2 -23
- package/.nuxt/ui/tooltip.ts +2 -23
- package/.nuxt/ui/tree.ts +2 -23
- package/.nuxt/ui.css +15 -8
- package/README.md +4 -0
- package/cli/templates.mjs +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +15 -5
- package/dist/runtime/components/Accordion.vue +9 -9
- package/dist/runtime/components/Accordion.vue.d.ts +6 -20
- package/dist/runtime/components/Alert.vue +1 -1
- package/dist/runtime/components/Alert.vue.d.ts +7 -22
- package/dist/runtime/components/App.vue.d.ts +2 -2
- package/dist/runtime/components/Avatar.vue +2 -2
- package/dist/runtime/components/Avatar.vue.d.ts +4 -25
- package/dist/runtime/components/AvatarGroup.vue +1 -1
- package/dist/runtime/components/AvatarGroup.vue.d.ts +2 -11
- package/dist/runtime/components/Badge.vue +5 -3
- package/dist/runtime/components/Badge.vue.d.ts +5 -24
- package/dist/runtime/components/Breadcrumb.vue +8 -8
- package/dist/runtime/components/Breadcrumb.vue.d.ts +4 -20
- package/dist/runtime/components/Button.vue +2 -3
- package/dist/runtime/components/Button.vue.d.ts +4 -29
- package/dist/runtime/components/ButtonGroup.vue.d.ts +3 -24
- package/dist/runtime/components/Calendar.vue +2 -1
- package/dist/runtime/components/Calendar.vue.d.ts +6 -2
- package/dist/runtime/components/Card.vue +1 -1
- package/dist/runtime/components/Card.vue.d.ts +2 -11
- package/dist/runtime/components/Carousel.vue +5 -2
- package/dist/runtime/components/Carousel.vue.d.ts +10 -3
- package/dist/runtime/components/Checkbox.vue +2 -2
- package/dist/runtime/components/Checkbox.vue.d.ts +10 -13
- package/dist/runtime/components/CheckboxGroup.vue +8 -5
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +12 -3
- package/dist/runtime/components/Chip.vue +1 -1
- package/dist/runtime/components/Chip.vue.d.ts +10 -24
- package/dist/runtime/components/Collapsible.vue +1 -1
- package/dist/runtime/components/Collapsible.vue.d.ts +7 -22
- package/dist/runtime/components/ColorPicker.vue +1 -1
- package/dist/runtime/components/ColorPicker.vue.d.ts +9 -24
- package/dist/runtime/components/CommandPalette.vue +17 -17
- package/dist/runtime/components/CommandPalette.vue.d.ts +17 -27
- package/dist/runtime/components/Container.vue.d.ts +2 -11
- package/dist/runtime/components/ContextMenu.vue.d.ts +6 -24
- package/dist/runtime/components/ContextMenuContent.vue +15 -15
- package/dist/runtime/components/ContextMenuContent.vue.d.ts +17 -57
- package/dist/runtime/components/Drawer.vue.d.ts +17 -27
- package/dist/runtime/components/DropdownMenu.vue.d.ts +6 -28
- package/dist/runtime/components/DropdownMenuContent.vue +15 -15
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +19 -6
- package/dist/runtime/components/Form.vue.d.ts +5 -2
- package/dist/runtime/components/FormField.vue +5 -5
- package/dist/runtime/components/FormField.vue.d.ts +2 -11
- package/dist/runtime/components/Icon.vue.d.ts +1 -10
- package/dist/runtime/components/Input.vue +2 -2
- package/dist/runtime/components/Input.vue.d.ts +20 -41
- package/dist/runtime/components/InputMenu.vue +17 -17
- package/dist/runtime/components/InputMenu.vue.d.ts +227 -5
- package/dist/runtime/components/InputNumber.vue +13 -7
- package/dist/runtime/components/InputNumber.vue.d.ts +90 -23
- package/dist/runtime/components/Kbd.vue.d.ts +3 -24
- package/dist/runtime/components/Link.vue +5 -14
- package/dist/runtime/components/Link.vue.d.ts +3 -34
- package/dist/runtime/components/LinkBase.vue.d.ts +4 -27
- package/dist/runtime/components/Modal.vue.d.ts +12 -28
- package/dist/runtime/components/NavigationMenu.vue +35 -28
- package/dist/runtime/components/NavigationMenu.vue.d.ts +24 -26
- package/dist/runtime/components/Pagination.vue +1 -1
- package/dist/runtime/components/Pagination.vue.d.ts +9 -33
- package/dist/runtime/components/PinInput.vue +1 -1
- package/dist/runtime/components/PinInput.vue.d.ts +13 -24
- package/dist/runtime/components/Popover.vue.d.ts +9 -26
- package/dist/runtime/components/Progress.vue +1 -1
- package/dist/runtime/components/Progress.vue.d.ts +10 -41
- package/dist/runtime/components/RadioGroup.vue +8 -8
- package/dist/runtime/components/RadioGroup.vue.d.ts +8 -3
- package/dist/runtime/components/Select.vue +12 -12
- package/dist/runtime/components/Select.vue.d.ts +11 -3
- package/dist/runtime/components/SelectMenu.vue +13 -13
- package/dist/runtime/components/SelectMenu.vue.d.ts +19 -5
- package/dist/runtime/components/Separator.vue +1 -1
- package/dist/runtime/components/Separator.vue.d.ts +3 -24
- package/dist/runtime/components/Skeleton.vue.d.ts +3 -12
- package/dist/runtime/components/Slideover.vue.d.ts +12 -29
- package/dist/runtime/components/Slider.vue +16 -4
- package/dist/runtime/components/Slider.vue.d.ts +23 -36
- package/dist/runtime/components/Stepper.vue +10 -10
- package/dist/runtime/components/Stepper.vue.d.ts +10 -14
- package/dist/runtime/components/Switch.vue +1 -1
- package/dist/runtime/components/Switch.vue.d.ts +10 -13
- package/dist/runtime/components/Table.vue +2 -2
- package/dist/runtime/components/Table.vue.d.ts +17 -17
- package/dist/runtime/components/Tabs.vue +6 -6
- package/dist/runtime/components/Tabs.vue.d.ts +6 -20
- package/dist/runtime/components/Textarea.vue +3 -3
- package/dist/runtime/components/Textarea.vue.d.ts +20 -44
- package/dist/runtime/components/Toast.vue +3 -2
- package/dist/runtime/components/Toast.vue.d.ts +92 -24
- package/dist/runtime/components/Toaster.vue +4 -4
- package/dist/runtime/components/Toaster.vue.d.ts +9 -28
- package/dist/runtime/components/Tooltip.vue.d.ts +7 -22
- package/dist/runtime/components/Tree.vue +10 -10
- package/dist/runtime/components/Tree.vue.d.ts +7 -22
- package/dist/runtime/composables/defineShortcuts.js +6 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useButtonGroup.d.ts +1 -1
- package/dist/runtime/composables/useFormField.d.ts +2 -2
- package/dist/runtime/composables/useFormField.js +2 -1
- package/dist/runtime/composables/useKbd.d.ts +1 -0
- package/dist/runtime/composables/useKbd.js +4 -3
- package/dist/runtime/composables/useOverlay.d.ts +9 -10
- package/dist/runtime/composables/useOverlay.js +11 -6
- package/dist/runtime/inertia/components/Link.vue +46 -60
- package/dist/runtime/inertia/components/Link.vue.d.ts +4 -33
- package/dist/runtime/inertia/components/LinkBase.vue +68 -0
- package/dist/runtime/inertia/components/LinkBase.vue.d.ts +25 -0
- package/dist/runtime/inertia/stubs.d.ts +1 -1
- package/dist/runtime/inertia/stubs.js +1 -1
- package/dist/runtime/locale/index.d.ts +1 -0
- package/dist/runtime/locale/index.js +1 -0
- package/dist/runtime/locale/sl.d.ts +3 -0
- package/dist/runtime/locale/sl.js +54 -0
- package/dist/runtime/types/tv.d.ts +53 -0
- package/dist/runtime/types/tv.js +0 -0
- package/dist/runtime/types/utils.d.ts +2 -52
- package/dist/runtime/types/utils.js +1 -0
- package/dist/runtime/utils/link.d.ts +1 -0
- package/dist/runtime/utils/link.js +12 -0
- package/dist/runtime/vue/components/Icon.vue.d.ts +1 -10
- package/dist/runtime/vue/components/Link.vue +27 -40
- package/dist/runtime/vue/components/Link.vue.d.ts +3 -34
- package/dist/runtime/vue/composables/useAppConfig.js +3 -1
- package/dist/runtime/vue/stubs.d.ts +1 -1
- package/dist/runtime/vue/stubs.js +1 -1
- package/dist/shared/{ui.D7lOOabO.mjs → ui.BvUP-pSb.mjs} +120 -27
- package/dist/unplugin.d.mts +2 -2
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +2 -2
- package/package.json +28 -27
|
@@ -59,29 +59,29 @@ const groups = computed(
|
|
|
59
59
|
<DefineItemTemplate v-slot="{ item, active, index }">
|
|
60
60
|
<slot :name="item.slot || 'item'" :item="item" :index="index">
|
|
61
61
|
<slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="item" :active="active" :index="index">
|
|
62
|
-
<UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, color: item?.color, loading: true })" />
|
|
63
|
-
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, color: item?.color, active })" />
|
|
64
|
-
<UAvatar v-else-if="item.avatar" :size="props.uiOverride?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: uiOverride?.itemLeadingAvatar, active })" />
|
|
62
|
+
<UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: [uiOverride?.itemLeadingIcon, item.ui?.itemLeadingIcon], color: item?.color, loading: true })" />
|
|
63
|
+
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: [uiOverride?.itemLeadingIcon, item.ui?.itemLeadingIcon], color: item?.color, active })" />
|
|
64
|
+
<UAvatar v-else-if="item.avatar" :size="item.ui?.itemLeadingAvatarSize || props.uiOverride?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: [uiOverride?.itemLeadingAvatar, item.ui?.itemLeadingAvatar], active })" />
|
|
65
65
|
</slot>
|
|
66
66
|
|
|
67
|
-
<span v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.itemLabel({ class: uiOverride?.itemLabel, active })">
|
|
67
|
+
<span v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.itemLabel({ class: [uiOverride?.itemLabel, item.ui?.itemLabel], active })">
|
|
68
68
|
<slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="active" :index="index">
|
|
69
69
|
{{ get(item, props.labelKey) }}
|
|
70
70
|
</slot>
|
|
71
71
|
|
|
72
|
-
<UIcon v-if="item.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" :class="ui.itemLabelExternalIcon({ class: uiOverride?.itemLabelExternalIcon, color: item?.color, active })" />
|
|
72
|
+
<UIcon v-if="item.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" :class="ui.itemLabelExternalIcon({ class: [uiOverride?.itemLabelExternalIcon, item.ui?.itemLabelExternalIcon], color: item?.color, active })" />
|
|
73
73
|
</span>
|
|
74
74
|
|
|
75
|
-
<span :class="ui.itemTrailing({ class: uiOverride?.itemTrailing })">
|
|
75
|
+
<span :class="ui.itemTrailing({ class: [uiOverride?.itemTrailing, item.ui?.itemTrailing] })">
|
|
76
76
|
<slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="active" :index="index">
|
|
77
|
-
<UIcon v-if="item.children?.length" :name="childrenIcon" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon, color: item?.color, active })" />
|
|
78
|
-
<span v-else-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: uiOverride?.itemTrailingKbds })">
|
|
79
|
-
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="props.uiOverride?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
77
|
+
<UIcon v-if="item.children?.length" :name="childrenIcon" :class="ui.itemTrailingIcon({ class: [uiOverride?.itemTrailingIcon, item.ui?.itemTrailingIcon], color: item?.color, active })" />
|
|
78
|
+
<span v-else-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: [uiOverride?.itemTrailingKbds, item.ui?.itemTrailingKbds] })">
|
|
79
|
+
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="item.ui?.itemTrailingKbdsSize || props.uiOverride?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
80
80
|
</span>
|
|
81
81
|
</slot>
|
|
82
82
|
|
|
83
83
|
<ContextMenu.ItemIndicator as-child>
|
|
84
|
-
<UIcon :name="checkedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon, color: item?.color })" />
|
|
84
|
+
<UIcon :name="checkedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: [uiOverride?.itemTrailingIcon, item.ui?.itemTrailingIcon], color: item?.color })" />
|
|
85
85
|
</ContextMenu.ItemIndicator>
|
|
86
86
|
</span>
|
|
87
87
|
</slot>
|
|
@@ -93,17 +93,17 @@ const groups = computed(
|
|
|
93
93
|
|
|
94
94
|
<ContextMenu.Group v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" :class="ui.group({ class: uiOverride?.group })">
|
|
95
95
|
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
96
|
-
<ContextMenu.Label v-if="item.type === 'label'" :class="ui.label({ class: uiOverride?.label })">
|
|
96
|
+
<ContextMenu.Label v-if="item.type === 'label'" :class="ui.label({ class: [uiOverride?.label, item.ui?.label, item.class] })">
|
|
97
97
|
<ReuseItemTemplate :item="item" :index="index" />
|
|
98
98
|
</ContextMenu.Label>
|
|
99
|
-
<ContextMenu.Separator v-else-if="item.type === 'separator'" :class="ui.separator({ class: uiOverride?.separator })" />
|
|
99
|
+
<ContextMenu.Separator v-else-if="item.type === 'separator'" :class="ui.separator({ class: [uiOverride?.separator, item.ui?.separator, item.class] })" />
|
|
100
100
|
<ContextMenu.Sub v-else-if="item?.children?.length" :open="item.open" :default-open="item.defaultOpen">
|
|
101
101
|
<ContextMenu.SubTrigger
|
|
102
102
|
as="button"
|
|
103
103
|
type="button"
|
|
104
104
|
:disabled="item.disabled"
|
|
105
105
|
:text-value="get(item, props.labelKey)"
|
|
106
|
-
:class="ui.item({ class: uiOverride?.item, color: item?.color })"
|
|
106
|
+
:class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], color: item?.color })"
|
|
107
107
|
>
|
|
108
108
|
<ReuseItemTemplate :item="item" :index="index" />
|
|
109
109
|
</ContextMenu.SubTrigger>
|
|
@@ -132,7 +132,7 @@ const groups = computed(
|
|
|
132
132
|
:model-value="item.checked"
|
|
133
133
|
:disabled="item.disabled"
|
|
134
134
|
:text-value="get(item, props.labelKey)"
|
|
135
|
-
:class="ui.item({ class: [uiOverride?.item, item.class], color: item?.color })"
|
|
135
|
+
:class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], color: item?.color })"
|
|
136
136
|
@update:model-value="item.onUpdateChecked"
|
|
137
137
|
@select="item.onSelect"
|
|
138
138
|
>
|
|
@@ -146,7 +146,7 @@ const groups = computed(
|
|
|
146
146
|
@select="item.onSelect"
|
|
147
147
|
>
|
|
148
148
|
<ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
|
|
149
|
-
<ULinkBase v-bind="slotProps" :class="ui.item({ class: [uiOverride?.item, item.class], active, color: item?.color })">
|
|
149
|
+
<ULinkBase v-bind="slotProps" :class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], active, color: item?.color })">
|
|
150
150
|
<ReuseItemTemplate :item="item" :active="active" :index="index" />
|
|
151
151
|
</ULinkBase>
|
|
152
152
|
</ULink>
|
|
@@ -2,7 +2,7 @@ import { ContextMenu } from 'reka-ui/namespaced';
|
|
|
2
2
|
import type { ContextMenuContentProps as RekaContextMenuContentProps } from 'reka-ui';
|
|
3
3
|
import type { AppConfig } from '@nuxt/schema';
|
|
4
4
|
import type theme from '#build/ui/context-menu';
|
|
5
|
-
import type { ContextMenuItem } from '../types';
|
|
5
|
+
import type { ContextMenuItem, ContextMenuSlots } from '../types';
|
|
6
6
|
import type { ArrayOrNested, NestedItem, ComponentConfig } from '../types/utils';
|
|
7
7
|
type ContextMenu = ComponentConfig<typeof theme, AppConfig, 'contextMenu'>;
|
|
8
8
|
interface ContextMenuContentProps<T extends ArrayOrNested<ContextMenuItem>> extends Omit<RekaContextMenuContentProps, 'as' | 'asChild' | 'forceMount'> {
|
|
@@ -29,64 +29,24 @@ interface ContextMenuContentProps<T extends ArrayOrNested<ContextMenuItem>> exte
|
|
|
29
29
|
uiOverride?: ContextMenu['slots'];
|
|
30
30
|
}
|
|
31
31
|
declare const _default: <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<
|
|
32
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
33
|
+
readonly onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
34
|
+
readonly onPointerDownOutside?: ((event: CustomEvent<{
|
|
35
|
+
originalEvent: PointerEvent;
|
|
36
|
+
}>) => any) | undefined;
|
|
37
|
+
readonly onFocusOutside?: ((event: CustomEvent<{
|
|
38
|
+
originalEvent: FocusEvent;
|
|
39
|
+
}>) => any) | undefined;
|
|
40
|
+
readonly onInteractOutside?: ((event: CustomEvent<{
|
|
41
|
+
originalEvent: PointerEvent;
|
|
42
|
+
}> | CustomEvent<{
|
|
43
|
+
originalEvent: FocusEvent;
|
|
44
|
+
}>) => any) | undefined;
|
|
45
|
+
readonly onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
46
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onEscapeKeyDown" | "onPointerDownOutside" | "onFocusOutside" | "onInteractOutside" | "onCloseAutoFocus"> & ContextMenuContentProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
33
47
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
34
48
|
attrs: any;
|
|
35
|
-
slots:
|
|
36
|
-
default(props?: {}): any;
|
|
37
|
-
item: (props: {
|
|
38
|
-
item: NestedItem<T>;
|
|
39
|
-
active?: boolean;
|
|
40
|
-
index: number;
|
|
41
|
-
}) => any;
|
|
42
|
-
'item-leading': (props: {
|
|
43
|
-
item: NestedItem<T>;
|
|
44
|
-
active?: boolean;
|
|
45
|
-
index: number;
|
|
46
|
-
}) => any;
|
|
47
|
-
'item-label': (props: {
|
|
48
|
-
item: NestedItem<T>;
|
|
49
|
-
active?: boolean;
|
|
50
|
-
index: number;
|
|
51
|
-
}) => any;
|
|
52
|
-
'item-trailing': (props: {
|
|
53
|
-
item: NestedItem<T>;
|
|
54
|
-
active?: boolean;
|
|
55
|
-
index: number;
|
|
56
|
-
}) => any;
|
|
57
|
-
'content-top': (props?: {}) => any;
|
|
58
|
-
'content-bottom': (props?: {}) => any;
|
|
59
|
-
} & import("../types").DynamicSlots<import("../types").MergeTypes<NestedItem<T>>, "trailing" | "leading" | "label", {
|
|
60
|
-
active?: boolean;
|
|
61
|
-
index: number;
|
|
62
|
-
}>> & {
|
|
63
|
-
default(props?: {}): any;
|
|
64
|
-
item: (props: {
|
|
65
|
-
item: NestedItem<T>;
|
|
66
|
-
active?: boolean;
|
|
67
|
-
index: number;
|
|
68
|
-
}) => any;
|
|
69
|
-
'item-leading': (props: {
|
|
70
|
-
item: NestedItem<T>;
|
|
71
|
-
active?: boolean;
|
|
72
|
-
index: number;
|
|
73
|
-
}) => any;
|
|
74
|
-
'item-label': (props: {
|
|
75
|
-
item: NestedItem<T>;
|
|
76
|
-
active?: boolean;
|
|
77
|
-
index: number;
|
|
78
|
-
}) => any;
|
|
79
|
-
'item-trailing': (props: {
|
|
80
|
-
item: NestedItem<T>;
|
|
81
|
-
active?: boolean;
|
|
82
|
-
index: number;
|
|
83
|
-
}) => any;
|
|
84
|
-
'content-top': (props?: {}) => any;
|
|
85
|
-
'content-bottom': (props?: {}) => any;
|
|
86
|
-
} & import("../types").DynamicSlots<import("../types").MergeTypes<NestedItem<T>>, "trailing" | "leading" | "label", {
|
|
87
|
-
active?: boolean;
|
|
88
|
-
index: number;
|
|
89
|
-
}>;
|
|
49
|
+
slots: ContextMenuSlots<T>;
|
|
90
50
|
emit: ((evt: "escapeKeyDown", event: KeyboardEvent) => void) & ((evt: "pointerDownOutside", event: CustomEvent<{
|
|
91
51
|
originalEvent: PointerEvent;
|
|
92
52
|
}>) => void) & ((evt: "focusOutside", event: CustomEvent<{
|
|
@@ -48,41 +48,31 @@ export interface DrawerSlots {
|
|
|
48
48
|
body(props?: {}): any;
|
|
49
49
|
footer(props?: {}): any;
|
|
50
50
|
}
|
|
51
|
-
declare const _default:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
51
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<DrawerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
52
|
+
close: () => any;
|
|
53
|
+
drag: (percentageDragged: number) => any;
|
|
54
|
+
"update:open": (open: boolean) => any;
|
|
55
|
+
release: (open: boolean) => any;
|
|
56
|
+
"update:activeSnapPoint": (val: string | number) => any;
|
|
57
|
+
animationEnd: (open: boolean) => any;
|
|
58
|
+
}, string, import("vue").PublicProps, Readonly<DrawerProps> & Readonly<{
|
|
59
|
+
onClose?: (() => any) | undefined;
|
|
60
|
+
onDrag?: ((percentageDragged: number) => any) | undefined;
|
|
61
|
+
"onUpdate:open"?: ((open: boolean) => any) | undefined;
|
|
62
|
+
onRelease?: ((open: boolean) => any) | undefined;
|
|
63
|
+
"onUpdate:activeSnapPoint"?: ((val: string | number) => any) | undefined;
|
|
64
|
+
onAnimationEnd?: ((open: boolean) => any) | undefined;
|
|
65
|
+
}>, {
|
|
59
66
|
modal: boolean;
|
|
60
67
|
portal: boolean | string | HTMLElement;
|
|
61
68
|
overlay: boolean;
|
|
62
69
|
direction: import("vaul-vue").DrawerDirection;
|
|
63
70
|
dismissible: boolean;
|
|
64
71
|
handle: boolean;
|
|
65
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions,
|
|
72
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, DrawerSlots>;
|
|
66
73
|
export default _default;
|
|
67
|
-
type
|
|
68
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
69
|
-
default: D[K];
|
|
70
|
-
}> : P[K];
|
|
71
|
-
};
|
|
72
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
73
|
-
type __VLS_TypePropsToOption<T> = {
|
|
74
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
75
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
76
|
-
} : {
|
|
77
|
-
type: import('vue').PropType<T[K]>;
|
|
78
|
-
required: true;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
74
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
82
75
|
new (): {
|
|
83
76
|
$slots: S;
|
|
84
77
|
};
|
|
85
78
|
};
|
|
86
|
-
type __VLS_PrettifyLocal<T> = {
|
|
87
|
-
[K in keyof T]: T[K];
|
|
88
|
-
} & {};
|
|
@@ -28,6 +28,8 @@ export interface DropdownMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'cust
|
|
|
28
28
|
children?: ArrayOrNested<DropdownMenuItem>;
|
|
29
29
|
onSelect?(e: Event): void;
|
|
30
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'>;
|
|
31
33
|
[key: string]: any;
|
|
32
34
|
}
|
|
33
35
|
export interface DropdownMenuProps<T extends ArrayOrNested<DropdownMenuItem> = ArrayOrNested<DropdownMenuItem>> extends Omit<DropdownMenuRootProps, 'dir'> {
|
|
@@ -101,36 +103,12 @@ export type DropdownMenuSlots<A extends ArrayOrNested<DropdownMenuItem> = ArrayO
|
|
|
101
103
|
index: number;
|
|
102
104
|
}>;
|
|
103
105
|
declare const _default: <T extends ArrayOrNested<DropdownMenuItem>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
104
|
-
props: __VLS_PrettifyLocal<
|
|
106
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
107
|
+
readonly "onUpdate:open"?: ((payload: boolean) => any) | undefined;
|
|
108
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:open"> & DropdownMenuProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
105
109
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
106
110
|
attrs: any;
|
|
107
|
-
slots:
|
|
108
|
-
default(props: {
|
|
109
|
-
open: boolean;
|
|
110
|
-
}): any;
|
|
111
|
-
item: SlotProps<NestedItem<T>>;
|
|
112
|
-
'item-leading': SlotProps<NestedItem<T>>;
|
|
113
|
-
'item-label': SlotProps<NestedItem<T>>;
|
|
114
|
-
'item-trailing': SlotProps<NestedItem<T>>;
|
|
115
|
-
'content-top': (props?: {}) => any;
|
|
116
|
-
'content-bottom': (props?: {}) => any;
|
|
117
|
-
} & DynamicSlots<MergeTypes<NestedItem<T>>, "trailing" | "leading" | "label", {
|
|
118
|
-
active?: boolean;
|
|
119
|
-
index: number;
|
|
120
|
-
}>> & {
|
|
121
|
-
default(props: {
|
|
122
|
-
open: boolean;
|
|
123
|
-
}): any;
|
|
124
|
-
item: SlotProps<NestedItem<T>>;
|
|
125
|
-
'item-leading': SlotProps<NestedItem<T>>;
|
|
126
|
-
'item-label': SlotProps<NestedItem<T>>;
|
|
127
|
-
'item-trailing': SlotProps<NestedItem<T>>;
|
|
128
|
-
'content-top': (props?: {}) => any;
|
|
129
|
-
'content-bottom': (props?: {}) => any;
|
|
130
|
-
} & DynamicSlots<MergeTypes<NestedItem<T>>, "trailing" | "leading" | "label", {
|
|
131
|
-
active?: boolean;
|
|
132
|
-
index: number;
|
|
133
|
-
}>;
|
|
111
|
+
slots: DropdownMenuSlots<T, NestedItem<T>>;
|
|
134
112
|
emit: (evt: "update:open", payload: boolean) => void;
|
|
135
113
|
}>) => import("vue").VNode & {
|
|
136
114
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
@@ -64,29 +64,29 @@ const groups = computed(
|
|
|
64
64
|
<DefineItemTemplate v-slot="{ item, active, index }">
|
|
65
65
|
<slot :name="item.slot || 'item'" :item="item" :index="index">
|
|
66
66
|
<slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="item" :active="active" :index="index">
|
|
67
|
-
<UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, color: item?.color, loading: true })" />
|
|
68
|
-
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, color: item?.color, active })" />
|
|
69
|
-
<UAvatar v-else-if="item.avatar" :size="props.uiOverride?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: uiOverride?.itemLeadingAvatar, active })" />
|
|
67
|
+
<UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: [uiOverride?.itemLeadingIcon, item.ui?.itemLeadingIcon], color: item?.color, loading: true })" />
|
|
68
|
+
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: [uiOverride?.itemLeadingIcon, item.ui?.itemLeadingIcon], color: item?.color, active })" />
|
|
69
|
+
<UAvatar v-else-if="item.avatar" :size="item.ui?.itemLeadingAvatarSize || props.uiOverride?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: [uiOverride?.itemLeadingAvatar, item.ui?.itemLeadingAvatar], active })" />
|
|
70
70
|
</slot>
|
|
71
71
|
|
|
72
|
-
<span v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.itemLabel({ class: uiOverride?.itemLabel, active })">
|
|
72
|
+
<span v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.itemLabel({ class: [uiOverride?.itemLabel, item.ui?.itemLabel], active })">
|
|
73
73
|
<slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="active" :index="index">
|
|
74
74
|
{{ get(item, props.labelKey) }}
|
|
75
75
|
</slot>
|
|
76
76
|
|
|
77
|
-
<UIcon v-if="item.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" :class="ui.itemLabelExternalIcon({ class: uiOverride?.itemLabelExternalIcon, color: item?.color, active })" />
|
|
77
|
+
<UIcon v-if="item.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" :class="ui.itemLabelExternalIcon({ class: [uiOverride?.itemLabelExternalIcon, item.ui?.itemLabelExternalIcon], color: item?.color, active })" />
|
|
78
78
|
</span>
|
|
79
79
|
|
|
80
|
-
<span :class="ui.itemTrailing({ class: uiOverride?.itemTrailing })">
|
|
80
|
+
<span :class="ui.itemTrailing({ class: [uiOverride?.itemTrailing, item.ui?.itemTrailing] })">
|
|
81
81
|
<slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="active" :index="index">
|
|
82
|
-
<UIcon v-if="item.children?.length" :name="childrenIcon" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon, color: item?.color, active })" />
|
|
83
|
-
<span v-else-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: uiOverride?.itemTrailingKbds })">
|
|
84
|
-
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="props.uiOverride?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
82
|
+
<UIcon v-if="item.children?.length" :name="childrenIcon" :class="ui.itemTrailingIcon({ class: [uiOverride?.itemTrailingIcon, item.ui?.itemTrailingIcon], color: item?.color, active })" />
|
|
83
|
+
<span v-else-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: [uiOverride?.itemTrailingKbds, item.ui?.itemTrailingKbds] })">
|
|
84
|
+
<UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="item.ui?.itemTrailingKbdsSize || props.uiOverride?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
85
85
|
</span>
|
|
86
86
|
</slot>
|
|
87
87
|
|
|
88
88
|
<DropdownMenu.ItemIndicator as-child>
|
|
89
|
-
<UIcon :name="checkedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon, color: item?.color })" />
|
|
89
|
+
<UIcon :name="checkedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: [uiOverride?.itemTrailingIcon, item.ui?.itemTrailingIcon], color: item?.color })" />
|
|
90
90
|
</DropdownMenu.ItemIndicator>
|
|
91
91
|
</span>
|
|
92
92
|
</slot>
|
|
@@ -98,17 +98,17 @@ const groups = computed(
|
|
|
98
98
|
|
|
99
99
|
<DropdownMenu.Group v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" :class="ui.group({ class: uiOverride?.group })">
|
|
100
100
|
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
101
|
-
<DropdownMenu.Label v-if="item.type === 'label'" :class="ui.label({ class: uiOverride?.label })">
|
|
101
|
+
<DropdownMenu.Label v-if="item.type === 'label'" :class="ui.label({ class: [uiOverride?.label, item.ui?.label, item.class] })">
|
|
102
102
|
<ReuseItemTemplate :item="item" :index="index" />
|
|
103
103
|
</DropdownMenu.Label>
|
|
104
|
-
<DropdownMenu.Separator v-else-if="item.type === 'separator'" :class="ui.separator({ class: uiOverride?.separator })" />
|
|
104
|
+
<DropdownMenu.Separator v-else-if="item.type === 'separator'" :class="ui.separator({ class: [uiOverride?.separator, item.ui?.separator, item.class] })" />
|
|
105
105
|
<DropdownMenu.Sub v-else-if="item?.children?.length" :open="item.open" :default-open="item.defaultOpen">
|
|
106
106
|
<DropdownMenu.SubTrigger
|
|
107
107
|
as="button"
|
|
108
108
|
type="button"
|
|
109
109
|
:disabled="item.disabled"
|
|
110
110
|
:text-value="get(item, props.labelKey)"
|
|
111
|
-
:class="ui.item({ class: uiOverride?.item, color: item?.color })"
|
|
111
|
+
:class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], color: item?.color })"
|
|
112
112
|
>
|
|
113
113
|
<ReuseItemTemplate :item="item" :index="index" />
|
|
114
114
|
</DropdownMenu.SubTrigger>
|
|
@@ -139,7 +139,7 @@ const groups = computed(
|
|
|
139
139
|
:model-value="item.checked"
|
|
140
140
|
:disabled="item.disabled"
|
|
141
141
|
:text-value="get(item, props.labelKey)"
|
|
142
|
-
:class="ui.item({ class: [uiOverride?.item, item.class], color: item?.color })"
|
|
142
|
+
:class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], color: item?.color })"
|
|
143
143
|
@update:model-value="item.onUpdateChecked"
|
|
144
144
|
@select="item.onSelect"
|
|
145
145
|
>
|
|
@@ -153,7 +153,7 @@ const groups = computed(
|
|
|
153
153
|
@select="item.onSelect"
|
|
154
154
|
>
|
|
155
155
|
<ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
|
|
156
|
-
<ULinkBase v-bind="slotProps" :class="ui.item({ class: [uiOverride?.item, item.class], color: item?.color, active })">
|
|
156
|
+
<ULinkBase v-bind="slotProps" :class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], color: item?.color, active })">
|
|
157
157
|
<ReuseItemTemplate :item="item" :active="active" :index="index" />
|
|
158
158
|
</ULinkBase>
|
|
159
159
|
</ULink>
|
|
@@ -28,15 +28,28 @@ interface DropdownMenuContentProps<T extends ArrayOrNested<DropdownMenuItem>> ex
|
|
|
28
28
|
};
|
|
29
29
|
uiOverride?: DropdownMenu['slots'];
|
|
30
30
|
}
|
|
31
|
+
type DropdownMenuContentSlots<T extends ArrayOrNested<DropdownMenuItem>> = Omit<DropdownMenuSlots<T>, 'default'> & {
|
|
32
|
+
default(props?: {}): any;
|
|
33
|
+
};
|
|
31
34
|
declare const _default: <T extends ArrayOrNested<DropdownMenuItem>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
32
|
-
props: __VLS_PrettifyLocal<
|
|
35
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
36
|
+
readonly onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
37
|
+
readonly onPointerDownOutside?: ((event: CustomEvent<{
|
|
38
|
+
originalEvent: PointerEvent;
|
|
39
|
+
}>) => any) | undefined;
|
|
40
|
+
readonly onFocusOutside?: ((event: CustomEvent<{
|
|
41
|
+
originalEvent: FocusEvent;
|
|
42
|
+
}>) => any) | undefined;
|
|
43
|
+
readonly onInteractOutside?: ((event: CustomEvent<{
|
|
44
|
+
originalEvent: PointerEvent;
|
|
45
|
+
}> | CustomEvent<{
|
|
46
|
+
originalEvent: FocusEvent;
|
|
47
|
+
}>) => any) | undefined;
|
|
48
|
+
readonly onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
49
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onEscapeKeyDown" | "onPointerDownOutside" | "onFocusOutside" | "onInteractOutside" | "onCloseAutoFocus"> & DropdownMenuContentProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
33
50
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
34
51
|
attrs: any;
|
|
35
|
-
slots:
|
|
36
|
-
default(props?: {}): any;
|
|
37
|
-
}> & Omit<DropdownMenuSlots<T>, "default"> & {
|
|
38
|
-
default(props?: {}): any;
|
|
39
|
-
};
|
|
52
|
+
slots: DropdownMenuContentSlots<T>;
|
|
40
53
|
emit: ((evt: "escapeKeyDown", event: KeyboardEvent) => void) & ((evt: "pointerDownOutside", event: CustomEvent<{
|
|
41
54
|
originalEvent: PointerEvent;
|
|
42
55
|
}>) => void) & ((evt: "focusOutside", event: CustomEvent<{
|
|
@@ -52,10 +52,13 @@ export interface FormSlots {
|
|
|
52
52
|
}): any;
|
|
53
53
|
}
|
|
54
54
|
declare const _default: <S extends FormSchema>(__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<{
|
|
55
|
-
props: __VLS_PrettifyLocal<
|
|
55
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
56
|
+
readonly onError?: ((payload: FormErrorEvent) => any) | undefined;
|
|
57
|
+
readonly onSubmit?: ((payload: FormSubmitEvent<InferOutput<S>>) => any) | undefined;
|
|
58
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onError" | "onSubmit"> & FormProps<S> & Partial<{}>> & import("vue").PublicProps;
|
|
56
59
|
expose(exposed: import("vue").ShallowUnwrapRef<Form<InferInput<S>>>): void;
|
|
57
60
|
attrs: any;
|
|
58
|
-
slots:
|
|
61
|
+
slots: FormSlots;
|
|
59
62
|
emit: FormEmits<S>;
|
|
60
63
|
}>) => import("vue").VNode & {
|
|
61
64
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
@@ -50,7 +50,7 @@ provide(formFieldInjectionKey, computed(() => ({
|
|
|
50
50
|
</script>
|
|
51
51
|
|
|
52
52
|
<template>
|
|
53
|
-
<Primitive :as="as" :class="ui.root({ class: [props.
|
|
53
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
54
54
|
<div :class="ui.wrapper({ class: props.ui?.wrapper })">
|
|
55
55
|
<div v-if="label || !!slots.label" :class="ui.labelWrapper({ class: props.ui?.labelWrapper })">
|
|
56
56
|
<Label :for="id" :class="ui.label({ class: props.ui?.label })">
|
|
@@ -75,16 +75,16 @@ provide(formFieldInjectionKey, computed(() => ({
|
|
|
75
75
|
<div :class="[(label || !!slots.label || description || !!slots.description) && ui.container({ class: props.ui?.container })]">
|
|
76
76
|
<slot :error="error" />
|
|
77
77
|
|
|
78
|
-
<
|
|
78
|
+
<div v-if="typeof error === 'string' && error || !!slots.error" :id="`${ariaId}-error`" :class="ui.error({ class: props.ui?.error })">
|
|
79
79
|
<slot name="error" :error="error">
|
|
80
80
|
{{ error }}
|
|
81
81
|
</slot>
|
|
82
|
-
</
|
|
83
|
-
<
|
|
82
|
+
</div>
|
|
83
|
+
<div v-else-if="help || !!slots.help" :class="ui.help({ class: props.ui?.help })">
|
|
84
84
|
<slot name="help" :help="help">
|
|
85
85
|
{{ help }}
|
|
86
86
|
</slot>
|
|
87
|
-
</
|
|
87
|
+
</div>
|
|
88
88
|
</div>
|
|
89
89
|
</Primitive>
|
|
90
90
|
</template>
|
|
@@ -52,18 +52,9 @@ export interface FormFieldSlots {
|
|
|
52
52
|
error?: string | boolean;
|
|
53
53
|
}): any;
|
|
54
54
|
}
|
|
55
|
-
declare const _default:
|
|
55
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<FormFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FormFieldProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, FormFieldSlots>;
|
|
56
56
|
export default _default;
|
|
57
|
-
type
|
|
58
|
-
type __VLS_TypePropsToOption<T> = {
|
|
59
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
60
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
61
|
-
} : {
|
|
62
|
-
type: import('vue').PropType<T[K]>;
|
|
63
|
-
required: true;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
57
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
67
58
|
new (): {
|
|
68
59
|
$slots: S;
|
|
69
60
|
};
|
|
@@ -4,14 +4,5 @@ export interface IconProps {
|
|
|
4
4
|
size?: string | number;
|
|
5
5
|
customize?: (content: string, name?: string, prefix?: string, provider?: string) => string;
|
|
6
6
|
}
|
|
7
|
-
declare const _default: import("vue").DefineComponent<
|
|
7
|
+
declare const _default: import("vue").DefineComponent<IconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
8
|
export default _default;
|
|
9
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
10
|
-
type __VLS_TypePropsToOption<T> = {
|
|
11
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
12
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
13
|
-
} : {
|
|
14
|
-
type: import('vue').PropType<T[K]>;
|
|
15
|
-
required: true;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
@@ -42,7 +42,7 @@ const props = defineProps({
|
|
|
42
42
|
});
|
|
43
43
|
const emits = defineEmits(["update:modelValue", "blur", "change"]);
|
|
44
44
|
const slots = defineSlots();
|
|
45
|
-
const [modelValue, modelModifiers] = defineModel({ type:
|
|
45
|
+
const [modelValue, modelModifiers] = defineModel({ type: null });
|
|
46
46
|
const appConfig = useAppConfig();
|
|
47
47
|
const { emitFormBlur, emitFormInput, emitFormChange, size: formGroupSize, color, id, name, highlight, disabled, emitFormFocus, ariaAttrs } = useFormField(props, { deferInputValidation: true });
|
|
48
48
|
const { orientation, size: buttonGroupSize } = useButtonGroup(props);
|
|
@@ -109,7 +109,7 @@ defineExpose({
|
|
|
109
109
|
</script>
|
|
110
110
|
|
|
111
111
|
<template>
|
|
112
|
-
<Primitive :as="as" :class="ui.root({ class: [props.
|
|
112
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
113
113
|
<input
|
|
114
114
|
:id="id"
|
|
115
115
|
ref="inputRef"
|
|
@@ -2,7 +2,7 @@ import type { InputHTMLAttributes } from 'vue';
|
|
|
2
2
|
import type { AppConfig } from '@nuxt/schema';
|
|
3
3
|
import theme from '#build/ui/input';
|
|
4
4
|
import type { UseComponentIconsProps } from '../composables/useComponentIcons';
|
|
5
|
-
import type { ComponentConfig } from '../types/utils';
|
|
5
|
+
import type { AcceptableValue, ComponentConfig } from '../types/utils';
|
|
6
6
|
type Input = ComponentConfig<typeof theme, AppConfig, 'input'>;
|
|
7
7
|
export interface InputProps extends UseComponentIconsProps {
|
|
8
8
|
/**
|
|
@@ -37,8 +37,8 @@ export interface InputProps extends UseComponentIconsProps {
|
|
|
37
37
|
class?: any;
|
|
38
38
|
ui?: Input['slots'];
|
|
39
39
|
}
|
|
40
|
-
export interface InputEmits {
|
|
41
|
-
(e: 'update:modelValue', payload:
|
|
40
|
+
export interface InputEmits<T extends AcceptableValue = AcceptableValue> {
|
|
41
|
+
(e: 'update:modelValue', payload: T): void;
|
|
42
42
|
(e: 'blur', event: FocusEvent): void;
|
|
43
43
|
(e: 'change', event: Event): void;
|
|
44
44
|
}
|
|
@@ -47,45 +47,24 @@ export interface InputSlots {
|
|
|
47
47
|
default(props?: {}): any;
|
|
48
48
|
trailing(props?: {}): any;
|
|
49
49
|
}
|
|
50
|
-
declare const _default:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
autocomplete: string;
|
|
67
|
-
autofocusDelay: number;
|
|
68
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, Readonly<InputSlots> & InputSlots>;
|
|
69
|
-
export default _default;
|
|
70
|
-
type __VLS_WithDefaults<P, D> = {
|
|
71
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
72
|
-
default: D[K];
|
|
73
|
-
}> : P[K];
|
|
74
|
-
};
|
|
75
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
76
|
-
type __VLS_TypePropsToOption<T> = {
|
|
77
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
78
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
79
|
-
} : {
|
|
80
|
-
type: import('vue').PropType<T[K]>;
|
|
81
|
-
required: true;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
85
|
-
new (): {
|
|
86
|
-
$slots: S;
|
|
87
|
-
};
|
|
50
|
+
declare const _default: <T extends AcceptableValue>(__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<{
|
|
51
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
52
|
+
readonly onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
53
|
+
readonly onChange?: ((event: Event) => any) | undefined;
|
|
54
|
+
readonly "onUpdate:modelValue"?: ((payload: T) => any) | undefined;
|
|
55
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onBlur" | "onChange" | "onUpdate:modelValue"> & (InputProps & {
|
|
56
|
+
modelValue?: T;
|
|
57
|
+
}) & Partial<{}>> & import("vue").PublicProps;
|
|
58
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
59
|
+
inputRef: import("vue").Ref<HTMLInputElement | null, HTMLInputElement | null>;
|
|
60
|
+
}>): void;
|
|
61
|
+
attrs: any;
|
|
62
|
+
slots: InputSlots;
|
|
63
|
+
emit: InputEmits<T> & ((evt: "update:modelValue", value: T | undefined) => void);
|
|
64
|
+
}>) => import("vue").VNode & {
|
|
65
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
88
66
|
};
|
|
67
|
+
export default _default;
|
|
89
68
|
type __VLS_PrettifyLocal<T> = {
|
|
90
69
|
[K in keyof T]: T[K];
|
|
91
70
|
} & {};
|