sprintify-ui 0.10.86 → 0.10.88
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.
- package/dist/sprintify-ui.es.js +4611 -4502
- package/dist/types/components/BaseAutocomplete.vue.d.ts +88 -4
- package/dist/types/components/BaseAutocompleteDrawer.vue.d.ts +44 -4
- package/dist/types/components/BaseAutocompleteFetch.vue.d.ts +88 -4
- package/dist/types/components/BaseBelongsTo.vue.d.ts +88 -4
- package/dist/types/components/BaseBelongsToFetch.vue.d.ts +58 -4
- package/dist/types/components/BaseHasMany.vue.d.ts +36 -0
- package/dist/types/components/BaseInput.vue.d.ts +2 -0
- package/dist/types/components/BaseTagAutocomplete.vue.d.ts +96 -10
- package/dist/types/components/BaseTagAutocompleteFetch.vue.d.ts +52 -4
- package/dist/types/components/BaseTextarea.vue.d.ts +6 -0
- package/package.json +1 -1
- package/src/components/BaseAutocomplete.stories.js +10 -0
- package/src/components/BaseAutocomplete.vue +11 -1
- package/src/components/BaseAutocompleteDrawer.vue +52 -1
- package/src/components/BaseAutocompleteFetch.stories.js +6 -0
- package/src/components/BaseAutocompleteFetch.vue +10 -0
- package/src/components/BaseBelongsTo.stories.js +5 -0
- package/src/components/BaseBelongsTo.vue +10 -0
- package/src/components/BaseBelongsToFetch.stories.js +6 -0
- package/src/components/BaseBelongsToFetch.vue +6 -0
- package/src/components/BaseHasMany.stories.js +5 -0
- package/src/components/BaseHasMany.vue +10 -0
- package/src/components/BaseHasManyFetch.stories.js +12 -0
- package/src/components/BaseInput.vue +8 -5
- package/src/components/BaseTagAutocomplete.stories.js +5 -0
- package/src/components/BaseTagAutocomplete.vue +34 -1
- package/src/components/BaseTagAutocompleteFetch.stories.js +6 -0
- package/src/components/BaseTextarea.vue +4 -1
|
@@ -3,6 +3,7 @@ import { NormalizedOption, RawOption } from '@/types';
|
|
|
3
3
|
import BaseAutocompleteDrawer from './BaseAutocompleteDrawer.vue';
|
|
4
4
|
import { t } from '@/i18n';
|
|
5
5
|
import { Size } from '@/utils/sizes';
|
|
6
|
+
import { BaseIcon } from '.';
|
|
6
7
|
declare const emit: (event: "close" | "open" | "update:modelValue" | "scrollBottom" | "typing", ...args: any[]) => void;
|
|
7
8
|
declare const inputRef: import("vue").Ref<HTMLElement | null, HTMLElement | null>;
|
|
8
9
|
declare const dropdownRef: import("vue").Ref<HTMLElement | null, HTMLElement | null>;
|
|
@@ -16,6 +17,8 @@ declare const drawer: import("vue").Ref<({
|
|
|
16
17
|
selected: NormalizedOption | NormalizedOption[] | null | undefined;
|
|
17
18
|
keywords: string;
|
|
18
19
|
loadingBottom: boolean;
|
|
20
|
+
optionColor: (option: RawOption) => string;
|
|
21
|
+
optionIcon: (option: RawOption) => string;
|
|
19
22
|
twDrawer: string;
|
|
20
23
|
}> & Omit<{
|
|
21
24
|
readonly size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
@@ -25,9 +28,11 @@ declare const drawer: import("vue").Ref<({
|
|
|
25
28
|
readonly loadingBottom: boolean;
|
|
26
29
|
readonly twDrawer: string;
|
|
27
30
|
readonly selected?: NormalizedOption | NormalizedOption[] | null | undefined;
|
|
31
|
+
readonly optionColor?: ((option: RawOption) => string) | undefined;
|
|
32
|
+
readonly optionIcon?: ((option: RawOption) => string) | undefined;
|
|
28
33
|
readonly onSelect?: ((...args: any[]) => any) | undefined;
|
|
29
34
|
readonly onScrollBottom?: ((...args: any[]) => any) | undefined;
|
|
30
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "size" | "options" | "loading" | "selected" | "keywords" | "loadingBottom" | "twDrawer">;
|
|
35
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "size" | "options" | "loading" | "selected" | "keywords" | "loadingBottom" | "optionColor" | "optionIcon" | "twDrawer">;
|
|
31
36
|
$attrs: {
|
|
32
37
|
[x: string]: unknown;
|
|
33
38
|
};
|
|
@@ -67,6 +72,14 @@ declare const drawer: import("vue").Ref<({
|
|
|
67
72
|
type: PropType<Size>;
|
|
68
73
|
default: string;
|
|
69
74
|
};
|
|
75
|
+
optionColor: {
|
|
76
|
+
default: undefined;
|
|
77
|
+
type: PropType<(option: RawOption) => string>;
|
|
78
|
+
};
|
|
79
|
+
optionIcon: {
|
|
80
|
+
default: undefined;
|
|
81
|
+
type: PropType<(option: RawOption) => string>;
|
|
82
|
+
};
|
|
70
83
|
twDrawer: {
|
|
71
84
|
type: StringConstructor;
|
|
72
85
|
default: string;
|
|
@@ -86,6 +99,8 @@ declare const drawer: import("vue").Ref<({
|
|
|
86
99
|
selected: NormalizedOption | NormalizedOption[] | null | undefined;
|
|
87
100
|
keywords: string;
|
|
88
101
|
loadingBottom: boolean;
|
|
102
|
+
optionColor: (option: RawOption) => string;
|
|
103
|
+
optionIcon: (option: RawOption) => string;
|
|
89
104
|
twDrawer: string;
|
|
90
105
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
91
106
|
beforeCreate?: (() => void) | (() => void)[];
|
|
@@ -114,6 +129,8 @@ declare const drawer: import("vue").Ref<({
|
|
|
114
129
|
selected: NormalizedOption | NormalizedOption[] | null | undefined;
|
|
115
130
|
keywords: string;
|
|
116
131
|
loadingBottom: boolean;
|
|
132
|
+
optionColor: (option: RawOption) => string;
|
|
133
|
+
optionIcon: (option: RawOption) => string;
|
|
117
134
|
twDrawer: string;
|
|
118
135
|
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
|
119
136
|
selected: {
|
|
@@ -140,6 +157,14 @@ declare const drawer: import("vue").Ref<({
|
|
|
140
157
|
type: PropType<Size>;
|
|
141
158
|
default: string;
|
|
142
159
|
};
|
|
160
|
+
optionColor: {
|
|
161
|
+
default: undefined;
|
|
162
|
+
type: PropType<(option: RawOption) => string>;
|
|
163
|
+
};
|
|
164
|
+
optionIcon: {
|
|
165
|
+
default: undefined;
|
|
166
|
+
type: PropType<(option: RawOption) => string>;
|
|
167
|
+
};
|
|
143
168
|
twDrawer: {
|
|
144
169
|
type: StringConstructor;
|
|
145
170
|
default: string;
|
|
@@ -147,7 +172,7 @@ declare const drawer: import("vue").Ref<({
|
|
|
147
172
|
}>> & Readonly<{
|
|
148
173
|
onSelect?: ((...args: any[]) => any) | undefined;
|
|
149
174
|
onScrollBottom?: ((...args: any[]) => any) | undefined;
|
|
150
|
-
}>, "onKeydown" | ("size" | "options" | "loading" | "selected" | "keywords" | "loadingBottom" | "twDrawer")> & import("vue").ShallowUnwrapRef<{
|
|
175
|
+
}>, "onKeydown" | ("size" | "options" | "loading" | "selected" | "keywords" | "loadingBottom" | "optionColor" | "optionIcon" | "twDrawer")> & import("vue").ShallowUnwrapRef<{
|
|
151
176
|
onKeydown: (event: KeyboardEvent) => void;
|
|
152
177
|
}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
153
178
|
$slots: {
|
|
@@ -173,6 +198,8 @@ declare const drawer: import("vue").Ref<({
|
|
|
173
198
|
selected: NormalizedOption | NormalizedOption[] | null | undefined;
|
|
174
199
|
keywords: string;
|
|
175
200
|
loadingBottom: boolean;
|
|
201
|
+
optionColor: (option: RawOption) => string;
|
|
202
|
+
optionIcon: (option: RawOption) => string;
|
|
176
203
|
twDrawer: string;
|
|
177
204
|
}> & Omit<{
|
|
178
205
|
readonly size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
@@ -182,9 +209,11 @@ declare const drawer: import("vue").Ref<({
|
|
|
182
209
|
readonly loadingBottom: boolean;
|
|
183
210
|
readonly twDrawer: string;
|
|
184
211
|
readonly selected?: NormalizedOption | NormalizedOption[] | null | undefined;
|
|
212
|
+
readonly optionColor?: ((option: RawOption) => string) | undefined;
|
|
213
|
+
readonly optionIcon?: ((option: RawOption) => string) | undefined;
|
|
185
214
|
readonly onSelect?: ((...args: any[]) => any) | undefined;
|
|
186
215
|
readonly onScrollBottom?: ((...args: any[]) => any) | undefined;
|
|
187
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "size" | "options" | "loading" | "selected" | "keywords" | "loadingBottom" | "twDrawer">;
|
|
216
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "size" | "options" | "loading" | "selected" | "keywords" | "loadingBottom" | "optionColor" | "optionIcon" | "twDrawer">;
|
|
188
217
|
$attrs: {
|
|
189
218
|
[x: string]: unknown;
|
|
190
219
|
};
|
|
@@ -224,6 +253,14 @@ declare const drawer: import("vue").Ref<({
|
|
|
224
253
|
type: PropType<Size>;
|
|
225
254
|
default: string;
|
|
226
255
|
};
|
|
256
|
+
optionColor: {
|
|
257
|
+
default: undefined;
|
|
258
|
+
type: PropType<(option: RawOption) => string>;
|
|
259
|
+
};
|
|
260
|
+
optionIcon: {
|
|
261
|
+
default: undefined;
|
|
262
|
+
type: PropType<(option: RawOption) => string>;
|
|
263
|
+
};
|
|
227
264
|
twDrawer: {
|
|
228
265
|
type: StringConstructor;
|
|
229
266
|
default: string;
|
|
@@ -243,6 +280,8 @@ declare const drawer: import("vue").Ref<({
|
|
|
243
280
|
selected: NormalizedOption | NormalizedOption[] | null | undefined;
|
|
244
281
|
keywords: string;
|
|
245
282
|
loadingBottom: boolean;
|
|
283
|
+
optionColor: (option: RawOption) => string;
|
|
284
|
+
optionIcon: (option: RawOption) => string;
|
|
246
285
|
twDrawer: string;
|
|
247
286
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
248
287
|
beforeCreate?: (() => void) | (() => void)[];
|
|
@@ -271,6 +310,8 @@ declare const drawer: import("vue").Ref<({
|
|
|
271
310
|
selected: NormalizedOption | NormalizedOption[] | null | undefined;
|
|
272
311
|
keywords: string;
|
|
273
312
|
loadingBottom: boolean;
|
|
313
|
+
optionColor: (option: RawOption) => string;
|
|
314
|
+
optionIcon: (option: RawOption) => string;
|
|
274
315
|
twDrawer: string;
|
|
275
316
|
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
|
276
317
|
selected: {
|
|
@@ -297,6 +338,14 @@ declare const drawer: import("vue").Ref<({
|
|
|
297
338
|
type: PropType<Size>;
|
|
298
339
|
default: string;
|
|
299
340
|
};
|
|
341
|
+
optionColor: {
|
|
342
|
+
default: undefined;
|
|
343
|
+
type: PropType<(option: RawOption) => string>;
|
|
344
|
+
};
|
|
345
|
+
optionIcon: {
|
|
346
|
+
default: undefined;
|
|
347
|
+
type: PropType<(option: RawOption) => string>;
|
|
348
|
+
};
|
|
300
349
|
twDrawer: {
|
|
301
350
|
type: StringConstructor;
|
|
302
351
|
default: string;
|
|
@@ -304,7 +353,7 @@ declare const drawer: import("vue").Ref<({
|
|
|
304
353
|
}>> & Readonly<{
|
|
305
354
|
onSelect?: ((...args: any[]) => any) | undefined;
|
|
306
355
|
onScrollBottom?: ((...args: any[]) => any) | undefined;
|
|
307
|
-
}>, "onKeydown" | ("size" | "options" | "loading" | "selected" | "keywords" | "loadingBottom" | "twDrawer")> & import("vue").ShallowUnwrapRef<{
|
|
356
|
+
}>, "onKeydown" | ("size" | "options" | "loading" | "selected" | "keywords" | "loadingBottom" | "optionColor" | "optionIcon" | "twDrawer")> & import("vue").ShallowUnwrapRef<{
|
|
308
357
|
onKeydown: (event: KeyboardEvent) => void;
|
|
309
358
|
}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
310
359
|
$slots: {
|
|
@@ -366,13 +415,13 @@ declare var __VLS_1: {
|
|
|
366
415
|
items: NormalizedOption[];
|
|
367
416
|
removeOption: (option: NormalizedOption) => void;
|
|
368
417
|
disabled: boolean;
|
|
369
|
-
},
|
|
418
|
+
}, __VLS_21: {
|
|
370
419
|
focus: typeof focus;
|
|
371
420
|
blur: typeof blur;
|
|
372
421
|
open: typeof open;
|
|
373
422
|
close: typeof close;
|
|
374
423
|
keywords: ComputedRef<string>;
|
|
375
|
-
},
|
|
424
|
+
}, __VLS_23: {
|
|
376
425
|
focus: typeof focus;
|
|
377
426
|
blur: typeof blur;
|
|
378
427
|
open: typeof open;
|
|
@@ -383,7 +432,7 @@ declare var __VLS_1: {
|
|
|
383
432
|
label: string;
|
|
384
433
|
selected: boolean;
|
|
385
434
|
active: boolean;
|
|
386
|
-
},
|
|
435
|
+
}, __VLS_25: {
|
|
387
436
|
focus: typeof focus;
|
|
388
437
|
blur: typeof blur;
|
|
389
438
|
open: typeof open;
|
|
@@ -394,11 +443,11 @@ declare var __VLS_1: {
|
|
|
394
443
|
type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
|
|
395
444
|
items?: (props: typeof __VLS_1) => any;
|
|
396
445
|
} & {
|
|
397
|
-
empty?: (props: typeof
|
|
446
|
+
empty?: (props: typeof __VLS_21) => any;
|
|
398
447
|
} & {
|
|
399
|
-
option?: (props: typeof
|
|
448
|
+
option?: (props: typeof __VLS_23) => any;
|
|
400
449
|
} & {
|
|
401
|
-
footer?: (props: typeof
|
|
450
|
+
footer?: (props: typeof __VLS_25) => any;
|
|
402
451
|
}>;
|
|
403
452
|
declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
404
453
|
modelValue: {
|
|
@@ -477,9 +526,18 @@ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
477
526
|
default: boolean;
|
|
478
527
|
type: BooleanConstructor;
|
|
479
528
|
};
|
|
529
|
+
optionColor: {
|
|
530
|
+
default: undefined;
|
|
531
|
+
type: PropType<(option: RawOption) => string>;
|
|
532
|
+
};
|
|
533
|
+
optionIcon: {
|
|
534
|
+
default: undefined;
|
|
535
|
+
type: PropType<(option: RawOption) => string>;
|
|
536
|
+
};
|
|
480
537
|
}>, {
|
|
481
538
|
BaseAutocompleteDrawer: typeof BaseAutocompleteDrawer;
|
|
482
539
|
t: typeof t;
|
|
540
|
+
BaseIcon: typeof BaseIcon;
|
|
483
541
|
emit: typeof emit;
|
|
484
542
|
inputRef: typeof inputRef;
|
|
485
543
|
dropdownRef: typeof dropdownRef;
|
|
@@ -585,6 +643,14 @@ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
585
643
|
default: boolean;
|
|
586
644
|
type: BooleanConstructor;
|
|
587
645
|
};
|
|
646
|
+
optionColor: {
|
|
647
|
+
default: undefined;
|
|
648
|
+
type: PropType<(option: RawOption) => string>;
|
|
649
|
+
};
|
|
650
|
+
optionIcon: {
|
|
651
|
+
default: undefined;
|
|
652
|
+
type: PropType<(option: RawOption) => string>;
|
|
653
|
+
};
|
|
588
654
|
}>> & Readonly<{
|
|
589
655
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
590
656
|
onOpen?: ((...args: any[]) => any) | undefined;
|
|
@@ -604,6 +670,8 @@ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
604
670
|
visibleFocus: boolean;
|
|
605
671
|
loading: boolean;
|
|
606
672
|
loadingBottom: boolean;
|
|
673
|
+
optionColor: (option: RawOption) => string;
|
|
674
|
+
optionIcon: (option: RawOption) => string;
|
|
607
675
|
dropdownShow: "always" | "focus";
|
|
608
676
|
focusOnMount: boolean;
|
|
609
677
|
twContainer: string | string[];
|
|
@@ -685,6 +753,14 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
685
753
|
default: boolean;
|
|
686
754
|
type: BooleanConstructor;
|
|
687
755
|
};
|
|
756
|
+
optionColor: {
|
|
757
|
+
default: undefined;
|
|
758
|
+
type: PropType<(option: RawOption) => string>;
|
|
759
|
+
};
|
|
760
|
+
optionIcon: {
|
|
761
|
+
default: undefined;
|
|
762
|
+
type: PropType<(option: RawOption) => string>;
|
|
763
|
+
};
|
|
688
764
|
}>, {
|
|
689
765
|
focus: typeof focus;
|
|
690
766
|
blur: typeof blur;
|
|
@@ -774,6 +850,14 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
774
850
|
default: boolean;
|
|
775
851
|
type: BooleanConstructor;
|
|
776
852
|
};
|
|
853
|
+
optionColor: {
|
|
854
|
+
default: undefined;
|
|
855
|
+
type: PropType<(option: RawOption) => string>;
|
|
856
|
+
};
|
|
857
|
+
optionIcon: {
|
|
858
|
+
default: undefined;
|
|
859
|
+
type: PropType<(option: RawOption) => string>;
|
|
860
|
+
};
|
|
777
861
|
}>> & Readonly<{
|
|
778
862
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
779
863
|
onOpen?: ((...args: any[]) => any) | undefined;
|
|
@@ -793,6 +877,8 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
793
877
|
visibleFocus: boolean;
|
|
794
878
|
loading: boolean;
|
|
795
879
|
loadingBottom: boolean;
|
|
880
|
+
optionColor: (option: RawOption) => string;
|
|
881
|
+
optionIcon: (option: RawOption) => string;
|
|
796
882
|
dropdownShow: "always" | "focus";
|
|
797
883
|
focusOnMount: boolean;
|
|
798
884
|
twContainer: string | string[];
|
|
@@ -18,6 +18,8 @@ declare const tagAutocomplete: import("vue").Ref<({
|
|
|
18
18
|
visibleFocus: boolean;
|
|
19
19
|
loading: boolean;
|
|
20
20
|
loadingBottom: boolean;
|
|
21
|
+
optionColor: (option: RawOption) => string;
|
|
22
|
+
optionIcon: (option: RawOption) => string;
|
|
21
23
|
dropdownShow: "always" | "focus";
|
|
22
24
|
focusOnMount: boolean;
|
|
23
25
|
twContainer: string | string[];
|
|
@@ -41,12 +43,14 @@ declare const tagAutocomplete: import("vue").Ref<({
|
|
|
41
43
|
readonly name?: string | undefined;
|
|
42
44
|
readonly placeholder?: string | undefined;
|
|
43
45
|
readonly max?: number | undefined;
|
|
46
|
+
readonly optionColor?: ((option: RawOption) => string) | undefined;
|
|
47
|
+
readonly optionIcon?: ((option: RawOption) => string) | undefined;
|
|
44
48
|
readonly onClose?: ((...args: any[]) => any) | undefined;
|
|
45
49
|
readonly onOpen?: ((...args: any[]) => any) | undefined;
|
|
46
50
|
readonly "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
47
51
|
readonly onScrollBottom?: ((...args: any[]) => any) | undefined;
|
|
48
52
|
readonly onTyping?: ((...args: any[]) => any) | undefined;
|
|
49
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "filter" | "size" | "required" | "inline" | "disabled" | "name" | "placeholder" | "hasError" | "max" | "visibleFocus" | "loading" | "loadingBottom" | "dropdownShow" | "focusOnMount" | "twContainer">;
|
|
53
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "filter" | "size" | "required" | "inline" | "disabled" | "name" | "placeholder" | "hasError" | "max" | "visibleFocus" | "loading" | "loadingBottom" | "optionColor" | "optionIcon" | "dropdownShow" | "focusOnMount" | "twContainer">;
|
|
50
54
|
$attrs: {
|
|
51
55
|
[x: string]: unknown;
|
|
52
56
|
};
|
|
@@ -138,6 +142,14 @@ declare const tagAutocomplete: import("vue").Ref<({
|
|
|
138
142
|
default: boolean;
|
|
139
143
|
type: BooleanConstructor;
|
|
140
144
|
};
|
|
145
|
+
optionColor: {
|
|
146
|
+
default: undefined;
|
|
147
|
+
type: PropType<(option: RawOption) => string>;
|
|
148
|
+
};
|
|
149
|
+
optionIcon: {
|
|
150
|
+
default: undefined;
|
|
151
|
+
type: PropType<(option: RawOption) => string>;
|
|
152
|
+
};
|
|
141
153
|
}>> & Readonly<{
|
|
142
154
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
143
155
|
onOpen?: ((...args: any[]) => any) | undefined;
|
|
@@ -169,6 +181,8 @@ declare const tagAutocomplete: import("vue").Ref<({
|
|
|
169
181
|
visibleFocus: boolean;
|
|
170
182
|
loading: boolean;
|
|
171
183
|
loadingBottom: boolean;
|
|
184
|
+
optionColor: (option: RawOption) => string;
|
|
185
|
+
optionIcon: (option: RawOption) => string;
|
|
172
186
|
dropdownShow: "always" | "focus";
|
|
173
187
|
focusOnMount: boolean;
|
|
174
188
|
twContainer: string | string[];
|
|
@@ -205,6 +219,8 @@ declare const tagAutocomplete: import("vue").Ref<({
|
|
|
205
219
|
visibleFocus: boolean;
|
|
206
220
|
loading: boolean;
|
|
207
221
|
loadingBottom: boolean;
|
|
222
|
+
optionColor: (option: RawOption) => string;
|
|
223
|
+
optionIcon: (option: RawOption) => string;
|
|
208
224
|
dropdownShow: "always" | "focus";
|
|
209
225
|
focusOnMount: boolean;
|
|
210
226
|
twContainer: string | string[];
|
|
@@ -285,13 +301,21 @@ declare const tagAutocomplete: import("vue").Ref<({
|
|
|
285
301
|
default: boolean;
|
|
286
302
|
type: BooleanConstructor;
|
|
287
303
|
};
|
|
304
|
+
optionColor: {
|
|
305
|
+
default: undefined;
|
|
306
|
+
type: PropType<(option: RawOption) => string>;
|
|
307
|
+
};
|
|
308
|
+
optionIcon: {
|
|
309
|
+
default: undefined;
|
|
310
|
+
type: PropType<(option: RawOption) => string>;
|
|
311
|
+
};
|
|
288
312
|
}>> & Readonly<{
|
|
289
313
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
290
314
|
onOpen?: ((...args: any[]) => any) | undefined;
|
|
291
315
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
292
316
|
onScrollBottom?: ((...args: any[]) => any) | undefined;
|
|
293
317
|
onTyping?: ((...args: any[]) => any) | undefined;
|
|
294
|
-
}>, "blur" | "close" | "focus" | "open" | "setKeywords" | ("filter" | "size" | "required" | "inline" | "disabled" | "name" | "placeholder" | "hasError" | "max" | "visibleFocus" | "loading" | "loadingBottom" | "dropdownShow" | "focusOnMount" | "twContainer")> & import("vue").ShallowUnwrapRef<{
|
|
318
|
+
}>, "blur" | "close" | "focus" | "open" | "setKeywords" | ("filter" | "size" | "required" | "inline" | "disabled" | "name" | "placeholder" | "hasError" | "max" | "visibleFocus" | "loading" | "loadingBottom" | "optionColor" | "optionIcon" | "dropdownShow" | "focusOnMount" | "twContainer")> & import("vue").ShallowUnwrapRef<{
|
|
295
319
|
focus: () => void;
|
|
296
320
|
blur: () => void;
|
|
297
321
|
close: () => void;
|
|
@@ -348,6 +372,8 @@ declare const tagAutocomplete: import("vue").Ref<({
|
|
|
348
372
|
visibleFocus: boolean;
|
|
349
373
|
loading: boolean;
|
|
350
374
|
loadingBottom: boolean;
|
|
375
|
+
optionColor: (option: RawOption) => string;
|
|
376
|
+
optionIcon: (option: RawOption) => string;
|
|
351
377
|
dropdownShow: "always" | "focus";
|
|
352
378
|
focusOnMount: boolean;
|
|
353
379
|
twContainer: string | string[];
|
|
@@ -371,12 +397,14 @@ declare const tagAutocomplete: import("vue").Ref<({
|
|
|
371
397
|
readonly name?: string | undefined;
|
|
372
398
|
readonly placeholder?: string | undefined;
|
|
373
399
|
readonly max?: number | undefined;
|
|
400
|
+
readonly optionColor?: ((option: RawOption) => string) | undefined;
|
|
401
|
+
readonly optionIcon?: ((option: RawOption) => string) | undefined;
|
|
374
402
|
readonly onClose?: ((...args: any[]) => any) | undefined;
|
|
375
403
|
readonly onOpen?: ((...args: any[]) => any) | undefined;
|
|
376
404
|
readonly "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
377
405
|
readonly onScrollBottom?: ((...args: any[]) => any) | undefined;
|
|
378
406
|
readonly onTyping?: ((...args: any[]) => any) | undefined;
|
|
379
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "filter" | "size" | "required" | "inline" | "disabled" | "name" | "placeholder" | "hasError" | "max" | "visibleFocus" | "loading" | "loadingBottom" | "dropdownShow" | "focusOnMount" | "twContainer">;
|
|
407
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "filter" | "size" | "required" | "inline" | "disabled" | "name" | "placeholder" | "hasError" | "max" | "visibleFocus" | "loading" | "loadingBottom" | "optionColor" | "optionIcon" | "dropdownShow" | "focusOnMount" | "twContainer">;
|
|
380
408
|
$attrs: {
|
|
381
409
|
[x: string]: unknown;
|
|
382
410
|
};
|
|
@@ -468,6 +496,14 @@ declare const tagAutocomplete: import("vue").Ref<({
|
|
|
468
496
|
default: boolean;
|
|
469
497
|
type: BooleanConstructor;
|
|
470
498
|
};
|
|
499
|
+
optionColor: {
|
|
500
|
+
default: undefined;
|
|
501
|
+
type: PropType<(option: RawOption) => string>;
|
|
502
|
+
};
|
|
503
|
+
optionIcon: {
|
|
504
|
+
default: undefined;
|
|
505
|
+
type: PropType<(option: RawOption) => string>;
|
|
506
|
+
};
|
|
471
507
|
}>> & Readonly<{
|
|
472
508
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
473
509
|
onOpen?: ((...args: any[]) => any) | undefined;
|
|
@@ -499,6 +535,8 @@ declare const tagAutocomplete: import("vue").Ref<({
|
|
|
499
535
|
visibleFocus: boolean;
|
|
500
536
|
loading: boolean;
|
|
501
537
|
loadingBottom: boolean;
|
|
538
|
+
optionColor: (option: RawOption) => string;
|
|
539
|
+
optionIcon: (option: RawOption) => string;
|
|
502
540
|
dropdownShow: "always" | "focus";
|
|
503
541
|
focusOnMount: boolean;
|
|
504
542
|
twContainer: string | string[];
|
|
@@ -535,6 +573,8 @@ declare const tagAutocomplete: import("vue").Ref<({
|
|
|
535
573
|
visibleFocus: boolean;
|
|
536
574
|
loading: boolean;
|
|
537
575
|
loadingBottom: boolean;
|
|
576
|
+
optionColor: (option: RawOption) => string;
|
|
577
|
+
optionIcon: (option: RawOption) => string;
|
|
538
578
|
dropdownShow: "always" | "focus";
|
|
539
579
|
focusOnMount: boolean;
|
|
540
580
|
twContainer: string | string[];
|
|
@@ -615,13 +655,21 @@ declare const tagAutocomplete: import("vue").Ref<({
|
|
|
615
655
|
default: boolean;
|
|
616
656
|
type: BooleanConstructor;
|
|
617
657
|
};
|
|
658
|
+
optionColor: {
|
|
659
|
+
default: undefined;
|
|
660
|
+
type: PropType<(option: RawOption) => string>;
|
|
661
|
+
};
|
|
662
|
+
optionIcon: {
|
|
663
|
+
default: undefined;
|
|
664
|
+
type: PropType<(option: RawOption) => string>;
|
|
665
|
+
};
|
|
618
666
|
}>> & Readonly<{
|
|
619
667
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
620
668
|
onOpen?: ((...args: any[]) => any) | undefined;
|
|
621
669
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
622
670
|
onScrollBottom?: ((...args: any[]) => any) | undefined;
|
|
623
671
|
onTyping?: ((...args: any[]) => any) | undefined;
|
|
624
|
-
}>, "blur" | "close" | "focus" | "open" | "setKeywords" | ("filter" | "size" | "required" | "inline" | "disabled" | "name" | "placeholder" | "hasError" | "max" | "visibleFocus" | "loading" | "loadingBottom" | "dropdownShow" | "focusOnMount" | "twContainer")> & import("vue").ShallowUnwrapRef<{
|
|
672
|
+
}>, "blur" | "close" | "focus" | "open" | "setKeywords" | ("filter" | "size" | "required" | "inline" | "disabled" | "name" | "placeholder" | "hasError" | "max" | "visibleFocus" | "loading" | "loadingBottom" | "optionColor" | "optionIcon" | "dropdownShow" | "focusOnMount" | "twContainer")> & import("vue").ShallowUnwrapRef<{
|
|
625
673
|
focus: () => void;
|
|
626
674
|
blur: () => void;
|
|
627
675
|
close: () => void;
|
|
@@ -56,7 +56,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
56
56
|
blur: typeof blur;
|
|
57
57
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
58
58
|
blur: (...args: any[]) => void;
|
|
59
|
+
click: (...args: any[]) => void;
|
|
59
60
|
focus: (...args: any[]) => void;
|
|
61
|
+
keydown: (...args: any[]) => void;
|
|
62
|
+
keyup: (...args: any[]) => void;
|
|
60
63
|
"update:modelValue": (...args: any[]) => void;
|
|
61
64
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
62
65
|
modelValue: {
|
|
@@ -109,7 +112,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
109
112
|
};
|
|
110
113
|
}>> & Readonly<{
|
|
111
114
|
onBlur?: ((...args: any[]) => any) | undefined;
|
|
115
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
112
116
|
onFocus?: ((...args: any[]) => any) | undefined;
|
|
117
|
+
onKeydown?: ((...args: any[]) => any) | undefined;
|
|
118
|
+
onKeyup?: ((...args: any[]) => any) | undefined;
|
|
113
119
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
114
120
|
}>, {
|
|
115
121
|
class: string | string[];
|
package/package.json
CHANGED
|
@@ -22,6 +22,16 @@ export default {
|
|
|
22
22
|
labelKey: "label",
|
|
23
23
|
valueKey: "value",
|
|
24
24
|
options: options,
|
|
25
|
+
optionColor: (option) => {
|
|
26
|
+
if (option.type === "jedi") return "blue";
|
|
27
|
+
if (option.type === "sith") return "black";
|
|
28
|
+
return "gray";
|
|
29
|
+
},
|
|
30
|
+
optionIcon: (option) => {
|
|
31
|
+
if (option.type === "jedi") return "fa7-solid:jedi";
|
|
32
|
+
if (option.type === "sith") return "fa7-brands:sith";
|
|
33
|
+
return "mdi:help-circle-outline";
|
|
34
|
+
}
|
|
25
35
|
},
|
|
26
36
|
decorators: [() => ({ template: '<div class="mb-36"><story/></div>' })],
|
|
27
37
|
};
|
|
@@ -86,8 +86,10 @@
|
|
|
86
86
|
:size="size"
|
|
87
87
|
:loading="loading"
|
|
88
88
|
:loading-bottom="loadingBottom"
|
|
89
|
-
tw-drawer="p-1"
|
|
90
89
|
:keywords="keywords"
|
|
90
|
+
:option-color="optionColor"
|
|
91
|
+
:option-icon="optionIcon"
|
|
92
|
+
tw-drawer="p-1"
|
|
91
93
|
@select="onSelect"
|
|
92
94
|
@scroll-bottom="emit('scrollBottom')"
|
|
93
95
|
>
|
|
@@ -231,6 +233,14 @@ const props = defineProps({
|
|
|
231
233
|
},
|
|
232
234
|
type: [String] as PropType<string>,
|
|
233
235
|
},
|
|
236
|
+
optionColor: {
|
|
237
|
+
default: undefined,
|
|
238
|
+
type: Function as PropType<(option: RawOption) => string>,
|
|
239
|
+
},
|
|
240
|
+
optionIcon: {
|
|
241
|
+
default: undefined,
|
|
242
|
+
type: Function as PropType<(option: RawOption) => string>,
|
|
243
|
+
},
|
|
234
244
|
twInput: {
|
|
235
245
|
default: undefined,
|
|
236
246
|
type: [String, Array] as PropType<string | string[]>,
|
|
@@ -51,6 +51,29 @@
|
|
|
51
51
|
class="flex items-center rounded px-[0.75em] py-[0.5em]"
|
|
52
52
|
:class="[optionClass(option), optionSizeClass]"
|
|
53
53
|
>
|
|
54
|
+
<div
|
|
55
|
+
v-if="optionIcon"
|
|
56
|
+
class="shrink-0"
|
|
57
|
+
>
|
|
58
|
+
<BaseIcon
|
|
59
|
+
:icon="option.option ? optionIcon(option.option) : ''"
|
|
60
|
+
class="flex-shrink-0"
|
|
61
|
+
:class="optionIconSizeClass"
|
|
62
|
+
:color="option.option && optionColor ? optionColor(option.option) : 'gray'"
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
<div
|
|
66
|
+
v-else-if="optionColor"
|
|
67
|
+
class="shrink-0"
|
|
68
|
+
>
|
|
69
|
+
<div
|
|
70
|
+
class="flex-shrink-0 rounded-full"
|
|
71
|
+
:class="optionColorSizeClass"
|
|
72
|
+
:style="{
|
|
73
|
+
backgroundColor: option.option ? optionColor(option.option) : 'gray',
|
|
74
|
+
}"
|
|
75
|
+
/>
|
|
76
|
+
</div>
|
|
54
77
|
<div class="grow">
|
|
55
78
|
{{ option.label }}
|
|
56
79
|
</div>
|
|
@@ -120,7 +143,7 @@
|
|
|
120
143
|
<script lang="ts" setup>
|
|
121
144
|
import { PropType } from 'vue';
|
|
122
145
|
import { useInfiniteScroll } from '@vueuse/core';
|
|
123
|
-
import { NormalizedOption } from '@/types';
|
|
146
|
+
import { NormalizedOption, RawOption } from '@/types';
|
|
124
147
|
import { isArray, isObject, throttle } from 'lodash';
|
|
125
148
|
import BaseSkeleton from './BaseSkeleton.vue';
|
|
126
149
|
import { Icon as BaseIcon } from '@iconify/vue';
|
|
@@ -157,6 +180,14 @@ const props = defineProps({
|
|
|
157
180
|
type: String as PropType<Size>,
|
|
158
181
|
default: 'md',
|
|
159
182
|
},
|
|
183
|
+
optionColor: {
|
|
184
|
+
default: undefined,
|
|
185
|
+
type: Function as PropType<(option: RawOption) => string>,
|
|
186
|
+
},
|
|
187
|
+
optionIcon: {
|
|
188
|
+
default: undefined,
|
|
189
|
+
type: Function as PropType<(option: RawOption) => string>,
|
|
190
|
+
},
|
|
160
191
|
twDrawer: {
|
|
161
192
|
type: String,
|
|
162
193
|
default: '',
|
|
@@ -380,6 +411,26 @@ const optionIconClass = computed(() => {
|
|
|
380
411
|
return 'w-5 h-5';
|
|
381
412
|
});
|
|
382
413
|
|
|
414
|
+
const optionColorSizeClass = computed(() => {
|
|
415
|
+
if (props.size == 'xs') {
|
|
416
|
+
return 'mr-2 -ml-px h-3 w-3';
|
|
417
|
+
}
|
|
418
|
+
if (props.size == 'sm') {
|
|
419
|
+
return 'mr-2 -ml-px h-2.5 w-2.5';
|
|
420
|
+
}
|
|
421
|
+
return 'mr-2 -ml-px h-2.5 w-2.5';
|
|
422
|
+
});
|
|
423
|
+
|
|
424
|
+
const optionIconSizeClass = computed(() => {
|
|
425
|
+
if (props.size == 'xs') {
|
|
426
|
+
return 'mr-2 -ml-px h-3 w-3';
|
|
427
|
+
}
|
|
428
|
+
if (props.size == 'sm') {
|
|
429
|
+
return 'mr-2 -ml-0.5 h-4 w-4';
|
|
430
|
+
}
|
|
431
|
+
return 'mr-2 -ml-0.5 h-4 w-4';
|
|
432
|
+
});
|
|
433
|
+
|
|
383
434
|
defineExpose({
|
|
384
435
|
onKeydown,
|
|
385
436
|
});
|
|
@@ -16,6 +16,12 @@ export default {
|
|
|
16
16
|
url: "https://faker.witify.io/api/todos",
|
|
17
17
|
labelKey: "title",
|
|
18
18
|
valueKey: "id",
|
|
19
|
+
optionColor: (option) => {
|
|
20
|
+
if (option.type === "work") return "green";
|
|
21
|
+
if (option.type === "personal") return "blue";
|
|
22
|
+
if (option.type === "family") return "purple";
|
|
23
|
+
return "gray";
|
|
24
|
+
}
|
|
19
25
|
},
|
|
20
26
|
decorators: [() => ({ template: '<div class="mb-36"><story/></div>' })],
|
|
21
27
|
};
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
:show-remove-button="showRemoveButton"
|
|
24
24
|
:select="select"
|
|
25
25
|
:filter="filterOptions"
|
|
26
|
+
:option-color="optionColor"
|
|
27
|
+
:option-icon="optionIcon"
|
|
26
28
|
:tw-input="twInput"
|
|
27
29
|
@clear="onClear"
|
|
28
30
|
@open="onOpen"
|
|
@@ -168,6 +170,14 @@ const props = defineProps({
|
|
|
168
170
|
default: undefined,
|
|
169
171
|
type: Object as PropType<SelectConfiguration | undefined>,
|
|
170
172
|
},
|
|
173
|
+
optionColor: {
|
|
174
|
+
default: undefined,
|
|
175
|
+
type: Function as PropType<(option: RawOption) => string>,
|
|
176
|
+
},
|
|
177
|
+
optionIcon: {
|
|
178
|
+
default: undefined,
|
|
179
|
+
type: Function as PropType<(option: RawOption) => string>,
|
|
180
|
+
},
|
|
171
181
|
twInput: {
|
|
172
182
|
default: undefined,
|
|
173
183
|
type: [String, Array] as PropType<string | string[]>,
|
|
@@ -16,6 +16,11 @@ export default {
|
|
|
16
16
|
options: options,
|
|
17
17
|
field: "label",
|
|
18
18
|
primaryKey: "value",
|
|
19
|
+
optionColor: (option) => {
|
|
20
|
+
if (option.type === "jedi") return "blue";
|
|
21
|
+
if (option.type === "sith") return "black";
|
|
22
|
+
return "gray";
|
|
23
|
+
}
|
|
19
24
|
},
|
|
20
25
|
decorators: [() => ({ template: '<div class="mb-36"><story/></div>' })],
|
|
21
26
|
};
|
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
:focus-on-mount="focusOnMount"
|
|
23
23
|
:select="select"
|
|
24
24
|
:icon="icon"
|
|
25
|
+
:option-color="optionColor"
|
|
26
|
+
:option-icon="optionIcon"
|
|
25
27
|
@update:model-value="onUpdate"
|
|
26
28
|
>
|
|
27
29
|
<template #option="optionProps">
|
|
@@ -138,6 +140,14 @@ const props = defineProps({
|
|
|
138
140
|
default: undefined,
|
|
139
141
|
type: String,
|
|
140
142
|
},
|
|
143
|
+
optionColor: {
|
|
144
|
+
default: undefined,
|
|
145
|
+
type: Function as PropType<(option: RawOption) => string>,
|
|
146
|
+
},
|
|
147
|
+
optionIcon: {
|
|
148
|
+
default: undefined,
|
|
149
|
+
type: Function as PropType<(option: RawOption) => string>,
|
|
150
|
+
},
|
|
141
151
|
});
|
|
142
152
|
|
|
143
153
|
const emit = defineEmits(['update:modelValue']);
|