@bitrix24/b24ui-nuxt 0.5.11 → 0.6.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/advice.ts +10 -2
- package/.nuxt/b24ui/alert.ts +10 -2
- package/.nuxt/b24ui/avatar-group.ts +10 -2
- package/.nuxt/b24ui/avatar.ts +10 -2
- package/.nuxt/b24ui/badge.ts +10 -2
- package/.nuxt/b24ui/button-group.ts +10 -2
- package/.nuxt/b24ui/button.ts +16 -6
- package/.nuxt/b24ui/calendar.ts +10 -2
- package/.nuxt/b24ui/checkbox.ts +10 -2
- package/.nuxt/b24ui/chip.ts +10 -2
- package/.nuxt/b24ui/collapsible.ts +10 -2
- package/.nuxt/b24ui/container.ts +10 -2
- package/.nuxt/b24ui/countdown.ts +10 -2
- package/.nuxt/b24ui/description-list.ts +10 -2
- package/.nuxt/b24ui/dropdown-menu.ts +10 -2
- package/.nuxt/b24ui/form-field.ts +10 -2
- package/.nuxt/b24ui/form.ts +10 -2
- package/.nuxt/b24ui/input-menu.ts +12 -4
- package/.nuxt/b24ui/input-number.ts +10 -2
- package/.nuxt/b24ui/input.ts +10 -2
- package/.nuxt/b24ui/kbd.ts +10 -2
- package/.nuxt/b24ui/link.ts +10 -2
- package/.nuxt/b24ui/modal.ts +10 -2
- package/.nuxt/b24ui/navbar-divider.ts +10 -2
- package/.nuxt/b24ui/navbar-section.ts +10 -2
- package/.nuxt/b24ui/navbar-spacer.ts +10 -2
- package/.nuxt/b24ui/navbar.ts +10 -2
- package/.nuxt/b24ui/navigation-menu.ts +10 -2
- package/.nuxt/b24ui/popover.ts +10 -2
- package/.nuxt/b24ui/progress.ts +10 -2
- package/.nuxt/b24ui/radio-group.ts +10 -2
- package/.nuxt/b24ui/range.ts +10 -2
- package/.nuxt/b24ui/select-menu.ts +14 -6
- package/.nuxt/b24ui/select.ts +12 -4
- package/.nuxt/b24ui/separator.ts +10 -2
- package/.nuxt/b24ui/sidebar-body.ts +10 -2
- package/.nuxt/b24ui/sidebar-footer.ts +10 -2
- package/.nuxt/b24ui/sidebar-header.ts +10 -2
- package/.nuxt/b24ui/sidebar-heading.ts +10 -2
- package/.nuxt/b24ui/sidebar-layout.ts +10 -2
- package/.nuxt/b24ui/sidebar-section.ts +10 -2
- package/.nuxt/b24ui/sidebar-spacer.ts +10 -2
- package/.nuxt/b24ui/sidebar.ts +10 -2
- package/.nuxt/b24ui/skeleton.ts +10 -2
- package/.nuxt/b24ui/slideover.ts +10 -2
- package/.nuxt/b24ui/stacked-layout.ts +10 -2
- package/.nuxt/b24ui/switch.ts +10 -2
- package/.nuxt/b24ui/tabs.ts +10 -2
- package/.nuxt/b24ui/textarea.ts +10 -2
- package/.nuxt/b24ui/toast.ts +10 -2
- package/.nuxt/b24ui/toaster.ts +10 -2
- package/.nuxt/b24ui/tooltip.ts +10 -2
- package/cli/templates.mjs +19 -15
- package/dist/meta.d.mts +5675 -7513
- package/dist/meta.mjs +5675 -7513
- package/dist/module.json +3 -3
- package/dist/module.mjs +2 -2
- package/dist/runtime/components/Advice.vue +27 -55
- package/dist/runtime/components/Advice.vue.d.ts +56 -0
- package/dist/runtime/components/Alert.vue +35 -97
- package/dist/runtime/components/Alert.vue.d.ts +97 -0
- package/dist/runtime/components/App.vue +24 -34
- package/dist/runtime/components/App.vue.d.ts +23 -0
- package/dist/runtime/components/Avatar.vue +43 -82
- package/dist/runtime/components/Avatar.vue.d.ts +62 -0
- package/dist/runtime/components/AvatarGroup.vue +40 -77
- package/dist/runtime/components/AvatarGroup.vue.d.ts +40 -0
- package/dist/runtime/components/Badge.vue +40 -84
- package/dist/runtime/components/Badge.vue.d.ts +78 -0
- package/dist/runtime/components/Button.vue +107 -164
- package/dist/runtime/components/Button.vue.d.ts +115 -0
- package/dist/runtime/components/ButtonGroup.vue +25 -52
- package/dist/runtime/components/ButtonGroup.vue.d.ts +63 -0
- package/dist/runtime/components/Calendar.vue +73 -153
- package/dist/runtime/components/Calendar.vue.d.ts +107 -0
- package/dist/runtime/components/Checkbox.vue +42 -74
- package/dist/runtime/components/Checkbox.vue.d.ts +55 -0
- package/dist/runtime/components/Chip.vue +26 -75
- package/dist/runtime/components/Chip.vue.d.ts +77 -0
- package/dist/runtime/components/Collapsible.vue +22 -41
- package/dist/runtime/components/Collapsible.vue.d.ts +50 -0
- package/dist/runtime/components/Container.vue +15 -28
- package/dist/runtime/components/Container.vue.d.ts +27 -0
- package/dist/runtime/components/Countdown.vue +153 -379
- package/dist/runtime/components/Countdown.vue.d.ts +122 -0
- package/dist/runtime/components/DescriptionList.vue +78 -150
- package/dist/runtime/components/DescriptionList.vue.d.ts +109 -0
- package/dist/runtime/components/DropdownMenu.vue +38 -140
- package/dist/runtime/components/DropdownMenu.vue.d.ts +133 -0
- package/dist/runtime/components/DropdownMenuContent.vue +65 -79
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +51 -0
- package/dist/runtime/components/Form.vue +132 -218
- package/dist/runtime/components/Form.vue.d.ts +55 -0
- package/dist/runtime/components/FormField.vue +36 -81
- package/dist/runtime/components/FormField.vue.d.ts +73 -0
- package/dist/runtime/components/Input.vue +79 -180
- package/dist/runtime/components/Input.vue.d.ts +135 -0
- package/dist/runtime/components/InputMenu.vue +185 -382
- package/dist/runtime/components/InputMenu.vue.d.ts +357 -0
- package/dist/runtime/components/InputNumber.vue +77 -176
- package/dist/runtime/components/InputNumber.vue.d.ts +238 -0
- package/dist/runtime/components/Kbd.vue +20 -46
- package/dist/runtime/components/Kbd.vue.d.ts +55 -0
- package/dist/runtime/components/Link.vue +99 -179
- package/dist/runtime/components/Link.vue.d.ts +129 -0
- package/dist/runtime/components/LinkBase.vue +33 -42
- package/dist/runtime/components/LinkBase.vue.d.ts +48 -0
- package/dist/runtime/components/Modal.vue +48 -128
- package/dist/runtime/components/Modal.vue.d.ts +124 -0
- package/dist/runtime/components/ModalDialogClose.vue +5 -8
- package/dist/runtime/components/ModalDialogClose.vue.d.ts +10 -0
- package/dist/runtime/components/Navbar.vue +15 -33
- package/dist/runtime/components/Navbar.vue.d.ts +46 -0
- package/dist/runtime/components/NavbarDivider.vue +15 -33
- package/dist/runtime/components/NavbarDivider.vue.d.ts +46 -0
- package/dist/runtime/components/NavbarSection.vue +15 -33
- package/dist/runtime/components/NavbarSection.vue.d.ts +46 -0
- package/dist/runtime/components/NavbarSpacer.vue +15 -33
- package/dist/runtime/components/NavbarSpacer.vue.d.ts +46 -0
- package/dist/runtime/components/NavigationMenu.vue +74 -209
- package/dist/runtime/components/NavigationMenu.vue.d.ts +159 -0
- package/dist/runtime/components/OverlayProvider.vue +14 -18
- package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -0
- package/dist/runtime/components/Popover.vue +40 -82
- package/dist/runtime/components/Popover.vue.d.ts +79 -0
- package/dist/runtime/components/Progress.vue +70 -137
- package/dist/runtime/components/Progress.vue.d.ts +103 -0
- package/dist/runtime/components/RadioGroup.vue +59 -135
- package/dist/runtime/components/RadioGroup.vue.d.ts +88 -0
- package/dist/runtime/components/Range.vue +46 -86
- package/dist/runtime/components/Range.vue.d.ts +73 -0
- package/dist/runtime/components/Select.vue +110 -261
- package/dist/runtime/components/Select.vue.d.ts +170 -0
- package/dist/runtime/components/SelectMenu.vue +161 -348
- package/dist/runtime/components/SelectMenu.vue.d.ts +217 -0
- package/dist/runtime/components/Separator.vue +28 -72
- package/dist/runtime/components/Separator.vue.d.ts +77 -0
- package/dist/runtime/components/Sidebar.vue +15 -33
- package/dist/runtime/components/Sidebar.vue.d.ts +46 -0
- package/dist/runtime/components/SidebarBody.vue +17 -39
- package/dist/runtime/components/SidebarBody.vue.d.ts +53 -0
- package/dist/runtime/components/SidebarFooter.vue +15 -33
- package/dist/runtime/components/SidebarFooter.vue.d.ts +46 -0
- package/dist/runtime/components/SidebarHeader.vue +15 -33
- package/dist/runtime/components/SidebarHeader.vue.d.ts +46 -0
- package/dist/runtime/components/SidebarHeading.vue +15 -33
- package/dist/runtime/components/SidebarHeading.vue.d.ts +46 -0
- package/dist/runtime/components/SidebarLayout.vue +34 -71
- package/dist/runtime/components/SidebarLayout.vue.d.ts +65 -0
- package/dist/runtime/components/SidebarSection.vue +15 -33
- package/dist/runtime/components/SidebarSection.vue.d.ts +46 -0
- package/dist/runtime/components/SidebarSpacer.vue +15 -33
- package/dist/runtime/components/SidebarSpacer.vue.d.ts +46 -0
- package/dist/runtime/components/Skeleton.vue +14 -23
- package/dist/runtime/components/Skeleton.vue.d.ts +26 -0
- package/dist/runtime/components/Slideover.vue +50 -132
- package/dist/runtime/components/Slideover.vue.d.ts +127 -0
- package/dist/runtime/components/StackedLayout.vue +34 -74
- package/dist/runtime/components/StackedLayout.vue.d.ts +65 -0
- package/dist/runtime/components/Switch.vue +46 -96
- package/dist/runtime/components/Switch.vue.d.ts +77 -0
- package/dist/runtime/components/Tabs.vue +41 -106
- package/dist/runtime/components/Tabs.vue.d.ts +104 -0
- package/dist/runtime/components/Textarea.vue +92 -202
- package/dist/runtime/components/Textarea.vue.d.ts +141 -0
- package/dist/runtime/components/Toast.vue +47 -106
- package/dist/runtime/components/Toast.vue.d.ts +95 -0
- package/dist/runtime/components/Toaster.vue +70 -116
- package/dist/runtime/components/Toaster.vue.d.ts +70 -0
- package/dist/runtime/components/Tooltip.vue +36 -65
- package/dist/runtime/components/Tooltip.vue.d.ts +65 -0
- package/dist/runtime/components/content/TableWrapper.vue +24 -71
- package/dist/runtime/components/content/TableWrapper.vue.d.ts +83 -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 +3 -3
- package/dist/runtime/composables/useFormField.d.ts +2 -2
- package/dist/runtime/composables/useOverlay.d.ts +14 -7
- package/dist/runtime/composables/useOverlay.js +14 -6
- package/dist/runtime/prose/A.vue +16 -26
- package/dist/runtime/prose/A.vue.d.ts +27 -0
- package/dist/runtime/prose/Blockquote.vue +14 -26
- package/dist/runtime/prose/Blockquote.vue.d.ts +27 -0
- package/dist/runtime/prose/Code.vue +15 -32
- package/dist/runtime/prose/Code.vue.d.ts +31 -0
- package/dist/runtime/prose/Em.vue +16 -26
- package/dist/runtime/prose/Em.vue.d.ts +27 -0
- package/dist/runtime/prose/H1.vue +14 -26
- package/dist/runtime/prose/H1.vue.d.ts +27 -0
- package/dist/runtime/prose/H2.vue +14 -26
- package/dist/runtime/prose/H2.vue.d.ts +27 -0
- package/dist/runtime/prose/H3.vue +14 -26
- package/dist/runtime/prose/H3.vue.d.ts +27 -0
- package/dist/runtime/prose/H4.vue +14 -26
- package/dist/runtime/prose/H4.vue.d.ts +27 -0
- package/dist/runtime/prose/H5.vue +14 -26
- package/dist/runtime/prose/H5.vue.d.ts +27 -0
- package/dist/runtime/prose/H6.vue +14 -26
- package/dist/runtime/prose/H6.vue.d.ts +27 -0
- package/dist/runtime/prose/Hr.vue +13 -22
- package/dist/runtime/prose/Hr.vue.d.ts +19 -0
- package/dist/runtime/prose/Img.vue +13 -26
- package/dist/runtime/prose/Img.vue.d.ts +19 -0
- package/dist/runtime/prose/Li.vue +14 -26
- package/dist/runtime/prose/Li.vue.d.ts +27 -0
- package/dist/runtime/prose/Ol.vue +14 -26
- package/dist/runtime/prose/Ol.vue.d.ts +27 -0
- package/dist/runtime/prose/P.vue +14 -26
- package/dist/runtime/prose/P.vue.d.ts +27 -0
- package/dist/runtime/prose/Pre.vue +17 -33
- package/dist/runtime/prose/Pre.vue.d.ts +47 -0
- package/dist/runtime/prose/Strong.vue +14 -26
- package/dist/runtime/prose/Strong.vue.d.ts +27 -0
- package/dist/runtime/prose/Table.vue +21 -57
- package/dist/runtime/prose/Table.vue.d.ts +74 -0
- package/dist/runtime/prose/Tbody.vue +14 -26
- package/dist/runtime/prose/Tbody.vue.d.ts +27 -0
- package/dist/runtime/prose/Td.vue +14 -26
- package/dist/runtime/prose/Td.vue.d.ts +27 -0
- package/dist/runtime/prose/Th.vue +14 -26
- package/dist/runtime/prose/Th.vue.d.ts +27 -0
- package/dist/runtime/prose/Thead.vue +14 -26
- package/dist/runtime/prose/Thead.vue.d.ts +27 -0
- package/dist/runtime/prose/Tr.vue +14 -26
- package/dist/runtime/prose/Tr.vue.d.ts +27 -0
- package/dist/runtime/prose/Ul.vue +14 -26
- package/dist/runtime/prose/Ul.vue.d.ts +27 -0
- package/dist/runtime/types/form.d.ts +1 -0
- package/dist/runtime/types/utils.d.ts +42 -3
- package/dist/runtime/utils/link.d.ts +3 -3
- package/dist/runtime/utils/tv.js +2 -2
- package/dist/runtime/vue/components/Link.vue +122 -208
- package/dist/runtime/vue/components/Link.vue.d.ts +129 -0
- package/dist/shared/{b24ui-nuxt.CS9Lf0os.mjs → b24ui-nuxt.wBs9vEU5.mjs} +33 -8
- package/dist/types.d.mts +3 -5
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +19 -27
- package/dist/meta.cjs +0 -72112
- package/dist/meta.d.cts +0 -72110
- package/dist/meta.d.ts +0 -72110
- package/dist/module.cjs +0 -63
- package/dist/module.d.cts +0 -15
- package/dist/module.d.ts +0 -15
- package/dist/shared/b24ui-nuxt.DrKwIWoc.cjs +0 -7721
- 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
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import type { InputHTMLAttributes } from 'vue';
|
|
2
|
+
import type { ComboboxRootProps, ComboboxRootEmits, ComboboxContentProps, ComboboxContentEmits, ComboboxArrowProps } from 'reka-ui';
|
|
3
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
4
|
+
import theme from '#build/b24ui/input-menu';
|
|
5
|
+
import type { UseComponentIconsProps } from '../composables/useComponentIcons';
|
|
6
|
+
import type { AvatarProps, ChipProps, IconComponent } from '../types';
|
|
7
|
+
import type { AcceptableValue, ArrayOrNested, GetItemKeys, GetModelValue, GetModelValueEmits, NestedItem, EmitsToProps, ComponentConfig } from '../types/utils';
|
|
8
|
+
type InputMenu = ComponentConfig<typeof theme, AppConfig, 'inputMenu'>;
|
|
9
|
+
interface _InputMenuItem {
|
|
10
|
+
label?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Display an icon on the left side.
|
|
13
|
+
* @IconComponent
|
|
14
|
+
*/
|
|
15
|
+
icon?: IconComponent;
|
|
16
|
+
avatar?: AvatarProps;
|
|
17
|
+
color?: InputMenu['variants']['color'];
|
|
18
|
+
chip?: ChipProps;
|
|
19
|
+
/**
|
|
20
|
+
* The item type.
|
|
21
|
+
* @defaultValue 'item'
|
|
22
|
+
*/
|
|
23
|
+
type?: 'label' | 'separator' | 'item';
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
onSelect?(e?: Event): void;
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}
|
|
28
|
+
export type InputMenuItem = _InputMenuItem | AcceptableValue | boolean;
|
|
29
|
+
export interface InputMenuProps<T extends ArrayOrNested<InputMenuItem> = ArrayOrNested<InputMenuItem>, VK extends GetItemKeys<T> | undefined = undefined, M extends boolean = false> extends Pick<ComboboxRootProps<T>, 'open' | 'defaultOpen' | 'disabled' | 'name' | 'resetSearchTermOnBlur' | 'resetSearchTermOnSelect' | 'highlightOnHover'>, UseComponentIconsProps {
|
|
30
|
+
/**
|
|
31
|
+
* The element or component this component should render as.
|
|
32
|
+
* @defaultValue 'div'
|
|
33
|
+
*/
|
|
34
|
+
as?: any;
|
|
35
|
+
id?: string;
|
|
36
|
+
/**
|
|
37
|
+
* @defaultValue 'text'
|
|
38
|
+
*/
|
|
39
|
+
type?: InputHTMLAttributes['type'];
|
|
40
|
+
/**
|
|
41
|
+
* The placeholder text when the input is empty
|
|
42
|
+
*/
|
|
43
|
+
placeholder?: string;
|
|
44
|
+
/**
|
|
45
|
+
* @defaultValue 'primary'
|
|
46
|
+
*/
|
|
47
|
+
color?: InputMenu['variants']['color'];
|
|
48
|
+
/**
|
|
49
|
+
* @defaultValue 'md'
|
|
50
|
+
*/
|
|
51
|
+
size?: InputMenu['variants']['size'];
|
|
52
|
+
/**
|
|
53
|
+
* Removes padding from input
|
|
54
|
+
* @defaultValue false
|
|
55
|
+
*/
|
|
56
|
+
noPadding?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Removes all borders (rings)
|
|
59
|
+
* @defaultValue false
|
|
60
|
+
*/
|
|
61
|
+
noBorder?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Removes all borders (rings) except the bottom one
|
|
64
|
+
* @defaultValue false
|
|
65
|
+
*/
|
|
66
|
+
underline?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Rounds the corners of the button
|
|
69
|
+
* @defaultValue false
|
|
70
|
+
*/
|
|
71
|
+
rounded?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* @defaultValue false
|
|
74
|
+
*/
|
|
75
|
+
required?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* @defaultValue false
|
|
78
|
+
*/
|
|
79
|
+
autofocus?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* @defaultValue 0
|
|
82
|
+
*/
|
|
83
|
+
autofocusDelay?: number;
|
|
84
|
+
/**
|
|
85
|
+
* The icon displayed to open the menu.
|
|
86
|
+
* @defaultValue icons.chevronDown
|
|
87
|
+
* @IconComponent
|
|
88
|
+
*/
|
|
89
|
+
trailingIcon?: IconComponent;
|
|
90
|
+
/**
|
|
91
|
+
* The icon displayed when an item is selected.
|
|
92
|
+
* @defaultValue icons.check
|
|
93
|
+
* @IconComponent
|
|
94
|
+
*/
|
|
95
|
+
selectedIcon?: IconComponent;
|
|
96
|
+
/**
|
|
97
|
+
* The icon displayed to delete a tag.
|
|
98
|
+
* Works only when `multiple` is `true`.
|
|
99
|
+
* @defaultValue icons.close
|
|
100
|
+
* @IconComponent
|
|
101
|
+
*/
|
|
102
|
+
deleteIcon?: IconComponent;
|
|
103
|
+
/**
|
|
104
|
+
* The content of the menu.
|
|
105
|
+
* @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8, position: 'popper' }
|
|
106
|
+
*/
|
|
107
|
+
content?: Omit<ComboboxContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<ComboboxContentEmits>>;
|
|
108
|
+
/**
|
|
109
|
+
* Display an arrow alongside the menu.
|
|
110
|
+
* @defaultValue false
|
|
111
|
+
*/
|
|
112
|
+
arrow?: boolean | Omit<ComboboxArrowProps, 'as' | 'asChild'>;
|
|
113
|
+
/**
|
|
114
|
+
* Render the menu in a portal.
|
|
115
|
+
* @defaultValue true
|
|
116
|
+
*/
|
|
117
|
+
portal?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* When `items` is an array of objects, select the field to use as the value instead of the object itself.
|
|
120
|
+
* @defaultValue undefined
|
|
121
|
+
*/
|
|
122
|
+
valueKey?: VK;
|
|
123
|
+
/**
|
|
124
|
+
* When `items` is an array of objects, select the field to use as the label.
|
|
125
|
+
* @defaultValue 'label'
|
|
126
|
+
*/
|
|
127
|
+
labelKey?: keyof NestedItem<T>;
|
|
128
|
+
items?: T;
|
|
129
|
+
/**
|
|
130
|
+
* The value of the InputMenu when initially rendered. Use when you do not need to control the state of the InputMenu
|
|
131
|
+
*/
|
|
132
|
+
defaultValue?: GetModelValue<T, VK, M>;
|
|
133
|
+
/**
|
|
134
|
+
* The controlled value of the InputMenu. Can be binded-with with `v-model`
|
|
135
|
+
*/
|
|
136
|
+
modelValue?: GetModelValue<T, VK, M>;
|
|
137
|
+
/**
|
|
138
|
+
* Whether multiple options can be selected or not
|
|
139
|
+
* @defaultValue false
|
|
140
|
+
*/
|
|
141
|
+
multiple?: M & boolean;
|
|
142
|
+
tag?: string;
|
|
143
|
+
/**
|
|
144
|
+
* @defaultValue 'primary'
|
|
145
|
+
*/
|
|
146
|
+
tagColor?: InputMenu['variants']['tagColor'];
|
|
147
|
+
/**
|
|
148
|
+
* Highlight the ring color like a focus state
|
|
149
|
+
* @defaultValue false
|
|
150
|
+
*/
|
|
151
|
+
highlight?: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Determines if custom user input that does not exist in options can be added.
|
|
154
|
+
* @defaultValue false
|
|
155
|
+
*/
|
|
156
|
+
createItem?: boolean | 'always' | {
|
|
157
|
+
position?: 'top' | 'bottom';
|
|
158
|
+
when?: 'empty' | 'always';
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Fields to filter items by.
|
|
162
|
+
* @defaultValue [labelKey]
|
|
163
|
+
*/
|
|
164
|
+
filterFields?: string[];
|
|
165
|
+
/**
|
|
166
|
+
* When `true`, disable the default filters, useful for custom filtering (useAsyncData, useFetch, etc.).
|
|
167
|
+
* @defaultValue false
|
|
168
|
+
*/
|
|
169
|
+
ignoreFilter?: boolean;
|
|
170
|
+
class?: any;
|
|
171
|
+
b24ui?: InputMenu['slots'];
|
|
172
|
+
}
|
|
173
|
+
export type InputMenuEmits<A extends ArrayOrNested<InputMenuItem>, VK extends GetItemKeys<A> | undefined, M extends boolean> = Pick<ComboboxRootEmits, 'update:open'> & {
|
|
174
|
+
change: [payload: Event];
|
|
175
|
+
blur: [payload: FocusEvent];
|
|
176
|
+
focus: [payload: FocusEvent];
|
|
177
|
+
create: [item: string];
|
|
178
|
+
/** Event handler when highlighted element changes. */
|
|
179
|
+
highlight: [
|
|
180
|
+
payload: {
|
|
181
|
+
ref: HTMLElement;
|
|
182
|
+
value: GetModelValue<A, VK, M>;
|
|
183
|
+
} | undefined
|
|
184
|
+
];
|
|
185
|
+
} & GetModelValueEmits<A, VK, M>;
|
|
186
|
+
type SlotProps<T extends InputMenuItem> = (props: {
|
|
187
|
+
item: T;
|
|
188
|
+
index: number;
|
|
189
|
+
}) => any;
|
|
190
|
+
export interface InputMenuSlots<A extends ArrayOrNested<InputMenuItem> = ArrayOrNested<InputMenuItem>, VK extends GetItemKeys<A> | undefined = undefined, M extends boolean = false, T extends NestedItem<A> = NestedItem<A>> {
|
|
191
|
+
'leading'(props: {
|
|
192
|
+
modelValue?: GetModelValue<A, VK, M>;
|
|
193
|
+
open: boolean;
|
|
194
|
+
b24ui: {
|
|
195
|
+
[K in keyof Required<InputMenu['slots']>]: (props?: Record<string, any>) => string;
|
|
196
|
+
};
|
|
197
|
+
}): any;
|
|
198
|
+
'trailing'(props: {
|
|
199
|
+
modelValue?: GetModelValue<A, VK, M>;
|
|
200
|
+
open: boolean;
|
|
201
|
+
b24ui: {
|
|
202
|
+
[K in keyof Required<InputMenu['slots']>]: (props?: Record<string, any>) => string;
|
|
203
|
+
};
|
|
204
|
+
}): any;
|
|
205
|
+
'empty'(props: {
|
|
206
|
+
searchTerm?: string;
|
|
207
|
+
}): any;
|
|
208
|
+
'item': SlotProps<T>;
|
|
209
|
+
'item-leading': SlotProps<T>;
|
|
210
|
+
'item-label': SlotProps<T>;
|
|
211
|
+
'item-trailing': SlotProps<T>;
|
|
212
|
+
'tags-item-text': SlotProps<T>;
|
|
213
|
+
'tags-item-delete': SlotProps<T>;
|
|
214
|
+
'create-item-label'(props: {
|
|
215
|
+
item: string;
|
|
216
|
+
}): any;
|
|
217
|
+
}
|
|
218
|
+
declare const _default: <T extends ArrayOrNested<InputMenuItem>, VK extends GetItemKeys<T> | undefined = undefined, M extends boolean = false>(__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<{
|
|
219
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & ({
|
|
220
|
+
searchTerm?: string;
|
|
221
|
+
} & InputMenuProps<T, VK, M>) & Partial<{}>> & (import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps);
|
|
222
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
223
|
+
inputRef: import("vue").Ref<({
|
|
224
|
+
$: import("vue").ComponentInternalInstance;
|
|
225
|
+
$data: {};
|
|
226
|
+
$props: {
|
|
227
|
+
readonly displayValue?: ((val: any) => string) | undefined;
|
|
228
|
+
readonly modelValue?: string | undefined;
|
|
229
|
+
readonly autoFocus?: boolean | undefined;
|
|
230
|
+
readonly disabled?: boolean | undefined;
|
|
231
|
+
readonly asChild?: boolean | undefined;
|
|
232
|
+
readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
|
|
233
|
+
readonly "onUpdate:modelValue"?: ((args_0: string) => any) | undefined | undefined;
|
|
234
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
235
|
+
$attrs: {
|
|
236
|
+
[x: string]: unknown;
|
|
237
|
+
};
|
|
238
|
+
$refs: {
|
|
239
|
+
[x: string]: unknown;
|
|
240
|
+
};
|
|
241
|
+
$slots: Readonly<{
|
|
242
|
+
[name: string]: import("vue").Slot<any> | undefined;
|
|
243
|
+
}>;
|
|
244
|
+
$root: import("vue").ComponentPublicInstance | null;
|
|
245
|
+
$parent: import("vue").ComponentPublicInstance | null;
|
|
246
|
+
$host: Element | null;
|
|
247
|
+
$emit: (event: "update:modelValue", args_0: string) => void;
|
|
248
|
+
$el: any;
|
|
249
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").ComboboxInputProps> & Readonly<{
|
|
250
|
+
"onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
|
|
251
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
252
|
+
"update:modelValue": (args_0: string) => any;
|
|
253
|
+
}, string, {
|
|
254
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
255
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
256
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
257
|
+
created?: (() => void) | (() => void)[];
|
|
258
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
259
|
+
mounted?: (() => void) | (() => void)[];
|
|
260
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
261
|
+
updated?: (() => void) | (() => void)[];
|
|
262
|
+
activated?: (() => void) | (() => void)[];
|
|
263
|
+
deactivated?: (() => void) | (() => void)[];
|
|
264
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
265
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
266
|
+
destroyed?: (() => void) | (() => void)[];
|
|
267
|
+
unmounted?: (() => void) | (() => void)[];
|
|
268
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
269
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
270
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
271
|
+
};
|
|
272
|
+
$forceUpdate: () => void;
|
|
273
|
+
$nextTick: typeof import("vue").nextTick;
|
|
274
|
+
$watch<T_1 extends string | ((...args: any) => any)>(source: T_1, cb: T_1 extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
|
|
275
|
+
} & Readonly<{
|
|
276
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
277
|
+
}> & Omit<Readonly<import("reka-ui").ComboboxInputProps> & Readonly<{
|
|
278
|
+
"onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
|
|
279
|
+
}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
280
|
+
$slots: {
|
|
281
|
+
default?(_: {}): any;
|
|
282
|
+
};
|
|
283
|
+
}) | null, ({
|
|
284
|
+
$: import("vue").ComponentInternalInstance;
|
|
285
|
+
$data: {};
|
|
286
|
+
$props: {
|
|
287
|
+
readonly displayValue?: ((val: any) => string) | undefined;
|
|
288
|
+
readonly modelValue?: string | undefined;
|
|
289
|
+
readonly autoFocus?: boolean | undefined;
|
|
290
|
+
readonly disabled?: boolean | undefined;
|
|
291
|
+
readonly asChild?: boolean | undefined;
|
|
292
|
+
readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
|
|
293
|
+
readonly "onUpdate:modelValue"?: ((args_0: string) => any) | undefined | undefined;
|
|
294
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
295
|
+
$attrs: {
|
|
296
|
+
[x: string]: unknown;
|
|
297
|
+
};
|
|
298
|
+
$refs: {
|
|
299
|
+
[x: string]: unknown;
|
|
300
|
+
};
|
|
301
|
+
$slots: Readonly<{
|
|
302
|
+
[name: string]: import("vue").Slot<any> | undefined;
|
|
303
|
+
}>;
|
|
304
|
+
$root: import("vue").ComponentPublicInstance | null;
|
|
305
|
+
$parent: import("vue").ComponentPublicInstance | null;
|
|
306
|
+
$host: Element | null;
|
|
307
|
+
$emit: (event: "update:modelValue", args_0: string) => void;
|
|
308
|
+
$el: any;
|
|
309
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").ComboboxInputProps> & Readonly<{
|
|
310
|
+
"onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
|
|
311
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
312
|
+
"update:modelValue": (args_0: string) => any;
|
|
313
|
+
}, string, {
|
|
314
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
315
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
316
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
317
|
+
created?: (() => void) | (() => void)[];
|
|
318
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
319
|
+
mounted?: (() => void) | (() => void)[];
|
|
320
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
321
|
+
updated?: (() => void) | (() => void)[];
|
|
322
|
+
activated?: (() => void) | (() => void)[];
|
|
323
|
+
deactivated?: (() => void) | (() => void)[];
|
|
324
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
325
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
326
|
+
destroyed?: (() => void) | (() => void)[];
|
|
327
|
+
unmounted?: (() => void) | (() => void)[];
|
|
328
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
329
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
330
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
331
|
+
};
|
|
332
|
+
$forceUpdate: () => void;
|
|
333
|
+
$nextTick: typeof import("vue").nextTick;
|
|
334
|
+
$watch<T_1 extends string | ((...args: any) => any)>(source: T_1, cb: T_1 extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
|
|
335
|
+
} & Readonly<{
|
|
336
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
337
|
+
}> & Omit<Readonly<import("reka-ui").ComboboxInputProps> & Readonly<{
|
|
338
|
+
"onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
|
|
339
|
+
}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
340
|
+
$slots: {
|
|
341
|
+
default?(_: {}): any;
|
|
342
|
+
};
|
|
343
|
+
}) | null>;
|
|
344
|
+
}>): void;
|
|
345
|
+
attrs: any;
|
|
346
|
+
slots: Readonly<InputMenuSlots<T, VK, M, NestedItem<T>>> & InputMenuSlots<T, VK, M, NestedItem<T>>;
|
|
347
|
+
emit: (((evt: "blur", payload: FocusEvent) => void) & ((evt: "change", payload: Event) => void) & ((evt: "focus", payload: FocusEvent) => void) & ((evt: "create", item: string) => void) & ((evt: "highlight", payload: {
|
|
348
|
+
ref: HTMLElement;
|
|
349
|
+
value: GetModelValue<T, VK, M>;
|
|
350
|
+
} | undefined) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "update:modelValue", payload: GetModelValue<T, VK, M>) => void)) & ((evt: "update:searchTerm", value: string) => void);
|
|
351
|
+
}>) => import("vue").VNode & {
|
|
352
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
353
|
+
};
|
|
354
|
+
export default _default;
|
|
355
|
+
type __VLS_PrettifyLocal<T> = {
|
|
356
|
+
[K in keyof T]: T[K];
|
|
357
|
+
} & {};
|
|
@@ -1,154 +1,64 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
import type { NumberFieldRootProps } from 'reka-ui'
|
|
4
|
-
import type { AppConfig } from '@nuxt/schema'
|
|
5
|
-
import _appConfig from '#build/app.config'
|
|
6
|
-
import theme from '#build/b24ui/input-number'
|
|
7
|
-
import { tv } from '../utils/tv'
|
|
8
|
-
import type { ButtonProps, IconComponent } from '../types'
|
|
9
|
-
import type { PartialString } from '../types/utils'
|
|
10
|
-
|
|
11
|
-
const appConfigInputNumber = _appConfig as AppConfig & { b24ui: { inputNumber: Partial<typeof theme> } }
|
|
12
|
-
|
|
13
|
-
const inputNumber = tv({ extend: tv(theme), ...(appConfigInputNumber.b24ui?.inputNumber || {}) })
|
|
14
|
-
|
|
15
|
-
type InputNumberVariants = VariantProps<typeof inputNumber>
|
|
16
|
-
|
|
17
|
-
export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue' | 'defaultValue' | 'min' | 'max' | 'stepSnapping' | 'step' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions' | 'disableWheelChange'> {
|
|
18
|
-
/**
|
|
19
|
-
* The element or component this component should render as.
|
|
20
|
-
* @defaultValue 'div'
|
|
21
|
-
*/
|
|
22
|
-
as?: any
|
|
23
|
-
/**
|
|
24
|
-
* The placeholder text when the input is empty
|
|
25
|
-
*/
|
|
26
|
-
placeholder?: string
|
|
27
|
-
/**
|
|
28
|
-
* @defaultValue 'primary'
|
|
29
|
-
*/
|
|
30
|
-
color?: InputNumberVariants['color']
|
|
31
|
-
/**
|
|
32
|
-
* @defaultValue 'md'
|
|
33
|
-
*/
|
|
34
|
-
size?: InputNumberVariants['size']
|
|
35
|
-
/**
|
|
36
|
-
* Removes padding from input
|
|
37
|
-
* @defaultValue false
|
|
38
|
-
*/
|
|
39
|
-
noPadding?: boolean
|
|
40
|
-
/**
|
|
41
|
-
* Removes all borders (rings)
|
|
42
|
-
* @defaultValue false
|
|
43
|
-
*/
|
|
44
|
-
noBorder?: boolean
|
|
45
|
-
/**
|
|
46
|
-
* Removes all borders (rings) except the bottom one
|
|
47
|
-
* @defaultValue false
|
|
48
|
-
*/
|
|
49
|
-
underline?: boolean
|
|
50
|
-
/**
|
|
51
|
-
* Rounds the corners of the button
|
|
52
|
-
* @defaultValue false
|
|
53
|
-
*/
|
|
54
|
-
rounded?: boolean
|
|
55
|
-
tag?: string
|
|
56
|
-
/**
|
|
57
|
-
* @defaultValue 'primary'
|
|
58
|
-
*/
|
|
59
|
-
tagColor?: InputNumberVariants['tagColor']
|
|
60
|
-
/**
|
|
61
|
-
* Highlight the ring color like a focus state
|
|
62
|
-
* @defaultValue false
|
|
63
|
-
*/
|
|
64
|
-
highlight?: boolean
|
|
65
|
-
/**
|
|
66
|
-
* The orientation of the input menu.
|
|
67
|
-
* @defaultValue 'horizontal'
|
|
68
|
-
*/
|
|
69
|
-
orientation?: 'vertical' | 'horizontal'
|
|
70
|
-
/**
|
|
71
|
-
* Configure the increment button. The `size` is inherited.
|
|
72
|
-
* @defaultValue { color: 'link', depth: 'light' }
|
|
73
|
-
*/
|
|
74
|
-
increment?: ButtonProps
|
|
75
|
-
/**
|
|
76
|
-
* The icon displayed to increment the value.
|
|
77
|
-
* @defaultValue icons.plus
|
|
78
|
-
* @IconComponent
|
|
79
|
-
*/
|
|
80
|
-
incrementIcon?: IconComponent
|
|
81
|
-
/**
|
|
82
|
-
* Configure the decrement button. The `size` is inherited.
|
|
83
|
-
* @defaultValue { color: 'link', depth: 'light' }
|
|
84
|
-
*/
|
|
85
|
-
decrement?: ButtonProps
|
|
86
|
-
/**
|
|
87
|
-
* The icon displayed to decrement the value.
|
|
88
|
-
* @defaultValue icons.minus
|
|
89
|
-
* @IconComponent
|
|
90
|
-
*/
|
|
91
|
-
decrementIcon?: IconComponent
|
|
92
|
-
/**
|
|
93
|
-
* @defaultValue false
|
|
94
|
-
*/
|
|
95
|
-
autofocus?: boolean
|
|
96
|
-
/**
|
|
97
|
-
* @defaultValue 0
|
|
98
|
-
*/
|
|
99
|
-
autofocusDelay?: number
|
|
100
|
-
/**
|
|
101
|
-
* The locale to use for formatting and parsing numbers.
|
|
102
|
-
* @defaultValue B24App.locale.code
|
|
103
|
-
*/
|
|
104
|
-
locale?: string
|
|
105
|
-
class?: any
|
|
106
|
-
b24ui?: PartialString<typeof inputNumber.slots>
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export interface InputNumberEmits {
|
|
110
|
-
(e: 'update:modelValue', payload: number): void
|
|
111
|
-
(e: 'blur', event: FocusEvent): void
|
|
112
|
-
(e: 'change', payload: Event): void
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export interface InputNumberSlots {
|
|
116
|
-
increment(props?: {}): any
|
|
117
|
-
decrement(props?: {}): any
|
|
118
|
-
}
|
|
1
|
+
<script>
|
|
2
|
+
import theme from "#build/b24ui/input-number";
|
|
119
3
|
</script>
|
|
120
4
|
|
|
121
|
-
<script setup
|
|
122
|
-
import { onMounted, ref, computed } from
|
|
123
|
-
import { NumberFieldRoot, NumberFieldInput, NumberFieldDecrement, NumberFieldIncrement, useForwardPropsEmits } from
|
|
124
|
-
import { reactivePick } from
|
|
125
|
-
import {
|
|
126
|
-
import {
|
|
127
|
-
import
|
|
128
|
-
import
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
const props =
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
5
|
+
<script setup>
|
|
6
|
+
import { onMounted, ref, computed } from "vue";
|
|
7
|
+
import { NumberFieldRoot, NumberFieldInput, NumberFieldDecrement, NumberFieldIncrement, useForwardPropsEmits } from "reka-ui";
|
|
8
|
+
import { reactivePick } from "@vueuse/core";
|
|
9
|
+
import { useAppConfig } from "#imports";
|
|
10
|
+
import { useFormField } from "../composables/useFormField";
|
|
11
|
+
import { useLocale } from "../composables/useLocale";
|
|
12
|
+
import { tv } from "../utils/tv";
|
|
13
|
+
import icons from "../dictionary/icons";
|
|
14
|
+
import B24Button from "./Button.vue";
|
|
15
|
+
defineOptions({ inheritAttrs: false });
|
|
16
|
+
const props = defineProps({
|
|
17
|
+
as: { type: null, required: false },
|
|
18
|
+
placeholder: { type: String, required: false },
|
|
19
|
+
color: { type: null, required: false, default: "primary" },
|
|
20
|
+
size: { type: null, required: false, default: "md" },
|
|
21
|
+
noPadding: { type: Boolean, required: false },
|
|
22
|
+
noBorder: { type: Boolean, required: false },
|
|
23
|
+
underline: { type: Boolean, required: false },
|
|
24
|
+
rounded: { type: Boolean, required: false },
|
|
25
|
+
tag: { type: String, required: false },
|
|
26
|
+
tagColor: { type: null, required: false },
|
|
27
|
+
highlight: { type: Boolean, required: false },
|
|
28
|
+
orientation: { type: String, required: false, default: "horizontal" },
|
|
29
|
+
increment: { type: Object, required: false },
|
|
30
|
+
incrementIcon: { type: [Function, Object], required: false },
|
|
31
|
+
decrement: { type: Object, required: false },
|
|
32
|
+
decrementIcon: { type: [Function, Object], required: false },
|
|
33
|
+
autofocus: { type: Boolean, required: false },
|
|
34
|
+
autofocusDelay: { type: Number, required: false },
|
|
35
|
+
locale: { type: String, required: false },
|
|
36
|
+
class: { type: null, required: false },
|
|
37
|
+
b24ui: { type: null, required: false },
|
|
38
|
+
modelValue: { type: [Number, null], required: false },
|
|
39
|
+
defaultValue: { type: Number, required: false },
|
|
40
|
+
min: { type: Number, required: false },
|
|
41
|
+
max: { type: Number, required: false },
|
|
42
|
+
stepSnapping: { type: Boolean, required: false },
|
|
43
|
+
step: { type: Number, required: false },
|
|
44
|
+
disabled: { type: Boolean, required: false },
|
|
45
|
+
required: { type: Boolean, required: false },
|
|
46
|
+
id: { type: String, required: false },
|
|
47
|
+
name: { type: String, required: false },
|
|
48
|
+
formatOptions: { type: null, required: false },
|
|
49
|
+
disableWheelChange: { type: Boolean, required: false }
|
|
50
|
+
});
|
|
51
|
+
const emits = defineEmits(["update:modelValue", "blur", "change"]);
|
|
52
|
+
defineSlots();
|
|
53
|
+
const appConfig = useAppConfig();
|
|
54
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, "as", "modelValue", "defaultValue", "min", "max", "step", "stepSnapping", "formatOptions", "disableWheelChange"), emits);
|
|
55
|
+
const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, id, color, size, name, highlight, disabled, ariaAttrs } = useFormField(props);
|
|
56
|
+
const { t, code: codeLocale } = useLocale();
|
|
57
|
+
const locale = computed(() => props.locale || codeLocale.value);
|
|
147
58
|
const isTag = computed(() => {
|
|
148
|
-
return props.tag
|
|
149
|
-
})
|
|
150
|
-
|
|
151
|
-
const b24ui = computed(() => inputNumber({
|
|
59
|
+
return props.tag;
|
|
60
|
+
});
|
|
61
|
+
const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.inputNumber || {} })({
|
|
152
62
|
color: color.value,
|
|
153
63
|
size: size.value,
|
|
154
64
|
tagColor: props.tagColor,
|
|
@@ -158,42 +68,33 @@ const b24ui = computed(() => inputNumber({
|
|
|
158
68
|
noBorder: Boolean(props.noBorder),
|
|
159
69
|
underline: Boolean(props.underline),
|
|
160
70
|
orientation: props.orientation
|
|
161
|
-
}))
|
|
162
|
-
|
|
163
|
-
const
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
const event = new Event('change', { target: { value } })
|
|
171
|
-
emits('change', event)
|
|
172
|
-
|
|
173
|
-
emitFormChange()
|
|
174
|
-
emitFormInput()
|
|
71
|
+
}));
|
|
72
|
+
const incrementIcon = computed(() => props.incrementIcon || (props.orientation === "horizontal" ? icons.plus : icons.chevronUp));
|
|
73
|
+
const decrementIcon = computed(() => props.decrementIcon || (props.orientation === "horizontal" ? icons.minus : icons.chevronDown));
|
|
74
|
+
const inputRef = ref(null);
|
|
75
|
+
function onUpdate(value) {
|
|
76
|
+
const event = new Event("change", { target: { value } });
|
|
77
|
+
emits("change", event);
|
|
78
|
+
emitFormChange();
|
|
79
|
+
emitFormInput();
|
|
175
80
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
emits('blur', event)
|
|
81
|
+
function onBlur(event) {
|
|
82
|
+
emitFormBlur();
|
|
83
|
+
emits("blur", event);
|
|
180
84
|
}
|
|
181
|
-
|
|
182
85
|
function autoFocus() {
|
|
183
86
|
if (props.autofocus) {
|
|
184
|
-
inputRef.value?.$el?.focus()
|
|
87
|
+
inputRef.value?.$el?.focus();
|
|
185
88
|
}
|
|
186
89
|
}
|
|
187
|
-
|
|
188
90
|
onMounted(() => {
|
|
189
91
|
setTimeout(() => {
|
|
190
|
-
autoFocus()
|
|
191
|
-
}, props.autofocusDelay)
|
|
192
|
-
})
|
|
193
|
-
|
|
92
|
+
autoFocus();
|
|
93
|
+
}, props.autofocusDelay);
|
|
94
|
+
});
|
|
194
95
|
defineExpose({
|
|
195
96
|
inputRef
|
|
196
|
-
})
|
|
97
|
+
});
|
|
197
98
|
</script>
|
|
198
99
|
|
|
199
100
|
<template>
|
|
@@ -229,7 +130,7 @@ defineExpose({
|
|
|
229
130
|
color="link"
|
|
230
131
|
depth="light"
|
|
231
132
|
:aria-label="t('inputNumber.increment')"
|
|
232
|
-
v-bind="typeof increment === 'object' ? increment :
|
|
133
|
+
v-bind="typeof increment === 'object' ? increment : void 0"
|
|
233
134
|
/>
|
|
234
135
|
</slot>
|
|
235
136
|
</NumberFieldIncrement>
|
|
@@ -244,7 +145,7 @@ defineExpose({
|
|
|
244
145
|
color="link"
|
|
245
146
|
depth="light"
|
|
246
147
|
:aria-label="t('inputNumber.decrement')"
|
|
247
|
-
v-bind="typeof decrement === 'object' ? decrement :
|
|
148
|
+
v-bind="typeof decrement === 'object' ? decrement : void 0"
|
|
248
149
|
/>
|
|
249
150
|
</slot>
|
|
250
151
|
</NumberFieldDecrement>
|