sprintify-ui 0.6.84 → 0.6.85
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/types/components/BaseAutocomplete.vue.d.ts +7 -7
- package/dist/types/components/BaseAutocompleteDrawer.vue.d.ts +1 -1
- package/dist/types/components/BaseAutocompleteFetch.vue.d.ts +5 -5
- package/dist/types/components/BaseBelongsTo.vue.d.ts +4 -4
- package/dist/types/components/BaseBelongsToFetch.vue.d.ts +5 -5
- package/dist/types/components/BaseButtonGroup.vue.d.ts +11 -11
- package/dist/types/components/BaseColor.vue.d.ts +6 -6
- package/dist/types/components/BaseDropdownAutocomplete.vue.d.ts +7 -7
- package/dist/types/components/BaseHasMany.vue.d.ts +5 -5
- package/dist/types/components/BaseRadioGroup.vue.d.ts +3 -3
- package/dist/types/components/BaseSelect.vue.d.ts +4 -4
- package/dist/types/components/BaseTagAutocomplete.vue.d.ts +6 -6
- package/dist/types/components/BaseTagAutocompleteFetch.vue.d.ts +4 -4
- package/dist/types/composables/hasOptions.d.ts +2 -2
- package/dist/types/types/Media.d.ts +1 -1
- package/dist/types/types/Notification.d.ts +1 -1
- package/dist/types/types/UploadedFile.d.ts +1 -1
- package/dist/types/types/User.d.ts +1 -1
- package/dist/types/types/index.d.ts +2 -2
- package/dist/types/utils/sizes.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/BaseAutocomplete.vue +5 -5
- package/src/components/BaseAutocompleteFetch.vue +4 -4
- package/src/components/BaseBelongsTo.vue +3 -3
- package/src/components/BaseBelongsToFetch.vue +4 -4
- package/src/components/BaseButtonGroup.vue +5 -5
- package/src/components/BaseColor.vue +4 -4
- package/src/components/BaseDropdownAutocomplete.vue +5 -5
- package/src/components/BaseHasMany.vue +4 -4
- package/src/components/BaseRadioGroup.vue +2 -2
- package/src/components/BaseSelect.vue +2 -2
- package/src/components/BaseTagAutocomplete.vue +3 -3
- package/src/components/BaseTagAutocompleteFetch.vue +3 -3
- package/src/composables/hasOptions.ts +3 -3
- package/src/types/Media.ts +1 -1
- package/src/types/Notification.ts +1 -1
- package/src/types/UploadedFile.ts +1 -1
- package/src/types/User.ts +1 -1
- package/src/types/index.ts +2 -2
- package/src/utils/sizes.ts +3 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType, ComputedRef } from 'vue';
|
|
2
|
-
import { NormalizedOption,
|
|
2
|
+
import { NormalizedOption, RawOption } from '@/types';
|
|
3
3
|
import { SelectConfiguration } from '@/types';
|
|
4
4
|
declare function open(): void;
|
|
5
5
|
declare function close(): void;
|
|
@@ -9,11 +9,11 @@ declare function blur(): void;
|
|
|
9
9
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
10
10
|
modelValue: {
|
|
11
11
|
default: undefined;
|
|
12
|
-
type: PropType<
|
|
12
|
+
type: PropType<RawOption | null | undefined>;
|
|
13
13
|
};
|
|
14
14
|
options: {
|
|
15
15
|
required: true;
|
|
16
|
-
type: PropType<
|
|
16
|
+
type: PropType<RawOption[]>;
|
|
17
17
|
};
|
|
18
18
|
labelKey: {
|
|
19
19
|
required: true;
|
|
@@ -109,11 +109,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
109
109
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
110
110
|
modelValue: {
|
|
111
111
|
default: undefined;
|
|
112
|
-
type: PropType<
|
|
112
|
+
type: PropType<RawOption | null | undefined>;
|
|
113
113
|
};
|
|
114
114
|
options: {
|
|
115
115
|
required: true;
|
|
116
|
-
type: PropType<
|
|
116
|
+
type: PropType<RawOption[]>;
|
|
117
117
|
};
|
|
118
118
|
labelKey: {
|
|
119
119
|
required: true;
|
|
@@ -203,7 +203,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
203
203
|
}, {
|
|
204
204
|
filter: (option: NormalizedOption) => boolean;
|
|
205
205
|
required: boolean;
|
|
206
|
-
modelValue:
|
|
206
|
+
modelValue: RawOption | null | undefined;
|
|
207
207
|
size: "xs" | "sm" | "md";
|
|
208
208
|
select: SelectConfiguration | undefined;
|
|
209
209
|
name: string;
|
|
@@ -233,7 +233,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
233
233
|
open: typeof open;
|
|
234
234
|
close: typeof close;
|
|
235
235
|
keywords: ComputedRef<string>;
|
|
236
|
-
option:
|
|
236
|
+
option: RawOption;
|
|
237
237
|
selected: boolean;
|
|
238
238
|
active: boolean;
|
|
239
239
|
}): any;
|
|
@@ -78,7 +78,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
78
78
|
}, {}>, {
|
|
79
79
|
empty?(_: {}): any;
|
|
80
80
|
option?(_: {
|
|
81
|
-
option: import("@/types").
|
|
81
|
+
option: import("@/types").RawOption;
|
|
82
82
|
selected: boolean;
|
|
83
83
|
active: boolean;
|
|
84
84
|
}): any;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { RawOption, SelectConfiguration } from '@/types';
|
|
3
3
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
4
4
|
modelValue: {
|
|
5
5
|
default: undefined;
|
|
6
|
-
type: PropType<
|
|
6
|
+
type: PropType<RawOption | null | undefined>;
|
|
7
7
|
};
|
|
8
8
|
url: {
|
|
9
9
|
required: true;
|
|
@@ -92,7 +92,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
92
92
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
93
93
|
modelValue: {
|
|
94
94
|
default: undefined;
|
|
95
|
-
type: PropType<
|
|
95
|
+
type: PropType<RawOption | null | undefined>;
|
|
96
96
|
};
|
|
97
97
|
url: {
|
|
98
98
|
required: true;
|
|
@@ -174,7 +174,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
174
174
|
onFocus?: ((...args: any[]) => any) | undefined;
|
|
175
175
|
}, {
|
|
176
176
|
required: boolean;
|
|
177
|
-
modelValue:
|
|
177
|
+
modelValue: RawOption | null | undefined;
|
|
178
178
|
size: "xs" | "sm" | "md";
|
|
179
179
|
select: SelectConfiguration | undefined;
|
|
180
180
|
name: string;
|
|
@@ -196,7 +196,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
196
196
|
open: () => void;
|
|
197
197
|
close: () => void;
|
|
198
198
|
keywords: import("vue").ComputedRef<string>;
|
|
199
|
-
option:
|
|
199
|
+
option: RawOption;
|
|
200
200
|
selected: boolean;
|
|
201
201
|
active: boolean;
|
|
202
202
|
}): any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { RawOption, SelectConfiguration } from '@/types';
|
|
3
3
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
4
4
|
modelValue: {
|
|
5
5
|
default: undefined;
|
|
@@ -7,7 +7,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
7
7
|
};
|
|
8
8
|
options: {
|
|
9
9
|
required: true;
|
|
10
|
-
type: PropType<
|
|
10
|
+
type: PropType<RawOption[]>;
|
|
11
11
|
};
|
|
12
12
|
primaryKey: {
|
|
13
13
|
default: string;
|
|
@@ -88,7 +88,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
88
88
|
};
|
|
89
89
|
options: {
|
|
90
90
|
required: true;
|
|
91
|
-
type: PropType<
|
|
91
|
+
type: PropType<RawOption[]>;
|
|
92
92
|
};
|
|
93
93
|
primaryKey: {
|
|
94
94
|
default: string;
|
|
@@ -180,7 +180,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
180
180
|
open: () => void;
|
|
181
181
|
close: () => void;
|
|
182
182
|
keywords: import("vue").ComputedRef<string>;
|
|
183
|
-
option:
|
|
183
|
+
option: RawOption;
|
|
184
184
|
selected: boolean;
|
|
185
185
|
active: boolean;
|
|
186
186
|
}): any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { RawOption, SelectConfiguration } from '@/types';
|
|
3
3
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
4
4
|
modelValue: {
|
|
5
5
|
default: undefined;
|
|
@@ -39,7 +39,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
39
39
|
};
|
|
40
40
|
currentModel: {
|
|
41
41
|
default: undefined;
|
|
42
|
-
type: PropType<
|
|
42
|
+
type: PropType<RawOption | null | undefined>;
|
|
43
43
|
};
|
|
44
44
|
hasError: {
|
|
45
45
|
default: boolean;
|
|
@@ -128,7 +128,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
128
128
|
};
|
|
129
129
|
currentModel: {
|
|
130
130
|
default: undefined;
|
|
131
|
-
type: PropType<
|
|
131
|
+
type: PropType<RawOption | null | undefined>;
|
|
132
132
|
};
|
|
133
133
|
hasError: {
|
|
134
134
|
default: boolean;
|
|
@@ -190,7 +190,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
190
190
|
emptyOptionLabel: string;
|
|
191
191
|
primaryKey: string;
|
|
192
192
|
showRouteUrl: ((id: string | number) => string) | undefined;
|
|
193
|
-
currentModel:
|
|
193
|
+
currentModel: RawOption | null | undefined;
|
|
194
194
|
}, {}>, {
|
|
195
195
|
option?(_: {
|
|
196
196
|
focus: () => void;
|
|
@@ -198,7 +198,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
198
198
|
open: () => void;
|
|
199
199
|
close: () => void;
|
|
200
200
|
keywords: import("vue").ComputedRef<string>;
|
|
201
|
-
option:
|
|
201
|
+
option: RawOption;
|
|
202
202
|
selected: boolean;
|
|
203
203
|
active: boolean;
|
|
204
204
|
}): any;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import { NormalizedOption,
|
|
2
|
+
import { NormalizedOption, RawOption } from '@/types';
|
|
3
3
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
4
4
|
modelValue: {
|
|
5
5
|
default: undefined;
|
|
6
|
-
type: PropType<
|
|
6
|
+
type: PropType<RawOption | RawOption[] | null | undefined>;
|
|
7
7
|
};
|
|
8
8
|
class: {
|
|
9
9
|
default: string;
|
|
@@ -26,8 +26,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
26
26
|
type: PropType<"button" | "submit">;
|
|
27
27
|
};
|
|
28
28
|
buttonColor: {
|
|
29
|
-
default(option:
|
|
30
|
-
type: PropType<(option:
|
|
29
|
+
default(option: RawOption, selected: boolean): "" | "primary";
|
|
30
|
+
type: PropType<(option: RawOption, selected: boolean) => string>;
|
|
31
31
|
};
|
|
32
32
|
twButton: {
|
|
33
33
|
default: string;
|
|
@@ -39,7 +39,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
39
39
|
};
|
|
40
40
|
options: {
|
|
41
41
|
required: true;
|
|
42
|
-
type: PropType<
|
|
42
|
+
type: PropType<RawOption[]>;
|
|
43
43
|
};
|
|
44
44
|
labelKey: {
|
|
45
45
|
required: true;
|
|
@@ -66,7 +66,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
66
66
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
67
67
|
modelValue: {
|
|
68
68
|
default: undefined;
|
|
69
|
-
type: PropType<
|
|
69
|
+
type: PropType<RawOption | RawOption[] | null | undefined>;
|
|
70
70
|
};
|
|
71
71
|
class: {
|
|
72
72
|
default: string;
|
|
@@ -89,8 +89,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
89
89
|
type: PropType<"button" | "submit">;
|
|
90
90
|
};
|
|
91
91
|
buttonColor: {
|
|
92
|
-
default(option:
|
|
93
|
-
type: PropType<(option:
|
|
92
|
+
default(option: RawOption, selected: boolean): "" | "primary";
|
|
93
|
+
type: PropType<(option: RawOption, selected: boolean) => string>;
|
|
94
94
|
};
|
|
95
95
|
twButton: {
|
|
96
96
|
default: string;
|
|
@@ -102,7 +102,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
102
102
|
};
|
|
103
103
|
options: {
|
|
104
104
|
required: true;
|
|
105
|
-
type: PropType<
|
|
105
|
+
type: PropType<RawOption[]>;
|
|
106
106
|
};
|
|
107
107
|
labelKey: {
|
|
108
108
|
required: true;
|
|
@@ -129,13 +129,13 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
129
129
|
}, {
|
|
130
130
|
class: string | string[];
|
|
131
131
|
required: boolean;
|
|
132
|
-
modelValue:
|
|
132
|
+
modelValue: RawOption | RawOption[] | null | undefined;
|
|
133
133
|
size: "xs" | "sm" | "md";
|
|
134
134
|
name: string;
|
|
135
135
|
disabled: boolean;
|
|
136
136
|
hasError: boolean;
|
|
137
137
|
buttonType: "button" | "submit";
|
|
138
|
-
buttonColor: (option:
|
|
138
|
+
buttonColor: (option: RawOption, selected: boolean) => string;
|
|
139
139
|
twButton: string | string[];
|
|
140
140
|
spacing: "default" | "none";
|
|
141
141
|
multiple: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { RawOption } from '@/types';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<{
|
|
4
4
|
modelValue: {
|
|
5
5
|
default: undefined;
|
|
@@ -26,8 +26,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
26
26
|
default(): string[];
|
|
27
27
|
};
|
|
28
28
|
buttonColor: {
|
|
29
|
-
default(option:
|
|
30
|
-
type: PropType<(option:
|
|
29
|
+
default(option: RawOption, selected: boolean): any;
|
|
30
|
+
type: PropType<(option: RawOption, selected: boolean) => string>;
|
|
31
31
|
};
|
|
32
32
|
multiple: {
|
|
33
33
|
default: boolean;
|
|
@@ -69,8 +69,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
69
69
|
default(): string[];
|
|
70
70
|
};
|
|
71
71
|
buttonColor: {
|
|
72
|
-
default(option:
|
|
73
|
-
type: PropType<(option:
|
|
72
|
+
default(option: RawOption, selected: boolean): any;
|
|
73
|
+
type: PropType<(option: RawOption, selected: boolean) => string>;
|
|
74
74
|
};
|
|
75
75
|
multiple: {
|
|
76
76
|
default: boolean;
|
|
@@ -94,7 +94,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
94
94
|
disabled: boolean;
|
|
95
95
|
hasError: boolean;
|
|
96
96
|
buttonType: "button" | "submit";
|
|
97
|
-
buttonColor: (option:
|
|
97
|
+
buttonColor: (option: RawOption, selected: boolean) => string;
|
|
98
98
|
multiple: boolean;
|
|
99
99
|
colors: string[];
|
|
100
100
|
}, {}>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { RawOption, SelectConfiguration } from '@/types';
|
|
3
3
|
import { Placement } from '@floating-ui/vue';
|
|
4
4
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
5
5
|
modelValue: {
|
|
6
|
-
type: PropType<
|
|
6
|
+
type: PropType<RawOption | RawOption[] | null | undefined>;
|
|
7
7
|
default: undefined;
|
|
8
8
|
};
|
|
9
9
|
multiple: {
|
|
@@ -15,7 +15,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
15
15
|
default: undefined;
|
|
16
16
|
};
|
|
17
17
|
options: {
|
|
18
|
-
type: PropType<
|
|
18
|
+
type: PropType<RawOption[] | undefined>;
|
|
19
19
|
default: undefined;
|
|
20
20
|
};
|
|
21
21
|
labelKey: {
|
|
@@ -50,7 +50,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
50
50
|
"update:model-value": (...args: any[]) => void;
|
|
51
51
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
52
52
|
modelValue: {
|
|
53
|
-
type: PropType<
|
|
53
|
+
type: PropType<RawOption | RawOption[] | null | undefined>;
|
|
54
54
|
default: undefined;
|
|
55
55
|
};
|
|
56
56
|
multiple: {
|
|
@@ -62,7 +62,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
62
62
|
default: undefined;
|
|
63
63
|
};
|
|
64
64
|
options: {
|
|
65
|
-
type: PropType<
|
|
65
|
+
type: PropType<RawOption[] | undefined>;
|
|
66
66
|
default: undefined;
|
|
67
67
|
};
|
|
68
68
|
labelKey: {
|
|
@@ -97,10 +97,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
97
97
|
"onUpdate:model-value"?: ((...args: any[]) => any) | undefined;
|
|
98
98
|
}, {
|
|
99
99
|
required: boolean;
|
|
100
|
-
modelValue:
|
|
100
|
+
modelValue: RawOption | RawOption[] | null | undefined;
|
|
101
101
|
size: "xs" | "sm" | "base";
|
|
102
102
|
select: SelectConfiguration | undefined;
|
|
103
|
-
options:
|
|
103
|
+
options: RawOption[] | undefined;
|
|
104
104
|
labelKey: string;
|
|
105
105
|
valueKey: string;
|
|
106
106
|
emptyOptionLabel: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RawOption } from '@/types';
|
|
2
2
|
import { PropType } from 'vue';
|
|
3
3
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
4
4
|
modelValue: {
|
|
@@ -43,7 +43,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
43
43
|
};
|
|
44
44
|
currentModels: {
|
|
45
45
|
default(): undefined;
|
|
46
|
-
type: PropType<
|
|
46
|
+
type: PropType<RawOption[] | undefined>;
|
|
47
47
|
};
|
|
48
48
|
hasError: {
|
|
49
49
|
default: boolean;
|
|
@@ -100,7 +100,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
100
100
|
};
|
|
101
101
|
currentModels: {
|
|
102
102
|
default(): undefined;
|
|
103
|
-
type: PropType<
|
|
103
|
+
type: PropType<RawOption[] | undefined>;
|
|
104
104
|
};
|
|
105
105
|
hasError: {
|
|
106
106
|
default: boolean;
|
|
@@ -118,7 +118,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
118
118
|
max: number;
|
|
119
119
|
primaryKey: string;
|
|
120
120
|
showRouteUrl: ((ids: (string | number)[]) => string) | undefined;
|
|
121
|
-
currentModels:
|
|
121
|
+
currentModels: RawOption[] | undefined;
|
|
122
122
|
}, {}>, {
|
|
123
123
|
items?(_: {
|
|
124
124
|
items: import("@/types").NormalizedOption[];
|
|
@@ -131,7 +131,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
131
131
|
open: () => void;
|
|
132
132
|
close: () => void;
|
|
133
133
|
keywords: import("vue").ComputedRef<string>;
|
|
134
|
-
option:
|
|
134
|
+
option: RawOption;
|
|
135
135
|
selected: boolean;
|
|
136
136
|
active: boolean;
|
|
137
137
|
}): any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import { NormalizedOption,
|
|
2
|
+
import { NormalizedOption, RawOption, OptionValue } from '@/types';
|
|
3
3
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
4
4
|
modelValue: {
|
|
5
5
|
default: undefined;
|
|
@@ -19,7 +19,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
19
19
|
};
|
|
20
20
|
options: {
|
|
21
21
|
required: true;
|
|
22
|
-
type: PropType<
|
|
22
|
+
type: PropType<RawOption[]>;
|
|
23
23
|
};
|
|
24
24
|
labelKey: {
|
|
25
25
|
required: true;
|
|
@@ -62,7 +62,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
62
62
|
};
|
|
63
63
|
options: {
|
|
64
64
|
required: true;
|
|
65
|
-
type: PropType<
|
|
65
|
+
type: PropType<RawOption[]>;
|
|
66
66
|
};
|
|
67
67
|
labelKey: {
|
|
68
68
|
required: true;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { RawOption } from '@/types';
|
|
3
3
|
type SelectOption = string | number | null;
|
|
4
4
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
5
5
|
modelValue: {
|
|
@@ -36,7 +36,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
36
36
|
};
|
|
37
37
|
options: {
|
|
38
38
|
default: undefined;
|
|
39
|
-
type: PropType<
|
|
39
|
+
type: PropType<RawOption[]>;
|
|
40
40
|
};
|
|
41
41
|
labelKey: {
|
|
42
42
|
default: undefined;
|
|
@@ -87,7 +87,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
87
87
|
};
|
|
88
88
|
options: {
|
|
89
89
|
default: undefined;
|
|
90
|
-
type: PropType<
|
|
90
|
+
type: PropType<RawOption[]>;
|
|
91
91
|
};
|
|
92
92
|
labelKey: {
|
|
93
93
|
default: undefined;
|
|
@@ -108,7 +108,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
108
108
|
required: boolean;
|
|
109
109
|
modelValue: SelectOption | undefined;
|
|
110
110
|
size: "xs" | "sm" | "md";
|
|
111
|
-
options:
|
|
111
|
+
options: RawOption[];
|
|
112
112
|
labelKey: string;
|
|
113
113
|
valueKey: string;
|
|
114
114
|
name: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType, ComputedRef } from 'vue';
|
|
2
|
-
import { NormalizedOption,
|
|
2
|
+
import { NormalizedOption, RawOption } from '@/types';
|
|
3
3
|
declare function open(): void;
|
|
4
4
|
declare function close(): void;
|
|
5
5
|
declare function setKeywords(input: string): void;
|
|
@@ -8,11 +8,11 @@ declare function blur(): void;
|
|
|
8
8
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
9
9
|
modelValue: {
|
|
10
10
|
required: true;
|
|
11
|
-
type: PropType<
|
|
11
|
+
type: PropType<RawOption[] | null>;
|
|
12
12
|
};
|
|
13
13
|
options: {
|
|
14
14
|
required: true;
|
|
15
|
-
type: PropType<
|
|
15
|
+
type: PropType<RawOption[]>;
|
|
16
16
|
};
|
|
17
17
|
labelKey: {
|
|
18
18
|
required: true;
|
|
@@ -97,11 +97,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
97
97
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
98
98
|
modelValue: {
|
|
99
99
|
required: true;
|
|
100
|
-
type: PropType<
|
|
100
|
+
type: PropType<RawOption[] | null>;
|
|
101
101
|
};
|
|
102
102
|
options: {
|
|
103
103
|
required: true;
|
|
104
|
-
type: PropType<
|
|
104
|
+
type: PropType<RawOption[]>;
|
|
105
105
|
};
|
|
106
106
|
labelKey: {
|
|
107
107
|
required: true;
|
|
@@ -212,7 +212,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
212
212
|
open: typeof open;
|
|
213
213
|
close: typeof close;
|
|
214
214
|
keywords: ComputedRef<string>;
|
|
215
|
-
option:
|
|
215
|
+
option: RawOption;
|
|
216
216
|
selected: boolean;
|
|
217
217
|
active: boolean;
|
|
218
218
|
}): any;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { RawOption } from '@/types';
|
|
3
3
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
4
4
|
modelValue: {
|
|
5
5
|
required: true;
|
|
6
|
-
type: PropType<
|
|
6
|
+
type: PropType<RawOption[]>;
|
|
7
7
|
};
|
|
8
8
|
url: {
|
|
9
9
|
required: true;
|
|
@@ -59,7 +59,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
59
59
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
60
60
|
modelValue: {
|
|
61
61
|
required: true;
|
|
62
|
-
type: PropType<
|
|
62
|
+
type: PropType<RawOption[]>;
|
|
63
63
|
};
|
|
64
64
|
url: {
|
|
65
65
|
required: true;
|
|
@@ -126,7 +126,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
126
126
|
open: () => void;
|
|
127
127
|
close: () => void;
|
|
128
128
|
keywords: import("vue").ComputedRef<string>;
|
|
129
|
-
option:
|
|
129
|
+
option: RawOption;
|
|
130
130
|
selected: boolean;
|
|
131
131
|
active: boolean;
|
|
132
132
|
}): any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
import { NormalizedOption,
|
|
3
|
-
export declare function useHasOptions(modelValue: Ref<
|
|
2
|
+
import { NormalizedOption, RawOption } from '@/types';
|
|
3
|
+
export declare function useHasOptions(modelValue: Ref<RawOption[] | RawOption | null | undefined>, options: Ref<RawOption[]>, labelKey: Ref<string>, valueKey: Ref<string>, multiple?: Ref<boolean>): {
|
|
4
4
|
normalizedOptions: import("vue").ComputedRef<NormalizedOption[]>;
|
|
5
5
|
normalizedModelValue: import("vue").ComputedRef<NormalizedOption | NormalizedOption[] | null>;
|
|
6
6
|
isSelected: (option: NormalizedOption) => boolean;
|
|
@@ -27,9 +27,9 @@ export interface DataTableQuery extends Record<string, any> {
|
|
|
27
27
|
filter?: Record<string, any>;
|
|
28
28
|
}
|
|
29
29
|
export type OptionValue = string | number | null;
|
|
30
|
-
export type
|
|
30
|
+
export type RawOption = Record<string, any>;
|
|
31
31
|
export type NormalizedOption = {
|
|
32
|
-
option:
|
|
32
|
+
option: RawOption;
|
|
33
33
|
value: OptionValue;
|
|
34
34
|
label: string;
|
|
35
35
|
};
|
package/package.json
CHANGED
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
|
|
109
109
|
<script lang="ts" setup>
|
|
110
110
|
import { PropType, ComputedRef } from 'vue';
|
|
111
|
-
import { NormalizedOption,
|
|
111
|
+
import { NormalizedOption, RawOption, OptionValue } from '@/types';
|
|
112
112
|
import { useHasOptions } from '@/composables/hasOptions';
|
|
113
113
|
import { useField } from '@/composables/field';
|
|
114
114
|
import { Icon as BaseIcon } from '@iconify/vue';
|
|
@@ -122,11 +122,11 @@ import { BaseInput, BaseSelect } from '.';
|
|
|
122
122
|
const props = defineProps({
|
|
123
123
|
modelValue: {
|
|
124
124
|
default: undefined,
|
|
125
|
-
type: [Object, null] as PropType<
|
|
125
|
+
type: [Object, null] as PropType<RawOption | null | undefined>,
|
|
126
126
|
},
|
|
127
127
|
options: {
|
|
128
128
|
required: true,
|
|
129
|
-
type: Array as PropType<
|
|
129
|
+
type: Array as PropType<RawOption[]>,
|
|
130
130
|
},
|
|
131
131
|
labelKey: {
|
|
132
132
|
required: true,
|
|
@@ -411,7 +411,7 @@ const clear = () => {
|
|
|
411
411
|
emit('clear');
|
|
412
412
|
};
|
|
413
413
|
|
|
414
|
-
function onSelect(normalizedModelValue:
|
|
414
|
+
function onSelect(normalizedModelValue: RawOption | null | undefined) {
|
|
415
415
|
focus();
|
|
416
416
|
update(normalizedModelValue);
|
|
417
417
|
if (props.dropdownShow == 'focus') {
|
|
@@ -419,7 +419,7 @@ function onSelect(normalizedModelValue: Option | null | undefined) {
|
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
|
|
422
|
-
function update(normalizedSelection:
|
|
422
|
+
function update(normalizedSelection: RawOption | null | undefined) {
|
|
423
423
|
// Re-activate filter
|
|
424
424
|
shouldFilter.value = false;
|
|
425
425
|
|
|
@@ -66,7 +66,7 @@ import { debounce, throttle } from 'lodash';
|
|
|
66
66
|
import { PropType } from 'vue';
|
|
67
67
|
import {
|
|
68
68
|
Collection,
|
|
69
|
-
|
|
69
|
+
RawOption,
|
|
70
70
|
PaginatedCollection,
|
|
71
71
|
ResourceCollection,
|
|
72
72
|
SelectConfiguration,
|
|
@@ -88,7 +88,7 @@ import { Size } from '@/utils/sizes';
|
|
|
88
88
|
const props = defineProps({
|
|
89
89
|
modelValue: {
|
|
90
90
|
default: undefined,
|
|
91
|
-
type: [Object, null] as PropType<
|
|
91
|
+
type: [Object, null] as PropType<RawOption | null | undefined>,
|
|
92
92
|
},
|
|
93
93
|
url: {
|
|
94
94
|
required: true,
|
|
@@ -177,7 +177,7 @@ const fetching = ref(false);
|
|
|
177
177
|
const firstSearch = ref(false);
|
|
178
178
|
const keywords = ref('');
|
|
179
179
|
const page = ref(1);
|
|
180
|
-
const options = ref<
|
|
180
|
+
const options = ref<RawOption[]>([]);
|
|
181
181
|
|
|
182
182
|
const data = ref<null | ResourceCollection | PaginatedCollection | Collection>(
|
|
183
183
|
null
|
|
@@ -268,7 +268,7 @@ const debouncedSearch = debounce(() => {
|
|
|
268
268
|
search();
|
|
269
269
|
}, 300);
|
|
270
270
|
|
|
271
|
-
function filterOptions(option:
|
|
271
|
+
function filterOptions(option: RawOption): boolean {
|
|
272
272
|
// Do nothing if showEmptyOption is false
|
|
273
273
|
if (!props.showEmptyOption) {
|
|
274
274
|
return true;
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
<script lang="ts" setup>
|
|
46
46
|
import { PropType } from 'vue';
|
|
47
47
|
import BaseAutocomplete from './BaseAutocomplete.vue';
|
|
48
|
-
import {
|
|
48
|
+
import { RawOption, SelectConfiguration } from '@/types';
|
|
49
49
|
import { Size } from '@/utils/sizes';
|
|
50
50
|
|
|
51
51
|
const props = defineProps({
|
|
@@ -57,7 +57,7 @@ const props = defineProps({
|
|
|
57
57
|
},
|
|
58
58
|
options: {
|
|
59
59
|
required: true,
|
|
60
|
-
type: Array as PropType<
|
|
60
|
+
type: Array as PropType<RawOption[]>,
|
|
61
61
|
},
|
|
62
62
|
primaryKey: {
|
|
63
63
|
default: 'id',
|
|
@@ -135,7 +135,7 @@ const model = computed(() => {
|
|
|
135
135
|
: null;
|
|
136
136
|
});
|
|
137
137
|
|
|
138
|
-
function onUpdate(newModel:
|
|
138
|
+
function onUpdate(newModel: RawOption | null) {
|
|
139
139
|
if (!newModel) {
|
|
140
140
|
emit('update:modelValue', null, null);
|
|
141
141
|
} else {
|
|
@@ -47,7 +47,7 @@ import { PropType } from 'vue';
|
|
|
47
47
|
import { AxiosResponse } from 'axios';
|
|
48
48
|
import { config } from '@/index';
|
|
49
49
|
import BaseAutocompleteFetch from './BaseAutocompleteFetch.vue';
|
|
50
|
-
import {
|
|
50
|
+
import { RawOption, SelectConfiguration } from '@/types';
|
|
51
51
|
import { Size } from '@/utils/sizes';
|
|
52
52
|
import { debounce, isObject } from 'lodash';
|
|
53
53
|
|
|
@@ -92,7 +92,7 @@ const props = defineProps({
|
|
|
92
92
|
},
|
|
93
93
|
currentModel: {
|
|
94
94
|
default: undefined,
|
|
95
|
-
type: [Object, null, undefined] as PropType<
|
|
95
|
+
type: [Object, null, undefined] as PropType<RawOption | null | undefined>,
|
|
96
96
|
},
|
|
97
97
|
hasError: {
|
|
98
98
|
default: false,
|
|
@@ -144,7 +144,7 @@ const autocompleteFetch = ref<InstanceType<
|
|
|
144
144
|
typeof BaseAutocompleteFetch
|
|
145
145
|
> | null>(null);
|
|
146
146
|
|
|
147
|
-
const model = ref<
|
|
147
|
+
const model = ref<RawOption | null>(null);
|
|
148
148
|
const ensureModelIsFilledDebounced = debounce(ensureModelIsFilled, 100);
|
|
149
149
|
|
|
150
150
|
watch(
|
|
@@ -159,7 +159,7 @@ watch(
|
|
|
159
159
|
|
|
160
160
|
ensureModelIsFilledDebounced();
|
|
161
161
|
|
|
162
|
-
function onUpdate(newModel:
|
|
162
|
+
function onUpdate(newModel: RawOption | null) {
|
|
163
163
|
if (!newModel) {
|
|
164
164
|
model.value = null;
|
|
165
165
|
emit('update:modelValue', null, null);
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
<script lang="ts" setup>
|
|
29
29
|
import { PropType, computed } from 'vue';
|
|
30
|
-
import { NormalizedOption,
|
|
30
|
+
import { NormalizedOption, RawOption } from '@/types';
|
|
31
31
|
import { cloneDeep, isArray } from 'lodash';
|
|
32
32
|
import { useHasOptions } from '@/composables/hasOptions';
|
|
33
33
|
import { useField } from '@/composables/field';
|
|
@@ -43,7 +43,7 @@ const props = defineProps({
|
|
|
43
43
|
modelValue: {
|
|
44
44
|
default: undefined,
|
|
45
45
|
type: [Object, Array, null, undefined] as PropType<
|
|
46
|
-
|
|
46
|
+
RawOption[] | RawOption | null | undefined
|
|
47
47
|
>,
|
|
48
48
|
},
|
|
49
49
|
class: {
|
|
@@ -67,10 +67,10 @@ const props = defineProps({
|
|
|
67
67
|
type: String as PropType<'button' | 'submit'>,
|
|
68
68
|
},
|
|
69
69
|
buttonColor: {
|
|
70
|
-
default(option:
|
|
70
|
+
default(option: RawOption, selected: boolean) {
|
|
71
71
|
return selected ? 'primary' : ''
|
|
72
72
|
},
|
|
73
|
-
type: Function as PropType<(option:
|
|
73
|
+
type: Function as PropType<(option: RawOption, selected: boolean) => string>,
|
|
74
74
|
},
|
|
75
75
|
twButton: {
|
|
76
76
|
default: '',
|
|
@@ -82,7 +82,7 @@ const props = defineProps({
|
|
|
82
82
|
},
|
|
83
83
|
options: {
|
|
84
84
|
required: true,
|
|
85
|
-
type: Array as PropType<
|
|
85
|
+
type: Array as PropType<RawOption[]>,
|
|
86
86
|
},
|
|
87
87
|
labelKey: {
|
|
88
88
|
required: true,
|
|
@@ -35,7 +35,7 @@ import { PropType } from 'vue';
|
|
|
35
35
|
import { BaseButtonGroup } from '.';
|
|
36
36
|
import { isArray } from 'lodash';
|
|
37
37
|
import { useField } from '@/composables/field';
|
|
38
|
-
import {
|
|
38
|
+
import { RawOption } from '@/types';
|
|
39
39
|
import { palette } from '@/utils/colors';
|
|
40
40
|
import { getContrast } from 'color2k';
|
|
41
41
|
import { Size } from '@/utils/sizes';
|
|
@@ -70,10 +70,10 @@ const props = defineProps({
|
|
|
70
70
|
},
|
|
71
71
|
},
|
|
72
72
|
buttonColor: {
|
|
73
|
-
default(option:
|
|
73
|
+
default(option: RawOption, selected: boolean) {
|
|
74
74
|
return option.value;
|
|
75
75
|
},
|
|
76
|
-
type: Function as PropType<(option:
|
|
76
|
+
type: Function as PropType<(option: RawOption, selected: boolean) => string>,
|
|
77
77
|
},
|
|
78
78
|
multiple: {
|
|
79
79
|
default: false,
|
|
@@ -126,7 +126,7 @@ const { emitUpdate } = useField({
|
|
|
126
126
|
emit: emit,
|
|
127
127
|
});
|
|
128
128
|
|
|
129
|
-
function transformModelValue(payload:
|
|
129
|
+
function transformModelValue(payload: RawOption | RawOption[] | null) {
|
|
130
130
|
if (props.multiple) {
|
|
131
131
|
let newModalValue = [] as string[];
|
|
132
132
|
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
<script lang="ts" setup>
|
|
62
62
|
import { isArray } from 'lodash';
|
|
63
63
|
import { PropType } from 'vue';
|
|
64
|
-
import {
|
|
64
|
+
import { RawOption, SelectConfiguration } from '@/types';
|
|
65
65
|
import BaseDropdown from './BaseDropdown.vue';
|
|
66
66
|
import BaseAutocomplete from './BaseAutocomplete.vue';
|
|
67
67
|
import BaseAutocompleteFetch from './BaseAutocompleteFetch.vue';
|
|
@@ -72,7 +72,7 @@ import { Placement } from '@floating-ui/vue';
|
|
|
72
72
|
const props = defineProps({
|
|
73
73
|
modelValue: {
|
|
74
74
|
type: [Array, Object, null, undefined] as PropType<
|
|
75
|
-
|
|
75
|
+
RawOption[] | RawOption | null | undefined
|
|
76
76
|
>,
|
|
77
77
|
default: undefined,
|
|
78
78
|
},
|
|
@@ -85,7 +85,7 @@ const props = defineProps({
|
|
|
85
85
|
default: undefined,
|
|
86
86
|
},
|
|
87
87
|
options: {
|
|
88
|
-
type: Array as PropType<
|
|
88
|
+
type: Array as PropType<RawOption[] | undefined>,
|
|
89
89
|
default: undefined,
|
|
90
90
|
},
|
|
91
91
|
labelKey: {
|
|
@@ -174,7 +174,7 @@ watch(
|
|
|
174
174
|
);
|
|
175
175
|
|
|
176
176
|
function onUpdate(
|
|
177
|
-
value:
|
|
177
|
+
value: RawOption | RawOption[] | null | undefined,
|
|
178
178
|
close: () => void
|
|
179
179
|
) {
|
|
180
180
|
newValue.value = getNewValue(value);
|
|
@@ -186,7 +186,7 @@ function onUpdate(
|
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
function getNewValue(value:
|
|
189
|
+
function getNewValue(value: RawOption | RawOption[] | null | undefined) {
|
|
190
190
|
if (isArray(value)) {
|
|
191
191
|
return value;
|
|
192
192
|
}
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
|
|
46
46
|
<script lang="ts" setup>
|
|
47
47
|
import { debounce } from 'lodash';
|
|
48
|
-
import {
|
|
48
|
+
import { RawOption } from '@/types';
|
|
49
49
|
import { config } from '@/index';
|
|
50
50
|
import { PropType } from 'vue';
|
|
51
51
|
import BaseTagAutocompleteFetch from './BaseTagAutocompleteFetch.vue';
|
|
@@ -97,7 +97,7 @@ const props = defineProps({
|
|
|
97
97
|
default() {
|
|
98
98
|
return undefined;
|
|
99
99
|
},
|
|
100
|
-
type: Array as PropType<
|
|
100
|
+
type: Array as PropType<RawOption[] | undefined>,
|
|
101
101
|
},
|
|
102
102
|
hasError: {
|
|
103
103
|
default: false,
|
|
@@ -113,7 +113,7 @@ const tagAutocompleteFetch = ref<InstanceType<
|
|
|
113
113
|
typeof BaseTagAutocompleteFetch
|
|
114
114
|
> | null>(null);
|
|
115
115
|
|
|
116
|
-
const models = ref<
|
|
116
|
+
const models = ref<RawOption[]>([]);
|
|
117
117
|
const ensureModelIsFilledDebounced = debounce(() => ensureModelsAreFilled(), 100);
|
|
118
118
|
|
|
119
119
|
watch(
|
|
@@ -130,7 +130,7 @@ watch(
|
|
|
130
130
|
|
|
131
131
|
ensureModelIsFilledDebounced();
|
|
132
132
|
|
|
133
|
-
function onUpdate(newModels:
|
|
133
|
+
function onUpdate(newModels: RawOption[]) {
|
|
134
134
|
models.value = newModels;
|
|
135
135
|
emit(
|
|
136
136
|
'update:modelValue',
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
<script lang="ts" setup>
|
|
38
38
|
import { PropType } from 'vue';
|
|
39
|
-
import { NormalizedOption,
|
|
39
|
+
import { NormalizedOption, RawOption, OptionValue } from '@/types';
|
|
40
40
|
import { useField } from '@/composables/field';
|
|
41
41
|
import { uniqueId } from 'lodash';
|
|
42
42
|
|
|
@@ -61,7 +61,7 @@ const props = defineProps({
|
|
|
61
61
|
},
|
|
62
62
|
options: {
|
|
63
63
|
required: true,
|
|
64
|
-
type: Array as PropType<
|
|
64
|
+
type: Array as PropType<RawOption[]>,
|
|
65
65
|
},
|
|
66
66
|
labelKey: {
|
|
67
67
|
required: true,
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
import { PropType } from 'vue';
|
|
42
42
|
import { get, isArray } from 'lodash';
|
|
43
43
|
import { useField } from '@/composables/field';
|
|
44
|
-
import { NormalizedOption, OptionValue,
|
|
44
|
+
import { NormalizedOption, OptionValue, RawOption } from '@/types';
|
|
45
45
|
import { t } from '@/i18n';
|
|
46
46
|
import { twMerge } from 'tailwind-merge';
|
|
47
47
|
import { Size, sizes } from '@/utils/sizes';
|
|
@@ -90,7 +90,7 @@ const props = defineProps({
|
|
|
90
90
|
},
|
|
91
91
|
options: {
|
|
92
92
|
default: undefined,
|
|
93
|
-
type: Array as PropType<
|
|
93
|
+
type: Array as PropType<RawOption[]>,
|
|
94
94
|
},
|
|
95
95
|
labelKey: {
|
|
96
96
|
default: undefined,
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
<script lang="ts" setup>
|
|
93
93
|
import { cloneDeep, get } from 'lodash';
|
|
94
94
|
import { PropType, ComputedRef } from 'vue';
|
|
95
|
-
import { NormalizedOption,
|
|
95
|
+
import { NormalizedOption, RawOption } from '@/types';
|
|
96
96
|
import { useHasOptions } from '@/composables/hasOptions';
|
|
97
97
|
import { useField } from '@/composables/field';
|
|
98
98
|
import { useClickOutside } from '@/composables/clickOutside';
|
|
@@ -107,11 +107,11 @@ const notifications = useNotificationsStore();
|
|
|
107
107
|
const props = defineProps({
|
|
108
108
|
modelValue: {
|
|
109
109
|
required: true,
|
|
110
|
-
type: [Array, null] as PropType<
|
|
110
|
+
type: [Array, null] as PropType<RawOption[] | null>,
|
|
111
111
|
},
|
|
112
112
|
options: {
|
|
113
113
|
required: true,
|
|
114
|
-
type: Array as PropType<
|
|
114
|
+
type: Array as PropType<RawOption[]>,
|
|
115
115
|
},
|
|
116
116
|
labelKey: {
|
|
117
117
|
required: true,
|
|
@@ -63,7 +63,7 @@ import { config } from '@/index';
|
|
|
63
63
|
import { PropType } from 'vue';
|
|
64
64
|
import {
|
|
65
65
|
Collection,
|
|
66
|
-
|
|
66
|
+
RawOption,
|
|
67
67
|
PaginatedCollection,
|
|
68
68
|
ResourceCollection,
|
|
69
69
|
} from '@/types';
|
|
@@ -74,7 +74,7 @@ import { t } from '@/i18n';
|
|
|
74
74
|
const props = defineProps({
|
|
75
75
|
modelValue: {
|
|
76
76
|
required: true,
|
|
77
|
-
type: Array as PropType<
|
|
77
|
+
type: Array as PropType<RawOption[]>,
|
|
78
78
|
},
|
|
79
79
|
url: {
|
|
80
80
|
required: true,
|
|
@@ -131,7 +131,7 @@ const fetching = ref(false);
|
|
|
131
131
|
const firstSearch = ref(false);
|
|
132
132
|
const keywords = ref('');
|
|
133
133
|
const page = ref(1);
|
|
134
|
-
const options = ref<
|
|
134
|
+
const options = ref<RawOption[]>([]);
|
|
135
135
|
|
|
136
136
|
const data = ref<null | ResourceCollection | PaginatedCollection | Collection>(
|
|
137
137
|
null
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
import { NormalizedOption,
|
|
2
|
+
import { NormalizedOption, RawOption } from '@/types';
|
|
3
3
|
import { isArray, isObject } from 'lodash';
|
|
4
4
|
|
|
5
5
|
export function useHasOptions(
|
|
6
|
-
modelValue: Ref<
|
|
7
|
-
options: Ref<
|
|
6
|
+
modelValue: Ref<RawOption[] | RawOption | null | undefined>,
|
|
7
|
+
options: Ref<RawOption[]>,
|
|
8
8
|
labelKey: Ref<string>,
|
|
9
9
|
valueKey: Ref<string>,
|
|
10
10
|
multiple: Ref<boolean> = ref(false)
|
package/src/types/Media.ts
CHANGED
package/src/types/User.ts
CHANGED
package/src/types/index.ts
CHANGED
|
@@ -34,10 +34,10 @@ export interface DataTableQuery extends Record<string, any> {
|
|
|
34
34
|
|
|
35
35
|
export type OptionValue = string | number | null;
|
|
36
36
|
|
|
37
|
-
export type
|
|
37
|
+
export type RawOption = Record<string, any>;
|
|
38
38
|
|
|
39
39
|
export type NormalizedOption = {
|
|
40
|
-
option:
|
|
40
|
+
option: RawOption;
|
|
41
41
|
value: OptionValue;
|
|
42
42
|
label: string;
|
|
43
43
|
};
|