@bitrix24/b24ui-nuxt 2.0.8 → 2.1.0

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 (165) hide show
  1. package/dist/meta.d.mts +84957 -50082
  2. package/dist/meta.mjs +84957 -50082
  3. package/dist/module.d.mts +13 -1
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +8 -7
  6. package/dist/runtime/air-design-tokens/001_b24_global.css +1 -1
  7. package/dist/runtime/air-design-tokens/003_b24_context_light.css +1 -1
  8. package/dist/runtime/air-design-tokens/004_b24_context_dark.css +1 -1
  9. package/dist/runtime/air-design-tokens/005_b24_context_edge-light.css +1 -1
  10. package/dist/runtime/air-design-tokens/006_b24_context_edge-dark.css +1 -1
  11. package/dist/runtime/air-design-tokens/007_b24_global.css +1 -1
  12. package/dist/runtime/air-design-tokens/008_ui_global.css +1 -1
  13. package/dist/runtime/air-design-tokens/009_b24_tools.css +1 -1
  14. package/dist/runtime/air-design-tokens/components/badge-counter.css +1 -1
  15. package/dist/runtime/air-design-tokens/components/button.css +1 -1
  16. package/dist/runtime/air-design-tokens/components/navigation-menu.css +1 -1
  17. package/dist/runtime/air-design-tokens/components/popup.css +1 -1
  18. package/dist/runtime/air-design-tokens/components/scrollbar.css +1 -2
  19. package/dist/runtime/air-design-tokens/index.css +1 -1
  20. package/dist/runtime/components/Advice.d.vue.ts +1 -1
  21. package/dist/runtime/components/Advice.vue +1 -3
  22. package/dist/runtime/components/Advice.vue.d.ts +1 -1
  23. package/dist/runtime/components/App.d.vue.ts +1 -1
  24. package/dist/runtime/components/App.vue +2 -1
  25. package/dist/runtime/components/App.vue.d.ts +1 -1
  26. package/dist/runtime/components/Avatar.d.vue.ts +2 -1
  27. package/dist/runtime/components/Avatar.vue.d.ts +2 -1
  28. package/dist/runtime/components/Button.vue +1 -0
  29. package/dist/runtime/components/ChatPrompt.d.vue.ts +2 -2
  30. package/dist/runtime/components/ChatPrompt.vue +5 -5
  31. package/dist/runtime/components/ChatPrompt.vue.d.ts +2 -2
  32. package/dist/runtime/components/ChatPromptSubmit.d.vue.ts +5 -5
  33. package/dist/runtime/components/ChatPromptSubmit.vue +53 -4
  34. package/dist/runtime/components/ChatPromptSubmit.vue.d.ts +5 -5
  35. package/dist/runtime/components/Checkbox.d.vue.ts +2 -1
  36. package/dist/runtime/components/Checkbox.vue.d.ts +2 -1
  37. package/dist/runtime/components/CommandPalette.vue +5 -4
  38. package/dist/runtime/components/DashboardSearch.d.vue.ts +3 -6
  39. package/dist/runtime/components/DashboardSearch.vue +2 -3
  40. package/dist/runtime/components/DashboardSearch.vue.d.ts +3 -6
  41. package/dist/runtime/components/DashboardSearchButton.d.vue.ts +2 -3
  42. package/dist/runtime/components/DashboardSearchButton.vue +44 -6
  43. package/dist/runtime/components/DashboardSearchButton.vue.d.ts +2 -3
  44. package/dist/runtime/components/Error.d.vue.ts +1 -1
  45. package/dist/runtime/components/Error.vue.d.ts +1 -1
  46. package/dist/runtime/components/FileUpload.d.vue.ts +3 -2
  47. package/dist/runtime/components/FileUpload.vue +9 -9
  48. package/dist/runtime/components/FileUpload.vue.d.ts +3 -2
  49. package/dist/runtime/components/Form.d.vue.ts +3 -2
  50. package/dist/runtime/components/Form.vue +3 -4
  51. package/dist/runtime/components/Form.vue.d.ts +3 -2
  52. package/dist/runtime/components/Input.d.vue.ts +7 -7
  53. package/dist/runtime/components/Input.vue +2 -2
  54. package/dist/runtime/components/Input.vue.d.ts +7 -7
  55. package/dist/runtime/components/InputDate.d.vue.ts +115 -0
  56. package/dist/runtime/components/InputDate.vue +198 -0
  57. package/dist/runtime/components/InputDate.vue.d.ts +115 -0
  58. package/dist/runtime/components/InputMenu.d.vue.ts +7 -128
  59. package/dist/runtime/components/InputMenu.vue +3 -3
  60. package/dist/runtime/components/InputMenu.vue.d.ts +7 -128
  61. package/dist/runtime/components/InputNumber.d.vue.ts +25 -124
  62. package/dist/runtime/components/InputNumber.vue +3 -3
  63. package/dist/runtime/components/InputNumber.vue.d.ts +25 -124
  64. package/dist/runtime/components/InputTags.d.vue.ts +6 -109
  65. package/dist/runtime/components/InputTags.vue +8 -8
  66. package/dist/runtime/components/InputTags.vue.d.ts +6 -109
  67. package/dist/runtime/components/InputTime.d.vue.ts +99 -0
  68. package/dist/runtime/components/InputTime.vue +170 -0
  69. package/dist/runtime/components/InputTime.vue.d.ts +99 -0
  70. package/dist/runtime/components/Link.d.vue.ts +4 -49
  71. package/dist/runtime/components/Link.vue +1 -0
  72. package/dist/runtime/components/Link.vue.d.ts +4 -49
  73. package/dist/runtime/components/Modal.d.vue.ts +6 -1
  74. package/dist/runtime/components/Modal.vue +37 -9
  75. package/dist/runtime/components/Modal.vue.d.ts +6 -1
  76. package/dist/runtime/components/Pagination.d.vue.ts +2 -2
  77. package/dist/runtime/components/Pagination.vue.d.ts +2 -2
  78. package/dist/runtime/components/PinInput.d.vue.ts +3 -3
  79. package/dist/runtime/components/PinInput.vue.d.ts +3 -3
  80. package/dist/runtime/components/Progress.d.vue.ts +1 -1
  81. package/dist/runtime/components/Progress.vue.d.ts +1 -1
  82. package/dist/runtime/components/Select.d.vue.ts +6 -107
  83. package/dist/runtime/components/Select.vue +3 -3
  84. package/dist/runtime/components/Select.vue.d.ts +6 -107
  85. package/dist/runtime/components/SelectMenu.d.vue.ts +7 -106
  86. package/dist/runtime/components/SelectMenu.vue +3 -3
  87. package/dist/runtime/components/SelectMenu.vue.d.ts +7 -106
  88. package/dist/runtime/components/Slideover.d.vue.ts +1 -1
  89. package/dist/runtime/components/Slideover.vue.d.ts +1 -1
  90. package/dist/runtime/components/Switch.d.vue.ts +2 -1
  91. package/dist/runtime/components/Switch.vue.d.ts +2 -1
  92. package/dist/runtime/components/Table.d.vue.ts +5 -4
  93. package/dist/runtime/components/Table.vue +4 -3
  94. package/dist/runtime/components/Table.vue.d.ts +5 -4
  95. package/dist/runtime/components/Textarea.d.vue.ts +7 -6
  96. package/dist/runtime/components/Textarea.vue +2 -2
  97. package/dist/runtime/components/Textarea.vue.d.ts +7 -6
  98. package/dist/runtime/components/Toast.vue +5 -5
  99. package/dist/runtime/components/Toaster.d.vue.ts +1 -1
  100. package/dist/runtime/components/Toaster.vue.d.ts +1 -1
  101. package/dist/runtime/components/color-mode/ColorModeAvatar.d.vue.ts +3 -3
  102. package/dist/runtime/components/color-mode/ColorModeAvatar.vue +16 -4
  103. package/dist/runtime/components/color-mode/ColorModeAvatar.vue.d.ts +3 -3
  104. package/dist/runtime/components/color-mode/ColorModeButton.d.vue.ts +3 -3
  105. package/dist/runtime/components/color-mode/ColorModeButton.vue +54 -6
  106. package/dist/runtime/components/color-mode/ColorModeButton.vue.d.ts +3 -3
  107. package/dist/runtime/components/color-mode/ColorModeImage.d.vue.ts +4 -3
  108. package/dist/runtime/components/color-mode/ColorModeImage.vue +4 -0
  109. package/dist/runtime/components/color-mode/ColorModeImage.vue.d.ts +4 -3
  110. package/dist/runtime/components/color-mode/ColorModeSelect.d.vue.ts +5 -3
  111. package/dist/runtime/components/color-mode/ColorModeSelect.vue +47 -5
  112. package/dist/runtime/components/color-mode/ColorModeSelect.vue.d.ts +5 -3
  113. package/dist/runtime/components/color-mode/ColorModeSwitch.d.vue.ts +2 -2
  114. package/dist/runtime/components/color-mode/ColorModeSwitch.vue +29 -5
  115. package/dist/runtime/components/color-mode/ColorModeSwitch.vue.d.ts +2 -2
  116. package/dist/runtime/components/content/ContentSearch.d.vue.ts +3 -6
  117. package/dist/runtime/components/content/ContentSearch.vue +2 -3
  118. package/dist/runtime/components/content/ContentSearch.vue.d.ts +3 -6
  119. package/dist/runtime/components/content/ContentSearchButton.d.vue.ts +2 -3
  120. package/dist/runtime/components/content/ContentSearchButton.vue +43 -5
  121. package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +2 -3
  122. package/dist/runtime/components/content/ContentSurround.vue +7 -1
  123. package/dist/runtime/components/locale/LocaleSelect.d.vue.ts +11 -7
  124. package/dist/runtime/components/locale/LocaleSelect.vue +50 -6
  125. package/dist/runtime/components/locale/LocaleSelect.vue.d.ts +11 -7
  126. package/dist/runtime/components/prose/Callout.vue +4 -0
  127. package/dist/runtime/composables/index.d.ts +8 -0
  128. package/dist/runtime/composables/index.js +8 -0
  129. package/dist/runtime/composables/useFileUpload.d.ts +2 -1
  130. package/dist/runtime/composables/useFileUpload.js +13 -4
  131. package/dist/runtime/index.css +1 -1
  132. package/dist/runtime/inertia/components/Link.d.vue.ts +17 -10
  133. package/dist/runtime/inertia/components/Link.vue +8 -6
  134. package/dist/runtime/inertia/components/Link.vue.d.ts +17 -10
  135. package/dist/runtime/inertia/stubs.d.ts +1 -1
  136. package/dist/runtime/plugins/colors.js +4 -8
  137. package/dist/runtime/types/html.d.ts +8 -0
  138. package/dist/runtime/types/index.d.ts +2 -0
  139. package/dist/runtime/types/index.js +2 -0
  140. package/dist/runtime/types/input.d.ts +5 -5
  141. package/dist/runtime/types/utils.d.ts +2 -0
  142. package/dist/runtime/utils/content.d.ts +2 -2
  143. package/dist/runtime/utils/dashboard.d.ts +1 -1
  144. package/dist/runtime/utils/link.d.ts +1 -0
  145. package/dist/runtime/utils/link.js +40 -24
  146. package/dist/runtime/vue/components/Link.d.vue.ts +8 -37
  147. package/dist/runtime/vue/components/Link.vue +6 -11
  148. package/dist/runtime/vue/components/Link.vue.d.ts +8 -37
  149. package/dist/runtime/vue/components/color-mode/ColorModeButton.d.vue.ts +2 -2
  150. package/dist/runtime/vue/components/color-mode/ColorModeButton.vue +55 -5
  151. package/dist/runtime/vue/components/color-mode/ColorModeButton.vue.d.ts +2 -2
  152. package/dist/runtime/vue/components/color-mode/ColorModeSelect.d.vue.ts +5 -3
  153. package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue +46 -3
  154. package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue.d.ts +5 -3
  155. package/dist/runtime/vue/components/color-mode/ColorModeSwitch.d.vue.ts +1 -1
  156. package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue +24 -3
  157. package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue.d.ts +1 -1
  158. package/dist/runtime/vue/stubs.d.ts +2 -2
  159. package/dist/runtime/vue/stubs.js +1 -1
  160. package/dist/shared/{b24ui-nuxt.CEMVb5Ee.mjs → b24ui-nuxt.CXLCGBie.mjs} +353 -128
  161. package/dist/unplugin.d.mts +3 -1
  162. package/dist/unplugin.mjs +4 -3
  163. package/dist/vite.mjs +3 -3
  164. package/package.json +27 -17
  165. /package/dist/runtime/{air-design-tokens/002_b24_context_utility.css → types/html.js} +0 -0
