@bitrix24/b24ui-nuxt 0.5.11 → 0.6.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/b24ui/advice.ts +10 -2
- package/.nuxt/b24ui/alert.ts +10 -2
- package/.nuxt/b24ui/avatar-group.ts +10 -2
- package/.nuxt/b24ui/avatar.ts +10 -2
- package/.nuxt/b24ui/badge.ts +10 -2
- package/.nuxt/b24ui/button-group.ts +10 -2
- package/.nuxt/b24ui/button.ts +16 -6
- package/.nuxt/b24ui/calendar.ts +10 -2
- package/.nuxt/b24ui/checkbox.ts +10 -2
- package/.nuxt/b24ui/chip.ts +10 -2
- package/.nuxt/b24ui/collapsible.ts +10 -2
- package/.nuxt/b24ui/container.ts +10 -2
- package/.nuxt/b24ui/countdown.ts +10 -2
- package/.nuxt/b24ui/description-list.ts +10 -2
- package/.nuxt/b24ui/dropdown-menu.ts +10 -2
- package/.nuxt/b24ui/form-field.ts +10 -2
- package/.nuxt/b24ui/form.ts +10 -2
- package/.nuxt/b24ui/input-menu.ts +12 -4
- package/.nuxt/b24ui/input-number.ts +10 -2
- package/.nuxt/b24ui/input.ts +10 -2
- package/.nuxt/b24ui/kbd.ts +10 -2
- package/.nuxt/b24ui/link.ts +10 -2
- package/.nuxt/b24ui/modal.ts +10 -2
- package/.nuxt/b24ui/navbar-divider.ts +10 -2
- package/.nuxt/b24ui/navbar-section.ts +10 -2
- package/.nuxt/b24ui/navbar-spacer.ts +10 -2
- package/.nuxt/b24ui/navbar.ts +10 -2
- package/.nuxt/b24ui/navigation-menu.ts +10 -2
- package/.nuxt/b24ui/popover.ts +10 -2
- package/.nuxt/b24ui/progress.ts +10 -2
- package/.nuxt/b24ui/radio-group.ts +10 -2
- package/.nuxt/b24ui/range.ts +10 -2
- package/.nuxt/b24ui/select-menu.ts +14 -6
- package/.nuxt/b24ui/select.ts +12 -4
- package/.nuxt/b24ui/separator.ts +10 -2
- package/.nuxt/b24ui/sidebar-body.ts +10 -2
- package/.nuxt/b24ui/sidebar-footer.ts +10 -2
- package/.nuxt/b24ui/sidebar-header.ts +10 -2
- package/.nuxt/b24ui/sidebar-heading.ts +10 -2
- package/.nuxt/b24ui/sidebar-layout.ts +10 -2
- package/.nuxt/b24ui/sidebar-section.ts +10 -2
- package/.nuxt/b24ui/sidebar-spacer.ts +10 -2
- package/.nuxt/b24ui/sidebar.ts +10 -2
- package/.nuxt/b24ui/skeleton.ts +10 -2
- package/.nuxt/b24ui/slideover.ts +10 -2
- package/.nuxt/b24ui/stacked-layout.ts +10 -2
- package/.nuxt/b24ui/switch.ts +10 -2
- package/.nuxt/b24ui/tabs.ts +10 -2
- package/.nuxt/b24ui/textarea.ts +10 -2
- package/.nuxt/b24ui/toast.ts +10 -2
- package/.nuxt/b24ui/toaster.ts +10 -2
- package/.nuxt/b24ui/tooltip.ts +10 -2
- package/cli/templates.mjs +19 -15
- package/dist/meta.d.mts +5675 -7513
- package/dist/meta.mjs +5675 -7513
- package/dist/module.json +3 -3
- package/dist/module.mjs +2 -2
- package/dist/runtime/components/Advice.vue +27 -55
- package/dist/runtime/components/Advice.vue.d.ts +56 -0
- package/dist/runtime/components/Alert.vue +35 -97
- package/dist/runtime/components/Alert.vue.d.ts +97 -0
- package/dist/runtime/components/App.vue +24 -34
- package/dist/runtime/components/App.vue.d.ts +23 -0
- package/dist/runtime/components/Avatar.vue +43 -82
- package/dist/runtime/components/Avatar.vue.d.ts +62 -0
- package/dist/runtime/components/AvatarGroup.vue +40 -77
- package/dist/runtime/components/AvatarGroup.vue.d.ts +40 -0
- package/dist/runtime/components/Badge.vue +40 -84
- package/dist/runtime/components/Badge.vue.d.ts +78 -0
- package/dist/runtime/components/Button.vue +107 -164
- package/dist/runtime/components/Button.vue.d.ts +115 -0
- package/dist/runtime/components/ButtonGroup.vue +25 -52
- package/dist/runtime/components/ButtonGroup.vue.d.ts +63 -0
- package/dist/runtime/components/Calendar.vue +73 -153
- package/dist/runtime/components/Calendar.vue.d.ts +107 -0
- package/dist/runtime/components/Checkbox.vue +42 -74
- package/dist/runtime/components/Checkbox.vue.d.ts +55 -0
- package/dist/runtime/components/Chip.vue +26 -75
- package/dist/runtime/components/Chip.vue.d.ts +77 -0
- package/dist/runtime/components/Collapsible.vue +22 -41
- package/dist/runtime/components/Collapsible.vue.d.ts +50 -0
- package/dist/runtime/components/Container.vue +15 -28
- package/dist/runtime/components/Container.vue.d.ts +27 -0
- package/dist/runtime/components/Countdown.vue +153 -379
- package/dist/runtime/components/Countdown.vue.d.ts +122 -0
- package/dist/runtime/components/DescriptionList.vue +78 -150
- package/dist/runtime/components/DescriptionList.vue.d.ts +109 -0
- package/dist/runtime/components/DropdownMenu.vue +38 -140
- package/dist/runtime/components/DropdownMenu.vue.d.ts +133 -0
- package/dist/runtime/components/DropdownMenuContent.vue +65 -79
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +51 -0
- package/dist/runtime/components/Form.vue +132 -218
- package/dist/runtime/components/Form.vue.d.ts +55 -0
- package/dist/runtime/components/FormField.vue +36 -81
- package/dist/runtime/components/FormField.vue.d.ts +73 -0
- package/dist/runtime/components/Input.vue +79 -180
- package/dist/runtime/components/Input.vue.d.ts +135 -0
- package/dist/runtime/components/InputMenu.vue +185 -382
- package/dist/runtime/components/InputMenu.vue.d.ts +357 -0
- package/dist/runtime/components/InputNumber.vue +77 -176
- package/dist/runtime/components/InputNumber.vue.d.ts +238 -0
- package/dist/runtime/components/Kbd.vue +20 -46
- package/dist/runtime/components/Kbd.vue.d.ts +55 -0
- package/dist/runtime/components/Link.vue +99 -179
- package/dist/runtime/components/Link.vue.d.ts +129 -0
- package/dist/runtime/components/LinkBase.vue +33 -42
- package/dist/runtime/components/LinkBase.vue.d.ts +48 -0
- package/dist/runtime/components/Modal.vue +48 -128
- package/dist/runtime/components/Modal.vue.d.ts +124 -0
- package/dist/runtime/components/ModalDialogClose.vue +5 -8
- package/dist/runtime/components/ModalDialogClose.vue.d.ts +10 -0
- package/dist/runtime/components/Navbar.vue +15 -33
- package/dist/runtime/components/Navbar.vue.d.ts +46 -0
- package/dist/runtime/components/NavbarDivider.vue +15 -33
- package/dist/runtime/components/NavbarDivider.vue.d.ts +46 -0
- package/dist/runtime/components/NavbarSection.vue +15 -33
- package/dist/runtime/components/NavbarSection.vue.d.ts +46 -0
- package/dist/runtime/components/NavbarSpacer.vue +15 -33
- package/dist/runtime/components/NavbarSpacer.vue.d.ts +46 -0
- package/dist/runtime/components/NavigationMenu.vue +74 -209
- package/dist/runtime/components/NavigationMenu.vue.d.ts +159 -0
- package/dist/runtime/components/OverlayProvider.vue +14 -18
- package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -0
- package/dist/runtime/components/Popover.vue +40 -82
- package/dist/runtime/components/Popover.vue.d.ts +79 -0
- package/dist/runtime/components/Progress.vue +70 -137
- package/dist/runtime/components/Progress.vue.d.ts +103 -0
- package/dist/runtime/components/RadioGroup.vue +59 -135
- package/dist/runtime/components/RadioGroup.vue.d.ts +88 -0
- package/dist/runtime/components/Range.vue +46 -86
- package/dist/runtime/components/Range.vue.d.ts +73 -0
- package/dist/runtime/components/Select.vue +110 -261
- package/dist/runtime/components/Select.vue.d.ts +170 -0
- package/dist/runtime/components/SelectMenu.vue +161 -348
- package/dist/runtime/components/SelectMenu.vue.d.ts +217 -0
- package/dist/runtime/components/Separator.vue +28 -72
- package/dist/runtime/components/Separator.vue.d.ts +77 -0
- package/dist/runtime/components/Sidebar.vue +15 -33
- package/dist/runtime/components/Sidebar.vue.d.ts +46 -0
- package/dist/runtime/components/SidebarBody.vue +17 -39
- package/dist/runtime/components/SidebarBody.vue.d.ts +53 -0
- package/dist/runtime/components/SidebarFooter.vue +15 -33
- package/dist/runtime/components/SidebarFooter.vue.d.ts +46 -0
- package/dist/runtime/components/SidebarHeader.vue +15 -33
- package/dist/runtime/components/SidebarHeader.vue.d.ts +46 -0
- package/dist/runtime/components/SidebarHeading.vue +15 -33
- package/dist/runtime/components/SidebarHeading.vue.d.ts +46 -0
- package/dist/runtime/components/SidebarLayout.vue +34 -71
- package/dist/runtime/components/SidebarLayout.vue.d.ts +65 -0
- package/dist/runtime/components/SidebarSection.vue +15 -33
- package/dist/runtime/components/SidebarSection.vue.d.ts +46 -0
- package/dist/runtime/components/SidebarSpacer.vue +15 -33
- package/dist/runtime/components/SidebarSpacer.vue.d.ts +46 -0
- package/dist/runtime/components/Skeleton.vue +14 -23
- package/dist/runtime/components/Skeleton.vue.d.ts +26 -0
- package/dist/runtime/components/Slideover.vue +50 -132
- package/dist/runtime/components/Slideover.vue.d.ts +127 -0
- package/dist/runtime/components/StackedLayout.vue +34 -74
- package/dist/runtime/components/StackedLayout.vue.d.ts +65 -0
- package/dist/runtime/components/Switch.vue +46 -96
- package/dist/runtime/components/Switch.vue.d.ts +77 -0
- package/dist/runtime/components/Tabs.vue +41 -106
- package/dist/runtime/components/Tabs.vue.d.ts +104 -0
- package/dist/runtime/components/Textarea.vue +92 -202
- package/dist/runtime/components/Textarea.vue.d.ts +141 -0
- package/dist/runtime/components/Toast.vue +47 -106
- package/dist/runtime/components/Toast.vue.d.ts +95 -0
- package/dist/runtime/components/Toaster.vue +70 -116
- package/dist/runtime/components/Toaster.vue.d.ts +70 -0
- package/dist/runtime/components/Tooltip.vue +36 -65
- package/dist/runtime/components/Tooltip.vue.d.ts +65 -0
- package/dist/runtime/components/content/TableWrapper.vue +24 -71
- package/dist/runtime/components/content/TableWrapper.vue.d.ts +83 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
- package/dist/runtime/composables/useComponentIcons.d.ts +3 -3
- package/dist/runtime/composables/useFormField.d.ts +2 -2
- package/dist/runtime/composables/useOverlay.d.ts +14 -7
- package/dist/runtime/composables/useOverlay.js +14 -6
- package/dist/runtime/prose/A.vue +16 -26
- package/dist/runtime/prose/A.vue.d.ts +27 -0
- package/dist/runtime/prose/Blockquote.vue +14 -26
- package/dist/runtime/prose/Blockquote.vue.d.ts +27 -0
- package/dist/runtime/prose/Code.vue +15 -32
- package/dist/runtime/prose/Code.vue.d.ts +31 -0
- package/dist/runtime/prose/Em.vue +16 -26
- package/dist/runtime/prose/Em.vue.d.ts +27 -0
- package/dist/runtime/prose/H1.vue +14 -26
- package/dist/runtime/prose/H1.vue.d.ts +27 -0
- package/dist/runtime/prose/H2.vue +14 -26
- package/dist/runtime/prose/H2.vue.d.ts +27 -0
- package/dist/runtime/prose/H3.vue +14 -26
- package/dist/runtime/prose/H3.vue.d.ts +27 -0
- package/dist/runtime/prose/H4.vue +14 -26
- package/dist/runtime/prose/H4.vue.d.ts +27 -0
- package/dist/runtime/prose/H5.vue +14 -26
- package/dist/runtime/prose/H5.vue.d.ts +27 -0
- package/dist/runtime/prose/H6.vue +14 -26
- package/dist/runtime/prose/H6.vue.d.ts +27 -0
- package/dist/runtime/prose/Hr.vue +13 -22
- package/dist/runtime/prose/Hr.vue.d.ts +19 -0
- package/dist/runtime/prose/Img.vue +13 -26
- package/dist/runtime/prose/Img.vue.d.ts +19 -0
- package/dist/runtime/prose/Li.vue +14 -26
- package/dist/runtime/prose/Li.vue.d.ts +27 -0
- package/dist/runtime/prose/Ol.vue +14 -26
- package/dist/runtime/prose/Ol.vue.d.ts +27 -0
- package/dist/runtime/prose/P.vue +14 -26
- package/dist/runtime/prose/P.vue.d.ts +27 -0
- package/dist/runtime/prose/Pre.vue +17 -33
- package/dist/runtime/prose/Pre.vue.d.ts +47 -0
- package/dist/runtime/prose/Strong.vue +14 -26
- package/dist/runtime/prose/Strong.vue.d.ts +27 -0
- package/dist/runtime/prose/Table.vue +21 -57
- package/dist/runtime/prose/Table.vue.d.ts +74 -0
- package/dist/runtime/prose/Tbody.vue +14 -26
- package/dist/runtime/prose/Tbody.vue.d.ts +27 -0
- package/dist/runtime/prose/Td.vue +14 -26
- package/dist/runtime/prose/Td.vue.d.ts +27 -0
- package/dist/runtime/prose/Th.vue +14 -26
- package/dist/runtime/prose/Th.vue.d.ts +27 -0
- package/dist/runtime/prose/Thead.vue +14 -26
- package/dist/runtime/prose/Thead.vue.d.ts +27 -0
- package/dist/runtime/prose/Tr.vue +14 -26
- package/dist/runtime/prose/Tr.vue.d.ts +27 -0
- package/dist/runtime/prose/Ul.vue +14 -26
- package/dist/runtime/prose/Ul.vue.d.ts +27 -0
- package/dist/runtime/types/form.d.ts +1 -0
- package/dist/runtime/types/utils.d.ts +42 -3
- package/dist/runtime/utils/link.d.ts +3 -3
- package/dist/runtime/utils/tv.js +2 -2
- package/dist/runtime/vue/components/Link.vue +122 -208
- package/dist/runtime/vue/components/Link.vue.d.ts +129 -0
- package/dist/shared/{b24ui-nuxt.CS9Lf0os.mjs → b24ui-nuxt.wBs9vEU5.mjs} +33 -8
- package/dist/types.d.mts +3 -5
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +19 -27
- package/dist/meta.cjs +0 -72112
- package/dist/meta.d.cts +0 -72110
- package/dist/meta.d.ts +0 -72110
- package/dist/module.cjs +0 -63
- package/dist/module.d.cts +0 -15
- package/dist/module.d.ts +0 -15
- package/dist/shared/b24ui-nuxt.DrKwIWoc.cjs +0 -7721
- package/dist/types.d.ts +0 -7
- package/dist/unplugin.cjs +0 -236
- package/dist/unplugin.d.cts +0 -33
- package/dist/unplugin.d.ts +0 -33
- package/dist/vite.cjs +0 -21
- package/dist/vite.d.cts +0 -14
- package/dist/vite.d.ts +0 -14
|
@@ -1,144 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type { VariantProps } from 'tailwind-variants'
|
|
4
|
-
import type { DropdownMenuRootProps, DropdownMenuRootEmits, DropdownMenuContentProps, DropdownMenuContentEmits, DropdownMenuArrowProps } from 'reka-ui'
|
|
5
|
-
import type { AppConfig } from '@nuxt/schema'
|
|
6
|
-
import _appConfig from '#build/app.config'
|
|
7
|
-
import theme from '#build/b24ui/dropdown-menu'
|
|
8
|
-
import { tv } from '../utils/tv'
|
|
9
|
-
import type { AvatarProps, KbdProps, LinkProps, IconComponent } from '../types'
|
|
10
|
-
import type {
|
|
11
|
-
ArrayOrNested,
|
|
12
|
-
DynamicSlots,
|
|
13
|
-
MergeTypes,
|
|
14
|
-
NestedItem,
|
|
15
|
-
PartialString,
|
|
16
|
-
EmitsToProps
|
|
17
|
-
} from '../types/utils'
|
|
18
|
-
|
|
19
|
-
const appConfigDropdownMenu = _appConfig as AppConfig & { b24ui: { dropdownMenu: Partial<typeof theme> } }
|
|
20
|
-
|
|
21
|
-
const dropdownMenu = tv({ extend: tv(theme), ...(appConfigDropdownMenu.b24ui?.dropdownMenu || {}) })
|
|
22
|
-
|
|
23
|
-
type DropdownMenuVariants = VariantProps<typeof dropdownMenu>
|
|
24
|
-
|
|
25
|
-
export interface DropdownMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custom'> {
|
|
26
|
-
label?: string
|
|
27
|
-
/**
|
|
28
|
-
* Display an icon on the left side.
|
|
29
|
-
* @IconComponent
|
|
30
|
-
*/
|
|
31
|
-
icon?: IconComponent
|
|
32
|
-
color?: DropdownMenuVariants['color']
|
|
33
|
-
avatar?: AvatarProps
|
|
34
|
-
content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<DropdownMenuContentEmits>>
|
|
35
|
-
kbds?: KbdProps['value'][] | KbdProps[]
|
|
36
|
-
/**
|
|
37
|
-
* The item type.
|
|
38
|
-
* @defaultValue 'link'
|
|
39
|
-
*/
|
|
40
|
-
type?: 'label' | 'separator' | 'link' | 'checkbox'
|
|
41
|
-
slot?: string
|
|
42
|
-
loading?: boolean
|
|
43
|
-
disabled?: boolean
|
|
44
|
-
checked?: boolean
|
|
45
|
-
open?: boolean
|
|
46
|
-
defaultOpen?: boolean
|
|
47
|
-
children?: ArrayOrNested<DropdownMenuItem>
|
|
48
|
-
onSelect?(e: Event): void
|
|
49
|
-
onUpdateChecked?(checked: boolean): void
|
|
50
|
-
[key: string]: any
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export interface DropdownMenuProps<T extends ArrayOrNested<DropdownMenuItem> = ArrayOrNested<DropdownMenuItem>> extends Omit<DropdownMenuRootProps, 'dir'> {
|
|
54
|
-
/**
|
|
55
|
-
* @defaultValue 'md'
|
|
56
|
-
*/
|
|
57
|
-
size?: DropdownMenuVariants['size']
|
|
58
|
-
items?: T
|
|
59
|
-
/**
|
|
60
|
-
* The icon displayed when an item is checked.
|
|
61
|
-
* @defaultValue icons.check
|
|
62
|
-
* @IconComponent
|
|
63
|
-
*/
|
|
64
|
-
checkedIcon?: IconComponent
|
|
65
|
-
/**
|
|
66
|
-
* The icon displayed when the item is an external link.
|
|
67
|
-
* Set to `false` to hide the external icon.
|
|
68
|
-
* @defaultValue icons.external
|
|
69
|
-
* @IconComponent
|
|
70
|
-
*/
|
|
71
|
-
externalIcon?: boolean | IconComponent
|
|
72
|
-
/**
|
|
73
|
-
* The content of the menu.
|
|
74
|
-
* @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8 }
|
|
75
|
-
*/
|
|
76
|
-
content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<DropdownMenuContentEmits>>
|
|
77
|
-
/**
|
|
78
|
-
* Display an arrow alongside the menu.
|
|
79
|
-
* @defaultValue false
|
|
80
|
-
*/
|
|
81
|
-
arrow?: boolean | Omit<DropdownMenuArrowProps, 'as' | 'asChild'>
|
|
82
|
-
/**
|
|
83
|
-
* Render the menu in a portal.
|
|
84
|
-
* @defaultValue true
|
|
85
|
-
*/
|
|
86
|
-
portal?: boolean
|
|
87
|
-
/**
|
|
88
|
-
* The key used to get the label from the item.
|
|
89
|
-
* @defaultValue 'label'
|
|
90
|
-
*/
|
|
91
|
-
labelKey?: keyof NestedItem<T>
|
|
92
|
-
/**
|
|
93
|
-
* @defaultValue false
|
|
94
|
-
*/
|
|
95
|
-
disabled?: boolean
|
|
96
|
-
class?: any
|
|
97
|
-
b24ui?: PartialString<typeof dropdownMenu.slots>
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export interface DropdownMenuEmits extends DropdownMenuRootEmits {}
|
|
101
|
-
|
|
102
|
-
type SlotProps<T extends DropdownMenuItem> = (props: { item: T, active?: boolean, index: number }) => any
|
|
103
|
-
|
|
104
|
-
export type DropdownMenuSlots<
|
|
105
|
-
A extends ArrayOrNested<DropdownMenuItem> = ArrayOrNested<DropdownMenuItem>,
|
|
106
|
-
T extends NestedItem<A> = NestedItem<A>
|
|
107
|
-
> = {
|
|
108
|
-
'default'(props: { open: boolean }): any
|
|
109
|
-
'item': SlotProps<T>
|
|
110
|
-
'item-leading': SlotProps<T>
|
|
111
|
-
'item-label': SlotProps<T>
|
|
112
|
-
'item-trailing': SlotProps<T>
|
|
113
|
-
} & DynamicSlots<MergeTypes<T>, 'leading' | 'label' | 'trailing', { active?: boolean, index: number }>
|
|
114
|
-
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/b24ui/dropdown-menu";
|
|
115
3
|
</script>
|
|
116
4
|
|
|
117
|
-
<script setup
|
|
118
|
-
import { computed, toRef } from
|
|
119
|
-
import { defu } from
|
|
120
|
-
import { DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuArrow, useForwardPropsEmits } from
|
|
121
|
-
import { reactivePick } from
|
|
122
|
-
import {
|
|
123
|
-
import
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed, toRef } from "vue";
|
|
7
|
+
import { defu } from "defu";
|
|
8
|
+
import { DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuArrow, useForwardPropsEmits } from "reka-ui";
|
|
9
|
+
import { reactivePick } from "@vueuse/core";
|
|
10
|
+
import { useAppConfig } from "#imports";
|
|
11
|
+
import { omit } from "../utils";
|
|
12
|
+
import { tv } from "../utils/tv";
|
|
13
|
+
import B24DropdownMenuContent from "./DropdownMenuContent.vue";
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
size: { type: null, required: false },
|
|
16
|
+
items: { type: null, required: false },
|
|
17
|
+
checkedIcon: { type: [Function, Object], required: false },
|
|
18
|
+
externalIcon: { type: [Boolean, Function, Object], required: false, default: true },
|
|
19
|
+
content: { type: Object, required: false },
|
|
20
|
+
arrow: { type: [Boolean, Object], required: false },
|
|
21
|
+
portal: { type: Boolean, required: false, default: true },
|
|
22
|
+
labelKey: { type: null, required: false, default: "label" },
|
|
23
|
+
disabled: { type: Boolean, required: false },
|
|
24
|
+
class: { type: null, required: false },
|
|
25
|
+
b24ui: { type: null, required: false },
|
|
26
|
+
defaultOpen: { type: Boolean, required: false },
|
|
27
|
+
open: { type: Boolean, required: false },
|
|
28
|
+
modal: { type: Boolean, required: false, default: true }
|
|
29
|
+
});
|
|
30
|
+
const emits = defineEmits(["update:open"]);
|
|
31
|
+
const slots = defineSlots();
|
|
32
|
+
const appConfig = useAppConfig();
|
|
33
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, "defaultOpen", "open", "modal"), emits);
|
|
34
|
+
const contentProps = toRef(() => defu(props.content, { side: "bottom", sideOffset: 8, collisionPadding: 8 }));
|
|
35
|
+
const arrowProps = toRef(() => props.arrow);
|
|
36
|
+
const proxySlots = omit(slots, ["default"]);
|
|
37
|
+
const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.dropdownMenu || {} })({
|
|
140
38
|
size: props.size
|
|
141
|
-
}))
|
|
39
|
+
}));
|
|
142
40
|
</script>
|
|
143
41
|
|
|
144
42
|
<template>
|
|
@@ -154,12 +52,12 @@ const b24ui = computed(() => dropdownMenu({
|
|
|
154
52
|
v-bind="contentProps"
|
|
155
53
|
:items="items"
|
|
156
54
|
:portal="portal"
|
|
157
|
-
:label-key="
|
|
55
|
+
:label-key="labelKey"
|
|
158
56
|
:checked-icon="checkedIcon"
|
|
159
57
|
:external-icon="externalIcon"
|
|
160
58
|
>
|
|
161
59
|
<template v-for="(_, name) in proxySlots" #[name]="slotData">
|
|
162
|
-
<slot :name="
|
|
60
|
+
<slot :name="name" v-bind="slotData" />
|
|
163
61
|
</template>
|
|
164
62
|
|
|
165
63
|
<DropdownMenuArrow v-if="!!arrow" v-bind="arrowProps" :class="b24ui.arrow({ class: props.b24ui?.arrow })" />
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type { DropdownMenuRootProps, DropdownMenuRootEmits, DropdownMenuContentProps, DropdownMenuContentEmits, DropdownMenuArrowProps } from 'reka-ui';
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
3
|
+
import theme from '#build/b24ui/dropdown-menu';
|
|
4
|
+
import type { AvatarProps, KbdProps, LinkProps, IconComponent } from '../types';
|
|
5
|
+
import type { ArrayOrNested, DynamicSlots, MergeTypes, NestedItem, EmitsToProps, ComponentConfig } from '../types/utils';
|
|
6
|
+
type DropdownMenu = ComponentConfig<typeof theme, AppConfig, 'dropdownMenu'>;
|
|
7
|
+
export interface DropdownMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custom'> {
|
|
8
|
+
label?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Display an icon on the left side.
|
|
11
|
+
* @IconComponent
|
|
12
|
+
*/
|
|
13
|
+
icon?: IconComponent;
|
|
14
|
+
color?: DropdownMenu['variants']['color'];
|
|
15
|
+
avatar?: AvatarProps;
|
|
16
|
+
content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<DropdownMenuContentEmits>>;
|
|
17
|
+
kbds?: KbdProps['value'][] | KbdProps[];
|
|
18
|
+
/**
|
|
19
|
+
* The item type.
|
|
20
|
+
* @defaultValue 'link'
|
|
21
|
+
*/
|
|
22
|
+
type?: 'label' | 'separator' | 'link' | 'checkbox';
|
|
23
|
+
slot?: string;
|
|
24
|
+
loading?: boolean;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
checked?: boolean;
|
|
27
|
+
open?: boolean;
|
|
28
|
+
defaultOpen?: boolean;
|
|
29
|
+
children?: ArrayOrNested<DropdownMenuItem>;
|
|
30
|
+
onSelect?(e: Event): void;
|
|
31
|
+
onUpdateChecked?(checked: boolean): void;
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
}
|
|
34
|
+
export interface DropdownMenuProps<T extends ArrayOrNested<DropdownMenuItem> = ArrayOrNested<DropdownMenuItem>> extends Omit<DropdownMenuRootProps, 'dir'> {
|
|
35
|
+
/**
|
|
36
|
+
* @defaultValue 'md'
|
|
37
|
+
*/
|
|
38
|
+
size?: DropdownMenu['variants']['size'];
|
|
39
|
+
items?: T;
|
|
40
|
+
/**
|
|
41
|
+
* The icon displayed when an item is checked.
|
|
42
|
+
* @defaultValue icons.check
|
|
43
|
+
* @IconComponent
|
|
44
|
+
*/
|
|
45
|
+
checkedIcon?: IconComponent;
|
|
46
|
+
/**
|
|
47
|
+
* The icon displayed when the item is an external link.
|
|
48
|
+
* Set to `false` to hide the external icon.
|
|
49
|
+
* @defaultValue icons.external
|
|
50
|
+
* @IconComponent
|
|
51
|
+
*/
|
|
52
|
+
externalIcon?: boolean | IconComponent;
|
|
53
|
+
/**
|
|
54
|
+
* The content of the menu.
|
|
55
|
+
* @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8 }
|
|
56
|
+
*/
|
|
57
|
+
content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<DropdownMenuContentEmits>>;
|
|
58
|
+
/**
|
|
59
|
+
* Display an arrow alongside the menu.
|
|
60
|
+
* @defaultValue false
|
|
61
|
+
*/
|
|
62
|
+
arrow?: boolean | Omit<DropdownMenuArrowProps, 'as' | 'asChild'>;
|
|
63
|
+
/**
|
|
64
|
+
* Render the menu in a portal.
|
|
65
|
+
* @defaultValue true
|
|
66
|
+
*/
|
|
67
|
+
portal?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* The key used to get the label from the item.
|
|
70
|
+
* @defaultValue 'label'
|
|
71
|
+
*/
|
|
72
|
+
labelKey?: keyof NestedItem<T>;
|
|
73
|
+
/**
|
|
74
|
+
* @defaultValue false
|
|
75
|
+
*/
|
|
76
|
+
disabled?: boolean;
|
|
77
|
+
class?: any;
|
|
78
|
+
b24ui?: DropdownMenu['slots'];
|
|
79
|
+
}
|
|
80
|
+
export interface DropdownMenuEmits extends DropdownMenuRootEmits {
|
|
81
|
+
}
|
|
82
|
+
type SlotProps<T extends DropdownMenuItem> = (props: {
|
|
83
|
+
item: T;
|
|
84
|
+
active?: boolean;
|
|
85
|
+
index: number;
|
|
86
|
+
}) => any;
|
|
87
|
+
export type DropdownMenuSlots<A extends ArrayOrNested<DropdownMenuItem> = ArrayOrNested<DropdownMenuItem>, T extends NestedItem<A> = NestedItem<A>> = {
|
|
88
|
+
'default'(props: {
|
|
89
|
+
open: boolean;
|
|
90
|
+
}): any;
|
|
91
|
+
'item': SlotProps<T>;
|
|
92
|
+
'item-leading': SlotProps<T>;
|
|
93
|
+
'item-label': SlotProps<T>;
|
|
94
|
+
'item-trailing': SlotProps<T>;
|
|
95
|
+
} & DynamicSlots<MergeTypes<T>, 'leading' | 'label' | 'trailing', {
|
|
96
|
+
active?: boolean;
|
|
97
|
+
index: number;
|
|
98
|
+
}>;
|
|
99
|
+
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<{
|
|
100
|
+
props: __VLS_PrettifyLocal<any & DropdownMenuProps<T> & Partial<{}>> & (import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps);
|
|
101
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
102
|
+
attrs: any;
|
|
103
|
+
slots: Readonly<{
|
|
104
|
+
default(props: {
|
|
105
|
+
open: boolean;
|
|
106
|
+
}): any;
|
|
107
|
+
item: SlotProps<NestedItem<T>>;
|
|
108
|
+
'item-leading': SlotProps<NestedItem<T>>;
|
|
109
|
+
'item-label': SlotProps<NestedItem<T>>;
|
|
110
|
+
'item-trailing': SlotProps<NestedItem<T>>;
|
|
111
|
+
} & DynamicSlots<MergeTypes<NestedItem<T>>, "leading" | "trailing" | "label", {
|
|
112
|
+
active?: boolean;
|
|
113
|
+
index: number;
|
|
114
|
+
}>> & {
|
|
115
|
+
default(props: {
|
|
116
|
+
open: boolean;
|
|
117
|
+
}): any;
|
|
118
|
+
item: SlotProps<NestedItem<T>>;
|
|
119
|
+
'item-leading': SlotProps<NestedItem<T>>;
|
|
120
|
+
'item-label': SlotProps<NestedItem<T>>;
|
|
121
|
+
'item-trailing': SlotProps<NestedItem<T>>;
|
|
122
|
+
} & DynamicSlots<MergeTypes<NestedItem<T>>, "leading" | "trailing" | "label", {
|
|
123
|
+
active?: boolean;
|
|
124
|
+
index: number;
|
|
125
|
+
}>;
|
|
126
|
+
emit: (evt: "update:open", payload: boolean) => void;
|
|
127
|
+
}>) => import("vue").VNode & {
|
|
128
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
129
|
+
};
|
|
130
|
+
export default _default;
|
|
131
|
+
type __VLS_PrettifyLocal<T> = {
|
|
132
|
+
[K in keyof T]: T[K];
|
|
133
|
+
} & {};
|
|
@@ -1,81 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
<script lang="ts">
|
|
3
|
-
import type { DropdownMenuContentProps as RekaDropdownMenuContentProps, DropdownMenuContentEmits as RekaDropdownMenuContentEmits } from 'reka-ui'
|
|
4
|
-
import theme from '#build/b24ui/dropdown-menu'
|
|
5
|
-
import { tv } from '../utils/tv'
|
|
6
|
-
import type { KbdProps, AvatarProps, DropdownMenuItem, DropdownMenuSlots, IconComponent } from '../types'
|
|
7
|
-
import type { ArrayOrNested, NestedItem } from '../types/utils'
|
|
1
|
+
<script>
|
|
8
2
|
|
|
9
|
-
const _dropdownMenu = tv(theme)()
|
|
10
|
-
|
|
11
|
-
interface DropdownMenuContentProps<T extends ArrayOrNested<DropdownMenuItem>> extends Omit<RekaDropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> {
|
|
12
|
-
items?: T
|
|
13
|
-
portal?: boolean
|
|
14
|
-
sub?: boolean
|
|
15
|
-
labelKey: keyof NestedItem<T>
|
|
16
|
-
/**
|
|
17
|
-
* @IconComponent
|
|
18
|
-
*/
|
|
19
|
-
checkedIcon?: IconComponent
|
|
20
|
-
/**
|
|
21
|
-
* @IconComponent
|
|
22
|
-
*/
|
|
23
|
-
externalIcon?: boolean | IconComponent
|
|
24
|
-
class?: any
|
|
25
|
-
b24ui: typeof _dropdownMenu
|
|
26
|
-
b24uiOverride?: any
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface DropdownMenuContentEmits extends RekaDropdownMenuContentEmits {}
|
|
30
|
-
|
|
31
|
-
type DropdownMenuContentSlots<T extends ArrayOrNested<DropdownMenuItem>> = Omit<DropdownMenuSlots<T>, 'default'> & {
|
|
32
|
-
default(props?: {}): any
|
|
33
|
-
}
|
|
34
3
|
</script>
|
|
35
4
|
|
|
36
|
-
<script setup
|
|
37
|
-
import { computed } from
|
|
38
|
-
import { DropdownMenu } from
|
|
39
|
-
import { useForwardPropsEmits } from
|
|
40
|
-
import { reactiveOmit, createReusableTemplate } from
|
|
41
|
-
import { useLocale } from
|
|
42
|
-
import { omit, get, isArrayOfArray } from
|
|
43
|
-
import { pickLinkProps } from
|
|
44
|
-
import icons from
|
|
45
|
-
import B24LinkBase from
|
|
46
|
-
import B24Link from
|
|
47
|
-
import B24Avatar from
|
|
48
|
-
import B24Kbd from
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
5
|
+
<script setup>
|
|
6
|
+
import { computed } from "vue";
|
|
7
|
+
import { DropdownMenu } from "reka-ui/namespaced";
|
|
8
|
+
import { useForwardPropsEmits } from "reka-ui";
|
|
9
|
+
import { reactiveOmit, createReusableTemplate } from "@vueuse/core";
|
|
10
|
+
import { useLocale } from "../composables/useLocale";
|
|
11
|
+
import { omit, get, isArrayOfArray } from "../utils";
|
|
12
|
+
import { pickLinkProps } from "../utils/link";
|
|
13
|
+
import icons from "../dictionary/icons";
|
|
14
|
+
import B24LinkBase from "./LinkBase.vue";
|
|
15
|
+
import B24Link from "./Link.vue";
|
|
16
|
+
import B24Avatar from "./Avatar.vue";
|
|
17
|
+
import B24Kbd from "./Kbd.vue";
|
|
18
|
+
import B24DropdownMenuContent from "./DropdownMenuContent.vue";
|
|
19
|
+
const props = defineProps({
|
|
20
|
+
items: { type: null, required: false },
|
|
21
|
+
portal: { type: Boolean, required: false },
|
|
22
|
+
sub: { type: Boolean, required: false },
|
|
23
|
+
labelKey: { type: null, required: true },
|
|
24
|
+
checkedIcon: { type: [Function, Object], required: false },
|
|
25
|
+
externalIcon: { type: [Boolean, Function, Object], required: false },
|
|
26
|
+
class: { type: null, required: false },
|
|
27
|
+
b24ui: { type: null, required: true },
|
|
28
|
+
b24uiOverride: { type: null, required: false },
|
|
29
|
+
loop: { type: Boolean, required: false },
|
|
30
|
+
side: { type: null, required: false },
|
|
31
|
+
sideOffset: { type: Number, required: false },
|
|
32
|
+
align: { type: null, required: false },
|
|
33
|
+
alignOffset: { type: Number, required: false },
|
|
34
|
+
avoidCollisions: { type: Boolean, required: false },
|
|
35
|
+
collisionBoundary: { type: null, required: false },
|
|
36
|
+
collisionPadding: { type: [Number, Object], required: false },
|
|
37
|
+
arrowPadding: { type: Number, required: false },
|
|
38
|
+
sticky: { type: String, required: false },
|
|
39
|
+
hideWhenDetached: { type: Boolean, required: false },
|
|
40
|
+
positionStrategy: { type: String, required: false },
|
|
41
|
+
updatePositionStrategy: { type: String, required: false },
|
|
42
|
+
disableUpdateOnLayoutShift: { type: Boolean, required: false },
|
|
43
|
+
prioritizePosition: { type: Boolean, required: false },
|
|
44
|
+
reference: { type: null, required: false }
|
|
45
|
+
});
|
|
46
|
+
const emits = defineEmits(["escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "closeAutoFocus"]);
|
|
47
|
+
const slots = defineSlots();
|
|
48
|
+
const { dir } = useLocale();
|
|
49
|
+
const contentProps = useForwardPropsEmits(reactiveOmit(props, "sub", "items", "portal", "labelKey", "checkedIcon", "externalIcon", "class", "b24ui", "b24uiOverride"), emits);
|
|
50
|
+
const proxySlots = omit(slots, ["default"]);
|
|
51
|
+
const getLabel = (item) => {
|
|
52
|
+
return get(item, props.labelKey);
|
|
53
|
+
};
|
|
54
|
+
const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate();
|
|
55
|
+
const childrenIcon = computed(() => dir.value === "rtl" ? icons.chevronLeft : icons.chevronRight);
|
|
56
|
+
const groups = computed(
|
|
57
|
+
() => props.items?.length ? isArrayOfArray(props.items) ? props.items : [props.items] : []
|
|
58
|
+
);
|
|
73
59
|
</script>
|
|
74
60
|
|
|
75
61
|
<template>
|
|
76
62
|
<DefineItemTemplate v-slot="{ item, active, index }">
|
|
77
|
-
<slot :name="
|
|
78
|
-
<slot :name="
|
|
63
|
+
<slot :name="item.slot || 'item'" :item="item" :index="index">
|
|
64
|
+
<slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="item" :active="active" :index="index">
|
|
79
65
|
<Component
|
|
80
66
|
:is="icons.loading"
|
|
81
67
|
v-if="item.loading"
|
|
@@ -88,14 +74,14 @@ const groups = computed<DropdownMenuItem[][]>(() =>
|
|
|
88
74
|
/>
|
|
89
75
|
<B24Avatar
|
|
90
76
|
v-else-if="item.avatar"
|
|
91
|
-
:size="
|
|
77
|
+
:size="props.b24uiOverride?.itemLeadingAvatarSize || b24ui.itemLeadingAvatarSize()"
|
|
92
78
|
v-bind="item.avatar"
|
|
93
79
|
:class="b24ui.itemLeadingAvatar({ class: b24uiOverride?.itemLeadingAvatar, active })"
|
|
94
80
|
/>
|
|
95
81
|
</slot>
|
|
96
82
|
|
|
97
|
-
<span v-if="getLabel(item) || !!slots[
|
|
98
|
-
<slot :name="
|
|
83
|
+
<span v-if="getLabel(item) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="b24ui.itemLabel({ class: b24uiOverride?.itemLabel, active })">
|
|
84
|
+
<slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="active" :index="index">
|
|
99
85
|
{{ getLabel(item) }}
|
|
100
86
|
</slot>
|
|
101
87
|
<Component
|
|
@@ -106,14 +92,14 @@ const groups = computed<DropdownMenuItem[][]>(() =>
|
|
|
106
92
|
</span>
|
|
107
93
|
|
|
108
94
|
<span :class="b24ui.itemTrailing({ class: b24uiOverride?.itemTrailing })">
|
|
109
|
-
<slot :name="
|
|
95
|
+
<slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="active" :index="index">
|
|
110
96
|
<Component
|
|
111
97
|
:is="childrenIcon"
|
|
112
98
|
v-if="item.children?.length"
|
|
113
99
|
:class="b24ui.itemTrailingIcon({ class: b24uiOverride?.itemTrailingIcon, color: item?.color, active })"
|
|
114
100
|
/>
|
|
115
101
|
<span v-else-if="item.kbds?.length" :class="b24ui.itemTrailingKbds({ class: b24uiOverride?.itemTrailingKbds })">
|
|
116
|
-
<B24Kbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="
|
|
102
|
+
<B24Kbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="props.b24uiOverride?.itemTrailingKbdsSize || b24ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
117
103
|
</span>
|
|
118
104
|
</slot>
|
|
119
105
|
|
|
@@ -152,7 +138,7 @@ const groups = computed<DropdownMenuItem[][]>(() =>
|
|
|
152
138
|
:b24ui="b24ui"
|
|
153
139
|
:b24ui-override="b24uiOverride"
|
|
154
140
|
:portal="portal"
|
|
155
|
-
:items="
|
|
141
|
+
:items="item.children"
|
|
156
142
|
align="start"
|
|
157
143
|
:align-offset="-4"
|
|
158
144
|
:side-offset="3"
|
|
@@ -162,7 +148,7 @@ const groups = computed<DropdownMenuItem[][]>(() =>
|
|
|
162
148
|
v-bind="item.content"
|
|
163
149
|
>
|
|
164
150
|
<template v-for="(_, name) in proxySlots" #[name]="slotData">
|
|
165
|
-
<slot :name="
|
|
151
|
+
<slot :name="name" v-bind="slotData" />
|
|
166
152
|
</template>
|
|
167
153
|
</B24DropdownMenuContent>
|
|
168
154
|
</DropdownMenu.Sub>
|
|
@@ -184,7 +170,7 @@ const groups = computed<DropdownMenuItem[][]>(() =>
|
|
|
184
170
|
:text-value="getLabel(item)"
|
|
185
171
|
@select="item.onSelect"
|
|
186
172
|
>
|
|
187
|
-
<B24Link v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item
|
|
173
|
+
<B24Link v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
|
|
188
174
|
<B24LinkBase
|
|
189
175
|
v-bind="slotProps"
|
|
190
176
|
:class="b24ui.item({ class: [b24uiOverride?.item, item.class], color: item?.color, active })"
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { DropdownMenu } from 'reka-ui/namespaced';
|
|
2
|
+
import type { DropdownMenuContentProps as RekaDropdownMenuContentProps } from 'reka-ui';
|
|
3
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
4
|
+
import type theme from '#build/b24ui/dropdown-menu';
|
|
5
|
+
import type { DropdownMenuItem, DropdownMenuSlots, IconComponent } from '../types';
|
|
6
|
+
import type { ArrayOrNested, NestedItem, ComponentConfig } from '../types/utils';
|
|
7
|
+
type DropdownMenu = ComponentConfig<typeof theme, AppConfig, 'dropdownMenu'>;
|
|
8
|
+
interface DropdownMenuContentProps<T extends ArrayOrNested<DropdownMenuItem>> extends Omit<RekaDropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> {
|
|
9
|
+
items?: T;
|
|
10
|
+
portal?: boolean;
|
|
11
|
+
sub?: boolean;
|
|
12
|
+
labelKey: keyof NestedItem<T>;
|
|
13
|
+
/**
|
|
14
|
+
* @IconComponent
|
|
15
|
+
*/
|
|
16
|
+
checkedIcon?: IconComponent;
|
|
17
|
+
/**
|
|
18
|
+
* @IconComponent
|
|
19
|
+
*/
|
|
20
|
+
externalIcon?: boolean | IconComponent;
|
|
21
|
+
class?: any;
|
|
22
|
+
b24ui: {
|
|
23
|
+
[K in keyof Required<DropdownMenu['slots']>]: (props?: Record<string, any>) => string;
|
|
24
|
+
};
|
|
25
|
+
b24uiOverride?: DropdownMenu['slots'];
|
|
26
|
+
}
|
|
27
|
+
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<{
|
|
28
|
+
props: __VLS_PrettifyLocal<any & DropdownMenuContentProps<T> & Partial<{}>> & (import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps);
|
|
29
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
30
|
+
attrs: any;
|
|
31
|
+
slots: Readonly<Omit<DropdownMenuSlots<T>, "default"> & {
|
|
32
|
+
default(props?: {}): any;
|
|
33
|
+
}> & Omit<DropdownMenuSlots<T>, "default"> & {
|
|
34
|
+
default(props?: {}): any;
|
|
35
|
+
};
|
|
36
|
+
emit: ((evt: "escapeKeyDown", event: KeyboardEvent) => void) & ((evt: "pointerDownOutside", event: CustomEvent<{
|
|
37
|
+
originalEvent: PointerEvent;
|
|
38
|
+
}>) => void) & ((evt: "focusOutside", event: CustomEvent<{
|
|
39
|
+
originalEvent: FocusEvent;
|
|
40
|
+
}>) => void) & ((evt: "interactOutside", event: CustomEvent<{
|
|
41
|
+
originalEvent: PointerEvent;
|
|
42
|
+
}> | CustomEvent<{
|
|
43
|
+
originalEvent: FocusEvent;
|
|
44
|
+
}>) => void) & ((evt: "closeAutoFocus", event: Event) => void);
|
|
45
|
+
}>) => import("vue").VNode & {
|
|
46
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
47
|
+
};
|
|
48
|
+
export default _default;
|
|
49
|
+
type __VLS_PrettifyLocal<T> = {
|
|
50
|
+
[K in keyof T]: T[K];
|
|
51
|
+
} & {};
|