@nuxt/ui 3.0.2 → 3.1.1
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 -2
- package/.nuxt/ui/alert.ts +29 -29
- package/.nuxt/ui/avatar-group.ts +1 -1
- package/.nuxt/ui/avatar.ts +3 -3
- package/.nuxt/ui/badge.ts +33 -33
- package/.nuxt/ui/breadcrumb.ts +5 -5
- package/.nuxt/ui/button.ts +43 -43
- package/.nuxt/ui/calendar.ts +17 -17
- package/.nuxt/ui/card.ts +5 -5
- package/.nuxt/ui/carousel.ts +6 -6
- package/.nuxt/ui/checkbox-group.ts +61 -0
- package/.nuxt/ui/checkbox.ts +140 -27
- package/.nuxt/ui/chip.ts +8 -8
- package/.nuxt/ui/color-picker.ts +3 -3
- package/.nuxt/ui/command-palette.ts +14 -14
- package/.nuxt/ui/context-menu.ts +33 -33
- package/.nuxt/ui/drawer.ts +10 -10
- package/.nuxt/ui/dropdown-menu.ts +34 -34
- package/.nuxt/ui/form-field.ts +6 -6
- package/.nuxt/ui/index.ts +1 -0
- package/.nuxt/ui/input-menu.ts +42 -42
- package/.nuxt/ui/input-number.ts +20 -20
- package/.nuxt/ui/input.ts +23 -23
- package/.nuxt/ui/kbd.ts +4 -4
- package/.nuxt/ui/link.ts +3 -3
- package/.nuxt/ui/modal.ts +5 -5
- package/.nuxt/ui/navigation-menu.ts +78 -80
- package/.nuxt/ui/pin-input.ts +20 -20
- package/.nuxt/ui/popover.ts +2 -2
- package/.nuxt/ui/progress.ts +17 -17
- package/.nuxt/ui/radio-group.ts +250 -35
- package/.nuxt/ui/select-menu.ts +36 -33
- package/.nuxt/ui/select.ts +32 -32
- package/.nuxt/ui/separator.ts +8 -8
- package/.nuxt/ui/skeleton.ts +1 -1
- package/.nuxt/ui/slideover.ts +4 -4
- package/.nuxt/ui/slider.ts +16 -16
- package/.nuxt/ui/stepper.ts +18 -18
- package/.nuxt/ui/switch.ts +20 -20
- package/.nuxt/ui/table.ts +15 -15
- package/.nuxt/ui/tabs.ts +32 -32
- package/.nuxt/ui/textarea.ts +40 -35
- package/.nuxt/ui/toast.ts +24 -24
- package/.nuxt/ui/tooltip.ts +2 -2
- package/.nuxt/ui/tree.ts +18 -18
- package/.nuxt/ui.css +63 -12
- package/README.md +15 -0
- package/cli/templates.mjs +18 -17
- package/dist/module.json +5 -5
- package/dist/module.mjs +12 -7
- package/dist/runtime/components/Accordion.vue +36 -93
- package/dist/runtime/components/Accordion.vue.d.ts +75 -0
- package/dist/runtime/components/Alert.vue +37 -100
- package/dist/runtime/components/Alert.vue.d.ts +81 -0
- package/dist/runtime/components/App.vue +28 -34
- package/dist/runtime/components/App.vue.d.ts +24 -0
- package/dist/runtime/components/Avatar.vue +42 -75
- package/dist/runtime/components/Avatar.vue.d.ts +39 -0
- package/dist/runtime/components/AvatarGroup.vue +40 -77
- package/dist/runtime/components/AvatarGroup.vue.d.ts +31 -0
- package/dist/runtime/components/Badge.vue +33 -62
- package/dist/runtime/components/Badge.vue.d.ts +41 -0
- package/dist/runtime/components/Breadcrumb.vue +37 -90
- package/dist/runtime/components/Breadcrumb.vue.d.ts +64 -0
- package/dist/runtime/components/Button.vue +95 -104
- package/dist/runtime/components/Button.vue.d.ts +48 -0
- package/dist/runtime/components/ButtonGroup.vue +20 -46
- package/dist/runtime/components/ButtonGroup.vue.d.ts +34 -0
- package/dist/runtime/components/Calendar.vue +67 -150
- package/dist/runtime/components/Calendar.vue.d.ts +111 -0
- package/dist/runtime/components/Card.vue +18 -40
- package/dist/runtime/components/Card.vue.d.ts +29 -0
- package/dist/runtime/components/Carousel.vue +112 -234
- package/dist/runtime/components/Carousel.vue.d.ts +122 -0
- package/dist/runtime/components/Checkbox.vue +52 -93
- package/dist/runtime/components/Checkbox.vue.d.ts +73 -0
- package/dist/runtime/components/CheckboxGroup.vue +121 -0
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +78 -0
- package/dist/runtime/components/Chip.vue +26 -69
- package/dist/runtime/components/Chip.vue.d.ts +57 -0
- package/dist/runtime/components/Collapsible.vue +22 -41
- package/dist/runtime/components/Collapsible.vue.d.ts +35 -0
- package/dist/runtime/components/ColorPicker.vue +111 -197
- package/dist/runtime/components/ColorPicker.vue.d.ts +48 -0
- package/dist/runtime/components/CommandPalette.vue +96 -237
- package/dist/runtime/components/CommandPalette.vue.d.ts +161 -0
- package/dist/runtime/components/Container.vue +15 -28
- package/dist/runtime/components/Container.vue.d.ts +18 -0
- package/dist/runtime/components/ContextMenu.vue +34 -133
- package/dist/runtime/components/ContextMenu.vue.d.ts +107 -0
- package/dist/runtime/components/ContextMenuContent.vue +73 -81
- package/dist/runtime/components/ContextMenuContent.vue.d.ts +65 -0
- package/dist/runtime/components/Drawer.vue +49 -83
- package/dist/runtime/components/Drawer.vue.d.ts +78 -0
- package/dist/runtime/components/DropdownMenu.vue +39 -142
- package/dist/runtime/components/DropdownMenu.vue.d.ts +117 -0
- package/dist/runtime/components/DropdownMenuContent.vue +78 -88
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +68 -0
- package/dist/runtime/components/Form.vue +135 -220
- package/dist/runtime/components/Form.vue.d.ts +69 -0
- package/dist/runtime/components/FormField.vue +35 -77
- package/dist/runtime/components/FormField.vue.d.ts +61 -0
- package/dist/runtime/components/Icon.vue +12 -19
- package/dist/runtime/components/Icon.vue.d.ts +8 -0
- package/dist/runtime/components/Input.vue +82 -140
- package/dist/runtime/components/Input.vue.d.ts +76 -0
- package/dist/runtime/components/InputMenu.vue +185 -332
- package/dist/runtime/components/InputMenu.vue.d.ts +324 -0
- package/dist/runtime/components/InputNumber.vue +71 -133
- package/dist/runtime/components/InputNumber.vue.d.ts +182 -0
- package/dist/runtime/components/Kbd.vue +20 -46
- package/dist/runtime/components/Kbd.vue.d.ts +34 -0
- package/dist/runtime/components/Link.vue +98 -176
- package/dist/runtime/components/Link.vue.d.ts +93 -0
- package/dist/runtime/components/LinkBase.vue +33 -42
- package/dist/runtime/components/LinkBase.vue.d.ts +25 -0
- package/dist/runtime/components/Modal.vue +53 -116
- package/dist/runtime/components/Modal.vue.d.ts +93 -0
- package/dist/runtime/components/NavigationMenu.vue +77 -209
- package/dist/runtime/components/NavigationMenu.vue.d.ts +139 -0
- package/dist/runtime/components/OverlayProvider.vue +14 -18
- package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -0
- package/dist/runtime/components/Pagination.vue +46 -140
- package/dist/runtime/components/Pagination.vue.d.ts +119 -0
- package/dist/runtime/components/PinInput.vue +61 -78
- package/dist/runtime/components/PinInput.vue.d.ts +57 -0
- package/dist/runtime/components/Popover.vue +47 -84
- package/dist/runtime/components/Popover.vue.d.ts +63 -0
- package/dist/runtime/components/Progress.vue +70 -131
- package/dist/runtime/components/Progress.vue.d.ts +66 -0
- package/dist/runtime/components/RadioGroup.vue +70 -132
- package/dist/runtime/components/RadioGroup.vue.d.ts +91 -0
- package/dist/runtime/components/Select.vue +110 -224
- package/dist/runtime/components/Select.vue.d.ts +145 -0
- package/dist/runtime/components/SelectMenu.vue +161 -310
- package/dist/runtime/components/SelectMenu.vue.d.ts +196 -0
- package/dist/runtime/components/Separator.vue +29 -71
- package/dist/runtime/components/Separator.vue.d.ts +54 -0
- package/dist/runtime/components/Skeleton.vue +21 -23
- package/dist/runtime/components/Skeleton.vue.d.ts +17 -0
- package/dist/runtime/components/Slideover.vue +53 -120
- package/dist/runtime/components/Slideover.vue.d.ts +94 -0
- package/dist/runtime/components/Slider.vue +46 -84
- package/dist/runtime/components/Slider.vue.d.ts +52 -0
- package/dist/runtime/components/Stepper.vue +45 -115
- package/dist/runtime/components/Stepper.vue.d.ts +83 -0
- package/dist/runtime/components/Switch.vue +45 -93
- package/dist/runtime/components/Switch.vue.d.ts +70 -0
- package/dist/runtime/components/Table.vue +163 -267
- package/dist/runtime/components/Table.vue.d.ts +183 -0
- package/dist/runtime/components/Tabs.vue +41 -107
- package/dist/runtime/components/Tabs.vue.d.ts +88 -0
- package/dist/runtime/components/Textarea.vue +113 -158
- package/dist/runtime/components/Textarea.vue.d.ts +78 -0
- package/dist/runtime/components/Toast.vue +49 -110
- package/dist/runtime/components/Toast.vue.d.ts +157 -0
- package/dist/runtime/components/Toaster.vue +70 -107
- package/dist/runtime/components/Toaster.vue.d.ts +38 -0
- package/dist/runtime/components/Tooltip.vue +38 -65
- package/dist/runtime/components/Tooltip.vue.d.ts +50 -0
- package/dist/runtime/components/Tree.vue +59 -166
- package/dist/runtime/components/Tree.vue.d.ts +111 -0
- package/dist/runtime/composables/defineShortcuts.d.ts +1 -1
- package/dist/runtime/composables/defineShortcuts.js +6 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
- package/dist/runtime/composables/useFormField.d.ts +2 -2
- package/dist/runtime/composables/useKbd.d.ts +1 -0
- package/dist/runtime/composables/useKbd.js +4 -3
- package/dist/runtime/composables/useOverlay.d.ts +14 -8
- package/dist/runtime/composables/useOverlay.js +20 -7
- package/dist/runtime/composables/usePortal.d.ts +6 -0
- package/dist/runtime/composables/usePortal.js +17 -0
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/inertia/components/Link.vue +146 -0
- package/dist/runtime/inertia/components/Link.vue.d.ts +63 -0
- package/dist/runtime/inertia/stubs.d.ts +43 -0
- package/dist/runtime/inertia/stubs.js +82 -0
- package/dist/runtime/locale/bg.d.ts +3 -0
- package/dist/runtime/locale/bg.js +54 -0
- package/dist/runtime/locale/index.d.ts +5 -1
- package/dist/runtime/locale/index.js +5 -1
- package/dist/runtime/locale/kk.d.ts +3 -0
- package/dist/runtime/locale/kk.js +54 -0
- package/dist/runtime/locale/tj.d.ts +3 -0
- package/dist/runtime/locale/tj.js +54 -0
- package/dist/runtime/locale/ug_cn.d.ts +3 -0
- package/dist/runtime/locale/ug_cn.js +55 -0
- package/dist/runtime/types/form.d.ts +4 -1
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -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 +7 -17
- package/dist/runtime/types/utils.js +1 -0
- package/dist/runtime/utils/link.d.ts +3 -3
- package/dist/runtime/utils/link.js +1 -0
- package/dist/runtime/utils/tv.js +2 -2
- package/dist/runtime/vue/components/Icon.vue +7 -8
- package/dist/runtime/vue/components/Icon.vue.d.ts +5 -0
- package/dist/runtime/vue/components/Link.vue +118 -202
- package/dist/runtime/vue/components/Link.vue.d.ts +93 -0
- package/dist/runtime/vue/stubs.d.ts +2 -2
- package/dist/shared/{ui.BkNUP964.mjs → ui.CbtTMMzt.mjs} +631 -366
- package/dist/types.d.mts +3 -5
- package/dist/unplugin.d.mts +6 -2
- package/dist/unplugin.mjs +25 -4
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +2 -2
- package/package.json +96 -54
- package/dist/module.cjs +0 -62
- package/dist/module.d.cts +0 -45
- package/dist/module.d.ts +0 -45
- package/dist/shared/ui.BL-XB3u1.cjs +0 -3555
- package/dist/types.d.ts +0 -7
- package/dist/unplugin.cjs +0 -232
- package/dist/unplugin.d.cts +0 -62
- package/dist/unplugin.d.ts +0 -62
- package/dist/vite.cjs +0 -23
- package/dist/vite.d.cts +0 -15
- package/dist/vite.d.ts +0 -15
|
@@ -1,171 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type { VariantProps } from 'tailwind-variants'
|
|
4
|
-
import type { NavigationMenuRootProps, NavigationMenuRootEmits, NavigationMenuContentProps, NavigationMenuContentEmits, CollapsibleRootProps } from 'reka-ui'
|
|
5
|
-
import type { AppConfig } from '@nuxt/schema'
|
|
6
|
-
import _appConfig from '#build/app.config'
|
|
7
|
-
import theme from '#build/ui/navigation-menu'
|
|
8
|
-
import { tv } from '../utils/tv'
|
|
9
|
-
import type { AvatarProps, BadgeProps, LinkProps } from '../types'
|
|
10
|
-
import type {
|
|
11
|
-
ArrayOrNested,
|
|
12
|
-
DynamicSlots,
|
|
13
|
-
MergeTypes,
|
|
14
|
-
NestedItem,
|
|
15
|
-
PartialString,
|
|
16
|
-
EmitsToProps
|
|
17
|
-
} from '../types/utils'
|
|
18
|
-
|
|
19
|
-
const appConfigNavigationMenu = _appConfig as AppConfig & { ui: { navigationMenu: Partial<typeof theme> } }
|
|
20
|
-
|
|
21
|
-
const navigationMenu = tv({ extend: tv(theme), ...(appConfigNavigationMenu.ui?.navigationMenu || {}) })
|
|
22
|
-
|
|
23
|
-
export interface NavigationMenuChildItem extends Omit<NavigationMenuItem, 'type'> {
|
|
24
|
-
/** Description is only used when `orientation` is `horizontal`. */
|
|
25
|
-
description?: string
|
|
26
|
-
[key: string]: any
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface NavigationMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custom'>, Pick<CollapsibleRootProps, 'defaultOpen' | 'open'> {
|
|
30
|
-
label?: string
|
|
31
|
-
/**
|
|
32
|
-
* @IconifyIcon
|
|
33
|
-
*/
|
|
34
|
-
icon?: string
|
|
35
|
-
avatar?: AvatarProps
|
|
36
|
-
/**
|
|
37
|
-
* Display a badge on the item.
|
|
38
|
-
* `{ size: 'sm', color: 'neutral', variant: 'outline' }`{lang="ts-type"}
|
|
39
|
-
*/
|
|
40
|
-
badge?: string | number | BadgeProps
|
|
41
|
-
/**
|
|
42
|
-
* @IconifyIcon
|
|
43
|
-
*/
|
|
44
|
-
trailingIcon?: string
|
|
45
|
-
/**
|
|
46
|
-
* The type of the item.
|
|
47
|
-
* The `label` type only works on `vertical` orientation.
|
|
48
|
-
* @defaultValue 'link'
|
|
49
|
-
*/
|
|
50
|
-
type?: 'label' | 'link'
|
|
51
|
-
slot?: string
|
|
52
|
-
value?: string
|
|
53
|
-
children?: NavigationMenuChildItem[]
|
|
54
|
-
onSelect?(e: Event): void
|
|
55
|
-
[key: string]: any
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
type NavigationMenuVariants = VariantProps<typeof navigationMenu>
|
|
59
|
-
|
|
60
|
-
export interface NavigationMenuProps<T extends ArrayOrNested<NavigationMenuItem> = ArrayOrNested<NavigationMenuItem>> extends Pick<NavigationMenuRootProps, 'modelValue' | 'defaultValue' | 'delayDuration' | 'disableClickTrigger' | 'disableHoverTrigger' | 'skipDelayDuration' | 'disablePointerLeaveClose' | 'unmountOnHide'> {
|
|
61
|
-
/**
|
|
62
|
-
* The element or component this component should render as.
|
|
63
|
-
* @defaultValue 'div'
|
|
64
|
-
*/
|
|
65
|
-
as?: any
|
|
66
|
-
/**
|
|
67
|
-
* The icon displayed to open the menu.
|
|
68
|
-
* @defaultValue appConfig.ui.icons.chevronDown
|
|
69
|
-
* @IconifyIcon
|
|
70
|
-
*/
|
|
71
|
-
trailingIcon?: string
|
|
72
|
-
/**
|
|
73
|
-
* The icon displayed when the item is an external link.
|
|
74
|
-
* Set to `false` to hide the external icon.
|
|
75
|
-
* @defaultValue appConfig.ui.icons.external
|
|
76
|
-
* @IconifyIcon
|
|
77
|
-
*/
|
|
78
|
-
externalIcon?: boolean | string
|
|
79
|
-
items?: T
|
|
80
|
-
/**
|
|
81
|
-
* @defaultValue 'primary'
|
|
82
|
-
*/
|
|
83
|
-
color?: NavigationMenuVariants['color']
|
|
84
|
-
/**
|
|
85
|
-
* @defaultValue 'pill'
|
|
86
|
-
*/
|
|
87
|
-
variant?: NavigationMenuVariants['variant']
|
|
88
|
-
/**
|
|
89
|
-
* The orientation of the menu.
|
|
90
|
-
* @defaultValue 'horizontal'
|
|
91
|
-
*/
|
|
92
|
-
orientation?: NavigationMenuRootProps['orientation']
|
|
93
|
-
/**
|
|
94
|
-
* Collapse the navigation menu to only show icons.
|
|
95
|
-
* Only works when `orientation` is `vertical`.
|
|
96
|
-
* @defaultValue false
|
|
97
|
-
*/
|
|
98
|
-
collapsed?: boolean
|
|
99
|
-
/** Display a line next to the active item. */
|
|
100
|
-
highlight?: boolean
|
|
101
|
-
/**
|
|
102
|
-
* @defaultValue 'primary'
|
|
103
|
-
*/
|
|
104
|
-
highlightColor?: NavigationMenuVariants['highlightColor']
|
|
105
|
-
/** The content of the menu. */
|
|
106
|
-
content?: Omit<NavigationMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<NavigationMenuContentEmits>>
|
|
107
|
-
/**
|
|
108
|
-
* The orientation of the content.
|
|
109
|
-
* Only works when `orientation` is `horizontal`.
|
|
110
|
-
* @defaultValue 'horizontal'
|
|
111
|
-
*/
|
|
112
|
-
contentOrientation?: NavigationMenuVariants['contentOrientation']
|
|
113
|
-
/**
|
|
114
|
-
* Display an arrow alongside the menu.
|
|
115
|
-
* @defaultValue false
|
|
116
|
-
*/
|
|
117
|
-
arrow?: boolean
|
|
118
|
-
/**
|
|
119
|
-
* The key used to get the label from the item.
|
|
120
|
-
* @defaultValue 'label'
|
|
121
|
-
*/
|
|
122
|
-
labelKey?: keyof NestedItem<T>
|
|
123
|
-
class?: any
|
|
124
|
-
ui?: PartialString<typeof navigationMenu.slots>
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export interface NavigationMenuEmits extends NavigationMenuRootEmits {}
|
|
128
|
-
|
|
129
|
-
type SlotProps<T extends NavigationMenuItem> = (props: { item: T, index: number, active?: boolean }) => any
|
|
130
|
-
|
|
131
|
-
export type NavigationMenuSlots<
|
|
132
|
-
A extends ArrayOrNested<NavigationMenuItem> = ArrayOrNested<NavigationMenuItem>,
|
|
133
|
-
T extends NestedItem<A> = NestedItem<A>
|
|
134
|
-
> = {
|
|
135
|
-
'item': SlotProps<T>
|
|
136
|
-
'item-leading': SlotProps<T>
|
|
137
|
-
'item-label': SlotProps<T>
|
|
138
|
-
'item-trailing': SlotProps<T>
|
|
139
|
-
'item-content': SlotProps<T>
|
|
140
|
-
} & DynamicSlots<MergeTypes<T>, 'leading' | 'label' | 'trailing' | 'content', { index: number, active?: boolean }>
|
|
141
|
-
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/ui/navigation-menu";
|
|
142
3
|
</script>
|
|
143
4
|
|
|
144
|
-
<script setup
|
|
145
|
-
import { computed, toRef } from
|
|
146
|
-
import { NavigationMenuRoot, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, useForwardPropsEmits } from
|
|
147
|
-
import { createReusableTemplate } from
|
|
148
|
-
import { useAppConfig } from
|
|
149
|
-
import { get, isArrayOfArray } from
|
|
150
|
-
import {
|
|
151
|
-
import
|
|
152
|
-
import
|
|
153
|
-
import
|
|
154
|
-
import
|
|
155
|
-
import
|
|
156
|
-
import
|
|
157
|
-
|
|
158
|
-
const props =
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
externalIcon: true,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed, toRef } from "vue";
|
|
7
|
+
import { NavigationMenuRoot, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, useForwardPropsEmits } from "reka-ui";
|
|
8
|
+
import { createReusableTemplate } from "@vueuse/core";
|
|
9
|
+
import { useAppConfig } from "#imports";
|
|
10
|
+
import { get, isArrayOfArray } from "../utils";
|
|
11
|
+
import { tv } from "../utils/tv";
|
|
12
|
+
import { pickLinkProps } from "../utils/link";
|
|
13
|
+
import ULinkBase from "./LinkBase.vue";
|
|
14
|
+
import ULink from "./Link.vue";
|
|
15
|
+
import UAvatar from "./Avatar.vue";
|
|
16
|
+
import UIcon from "./Icon.vue";
|
|
17
|
+
import UBadge from "./Badge.vue";
|
|
18
|
+
import UCollapsible from "./Collapsible.vue";
|
|
19
|
+
const props = defineProps({
|
|
20
|
+
as: { type: null, required: false },
|
|
21
|
+
trailingIcon: { type: String, required: false },
|
|
22
|
+
externalIcon: { type: [Boolean, String], required: false, default: true },
|
|
23
|
+
items: { type: null, required: false },
|
|
24
|
+
color: { type: null, required: false },
|
|
25
|
+
variant: { type: null, required: false },
|
|
26
|
+
orientation: { type: null, required: false, default: "horizontal" },
|
|
27
|
+
collapsed: { type: Boolean, required: false },
|
|
28
|
+
highlight: { type: Boolean, required: false },
|
|
29
|
+
highlightColor: { type: null, required: false },
|
|
30
|
+
content: { type: Object, required: false },
|
|
31
|
+
contentOrientation: { type: null, required: false, default: "horizontal" },
|
|
32
|
+
arrow: { type: Boolean, required: false },
|
|
33
|
+
labelKey: { type: null, required: false, default: "label" },
|
|
34
|
+
class: { type: null, required: false },
|
|
35
|
+
ui: { type: null, required: false },
|
|
36
|
+
modelValue: { type: String, required: false },
|
|
37
|
+
defaultValue: { type: String, required: false },
|
|
38
|
+
delayDuration: { type: Number, required: false, default: 0 },
|
|
39
|
+
disableClickTrigger: { type: Boolean, required: false },
|
|
40
|
+
disableHoverTrigger: { type: Boolean, required: false },
|
|
41
|
+
skipDelayDuration: { type: Number, required: false },
|
|
42
|
+
disablePointerLeaveClose: { type: Boolean, required: false },
|
|
43
|
+
unmountOnHide: { type: Boolean, required: false, default: true }
|
|
44
|
+
});
|
|
45
|
+
const emits = defineEmits(["update:modelValue"]);
|
|
46
|
+
const slots = defineSlots();
|
|
47
|
+
const appConfig = useAppConfig();
|
|
169
48
|
const rootProps = useForwardPropsEmits(computed(() => ({
|
|
170
49
|
as: props.as,
|
|
171
50
|
modelValue: props.modelValue,
|
|
@@ -177,27 +56,17 @@ const rootProps = useForwardPropsEmits(computed(() => ({
|
|
|
177
56
|
disableHoverTrigger: props.disableHoverTrigger,
|
|
178
57
|
disablePointerLeaveClose: props.disablePointerLeaveClose,
|
|
179
58
|
unmountOnHide: props.unmountOnHide
|
|
180
|
-
})), emits)
|
|
181
|
-
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
const appConfig = useAppConfig()
|
|
185
|
-
const [DefineLinkTemplate, ReuseLinkTemplate] = createReusableTemplate<
|
|
186
|
-
{ item: NavigationMenuItem, index: number, active?: boolean },
|
|
187
|
-
NavigationMenuSlots<T>
|
|
188
|
-
>()
|
|
189
|
-
const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate<
|
|
190
|
-
{ item: NavigationMenuItem, index: number, level?: number },
|
|
191
|
-
NavigationMenuSlots<T>
|
|
192
|
-
>({
|
|
59
|
+
})), emits);
|
|
60
|
+
const contentProps = toRef(() => props.content);
|
|
61
|
+
const [DefineLinkTemplate, ReuseLinkTemplate] = createReusableTemplate();
|
|
62
|
+
const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate({
|
|
193
63
|
props: {
|
|
194
64
|
item: Object,
|
|
195
65
|
index: Number,
|
|
196
66
|
level: Number
|
|
197
67
|
}
|
|
198
|
-
})
|
|
199
|
-
|
|
200
|
-
const ui = computed(() => navigationMenu({
|
|
68
|
+
});
|
|
69
|
+
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.navigationMenu || {} })({
|
|
201
70
|
orientation: props.orientation,
|
|
202
71
|
contentOrientation: props.contentOrientation,
|
|
203
72
|
collapsed: props.collapsed,
|
|
@@ -205,48 +74,43 @@ const ui = computed(() => navigationMenu({
|
|
|
205
74
|
variant: props.variant,
|
|
206
75
|
highlight: props.highlight,
|
|
207
76
|
highlightColor: props.highlightColor || props.color
|
|
208
|
-
}))
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
? isArrayOfArray(props.items)
|
|
213
|
-
? props.items
|
|
214
|
-
: [props.items]
|
|
215
|
-
: []
|
|
216
|
-
)
|
|
77
|
+
}));
|
|
78
|
+
const lists = computed(
|
|
79
|
+
() => props.items?.length ? isArrayOfArray(props.items) ? props.items : [props.items] : []
|
|
80
|
+
);
|
|
217
81
|
</script>
|
|
218
82
|
|
|
219
83
|
<template>
|
|
220
84
|
<DefineLinkTemplate v-slot="{ item, active, index }">
|
|
221
|
-
<slot :name="
|
|
222
|
-
<slot :name="
|
|
223
|
-
<UAvatar v-if="item.avatar" :size="
|
|
85
|
+
<slot :name="item.slot || 'item'" :item="item" :index="index">
|
|
86
|
+
<slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="item" :active="active" :index="index">
|
|
87
|
+
<UAvatar v-if="item.avatar" :size="props.ui?.linkLeadingAvatarSize || ui.linkLeadingAvatarSize()" v-bind="item.avatar" :class="ui.linkLeadingAvatar({ class: props.ui?.linkLeadingAvatar, active, disabled: !!item.disabled })" />
|
|
224
88
|
<UIcon v-else-if="item.icon" :name="item.icon" :class="ui.linkLeadingIcon({ class: props.ui?.linkLeadingIcon, active, disabled: !!item.disabled })" />
|
|
225
89
|
</slot>
|
|
226
90
|
|
|
227
91
|
<span
|
|
228
|
-
v-if="(!collapsed || orientation !== 'vertical') && (get(item, props.labelKey
|
|
92
|
+
v-if="(!collapsed || orientation !== 'vertical') && (get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label'])"
|
|
229
93
|
:class="ui.linkLabel({ class: props.ui?.linkLabel })"
|
|
230
94
|
>
|
|
231
|
-
<slot :name="
|
|
232
|
-
{{ get(item, props.labelKey
|
|
95
|
+
<slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="active" :index="index">
|
|
96
|
+
{{ get(item, props.labelKey) }}
|
|
233
97
|
</slot>
|
|
234
98
|
|
|
235
99
|
<UIcon v-if="item.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" :class="ui.linkLabelExternalIcon({ class: props.ui?.linkLabelExternalIcon, active })" />
|
|
236
100
|
</span>
|
|
237
101
|
|
|
238
|
-
<span v-if="(!collapsed || orientation !== 'vertical') && (item.badge ||
|
|
239
|
-
<slot :name="
|
|
102
|
+
<span v-if="(!collapsed || orientation !== 'vertical') && (item.badge || orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) || orientation === 'vertical' && item.children?.length || item.trailingIcon || !!slots[item.slot ? `${item.slot}-trailing` : 'item-trailing'])" :class="ui.linkTrailing({ class: props.ui?.linkTrailing })">
|
|
103
|
+
<slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="active" :index="index">
|
|
240
104
|
<UBadge
|
|
241
105
|
v-if="item.badge"
|
|
242
106
|
color="neutral"
|
|
243
107
|
variant="outline"
|
|
244
|
-
:size="
|
|
245
|
-
v-bind="
|
|
108
|
+
:size="props.ui?.linkTrailingBadgeSize || ui.linkTrailingBadgeSize()"
|
|
109
|
+
v-bind="typeof item.badge === 'string' || typeof item.badge === 'number' ? { label: item.badge } : item.badge"
|
|
246
110
|
:class="ui.linkTrailingBadge({ class: props.ui?.linkTrailingBadge })"
|
|
247
111
|
/>
|
|
248
112
|
|
|
249
|
-
<UIcon v-if="
|
|
113
|
+
<UIcon v-if="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) || orientation === 'vertical' && item.children?.length" :name="item.trailingIcon || trailingIcon || appConfig.ui.icons.chevronDown" :class="ui.linkTrailingIcon({ class: props.ui?.linkTrailingIcon, active })" />
|
|
250
114
|
<UIcon v-else-if="item.trailingIcon" :name="item.trailingIcon" :class="ui.linkTrailingIcon({ class: props.ui?.linkTrailingIcon, active })" />
|
|
251
115
|
</slot>
|
|
252
116
|
</span>
|
|
@@ -255,19 +119,19 @@ const lists = computed<NavigationMenuItem[][]>(() =>
|
|
|
255
119
|
|
|
256
120
|
<DefineItemTemplate v-slot="{ item, index, level = 0 }">
|
|
257
121
|
<component
|
|
258
|
-
:is="
|
|
122
|
+
:is="orientation === 'vertical' && item.children?.length && !collapsed ? UCollapsible : NavigationMenuItem"
|
|
259
123
|
as="li"
|
|
260
124
|
:value="item.value || String(index)"
|
|
261
125
|
:default-open="item.defaultOpen"
|
|
262
|
-
:unmount-on-hide="
|
|
126
|
+
:unmount-on-hide="orientation === 'vertical' && item.children?.length && !collapsed ? unmountOnHide : void 0"
|
|
263
127
|
:open="item.open"
|
|
264
128
|
>
|
|
265
129
|
<div v-if="orientation === 'vertical' && item.type === 'label'" :class="ui.label({ class: props.ui?.label })">
|
|
266
130
|
<ReuseLinkTemplate :item="item" :index="index" />
|
|
267
131
|
</div>
|
|
268
|
-
<ULink v-else-if="item.type !== 'label'" v-slot="{ active, ...slotProps }" v-bind="
|
|
132
|
+
<ULink v-else-if="item.type !== 'label'" v-slot="{ active, ...slotProps }" v-bind="orientation === 'vertical' && item.children?.length && !collapsed ? {} : pickLinkProps(item)" custom>
|
|
269
133
|
<component
|
|
270
|
-
:is="
|
|
134
|
+
:is="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) ? NavigationMenuTrigger : NavigationMenuLink"
|
|
271
135
|
as-child
|
|
272
136
|
:active="active || item.active"
|
|
273
137
|
:disabled="item.disabled"
|
|
@@ -278,8 +142,8 @@ const lists = computed<NavigationMenuItem[][]>(() =>
|
|
|
278
142
|
</ULinkBase>
|
|
279
143
|
</component>
|
|
280
144
|
|
|
281
|
-
<NavigationMenuContent v-if="orientation === 'horizontal' && (item.children?.length || !!slots[
|
|
282
|
-
<slot :name="
|
|
145
|
+
<NavigationMenuContent v-if="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content'])" v-bind="contentProps" :class="ui.content({ class: props.ui?.content })">
|
|
146
|
+
<slot :name="item.slot ? `${item.slot}-content` : 'item-content'" :item="item" :active="active" :index="index">
|
|
283
147
|
<ul :class="ui.childList({ class: props.ui?.childList })">
|
|
284
148
|
<li v-for="(childItem, childIndex) in item.children" :key="childIndex" :class="ui.childItem({ class: props.ui?.childItem })">
|
|
285
149
|
<ULink v-slot="{ active: childActive, ...childSlotProps }" v-bind="pickLinkProps(childItem)" custom>
|
|
@@ -289,7 +153,7 @@ const lists = computed<NavigationMenuItem[][]>(() =>
|
|
|
289
153
|
|
|
290
154
|
<div :class="ui.childLinkWrapper({ class: props.ui?.childLinkWrapper })">
|
|
291
155
|
<p :class="ui.childLinkLabel({ class: props.ui?.childLinkLabel, active: childActive })">
|
|
292
|
-
{{ get(childItem, props.labelKey
|
|
156
|
+
{{ get(childItem, props.labelKey) }}
|
|
293
157
|
|
|
294
158
|
<UIcon v-if="childItem.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" :class="ui.childLinkLabelExternalIcon({ class: props.ui?.childLinkLabelExternalIcon, active: childActive })" />
|
|
295
159
|
</p>
|
|
@@ -322,6 +186,8 @@ const lists = computed<NavigationMenuItem[][]>(() =>
|
|
|
322
186
|
</DefineItemTemplate>
|
|
323
187
|
|
|
324
188
|
<NavigationMenuRoot v-bind="rootProps" :data-collapsed="collapsed" :class="ui.root({ class: [props.class, props.ui?.root] })">
|
|
189
|
+
<slot name="list-leading" />
|
|
190
|
+
|
|
325
191
|
<template v-for="(list, listIndex) in lists" :key="`list-${listIndex}`">
|
|
326
192
|
<NavigationMenuList :class="ui.list({ class: props.ui?.list })">
|
|
327
193
|
<ReuseItemTemplate v-for="(item, index) in list" :key="`list-${listIndex}-${index}`" :item="item" :index="index" :class="ui.item({ class: props.ui?.item })" />
|
|
@@ -330,6 +196,8 @@ const lists = computed<NavigationMenuItem[][]>(() =>
|
|
|
330
196
|
<div v-if="orientation === 'vertical' && listIndex < lists.length - 1" :class="ui.separator({ class: props.ui?.separator })" />
|
|
331
197
|
</template>
|
|
332
198
|
|
|
199
|
+
<slot name="list-trailing" />
|
|
200
|
+
|
|
333
201
|
<div v-if="orientation === 'horizontal'" :class="ui.viewportWrapper({ class: props.ui?.viewportWrapper })">
|
|
334
202
|
<NavigationMenuIndicator v-if="arrow" :class="ui.indicator({ class: props.ui?.indicator })">
|
|
335
203
|
<div :class="ui.arrow({ class: props.ui?.arrow })" />
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { NavigationMenuRootProps, NavigationMenuRootEmits, NavigationMenuContentProps, NavigationMenuContentEmits, CollapsibleRootProps } from 'reka-ui';
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
3
|
+
import theme from '#build/ui/navigation-menu';
|
|
4
|
+
import type { AvatarProps, BadgeProps, LinkProps } from '../types';
|
|
5
|
+
import type { ArrayOrNested, DynamicSlots, MergeTypes, NestedItem, EmitsToProps, ComponentConfig } from '../types/utils';
|
|
6
|
+
type NavigationMenu = ComponentConfig<typeof theme, AppConfig, 'navigationMenu'>;
|
|
7
|
+
export interface NavigationMenuChildItem extends Omit<NavigationMenuItem, 'type'> {
|
|
8
|
+
/** Description is only used when `orientation` is `horizontal`. */
|
|
9
|
+
description?: string;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
export interface NavigationMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custom'>, Pick<CollapsibleRootProps, 'defaultOpen' | 'open'> {
|
|
13
|
+
label?: string;
|
|
14
|
+
/**
|
|
15
|
+
* @IconifyIcon
|
|
16
|
+
*/
|
|
17
|
+
icon?: string;
|
|
18
|
+
avatar?: AvatarProps;
|
|
19
|
+
/**
|
|
20
|
+
* Display a badge on the item.
|
|
21
|
+
* `{ size: 'sm', color: 'neutral', variant: 'outline' }`{lang="ts-type"}
|
|
22
|
+
*/
|
|
23
|
+
badge?: string | number | BadgeProps;
|
|
24
|
+
/**
|
|
25
|
+
* @IconifyIcon
|
|
26
|
+
*/
|
|
27
|
+
trailingIcon?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The type of the item.
|
|
30
|
+
* The `label` type only works on `vertical` orientation.
|
|
31
|
+
* @defaultValue 'link'
|
|
32
|
+
*/
|
|
33
|
+
type?: 'label' | 'link';
|
|
34
|
+
slot?: string;
|
|
35
|
+
value?: string;
|
|
36
|
+
children?: NavigationMenuChildItem[];
|
|
37
|
+
onSelect?(e: Event): void;
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
}
|
|
40
|
+
export interface NavigationMenuProps<T extends ArrayOrNested<NavigationMenuItem> = ArrayOrNested<NavigationMenuItem>> extends Pick<NavigationMenuRootProps, 'modelValue' | 'defaultValue' | 'delayDuration' | 'disableClickTrigger' | 'disableHoverTrigger' | 'skipDelayDuration' | 'disablePointerLeaveClose' | 'unmountOnHide'> {
|
|
41
|
+
/**
|
|
42
|
+
* The element or component this component should render as.
|
|
43
|
+
* @defaultValue 'div'
|
|
44
|
+
*/
|
|
45
|
+
as?: any;
|
|
46
|
+
/**
|
|
47
|
+
* The icon displayed to open the menu.
|
|
48
|
+
* @defaultValue appConfig.ui.icons.chevronDown
|
|
49
|
+
* @IconifyIcon
|
|
50
|
+
*/
|
|
51
|
+
trailingIcon?: string;
|
|
52
|
+
/**
|
|
53
|
+
* The icon displayed when the item is an external link.
|
|
54
|
+
* Set to `false` to hide the external icon.
|
|
55
|
+
* @defaultValue appConfig.ui.icons.external
|
|
56
|
+
* @IconifyIcon
|
|
57
|
+
*/
|
|
58
|
+
externalIcon?: boolean | string;
|
|
59
|
+
items?: T;
|
|
60
|
+
/**
|
|
61
|
+
* @defaultValue 'primary'
|
|
62
|
+
*/
|
|
63
|
+
color?: NavigationMenu['variants']['color'];
|
|
64
|
+
/**
|
|
65
|
+
* @defaultValue 'pill'
|
|
66
|
+
*/
|
|
67
|
+
variant?: NavigationMenu['variants']['variant'];
|
|
68
|
+
/**
|
|
69
|
+
* The orientation of the menu.
|
|
70
|
+
* @defaultValue 'horizontal'
|
|
71
|
+
*/
|
|
72
|
+
orientation?: NavigationMenuRootProps['orientation'];
|
|
73
|
+
/**
|
|
74
|
+
* Collapse the navigation menu to only show icons.
|
|
75
|
+
* Only works when `orientation` is `vertical`.
|
|
76
|
+
* @defaultValue false
|
|
77
|
+
*/
|
|
78
|
+
collapsed?: boolean;
|
|
79
|
+
/** Display a line next to the active item. */
|
|
80
|
+
highlight?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* @defaultValue 'primary'
|
|
83
|
+
*/
|
|
84
|
+
highlightColor?: NavigationMenu['variants']['highlightColor'];
|
|
85
|
+
/** The content of the menu. */
|
|
86
|
+
content?: Omit<NavigationMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<NavigationMenuContentEmits>>;
|
|
87
|
+
/**
|
|
88
|
+
* The orientation of the content.
|
|
89
|
+
* Only works when `orientation` is `horizontal`.
|
|
90
|
+
* @defaultValue 'horizontal'
|
|
91
|
+
*/
|
|
92
|
+
contentOrientation?: NavigationMenu['variants']['contentOrientation'];
|
|
93
|
+
/**
|
|
94
|
+
* Display an arrow alongside the menu.
|
|
95
|
+
* @defaultValue false
|
|
96
|
+
*/
|
|
97
|
+
arrow?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* The key used to get the label from the item.
|
|
100
|
+
* @defaultValue 'label'
|
|
101
|
+
*/
|
|
102
|
+
labelKey?: keyof NestedItem<T>;
|
|
103
|
+
class?: any;
|
|
104
|
+
ui?: NavigationMenu['slots'];
|
|
105
|
+
}
|
|
106
|
+
export interface NavigationMenuEmits extends NavigationMenuRootEmits {
|
|
107
|
+
}
|
|
108
|
+
type SlotProps<T extends NavigationMenuItem> = (props: {
|
|
109
|
+
item: T;
|
|
110
|
+
index: number;
|
|
111
|
+
active?: boolean;
|
|
112
|
+
}) => any;
|
|
113
|
+
export type NavigationMenuSlots<A extends ArrayOrNested<NavigationMenuItem> = ArrayOrNested<NavigationMenuItem>, T extends NestedItem<A> = NestedItem<A>> = {
|
|
114
|
+
'item': SlotProps<T>;
|
|
115
|
+
'item-leading': SlotProps<T>;
|
|
116
|
+
'item-label': SlotProps<T>;
|
|
117
|
+
'item-trailing': SlotProps<T>;
|
|
118
|
+
'item-content': SlotProps<T>;
|
|
119
|
+
'list-leading': (props?: {}) => any;
|
|
120
|
+
'list-trailing': (props?: {}) => any;
|
|
121
|
+
} & DynamicSlots<MergeTypes<T>, 'leading' | 'label' | 'trailing' | 'content', {
|
|
122
|
+
index: number;
|
|
123
|
+
active?: boolean;
|
|
124
|
+
}>;
|
|
125
|
+
declare const _default: <T extends ArrayOrNested<NavigationMenuItem>>(__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<{
|
|
126
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
127
|
+
readonly "onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
128
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue"> & NavigationMenuProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
129
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
130
|
+
attrs: any;
|
|
131
|
+
slots: NavigationMenuSlots<T, NestedItem<T>>;
|
|
132
|
+
emit: (evt: "update:modelValue", value: string) => void;
|
|
133
|
+
}>) => import("vue").VNode & {
|
|
134
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
135
|
+
};
|
|
136
|
+
export default _default;
|
|
137
|
+
type __VLS_PrettifyLocal<T> = {
|
|
138
|
+
[K in keyof T]: T[K];
|
|
139
|
+
} & {};
|
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import { computed } from
|
|
3
|
-
import { useOverlay
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const onClose = (id: symbol, value: any) => {
|
|
15
|
-
close(id, value)
|
|
16
|
-
}
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useOverlay } from "../composables/useOverlay";
|
|
4
|
+
const { overlays, unMount, close } = useOverlay();
|
|
5
|
+
const mountedOverlays = computed(() => overlays.filter((overlay) => overlay.isMounted));
|
|
6
|
+
const onAfterLeave = (id) => {
|
|
7
|
+
close(id);
|
|
8
|
+
unMount(id);
|
|
9
|
+
};
|
|
10
|
+
const onClose = (id, value) => {
|
|
11
|
+
close(id, value);
|
|
12
|
+
};
|
|
17
13
|
</script>
|
|
18
14
|
|
|
19
15
|
<template>
|
|
@@ -22,8 +18,8 @@ const onClose = (id: symbol, value: any) => {
|
|
|
22
18
|
v-for="overlay in mountedOverlays"
|
|
23
19
|
:key="overlay.id"
|
|
24
20
|
v-bind="overlay.props"
|
|
25
|
-
v-model:open="overlay.
|
|
26
|
-
@close="(value
|
|
21
|
+
v-model:open="overlay.isOpen"
|
|
22
|
+
@close="(value) => onClose(overlay.id, value)"
|
|
27
23
|
@after:leave="onAfterLeave(overlay.id)"
|
|
28
24
|
/>
|
|
29
25
|
</template>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|