@@ -0,0 +1,115 @@
1
+ import type { ComponentPublicInstance } from 'vue';
2
+ import type { DateFieldRootProps, DateFieldRootEmits, DateRangeFieldRootProps, DateRangeFieldRootEmits, DateValue } from 'reka-ui';
3
+ import type { AppConfig } from '@nuxt/schema';
4
+ import type { UseComponentIconsProps } from '../composables/useComponentIcons';
5
+ import type { BadgeProps, IconComponent } from '../types';
6
+ import type { ComponentConfig } from '../types/tv';
7
+ import theme from '#build/b24ui/input-date';
8
+ type InputDate = ComponentConfig<typeof theme, AppConfig, 'inputDate'>;
9
+ type _DateFieldRootProps = Omit<DateFieldRootProps, 'as' | 'asChild' | 'modelValue' | 'defaultValue' | 'dir' | 'locale'>;
10
+ type _RangeDateFieldRootProps = Omit<DateRangeFieldRootProps, 'as' | 'asChild' | 'modelValue' | 'defaultValue' | 'dir' | 'locale'>;
11
+ type InputDateDefaultValue<R extends boolean = false> = R extends true ? DateRangeFieldRootProps['defaultValue'] : DateFieldRootProps['defaultValue'];
12
+ type InputDateModelValue<R extends boolean = false> = (R extends true ? DateRangeFieldRootProps['modelValue'] : DateFieldRootProps['modelValue']) | undefined;
13
+ export interface InputDateProps<R extends boolean = false> extends UseComponentIconsProps, _DateFieldRootProps, _RangeDateFieldRootProps {
14
+ /**
15
+ * The element or component this component should render as.
16
+ * @defaultValue 'div'
17
+ */
18
+ as?: any;
19
+ /**
20
+ * @defaultValue 'air-primary'
21
+ */
22
+ color?: InputDate['variants']['color'];
23
+ /**
24
+ * @defaultValue 'md'
25
+ */
26
+ size?: InputDate['variants']['size'];
27
+ /**
28
+ * Removes padding from input
29
+ * @defaultValue false
30
+ */
31
+ noPadding?: boolean;
32
+ /**
33
+ * Removes all borders (rings)
34
+ * @defaultValue false
35
+ */
36
+ noBorder?: boolean;
37
+ /**
38
+ * Removes all borders (rings) except the bottom one
39
+ * @defaultValue false
40
+ */
41
+ underline?: boolean;
42
+ /**
43
+ * Rounds the corners of the input
44
+ * @defaultValue false
45
+ */
46
+ rounded?: boolean;
47
+ tag?: string;
48
+ /**
49
+ * @defaultValue 'air-primary'
50
+ */
51
+ tagColor?: BadgeProps['color'];
52
+ /** Highlight the ring color like a focus state. */
53
+ highlight?: boolean;
54
+ autofocus?: boolean;
55
+ autofocusDelay?: number;
56
+ /**
57
+ * The icon to use as a range separator.
58
+ * @defaultValue icons.minus
59
+ * @IconComponent
60
+ */
61
+ separatorIcon?: IconComponent;
62
+ /** Whether or not a range of dates can be selected */
63
+ range?: R & boolean;
64
+ /**
65
+ * The locale to use for formatting and parsing numbers.
66
+ * @defaultValue B24App.locale.code
67
+ */
68
+ locale?: string;
69
+ defaultValue?: InputDateDefaultValue<R>;
70
+ modelValue?: InputDateModelValue<R>;
71
+ class?: any;
72
+ b24ui?: InputDate['slots'];
73
+ }
74
+ export interface InputDateEmits<R extends boolean> extends Omit<DateFieldRootEmits & DateRangeFieldRootEmits, 'update:modelValue'> {
75
+ 'update:modelValue': [date: InputDateModelValue<R>];
76
+ 'change': [event: Event];
77
+ 'blur': [event: FocusEvent];
78
+ 'focus': [event: FocusEvent];
79
+ }
80
+ export interface InputDateSlots {
81
+ leading(props: {
82
+ b24ui: InputDate['b24ui'];
83
+ }): any;
84
+ default(props: {
85
+ b24ui: InputDate['b24ui'];
86
+ }): any;
87
+ trailing(props: {
88
+ b24ui: InputDate['b24ui'];
89
+ }): any;
90
+ separator(props: {
91
+ b24ui: InputDate['b24ui'];
92
+ }): any;
93
+ }
94
+ declare const __VLS_export: <R extends boolean>(__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<{
95
+ props: __VLS_PrettifyLocal<InputDateProps<R> & {
96
+ onChange?: ((event: Event) => any) | undefined;
97
+ onBlur?: ((event: FocusEvent) => any) | undefined;
98
+ onFocus?: ((event: FocusEvent) => any) | undefined;
99
+ "onUpdate:modelValue"?: ((date: InputDateModelValue<R>) => any) | undefined;
100
+ "onUpdate:placeholder"?: ((...args: DateValue[]) => any) | undefined;
101
+ }> & import("vue").PublicProps;
102
+ expose: (exposed: import("vue").ShallowUnwrapRef<{
103
+ inputsRef: import("vue").Ref<ComponentPublicInstance[], ComponentPublicInstance[]>;
104
+ }>) => void;
105
+ attrs: any;
106
+ slots: InputDateSlots;
107
+ emit: ((evt: "change", event: Event) => void) & ((evt: "blur", event: FocusEvent) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "update:modelValue", date: InputDateModelValue<R>) => void) & ((evt: "update:placeholder", ...args: [date: DateValue] & [date: DateValue]) => void);
108
+ }>) => import("vue").VNode & {
109
+ __ctx?: Awaited<typeof __VLS_setup>;
110
+ };
111
+ declare const _default: typeof __VLS_export;
112
+ export default _default;
113
+ type __VLS_PrettifyLocal<T> = {
114
+ [K in keyof T as K]: T[K];
115
+ } & {};
@@ -1,10 +1,9 @@
1
- import { nextTick } from 'vue';
2
- import type { InputHTMLAttributes } from 'vue';
3
1
  import type { ComboboxRootProps, ComboboxRootEmits, ComboboxContentProps, ComboboxContentEmits, ComboboxArrowProps } from 'reka-ui';
