@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,153 +1,223 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import type { UseComponentIconsProps } from '../composables/useComponentIcons'
|
|
8
|
-
import { tv } from '../utils/tv'
|
|
9
|
-
import type { AvatarProps } from '../types'
|
|
10
|
-
import type { PartialString } from '../types/utils'
|
|
11
|
-
|
|
12
|
-
const appConfigButton = _appConfig as AppConfig & { b24ui: { button: Partial<typeof theme> } }
|
|
13
|
-
|
|
14
|
-
const button = tv({ extend: tv(theme), ...(appConfigButton.b24ui?.button || {}) })
|
|
15
|
-
|
|
16
|
-
type ButtonVariants = VariantProps<typeof button>
|
|
17
|
-
|
|
18
|
-
export interface ButtonProps extends Omit<UseComponentIconsProps, 'trailing' | 'trailingIcon'>, Omit<LinkProps, 'raw' | 'custom'> {
|
|
19
|
-
label?: string
|
|
20
|
-
/**
|
|
21
|
-
* @defaultValue 'default'
|
|
22
|
-
*/
|
|
23
|
-
color?: ButtonVariants['color']
|
|
24
|
-
activeColor?: ButtonVariants['color']
|
|
25
|
-
/**
|
|
26
|
-
* @defaultValue 'normal'
|
|
27
|
-
*/
|
|
28
|
-
depth?: ButtonVariants['depth']
|
|
29
|
-
activeDepth?: ButtonVariants['depth']
|
|
30
|
-
/**
|
|
31
|
-
* @defaultValue 'md'
|
|
32
|
-
*/
|
|
33
|
-
size?: ButtonVariants['size']
|
|
34
|
-
/**
|
|
35
|
-
* Rounds the corners of the button
|
|
36
|
-
* @defaultValue false
|
|
37
|
-
*/
|
|
38
|
-
rounded?: boolean
|
|
39
|
-
/**
|
|
40
|
-
* Render the button full width
|
|
41
|
-
* @defaultValue false
|
|
42
|
-
*/
|
|
43
|
-
block?: boolean
|
|
44
|
-
/**
|
|
45
|
-
* Set loading state automatically based on the `@click` promise state
|
|
46
|
-
* @defaultValue false
|
|
47
|
-
*/
|
|
48
|
-
loadingAuto?: boolean
|
|
49
|
-
/**
|
|
50
|
-
* Disable uppercase label
|
|
51
|
-
* @defaultValue false
|
|
52
|
-
*/
|
|
53
|
-
normalCase?: boolean
|
|
54
|
-
/**
|
|
55
|
-
* Shows LoaderWaitIcon in loading mode
|
|
56
|
-
* @defaultValue false
|
|
57
|
-
*/
|
|
58
|
-
useWait?: boolean
|
|
59
|
-
/**
|
|
60
|
-
* Shows LoaderClockIcon icon in loading mode
|
|
61
|
-
* @defaultValue false
|
|
62
|
-
*/
|
|
63
|
-
useClock?: boolean
|
|
64
|
-
/**
|
|
65
|
-
* Shows icons.chevronDown on the right side
|
|
66
|
-
* @defaultValue false
|
|
67
|
-
*/
|
|
68
|
-
useDropdown?: boolean
|
|
69
|
-
onClick?: ((event: MouseEvent) => void | Promise<void>) | Array<((event: MouseEvent) => void | Promise<void>)>
|
|
70
|
-
class?: any
|
|
71
|
-
/**
|
|
72
|
-
* The class to apply when the link is active
|
|
73
|
-
* @defaultValue ''
|
|
74
|
-
*/
|
|
75
|
-
activeClass?: string
|
|
76
|
-
/**
|
|
77
|
-
* The class to apply when the link is inactive
|
|
78
|
-
* @defaultValue ''
|
|
79
|
-
*/
|
|
80
|
-
inactiveClass?: string
|
|
81
|
-
b24ui?: PartialString<typeof button.slots>
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export interface ButtonSlots {
|
|
85
|
-
leading(props?: {}): any
|
|
86
|
-
default(props?: {}): any
|
|
87
|
-
trailing(props?: {}): any
|
|
88
|
-
}
|
|
1
|
+
<script>
|
|
2
|
+
import _appConfig from "#build/app.config";
|
|
3
|
+
import theme from "#build/b24ui/button";
|
|
4
|
+
import { tv } from "../utils/tv";
|
|
5
|
+
const appConfigButton = _appConfig;
|
|
6
|
+
const button = tv({ extend: tv(theme), ...appConfigButton.b24ui?.button || {} });
|
|
89
7
|
</script>
|
|
90
8
|
|
|
91
|
-
<script setup
|
|
92
|
-
import {
|
|
93
|
-
import { useForwardProps } from
|
|
94
|
-
import { useComponentIcons } from
|
|
95
|
-
import { useButtonGroup } from
|
|
96
|
-
import { formLoadingInjectionKey } from
|
|
97
|
-
import {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
9
|
+
<script setup>
|
|
10
|
+
import { computed, ref, inject } from "vue";
|
|
11
|
+
import { useForwardProps } from "reka-ui";
|
|
12
|
+
import { useComponentIcons } from "../composables/useComponentIcons";
|
|
13
|
+
import { useButtonGroup } from "../composables/useButtonGroup";
|
|
14
|
+
import { formLoadingInjectionKey } from "../composables/useFormField";
|
|
15
|
+
import { pickLinkProps } from "../utils/link";
|
|
16
|
+
const props = defineProps({
|
|
17
|
+
label: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: false
|
|
20
|
+
},
|
|
21
|
+
color: {
|
|
22
|
+
type: null,
|
|
23
|
+
required: false
|
|
24
|
+
},
|
|
25
|
+
activeColor: {
|
|
26
|
+
type: null,
|
|
27
|
+
required: false
|
|
28
|
+
},
|
|
29
|
+
depth: {
|
|
30
|
+
type: null,
|
|
31
|
+
required: false
|
|
32
|
+
},
|
|
33
|
+
activeDepth: {
|
|
34
|
+
type: null,
|
|
35
|
+
required: false
|
|
36
|
+
},
|
|
37
|
+
size: {
|
|
38
|
+
type: null,
|
|
39
|
+
required: false
|
|
40
|
+
},
|
|
41
|
+
rounded: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
required: false
|
|
44
|
+
},
|
|
45
|
+
block: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
required: false
|
|
48
|
+
},
|
|
49
|
+
loadingAuto: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
required: false
|
|
52
|
+
},
|
|
53
|
+
normalCase: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
required: false
|
|
56
|
+
},
|
|
57
|
+
useWait: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
required: false
|
|
60
|
+
},
|
|
61
|
+
useClock: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
required: false
|
|
64
|
+
},
|
|
65
|
+
useDropdown: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
required: false
|
|
68
|
+
},
|
|
69
|
+
onClick: {
|
|
70
|
+
type: [Function, Array],
|
|
71
|
+
required: false
|
|
72
|
+
},
|
|
73
|
+
class: {
|
|
74
|
+
type: null,
|
|
75
|
+
required: false
|
|
76
|
+
},
|
|
77
|
+
activeClass: {
|
|
78
|
+
type: String,
|
|
79
|
+
required: false,
|
|
80
|
+
default: ""
|
|
81
|
+
},
|
|
82
|
+
inactiveClass: {
|
|
83
|
+
type: String,
|
|
84
|
+
required: false,
|
|
85
|
+
default: ""
|
|
86
|
+
},
|
|
87
|
+
b24ui: {
|
|
88
|
+
type: null,
|
|
89
|
+
required: false
|
|
90
|
+
},
|
|
91
|
+
icon: {
|
|
92
|
+
type: [Function, Object],
|
|
93
|
+
required: false
|
|
94
|
+
},
|
|
95
|
+
avatar: {
|
|
96
|
+
type: Object,
|
|
97
|
+
required: false
|
|
98
|
+
},
|
|
99
|
+
loading: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
required: false
|
|
102
|
+
},
|
|
103
|
+
as: {
|
|
104
|
+
type: null,
|
|
105
|
+
required: false
|
|
106
|
+
},
|
|
107
|
+
type: {
|
|
108
|
+
type: null,
|
|
109
|
+
required: false,
|
|
110
|
+
default: "button"
|
|
111
|
+
},
|
|
112
|
+
disabled: {
|
|
113
|
+
type: Boolean,
|
|
114
|
+
required: false
|
|
115
|
+
},
|
|
116
|
+
active: {
|
|
117
|
+
type: Boolean,
|
|
118
|
+
required: false,
|
|
119
|
+
default: void 0
|
|
120
|
+
},
|
|
121
|
+
exact: {
|
|
122
|
+
type: Boolean,
|
|
123
|
+
required: false
|
|
124
|
+
},
|
|
125
|
+
exactQuery: {
|
|
126
|
+
type: [Boolean, String],
|
|
127
|
+
required: false
|
|
128
|
+
},
|
|
129
|
+
exactHash: {
|
|
130
|
+
type: Boolean,
|
|
131
|
+
required: false
|
|
132
|
+
},
|
|
133
|
+
isAction: {
|
|
134
|
+
type: Boolean,
|
|
135
|
+
required: false
|
|
136
|
+
},
|
|
137
|
+
to: {
|
|
138
|
+
type: null,
|
|
139
|
+
required: false
|
|
140
|
+
},
|
|
141
|
+
href: {
|
|
142
|
+
type: null,
|
|
143
|
+
required: false
|
|
144
|
+
},
|
|
145
|
+
external: {
|
|
146
|
+
type: Boolean,
|
|
147
|
+
required: false
|
|
148
|
+
},
|
|
149
|
+
target: {
|
|
150
|
+
type: [String, Object, null],
|
|
151
|
+
required: false
|
|
152
|
+
},
|
|
153
|
+
rel: {
|
|
154
|
+
type: [String, Object, null],
|
|
155
|
+
required: false
|
|
156
|
+
},
|
|
157
|
+
noRel: {
|
|
158
|
+
type: Boolean,
|
|
159
|
+
required: false
|
|
160
|
+
},
|
|
161
|
+
prefetchedClass: {
|
|
162
|
+
type: String,
|
|
163
|
+
required: false
|
|
164
|
+
},
|
|
165
|
+
prefetch: {
|
|
166
|
+
type: Boolean,
|
|
167
|
+
required: false
|
|
168
|
+
},
|
|
169
|
+
prefetchOn: {
|
|
170
|
+
type: [String, Object],
|
|
171
|
+
required: false
|
|
172
|
+
},
|
|
173
|
+
noPrefetch: {
|
|
174
|
+
type: Boolean,
|
|
175
|
+
required: false
|
|
176
|
+
},
|
|
177
|
+
exactActiveClass: {
|
|
178
|
+
type: String,
|
|
179
|
+
required: false
|
|
180
|
+
},
|
|
181
|
+
ariaCurrentValue: {
|
|
182
|
+
type: String,
|
|
183
|
+
required: false
|
|
184
|
+
},
|
|
185
|
+
viewTransition: {
|
|
186
|
+
type: Boolean,
|
|
187
|
+
required: false
|
|
188
|
+
},
|
|
189
|
+
replace: {
|
|
190
|
+
type: Boolean,
|
|
191
|
+
required: false
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
const slots = defineSlots();
|
|
195
|
+
const linkProps = useForwardProps(pickLinkProps(props));
|
|
196
|
+
const { orientation, size: buttonSize, noSplit } = useButtonGroup(props);
|
|
197
|
+
const loadingAutoState = ref(false);
|
|
198
|
+
const formLoading = inject(formLoadingInjectionKey, void 0);
|
|
199
|
+
async function onClickWrapper(event) {
|
|
200
|
+
loadingAutoState.value = true;
|
|
201
|
+
const callbacks = Array.isArray(props.onClick) ? props.onClick : [props.onClick];
|
|
126
202
|
try {
|
|
127
|
-
await Promise.all(callbacks.map(fn => fn?.(event)))
|
|
203
|
+
await Promise.all(callbacks.map((fn) => fn?.(event)));
|
|
128
204
|
} finally {
|
|
129
|
-
loadingAutoState.value = false
|
|
205
|
+
loadingAutoState.value = false;
|
|
130
206
|
}
|
|
131
207
|
}
|
|
132
|
-
|
|
133
208
|
const isLoading = computed(() => {
|
|
134
|
-
return props.loading ||
|
|
135
|
-
})
|
|
136
|
-
|
|
209
|
+
return props.loading || props.loadingAuto && (loadingAutoState.value || formLoading?.value && props.type === "submit");
|
|
210
|
+
});
|
|
137
211
|
const { isLeading, leadingIconName } = useComponentIcons(
|
|
138
212
|
computed(() => ({ ...props, loading: false }))
|
|
139
|
-
)
|
|
140
|
-
|
|
213
|
+
);
|
|
141
214
|
const isLabel = computed(() => {
|
|
142
|
-
let isUseSlot = false
|
|
143
|
-
|
|
215
|
+
let isUseSlot = false;
|
|
144
216
|
if (slots && !!slots.default) {
|
|
145
|
-
isUseSlot = true
|
|
217
|
+
isUseSlot = true;
|
|
146
218
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
})
|
|
150
|
-
|
|
219
|
+
return (props?.label || "").length > 0 || isUseSlot;
|
|
220
|
+
});
|
|
151
221
|
const b24ui = computed(() => tv({
|
|
152
222
|
extend: button,
|
|
153
223
|
variants: {
|
|
@@ -175,7 +245,7 @@ const b24ui = computed(() => tv({
|
|
|
175
245
|
useClock: Boolean(props.useClock),
|
|
176
246
|
leading: Boolean(isLeading.value),
|
|
177
247
|
buttonGroup: orientation.value
|
|
178
|
-
}))
|
|
248
|
+
}));
|
|
179
249
|
</script>
|
|
180
250
|
|
|
181
251
|
<template>
|
|
@@ -190,11 +260,11 @@ const b24ui = computed(() => tv({
|
|
|
190
260
|
<B24LinkBase
|
|
191
261
|
v-bind="slotProps"
|
|
192
262
|
:class="b24ui.base({
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
263
|
+
class: [props.class, props.b24ui?.base],
|
|
264
|
+
active,
|
|
265
|
+
...active && activeDepth ? { depth: activeDepth } : {},
|
|
266
|
+
...active && activeColor ? { color: activeColor } : {}
|
|
267
|
+
})"
|
|
198
268
|
@click="onClickWrapper"
|
|
199
269
|
>
|
|
200
270
|
<div
|
|
@@ -207,19 +277,19 @@ const b24ui = computed(() => tv({
|
|
|
207
277
|
</div>
|
|
208
278
|
<div
|
|
209
279
|
:class="[
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
280
|
+
b24ui.baseLine({ class: [props.b24ui?.baseLine] }),
|
|
281
|
+
isLoading ? 'invisible' : ''
|
|
282
|
+
]"
|
|
213
283
|
>
|
|
214
284
|
<slot name="leading">
|
|
215
285
|
<Component
|
|
216
286
|
:is="leadingIconName"
|
|
217
|
-
v-if="isLeading &&
|
|
287
|
+
v-if="isLeading && typeof leadingIconName !== 'undefined'"
|
|
218
288
|
:class="b24ui.leadingIcon({ class: props.b24ui?.leadingIcon })"
|
|
219
289
|
/>
|
|
220
290
|
<B24Avatar
|
|
221
291
|
v-else-if="!!avatar"
|
|
222
|
-
:size="
|
|
292
|
+
:size="props.b24ui?.leadingAvatarSize || b24ui.leadingAvatarSize()"
|
|
223
293
|
v-bind="avatar"
|
|
224
294
|
:class="b24ui.leadingAvatar({ class: props.b24ui?.leadingAvatar })"
|
|
225
295
|
/>
|