@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.
Files changed (252) hide show
  1. package/.nuxt/b24ui/advice.ts +10 -2
  2. package/.nuxt/b24ui/alert.ts +10 -2
  3. package/.nuxt/b24ui/avatar-group.ts +10 -2
  4. package/.nuxt/b24ui/avatar.ts +10 -2
  5. package/.nuxt/b24ui/badge.ts +10 -2
  6. package/.nuxt/b24ui/button-group.ts +10 -2
  7. package/.nuxt/b24ui/button.ts +16 -6
  8. package/.nuxt/b24ui/calendar.ts +10 -2
  9. package/.nuxt/b24ui/checkbox.ts +10 -2
  10. package/.nuxt/b24ui/chip.ts +10 -2
  11. package/.nuxt/b24ui/collapsible.ts +10 -2
  12. package/.nuxt/b24ui/container.ts +10 -2
  13. package/.nuxt/b24ui/countdown.ts +10 -2
  14. package/.nuxt/b24ui/description-list.ts +10 -2
  15. package/.nuxt/b24ui/dropdown-menu.ts +10 -2
  16. package/.nuxt/b24ui/form-field.ts +10 -2
  17. package/.nuxt/b24ui/form.ts +10 -2
  18. package/.nuxt/b24ui/input-menu.ts +12 -4
  19. package/.nuxt/b24ui/input-number.ts +10 -2
  20. package/.nuxt/b24ui/input.ts +10 -2
  21. package/.nuxt/b24ui/kbd.ts +10 -2
  22. package/.nuxt/b24ui/link.ts +10 -2
  23. package/.nuxt/b24ui/modal.ts +10 -2
  24. package/.nuxt/b24ui/navbar-divider.ts +10 -2
  25. package/.nuxt/b24ui/navbar-section.ts +10 -2
  26. package/.nuxt/b24ui/navbar-spacer.ts +10 -2
  27. package/.nuxt/b24ui/navbar.ts +10 -2
  28. package/.nuxt/b24ui/navigation-menu.ts +10 -2
  29. package/.nuxt/b24ui/popover.ts +10 -2
  30. package/.nuxt/b24ui/progress.ts +10 -2
  31. package/.nuxt/b24ui/radio-group.ts +10 -2
  32. package/.nuxt/b24ui/range.ts +10 -2
  33. package/.nuxt/b24ui/select-menu.ts +14 -6
  34. package/.nuxt/b24ui/select.ts +12 -4
  35. package/.nuxt/b24ui/separator.ts +10 -2
  36. package/.nuxt/b24ui/sidebar-body.ts +10 -2
  37. package/.nuxt/b24ui/sidebar-footer.ts +10 -2
  38. package/.nuxt/b24ui/sidebar-header.ts +10 -2
  39. package/.nuxt/b24ui/sidebar-heading.ts +10 -2
  40. package/.nuxt/b24ui/sidebar-layout.ts +10 -2
  41. package/.nuxt/b24ui/sidebar-section.ts +10 -2
  42. package/.nuxt/b24ui/sidebar-spacer.ts +10 -2
  43. package/.nuxt/b24ui/sidebar.ts +10 -2
  44. package/.nuxt/b24ui/skeleton.ts +10 -2
  45. package/.nuxt/b24ui/slideover.ts +10 -2
  46. package/.nuxt/b24ui/stacked-layout.ts +10 -2
  47. package/.nuxt/b24ui/switch.ts +10 -2
  48. package/.nuxt/b24ui/tabs.ts +10 -2
  49. package/.nuxt/b24ui/textarea.ts +10 -2
  50. package/.nuxt/b24ui/toast.ts +10 -2
  51. package/.nuxt/b24ui/toaster.ts +10 -2
  52. package/.nuxt/b24ui/tooltip.ts +10 -2
  53. package/cli/templates.mjs +19 -15
  54. package/dist/meta.d.mts +5675 -7513
  55. package/dist/meta.mjs +5675 -7513
  56. package/dist/module.json +3 -3
  57. package/dist/module.mjs +2 -2
  58. package/dist/runtime/components/Advice.vue +27 -55
  59. package/dist/runtime/components/Advice.vue.d.ts +56 -0
  60. package/dist/runtime/components/Alert.vue +35 -97
  61. package/dist/runtime/components/Alert.vue.d.ts +97 -0
  62. package/dist/runtime/components/App.vue +24 -34
  63. package/dist/runtime/components/App.vue.d.ts +23 -0
  64. package/dist/runtime/components/Avatar.vue +43 -82
  65. package/dist/runtime/components/Avatar.vue.d.ts +62 -0
  66. package/dist/runtime/components/AvatarGroup.vue +40 -77
  67. package/dist/runtime/components/AvatarGroup.vue.d.ts +40 -0
  68. package/dist/runtime/components/Badge.vue +40 -84
  69. package/dist/runtime/components/Badge.vue.d.ts +78 -0
  70. package/dist/runtime/components/Button.vue +107 -164
  71. package/dist/runtime/components/Button.vue.d.ts +115 -0
  72. package/dist/runtime/components/ButtonGroup.vue +25 -52
  73. package/dist/runtime/components/ButtonGroup.vue.d.ts +63 -0
  74. package/dist/runtime/components/Calendar.vue +73 -153
  75. package/dist/runtime/components/Calendar.vue.d.ts +107 -0
  76. package/dist/runtime/components/Checkbox.vue +42 -74
  77. package/dist/runtime/components/Checkbox.vue.d.ts +55 -0
  78. package/dist/runtime/components/Chip.vue +26 -75
  79. package/dist/runtime/components/Chip.vue.d.ts +77 -0
  80. package/dist/runtime/components/Collapsible.vue +22 -41
  81. package/dist/runtime/components/Collapsible.vue.d.ts +50 -0
  82. package/dist/runtime/components/Container.vue +15 -28
  83. package/dist/runtime/components/Container.vue.d.ts +27 -0
  84. package/dist/runtime/components/Countdown.vue +153 -379
  85. package/dist/runtime/components/Countdown.vue.d.ts +122 -0
  86. package/dist/runtime/components/DescriptionList.vue +78 -150
  87. package/dist/runtime/components/DescriptionList.vue.d.ts +109 -0
  88. package/dist/runtime/components/DropdownMenu.vue +38 -140
  89. package/dist/runtime/components/DropdownMenu.vue.d.ts +133 -0
  90. package/dist/runtime/components/DropdownMenuContent.vue +65 -79
  91. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +51 -0
  92. package/dist/runtime/components/Form.vue +132 -218
  93. package/dist/runtime/components/Form.vue.d.ts +55 -0
  94. package/dist/runtime/components/FormField.vue +36 -81
  95. package/dist/runtime/components/FormField.vue.d.ts +73 -0
  96. package/dist/runtime/components/Input.vue +79 -180
  97. package/dist/runtime/components/Input.vue.d.ts +135 -0
  98. package/dist/runtime/components/InputMenu.vue +185 -382
  99. package/dist/runtime/components/InputMenu.vue.d.ts +357 -0
  100. package/dist/runtime/components/InputNumber.vue +77 -176
  101. package/dist/runtime/components/InputNumber.vue.d.ts +238 -0
  102. package/dist/runtime/components/Kbd.vue +20 -46
  103. package/dist/runtime/components/Kbd.vue.d.ts +55 -0
  104. package/dist/runtime/components/Link.vue +99 -179
  105. package/dist/runtime/components/Link.vue.d.ts +129 -0
  106. package/dist/runtime/components/LinkBase.vue +33 -42
  107. package/dist/runtime/components/LinkBase.vue.d.ts +48 -0
  108. package/dist/runtime/components/Modal.vue +48 -128
  109. package/dist/runtime/components/Modal.vue.d.ts +124 -0
  110. package/dist/runtime/components/ModalDialogClose.vue +5 -8
  111. package/dist/runtime/components/ModalDialogClose.vue.d.ts +10 -0
  112. package/dist/runtime/components/Navbar.vue +15 -33
  113. package/dist/runtime/components/Navbar.vue.d.ts +46 -0
  114. package/dist/runtime/components/NavbarDivider.vue +15 -33
  115. package/dist/runtime/components/NavbarDivider.vue.d.ts +46 -0
  116. package/dist/runtime/components/NavbarSection.vue +15 -33
  117. package/dist/runtime/components/NavbarSection.vue.d.ts +46 -0
  118. package/dist/runtime/components/NavbarSpacer.vue +15 -33
  119. package/dist/runtime/components/NavbarSpacer.vue.d.ts +46 -0
  120. package/dist/runtime/components/NavigationMenu.vue +74 -209
  121. package/dist/runtime/components/NavigationMenu.vue.d.ts +159 -0
  122. package/dist/runtime/components/OverlayProvider.vue +14 -18
  123. package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -0
  124. package/dist/runtime/components/Popover.vue +40 -82
  125. package/dist/runtime/components/Popover.vue.d.ts +79 -0
  126. package/dist/runtime/components/Progress.vue +70 -137
  127. package/dist/runtime/components/Progress.vue.d.ts +103 -0
  128. package/dist/runtime/components/RadioGroup.vue +59 -135
  129. package/dist/runtime/components/RadioGroup.vue.d.ts +88 -0
  130. package/dist/runtime/components/Range.vue +46 -86
  131. package/dist/runtime/components/Range.vue.d.ts +73 -0
  132. package/dist/runtime/components/Select.vue +110 -261
  133. package/dist/runtime/components/Select.vue.d.ts +170 -0
  134. package/dist/runtime/components/SelectMenu.vue +161 -348
  135. package/dist/runtime/components/SelectMenu.vue.d.ts +217 -0
  136. package/dist/runtime/components/Separator.vue +28 -72
  137. package/dist/runtime/components/Separator.vue.d.ts +77 -0
  138. package/dist/runtime/components/Sidebar.vue +15 -33
  139. package/dist/runtime/components/Sidebar.vue.d.ts +46 -0
  140. package/dist/runtime/components/SidebarBody.vue +17 -39
  141. package/dist/runtime/components/SidebarBody.vue.d.ts +53 -0
  142. package/dist/runtime/components/SidebarFooter.vue +15 -33
  143. package/dist/runtime/components/SidebarFooter.vue.d.ts +46 -0
  144. package/dist/runtime/components/SidebarHeader.vue +15 -33
  145. package/dist/runtime/components/SidebarHeader.vue.d.ts +46 -0
  146. package/dist/runtime/components/SidebarHeading.vue +15 -33
  147. package/dist/runtime/components/SidebarHeading.vue.d.ts +46 -0
  148. package/dist/runtime/components/SidebarLayout.vue +34 -71
  149. package/dist/runtime/components/SidebarLayout.vue.d.ts +65 -0
  150. package/dist/runtime/components/SidebarSection.vue +15 -33
  151. package/dist/runtime/components/SidebarSection.vue.d.ts +46 -0
  152. package/dist/runtime/components/SidebarSpacer.vue +15 -33
  153. package/dist/runtime/components/SidebarSpacer.vue.d.ts +46 -0
  154. package/dist/runtime/components/Skeleton.vue +14 -23
  155. package/dist/runtime/components/Skeleton.vue.d.ts +26 -0
  156. package/dist/runtime/components/Slideover.vue +50 -132
  157. package/dist/runtime/components/Slideover.vue.d.ts +127 -0
  158. package/dist/runtime/components/StackedLayout.vue +34 -74
  159. package/dist/runtime/components/StackedLayout.vue.d.ts +65 -0
  160. package/dist/runtime/components/Switch.vue +46 -96
  161. package/dist/runtime/components/Switch.vue.d.ts +77 -0
  162. package/dist/runtime/components/Tabs.vue +41 -106
  163. package/dist/runtime/components/Tabs.vue.d.ts +104 -0
  164. package/dist/runtime/components/Textarea.vue +92 -202
  165. package/dist/runtime/components/Textarea.vue.d.ts +141 -0
  166. package/dist/runtime/components/Toast.vue +47 -106
  167. package/dist/runtime/components/Toast.vue.d.ts +95 -0
  168. package/dist/runtime/components/Toaster.vue +70 -116
  169. package/dist/runtime/components/Toaster.vue.d.ts +70 -0
  170. package/dist/runtime/components/Tooltip.vue +36 -65
  171. package/dist/runtime/components/Tooltip.vue.d.ts +65 -0
  172. package/dist/runtime/components/content/TableWrapper.vue +24 -71
  173. package/dist/runtime/components/content/TableWrapper.vue.d.ts +83 -0
  174. package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
  175. package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
  176. package/dist/runtime/composables/useComponentIcons.d.ts +3 -3
  177. package/dist/runtime/composables/useFormField.d.ts +2 -2
  178. package/dist/runtime/composables/useOverlay.d.ts +14 -7
  179. package/dist/runtime/composables/useOverlay.js +14 -6
  180. package/dist/runtime/prose/A.vue +16 -26
  181. package/dist/runtime/prose/A.vue.d.ts +27 -0
  182. package/dist/runtime/prose/Blockquote.vue +14 -26
  183. package/dist/runtime/prose/Blockquote.vue.d.ts +27 -0
  184. package/dist/runtime/prose/Code.vue +15 -32
  185. package/dist/runtime/prose/Code.vue.d.ts +31 -0
  186. package/dist/runtime/prose/Em.vue +16 -26
  187. package/dist/runtime/prose/Em.vue.d.ts +27 -0
  188. package/dist/runtime/prose/H1.vue +14 -26
  189. package/dist/runtime/prose/H1.vue.d.ts +27 -0
  190. package/dist/runtime/prose/H2.vue +14 -26
  191. package/dist/runtime/prose/H2.vue.d.ts +27 -0
  192. package/dist/runtime/prose/H3.vue +14 -26
  193. package/dist/runtime/prose/H3.vue.d.ts +27 -0
  194. package/dist/runtime/prose/H4.vue +14 -26
  195. package/dist/runtime/prose/H4.vue.d.ts +27 -0
  196. package/dist/runtime/prose/H5.vue +14 -26
  197. package/dist/runtime/prose/H5.vue.d.ts +27 -0
  198. package/dist/runtime/prose/H6.vue +14 -26
  199. package/dist/runtime/prose/H6.vue.d.ts +27 -0
  200. package/dist/runtime/prose/Hr.vue +13 -22
  201. package/dist/runtime/prose/Hr.vue.d.ts +19 -0
  202. package/dist/runtime/prose/Img.vue +13 -26
  203. package/dist/runtime/prose/Img.vue.d.ts +19 -0
  204. package/dist/runtime/prose/Li.vue +14 -26
  205. package/dist/runtime/prose/Li.vue.d.ts +27 -0
  206. package/dist/runtime/prose/Ol.vue +14 -26
  207. package/dist/runtime/prose/Ol.vue.d.ts +27 -0
  208. package/dist/runtime/prose/P.vue +14 -26
  209. package/dist/runtime/prose/P.vue.d.ts +27 -0
  210. package/dist/runtime/prose/Pre.vue +17 -33
  211. package/dist/runtime/prose/Pre.vue.d.ts +47 -0
  212. package/dist/runtime/prose/Strong.vue +14 -26
  213. package/dist/runtime/prose/Strong.vue.d.ts +27 -0
  214. package/dist/runtime/prose/Table.vue +21 -57
  215. package/dist/runtime/prose/Table.vue.d.ts +74 -0
  216. package/dist/runtime/prose/Tbody.vue +14 -26
  217. package/dist/runtime/prose/Tbody.vue.d.ts +27 -0
  218. package/dist/runtime/prose/Td.vue +14 -26
  219. package/dist/runtime/prose/Td.vue.d.ts +27 -0
  220. package/dist/runtime/prose/Th.vue +14 -26
  221. package/dist/runtime/prose/Th.vue.d.ts +27 -0
  222. package/dist/runtime/prose/Thead.vue +14 -26
  223. package/dist/runtime/prose/Thead.vue.d.ts +27 -0
  224. package/dist/runtime/prose/Tr.vue +14 -26
  225. package/dist/runtime/prose/Tr.vue.d.ts +27 -0
  226. package/dist/runtime/prose/Ul.vue +14 -26
  227. package/dist/runtime/prose/Ul.vue.d.ts +27 -0
  228. package/dist/runtime/types/form.d.ts +1 -0
  229. package/dist/runtime/types/utils.d.ts +42 -3
  230. package/dist/runtime/utils/link.d.ts +3 -3
  231. package/dist/runtime/utils/tv.js +2 -2
  232. package/dist/runtime/vue/components/Link.vue +122 -208
  233. package/dist/runtime/vue/components/Link.vue.d.ts +129 -0
  234. package/dist/shared/{b24ui-nuxt.CS9Lf0os.mjs → b24ui-nuxt.wBs9vEU5.mjs} +33 -8
  235. package/dist/types.d.mts +3 -5
  236. package/dist/unplugin.mjs +1 -1
  237. package/dist/vite.mjs +1 -1
  238. package/package.json +19 -27
  239. package/dist/meta.cjs +0 -72112
  240. package/dist/meta.d.cts +0 -72110
  241. package/dist/meta.d.ts +0 -72110
  242. package/dist/module.cjs +0 -63
  243. package/dist/module.d.cts +0 -15
  244. package/dist/module.d.ts +0 -15
  245. package/dist/shared/b24ui-nuxt.DrKwIWoc.cjs +0 -7721
  246. package/dist/types.d.ts +0 -7
  247. package/dist/unplugin.cjs +0 -236
  248. package/dist/unplugin.d.cts +0 -33
  249. package/dist/unplugin.d.ts +0 -33
  250. package/dist/vite.cjs +0 -21
  251. package/dist/vite.d.cts +0 -14
  252. 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 lang="ts">
