sprintify-ui 0.0.41 → 0.0.42

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 (89) hide show
  1. package/dist/sprintify-ui.es.js +6033 -5518
  2. package/dist/types/src/components/BaseAutocomplete.vue.d.ts +32 -12
  3. package/dist/types/src/components/BaseAutocompleteFetch.vue.d.ts +28 -28
  4. package/dist/types/src/components/BaseBelongsTo.vue.d.ts +35 -35
  5. package/dist/types/src/components/BaseButtonGroup.vue.d.ts +46 -8
  6. package/dist/types/src/components/BaseDatePicker.vue.d.ts +18 -9
  7. package/dist/types/src/components/BaseDateSelect.vue.d.ts +14 -5
  8. package/dist/types/src/components/BaseField.vue.d.ts +151 -0
  9. package/dist/types/src/components/BaseFieldI18n.vue.d.ts +93 -0
  10. package/dist/types/src/components/BaseForm.vue.d.ts +267 -0
  11. package/dist/types/src/components/BaseFormField.d.ts +81 -0
  12. package/dist/types/src/components/BaseHasMany.vue.d.ts +31 -31
  13. package/dist/types/src/components/BaseInput.vue.d.ts +1 -1
  14. package/dist/types/src/components/BaseInputError.vue.d.ts +48 -0
  15. package/dist/types/src/components/BaseInputPercent.vue.d.ts +1 -1
  16. package/dist/types/src/components/BaseLocaleForm.vue.d.ts +420 -0
  17. package/dist/types/src/components/BaseMediaLibrary.vue.d.ts +46 -24
  18. package/dist/types/src/components/BaseNumberForm.vue.d.ts +382 -0
  19. package/dist/types/src/components/BasePassword.vue.d.ts +10 -14
  20. package/dist/types/src/components/BasePasswordForm.vue.d.ts +365 -0
  21. package/dist/types/src/components/BaseRadioGroup.vue.d.ts +23 -4
  22. package/dist/types/src/components/BaseSelect.vue.d.ts +20 -1
  23. package/dist/types/src/components/BaseSwitch.vue.d.ts +155 -23
  24. package/dist/types/src/components/BaseTagAutocomplete.vue.d.ts +31 -12
  25. package/dist/types/src/components/BaseTagAutocompleteFetch.vue.d.ts +20 -20
  26. package/dist/types/src/components/BaseTextarea.vue.d.ts +9 -0
  27. package/dist/types/src/components/BaseTextareaAutoresize.vue.d.ts +18 -0
  28. package/dist/types/src/components/BaseTextareaForm.vue.d.ts +394 -0
  29. package/dist/types/src/components/index.d.ts +4 -1
  30. package/dist/types/src/composables/field.d.ts +17 -0
  31. package/dist/types/src/index.d.ts +3 -0
  32. package/dist/types/src/types/index.d.ts +11 -0
  33. package/package.json +4 -1
  34. package/src/components/BaseAutocomplete.stories.js +56 -51
  35. package/src/components/BaseAutocomplete.vue +25 -8
  36. package/src/components/BaseAutocompleteFetch.stories.js +67 -65
  37. package/src/components/BaseAutocompleteFetch.vue +9 -29
  38. package/src/components/BaseBelongsTo.stories.js +72 -82
  39. package/src/components/BaseBelongsTo.vue +10 -11
  40. package/src/components/BaseButtonGroup.stories.js +11 -10
  41. package/src/components/BaseButtonGroup.vue +22 -9
  42. package/src/components/BaseCharacterCounter.stories.js +1 -1
  43. package/src/components/BaseDatePicker.stories.js +13 -9
  44. package/src/components/BaseDatePicker.vue +25 -8
  45. package/src/components/BaseDateSelect.stories.js +15 -9
  46. package/src/components/BaseDateSelect.vue +20 -8
  47. package/src/components/BaseField.vue +109 -0
  48. package/src/components/BaseFieldI18n.stories.js +38 -0
  49. package/src/components/BaseFieldI18n.vue +162 -0
  50. package/src/components/BaseFileUploader.stories.js +3 -3
  51. package/src/components/BaseFileUploader.vue +3 -3
  52. package/src/components/BaseForm.vue +298 -0
  53. package/src/components/BaseFormField.ts +117 -0
  54. package/src/components/BaseHasMany.stories.js +25 -10
  55. package/src/components/BaseHasMany.vue +9 -9
  56. package/src/components/BaseInput.stories.js +27 -14
  57. package/src/components/BaseInput.vue +17 -8
  58. package/src/components/BaseInputError.vue +7 -0
  59. package/src/components/BaseInputPercent.stories.js +10 -3
  60. package/src/components/BaseInputPercent.vue +2 -1
  61. package/src/components/BaseLocaleForm.vue +142 -0
  62. package/src/components/BaseMediaLibrary.stories.js +7 -6
  63. package/src/components/BaseMediaLibrary.vue +32 -31
  64. package/src/components/BaseMenu.vue +1 -1
  65. package/src/components/BaseNumberForm.vue +67 -0
  66. package/src/components/BasePassword.stories.js +9 -4
  67. package/src/components/BasePassword.vue +49 -44
  68. package/src/components/BasePasswordForm.vue +59 -0
  69. package/src/components/BaseRadioGroup.stories.js +9 -8
  70. package/src/components/BaseRadioGroup.vue +17 -3
  71. package/src/components/BaseSelect.stories.js +15 -2
  72. package/src/components/BaseSelect.vue +26 -10
  73. package/src/components/BaseSwitch.stories.js +7 -0
  74. package/src/components/BaseSwitch.vue +134 -124
  75. package/src/components/BaseTagAutocomplete.stories.js +21 -14
  76. package/src/components/BaseTagAutocomplete.vue +25 -14
  77. package/src/components/BaseTagAutocompleteFetch.stories.js +37 -21
  78. package/src/components/BaseTagAutocompleteFetch.vue +5 -5
  79. package/src/components/BaseTextarea.stories.js +11 -3
  80. package/src/components/BaseTextarea.vue +20 -6
  81. package/src/components/BaseTextareaAutoresize.stories.js +11 -2
  82. package/src/components/BaseTextareaAutoresize.vue +28 -4
  83. package/src/components/BaseTextareaForm.vue +101 -0
  84. package/src/components/BaseTimeline.vue +1 -1
  85. package/src/components/BaseTimelineItem.vue +4 -4
  86. package/src/components/index.ts +6 -0
  87. package/src/composables/field.ts +100 -0
  88. package/src/index.ts +11 -1
  89. package/src/types/index.ts +12 -0
