@bitrix24/b24ui-nuxt 2.0.9 → 2.1.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 (143) hide show
  1. package/dist/meta.d.mts +79556 -44766
  2. package/dist/meta.mjs +79556 -44766
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +3 -3
  5. package/dist/runtime/components/App.d.vue.ts +1 -1
  6. package/dist/runtime/components/App.vue +2 -1
  7. package/dist/runtime/components/App.vue.d.ts +1 -1
  8. package/dist/runtime/components/Avatar.d.vue.ts +2 -1
  9. package/dist/runtime/components/Avatar.vue.d.ts +2 -1
  10. package/dist/runtime/components/Button.vue +1 -0
  11. package/dist/runtime/components/Calendar.vue +1 -3
  12. package/dist/runtime/components/ChatPrompt.d.vue.ts +2 -2
  13. package/dist/runtime/components/ChatPrompt.vue +5 -5
  14. package/dist/runtime/components/ChatPrompt.vue.d.ts +2 -2
  15. package/dist/runtime/components/ChatPromptSubmit.d.vue.ts +5 -5
  16. package/dist/runtime/components/ChatPromptSubmit.vue +53 -4
  17. package/dist/runtime/components/ChatPromptSubmit.vue.d.ts +5 -5
  18. package/dist/runtime/components/Checkbox.d.vue.ts +2 -1
  19. package/dist/runtime/components/Checkbox.vue.d.ts +2 -1
  20. package/dist/runtime/components/CommandPalette.vue +5 -4
  21. package/dist/runtime/components/DashboardSearch.d.vue.ts +3 -6
  22. package/dist/runtime/components/DashboardSearch.vue +2 -3
  23. package/dist/runtime/components/DashboardSearch.vue.d.ts +3 -6
  24. package/dist/runtime/components/DashboardSearchButton.d.vue.ts +2 -3
  25. package/dist/runtime/components/DashboardSearchButton.vue +44 -6
  26. package/dist/runtime/components/DashboardSearchButton.vue.d.ts +2 -3
  27. package/dist/runtime/components/Error.d.vue.ts +1 -1
  28. package/dist/runtime/components/Error.vue.d.ts +1 -1
  29. package/dist/runtime/components/FileUpload.d.vue.ts +3 -2
  30. package/dist/runtime/components/FileUpload.vue +9 -9
  31. package/dist/runtime/components/FileUpload.vue.d.ts +3 -2
  32. package/dist/runtime/components/Form.d.vue.ts +2 -1
  33. package/dist/runtime/components/Form.vue.d.ts +2 -1
  34. package/dist/runtime/components/Input.d.vue.ts +7 -7
  35. package/dist/runtime/components/Input.vue +2 -2
  36. package/dist/runtime/components/Input.vue.d.ts +7 -7
  37. package/dist/runtime/components/InputDate.d.vue.ts +110 -0
  38. package/dist/runtime/components/InputDate.vue +192 -0
  39. package/dist/runtime/components/InputDate.vue.d.ts +110 -0
  40. package/dist/runtime/components/InputMenu.d.vue.ts +7 -128
  41. package/dist/runtime/components/InputMenu.vue +3 -3
  42. package/dist/runtime/components/InputMenu.vue.d.ts +7 -128
  43. package/dist/runtime/components/InputNumber.d.vue.ts +25 -129
  44. package/dist/runtime/components/InputNumber.vue +4 -7
  45. package/dist/runtime/components/InputNumber.vue.d.ts +25 -129
  46. package/dist/runtime/components/InputTags.d.vue.ts +6 -109
  47. package/dist/runtime/components/InputTags.vue +8 -8
  48. package/dist/runtime/components/InputTags.vue.d.ts +6 -109
  49. package/dist/runtime/components/InputTime.d.vue.ts +94 -0
  50. package/dist/runtime/components/InputTime.vue +164 -0
  51. package/dist/runtime/components/InputTime.vue.d.ts +94 -0
  52. package/dist/runtime/components/Link.d.vue.ts +4 -49
  53. package/dist/runtime/components/Link.vue +1 -0
  54. package/dist/runtime/components/Link.vue.d.ts +4 -49
  55. package/dist/runtime/components/Modal.d.vue.ts +1 -1
  56. package/dist/runtime/components/Modal.vue.d.ts +1 -1
  57. package/dist/runtime/components/Pagination.d.vue.ts +2 -2
  58. package/dist/runtime/components/Pagination.vue.d.ts +2 -2
  59. package/dist/runtime/components/PinInput.d.vue.ts +3 -3
  60. package/dist/runtime/components/PinInput.vue.d.ts +3 -3
  61. package/dist/runtime/components/Progress.d.vue.ts +1 -1
  62. package/dist/runtime/components/Progress.vue.d.ts +1 -1
  63. package/dist/runtime/components/Select.d.vue.ts +6 -107
  64. package/dist/runtime/components/Select.vue +3 -3
  65. package/dist/runtime/components/Select.vue.d.ts +6 -107
  66. package/dist/runtime/components/SelectMenu.d.vue.ts +7 -106
  67. package/dist/runtime/components/SelectMenu.vue +3 -3
  68. package/dist/runtime/components/SelectMenu.vue.d.ts +7 -106
  69. package/dist/runtime/components/Slideover.d.vue.ts +1 -1
  70. package/dist/runtime/components/Slideover.vue.d.ts +1 -1
  71. package/dist/runtime/components/Switch.d.vue.ts +2 -1
  72. package/dist/runtime/components/Switch.vue.d.ts +2 -1
  73. package/dist/runtime/components/Table.d.vue.ts +5 -4
  74. package/dist/runtime/components/Table.vue +4 -3
  75. package/dist/runtime/components/Table.vue.d.ts +5 -4
  76. package/dist/runtime/components/Textarea.d.vue.ts +7 -6
  77. package/dist/runtime/components/Textarea.vue +2 -2
  78. package/dist/runtime/components/Textarea.vue.d.ts +7 -6
  79. package/dist/runtime/components/Toast.vue +5 -5
  80. package/dist/runtime/components/Toaster.d.vue.ts +1 -1
  81. package/dist/runtime/components/Toaster.vue.d.ts +1 -1
  82. package/dist/runtime/components/color-mode/ColorModeAvatar.d.vue.ts +3 -3
  83. package/dist/runtime/components/color-mode/ColorModeAvatar.vue +16 -4
  84. package/dist/runtime/components/color-mode/ColorModeAvatar.vue.d.ts +3 -3
  85. package/dist/runtime/components/color-mode/ColorModeButton.d.vue.ts +3 -3
  86. package/dist/runtime/components/color-mode/ColorModeButton.vue +54 -6
  87. package/dist/runtime/components/color-mode/ColorModeButton.vue.d.ts +3 -3
  88. package/dist/runtime/components/color-mode/ColorModeImage.d.vue.ts +4 -3
  89. package/dist/runtime/components/color-mode/ColorModeImage.vue +4 -0
  90. package/dist/runtime/components/color-mode/ColorModeImage.vue.d.ts +4 -3
  91. package/dist/runtime/components/color-mode/ColorModeSelect.d.vue.ts +5 -3
  92. package/dist/runtime/components/color-mode/ColorModeSelect.vue +47 -5
  93. package/dist/runtime/components/color-mode/ColorModeSelect.vue.d.ts +5 -3
  94. package/dist/runtime/components/color-mode/ColorModeSwitch.d.vue.ts +2 -2
  95. package/dist/runtime/components/color-mode/ColorModeSwitch.vue +29 -5
  96. package/dist/runtime/components/color-mode/ColorModeSwitch.vue.d.ts +2 -2
  97. package/dist/runtime/components/content/ContentSearch.d.vue.ts +3 -6
  98. package/dist/runtime/components/content/ContentSearch.vue +2 -3
  99. package/dist/runtime/components/content/ContentSearch.vue.d.ts +3 -6
  100. package/dist/runtime/components/content/ContentSearchButton.d.vue.ts +2 -3
  101. package/dist/runtime/components/content/ContentSearchButton.vue +43 -5
  102. package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +2 -3
  103. package/dist/runtime/components/content/ContentSurround.vue +7 -1
  104. package/dist/runtime/components/locale/LocaleSelect.d.vue.ts +11 -7
  105. package/dist/runtime/components/locale/LocaleSelect.vue +50 -6
  106. package/dist/runtime/components/locale/LocaleSelect.vue.d.ts +11 -7
  107. package/dist/runtime/components/prose/Callout.vue +4 -0
  108. package/dist/runtime/composables/index.d.ts +8 -0
  109. package/dist/runtime/composables/index.js +8 -0
  110. package/dist/runtime/composables/useFileUpload.d.ts +2 -1
  111. package/dist/runtime/composables/useFileUpload.js +13 -4
  112. package/dist/runtime/inertia/components/Link.d.vue.ts +17 -10
  113. package/dist/runtime/inertia/components/Link.vue +8 -6
  114. package/dist/runtime/inertia/components/Link.vue.d.ts +17 -10
  115. package/dist/runtime/inertia/stubs.d.ts +1 -1
  116. package/dist/runtime/types/html.d.ts +8 -0
  117. package/dist/runtime/types/html.js +0 -0
  118. package/dist/runtime/types/index.d.ts +2 -0
  119. package/dist/runtime/types/index.js +2 -0
  120. package/dist/runtime/types/input.d.ts +5 -5
  121. package/dist/runtime/types/utils.d.ts +2 -0
  122. package/dist/runtime/utils/content.d.ts +2 -2
  123. package/dist/runtime/utils/dashboard.d.ts +1 -1
  124. package/dist/runtime/utils/link.d.ts +1 -0
  125. package/dist/runtime/utils/link.js +40 -24
  126. package/dist/runtime/vue/components/Link.d.vue.ts +8 -37
  127. package/dist/runtime/vue/components/Link.vue +6 -11
  128. package/dist/runtime/vue/components/Link.vue.d.ts +8 -37
  129. package/dist/runtime/vue/components/color-mode/ColorModeButton.d.vue.ts +2 -2
  130. package/dist/runtime/vue/components/color-mode/ColorModeButton.vue +55 -5
  131. package/dist/runtime/vue/components/color-mode/ColorModeButton.vue.d.ts +2 -2
  132. package/dist/runtime/vue/components/color-mode/ColorModeSelect.d.vue.ts +5 -3
  133. package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue +46 -3
  134. package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue.d.ts +5 -3
  135. package/dist/runtime/vue/components/color-mode/ColorModeSwitch.d.vue.ts +1 -1
  136. package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue +24 -3
  137. package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue.d.ts +1 -1
  138. package/dist/runtime/vue/stubs.d.ts +2 -2
  139. package/dist/runtime/vue/stubs.js +1 -1
  140. package/dist/shared/{b24ui-nuxt.4XNR9Ysu.mjs → b24ui-nuxt.B13KxxqP.mjs} +137 -3
  141. package/dist/unplugin.mjs +1 -1
  142. package/dist/vite.mjs +1 -1
  143. package/package.json +24 -14