4
2
  import type { AppConfig } from '@nuxt/schema';
5
3
  import theme from '#build/b24ui/input-menu';
6
4
  import type { UseComponentIconsProps } from '../composables/useComponentIcons';
7
5
  import type { AvatarProps, ChipProps, BadgeProps, IconComponent } from '../types';
6
+ import type { InputHTMLAttributes } from '../types/html';
8
7
  import type { AcceptableValue, ArrayOrNested, GetItemKeys, GetModelValue, GetModelValueEmits, NestedItem, EmitsToProps } from '../types/utils';
9
8
  import type { ComponentConfig } from '../types/tv';
10
9
  type InputMenu = ComponentConfig<typeof theme, AppConfig, 'inputMenu'>;
@@ -30,7 +29,7 @@ export type InputMenuItem = InputMenuValue | {
30
29
  b24ui?: Pick<InputMenu['slots'], 'tagsItem' | 'tagsItemText' | 'tagsItemDelete' | 'tagsItemDeleteIcon' | 'label' | 'separator' | 'item' | 'itemLeadingIcon' | 'itemLeadingAvatarSize' | 'itemLeadingAvatar' | 'itemLeadingChip' | 'itemLeadingChipSize' | 'itemWrapper' | 'itemLabel' | 'itemDescription' | 'itemTrailing' | 'itemTrailingIcon'>;
31
30
  [key: string]: any;
32
31
  };
