@bitrix24/b24ui-nuxt 2.0.9 → 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 (145) hide show
  1. package/dist/meta.d.mts +77776 -42923
  2. package/dist/meta.mjs +77776 -42923
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +3 -3
  5. package/dist/runtime/components/Advice.d.vue.ts +1 -1
  6. package/dist/runtime/components/Advice.vue +1 -3
  7. package/dist/runtime/components/Advice.vue.d.ts +1 -1
  8. package/dist/runtime/components/App.d.vue.ts +1 -1
  9. package/dist/runtime/components/App.vue +2 -1
  10. package/dist/runtime/components/App.vue.d.ts +1 -1
  11. package/dist/runtime/components/Avatar.d.vue.ts +2 -1
  12. package/dist/runtime/components/Avatar.vue.d.ts +2 -1
  13. package/dist/runtime/components/Button.vue +1 -0
  14. package/dist/runtime/components/ChatPrompt.d.vue.ts +2 -2
  15. package/dist/runtime/components/ChatPrompt.vue +5 -5
  16. package/dist/runtime/components/ChatPrompt.vue.d.ts +2 -2
  17. package/dist/runtime/components/ChatPromptSubmit.d.vue.ts +5 -5
  18. package/dist/runtime/components/ChatPromptSubmit.vue +53 -4
  19. package/dist/runtime/components/ChatPromptSubmit.vue.d.ts +5 -5
  20. package/dist/runtime/components/Checkbox.d.vue.ts +2 -1
  21. package/dist/runtime/components/Checkbox.vue.d.ts +2 -1
  22. package/dist/runtime/components/CommandPalette.vue +5 -4
  23. package/dist/runtime/components/DashboardSearch.d.vue.ts +3 -6
  24. package/dist/runtime/components/DashboardSearch.vue +2 -3
  25. package/dist/runtime/components/DashboardSearch.vue.d.ts +3 -6
  26. package/dist/runtime/components/DashboardSearchButton.d.vue.ts +2 -3
  27. package/dist/runtime/components/DashboardSearchButton.vue +44 -6
  28. package/dist/runtime/components/DashboardSearchButton.vue.d.ts +2 -3
  29. package/dist/runtime/components/Error.d.vue.ts +1 -1
  30. package/dist/runtime/components/Error.vue.d.ts +1 -1
  31. package/dist/runtime/components/FileUpload.d.vue.ts +3 -2
  32. package/dist/runtime/components/FileUpload.vue +9 -9
  33. package/dist/runtime/components/FileUpload.vue.d.ts +3 -2
  34. package/dist/runtime/components/Form.d.vue.ts +2 -1
  35. package/dist/runtime/components/Form.vue.d.ts +2 -1
  36. package/dist/runtime/components/Input.d.vue.ts +7 -7
  37. package/dist/runtime/components/Input.vue +2 -2
  38. package/dist/runtime/components/Input.vue.d.ts +7 -7
  39. package/dist/runtime/components/InputDate.d.vue.ts +115 -0
  40. package/dist/runtime/components/InputDate.vue +198 -0
  41. package/dist/runtime/components/InputDate.vue.d.ts +115 -0
  42. package/dist/runtime/components/InputMenu.d.vue.ts +7 -128
  43. package/dist/runtime/components/InputMenu.vue +3 -3
  44. package/dist/runtime/components/InputMenu.vue.d.ts +7 -128
  45. package/dist/runtime/components/InputNumber.d.vue.ts +25 -124
  46. package/dist/runtime/components/InputNumber.vue +3 -3
  47. package/dist/runtime/components/InputNumber.vue.d.ts +25 -124
  48. package/dist/runtime/components/InputTags.d.vue.ts +6 -109
  49. package/dist/runtime/components/InputTags.vue +8 -8
  50. package/dist/runtime/components/InputTags.vue.d.ts +6 -109
  51. package/dist/runtime/components/InputTime.d.vue.ts +99 -0
  52. package/dist/runtime/components/InputTime.vue +170 -0
  53. package/dist/runtime/components/InputTime.vue.d.ts +99 -0
  54. package/dist/runtime/components/Link.d.vue.ts +4 -49
  55. package/dist/runtime/components/Link.vue +1 -0
  56. package/dist/runtime/components/Link.vue.d.ts +4 -49
  57. package/dist/runtime/components/Modal.d.vue.ts +1 -1
  58. package/dist/runtime/components/Modal.vue.d.ts +1 -1
  59. package/dist/runtime/components/Pagination.d.vue.ts +2 -2
  60. package/dist/runtime/components/Pagination.vue.d.ts +2 -2
  61. package/dist/runtime/components/PinInput.d.vue.ts +3 -3
  62. package/dist/runtime/components/PinInput.vue.d.ts +3 -3
  63. package/dist/runtime/components/Progress.d.vue.ts +1 -1
  64. package/dist/runtime/components/Progress.vue.d.ts +1 -1
  65. package/dist/runtime/components/Select.d.vue.ts +6 -107
  66. package/dist/runtime/components/Select.vue +3 -3
  67. package/dist/runtime/components/Select.vue.d.ts +6 -107
  68. package/dist/runtime/components/SelectMenu.d.vue.ts +7 -106
  69. package/dist/runtime/components/SelectMenu.vue +3 -3
  70. package/dist/runtime/components/SelectMenu.vue.d.ts +7 -106
  71. package/dist/runtime/components/Slideover.d.vue.ts +1 -1
  72. package/dist/runtime/components/Slideover.vue.d.ts +1 -1
  73. package/dist/runtime/components/Switch.d.vue.ts +2 -1
  74. package/dist/runtime/components/Switch.vue.d.ts +2 -1
  75. package/dist/runtime/components/Table.d.vue.ts +5 -4
  76. package/dist/runtime/components/Table.vue +4 -3
  77. package/dist/runtime/components/Table.vue.d.ts +5 -4
  78. package/dist/runtime/components/Textarea.d.vue.ts +7 -6
  79. package/dist/runtime/components/Textarea.vue +2 -2
  80. package/dist/runtime/components/Textarea.vue.d.ts +7 -6
  81. package/dist/runtime/components/Toast.vue +5 -5
  82. package/dist/runtime/components/Toaster.d.vue.ts +1 -1
  83. package/dist/runtime/components/Toaster.vue.d.ts +1 -1
  84. package/dist/runtime/components/color-mode/ColorModeAvatar.d.vue.ts +3 -3
  85. package/dist/runtime/components/color-mode/ColorModeAvatar.vue +16 -4
  86. package/dist/runtime/components/color-mode/ColorModeAvatar.vue.d.ts +3 -3
  87. package/dist/runtime/components/color-mode/ColorModeButton.d.vue.ts +3 -3
  88. package/dist/runtime/components/color-mode/ColorModeButton.vue +54 -6
  89. package/dist/runtime/components/color-mode/ColorModeButton.vue.d.ts +3 -3
  90. package/dist/runtime/components/color-mode/ColorModeImage.d.vue.ts +4 -3
  91. package/dist/runtime/components/color-mode/ColorModeImage.vue +4 -0
  92. package/dist/runtime/components/color-mode/ColorModeImage.vue.d.ts +4 -3
  93. package/dist/runtime/components/color-mode/ColorModeSelect.d.vue.ts +5 -3
  94. package/dist/runtime/components/color-mode/ColorModeSelect.vue +47 -5
  95. package/dist/runtime/components/color-mode/ColorModeSelect.vue.d.ts +5 -3
  96. package/dist/runtime/components/color-mode/ColorModeSwitch.d.vue.ts +2 -2
  97. package/dist/runtime/components/color-mode/ColorModeSwitch.vue +29 -5
  98. package/dist/runtime/components/color-mode/ColorModeSwitch.vue.d.ts +2 -2
  99. package/dist/runtime/components/content/ContentSearch.d.vue.ts +3 -6
  100. package/dist/runtime/components/content/ContentSearch.vue +2 -3
  101. package/dist/runtime/components/content/ContentSearch.vue.d.ts +3 -6
  102. package/dist/runtime/components/content/ContentSearchButton.d.vue.ts +2 -3
  103. package/dist/runtime/components/content/ContentSearchButton.vue +43 -5
  104. package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +2 -3
  105. package/dist/runtime/components/content/ContentSurround.vue +7 -1
  106. package/dist/runtime/components/locale/LocaleSelect.d.vue.ts +11 -7
  107. package/dist/runtime/components/locale/LocaleSelect.vue +50 -6
  108. package/dist/runtime/components/locale/LocaleSelect.vue.d.ts +11 -7
  109. package/dist/runtime/components/prose/Callout.vue +4 -0
  110. package/dist/runtime/composables/index.d.ts +8 -0
  111. package/dist/runtime/composables/index.js +8 -0
  112. package/dist/runtime/composables/useFileUpload.d.ts +2 -1
  113. package/dist/runtime/composables/useFileUpload.js +13 -4
  114. package/dist/runtime/inertia/components/Link.d.vue.ts +17 -10
  115. package/dist/runtime/inertia/components/Link.vue +8 -6
  116. package/dist/runtime/inertia/components/Link.vue.d.ts +17 -10
  117. package/dist/runtime/inertia/stubs.d.ts +1 -1
  118. package/dist/runtime/types/html.d.ts +8 -0
  119. package/dist/runtime/types/html.js +0 -0
  120. package/dist/runtime/types/index.d.ts +2 -0
  121. package/dist/runtime/types/index.js +2 -0
  122. package/dist/runtime/types/input.d.ts +5 -5
  123. package/dist/runtime/types/utils.d.ts +2 -0
  124. package/dist/runtime/utils/content.d.ts +2 -2
  125. package/dist/runtime/utils/dashboard.d.ts +1 -1
  126. package/dist/runtime/utils/link.d.ts +1 -0
  127. package/dist/runtime/utils/link.js +40 -24
  128. package/dist/runtime/vue/components/Link.d.vue.ts +8 -37
  129. package/dist/runtime/vue/components/Link.vue +6 -11
  130. package/dist/runtime/vue/components/Link.vue.d.ts +8 -37
  131. package/dist/runtime/vue/components/color-mode/ColorModeButton.d.vue.ts +2 -2
  132. package/dist/runtime/vue/components/color-mode/ColorModeButton.vue +55 -5
  133. package/dist/runtime/vue/components/color-mode/ColorModeButton.vue.d.ts +2 -2
  134. package/dist/runtime/vue/components/color-mode/ColorModeSelect.d.vue.ts +5 -3
  135. package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue +46 -3
  136. package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue.d.ts +5 -3
  137. package/dist/runtime/vue/components/color-mode/ColorModeSwitch.d.vue.ts +1 -1
  138. package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue +24 -3
  139. package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue.d.ts +1 -1
  140. package/dist/runtime/vue/stubs.d.ts +2 -2
  141. package/dist/runtime/vue/stubs.js +1 -1
  142. package/dist/shared/{b24ui-nuxt.4XNR9Ysu.mjs → b24ui-nuxt.CXLCGBie.mjs} +135 -1
  143. package/dist/unplugin.mjs +1 -1
  144. package/dist/vite.mjs +1 -1
  145. package/package.json +24 -14
