@bitrix24/b24ui-nuxt 0.7.2 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nuxt/b24ui/accordion.ts +3 -3
- package/.nuxt/b24ui/advice.ts +6 -5
- package/.nuxt/b24ui/alert.ts +102 -49
- package/.nuxt/b24ui/avatar-group.ts +10 -10
- package/.nuxt/b24ui/avatar.ts +18 -18
- package/.nuxt/b24ui/badge.ts +167 -176
- package/.nuxt/b24ui/button-group.ts +3 -1
- package/.nuxt/b24ui/button.ts +179 -170
- package/.nuxt/b24ui/calendar.ts +48 -28
- package/.nuxt/b24ui/checkbox.ts +82 -85
- package/.nuxt/b24ui/chip.ts +121 -32
- package/.nuxt/b24ui/container.ts +1 -1
- package/.nuxt/b24ui/content/table-wrapper.ts +11 -11
- package/.nuxt/b24ui/countdown.ts +11 -11
- package/.nuxt/b24ui/description-list.ts +6 -6
- package/.nuxt/b24ui/dropdown-menu.ts +111 -183
- package/.nuxt/b24ui/form-field.ts +19 -19
- package/.nuxt/b24ui/index.ts +0 -1
- package/.nuxt/b24ui/input-menu.ts +294 -357
- package/.nuxt/b24ui/input-number.ts +111 -259
- package/.nuxt/b24ui/input.ts +136 -259
- package/.nuxt/b24ui/kbd.ts +15 -13
- package/.nuxt/b24ui/link.ts +5 -5
- package/.nuxt/b24ui/modal.ts +14 -12
- package/.nuxt/b24ui/navbar-divider.ts +1 -1
- package/.nuxt/b24ui/navbar-section.ts +1 -1
- package/.nuxt/b24ui/navbar.ts +1 -1
- package/.nuxt/b24ui/navigation-menu.ts +70 -754
- package/.nuxt/b24ui/popover.ts +2 -2
- package/.nuxt/b24ui/progress.ts +58 -68
- package/.nuxt/b24ui/prose/a.ts +1 -1
- package/.nuxt/b24ui/prose/blockquote.ts +1 -1
- package/.nuxt/b24ui/prose/code.ts +45 -9
- package/.nuxt/b24ui/prose/h1.ts +21 -2
- package/.nuxt/b24ui/prose/h2.ts +21 -12
- package/.nuxt/b24ui/prose/h3.ts +21 -12
- package/.nuxt/b24ui/prose/h4.ts +21 -12
- package/.nuxt/b24ui/prose/h5.ts +21 -12
- package/.nuxt/b24ui/prose/h6.ts +21 -12
- package/.nuxt/b24ui/prose/hr.ts +1 -1
- package/.nuxt/b24ui/prose/ol.ts +1 -1
- package/.nuxt/b24ui/prose/p.ts +26 -1
- package/.nuxt/b24ui/prose/thead.ts +1 -1
- package/.nuxt/b24ui/prose/ul.ts +1 -1
- package/.nuxt/b24ui/radio-group.ts +115 -155
- package/.nuxt/b24ui/range.ts +38 -26
- package/.nuxt/b24ui/select-menu.ts +251 -306
- package/.nuxt/b24ui/select.ts +246 -301
- package/.nuxt/b24ui/separator.ts +40 -85
- package/.nuxt/b24ui/sidebar-header.ts +1 -1
- package/.nuxt/b24ui/sidebar-heading.ts +1 -1
- package/.nuxt/b24ui/sidebar-layout.ts +130 -19
- package/.nuxt/b24ui/sidebar-section.ts +1 -1
- package/.nuxt/b24ui/skeleton.ts +19 -1
- package/.nuxt/b24ui/slideover.ts +35 -34
- package/.nuxt/b24ui/switch.ts +59 -48
- package/.nuxt/b24ui/tabs.ts +26 -239
- package/.nuxt/b24ui/textarea.ts +50 -236
- package/.nuxt/b24ui/toast.ts +38 -30
- package/.nuxt/b24ui/toaster.ts +1 -1
- package/.nuxt/b24ui/tooltip.ts +5 -5
- package/cli/templates.mjs +2 -1
- package/dist/meta.d.mts +18759 -5002
- package/dist/meta.mjs +18759 -5002
- package/dist/module.d.mts +1 -0
- package/dist/module.json +2 -2
- package/dist/module.mjs +3 -5
- package/dist/runtime/air-design-tokens/001_b24_global.css +1 -0
- package/dist/runtime/air-design-tokens/002_b24_context_utility.css +0 -0
- package/dist/runtime/air-design-tokens/003_b24_context_light.css +1 -0
- package/dist/runtime/air-design-tokens/004_b24_context_dark.css +1 -0
- package/dist/runtime/air-design-tokens/005_b24_context_edge-light.css +1 -0
- package/dist/runtime/air-design-tokens/006_b24_context_edge-dark.css +1 -0
- package/dist/runtime/air-design-tokens/007_b24_global.css +1 -0
- package/dist/runtime/air-design-tokens/008_ui_global.css +1 -0
- package/dist/runtime/air-design-tokens/009_b24_tools.css +1 -0
- package/dist/runtime/air-design-tokens/components/badge-counter.css +1 -0
- package/dist/runtime/air-design-tokens/components/button.css +1 -0
- package/dist/runtime/air-design-tokens/components/navigation-menu.css +1 -0
- package/dist/runtime/air-design-tokens/components/popup.css +1 -0
- package/dist/runtime/air-design-tokens/components/scrollbar.css +2 -0
- package/dist/runtime/air-design-tokens/index.css +1 -0
- package/dist/runtime/components/Accordion.vue.d.ts +1 -1
- package/dist/runtime/components/Advice.vue +1 -13
- package/dist/runtime/components/Advice.vue.d.ts +1 -1
- package/dist/runtime/components/Alert.vue +6 -4
- package/dist/runtime/components/Alert.vue.d.ts +11 -4
- package/dist/runtime/components/App.vue.d.ts +1 -1
- package/dist/runtime/components/Avatar.vue.d.ts +1 -1
- package/dist/runtime/components/AvatarGroup.vue.d.ts +1 -1
- package/dist/runtime/components/Badge.vue +7 -11
- package/dist/runtime/components/Badge.vue.d.ts +6 -8
- package/dist/runtime/components/Button.vue +18 -15
- package/dist/runtime/components/Button.vue.d.ts +5 -7
- package/dist/runtime/components/ButtonGroup.vue.d.ts +1 -1
- package/dist/runtime/components/Calendar.vue +8 -8
- package/dist/runtime/components/Calendar.vue.d.ts +14 -8
- package/dist/runtime/components/Checkbox.vue.d.ts +2 -2
- package/dist/runtime/components/Chip.vue +28 -7
- package/dist/runtime/components/Chip.vue.d.ts +22 -2
- package/dist/runtime/components/Collapsible.vue.d.ts +1 -1
- package/dist/runtime/components/Container.vue.d.ts +1 -1
- package/dist/runtime/components/Countdown.vue.d.ts +5 -3
- package/dist/runtime/components/DescriptionList.vue.d.ts +1 -1
- package/dist/runtime/components/DropdownMenu.vue +20 -9
- package/dist/runtime/components/DropdownMenu.vue.d.ts +1 -5
- package/dist/runtime/components/DropdownMenuContent.vue +29 -7
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +14 -6
- package/dist/runtime/components/Form.vue +3 -3
- package/dist/runtime/components/Form.vue.d.ts +6 -5
- package/dist/runtime/components/FormField.vue +2 -2
- package/dist/runtime/components/FormField.vue.d.ts +4 -4
- package/dist/runtime/components/Input.vue +8 -4
- package/dist/runtime/components/Input.vue.d.ts +9 -8
- package/dist/runtime/components/InputMenu.vue +44 -18
- package/dist/runtime/components/InputMenu.vue.d.ts +17 -223
- package/dist/runtime/components/InputNumber.vue +14 -11
- package/dist/runtime/components/InputNumber.vue.d.ts +13 -87
- package/dist/runtime/components/Kbd.vue +6 -3
- package/dist/runtime/components/Kbd.vue.d.ts +7 -3
- package/dist/runtime/components/Link.vue +6 -5
- package/dist/runtime/components/Link.vue.d.ts +1 -3
- package/dist/runtime/components/LinkBase.vue.d.ts +1 -1
- package/dist/runtime/components/Modal.vue +37 -33
- package/dist/runtime/components/Modal.vue.d.ts +2 -2
- package/dist/runtime/components/ModalDialogClose.vue.d.ts +1 -1
- package/dist/runtime/components/Navbar.vue.d.ts +1 -1
- package/dist/runtime/components/NavbarDivider.vue.d.ts +1 -1
- package/dist/runtime/components/NavbarSection.vue.d.ts +1 -1
- package/dist/runtime/components/NavbarSpacer.vue.d.ts +1 -1
- package/dist/runtime/components/NavigationMenu.vue +95 -84
- package/dist/runtime/components/NavigationMenu.vue.d.ts +31 -33
- package/dist/runtime/components/OverlayProvider.vue.d.ts +1 -1
- package/dist/runtime/components/Popover.vue +8 -2
- package/dist/runtime/components/Popover.vue.d.ts +9 -3
- package/dist/runtime/components/Progress.vue.d.ts +3 -3
- package/dist/runtime/components/RadioGroup.vue +1 -1
- package/dist/runtime/components/RadioGroup.vue.d.ts +6 -5
- package/dist/runtime/components/Range.vue.d.ts +6 -6
- package/dist/runtime/components/Select.vue +25 -11
- package/dist/runtime/components/Select.vue.d.ts +7 -7
- package/dist/runtime/components/SelectMenu.vue +38 -19
- package/dist/runtime/components/SelectMenu.vue.d.ts +11 -10
- package/dist/runtime/components/Separator.vue +4 -4
- package/dist/runtime/components/Separator.vue.d.ts +6 -3
- package/dist/runtime/components/Sidebar.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarBody.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarFooter.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarHeader.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarHeading.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarLayout.vue +148 -63
- package/dist/runtime/components/SidebarLayout.vue.d.ts +61 -8
- package/dist/runtime/components/SidebarSection.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarSpacer.vue.d.ts +4 -1
- package/dist/runtime/components/Skeleton.vue +7 -3
- package/dist/runtime/components/Skeleton.vue.d.ts +12 -1
- package/dist/runtime/components/Slideover.vue +120 -43
- package/dist/runtime/components/Slideover.vue.d.ts +22 -9
- package/dist/runtime/components/Switch.vue.d.ts +2 -2
- package/dist/runtime/components/Tabs.vue +11 -3
- package/dist/runtime/components/Tabs.vue.d.ts +8 -7
- package/dist/runtime/components/Textarea.vue +8 -4
- package/dist/runtime/components/Textarea.vue.d.ts +8 -7
- package/dist/runtime/components/Toast.vue +16 -8
- package/dist/runtime/components/Toast.vue.d.ts +16 -15
- package/dist/runtime/components/Toaster.vue.d.ts +2 -2
- package/dist/runtime/components/Tooltip.vue +9 -5
- package/dist/runtime/components/Tooltip.vue.d.ts +7 -1
- package/dist/runtime/components/content/TableWrapper.vue.d.ts +1 -1
- package/dist/runtime/composables/defineShortcuts.js +5 -3
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useButtonGroup.d.ts +1 -1
- package/dist/runtime/composables/useComponentIcons.d.ts +1 -1
- package/dist/runtime/composables/useFormField.d.ts +4 -7
- package/dist/runtime/composables/useFormField.js +6 -3
- package/dist/runtime/composables/useKbd.d.ts +1 -1
- package/dist/runtime/composables/useLocale.js +2 -2
- package/dist/runtime/composables/useOverlay.d.ts +29 -2
- package/dist/runtime/composables/useOverlay.js +8 -7
- package/dist/runtime/composables/usePortal.d.ts +1 -1
- package/dist/runtime/composables/useSidebarLayout.d.ts +20 -0
- package/dist/runtime/composables/useSidebarLayout.js +16 -0
- package/dist/runtime/dictionary/icons.js +7 -7
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/inertia/components/Link.vue +3 -0
- package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
- package/dist/runtime/inertia/components/LinkBase.vue.d.ts +1 -1
- package/dist/runtime/inertia/stubs.d.ts +1 -0
- package/dist/runtime/inertia/stubs.js +4 -2
- package/dist/runtime/locale/ar.js +6 -0
- package/dist/runtime/locale/br.js +6 -0
- package/dist/runtime/locale/de.js +6 -0
- package/dist/runtime/locale/en.js +6 -0
- package/dist/runtime/locale/fr.js +6 -0
- package/dist/runtime/locale/id.js +6 -0
- package/dist/runtime/locale/it.js +6 -0
- package/dist/runtime/locale/ja.js +6 -0
- package/dist/runtime/locale/kz.js +6 -0
- package/dist/runtime/locale/la.js +6 -0
- package/dist/runtime/locale/ms.js +6 -0
- package/dist/runtime/locale/pl.js +6 -0
- package/dist/runtime/locale/ru.js +6 -0
- package/dist/runtime/locale/sc.js +6 -0
- package/dist/runtime/locale/tc.js +6 -0
- package/dist/runtime/locale/th.js +6 -0
- package/dist/runtime/locale/tr.js +6 -0
- package/dist/runtime/locale/ua.js +6 -0
- package/dist/runtime/locale/vn.js +6 -0
- package/dist/runtime/plugins/ui-version.d.ts +5 -0
- package/dist/runtime/plugins/ui-version.js +8 -0
- package/dist/runtime/prose/A.vue.d.ts +4 -1
- package/dist/runtime/prose/Blockquote.vue.d.ts +4 -1
- package/dist/runtime/prose/Code.vue.d.ts +4 -1
- package/dist/runtime/prose/Em.vue.d.ts +4 -1
- package/dist/runtime/prose/H1.vue +4 -1
- package/dist/runtime/prose/H1.vue.d.ts +7 -1
- package/dist/runtime/prose/H2.vue +4 -1
- package/dist/runtime/prose/H2.vue.d.ts +7 -1
- package/dist/runtime/prose/H3.vue +4 -1
- package/dist/runtime/prose/H3.vue.d.ts +7 -1
- package/dist/runtime/prose/H4.vue +4 -1
- package/dist/runtime/prose/H4.vue.d.ts +7 -1
- package/dist/runtime/prose/H5.vue +4 -1
- package/dist/runtime/prose/H5.vue.d.ts +7 -1
- package/dist/runtime/prose/H6.vue +4 -1
- package/dist/runtime/prose/H6.vue.d.ts +7 -1
- package/dist/runtime/prose/Hr.vue.d.ts +1 -1
- package/dist/runtime/prose/Img.vue.d.ts +1 -1
- package/dist/runtime/prose/Li.vue.d.ts +4 -1
- package/dist/runtime/prose/Ol.vue.d.ts +4 -1
- package/dist/runtime/prose/P.vue +6 -1
- package/dist/runtime/prose/P.vue.d.ts +12 -1
- package/dist/runtime/prose/Pre.vue.d.ts +4 -1
- package/dist/runtime/prose/Strong.vue.d.ts +4 -1
- package/dist/runtime/prose/Table.vue.d.ts +5 -2
- package/dist/runtime/prose/Tbody.vue.d.ts +4 -1
- package/dist/runtime/prose/Td.vue.d.ts +4 -1
- package/dist/runtime/prose/Th.vue.d.ts +4 -1
- package/dist/runtime/prose/Thead.vue.d.ts +4 -1
- package/dist/runtime/prose/Tr.vue.d.ts +4 -1
- package/dist/runtime/prose/Ul.vue.d.ts +4 -1
- package/dist/runtime/types/index.d.ts +0 -1
- package/dist/runtime/types/index.js +0 -1
- package/dist/runtime/types/locale.d.ts +6 -0
- package/dist/runtime/utils/index.d.ts +6 -0
- package/dist/runtime/utils/index.js +27 -0
- package/dist/runtime/utils/tv.js +66 -1
- package/dist/runtime/vue/components/Link.vue +3 -0
- package/dist/runtime/vue/components/Link.vue.d.ts +1 -1
- package/dist/runtime/vue/stubs.d.ts +1 -0
- package/dist/runtime/vue/stubs.js +3 -1
- package/dist/shared/b24ui-nuxt.dLc5H7ID.mjs +6100 -0
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +40 -28
- package/.nuxt/b24ui/stacked-layout.ts +0 -34
- package/dist/runtime/air-design-tokens.css +0 -1
- package/dist/runtime/components/StackedLayout.vue +0 -117
- package/dist/runtime/components/StackedLayout.vue.d.ts +0 -44
- package/dist/shared/b24ui-nuxt.CxsFEY3M.mjs +0 -7895
|
@@ -4,7 +4,7 @@ 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,
|
|
7
|
+
import { NavigationMenuRoot, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuViewport, AccordionRoot, AccordionItem, AccordionTrigger, AccordionContent, useForwardPropsEmits } from "reka-ui";
|
|
8
8
|
import { defu } from "defu";
|
|
9
9
|
import { reactivePick, createReusableTemplate } from "@vueuse/core";
|
|
10
10
|
import { useAppConfig } from "#imports";
|
|
@@ -18,28 +18,23 @@ import B24Avatar from "./Avatar.vue";
|
|
|
18
18
|
import B24Badge from "./Badge.vue";
|
|
19
19
|
import B24Popover from "./Popover.vue";
|
|
20
20
|
import B24Tooltip from "./Tooltip.vue";
|
|
21
|
+
defineOptions({ inheritAttrs: false });
|
|
21
22
|
const props = defineProps({
|
|
22
23
|
as: { type: null, required: false },
|
|
23
24
|
trailingIcon: { type: [Function, Object], required: false },
|
|
24
25
|
externalIcon: { type: [Boolean, Function, Object], required: false, default: true },
|
|
25
26
|
items: { type: null, required: false },
|
|
26
|
-
color: { type: null, required: false },
|
|
27
|
-
variant: { type: null, required: false },
|
|
28
27
|
orientation: { type: null, required: false, default: "horizontal" },
|
|
29
28
|
collapsed: { type: Boolean, required: false },
|
|
30
29
|
tooltip: { type: [Boolean, Object], required: false },
|
|
31
30
|
popover: { type: [Boolean, Object], required: false },
|
|
32
|
-
highlight: { type: Boolean, required: false },
|
|
33
|
-
highlightColor: { type: null, required: false },
|
|
34
31
|
content: { type: Object, required: false },
|
|
35
|
-
contentOrientation: { type: null, required: false, default: "vertical" },
|
|
36
|
-
arrow: { type: Boolean, required: false },
|
|
37
32
|
labelKey: { type: null, required: false, default: "label" },
|
|
38
33
|
class: { type: null, required: false },
|
|
39
34
|
b24ui: { type: null, required: false },
|
|
40
35
|
modelValue: { type: String, required: false },
|
|
41
36
|
defaultValue: { type: String, required: false },
|
|
42
|
-
delayDuration: { type: Number, required: false, default:
|
|
37
|
+
delayDuration: { type: Number, required: false, default: 200 },
|
|
43
38
|
disableClickTrigger: { type: Boolean, required: false },
|
|
44
39
|
disableHoverTrigger: { type: Boolean, required: false },
|
|
45
40
|
skipDelayDuration: { type: Number, required: false },
|
|
@@ -67,7 +62,7 @@ const rootProps = useForwardPropsEmits(computed(() => ({
|
|
|
67
62
|
const accordionProps = useForwardPropsEmits(reactivePick(props, "collapsible", "disabled", "type", "unmountOnHide"), emits);
|
|
68
63
|
const contentProps = toRef(() => props.content);
|
|
69
64
|
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: "
|
|
65
|
+
const popoverProps = toRef(() => defu(typeof props.popover === "boolean" ? {} : props.popover, { arrow: true, mode: "hover", content: { side: "right", align: "center", alignOffset: 2 } }));
|
|
71
66
|
const [DefineLinkTemplate, ReuseLinkTemplate] = createReusableTemplate();
|
|
72
67
|
const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate({
|
|
73
68
|
props: {
|
|
@@ -85,12 +80,7 @@ const getLabel = (item) => {
|
|
|
85
80
|
};
|
|
86
81
|
const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.navigationMenu || {} })({
|
|
87
82
|
orientation: props.orientation,
|
|
88
|
-
|
|
89
|
-
collapsed: props.collapsed,
|
|
90
|
-
color: props.color,
|
|
91
|
-
variant: props.variant,
|
|
92
|
-
highlight: props.highlight,
|
|
93
|
-
highlightColor: props.highlightColor || props.color
|
|
83
|
+
collapsed: props.collapsed
|
|
94
84
|
}));
|
|
95
85
|
const lists = computed(
|
|
96
86
|
() => props.items?.length ? isArrayOfArray(props.items) ? props.items : [props.items] : []
|
|
@@ -110,13 +100,33 @@ function getAccordionDefaultValue(list, level = 0) {
|
|
|
110
100
|
<DefineLinkTemplate v-slot="{ item, active, index }">
|
|
111
101
|
<slot :name="item.slot || 'item'" :item="item" :index="index">
|
|
112
102
|
<span :class="b24ui.linkLabelWrapper({ class: props.b24ui?.linkLabelWrapper, active })">
|
|
113
|
-
<slot
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
103
|
+
<slot
|
|
104
|
+
:name="item.slot ? `${item.slot}-leading` : 'item-leading'"
|
|
105
|
+
:item="item"
|
|
106
|
+
:active="active"
|
|
107
|
+
:index="index"
|
|
108
|
+
>
|
|
109
|
+
<template v-if="orientation === 'vertical' && item.type !== 'label'">
|
|
110
|
+
<Component
|
|
111
|
+
:is="item.icon"
|
|
112
|
+
v-if="item.icon"
|
|
113
|
+
:class="b24ui.linkLeadingIcon({ class: [props.b24ui?.linkLeadingIcon, item.b24ui?.linkLeadingIcon], active, disabled: !!item.disabled })"
|
|
114
|
+
/>
|
|
115
|
+
<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 })" />
|
|
116
|
+
</template>
|
|
117
|
+
<div
|
|
118
|
+
v-if="item.hint && item.type !== 'label' && orientation === 'horizontal'"
|
|
119
|
+
:class="b24ui.linkLeadingHint({ class: [props.b24ui?.linkLeadingHint, item.b24ui?.linkLeadingHint] })"
|
|
120
|
+
>
|
|
121
|
+
{{ item.hint }}
|
|
122
|
+
</div>
|
|
123
|
+
<B24Badge
|
|
124
|
+
v-if="item.badge !== void 0 && item.type !== 'label'"
|
|
125
|
+
color="air-primary-alert"
|
|
126
|
+
:size="item.b24ui?.linkLeadingBadgeSize || props.b24ui?.linkLeadingBadgeSize || b24ui.linkLeadingBadgeSize()"
|
|
127
|
+
v-bind="typeof item.badge === 'string' || typeof item.badge === 'number' ? { label: item.badge } : item.badge"
|
|
128
|
+
:class="b24ui.linkLeadingBadge({ class: [props.b24ui?.linkLeadingBadge, item.b24ui?.linkLeadingBadge] })"
|
|
118
129
|
/>
|
|
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 })" />
|
|
120
130
|
</slot>
|
|
121
131
|
|
|
122
132
|
<span
|
|
@@ -126,17 +136,16 @@ function getAccordionDefaultValue(list, level = 0) {
|
|
|
126
136
|
<slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="active" :index="index">
|
|
127
137
|
{{ getLabel(item) }}
|
|
128
138
|
</slot>
|
|
129
|
-
|
|
130
|
-
<Component
|
|
131
|
-
:is="typeof externalIcon !== 'boolean' ? externalIcon : icons.external"
|
|
132
|
-
v-if="item.target === '_blank' && externalIcon !== false"
|
|
133
|
-
:class="b24ui.linkLabelExternalIcon({ class: [props.b24ui?.linkLabelExternalIcon, item.b24ui?.linkLabelExternalIcon], active })"
|
|
134
|
-
/>
|
|
135
139
|
</span>
|
|
140
|
+
<Component
|
|
141
|
+
:is="typeof externalIcon !== 'boolean' ? externalIcon : icons.external"
|
|
142
|
+
v-if="item.target === '_blank' && externalIcon !== false"
|
|
143
|
+
:class="b24ui.linkLabelExternalIcon({ class: [props.b24ui?.linkLabelExternalIcon, item.b24ui?.linkLabelExternalIcon], active })"
|
|
144
|
+
/>
|
|
136
145
|
</span>
|
|
137
146
|
<component
|
|
138
147
|
:is="orientation === 'vertical' && item.children?.length && !collapsed ? AccordionTrigger : 'span'"
|
|
139
|
-
v-if="(!collapsed || orientation !== 'vertical') && (
|
|
148
|
+
v-if="(!collapsed || orientation !== 'vertical') && (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
149
|
:class="b24ui.linkTrailing({ class: [props.b24ui?.linkTrailing, item.b24ui?.linkTrailing] })"
|
|
141
150
|
>
|
|
142
151
|
<slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="active" :index="index">
|
|
@@ -152,16 +161,6 @@ function getAccordionDefaultValue(list, level = 0) {
|
|
|
152
161
|
v-else-if="item.trailingIcon"
|
|
153
162
|
:class="b24ui.linkTrailingIcon({ class: [props.b24ui?.linkTrailingIcon, item.b24ui?.linkTrailingIcon], active })"
|
|
154
163
|
/>
|
|
155
|
-
|
|
156
|
-
<B24Badge
|
|
157
|
-
v-if="item.badge"
|
|
158
|
-
color="danger"
|
|
159
|
-
depth="dark"
|
|
160
|
-
:use-fill="true"
|
|
161
|
-
:size="item.b24ui?.linkTrailingBadgeSize || props.b24ui?.linkTrailingBadgeSize || b24ui.linkTrailingBadgeSize()"
|
|
162
|
-
v-bind="typeof item.badge === 'string' || typeof item.badge === 'number' ? { label: item.badge } : item.badge"
|
|
163
|
-
:class="b24ui.linkTrailingBadge({ class: [props.b24ui?.linkTrailingBadge, item.b24ui?.linkTrailingBadge] })"
|
|
164
|
-
/>
|
|
165
164
|
</slot>
|
|
166
165
|
</component>
|
|
167
166
|
</slot>
|
|
@@ -210,43 +209,50 @@ function getAccordionDefaultValue(list, level = 0) {
|
|
|
210
209
|
</B24LinkBase>
|
|
211
210
|
|
|
212
211
|
<template #content>
|
|
213
|
-
<
|
|
214
|
-
<
|
|
215
|
-
<
|
|
216
|
-
{
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
<
|
|
225
|
-
<
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
212
|
+
<div :class="b24ui.popoverWrapper({ class: props.b24ui?.popoverWrapper })">
|
|
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
|
+
<div
|
|
235
|
+
v-if="childItem.hint"
|
|
236
|
+
:class="b24ui.childLinkHint({ class: [props.b24ui?.childLinkHint, item.b24ui?.childLinkHint] })"
|
|
237
|
+
>
|
|
238
|
+
{{ childItem.hint }}
|
|
239
|
+
</div>
|
|
237
240
|
|
|
241
|
+
<span :class="b24ui.childLinkLabel({ class: [props.b24ui?.childLinkLabel, item.b24ui?.childLinkLabel], active: childActive })">
|
|
242
|
+
{{ getLabel(childItem) }}
|
|
243
|
+
</span>
|
|
238
244
|
<Component
|
|
239
|
-
:is="typeof externalIcon === '
|
|
245
|
+
:is="typeof externalIcon === 'boolean' ? icons.external : externalIcon"
|
|
240
246
|
v-if="childItem.target === '_blank' && externalIcon !== false"
|
|
241
247
|
:class="b24ui.childLinkLabelExternalIcon({ class: [props.b24ui?.childLinkLabelExternalIcon, item.b24ui?.childLinkLabelExternalIcon], active: childActive })"
|
|
242
248
|
/>
|
|
243
|
-
</
|
|
244
|
-
</
|
|
245
|
-
</
|
|
246
|
-
</
|
|
247
|
-
</
|
|
248
|
-
</
|
|
249
|
-
</
|
|
249
|
+
</B24LinkBase>
|
|
250
|
+
</NavigationMenuLink>
|
|
251
|
+
</B24Link>
|
|
252
|
+
</li>
|
|
253
|
+
</ul>
|
|
254
|
+
</slot>
|
|
255
|
+
</div>
|
|
250
256
|
</template>
|
|
251
257
|
</B24Popover>
|
|
252
258
|
<B24Tooltip
|
|
@@ -309,20 +315,29 @@ function getAccordionDefaultValue(list, level = 0) {
|
|
|
309
315
|
:class="b24ui.childLinkIcon({ class: [props.b24ui?.childLinkIcon, item.b24ui?.childLinkIcon], active: childActive })"
|
|
310
316
|
/>
|
|
311
317
|
|
|
318
|
+
<div
|
|
319
|
+
v-if="childItem.hint"
|
|
320
|
+
:class="b24ui.childLinkHint({ class: [props.b24ui?.childLinkHint, item.b24ui?.childLinkHint] })"
|
|
321
|
+
>
|
|
322
|
+
{{ childItem.hint }}
|
|
323
|
+
</div>
|
|
312
324
|
<div :class="b24ui.childLinkWrapper({ class: [props.b24ui?.childLinkWrapper, item.b24ui?.childLinkWrapper] })">
|
|
313
325
|
<p :class="b24ui.childLinkLabel({ class: [props.b24ui?.childLinkLabel, item.b24ui?.childLinkLabel], active: childActive })">
|
|
314
326
|
{{ getLabel(childItem) }}
|
|
315
|
-
|
|
316
|
-
<Component
|
|
317
|
-
:is="typeof externalIcon === 'string' ? externalIcon : icons.external"
|
|
318
|
-
v-if="childItem.target === '_blank' && externalIcon !== false"
|
|
319
|
-
:class="b24ui.childLinkLabelExternalIcon({ class: [props.b24ui?.childLinkLabelExternalIcon, item.b24ui?.childLinkLabelExternalIcon], active: childActive })"
|
|
320
|
-
/>
|
|
321
|
-
</p>
|
|
322
|
-
<p v-if="childItem.description" :class="b24ui.childLinkDescription({ class: [props.b24ui?.childLinkDescription, item.b24ui?.childLinkDescription], active: childActive })">
|
|
323
|
-
{{ childItem.description }}
|
|
324
327
|
</p>
|
|
328
|
+
<B24Badge
|
|
329
|
+
v-if="childItem.badge"
|
|
330
|
+
color="air-primary-alert"
|
|
331
|
+
:size="item.b24ui?.childLinkBadgeSize || props.b24ui?.childLinkBadgeSize || b24ui.childLinkBadgeSize()"
|
|
332
|
+
v-bind="typeof childItem.badge === 'string' || typeof childItem.badge === 'number' ? { label: childItem.badge } : childItem.badge"
|
|
333
|
+
:class="b24ui.childLinkBadge({ class: [props.b24ui?.childLinkBadge, item.b24ui?.childLinkBadge] })"
|
|
334
|
+
/>
|
|
325
335
|
</div>
|
|
336
|
+
<Component
|
|
337
|
+
:is="typeof externalIcon === 'boolean' ? icons.external : externalIcon"
|
|
338
|
+
v-if="childItem.target === '_blank' && externalIcon !== false"
|
|
339
|
+
:class="b24ui.childLinkLabelExternalIcon({ class: [props.b24ui?.childLinkLabelExternalIcon, item.b24ui?.childLinkLabelExternalIcon], active: childActive })"
|
|
340
|
+
/>
|
|
326
341
|
</B24LinkBase>
|
|
327
342
|
</NavigationMenuLink>
|
|
328
343
|
</B24Link>
|
|
@@ -358,7 +373,7 @@ function getAccordionDefaultValue(list, level = 0) {
|
|
|
358
373
|
</DefineItemTemplate>
|
|
359
374
|
|
|
360
375
|
<NavigationMenuRoot
|
|
361
|
-
v-bind="rootProps"
|
|
376
|
+
v-bind="{ ...rootProps, ...$attrs }"
|
|
362
377
|
:data-collapsed="collapsed"
|
|
363
378
|
:class="b24ui.root({ class: [props.b24ui?.root, props.class] })"
|
|
364
379
|
data-slot="section"
|
|
@@ -390,10 +405,6 @@ function getAccordionDefaultValue(list, level = 0) {
|
|
|
390
405
|
<slot name="list-trailing" />
|
|
391
406
|
|
|
392
407
|
<div v-if="orientation === 'horizontal'" :class="b24ui.viewportWrapper({ class: props.b24ui?.viewportWrapper })">
|
|
393
|
-
<NavigationMenuIndicator v-if="arrow" :class="b24ui.indicator({ class: props.b24ui?.indicator })">
|
|
394
|
-
<div :class="b24ui.arrow({ class: props.b24ui?.arrow })" />
|
|
395
|
-
</NavigationMenuIndicator>
|
|
396
|
-
|
|
397
408
|
<NavigationMenuViewport
|
|
398
409
|
align="start"
|
|
399
410
|
:class="b24ui.viewport({ class: props.b24ui?.viewport })"
|
|
@@ -4,23 +4,38 @@ import theme from '#build/b24ui/navigation-menu';
|
|
|
4
4
|
import type { AvatarProps, BadgeProps, LinkProps, PopoverProps, TooltipProps, IconComponent } from '../types';
|
|
5
5
|
import type { ArrayOrNested, DynamicSlots, MergeTypes, NestedItem, EmitsToProps, ComponentConfig } from '../types/utils';
|
|
6
6
|
type NavigationMenu = ComponentConfig<typeof theme, AppConfig, 'navigationMenu'>;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @memo not use
|
|
9
|
+
* - description
|
|
10
|
+
* - type
|
|
11
|
+
* - b24ui
|
|
12
|
+
* - avatar
|
|
13
|
+
* - children - only 1 level
|
|
14
|
+
*/
|
|
15
|
+
export interface NavigationMenuChildItem extends Omit<NavigationMenuItem, 'type' | 'b24ui' | 'avatar' | 'children'> {
|
|
10
16
|
[key: string]: any;
|
|
11
17
|
}
|
|
12
18
|
export interface NavigationMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custom'> {
|
|
13
19
|
label?: string;
|
|
14
20
|
/**
|
|
21
|
+
* Icon is only used when `orientation` is `vertical`
|
|
15
22
|
* @IconComponent
|
|
16
23
|
*/
|
|
17
24
|
icon?: IconComponent;
|
|
25
|
+
/**
|
|
26
|
+
* Avatar is only used when `orientation` is `vertical`
|
|
27
|
+
* @AvatarProps
|
|
28
|
+
*/
|
|
18
29
|
avatar?: AvatarProps;
|
|
19
30
|
/**
|
|
20
31
|
* Display a badge on the item.
|
|
21
|
-
* `{ size: '
|
|
32
|
+
* `{ size: 'xs', color: 'air-primary-alert' }`{lang="ts"}
|
|
22
33
|
*/
|
|
23
34
|
badge?: string | number | BadgeProps;
|
|
35
|
+
/**
|
|
36
|
+
* Display a hint on the item.
|
|
37
|
+
*/
|
|
38
|
+
hint?: string;
|
|
24
39
|
/**
|
|
25
40
|
* Display a tooltip on the item when the menu is collapsed with the label of the item.
|
|
26
41
|
* This has priority over the global `tooltip` prop.
|
|
@@ -38,7 +53,7 @@ export interface NavigationMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'cu
|
|
|
38
53
|
/**
|
|
39
54
|
* The type of the item.
|
|
40
55
|
* The `label` type is only displayed in `vertical` orientation.
|
|
41
|
-
* The `trigger` type is used to force the item to be collapsible when
|
|
56
|
+
* The `trigger` type is used to force the item to be collapsible when it`s a link in `vertical` orientation.
|
|
42
57
|
* @defaultValue 'link'
|
|
43
58
|
*/
|
|
44
59
|
type?: 'label' | 'trigger' | 'link';
|
|
@@ -57,9 +72,17 @@ export interface NavigationMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'cu
|
|
|
57
72
|
open?: boolean;
|
|
58
73
|
onSelect?(e: Event): void;
|
|
59
74
|
class?: any;
|
|
60
|
-
b24ui?: Pick<NavigationMenu['slots'], 'item' | 'linkLeadingAvatarSize' | 'linkLeadingAvatar' | 'linkLeadingIcon' | 'linkLabel' | 'linkLabelExternalIcon' | 'linkTrailing' | '
|
|
75
|
+
b24ui?: Pick<NavigationMenu['slots'], 'item' | 'linkLeadingAvatarSize' | 'linkLeadingAvatar' | 'linkLeadingIcon' | 'linkLabel' | 'linkLabelExternalIcon' | 'linkTrailing' | 'linkLeadingHint' | 'linkLeadingBadgeSize' | 'linkLeadingBadge' | 'linkTrailingIcon' | 'label' | 'link' | 'content' | 'childList' | 'childLabel' | 'childItem' | 'childLink' | 'childLinkIcon' | 'childLinkHint' | 'childLinkBadgeSize' | 'childLinkBadge' | 'childLinkWrapper' | 'childLinkLabel' | 'childLinkLabelExternalIcon' | 'popoverWrapper'>;
|
|
61
76
|
[key: string]: any;
|
|
62
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* @memo remove contentOrientation
|
|
80
|
+
* @memo remove highlight
|
|
81
|
+
* @memo remove highlightColor
|
|
82
|
+
* @memo remove arrow
|
|
83
|
+
* @memo remove color
|
|
84
|
+
* @memo remove variant (link) -> use variant.pill
|
|
85
|
+
*/
|
|
63
86
|
export interface NavigationMenuProps<T extends ArrayOrNested<NavigationMenuItem> = ArrayOrNested<NavigationMenuItem>> extends Pick<NavigationMenuRootProps, 'modelValue' | 'defaultValue' | 'delayDuration' | 'disableClickTrigger' | 'disableHoverTrigger' | 'skipDelayDuration' | 'disablePointerLeaveClose' | 'unmountOnHide'>, Pick<AccordionRootProps, 'disabled' | 'type' | 'collapsible'> {
|
|
64
87
|
/**
|
|
65
88
|
* The element or component this component should render as.
|
|
@@ -80,14 +103,6 @@ export interface NavigationMenuProps<T extends ArrayOrNested<NavigationMenuItem>
|
|
|
80
103
|
*/
|
|
81
104
|
externalIcon?: boolean | IconComponent;
|
|
82
105
|
items?: T;
|
|
83
|
-
/**
|
|
84
|
-
* @defaultValue 'primary'
|
|
85
|
-
*/
|
|
86
|
-
color?: NavigationMenu['variants']['color'];
|
|
87
|
-
/**
|
|
88
|
-
* @defaultValue 'pill'
|
|
89
|
-
*/
|
|
90
|
-
variant?: NavigationMenu['variants']['variant'];
|
|
91
106
|
/**
|
|
92
107
|
* The orientation of the menu.
|
|
93
108
|
* @defaultValue 'horizontal'
|
|
@@ -107,31 +122,14 @@ export interface NavigationMenuProps<T extends ArrayOrNested<NavigationMenuItem>
|
|
|
107
122
|
tooltip?: boolean | TooltipProps;
|
|
108
123
|
/**
|
|
109
124
|
* Display a popover on the items when the menu is collapsed with the children list.
|
|
110
|
-
* `{ mode: 'hover', content: { side: 'right', align: '
|
|
125
|
+
* `{ mode: 'hover', content: { side: 'right', align: 'center', alignOffset: 2 } }`{lang="ts"}
|
|
111
126
|
* @defaultValue false
|
|
112
127
|
*/
|
|
113
128
|
popover?: boolean | PopoverProps;
|
|
114
|
-
/** Display a line next to the active item. */
|
|
115
|
-
highlight?: boolean;
|
|
116
|
-
/**
|
|
117
|
-
* @defaultValue 'primary'
|
|
118
|
-
*/
|
|
119
|
-
highlightColor?: NavigationMenu['variants']['highlightColor'];
|
|
120
129
|
/**
|
|
121
130
|
* The content of the menu.
|
|
122
131
|
*/
|
|
123
132
|
content?: Omit<NavigationMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<NavigationMenuContentEmits>>;
|
|
124
|
-
/**
|
|
125
|
-
* The orientation of the content.
|
|
126
|
-
* Only works when `orientation` is `horizontal`.
|
|
127
|
-
* @defaultValue 'vertical'
|
|
128
|
-
*/
|
|
129
|
-
contentOrientation?: NavigationMenu['variants']['contentOrientation'];
|
|
130
|
-
/**
|
|
131
|
-
* Display an arrow alongside the menu.
|
|
132
|
-
* @defaultValue false
|
|
133
|
-
*/
|
|
134
|
-
arrow?: boolean;
|
|
135
133
|
/**
|
|
136
134
|
* The key used to get the label from the item.
|
|
137
135
|
* @defaultValue 'label'
|
|
@@ -172,5 +170,5 @@ declare const _default: <T extends ArrayOrNested<NavigationMenuItem>>(__VLS_prop
|
|
|
172
170
|
};
|
|
173
171
|
export default _default;
|
|
174
172
|
type __VLS_PrettifyLocal<T> = {
|
|
175
|
-
[K in keyof T]: T[K];
|
|
173
|
+
[K in keyof T as K]: T[K];
|
|
176
174
|
} & {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{},
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
2
|
export default _default;
|
|
@@ -16,6 +16,7 @@ const props = defineProps({
|
|
|
16
16
|
content: { type: Object, required: false },
|
|
17
17
|
arrow: { type: [Boolean, Object], required: false },
|
|
18
18
|
portal: { type: [Boolean, String], required: false, skipCheck: true, default: true },
|
|
19
|
+
reference: { type: null, required: false },
|
|
19
20
|
dismissible: { type: Boolean, required: false, default: true },
|
|
20
21
|
class: { type: null, required: false },
|
|
21
22
|
b24ui: { type: null, required: false },
|
|
@@ -45,7 +46,7 @@ const contentEvents = computed(() => {
|
|
|
45
46
|
}
|
|
46
47
|
return {};
|
|
47
48
|
});
|
|
48
|
-
const arrowProps = toRef(() => props.arrow);
|
|
49
|
+
const arrowProps = toRef(() => defu(typeof props.arrow === "boolean" ? {} : props.arrow, { width: 20, height: 10 }));
|
|
49
50
|
const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.popover || {} })({
|
|
50
51
|
side: contentProps.value.side
|
|
51
52
|
}));
|
|
@@ -54,7 +55,12 @@ const Component = computed(() => props.mode === "hover" ? HoverCard : Popover);
|
|
|
54
55
|
|
|
55
56
|
<template>
|
|
56
57
|
<Component.Root v-slot="{ open }" v-bind="rootProps">
|
|
57
|
-
<Component.Trigger
|
|
58
|
+
<Component.Trigger
|
|
59
|
+
v-if="!!slots.default || !!reference"
|
|
60
|
+
as-child
|
|
61
|
+
:reference="reference"
|
|
62
|
+
:class="props.class"
|
|
63
|
+
>
|
|
58
64
|
<slot :open="open" />
|
|
59
65
|
</Component.Trigger>
|
|
60
66
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Popover } from 'reka-ui/namespaced';
|
|
2
|
-
import type { PopoverRootProps, HoverCardRootProps, PopoverRootEmits, PopoverContentProps, PopoverContentEmits, PopoverArrowProps } from 'reka-ui';
|
|
2
|
+
import type { PopoverRootProps, HoverCardRootProps, PopoverRootEmits, PopoverContentProps, PopoverContentEmits, PopoverArrowProps, HoverCardTriggerProps } from 'reka-ui';
|
|
3
3
|
import type { AppConfig } from '@nuxt/schema';
|
|
4
4
|
import theme from '#build/b24ui/popover';
|
|
5
5
|
import type { EmitsToProps, ComponentConfig } from '../types/utils';
|
|
@@ -25,6 +25,12 @@ export interface PopoverProps extends PopoverRootProps, Pick<HoverCardRootProps,
|
|
|
25
25
|
* @defaultValue true
|
|
26
26
|
*/
|
|
27
27
|
portal?: boolean | string | HTMLElement;
|
|
28
|
+
/**
|
|
29
|
+
* The reference (or anchor) element that is being referred to for positioning.
|
|
30
|
+
*
|
|
31
|
+
* If not provided will use the current component as anchor.
|
|
32
|
+
*/
|
|
33
|
+
reference?: HoverCardTriggerProps['reference'];
|
|
28
34
|
/**
|
|
29
35
|
* When `false`, the popover will not close when clicking outside or pressing escape.
|
|
30
36
|
* @defaultValue true
|
|
@@ -43,7 +49,7 @@ export interface PopoverSlots {
|
|
|
43
49
|
content(props?: {}): any;
|
|
44
50
|
anchor(props?: {}): any;
|
|
45
51
|
}
|
|
46
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PopoverProps,
|
|
52
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PopoverProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
47
53
|
"update:open": (value: boolean) => any;
|
|
48
54
|
"close:prevent": () => any;
|
|
49
55
|
}, string, import("vue").PublicProps, Readonly<PopoverProps> & Readonly<{
|
|
@@ -51,10 +57,10 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PopoverPro
|
|
|
51
57
|
"onClose:prevent"?: (() => any) | undefined;
|
|
52
58
|
}>, {
|
|
53
59
|
portal: boolean | string | HTMLElement;
|
|
54
|
-
mode: "click" | "hover";
|
|
55
60
|
dismissible: boolean;
|
|
56
61
|
openDelay: number;
|
|
57
62
|
closeDelay: number;
|
|
63
|
+
mode: "click" | "hover";
|
|
58
64
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, PopoverSlots>;
|
|
59
65
|
export default _default;
|
|
60
66
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -27,7 +27,7 @@ export interface ProgressProps extends Pick<ProgressRootProps, 'getValueLabel' |
|
|
|
27
27
|
*/
|
|
28
28
|
size?: Progress['variants']['size'];
|
|
29
29
|
/**
|
|
30
|
-
* @defaultValue 'primary'
|
|
30
|
+
* @defaultValue 'air-primary'
|
|
31
31
|
*/
|
|
32
32
|
color?: Progress['variants']['color'];
|
|
33
33
|
/**
|
|
@@ -53,16 +53,16 @@ export type ProgressSlots = {
|
|
|
53
53
|
step: number;
|
|
54
54
|
}) => any;
|
|
55
55
|
};
|
|
56
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProgressProps,
|
|
56
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ProgressProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
57
57
|
"update:modelValue": (value: string[] | undefined) => any;
|
|
58
58
|
"update:max": (value: number) => any;
|
|
59
59
|
}, string, import("vue").PublicProps, Readonly<ProgressProps> & Readonly<{
|
|
60
60
|
"onUpdate:modelValue"?: ((value: string[] | undefined) => any) | undefined;
|
|
61
61
|
"onUpdate:max"?: ((value: number) => any) | undefined;
|
|
62
62
|
}>, {
|
|
63
|
+
inverted: boolean;
|
|
63
64
|
orientation: Progress["variants"]["orientation"];
|
|
64
65
|
modelValue: number | null;
|
|
65
|
-
inverted: boolean;
|
|
66
66
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ProgressSlots>;
|
|
67
67
|
export default _default;
|
|
68
68
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -54,7 +54,7 @@ function normalizeItem(item) {
|
|
|
54
54
|
label: void 0
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
if (typeof item === "string" || typeof item === "number") {
|
|
57
|
+
if (typeof item === "string" || typeof item === "number" || typeof item === "bigint") {
|
|
58
58
|
return {
|
|
59
59
|
id: `${id}:${item}`,
|
|
60
60
|
value: String(item),
|
|
@@ -45,7 +45,7 @@ export interface RadioGroupProps<T extends RadioGroupItem = RadioGroupItem> exte
|
|
|
45
45
|
*/
|
|
46
46
|
variant?: RadioGroup['variants']['variant'];
|
|
47
47
|
/**
|
|
48
|
-
* @defaultValue 'primary'
|
|
48
|
+
* @defaultValue 'air-primary'
|
|
49
49
|
*/
|
|
50
50
|
color?: RadioGroup['variants']['color'];
|
|
51
51
|
/**
|
|
@@ -64,10 +64,11 @@ export interface RadioGroupProps<T extends RadioGroupItem = RadioGroupItem> exte
|
|
|
64
64
|
export type RadioGroupEmits = RadioGroupRootEmits & {
|
|
65
65
|
change: [payload: Event];
|
|
66
66
|
};
|
|
67
|
+
type NormalizeItem<T extends RadioGroupItem> = Exclude<T & {
|
|
68
|
+
id: string;
|
|
69
|
+
}, RadioGroupValue>;
|
|
67
70
|
type SlotProps<T extends RadioGroupItem> = (props: {
|
|
68
|
-
item: T
|
|
69
|
-
id: string;
|
|
70
|
-
};
|
|
71
|
+
item: NormalizeItem<T>;
|
|
71
72
|
modelValue?: RadioGroupValue;
|
|
72
73
|
}) => any;
|
|
73
74
|
export interface RadioGroupSlots<T extends RadioGroupItem = RadioGroupItem> {
|
|
@@ -89,5 +90,5 @@ declare const _default: <T extends RadioGroupItem>(__VLS_props: NonNullable<Awai
|
|
|
89
90
|
};
|
|
90
91
|
export default _default;
|
|
91
92
|
type __VLS_PrettifyLocal<T> = {
|
|
92
|
-
[K in keyof T]: T[K];
|
|
93
|
+
[K in keyof T as K]: T[K];
|
|
93
94
|
} & {};
|
|
@@ -14,7 +14,7 @@ export interface RangeProps extends Pick<SliderRootProps, 'name' | 'disabled' |
|
|
|
14
14
|
*/
|
|
15
15
|
size?: Range['variants']['size'];
|
|
16
16
|
/**
|
|
17
|
-
* @defaultValue 'primary'
|
|
17
|
+
* @defaultValue 'air-primary'
|
|
18
18
|
*/
|
|
19
19
|
color?: Range['variants']['color'];
|
|
20
20
|
/**
|
|
@@ -30,24 +30,24 @@ export interface RangeProps extends Pick<SliderRootProps, 'name' | 'disabled' |
|
|
|
30
30
|
b24ui?: Range['slots'];
|
|
31
31
|
}
|
|
32
32
|
export interface RangeEmits<T extends number | number[] = number | number[]> {
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
'update:modelValue': [payload: T];
|
|
34
|
+
'change': [payload: Event];
|
|
35
35
|
}
|
|
36
36
|
declare const _default: <T extends number | number[]>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
37
37
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
38
38
|
readonly onChange?: ((payload: Event) => any) | undefined;
|
|
39
|
-
readonly "onUpdate:modelValue"?: ((
|
|
39
|
+
readonly "onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
|
|
40
40
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onChange" | "onUpdate:modelValue"> & (RangeProps & {
|
|
41
41
|
modelValue?: T;
|
|
42
42
|
}) & Partial<{}>> & import("vue").PublicProps;
|
|
43
43
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
44
44
|
attrs: any;
|
|
45
45
|
slots: {};
|
|
46
|
-
emit:
|
|
46
|
+
emit: (((evt: "change", payload: Event) => void) & ((evt: "update:modelValue", payload: T) => void)) & ((evt: "update:modelValue", value: T | undefined) => void);
|
|
47
47
|
}>) => import("vue").VNode & {
|
|
48
48
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
49
49
|
};
|
|
50
50
|
export default _default;
|
|
51
51
|
type __VLS_PrettifyLocal<T> = {
|
|
52
|
-
[K in keyof T]: T[K];
|
|
52
|
+
[K in keyof T as K]: T[K];
|
|
53
53
|
} & {};
|