@bitrix24/b24ui-nuxt 0.6.7 → 0.7.0
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/accordion.ts +20 -0
- package/.nuxt/b24ui/advice.ts +2 -10
- package/.nuxt/b24ui/alert.ts +2 -15
- package/.nuxt/b24ui/avatar-group.ts +2 -10
- package/.nuxt/b24ui/avatar.ts +3 -11
- package/.nuxt/b24ui/badge.ts +48 -13
- package/.nuxt/b24ui/button-group.ts +2 -22
- package/.nuxt/b24ui/button.ts +4 -17
- package/.nuxt/b24ui/calendar.ts +3 -11
- package/.nuxt/b24ui/checkbox.ts +75 -11
- package/.nuxt/b24ui/chip.ts +2 -10
- package/.nuxt/b24ui/collapsible.ts +2 -10
- package/.nuxt/b24ui/container.ts +2 -10
- package/.nuxt/b24ui/countdown.ts +2 -10
- package/.nuxt/b24ui/description-list.ts +2 -15
- package/.nuxt/b24ui/dropdown-menu.ts +4 -11
- package/.nuxt/b24ui/form-field.ts +3 -10
- package/.nuxt/b24ui/form.ts +2 -10
- package/.nuxt/b24ui/index.ts +1 -0
- package/.nuxt/b24ui/input-menu.ts +6 -30
- package/.nuxt/b24ui/input-number.ts +15 -10
- package/.nuxt/b24ui/input.ts +4 -17
- package/.nuxt/b24ui/kbd.ts +2 -10
- package/.nuxt/b24ui/link.ts +11 -17
- package/.nuxt/b24ui/modal.ts +3 -11
- package/.nuxt/b24ui/navbar-divider.ts +2 -10
- package/.nuxt/b24ui/navbar-section.ts +2 -10
- package/.nuxt/b24ui/navbar-spacer.ts +2 -10
- package/.nuxt/b24ui/navbar.ts +2 -10
- package/.nuxt/b24ui/navigation-menu.ts +69 -60
- package/.nuxt/b24ui/popover.ts +2 -10
- package/.nuxt/b24ui/progress.ts +2 -10
- package/.nuxt/b24ui/radio-group.ts +3 -11
- package/.nuxt/b24ui/range.ts +2 -10
- package/.nuxt/b24ui/select-menu.ts +10 -40
- package/.nuxt/b24ui/select.ts +10 -40
- package/.nuxt/b24ui/separator.ts +2 -10
- package/.nuxt/b24ui/sidebar-body.ts +2 -10
- package/.nuxt/b24ui/sidebar-footer.ts +2 -10
- package/.nuxt/b24ui/sidebar-header.ts +2 -10
- package/.nuxt/b24ui/sidebar-heading.ts +2 -10
- package/.nuxt/b24ui/sidebar-layout.ts +2 -10
- package/.nuxt/b24ui/sidebar-section.ts +2 -10
- package/.nuxt/b24ui/sidebar-spacer.ts +2 -10
- package/.nuxt/b24ui/sidebar.ts +2 -10
- package/.nuxt/b24ui/skeleton.ts +2 -10
- package/.nuxt/b24ui/slideover.ts +2 -10
- package/.nuxt/b24ui/stacked-layout.ts +2 -10
- package/.nuxt/b24ui/switch.ts +2 -10
- package/.nuxt/b24ui/tabs.ts +6 -13
- package/.nuxt/b24ui/textarea.ts +4 -17
- package/.nuxt/b24ui/toast.ts +2 -15
- package/.nuxt/b24ui/toaster.ts +3 -11
- package/.nuxt/b24ui/tooltip.ts +3 -11
- package/.nuxt/b24ui.css +1 -1
- package/cli/templates.mjs +2 -2
- package/dist/meta.d.mts +38368 -18666
- package/dist/meta.mjs +38368 -18666
- package/dist/module.json +1 -1
- package/dist/module.mjs +11 -3
- package/dist/runtime/components/Accordion.vue +96 -0
- package/dist/runtime/components/Accordion.vue.d.ts +78 -0
- package/dist/runtime/components/Advice.vue +1 -1
- package/dist/runtime/components/Alert.vue +1 -1
- package/dist/runtime/components/Avatar.vue +11 -3
- package/dist/runtime/components/Avatar.vue.d.ts +2 -1
- package/dist/runtime/components/AvatarGroup.vue +1 -1
- package/dist/runtime/components/Badge.vue +5 -3
- package/dist/runtime/components/Badge.vue.d.ts +2 -0
- package/dist/runtime/components/Button.vue +2 -3
- package/dist/runtime/components/Button.vue.d.ts +1 -1
- package/dist/runtime/components/Calendar.vue +6 -2
- package/dist/runtime/components/Checkbox.vue +14 -5
- package/dist/runtime/components/Checkbox.vue.d.ts +9 -0
- package/dist/runtime/components/Chip.vue +1 -1
- package/dist/runtime/components/Collapsible.vue +1 -1
- package/dist/runtime/components/Countdown.vue +1 -1
- package/dist/runtime/components/Countdown.vue.d.ts +2 -2
- package/dist/runtime/components/DescriptionList.vue +3 -2
- package/dist/runtime/components/DescriptionList.vue.d.ts +1 -1
- package/dist/runtime/components/DropdownMenu.vue +1 -1
- package/dist/runtime/components/DropdownMenu.vue.d.ts +2 -0
- package/dist/runtime/components/DropdownMenuContent.vue +74 -72
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +4 -20
- package/dist/runtime/components/Form.vue +6 -6
- package/dist/runtime/components/Form.vue.d.ts +12 -11
- package/dist/runtime/components/FormField.vue +4 -4
- package/dist/runtime/components/Input.vue +12 -8
- package/dist/runtime/components/Input.vue.d.ts +31 -30
- package/dist/runtime/components/InputMenu.vue +23 -20
- package/dist/runtime/components/InputMenu.vue.d.ts +214 -4
- package/dist/runtime/components/InputNumber.vue +17 -10
- package/dist/runtime/components/InputNumber.vue.d.ts +80 -3
- package/dist/runtime/components/Link.vue +5 -13
- package/dist/runtime/components/Modal.vue +22 -14
- package/dist/runtime/components/Modal.vue.d.ts +18 -5
- package/dist/runtime/components/Navbar.vue +1 -1
- package/dist/runtime/components/NavbarDivider.vue +1 -1
- package/dist/runtime/components/NavbarSection.vue +1 -1
- package/dist/runtime/components/NavbarSpacer.vue +1 -1
- package/dist/runtime/components/NavigationMenu.vue +186 -44
- package/dist/runtime/components/NavigationMenu.vue.d.ts +39 -8
- package/dist/runtime/components/OverlayProvider.vue +2 -2
- package/dist/runtime/components/Popover.vue +4 -0
- package/dist/runtime/components/Popover.vue.d.ts +2 -1
- package/dist/runtime/components/Progress.vue +3 -2
- package/dist/runtime/components/Progress.vue.d.ts +2 -2
- package/dist/runtime/components/RadioGroup.vue +26 -10
- package/dist/runtime/components/RadioGroup.vue.d.ts +3 -1
- package/dist/runtime/components/Range.vue +2 -2
- package/dist/runtime/components/Range.vue.d.ts +19 -20
- package/dist/runtime/components/Select.vue +57 -31
- package/dist/runtime/components/Select.vue.d.ts +110 -2
- package/dist/runtime/components/SelectMenu.vue +77 -23
- package/dist/runtime/components/SelectMenu.vue.d.ts +111 -5
- package/dist/runtime/components/Separator.vue +3 -3
- package/dist/runtime/components/Sidebar.vue +1 -1
- package/dist/runtime/components/SidebarBody.vue +1 -1
- package/dist/runtime/components/SidebarFooter.vue +1 -1
- package/dist/runtime/components/SidebarHeader.vue +1 -1
- package/dist/runtime/components/SidebarHeading.vue +1 -1
- package/dist/runtime/components/SidebarLayout.vue +1 -1
- package/dist/runtime/components/SidebarSection.vue +1 -1
- package/dist/runtime/components/SidebarSpacer.vue +1 -1
- package/dist/runtime/components/Slideover.vue +23 -15
- package/dist/runtime/components/Slideover.vue.d.ts +18 -5
- package/dist/runtime/components/StackedLayout.vue +1 -1
- package/dist/runtime/components/Switch.vue +1 -1
- package/dist/runtime/components/Tabs.vue +28 -7
- package/dist/runtime/components/Tabs.vue.d.ts +6 -1
- package/dist/runtime/components/Textarea.vue +13 -9
- package/dist/runtime/components/Textarea.vue.d.ts +31 -30
- package/dist/runtime/components/Toast.vue +7 -6
- package/dist/runtime/components/Toast.vue.d.ts +6 -0
- package/dist/runtime/components/Toaster.vue +4 -4
- package/dist/runtime/components/Toaster.vue.d.ts +6 -0
- package/dist/runtime/components/Tooltip.vue +9 -2
- package/dist/runtime/components/Tooltip.vue.d.ts +2 -1
- package/dist/runtime/components/content/TableWrapper.vue +1 -1
- package/dist/runtime/composables/defineLocale.d.ts +2 -0
- package/dist/runtime/composables/defineLocale.js +4 -0
- package/dist/runtime/composables/defineShortcuts.js +8 -2
- package/dist/runtime/composables/useFormField.d.ts +1 -1
- package/dist/runtime/composables/useFormField.js +2 -1
- package/dist/runtime/composables/useKbd.d.ts +1 -0
- package/dist/runtime/composables/useKbd.js +4 -3
- package/dist/runtime/composables/useOverlay.d.ts +11 -11
- package/dist/runtime/composables/useOverlay.js +17 -11
- package/dist/runtime/inertia/components/Link.vue +45 -60
- package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
- package/dist/runtime/inertia/components/LinkBase.vue +68 -0
- package/dist/runtime/inertia/components/LinkBase.vue.d.ts +25 -0
- package/dist/runtime/inertia/stubs.d.ts +1 -1
- package/dist/runtime/inertia/stubs.js +1 -1
- package/dist/runtime/prose/A.vue +1 -1
- package/dist/runtime/prose/Blockquote.vue +1 -1
- package/dist/runtime/prose/Code.vue +1 -1
- package/dist/runtime/prose/Em.vue +1 -1
- package/dist/runtime/prose/H1.vue +1 -1
- package/dist/runtime/prose/H2.vue +1 -1
- package/dist/runtime/prose/H3.vue +1 -1
- package/dist/runtime/prose/H4.vue +1 -1
- package/dist/runtime/prose/H5.vue +1 -1
- package/dist/runtime/prose/H6.vue +1 -1
- package/dist/runtime/prose/Hr.vue +1 -1
- package/dist/runtime/prose/Img.vue +1 -1
- package/dist/runtime/prose/Li.vue +1 -1
- package/dist/runtime/prose/Ol.vue +1 -1
- package/dist/runtime/prose/P.vue +1 -1
- package/dist/runtime/prose/Pre.vue +1 -1
- package/dist/runtime/prose/Strong.vue +1 -1
- package/dist/runtime/prose/Table.vue +1 -1
- package/dist/runtime/prose/Tbody.vue +1 -1
- package/dist/runtime/prose/Td.vue +1 -1
- package/dist/runtime/prose/Th.vue +1 -1
- package/dist/runtime/prose/Thead.vue +1 -1
- package/dist/runtime/prose/Tr.vue +1 -1
- package/dist/runtime/prose/Ul.vue +1 -1
- package/dist/runtime/types/form.d.ts +11 -10
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/locale.d.ts +1 -0
- package/dist/runtime/types/tv.d.ts +53 -0
- package/dist/runtime/types/tv.js +0 -0
- package/dist/runtime/types/utils.d.ts +4 -51
- package/dist/runtime/types/utils.js +1 -0
- package/dist/runtime/utils/link.d.ts +1 -0
- package/dist/runtime/utils/link.js +12 -0
- package/dist/runtime/vue/components/Link.vue +26 -40
- package/dist/runtime/vue/composables/useAppConfig.js +3 -1
- package/dist/runtime/vue/stubs.d.ts +1 -1
- package/dist/runtime/vue/stubs.js +1 -1
- package/dist/shared/{b24ui-nuxt.jU270f-Q.mjs → b24ui-nuxt.C-kZb5Ac.mjs} +267 -121
- package/dist/unplugin.d.mts +2 -2
- package/dist/unplugin.mjs +6 -3
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +2 -2
- package/package.json +41 -40
|
@@ -5,11 +5,12 @@ import theme from "#build/b24ui/link";
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed } from "vue";
|
|
7
7
|
import { defu } from "defu";
|
|
8
|
-
import { isEqual
|
|
8
|
+
import { isEqual } from "ohash/utils";
|
|
9
9
|
import { useForwardProps } from "reka-ui";
|
|
10
10
|
import { reactiveOmit } from "@vueuse/core";
|
|
11
11
|
import { useRoute, useAppConfig } from "#imports";
|
|
12
12
|
import { tv } from "../utils/tv";
|
|
13
|
+
import { isPartiallyEqual } from "../utils/link";
|
|
13
14
|
import B24LinkBase from "./LinkBase.vue";
|
|
14
15
|
defineOptions({ inheritAttrs: false });
|
|
15
16
|
const props = defineProps({
|
|
@@ -44,7 +45,7 @@ const props = defineProps({
|
|
|
44
45
|
defineSlots();
|
|
45
46
|
const route = useRoute();
|
|
46
47
|
const appConfig = useAppConfig();
|
|
47
|
-
const nuxtLinkProps = useForwardProps(reactiveOmit(props, "as", "type", "disabled", "active", "exact", "exactQuery", "exactHash", "activeClass", "inactiveClass", "raw", "class"));
|
|
48
|
+
const nuxtLinkProps = useForwardProps(reactiveOmit(props, "as", "type", "disabled", "active", "exact", "exactQuery", "exactHash", "activeClass", "inactiveClass", "to", "href", "raw", "custom", "class"));
|
|
48
49
|
const b24ui = computed(() => tv({
|
|
49
50
|
extend: tv(theme),
|
|
50
51
|
...defu({
|
|
@@ -56,17 +57,7 @@ const b24ui = computed(() => tv({
|
|
|
56
57
|
}
|
|
57
58
|
}, appConfig.b24ui?.link || {})
|
|
58
59
|
}));
|
|
59
|
-
|
|
60
|
-
const diffedKeys = diff(item1, item2).reduce((filtered, q) => {
|
|
61
|
-
if (q.type === "added") {
|
|
62
|
-
filtered.add(q.key);
|
|
63
|
-
}
|
|
64
|
-
return filtered;
|
|
65
|
-
}, /* @__PURE__ */ new Set());
|
|
66
|
-
const item1Filtered = Object.fromEntries(Object.entries(item1).filter(([key]) => !diffedKeys.has(key)));
|
|
67
|
-
const item2Filtered = Object.fromEntries(Object.entries(item2).filter(([key]) => !diffedKeys.has(key)));
|
|
68
|
-
return isEqual(item1Filtered, item2Filtered);
|
|
69
|
-
}
|
|
60
|
+
const to = computed(() => props.to ?? props.href);
|
|
70
61
|
function isLinkActive({ route: linkRoute, isActive, isExactActive }) {
|
|
71
62
|
if (props.active !== void 0) {
|
|
72
63
|
return props.active;
|
|
@@ -105,6 +96,7 @@ function resolveLinkClass({ route: route2, isActive, isExactActive }) {
|
|
|
105
96
|
<NuxtLink
|
|
106
97
|
v-slot="{ href, navigate, route: linkRoute, rel, target, isExternal, isActive, isExactActive }"
|
|
107
98
|
v-bind="nuxtLinkProps"
|
|
99
|
+
:to="to"
|
|
108
100
|
custom
|
|
109
101
|
>
|
|
110
102
|
<template v-if="custom">
|
|
@@ -31,7 +31,7 @@ const props = defineProps({
|
|
|
31
31
|
defaultOpen: { type: Boolean, required: false },
|
|
32
32
|
modal: { type: Boolean, required: false, default: true }
|
|
33
33
|
});
|
|
34
|
-
const emits = defineEmits(["after:leave", "close:prevent", "update:open"]);
|
|
34
|
+
const emits = defineEmits(["after:leave", "after:enter", "close:prevent", "update:open"]);
|
|
35
35
|
const slots = defineSlots();
|
|
36
36
|
const { t } = useLocale();
|
|
37
37
|
const appConfig = useAppConfig();
|
|
@@ -43,14 +43,14 @@ const contentEvents = computed(() => {
|
|
|
43
43
|
closeAutoFocus: (e) => e.preventDefault()
|
|
44
44
|
};
|
|
45
45
|
if (!props.dismissible) {
|
|
46
|
-
const events = ["pointerDownOutside", "interactOutside", "escapeKeyDown"
|
|
46
|
+
const events = ["pointerDownOutside", "interactOutside", "escapeKeyDown"];
|
|
47
47
|
return events.reduce((acc, curr) => {
|
|
48
48
|
acc[curr] = (e) => {
|
|
49
49
|
e.preventDefault();
|
|
50
50
|
emits("close:prevent");
|
|
51
51
|
};
|
|
52
52
|
return acc;
|
|
53
|
-
},
|
|
53
|
+
}, defaultEvents);
|
|
54
54
|
}
|
|
55
55
|
return defaultEvents;
|
|
56
56
|
});
|
|
@@ -62,7 +62,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.modal |
|
|
|
62
62
|
</script>
|
|
63
63
|
|
|
64
64
|
<template>
|
|
65
|
-
<DialogRoot v-slot="{ open }" v-bind="rootProps">
|
|
65
|
+
<DialogRoot v-slot="{ open, close }" v-bind="rootProps">
|
|
66
66
|
<DialogTrigger v-if="!!slots.default" as-child :class="props.class">
|
|
67
67
|
<slot :open="open" />
|
|
68
68
|
</DialogTrigger>
|
|
@@ -70,7 +70,13 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.modal |
|
|
|
70
70
|
<DialogPortal v-bind="portalProps">
|
|
71
71
|
<DialogOverlay v-if="overlay" :class="b24ui.overlay({ class: props.b24ui?.overlay })" />
|
|
72
72
|
|
|
73
|
-
<DialogContent
|
|
73
|
+
<DialogContent
|
|
74
|
+
:class="b24ui.content({ class: [!slots.default && props.b24ui?.content, props.class] })"
|
|
75
|
+
v-bind="contentProps"
|
|
76
|
+
@after-enter="emits('after:enter')"
|
|
77
|
+
@after-leave="emits('after:leave')"
|
|
78
|
+
v-on="contentEvents"
|
|
79
|
+
>
|
|
74
80
|
<VisuallyHidden v-if="!!slots.content && (title || !!slots.title || (description || !!slots.description))">
|
|
75
81
|
<DialogTitle v-if="title || !!slots.title">
|
|
76
82
|
<slot name="title">
|
|
@@ -85,9 +91,9 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.modal |
|
|
|
85
91
|
</DialogDescription>
|
|
86
92
|
</VisuallyHidden>
|
|
87
93
|
|
|
88
|
-
<slot name="content">
|
|
89
|
-
<div v-if="!!slots.header || (title || !!slots.title) || (description || !!slots.description) || (close || !!slots.close)" :class="b24ui.header({ class: props.b24ui?.header })">
|
|
90
|
-
<slot name="header">
|
|
94
|
+
<slot name="content" :close="close">
|
|
95
|
+
<div v-if="!!slots.header || (title || !!slots.title) || (description || !!slots.description) || (props.close || !!slots.close)" :class="b24ui.header({ class: props.b24ui?.header })">
|
|
96
|
+
<slot name="header" :close="close">
|
|
91
97
|
<div :class="b24ui.wrapper({ class: props.b24ui?.wrapper })">
|
|
92
98
|
<DialogTitle v-if="title || !!slots.title" :class="b24ui.title({ class: props.b24ui?.title })">
|
|
93
99
|
<slot name="title">
|
|
@@ -102,15 +108,17 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.modal |
|
|
|
102
108
|
</DialogDescription>
|
|
103
109
|
</div>
|
|
104
110
|
|
|
105
|
-
<
|
|
106
|
-
|
|
111
|
+
<slot name="actions" />
|
|
112
|
+
|
|
113
|
+
<DialogClose v-if="props.close || !!slots.close" as-child>
|
|
114
|
+
<slot name="close" :close="close" :b24ui="b24ui">
|
|
107
115
|
<B24Button
|
|
108
|
-
v-if="close"
|
|
116
|
+
v-if="props.close"
|
|
109
117
|
:icon="closeIcon || icons.close"
|
|
110
118
|
size="xs"
|
|
111
119
|
color="link"
|
|
112
120
|
:aria-label="t('modal.close')"
|
|
113
|
-
v-bind="typeof close === 'object' ? close : {}"
|
|
121
|
+
v-bind="typeof props.close === 'object' ? props.close : {}"
|
|
114
122
|
:class="b24ui.close({ class: props.b24ui?.close })"
|
|
115
123
|
/>
|
|
116
124
|
</slot>
|
|
@@ -119,11 +127,11 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.modal |
|
|
|
119
127
|
</div>
|
|
120
128
|
|
|
121
129
|
<div v-if="!!slots.body" :class="b24ui.body({ class: props.b24ui?.body, scrollbarThin: Boolean(props.scrollbarThin) })">
|
|
122
|
-
<slot name="body" />
|
|
130
|
+
<slot name="body" :close="close" />
|
|
123
131
|
</div>
|
|
124
132
|
|
|
125
133
|
<div v-if="!!slots.footer" :class="b24ui.footer({ class: props.b24ui?.footer })">
|
|
126
|
-
<slot name="footer" />
|
|
134
|
+
<slot name="footer" :close="close" />
|
|
127
135
|
</div>
|
|
128
136
|
</slot>
|
|
129
137
|
</DialogContent>
|
|
@@ -63,39 +63,52 @@ export interface ModalProps extends DialogRootProps {
|
|
|
63
63
|
}
|
|
64
64
|
export interface ModalEmits extends DialogRootEmits {
|
|
65
65
|
'after:leave': [];
|
|
66
|
+
'after:enter': [];
|
|
66
67
|
'close:prevent': [];
|
|
67
68
|
}
|
|
68
69
|
export interface ModalSlots {
|
|
69
70
|
default(props: {
|
|
70
71
|
open: boolean;
|
|
71
72
|
}): any;
|
|
72
|
-
content(props
|
|
73
|
-
|
|
73
|
+
content(props: {
|
|
74
|
+
close: () => void;
|
|
75
|
+
}): any;
|
|
76
|
+
header(props: {
|
|
77
|
+
close: () => void;
|
|
78
|
+
}): any;
|
|
74
79
|
title(props?: {}): any;
|
|
75
80
|
description(props?: {}): any;
|
|
81
|
+
actions(props?: {}): any;
|
|
76
82
|
close(props: {
|
|
83
|
+
close: () => void;
|
|
77
84
|
b24ui: {
|
|
78
85
|
[K in keyof Required<Modal['slots']>]: (props?: Record<string, any>) => string;
|
|
79
86
|
};
|
|
80
87
|
}): any;
|
|
81
|
-
body(props
|
|
82
|
-
|
|
88
|
+
body(props: {
|
|
89
|
+
close: () => void;
|
|
90
|
+
}): any;
|
|
91
|
+
footer(props: {
|
|
92
|
+
close: () => void;
|
|
93
|
+
}): any;
|
|
83
94
|
}
|
|
84
95
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ModalProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
85
96
|
"update:open": (value: boolean) => any;
|
|
86
97
|
"after:leave": () => any;
|
|
98
|
+
"after:enter": () => any;
|
|
87
99
|
"close:prevent": () => any;
|
|
88
100
|
}, string, import("vue").PublicProps, Readonly<ModalProps> & Readonly<{
|
|
89
101
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
90
102
|
"onAfter:leave"?: (() => any) | undefined;
|
|
103
|
+
"onAfter:enter"?: (() => any) | undefined;
|
|
91
104
|
"onClose:prevent"?: (() => any) | undefined;
|
|
92
105
|
}>, {
|
|
93
106
|
close: boolean | Partial<ButtonProps>;
|
|
94
107
|
modal: boolean;
|
|
95
|
-
transition: boolean;
|
|
96
108
|
portal: boolean | string | HTMLElement;
|
|
97
109
|
overlay: boolean;
|
|
98
110
|
overlayBlur: Modal["variants"]["overlayBlur"];
|
|
111
|
+
transition: boolean;
|
|
99
112
|
dismissible: boolean;
|
|
100
113
|
scrollbarThin: boolean;
|
|
101
114
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ModalSlots>;
|
|
@@ -19,7 +19,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.navbar
|
|
|
19
19
|
|
|
20
20
|
<template>
|
|
21
21
|
<!-- Navbar -->
|
|
22
|
-
<Primitive :as="as" :class="b24ui.root({ class: [props.
|
|
22
|
+
<Primitive :as="as" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
23
23
|
<slot />
|
|
24
24
|
</Primitive>
|
|
25
25
|
</template>
|
|
@@ -18,7 +18,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.navbarD
|
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
20
|
<template>
|
|
21
|
-
<Primitive :as="as" aria-hidden="true" :class="b24ui.root({ class: [props.
|
|
21
|
+
<Primitive :as="as" aria-hidden="true" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
22
22
|
<slot />
|
|
23
23
|
</Primitive>
|
|
24
24
|
</template>
|
|
@@ -20,7 +20,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.navbarS
|
|
|
20
20
|
<template>
|
|
21
21
|
<Primitive
|
|
22
22
|
:as="as"
|
|
23
|
-
:class="b24ui.root({ class: [props.
|
|
23
|
+
:class="b24ui.root({ class: [props.b24ui?.root, props.class] })"
|
|
24
24
|
data-slot="section"
|
|
25
25
|
>
|
|
26
26
|
<slot />
|
|
@@ -18,7 +18,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.navbarS
|
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
20
|
<template>
|
|
21
|
-
<Primitive :as="as" aria-hidden="true" :class="b24ui.root({ class: [props.
|
|
21
|
+
<Primitive :as="as" aria-hidden="true" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
22
22
|
<slot />
|
|
23
23
|
</Primitive>
|
|
24
24
|
</template>
|
|
@@ -4,8 +4,9 @@ import theme from "#build/b24ui/navigation-menu";
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed, toRef } from "vue";
|
|
7
|
-
import { NavigationMenuRoot, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, useForwardPropsEmits } from "reka-ui";
|
|
8
|
-
import {
|
|
7
|
+
import { NavigationMenuRoot, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, AccordionRoot, AccordionItem, AccordionTrigger, AccordionContent, useForwardPropsEmits } from "reka-ui";
|
|
8
|
+
import { defu } from "defu";
|
|
9
|
+
import { reactivePick, createReusableTemplate } from "@vueuse/core";
|
|
9
10
|
import { useAppConfig } from "#imports";
|
|
10
11
|
import { get, isArrayOfArray } from "../utils";
|
|
11
12
|
import { tv } from "../utils/tv";
|
|
@@ -15,7 +16,8 @@ import B24LinkBase from "./LinkBase.vue";
|
|
|
15
16
|
import B24Link from "./Link.vue";
|
|
16
17
|
import B24Avatar from "./Avatar.vue";
|
|
17
18
|
import B24Badge from "./Badge.vue";
|
|
18
|
-
import
|
|
19
|
+
import B24Popover from "./Popover.vue";
|
|
20
|
+
import B24Tooltip from "./Tooltip.vue";
|
|
19
21
|
const props = defineProps({
|
|
20
22
|
as: { type: null, required: false },
|
|
21
23
|
trailingIcon: { type: [Function, Object], required: false },
|
|
@@ -25,6 +27,8 @@ const props = defineProps({
|
|
|
25
27
|
variant: { type: null, required: false },
|
|
26
28
|
orientation: { type: null, required: false, default: "horizontal" },
|
|
27
29
|
collapsed: { type: Boolean, required: false },
|
|
30
|
+
tooltip: { type: [Boolean, Object], required: false },
|
|
31
|
+
popover: { type: [Boolean, Object], required: false },
|
|
28
32
|
highlight: { type: Boolean, required: false },
|
|
29
33
|
highlightColor: { type: null, required: false },
|
|
30
34
|
content: { type: Object, required: false },
|
|
@@ -40,7 +44,10 @@ const props = defineProps({
|
|
|
40
44
|
disableHoverTrigger: { type: Boolean, required: false },
|
|
41
45
|
skipDelayDuration: { type: Number, required: false },
|
|
42
46
|
disablePointerLeaveClose: { type: Boolean, required: false },
|
|
43
|
-
unmountOnHide: { type: Boolean, required: false, default: true }
|
|
47
|
+
unmountOnHide: { type: Boolean, required: false, default: true },
|
|
48
|
+
disabled: { type: Boolean, required: false },
|
|
49
|
+
type: { type: String, required: false, default: "multiple" },
|
|
50
|
+
collapsible: { type: Boolean, required: false, default: true }
|
|
44
51
|
});
|
|
45
52
|
const emits = defineEmits(["update:modelValue"]);
|
|
46
53
|
const slots = defineSlots();
|
|
@@ -57,7 +64,10 @@ const rootProps = useForwardPropsEmits(computed(() => ({
|
|
|
57
64
|
disablePointerLeaveClose: props.disablePointerLeaveClose,
|
|
58
65
|
unmountOnHide: props.unmountOnHide
|
|
59
66
|
})), emits);
|
|
67
|
+
const accordionProps = useForwardPropsEmits(reactivePick(props, "collapsible", "disabled", "type", "unmountOnHide"), emits);
|
|
60
68
|
const contentProps = toRef(() => props.content);
|
|
69
|
+
const tooltipProps = toRef(() => defu(typeof props.tooltip === "boolean" ? {} : props.tooltip, { delayDuration: 0, content: { side: "right" } }));
|
|
70
|
+
const popoverProps = toRef(() => defu(typeof props.popover === "boolean" ? {} : props.popover, { mode: "hover", content: { side: "right", align: "start", alignOffset: 2 } }));
|
|
61
71
|
const [DefineLinkTemplate, ReuseLinkTemplate] = createReusableTemplate();
|
|
62
72
|
const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate({
|
|
63
73
|
props: {
|
|
@@ -75,7 +85,7 @@ const getLabel = (item) => {
|
|
|
75
85
|
};
|
|
76
86
|
const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.navigationMenu || {} })({
|
|
77
87
|
orientation: props.orientation,
|
|
78
|
-
contentOrientation: props.contentOrientation,
|
|
88
|
+
contentOrientation: props.orientation === "vertical" ? void 0 : props.contentOrientation,
|
|
79
89
|
collapsed: props.collapsed,
|
|
80
90
|
color: props.color,
|
|
81
91
|
variant: props.variant,
|
|
@@ -85,6 +95,15 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.navigat
|
|
|
85
95
|
const lists = computed(
|
|
86
96
|
() => props.items?.length ? isArrayOfArray(props.items) ? props.items : [props.items] : []
|
|
87
97
|
);
|
|
98
|
+
function getAccordionDefaultValue(list, level = 0) {
|
|
99
|
+
const indexes = list.reduce((acc, item, index) => {
|
|
100
|
+
if (item.defaultOpen || item.open) {
|
|
101
|
+
acc.push(item.value || (level > 0 ? `item-${level}-${index}` : `item-${index}`));
|
|
102
|
+
}
|
|
103
|
+
return acc;
|
|
104
|
+
}, []);
|
|
105
|
+
return props.type === "single" ? indexes[0] : indexes;
|
|
106
|
+
}
|
|
88
107
|
</script>
|
|
89
108
|
|
|
90
109
|
<template>
|
|
@@ -95,14 +114,14 @@ const lists = computed(
|
|
|
95
114
|
<Component
|
|
96
115
|
:is="item.icon"
|
|
97
116
|
v-if="item.icon"
|
|
98
|
-
:class="b24ui.linkLeadingIcon({ class: props.b24ui?.linkLeadingIcon, active, disabled: !!item.disabled })"
|
|
117
|
+
:class="b24ui.linkLeadingIcon({ class: [props.b24ui?.linkLeadingIcon, item.b24ui?.linkLeadingIcon], active, disabled: !!item.disabled })"
|
|
99
118
|
/>
|
|
100
|
-
<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 })" />
|
|
119
|
+
<B24Avatar v-else-if="item.avatar" :size="item.b24ui?.linkLeadingAvatarSize || props.b24ui?.linkLeadingAvatarSize || b24ui.linkLeadingAvatarSize()" v-bind="item.avatar" :class="b24ui.linkLeadingAvatar({ class: [props.b24ui?.linkLeadingAvatar, item.b24ui?.linkLeadingAvatar], active, disabled: !!item.disabled })" />
|
|
101
120
|
</slot>
|
|
102
121
|
|
|
103
122
|
<span
|
|
104
123
|
v-if="(!collapsed || orientation !== 'vertical') && (getLabel(item) || !!slots[item.slot ? `${item.slot}-label` : 'item-label'])"
|
|
105
|
-
:class="b24ui.linkLabel({ class: props.b24ui?.linkLabel, active })"
|
|
124
|
+
:class="b24ui.linkLabel({ class: [props.b24ui?.linkLabel, item.b24ui?.linkLabel], active })"
|
|
106
125
|
>
|
|
107
126
|
<slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="active" :index="index">
|
|
108
127
|
{{ getLabel(item) }}
|
|
@@ -111,21 +130,27 @@ const lists = computed(
|
|
|
111
130
|
<Component
|
|
112
131
|
:is="typeof externalIcon !== 'boolean' ? externalIcon : icons.external"
|
|
113
132
|
v-if="item.target === '_blank' && externalIcon !== false"
|
|
114
|
-
:class="b24ui.linkLabelExternalIcon({ class: props.b24ui?.linkLabelExternalIcon, active })"
|
|
133
|
+
:class="b24ui.linkLabelExternalIcon({ class: [props.b24ui?.linkLabelExternalIcon, item.b24ui?.linkLabelExternalIcon], active })"
|
|
115
134
|
/>
|
|
116
135
|
</span>
|
|
117
136
|
</span>
|
|
118
|
-
<
|
|
137
|
+
<component
|
|
138
|
+
:is="orientation === 'vertical' && item.children?.length && !collapsed ? AccordionTrigger : 'span'"
|
|
139
|
+
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'])"
|
|
140
|
+
:class="b24ui.linkTrailing({ class: [props.b24ui?.linkTrailing, item.b24ui?.linkTrailing] })"
|
|
141
|
+
>
|
|
119
142
|
<slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="active" :index="index">
|
|
120
143
|
<Component
|
|
121
144
|
:is="item.trailingIcon || trailingIcon || icons.chevronDown"
|
|
122
145
|
v-if="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) || orientation === 'vertical' && item.children?.length"
|
|
123
|
-
|
|
146
|
+
as="span"
|
|
147
|
+
:class="b24ui.linkTrailingIcon({ class: [props.b24ui?.linkTrailingIcon, item.b24ui?.linkTrailingIcon], active })"
|
|
148
|
+
@click.stop.prevent
|
|
124
149
|
/>
|
|
125
150
|
<Component
|
|
126
151
|
:is="item.trailingIcon"
|
|
127
152
|
v-else-if="item.trailingIcon"
|
|
128
|
-
:class="b24ui.linkTrailingIcon({ class: props.b24ui?.linkTrailingIcon, active })"
|
|
153
|
+
:class="b24ui.linkTrailingIcon({ class: [props.b24ui?.linkTrailingIcon, item.b24ui?.linkTrailingIcon], active })"
|
|
129
154
|
/>
|
|
130
155
|
|
|
131
156
|
<B24Badge
|
|
@@ -133,36 +158,124 @@ const lists = computed(
|
|
|
133
158
|
color="danger"
|
|
134
159
|
depth="dark"
|
|
135
160
|
:use-fill="true"
|
|
136
|
-
:size="props.b24ui?.linkTrailingBadgeSize || b24ui.linkTrailingBadgeSize()"
|
|
161
|
+
:size="item.b24ui?.linkTrailingBadgeSize || props.b24ui?.linkTrailingBadgeSize || b24ui.linkTrailingBadgeSize()"
|
|
137
162
|
v-bind="typeof item.badge === 'string' || typeof item.badge === 'number' ? { label: item.badge } : item.badge"
|
|
138
|
-
:class="b24ui.linkTrailingBadge({ class: props.b24ui?.linkTrailingBadge })"
|
|
163
|
+
:class="b24ui.linkTrailingBadge({ class: [props.b24ui?.linkTrailingBadge, item.b24ui?.linkTrailingBadge] })"
|
|
139
164
|
/>
|
|
140
165
|
</slot>
|
|
141
|
-
</
|
|
166
|
+
</component>
|
|
142
167
|
</slot>
|
|
143
168
|
</DefineLinkTemplate>
|
|
144
169
|
|
|
145
170
|
<DefineItemTemplate v-slot="{ item, index, level }">
|
|
146
171
|
<component
|
|
147
|
-
:is="orientation === 'vertical' &&
|
|
172
|
+
:is="orientation === 'vertical' && !collapsed ? AccordionItem : NavigationMenuItem"
|
|
148
173
|
as="li"
|
|
149
|
-
:value="item.value ||
|
|
150
|
-
:default-open="item.defaultOpen"
|
|
151
|
-
:unmount-on-hide="orientation === 'vertical' && item.children?.length && !collapsed ? unmountOnHide : void 0"
|
|
152
|
-
:open="item.open"
|
|
174
|
+
:value="item.value || ((level || 0) > 0 ? `item-${level}-${index}` : `item-${index}`)"
|
|
153
175
|
>
|
|
154
|
-
<div
|
|
176
|
+
<div
|
|
177
|
+
v-if="orientation === 'vertical' && item.type === 'label' && !collapsed"
|
|
178
|
+
:class="b24ui.label({ class: [props.b24ui?.label, item.b24ui?.label, item.class] })"
|
|
179
|
+
>
|
|
155
180
|
<ReuseLinkTemplate :item="item" :index="index" />
|
|
156
181
|
</div>
|
|
157
|
-
<B24Link
|
|
182
|
+
<B24Link
|
|
183
|
+
v-else-if="item.type !== 'label'"
|
|
184
|
+
v-slot="{ active, ...slotProps }"
|
|
185
|
+
v-bind="orientation === 'vertical' && item.children?.length && !collapsed && item.type === 'trigger' ? {} : pickLinkProps(item)"
|
|
186
|
+
custom
|
|
187
|
+
>
|
|
158
188
|
<component
|
|
159
|
-
:is="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) ? NavigationMenuTrigger : NavigationMenuLink"
|
|
189
|
+
:is="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) ? NavigationMenuTrigger : orientation === 'vertical' && item.children?.length && !collapsed && !slotProps.href ? AccordionTrigger : NavigationMenuLink"
|
|
160
190
|
as-child
|
|
161
191
|
:active="active || item.active"
|
|
162
192
|
:disabled="item.disabled"
|
|
163
193
|
@select="item.onSelect"
|
|
164
194
|
>
|
|
165
|
-
<
|
|
195
|
+
<B24Popover
|
|
196
|
+
v-if="orientation === 'vertical' && collapsed && item.children?.length && (!!props.popover || !!item.popover)"
|
|
197
|
+
v-bind="{ ...popoverProps, ...typeof item.popover === 'boolean' ? {} : item.popover || {} }"
|
|
198
|
+
:b24ui="{ content: b24ui.content({ class: [props.b24ui?.content, item.b24ui?.content] }) }"
|
|
199
|
+
>
|
|
200
|
+
<B24LinkBase
|
|
201
|
+
v-bind="slotProps"
|
|
202
|
+
:class="b24ui.link({
|
|
203
|
+
class: [props.b24ui?.link, item.b24ui?.link, item.class],
|
|
204
|
+
active: active || item.active,
|
|
205
|
+
disabled: !!item.disabled,
|
|
206
|
+
level: (level || 0) > 0
|
|
207
|
+
})"
|
|
208
|
+
>
|
|
209
|
+
<ReuseLinkTemplate :item="item" :active="active || item.active" :index="index" />
|
|
210
|
+
</B24LinkBase>
|
|
211
|
+
|
|
212
|
+
<template #content>
|
|
213
|
+
<slot :name="item.slot ? `${item.slot}-content` : 'item-content'" :item="item" :active="active || item.active" :index="index">
|
|
214
|
+
<ul :class="b24ui.childList({ class: [props.b24ui?.childList, item.b24ui?.childList] })">
|
|
215
|
+
<li :class="b24ui.childLabel({ class: [props.b24ui?.childLabel, item.b24ui?.childLabel] })">
|
|
216
|
+
{{ getLabel(item) }}
|
|
217
|
+
</li>
|
|
218
|
+
<li
|
|
219
|
+
v-for="(childItem, childIndex) in item.children"
|
|
220
|
+
:key="childIndex"
|
|
221
|
+
:class="b24ui.childItem({ class: [props.b24ui?.childItem, item.b24ui?.childItem] })"
|
|
222
|
+
>
|
|
223
|
+
<B24Link v-slot="{ active: childActive, ...childSlotProps }" v-bind="pickLinkProps(childItem)" custom>
|
|
224
|
+
<NavigationMenuLink as-child :active="childActive" @select="childItem.onSelect">
|
|
225
|
+
<B24LinkBase
|
|
226
|
+
v-bind="childSlotProps"
|
|
227
|
+
:class="b24ui.childLink({ class: [props.b24ui?.childLink, item.b24ui?.childLink, childItem.class], active: childActive })"
|
|
228
|
+
>
|
|
229
|
+
<Component
|
|
230
|
+
:is="childItem.icon"
|
|
231
|
+
v-if="childItem.icon"
|
|
232
|
+
:class="b24ui.childLinkIcon({ class: [props.b24ui?.childLinkIcon, item.b24ui?.childLinkIcon], active: childActive })"
|
|
233
|
+
/>
|
|
234
|
+
|
|
235
|
+
<span :class="b24ui.childLinkLabel({ class: [props.b24ui?.childLinkLabel, item.b24ui?.childLinkLabel], active: childActive })">
|
|
236
|
+
{{ getLabel(childItem) }}
|
|
237
|
+
|
|
238
|
+
<Component
|
|
239
|
+
:is="typeof externalIcon === 'string' ? externalIcon : icons.external"
|
|
240
|
+
v-if="childItem.target === '_blank' && externalIcon !== false"
|
|
241
|
+
:class="b24ui.childLinkLabelExternalIcon({ class: [props.b24ui?.childLinkLabelExternalIcon, item.b24ui?.childLinkLabelExternalIcon], active: childActive })"
|
|
242
|
+
/>
|
|
243
|
+
</span>
|
|
244
|
+
</B24LinkBase>
|
|
245
|
+
</NavigationMenuLink>
|
|
246
|
+
</B24Link>
|
|
247
|
+
</li>
|
|
248
|
+
</ul>
|
|
249
|
+
</slot>
|
|
250
|
+
</template>
|
|
251
|
+
</B24Popover>
|
|
252
|
+
<B24Tooltip
|
|
253
|
+
v-else-if="orientation === 'vertical' && collapsed && (!!props.tooltip || !!item.tooltip)"
|
|
254
|
+
:text="get(item, props.labelKey)"
|
|
255
|
+
v-bind="{ ...tooltipProps, ...typeof item.tooltip === 'boolean' ? {} : item.tooltip || {} }"
|
|
256
|
+
>
|
|
257
|
+
<B24LinkBase
|
|
258
|
+
v-bind="slotProps"
|
|
259
|
+
:class="b24ui.link({
|
|
260
|
+
class: [props.b24ui?.link, item.b24ui?.link, item.class],
|
|
261
|
+
active: active || item.active,
|
|
262
|
+
disabled: !!item.disabled,
|
|
263
|
+
level: (level || 0) > 0
|
|
264
|
+
})"
|
|
265
|
+
>
|
|
266
|
+
<ReuseLinkTemplate :item="item" :active="active || item.active" :index="index" />
|
|
267
|
+
</B24LinkBase>
|
|
268
|
+
</B24Tooltip>
|
|
269
|
+
<B24LinkBase
|
|
270
|
+
v-else
|
|
271
|
+
v-bind="slotProps"
|
|
272
|
+
:class="b24ui.link({
|
|
273
|
+
class: [props.b24ui?.link, item.b24ui?.link, item.class],
|
|
274
|
+
active: active || item.active,
|
|
275
|
+
disabled: !!item.disabled,
|
|
276
|
+
level: orientation === 'horizontal' || (level || 0) > 0
|
|
277
|
+
})"
|
|
278
|
+
>
|
|
166
279
|
<ReuseLinkTemplate :item="item" :active="active || item.active" :index="index" />
|
|
167
280
|
</B24LinkBase>
|
|
168
281
|
</component>
|
|
@@ -171,31 +284,42 @@ const lists = computed(
|
|
|
171
284
|
v-if="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content'])"
|
|
172
285
|
v-bind="contentProps"
|
|
173
286
|
:data-viewport="item.viewportRtl ? 'rtl' : 'ltr'"
|
|
174
|
-
:class="b24ui.content({ class: props.b24ui?.content })"
|
|
287
|
+
:class="b24ui.content({ class: [props.b24ui?.content, item.b24ui?.content] })"
|
|
175
288
|
>
|
|
176
|
-
<slot :name="item.slot ? `${item.slot}-content` : 'item-content'" :item="item" :active="active" :index="index">
|
|
177
|
-
<ul :class="b24ui.childList({ class: props.b24ui?.childList })">
|
|
178
|
-
<li
|
|
179
|
-
|
|
289
|
+
<slot :name="item.slot ? `${item.slot}-content` : 'item-content'" :item="item" :active="active || item.active" :index="index">
|
|
290
|
+
<ul :class="b24ui.childList({ class: [props.b24ui?.childList, item.b24ui?.childList] })">
|
|
291
|
+
<li
|
|
292
|
+
v-for="(childItem, childIndex) in item.children"
|
|
293
|
+
:key="childIndex"
|
|
294
|
+
:class="b24ui.childItem({ class: [props.b24ui?.childItem, item.b24ui?.childItem] })"
|
|
295
|
+
>
|
|
296
|
+
<B24Link
|
|
297
|
+
v-slot="{ active: childActive, ...childSlotProps }"
|
|
298
|
+
v-bind="pickLinkProps(childItem)"
|
|
299
|
+
custom
|
|
300
|
+
>
|
|
180
301
|
<NavigationMenuLink as-child :active="childActive" @select="childItem.onSelect">
|
|
181
|
-
<B24LinkBase
|
|
302
|
+
<B24LinkBase
|
|
303
|
+
v-bind="childSlotProps"
|
|
304
|
+
:class="b24ui.childLink({ class: [props.b24ui?.childLink, childItem.childLink, childItem.class], active: childActive })"
|
|
305
|
+
>
|
|
182
306
|
<Component
|
|
183
307
|
:is="childItem.icon"
|
|
184
308
|
v-if="childItem.icon"
|
|
185
|
-
:class="b24ui.childLinkIcon({ class: props.b24ui?.childLinkIcon, active: childActive })"
|
|
309
|
+
:class="b24ui.childLinkIcon({ class: [props.b24ui?.childLinkIcon, item.b24ui?.childLinkIcon], active: childActive })"
|
|
186
310
|
/>
|
|
187
311
|
|
|
188
|
-
<div :class="b24ui.childLinkWrapper({ class: props.b24ui?.childLinkWrapper })">
|
|
189
|
-
<p :class="b24ui.childLinkLabel({ class: props.b24ui?.childLinkLabel, active: childActive })">
|
|
312
|
+
<div :class="b24ui.childLinkWrapper({ class: [props.b24ui?.childLinkWrapper, item.b24ui?.childLinkWrapper] })">
|
|
313
|
+
<p :class="b24ui.childLinkLabel({ class: [props.b24ui?.childLinkLabel, item.b24ui?.childLinkLabel], active: childActive })">
|
|
190
314
|
{{ getLabel(childItem) }}
|
|
191
315
|
|
|
192
316
|
<Component
|
|
193
317
|
:is="typeof externalIcon === 'string' ? externalIcon : icons.external"
|
|
194
318
|
v-if="childItem.target === '_blank' && externalIcon !== false"
|
|
195
|
-
:class="b24ui.childLinkLabelExternalIcon({ class: props.b24ui?.childLinkLabelExternalIcon, active: childActive })"
|
|
319
|
+
:class="b24ui.childLinkLabelExternalIcon({ class: [props.b24ui?.childLinkLabelExternalIcon, item.b24ui?.childLinkLabelExternalIcon], active: childActive })"
|
|
196
320
|
/>
|
|
197
321
|
</p>
|
|
198
|
-
<p v-if="childItem.description" :class="b24ui.childLinkDescription({ class: props.b24ui?.childLinkDescription, active: childActive })">
|
|
322
|
+
<p v-if="childItem.description" :class="b24ui.childLinkDescription({ class: [props.b24ui?.childLinkDescription, item.b24ui?.childLinkDescription], active: childActive })">
|
|
199
323
|
{{ childItem.description }}
|
|
200
324
|
</p>
|
|
201
325
|
</div>
|
|
@@ -208,39 +332,57 @@ const lists = computed(
|
|
|
208
332
|
</NavigationMenuContent>
|
|
209
333
|
</B24Link>
|
|
210
334
|
|
|
211
|
-
<
|
|
212
|
-
|
|
335
|
+
<AccordionContent
|
|
336
|
+
v-if="orientation === 'vertical' && item.children?.length && !collapsed"
|
|
337
|
+
:class="b24ui.content({ class: [props.b24ui?.content, item.b24ui?.content] })"
|
|
338
|
+
>
|
|
339
|
+
<AccordionRoot
|
|
340
|
+
v-bind="{
|
|
341
|
+
...accordionProps,
|
|
342
|
+
defaultValue: getAccordionDefaultValue(item.children, (level || 0) + 1)
|
|
343
|
+
}"
|
|
344
|
+
as="ul"
|
|
345
|
+
:class="b24ui.childList({ class: props.b24ui?.childList })"
|
|
346
|
+
>
|
|
213
347
|
<ReuseItemTemplate
|
|
214
348
|
v-for="(childItem, childIndex) in item.children"
|
|
215
349
|
:key="childIndex"
|
|
216
350
|
:item="childItem"
|
|
217
351
|
:index="childIndex"
|
|
218
352
|
:level="(level || 0) + 1"
|
|
219
|
-
:class="b24ui.childItem({ class: props.b24ui?.childItem })"
|
|
353
|
+
:class="b24ui.childItem({ class: [props.b24ui?.childItem, childItem.b24ui?.childItem] })"
|
|
220
354
|
/>
|
|
221
|
-
</
|
|
222
|
-
</
|
|
355
|
+
</AccordionRoot>
|
|
356
|
+
</AccordionContent>
|
|
223
357
|
</component>
|
|
224
358
|
</DefineItemTemplate>
|
|
225
359
|
|
|
226
360
|
<NavigationMenuRoot
|
|
227
361
|
v-bind="rootProps"
|
|
228
362
|
:data-collapsed="collapsed"
|
|
229
|
-
:class="b24ui.root({ class: [props.
|
|
363
|
+
:class="b24ui.root({ class: [props.b24ui?.root, props.class] })"
|
|
230
364
|
data-slot="section"
|
|
231
365
|
>
|
|
232
366
|
<slot name="list-leading" />
|
|
233
367
|
|
|
234
368
|
<template v-for="(list, listIndex) in lists" :key="`list-${listIndex}`">
|
|
235
|
-
<
|
|
369
|
+
<component
|
|
370
|
+
v-bind="orientation === 'vertical' && !collapsed ? {
|
|
371
|
+
...accordionProps,
|
|
372
|
+
defaultValue: getAccordionDefaultValue(list)
|
|
373
|
+
} : {}"
|
|
374
|
+
:is="orientation === 'vertical' && !collapsed ? AccordionRoot : NavigationMenuList"
|
|
375
|
+
as="ul"
|
|
376
|
+
:class="b24ui.list({ class: props.b24ui?.list })"
|
|
377
|
+
>
|
|
236
378
|
<ReuseItemTemplate
|
|
237
379
|
v-for="(item, index) in list"
|
|
238
380
|
:key="`list-${listIndex}-${index}`"
|
|
239
381
|
:item="item"
|
|
240
382
|
:index="index"
|
|
241
|
-
:class="b24ui.item({ class: props.b24ui?.item })"
|
|
383
|
+
:class="b24ui.item({ class: [props.b24ui?.item, item.b24ui?.item] })"
|
|
242
384
|
/>
|
|
243
|
-
</
|
|
385
|
+
</component>
|
|
244
386
|
|
|
245
387
|
<div v-if="orientation === 'vertical' && listIndex < lists.length - 1" :class="b24ui.separator({ class: props.b24ui?.separator })" />
|
|
246
388
|
</template>
|