@@ -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
 
@@ -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
  };
@@ -0,0 +1,99 @@
1
+ import type { ComponentPublicInstance } from 'vue';
2
+ import type { TimeFieldRootProps, TimeFieldRootEmits } from 'reka-ui';
3
+ import type { AppConfig } from '@nuxt/schema';
4
+ import theme from '#build/b24ui/input-time';
5
+ import type { UseComponentIconsProps } from '../composables/useComponentIcons';
6
+ import type { BadgeProps } from '../types';
7
+ import type { ComponentConfig } from '../types/tv';
8
+ type InputTime = ComponentConfig<typeof theme, AppConfig, 'inputTime'>;
9
+ export interface InputTimeProps extends Omit<TimeFieldRootProps, 'as' | 'asChild' | 'locale' | 'dir'>, UseComponentIconsProps {
10
+ /**
11
+ * The element or component this component should render as.
12
+ * @defaultValue 'div'
13
+ */
14
+ as?: any;
15
+ /**
16
+ * @defaultValue 'air-primary'
17
+ */
18
+ color?: InputTime['variants']['color'];
19
+ /**
20
+ * @defaultValue 'md'
21
+ */
22
+ size?: InputTime['variants']['size'];
23
+ /**
24
+ * Removes padding from input
25
+ * @defaultValue false
26
+ */
27
+ noPadding?: boolean;
28
+ /**
29
+ * Removes all borders (rings)
30
+ * @defaultValue false
31
+ */
32
+ noBorder?: boolean;
33
+ /**
34
+ * Removes all borders (rings) except the bottom one
35
+ * @defaultValue false
36
+ */
37
+ underline?: boolean;
38
+ /**
39
+ * Rounds the corners of the input
40
+ * @defaultValue false
41
+ */
42
+ rounded?: boolean;
43
+ tag?: string;
44
+ /**
45
+ * @defaultValue 'air-primary'
46
+ */
47
+ tagColor?: BadgeProps['color'];
48
+ /** Highlight the ring color like a focus state. */
49
+ highlight?: boolean;
50
+ autofocus?: boolean;
51
+ autofocusDelay?: number;
52
+ /**
53
+ * The locale to use for formatting and parsing numbers.
54
+ * @defaultValue B24App.locale.code
55
+ */
56
+ locale?: string;
57
+ class?: any;
58
+ b24ui?: InputTime['slots'];
59
+ }
60
+ export interface InputTimeEmits extends TimeFieldRootEmits {
61
+ change: [event: Event];
62
+ blur: [event: FocusEvent];
63
+ focus: [event: FocusEvent];
64
+ }
65
+ export interface InputTimeSlots {
66
+ leading(props: {
67
+ b24ui: InputTime['b24ui'];
68
+ }): any;
69
+ default(props: {
70
+ b24ui: InputTime['b24ui'];
71
+ }): any;
72
+ trailing(props: {
73
+ b24ui: InputTime['b24ui'];
74
+ }): any;
75
+ }
76
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<InputTimeProps, {
77
+ inputsRef: import("vue").Ref<ComponentPublicInstance[], ComponentPublicInstance[]>;
78
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
79
+ change: (event: Event) => any;
80
+ blur: (event: FocusEvent) => any;
81
+ focus: (event: FocusEvent) => any;
82
+ "update:modelValue": (date: (import("@internationalized/date").CalendarDateTime | import("@internationalized/date").ZonedDateTime | import("@internationalized/date").Time) | undefined) => any;
83
+ "update:placeholder": (date: import("@internationalized/date").CalendarDateTime | import("@internationalized/date").ZonedDateTime | import("@internationalized/date").Time) => any;
84
+ }, string, import("vue").PublicProps, Readonly<InputTimeProps> & Readonly<{
85
+ onChange?: ((event: Event) => any) | undefined;
86
+ onBlur?: ((event: FocusEvent) => any) | undefined;
87
+ onFocus?: ((event: FocusEvent) => any) | undefined;
88
+ "onUpdate:modelValue"?: ((date: (import("@internationalized/date").CalendarDateTime | import("@internationalized/date").ZonedDateTime | import("@internationalized/date").Time) | undefined) => any) | undefined;
89
+ "onUpdate:placeholder"?: ((date: import("@internationalized/date").CalendarDateTime | import("@internationalized/date").ZonedDateTime | import("@internationalized/date").Time) => any) | undefined;
90
+ }>, {
91
+ autofocusDelay: number;
92
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, InputTimeSlots>;
93
+ declare const _default: typeof __VLS_export;
94
+ export default _default;
95
+ type __VLS_WithSlots<T, S> = T & {
96
+ new (): {
97
+ $slots: S;
98
+ };
99
+ };
@@ -0,0 +1,170 @@
1
+ <script>
2
+ import theme from "#build/b24ui/input-time";
3
+ </script>
4
+
5
+ <script setup>
6
+ import { computed, onMounted, ref } from "vue";
7
+ import { TimeFieldRoot, TimeFieldInput, useForwardPropsEmits } from "reka-ui";
8
+ import { reactiveOmit } from "@vueuse/core";
9
+ import { useAppConfig } from "#imports";
10
+ import { useFieldGroup } from "../composables/useFieldGroup";
11
+ import { useComponentIcons } from "../composables/useComponentIcons";
12
+ import { useFormField } from "../composables/useFormField";
13
+ import { useLocale } from "../composables/useLocale";
14
+ import { tv } from "../utils/tv";
15
+ import B24Badge from "./Badge.vue";
16
+ import B24Avatar from "./Avatar.vue";
17
+ const props = defineProps({
18
+ as: { type: null, required: false },
19
+ color: { type: null, required: false },
20
+ size: { type: null, required: false },
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
+ autofocus: { type: Boolean, required: false },
29
+ autofocusDelay: { type: Number, required: false, default: 0 },
30
+ locale: { type: String, required: false },
31
+ class: { type: null, required: false },
32
+ b24ui: { type: null, required: false },
33
+ defaultValue: { type: Object, required: false },
34
+ defaultPlaceholder: { type: Object, required: false },
35
+ placeholder: { type: Object, required: false },
36
+ modelValue: { type: [Object, null], required: false },
37
+ hourCycle: { type: null, required: false },
38
+ step: { type: Object, required: false },
39
+ granularity: { type: String, required: false },
40
+ hideTimeZone: { type: Boolean, required: false },
41
+ maxValue: { type: Object, required: false },
42
+ minValue: { type: Object, required: false },
43
+ disabled: { type: Boolean, required: false },
44
+ readonly: { type: Boolean, required: false },
45
+ id: { type: String, required: false },
46
+ name: { type: String, required: false },
47
+ required: { type: Boolean, required: false },
48
+ icon: { type: [Function, Object], required: false },
49
+ avatar: { type: Object, required: false },
50
+ loading: { type: Boolean, required: false },
51
+ trailing: { type: Boolean, required: false },
52
+ trailingIcon: { type: [Function, Object], required: false }
53
+ });
54
+ const emits = defineEmits(["change", "blur", "focus", "update:modelValue", "update:placeholder"]);
55
+ const slots = defineSlots();
56
+ const { code: codeLocale, dir } = useLocale();
57
+ const appConfig = useAppConfig();
58
+ const rootProps = useForwardPropsEmits(reactiveOmit(props, "id", "name", "color", "size", "highlight", "disabled", "autofocus", "autofocusDelay", "locale", "icon", "avatar", "trailingIcon", "loading", "class", "b24ui"), emits);
59
+ const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, id, color, size: formGroupSize, name, highlight, disabled, ariaAttrs } = useFormField(props);
60
+ const { orientation, size: fieldGroupSize } = useFieldGroup(props);
61
+ const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(props);
62
+ const locale = computed(() => props.locale || codeLocale.value);
63
+ const inputSize = computed(() => fieldGroupSize.value || formGroupSize.value);
64
+ const isTag = computed(() => {
65
+ return props.tag;
66
+ });
67
+ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.inputTime || {} })({
68
+ color: color.value,
69
+ size: inputSize.value,
70
+ loading: props.loading,
71
+ highlight: highlight.value,
72
+ rounded: Boolean(props.rounded),
73
+ noPadding: Boolean(props.noPadding),
74
+ noBorder: Boolean(props.noBorder),
75
+ underline: Boolean(props.underline),
76
+ leading: Boolean(isLeading.value || !!props.avatar || !!slots.leading),
77
+ trailing: Boolean(isTrailing.value || !!slots.trailing),
78
+ fieldGroup: orientation.value
79
+ }));
80
+ const inputsRef = ref([]);
81
+ function onUpdate(value) {
82
+ const event = new Event("change", { target: { value } });
83
+ emits("change", event);
84
+ emitFormChange();
85
+ emitFormInput();
86
+ }
87
+ function onBlur(event) {
88
+ emitFormBlur();
89
+ emits("blur", event);
90
+ }
91
+ function onFocus(event) {
92
+ emitFormFocus();
93
+ emits("focus", event);
94
+ }
95
+ function autoFocus() {
96
+ if (props.autofocus) {
97
+ inputsRef.value[0]?.$el?.focus();
98
+ }
99
+ }
100
+ onMounted(() => {
101
+ setTimeout(() => {
102
+ autoFocus();
103
+ }, props.autofocusDelay);
104
+ });
105
+ defineExpose({
106
+ inputsRef
107
+ });
108
+ </script>
109
+
110
+ <template>
111
+ <TimeFieldRoot
112
+ v-bind="{ ...rootProps, ...ariaAttrs }"
113
+ :id="id"
114
+ v-slot="{ segments }"
115
+ :name="name"
116
+ :disabled="disabled"
117
+ :locale="locale"
118
+ :dir="dir"
119
+ :class="b24ui.base({ class: [props.b24ui?.base, props.class] })"
120
+ @update:model-value="onUpdate"
121
+ @blur="onBlur"
122
+ @focus="onFocus"
123
+ >
124
+ <B24Badge
125
+ v-if="isTag"
126
+ :class="b24ui.tag({ class: props.b24ui?.tag })"
127
+ :color="props.tagColor"
128
+ :label="props.tag"
129
+ size="xs"
130
+ />
131
+
132
+ <TimeFieldInput
133
+ v-for="(segment, index) in segments"
134
+ :key="`${segment.part}-${index}`"
135
+ :ref="(el) => inputsRef[index] = el"
136
+ :part="segment.part"
137
+ :class="b24ui.segment({ class: props.b24ui?.segment })"
138
+ >
139
+ {{ segment.value.trim() }}
140
+ </TimeFieldInput>
141
+
142
+ <slot :b24ui="b24ui" />
143
+
144
+ <span v-if="isLeading || !!avatar || !!slots.leading" :class="b24ui.leading({ class: props.b24ui?.leading })">
145
+ <slot name="leading" :b24ui="b24ui">
146
+ <Component
147
+ :is="leadingIconName"
148
+ v-if="isLeading && leadingIconName"
149
+ :class="b24ui.leadingIcon({ class: props.b24ui?.leadingIcon })"
150
+ />
151
+ <B24Avatar
152
+ v-else-if="!!avatar"
153
+ :size="props.b24ui?.leadingAvatarSize || b24ui.leadingAvatarSize()"
154
+ v-bind="avatar"
155
+ :class="b24ui.leadingAvatar({ class: props.b24ui?.leadingAvatar })"
156
+ />
157
+ </slot>
158
+ </span>
159
+
160
+ <span v-if="isTrailing || !!slots.trailing" :class="b24ui.trailing({ class: props.b24ui?.trailing })">
161
+ <slot name="trailing" :b24ui="b24ui">
162
+ <Component
163
+ :is="trailingIconName"
164
+ v-if="trailingIconName"
165
+ :class="b24ui.trailingIcon({ class: props.b24ui?.trailingIcon })"
166
+ />
167
+ </slot>
168
+ </span>
169
+ </TimeFieldRoot>
170
+ </template>