@@ -2,10 +2,12 @@ import type { NumberFieldRootProps } from 'reka-ui';
2
2
  import type { AppConfig } from '@nuxt/schema';
3
3
  import theme from '#build/b24ui/input-number';
4
4
  import type { ButtonProps, BadgeProps, IconComponent } from '../types';
5
+ import type { InputHTMLAttributes } from '../types/html';
5
6
  import type { ModelModifiers } from '../types/input';
6
7
  import type { ComponentConfig } from '../types/tv';
7
8
  type InputNumber = ComponentConfig<typeof theme, AppConfig, 'inputNumber'>;
8
- export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue' | 'defaultValue' | 'min' | 'max' | 'step' | 'stepSnapping' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions' | 'disableWheelChange' | 'invertWheelChange' | 'readonly'> {
9
+ type InputNumberValue = number | null;
10
+ export interface InputNumberProps<T extends InputNumberValue = InputNumberValue> extends Pick<NumberFieldRootProps, 'modelValue' | 'defaultValue' | 'min' | 'max' | 'step' | 'stepSnapping' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions' | 'disableWheelChange' | 'invertWheelChange' | 'readonly'>, /** @vue-ignore */ Omit<InputHTMLAttributes, 'disabled' | 'min' | 'max' | 'readonly' | 'required' | 'step' | 'name' | 'placeholder' | 'type' | 'autofocus' | 'maxlength' | 'minlength' | 'pattern' | 'size'> {
9
11
  /**
10
12
  * The element or component this component should render as.
11
13
  * @defaultValue 'div'
@@ -32,7 +34,7 @@ export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue
32
34
  */
33
35
  underline?: boolean;
34
36
  /**
35
- * Rounds the corners of the button
37
+ * Rounds the corners of the input
36
38
  * @defaultValue false
37
39
  */
38
40
  rounded?: boolean;
@@ -76,17 +78,12 @@ export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue
76
78
  decrementDisabled?: boolean;
77
79
  autofocus?: boolean;
78
80
  autofocusDelay?: number;
79
- modelModifiers?: Pick<ModelModifiers, 'optional'>;
80
- /**
81
- * The locale to use for formatting and parsing numbers.
82
- * @defaultValue B24App.locale.code
83
- */
84
- locale?: string;
81
+ modelModifiers?: Pick<ModelModifiers<T>, 'optional'>;
85
82
  class?: any;
86
83
  b24ui?: InputNumber['slots'];
87
84
  }
