@bitrix24/b24ui-nuxt 0.1.7 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nuxt/b24ui/alert.ts +18 -8
- package/.nuxt/b24ui/badge.ts +1 -1
- package/.nuxt/b24ui/content/description-list.ts +17 -7
- package/.nuxt/b24ui/dropdown-menu.ts +235 -0
- package/.nuxt/b24ui/index.ts +2 -0
- package/.nuxt/b24ui/input-menu.ts +591 -0
- package/.nuxt/b24ui/input.ts +5 -5
- package/.nuxt/b24ui/select-menu.ts +6 -6
- package/.nuxt/b24ui/select.ts +6 -6
- package/.nuxt/b24ui/toast.ts +18 -8
- package/.nuxt/b24ui.css +2 -0
- package/README.md +8 -8
- package/dist/meta.cjs +13508 -1751
- package/dist/meta.d.cts +13508 -1751
- package/dist/meta.d.mts +13508 -1751
- package/dist/meta.d.ts +13508 -1751
- package/dist/meta.mjs +13508 -1751
- package/dist/module.cjs +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/Alert.vue +13 -10
- package/dist/runtime/components/DropdownMenu.vue +135 -0
- package/dist/runtime/components/DropdownMenuContent.vue +182 -0
- package/dist/runtime/components/InputMenu.vue +507 -0
- package/dist/runtime/components/Toast.vue +26 -14
- package/dist/runtime/components/Toaster.vue +2 -2
- package/dist/runtime/components/content/DescriptionList.vue +9 -7
- package/dist/runtime/composables/useComponentIcons.d.ts +2 -2
- package/dist/runtime/composables/useToast.d.ts +5 -4
- package/dist/runtime/composables/useToast.js +2 -2
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/types/index.d.ts +2 -0
- package/dist/runtime/types/index.js +2 -0
- package/dist/runtime/types/utils.d.ts +5 -0
- package/dist/runtime/vue/components/Link.vue +1 -0
- package/dist/shared/{b24ui-nuxt.vQRZieQw.mjs → b24ui-nuxt.CYvh5VlN.mjs} +653 -31
- package/dist/shared/{b24ui-nuxt.ZUYaG6CJ.cjs → b24ui-nuxt.DgnM0VWe.cjs} +653 -31
- package/dist/unplugin.cjs +1 -1
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +24 -5
package/dist/module.cjs
CHANGED
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defu } from 'defu';
|
|
2
2
|
import { defineNuxtModule, createResolver, addVitePlugin, addPlugin, addComponentsDir, addImportsDir, hasNuxtModule, installModule } from '@nuxt/kit';
|
|
3
|
-
import { d as defaultOptions, a as getDefaultUiConfig, b as addTemplates } from './shared/b24ui-nuxt.
|
|
3
|
+
import { d as defaultOptions, a as getDefaultUiConfig, b as addTemplates } from './shared/b24ui-nuxt.CYvh5VlN.mjs';
|
|
4
4
|
import 'node:url';
|
|
5
5
|
import 'scule';
|
|
6
6
|
|
|
@@ -23,11 +23,12 @@ export interface AlertProps {
|
|
|
23
23
|
icon?: IconComponent
|
|
24
24
|
avatar?: AvatarProps
|
|
25
25
|
color?: AlertVariants['color']
|
|
26
|
+
orientation?: AlertVariants['orientation']
|
|
26
27
|
size?: AlertVariants['size']
|
|
27
28
|
/**
|
|
28
29
|
* Display a list of actions:
|
|
29
|
-
* - under the title and description
|
|
30
|
-
* - next to the close button
|
|
30
|
+
* - under the title and description when orientation is `vertical`
|
|
31
|
+
* - next to the close button when orientation is `horizontal`
|
|
31
32
|
* `{ size: 'xs' }`{lang="ts-type"}
|
|
32
33
|
*/
|
|
33
34
|
actions?: ButtonProps[]
|
|
@@ -68,22 +69,24 @@ import icons from '../dictionary/icons'
|
|
|
68
69
|
import B24Avatar from './Avatar.vue'
|
|
69
70
|
import B24Button from './Button.vue'
|
|
70
71
|
|
|
71
|
-
const props = defineProps<AlertProps>()
|
|
72
|
+
const props = withDefaults(defineProps<AlertProps>(), {
|
|
73
|
+
orientation: 'vertical'
|
|
74
|
+
})
|
|
72
75
|
const emits = defineEmits<AlertEmits>()
|
|
73
76
|
const slots = defineSlots<AlertSlots>()
|
|
74
77
|
|
|
75
78
|
const { t } = useLocale()
|
|
76
79
|
|
|
77
|
-
const multiline = computed(() => !!props.title && !!props.description)
|
|
78
|
-
|
|
79
80
|
const b24ui = computed(() => alert({
|
|
80
81
|
color: props.color,
|
|
81
|
-
size: props.size
|
|
82
|
+
size: props.size,
|
|
83
|
+
orientation: props.orientation,
|
|
84
|
+
title: !!props.title || !!slots.title
|
|
82
85
|
}))
|
|
83
86
|
</script>
|
|
84
87
|
|
|
85
88
|
<template>
|
|
86
|
-
<Primitive :as="as" :class="b24ui.root({ class: [props.class, props.b24ui?.root]
|
|
89
|
+
<Primitive :as="as" :data-orientation="orientation" :class="b24ui.root({ class: [props.class, props.b24ui?.root] })">
|
|
87
90
|
<slot name="leading">
|
|
88
91
|
<Component
|
|
89
92
|
:is="icon"
|
|
@@ -105,15 +108,15 @@ const b24ui = computed(() => alert({
|
|
|
105
108
|
</slot>
|
|
106
109
|
</div>
|
|
107
110
|
|
|
108
|
-
<div v-if="
|
|
111
|
+
<div v-if="orientation === 'vertical' && actions?.length" :class="b24ui.actions({ class: props.b24ui?.actions })">
|
|
109
112
|
<slot name="actions">
|
|
110
113
|
<B24Button v-for="(action, index) in actions" :key="index" size="xs" v-bind="action" />
|
|
111
114
|
</slot>
|
|
112
115
|
</div>
|
|
113
116
|
</div>
|
|
114
117
|
|
|
115
|
-
<div v-if="(
|
|
116
|
-
<template v-if="
|
|
118
|
+
<div v-if="(orientation === 'horizontal' && actions?.length) || close" :class="b24ui.actions({ class: props.b24ui?.actions, orientation: 'horizontal' })">
|
|
119
|
+
<template v-if="orientation === 'horizontal' && actions?.length">
|
|
117
120
|
<slot name="actions">
|
|
118
121
|
<B24Button v-for="(action, index) in actions" :key="index" size="xs" v-bind="action" />
|
|
119
122
|
</slot>
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { DropdownMenuRootProps, DropdownMenuRootEmits, DropdownMenuContentProps, DropdownMenuArrowProps } from 'reka-ui'
|
|
4
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
5
|
+
import _appConfig from '#build/app.config'
|
|
6
|
+
import theme from '#build/b24ui/dropdown-menu'
|
|
7
|
+
import { tv } from '../utils/tv'
|
|
8
|
+
import type { AvatarProps, KbdProps, LinkProps, IconComponent } from '../types'
|
|
9
|
+
import type { DynamicSlots, PartialString } from '../types/utils'
|
|
10
|
+
|
|
11
|
+
const appConfigDropdownMenu = _appConfig as AppConfig & { b24ui: { dropdownMenu: Partial<typeof theme> } }
|
|
12
|
+
|
|
13
|
+
const dropdownMenu = tv({ extend: tv(theme), ...(appConfigDropdownMenu.b24ui?.dropdownMenu || {}) })
|
|
14
|
+
|
|
15
|
+
type DropdownMenuVariants = VariantProps<typeof dropdownMenu>
|
|
16
|
+
|
|
17
|
+
export interface DropdownMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custom'> {
|
|
18
|
+
label?: string
|
|
19
|
+
icon?: IconComponent
|
|
20
|
+
color?: DropdownMenuVariants['color']
|
|
21
|
+
avatar?: AvatarProps
|
|
22
|
+
content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'>
|
|
23
|
+
kbds?: KbdProps['value'][] | KbdProps[]
|
|
24
|
+
/**
|
|
25
|
+
* The item type.
|
|
26
|
+
* @defaultValue 'link'
|
|
27
|
+
*/
|
|
28
|
+
type?: 'label' | 'separator' | 'link' | 'checkbox'
|
|
29
|
+
slot?: string
|
|
30
|
+
loading?: boolean
|
|
31
|
+
disabled?: boolean
|
|
32
|
+
checked?: boolean
|
|
33
|
+
open?: boolean
|
|
34
|
+
defaultOpen?: boolean
|
|
35
|
+
children?: DropdownMenuItem[] | DropdownMenuItem[][]
|
|
36
|
+
onSelect?(e: Event): void
|
|
37
|
+
onUpdateChecked?(checked: boolean): void
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface DropdownMenuProps<T> extends Omit<DropdownMenuRootProps, 'dir'> {
|
|
41
|
+
size?: DropdownMenuVariants['size']
|
|
42
|
+
items?: T[] | T[][]
|
|
43
|
+
/**
|
|
44
|
+
* The icon displayed when an item is checked.
|
|
45
|
+
* @defaultValue icons.check = `CheckIcon`
|
|
46
|
+
*/
|
|
47
|
+
checkedIcon?: IconComponent
|
|
48
|
+
/**
|
|
49
|
+
* The content of the menu.
|
|
50
|
+
* @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8 }
|
|
51
|
+
*/
|
|
52
|
+
content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'>
|
|
53
|
+
/**
|
|
54
|
+
* Display an arrow alongside the menu.
|
|
55
|
+
* @defaultValue false
|
|
56
|
+
*/
|
|
57
|
+
arrow?: boolean | Omit<DropdownMenuArrowProps, 'as' | 'asChild'>
|
|
58
|
+
/**
|
|
59
|
+
* Render the menu in a portal.
|
|
60
|
+
* @defaultValue true
|
|
61
|
+
*/
|
|
62
|
+
portal?: boolean
|
|
63
|
+
/**
|
|
64
|
+
* The key used to get the label from the item.
|
|
65
|
+
* @defaultValue 'label'
|
|
66
|
+
*/
|
|
67
|
+
labelKey?: string
|
|
68
|
+
disabled?: boolean
|
|
69
|
+
class?: any
|
|
70
|
+
b24ui?: PartialString<typeof dropdownMenu.slots>
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface DropdownMenuEmits extends DropdownMenuRootEmits {}
|
|
74
|
+
|
|
75
|
+
type SlotProps<T> = (props: { item: T, active?: boolean, index: number }) => any
|
|
76
|
+
|
|
77
|
+
export type DropdownMenuSlots<T extends { slot?: string }> = {
|
|
78
|
+
'default'(props: { open: boolean }): any
|
|
79
|
+
'item': SlotProps<T>
|
|
80
|
+
'item-leading': SlotProps<T>
|
|
81
|
+
'item-label': SlotProps<T>
|
|
82
|
+
'item-trailing': SlotProps<T>
|
|
83
|
+
} & DynamicSlots<T, SlotProps<T>>
|
|
84
|
+
</script>
|
|
85
|
+
|
|
86
|
+
<script setup lang="ts" generic="T extends DropdownMenuItem">
|
|
87
|
+
import { computed, toRef } from 'vue'
|
|
88
|
+
import { defu } from 'defu'
|
|
89
|
+
import { DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuArrow, useForwardPropsEmits } from 'reka-ui'
|
|
90
|
+
import { reactivePick } from '@vueuse/core'
|
|
91
|
+
import { omit } from '../utils'
|
|
92
|
+
import UDropdownMenuContent from './DropdownMenuContent.vue'
|
|
93
|
+
|
|
94
|
+
const props = withDefaults(defineProps<DropdownMenuProps<T>>(), {
|
|
95
|
+
portal: true,
|
|
96
|
+
modal: true,
|
|
97
|
+
labelKey: 'label'
|
|
98
|
+
})
|
|
99
|
+
const emits = defineEmits<DropdownMenuEmits>()
|
|
100
|
+
const slots = defineSlots<DropdownMenuSlots<T>>()
|
|
101
|
+
|
|
102
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, 'defaultOpen', 'open', 'modal'), emits)
|
|
103
|
+
const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8, collisionPadding: 8 }) as DropdownMenuContentProps)
|
|
104
|
+
const arrowProps = toRef(() => props.arrow as DropdownMenuArrowProps)
|
|
105
|
+
const proxySlots = omit(slots, ['default']) as Record<string, DropdownMenuSlots<T>[string]>
|
|
106
|
+
|
|
107
|
+
const b24ui = computed(() => dropdownMenu({
|
|
108
|
+
size: props.size
|
|
109
|
+
}))
|
|
110
|
+
</script>
|
|
111
|
+
|
|
112
|
+
<template>
|
|
113
|
+
<DropdownMenuRoot v-slot="{ open }" v-bind="rootProps">
|
|
114
|
+
<DropdownMenuTrigger v-if="!!slots.default" as-child :class="props.class" :disabled="disabled">
|
|
115
|
+
<slot :open="open" />
|
|
116
|
+
</DropdownMenuTrigger>
|
|
117
|
+
|
|
118
|
+
<UDropdownMenuContent
|
|
119
|
+
:class="b24ui.content({ class: [!slots.default && props.class, props.b24ui?.content] })"
|
|
120
|
+
:b24ui="b24ui"
|
|
121
|
+
:b24ui-override="props.b24ui"
|
|
122
|
+
v-bind="contentProps"
|
|
123
|
+
:items="items"
|
|
124
|
+
:portal="portal"
|
|
125
|
+
:label-key="labelKey"
|
|
126
|
+
:checked-icon="checkedIcon"
|
|
127
|
+
>
|
|
128
|
+
<template v-for="(_, name) in proxySlots" #[name]="slotData: any">
|
|
129
|
+
<slot :name="name" v-bind="slotData" />
|
|
130
|
+
</template>
|
|
131
|
+
|
|
132
|
+
<DropdownMenuArrow v-if="!!arrow" v-bind="arrowProps" :class="b24ui.arrow({ class: props.b24ui?.arrow })" />
|
|
133
|
+
</UDropdownMenuContent>
|
|
134
|
+
</DropdownMenuRoot>
|
|
135
|
+
</template>
|
|
@@ -0,0 +1,182 @@
|
|
|
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
|
+
|
|
8
|
+
const _dropdownMenu = tv(theme)()
|
|
9
|
+
|
|
10
|
+
interface DropdownMenuContentProps<T> extends Omit<RekaDropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> {
|
|
11
|
+
items?: T[] | T[][]
|
|
12
|
+
portal?: boolean
|
|
13
|
+
sub?: boolean
|
|
14
|
+
labelKey: string
|
|
15
|
+
checkedIcon?: IconComponent
|
|
16
|
+
class?: any
|
|
17
|
+
b24ui: typeof _dropdownMenu
|
|
18
|
+
b24uiOverride?: any
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface DropdownMenuContentEmits extends RekaDropdownMenuContentEmits {}
|
|
22
|
+
|
|
23
|
+
type DropdownMenuContentSlots<T extends { slot?: string }> = Omit<DropdownMenuSlots<T>, 'default'> & {
|
|
24
|
+
default(props?: {}): any
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<script setup lang="ts" generic="T extends DropdownMenuItem">
|
|
29
|
+
import { computed } from 'vue'
|
|
30
|
+
import { DropdownMenu } from 'reka-ui/namespaced'
|
|
31
|
+
import { useForwardPropsEmits } from 'reka-ui'
|
|
32
|
+
import { reactiveOmit, createReusableTemplate } from '@vueuse/core'
|
|
33
|
+
import { omit, get } from '../utils'
|
|
34
|
+
import { pickLinkProps } from '../utils/link'
|
|
35
|
+
import icons from '../dictionary/icons'
|
|
36
|
+
import B24LinkBase from './LinkBase.vue'
|
|
37
|
+
import B24Link from './Link.vue'
|
|
38
|
+
import B24Avatar from './Avatar.vue'
|
|
39
|
+
import B24Kbd from './Kbd.vue'
|
|
40
|
+
// eslint-disable-next-line import/no-self-import
|
|
41
|
+
import B24DropdownMenuContent from './DropdownMenuContent.vue'
|
|
42
|
+
|
|
43
|
+
const props = defineProps<DropdownMenuContentProps<T>>()
|
|
44
|
+
const emits = defineEmits<DropdownMenuContentEmits>()
|
|
45
|
+
const slots = defineSlots<DropdownMenuContentSlots<T>>()
|
|
46
|
+
|
|
47
|
+
const contentProps = useForwardPropsEmits(reactiveOmit(props, 'sub', 'items', 'portal', 'labelKey', 'checkedIcon', 'class', 'b24ui', 'b24uiOverride'), emits)
|
|
48
|
+
const proxySlots = omit(slots, ['default']) as Record<string, DropdownMenuContentSlots<T>[string]>
|
|
49
|
+
|
|
50
|
+
const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate<{ item: DropdownMenuItem, active?: boolean, index: number }>()
|
|
51
|
+
|
|
52
|
+
const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0]) ? props.items : [props.items]) as T[][] : [])
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<template>
|
|
56
|
+
<DefineItemTemplate v-slot="{ item, active, index }">
|
|
57
|
+
<slot :name="item.slot || 'item'" :item="(item as T)" :index="index">
|
|
58
|
+
<slot :name="item.slot ? `${item.slot}-leading`: 'item-leading'" :item="(item as T)" :active="active" :index="index">
|
|
59
|
+
<Component
|
|
60
|
+
:is="icons.loading"
|
|
61
|
+
v-if="item.loading"
|
|
62
|
+
:class="b24ui.itemLeadingIcon({ class: b24uiOverride?.itemLeadingIcon, color: item?.color, loading: true })"
|
|
63
|
+
/>
|
|
64
|
+
<Component
|
|
65
|
+
:is="item.icon"
|
|
66
|
+
v-else-if="item.icon"
|
|
67
|
+
:class="b24ui.itemLeadingIcon({ class: b24uiOverride?.itemLeadingIcon, color: item?.color, active })"
|
|
68
|
+
/>
|
|
69
|
+
<B24Avatar
|
|
70
|
+
v-else-if="item.avatar"
|
|
71
|
+
:size="((props.b24uiOverride?.itemLeadingAvatarSize || b24ui.itemLeadingAvatarSize()) as AvatarProps['size'])"
|
|
72
|
+
v-bind="item.avatar"
|
|
73
|
+
:class="b24ui.itemLeadingAvatar({ class: b24uiOverride?.itemLeadingAvatar, active })"
|
|
74
|
+
/>
|
|
75
|
+
</slot>
|
|
76
|
+
|
|
77
|
+
<span v-if="get(item, props.labelKey as string) || !!slots[item.slot ? `${item.slot}-label`: 'item-label']" :class="b24ui.itemLabel({ class: b24uiOverride?.itemLabel, active })">
|
|
78
|
+
<slot :name="item.slot ? `${item.slot}-label`: 'item-label'" :item="(item as T)" :active="active" :index="index">
|
|
79
|
+
{{ get(item, props.labelKey as string) }}
|
|
80
|
+
</slot>
|
|
81
|
+
<Component
|
|
82
|
+
:is="icons.external"
|
|
83
|
+
v-if="item.target === '_blank'"
|
|
84
|
+
:class="b24ui.itemLabelExternalIcon({ class: b24uiOverride?.itemLabelExternalIcon, color: item?.color, active })"
|
|
85
|
+
/>
|
|
86
|
+
</span>
|
|
87
|
+
|
|
88
|
+
<span :class="b24ui.itemTrailing({ class: b24uiOverride?.itemTrailing })">
|
|
89
|
+
<slot :name="item.slot ? `${item.slot}-trailing`: 'item-trailing'" :item="(item as T)" :active="active" :index="index">
|
|
90
|
+
<Component
|
|
91
|
+
:is="icons.chevronRight"
|
|
92
|
+
v-if="item.children?.length"
|
|
93
|
+
:class="b24ui.itemTrailingIcon({ class: b24uiOverride?.itemTrailingIcon, color: item?.color, active })"
|
|
94
|
+
/>
|
|
95
|
+
<span v-else-if="item.kbds?.length" :class="b24ui.itemTrailingKbds({ class: b24uiOverride?.itemTrailingKbds })">
|
|
96
|
+
<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" />
|
|
97
|
+
</span>
|
|
98
|
+
</slot>
|
|
99
|
+
|
|
100
|
+
<DropdownMenu.ItemIndicator as-child>
|
|
101
|
+
<Component
|
|
102
|
+
:is="checkedIcon || icons.check"
|
|
103
|
+
:class="b24ui.itemTrailingIcon({ class: b24uiOverride?.itemTrailingIcon, color: item?.color })"
|
|
104
|
+
/>
|
|
105
|
+
</DropdownMenu.ItemIndicator>
|
|
106
|
+
</span>
|
|
107
|
+
</slot>
|
|
108
|
+
</DefineItemTemplate>
|
|
109
|
+
|
|
110
|
+
<DropdownMenu.Portal :disabled="!portal">
|
|
111
|
+
<component :is="sub ? DropdownMenu.SubContent : DropdownMenu.Content" :class="props.class" v-bind="contentProps">
|
|
112
|
+
<DropdownMenu.Group v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" :class="b24ui.group({ class: b24uiOverride?.group })">
|
|
113
|
+
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
114
|
+
<DropdownMenu.Label v-if="item.type === 'label'" :class="b24ui.label({ class: b24uiOverride?.label })">
|
|
115
|
+
<ReuseItemTemplate :item="item" :index="index" />
|
|
116
|
+
</DropdownMenu.Label>
|
|
117
|
+
<DropdownMenu.Separator v-else-if="item.type === 'separator'" :class="b24ui.separator({ class: b24uiOverride?.separator })" />
|
|
118
|
+
<DropdownMenu.Sub v-else-if="item?.children?.length" :open="item.open" :default-open="item.defaultOpen">
|
|
119
|
+
<DropdownMenu.SubTrigger
|
|
120
|
+
as="button"
|
|
121
|
+
type="button"
|
|
122
|
+
:disabled="item.disabled"
|
|
123
|
+
:text-value="get(item, props.labelKey as string)"
|
|
124
|
+
:class="b24ui.item({ class: b24uiOverride?.item, color: item?.color })"
|
|
125
|
+
>
|
|
126
|
+
<ReuseItemTemplate :item="item" :index="index" />
|
|
127
|
+
</DropdownMenu.SubTrigger>
|
|
128
|
+
|
|
129
|
+
<B24DropdownMenuContent
|
|
130
|
+
sub
|
|
131
|
+
:class="props.class"
|
|
132
|
+
:b24ui="b24ui"
|
|
133
|
+
:b24ui-override="b24uiOverride"
|
|
134
|
+
:portal="portal"
|
|
135
|
+
:items="item.children"
|
|
136
|
+
side="right"
|
|
137
|
+
align="start"
|
|
138
|
+
:align-offset="-4"
|
|
139
|
+
:side-offset="3"
|
|
140
|
+
:label-key="labelKey"
|
|
141
|
+
:checked-icon="checkedIcon"
|
|
142
|
+
v-bind="item.content"
|
|
143
|
+
>
|
|
144
|
+
<template v-for="(_, name) in proxySlots" #[name]="slotData: any">
|
|
145
|
+
<slot :name="name" v-bind="slotData" />
|
|
146
|
+
</template>
|
|
147
|
+
</B24DropdownMenuContent>
|
|
148
|
+
</DropdownMenu.Sub>
|
|
149
|
+
<DropdownMenu.CheckboxItem
|
|
150
|
+
v-else-if="item.type === 'checkbox'"
|
|
151
|
+
:model-value="item.checked"
|
|
152
|
+
:disabled="item.disabled"
|
|
153
|
+
:text-value="get(item, props.labelKey as string)"
|
|
154
|
+
:class="b24ui.item({ class: [b24uiOverride?.item, item.class], color: item?.color })"
|
|
155
|
+
@update:model-value="item.onUpdateChecked"
|
|
156
|
+
@select="item.onSelect"
|
|
157
|
+
>
|
|
158
|
+
<ReuseItemTemplate :item="item" :index="index" />
|
|
159
|
+
</DropdownMenu.CheckboxItem>
|
|
160
|
+
<DropdownMenu.Item
|
|
161
|
+
v-else
|
|
162
|
+
as-child
|
|
163
|
+
:disabled="item.disabled"
|
|
164
|
+
:text-value="get(item, props.labelKey as string)"
|
|
165
|
+
@select="item.onSelect"
|
|
166
|
+
>
|
|
167
|
+
<B24Link v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item as Omit<DropdownMenuItem, 'type'>)" custom>
|
|
168
|
+
<B24LinkBase
|
|
169
|
+
v-bind="slotProps"
|
|
170
|
+
:class="b24ui.item({ class: [b24uiOverride?.item, item.class], color: item?.color, active })"
|
|
171
|
+
>
|
|
172
|
+
<ReuseItemTemplate :item="item" :active="active" :index="index" />
|
|
173
|
+
</B24LinkBase>
|
|
174
|
+
</B24Link>
|
|
175
|
+
</DropdownMenu.Item>
|
|
176
|
+
</template>
|
|
177
|
+
</DropdownMenu.Group>
|
|
178
|
+
|
|
179
|
+
<slot />
|
|
180
|
+
</component>
|
|
181
|
+
</DropdownMenu.Portal>
|
|
182
|
+
</template>
|