@@ -0,0 +1,394 @@
1
+ import { PropType } from 'vue';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ modelValue: {
4
+ required: true;
5
+ type: PropType<string | null>;
6
+ };
7
+ type: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ rows: {
12
+ default: number;
13
+ type: NumberConstructor;
14
+ };
15
+ min: {
16
+ default: undefined;
17
+ type: NumberConstructor;
18
+ };
19
+ max: {
20
+ default: undefined;
21
+ type: NumberConstructor;
22
+ };
23
+ }, unknown, unknown, {
24
+ normalizedModelValue(): string;
25
+ }, {
26
+ transformInputValue(event: Event | null): string | null;
27
+ }, import("vue").ComponentOptionsMixin, import("vue").DefineComponent<{
28
+ name: {
29
+ required: true;
30
+ type: StringConstructor;
31
+ };
32
+ placeholder: {
33
+ default: string;
34
+ type: StringConstructor;
35
+ };
36
+ label: {
37
+ default: string;
38
+ type: StringConstructor;
39
+ };
40
+ disabled: {
41
+ type: BooleanConstructor;
42
+ default: boolean;
43
+ };
44
+ required: {
45
+ default: boolean;
46
+ type: BooleanConstructor;
47
+ };
48
+ autofocus: {
49
+ default: boolean;
50
+ type: BooleanConstructor;
51
+ };
52
+ preventSubmit: {
53
+ default: boolean;
54
+ type: BooleanConstructor;
55
+ };
56
+ }, unknown, unknown, {
57
+ form(): ({
58
+ new (...args: any[]): {
59
+ $: import("vue").ComponentInternalInstance;
60
+ $data: {};
61
+ $props: Partial<{
62
+ axiosInstance: import("axios").AxiosInstance | null;
63
+ format: import("../types").DataFormat;
64
+ beforeSubmit: (next: () => void) => void;
65
+ successHandler: (response: any) => void;
66
+ errorHandler: (error: import("axios").AxiosError<any, any>) => void;
67
+ loadingMaskClass: string;
68
+ }> & Omit<Readonly<import("vue").ExtractPropTypes<{
69
+ url: {
70
+ required: true;
71
+ type: StringConstructor;
72
+ };
73
+ method: {
74
+ required: true;
75
+ type: PropType<import("../types").Method>;
76
+ validator: (value: string) => boolean;
77
+ };
78
+ data: {
79
+ required: true;
80
+ type: PropType<Record<string, any>>;
81
+ };
82
+ axiosInstance: {
83
+ default: null;
84
+ type: PropType<import("axios").AxiosInstance | null>;
85
+ };
86
+ format: {
87
+ type: PropType<import("../types").DataFormat>;
88
+ default: import("../types").DataFormat;
89
+ validator: (value: string) => boolean;
90
+ };
91
+ beforeSubmit: {
92
+ default: (next: () => void) => void;
93
+ type: PropType<(next: () => void) => void>;
94
+ };
95
+ successHandler: {
96
+ default: undefined;
97
+ type: PropType<(response: any) => void>;
98
+ };
99
+ errorHandler: {
100
+ default: (error: import("axios").AxiosError<any, any>) => void;
101
+ type: PropType<(error: import("axios").AxiosError<any, any>) => void>;
102
+ };
103
+ loadingMaskClass: {
104
+ default: string;
105
+ type: StringConstructor;
106
+ };
107
+ }>> & {
108
+ onError?: ((...args: any[]) => any) | undefined;
109
+ onSuccess?: ((...args: any[]) => any) | undefined;
110
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "axiosInstance" | "format" | "beforeSubmit" | "successHandler" | "errorHandler" | "loadingMaskClass">;
111
+ $attrs: {
112
+ [x: string]: unknown;
113
+ };
114
+ $refs: {
115
+ [x: string]: unknown;
116
+ };
117
+ $slots: Readonly<{
118
+ [name: string]: import("vue").Slot | undefined;
119
+ }>;
120
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
121
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
122
+ $emit: (event: "success" | "error", ...args: any[]) => void;
123
+ $el: any;
124
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
125
+ url: {
126
+ required: true;
127
+ type: StringConstructor;
128
+ };
129
+ method: {
130
+ required: true;
131
+ type: PropType<import("../types").Method>;
132
+ validator: (value: string) => boolean;
133
+ };
134
+ data: {
135
+ required: true;
136
+ type: PropType<Record<string, any>>;
137
+ };
138
+ axiosInstance: {
139
+ default: null;
140
+ type: PropType<import("axios").AxiosInstance | null>;
141
+ };
142
+ format: {
143
+ type: PropType<import("../types").DataFormat>;
144
+ default: import("../types").DataFormat;
145
+ validator: (value: string) => boolean;
146
+ };
147
+ beforeSubmit: {
148
+ default: (next: () => void) => void;
149
+ type: PropType<(next: () => void) => void>;
150
+ };
151
+ successHandler: {
152
+ default: undefined;
153
+ type: PropType<(response: any) => void>;
154
+ };
155
+ errorHandler: {
156
+ default: (error: import("axios").AxiosError<any, any>) => void;
157
+ type: PropType<(error: import("axios").AxiosError<any, any>) => void>;
158
+ };
159
+ loadingMaskClass: {
160
+ default: string;
161
+ type: StringConstructor;
162
+ };
163
+ }>> & {
164
+ onError?: ((...args: any[]) => any) | undefined;
165
+ onSuccess?: ((...args: any[]) => any) | undefined;
166
+ }, {
167
+ submit: () => void;
168
+ errors: import("vue").Ref<Record<string, string[]>>;
169
+ hasErrors: import("vue").ComputedRef<boolean>;
170
+ clearErrors: (name?: null) => void;
171
+ disabled: import("vue").Ref<boolean>;
172
+ loading: import("vue").Ref<boolean>;
173
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("success" | "error")[], string, {
174
+ axiosInstance: import("axios").AxiosInstance | null;
175
+ format: import("../types").DataFormat;
176
+ beforeSubmit: (next: () => void) => void;
177
+ successHandler: (response: any) => void;
178
+ errorHandler: (error: import("axios").AxiosError<any, any>) => void;
179
+ loadingMaskClass: string;
180
+ }, {}, string> & {
181
+ beforeCreate?: ((() => void) | (() => void)[]) | undefined;
182
+ created?: ((() => void) | (() => void)[]) | undefined;
183
+ beforeMount?: ((() => void) | (() => void)[]) | undefined;
184
+ mounted?: ((() => void) | (() => void)[]) | undefined;
185
+ beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
186
+ updated?: ((() => void) | (() => void)[]) | undefined;
187
+ activated?: ((() => void) | (() => void)[]) | undefined;
188
+ deactivated?: ((() => void) | (() => void)[]) | undefined;
189
+ beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
190
+ beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
191
+ destroyed?: ((() => void) | (() => void)[]) | undefined;
192
+ unmounted?: ((() => void) | (() => void)[]) | undefined;
193
+ renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
194
+ renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
195
+ errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void)[]) | undefined;
196
+ };
197
+ $forceUpdate: () => void;
198
+ $nextTick: typeof import("vue").nextTick;
199
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
200
+ } & Readonly<import("vue").ExtractPropTypes<{
201
+ url: {
202
+ required: true;
203
+ type: StringConstructor;
204
+ };
205
+ method: {
206
+ required: true;
207
+ type: PropType<import("../types").Method>;
208
+ validator: (value: string) => boolean;
209
+ };
210
+ data: {
211
+ required: true;
212
+ type: PropType<Record<string, any>>;
213
+ };
214
+ axiosInstance: {
215
+ default: null;
216
+ type: PropType<import("axios").AxiosInstance | null>;
217
+ };
218
+ format: {
219
+ type: PropType<import("../types").DataFormat>;
220
+ default: import("../types").DataFormat;
221
+ validator: (value: string) => boolean;
222
+ };
223
+ beforeSubmit: {
224
+ default: (next: () => void) => void;
225
+ type: PropType<(next: () => void) => void>;
226
+ };
227
+ successHandler: {
228
+ default: undefined;
229
+ type: PropType<(response: any) => void>;
230
+ };
231
+ errorHandler: {
232
+ default: (error: import("axios").AxiosError<any, any>) => void;
233
+ type: PropType<(error: import("axios").AxiosError<any, any>) => void>;
234
+ };
235
+ loadingMaskClass: {
236
+ default: string;
237
+ type: StringConstructor;
238
+ };
239
+ }>> & {
240
+ onError?: ((...args: any[]) => any) | undefined;
241
+ onSuccess?: ((...args: any[]) => any) | undefined;
242
+ } & import("vue").ShallowUnwrapRef<{
243
+ submit: () => void;
244
+ errors: import("vue").Ref<Record<string, string[]>>;
245
+ hasErrors: import("vue").ComputedRef<boolean>;
246
+ clearErrors: (name?: null) => void;
247
+ disabled: import("vue").Ref<boolean>;
248
+ loading: import("vue").Ref<boolean>;
249
+ }> & {} & import("vue").ComponentCustomProperties & {};
250
+ __isFragment?: undefined;
251
+ __isTeleport?: undefined;
252
+ __isSuspense?: undefined;
253
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
254
+ url: {
255
+ required: true;
256
+ type: StringConstructor;
257
+ };
258
+ method: {
259
+ required: true;
260
+ type: PropType<import("../types").Method>;
261
+ validator: (value: string) => boolean;
262
+ };
263
+ data: {
264
+ required: true;
265
+ type: PropType<Record<string, any>>;
266
+ };
267
+ axiosInstance: {
268
+ default: null;
269
+ type: PropType<import("axios").AxiosInstance | null>;
270
+ };
271
+ format: {
272
+ type: PropType<import("../types").DataFormat>;
273
+ default: import("../types").DataFormat;
274
+ validator: (value: string) => boolean;
275
+ };
276
+ beforeSubmit: {
277
+ default: (next: () => void) => void;
278
+ type: PropType<(next: () => void) => void>;
279
+ };
280
+ successHandler: {
281
+ default: undefined;
282
+ type: PropType<(response: any) => void>;
283
+ };
284
+ errorHandler: {
285
+ default: (error: import("axios").AxiosError<any, any>) => void;
286
+ type: PropType<(error: import("axios").AxiosError<any, any>) => void>;
287
+ };
288
+ loadingMaskClass: {
289
+ default: string;
290
+ type: StringConstructor;
291
+ };
292
+ }>> & {
293
+ onError?: ((...args: any[]) => any) | undefined;
294
+ onSuccess?: ((...args: any[]) => any) | undefined;
295
+ }, {
296
+ submit: () => void;
297
+ errors: import("vue").Ref<Record<string, string[]>>;
298
+ hasErrors: import("vue").ComputedRef<boolean>;
299
+ clearErrors: (name?: null) => void;
300
+ disabled: import("vue").Ref<boolean>;
301
+ loading: import("vue").Ref<boolean>;
302
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("success" | "error")[], "success" | "error", {
303
+ axiosInstance: import("axios").AxiosInstance | null;
304
+ format: import("../types").DataFormat;
305
+ beforeSubmit: (next: () => void) => void;
306
+ successHandler: (response: any) => void;
307
+ errorHandler: (error: import("axios").AxiosError<any, any>) => void;
308
+ loadingMaskClass: string;
309
+ }, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
310
+ $slots: {
311
+ default: (_: {
312
+ errors: Record<string, string[]>;
313
+ loading: boolean;
314
+ disabled: boolean;
315
+ submit: () => void;
316
+ }) => any;
317
+ loading: (_: {}) => any;
318
+ };
319
+ })) | null;
320
+ errors(): any;
321
+ labelValue(): string;
322
+ }, {
323
+ inputListener(payload: any): void;
324
+ errorMessage(name?: string | null): any;
325
+ hasError(name?: string | null): boolean;
326
+ clearErrors(name?: string | null): void;
327
+ disableForm(): void;
328
+ enableForm(): void;
329
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
330
+ name: {
331
+ required: true;
332
+ type: StringConstructor;
333
+ };
334
+ placeholder: {
335
+ default: string;
336
+ type: StringConstructor;
337
+ };
338
+ label: {
339
+ default: string;
340
+ type: StringConstructor;
341
+ };
342
+ disabled: {
343
+ type: BooleanConstructor;
344
+ default: boolean;
345
+ };
346
+ required: {
347
+ default: boolean;
348
+ type: BooleanConstructor;
349
+ };
350
+ autofocus: {
351
+ default: boolean;
352
+ type: BooleanConstructor;
353
+ };
354
+ preventSubmit: {
355
+ default: boolean;
356
+ type: BooleanConstructor;
357
+ };
358
+ }>> & {
359
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
360
+ }, {
361
+ required: boolean;
362
+ label: string;
363
+ placeholder: string;
364
+ disabled: boolean;
365
+ preventSubmit: boolean;
366
+ autofocus: boolean;
367
+ }>, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
368
+ modelValue: {
369
+ required: true;
370
+ type: PropType<string | null>;
371
+ };
372
+ type: {
373
+ type: StringConstructor;
374
+ default: string;
375
+ };
376
+ rows: {
377
+ default: number;
378
+ type: NumberConstructor;
379
+ };
380
+ min: {
381
+ default: undefined;
382
+ type: NumberConstructor;
383
+ };
384
+ max: {
385
+ default: undefined;
386
+ type: NumberConstructor;
387
+ };
388
+ }>>, {
389
+ type: string;
390
+ min: number;
391
+ max: number;
392
+ rows: number;
393
+ }>;
394
+ export default _default;
@@ -25,8 +25,11 @@ import BaseDateSelect from './BaseDateSelect.vue';
25
25
  import BaseDescriptionList from './BaseDescriptionList.vue';
