@bitrix24/b24ui-nuxt 0.5.10 → 0.5.11
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/dist/meta.cjs +72112 -0
- package/dist/meta.d.cts +72110 -0
- package/dist/meta.d.mts +5060 -5060
- package/dist/meta.d.ts +72110 -0
- package/dist/meta.mjs +5060 -5060
- package/dist/module.cjs +63 -0
- package/dist/module.d.cts +15 -0
- package/dist/module.d.ts +15 -0
- package/dist/module.json +3 -3
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/Advice.vue +54 -47
- package/dist/runtime/components/Alert.vue +96 -71
- package/dist/runtime/components/App.vue +34 -37
- package/dist/runtime/components/Avatar.vue +81 -69
- package/dist/runtime/components/AvatarGroup.vue +76 -53
- package/dist/runtime/components/Badge.vue +83 -83
- package/dist/runtime/components/Button.vue +157 -220
- package/dist/runtime/components/ButtonGroup.vue +51 -35
- package/dist/runtime/components/Calendar.vue +152 -186
- package/dist/runtime/components/Checkbox.vue +73 -84
- package/dist/runtime/components/Chip.vue +74 -59
- package/dist/runtime/components/Collapsible.vue +41 -44
- package/dist/runtime/components/Container.vue +27 -18
- package/dist/runtime/components/Countdown.vue +378 -198
- package/dist/runtime/components/DescriptionList.vue +149 -102
- package/dist/runtime/components/DropdownMenu.vue +139 -83
- package/dist/runtime/components/DropdownMenuContent.vue +84 -137
- package/dist/runtime/components/Form.vue +216 -162
- package/dist/runtime/components/FormField.vue +80 -76
- package/dist/runtime/components/Input.vue +179 -160
- package/dist/runtime/components/InputMenu.vue +380 -300
- package/dist/runtime/components/InputNumber.vue +175 -178
- package/dist/runtime/components/Kbd.vue +45 -33
- package/dist/runtime/components/Link.vue +173 -179
- package/dist/runtime/components/LinkBase.vue +42 -64
- package/dist/runtime/components/Modal.vue +127 -105
- package/dist/runtime/components/ModalDialogClose.vue +8 -4
- package/dist/runtime/components/Navbar.vue +33 -24
- package/dist/runtime/components/NavbarDivider.vue +33 -24
- package/dist/runtime/components/NavbarSection.vue +33 -24
- package/dist/runtime/components/NavbarSpacer.vue +33 -24
- package/dist/runtime/components/NavigationMenu.vue +210 -144
- package/dist/runtime/components/OverlayProvider.vue +17 -13
- package/dist/runtime/components/Popover.vue +81 -81
- package/dist/runtime/components/Progress.vue +136 -109
- package/dist/runtime/components/RadioGroup.vue +134 -120
- package/dist/runtime/components/Range.vue +85 -94
- package/dist/runtime/components/Select.vue +260 -212
- package/dist/runtime/components/SelectMenu.vue +365 -272
- package/dist/runtime/components/Separator.vue +71 -61
- package/dist/runtime/components/Sidebar.vue +33 -24
- package/dist/runtime/components/SidebarBody.vue +38 -30
- package/dist/runtime/components/SidebarFooter.vue +33 -24
- package/dist/runtime/components/SidebarHeader.vue +33 -24
- package/dist/runtime/components/SidebarHeading.vue +33 -24
- package/dist/runtime/components/SidebarLayout.vue +70 -40
- package/dist/runtime/components/SidebarSection.vue +33 -24
- package/dist/runtime/components/SidebarSpacer.vue +33 -24
- package/dist/runtime/components/Skeleton.vue +22 -17
- package/dist/runtime/components/Slideover.vue +131 -108
- package/dist/runtime/components/StackedLayout.vue +73 -40
- package/dist/runtime/components/Switch.vue +95 -100
- package/dist/runtime/components/Tabs.vue +107 -81
- package/dist/runtime/components/Textarea.vue +201 -177
- package/dist/runtime/components/Toast.vue +105 -94
- package/dist/runtime/components/Toaster.vue +116 -94
- package/dist/runtime/components/Tooltip.vue +64 -78
- package/dist/runtime/components/content/TableWrapper.vue +70 -58
- 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 +1 -1
- package/dist/runtime/prose/A.vue +23 -18
- package/dist/runtime/prose/Blockquote.vue +23 -18
- package/dist/runtime/prose/Code.vue +31 -23
- package/dist/runtime/prose/Em.vue +23 -18
- package/dist/runtime/prose/H1.vue +23 -18
- package/dist/runtime/prose/H2.vue +23 -18
- package/dist/runtime/prose/H3.vue +23 -18
- package/dist/runtime/prose/H4.vue +23 -18
- package/dist/runtime/prose/H5.vue +23 -18
- package/dist/runtime/prose/H6.vue +23 -18
- package/dist/runtime/prose/Hr.vue +19 -18
- package/dist/runtime/prose/Img.vue +23 -18
- package/dist/runtime/prose/Li.vue +23 -18
- package/dist/runtime/prose/Ol.vue +23 -18
- package/dist/runtime/prose/P.vue +23 -18
- package/dist/runtime/prose/Pre.vue +33 -28
- package/dist/runtime/prose/Strong.vue +23 -18
- package/dist/runtime/prose/Table.vue +54 -44
- package/dist/runtime/prose/Tbody.vue +23 -18
- package/dist/runtime/prose/Td.vue +23 -18
- package/dist/runtime/prose/Th.vue +23 -18
- package/dist/runtime/prose/Thead.vue +23 -18
- package/dist/runtime/prose/Tr.vue +23 -18
- package/dist/runtime/prose/Ul.vue +23 -18
- package/dist/runtime/vue/components/Link.vue +202 -201
- package/dist/shared/b24ui-nuxt.DrKwIWoc.cjs +7721 -0
- package/dist/types.d.mts +5 -3
- package/dist/types.d.ts +7 -0
- package/dist/unplugin.cjs +236 -0
- package/dist/unplugin.d.cts +33 -0
- package/dist/unplugin.d.ts +33 -0
- package/dist/vite.cjs +21 -0
- package/dist/vite.d.cts +14 -0
- package/dist/vite.d.ts +14 -0
- package/package.json +25 -13
- package/dist/runtime/components/Advice.vue.d.ts +0 -170
- package/dist/runtime/components/Alert.vue.d.ts +0 -464
- package/dist/runtime/components/App.vue.d.ts +0 -23
- package/dist/runtime/components/Avatar.vue.d.ts +0 -281
- package/dist/runtime/components/AvatarGroup.vue.d.ts +0 -204
- package/dist/runtime/components/Badge.vue.d.ts +0 -517
- package/dist/runtime/components/Button.vue.d.ts +0 -640
- package/dist/runtime/components/ButtonGroup.vue.d.ts +0 -116
- package/dist/runtime/components/Calendar.vue.d.ts +0 -437
- package/dist/runtime/components/Checkbox.vue.d.ts +0 -354
- package/dist/runtime/components/Chip.vue.d.ts +0 -271
- package/dist/runtime/components/Collapsible.vue.d.ts +0 -118
- package/dist/runtime/components/Container.vue.d.ts +0 -27
- package/dist/runtime/components/Countdown.vue.d.ts +0 -356
- package/dist/runtime/components/DescriptionList.vue.d.ts +0 -379
- package/dist/runtime/components/DropdownMenu.vue.d.ts +0 -533
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +0 -228
- package/dist/runtime/components/Form.vue.d.ts +0 -55
- package/dist/runtime/components/FormField.vue.d.ts +0 -282
- package/dist/runtime/components/Input.vue.d.ts +0 -755
- package/dist/runtime/components/InputMenu.vue.d.ts +0 -1504
- package/dist/runtime/components/InputNumber.vue.d.ts +0 -658
- package/dist/runtime/components/Kbd.vue.d.ts +0 -109
- package/dist/runtime/components/Link.vue.d.ts +0 -129
- package/dist/runtime/components/LinkBase.vue.d.ts +0 -48
- package/dist/runtime/components/Modal.vue.d.ts +0 -327
- package/dist/runtime/components/ModalDialogClose.vue.d.ts +0 -10
- package/dist/runtime/components/Navbar.vue.d.ts +0 -101
- package/dist/runtime/components/NavbarDivider.vue.d.ts +0 -101
- package/dist/runtime/components/NavbarSection.vue.d.ts +0 -101
- package/dist/runtime/components/NavbarSpacer.vue.d.ts +0 -101
- package/dist/runtime/components/NavigationMenu.vue.d.ts +0 -824
- package/dist/runtime/components/OverlayProvider.vue.d.ts +0 -2
- package/dist/runtime/components/Popover.vue.d.ts +0 -147
- package/dist/runtime/components/Progress.vue.d.ts +0 -592
- package/dist/runtime/components/RadioGroup.vue.d.ts +0 -723
- package/dist/runtime/components/Range.vue.d.ts +0 -417
- package/dist/runtime/components/Select.vue.d.ts +0 -1200
- package/dist/runtime/components/SelectMenu.vue.d.ts +0 -1298
- package/dist/runtime/components/Separator.vue.d.ts +0 -400
- package/dist/runtime/components/Sidebar.vue.d.ts +0 -101
- package/dist/runtime/components/SidebarBody.vue.d.ts +0 -90
- package/dist/runtime/components/SidebarFooter.vue.d.ts +0 -101
- package/dist/runtime/components/SidebarHeader.vue.d.ts +0 -101
- package/dist/runtime/components/SidebarHeading.vue.d.ts +0 -101
- package/dist/runtime/components/SidebarLayout.vue.d.ts +0 -222
- package/dist/runtime/components/SidebarSection.vue.d.ts +0 -101
- package/dist/runtime/components/SidebarSpacer.vue.d.ts +0 -101
- package/dist/runtime/components/Skeleton.vue.d.ts +0 -26
- package/dist/runtime/components/Slideover.vue.d.ts +0 -360
- package/dist/runtime/components/StackedLayout.vue.d.ts +0 -192
- package/dist/runtime/components/Switch.vue.d.ts +0 -587
- package/dist/runtime/components/Tabs.vue.d.ts +0 -453
- package/dist/runtime/components/Textarea.vue.d.ts +0 -601
- package/dist/runtime/components/Toast.vue.d.ts +0 -438
- package/dist/runtime/components/Toaster.vue.d.ts +0 -219
- package/dist/runtime/components/Tooltip.vue.d.ts +0 -186
- package/dist/runtime/components/content/TableWrapper.vue.d.ts +0 -237
- package/dist/runtime/prose/A.vue.d.ts +0 -84
- package/dist/runtime/prose/Blockquote.vue.d.ts +0 -84
- package/dist/runtime/prose/Code.vue.d.ts +0 -97
- package/dist/runtime/prose/Em.vue.d.ts +0 -84
- package/dist/runtime/prose/H1.vue.d.ts +0 -97
- package/dist/runtime/prose/H2.vue.d.ts +0 -123
- package/dist/runtime/prose/H3.vue.d.ts +0 -123
- package/dist/runtime/prose/H4.vue.d.ts +0 -123
- package/dist/runtime/prose/H5.vue.d.ts +0 -123
- package/dist/runtime/prose/H6.vue.d.ts +0 -123
- package/dist/runtime/prose/Hr.vue.d.ts +0 -74
- package/dist/runtime/prose/Img.vue.d.ts +0 -77
- package/dist/runtime/prose/Li.vue.d.ts +0 -84
- package/dist/runtime/prose/Ol.vue.d.ts +0 -84
- package/dist/runtime/prose/P.vue.d.ts +0 -84
- package/dist/runtime/prose/Pre.vue.d.ts +0 -117
- package/dist/runtime/prose/Strong.vue.d.ts +0 -84
- package/dist/runtime/prose/Table.vue.d.ts +0 -144
- package/dist/runtime/prose/Tbody.vue.d.ts +0 -84
- package/dist/runtime/prose/Td.vue.d.ts +0 -84
- package/dist/runtime/prose/Th.vue.d.ts +0 -84
- package/dist/runtime/prose/Thead.vue.d.ts +0 -84
- package/dist/runtime/prose/Tr.vue.d.ts +0 -84
- package/dist/runtime/prose/Ul.vue.d.ts +0 -84
- package/dist/runtime/vue/components/Link.vue.d.ts +0 -129
|
@@ -1,134 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
<!-- eslint-disable vue/block-tag-newline -->
|
|
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'
|
|
8
|
+
|
|
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
|
+
}
|
|
5
34
|
</script>
|
|
6
35
|
|
|
7
|
-
<script setup>
|
|
8
|
-
import { computed } from
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
type: null,
|
|
45
|
-
required: true
|
|
46
|
-
},
|
|
47
|
-
b24uiOverride: {
|
|
48
|
-
type: null,
|
|
49
|
-
required: false
|
|
50
|
-
},
|
|
51
|
-
loop: {
|
|
52
|
-
type: Boolean,
|
|
53
|
-
required: false
|
|
54
|
-
},
|
|
55
|
-
side: {
|
|
56
|
-
type: null,
|
|
57
|
-
required: false
|
|
58
|
-
},
|
|
59
|
-
sideOffset: {
|
|
60
|
-
type: Number,
|
|
61
|
-
required: false
|
|
62
|
-
},
|
|
63
|
-
align: {
|
|
64
|
-
type: null,
|
|
65
|
-
required: false
|
|
66
|
-
},
|
|
67
|
-
alignOffset: {
|
|
68
|
-
type: Number,
|
|
69
|
-
required: false
|
|
70
|
-
},
|
|
71
|
-
avoidCollisions: {
|
|
72
|
-
type: Boolean,
|
|
73
|
-
required: false
|
|
74
|
-
},
|
|
75
|
-
collisionBoundary: {
|
|
76
|
-
type: null,
|
|
77
|
-
required: false
|
|
78
|
-
},
|
|
79
|
-
collisionPadding: {
|
|
80
|
-
type: [Number, Object],
|
|
81
|
-
required: false
|
|
82
|
-
},
|
|
83
|
-
arrowPadding: {
|
|
84
|
-
type: Number,
|
|
85
|
-
required: false
|
|
86
|
-
},
|
|
87
|
-
sticky: {
|
|
88
|
-
type: String,
|
|
89
|
-
required: false
|
|
90
|
-
},
|
|
91
|
-
hideWhenDetached: {
|
|
92
|
-
type: Boolean,
|
|
93
|
-
required: false
|
|
94
|
-
},
|
|
95
|
-
positionStrategy: {
|
|
96
|
-
type: String,
|
|
97
|
-
required: false
|
|
98
|
-
},
|
|
99
|
-
updatePositionStrategy: {
|
|
100
|
-
type: String,
|
|
101
|
-
required: false
|
|
102
|
-
},
|
|
103
|
-
disableUpdateOnLayoutShift: {
|
|
104
|
-
type: Boolean,
|
|
105
|
-
required: false
|
|
106
|
-
},
|
|
107
|
-
prioritizePosition: {
|
|
108
|
-
type: Boolean,
|
|
109
|
-
required: false
|
|
110
|
-
},
|
|
111
|
-
reference: {
|
|
112
|
-
type: null,
|
|
113
|
-
required: false
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
const emits = defineEmits(["escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "closeAutoFocus"]);
|
|
117
|
-
const slots = defineSlots();
|
|
118
|
-
const { dir } = useLocale();
|
|
119
|
-
const contentProps = useForwardPropsEmits(reactiveOmit(props, "sub", "items", "portal", "labelKey", "checkedIcon", "externalIcon", "class", "b24ui", "b24uiOverride"), emits);
|
|
120
|
-
const proxySlots = omit(slots, ["default"]);
|
|
121
|
-
const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate();
|
|
122
|
-
const childrenIcon = computed(() => dir.value === "rtl" ? icons.chevronLeft : icons.chevronRight);
|
|
123
|
-
const groups = computed(
|
|
124
|
-
() => props.items?.length ? isArrayOfArray(props.items) ? props.items : [props.items] : []
|
|
125
|
-
);
|
|
36
|
+
<script setup lang="ts" generic="T extends ArrayOrNested<DropdownMenuItem>">
|
|
37
|
+
import { computed } from 'vue'
|
|
38
|
+
import { DropdownMenu } from 'reka-ui/namespaced'
|
|
39
|
+
import { useForwardPropsEmits } from 'reka-ui'
|
|
40
|
+
import { reactiveOmit, createReusableTemplate } from '@vueuse/core'
|
|
41
|
+
import { useLocale } from '../composables/useLocale'
|
|
42
|
+
import { omit, get, isArrayOfArray } from '../utils'
|
|
43
|
+
import { pickLinkProps } from '../utils/link'
|
|
44
|
+
import icons from '../dictionary/icons'
|
|
45
|
+
import B24LinkBase from './LinkBase.vue'
|
|
46
|
+
import B24Link from './Link.vue'
|
|
47
|
+
import B24Avatar from './Avatar.vue'
|
|
48
|
+
import B24Kbd from './Kbd.vue'
|
|
49
|
+
// eslint-disable-next-line import/no-self-import
|
|
50
|
+
import B24DropdownMenuContent from './DropdownMenuContent.vue'
|
|
51
|
+
|
|
52
|
+
const props = defineProps<DropdownMenuContentProps<T>>()
|
|
53
|
+
const emits = defineEmits<DropdownMenuContentEmits>()
|
|
54
|
+
const slots = defineSlots<DropdownMenuContentSlots<T>>()
|
|
55
|
+
|
|
56
|
+
const { dir } = useLocale()
|
|
57
|
+
const contentProps = useForwardPropsEmits(reactiveOmit(props, 'sub', 'items', 'portal', 'labelKey', 'checkedIcon', 'externalIcon', 'class', 'b24ui', 'b24uiOverride'), emits)
|
|
58
|
+
const proxySlots = omit(slots, ['default'])
|
|
59
|
+
const getLabel = (item: DropdownMenuItem) => {
|
|
60
|
+
return get(item, props.labelKey as string)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate<{ item: DropdownMenuItem, active?: boolean, index: number }>()
|
|
64
|
+
|
|
65
|
+
const childrenIcon = computed(() => dir.value === 'rtl' ? icons.chevronLeft : icons.chevronRight)
|
|
66
|
+
const groups = computed<DropdownMenuItem[][]>(() =>
|
|
67
|
+
props.items?.length
|
|
68
|
+
? isArrayOfArray(props.items)
|
|
69
|
+
? props.items
|
|
70
|
+
: [props.items]
|
|
71
|
+
: []
|
|
72
|
+
)
|
|
126
73
|
</script>
|
|
127
74
|
|
|
128
75
|
<template>
|
|
129
76
|
<DefineItemTemplate v-slot="{ item, active, index }">
|
|
130
|
-
<slot :name="item.slot || 'item'" :item="item" :index="index">
|
|
131
|
-
<slot :name="item.slot ? `${item.slot}-leading
|
|
77
|
+
<slot :name="((item.slot || 'item') as keyof DropdownMenuContentSlots<T>)" :item="(item as Extract<NestedItem<T>, { slot: string; }>)" :index="index">
|
|
78
|
+
<slot :name="((item.slot ? `${item.slot}-leading`: 'item-leading') as keyof DropdownMenuContentSlots<T>)" :item="(item as Extract<NestedItem<T>, { slot: string; }>)" :active="active" :index="index">
|
|
132
79
|
<Component
|
|
133
80
|
:is="icons.loading"
|
|
134
81
|
v-if="item.loading"
|
|
@@ -141,15 +88,15 @@ const groups = computed(
|
|
|
141
88
|
/>
|
|
142
89
|
<B24Avatar
|
|
143
90
|
v-else-if="item.avatar"
|
|
144
|
-
:size="props.b24uiOverride?.itemLeadingAvatarSize || b24ui.itemLeadingAvatarSize()"
|
|
91
|
+
:size="((props.b24uiOverride?.itemLeadingAvatarSize || b24ui.itemLeadingAvatarSize()) as AvatarProps['size'])"
|
|
145
92
|
v-bind="item.avatar"
|
|
146
93
|
:class="b24ui.itemLeadingAvatar({ class: b24uiOverride?.itemLeadingAvatar, active })"
|
|
147
94
|
/>
|
|
148
95
|
</slot>
|
|
149
96
|
|
|
150
|
-
<span v-if="
|
|
151
|
-
<slot :name="item.slot ? `${item.slot}-label
|
|
152
|
-
{{
|
|
97
|
+
<span v-if="getLabel(item) || !!slots[(item.slot ? `${item.slot}-label`: 'item-label') as keyof DropdownMenuContentSlots<T>]" :class="b24ui.itemLabel({ class: b24uiOverride?.itemLabel, active })">
|
|
98
|
+
<slot :name="((item.slot ? `${item.slot}-label`: 'item-label') as keyof DropdownMenuContentSlots<T>)" :item="(item as Extract<NestedItem<T>, { slot: string; }>)" :active="active" :index="index">
|
|
99
|
+
{{ getLabel(item) }}
|
|
153
100
|
</slot>
|
|
154
101
|
<Component
|
|
155
102
|
:is="typeof externalIcon !== 'boolean' ? externalIcon : icons.external"
|
|
@@ -159,14 +106,14 @@ const groups = computed(
|
|
|
159
106
|
</span>
|
|
160
107
|
|
|
161
108
|
<span :class="b24ui.itemTrailing({ class: b24uiOverride?.itemTrailing })">
|
|
162
|
-
<slot :name="item.slot ? `${item.slot}-trailing
|
|
109
|
+
<slot :name="((item.slot ? `${item.slot}-trailing`: 'item-trailing') as keyof DropdownMenuContentSlots<T>)" :item="(item as Extract<NestedItem<T>, { slot: string; }>)" :active="active" :index="index">
|
|
163
110
|
<Component
|
|
164
111
|
:is="childrenIcon"
|
|
165
112
|
v-if="item.children?.length"
|
|
166
113
|
:class="b24ui.itemTrailingIcon({ class: b24uiOverride?.itemTrailingIcon, color: item?.color, active })"
|
|
167
114
|
/>
|
|
168
115
|
<span v-else-if="item.kbds?.length" :class="b24ui.itemTrailingKbds({ class: b24uiOverride?.itemTrailingKbds })">
|
|
169
|
-
<B24Kbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="props.b24uiOverride?.itemTrailingKbdsSize || b24ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
116
|
+
<B24Kbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="((props.b24uiOverride?.itemTrailingKbdsSize || b24ui.itemTrailingKbdsSize()) as KbdProps['size'])" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
170
117
|
</span>
|
|
171
118
|
</slot>
|
|
172
119
|
|
|
@@ -193,7 +140,7 @@ const groups = computed(
|
|
|
193
140
|
as="button"
|
|
194
141
|
type="button"
|
|
195
142
|
:disabled="item.disabled"
|
|
196
|
-
:text-value="
|
|
143
|
+
:text-value="getLabel(item)"
|
|
197
144
|
:class="b24ui.item({ class: b24uiOverride?.item, color: item?.color })"
|
|
198
145
|
>
|
|
199
146
|
<ReuseItemTemplate :item="item" :index="index" />
|
|
@@ -205,7 +152,7 @@ const groups = computed(
|
|
|
205
152
|
:b24ui="b24ui"
|
|
206
153
|
:b24ui-override="b24uiOverride"
|
|
207
154
|
:portal="portal"
|
|
208
|
-
:items="item.children"
|
|
155
|
+
:items="(item.children as T)"
|
|
209
156
|
align="start"
|
|
210
157
|
:align-offset="-4"
|
|
211
158
|
:side-offset="3"
|
|
@@ -215,7 +162,7 @@ const groups = computed(
|
|
|
215
162
|
v-bind="item.content"
|
|
216
163
|
>
|
|
217
164
|
<template v-for="(_, name) in proxySlots" #[name]="slotData">
|
|
218
|
-
<slot :name="name" v-bind="slotData" />
|
|
165
|
+
<slot :name="(name as keyof DropdownMenuContentSlots<T>)" v-bind="slotData" />
|
|
219
166
|
</template>
|
|
220
167
|
</B24DropdownMenuContent>
|
|
221
168
|
</DropdownMenu.Sub>
|
|
@@ -223,7 +170,7 @@ const groups = computed(
|
|
|
223
170
|
v-else-if="item.type === 'checkbox'"
|
|
224
171
|
:model-value="item.checked"
|
|
225
172
|
:disabled="item.disabled"
|
|
226
|
-
:text-value="
|
|
173
|
+
:text-value="getLabel(item)"
|
|
227
174
|
:class="b24ui.item({ class: [b24uiOverride?.item, item.class], color: item?.color })"
|
|
228
175
|
@update:model-value="item.onUpdateChecked"
|
|
229
176
|
@select="item.onSelect"
|
|
@@ -234,10 +181,10 @@ const groups = computed(
|
|
|
234
181
|
v-else
|
|
235
182
|
as-child
|
|
236
183
|
:disabled="item.disabled"
|
|
237
|
-
:text-value="
|
|
184
|
+
:text-value="getLabel(item)"
|
|
238
185
|
@select="item.onSelect"
|
|
239
186
|
>
|
|
240
|
-
<B24Link v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
|
|
187
|
+
<B24Link v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item as Omit<DropdownMenuItem, 'type'>)" custom>
|
|
241
188
|
<B24LinkBase
|
|
242
189
|
v-bind="slotProps"
|
|
243
190
|
:class="b24ui.item({ class: [b24uiOverride?.item, item.class], color: item?.color, active })"
|