33
- 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' | 'openOnClick' | 'openOnFocus'>, UseComponentIconsProps {
32
+ 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' | 'openOnClick' | 'openOnFocus'>, UseComponentIconsProps, /** @vue-ignore */ Omit<InputHTMLAttributes, 'disabled' | 'name' | 'type' | 'placeholder' | 'autofocus' | 'maxlength' | 'minlength' | 'pattern' | 'size' | 'min' | 'max' | 'step'> {
34
33
  /**
35
34
  * The element or component this component should render as.
36
35
  * @defaultValue 'div'
@@ -59,7 +58,7 @@ export interface InputMenuProps<T extends ArrayOrNested<InputMenuItem> = ArrayOr
59
58
  */
60
59
  underline?: boolean;
61
60
  /**
62
- * Rounds the corners of the button
61
+ * Rounds the corners of the input
63
62
  * @defaultValue false
64
63
  */
65
64
  rounded?: boolean;
@@ -226,11 +225,11 @@ declare const __VLS_export: <T extends ArrayOrNested<InputMenuItem>, VK extends
226
225
  props: __VLS_PrettifyLocal<(InputMenuProps<T, VK, M> & {
227
226
  searchTerm?: string;
228
227
  }) & {
229
- onBlur?: ((event: FocusEvent) => any) | undefined;
230
228
  onChange?: ((event: Event) => any) | undefined;
229
+ onBlur?: ((event: FocusEvent) => any) | undefined;
231
230
  onFocus?: ((event: FocusEvent) => any) | undefined;
232
- onCreate?: ((item: string) => any) | undefined;
233
231
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
232
+ onCreate?: ((item: string) => any) | undefined;
234
233
  "onUpdate:modelValue"?: ((value: GetModelValue<T, VK, M>) => any) | undefined;
235
234
  onHighlight?: ((payload: {
236
235
  ref: HTMLElement;
@@ -240,131 +239,11 @@ declare const __VLS_export: <T extends ArrayOrNested<InputMenuItem>, VK extends
240
239
  "onRemove-tag"?: ((item: GetModelValue<T, VK, M>) => any) | undefined;
241
240
  }> & import("vue").PublicProps;
242
241
  expose: (exposed: import("vue").ShallowUnwrapRef<{
243
- inputRef: import("vue").Ref<({
244
- $: import("vue").ComponentInternalInstance;
245
- $data: {};
246
- $props: {
247
- readonly displayValue?: ((val: any) => string) | undefined;
248
- readonly modelValue?: string | undefined;
249
- readonly autoFocus?: boolean | undefined;
250
- readonly disabled?: boolean | undefined;
251
- readonly asChild?: boolean | undefined;
252
- readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
253
- readonly "onUpdate:modelValue"?: ((args_0: string) => any) | undefined | undefined;
254
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
255
- $attrs: {
256
- [x: string]: unknown;
257
- };
258
- $refs: {
259
- [x: string]: unknown;
260
- };
261
- $slots: Readonly<{
262
- [name: string]: import("vue").Slot<any> | undefined;
263
- }>;
264
- $root: import("vue").ComponentPublicInstance | null;
265
- $parent: import("vue").ComponentPublicInstance | null;
266
- $host: Element | null;
267
- $emit: (event: "update:modelValue", args_0: string) => void;
268
- $el: any;
269
- $options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").ComboboxInputProps> & Readonly<{
270
- "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
271
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
272
- "update:modelValue": (args_0: string) => any;
273
- }, string, {
274
- as: import("reka-ui").AsTag | import("vue").Component;
275
- }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
276
- beforeCreate?: (() => void) | (() => void)[];
277
- created?: (() => void) | (() => void)[];
278
- beforeMount?: (() => void) | (() => void)[];
279
- mounted?: (() => void) | (() => void)[];
280
- beforeUpdate?: (() => void) | (() => void)[];
281
- updated?: (() => void) | (() => void)[];
282
- activated?: (() => void) | (() => void)[];
283
- deactivated?: (() => void) | (() => void)[];
284
- beforeDestroy?: (() => void) | (() => void)[];
285
- beforeUnmount?: (() => void) | (() => void)[];
286
- destroyed?: (() => void) | (() => void)[];
287
- unmounted?: (() => void) | (() => void)[];
288
- renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
289
- renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
290
- errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
291
- };
292
- $forceUpdate: () => void;
293
- $nextTick: typeof nextTick;
294
- $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;
295
- } & Readonly<{
296
- as: import("reka-ui").AsTag | import("vue").Component;
297
- }> & Omit<Readonly<import("reka-ui").ComboboxInputProps> & Readonly<{
298
- "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
299
- }>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
300
- $slots: {
301
- default?: (props: {}) => any;
302
- };
303
- }) | null, ({
304
- $: import("vue").ComponentInternalInstance;
305
- $data: {};
306
- $props: {
307
- readonly displayValue?: ((val: any) => string) | undefined;
308
- readonly modelValue?: string | undefined;
309
- readonly autoFocus?: boolean | undefined;
310
- readonly disabled?: boolean | undefined;
311
- readonly asChild?: boolean | undefined;
312
- readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
313
- readonly "onUpdate:modelValue"?: ((args_0: string) => any) | undefined | undefined;
314
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
315
- $attrs: {
316
- [x: string]: unknown;
317
- };
318
- $refs: {
319
- [x: string]: unknown;
320
- };
321
- $slots: Readonly<{
322
- [name: string]: import("vue").Slot<any> | undefined;
323
- }>;
324
- $root: import("vue").ComponentPublicInstance | null;
325
- $parent: import("vue").ComponentPublicInstance | null;
326
- $host: Element | null;
327
- $emit: (event: "update:modelValue", args_0: string) => void;
328
- $el: any;
329
- $options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").ComboboxInputProps> & Readonly<{
330
- "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
331
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
332
- "update:modelValue": (args_0: string) => any;
333
- }, string, {
334
- as: import("reka-ui").AsTag | import("vue").Component;
335
- }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
336
- beforeCreate?: (() => void) | (() => void)[];
337
- created?: (() => void) | (() => void)[];
338
- beforeMount?: (() => void) | (() => void)[];
339
- mounted?: (() => void) | (() => void)[];
340
- beforeUpdate?: (() => void) | (() => void)[];
341
- updated?: (() => void) | (() => void)[];
342
- activated?: (() => void) | (() => void)[];
343
- deactivated?: (() => void) | (() => void)[];
344
- beforeDestroy?: (() => void) | (() => void)[];
345
- beforeUnmount?: (() => void) | (() => void)[];
346
- destroyed?: (() => void) | (() => void)[];
347
- unmounted?: (() => void) | (() => void)[];
348
- renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
349
- renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
350
- errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
351
- };
352
- $forceUpdate: () => void;
353
- $nextTick: typeof nextTick;
354
- $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;
355
- } & Readonly<{
356
- as: import("reka-ui").AsTag | import("vue").Component;
357
- }> & Omit<Readonly<import("reka-ui").ComboboxInputProps> & Readonly<{
358
- "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
359
- }>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
360
- $slots: {
361
- default?: (props: {}) => any;
362
- };
363
- }) | null>;
242
+ inputRef: Readonly<import("vue").Ref<HTMLInputElement, HTMLInputElement>>;
364
243
  }>) => void;