26
26
  import BaseDescriptionListItem from './BaseDescriptionListItem.vue';
27
27
  import BaseDialog from './BaseDialog.vue';
28
+ import BaseField from './BaseField.vue';
29
+ import BaseFieldI18n from './BaseFieldI18n.vue';
28
30
  import BaseFilePicker from './BaseFilePicker.vue';
29
31
  import BaseFileUploader from './BaseFileUploader.vue';
32
+ import BaseForm from './BaseForm.vue';
30
33
  import BaseHasMany from './BaseHasMany.vue';
31
34
  import { Icon as BaseIcon } from '@iconify/vue';
32
35
  import BaseInput from './BaseInput.vue';
@@ -70,4 +73,4 @@ import BaseLayoutStacked from './BaseLayoutStacked.vue';
70
73
  import BaseLayoutStackedConfigurable from './BaseLayoutStackedConfigurable.vue';
71
74
  import BaseLayoutSidebar from './BaseLayoutSidebar.vue';
72
75
  import BaseLayoutSidebarConfigurable from './BaseLayoutSidebarConfigurable.vue';
73
- export { BaseActionItem, BaseAlert, BaseApp, BaseAppDialogs, BaseAppNotifications, BaseAutocomplete, BaseAutocompleteFetch, BaseAvatar, BaseBadge, BaseBelongsTo, BaseBoolean, BaseBreadcrumbs, BaseButton, BaseButtonGroup, BaseCard, BaseCardRow, BaseCharacterCounter, BaseClipboard, BaseContainer, BaseCounter, BaseDataIterator, BaseDataTable, BaseDatePicker, BaseDateSelect, BaseDescriptionList, BaseDescriptionListItem, BaseDialog, BaseFilePicker, BaseFileUploader, BaseHasMany, BaseIcon, BaseInput, BaseInputLabel, BaseLoadingCover, BaseMediaItem, BaseMediaLibrary, BaseMediaPreview, BaseMenu, BaseMenuItem, BaseModalCenter, BaseModalSide, BaseNavbar, BaseNavbarItem, BaseNavbarItemContent, BasePagination, BasePanel, BasePassword, BaseProgressCircle, BaseRadioGroup, BaseReadMore, BaseSelect, BaseShortcut, BaseSideNavigation, BaseSideNavigationItem, BaseSkeleton, BaseStatistic, BaseSwitch, BaseSystemAlert, BaseTabs, BaseTabItem, BaseTagAutocomplete, BaseTagAutocompleteFetch, BaseTable, BaseTableColumn, BaseTextarea, BaseTextareaAutoresize, BaseTimeline, BaseTimelineItem, BaseLayoutStacked, BaseLayoutStackedConfigurable, BaseLayoutSidebar, BaseLayoutSidebarConfigurable, };
76
+ export { BaseActionItem, BaseAlert, BaseApp, BaseAppDialogs, BaseAppNotifications, BaseAutocomplete, BaseAutocompleteFetch, BaseAvatar, BaseBadge, BaseBelongsTo, BaseBoolean, BaseBreadcrumbs, BaseButton, BaseButtonGroup, BaseCard, BaseCardRow, BaseCharacterCounter, BaseClipboard, BaseContainer, BaseCounter, BaseDataIterator, BaseDataTable, BaseDatePicker, BaseDateSelect, BaseDescriptionList, BaseDescriptionListItem, BaseDialog, BaseField, BaseFieldI18n, BaseFilePicker, BaseFileUploader, BaseForm, BaseHasMany, BaseIcon, BaseInput, BaseInputLabel, BaseLoadingCover, BaseMediaItem, BaseMediaLibrary, BaseMediaPreview, BaseMenu, BaseMenuItem, BaseModalCenter, BaseModalSide, BaseNavbar, BaseNavbarItem, BaseNavbarItemContent, BasePagination, BasePanel, BasePassword, BaseProgressCircle, BaseRadioGroup, BaseReadMore, BaseSelect, BaseShortcut, BaseSideNavigation, BaseSideNavigationItem, BaseSkeleton, BaseStatistic, BaseSwitch, BaseSystemAlert, BaseTabs, BaseTabItem, BaseTagAutocomplete, BaseTagAutocompleteFetch, BaseTable, BaseTableColumn, BaseTextarea, BaseTextareaAutoresize, BaseTimeline, BaseTimelineItem, BaseLayoutStacked, BaseLayoutStackedConfigurable, BaseLayoutSidebar, BaseLayoutSidebarConfigurable, };
@@ -0,0 +1,17 @@
1
+ import { Ref } from 'vue';
2
+ interface Config {
3
+ name: Ref<string | null | undefined>;
4
+ required: Ref<boolean>;
5
+ hasError: Ref<boolean | undefined>;
6
+ emit: any;
7
+ errorType?: string;
8
+ labelClass?: string;
9
+ }
10
+ export declare function useField(config: Config): {
11
+ requiredInternal: import("vue").ComputedRef<boolean>;
12
+ nameInternal: import("vue").ComputedRef<string>;
13
+ hasErrorInternal: import("vue").ComputedRef<boolean>;
14
+ errorMessageInternal: import("vue").ComputedRef<string | null | undefined>;
15
+ emitUpdate: (value: any) => void;
16
+ };
17
+ export {};
@@ -135,10 +135,12 @@ declare const messages: {
135
135
  };
