@bitrix24/b24ui-nuxt 0.5.9 → 0.5.10

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.
Files changed (196) hide show
  1. package/.nuxt/b24ui/navigation-menu.ts +0 -2
  2. package/.nuxt/b24ui/popover.ts +1 -1
  3. package/dist/meta.d.mts +4789 -4897
  4. package/dist/meta.mjs +4789 -4897
  5. package/dist/module.json +5 -5
  6. package/dist/module.mjs +11 -7
  7. package/dist/runtime/components/Advice.vue +47 -54
  8. package/dist/runtime/components/Advice.vue.d.ts +170 -0
  9. package/dist/runtime/components/Alert.vue +71 -96
  10. package/dist/runtime/components/Alert.vue.d.ts +464 -0
  11. package/dist/runtime/components/App.vue +37 -34
  12. package/dist/runtime/components/App.vue.d.ts +23 -0
  13. package/dist/runtime/components/Avatar.vue +69 -81
  14. package/dist/runtime/components/Avatar.vue.d.ts +281 -0
  15. package/dist/runtime/components/AvatarGroup.vue +53 -76
  16. package/dist/runtime/components/AvatarGroup.vue.d.ts +204 -0
  17. package/dist/runtime/components/Badge.vue +83 -83
  18. package/dist/runtime/components/Badge.vue.d.ts +517 -0
  19. package/dist/runtime/components/Button.vue +219 -149
  20. package/dist/runtime/components/Button.vue.d.ts +640 -0
  21. package/dist/runtime/components/ButtonGroup.vue +35 -51
  22. package/dist/runtime/components/ButtonGroup.vue.d.ts +116 -0
  23. package/dist/runtime/components/Calendar.vue +186 -152
  24. package/dist/runtime/components/Calendar.vue.d.ts +437 -0
  25. package/dist/runtime/components/Checkbox.vue +84 -73
  26. package/dist/runtime/components/Checkbox.vue.d.ts +354 -0
  27. package/dist/runtime/components/Chip.vue +59 -74
  28. package/dist/runtime/components/Chip.vue.d.ts +271 -0
  29. package/dist/runtime/components/Collapsible.vue +44 -41
  30. package/dist/runtime/components/Collapsible.vue.d.ts +118 -0
  31. package/dist/runtime/components/Container.vue +18 -27
  32. package/dist/runtime/components/Container.vue.d.ts +27 -0
  33. package/dist/runtime/components/Countdown.vue +198 -378
  34. package/dist/runtime/components/Countdown.vue.d.ts +356 -0
  35. package/dist/runtime/components/DescriptionList.vue +102 -149
  36. package/dist/runtime/components/DescriptionList.vue.d.ts +379 -0
  37. package/dist/runtime/components/DropdownMenu.vue +83 -139
  38. package/dist/runtime/components/DropdownMenu.vue.d.ts +533 -0
  39. package/dist/runtime/components/DropdownMenuContent.vue +137 -81
  40. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +228 -0
  41. package/dist/runtime/components/Form.vue +162 -216
  42. package/dist/runtime/components/Form.vue.d.ts +55 -0
  43. package/dist/runtime/components/FormField.vue +76 -80
  44. package/dist/runtime/components/FormField.vue.d.ts +282 -0
  45. package/dist/runtime/components/Input.vue +160 -179
  46. package/dist/runtime/components/Input.vue.d.ts +755 -0
  47. package/dist/runtime/components/InputMenu.vue +300 -381
  48. package/dist/runtime/components/InputMenu.vue.d.ts +1504 -0
  49. package/dist/runtime/components/InputNumber.vue +178 -175
  50. package/dist/runtime/components/InputNumber.vue.d.ts +658 -0
  51. package/dist/runtime/components/Kbd.vue +33 -45
  52. package/dist/runtime/components/Kbd.vue.d.ts +109 -0
  53. package/dist/runtime/components/Link.vue +179 -173
  54. package/dist/runtime/components/Link.vue.d.ts +129 -0
  55. package/dist/runtime/components/LinkBase.vue +64 -42
  56. package/dist/runtime/components/LinkBase.vue.d.ts +48 -0
  57. package/dist/runtime/components/Modal.vue +105 -127
  58. package/dist/runtime/components/Modal.vue.d.ts +327 -0
  59. package/dist/runtime/components/ModalDialogClose.vue +4 -8
  60. package/dist/runtime/components/ModalDialogClose.vue.d.ts +10 -0
  61. package/dist/runtime/components/Navbar.vue +24 -33
  62. package/dist/runtime/components/Navbar.vue.d.ts +101 -0
  63. package/dist/runtime/components/NavbarDivider.vue +24 -33
  64. package/dist/runtime/components/NavbarDivider.vue.d.ts +101 -0
  65. package/dist/runtime/components/NavbarSection.vue +24 -33
  66. package/dist/runtime/components/NavbarSection.vue.d.ts +101 -0
  67. package/dist/runtime/components/NavbarSpacer.vue +24 -33
  68. package/dist/runtime/components/NavbarSpacer.vue.d.ts +101 -0
  69. package/dist/runtime/components/NavigationMenu.vue +152 -216
  70. package/dist/runtime/components/NavigationMenu.vue.d.ts +824 -0
  71. package/dist/runtime/components/OverlayProvider.vue +13 -17
  72. package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -0
  73. package/dist/runtime/components/Popover.vue +81 -81
  74. package/dist/runtime/components/Popover.vue.d.ts +147 -0
  75. package/dist/runtime/components/Progress.vue +109 -136
  76. package/dist/runtime/components/Progress.vue.d.ts +592 -0
  77. package/dist/runtime/components/RadioGroup.vue +120 -134
  78. package/dist/runtime/components/RadioGroup.vue.d.ts +723 -0
  79. package/dist/runtime/components/Range.vue +94 -85
  80. package/dist/runtime/components/Range.vue.d.ts +417 -0
  81. package/dist/runtime/components/Select.vue +212 -260
  82. package/dist/runtime/components/Select.vue.d.ts +1200 -0
  83. package/dist/runtime/components/SelectMenu.vue +272 -366
  84. package/dist/runtime/components/SelectMenu.vue.d.ts +1298 -0
  85. package/dist/runtime/components/Separator.vue +61 -71
  86. package/dist/runtime/components/Separator.vue.d.ts +400 -0
  87. package/dist/runtime/components/Sidebar.vue +24 -33
  88. package/dist/runtime/components/Sidebar.vue.d.ts +101 -0
  89. package/dist/runtime/components/SidebarBody.vue +30 -38
  90. package/dist/runtime/components/SidebarBody.vue.d.ts +90 -0
  91. package/dist/runtime/components/SidebarFooter.vue +24 -33
  92. package/dist/runtime/components/SidebarFooter.vue.d.ts +101 -0
  93. package/dist/runtime/components/SidebarHeader.vue +24 -33
  94. package/dist/runtime/components/SidebarHeader.vue.d.ts +101 -0
  95. package/dist/runtime/components/SidebarHeading.vue +24 -33
  96. package/dist/runtime/components/SidebarHeading.vue.d.ts +101 -0
  97. package/dist/runtime/components/SidebarLayout.vue +40 -70
  98. package/dist/runtime/components/SidebarLayout.vue.d.ts +222 -0
  99. package/dist/runtime/components/SidebarSection.vue +24 -33
  100. package/dist/runtime/components/SidebarSection.vue.d.ts +101 -0
  101. package/dist/runtime/components/SidebarSpacer.vue +24 -33
  102. package/dist/runtime/components/SidebarSpacer.vue.d.ts +101 -0
  103. package/dist/runtime/components/Skeleton.vue +17 -22
  104. package/dist/runtime/components/Skeleton.vue.d.ts +26 -0
  105. package/dist/runtime/components/Slideover.vue +108 -131
  106. package/dist/runtime/components/Slideover.vue.d.ts +360 -0
  107. package/dist/runtime/components/StackedLayout.vue +40 -73
  108. package/dist/runtime/components/StackedLayout.vue.d.ts +192 -0
  109. package/dist/runtime/components/Switch.vue +100 -95
  110. package/dist/runtime/components/Switch.vue.d.ts +587 -0
  111. package/dist/runtime/components/Tabs.vue +83 -105
  112. package/dist/runtime/components/Tabs.vue.d.ts +453 -0
  113. package/dist/runtime/components/Textarea.vue +177 -201
  114. package/dist/runtime/components/Textarea.vue.d.ts +601 -0
  115. package/dist/runtime/components/Toast.vue +94 -105
  116. package/dist/runtime/components/Toast.vue.d.ts +438 -0
  117. package/dist/runtime/components/Toaster.vue +94 -111
  118. package/dist/runtime/components/Toaster.vue.d.ts +219 -0
  119. package/dist/runtime/components/Tooltip.vue +78 -64
  120. package/dist/runtime/components/Tooltip.vue.d.ts +186 -0
  121. package/dist/runtime/components/content/TableWrapper.vue +58 -70
  122. package/dist/runtime/components/content/TableWrapper.vue.d.ts +237 -0
  123. package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
  124. package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
  125. package/dist/runtime/composables/useComponentIcons.d.ts +1 -1
  126. package/dist/runtime/composables/useFormField.d.ts +1 -1
  127. package/dist/runtime/prose/A.vue +18 -23
  128. package/dist/runtime/prose/A.vue.d.ts +84 -0
  129. package/dist/runtime/prose/Blockquote.vue +18 -23
  130. package/dist/runtime/prose/Blockquote.vue.d.ts +84 -0
  131. package/dist/runtime/prose/Code.vue +23 -31
  132. package/dist/runtime/prose/Code.vue.d.ts +97 -0
  133. package/dist/runtime/prose/Em.vue +18 -23
  134. package/dist/runtime/prose/Em.vue.d.ts +84 -0
  135. package/dist/runtime/prose/H1.vue +18 -23
  136. package/dist/runtime/prose/H1.vue.d.ts +97 -0
  137. package/dist/runtime/prose/H2.vue +18 -23
  138. package/dist/runtime/prose/H2.vue.d.ts +123 -0
  139. package/dist/runtime/prose/H3.vue +18 -23
  140. package/dist/runtime/prose/H3.vue.d.ts +123 -0
  141. package/dist/runtime/prose/H4.vue +18 -23
  142. package/dist/runtime/prose/H4.vue.d.ts +123 -0
  143. package/dist/runtime/prose/H5.vue +18 -23
  144. package/dist/runtime/prose/H5.vue.d.ts +123 -0
  145. package/dist/runtime/prose/H6.vue +18 -23
  146. package/dist/runtime/prose/H6.vue.d.ts +123 -0
  147. package/dist/runtime/prose/Hr.vue +18 -19
  148. package/dist/runtime/prose/Hr.vue.d.ts +74 -0
  149. package/dist/runtime/prose/Img.vue +18 -23
  150. package/dist/runtime/prose/Img.vue.d.ts +77 -0
  151. package/dist/runtime/prose/Li.vue +18 -23
  152. package/dist/runtime/prose/Li.vue.d.ts +84 -0
  153. package/dist/runtime/prose/Ol.vue +18 -23
  154. package/dist/runtime/prose/Ol.vue.d.ts +84 -0
  155. package/dist/runtime/prose/P.vue +18 -23
  156. package/dist/runtime/prose/P.vue.d.ts +84 -0
  157. package/dist/runtime/prose/Pre.vue +28 -33
  158. package/dist/runtime/prose/Pre.vue.d.ts +117 -0
  159. package/dist/runtime/prose/Strong.vue +18 -23
  160. package/dist/runtime/prose/Strong.vue.d.ts +84 -0
  161. package/dist/runtime/prose/Table.vue +44 -54
  162. package/dist/runtime/prose/Table.vue.d.ts +144 -0
  163. package/dist/runtime/prose/Tbody.vue +18 -23
  164. package/dist/runtime/prose/Tbody.vue.d.ts +84 -0
  165. package/dist/runtime/prose/Td.vue +18 -23
  166. package/dist/runtime/prose/Td.vue.d.ts +84 -0
  167. package/dist/runtime/prose/Th.vue +18 -23
  168. package/dist/runtime/prose/Th.vue.d.ts +84 -0
  169. package/dist/runtime/prose/Thead.vue +18 -23
  170. package/dist/runtime/prose/Thead.vue.d.ts +84 -0
  171. package/dist/runtime/prose/Tr.vue +18 -23
  172. package/dist/runtime/prose/Tr.vue.d.ts +84 -0
  173. package/dist/runtime/prose/Ul.vue +18 -23
  174. package/dist/runtime/prose/Ul.vue.d.ts +84 -0
  175. package/dist/runtime/vue/components/Link.vue +201 -202
  176. package/dist/runtime/vue/components/Link.vue.d.ts +129 -0
  177. package/dist/runtime/vue/stubs.d.ts +3 -3
  178. package/dist/shared/{b24ui-nuxt.C1lGF53R.mjs → b24ui-nuxt.CS9Lf0os.mjs} +4 -3
  179. package/dist/types.d.mts +3 -5
  180. package/dist/unplugin.mjs +1 -1
  181. package/dist/vite.mjs +1 -1
  182. package/package.json +59 -32
  183. package/dist/meta.cjs +0 -72220
  184. package/dist/meta.d.cts +0 -72218
  185. package/dist/meta.d.ts +0 -72218
  186. package/dist/module.cjs +0 -59
  187. package/dist/module.d.cts +0 -15
  188. package/dist/module.d.ts +0 -15
  189. package/dist/shared/b24ui-nuxt.BVg3rkkG.cjs +0 -7720
  190. package/dist/types.d.ts +0 -7
  191. package/dist/unplugin.cjs +0 -236
  192. package/dist/unplugin.d.cts +0 -33
  193. package/dist/unplugin.d.ts +0 -33
  194. package/dist/vite.cjs +0 -21
  195. package/dist/vite.d.cts +0 -14
  196. package/dist/vite.d.ts +0 -14