365
244
  attrs: any;
366
245
  slots: InputMenuSlots<T, VK, M, NestedItem<T>>;
367
- emit: (((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "create", item: string) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "update:modelValue", value: GetModelValue<T, VK, M>) => void) & ((evt: "highlight", payload: {
246
+ emit: (((evt: "change", event: Event) => void) & ((evt: "blur", event: FocusEvent) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "create", item: string) => void) & ((evt: "update:modelValue", value: GetModelValue<T, VK, M>) => void) & ((evt: "highlight", payload: {
368
247
  ref: HTMLElement;
369
248
  value: GetModelValue<T, VK, M>;
370
249
  } | undefined) => void) & ((evt: "remove-tag", item: GetModelValue<T, VK, M>) => void)) & ((evt: "update:searchTerm", value: string) => void);
@@ -3,7 +3,7 @@ import theme from "#build/b24ui/input-menu";
3
3
  </script>
4
4
 
5
5
  <script setup>
6
- import { computed, ref, toRef, onMounted, toRaw, nextTick } from "vue";
6
+ import { computed, useTemplateRef, toRef, onMounted, toRaw, nextTick } from "vue";
7
7
  import { ComboboxRoot, ComboboxArrow, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxPortal, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxVirtualizer, ComboboxLabel, ComboboxSeparator, ComboboxItem, ComboboxItemIndicator, TagsInputRoot, TagsInputItem, TagsInputItemText, TagsInputItemDelete, TagsInputInput, useForwardPropsEmits, useFilter } from "reka-ui";
8
8
  import { defu } from "defu";
9
9
  import { isEqual } from "ohash/utils";
@@ -169,7 +169,7 @@ const createItem = computed(() => {
169
169
  return !filteredItems.value.length;
170
170
  });
171
171
  const createItemPosition = computed(() => typeof props.createItem === "object" ? props.createItem.position : "bottom");
172
- const inputRef = ref(null);
172
+ const inputRef = useTemplateRef("inputRef");
173
173
  function autoFocus() {
174
174
  if (props.autofocus) {
175
175
  inputRef.value?.$el?.focus();
@@ -244,7 +244,7 @@ function isInputItem(item) {
244
244
  return typeof item === "object" && item !== null;
245
245
  }
246
246
  defineExpose({
247
- inputRef
247
+ inputRef: toRef(() => inputRef.value?.$el)
248
248
  });
249
249
  </script>
250
250
 
@@ -1,10 +1,9 @@
1
- import { nextTick } from 'vue';
2
- import type { InputHTMLAttributes } from 'vue';
3
1
  import type { ComboboxRootProps, ComboboxRootEmits, ComboboxContentProps, ComboboxContentEmits, ComboboxArrowProps } from 'reka-ui';
4
2
  import type { AppConfig } from '@nuxt/schema';
5
3
  import theme from '#build/b24ui/input-menu';
6
4
  import type { UseComponentIconsProps } from '../composables/useComponentIcons';
7
5
  import type { AvatarProps, ChipProps, BadgeProps, IconComponent } from '../types';
6
+ import type { InputHTMLAttributes } from '../types/html';
8
7
  import type { AcceptableValue, ArrayOrNested, GetItemKeys, GetModelValue, GetModelValueEmits, NestedItem, EmitsToProps } from '../types/utils';
9
8
  import type { ComponentConfig } from '../types/tv';
10
9
  type InputMenu = ComponentConfig<typeof theme, AppConfig, 'inputMenu'>;
@@ -30,7 +29,7 @@ export type InputMenuItem = InputMenuValue | {
30
29
  b24ui?: Pick<InputMenu['slots'], 'tagsItem' | 'tagsItemText' | 'tagsItemDelete' | 'tagsItemDeleteIcon' | 'label' | 'separator' | 'item' | 'itemLeadingIcon' | 'itemLeadingAvatarSize' | 'itemLeadingAvatar' | 'itemLeadingChip' | 'itemLeadingChipSize' | 'itemWrapper' | 'itemLabel' | 'itemDescription' | 'itemTrailing' | 'itemTrailingIcon'>;
31
30
  [key: string]: any;
32
31
  };
33
- 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' | 'openOnClick' | 'openOnFocus'>, UseComponentIconsProps {
32
+ 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' | 'openOnClick' | 'openOnFocus'>, UseComponentIconsProps, /** @vue-ignore */ Omit<InputHTMLAttributes, 'disabled' | 'name' | 'type' | 'placeholder' | 'autofocus' | 'maxlength' | 'minlength' | 'pattern' | 'size' | 'min' | 'max' | 'step'> {
34
33
  /**
35
34
  * The element or component this component should render as.
36
35
  * @defaultValue 'div'
@@ -59,7 +58,7 @@ export interface InputMenuProps<T extends ArrayOrNested<InputMenuItem> = ArrayOr
59
58
  */
60
59
  underline?: boolean;
61
60
  /**
62
- * Rounds the corners of the button
61
+ * Rounds the corners of the input
63
62
  * @defaultValue false
64
63
  */
65
64
  rounded?: boolean;
@@ -226,11 +225,11 @@ declare const __VLS_export: <T extends ArrayOrNested<InputMenuItem>, VK extends
226
225
  props: __VLS_PrettifyLocal<(InputMenuProps<T, VK, M> & {
227
226
  searchTerm?: string;
228
227
  }) & {
229
- onBlur?: ((event: FocusEvent) => any) | undefined;
230
228
  onChange?: ((event: Event) => any) | undefined;
229
+ onBlur?: ((event: FocusEvent) => any) | undefined;
231
230
  onFocus?: ((event: FocusEvent) => any) | undefined;
232
- onCreate?: ((item: string) => any) | undefined;
233
231
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
232
+ onCreate?: ((item: string) => any) | undefined;
234
233
  "onUpdate:modelValue"?: ((value: GetModelValue<T, VK, M>) => any) | undefined;
235
234
  onHighlight?: ((payload: {
236
235
  ref: HTMLElement;
@@ -240,131 +239,11 @@ declare const __VLS_export: <T extends ArrayOrNested<InputMenuItem>, VK extends
240
239
  "onRemove-tag"?: ((item: GetModelValue<T, VK, M>) => any) | undefined;
241
240
  }> & import("vue").PublicProps;
242
241
  expose: (exposed: import("vue").ShallowUnwrapRef<{
243
- inputRef: import("vue").Ref<({
244
- $: import("vue").ComponentInternalInstance;
245
- $data: {};
246
- $props: {
247
- readonly displayValue?: ((val: any) => string) | undefined;
248
- readonly modelValue?: string | undefined;
249
- readonly autoFocus?: boolean | undefined;
250
- readonly disabled?: boolean | undefined;
251
- readonly asChild?: boolean | undefined;
252
- readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
253
- readonly "onUpdate:modelValue"?: ((args_0: string) => any) | undefined | undefined;
254
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
255
- $attrs: {
256
- [x: string]: unknown;
257
- };
258
- $refs: {
259
- [x: string]: unknown;
260
- };
261
- $slots: Readonly<{
262
- [name: string]: import("vue").Slot<any> | undefined;
263
- }>;
264
- $root: import("vue").ComponentPublicInstance | null;
265
- $parent: import("vue").ComponentPublicInstance | null;
266
- $host: Element | null;
267
- $emit: (event: "update:modelValue", args_0: string) => void;
268
- $el: any;
269
- $options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").ComboboxInputProps> & Readonly<{
270
- "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
271
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
272
- "update:modelValue": (args_0: string) => any;
273
- }, string, {
274
- as: import("reka-ui").AsTag | import("vue").Component;
275
- }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
276
- beforeCreate?: (() => void) | (() => void)[];
277
- created?: (() => void) | (() => void)[];
278
- beforeMount?: (() => void) | (() => void)[];
279
- mounted?: (() => void) | (() => void)[];
280
- beforeUpdate?: (() => void) | (() => void)[];
281
- updated?: (() => void) | (() => void)[];
282
- activated?: (() => void) | (() => void)[];
283
- deactivated?: (() => void) | (() => void)[];
284
- beforeDestroy?: (() => void) | (() => void)[];
285
- beforeUnmount?: (() => void) | (() => void)[];
286
- destroyed?: (() => void) | (() => void)[];
287
- unmounted?: (() => void) | (() => void)[];
288
- renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
289
- renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
290
- errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
291
- };
292
- $forceUpdate: () => void;
293
- $nextTick: typeof nextTick;
294
- $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;
295
- } & Readonly<{
296
- as: import("reka-ui").AsTag | import("vue").Component;
297
- }> & Omit<Readonly<import("reka-ui").ComboboxInputProps> & Readonly<{
298
- "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
299
- }>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
300
- $slots: {
301
- default?: (props: {}) => any;
302
- };
303
- }) | null, ({
304
- $: import("vue").ComponentInternalInstance;
305
- $data: {};
306
- $props: {
307
- readonly displayValue?: ((val: any) => string) | undefined;
308
- readonly modelValue?: string | undefined;
309
- readonly autoFocus?: boolean | undefined;
310
- readonly disabled?: boolean | undefined;
311
- readonly asChild?: boolean | undefined;
312
- readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
313
- readonly "onUpdate:modelValue"?: ((args_0: string) => any) | undefined | undefined;
314
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
315
- $attrs: {
316
- [x: string]: unknown;
317
- };
318
- $refs: {
319
- [x: string]: unknown;
320
- };
321
- $slots: Readonly<{
322
- [name: string]: import("vue").Slot<any> | undefined;
323
- }>;
324
- $root: import("vue").ComponentPublicInstance | null;
325
- $parent: import("vue").ComponentPublicInstance | null;
326
- $host: Element | null;
327
- $emit: (event: "update:modelValue", args_0: string) => void;
328
- $el: any;
329
- $options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").ComboboxInputProps> & Readonly<{
330
- "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
331
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
332
- "update:modelValue": (args_0: string) => any;
333
- }, string, {
334
- as: import("reka-ui").AsTag | import("vue").Component;
335
- }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
336
- beforeCreate?: (() => void) | (() => void)[];
337
- created?: (() => void) | (() => void)[];
338
- beforeMount?: (() => void) | (() => void)[];
339
- mounted?: (() => void) | (() => void)[];
340
- beforeUpdate?: (() => void) | (() => void)[];
341
- updated?: (() => void) | (() => void)[];
342
- activated?: (() => void) | (() => void)[];
343
- deactivated?: (() => void) | (() => void)[];
344
- beforeDestroy?: (() => void) | (() => void)[];
345
- beforeUnmount?: (() => void) | (() => void)[];
346
- destroyed?: (() => void) | (() => void)[];
347
- unmounted?: (() => void) | (() => void)[];
348
- renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
349
- renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
350
- errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
351
- };
352
- $forceUpdate: () => void;
353
- $nextTick: typeof nextTick;
354
- $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;
355
- } & Readonly<{
356
- as: import("reka-ui").AsTag | import("vue").Component;
357
- }> & Omit<Readonly<import("reka-ui").ComboboxInputProps> & Readonly<{
358
- "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
359
- }>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
360
- $slots: {
361
- default?: (props: {}) => any;
362
- };
363
- }) | null>;
242
+ inputRef: Readonly<import("vue").Ref<HTMLInputElement, HTMLInputElement>>;
364
243
  }>) => void;
365
244
  attrs: any;
366
245
  slots: InputMenuSlots<T, VK, M, NestedItem<T>>;
367
- emit: (((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "create", item: string) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "update:modelValue", value: GetModelValue<T, VK, M>) => void) & ((evt: "highlight", payload: {
246
+ emit: (((evt: "change", event: Event) => void) & ((evt: "blur", event: FocusEvent) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "create", item: string) => void) & ((evt: "update:modelValue", value: GetModelValue<T, VK, M>) => void) & ((evt: "highlight", payload: {
368
247
  ref: HTMLElement;
369
248
  value: GetModelValue<T, VK, M>;
370
249
  } | undefined) => void) & ((evt: "remove-tag", item: GetModelValue<T, VK, M>) => void)) & ((evt: "update:searchTerm", value: string) => void);