@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
|
@@ -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?.slideov
|
|
|
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,14 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.slideov
|
|
|
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
|
+
:data-side="side"
|
|
75
|
+
:class="b24ui.content({ class: [!slots.default && props.b24ui?.content, props.class] })"
|
|
76
|
+
v-bind="contentProps"
|
|
77
|
+
@after-enter="emits('after:enter')"
|
|
78
|
+
@after-leave="emits('after:leave')"
|
|
79
|
+
v-on="contentEvents"
|
|
80
|
+
>
|
|
74
81
|
<VisuallyHidden v-if="!!slots.content && (title || !!slots.title || (description || !!slots.description))">
|
|
75
82
|
<DialogTitle v-if="title || !!slots.title">
|
|
76
83
|
<slot name="title">
|
|
@@ -85,9 +92,9 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.slideov
|
|
|
85
92
|
</DialogDescription>
|
|
86
93
|
</VisuallyHidden>
|
|
87
94
|
|
|
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">
|
|
95
|
+
<slot name="content" :close="close">
|
|
96
|
+
<div v-if="!!slots.header || (title || !!slots.title) || (description || !!slots.description) || (props.close || !!slots.close)" :class="b24ui.header({ class: props.b24ui?.header })">
|
|
97
|
+
<slot name="header" :close="close">
|
|
91
98
|
<div :class="b24ui.wrapper({ class: props.b24ui?.wrapper })">
|
|
92
99
|
<DialogTitle v-if="title || !!slots.title" :class="b24ui.title({ class: props.b24ui?.title })">
|
|
93
100
|
<slot name="title">
|
|
@@ -102,19 +109,20 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.slideov
|
|
|
102
109
|
</DialogDescription>
|
|
103
110
|
</div>
|
|
104
111
|
|
|
105
|
-
<
|
|
106
|
-
|
|
112
|
+
<slot name="actions" />
|
|
113
|
+
|
|
114
|
+
<DialogClose v-if="props.close || !!slots.close" as-child>
|
|
115
|
+
<slot name="close" :close="close" :b24ui="b24ui">
|
|
107
116
|
<B24Button
|
|
108
|
-
v-if="close"
|
|
117
|
+
v-if="props.close"
|
|
109
118
|
:icon="closeIcon || icons.close"
|
|
110
|
-
size="md"
|
|
111
119
|
class="group"
|
|
112
120
|
:color="['left', 'right'].includes(props?.side) ? 'primary' : 'link'"
|
|
113
121
|
:aria-label="t('slideover.close')"
|
|
114
122
|
:b24ui="{
|
|
115
123
|
leadingIcon: ['left', 'right'].includes(props?.side) ? 'group-hover:rounded-full group-hover:border-1 group-hover:border-current' : ''
|
|
116
124
|
}"
|
|
117
|
-
v-bind="typeof close === 'object' ? close : {}"
|
|
125
|
+
v-bind="typeof props.close === 'object' ? props.close : {}"
|
|
118
126
|
:class="b24ui.close({ class: props.b24ui?.close })"
|
|
119
127
|
/>
|
|
120
128
|
</slot>
|
|
@@ -123,11 +131,11 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.slideov
|
|
|
123
131
|
</div>
|
|
124
132
|
|
|
125
133
|
<div :class="b24ui.body({ class: props.b24ui?.body, scrollbarThin: Boolean(props.scrollbarThin) })">
|
|
126
|
-
<slot name="body" />
|
|
134
|
+
<slot name="body" :close="close" />
|
|
127
135
|
</div>
|
|
128
136
|
|
|
129
137
|
<div v-if="!!slots.footer" :class="b24ui.footer({ class: props.b24ui?.footer })">
|
|
130
|
-
<slot name="footer" />
|
|
138
|
+
<slot name="footer" :close="close" />
|
|
131
139
|
</div>
|
|
132
140
|
</slot>
|
|
133
141
|
</DialogContent>
|
|
@@ -64,40 +64,53 @@ export interface SlideoverProps extends DialogRootProps {
|
|
|
64
64
|
}
|
|
65
65
|
export interface SlideoverEmits extends DialogRootEmits {
|
|
66
66
|
'after:leave': [];
|
|
67
|
+
'after:enter': [];
|
|
67
68
|
'close:prevent': [];
|
|
68
69
|
}
|
|
69
70
|
export interface SlideoverSlots {
|
|
70
71
|
default(props: {
|
|
71
72
|
open: boolean;
|
|
72
73
|
}): any;
|
|
73
|
-
content(props
|
|
74
|
-
|
|
74
|
+
content(props: {
|
|
75
|
+
close: () => void;
|
|
76
|
+
}): any;
|
|
77
|
+
header(props: {
|
|
78
|
+
close: () => void;
|
|
79
|
+
}): any;
|
|
75
80
|
title(props?: {}): any;
|
|
76
81
|
description(props?: {}): any;
|
|
82
|
+
actions(props?: {}): any;
|
|
77
83
|
close(props: {
|
|
84
|
+
close: () => void;
|
|
78
85
|
b24ui: {
|
|
79
86
|
[K in keyof Required<Slideover['slots']>]: (props?: Record<string, any>) => string;
|
|
80
87
|
};
|
|
81
88
|
}): any;
|
|
82
|
-
body(props
|
|
83
|
-
|
|
89
|
+
body(props: {
|
|
90
|
+
close: () => void;
|
|
91
|
+
}): any;
|
|
92
|
+
footer(props: {
|
|
93
|
+
close: () => void;
|
|
94
|
+
}): any;
|
|
84
95
|
}
|
|
85
96
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SlideoverProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
86
97
|
"update:open": (value: boolean) => any;
|
|
87
98
|
"after:leave": () => any;
|
|
99
|
+
"after:enter": () => any;
|
|
88
100
|
"close:prevent": () => any;
|
|
89
101
|
}, string, import("vue").PublicProps, Readonly<SlideoverProps> & Readonly<{
|
|
90
102
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
91
103
|
"onAfter:leave"?: (() => any) | undefined;
|
|
104
|
+
"onAfter:enter"?: (() => any) | undefined;
|
|
92
105
|
"onClose:prevent"?: (() => any) | undefined;
|
|
93
106
|
}>, {
|
|
94
107
|
close: boolean | Partial<ButtonProps>;
|
|
95
108
|
modal: boolean;
|
|
96
|
-
transition: boolean;
|
|
97
109
|
portal: boolean | string | HTMLElement;
|
|
98
110
|
overlay: boolean;
|
|
99
111
|
side: Slideover["variants"]["side"];
|
|
100
112
|
overlayBlur: Slideover["variants"]["overlayBlur"];
|
|
113
|
+
transition: boolean;
|
|
101
114
|
dismissible: boolean;
|
|
102
115
|
scrollbarThin: boolean;
|
|
103
116
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SlideoverSlots>;
|
|
@@ -48,7 +48,7 @@ const handleNavigationClick = () => {
|
|
|
48
48
|
</script>
|
|
49
49
|
|
|
50
50
|
<template>
|
|
51
|
-
<Primitive :as="as" :class="b24ui.root({ class: [props.
|
|
51
|
+
<Primitive :as="as" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
52
52
|
<header :class="b24ui.header({ class: props.b24ui?.header })">
|
|
53
53
|
<div
|
|
54
54
|
v-if="isUseSideBar"
|
|
@@ -54,7 +54,7 @@ function onUpdate(value) {
|
|
|
54
54
|
</script>
|
|
55
55
|
|
|
56
56
|
<template>
|
|
57
|
-
<Primitive :as="as" :class="b24ui.root({ class: [props.
|
|
57
|
+
<Primitive :as="as" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
58
58
|
<div :class="b24ui.container({ class: props.b24ui?.container })">
|
|
59
59
|
<SwitchRoot
|
|
60
60
|
:id="id"
|
|
@@ -3,7 +3,7 @@ import theme from "#build/b24ui/tabs";
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
|
-
import { computed } from "vue";
|
|
6
|
+
import { ref, computed } from "vue";
|
|
7
7
|
import { TabsRoot, TabsList, TabsIndicator, TabsTrigger, TabsContent, useForwardPropsEmits } from "reka-ui";
|
|
8
8
|
import { reactivePick } from "@vueuse/core";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
@@ -39,26 +39,42 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.tabs ||
|
|
|
39
39
|
size: props.size,
|
|
40
40
|
orientation: props.orientation
|
|
41
41
|
}));
|
|
42
|
+
const triggersRef = ref([]);
|
|
43
|
+
defineExpose({
|
|
44
|
+
triggersRef
|
|
45
|
+
});
|
|
42
46
|
</script>
|
|
43
47
|
|
|
44
48
|
<template>
|
|
45
|
-
<TabsRoot v-bind="rootProps" :class="b24ui.root({ class: [props.
|
|
49
|
+
<TabsRoot v-bind="rootProps" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
46
50
|
<TabsList :class="b24ui.list({ class: props.b24ui?.list })">
|
|
47
51
|
<TabsIndicator :class="b24ui.indicator({ class: props.b24ui?.indicator })" />
|
|
48
52
|
|
|
49
53
|
<slot name="list-leading" />
|
|
50
54
|
|
|
51
|
-
<TabsTrigger
|
|
55
|
+
<TabsTrigger
|
|
56
|
+
v-for="(item, index) in items"
|
|
57
|
+
:key="index"
|
|
58
|
+
:ref="(el) => triggersRef[index] = el"
|
|
59
|
+
:value="item.value || String(index)"
|
|
60
|
+
:disabled="item.disabled"
|
|
61
|
+
:class="b24ui.trigger({ class: [props.b24ui?.trigger, item.b24ui?.trigger] })"
|
|
62
|
+
>
|
|
52
63
|
<slot name="leading" :item="item" :index="index">
|
|
53
64
|
<Component
|
|
54
65
|
:is="item.icon"
|
|
55
66
|
v-if="item.icon"
|
|
56
|
-
:class="b24ui.leadingIcon({ class: props.b24ui?.leadingIcon })"
|
|
67
|
+
:class="b24ui.leadingIcon({ class: [props.b24ui?.leadingIcon, item.b24ui?.leadingIcon] })"
|
|
68
|
+
/>
|
|
69
|
+
<B24Avatar
|
|
70
|
+
v-else-if="item.avatar"
|
|
71
|
+
:size="item.b24ui?.leadingAvatarSize || props.b24ui?.leadingAvatarSize || b24ui.leadingAvatarSize()"
|
|
72
|
+
v-bind="item.avatar"
|
|
73
|
+
:class="b24ui.leadingAvatar({ class: [props.b24ui?.leadingAvatar, item.b24ui?.leadingAvatar] })"
|
|
57
74
|
/>
|
|
58
|
-
<B24Avatar v-else-if="item.avatar" :size="props.b24ui?.leadingAvatarSize || b24ui.leadingAvatarSize()" v-bind="item.avatar" :class="b24ui.leadingAvatar({ class: props.b24ui?.leadingAvatar })" />
|
|
59
75
|
</slot>
|
|
60
76
|
|
|
61
|
-
<span v-if="getLabel(item) || !!slots.default" :class="b24ui.label({ class: props.b24ui?.label })">
|
|
77
|
+
<span v-if="getLabel(item) || !!slots.default" :class="b24ui.label({ class: [props.b24ui?.label, item.b24ui?.label] })">
|
|
62
78
|
<slot :item="item" :index="index">{{ getLabel(item) }}</slot>
|
|
63
79
|
</span>
|
|
64
80
|
|
|
@@ -69,7 +85,12 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.tabs ||
|
|
|
69
85
|
</TabsList>
|
|
70
86
|
|
|
71
87
|
<template v-if="!!content">
|
|
72
|
-
<TabsContent
|
|
88
|
+
<TabsContent
|
|
89
|
+
v-for="(item, index) in items"
|
|
90
|
+
:key="index"
|
|
91
|
+
:value="item.value || String(index)"
|
|
92
|
+
:class="b24ui.content({ class: [props.b24ui?.content, item.b24ui?.content, item.class] })"
|
|
93
|
+
>
|
|
73
94
|
<slot :name="item.slot || 'content'" :item="item" :index="index">
|
|
74
95
|
{{ item.content }}
|
|
75
96
|
</slot>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ComponentPublicInstance } from 'vue';
|
|
1
2
|
import type { TabsRootProps, TabsRootEmits } from 'reka-ui';
|
|
2
3
|
import type { AppConfig } from '@nuxt/schema';
|
|
3
4
|
import theme from '#build/b24ui/tabs';
|
|
@@ -16,6 +17,8 @@ export interface TabsItem {
|
|
|
16
17
|
/** A unique value for the tab item. Defaults to the index. */
|
|
17
18
|
value?: string | number;
|
|
18
19
|
disabled?: boolean;
|
|
20
|
+
class?: any;
|
|
21
|
+
b24ui?: Pick<Tabs['slots'], 'trigger' | 'leadingIcon' | 'leadingAvatarSize' | 'leadingAvatar' | 'label' | 'content'>;
|
|
19
22
|
[key: string]: any;
|
|
20
23
|
}
|
|
21
24
|
export interface TabsProps<T extends TabsItem = TabsItem> extends Pick<TabsRootProps<string | number>, 'defaultValue' | 'modelValue' | 'activationMode' | 'unmountOnHide'> {
|
|
@@ -75,7 +78,9 @@ declare const _default: <T extends TabsItem>(__VLS_props: NonNullable<Awaited<ty
|
|
|
75
78
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
76
79
|
readonly "onUpdate:modelValue"?: ((payload: string | number) => any) | undefined;
|
|
77
80
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue"> & TabsProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
78
|
-
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
81
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
82
|
+
triggersRef: import("vue").Ref<ComponentPublicInstance[], ComponentPublicInstance[]>;
|
|
83
|
+
}>): void;
|
|
79
84
|
attrs: any;
|
|
80
85
|
slots: TabsSlots<T>;
|
|
81
86
|
emit: (evt: "update:modelValue", payload: string | number) => void;
|
|
@@ -5,6 +5,7 @@ import theme from "#build/b24ui/textarea";
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { ref, computed, onMounted, nextTick, watch } from "vue";
|
|
7
7
|
import { Primitive } from "reka-ui";
|
|
8
|
+
import { useVModel } from "@vueuse/core";
|
|
8
9
|
import { useAppConfig } from "#imports";
|
|
9
10
|
import { useComponentIcons } from "../composables/useComponentIcons";
|
|
10
11
|
import { useFormField } from "../composables/useFormField";
|
|
@@ -33,6 +34,9 @@ const props = defineProps({
|
|
|
33
34
|
tag: { type: String, required: false },
|
|
34
35
|
tagColor: { type: null, required: false },
|
|
35
36
|
highlight: { type: Boolean, required: false },
|
|
37
|
+
modelValue: { type: null, required: false },
|
|
38
|
+
defaultValue: { type: null, required: false },
|
|
39
|
+
modelModifiers: { type: Object, required: false },
|
|
36
40
|
class: { type: null, required: false },
|
|
37
41
|
b24ui: { type: null, required: false },
|
|
38
42
|
icon: { type: [Function, Object], required: false },
|
|
@@ -41,9 +45,9 @@ const props = defineProps({
|
|
|
41
45
|
trailing: { type: Boolean, required: false },
|
|
42
46
|
trailingIcon: { type: [Function, Object], required: false }
|
|
43
47
|
});
|
|
44
|
-
const slots = defineSlots();
|
|
45
48
|
const emits = defineEmits(["update:modelValue", "blur", "change"]);
|
|
46
|
-
const
|
|
49
|
+
const slots = defineSlots();
|
|
50
|
+
const modelValue = useVModel(props, "modelValue", emits, { defaultValue: props.defaultValue });
|
|
47
51
|
const appConfig = useAppConfig();
|
|
48
52
|
const { emitFormFocus, emitFormBlur, emitFormInput, emitFormChange, color, id, name, highlight, disabled, ariaAttrs } = useFormField(props, { deferInputValidation: true });
|
|
49
53
|
const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(props);
|
|
@@ -65,13 +69,13 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.textare
|
|
|
65
69
|
}));
|
|
66
70
|
const textareaRef = ref(null);
|
|
67
71
|
function updateInput(value) {
|
|
68
|
-
if (modelModifiers
|
|
72
|
+
if (props.modelModifiers?.trim) {
|
|
69
73
|
value = value?.trim() ?? null;
|
|
70
74
|
}
|
|
71
|
-
if (modelModifiers
|
|
75
|
+
if (props.modelModifiers?.number) {
|
|
72
76
|
value = looseToNumber(value);
|
|
73
77
|
}
|
|
74
|
-
if (modelModifiers
|
|
78
|
+
if (props.modelModifiers?.nullify) {
|
|
75
79
|
value ||= null;
|
|
76
80
|
}
|
|
77
81
|
modelValue.value = value;
|
|
@@ -79,16 +83,16 @@ function updateInput(value) {
|
|
|
79
83
|
}
|
|
80
84
|
function onInput(event) {
|
|
81
85
|
autoResize();
|
|
82
|
-
if (!modelModifiers
|
|
86
|
+
if (!props.modelModifiers?.lazy) {
|
|
83
87
|
updateInput(event.target.value);
|
|
84
88
|
}
|
|
85
89
|
}
|
|
86
90
|
function onChange(event) {
|
|
87
91
|
const value = event.target.value;
|
|
88
|
-
if (modelModifiers
|
|
92
|
+
if (props.modelModifiers?.lazy) {
|
|
89
93
|
updateInput(value);
|
|
90
94
|
}
|
|
91
|
-
if (modelModifiers
|
|
95
|
+
if (props.modelModifiers?.trim) {
|
|
92
96
|
event.target.value = value.trim();
|
|
93
97
|
}
|
|
94
98
|
emitFormChange();
|
|
@@ -138,7 +142,7 @@ defineExpose({
|
|
|
138
142
|
</script>
|
|
139
143
|
|
|
140
144
|
<template>
|
|
141
|
-
<Primitive :as="as" :class="b24ui.root({ class: [props.
|
|
145
|
+
<Primitive :as="as" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
142
146
|
<div v-if="isTag" :class="b24ui.tag({ class: props.b24ui?.tag })">
|
|
143
147
|
{{ props.tag }}
|
|
144
148
|
</div>
|
|
@@ -3,7 +3,8 @@ import theme from '#build/b24ui/textarea';
|
|
|
3
3
|
import type { UseComponentIconsProps } from '../composables/useComponentIcons';
|
|
4
4
|
import type { ComponentConfig } from '../types/utils';
|
|
5
5
|
type Textarea = ComponentConfig<typeof theme, AppConfig, 'textarea'>;
|
|
6
|
-
|
|
6
|
+
type TextareaValue = string | number | null;
|
|
7
|
+
export interface TextareaProps<T extends TextareaValue = TextareaValue> extends UseComponentIconsProps {
|
|
7
8
|
/**
|
|
8
9
|
* The element or component this component should render as.
|
|
9
10
|
* @defaultValue 'div'
|
|
@@ -81,11 +82,20 @@ export interface TextareaProps extends UseComponentIconsProps {
|
|
|
81
82
|
* @defaultValue false
|
|
82
83
|
*/
|
|
83
84
|
highlight?: boolean;
|
|
85
|
+
modelValue?: T;
|
|
86
|
+
defaultValue?: T;
|
|
87
|
+
modelModifiers?: {
|
|
88
|
+
string?: boolean;
|
|
89
|
+
number?: boolean;
|
|
90
|
+
trim?: boolean;
|
|
91
|
+
lazy?: boolean;
|
|
92
|
+
nullify?: boolean;
|
|
93
|
+
};
|
|
84
94
|
class?: any;
|
|
85
95
|
b24ui?: Textarea['slots'];
|
|
86
96
|
}
|
|
87
|
-
export interface TextareaEmits {
|
|
88
|
-
(e: 'update:modelValue', payload:
|
|
97
|
+
export interface TextareaEmits<T extends TextareaValue = TextareaValue> {
|
|
98
|
+
(e: 'update:modelValue', payload: T): void;
|
|
89
99
|
(e: 'blur', event: FocusEvent): void;
|
|
90
100
|
(e: 'change', event: Event): void;
|
|
91
101
|
}
|
|
@@ -94,31 +104,22 @@ export interface TextareaSlots {
|
|
|
94
104
|
default(props?: {}): any;
|
|
95
105
|
trailing(props?: {}): any;
|
|
96
106
|
}
|
|
97
|
-
declare const _default:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}> &
|
|
110
|
-
|
|
111
|
-
onChange?: ((event: Event) => any) | undefined;
|
|
112
|
-
"onUpdate:modelValue"?: ((payload: string | number) => any) | undefined;
|
|
113
|
-
}>, {
|
|
114
|
-
autofocusDelay: number;
|
|
115
|
-
autoresizeDelay: number;
|
|
116
|
-
rows: number;
|
|
117
|
-
maxrows: number;
|
|
118
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, TextareaSlots>;
|
|
119
|
-
export default _default;
|
|
120
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
121
|
-
new (): {
|
|
122
|
-
$slots: S;
|
|
123
|
-
};
|
|
107
|
+
declare const _default: <T extends TextareaValue>(__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<{
|
|
108
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
109
|
+
readonly onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
110
|
+
readonly onChange?: ((event: Event) => any) | undefined;
|
|
111
|
+
readonly "onUpdate:modelValue"?: ((payload: T) => any) | undefined;
|
|
112
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onBlur" | "onChange" | "onUpdate:modelValue"> & TextareaProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
113
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
114
|
+
textareaRef: import("vue").Ref<HTMLTextAreaElement | null, HTMLTextAreaElement | null>;
|
|
115
|
+
}>): void;
|
|
116
|
+
attrs: any;
|
|
117
|
+
slots: TextareaSlots;
|
|
118
|
+
emit: TextareaEmits<T>;
|
|
119
|
+
}>) => import("vue").VNode & {
|
|
120
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
124
121
|
};
|
|
122
|
+
export default _default;
|
|
123
|
+
type __VLS_PrettifyLocal<T> = {
|
|
124
|
+
[K in keyof T]: T[K];
|
|
125
|
+
} & {};
|
|
@@ -3,7 +3,7 @@ import theme from "#build/b24ui/toast";
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
|
-
import { ref, computed, onMounted } from "vue";
|
|
6
|
+
import { ref, computed, onMounted, nextTick } from "vue";
|
|
7
7
|
import { ToastRoot, ToastTitle, ToastDescription, ToastAction, ToastClose, useForwardPropsEmits } from "reka-ui";
|
|
8
8
|
import { reactivePick } from "@vueuse/core";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
@@ -20,6 +20,7 @@ const props = defineProps({
|
|
|
20
20
|
avatar: { type: Object, required: false },
|
|
21
21
|
color: { type: null, required: false },
|
|
22
22
|
orientation: { type: null, required: false, default: "vertical" },
|
|
23
|
+
progress: { type: Boolean, required: false, default: true },
|
|
23
24
|
actions: { type: Array, required: false },
|
|
24
25
|
close: { type: [Boolean, Object], required: false, default: true },
|
|
25
26
|
closeIcon: { type: [Function, Object], required: false },
|
|
@@ -46,9 +47,9 @@ onMounted(() => {
|
|
|
46
47
|
if (!el.value) {
|
|
47
48
|
return;
|
|
48
49
|
}
|
|
49
|
-
|
|
50
|
-
height.value = el.value
|
|
51
|
-
}
|
|
50
|
+
nextTick(() => {
|
|
51
|
+
height.value = el.value?.$el?.getBoundingClientRect()?.height;
|
|
52
|
+
});
|
|
52
53
|
});
|
|
53
54
|
defineExpose({
|
|
54
55
|
height
|
|
@@ -61,7 +62,7 @@ defineExpose({
|
|
|
61
62
|
v-slot="{ remaining, duration }"
|
|
62
63
|
v-bind="rootProps"
|
|
63
64
|
:data-orientation="orientation"
|
|
64
|
-
:class="b24ui.root({ class: [props.
|
|
65
|
+
:class="b24ui.root({ class: [props.b24ui?.root, props.class] })"
|
|
65
66
|
:style="{ '--height': height }"
|
|
66
67
|
>
|
|
67
68
|
<slot name="leading">
|
|
@@ -127,6 +128,6 @@ defineExpose({
|
|
|
127
128
|
</ToastClose>
|
|
128
129
|
</div>
|
|
129
130
|
|
|
130
|
-
<div v-if="remaining > 0 && duration" :class="b24ui.progress({ class: props.b24ui?.progress })" :style="{ width: `${remaining / duration * 100}%` }" />
|
|
131
|
+
<div v-if="progress && remaining > 0 && duration" :class="b24ui.progress({ class: props.b24ui?.progress })" :style="{ width: `${remaining / duration * 100}%` }" />
|
|
131
132
|
</ToastRoot>
|
|
132
133
|
</template>
|
|
@@ -26,6 +26,11 @@ export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open'
|
|
|
26
26
|
* @defaultValue 'vertical'
|
|
27
27
|
*/
|
|
28
28
|
orientation?: Toast['variants']['orientation'];
|
|
29
|
+
/**
|
|
30
|
+
* Whether to show the progress bar.
|
|
31
|
+
* @defaultValue true
|
|
32
|
+
*/
|
|
33
|
+
progress?: boolean;
|
|
29
34
|
/**
|
|
30
35
|
* Display a list of actions:
|
|
31
36
|
* - under the title and description when orientation is `vertical`
|
|
@@ -147,6 +152,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ToastProps
|
|
|
147
152
|
}>, "currentTarget">) => any) | undefined;
|
|
148
153
|
}>, {
|
|
149
154
|
close: boolean | Partial<ButtonProps>;
|
|
155
|
+
progress: boolean;
|
|
150
156
|
orientation: Toast["variants"]["orientation"];
|
|
151
157
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ToastSlots>;
|
|
152
158
|
export default _default;
|
|
@@ -18,6 +18,7 @@ import B24Toast from "./Toast.vue";
|
|
|
18
18
|
const props = defineProps({
|
|
19
19
|
position: { type: null, required: false, default: "top-right" },
|
|
20
20
|
expand: { type: Boolean, required: false, default: true },
|
|
21
|
+
progress: { type: Boolean, required: false, default: true },
|
|
21
22
|
portal: { type: [Boolean, String], required: false, skipCheck: true, default: true },
|
|
22
23
|
duration: { type: Number, required: false, default: 5e3 },
|
|
23
24
|
class: { type: null, required: false },
|
|
@@ -76,6 +77,7 @@ function getOffset(index) {
|
|
|
76
77
|
v-for="(toast, index) in toasts"
|
|
77
78
|
:key="toast.id"
|
|
78
79
|
ref="refs"
|
|
80
|
+
:progress="progress"
|
|
79
81
|
v-bind="proxyToastProps(toast)"
|
|
80
82
|
:close="toast.close"
|
|
81
83
|
:data-expanded="expanded"
|
|
@@ -88,9 +90,7 @@ function getOffset(index) {
|
|
|
88
90
|
'--translate': expanded ? 'calc(var(--offset) * var(--translate-factor))' : 'calc(var(--before) * var(--gap))',
|
|
89
91
|
'--transform': 'translateY(var(--translate)) scale(var(--scale))'
|
|
90
92
|
}"
|
|
91
|
-
:class="
|
|
92
|
-
'cursor-pointer': !!toast.onClick
|
|
93
|
-
}]"
|
|
93
|
+
:class="b24ui.base({ class: [props.b24ui?.base, toast.onClick ? 'cursor-pointer' : void 0] })"
|
|
94
94
|
@update:open="onUpdateOpen($event, toast.id)"
|
|
95
95
|
@click="toast.onClick && toast.onClick(toast)"
|
|
96
96
|
/>
|
|
@@ -98,7 +98,7 @@ function getOffset(index) {
|
|
|
98
98
|
<ToastPortal v-bind="portalProps">
|
|
99
99
|
<ToastViewport
|
|
100
100
|
:data-expanded="expanded"
|
|
101
|
-
:class="b24ui.viewport({ class: [props.
|
|
101
|
+
:class="b24ui.viewport({ class: [props.b24ui?.viewport, props.class] })"
|
|
102
102
|
:style="{
|
|
103
103
|
'--scale-factor': '0.05',
|
|
104
104
|
'--translate-factor': position?.startsWith('top') ? '1px' : '-1px',
|
|
@@ -14,6 +14,11 @@ export interface ToasterProps extends Omit<ToastProviderProps, 'swipeDirection'>
|
|
|
14
14
|
* @defaultValue true
|
|
15
15
|
*/
|
|
16
16
|
expand?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Whether to show the progress bar on all toasts.
|
|
19
|
+
* @defaultValue true
|
|
20
|
+
*/
|
|
21
|
+
progress?: boolean;
|
|
17
22
|
/**
|
|
18
23
|
* Render the toaster in a portal.
|
|
19
24
|
* @defaultValue true
|
|
@@ -30,6 +35,7 @@ export interface ToasterSlots {
|
|
|
30
35
|
default(props?: {}): any;
|
|
31
36
|
}
|
|
32
37
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ToasterProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ToasterProps> & Readonly<{}>, {
|
|
38
|
+
progress: boolean;
|
|
33
39
|
position: Toaster["variants"]["position"];
|
|
34
40
|
duration: number;
|
|
35
41
|
expand: boolean;
|
|
@@ -17,6 +17,7 @@ const props = defineProps({
|
|
|
17
17
|
content: { type: Object, required: false },
|
|
18
18
|
arrow: { type: [Boolean, Object], required: false },
|
|
19
19
|
portal: { type: [Boolean, String], required: false, skipCheck: true, default: true },
|
|
20
|
+
reference: { type: null, required: false },
|
|
20
21
|
class: { type: null, required: false },
|
|
21
22
|
b24ui: { type: null, required: false },
|
|
22
23
|
defaultOpen: { type: Boolean, required: false },
|
|
@@ -41,12 +42,18 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.tooltip
|
|
|
41
42
|
|
|
42
43
|
<template>
|
|
43
44
|
<TooltipRoot v-slot="{ open }" v-bind="rootProps">
|
|
44
|
-
<TooltipTrigger
|
|
45
|
+
<TooltipTrigger
|
|
46
|
+
v-if="!!slots.default || !!reference"
|
|
47
|
+
v-bind="$attrs"
|
|
48
|
+
as-child
|
|
49
|
+
:reference="reference"
|
|
50
|
+
:class="props.class"
|
|
51
|
+
>
|
|
45
52
|
<slot :open="open" />
|
|
46
53
|
</TooltipTrigger>
|
|
47
54
|
|
|
48
55
|
<TooltipPortal v-bind="portalProps">
|
|
49
|
-
<TooltipContent v-bind="contentProps" :class="b24ui.content({ class: [!slots.default && props.
|
|
56
|
+
<TooltipContent v-bind="contentProps" :class="b24ui.content({ class: [!slots.default && props.b24ui?.content, props.class] })">
|
|
50
57
|
<slot name="content">
|
|
51
58
|
<span v-if="text" :class="b24ui.text({ class: props.b24ui?.text })">{{ text }}</span>
|
|
52
59
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TooltipRootProps, TooltipRootEmits, TooltipContentProps, TooltipContentEmits, TooltipArrowProps } from 'reka-ui';
|
|
1
|
+
import type { TooltipRootProps, TooltipRootEmits, TooltipContentProps, TooltipContentEmits, TooltipArrowProps, TooltipTriggerProps } from 'reka-ui';
|
|
2
2
|
import type { AppConfig } from '@nuxt/schema';
|
|
3
3
|
import theme from '#build/b24ui/tooltip';
|
|
4
4
|
import type { KbdProps } from '../types';
|
|
@@ -24,6 +24,7 @@ export interface TooltipProps extends TooltipRootProps {
|
|
|
24
24
|
* @defaultValue true
|
|
25
25
|
*/
|
|
26
26
|
portal?: boolean | string | HTMLElement;
|
|
27
|
+
reference?: TooltipTriggerProps['reference'];
|
|
27
28
|
class?: any;
|
|
28
29
|
b24ui?: Tooltip['slots'];
|
|
29
30
|
}
|
|
@@ -37,7 +37,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.content
|
|
|
37
37
|
<template>
|
|
38
38
|
<Primitive
|
|
39
39
|
:as="as"
|
|
40
|
-
:class="b24ui.base({ class: [props.
|
|
40
|
+
:class="b24ui.base({ class: [props.b24ui?.base, props.class] })"
|
|
41
41
|
>
|
|
42
42
|
<slot />
|
|
43
43
|
</Primitive>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Locale, Direction } from '../types/locale';
|
|
2
|
+
import type { DeepPartial } from '../types/utils';
|
|
2
3
|
interface DefineLocaleOptions<M> {
|
|
3
4
|
name: string;
|
|
4
5
|
code: string;
|
|
@@ -7,4 +8,5 @@ interface DefineLocaleOptions<M> {
|
|
|
7
8
|
messages: M;
|
|
8
9
|
}
|
|
9
10
|
export declare function defineLocale<M>(options: DefineLocaleOptions<M>): Locale<M>;
|
|
11
|
+
export declare function extendLocale<M>(locale: Locale<M>, options: Partial<DefineLocaleOptions<DeepPartial<M>>>): Locale<M>;
|
|
10
12
|
export {};
|