@bitrix24/b24ui-nuxt 0.7.1 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nuxt/b24ui/accordion.ts +3 -3
- package/.nuxt/b24ui/advice.ts +6 -5
- package/.nuxt/b24ui/alert.ts +102 -49
- package/.nuxt/b24ui/avatar-group.ts +10 -10
- package/.nuxt/b24ui/avatar.ts +18 -18
- package/.nuxt/b24ui/badge.ts +167 -176
- package/.nuxt/b24ui/button-group.ts +3 -1
- package/.nuxt/b24ui/button.ts +179 -170
- package/.nuxt/b24ui/calendar.ts +48 -28
- package/.nuxt/b24ui/checkbox.ts +82 -85
- package/.nuxt/b24ui/chip.ts +121 -32
- package/.nuxt/b24ui/container.ts +1 -1
- package/.nuxt/b24ui/content/table-wrapper.ts +11 -11
- package/.nuxt/b24ui/countdown.ts +11 -11
- package/.nuxt/b24ui/description-list.ts +6 -6
- package/.nuxt/b24ui/dropdown-menu.ts +111 -183
- package/.nuxt/b24ui/form-field.ts +19 -19
- package/.nuxt/b24ui/index.ts +0 -1
- package/.nuxt/b24ui/input-menu.ts +294 -357
- package/.nuxt/b24ui/input-number.ts +111 -259
- package/.nuxt/b24ui/input.ts +136 -259
- package/.nuxt/b24ui/kbd.ts +15 -13
- package/.nuxt/b24ui/link.ts +5 -5
- package/.nuxt/b24ui/modal.ts +14 -12
- package/.nuxt/b24ui/navbar-divider.ts +1 -1
- package/.nuxt/b24ui/navbar-section.ts +1 -1
- package/.nuxt/b24ui/navbar.ts +1 -1
- package/.nuxt/b24ui/navigation-menu.ts +70 -754
- package/.nuxt/b24ui/popover.ts +2 -2
- package/.nuxt/b24ui/progress.ts +58 -68
- package/.nuxt/b24ui/prose/a.ts +1 -1
- package/.nuxt/b24ui/prose/blockquote.ts +1 -1
- package/.nuxt/b24ui/prose/code.ts +45 -9
- package/.nuxt/b24ui/prose/h1.ts +21 -2
- package/.nuxt/b24ui/prose/h2.ts +21 -12
- package/.nuxt/b24ui/prose/h3.ts +21 -12
- package/.nuxt/b24ui/prose/h4.ts +21 -12
- package/.nuxt/b24ui/prose/h5.ts +21 -12
- package/.nuxt/b24ui/prose/h6.ts +21 -12
- package/.nuxt/b24ui/prose/hr.ts +1 -1
- package/.nuxt/b24ui/prose/ol.ts +1 -1
- package/.nuxt/b24ui/prose/p.ts +26 -1
- package/.nuxt/b24ui/prose/thead.ts +1 -1
- package/.nuxt/b24ui/prose/ul.ts +1 -1
- package/.nuxt/b24ui/radio-group.ts +115 -155
- package/.nuxt/b24ui/range.ts +38 -26
- package/.nuxt/b24ui/select-menu.ts +251 -306
- package/.nuxt/b24ui/select.ts +246 -301
- package/.nuxt/b24ui/separator.ts +40 -85
- package/.nuxt/b24ui/sidebar-header.ts +1 -1
- package/.nuxt/b24ui/sidebar-heading.ts +1 -1
- package/.nuxt/b24ui/sidebar-layout.ts +130 -19
- package/.nuxt/b24ui/sidebar-section.ts +1 -1
- package/.nuxt/b24ui/skeleton.ts +19 -1
- package/.nuxt/b24ui/slideover.ts +35 -34
- package/.nuxt/b24ui/switch.ts +59 -48
- package/.nuxt/b24ui/tabs.ts +26 -239
- package/.nuxt/b24ui/textarea.ts +50 -236
- package/.nuxt/b24ui/toast.ts +38 -30
- package/.nuxt/b24ui/toaster.ts +1 -1
- package/.nuxt/b24ui/tooltip.ts +5 -5
- package/cli/templates.mjs +2 -1
- package/dist/meta.d.mts +18759 -5002
- package/dist/meta.mjs +18759 -5002
- package/dist/module.d.mts +1 -0
- package/dist/module.json +2 -2
- package/dist/module.mjs +3 -5
- package/dist/runtime/air-design-tokens/001_b24_global.css +1 -0
- package/dist/runtime/air-design-tokens/002_b24_context_utility.css +0 -0
- package/dist/runtime/air-design-tokens/003_b24_context_light.css +1 -0
- package/dist/runtime/air-design-tokens/004_b24_context_dark.css +1 -0
- package/dist/runtime/air-design-tokens/005_b24_context_edge-light.css +1 -0
- package/dist/runtime/air-design-tokens/006_b24_context_edge-dark.css +1 -0
- package/dist/runtime/air-design-tokens/007_b24_global.css +1 -0
- package/dist/runtime/air-design-tokens/008_ui_global.css +1 -0
- package/dist/runtime/air-design-tokens/009_b24_tools.css +1 -0
- package/dist/runtime/air-design-tokens/components/badge-counter.css +1 -0
- package/dist/runtime/air-design-tokens/components/button.css +1 -0
- package/dist/runtime/air-design-tokens/components/navigation-menu.css +1 -0
- package/dist/runtime/air-design-tokens/components/popup.css +1 -0
- package/dist/runtime/air-design-tokens/components/scrollbar.css +2 -0
- package/dist/runtime/air-design-tokens/index.css +1 -0
- package/dist/runtime/components/Accordion.vue.d.ts +1 -1
- package/dist/runtime/components/Advice.vue +1 -13
- package/dist/runtime/components/Advice.vue.d.ts +1 -1
- package/dist/runtime/components/Alert.vue +6 -4
- package/dist/runtime/components/Alert.vue.d.ts +11 -4
- package/dist/runtime/components/App.vue.d.ts +1 -1
- package/dist/runtime/components/Avatar.vue.d.ts +1 -1
- package/dist/runtime/components/AvatarGroup.vue.d.ts +1 -1
- package/dist/runtime/components/Badge.vue +7 -11
- package/dist/runtime/components/Badge.vue.d.ts +6 -8
- package/dist/runtime/components/Button.vue +18 -15
- package/dist/runtime/components/Button.vue.d.ts +5 -7
- package/dist/runtime/components/ButtonGroup.vue.d.ts +1 -1
- package/dist/runtime/components/Calendar.vue +8 -8
- package/dist/runtime/components/Calendar.vue.d.ts +14 -8
- package/dist/runtime/components/Checkbox.vue.d.ts +2 -2
- package/dist/runtime/components/Chip.vue +28 -7
- package/dist/runtime/components/Chip.vue.d.ts +22 -2
- package/dist/runtime/components/Collapsible.vue.d.ts +1 -1
- package/dist/runtime/components/Container.vue.d.ts +1 -1
- package/dist/runtime/components/Countdown.vue.d.ts +5 -3
- package/dist/runtime/components/DescriptionList.vue.d.ts +1 -1
- package/dist/runtime/components/DropdownMenu.vue +20 -9
- package/dist/runtime/components/DropdownMenu.vue.d.ts +1 -5
- package/dist/runtime/components/DropdownMenuContent.vue +29 -7
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +14 -6
- package/dist/runtime/components/Form.vue +3 -3
- package/dist/runtime/components/Form.vue.d.ts +6 -5
- package/dist/runtime/components/FormField.vue +2 -2
- package/dist/runtime/components/FormField.vue.d.ts +4 -4
- package/dist/runtime/components/Input.vue +8 -4
- package/dist/runtime/components/Input.vue.d.ts +9 -8
- package/dist/runtime/components/InputMenu.vue +44 -18
- package/dist/runtime/components/InputMenu.vue.d.ts +17 -223
- package/dist/runtime/components/InputNumber.vue +14 -11
- package/dist/runtime/components/InputNumber.vue.d.ts +13 -87
- package/dist/runtime/components/Kbd.vue +6 -3
- package/dist/runtime/components/Kbd.vue.d.ts +7 -3
- package/dist/runtime/components/Link.vue +6 -5
- package/dist/runtime/components/Link.vue.d.ts +1 -3
- package/dist/runtime/components/LinkBase.vue.d.ts +1 -1
- package/dist/runtime/components/Modal.vue +37 -33
- package/dist/runtime/components/Modal.vue.d.ts +2 -2
- package/dist/runtime/components/ModalDialogClose.vue.d.ts +1 -1
- package/dist/runtime/components/Navbar.vue.d.ts +1 -1
- package/dist/runtime/components/NavbarDivider.vue.d.ts +1 -1
- package/dist/runtime/components/NavbarSection.vue.d.ts +1 -1
- package/dist/runtime/components/NavbarSpacer.vue.d.ts +1 -1
- package/dist/runtime/components/NavigationMenu.vue +95 -84
- package/dist/runtime/components/NavigationMenu.vue.d.ts +31 -33
- package/dist/runtime/components/OverlayProvider.vue.d.ts +1 -1
- package/dist/runtime/components/Popover.vue +8 -2
- package/dist/runtime/components/Popover.vue.d.ts +9 -3
- package/dist/runtime/components/Progress.vue.d.ts +3 -3
- package/dist/runtime/components/RadioGroup.vue +1 -1
- package/dist/runtime/components/RadioGroup.vue.d.ts +6 -5
- package/dist/runtime/components/Range.vue.d.ts +6 -6
- package/dist/runtime/components/Select.vue +25 -11
- package/dist/runtime/components/Select.vue.d.ts +7 -7
- package/dist/runtime/components/SelectMenu.vue +38 -19
- package/dist/runtime/components/SelectMenu.vue.d.ts +11 -10
- package/dist/runtime/components/Separator.vue +4 -4
- package/dist/runtime/components/Separator.vue.d.ts +6 -3
- package/dist/runtime/components/Sidebar.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarBody.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarFooter.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarHeader.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarHeading.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarLayout.vue +148 -63
- package/dist/runtime/components/SidebarLayout.vue.d.ts +61 -8
- package/dist/runtime/components/SidebarSection.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarSpacer.vue.d.ts +4 -1
- package/dist/runtime/components/Skeleton.vue +7 -3
- package/dist/runtime/components/Skeleton.vue.d.ts +12 -1
- package/dist/runtime/components/Slideover.vue +120 -43
- package/dist/runtime/components/Slideover.vue.d.ts +22 -9
- package/dist/runtime/components/Switch.vue.d.ts +2 -2
- package/dist/runtime/components/Tabs.vue +11 -3
- package/dist/runtime/components/Tabs.vue.d.ts +8 -7
- package/dist/runtime/components/Textarea.vue +8 -4
- package/dist/runtime/components/Textarea.vue.d.ts +8 -7
- package/dist/runtime/components/Toast.vue +16 -8
- package/dist/runtime/components/Toast.vue.d.ts +16 -15
- package/dist/runtime/components/Toaster.vue.d.ts +2 -2
- package/dist/runtime/components/Tooltip.vue +9 -5
- package/dist/runtime/components/Tooltip.vue.d.ts +7 -1
- package/dist/runtime/components/content/TableWrapper.vue.d.ts +1 -1
- package/dist/runtime/composables/defineShortcuts.js +5 -3
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useButtonGroup.d.ts +1 -1
- package/dist/runtime/composables/useComponentIcons.d.ts +1 -1
- package/dist/runtime/composables/useFormField.d.ts +4 -7
- package/dist/runtime/composables/useFormField.js +6 -3
- package/dist/runtime/composables/useKbd.d.ts +1 -1
- package/dist/runtime/composables/useLocale.js +2 -2
- package/dist/runtime/composables/useOverlay.d.ts +29 -2
- package/dist/runtime/composables/useOverlay.js +8 -7
- package/dist/runtime/composables/usePortal.d.ts +1 -1
- package/dist/runtime/composables/useSidebarLayout.d.ts +20 -0
- package/dist/runtime/composables/useSidebarLayout.js +16 -0
- package/dist/runtime/dictionary/icons.js +7 -7
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/inertia/components/Link.vue +3 -0
- package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
- package/dist/runtime/inertia/components/LinkBase.vue.d.ts +1 -1
- package/dist/runtime/inertia/stubs.d.ts +1 -0
- package/dist/runtime/inertia/stubs.js +4 -2
- package/dist/runtime/locale/ar.js +6 -0
- package/dist/runtime/locale/br.js +6 -0
- package/dist/runtime/locale/de.js +6 -0
- package/dist/runtime/locale/en.js +6 -0
- package/dist/runtime/locale/fr.js +6 -0
- package/dist/runtime/locale/id.js +6 -0
- package/dist/runtime/locale/it.js +6 -0
- package/dist/runtime/locale/ja.js +6 -0
- package/dist/runtime/locale/kz.js +6 -0
- package/dist/runtime/locale/la.js +6 -0
- package/dist/runtime/locale/ms.js +6 -0
- package/dist/runtime/locale/pl.js +6 -0
- package/dist/runtime/locale/ru.js +6 -0
- package/dist/runtime/locale/sc.js +6 -0
- package/dist/runtime/locale/tc.js +6 -0
- package/dist/runtime/locale/th.js +6 -0
- package/dist/runtime/locale/tr.js +6 -0
- package/dist/runtime/locale/ua.js +6 -0
- package/dist/runtime/locale/vn.js +6 -0
- package/dist/runtime/plugins/ui-version.d.ts +5 -0
- package/dist/runtime/plugins/ui-version.js +8 -0
- package/dist/runtime/prose/A.vue.d.ts +4 -1
- package/dist/runtime/prose/Blockquote.vue.d.ts +4 -1
- package/dist/runtime/prose/Code.vue.d.ts +4 -1
- package/dist/runtime/prose/Em.vue.d.ts +4 -1
- package/dist/runtime/prose/H1.vue +4 -1
- package/dist/runtime/prose/H1.vue.d.ts +7 -1
- package/dist/runtime/prose/H2.vue +4 -1
- package/dist/runtime/prose/H2.vue.d.ts +7 -1
- package/dist/runtime/prose/H3.vue +4 -1
- package/dist/runtime/prose/H3.vue.d.ts +7 -1
- package/dist/runtime/prose/H4.vue +4 -1
- package/dist/runtime/prose/H4.vue.d.ts +7 -1
- package/dist/runtime/prose/H5.vue +4 -1
- package/dist/runtime/prose/H5.vue.d.ts +7 -1
- package/dist/runtime/prose/H6.vue +4 -1
- package/dist/runtime/prose/H6.vue.d.ts +7 -1
- package/dist/runtime/prose/Hr.vue.d.ts +1 -1
- package/dist/runtime/prose/Img.vue.d.ts +1 -1
- package/dist/runtime/prose/Li.vue.d.ts +4 -1
- package/dist/runtime/prose/Ol.vue.d.ts +4 -1
- package/dist/runtime/prose/P.vue +6 -1
- package/dist/runtime/prose/P.vue.d.ts +12 -1
- package/dist/runtime/prose/Pre.vue.d.ts +4 -1
- package/dist/runtime/prose/Strong.vue.d.ts +4 -1
- package/dist/runtime/prose/Table.vue.d.ts +5 -2
- package/dist/runtime/prose/Tbody.vue.d.ts +4 -1
- package/dist/runtime/prose/Td.vue.d.ts +4 -1
- package/dist/runtime/prose/Th.vue.d.ts +4 -1
- package/dist/runtime/prose/Thead.vue.d.ts +4 -1
- package/dist/runtime/prose/Tr.vue.d.ts +4 -1
- package/dist/runtime/prose/Ul.vue.d.ts +4 -1
- package/dist/runtime/types/index.d.ts +1 -2
- package/dist/runtime/types/index.js +1 -2
- package/dist/runtime/types/locale.d.ts +6 -0
- package/dist/runtime/utils/index.d.ts +6 -0
- package/dist/runtime/utils/index.js +27 -0
- package/dist/runtime/utils/tv.js +66 -1
- package/dist/runtime/vue/components/Link.vue +3 -0
- package/dist/runtime/vue/components/Link.vue.d.ts +1 -1
- package/dist/runtime/vue/stubs.d.ts +1 -0
- package/dist/runtime/vue/stubs.js +3 -1
- package/dist/shared/b24ui-nuxt.dLc5H7ID.mjs +6100 -0
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +40 -28
- package/.nuxt/b24ui/stacked-layout.ts +0 -34
- package/dist/runtime/air-design-tokens.css +0 -1
- package/dist/runtime/components/StackedLayout.vue +0 -117
- package/dist/runtime/components/StackedLayout.vue.d.ts +0 -44
- package/dist/shared/b24ui-nuxt.CxsFEY3M.mjs +0 -7895
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AppConfig } from '@nuxt/schema';
|
|
2
2
|
import theme from '#build/b24ui/chip';
|
|
3
|
+
import type { IconComponent } from '../types';
|
|
3
4
|
import type { ComponentConfig } from '../types/utils';
|
|
4
5
|
type Chip = ComponentConfig<typeof theme, AppConfig, 'chip'>;
|
|
5
6
|
export interface ChipProps {
|
|
@@ -10,10 +11,21 @@ export interface ChipProps {
|
|
|
10
11
|
as?: any;
|
|
11
12
|
/** Display some text inside the chip. */
|
|
12
13
|
text?: string | number;
|
|
14
|
+
/**
|
|
15
|
+
* The icon displayed on the right side of the chip.
|
|
16
|
+
* @IconComponent
|
|
17
|
+
*/
|
|
18
|
+
trailingIcon?: IconComponent;
|
|
13
19
|
/**
|
|
14
20
|
* @defaultValue 'danger'
|
|
15
21
|
*/
|
|
16
22
|
color?: Chip['variants']['color'];
|
|
23
|
+
/**
|
|
24
|
+
* If set to `true` the color is inverted.
|
|
25
|
+
* Used for 'air-primary', 'air-primary-success', 'air-primary-alert', 'air-primary-copilot' and 'air-primary-warning' colors.
|
|
26
|
+
* @defaultValue false
|
|
27
|
+
*/
|
|
28
|
+
inverted?: boolean;
|
|
17
29
|
/**
|
|
18
30
|
* @defaultValue 'sm'
|
|
19
31
|
*/
|
|
@@ -33,19 +45,25 @@ export interface ChipProps {
|
|
|
33
45
|
* @defaultValue false
|
|
34
46
|
*/
|
|
35
47
|
standalone?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* When `true`, hide chip if value='0'
|
|
50
|
+
* @defaultValue false
|
|
51
|
+
*/
|
|
52
|
+
hideZero?: boolean;
|
|
36
53
|
class?: any;
|
|
37
54
|
b24ui?: Chip['slots'];
|
|
38
55
|
}
|
|
39
56
|
export interface ChipEmits {
|
|
40
|
-
|
|
57
|
+
'update:show': [payload: boolean];
|
|
41
58
|
}
|
|
42
59
|
export interface ChipSlots {
|
|
43
60
|
default(props?: {}): any;
|
|
44
61
|
content(props?: {}): any;
|
|
62
|
+
trailing(props?: {}): any;
|
|
45
63
|
}
|
|
46
64
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ChipProps & {
|
|
47
65
|
show?: boolean;
|
|
48
|
-
},
|
|
66
|
+
}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
49
67
|
"update:show": (value: boolean) => any;
|
|
50
68
|
}, string, import("vue").PublicProps, Readonly<ChipProps & {
|
|
51
69
|
show?: boolean;
|
|
@@ -53,7 +71,9 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ChipProps
|
|
|
53
71
|
"onUpdate:show"?: ((value: boolean) => any) | undefined;
|
|
54
72
|
}>, {
|
|
55
73
|
inset: boolean;
|
|
74
|
+
inverted: boolean;
|
|
56
75
|
standalone: boolean;
|
|
76
|
+
hideZero: boolean;
|
|
57
77
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ChipSlots>;
|
|
58
78
|
export default _default;
|
|
59
79
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -20,7 +20,7 @@ export interface CollapsibleSlots {
|
|
|
20
20
|
}): any;
|
|
21
21
|
content(props?: {}): any;
|
|
22
22
|
}
|
|
23
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<CollapsibleProps,
|
|
23
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<CollapsibleProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
24
24
|
"update:open": (value: boolean) => any;
|
|
25
25
|
}, string, import("vue").PublicProps, Readonly<CollapsibleProps> & Readonly<{
|
|
26
26
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
@@ -9,7 +9,7 @@ export interface ContainerProps {
|
|
|
9
9
|
export interface ContainerSlots {
|
|
10
10
|
default(props?: {}): any;
|
|
11
11
|
}
|
|
12
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ContainerProps,
|
|
12
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ContainerProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ContainerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ContainerSlots>;
|
|
13
13
|
export default _default;
|
|
14
14
|
type __VLS_WithSlots<T, S> = T & {
|
|
15
15
|
new (): {
|
|
@@ -64,8 +64,10 @@ export interface CountdownProps extends Omit<UseComponentIconsProps, 'loading' |
|
|
|
64
64
|
b24ui?: Countdown['slots'];
|
|
65
65
|
}
|
|
66
66
|
export interface CountdownEmits {
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
start: [];
|
|
68
|
+
end: [];
|
|
69
|
+
abort: [];
|
|
70
|
+
progress: [payload: CountdownData];
|
|
69
71
|
}
|
|
70
72
|
export interface CountdownSlots {
|
|
71
73
|
leading(props?: {}): any;
|
|
@@ -78,7 +80,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<CountdownP
|
|
|
78
80
|
abort: () => void;
|
|
79
81
|
stop: () => void;
|
|
80
82
|
restart: () => void;
|
|
81
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
83
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
82
84
|
end: () => any;
|
|
83
85
|
abort: () => any;
|
|
84
86
|
progress: (payload: CountdownData) => any;
|
|
@@ -5,14 +5,18 @@ import theme from "#build/b24ui/dropdown-menu";
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed, toRef } from "vue";
|
|
7
7
|
import { defu } from "defu";
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
DropdownMenuRoot,
|
|
10
|
+
DropdownMenuTrigger,
|
|
11
|
+
DropdownMenuArrow,
|
|
12
|
+
useForwardPropsEmits
|
|
13
|
+
} from "reka-ui";
|
|
9
14
|
import { reactivePick } from "@vueuse/core";
|
|
10
15
|
import { useAppConfig } from "#imports";
|
|
11
16
|
import { omit } from "../utils";
|
|
12
17
|
import { tv } from "../utils/tv";
|
|
13
18
|
import B24DropdownMenuContent from "./DropdownMenuContent.vue";
|
|
14
19
|
const props = defineProps({
|
|
15
|
-
size: { type: null, required: false },
|
|
16
20
|
items: { type: null, required: false },
|
|
17
21
|
checkedIcon: { type: [Function, Object], required: false },
|
|
18
22
|
externalIcon: { type: [Boolean, Function, Object], required: false, default: true },
|
|
@@ -31,17 +35,23 @@ const emits = defineEmits(["update:open"]);
|
|
|
31
35
|
const slots = defineSlots();
|
|
32
36
|
const appConfig = useAppConfig();
|
|
33
37
|
const rootProps = useForwardPropsEmits(reactivePick(props, "defaultOpen", "open", "modal"), emits);
|
|
34
|
-
const contentProps = toRef(() => defu(props.content, { side: "bottom", sideOffset: 8, collisionPadding: 8 }));
|
|
35
|
-
const arrowProps = toRef(() => props.arrow);
|
|
38
|
+
const contentProps = toRef(() => defu(props.content, { side: "bottom", align: "center", sideOffset: 8, collisionPadding: 8 }));
|
|
39
|
+
const arrowProps = toRef(() => defu(typeof props.arrow === "boolean" ? {} : props.arrow, { width: 20, height: 10 }));
|
|
36
40
|
const proxySlots = omit(slots, ["default"]);
|
|
37
|
-
const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.dropdownMenu || {} })({
|
|
38
|
-
size: props.size
|
|
39
|
-
}));
|
|
41
|
+
const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.dropdownMenu || {} })({}));
|
|
40
42
|
</script>
|
|
41
43
|
|
|
42
44
|
<template>
|
|
43
|
-
<DropdownMenuRoot
|
|
44
|
-
|
|
45
|
+
<DropdownMenuRoot
|
|
46
|
+
v-slot="{ open }"
|
|
47
|
+
v-bind="rootProps"
|
|
48
|
+
>
|
|
49
|
+
<DropdownMenuTrigger
|
|
50
|
+
v-if="!!slots.default"
|
|
51
|
+
as-child
|
|
52
|
+
:class="props.class"
|
|
53
|
+
:disabled="disabled"
|
|
54
|
+
>
|
|
45
55
|
<slot :open="open" />
|
|
46
56
|
</DropdownMenuTrigger>
|
|
47
57
|
|
|
@@ -51,6 +61,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.dropdow
|
|
|
51
61
|
:b24ui-override="props.b24ui"
|
|
52
62
|
v-bind="contentProps"
|
|
53
63
|
:items="items"
|
|
64
|
+
:arrow="arrow"
|
|
54
65
|
:portal="portal"
|
|
55
66
|
:label-key="labelKey"
|
|
56
67
|
:checked-icon="checkedIcon"
|
|
@@ -34,10 +34,6 @@ export interface DropdownMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'cust
|
|
|
34
34
|
[key: string]: any;
|
|
35
35
|
}
|
|
36
36
|
export interface DropdownMenuProps<T extends ArrayOrNested<DropdownMenuItem> = ArrayOrNested<DropdownMenuItem>> extends Omit<DropdownMenuRootProps, 'dir'> {
|
|
37
|
-
/**
|
|
38
|
-
* @defaultValue 'md'
|
|
39
|
-
*/
|
|
40
|
-
size?: DropdownMenu['variants']['size'];
|
|
41
37
|
items?: T;
|
|
42
38
|
/**
|
|
43
39
|
* The icon displayed when an item is checked.
|
|
@@ -113,5 +109,5 @@ declare const _default: <T extends ArrayOrNested<DropdownMenuItem>>(__VLS_props:
|
|
|
113
109
|
};
|
|
114
110
|
export default _default;
|
|
115
111
|
type __VLS_PrettifyLocal<T> = {
|
|
116
|
-
[K in keyof T]: T[K];
|
|
112
|
+
[K in keyof T as K]: T[K];
|
|
117
113
|
} & {};
|
|
@@ -4,8 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
6
|
import { computed, toRef } from "vue";
|
|
7
|
+
import { defu } from "defu";
|
|
7
8
|
import { DropdownMenu } from "reka-ui/namespaced";
|
|
8
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
DropdownMenuArrow,
|
|
11
|
+
useForwardPropsEmits
|
|
12
|
+
} from "reka-ui";
|
|
9
13
|
import { reactiveOmit, createReusableTemplate } from "@vueuse/core";
|
|
10
14
|
import { useLocale } from "../composables/useLocale";
|
|
11
15
|
import { usePortal } from "../composables/usePortal";
|
|
@@ -19,6 +23,7 @@ import B24Kbd from "./Kbd.vue";
|
|
|
19
23
|
import B24DropdownMenuContent from "./DropdownMenuContent.vue";
|
|
20
24
|
const props = defineProps({
|
|
21
25
|
items: { type: null, required: false },
|
|
26
|
+
arrow: { type: [Boolean, Object], required: false },
|
|
22
27
|
portal: { type: [Boolean, String], required: false, skipCheck: true },
|
|
23
28
|
sub: { type: Boolean, required: false },
|
|
24
29
|
labelKey: { type: null, required: true },
|
|
@@ -30,8 +35,10 @@ const props = defineProps({
|
|
|
30
35
|
loop: { type: Boolean, required: false },
|
|
31
36
|
side: { type: null, required: false },
|
|
32
37
|
sideOffset: { type: Number, required: false },
|
|
38
|
+
sideFlip: { type: Boolean, required: false },
|
|
33
39
|
align: { type: null, required: false },
|
|
34
40
|
alignOffset: { type: Number, required: false },
|
|
41
|
+
alignFlip: { type: Boolean, required: false },
|
|
35
42
|
avoidCollisions: { type: Boolean, required: false },
|
|
36
43
|
collisionBoundary: { type: null, required: false },
|
|
37
44
|
collisionPadding: { type: [Number, Object], required: false },
|
|
@@ -50,6 +57,7 @@ const { dir } = useLocale();
|
|
|
50
57
|
const portalProps = usePortal(toRef(() => props.portal));
|
|
51
58
|
const contentProps = useForwardPropsEmits(reactiveOmit(props, "sub", "items", "portal", "labelKey", "checkedIcon", "externalIcon", "class", "b24ui", "b24uiOverride"), emits);
|
|
52
59
|
const proxySlots = omit(slots, ["default"]);
|
|
60
|
+
const arrowProps = toRef(() => defu(typeof props.arrow === "boolean" ? {} : props.arrow, { width: 20, height: 10 }));
|
|
53
61
|
const getLabel = (item) => {
|
|
54
62
|
return get(item, props.labelKey);
|
|
55
63
|
};
|
|
@@ -76,7 +84,7 @@ const groups = computed(
|
|
|
76
84
|
/>
|
|
77
85
|
<B24Avatar
|
|
78
86
|
v-else-if="item.avatar"
|
|
79
|
-
:size="item.b24ui?.itemLeadingAvatarSize ||
|
|
87
|
+
:size="item.b24ui?.itemLeadingAvatarSize || b24uiOverride?.itemLeadingAvatarSize || b24ui.itemLeadingAvatarSize()"
|
|
80
88
|
v-bind="item.avatar"
|
|
81
89
|
:class="b24ui.itemLeadingAvatar({ class: [b24uiOverride?.itemLeadingAvatar, item.b24ui?.itemLeadingAvatar], active })"
|
|
82
90
|
/>
|
|
@@ -101,7 +109,7 @@ const groups = computed(
|
|
|
101
109
|
:class="b24ui.itemTrailingIcon({ class: [b24uiOverride?.itemTrailingIcon, item.b24ui?.itemTrailingIcon], color: item?.color, active })"
|
|
102
110
|
/>
|
|
103
111
|
<span v-else-if="item.kbds?.length" :class="b24ui.itemTrailingKbds({ class: [b24uiOverride?.itemTrailingKbds, item.b24ui?.itemTrailingKbds] })">
|
|
104
|
-
<B24Kbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="item.b24ui?.itemTrailingKbdsSize ||
|
|
112
|
+
<B24Kbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="item.b24ui?.itemTrailingKbdsSize || b24uiOverride?.itemTrailingKbdsSize || b24ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
|
|
105
113
|
</span>
|
|
106
114
|
</slot>
|
|
107
115
|
|
|
@@ -116,17 +124,29 @@ const groups = computed(
|
|
|
116
124
|
</DefineItemTemplate>
|
|
117
125
|
|
|
118
126
|
<DropdownMenu.Portal v-bind="portalProps">
|
|
119
|
-
<component
|
|
127
|
+
<component
|
|
128
|
+
:is="sub ? DropdownMenu.SubContent : DropdownMenu.Content"
|
|
129
|
+
:class="props.class"
|
|
130
|
+
v-bind="contentProps"
|
|
131
|
+
>
|
|
120
132
|
<slot name="content-top" />
|
|
121
133
|
|
|
122
|
-
<div role="presentation" :class="b24ui.viewport({ class:
|
|
123
|
-
<DropdownMenu.Group
|
|
134
|
+
<div role="presentation" :class="b24ui.viewport({ class: b24uiOverride?.viewport })">
|
|
135
|
+
<DropdownMenu.Group
|
|
136
|
+
v-for="(group, groupIndex) in groups"
|
|
137
|
+
:key="`group-${groupIndex}`"
|
|
138
|
+
:class="b24ui.group({ class: b24uiOverride?.group })"
|
|
139
|
+
>
|
|
124
140
|
<template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
|
|
125
141
|
<DropdownMenu.Label v-if="item.type === 'label'" :class="b24ui.label({ class: [b24uiOverride?.label, item.b24ui?.label, item.class] })">
|
|
126
142
|
<ReuseItemTemplate :item="item" :index="index" />
|
|
127
143
|
</DropdownMenu.Label>
|
|
128
144
|
<DropdownMenu.Separator v-else-if="item.type === 'separator'" :class="b24ui.separator({ class: [b24uiOverride?.separator, item.b24ui?.separator, item.class] })" />
|
|
129
|
-
<DropdownMenu.Sub
|
|
145
|
+
<DropdownMenu.Sub
|
|
146
|
+
v-else-if="item?.children?.length"
|
|
147
|
+
:open="item.open"
|
|
148
|
+
:default-open="item.defaultOpen"
|
|
149
|
+
>
|
|
130
150
|
<DropdownMenu.SubTrigger
|
|
131
151
|
as="button"
|
|
132
152
|
type="button"
|
|
@@ -144,6 +164,7 @@ const groups = computed(
|
|
|
144
164
|
:b24ui-override="b24uiOverride"
|
|
145
165
|
:portal="portal"
|
|
146
166
|
:items="item.children"
|
|
167
|
+
:arrow="arrow"
|
|
147
168
|
align="start"
|
|
148
169
|
:align-offset="-4"
|
|
149
170
|
:side-offset="3"
|
|
@@ -155,6 +176,7 @@ const groups = computed(
|
|
|
155
176
|
<template v-for="(_, name) in proxySlots" #[name]="slotData">
|
|
156
177
|
<slot :name="name" v-bind="slotData" />
|
|
157
178
|
</template>
|
|
179
|
+
<DropdownMenuArrow v-if="!!arrow" v-bind="arrowProps" :class="b24ui.arrow({ class: props.b24ui?.arrow })" />
|
|
158
180
|
</B24DropdownMenuContent>
|
|
159
181
|
</DropdownMenu.Sub>
|
|
160
182
|
<DropdownMenu.CheckboxItem
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { DropdownMenu } from 'reka-ui/namespaced';
|
|
2
|
-
import type { DropdownMenuContentProps as RekaDropdownMenuContentProps } from 'reka-ui';
|
|
2
|
+
import type { DropdownMenuContentProps as RekaDropdownMenuContentProps, DropdownMenuArrowProps } from 'reka-ui';
|
|
3
3
|
import type { AppConfig } from '@nuxt/schema';
|
|
4
4
|
import type theme from '#build/b24ui/dropdown-menu';
|
|
5
|
-
import type { DropdownMenuItem, DropdownMenuSlots, IconComponent } from '../types';
|
|
5
|
+
import type { DropdownMenuItem, DropdownMenuSlots, DynamicSlots, MergeTypes, IconComponent } from '../types';
|
|
6
6
|
import type { ArrayOrNested, NestedItem, ComponentConfig } from '../types/utils';
|
|
7
7
|
type DropdownMenu = ComponentConfig<typeof theme, AppConfig, 'dropdownMenu'>;
|
|
8
8
|
interface DropdownMenuContentProps<T extends ArrayOrNested<DropdownMenuItem>> extends Omit<RekaDropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> {
|
|
9
9
|
items?: T;
|
|
10
|
+
/**
|
|
11
|
+
* Display an arrow alongside the menu.
|
|
12
|
+
* @defaultValue false
|
|
13
|
+
*/
|
|
14
|
+
arrow?: boolean | Omit<DropdownMenuArrowProps, 'as' | 'asChild'>;
|
|
10
15
|
portal?: boolean | string | HTMLElement;
|
|
11
16
|
sub?: boolean;
|
|
12
17
|
labelKey: keyof NestedItem<T>;
|
|
@@ -24,9 +29,12 @@ interface DropdownMenuContentProps<T extends ArrayOrNested<DropdownMenuItem>> ex
|
|
|
24
29
|
};
|
|
25
30
|
b24uiOverride?: DropdownMenu['slots'];
|
|
26
31
|
}
|
|
27
|
-
type DropdownMenuContentSlots<
|
|
32
|
+
type DropdownMenuContentSlots<A extends ArrayOrNested<DropdownMenuItem> = ArrayOrNested<DropdownMenuItem>, T extends NestedItem<A> = NestedItem<A>> = Pick<DropdownMenuSlots<A>, 'item' | 'item-leading' | 'item-label' | 'item-trailing' | 'content-top' | 'content-bottom'> & {
|
|
28
33
|
default(props?: {}): any;
|
|
29
|
-
}
|
|
34
|
+
} & DynamicSlots<MergeTypes<T>, 'leading' | 'label' | 'trailing', {
|
|
35
|
+
active?: boolean;
|
|
36
|
+
index: number;
|
|
37
|
+
}>;
|
|
30
38
|
declare const _default: <T extends ArrayOrNested<DropdownMenuItem>>(__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<{
|
|
31
39
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
32
40
|
readonly onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
@@ -37,12 +45,12 @@ declare const _default: <T extends ArrayOrNested<DropdownMenuItem>>(__VLS_props:
|
|
|
37
45
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onEscapeKeyDown" | "onPointerDownOutside" | "onFocusOutside" | "onInteractOutside" | "onCloseAutoFocus"> & DropdownMenuContentProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
38
46
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
39
47
|
attrs: any;
|
|
40
|
-
slots: DropdownMenuContentSlots<T
|
|
48
|
+
slots: DropdownMenuContentSlots<T, NestedItem<T>>;
|
|
41
49
|
emit: ((evt: "escapeKeyDown", event: KeyboardEvent) => void) & ((evt: "pointerDownOutside", event: import("reka-ui").PointerDownOutsideEvent) => void) & ((evt: "focusOutside", event: import("reka-ui").FocusOutsideEvent) => void) & ((evt: "interactOutside", event: import("reka-ui").PointerDownOutsideEvent | import("reka-ui").FocusOutsideEvent) => void) & ((evt: "closeAutoFocus", event: Event) => void);
|
|
42
50
|
}>) => import("vue").VNode & {
|
|
43
51
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
44
52
|
};
|
|
45
53
|
export default _default;
|
|
46
54
|
type __VLS_PrettifyLocal<T> = {
|
|
47
|
-
[K in keyof T]: T[K];
|
|
55
|
+
[K in keyof T as K]: T[K];
|
|
48
56
|
} & {};
|
|
@@ -168,7 +168,7 @@ defineExpose({
|
|
|
168
168
|
errors,
|
|
169
169
|
setErrors(errs, name) {
|
|
170
170
|
if (name) {
|
|
171
|
-
errors.value = errors.value.filter((
|
|
171
|
+
errors.value = errors.value.filter((err) => name instanceof RegExp ? !(err.name && name.test(err.name)) : err.name !== name).concat(resolveErrorIds(errs));
|
|
172
172
|
} else {
|
|
173
173
|
errors.value = resolveErrorIds(errs);
|
|
174
174
|
}
|
|
@@ -178,13 +178,13 @@ defineExpose({
|
|
|
178
178
|
},
|
|
179
179
|
getErrors(name) {
|
|
180
180
|
if (name) {
|
|
181
|
-
return errors.value.filter((err) => err.name === name);
|
|
181
|
+
return errors.value.filter((err) => name instanceof RegExp ? err.name && name.test(err.name) : err.name === name);
|
|
182
182
|
}
|
|
183
183
|
return errors.value;
|
|
184
184
|
},
|
|
185
185
|
clear(name) {
|
|
186
186
|
if (name) {
|
|
187
|
-
errors.value = errors.value.filter((err) => err.name !== name);
|
|
187
|
+
errors.value = errors.value.filter((err) => name instanceof RegExp ? !(err.name && name.test(err.name)) : err.name !== name);
|
|
188
188
|
} else {
|
|
189
189
|
errors.value = [];
|
|
190
190
|
}
|
|
@@ -13,6 +13,7 @@ export interface FormProps<S extends FormSchema, T extends boolean = true> {
|
|
|
13
13
|
validate?: (state: Partial<InferInput<S>>) => Promise<FormError[]> | FormError[];
|
|
14
14
|
/**
|
|
15
15
|
* The list of input events that trigger the form validation.
|
|
16
|
+
* @remarks The form always validates on submit.
|
|
16
17
|
* @defaultValue `['blur', 'change', 'input']`
|
|
17
18
|
*/
|
|
18
19
|
validateOn?: FormInputEvents[];
|
|
@@ -43,11 +44,11 @@ export interface FormProps<S extends FormSchema, T extends boolean = true> {
|
|
|
43
44
|
onSubmit?: ((event: FormSubmitEvent<FormData<S, T>>) => void | Promise<void>) | (() => void | Promise<void>);
|
|
44
45
|
}
|
|
45
46
|
export interface FormEmits<S extends FormSchema, T extends boolean = true> {
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
submit: [payload: FormSubmitEvent<FormData<S, T>>];
|
|
48
|
+
error: [payload: FormErrorEvent];
|
|
48
49
|
}
|
|
49
50
|
export interface FormSlots {
|
|
50
|
-
default(props
|
|
51
|
+
default(props: {
|
|
51
52
|
errors: FormError[];
|
|
52
53
|
loading: boolean;
|
|
53
54
|
}): any;
|
|
@@ -60,11 +61,11 @@ declare const _default: <S extends FormSchema, T extends boolean = true>(__VLS_p
|
|
|
60
61
|
expose(exposed: import("vue").ShallowUnwrapRef<Form<S>>): void;
|
|
61
62
|
attrs: any;
|
|
62
63
|
slots: FormSlots;
|
|
63
|
-
emit:
|
|
64
|
+
emit: ((evt: "error", payload: FormErrorEvent) => void) & ((evt: "submit", payload: FormSubmitEvent<FormData<S, T>>) => void);
|
|
64
65
|
}>) => import("vue").VNode & {
|
|
65
66
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
66
67
|
};
|
|
67
68
|
export default _default;
|
|
68
69
|
type __VLS_PrettifyLocal<T> = {
|
|
69
|
-
[K in keyof T]: T[K];
|
|
70
|
+
[K in keyof T as K]: T[K];
|
|
70
71
|
} & {};
|
|
@@ -16,7 +16,7 @@ const props = defineProps({
|
|
|
16
16
|
label: { type: String, required: false },
|
|
17
17
|
description: { type: String, required: false },
|
|
18
18
|
help: { type: String, required: false },
|
|
19
|
-
error: { type: [
|
|
19
|
+
error: { type: [Boolean, String], required: false },
|
|
20
20
|
hint: { type: String, required: false },
|
|
21
21
|
size: { type: null, required: false },
|
|
22
22
|
required: { type: Boolean, required: false },
|
|
@@ -85,7 +85,7 @@ provide(formFieldInjectionKey, computed(() => ({
|
|
|
85
85
|
</div>
|
|
86
86
|
</slot>
|
|
87
87
|
</div>
|
|
88
|
-
<div v-else-if="help || !!slots.help" :class="b24ui.help({ class: props.b24ui?.help })">
|
|
88
|
+
<div v-else-if="help || !!slots.help" :id="`${ariaId}-help`" :class="b24ui.help({ class: props.b24ui?.help })">
|
|
89
89
|
<slot name="help" :help="help">
|
|
90
90
|
{{ help }}
|
|
91
91
|
</slot>
|
|
@@ -15,7 +15,7 @@ export interface FormFieldProps {
|
|
|
15
15
|
label?: string;
|
|
16
16
|
description?: string;
|
|
17
17
|
help?: string;
|
|
18
|
-
error?:
|
|
18
|
+
error?: boolean | string;
|
|
19
19
|
hint?: string;
|
|
20
20
|
/**
|
|
21
21
|
* @defaultValue 'md'
|
|
@@ -49,13 +49,13 @@ export interface FormFieldSlots {
|
|
|
49
49
|
help?: string;
|
|
50
50
|
}): any;
|
|
51
51
|
error(props: {
|
|
52
|
-
error?:
|
|
52
|
+
error?: boolean | string;
|
|
53
53
|
}): any;
|
|
54
54
|
default(props: {
|
|
55
|
-
error?:
|
|
55
|
+
error?: boolean | string;
|
|
56
56
|
}): any;
|
|
57
57
|
}
|
|
58
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<FormFieldProps,
|
|
58
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<FormFieldProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FormFieldProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, FormFieldSlots>;
|
|
59
59
|
export default _default;
|
|
60
60
|
type __VLS_WithSlots<T, S> = T & {
|
|
61
61
|
new (): {
|
|
@@ -12,6 +12,7 @@ import { useComponentIcons } from "../composables/useComponentIcons";
|
|
|
12
12
|
import { useFormField } from "../composables/useFormField";
|
|
13
13
|
import { looseToNumber } from "../utils";
|
|
14
14
|
import { tv } from "../utils/tv";
|
|
15
|
+
import B24Badge from "./Badge.vue";
|
|
15
16
|
import B24Avatar from "./Avatar.vue";
|
|
16
17
|
defineOptions({ inheritAttrs: false });
|
|
17
18
|
const props = defineProps({
|
|
@@ -61,7 +62,6 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.input |
|
|
|
61
62
|
color: color.value,
|
|
62
63
|
size: inputSize?.value,
|
|
63
64
|
loading: props.loading,
|
|
64
|
-
tagColor: props.tagColor,
|
|
65
65
|
highlight: highlight.value,
|
|
66
66
|
rounded: Boolean(props.rounded),
|
|
67
67
|
noPadding: Boolean(props.noPadding),
|
|
@@ -122,9 +122,13 @@ defineExpose({
|
|
|
122
122
|
|
|
123
123
|
<template>
|
|
124
124
|
<Primitive :as="as" :class="b24ui.root({ class: [props.b24ui?.root, props.class] })">
|
|
125
|
-
<
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
<B24Badge
|
|
126
|
+
v-if="isTag"
|
|
127
|
+
:class="b24ui.tag({ class: props.b24ui?.tag })"
|
|
128
|
+
:color="props.tagColor"
|
|
129
|
+
:label="props.tag"
|
|
130
|
+
size="xs"
|
|
131
|
+
/>
|
|
128
132
|
|
|
129
133
|
<input
|
|
130
134
|
:id="id"
|
|
@@ -2,6 +2,7 @@ import type { InputHTMLAttributes } from 'vue';
|
|
|
2
2
|
import type { AppConfig } from '@nuxt/schema';
|
|
3
3
|
import theme from '#build/b24ui/input';
|
|
4
4
|
import type { UseComponentIconsProps } from '../composables/useComponentIcons';
|
|
5
|
+
import type { BadgeProps } from '../types';
|
|
5
6
|
import type { AcceptableValue, ComponentConfig } from '../types/utils';
|
|
6
7
|
type Input = ComponentConfig<typeof theme, AppConfig, 'input'>;
|
|
7
8
|
export interface InputProps<T extends AcceptableValue = AcceptableValue> extends UseComponentIconsProps {
|
|
@@ -21,7 +22,7 @@ export interface InputProps<T extends AcceptableValue = AcceptableValue> extends
|
|
|
21
22
|
*/
|
|
22
23
|
placeholder?: string;
|
|
23
24
|
/**
|
|
24
|
-
* @defaultValue 'primary'
|
|
25
|
+
* @defaultValue 'air-primary'
|
|
25
26
|
*/
|
|
26
27
|
color?: Input['variants']['color'];
|
|
27
28
|
/**
|
|
@@ -70,9 +71,9 @@ export interface InputProps<T extends AcceptableValue = AcceptableValue> extends
|
|
|
70
71
|
disabled?: boolean;
|
|
71
72
|
tag?: string;
|
|
72
73
|
/**
|
|
73
|
-
* @defaultValue 'primary'
|
|
74
|
+
* @defaultValue 'air-primary'
|
|
74
75
|
*/
|
|
75
|
-
tagColor?:
|
|
76
|
+
tagColor?: BadgeProps['color'];
|
|
76
77
|
/**
|
|
77
78
|
* Highlight the ring color like a focus state
|
|
78
79
|
* @defaultValue false
|
|
@@ -91,9 +92,9 @@ export interface InputProps<T extends AcceptableValue = AcceptableValue> extends
|
|
|
91
92
|
b24ui?: Input['slots'];
|
|
92
93
|
}
|
|
93
94
|
export interface InputEmits<T extends AcceptableValue = AcceptableValue> {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
'update:modelValue': [payload: T];
|
|
96
|
+
'blur': [event: FocusEvent];
|
|
97
|
+
'change': [event: Event];
|
|
97
98
|
}
|
|
98
99
|
export interface InputSlots {
|
|
99
100
|
leading(props?: {}): any;
|
|
@@ -111,11 +112,11 @@ declare const _default: <T extends AcceptableValue>(__VLS_props: NonNullable<Awa
|
|
|
111
112
|
}>): void;
|
|
112
113
|
attrs: any;
|
|
113
114
|
slots: InputSlots;
|
|
114
|
-
emit:
|
|
115
|
+
emit: ((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "update:modelValue", payload: T) => void);
|
|
115
116
|
}>) => import("vue").VNode & {
|
|
116
117
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
117
118
|
};
|
|
118
119
|
export default _default;
|
|
119
120
|
type __VLS_PrettifyLocal<T> = {
|
|
120
|
-
[K in keyof T]: T[K];
|
|
121
|
+
[K in keyof T as K]: T[K];
|
|
121
122
|
} & {};
|