2
- import type { VariantProps } from 'tailwind-variants'
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 lang="ts">
122
- import { onMounted, ref, computed } from 'vue'
123
- import { NumberFieldRoot, NumberFieldInput, NumberFieldDecrement, NumberFieldIncrement, useForwardPropsEmits } from 'reka-ui'
124
- import { reactivePick } from '@vueuse/core'
125
- import { useFormField } from '../composables/useFormField'
126
- import { useLocale } from '../composables/useLocale'
127
- import icons from '../dictionary/icons'
128
- import B24Button from './Button.vue'
129
-
130
- defineOptions({ inheritAttrs: false })
131
-
132
- const props = withDefaults(defineProps<InputNumberProps>(), {
133
- orientation: 'horizontal',
134
- color: 'primary',
135
- size: 'md'
136
- })
137
- const emits = defineEmits<InputNumberEmits>()
138
- defineSlots<InputNumberSlots>()
139
-
140
- const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'min', 'max', 'step', 'stepSnapping', 'formatOptions', 'disableWheelChange'), emits)
141
-
142
- const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, id, color, size, name, highlight, disabled, ariaAttrs } = useFormField<InputNumberProps>(props)
143
-
144
- const { t, code: codeLocale } = useLocale()
145
- const locale = computed(() => props.locale || codeLocale.value)
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 incrementIcon = computed(() => props.incrementIcon || (props.orientation === 'horizontal' ? icons.plus : icons.chevronUp))
164
- const decrementIcon = computed(() => props.decrementIcon || (props.orientation === 'horizontal' ? icons.minus : icons.chevronDown))
165
-
166
- const inputRef = ref<InstanceType<typeof NumberFieldInput> | null>(null)
167
-
168
- function onUpdate(value: number) {
169
- // @ts-expect-error - 'target' does not exist in type 'EventInit'
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
- function onBlur(event: FocusEvent) {
178
- emitFormBlur()
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 : undefined"
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 : undefined"
148
+ v-bind="typeof decrement === 'object' ? decrement : void 0"
248
149
  />
249
150
  </slot>
250
151
  </NumberFieldDecrement>