136
136
  };
137
137
  import './assets/main.css';
138
+ import { Locales } from './types';
138
139
  export interface Options {
139
140
  i18n?: I18n<typeof messages, {}, {}, string, true>;
140
141
  http?: AxiosInstance;
141
142
  upload_url?: string;
143
+ locales?: Locales;
142
144
  formatQueryString?: (params: Record<string, any>) => string;
143
145
  parseQueryString?: (params: string) => Record<string, any>;
144
146
  }
@@ -274,6 +276,7 @@ declare const config: {
274
276
  };
275
277
  }, {}, {}, string, true>;
276
278
  http: AxiosInstance;
279
+ locales: Locales;
277
280
  upload_url: string;
278
281
  formatQueryString(params: Record<string, any>): string;
279
282
  parseQueryString(params: string): Record<string, any>;
@@ -1,6 +1,17 @@
1
1
  import { RouteLocationRaw } from 'vue-router';
2
2
  import { UploadedFile } from './UploadedFile';
3
3
  import { Notification as AppNotification } from './Notification';
4
+ export type Locales = {
5
+ [locale: string]: string;
6
+ };
7
+ export declare enum Method {
8
+ post = "post",
9
+ patch = "patch"
10
+ }
11
+ export declare enum DataFormat {
12
+ json = "json",
13
+ formData = "formData"
14
+ }
4
15
  export interface Breadcrumb {
5
16
  icon?: string;
6
17
  to: RouteLocationRaw;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.0.41",
3
+ "version": "0.0.42",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build-fast": "rimraf dist && vite build",
@@ -21,6 +21,7 @@
21
21
  "humanize-duration": "^3.0.0",
22
22
  "lodash": "^4.17.21",
23
23
  "luxon": "^3.0.0",
24
+ "object-to-formdata": "^4.4.2",
24
25
  "pikaday": "^1.8.2",
25
26
  "pinia": "^2.0.0",
26
27
  "qs": "^6.0.0",
@@ -70,6 +71,7 @@
70
71
  "lodash": "^4.17.21",
71
72
  "luxon": "^3.1.0",
72
73
  "object-hash": "^3.0.0",
74
+ "object-to-formdata": "^4.4.2",
73
75
  "pikaday": "^1.8.2",
74
76
  "pinia": "^2.0.23",
75
77
  "postcss": "^8.4.19",
@@ -80,6 +82,7 @@
80
82
  "rimraf": "^3.0.2",
81
83
  "rollup-plugin-analyzer": "^4.0.0",
82
84
  "scroll-lock": "^2.1.5",
85
+ "storybook-addon-mock": "^3.2.0",
83
86
  "tailwindcss": "^3.2.4",
84
87
  "typescript": "^4.4.4",
85
88
  "unplugin-auto-import": "^0.11.4",
@@ -1,30 +1,27 @@
1
+ import { createFieldStory, options } from '../../.storybook/utils';
1
2
  import BaseAutocomplete from './BaseAutocomplete.vue';
3
+ import ShowValue from '@/../.storybook/components/ShowValue.vue';
2
4
 
3
5
  export default {
4
6
  title: 'Form/BaseAutocomplete',
5
7
  component: BaseAutocomplete,
6
- argTypes: {},
7
8
  args: {
8
9
  labelKey: 'label',
9
10
  valueKey: 'value',
10
- options: [
11
- { label: 'Dark Vader', value: 'dark_vader' },
12
- { label: 'Darth Maul', value: 'darth_maul' },
13
- { label: 'Dark Sidious', value: 'dark_sidious' },
14
- ],
11
+ options: options,
15
12
  },
16
13
  decorators: [() => ({ template: '<div class="mb-36"><story/></div>' })],
17
14
  };
18
15
 
19
16
  const Template = (args) => ({
20
- components: { BaseAutocomplete },
17
+ components: { BaseAutocomplete, ShowValue },
21
18
  setup() {
22
19
  const value = ref(null);
23
20
  return { args, value };
24
21
  },
25
22
  template: `
26
23
  <BaseAutocomplete v-model="value" v-bind="args"></BaseAutocomplete>
27
- <p class="mt-5 text-sm">Value: <span class="bg-slate-200 font-mono px-1 py-px rounded">{{ value ?? 'NULL' }}</span></p>
24
+ <ShowValue :value="value" />
28
25
  `,
29
26
  });
30
27
 
@@ -59,27 +56,27 @@ export const SlotOption = (args) => ({
59
56
  return { value, options, args };
60
57
  },
61
58
  template: `
62
- <BaseAutocomplete
63
- v-bind="args"
64
- v-model="value"
65
- :options="options"
66
- >
67
- <template #option="{ option, active, selected }">
68
- <div
69
- class="rounded px-2 font-semibold py-1 text-sm"
70
- :class="{
71
- 'hover:bg-slate-100': !active && !selected,
72
- 'bg-slate-200 hover:bg-slate-300': active && !selected,
73
- 'bg-blue-500 text-white hover:bg-blue-600': !active && selected,
74
- 'bg-blue-600 text-white hover:bg-blue-700': active && selected,
75
- }"
76
- :style="{ color: selected ? '' : option.value }"
77
- >
78
- {{ option.label }}
79
- </div>
80
- </template>
81
- </BaseAutocomplete>
82
- `,
59
+ <BaseAutocomplete
60
+ v-bind="args"
61
+ v-model="value"
62
+ :options="options"
63
+ >
64
+ <template #option="{ option, active, selected }">
65
+ <div
66
+ class="rounded px-2 font-semibold py-1 text-sm"
67
+ :class="{
68
+ 'hover:bg-slate-100': !active && !selected,
69
+ 'bg-slate-200 hover:bg-slate-300': active && !selected,
70
+ 'bg-blue-500 text-white hover:bg-blue-600': !active && selected,
71
+ 'bg-blue-600 text-white hover:bg-blue-700': active && selected,
72
+ }"
73
+ :style="{ color: selected ? '' : option.value }"
74
+ >
75
+ {{ option.label }}
76
+ </div>
77
+ </template>
78
+ </BaseAutocomplete>
79
+ `,
83
80
  });
84
81
 
85
82
  export const SlotFooter = (args) => {
@@ -88,22 +85,24 @@ export const SlotFooter = (args) => {
88
85
  setup() {
89
86
  const value = ref(null);
90
87
  function onClick() {
91
- alert(1);
88
+ setTimeout(() => {
89
+ alert(1);
90
+ }, 150);
92
91
  }
93
92
  return { args, value, onClick };
94
93
  },
95
94
  template: `
96
- <BaseAutocomplete
97
- v-model="value"
98
- v-bind="args"
99
- >
100
- <template #footer>
101
- <div class="text-center p-2 border-t">
102
- <button @click=onClick class="btn btn-sm w-full btn-slate-200-outline">This is the footer 💯</button>
103
- </div>
104
- </template>
105
- </BaseAutocomplete>
106
- `,
95
+ <BaseAutocomplete
96
+ v-model="value"
97
+ v-bind="args"
98
+ >
99
+ <template #footer>
100
+ <div class="text-center p-2 border-t">
101
+ <button @click=onClick class="btn btn-sm w-full btn-slate-200-outline">This is the footer 💯</button>
102
+ </div>
103
+ </template>
104
+ </BaseAutocomplete>
105
+ `,
107
106
  };
108
107
  };
109
108
 
@@ -115,15 +114,21 @@ export const SlotEmpty = (args) => {
115
114
  return { args, value };
116
115
  },
117
116
  template: `
118
- <BaseAutocomplete
119
- v-model="value"
120
- v-bind="args"
121
- :options="[]"
122
- >
123
- <template #empty>
124
- <div class="text-center p-6 py-10 flex items-center justify-center">🤓🤓🤓</div>
125
- </template>
126
- </BaseAutocomplete>
127
- `,
117
+ <BaseAutocomplete
118
+ v-model="value"
119
+ v-bind="args"
120
+ :options="[]"
121
+ >
122
+ <template #empty>
123
+ <div class="text-center p-6 py-10 flex items-center justify-center">🤓🤓🤓</div>
124
+ </template>
125
+ </BaseAutocomplete>
126
+ `,
128
127
  };
129
128
  };
129
+
130
+ export const Field = createFieldStory({
131
+ component: BaseAutocomplete,
132
+ componentName: 'BaseAutocomplete',
133
+ label: 'Article',
134
+ });