88
- export interface InputNumberEmits {
89
- 'update:modelValue': [value: number];
85
+ export interface InputNumberEmits<T extends InputNumberValue = InputNumberValue> {
86
+ 'update:modelValue': [value: T];
90
87
  'blur': [event: FocusEvent];
91
88
  'change': [event: Event];
92
89
  }
@@ -94,124 +91,23 @@ export interface InputNumberSlots {
94
91
  increment(props?: {}): any;
95
92
  decrement(props?: {}): any;
96
93
  }
97
- declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<InputNumberProps, {
98
- inputRef: import("vue").Ref<({
99
- $: import("vue").ComponentInternalInstance;
100
- $data: {};
101
- $props: {
102
- readonly asChild?: boolean | undefined;
103
- readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
104
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
105
- $attrs: {
106
- [x: string]: unknown;
107
- };
108
- $refs: {
109
- [x: string]: unknown;
110
- };
111
- $slots: Readonly<{
112
- [name: string]: import("vue").Slot<any> | undefined;
113
- }>;
114
- $root: import("vue").ComponentPublicInstance | null;
115
- $parent: import("vue").ComponentPublicInstance | null;
116
- $host: Element | null;
117
- $emit: (event: string, ...args: any[]) => void;
118
- $el: any;
119
- $options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").NumberFieldInputProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
120
- as: import("reka-ui").AsTag | import("vue").Component;
121
- }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
122
- beforeCreate?: (() => void) | (() => void)[];
123
- created?: (() => void) | (() => void)[];
124
- beforeMount?: (() => void) | (() => void)[];
125
- mounted?: (() => void) | (() => void)[];
126
- beforeUpdate?: (() => void) | (() => void)[];
127
- updated?: (() => void) | (() => void)[];
128
- activated?: (() => void) | (() => void)[];
129
- deactivated?: (() => void) | (() => void)[];
130
- beforeDestroy?: (() => void) | (() => void)[];
131
- beforeUnmount?: (() => void) | (() => void)[];
132
- destroyed?: (() => void) | (() => void)[];
133
- unmounted?: (() => void) | (() => void)[];
134
- renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
135
- renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
136
- errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
137
- };
138
- $forceUpdate: () => void;
139
- $nextTick: typeof import("vue").nextTick;
140
- $watch<T extends string | ((...args: any) => any)>(source: T, cb: T 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;
141
- } & Readonly<{
142
- as: import("reka-ui").AsTag | import("vue").Component;
143
- }> & Omit<Readonly<import("reka-ui").NumberFieldInputProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
144
- $slots: {
145
- default?: (props: {}) => any;
146
- };
147
- }) | null, ({
148
- $: import("vue").ComponentInternalInstance;
149
- $data: {};
150
- $props: {
151
- readonly asChild?: boolean | undefined;
152
- readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
153
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
154
- $attrs: {
155
- [x: string]: unknown;
156
- };
157
- $refs: {
158
- [x: string]: unknown;
159
- };
160
- $slots: Readonly<{
161
- [name: string]: import("vue").Slot<any> | undefined;
162
- }>;
163
- $root: import("vue").ComponentPublicInstance | null;
164
- $parent: import("vue").ComponentPublicInstance | null;
165
- $host: Element | null;
166
- $emit: (event: string, ...args: any[]) => void;
167
- $el: any;
168
- $options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").NumberFieldInputProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
169
- as: import("reka-ui").AsTag | import("vue").Component;
170
- }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
171
- beforeCreate?: (() => void) | (() => void)[];
172
- created?: (() => void) | (() => void)[];
173
- beforeMount?: (() => void) | (() => void)[];
174
- mounted?: (() => void) | (() => void)[];
175
- beforeUpdate?: (() => void) | (() => void)[];
176
- updated?: (() => void) | (() => void)[];
177
- activated?: (() => void) | (() => void)[];
178
- deactivated?: (() => void) | (() => void)[];
179
- beforeDestroy?: (() => void) | (() => void)[];
180
- beforeUnmount?: (() => void) | (() => void)[];
181
- destroyed?: (() => void) | (() => void)[];
182
- unmounted?: (() => void) | (() => void)[];
183
- renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
184
- renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
185
- errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
186
- };
187
- $forceUpdate: () => void;
188
- $nextTick: typeof import("vue").nextTick;
189
- $watch<T extends string | ((...args: any) => any)>(source: T, cb: T 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;
190
- } & Readonly<{
191
- as: import("reka-ui").AsTag | import("vue").Component;
192
- }> & Omit<Readonly<import("reka-ui").NumberFieldInputProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
193
- $slots: {
194
- default?: (props: {}) => any;
195
- };
196
- }) | null>;
197
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
198
- blur: (event: FocusEvent) => any;
199
- change: (event: Event) => any;
200
- "update:modelValue": (value: number) => any;
201
- }, string, import("vue").PublicProps, Readonly<InputNumberProps> & Readonly<{
202
- onBlur?: ((event: FocusEvent) => any) | undefined;
203
- onChange?: ((event: Event) => any) | undefined;
204
- "onUpdate:modelValue"?: ((value: number) => any) | undefined;
205
- }>, {
206
- color: InputNumber["variants"]["color"];
207
- decrement: boolean | ButtonProps;
208
- increment: boolean | ButtonProps;
209
- orientation: "vertical" | "horizontal";
210
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, InputNumberSlots>;
94
+ declare const __VLS_export: <T extends InputNumberValue = InputNumberValue>(__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<InputNumberProps<T> & {
96
+ onChange?: ((event: Event) => any) | undefined;
97
+ onBlur?: ((event: FocusEvent) => any) | undefined;
98
+ "onUpdate:modelValue"?: ((value: T) => any) | undefined;
99
+ }> & import("vue").PublicProps;
100
+ expose: (exposed: import("vue").ShallowUnwrapRef<{
101
+ inputRef: Readonly<import("vue").Ref<HTMLInputElement, HTMLInputElement>>;
102
+ }>) => void;
103
+ attrs: any;
104
+ slots: InputNumberSlots;
105
+ emit: ((evt: "change", event: Event) => void) & ((evt: "blur", event: FocusEvent) => void) & ((evt: "update:modelValue", value: T) => void);
106
+ }>) => import("vue").VNode & {
107
+ __ctx?: Awaited<typeof __VLS_setup>;
108
+ };
211
109
  declare const _default: typeof __VLS_export;