@@ -1,176 +1,122 @@
1
- <!-- eslint-disable vue/block-tag-newline -->
2
- <script lang="ts">
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/b24ui/navigation-menu'
8
- import { tv } from '../utils/tv'
9
- import type { AvatarProps, BadgeProps, 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 appConfigNavigationMenu = _appConfig as AppConfig & { b24ui: { navigationMenu: Partial<typeof theme> } }
20
-
21
- const navigationMenu = tv({ extend: tv(theme), ...(appConfigNavigationMenu.b24ui?.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
- * @IconComponent
33
- */
34
- icon?: IconComponent
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
- * @IconComponent
43
- */
44
- trailingIcon?: IconComponent
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
- /**
55
- * With orientation=`horizontal` if `true` it will position the dropdown menu correctly
56
- */
57
- viewportRtl?: boolean
58
- onSelect?(e: Event): void
59
- [key: string]: any
60
- }
61
-
62
- type NavigationMenuVariants = VariantProps<typeof navigationMenu>
63
-
64
- export interface NavigationMenuProps<T extends ArrayOrNested<NavigationMenuItem> = ArrayOrNested<NavigationMenuItem>> extends Pick<NavigationMenuRootProps, 'modelValue' | 'defaultValue' | 'delayDuration' | 'disableClickTrigger' | 'disableHoverTrigger' | 'skipDelayDuration' | 'disablePointerLeaveClose' | 'unmountOnHide'> {
65
- /**
66
- * The element or component this component should render as.
67
- * @defaultValue 'div'
68
- */
69
- as?: any
70
- /**
71
- * The icon displayed to open the menu.
72
- * @defaultValue icons.chevronDown
73
- * @IconComponent
74
- */
75
- trailingIcon?: IconComponent
76
- /**
77
- * The icon displayed when the item is an external link.
78
- * Set to `false` to hide the external icon.
79
- * @defaultValue icons.external
80
- * @IconComponent
81
- */
82
- externalIcon?: boolean | IconComponent
83
- items?: T
84
- /**
85
- * @defaultValue 'primary'
86
- */
87
- color?: NavigationMenuVariants['color']
88
- /**
89
- * @defaultValue 'pill'
90
- */
91
- variant?: NavigationMenuVariants['variant']
92
- /**
93
- * The orientation of the menu.
94
- * @defaultValue 'horizontal'
95
- */
96
- orientation?: NavigationMenuRootProps['orientation']
97
- /**
98
- * Collapse the navigation menu to only show icons.
99
- * Only works when `orientation` is `vertical`.
100
- * @defaultValue false
101
- */
102
- collapsed?: boolean
103
- /** Display a line next to the active item. */
104
- highlight?: boolean
105
- /**
106
- * @defaultValue 'primary'
107
- */
108
- highlightColor?: NavigationMenuVariants['highlightColor']
109
- /**
110
- * The content of the menu.
111
- */
112
- content?: Omit<NavigationMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<NavigationMenuContentEmits>>
113
- /**
114
- * The orientation of the content.
115
- * Only works when `orientation` is `horizontal`.
116
- * @defaultValue 'vertical'
117
- */
118
- contentOrientation?: NavigationMenuVariants['contentOrientation']
119
- /**
120
- * Display an arrow alongside the menu.
121
- * @defaultValue false
122
- */
123
- arrow?: boolean
124
- /**
125
- * The key used to get the label from the item.
126
- * @defaultValue 'label'
127
- */
128
- labelKey?: keyof NestedItem<T>
129
- class?: any
130
- b24ui?: PartialString<typeof navigationMenu.slots>
131
- }
132
-
133
- export interface NavigationMenuEmits extends NavigationMenuRootEmits {}
134
-
135
- type SlotProps<T extends NavigationMenuItem> = (props: { item: T, index: number, active?: boolean }) => any
136
-
137
- export type NavigationMenuSlots<
138
- A extends ArrayOrNested<NavigationMenuItem> = ArrayOrNested<NavigationMenuItem>,
139
- T extends NestedItem<A> = NestedItem<A>
140
- > = {
141
- 'item': SlotProps<T>
142
- 'item-leading': SlotProps<T>
143
- 'item-label': SlotProps<T>
144
- 'item-trailing': SlotProps<T>
145
- 'item-content': SlotProps<T>
146
- } & DynamicSlots<MergeTypes<T>, 'leading' | 'label' | 'trailing' | 'content', { index: number, active?: boolean }>
147
-
1
+ <script>
2
+ import _appConfig from "#build/app.config";
3
+ import theme from "#build/b24ui/navigation-menu";
4
+ import { tv } from "../utils/tv";
5
+ const appConfigNavigationMenu = _appConfig;
6
+ const navigationMenu = tv({ extend: tv(theme), ...appConfigNavigationMenu.b24ui?.navigationMenu || {} });
148
7
  </script>
149
8
 
150
- <script setup lang="ts" generic="T extends ArrayOrNested<NavigationMenuItem>">
151
- import { computed, toRef } from 'vue'
152
- import { NavigationMenuRoot, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, useForwardPropsEmits } from 'reka-ui'
153
- import { createReusableTemplate } from '@vueuse/core'
154
- import { get, isArrayOfArray } from '../utils'
155
- import { pickLinkProps } from '../utils/link'
156
- import icons from '../dictionary/icons'
157
- import B24LinkBase from './LinkBase.vue'
158
- import B24Link from './Link.vue'
159
- import B24Avatar from './Avatar.vue'
160
- import B24Badge from './Badge.vue'
161
- import B24Collapsible from './Collapsible.vue'
162
-
163
- const props = withDefaults(defineProps<NavigationMenuProps<T>>(), {
164
- orientation: 'horizontal',
165
- contentOrientation: 'vertical',
166
- externalIcon: true,
167
- delayDuration: 0,
168
- unmountOnHide: true,
169
- labelKey: 'label'
170
- })
171
- const emits = defineEmits<NavigationMenuEmits>()
172
- const slots = defineSlots<NavigationMenuSlots<T>>()
173
-
9
+ <script setup>
10
+ import { computed, toRef } from "vue";
11
+ import { useForwardPropsEmits } from "reka-ui";
12
+ import { createReusableTemplate } from "@vueuse/core";
13
+ import { isArrayOfArray } from "../utils";
14
+ const props = defineProps({
15
+ as: {
16
+ type: null,
17
+ required: false
18
+ },
19
+ trailingIcon: {
20
+ type: [Function, Object],
21
+ required: false
22
+ },
23
+ externalIcon: {
24
+ type: [Boolean, Function, Object],
25
+ required: false,
26
+ default: true
27
+ },
28
+ items: {
29
+ type: null,
30
+ required: false
31
+ },
32
+ color: {
33
+ type: null,
34
+ required: false
35
+ },
36
+ variant: {
37
+ type: null,
38
+ required: false
39
+ },
40
+ orientation: {
41
+ type: null,
42
+ required: false,
43
+ default: "horizontal"
44
+ },
45
+ collapsed: {
46
+ type: Boolean,
47
+ required: false
48
+ },
49
+ highlight: {
50
+ type: Boolean,
51
+ required: false
52
+ },
53
+ highlightColor: {
54
+ type: null,
55
+ required: false
56
+ },
57
+ content: {
58
+ type: Object,
59
+ required: false
60
+ },
61
+ contentOrientation: {
62
+ type: null,
63
+ required: false,
64
+ default: "vertical"
65
+ },
66
+ arrow: {
67
+ type: Boolean,
68
+ required: false
69
+ },
70
+ labelKey: {
71
+ type: null,
72
+ required: false,
73
+ default: "label"
74
+ },
75
+ class: {
76
+ type: null,
77
+ required: false
78
+ },
79
+ b24ui: {
80
+ type: null,
81
+ required: false
82
+ },
83
+ modelValue: {
84
+ type: String,
85
+ required: false
86
+ },
87
+ defaultValue: {
88
+ type: String,
89
+ required: false
90
+ },
91
+ delayDuration: {
92
+ type: Number,
93
+ required: false,
94
+ default: 0
95
+ },
96
+ disableClickTrigger: {
97
+ type: Boolean,
98
+ required: false
99
+ },
100
+ disableHoverTrigger: {
101
+ type: Boolean,
102
+ required: false
103
+ },
104
+ skipDelayDuration: {
105
+ type: Number,
106
+ required: false
107
+ },
108
+ disablePointerLeaveClose: {
109
+ type: Boolean,
110
+ required: false
111
+ },
112
+ unmountOnHide: {
113
+ type: Boolean,
114
+ required: false,
115
+ default: true
116
+ }
117
+ });
118
+ const emits = defineEmits(["update:modelValue"]);
119
+ const slots = defineSlots();
174
120
  const rootProps = useForwardPropsEmits(computed(() => ({
175
121
  as: props.as,
176
122
  modelValue: props.modelValue,
@@ -182,25 +128,20 @@ const rootProps = useForwardPropsEmits(computed(() => ({
182
128
  disableHoverTrigger: props.disableHoverTrigger,
183
129
  disablePointerLeaveClose: props.disablePointerLeaveClose,
184
130
  unmountOnHide: props.unmountOnHide
185
- })), emits)
186
-
187
- const contentProps = toRef(() => props.content)
188
-
189
- const [DefineLinkTemplate, ReuseLinkTemplate] = createReusableTemplate<
190
- { item: NavigationMenuItem, index: number, active?: boolean },
191
- NavigationMenuSlots<T>
192
- >()
193
- const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate<
194
- { item: NavigationMenuItem, index: number, level?: number },
195
- NavigationMenuSlots<T>
196
- >({
131
+ })), emits);
132
+ const contentProps = toRef(() => props.content);
133
+ const [DefineLinkTemplate, ReuseLinkTemplate] = createReusableTemplate();
134
+ const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate({
197
135
  props: {
198
136
  item: Object,
199
137
  index: Number,
200
- level: Number
138
+ // @memo problem compile
139
+ level: {
140
+ type: Number,
141
+ default: 0
142
+ }
201
143
  }
202
- })
203
-
144
+ });
204
145
  const b24ui = computed(() => navigationMenu({
205
146
  orientation: props.orientation,
206
147
  contentOrientation: props.contentOrientation,
@@ -209,36 +150,31 @@ const b24ui = computed(() => navigationMenu({
209
150
  variant: props.variant,
210
151
  highlight: props.highlight,
211
152
  highlightColor: props.highlightColor || props.color
212
- }))
213
-
214
- const lists = computed<NavigationMenuItem[][]>(() =>
215
- props.items?.length
216
- ? isArrayOfArray(props.items)
217
- ? props.items
218
- : [props.items]
219
- : []
220
- )
153
+ }));
154
+ const lists = computed(
155
+ () => props.items?.length ? isArrayOfArray(props.items) ? props.items : [props.items] : []
156
+ );
221
157
  </script>
222
158
 
223
159
  <template>
224
160
  <DefineLinkTemplate v-slot="{ item, active, index }">
225
- <slot :name="((item.slot || 'item') as keyof NavigationMenuSlots<T>)" :item="item" :index="index">
161
+ <slot :name="item.slot || 'item'" :item="item" :index="index">
226
162
  <span :class="b24ui.linkLabelWrapper({ class: props.b24ui?.linkLabelWrapper, active })">
227
- <slot :name="((item.slot ? `${item.slot}-leading` : 'item-leading') as keyof NavigationMenuSlots<T>)" :item="item" :active="active" :index="index">
163
+ <slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="item" :active="active" :index="index">
228
164
  <Component
229
165
  :is="item.icon"
230
166
  v-if="item.icon"
231
167
  :class="b24ui.linkLeadingIcon({ class: props.b24ui?.linkLeadingIcon, active, disabled: !!item.disabled })"
232
168
  />
233
- <B24Avatar v-else-if="item.avatar" :size="((props.b24ui?.linkLeadingAvatarSize || b24ui.linkLeadingAvatarSize()) as AvatarProps['size'])" v-bind="item.avatar" :class="b24ui.linkLeadingAvatar({ class: props.b24ui?.linkLeadingAvatar, active, disabled: !!item.disabled })" />
169
+ <B24Avatar v-else-if="item.avatar" :size="props.b24ui?.linkLeadingAvatarSize || b24ui.linkLeadingAvatarSize()" v-bind="item.avatar" :class="b24ui.linkLeadingAvatar({ class: props.b24ui?.linkLeadingAvatar, active, disabled: !!item.disabled })" />
234
170
  </slot>
235
171
 
236
172
  <span
237
- v-if="(!collapsed || orientation !== 'vertical') && (get(item, props.labelKey as string) || !!slots[(item.slot ? `${item.slot}-label` : 'item-label') as keyof NavigationMenuSlots<T>])"
173
+ v-if="(!collapsed || orientation !== 'vertical') && (get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label'])"
238
174
  :class="b24ui.linkLabel({ class: props.b24ui?.linkLabel, active })"
239
175
  >
240
- <slot :name="((item.slot ? `${item.slot}-label` : 'item-label') as keyof NavigationMenuSlots<T>)" :item="item" :active="active" :index="index">
241
- {{ get(item, props.labelKey as string) }}
176
+ <slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="active" :index="index">
177
+ {{ get(item, props.labelKey) }}
242
178
  </slot>
243
179
 
244
180
  <Component
@@ -248,11 +184,11 @@ const lists = computed<NavigationMenuItem[][]>(() =>
248
184
  />
249
185
  </span>
250
186
  </span>
251
- <span v-if="(!collapsed || orientation !== 'vertical') && (item.badge || (orientation === 'horizontal' && (item.children?.length || !!slots[(item.slot ? `${item.slot}-content` : 'item-content') as keyof NavigationMenuSlots<T>])) || (orientation === 'vertical' && item.children?.length) || item.trailingIcon || !!slots[(item.slot ? `${item.slot}-trailing` : 'item-trailing') as keyof NavigationMenuSlots<T>])" :class="b24ui.linkTrailing({ class: props.b24ui?.linkTrailing })">
252
- <slot :name="((item.slot ? `${item.slot}-trailing` : 'item-trailing') as keyof NavigationMenuSlots<T>)" :item="item" :active="active" :index="index">
187
+ <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="b24ui.linkTrailing({ class: props.b24ui?.linkTrailing })">
188
+ <slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="active" :index="index">
253
189
  <Component
254
190
  :is="item.trailingIcon || trailingIcon || icons.chevronDown"
255
- v-if="(orientation === 'horizontal' && (item.children?.length || !!slots[(item.slot ? `${item.slot}-content` : 'item-content') as keyof NavigationMenuSlots<T>])) || (orientation === 'vertical' && item.children?.length)"
191
+ v-if="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) || orientation === 'vertical' && item.children?.length"
256
192
  :class="b24ui.linkTrailingIcon({ class: props.b24ui?.linkTrailingIcon, active })"
257
193
  />
258
194
  <Component
@@ -266,8 +202,8 @@ const lists = computed<NavigationMenuItem[][]>(() =>
266
202
  color="danger"
267
203
  depth="dark"
268
204
  :use-fill="true"
269
- :size="((props.b24ui?.linkTrailingBadgeSize || b24ui.linkTrailingBadgeSize()) as BadgeProps['size'])"
270
- v-bind="(typeof item.badge === 'string' || typeof item.badge === 'number') ? { label: item.badge } : item.badge"
205
+ :size="props.b24ui?.linkTrailingBadgeSize || b24ui.linkTrailingBadgeSize()"
206
+ v-bind="typeof item.badge === 'string' || typeof item.badge === 'number' ? { label: item.badge } : item.badge"
271
207
  :class="b24ui.linkTrailingBadge({ class: props.b24ui?.linkTrailingBadge })"
272
208
  />
273
209
  </slot>
@@ -275,38 +211,38 @@ const lists = computed<NavigationMenuItem[][]>(() =>
275
211
  </slot>
276
212
  </DefineLinkTemplate>
277
213
 
278
- <DefineItemTemplate v-slot="{ item, index, level = 0 }">
214
+ <DefineItemTemplate v-slot="{ item, index, level }">
279
215
  <component
280
- :is="(orientation === 'vertical' && item.children?.length && !collapsed) ? B24Collapsible : NavigationMenuItem"
216
+ :is="orientation === 'vertical' && item.children?.length && !collapsed ? B24Collapsible : NavigationMenuItem"
281
217
  as="li"
282
218
  :value="item.value || String(index)"
283
219
  :default-open="item.defaultOpen"
284
- :unmount-on-hide="(orientation === 'vertical' && item.children?.length && !collapsed) ? unmountOnHide : undefined"
220
+ :unmount-on-hide="orientation === 'vertical' && item.children?.length && !collapsed ? unmountOnHide : void 0"
285
221
  :open="item.open"
286
222
  >
287
223
  <div v-if="orientation === 'vertical' && item.type === 'label'" :class="b24ui.label({ class: props.b24ui?.label })">
288
224
  <ReuseLinkTemplate :item="item" :index="index" />
289
225
  </div>
290
- <B24Link v-else-if="item.type !== 'label'" v-slot="{ active, ...slotProps }" v-bind="(orientation === 'vertical' && item.children?.length && !collapsed) ? {} : pickLinkProps(item as Omit<NavigationMenuItem, 'type'>)" custom>
226
+ <B24Link v-else-if="item.type !== 'label'" v-slot="{ active, ...slotProps }" v-bind="orientation === 'vertical' && item.children?.length && !collapsed ? {} : pickLinkProps(item)" custom>
291
227
  <component
292
- :is="(orientation === 'horizontal' && (item.children?.length || !!slots[(item.slot ? `${item.slot}-content` : 'item-content') as keyof NavigationMenuSlots<T>])) ? NavigationMenuTrigger : NavigationMenuLink"
228
+ :is="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) ? NavigationMenuTrigger : NavigationMenuLink"
293
229
  as-child
294
230
  :active="active || item.active"
295
231
  :disabled="item.disabled"
296
232
  @select="item.onSelect"
297
233
  >
298
- <B24LinkBase v-bind="slotProps" :class="b24ui.link({ class: [props.b24ui?.link, item.class], active: active || item.active, disabled: !!item.disabled, level: orientation === 'horizontal' || level > 0 })">
234
+ <B24LinkBase v-bind="slotProps" :class="b24ui.link({ class: [props.b24ui?.link, item.class], active: active || item.active, disabled: !!item.disabled, level: orientation === 'horizontal' || (level || 0) > 0 })">
299
235
  <ReuseLinkTemplate :item="item" :active="active || item.active" :index="index" />
300
236
  </B24LinkBase>
301
237
  </component>
302
238
 
303
239
  <NavigationMenuContent
304
- v-if="orientation === 'horizontal' && (item.children?.length || !!slots[(item.slot ? `${item.slot}-content` : 'item-content') as keyof NavigationMenuSlots<T>])"
240
+ v-if="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content'])"
305
241
  v-bind="contentProps"
306
242
  :data-viewport="item.viewportRtl ? 'rtl' : 'ltr'"
307
243
  :class="b24ui.content({ class: props.b24ui?.content })"
308
244
  >
309
- <slot :name="((item.slot ? `${item.slot}-content` : 'item-content') as keyof NavigationMenuSlots<T>)" :item="item" :active="active" :index="index">
245
+ <slot :name="item.slot ? `${item.slot}-content` : 'item-content'" :item="item" :active="active" :index="index">
310
246
  <ul :class="b24ui.childList({ class: props.b24ui?.childList })">
311
247
  <li v-for="(childItem, childIndex) in item.children" :key="childIndex" :class="b24ui.childItem({ class: props.b24ui?.childItem })">
312
248
  <B24Link v-slot="{ active: childActive, ...childSlotProps }" v-bind="pickLinkProps(childItem)" custom>
@@ -320,7 +256,7 @@ const lists = computed<NavigationMenuItem[][]>(() =>
320
256
 
321
257
  <div :class="b24ui.childLinkWrapper({ class: props.b24ui?.childLinkWrapper })">
322
258
  <p :class="b24ui.childLinkLabel({ class: props.b24ui?.childLinkLabel, active: childActive })">
323
- {{ get(childItem, props.labelKey as string) }}
259
+ {{ get(childItem, props.labelKey) }}
324
260
 
325
261
  <Component
326
262
  :is="typeof externalIcon === 'string' ? externalIcon : icons.external"
@@ -348,7 +284,7 @@ const lists = computed<NavigationMenuItem[][]>(() =>
348
284
  :key="childIndex"
349
285
  :item="childItem"
350
286
  :index="childIndex"
351
- :level="level + 1"
287
+ :level="(level || 0) + 1"
352
288
  :class="b24ui.childItem({ class: props.b24ui?.childItem })"
353
289
  />
354
290
  </ul>