@sewadah/selaras 0.3.0 → 0.3.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/README.md +4 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +21 -6
- package/dist/runtime/components/AlertDialog.d.vue.ts +5 -3
- package/dist/runtime/components/AlertDialog.vue +17 -9
- package/dist/runtime/components/AlertDialog.vue.d.ts +5 -3
- package/dist/runtime/components/App.vue +2 -0
- package/dist/runtime/components/Autocomplete.d.vue.ts +2 -2
- package/dist/runtime/components/Autocomplete.vue +4 -2
- package/dist/runtime/components/Autocomplete.vue.d.ts +2 -2
- package/dist/runtime/components/Button.d.vue.ts +7 -5
- package/dist/runtime/components/Button.vue +14 -3
- package/dist/runtime/components/Button.vue.d.ts +7 -5
- package/dist/runtime/components/Calendar.d.vue.ts +69 -0
- package/dist/runtime/components/Calendar.vue +163 -0
- package/dist/runtime/components/Calendar.vue.d.ts +69 -0
- package/dist/runtime/components/Callout.vue +12 -1
- package/dist/runtime/components/CodeGroup.vue +13 -3
- package/dist/runtime/components/CodeTree.d.vue.ts +2 -0
- package/dist/runtime/components/CodeTree.vue +52 -1
- package/dist/runtime/components/CodeTree.vue.d.ts +2 -0
- package/dist/runtime/components/ColorModeSwitch.d.vue.ts +18 -0
- package/dist/runtime/components/ColorModeSwitch.vue +59 -0
- package/dist/runtime/components/ColorModeSwitch.vue.d.ts +18 -0
- package/dist/runtime/components/ColorPicker.d.vue.ts +8 -0
- package/dist/runtime/components/ColorPicker.vue +66 -45
- package/dist/runtime/components/ColorPicker.vue.d.ts +8 -0
- package/dist/runtime/components/Column.js +1 -1
- package/dist/runtime/components/CommandPalette.d.vue.ts +3 -1
- package/dist/runtime/components/CommandPalette.vue +5 -0
- package/dist/runtime/components/CommandPalette.vue.d.ts +3 -1
- package/dist/runtime/components/ConfirmRenderer.d.vue.ts +3 -0
- package/dist/runtime/components/ConfirmRenderer.vue +39 -0
- package/dist/runtime/components/ConfirmRenderer.vue.d.ts +3 -0
- package/dist/runtime/components/ContentNavigation.d.vue.ts +8 -1
- package/dist/runtime/components/ContentNavigation.vue +9 -2
- package/dist/runtime/components/ContentNavigation.vue.d.ts +8 -1
- package/dist/runtime/components/ContextMenu.d.vue.ts +8 -1
- package/dist/runtime/components/ContextMenu.vue +20 -6
- package/dist/runtime/components/ContextMenu.vue.d.ts +8 -1
- package/dist/runtime/components/DatePicker.d.vue.ts +10 -3
- package/dist/runtime/components/DatePicker.vue +24 -16
- package/dist/runtime/components/DatePicker.vue.d.ts +10 -3
- package/dist/runtime/components/Drawer.vue +3 -2
- package/dist/runtime/components/Dropdown.d.vue.ts +33 -6
- package/dist/runtime/components/Dropdown.vue +146 -12
- package/dist/runtime/components/Dropdown.vue.d.ts +33 -6
- package/dist/runtime/components/FileTree.d.vue.ts +2 -0
- package/dist/runtime/components/FileTree.vue +8 -4
- package/dist/runtime/components/FileTree.vue.d.ts +2 -0
- package/dist/runtime/components/FormField.d.vue.ts +4 -0
- package/dist/runtime/components/FormField.vue +19 -4
- package/dist/runtime/components/FormField.vue.d.ts +4 -0
- package/dist/runtime/components/Input.vue +3 -2
- package/dist/runtime/components/Kbd.vue +12 -2
- package/dist/runtime/components/Modal.vue +3 -2
- package/dist/runtime/components/NavigationMenu.d.vue.ts +10 -10
- package/dist/runtime/components/NavigationMenu.vue +13 -9
- package/dist/runtime/components/NavigationMenu.vue.d.ts +10 -10
- package/dist/runtime/components/NavigationMenuAccordionItem.vue +5 -1
- package/dist/runtime/components/NavigationMenuFlyoutList.vue +7 -4
- package/dist/runtime/components/Popover.d.vue.ts +8 -2
- package/dist/runtime/components/Popover.vue +13 -6
- package/dist/runtime/components/Popover.vue.d.ts +8 -2
- package/dist/runtime/components/ProsePre.d.vue.ts +2 -0
- package/dist/runtime/components/ProsePre.vue +2 -1
- package/dist/runtime/components/ProsePre.vue.d.ts +2 -0
- package/dist/runtime/components/Select.d.vue.ts +8 -4
- package/dist/runtime/components/Select.vue +4 -2
- package/dist/runtime/components/Select.vue.d.ts +8 -4
- package/dist/runtime/components/Slideover.vue +3 -2
- package/dist/runtime/components/SplitterPanel.d.vue.ts +2 -2
- package/dist/runtime/components/SplitterPanel.vue.d.ts +2 -2
- package/dist/runtime/components/Table.vue +95 -26
- package/dist/runtime/components/Tabs.d.vue.ts +44 -4
- package/dist/runtime/components/Tabs.vue +171 -18
- package/dist/runtime/components/Tabs.vue.d.ts +44 -4
- package/dist/runtime/components/Textarea.vue +3 -2
- package/dist/runtime/components/Timeline.d.vue.ts +19 -0
- package/dist/runtime/components/Timeline.vue +99 -0
- package/dist/runtime/components/Timeline.vue.d.ts +19 -0
- package/dist/runtime/components/Toast.d.vue.ts +10 -1
- package/dist/runtime/components/Toast.vue +94 -8
- package/dist/runtime/components/Toast.vue.d.ts +10 -1
- package/dist/runtime/components/Tooltip.d.vue.ts +8 -2
- package/dist/runtime/components/Tooltip.vue +13 -6
- package/dist/runtime/components/Tooltip.vue.d.ts +8 -2
- package/dist/runtime/composables/use-confirm.d.ts +14 -0
- package/dist/runtime/composables/use-confirm.js +28 -0
- package/dist/runtime/composables/use-form-field.d.ts +1 -0
- package/dist/runtime/composables/use-table.d.ts +3 -0
- package/dist/runtime/composables/use-table.js +10 -4
- package/dist/runtime/composables/use-toast.js +5 -1
- package/dist/runtime/directives/hotkey.d.ts +13 -0
- package/dist/runtime/directives/hotkey.js +107 -0
- package/dist/runtime/directives/index.d.ts +2 -0
- package/dist/runtime/directives/index.js +2 -0
- package/dist/runtime/directives/mask.d.ts +30 -0
- package/dist/runtime/directives/mask.js +165 -0
- package/dist/runtime/internal/ComboboxSelectBase.d.vue.ts +41 -36
- package/dist/runtime/internal/ComboboxSelectBase.vue +119 -26
- package/dist/runtime/internal/ComboboxSelectBase.vue.d.ts +41 -36
- package/dist/runtime/internal/ComboboxSelectBody.d.vue.ts +23 -17
- package/dist/runtime/internal/ComboboxSelectBody.vue +50 -11
- package/dist/runtime/internal/ComboboxSelectBody.vue.d.ts +23 -17
- package/dist/runtime/internal/DatePickerCalendarBody.vue +1 -1
- package/dist/runtime/internal/DatePickerRangeCalendarBody.vue +1 -1
- package/dist/runtime/internal/ShortcutHint.d.vue.ts +6 -0
- package/dist/runtime/internal/ShortcutHint.vue +13 -0
- package/dist/runtime/internal/ShortcutHint.vue.d.ts +6 -0
- package/dist/runtime/internal/ToastItemRenderer.d.vue.ts +9 -1
- package/dist/runtime/internal/ToastItemRenderer.vue +55 -8
- package/dist/runtime/internal/ToastItemRenderer.vue.d.ts +9 -1
- package/dist/runtime/internal/combobox-select.d.ts +19 -18
- package/dist/runtime/internal/combobox-select.js +38 -15
- package/dist/runtime/internal/programmatic-services.d.ts +13 -0
- package/dist/runtime/internal/programmatic-services.js +9 -0
- package/dist/runtime/internal/toast-stack.d.ts +36 -0
- package/dist/runtime/internal/toast-stack.js +36 -0
- package/dist/runtime/structural.css +1 -1
- package/dist/runtime/table.d.ts +1 -1
- package/dist/runtime/theme/alert-dialog.js +1 -1
- package/dist/runtime/theme/badge.d.ts +9 -0
- package/dist/runtime/theme/badge.js +2 -1
- package/dist/runtime/theme/button.d.ts +18 -0
- package/dist/runtime/theme/button.js +4 -1
- package/dist/runtime/theme/calendar.d.ts +86 -0
- package/dist/runtime/theme/calendar.js +19 -0
- package/dist/runtime/theme/callout.d.ts +0 -12
- package/dist/runtime/theme/callout.js +8 -8
- package/dist/runtime/theme/code-tree.js +1 -1
- package/dist/runtime/theme/command-palette.js +1 -1
- package/dist/runtime/theme/content-navigation.d.ts +3 -0
- package/dist/runtime/theme/content-navigation.js +1 -0
- package/dist/runtime/theme/drawer.js +1 -1
- package/dist/runtime/theme/dropdown.d.ts +21 -0
- package/dist/runtime/theme/dropdown.js +15 -2
- package/dist/runtime/theme/file-tree.js +1 -1
- package/dist/runtime/theme/form-field.d.ts +18 -0
- package/dist/runtime/theme/form-field.js +6 -1
- package/dist/runtime/theme/modal.js +1 -1
- package/dist/runtime/theme/slideover.js +1 -1
- package/dist/runtime/theme/table.d.ts +27 -0
- package/dist/runtime/theme/table.js +11 -2
- package/dist/runtime/theme/tabs.d.ts +87 -3
- package/dist/runtime/theme/tabs.js +46 -22
- package/dist/runtime/theme/timeline.d.ts +251 -0
- package/dist/runtime/theme/timeline.js +84 -0
- package/dist/runtime/theme/toast.d.ts +92 -0
- package/dist/runtime/theme/toast.js +29 -7
- package/dist/runtime/theme-config.d.ts +13 -2
- package/dist/runtime/types/index.d.ts +10 -2
- package/dist/runtime/utils/arrow.d.ts +21 -0
- package/dist/runtime/utils/arrow.js +10 -0
- package/dist/runtime/utils/autocomplete-contracts.d.ts +4 -4
- package/dist/runtime/utils/file-icons.js +3 -0
- package/dist/runtime/utils/icons.d.ts +2 -0
- package/dist/runtime/utils/icons.js +2 -0
- package/dist/runtime/utils/messages.d.ts +7 -0
- package/dist/runtime/utils/messages.js +7 -0
- package/dist/runtime/utils/navigation-menu.d.ts +7 -0
- package/dist/runtime/utils/navigation-menu.js +3 -0
- package/dist/runtime/utils/overlay.d.ts +17 -0
- package/dist/runtime/utils/overlay.js +7 -0
- package/dist/runtime/utils/select-contracts.d.ts +25 -11
- package/dist/runtime/utils/table-columns.js +1 -1
- package/dist/runtime/utils/table-contracts.d.ts +9 -1
- package/dist/runtime/utils/timeline-contracts.d.ts +42 -0
- package/dist/runtime/utils/timeline-contracts.js +0 -0
- package/dist/runtime/utils/ui.d.ts +11 -0
- package/dist/runtime/utils/ui.js +54 -1
- package/package.json +6 -5
|
@@ -4,7 +4,12 @@ import type { UiProp } from '../utils/ui.js';
|
|
|
4
4
|
export interface ContentNavigationLink {
|
|
5
5
|
title: string;
|
|
6
6
|
path: string;
|
|
7
|
-
icon?: string;
|
|
7
|
+
icon?: string | false;
|
|
8
|
+
order?: number;
|
|
9
|
+
collapse?: boolean;
|
|
10
|
+
navBadges?: Array<string | {
|
|
11
|
+
text: string;
|
|
12
|
+
}>;
|
|
8
13
|
children?: ContentNavigationLink[];
|
|
9
14
|
}
|
|
10
15
|
type __VLS_Slots = ContentNavigationSlots;
|
|
@@ -12,6 +17,8 @@ export interface ContentNavigationProps {
|
|
|
12
17
|
navigation: ContentNavigationLink[];
|
|
13
18
|
/** The active-link accent. @default 'primary' */
|
|
14
19
|
color?: ColorRole;
|
|
20
|
+
/** Collapse every group initially unless the item's own `collapse` metadata overrides it. @default false */
|
|
21
|
+
collapsed?: boolean;
|
|
15
22
|
/** Set only by this component's own recursive self-call, one level down for each nested group - gates the tree-connector rail (see `content-navigation.ts`'s own `isNested` variant), since a root-level entry has no parent trunk to its left to branch off of. */
|
|
16
23
|
isNested?: boolean;
|
|
17
24
|
ui?: UiProp<ContentNavigationThemeSlots>;
|
|
@@ -10,6 +10,7 @@ defineOptions({ inheritAttrs: false });
|
|
|
10
10
|
const props = defineProps({
|
|
11
11
|
navigation: { type: Array, required: true },
|
|
12
12
|
color: { type: null, required: false },
|
|
13
|
+
collapsed: { type: Boolean, required: false },
|
|
13
14
|
isNested: { type: Boolean, required: false },
|
|
14
15
|
ui: { type: Object, required: false }
|
|
15
16
|
});
|
|
@@ -37,19 +38,22 @@ const groupUi = computed(() => ({
|
|
|
37
38
|
<Accordion
|
|
38
39
|
v-if="link.children?.length"
|
|
39
40
|
:items="[{ value: link.path, label: link.title }]"
|
|
40
|
-
:default-value="[link.path]"
|
|
41
|
+
:default-value="link.collapse ?? collapsed ? [] : [link.path]"
|
|
41
42
|
:ui="groupUi"
|
|
42
43
|
>
|
|
43
44
|
<template #label>
|
|
44
45
|
<slot name="link" :link="link" :active="false">
|
|
45
46
|
<Icon v-if="link.icon" :name="link.icon" v-bind="resolveSlot(ui.icon, props.ui?.icon)" />
|
|
46
47
|
{{ link.title }}
|
|
48
|
+
<span v-for="(badge, index) in link.navBadges" :key="`${link.path}:badge:${index}`" v-bind="resolveSlot(ui.badge, props.ui?.badge)">
|
|
49
|
+
{{ typeof badge === "string" ? badge : badge.text }}
|
|
50
|
+
</span>
|
|
47
51
|
</slot>
|
|
48
52
|
</template>
|
|
49
53
|
<template #[link.path]>
|
|
50
54
|
<!-- Vue's SFC self-recursion resolves by this file's own bare name -
|
|
51
55
|
keep it unprefixed even though the public component is SContentNavigation. -->
|
|
52
|
-
<ContentNavigation :navigation="link.children" is-nested :color="color" :ui="props.ui">
|
|
56
|
+
<ContentNavigation :navigation="link.children" is-nested :color="color" :collapsed="collapsed" :ui="props.ui">
|
|
53
57
|
<template #link="scope">
|
|
54
58
|
<slot name="link" v-bind="scope" />
|
|
55
59
|
</template>
|
|
@@ -60,6 +64,9 @@ const groupUi = computed(() => ({
|
|
|
60
64
|
<slot name="link" :link="link" :active="isActive(link)">
|
|
61
65
|
<Icon v-if="link.icon" :name="link.icon" v-bind="resolveSlot(ui.icon, props.ui?.icon)" />
|
|
62
66
|
{{ link.title }}
|
|
67
|
+
<span v-for="(badge, index) in link.navBadges" :key="`${link.path}:badge:${index}`" v-bind="resolveSlot(ui.badge, props.ui?.badge)">
|
|
68
|
+
{{ typeof badge === "string" ? badge : badge.text }}
|
|
69
|
+
</span>
|
|
63
70
|
</slot>
|
|
64
71
|
</NuxtLink>
|
|
65
72
|
</li>
|
|
@@ -4,7 +4,12 @@ import type { UiProp } from '../utils/ui.js';
|
|
|
4
4
|
export interface ContentNavigationLink {
|
|
5
5
|
title: string;
|
|
6
6
|
path: string;
|
|
7
|
-
icon?: string;
|
|
7
|
+
icon?: string | false;
|
|
8
|
+
order?: number;
|
|
9
|
+
collapse?: boolean;
|
|
10
|
+
navBadges?: Array<string | {
|
|
11
|
+
text: string;
|
|
12
|
+
}>;
|
|
8
13
|
children?: ContentNavigationLink[];
|
|
9
14
|
}
|
|
10
15
|
type __VLS_Slots = ContentNavigationSlots;
|
|
@@ -12,6 +17,8 @@ export interface ContentNavigationProps {
|
|
|
12
17
|
navigation: ContentNavigationLink[];
|
|
13
18
|
/** The active-link accent. @default 'primary' */
|
|
14
19
|
color?: ColorRole;
|
|
20
|
+
/** Collapse every group initially unless the item's own `collapse` metadata overrides it. @default false */
|
|
21
|
+
collapsed?: boolean;
|
|
15
22
|
/** Set only by this component's own recursive self-call, one level down for each nested group - gates the tree-connector rail (see `content-navigation.ts`'s own `isNested` variant), since a root-level entry has no parent trunk to its left to branch off of. */
|
|
16
23
|
isNested?: boolean;
|
|
17
24
|
ui?: UiProp<ContentNavigationThemeSlots>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ContextMenuThemeSlots } from '../theme/context-menu.js';
|
|
2
|
+
import type { ContextMenuPositioning, OverlayPortal } from '../utils/overlay.js';
|
|
2
3
|
import type { UiProp } from '../utils/ui.js';
|
|
3
4
|
export interface ContextMenuItemDef {
|
|
4
5
|
label: string;
|
|
@@ -7,12 +8,18 @@ export interface ContextMenuItemDef {
|
|
|
7
8
|
/** Styles this item for a delete/remove-style action (danger text, danger-tinted hover) - matches Dropdown's own `destructive` flag. */
|
|
8
9
|
destructive?: boolean;
|
|
9
10
|
onSelect?: () => void;
|
|
10
|
-
/**
|
|
11
|
+
/** Displays a keyboard shortcut hint. */
|
|
11
12
|
shortcut?: string;
|
|
13
|
+
/** Bind `shortcut` while this menu is open; activation follows the normal menu item click path. */
|
|
14
|
+
hotkey?: boolean;
|
|
12
15
|
}
|
|
13
16
|
type __VLS_Slots = ContextMenuSlots;
|
|
14
17
|
export interface ContextMenuProps {
|
|
15
18
|
items: ContextMenuItemDef[][];
|
|
19
|
+
/** Collision and offset controls for the menu anchored to the right-click point. */
|
|
20
|
+
positioning?: ContextMenuPositioning;
|
|
21
|
+
/** Teleport target, or `false` to render inline. Defaults to `body`. */
|
|
22
|
+
portal?: OverlayPortal;
|
|
16
23
|
ui?: UiProp<ContextMenuThemeSlots>;
|
|
17
24
|
}
|
|
18
25
|
export interface ContextMenuSlots {
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ContextMenuContent, ContextMenuItem, ContextMenuPortal, ContextMenuRoot, ContextMenuSeparator, ContextMenuTrigger } from "reka-ui";
|
|
3
|
-
import { computed } from "vue";
|
|
3
|
+
import { computed, ref } from "vue";
|
|
4
|
+
import { vHotkey } from "../directives/hotkey";
|
|
5
|
+
import ShortcutHint from "../internal/ShortcutHint.vue";
|
|
4
6
|
import { contextMenuTheme } from "../theme/context-menu";
|
|
5
|
-
import {
|
|
7
|
+
import { overlayPortalProps } from "../utils/overlay";
|
|
8
|
+
import { resolveSlot, useComponentTheme, useFallthroughProps, useThemeBindings } from "../utils/ui";
|
|
6
9
|
import Icon from "./Icon.vue";
|
|
10
|
+
defineOptions({ inheritAttrs: false });
|
|
7
11
|
const props = defineProps({
|
|
8
12
|
items: { type: Array, required: true },
|
|
13
|
+
positioning: { type: Object, required: false },
|
|
14
|
+
portal: { type: [Boolean, String], required: false, skipCheck: true, default: void 0 },
|
|
9
15
|
ui: { type: Object, required: false }
|
|
10
16
|
});
|
|
11
17
|
defineSlots();
|
|
12
18
|
const theme = useComponentTheme("contextMenu", contextMenuTheme);
|
|
19
|
+
const open = ref(false);
|
|
13
20
|
const themeBindings = useThemeBindings();
|
|
14
21
|
const ui = computed(() => theme.value());
|
|
15
|
-
const
|
|
22
|
+
const triggerProps = useFallthroughProps();
|
|
23
|
+
const contentProps = computed(() => ({ ...resolveSlot(ui.value.content, props.ui?.content), ...props.positioning }));
|
|
24
|
+
const portalProps = computed(() => overlayPortalProps(props.portal));
|
|
16
25
|
function itemPropsFor(item) {
|
|
17
26
|
return resolveSlot(theme.value({ destructive: item.destructive }).item, props.ui?.item);
|
|
18
27
|
}
|
|
@@ -20,20 +29,24 @@ function iconPropsFor(item) {
|
|
|
20
29
|
return resolveSlot(theme.value({ destructive: item.destructive }).icon, props.ui?.icon);
|
|
21
30
|
}
|
|
22
31
|
const separatorProps = computed(() => resolveSlot(ui.value.separator, props.ui?.separator));
|
|
32
|
+
function hotkeyFor(item) {
|
|
33
|
+
return item.hotkey && item.shortcut && !item.disabled ? { keys: item.shortcut, when: () => open.value } : void 0;
|
|
34
|
+
}
|
|
23
35
|
</script>
|
|
24
36
|
|
|
25
37
|
<template>
|
|
26
|
-
<ContextMenuRoot>
|
|
27
|
-
<ContextMenuTrigger as-child>
|
|
38
|
+
<ContextMenuRoot :open="open" @update:open="open = $event">
|
|
39
|
+
<ContextMenuTrigger as-child v-bind="triggerProps">
|
|
28
40
|
<slot />
|
|
29
41
|
</ContextMenuTrigger>
|
|
30
|
-
<ContextMenuPortal>
|
|
42
|
+
<ContextMenuPortal v-bind="portalProps">
|
|
31
43
|
<ContextMenuContent :data-selaras-theme="themeBindings['data-selaras-theme']" :data-selaras-mode="themeBindings['data-selaras-mode']" :style="themeBindings.style" v-bind="contentProps">
|
|
32
44
|
<template v-for="(group, groupIndex) in items" :key="groupIndex">
|
|
33
45
|
<ContextMenuSeparator v-if="groupIndex > 0" v-bind="separatorProps" />
|
|
34
46
|
<ContextMenuItem
|
|
35
47
|
v-for="(item, itemIndex) in group"
|
|
36
48
|
:key="itemIndex"
|
|
49
|
+
v-hotkey="hotkeyFor(item)"
|
|
37
50
|
:disabled="item.disabled"
|
|
38
51
|
v-bind="itemPropsFor(item)"
|
|
39
52
|
@select="item.onSelect?.()"
|
|
@@ -41,6 +54,7 @@ const separatorProps = computed(() => resolveSlot(ui.value.separator, props.ui?.
|
|
|
41
54
|
<Icon v-if="item.icon" :name="item.icon" v-bind="iconPropsFor(item)" />
|
|
42
55
|
<slot name="item" :item="item">
|
|
43
56
|
{{ item.label }}
|
|
57
|
+
<ShortcutHint :shortcut="item.shortcut" />
|
|
44
58
|
</slot>
|
|
45
59
|
</ContextMenuItem>
|
|
46
60
|
</template>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ContextMenuThemeSlots } from '../theme/context-menu.js';
|
|
2
|
+
import type { ContextMenuPositioning, OverlayPortal } from '../utils/overlay.js';
|
|
2
3
|
import type { UiProp } from '../utils/ui.js';
|
|
3
4
|
export interface ContextMenuItemDef {
|
|
4
5
|
label: string;
|
|
@@ -7,12 +8,18 @@ export interface ContextMenuItemDef {
|
|
|
7
8
|
/** Styles this item for a delete/remove-style action (danger text, danger-tinted hover) - matches Dropdown's own `destructive` flag. */
|
|
8
9
|
destructive?: boolean;
|
|
9
10
|
onSelect?: () => void;
|
|
10
|
-
/**
|
|
11
|
+
/** Displays a keyboard shortcut hint. */
|
|
11
12
|
shortcut?: string;
|
|
13
|
+
/** Bind `shortcut` while this menu is open; activation follows the normal menu item click path. */
|
|
14
|
+
hotkey?: boolean;
|
|
12
15
|
}
|
|
13
16
|
type __VLS_Slots = ContextMenuSlots;
|
|
14
17
|
export interface ContextMenuProps {
|
|
15
18
|
items: ContextMenuItemDef[][];
|
|
19
|
+
/** Collision and offset controls for the menu anchored to the right-click point. */
|
|
20
|
+
positioning?: ContextMenuPositioning;
|
|
21
|
+
/** Teleport target, or `false` to render inline. Defaults to `body`. */
|
|
22
|
+
portal?: OverlayPortal;
|
|
16
23
|
ui?: UiProp<ContextMenuThemeSlots>;
|
|
17
24
|
}
|
|
18
25
|
export interface ContextMenuSlots {
|
|
@@ -2,7 +2,9 @@ import type { DateValue } from '@internationalized/date';
|
|
|
2
2
|
import type { DateRange } from 'reka-ui';
|
|
3
3
|
import type { VariantProps } from 'tailwind-variants';
|
|
4
4
|
import type { DatePickerThemeSlots } from '../theme/date-picker.js';
|
|
5
|
+
import type { RoundedArrowConfig } from '../utils/arrow.js';
|
|
5
6
|
import type { ColorRole } from '../utils/color-registry.js';
|
|
7
|
+
import type { OverlayPortal, OverlayPositioning } from '../utils/overlay.js';
|
|
6
8
|
import type { UiProp } from '../utils/ui.js';
|
|
7
9
|
import { Time } from '@internationalized/date';
|
|
8
10
|
import { datePickerTheme } from '../theme/date-picker.js';
|
|
@@ -73,7 +75,12 @@ export interface DatePickerProps {
|
|
|
73
75
|
activeColor?: ColorRole;
|
|
74
76
|
size?: DatePickerVariants['size'];
|
|
75
77
|
/** Shows a small pointer triangle connecting the panel to its trigger. */
|
|
76
|
-
|
|
78
|
+
/** Shows the pointer; an object configures its size, rounding, and edge clearance. */
|
|
79
|
+
arrow?: boolean | RoundedArrowConfig;
|
|
80
|
+
/** Positioning of the anchored calendar (the adaptive modal uses its own layout). */
|
|
81
|
+
positioning?: OverlayPositioning;
|
|
82
|
+
/** Teleport target for the anchored calendar, or `false` to render it inline. */
|
|
83
|
+
portal?: OverlayPortal;
|
|
77
84
|
/** Opts into the calendar's accessible small-screen modal presentation. It is selected when the calendar opens and held until close. */
|
|
78
85
|
adaptive?: boolean;
|
|
79
86
|
ui?: UiProp<DatePickerThemeSlots>;
|
|
@@ -158,11 +165,11 @@ type __VLS_Slots = {} & {
|
|
|
158
165
|
declare const __VLS_base: import("vue").DefineComponent<DatePickerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
159
166
|
"update:modelValue": (value: DateValue | DateRange | Time | undefined) => any;
|
|
160
167
|
"update:open": (value: boolean) => any;
|
|
161
|
-
"update:view": (view: "
|
|
168
|
+
"update:view": (view: "date" | "month" | "year") => any;
|
|
162
169
|
}, string, import("vue").PublicProps, Readonly<DatePickerProps> & Readonly<{
|
|
163
170
|
"onUpdate:modelValue"?: ((value: DateValue | DateRange | Time | undefined) => any) | undefined;
|
|
164
171
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
165
|
-
"onUpdate:view"?: ((view: "
|
|
172
|
+
"onUpdate:view"?: ((view: "date" | "month" | "year") => any) | undefined;
|
|
166
173
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
167
174
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
168
175
|
declare const _default: typeof __VLS_export;
|
|
@@ -34,6 +34,8 @@ import DatePickerCalendarBody from "../internal/DatePickerCalendarBody.vue";
|
|
|
34
34
|
import DatePickerRangeCalendarBody from "../internal/DatePickerRangeCalendarBody.vue";
|
|
35
35
|
import DatePickerTimeBody from "../internal/DatePickerTimeBody.vue";
|
|
36
36
|
import { datePickerTheme } from "../theme/date-picker";
|
|
37
|
+
import { arrowContentProps, arrowElementProps } from "../utils/arrow";
|
|
38
|
+
import { overlayPortalProps } from "../utils/overlay";
|
|
37
39
|
import { resolveRegisteredColorRole } from "../utils/registered-colors";
|
|
38
40
|
import { applyClassPrefix, resolveSlot, useComponentTheme, useRootProps, useThemeBindings } from "../utils/ui";
|
|
39
41
|
import Button from "./Button.vue";
|
|
@@ -81,7 +83,9 @@ const props = defineProps({
|
|
|
81
83
|
color: { type: null, required: false, default: "neutral" },
|
|
82
84
|
activeColor: { type: null, required: false, default: "primary" },
|
|
83
85
|
size: { type: null, required: false },
|
|
84
|
-
arrow: { type: Boolean, required: false, default: false },
|
|
86
|
+
arrow: { type: [Boolean, Object], required: false, default: false },
|
|
87
|
+
positioning: { type: Object, required: false },
|
|
88
|
+
portal: { type: [Boolean, String], required: false, skipCheck: true, default: void 0 },
|
|
85
89
|
adaptive: { type: Boolean, required: false },
|
|
86
90
|
ui: { type: Object, required: false }
|
|
87
91
|
});
|
|
@@ -360,8 +364,9 @@ const rootProps = useRootProps(() => ui.value.root, () => props.ui?.root);
|
|
|
360
364
|
const fieldProps = computed(() => resolveSlot(ui.value.field, props.ui?.field));
|
|
361
365
|
const segmentProps = computed(() => resolveSlot(ui.value.segment, props.ui?.segment));
|
|
362
366
|
const separatorProps = computed(() => resolveSlot(ui.value.separator, props.ui?.separator));
|
|
363
|
-
const contentProps = computed(() => resolveSlot(ui.value.content, props.ui?.content));
|
|
364
|
-
const
|
|
367
|
+
const contentProps = computed(() => ({ ...resolveSlot(ui.value.content, props.ui?.content), ...arrowContentProps(props.arrow), ...props.positioning }));
|
|
368
|
+
const portalProps = computed(() => overlayPortalProps(props.portal));
|
|
369
|
+
const arrowProps = computed(() => ({ ...resolveSlot(ui.value.arrow, props.ui?.arrow), ...arrowElementProps(props.arrow) }));
|
|
365
370
|
const headerProps = computed(() => resolveSlot(ui.value.header, props.ui?.header));
|
|
366
371
|
const headingProps = computed(() => resolveSlot(ui.value.heading, props.ui?.heading));
|
|
367
372
|
const gridsProps = computed(() => resolveSlot(ui.value.grids, props.ui?.grids));
|
|
@@ -492,7 +497,7 @@ const buttonTriggerUi = computed(() => ({
|
|
|
492
497
|
@update:model-value="(value) => updateModelValue(value)"
|
|
493
498
|
>
|
|
494
499
|
<DateRangePickerAnchor as-child>
|
|
495
|
-
<div v-if="triggerMode === 'field'" :data-selaras-color="fieldColor" :aria-invalid="datePickerInvalid || void 0" :aria-describedby="describedBy" v-bind="fieldProps" :aria-labelledby="field?.labelId">
|
|
500
|
+
<div v-if="triggerMode === 'field'" data-selaras-field-segmented :data-selaras-color="fieldColor" :data-selaras-field-filled="hasValue ? '' : void 0" :data-selaras-field-active="open ? '' : void 0" :aria-invalid="datePickerInvalid || void 0" :aria-describedby="describedBy" v-bind="fieldProps" :aria-labelledby="field?.labelId">
|
|
496
501
|
<DateRangePickerField v-slot="{ segments }" :aria-labelledby="field?.labelId" :aria-describedby="describedBy" :aria-invalid="datePickerInvalid || void 0">
|
|
497
502
|
<template v-for="segment in segments.start" :key="`start-${segment.part}`">
|
|
498
503
|
<DateRangePickerInput as="span" type="start" :part="segment.part" v-bind="segmentProps">
|
|
@@ -533,9 +538,10 @@ const buttonTriggerUi = computed(() => ({
|
|
|
533
538
|
</div>
|
|
534
539
|
</div>
|
|
535
540
|
|
|
536
|
-
<div v-else :class="applyClassPrefix('relative inline-block w-full')">
|
|
541
|
+
<div v-else :class="applyClassPrefix('relative inline-block w-full')" :data-selaras-field-filled="hasValue ? '' : void 0" :data-selaras-field-active="open ? '' : void 0">
|
|
537
542
|
<DateRangePickerTrigger as-child>
|
|
538
543
|
<Button
|
|
544
|
+
:id="datePickerId"
|
|
539
545
|
variant="text"
|
|
540
546
|
:color="color"
|
|
541
547
|
:size="effectiveSize"
|
|
@@ -544,7 +550,7 @@ const buttonTriggerUi = computed(() => ({
|
|
|
544
550
|
:aria-labelledby="field?.labelId"
|
|
545
551
|
:ui="buttonTriggerUi"
|
|
546
552
|
>
|
|
547
|
-
{{ hasValue ? formattedValue : messages.pickDate }}
|
|
553
|
+
{{ hasValue ? formattedValue : field?.floatingLabel.value ? "" : messages.pickDate }}
|
|
548
554
|
<template v-if="!(clearable && hasValue)" #trailing-icon="{ class: iconClass }">
|
|
549
555
|
<slot name="trigger-icon">
|
|
550
556
|
<Icon :name="icons.calendar" :class="iconClass" />
|
|
@@ -570,7 +576,7 @@ const buttonTriggerUi = computed(() => ({
|
|
|
570
576
|
</div>
|
|
571
577
|
</DateRangePickerAnchor>
|
|
572
578
|
|
|
573
|
-
<DateRangePickerContent v-if="!showMobileModal" :side-offset="6" align="start" :data-selaras-theme="themeBindings['data-selaras-theme']" :data-selaras-mode="themeBindings['data-selaras-mode']" :style="themeBindings.style" v-bind="contentProps">
|
|
579
|
+
<DateRangePickerContent v-if="!showMobileModal" :side-offset="6" align="start" :portal="portalProps" :data-selaras-theme="themeBindings['data-selaras-theme']" :data-selaras-mode="themeBindings['data-selaras-mode']" :style="themeBindings.style" v-bind="contentProps">
|
|
574
580
|
<DatePickerRangeCalendarBody v-bind="rangeBodyProps">
|
|
575
581
|
<template #day="scope">
|
|
576
582
|
<slot name="day" v-bind="scope" />
|
|
@@ -610,7 +616,7 @@ const buttonTriggerUi = computed(() => ({
|
|
|
610
616
|
|
|
611
617
|
<PopoverRoot v-else-if="timeOnly" :open="open" :data-selaras-color="fieldColor" @update:open="onUpdateOpen">
|
|
612
618
|
<PopoverAnchor as-child>
|
|
613
|
-
<div v-if="triggerMode === 'field'" :data-selaras-color="fieldColor" :aria-invalid="datePickerInvalid || void 0" :aria-describedby="describedBy" v-bind="fieldProps" :aria-labelledby="field?.labelId">
|
|
619
|
+
<div v-if="triggerMode === 'field'" data-selaras-field-segmented :data-selaras-color="fieldColor" :data-selaras-field-filled="hasValue ? '' : void 0" :data-selaras-field-active="open ? '' : void 0" :aria-invalid="datePickerInvalid || void 0" :aria-describedby="describedBy" v-bind="fieldProps" :aria-labelledby="field?.labelId">
|
|
614
620
|
<TimeFieldRoot
|
|
615
621
|
:id="datePickerId"
|
|
616
622
|
v-slot="{ segments }"
|
|
@@ -660,9 +666,10 @@ const buttonTriggerUi = computed(() => ({
|
|
|
660
666
|
</div>
|
|
661
667
|
</div>
|
|
662
668
|
|
|
663
|
-
<div v-else :class="applyClassPrefix('relative inline-block w-full')">
|
|
669
|
+
<div v-else :class="applyClassPrefix('relative inline-block w-full')" :data-selaras-field-filled="hasValue ? '' : void 0" :data-selaras-field-active="open ? '' : void 0">
|
|
664
670
|
<PopoverTrigger as-child>
|
|
665
671
|
<Button
|
|
672
|
+
:id="datePickerId"
|
|
666
673
|
variant="text"
|
|
667
674
|
:color="color"
|
|
668
675
|
:size="effectiveSize"
|
|
@@ -671,7 +678,7 @@ const buttonTriggerUi = computed(() => ({
|
|
|
671
678
|
:aria-labelledby="field?.labelId"
|
|
672
679
|
:ui="buttonTriggerUi"
|
|
673
680
|
>
|
|
674
|
-
{{ hasValue ? formattedTimeValue : messages.pickTime }}
|
|
681
|
+
{{ hasValue ? formattedTimeValue : field?.floatingLabel.value ? "" : messages.pickTime }}
|
|
675
682
|
<template v-if="!(clearable && hasValue)" #trailing-icon="{ class: iconClass }">
|
|
676
683
|
<slot name="trigger-icon">
|
|
677
684
|
<Icon :name="icons.clock" :class="iconClass" />
|
|
@@ -697,7 +704,7 @@ const buttonTriggerUi = computed(() => ({
|
|
|
697
704
|
</div>
|
|
698
705
|
</PopoverAnchor>
|
|
699
706
|
|
|
700
|
-
<PopoverPortal v-if="!showMobileModal">
|
|
707
|
+
<PopoverPortal v-if="!showMobileModal" v-bind="portalProps">
|
|
701
708
|
<PopoverContent :side-offset="6" align="start" :data-selaras-theme="themeBindings['data-selaras-theme']" :data-selaras-mode="themeBindings['data-selaras-mode']" :style="themeBindings.style" v-bind="contentProps">
|
|
702
709
|
<DatePickerTimeBody v-bind="timeBodyProps">
|
|
703
710
|
<template #footer>
|
|
@@ -753,7 +760,7 @@ const buttonTriggerUi = computed(() => ({
|
|
|
753
760
|
@update:model-value="(value) => updateModelValue(normalizeForGranularity(value))"
|
|
754
761
|
>
|
|
755
762
|
<DatePickerAnchor as-child>
|
|
756
|
-
<div v-if="triggerMode === 'field'" :data-selaras-color="fieldColor" :aria-invalid="datePickerInvalid || void 0" :aria-describedby="describedBy" v-bind="fieldProps" :aria-labelledby="field?.labelId">
|
|
763
|
+
<div v-if="triggerMode === 'field'" data-selaras-field-segmented :data-selaras-color="fieldColor" :data-selaras-field-filled="hasValue ? '' : void 0" :data-selaras-field-active="open ? '' : void 0" :aria-invalid="datePickerInvalid || void 0" :aria-describedby="describedBy" v-bind="fieldProps" :aria-labelledby="field?.labelId">
|
|
757
764
|
<DatePickerField v-slot="{ segments }" :aria-labelledby="field?.labelId" :aria-describedby="describedBy" :aria-invalid="datePickerInvalid || void 0">
|
|
758
765
|
<template v-for="(segment, index) in visibleSegments(segments)" :key="`${segment.part}-${index}`">
|
|
759
766
|
<DatePickerInput as="span" :part="segment.part" v-bind="segmentProps">
|
|
@@ -788,9 +795,10 @@ const buttonTriggerUi = computed(() => ({
|
|
|
788
795
|
</div>
|
|
789
796
|
</div>
|
|
790
797
|
|
|
791
|
-
<div v-else :class="applyClassPrefix('relative inline-block w-full')">
|
|
798
|
+
<div v-else :class="applyClassPrefix('relative inline-block w-full')" :data-selaras-field-filled="hasValue ? '' : void 0" :data-selaras-field-active="open ? '' : void 0">
|
|
792
799
|
<DatePickerTrigger as-child>
|
|
793
800
|
<Button
|
|
801
|
+
:id="datePickerId"
|
|
794
802
|
variant="text"
|
|
795
803
|
:color="color"
|
|
796
804
|
:size="effectiveSize"
|
|
@@ -799,7 +807,7 @@ const buttonTriggerUi = computed(() => ({
|
|
|
799
807
|
:aria-labelledby="field?.labelId"
|
|
800
808
|
:ui="buttonTriggerUi"
|
|
801
809
|
>
|
|
802
|
-
{{ hasValue ? formattedValue : messages.pickDate }}
|
|
810
|
+
{{ hasValue ? formattedValue : field?.floatingLabel.value ? "" : messages.pickDate }}
|
|
803
811
|
<template v-if="!(clearable && hasValue)" #trailing-icon="{ class: iconClass }">
|
|
804
812
|
<slot name="trigger-icon">
|
|
805
813
|
<Icon :name="icons.calendar" :class="iconClass" />
|
|
@@ -832,7 +840,7 @@ const buttonTriggerUi = computed(() => ({
|
|
|
832
840
|
center without clipping, so it silently hides instead. Centering the
|
|
833
841
|
panel on the trigger only when `arrow` is on sidesteps that without
|
|
834
842
|
changing the default (start-aligned) layout everyone already sees. -->
|
|
835
|
-
<DatePickerContent v-if="!showMobileModal" :side-offset="6" :align="arrow ? 'center' : 'start'" :data-selaras-theme="themeBindings['data-selaras-theme']" :data-selaras-mode="themeBindings['data-selaras-mode']" :style="themeBindings.style" v-bind="contentProps">
|
|
843
|
+
<DatePickerContent v-if="!showMobileModal" :side-offset="6" :align="arrow ? 'center' : 'start'" :portal="portalProps" :data-selaras-theme="themeBindings['data-selaras-theme']" :data-selaras-mode="themeBindings['data-selaras-mode']" :style="themeBindings.style" v-bind="contentProps">
|
|
836
844
|
<DatePickerCalendarBody v-bind="calendarBodyProps">
|
|
837
845
|
<template #day="scope">
|
|
838
846
|
<slot name="day" v-bind="scope" />
|
|
@@ -862,5 +870,5 @@ const buttonTriggerUi = computed(() => ({
|
|
|
862
870
|
</template>
|
|
863
871
|
</Modal>
|
|
864
872
|
</DatePickerRoot>
|
|
865
|
-
<input ref="formAnchor" type="hidden" :name="formName" :form="form" :value="nativeFormValue">
|
|
873
|
+
<input ref="formAnchor" type="hidden" :name="formName" :form="form" :value="nativeFormValue" :disabled="disabled">
|
|
866
874
|
</template>
|
|
@@ -2,7 +2,9 @@ import type { DateValue } from '@internationalized/date';
|
|
|
2
2
|
import type { DateRange } from 'reka-ui';
|
|
3
3
|
import type { VariantProps } from 'tailwind-variants';
|
|
4
4
|
import type { DatePickerThemeSlots } from '../theme/date-picker.js';
|
|
5
|
+
import type { RoundedArrowConfig } from '../utils/arrow.js';
|
|
5
6
|
import type { ColorRole } from '../utils/color-registry.js';
|
|
7
|
+
import type { OverlayPortal, OverlayPositioning } from '../utils/overlay.js';
|
|
6
8
|
import type { UiProp } from '../utils/ui.js';
|
|
7
9
|
import { Time } from '@internationalized/date';
|
|
8
10
|
import { datePickerTheme } from '../theme/date-picker.js';
|
|
@@ -73,7 +75,12 @@ export interface DatePickerProps {
|
|
|
73
75
|
activeColor?: ColorRole;
|
|
74
76
|
size?: DatePickerVariants['size'];
|
|
75
77
|
/** Shows a small pointer triangle connecting the panel to its trigger. */
|
|
76
|
-
|
|
78
|
+
/** Shows the pointer; an object configures its size, rounding, and edge clearance. */
|
|
79
|
+
arrow?: boolean | RoundedArrowConfig;
|
|
80
|
+
/** Positioning of the anchored calendar (the adaptive modal uses its own layout). */
|
|
81
|
+
positioning?: OverlayPositioning;
|
|
82
|
+
/** Teleport target for the anchored calendar, or `false` to render it inline. */
|
|
83
|
+
portal?: OverlayPortal;
|
|
77
84
|
/** Opts into the calendar's accessible small-screen modal presentation. It is selected when the calendar opens and held until close. */
|
|
78
85
|
adaptive?: boolean;
|
|
79
86
|
ui?: UiProp<DatePickerThemeSlots>;
|
|
@@ -158,11 +165,11 @@ type __VLS_Slots = {} & {
|
|
|
158
165
|
declare const __VLS_base: import("vue").DefineComponent<DatePickerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
159
166
|
"update:modelValue": (value: DateValue | DateRange | Time | undefined) => any;
|
|
160
167
|
"update:open": (value: boolean) => any;
|
|
161
|
-
"update:view": (view: "
|
|
168
|
+
"update:view": (view: "date" | "month" | "year") => any;
|
|
162
169
|
}, string, import("vue").PublicProps, Readonly<DatePickerProps> & Readonly<{
|
|
163
170
|
"onUpdate:modelValue"?: ((value: DateValue | DateRange | Time | undefined) => any) | undefined;
|
|
164
171
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
165
|
-
"onUpdate:view"?: ((view: "
|
|
172
|
+
"onUpdate:view"?: ((view: "date" | "month" | "year") => any) | undefined;
|
|
166
173
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
167
174
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
168
175
|
declare const _default: typeof __VLS_export;
|
|
@@ -4,9 +4,10 @@ import { computed, getCurrentInstance, ref, useSlots, watch, watchEffect } from
|
|
|
4
4
|
import { useIcons } from "../composables/use-icons";
|
|
5
5
|
import { useMessages } from "../composables/use-messages";
|
|
6
6
|
import { drawerTheme } from "../theme/drawer";
|
|
7
|
-
import { resolveSlot, useComponentTheme, useThemeBindings } from "../utils/ui";
|
|
7
|
+
import { resolveSlot, useComponentTheme, useRootProps, useThemeBindings } from "../utils/ui";
|
|
8
8
|
import Button from "./Button.vue";
|
|
9
9
|
import Icon from "./Icon.vue";
|
|
10
|
+
defineOptions({ inheritAttrs: false });
|
|
10
11
|
const props = defineProps({
|
|
11
12
|
open: { type: Boolean, required: false, default: void 0 },
|
|
12
13
|
defaultOpen: { type: Boolean, required: false },
|
|
@@ -76,8 +77,8 @@ const messages = useMessages();
|
|
|
76
77
|
const theme = useComponentTheme("drawer", drawerTheme);
|
|
77
78
|
const themeBindings = useThemeBindings();
|
|
78
79
|
const ui = computed(() => theme.value({ side: props.side, transition: props.transition }));
|
|
80
|
+
const contentProps = useRootProps(() => ui.value.content, () => props.ui?.content);
|
|
79
81
|
const overlayProps = computed(() => resolveSlot(ui.value.overlay, props.ui?.overlay));
|
|
80
|
-
const contentProps = computed(() => resolveSlot(ui.value.content, props.ui?.content));
|
|
81
82
|
const handleProps = computed(() => resolveSlot(ui.value.handle, props.ui?.handle));
|
|
82
83
|
const headerProps = computed(() => resolveSlot(ui.value.header, props.ui?.header));
|
|
83
84
|
const titleProps = computed(() => resolveSlot(ui.value.title, props.ui?.title));
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { DropdownThemeSlots } from '../theme/dropdown.js';
|
|
2
|
+
import type { RoundedArrowConfig } from '../utils/arrow.js';
|
|
3
|
+
import type { OverlayPortal, OverlayPositioning } from '../utils/overlay.js';
|
|
2
4
|
import type { UiProp } from '../utils/ui.js';
|
|
3
5
|
export interface DropdownItem {
|
|
4
6
|
label: string;
|
|
@@ -7,28 +9,53 @@ export interface DropdownItem {
|
|
|
7
9
|
/** Styles this item for a delete/remove-style action (danger text, danger-tinted hover) - just this one flag rather than the full color palette, since a menu item realistically only ever needs this one special case. */
|
|
8
10
|
destructive?: boolean;
|
|
9
11
|
onSelect?: () => void;
|
|
10
|
-
/**
|
|
12
|
+
/** Displays a keyboard shortcut hint. */
|
|
11
13
|
shortcut?: string;
|
|
14
|
+
/** Bind `shortcut` while this menu is open; activation follows the normal menu item click path. */
|
|
15
|
+
hotkey?: boolean;
|
|
16
|
+
/** Nuxt route or URL to navigate to instead of rendering an action item. */
|
|
17
|
+
to?: string;
|
|
18
|
+
/** Link target, for example `_blank`. */
|
|
19
|
+
target?: string;
|
|
20
|
+
rel?: string;
|
|
12
21
|
}
|
|
13
22
|
export interface DropdownProps {
|
|
14
23
|
items: DropdownItem[][];
|
|
15
24
|
open?: boolean;
|
|
16
25
|
/** Initial visibility for an uncontrolled dropdown. Supplying `open` makes the parent authoritative. */
|
|
17
26
|
defaultOpen?: boolean;
|
|
18
|
-
/** Shows
|
|
19
|
-
arrow?: boolean;
|
|
27
|
+
/** Shows the pointer; an object configures its size, rounding, and edge clearance. */
|
|
28
|
+
arrow?: boolean | RoundedArrowConfig;
|
|
29
|
+
/** Anchored menu placement. */
|
|
30
|
+
positioning?: OverlayPositioning;
|
|
31
|
+
/** Teleport target, or `false` to render inline. Defaults to `body`. */
|
|
32
|
+
portal?: OverlayPortal;
|
|
33
|
+
/** Opens a dialog-style action list on mobile instead of the anchored menu. */
|
|
34
|
+
adaptive?: boolean;
|
|
20
35
|
ui?: UiProp<DropdownThemeSlots>;
|
|
21
36
|
}
|
|
22
37
|
export interface DropdownEmits {
|
|
23
38
|
'update:open': [value: boolean];
|
|
24
39
|
}
|
|
25
|
-
declare var
|
|
40
|
+
declare var __VLS_17: {}, __VLS_55: {
|
|
41
|
+
item: DropdownItem;
|
|
42
|
+
}, __VLS_67: {
|
|
43
|
+
item: DropdownItem;
|
|
44
|
+
}, __VLS_102: {
|
|
45
|
+
item: DropdownItem;
|
|
46
|
+
}, __VLS_114: {
|
|
26
47
|
item: DropdownItem;
|
|
27
48
|
};
|
|
28
49
|
type __VLS_Slots = {} & {
|
|
29
|
-
default?: (props: typeof
|
|
50
|
+
default?: (props: typeof __VLS_17) => any;
|
|
51
|
+
} & {
|
|
52
|
+
item?: (props: typeof __VLS_55) => any;
|
|
53
|
+
} & {
|
|
54
|
+
item?: (props: typeof __VLS_67) => any;
|
|
55
|
+
} & {
|
|
56
|
+
item?: (props: typeof __VLS_102) => any;
|
|
30
57
|
} & {
|
|
31
|
-
item?: (props: typeof
|
|
58
|
+
item?: (props: typeof __VLS_114) => any;
|
|
32
59
|
};
|
|
33
60
|
declare const __VLS_base: import("vue").DefineComponent<DropdownProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
34
61
|
"update:open": (value: boolean) => any;
|