212
110
  export default _default;
213
- type __VLS_WithSlots<T, S> = T & {
214
- new (): {
215
- $slots: S;
216
- };
217
- };
111
+ type __VLS_PrettifyLocal<T> = {
112
+ [K in keyof T as K]: T[K];
113
+ } & {};
@@ -3,7 +3,7 @@ import theme from "#build/b24ui/input-number";
3
3
  </script>
4
4
 
5
5
  <script setup>
6
- import { onMounted, ref, computed } from "vue";
6
+ import { onMounted, computed, useTemplateRef, toRef } from "vue";
7
7
  import { NumberFieldRoot, NumberFieldInput, NumberFieldDecrement, NumberFieldIncrement, useForwardPropsEmits } from "reka-ui";
8
8
  import { reactivePick, useVModel } from "@vueuse/core";
9
9
  import { useAppConfig } from "#imports";
@@ -36,7 +36,6 @@ const props = defineProps({
36
36
  autofocus: { type: Boolean, required: false },
37
37
  autofocusDelay: { type: Number, required: false },
38
38
  modelModifiers: { type: Object, required: false },
39
- locale: { type: String, required: false },
40
39
  class: { type: null, required: false },
41
40
  b24ui: { type: null, required: false },
42
41
  modelValue: { type: [Number, null], required: false },
@@ -57,12 +56,11 @@ const props = defineProps({
57
56
  const emits = defineEmits(["update:modelValue", "blur", "change"]);
58
57
  defineSlots();
59
58
  const modelValue = useVModel(props, "modelValue", emits, { defaultValue: props.defaultValue });
60
- const { t, code: codeLocale } = useLocale();
59
+ const { t } = useLocale();
61
60
  const appConfig = useAppConfig();
62
61
  const rootProps = useForwardPropsEmits(reactivePick(props, "as", "defaultValue", "min", "max", "step", "stepSnapping", "formatOptions", "disableWheelChange", "invertWheelChange", "readonly"), emits);
63
62
  const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, id, color, size: formGroupSize, name, highlight, disabled, ariaAttrs } = useFormField(props);
64
63
  const { orientation, size: fieldGroupSize } = useFieldGroup(props);
65
- const locale = computed(() => props.locale || codeLocale.value);
66
64
  const inputSize = computed(() => fieldGroupSize.value || formGroupSize.value);
67
65
  const isTag = computed(() => {
68
66
  return props.tag;
@@ -81,7 +79,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.inputNu
81
79
  }));
82
80
  const incrementIcon = computed(() => props.incrementIcon || (props.orientation === "horizontal" ? icons.plus : icons.chevronUp));
83
81
  const decrementIcon = computed(() => props.decrementIcon || (props.orientation === "horizontal" ? icons.minus : icons.chevronDown));
84
- const inputRef = ref(null);
82
+ const inputRef = useTemplateRef("inputRef");
85
83
  function onUpdate(value) {
86
84
  if (props.modelModifiers?.optional) {
87
85
  value = value ?? void 0;
@@ -106,7 +104,7 @@ onMounted(() => {
106
104
  }, props.autofocusDelay);
107
105
  });
108
106
  defineExpose({
109
- inputRef
107
+ inputRef: toRef(() => inputRef.value?.$el)
110
108
  });
111
109
  </script>
112
110
 
@@ -118,7 +116,6 @@ defineExpose({
118
116
  :class="b24ui.root({ class: [props.b24ui?.root, props.class] })"
119
117
  :name="name"
120
118
  :disabled="disabled"
121
- :locale="locale"
122
119
  @update:model-value="onUpdate"
123
120
  >
124
121
  <B24Badge
@@ -2,10 +2,12 @@ import type { NumberFieldRootProps } from 'reka-ui';
2
2
  import type { AppConfig } from '@nuxt/schema';
3
3
  import theme from '#build/b24ui/input-number';
4
4
  import type { ButtonProps, BadgeProps, IconComponent } from '../types';
5
+ import type { InputHTMLAttributes } from '../types/html';
5
6
  import type { ModelModifiers } from '../types/input';
6
7
  import type { ComponentConfig } from '../types/tv';
7
8
  type InputNumber = ComponentConfig<typeof theme, AppConfig, 'inputNumber'>;
8
- export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue' | 'defaultValue' | 'min' | 'max' | 'step' | 'stepSnapping' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions' | 'disableWheelChange' | 'invertWheelChange' | 'readonly'> {
9
+ type InputNumberValue = number | null;
10
+ export interface InputNumberProps<T extends InputNumberValue = InputNumberValue> extends Pick<NumberFieldRootProps, 'modelValue' | 'defaultValue' | 'min' | 'max' | 'step' | 'stepSnapping' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions' | 'disableWheelChange' | 'invertWheelChange' | 'readonly'>, /** @vue-ignore */ Omit<InputHTMLAttributes, 'disabled' | 'min' | 'max' | 'readonly' | 'required' | 'step' | 'name' | 'placeholder' | 'type' | 'autofocus' | 'maxlength' | 'minlength' | 'pattern' | 'size'> {
9
11
  /**
10
12
  * The element or component this component should render as.
11
13
  * @defaultValue 'div'
@@ -32,7 +34,7 @@ export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue
32
34
  */
33
35
  underline?: boolean;
34
36
  /**
35
- * Rounds the corners of the button
37
+ * Rounds the corners of the input
36
38
  * @defaultValue false
37
39
  */
38
40
  rounded?: boolean;
@@ -76,17 +78,12 @@ export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue
76
78
  decrementDisabled?: boolean;
77
79
  autofocus?: boolean;
78
80
  autofocusDelay?: number;
79
- modelModifiers?: Pick<ModelModifiers, 'optional'>;
80
- /**
81
- * The locale to use for formatting and parsing numbers.
82
- * @defaultValue B24App.locale.code
83
- */
84
- locale?: string;
81
+ modelModifiers?: Pick<ModelModifiers<T>, 'optional'>;
85
82
  class?: any;
86
83
  b24ui?: InputNumber['slots'];
87
84
  }
88
- export interface InputNumberEmits {
89
- 'update:modelValue': [value: number];
85
+ export interface InputNumberEmits<T extends InputNumberValue = InputNumberValue> {
86
+ 'update:modelValue': [value: T];
90
87
  'blur': [event: FocusEvent];
91
88
  'change': [event: Event];
92
89
  }
@@ -94,124 +91,23 @@ export interface InputNumberSlots {
94
91
  increment(props?: {}): any;
95
92
  decrement(props?: {}): any;
96
93
  }
97
- declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<InputNumberProps, {
98
- inputRef: import("vue").Ref<({
99
- $: import("vue").ComponentInternalInstance;
100
- $data: {};
101
- $props: {
102
- readonly asChild?: boolean | undefined;
103
- readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
104
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
105
- $attrs: {
106
- [x: string]: unknown;
107
- };
108
- $refs: {
109
- [x: string]: unknown;
110
- };
111
- $slots: Readonly<{
112
- [name: string]: import("vue").Slot<any> | undefined;
113
- }>;
114
- $root: import("vue").ComponentPublicInstance | null;
115
- $parent: import("vue").ComponentPublicInstance | null;
116
- $host: Element | null;
117
- $emit: (event: string, ...args: any[]) => void;
118
- $el: any;
119
- $options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").NumberFieldInputProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
120
- as: import("reka-ui").AsTag | import("vue").Component;
121
- }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
122
- beforeCreate?: (() => void) | (() => void)[];
123
- created?: (() => void) | (() => void)[];
124
- beforeMount?: (() => void) | (() => void)[];
125
- mounted?: (() => void) | (() => void)[];
126
- beforeUpdate?: (() => void) | (() => void)[];
127
- updated?: (() => void) | (() => void)[];
128
- activated?: (() => void) | (() => void)[];
129
- deactivated?: (() => void) | (() => void)[];
130
- beforeDestroy?: (() => void) | (() => void)[];
131
- beforeUnmount?: (() => void) | (() => void)[];
132
- destroyed?: (() => void) | (() => void)[];
133
- unmounted?: (() => void) | (() => void)[];
134
- renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
135
- renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
136
- errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
137
- };
138
- $forceUpdate: () => void;
139
- $nextTick: typeof import("vue").nextTick;
140
- $watch<T extends string | ((...args: any) => any)>(source: T, cb: T 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;
141
- } & Readonly<{
142
- as: import("reka-ui").AsTag | import("vue").Component;
143
- }> & Omit<Readonly<import("reka-ui").NumberFieldInputProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
144
- $slots: {
145
- default?: (props: {}) => any;
146
- };
147
- }) | null, ({
148
- $: import("vue").ComponentInternalInstance;
149
- $data: {};
150
- $props: {
151
- readonly asChild?: boolean | undefined;
152
- readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
153
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
154
- $attrs: {
155
- [x: string]: unknown;
156
- };
157
- $refs: {
158
- [x: string]: unknown;
159
- };
160
- $slots: Readonly<{
161
- [name: string]: import("vue").Slot<any> | undefined;
162
- }>;
163
- $root: import("vue").ComponentPublicInstance | null;
164
- $parent: import("vue").ComponentPublicInstance | null;
165
- $host: Element | null;
166
- $emit: (event: string, ...args: any[]) => void;
167
- $el: any;
168
- $options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").NumberFieldInputProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
169
- as: import("reka-ui").AsTag | import("vue").Component;
170
- }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
171
- beforeCreate?: (() => void) | (() => void)[];
172
- created?: (() => void) | (() => void)[];
173
- beforeMount?: (() => void) | (() => void)[];
174
- mounted?: (() => void) | (() => void)[];
175
- beforeUpdate?: (() => void) | (() => void)[];
176
- updated?: (() => void) | (() => void)[];
177
- activated?: (() => void) | (() => void)[];
178
- deactivated?: (() => void) | (() => void)[];
179
- beforeDestroy?: (() => void) | (() => void)[];
180
- beforeUnmount?: (() => void) | (() => void)[];
181
- destroyed?: (() => void) | (() => void)[];
182
- unmounted?: (() => void) | (() => void)[];
183
- renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
184
- renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
185
- errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
186
- };
187
- $forceUpdate: () => void;
188
- $nextTick: typeof import("vue").nextTick;
189
- $watch<T extends string | ((...args: any) => any)>(source: T, cb: T 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;
190
- } & Readonly<{
191
- as: import("reka-ui").AsTag | import("vue").Component;
192
- }> & Omit<Readonly<import("reka-ui").NumberFieldInputProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
193
- $slots: {
194
- default?: (props: {}) => any;
195
- };
196
- }) | null>;
197
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
198
- blur: (event: FocusEvent) => any;
199
- change: (event: Event) => any;
200
- "update:modelValue": (value: number) => any;
201
- }, string, import("vue").PublicProps, Readonly<InputNumberProps> & Readonly<{
202
- onBlur?: ((event: FocusEvent) => any) | undefined;
203
- onChange?: ((event: Event) => any) | undefined;
204
- "onUpdate:modelValue"?: ((value: number) => any) | undefined;
205
- }>, {
206
- color: InputNumber["variants"]["color"];
207
- decrement: boolean | ButtonProps;
208
- increment: boolean | ButtonProps;
209
- orientation: "vertical" | "horizontal";
210
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, InputNumberSlots>;
94
+ declare const __VLS_export: <T extends InputNumberValue = InputNumberValue>(__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<InputNumberProps<T> & {
96
+ onChange?: ((event: Event) => any) | undefined;
97
+ onBlur?: ((event: FocusEvent) => any) | undefined;
98
+ "onUpdate:modelValue"?: ((value: T) => any) | undefined;
99
+ }> & import("vue").PublicProps;
100
+ expose: (exposed: import("vue").ShallowUnwrapRef<{
101
+ inputRef: Readonly<import("vue").Ref<HTMLInputElement, HTMLInputElement>>;
102
+ }>) => void;
103
+ attrs: any;
104
+ slots: InputNumberSlots;
105
+ emit: ((evt: "change", event: Event) => void) & ((evt: "blur", event: FocusEvent) => void) & ((evt: "update:modelValue", value: T) => void);
106
+ }>) => import("vue").VNode & {
107
+ __ctx?: Awaited<typeof __VLS_setup>;
108
+ };
211
109
  declare const _default: typeof __VLS_export;
212
110
  export default _default;
213
- type __VLS_WithSlots<T, S> = T & {
214
- new (): {
215
- $slots: S;
216
- };
217
- };
111
+ type __VLS_PrettifyLocal<T> = {
112
+ [K in keyof T as K]: T[K];
113
+ } & {};
@@ -3,10 +3,11 @@ import type { TagsInputRootProps, TagsInputRootEmits, AcceptableInputValue } fro
3
3
  import theme from '#build/b24ui/input-tags';
4
4
  import type { UseComponentIconsProps } from '../composables/useComponentIcons';
5
5
  import type { BadgeProps, IconComponent } from '../types';
6
+ import type { InputHTMLAttributes } from '../types/html';
6
7
  import type { ComponentConfig } from '../types/tv';
7
8
  type InputTags = ComponentConfig<typeof theme, AppConfig, 'inputTags'>;
8
9
  export type InputTagItem = AcceptableInputValue;
9
- export interface InputTagsProps<T extends InputTagItem = InputTagItem> extends Pick<TagsInputRootProps<T>, 'modelValue' | 'defaultValue' | 'addOnPaste' | 'addOnTab' | 'addOnBlur' | 'duplicate' | 'disabled' | 'delimiter' | 'max' | 'id' | 'convertValue' | 'displayValue' | 'name' | 'required'>, UseComponentIconsProps {
10
+ export interface InputTagsProps<T extends InputTagItem = InputTagItem> extends Pick<TagsInputRootProps<T>, 'modelValue' | 'defaultValue' | 'addOnPaste' | 'addOnTab' | 'addOnBlur' | 'duplicate' | 'disabled' | 'delimiter' | 'max' | 'id' | 'convertValue' | 'displayValue' | 'name' | 'required'>, UseComponentIconsProps, /** @vue-ignore */ Omit<InputHTMLAttributes, 'disabled' | 'max' | 'required' | 'name' | 'placeholder' | 'type' | 'autofocus' | 'maxlength' | 'minlength' | 'pattern' | 'size' | 'min' | 'step'> {
10
11
  /**
11
12
  * The element or component this component should render as.
12
13
  * @defaultValue 'div'
@@ -35,7 +36,7 @@ export interface InputTagsProps<T extends InputTagItem = InputTagItem> extends P
35
36
  */
36
37
  underline?: boolean;
37
38
  /**
38
- * Rounds the corners of the button
39
+ * Rounds the corners of the input
39
40
  * @defaultValue false
40
41
  */
41
42
  rounded?: boolean;
@@ -82,8 +83,8 @@ export interface InputTagsSlots<T extends InputTagItem = InputTagItem> {
82
83
  }
83
84
  declare const __VLS_export: <T extends InputTagItem>(__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<{
84
85
  props: __VLS_PrettifyLocal<InputTagsProps<T> & {
85
- onBlur?: ((event: FocusEvent) => any) | undefined;
86
86
  onChange?: ((event: Event) => any) | undefined;
87
+ onBlur?: ((event: FocusEvent) => any) | undefined;
87
88
  onFocus?: ((event: FocusEvent) => any) | undefined;
88
89
  onInvalid?: ((payload: T) => any) | undefined;
89
90
  "onUpdate:modelValue"?: ((payload: T[]) => any) | undefined;
@@ -91,115 +92,11 @@ declare const __VLS_export: <T extends InputTagItem>(__VLS_props: NonNullable<Aw
91
92
  onRemoveTag?: ((payload: T) => any) | undefined;
92
93
  }> & import("vue").PublicProps;
93
94
  expose: (exposed: import("vue").ShallowUnwrapRef<{
94
- inputRef: import("vue").Ref<({
95
- $: import("vue").ComponentInternalInstance;
96
- $data: {};
97
- $props: {
98
- readonly placeholder?: string | undefined;
99
- readonly autoFocus?: boolean | undefined;
100
- readonly maxLength?: number | undefined;
101
- readonly asChild?: boolean | undefined;
102
- readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
103
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
104
- $attrs: {
105
- [x: string]: unknown;
106
- };
107
- $refs: {
108
- [x: string]: unknown;
109
- };
110
- $slots: Readonly<{
111
- [name: string]: import("vue").Slot<any> | undefined;
112
- }>;
113
- $root: import("vue").ComponentPublicInstance | null;
114
- $parent: import("vue").ComponentPublicInstance | null;
115
- $host: Element | null;
116
- $emit: (event: string, ...args: any[]) => void;
117
- $el: any;
118
- $options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").TagsInputInputProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
119
- as: import("reka-ui").AsTag | import("vue").Component;
120
- }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
121
- beforeCreate?: (() => void) | (() => void)[];
122
- created?: (() => void) | (() => void)[];
123
- beforeMount?: (() => void) | (() => void)[];
124
- mounted?: (() => void) | (() => void)[];
125
- beforeUpdate?: (() => void) | (() => void)[];
126
- updated?: (() => void) | (() => void)[];
127
- activated?: (() => void) | (() => void)[];
128
- deactivated?: (() => void) | (() => void)[];
129
- beforeDestroy?: (() => void) | (() => void)[];
130
- beforeUnmount?: (() => void) | (() => void)[];
131
- destroyed?: (() => void) | (() => void)[];
132
- unmounted?: (() => void) | (() => void)[];
133
- renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
134
- renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
135
- errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
136
- };
137
- $forceUpdate: () => void;
138
- $nextTick: typeof import("vue").nextTick;
139
- $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;
140
- } & Readonly<{
141
- as: import("reka-ui").AsTag | import("vue").Component;
142
- }> & Omit<Readonly<import("reka-ui").TagsInputInputProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
143
- $slots: {
144
- default?: (props: {}) => any;
145
- };
146
- }) | null, ({
147
- $: import("vue").ComponentInternalInstance;
148
- $data: {};
149
- $props: {
150
- readonly placeholder?: string | undefined;
151
- readonly autoFocus?: boolean | undefined;
152
- readonly maxLength?: number | undefined;
153
- readonly asChild?: boolean | undefined;
154
- readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
155
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
156
- $attrs: {
157
- [x: string]: unknown;
158
- };
159
- $refs: {
160
- [x: string]: unknown;
161
- };
162
- $slots: Readonly<{
163
- [name: string]: import("vue").Slot<any> | undefined;
164
- }>;
165
- $root: import("vue").ComponentPublicInstance | null;
166
- $parent: import("vue").ComponentPublicInstance | null;
167
- $host: Element | null;
168
- $emit: (event: string, ...args: any[]) => void;
169
- $el: any;
170
- $options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").TagsInputInputProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
171
- as: import("reka-ui").AsTag | import("vue").Component;
172
- }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
173
- beforeCreate?: (() => void) | (() => void)[];
174
- created?: (() => void) | (() => void)[];
175
- beforeMount?: (() => void) | (() => void)[];
176
- mounted?: (() => void) | (() => void)[];
177
- beforeUpdate?: (() => void) | (() => void)[];
178
- updated?: (() => void) | (() => void)[];
179
- activated?: (() => void) | (() => void)[];
180
- deactivated?: (() => void) | (() => void)[];
181
- beforeDestroy?: (() => void) | (() => void)[];
182
- beforeUnmount?: (() => void) | (() => void)[];
183
- destroyed?: (() => void) | (() => void)[];
184
- unmounted?: (() => void) | (() => void)[];
185
- renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
186
- renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
187
- errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
188
- };
189
- $forceUpdate: () => void;
190
- $nextTick: typeof import("vue").nextTick;
191
- $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;
192
- } & Readonly<{
193
- as: import("reka-ui").AsTag | import("vue").Component;
194
- }> & Omit<Readonly<import("reka-ui").TagsInputInputProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
195
- $slots: {
196
- default?: (props: {}) => any;
197
- };
198
- }) | null>;
95
+ inputRef: Readonly<import("vue").Ref<HTMLInputElement, HTMLInputElement>>;
199
96
  }>) => void;
200
97
  attrs: any;
201
98
  slots: InputTagsSlots<T>;
202
- emit: ((evt: "blur", event: FocusEvent) => void) & ((evt: "change", event: Event) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "invalid", payload: T) => void) & ((evt: "update:modelValue", payload: T[]) => void) & ((evt: "addTag", payload: T) => void) & ((evt: "removeTag", payload: T) => void);
99
+ emit: ((evt: "change", event: Event) => void) & ((evt: "blur", event: FocusEvent) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "invalid", payload: T) => void) & ((evt: "update:modelValue", payload: T[]) => void) & ((evt: "addTag", payload: T) => void) & ((evt: "removeTag", payload: T) => void);
203
100
  }>) => import("vue").VNode & {
204
101
  __ctx?: Awaited<typeof __VLS_setup>;
205
102
  };
