@bitrix24/b24ui-nuxt 0.5.9 → 0.5.10
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/navigation-menu.ts +0 -2
- package/.nuxt/b24ui/popover.ts +1 -1
- package/dist/meta.d.mts +4789 -4897
- package/dist/meta.mjs +4789 -4897
- package/dist/module.json +5 -5
- package/dist/module.mjs +11 -7
- package/dist/runtime/components/Advice.vue +47 -54
- package/dist/runtime/components/Advice.vue.d.ts +170 -0
- package/dist/runtime/components/Alert.vue +71 -96
- package/dist/runtime/components/Alert.vue.d.ts +464 -0
- package/dist/runtime/components/App.vue +37 -34
- package/dist/runtime/components/App.vue.d.ts +23 -0
- package/dist/runtime/components/Avatar.vue +69 -81
- package/dist/runtime/components/Avatar.vue.d.ts +281 -0
- package/dist/runtime/components/AvatarGroup.vue +53 -76
- package/dist/runtime/components/AvatarGroup.vue.d.ts +204 -0
- package/dist/runtime/components/Badge.vue +83 -83
- package/dist/runtime/components/Badge.vue.d.ts +517 -0
- package/dist/runtime/components/Button.vue +219 -149
- package/dist/runtime/components/Button.vue.d.ts +640 -0
- package/dist/runtime/components/ButtonGroup.vue +35 -51
- package/dist/runtime/components/ButtonGroup.vue.d.ts +116 -0
- package/dist/runtime/components/Calendar.vue +186 -152
- package/dist/runtime/components/Calendar.vue.d.ts +437 -0
- package/dist/runtime/components/Checkbox.vue +84 -73
- package/dist/runtime/components/Checkbox.vue.d.ts +354 -0
- package/dist/runtime/components/Chip.vue +59 -74
- package/dist/runtime/components/Chip.vue.d.ts +271 -0
- package/dist/runtime/components/Collapsible.vue +44 -41
- package/dist/runtime/components/Collapsible.vue.d.ts +118 -0
- package/dist/runtime/components/Container.vue +18 -27
- package/dist/runtime/components/Container.vue.d.ts +27 -0
- package/dist/runtime/components/Countdown.vue +198 -378
- package/dist/runtime/components/Countdown.vue.d.ts +356 -0
- package/dist/runtime/components/DescriptionList.vue +102 -149
- package/dist/runtime/components/DescriptionList.vue.d.ts +379 -0
- package/dist/runtime/components/DropdownMenu.vue +83 -139
- package/dist/runtime/components/DropdownMenu.vue.d.ts +533 -0
- package/dist/runtime/components/DropdownMenuContent.vue +137 -81
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +228 -0
- package/dist/runtime/components/Form.vue +162 -216
- package/dist/runtime/components/Form.vue.d.ts +55 -0
- package/dist/runtime/components/FormField.vue +76 -80
- package/dist/runtime/components/FormField.vue.d.ts +282 -0
- package/dist/runtime/components/Input.vue +160 -179
- package/dist/runtime/components/Input.vue.d.ts +755 -0
- package/dist/runtime/components/InputMenu.vue +300 -381
- package/dist/runtime/components/InputMenu.vue.d.ts +1504 -0
- package/dist/runtime/components/InputNumber.vue +178 -175
- package/dist/runtime/components/InputNumber.vue.d.ts +658 -0
- package/dist/runtime/components/Kbd.vue +33 -45
- package/dist/runtime/components/Kbd.vue.d.ts +109 -0
- package/dist/runtime/components/Link.vue +179 -173
- package/dist/runtime/components/Link.vue.d.ts +129 -0
- package/dist/runtime/components/LinkBase.vue +64 -42
- package/dist/runtime/components/LinkBase.vue.d.ts +48 -0
- package/dist/runtime/components/Modal.vue +105 -127
- package/dist/runtime/components/Modal.vue.d.ts +327 -0
- package/dist/runtime/components/ModalDialogClose.vue +4 -8
- package/dist/runtime/components/ModalDialogClose.vue.d.ts +10 -0
- package/dist/runtime/components/Navbar.vue +24 -33
- package/dist/runtime/components/Navbar.vue.d.ts +101 -0
- package/dist/runtime/components/NavbarDivider.vue +24 -33
- package/dist/runtime/components/NavbarDivider.vue.d.ts +101 -0
- package/dist/runtime/components/NavbarSection.vue +24 -33
- package/dist/runtime/components/NavbarSection.vue.d.ts +101 -0
- package/dist/runtime/components/NavbarSpacer.vue +24 -33
- package/dist/runtime/components/NavbarSpacer.vue.d.ts +101 -0
- package/dist/runtime/components/NavigationMenu.vue +152 -216
- package/dist/runtime/components/NavigationMenu.vue.d.ts +824 -0
- package/dist/runtime/components/OverlayProvider.vue +13 -17
- package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -0
- package/dist/runtime/components/Popover.vue +81 -81
- package/dist/runtime/components/Popover.vue.d.ts +147 -0
- package/dist/runtime/components/Progress.vue +109 -136
- package/dist/runtime/components/Progress.vue.d.ts +592 -0
- package/dist/runtime/components/RadioGroup.vue +120 -134
- package/dist/runtime/components/RadioGroup.vue.d.ts +723 -0
- package/dist/runtime/components/Range.vue +94 -85
- package/dist/runtime/components/Range.vue.d.ts +417 -0
- package/dist/runtime/components/Select.vue +212 -260
- package/dist/runtime/components/Select.vue.d.ts +1200 -0
- package/dist/runtime/components/SelectMenu.vue +272 -366
- package/dist/runtime/components/SelectMenu.vue.d.ts +1298 -0
- package/dist/runtime/components/Separator.vue +61 -71
- package/dist/runtime/components/Separator.vue.d.ts +400 -0
- package/dist/runtime/components/Sidebar.vue +24 -33
- package/dist/runtime/components/Sidebar.vue.d.ts +101 -0
- package/dist/runtime/components/SidebarBody.vue +30 -38
- package/dist/runtime/components/SidebarBody.vue.d.ts +90 -0
- package/dist/runtime/components/SidebarFooter.vue +24 -33
- package/dist/runtime/components/SidebarFooter.vue.d.ts +101 -0
- package/dist/runtime/components/SidebarHeader.vue +24 -33
- package/dist/runtime/components/SidebarHeader.vue.d.ts +101 -0
- package/dist/runtime/components/SidebarHeading.vue +24 -33
- package/dist/runtime/components/SidebarHeading.vue.d.ts +101 -0
- package/dist/runtime/components/SidebarLayout.vue +40 -70
- package/dist/runtime/components/SidebarLayout.vue.d.ts +222 -0
- package/dist/runtime/components/SidebarSection.vue +24 -33
- package/dist/runtime/components/SidebarSection.vue.d.ts +101 -0
- package/dist/runtime/components/SidebarSpacer.vue +24 -33
- package/dist/runtime/components/SidebarSpacer.vue.d.ts +101 -0
- package/dist/runtime/components/Skeleton.vue +17 -22
- package/dist/runtime/components/Skeleton.vue.d.ts +26 -0
- package/dist/runtime/components/Slideover.vue +108 -131
- package/dist/runtime/components/Slideover.vue.d.ts +360 -0
- package/dist/runtime/components/StackedLayout.vue +40 -73
- package/dist/runtime/components/StackedLayout.vue.d.ts +192 -0
- package/dist/runtime/components/Switch.vue +100 -95
- package/dist/runtime/components/Switch.vue.d.ts +587 -0
- package/dist/runtime/components/Tabs.vue +83 -105
- package/dist/runtime/components/Tabs.vue.d.ts +453 -0
- package/dist/runtime/components/Textarea.vue +177 -201
- package/dist/runtime/components/Textarea.vue.d.ts +601 -0
- package/dist/runtime/components/Toast.vue +94 -105
- package/dist/runtime/components/Toast.vue.d.ts +438 -0
- package/dist/runtime/components/Toaster.vue +94 -111
- package/dist/runtime/components/Toaster.vue.d.ts +219 -0
- package/dist/runtime/components/Tooltip.vue +78 -64
- package/dist/runtime/components/Tooltip.vue.d.ts +186 -0
- package/dist/runtime/components/content/TableWrapper.vue +58 -70
- package/dist/runtime/components/content/TableWrapper.vue.d.ts +237 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
- package/dist/runtime/composables/useComponentIcons.d.ts +1 -1
- package/dist/runtime/composables/useFormField.d.ts +1 -1
- package/dist/runtime/prose/A.vue +18 -23
- package/dist/runtime/prose/A.vue.d.ts +84 -0
- package/dist/runtime/prose/Blockquote.vue +18 -23
- package/dist/runtime/prose/Blockquote.vue.d.ts +84 -0
- package/dist/runtime/prose/Code.vue +23 -31
- package/dist/runtime/prose/Code.vue.d.ts +97 -0
- package/dist/runtime/prose/Em.vue +18 -23
- package/dist/runtime/prose/Em.vue.d.ts +84 -0
- package/dist/runtime/prose/H1.vue +18 -23
- package/dist/runtime/prose/H1.vue.d.ts +97 -0
- package/dist/runtime/prose/H2.vue +18 -23
- package/dist/runtime/prose/H2.vue.d.ts +123 -0
- package/dist/runtime/prose/H3.vue +18 -23
- package/dist/runtime/prose/H3.vue.d.ts +123 -0
- package/dist/runtime/prose/H4.vue +18 -23
- package/dist/runtime/prose/H4.vue.d.ts +123 -0
- package/dist/runtime/prose/H5.vue +18 -23
- package/dist/runtime/prose/H5.vue.d.ts +123 -0
- package/dist/runtime/prose/H6.vue +18 -23
- package/dist/runtime/prose/H6.vue.d.ts +123 -0
- package/dist/runtime/prose/Hr.vue +18 -19
- package/dist/runtime/prose/Hr.vue.d.ts +74 -0
- package/dist/runtime/prose/Img.vue +18 -23
- package/dist/runtime/prose/Img.vue.d.ts +77 -0
- package/dist/runtime/prose/Li.vue +18 -23
- package/dist/runtime/prose/Li.vue.d.ts +84 -0
- package/dist/runtime/prose/Ol.vue +18 -23
- package/dist/runtime/prose/Ol.vue.d.ts +84 -0
- package/dist/runtime/prose/P.vue +18 -23
- package/dist/runtime/prose/P.vue.d.ts +84 -0
- package/dist/runtime/prose/Pre.vue +28 -33
- package/dist/runtime/prose/Pre.vue.d.ts +117 -0
- package/dist/runtime/prose/Strong.vue +18 -23
- package/dist/runtime/prose/Strong.vue.d.ts +84 -0
- package/dist/runtime/prose/Table.vue +44 -54
- package/dist/runtime/prose/Table.vue.d.ts +144 -0
- package/dist/runtime/prose/Tbody.vue +18 -23
- package/dist/runtime/prose/Tbody.vue.d.ts +84 -0
- package/dist/runtime/prose/Td.vue +18 -23
- package/dist/runtime/prose/Td.vue.d.ts +84 -0
- package/dist/runtime/prose/Th.vue +18 -23
- package/dist/runtime/prose/Th.vue.d.ts +84 -0
- package/dist/runtime/prose/Thead.vue +18 -23
- package/dist/runtime/prose/Thead.vue.d.ts +84 -0
- package/dist/runtime/prose/Tr.vue +18 -23
- package/dist/runtime/prose/Tr.vue.d.ts +84 -0
- package/dist/runtime/prose/Ul.vue +18 -23
- package/dist/runtime/prose/Ul.vue.d.ts +84 -0
- package/dist/runtime/vue/components/Link.vue +201 -202
- package/dist/runtime/vue/components/Link.vue.d.ts +129 -0
- package/dist/runtime/vue/stubs.d.ts +3 -3
- package/dist/shared/{b24ui-nuxt.C1lGF53R.mjs → b24ui-nuxt.CS9Lf0os.mjs} +4 -3
- package/dist/types.d.mts +3 -5
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +59 -32
- package/dist/meta.cjs +0 -72220
- package/dist/meta.d.cts +0 -72218
- package/dist/meta.d.ts +0 -72218
- package/dist/module.cjs +0 -59
- package/dist/module.d.cts +0 -15
- package/dist/module.d.ts +0 -15
- package/dist/shared/b24ui-nuxt.BVg3rkkG.cjs +0 -7720
- package/dist/types.d.ts +0 -7
- package/dist/unplugin.cjs +0 -236
- package/dist/unplugin.d.cts +0 -33
- package/dist/unplugin.d.ts +0 -33
- package/dist/vite.cjs +0 -21
- package/dist/vite.d.cts +0 -14
- package/dist/vite.d.ts +0 -14
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import { computed } from
|
|
3
|
-
import { useOverlay
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const onClose = (id: symbol, value: any) => {
|
|
15
|
-
close(id, value)
|
|
16
|
-
}
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useOverlay } from "../composables/useOverlay";
|
|
4
|
+
const { overlays, unMount, close } = useOverlay();
|
|
5
|
+
const mountedOverlays = computed(() => overlays.filter((overlay) => overlay.isMounted));
|
|
6
|
+
const onAfterLeave = (id) => {
|
|
7
|
+
close(id);
|
|
8
|
+
unMount(id);
|
|
9
|
+
};
|
|
10
|
+
const onClose = (id, value) => {
|
|
11
|
+
close(id, value);
|
|
12
|
+
};
|
|
17
13
|
</script>
|
|
18
14
|
|
|
19
15
|
<template>
|
|
@@ -23,7 +19,7 @@ const onClose = (id: symbol, value: any) => {
|
|
|
23
19
|
:key="overlay.id"
|
|
24
20
|
v-bind="overlay.props"
|
|
25
21
|
v-model:open="overlay.modelValue"
|
|
26
|
-
@close="(value
|
|
22
|
+
@close="(value) => onClose(overlay.id, value)"
|
|
27
23
|
@after:leave="onAfterLeave(overlay.id)"
|
|
28
24
|
/>
|
|
29
25
|
</template>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import type { EmitsToProps } from '../types/utils'
|
|
8
|
-
|
|
9
|
-
const appConfigPopover = _appConfig as AppConfig & { b24ui: { popover: Partial<typeof theme> } }
|
|
10
|
-
|
|
11
|
-
const popover = tv({ extend: tv(theme), ...(appConfigPopover.b24ui?.popover || {}) })
|
|
12
|
-
|
|
13
|
-
export interface PopoverProps extends PopoverRootProps, Pick<HoverCardRootProps, 'openDelay' | 'closeDelay'> {
|
|
14
|
-
/**
|
|
15
|
-
* The display mode of the popover.
|
|
16
|
-
* @defaultValue 'click'
|
|
17
|
-
*/
|
|
18
|
-
mode?: 'click' | 'hover'
|
|
19
|
-
/**
|
|
20
|
-
* The content of the popover.
|
|
21
|
-
* @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8 }
|
|
22
|
-
*/
|
|
23
|
-
content?: Omit<PopoverContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<PopoverContentEmits>>
|
|
24
|
-
/**
|
|
25
|
-
* Display an arrow alongside the popover.
|
|
26
|
-
* @defaultValue false
|
|
27
|
-
*/
|
|
28
|
-
arrow?: boolean | Omit<PopoverArrowProps, 'as' | 'asChild'>
|
|
29
|
-
/**
|
|
30
|
-
* Render the popover in a portal.
|
|
31
|
-
* @defaultValue true
|
|
32
|
-
*/
|
|
33
|
-
portal?: boolean
|
|
34
|
-
/**
|
|
35
|
-
* When `false`, the popover will not close when clicking outside or pressing escape.
|
|
36
|
-
* @defaultValue true
|
|
37
|
-
*/
|
|
38
|
-
dismissible?: boolean
|
|
39
|
-
class?: any
|
|
40
|
-
b24ui?: Partial<typeof popover.slots>
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface PopoverEmits extends PopoverRootEmits {}
|
|
44
|
-
|
|
45
|
-
export interface PopoverSlots {
|
|
46
|
-
default(props: { open: boolean }): any
|
|
47
|
-
content(props?: {}): any
|
|
48
|
-
}
|
|
1
|
+
<script>
|
|
2
|
+
import _appConfig from "#build/app.config";
|
|
3
|
+
import theme from "#build/b24ui/popover";
|
|
4
|
+
import { tv } from "../utils/tv";
|
|
5
|
+
const appConfigPopover = _appConfig;
|
|
6
|
+
const popover = tv({ extend: tv(theme), ...appConfigPopover.b24ui?.popover || {} });
|
|
49
7
|
</script>
|
|
50
8
|
|
|
51
|
-
<script setup
|
|
52
|
-
import { computed, toRef } from
|
|
53
|
-
import { defu } from
|
|
54
|
-
import { useForwardPropsEmits } from
|
|
55
|
-
import { Popover, HoverCard } from
|
|
56
|
-
import { reactivePick } from
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
9
|
+
<script setup>
|
|
10
|
+
import { computed, toRef } from "vue";
|
|
11
|
+
import { defu } from "defu";
|
|
12
|
+
import { useForwardPropsEmits } from "reka-ui";
|
|
13
|
+
import { Popover, HoverCard } from "reka-ui/namespaced";
|
|
14
|
+
import { reactivePick } from "@vueuse/core";
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
mode: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: false,
|
|
19
|
+
default: "click"
|
|
20
|
+
},
|
|
21
|
+
content: {
|
|
22
|
+
type: Object,
|
|
23
|
+
required: false
|
|
24
|
+
},
|
|
25
|
+
arrow: {
|
|
26
|
+
type: [Boolean, Object],
|
|
27
|
+
required: false
|
|
28
|
+
},
|
|
29
|
+
portal: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
required: false,
|
|
32
|
+
default: true
|
|
33
|
+
},
|
|
34
|
+
dismissible: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
required: false,
|
|
37
|
+
default: true
|
|
38
|
+
},
|
|
39
|
+
class: {
|
|
40
|
+
type: null,
|
|
41
|
+
required: false
|
|
42
|
+
},
|
|
43
|
+
b24ui: {
|
|
44
|
+
type: Object,
|
|
45
|
+
required: false
|
|
46
|
+
},
|
|
47
|
+
defaultOpen: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
required: false
|
|
50
|
+
},
|
|
51
|
+
open: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
required: false
|
|
54
|
+
},
|
|
55
|
+
modal: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
required: false
|
|
58
|
+
},
|
|
59
|
+
openDelay: {
|
|
60
|
+
type: Number,
|
|
61
|
+
required: false,
|
|
62
|
+
default: 0
|
|
63
|
+
},
|
|
64
|
+
closeDelay: {
|
|
65
|
+
type: Number,
|
|
66
|
+
required: false,
|
|
67
|
+
default: 0
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
const emits = defineEmits(["update:open"]);
|
|
71
|
+
const slots = defineSlots();
|
|
72
|
+
const pick = props.mode === "hover" ? reactivePick(props, "defaultOpen", "open", "openDelay", "closeDelay") : reactivePick(props, "defaultOpen", "open", "modal");
|
|
73
|
+
const rootProps = useForwardPropsEmits(pick, emits);
|
|
74
|
+
const contentProps = toRef(() => defu(props.content, { side: "bottom", sideOffset: 8, collisionPadding: 8 }));
|
|
71
75
|
const contentEvents = computed(() => {
|
|
72
76
|
if (!props.dismissible) {
|
|
73
77
|
return {
|
|
74
|
-
pointerDownOutside: (e
|
|
75
|
-
interactOutside: (e
|
|
76
|
-
escapeKeyDown: (e
|
|
77
|
-
}
|
|
78
|
+
pointerDownOutside: (e) => e.preventDefault(),
|
|
79
|
+
interactOutside: (e) => e.preventDefault(),
|
|
80
|
+
escapeKeyDown: (e) => e.preventDefault()
|
|
81
|
+
};
|
|
78
82
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const arrowProps = toRef(() => props.arrow as PopoverArrowProps)
|
|
83
|
-
|
|
84
|
-
// eslint-disable-next-line vue/no-dupe-keys
|
|
83
|
+
return {};
|
|
84
|
+
});
|
|
85
|
+
const arrowProps = toRef(() => props.arrow);
|
|
85
86
|
const b24ui = computed(() => popover({
|
|
86
87
|
side: contentProps.value.side
|
|
87
|
-
}))
|
|
88
|
-
|
|
89
|
-
const Component = computed(() => props.mode === 'hover' ? HoverCard : Popover)
|
|
88
|
+
}));
|
|
89
|
+
const Component = computed(() => props.mode === "hover" ? HoverCard : Popover);
|
|
90
90
|
</script>
|
|
91
91
|
|
|
92
92
|
<template>
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type { PopoverRootProps, HoverCardRootProps, PopoverRootEmits, PopoverContentProps, PopoverContentEmits, PopoverArrowProps } from 'reka-ui';
|
|
2
|
+
import type { EmitsToProps } from '../types/utils';
|
|
3
|
+
declare const popover: import("tailwind-variants").TVReturnType<{
|
|
4
|
+
[key: string]: {
|
|
5
|
+
[key: string]: import("tailwind-variants").ClassValue | {
|
|
6
|
+
content?: import("tailwind-variants").ClassValue;
|
|
7
|
+
arrow?: import("tailwind-variants").ClassValue;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
} | {
|
|
11
|
+
[x: string]: {
|
|
12
|
+
[x: string]: import("tailwind-variants").ClassValue | {
|
|
13
|
+
content?: import("tailwind-variants").ClassValue;
|
|
14
|
+
arrow?: import("tailwind-variants").ClassValue;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
} | {
|
|
18
|
+
[x: string]: {
|
|
19
|
+
[x: string]: import("tailwind-variants").ClassValue | {
|
|
20
|
+
content?: import("tailwind-variants").ClassValue;
|
|
21
|
+
arrow?: import("tailwind-variants").ClassValue;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
} | {}, {
|
|
25
|
+
content: string;
|
|
26
|
+
arrow: string;
|
|
27
|
+
}, undefined, {
|
|
28
|
+
[key: string]: {
|
|
29
|
+
[key: string]: import("tailwind-variants").ClassValue | {
|
|
30
|
+
content?: import("tailwind-variants").ClassValue;
|
|
31
|
+
arrow?: import("tailwind-variants").ClassValue;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
} | {
|
|
35
|
+
[x: string]: {
|
|
36
|
+
[x: string]: import("tailwind-variants").ClassValue | {
|
|
37
|
+
content?: import("tailwind-variants").ClassValue;
|
|
38
|
+
arrow?: import("tailwind-variants").ClassValue;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
} | {}, {
|
|
42
|
+
content: string;
|
|
43
|
+
arrow: string;
|
|
44
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
45
|
+
[key: string]: {
|
|
46
|
+
[key: string]: import("tailwind-variants").ClassValue | {
|
|
47
|
+
content?: import("tailwind-variants").ClassValue;
|
|
48
|
+
arrow?: import("tailwind-variants").ClassValue;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
} | {
|
|
52
|
+
[x: string]: {
|
|
53
|
+
[x: string]: import("tailwind-variants").ClassValue | {
|
|
54
|
+
content?: import("tailwind-variants").ClassValue;
|
|
55
|
+
arrow?: import("tailwind-variants").ClassValue;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
} | {}, {
|
|
59
|
+
content: string;
|
|
60
|
+
arrow: string;
|
|
61
|
+
}, undefined, {
|
|
62
|
+
[key: string]: {
|
|
63
|
+
[key: string]: import("tailwind-variants").ClassValue | {
|
|
64
|
+
content?: import("tailwind-variants").ClassValue;
|
|
65
|
+
arrow?: import("tailwind-variants").ClassValue;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
} | {}, {
|
|
69
|
+
content: string;
|
|
70
|
+
arrow: string;
|
|
71
|
+
}, import("tailwind-variants").TVReturnType<unknown, {
|
|
72
|
+
content: string;
|
|
73
|
+
arrow: string;
|
|
74
|
+
}, undefined, unknown, unknown, undefined>>>;
|
|
75
|
+
export interface PopoverProps extends PopoverRootProps, Pick<HoverCardRootProps, 'openDelay' | 'closeDelay'> {
|
|
76
|
+
/**
|
|
77
|
+
* The display mode of the popover.
|
|
78
|
+
* @defaultValue 'click'
|
|
79
|
+
*/
|
|
80
|
+
mode?: 'click' | 'hover';
|
|
81
|
+
/**
|
|
82
|
+
* The content of the popover.
|
|
83
|
+
* @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8 }
|
|
84
|
+
*/
|
|
85
|
+
content?: Omit<PopoverContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<PopoverContentEmits>>;
|
|
86
|
+
/**
|
|
87
|
+
* Display an arrow alongside the popover.
|
|
88
|
+
* @defaultValue false
|
|
89
|
+
*/
|
|
90
|
+
arrow?: boolean | Omit<PopoverArrowProps, 'as' | 'asChild'>;
|
|
91
|
+
/**
|
|
92
|
+
* Render the popover in a portal.
|
|
93
|
+
* @defaultValue true
|
|
94
|
+
*/
|
|
95
|
+
portal?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* When `false`, the popover will not close when clicking outside or pressing escape.
|
|
98
|
+
* @defaultValue true
|
|
99
|
+
*/
|
|
100
|
+
dismissible?: boolean;
|
|
101
|
+
class?: any;
|
|
102
|
+
b24ui?: Partial<typeof popover.slots>;
|
|
103
|
+
}
|
|
104
|
+
export interface PopoverEmits extends PopoverRootEmits {
|
|
105
|
+
}
|
|
106
|
+
export interface PopoverSlots {
|
|
107
|
+
default(props: {
|
|
108
|
+
open: boolean;
|
|
109
|
+
}): any;
|
|
110
|
+
content(props?: {}): any;
|
|
111
|
+
}
|
|
112
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<PopoverProps>, {
|
|
113
|
+
portal: boolean;
|
|
114
|
+
mode: string;
|
|
115
|
+
openDelay: number;
|
|
116
|
+
closeDelay: number;
|
|
117
|
+
dismissible: boolean;
|
|
118
|
+
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {
|
|
119
|
+
portal: boolean;
|
|
120
|
+
dismissible: boolean;
|
|
121
|
+
openDelay: number;
|
|
122
|
+
closeDelay: number;
|
|
123
|
+
mode: "click" | "hover";
|
|
124
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, Readonly<PopoverSlots> & PopoverSlots>;
|
|
125
|
+
export default _default;
|
|
126
|
+
type __VLS_WithDefaults<P, D> = {
|
|
127
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
128
|
+
default: D[K];
|
|
129
|
+
}> : P[K];
|
|
130
|
+
};
|
|
131
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
132
|
+
type __VLS_TypePropsToOption<T> = {
|
|
133
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
134
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
135
|
+
} : {
|
|
136
|
+
type: import('vue').PropType<T[K]>;
|
|
137
|
+
required: true;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
141
|
+
new (): {
|
|
142
|
+
$slots: S;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
type __VLS_PrettifyLocal<T> = {
|
|
146
|
+
[K in keyof T]: T[K];
|
|
147
|
+
} & {};
|
|
@@ -1,178 +1,151 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import theme from '#build/b24ui/progress'
|
|
8
|
-
import { tv } from '../utils/tv'
|
|
9
|
-
|
|
10
|
-
const appConfigProgress = _appConfig as AppConfig & { b24ui: { progress: Partial<typeof theme> } }
|
|
11
|
-
|
|
12
|
-
const progress = tv({ extend: tv(theme), ...(appConfigProgress.b24ui?.progress || {}) })
|
|
13
|
-
|
|
14
|
-
type ProgressVariants = VariantProps<typeof progress>
|
|
15
|
-
|
|
16
|
-
export interface ProgressProps extends Pick<ProgressRootProps, 'getValueLabel' | 'modelValue'> {
|
|
17
|
-
/**
|
|
18
|
-
* The element or component this component should render as.
|
|
19
|
-
* @defaultValue 'div'
|
|
20
|
-
*/
|
|
21
|
-
as?: any
|
|
22
|
-
/**
|
|
23
|
-
* The maximum progress value
|
|
24
|
-
*/
|
|
25
|
-
max?: number | Array<any>
|
|
26
|
-
/**
|
|
27
|
-
* Display the current progress value
|
|
28
|
-
*/
|
|
29
|
-
status?: boolean
|
|
30
|
-
/**
|
|
31
|
-
* Whether the progress is visually inverted
|
|
32
|
-
* @defaultValue false
|
|
33
|
-
*/
|
|
34
|
-
inverted?: boolean
|
|
35
|
-
/**
|
|
36
|
-
* @defaultValue 'md'
|
|
37
|
-
*/
|
|
38
|
-
size?: ProgressVariants['size']
|
|
39
|
-
/**
|
|
40
|
-
* @defaultValue 'primary'
|
|
41
|
-
*/
|
|
42
|
-
color?: ProgressVariants['color']
|
|
43
|
-
/**
|
|
44
|
-
* The orientation of the progress bar.
|
|
45
|
-
* @defaultValue 'horizontal'
|
|
46
|
-
*/
|
|
47
|
-
orientation?: ProgressVariants['orientation']
|
|
48
|
-
/**
|
|
49
|
-
* @defaultValue 'loading'
|
|
50
|
-
*/
|
|
51
|
-
animation?: ProgressVariants['animation']
|
|
52
|
-
class?: any
|
|
53
|
-
b24ui?: Partial<typeof progress.slots>
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface ProgressEmits extends ProgressRootEmits {}
|
|
57
|
-
|
|
58
|
-
export type ProgressSlots = {
|
|
59
|
-
status(props: { percent?: number }): any
|
|
60
|
-
} & {
|
|
61
|
-
[key: string]: (props: { step: number }) => any
|
|
62
|
-
}
|
|
63
|
-
|
|
1
|
+
<script>
|
|
2
|
+
import _appConfig from "#build/app.config";
|
|
3
|
+
import theme from "#build/b24ui/progress";
|
|
4
|
+
import { tv } from "../utils/tv";
|
|
5
|
+
const appConfigProgress = _appConfig;
|
|
6
|
+
const progress = tv({ extend: tv(theme), ...appConfigProgress.b24ui?.progress || {} });
|
|
64
7
|
</script>
|
|
65
8
|
|
|
66
|
-
<script setup
|
|
67
|
-
import { computed } from
|
|
68
|
-
import {
|
|
69
|
-
import { reactivePick } from
|
|
70
|
-
import { useLocale } from
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
9
|
+
<script setup>
|
|
10
|
+
import { computed } from "vue";
|
|
11
|
+
import { useForwardPropsEmits } from "reka-ui";
|
|
12
|
+
import { reactivePick } from "@vueuse/core";
|
|
13
|
+
import { useLocale } from "../composables/useLocale";
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
as: {
|
|
16
|
+
type: null,
|
|
17
|
+
required: false
|
|
18
|
+
},
|
|
19
|
+
max: {
|
|
20
|
+
type: [Number, Array],
|
|
21
|
+
required: false
|
|
22
|
+
},
|
|
23
|
+
status: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
required: false
|
|
26
|
+
},
|
|
27
|
+
inverted: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
required: false,
|
|
30
|
+
default: false
|
|
31
|
+
},
|
|
32
|
+
size: {
|
|
33
|
+
type: null,
|
|
34
|
+
required: false
|
|
35
|
+
},
|
|
36
|
+
color: {
|
|
37
|
+
type: null,
|
|
38
|
+
required: false
|
|
39
|
+
},
|
|
40
|
+
orientation: {
|
|
41
|
+
type: null,
|
|
42
|
+
required: false,
|
|
43
|
+
default: "horizontal"
|
|
44
|
+
},
|
|
45
|
+
animation: {
|
|
46
|
+
type: null,
|
|
47
|
+
required: false
|
|
48
|
+
},
|
|
49
|
+
class: {
|
|
50
|
+
type: null,
|
|
51
|
+
required: false
|
|
52
|
+
},
|
|
53
|
+
b24ui: {
|
|
54
|
+
type: Object,
|
|
55
|
+
required: false
|
|
56
|
+
},
|
|
57
|
+
getValueLabel: {
|
|
58
|
+
type: Function,
|
|
59
|
+
required: false
|
|
60
|
+
},
|
|
61
|
+
modelValue: {
|
|
62
|
+
type: [Number, null],
|
|
63
|
+
required: false,
|
|
64
|
+
default: null
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
const emits = defineEmits(["update:modelValue", "update:max"]);
|
|
68
|
+
const slots = defineSlots();
|
|
69
|
+
const { dir } = useLocale();
|
|
70
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, "getValueLabel", "modelValue"), emits);
|
|
71
|
+
const isIndeterminate = computed(() => rootProps.value.modelValue === null);
|
|
72
|
+
const hasSteps = computed(() => Array.isArray(props.max));
|
|
87
73
|
const realMax = computed(() => {
|
|
88
74
|
if (isIndeterminate.value || !props.max) {
|
|
89
|
-
return
|
|
75
|
+
return void 0;
|
|
90
76
|
}
|
|
91
|
-
|
|
92
77
|
if (Array.isArray(props.max)) {
|
|
93
|
-
return props.max.length - 1
|
|
78
|
+
return props.max.length - 1;
|
|
94
79
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
})
|
|
98
|
-
|
|
80
|
+
return Number(props.max);
|
|
81
|
+
});
|
|
99
82
|
const percent = computed(() => {
|
|
100
83
|
if (isIndeterminate.value) {
|
|
101
|
-
return
|
|
84
|
+
return void 0;
|
|
102
85
|
}
|
|
103
|
-
|
|
104
86
|
switch (true) {
|
|
105
|
-
case rootProps.value.modelValue
|
|
106
|
-
|
|
107
|
-
|
|
87
|
+
case rootProps.value.modelValue < 0:
|
|
88
|
+
return 0;
|
|
89
|
+
case rootProps.value.modelValue > (realMax.value ?? 100):
|
|
90
|
+
return 100;
|
|
91
|
+
default:
|
|
92
|
+
return Math.round(rootProps.value.modelValue / (realMax.value ?? 100) * 100);
|
|
108
93
|
}
|
|
109
|
-
})
|
|
110
|
-
|
|
94
|
+
});
|
|
111
95
|
const indicatorStyle = computed(() => {
|
|
112
|
-
if (percent.value ===
|
|
113
|
-
return
|
|
96
|
+
if (percent.value === void 0) {
|
|
97
|
+
return;
|
|
114
98
|
}
|
|
115
|
-
|
|
116
|
-
if (props.orientation === 'vertical') {
|
|
99
|
+
if (props.orientation === "vertical") {
|
|
117
100
|
return {
|
|
118
|
-
transform: `translateY(${props.inverted ?
|
|
119
|
-
}
|
|
101
|
+
transform: `translateY(${props.inverted ? "" : "-"}${100 - percent.value}%)`
|
|
102
|
+
};
|
|
120
103
|
} else {
|
|
121
|
-
if (dir.value ===
|
|
104
|
+
if (dir.value === "rtl") {
|
|
122
105
|
return {
|
|
123
|
-
transform: `translateX(${props.inverted ?
|
|
124
|
-
}
|
|
106
|
+
transform: `translateX(${props.inverted ? "-" : ""}${100 - percent.value}%)`
|
|
107
|
+
};
|
|
125
108
|
} else {
|
|
126
109
|
return {
|
|
127
|
-
transform: `translateX(${props.inverted ?
|
|
128
|
-
}
|
|
110
|
+
transform: `translateX(${props.inverted ? "" : "-"}${100 - percent.value}%)`
|
|
111
|
+
};
|
|
129
112
|
}
|
|
130
113
|
}
|
|
131
|
-
})
|
|
132
|
-
|
|
114
|
+
});
|
|
133
115
|
const statusStyle = computed(() => {
|
|
134
116
|
return {
|
|
135
|
-
[props.orientation ===
|
|
136
|
-
}
|
|
137
|
-
})
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
return index === Number(props.modelValue)
|
|
117
|
+
[props.orientation === "vertical" ? "height" : "width"]: percent.value ? `${percent.value}%` : "fit-content"
|
|
118
|
+
};
|
|
119
|
+
});
|
|
120
|
+
function isActive(index) {
|
|
121
|
+
return index === Number(props.modelValue);
|
|
141
122
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
return index === 0
|
|
123
|
+
function isFirst(index) {
|
|
124
|
+
return index === 0;
|
|
145
125
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
return index === realMax.value
|
|
126
|
+
function isLast(index) {
|
|
127
|
+
return index === realMax.value;
|
|
149
128
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
index = Number(index)
|
|
153
|
-
|
|
129
|
+
function stepVariant(index) {
|
|
130
|
+
index = Number(index);
|
|
154
131
|
if (isActive(index) && !isFirst(index)) {
|
|
155
|
-
return
|
|
132
|
+
return "active";
|
|
156
133
|
}
|
|
157
|
-
|
|
158
134
|
if (isFirst(index) && isActive(index)) {
|
|
159
|
-
return
|
|
135
|
+
return "first";
|
|
160
136
|
}
|
|
161
|
-
|
|
162
137
|
if (isLast(index) && isActive(index)) {
|
|
163
|
-
return
|
|
138
|
+
return "last";
|
|
164
139
|
}
|
|
165
|
-
|
|
166
|
-
return 'other'
|
|
140
|
+
return "other";
|
|
167
141
|
}
|
|
168
|
-
|
|
169
142
|
const b24ui = computed(() => progress({
|
|
170
143
|
animation: props.animation,
|
|
171
144
|
size: props.size,
|
|
172
145
|
color: props.color,
|
|
173
146
|
orientation: props.orientation,
|
|
174
147
|
inverted: props.inverted
|
|
175
|
-
}))
|
|
148
|
+
}));
|
|
176
149
|
</script>
|
|
177
150
|
|
|
178
151
|
<template>
|