@@ -3,7 +3,7 @@ import theme from "#build/b24ui/input-tags";
3
3
  </script>
4
4
 
5
5
  <script setup>
6
- import { computed, ref, onMounted, toRaw } from "vue";
6
+ import { computed, useTemplateRef, onMounted, toRaw, toRef } from "vue";
7
7
  import { TagsInputRoot, TagsInputItem, TagsInputItemText, TagsInputItemDelete, TagsInputInput, useForwardPropsEmits } from "reka-ui";
8
8
  import { reactivePick } from "@vueuse/core";
9
9
  import { useAppConfig } from "#imports";
@@ -75,17 +75,17 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.inputTa
75
75
  trailing: Boolean(isTrailing.value || !!slots.trailing),
76
76
  fieldGroup: orientation.value
77
77
  }));
78
- const inputRef = ref(null);
79
- onMounted(() => {
80
- setTimeout(() => {
81
- autoFocus();
82
- }, props.autofocusDelay);
83
- });
78
+ const inputRef = useTemplateRef("inputRef");
84
79
  function autoFocus() {
85
80
  if (props.autofocus) {
86
81
  inputRef.value?.$el?.focus();
87
82
  }
88
83
  }
84
+ onMounted(() => {
85
+ setTimeout(() => {
86
+ autoFocus();
87
+ }, props.autofocusDelay);
88
+ });
89
89
  function onUpdate(value) {
90
90
  if (toRaw(props.modelValue) === value) {
91
91
  return;
@@ -104,7 +104,7 @@ function onFocus(event) {
104
104
  emitFormFocus();
105
105
  }
106
106
  defineExpose({
107
- inputRef
107
+ inputRef: toRef(() => inputRef.value?.$el)
108
108
  });
109
109
  </script>
110
110