vuetify 3.3.14 → 3.3.15
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/json/importMap-labs.json +4 -4
- package/dist/json/web-types.json +95 -46
- package/dist/vuetify-labs.css +411 -391
- package/dist/vuetify-labs.d.ts +447 -226
- package/dist/vuetify-labs.esm.js +47 -17
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +47 -17
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +39 -19
- package/dist/vuetify.d.ts +448 -227
- package/dist/vuetify.esm.js +47 -17
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +47 -17
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +18 -17
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VBtnToggle/VBtnToggle.css +13 -2
- package/lib/components/VBtnToggle/VBtnToggle.sass +3 -3
- package/lib/components/VBtnToggle/_variables.scss +2 -1
- package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
- package/lib/components/VCheckbox/index.d.mts +203 -87
- package/lib/components/VField/VField.css +14 -11
- package/lib/components/VField/VField.sass +14 -7
- package/lib/components/VField/_variables.scss +0 -1
- package/lib/components/VIcon/VIcon.css +1 -0
- package/lib/components/VIcon/VIcon.sass +1 -0
- package/lib/components/VOverlay/useActivator.mjs +1 -1
- package/lib/components/VOverlay/useActivator.mjs.map +1 -1
- package/lib/components/VRadio/index.d.mts +82 -23
- package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
- package/lib/components/VRadioGroup/index.d.mts +75 -109
- package/lib/components/VSelectionControl/VSelectionControl.mjs +17 -2
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
- package/lib/components/VSelectionControl/index.d.mts +19 -5
- package/lib/components/VSwitch/VSwitch.css +7 -5
- package/lib/components/VSwitch/VSwitch.mjs +18 -8
- package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
- package/lib/components/VSwitch/VSwitch.sass +6 -4
- package/lib/components/VSwitch/_variables.scss +5 -3
- package/lib/components/VSwitch/index.d.mts +82 -23
- package/lib/components/VTable/VTable.css +3 -0
- package/lib/components/VTable/VTable.sass +4 -0
- package/lib/components/VTable/_variables.scss +3 -0
- package/lib/components/VTabs/VTab.mjs +2 -2
- package/lib/components/VTabs/VTab.mjs.map +1 -1
- package/lib/components/VTextarea/VTextarea.mjs +1 -0
- package/lib/components/VTextarea/VTextarea.mjs.map +1 -1
- package/lib/components/index.d.mts +448 -227
- package/lib/composables/theme.mjs +6 -2
- package/lib/composables/theme.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/index.d.mts +1 -1
- package/lib/locale/bg.mjs +23 -23
- package/lib/locale/bg.mjs.map +1 -1
- package/lib/locale/fa.mjs +16 -16
- package/lib/locale/fa.mjs.map +1 -1
- package/lib/styles/tools/_states.sass +5 -5
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
-
import { ComponentPropsOptions, ExtractPropTypes, PropType, JSXComponent,
|
|
2
|
+
import { ComponentPropsOptions, ExtractPropTypes, PropType, JSXComponent, ComputedRef, Ref } from 'vue';
|
|
3
3
|
|
|
4
4
|
interface FilterPropsOptions<PropsOptions extends Readonly<ComponentPropsOptions>, Props = ExtractPropTypes<PropsOptions>> {
|
|
5
5
|
filterProps<T extends Partial<Props>, U extends Exclude<keyof Props, Exclude<keyof Props, keyof T>>>(props: T): [yes: Partial<Pick<T, U>>, no: Omit<T, U>];
|
|
@@ -11,29 +11,16 @@ declare const EventProp: <T extends any[] = any[]>() => PropType<EventProp<T, (.
|
|
|
11
11
|
|
|
12
12
|
type Density = null | 'default' | 'comfortable' | 'compact';
|
|
13
13
|
|
|
14
|
+
type ValidationResult = string | boolean;
|
|
15
|
+
type ValidationRule = ValidationResult | PromiseLike<ValidationResult> | ((value: any) => ValidationResult) | ((value: any) => PromiseLike<ValidationResult>);
|
|
16
|
+
|
|
14
17
|
type IconValue = string | (string | [path: string, opacity: number])[] | JSXComponent;
|
|
15
18
|
declare const IconValue: PropType<IconValue>;
|
|
16
19
|
|
|
17
|
-
type SelectionControlSlot = {
|
|
18
|
-
model: WritableComputedRef<any>;
|
|
19
|
-
textColorClasses: Ref<string[]>;
|
|
20
|
-
textColorStyles: Ref<CSSProperties>;
|
|
21
|
-
inputNode: VNode;
|
|
22
|
-
icon: IconValue | undefined;
|
|
23
|
-
props: {
|
|
24
|
-
onBlur: (e: Event) => void;
|
|
25
|
-
onFocus: (e: FocusEvent) => void;
|
|
26
|
-
id: string;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
|
|
30
20
|
type VMessageSlot = {
|
|
31
21
|
message: string;
|
|
32
22
|
};
|
|
33
23
|
|
|
34
|
-
type ValidationResult = string | boolean;
|
|
35
|
-
type ValidationRule = ValidationResult | PromiseLike<ValidationResult> | ((value: any) => ValidationResult) | ((value: any) => PromiseLike<ValidationResult>);
|
|
36
|
-
|
|
37
24
|
interface VInputSlot {
|
|
38
25
|
id: ComputedRef<string>;
|
|
39
26
|
messagesId: ComputedRef<string>;
|
|
@@ -80,16 +67,15 @@ declare const VRadioGroup: {
|
|
|
80
67
|
label?: string | undefined;
|
|
81
68
|
class?: any;
|
|
82
69
|
$children?: vue.VNodeChild | (() => vue.VNodeChild) | {
|
|
83
|
-
default?: (() => vue.VNodeChild) | undefined;
|
|
84
|
-
prepend?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
85
|
-
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
86
|
-
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
87
70
|
message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
71
|
+
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
72
|
+
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
73
|
+
prepend?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
74
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
88
75
|
label?: ((arg: {
|
|
89
76
|
label: string | undefined;
|
|
90
|
-
props: Record<string,
|
|
77
|
+
props: Record<string, any>;
|
|
91
78
|
}) => vue.VNodeChild) | undefined;
|
|
92
|
-
input?: ((arg: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
93
79
|
};
|
|
94
80
|
ref?: vue.VNodeRef | undefined;
|
|
95
81
|
ref_for?: boolean | undefined;
|
|
@@ -97,16 +83,15 @@ declare const VRadioGroup: {
|
|
|
97
83
|
theme?: string | undefined;
|
|
98
84
|
"v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
|
|
99
85
|
'v-slots'?: {
|
|
100
|
-
default?: false | (() => vue.VNodeChild) | undefined;
|
|
101
|
-
prepend?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
102
|
-
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
103
|
-
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
104
86
|
message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
87
|
+
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
88
|
+
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
89
|
+
prepend?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
90
|
+
default?: false | (() => vue.VNodeChild) | undefined;
|
|
105
91
|
label?: false | ((arg: {
|
|
106
92
|
label: string | undefined;
|
|
107
|
-
props: Record<string,
|
|
93
|
+
props: Record<string, any>;
|
|
108
94
|
}) => vue.VNodeChild) | undefined;
|
|
109
|
-
input?: false | ((arg: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
110
95
|
} | undefined;
|
|
111
96
|
onVnodeBeforeMount?: ((vnode: vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
112
97
|
[key: string]: any;
|
|
@@ -153,10 +138,9 @@ declare const VRadioGroup: {
|
|
|
153
138
|
prependIcon?: IconValue | undefined;
|
|
154
139
|
appendIcon?: IconValue | undefined;
|
|
155
140
|
defaultsTarget?: string | undefined;
|
|
156
|
-
"v-slot:input"?: false | ((arg: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
157
141
|
"v-slot:label"?: false | ((arg: {
|
|
158
142
|
label: string | undefined;
|
|
159
|
-
props: Record<string,
|
|
143
|
+
props: Record<string, any>;
|
|
160
144
|
}) => vue.VNodeChild) | undefined;
|
|
161
145
|
'onClick:append'?: EventProp<[MouseEvent], (args_0: MouseEvent) => any> | undefined;
|
|
162
146
|
'onClick:prepend'?: EventProp<[MouseEvent], (args_0: MouseEvent) => any> | undefined;
|
|
@@ -175,30 +159,27 @@ declare const VRadioGroup: {
|
|
|
175
159
|
[x: string]: unknown;
|
|
176
160
|
};
|
|
177
161
|
$slots: Readonly<{
|
|
178
|
-
|
|
162
|
+
message?: ((arg: VMessageSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
179
163
|
[key: string]: any;
|
|
180
164
|
}>[]) | undefined;
|
|
181
|
-
|
|
165
|
+
details?: ((arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
182
166
|
[key: string]: any;
|
|
183
167
|
}>[]) | undefined;
|
|
184
168
|
append?: ((arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
185
169
|
[key: string]: any;
|
|
186
170
|
}>[]) | undefined;
|
|
187
|
-
|
|
171
|
+
prepend?: ((arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
188
172
|
[key: string]: any;
|
|
189
173
|
}>[]) | undefined;
|
|
190
|
-
|
|
174
|
+
default?: (() => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
191
175
|
[key: string]: any;
|
|
192
176
|
}>[]) | undefined;
|
|
193
177
|
label?: ((arg: {
|
|
194
178
|
label: string | undefined;
|
|
195
|
-
props: Record<string,
|
|
179
|
+
props: Record<string, any>;
|
|
196
180
|
}) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
197
181
|
[key: string]: any;
|
|
198
182
|
}>[]) | undefined;
|
|
199
|
-
input?: ((arg: SelectionControlSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
200
|
-
[key: string]: any;
|
|
201
|
-
}>[]) | undefined;
|
|
202
183
|
}>;
|
|
203
184
|
$root: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
204
185
|
$parent: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
@@ -245,40 +226,37 @@ declare const VRadioGroup: {
|
|
|
245
226
|
hideDetails?: boolean | "auto" | undefined;
|
|
246
227
|
} & {
|
|
247
228
|
$children?: vue.VNodeChild | (() => vue.VNodeChild) | {
|
|
248
|
-
default?: (() => vue.VNodeChild) | undefined;
|
|
249
|
-
prepend?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
250
|
-
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
251
|
-
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
252
229
|
message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
230
|
+
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
231
|
+
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
232
|
+
prepend?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
233
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
253
234
|
label?: ((arg: {
|
|
254
235
|
label: string | undefined;
|
|
255
|
-
props: Record<string,
|
|
236
|
+
props: Record<string, any>;
|
|
256
237
|
}) => vue.VNodeChild) | undefined;
|
|
257
|
-
input?: ((arg: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
258
238
|
};
|
|
259
239
|
'v-slots'?: {
|
|
260
|
-
default?: false | (() => vue.VNodeChild) | undefined;
|
|
261
|
-
prepend?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
262
|
-
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
263
|
-
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
264
240
|
message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
241
|
+
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
242
|
+
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
243
|
+
prepend?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
244
|
+
default?: false | (() => vue.VNodeChild) | undefined;
|
|
265
245
|
label?: false | ((arg: {
|
|
266
246
|
label: string | undefined;
|
|
267
|
-
props: Record<string,
|
|
247
|
+
props: Record<string, any>;
|
|
268
248
|
}) => vue.VNodeChild) | undefined;
|
|
269
|
-
input?: false | ((arg: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
270
249
|
} | undefined;
|
|
271
250
|
} & {
|
|
272
|
-
"v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
|
|
273
|
-
"v-slot:prepend"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
274
|
-
"v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
275
|
-
"v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
276
251
|
"v-slot:message"?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
252
|
+
"v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
253
|
+
"v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
254
|
+
"v-slot:prepend"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
255
|
+
"v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
|
|
277
256
|
"v-slot:label"?: false | ((arg: {
|
|
278
257
|
label: string | undefined;
|
|
279
|
-
props: Record<string,
|
|
258
|
+
props: Record<string, any>;
|
|
280
259
|
}) => vue.VNodeChild) | undefined;
|
|
281
|
-
"v-slot:input"?: false | ((arg: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
282
260
|
} & {
|
|
283
261
|
"onUpdate:modelValue"?: ((val: any) => any) | undefined;
|
|
284
262
|
}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
@@ -305,30 +283,27 @@ declare const VRadioGroup: {
|
|
|
305
283
|
centerAffix: boolean;
|
|
306
284
|
persistentHint: boolean;
|
|
307
285
|
}, {}, string, vue.SlotsType<Partial<{
|
|
308
|
-
|
|
286
|
+
message: (arg: VMessageSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
309
287
|
[key: string]: any;
|
|
310
288
|
}>[];
|
|
311
|
-
|
|
289
|
+
details: (arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
312
290
|
[key: string]: any;
|
|
313
291
|
}>[];
|
|
314
292
|
append: (arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
315
293
|
[key: string]: any;
|
|
316
294
|
}>[];
|
|
317
|
-
|
|
295
|
+
prepend: (arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
318
296
|
[key: string]: any;
|
|
319
297
|
}>[];
|
|
320
|
-
|
|
298
|
+
default: () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
321
299
|
[key: string]: any;
|
|
322
300
|
}>[];
|
|
323
301
|
label: (arg: {
|
|
324
302
|
label: string | undefined;
|
|
325
|
-
props: Record<string,
|
|
303
|
+
props: Record<string, any>;
|
|
326
304
|
}) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
327
305
|
[key: string]: any;
|
|
328
306
|
}>[];
|
|
329
|
-
input: (arg: SelectionControlSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
330
|
-
[key: string]: any;
|
|
331
|
-
}>[];
|
|
332
307
|
}>>> & {
|
|
333
308
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
334
309
|
created?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -390,40 +365,37 @@ declare const VRadioGroup: {
|
|
|
390
365
|
hideDetails?: boolean | "auto" | undefined;
|
|
391
366
|
} & {
|
|
392
367
|
$children?: vue.VNodeChild | (() => vue.VNodeChild) | {
|
|
393
|
-
default?: (() => vue.VNodeChild) | undefined;
|
|
394
|
-
prepend?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
395
|
-
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
396
|
-
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
397
368
|
message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
369
|
+
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
370
|
+
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
371
|
+
prepend?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
372
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
398
373
|
label?: ((arg: {
|
|
399
374
|
label: string | undefined;
|
|
400
|
-
props: Record<string,
|
|
375
|
+
props: Record<string, any>;
|
|
401
376
|
}) => vue.VNodeChild) | undefined;
|
|
402
|
-
input?: ((arg: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
403
377
|
};
|
|
404
378
|
'v-slots'?: {
|
|
405
|
-
default?: false | (() => vue.VNodeChild) | undefined;
|
|
406
|
-
prepend?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
407
|
-
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
408
|
-
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
409
379
|
message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
380
|
+
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
381
|
+
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
382
|
+
prepend?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
383
|
+
default?: false | (() => vue.VNodeChild) | undefined;
|
|
410
384
|
label?: false | ((arg: {
|
|
411
385
|
label: string | undefined;
|
|
412
|
-
props: Record<string,
|
|
386
|
+
props: Record<string, any>;
|
|
413
387
|
}) => vue.VNodeChild) | undefined;
|
|
414
|
-
input?: false | ((arg: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
415
388
|
} | undefined;
|
|
416
389
|
} & {
|
|
417
|
-
"v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
|
|
418
|
-
"v-slot:prepend"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
419
|
-
"v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
420
|
-
"v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
421
390
|
"v-slot:message"?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
391
|
+
"v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
392
|
+
"v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
393
|
+
"v-slot:prepend"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
394
|
+
"v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
|
|
422
395
|
"v-slot:label"?: false | ((arg: {
|
|
423
396
|
label: string | undefined;
|
|
424
|
-
props: Record<string,
|
|
397
|
+
props: Record<string, any>;
|
|
425
398
|
}) => vue.VNodeChild) | undefined;
|
|
426
|
-
"v-slot:input"?: false | ((arg: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
427
399
|
} & {
|
|
428
400
|
"onUpdate:modelValue"?: ((val: any) => any) | undefined;
|
|
429
401
|
} & vue.ShallowUnwrapRef<{}> & {} & vue.ComponentCustomProperties & {};
|
|
@@ -471,40 +443,37 @@ declare const VRadioGroup: {
|
|
|
471
443
|
hideDetails?: boolean | "auto" | undefined;
|
|
472
444
|
} & {
|
|
473
445
|
$children?: vue.VNodeChild | (() => vue.VNodeChild) | {
|
|
474
|
-
default?: (() => vue.VNodeChild) | undefined;
|
|
475
|
-
prepend?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
476
|
-
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
477
|
-
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
478
446
|
message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
447
|
+
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
448
|
+
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
449
|
+
prepend?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
450
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
479
451
|
label?: ((arg: {
|
|
480
452
|
label: string | undefined;
|
|
481
|
-
props: Record<string,
|
|
453
|
+
props: Record<string, any>;
|
|
482
454
|
}) => vue.VNodeChild) | undefined;
|
|
483
|
-
input?: ((arg: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
484
455
|
};
|
|
485
456
|
'v-slots'?: {
|
|
486
|
-
default?: false | (() => vue.VNodeChild) | undefined;
|
|
487
|
-
prepend?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
488
|
-
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
489
|
-
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
490
457
|
message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
458
|
+
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
459
|
+
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
460
|
+
prepend?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
461
|
+
default?: false | (() => vue.VNodeChild) | undefined;
|
|
491
462
|
label?: false | ((arg: {
|
|
492
463
|
label: string | undefined;
|
|
493
|
-
props: Record<string,
|
|
464
|
+
props: Record<string, any>;
|
|
494
465
|
}) => vue.VNodeChild) | undefined;
|
|
495
|
-
input?: false | ((arg: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
496
466
|
} | undefined;
|
|
497
467
|
} & {
|
|
498
|
-
"v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
|
|
499
|
-
"v-slot:prepend"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
500
|
-
"v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
501
|
-
"v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
502
468
|
"v-slot:message"?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
469
|
+
"v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
470
|
+
"v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
471
|
+
"v-slot:prepend"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
472
|
+
"v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
|
|
503
473
|
"v-slot:label"?: false | ((arg: {
|
|
504
474
|
label: string | undefined;
|
|
505
|
-
props: Record<string,
|
|
475
|
+
props: Record<string, any>;
|
|
506
476
|
}) => vue.VNodeChild) | undefined;
|
|
507
|
-
"v-slot:input"?: false | ((arg: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
508
477
|
} & {
|
|
509
478
|
"onUpdate:modelValue"?: ((val: any) => any) | undefined;
|
|
510
479
|
}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
@@ -531,30 +500,27 @@ declare const VRadioGroup: {
|
|
|
531
500
|
centerAffix: boolean;
|
|
532
501
|
persistentHint: boolean;
|
|
533
502
|
}, {}, string, vue.SlotsType<Partial<{
|
|
534
|
-
|
|
503
|
+
message: (arg: VMessageSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
535
504
|
[key: string]: any;
|
|
536
505
|
}>[];
|
|
537
|
-
|
|
506
|
+
details: (arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
538
507
|
[key: string]: any;
|
|
539
508
|
}>[];
|
|
540
509
|
append: (arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
541
510
|
[key: string]: any;
|
|
542
511
|
}>[];
|
|
543
|
-
|
|
512
|
+
prepend: (arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
544
513
|
[key: string]: any;
|
|
545
514
|
}>[];
|
|
546
|
-
|
|
515
|
+
default: () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
547
516
|
[key: string]: any;
|
|
548
517
|
}>[];
|
|
549
518
|
label: (arg: {
|
|
550
519
|
label: string | undefined;
|
|
551
|
-
props: Record<string,
|
|
520
|
+
props: Record<string, any>;
|
|
552
521
|
}) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
553
522
|
[key: string]: any;
|
|
554
523
|
}>[];
|
|
555
|
-
input: (arg: SelectionControlSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
556
|
-
[key: string]: any;
|
|
557
|
-
}>[];
|
|
558
524
|
}>>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & FilterPropsOptions<{
|
|
559
525
|
trueIcon: {
|
|
560
526
|
type: vue.PropType<IconValue>;
|
|
@@ -6,7 +6,7 @@ import "./VSelectionControl.css";
|
|
|
6
6
|
import { VIcon } from "../VIcon/index.mjs";
|
|
7
7
|
import { VLabel } from "../VLabel/index.mjs";
|
|
8
8
|
import { makeSelectionControlGroupProps, VSelectionControlGroupSymbol } from "../VSelectionControlGroup/VSelectionControlGroup.mjs"; // Composables
|
|
9
|
-
import { useTextColor } from "../../composables/color.mjs";
|
|
9
|
+
import { useBackgroundColor, useTextColor } from "../../composables/color.mjs";
|
|
10
10
|
import { makeComponentProps } from "../../composables/component.mjs";
|
|
11
11
|
import { useDensity } from "../../composables/density.mjs";
|
|
12
12
|
import { useProxiedModel } from "../../composables/proxiedModel.mjs"; // Directives
|
|
@@ -55,6 +55,12 @@ export function useSelectionControl(props) {
|
|
|
55
55
|
} = useTextColor(computed(() => {
|
|
56
56
|
return model.value && !props.error && !props.disabled ? props.color : undefined;
|
|
57
57
|
}));
|
|
58
|
+
const {
|
|
59
|
+
backgroundColorClasses,
|
|
60
|
+
backgroundColorStyles
|
|
61
|
+
} = useBackgroundColor(computed(() => {
|
|
62
|
+
return model.value && !props.error && !props.disabled ? props.color : undefined;
|
|
63
|
+
}));
|
|
58
64
|
const icon = computed(() => model.value ? props.trueIcon : props.falseIcon);
|
|
59
65
|
return {
|
|
60
66
|
group,
|
|
@@ -64,6 +70,8 @@ export function useSelectionControl(props) {
|
|
|
64
70
|
model,
|
|
65
71
|
textColorClasses,
|
|
66
72
|
textColorStyles,
|
|
73
|
+
backgroundColorClasses,
|
|
74
|
+
backgroundColorStyles,
|
|
67
75
|
icon
|
|
68
76
|
};
|
|
69
77
|
}
|
|
@@ -89,6 +97,8 @@ export const VSelectionControl = genericComponent()({
|
|
|
89
97
|
model,
|
|
90
98
|
textColorClasses,
|
|
91
99
|
textColorStyles,
|
|
100
|
+
backgroundColorClasses,
|
|
101
|
+
backgroundColorStyles,
|
|
92
102
|
trueValue
|
|
93
103
|
} = useSelectionControl(props);
|
|
94
104
|
const uid = getUid();
|
|
@@ -153,12 +163,17 @@ export const VSelectionControl = genericComponent()({
|
|
|
153
163
|
}), [_createVNode("div", {
|
|
154
164
|
"class": ['v-selection-control__wrapper', textColorClasses.value],
|
|
155
165
|
"style": textColorStyles.value
|
|
156
|
-
}, [slots.default?.(
|
|
166
|
+
}, [slots.default?.({
|
|
167
|
+
backgroundColorClasses,
|
|
168
|
+
backgroundColorStyles
|
|
169
|
+
}), _withDirectives(_createVNode("div", {
|
|
157
170
|
"class": ['v-selection-control__input']
|
|
158
171
|
}, [slots.input?.({
|
|
159
172
|
model,
|
|
160
173
|
textColorClasses,
|
|
161
174
|
textColorStyles,
|
|
175
|
+
backgroundColorClasses,
|
|
176
|
+
backgroundColorStyles,
|
|
162
177
|
inputNode,
|
|
163
178
|
icon: icon.value,
|
|
164
179
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VSelectionControl.mjs","names":["VIcon","VLabel","makeSelectionControlGroupProps","VSelectionControlGroupSymbol","useTextColor","makeComponentProps","useDensity","useProxiedModel","Ripple","computed","inject","nextTick","ref","shallowRef","filterInputAttrs","genericComponent","getUid","matchesSelector","propsFactory","useRender","wrapInArray","makeVSelectionControlProps","label","String","trueValue","falseValue","value","useSelectionControl","props","group","undefined","densityClasses","modelValue","isMultiple","multiple","Array","isArray","model","get","val","some","v","valueComparator","set","readonly","currentValue","newVal","filter","item","textColorClasses","textColorStyles","error","disabled","color","icon","trueIcon","falseIcon","VSelectionControl","name","directives","inheritAttrs","emits","setup","_ref","attrs","slots","uid","id","isFocused","isFocusVisible","input","onForceUpdate","checked","onFocus","e","target","onBlur","onInput","forceUpdate","for","rootAttrs","inputAttrs","inputNode","_createVNode","_mergeProps","type","inline","class","style","default","_withDirectives","_Fragment","_resolveDirective","ripple","stopPropagation"],"sources":["../../../src/components/VSelectionControl/VSelectionControl.tsx"],"sourcesContent":["// Styles\nimport './VSelectionControl.sass'\n\n// Components\nimport { VIcon } from '@/components/VIcon'\nimport { VLabel } from '@/components/VLabel'\nimport { makeSelectionControlGroupProps, VSelectionControlGroupSymbol } from '@/components/VSelectionControlGroup/VSelectionControlGroup'\n\n// Composables\nimport { useTextColor } from '@/composables/color'\nimport { makeComponentProps } from '@/composables/component'\nimport { useDensity } from '@/composables/density'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Directives\nimport { Ripple } from '@/directives/ripple'\n\n// Utilities\nimport { computed, inject, nextTick, ref, shallowRef } from 'vue'\nimport {\n filterInputAttrs,\n genericComponent,\n getUid,\n matchesSelector,\n propsFactory,\n useRender,\n wrapInArray,\n} from '@/util'\n\n// Types\nimport type { CSSProperties, ExtractPropTypes, Ref, VNode, WritableComputedRef } from 'vue'\nimport type { IconValue } from '@/composables/icons'\nimport type { GenericProps } from '@/util'\n\nexport type SelectionControlSlot = {\n model: WritableComputedRef<any>\n textColorClasses: Ref<string[]>\n textColorStyles: Ref<CSSProperties>\n inputNode: VNode\n icon: IconValue | undefined\n props: {\n onBlur: (e: Event) => void\n onFocus: (e: FocusEvent) => void\n id: string\n }\n}\n\nexport type VSelectionControlSlots = {\n default: never\n label: { label: string | undefined, props: Record<string, unknown> }\n input: SelectionControlSlot\n}\n\nexport const makeVSelectionControlProps = propsFactory({\n label: String,\n trueValue: null,\n falseValue: null,\n value: null,\n\n ...makeComponentProps(),\n ...makeSelectionControlGroupProps(),\n}, 'VSelectionControl')\n\nexport function useSelectionControl (\n props: ExtractPropTypes<ReturnType<typeof makeVSelectionControlProps>> & {\n 'onUpdate:modelValue': ((val: any) => void) | undefined\n }\n) {\n const group = inject(VSelectionControlGroupSymbol, undefined)\n const { densityClasses } = useDensity(props)\n const modelValue = useProxiedModel(props, 'modelValue')\n const trueValue = computed(() => (\n props.trueValue !== undefined ? props.trueValue\n : props.value !== undefined ? props.value\n : true\n ))\n const falseValue = computed(() => props.falseValue !== undefined ? props.falseValue : false)\n const isMultiple = computed(() => (\n !!props.multiple ||\n (props.multiple == null && Array.isArray(modelValue.value))\n ))\n const model = computed({\n get () {\n const val = group ? group.modelValue.value : modelValue.value\n\n return isMultiple.value\n ? val.some((v: any) => props.valueComparator(v, trueValue.value))\n : props.valueComparator(val, trueValue.value)\n },\n set (val: boolean) {\n if (props.readonly) return\n\n const currentValue = val ? trueValue.value : falseValue.value\n\n let newVal = currentValue\n\n if (isMultiple.value) {\n newVal = val\n ? [...wrapInArray(modelValue.value), currentValue]\n : wrapInArray(modelValue.value).filter((item: any) => !props.valueComparator(item, trueValue.value))\n }\n\n if (group) {\n group.modelValue.value = newVal\n } else {\n modelValue.value = newVal\n }\n },\n })\n const { textColorClasses, textColorStyles } = useTextColor(computed(() => {\n return (\n model.value &&\n !props.error &&\n !props.disabled\n ) ? props.color : undefined\n }))\n const icon = computed(() => model.value ? props.trueIcon : props.falseIcon)\n\n return {\n group,\n densityClasses,\n trueValue,\n falseValue,\n model,\n textColorClasses,\n textColorStyles,\n icon,\n }\n}\n\nexport const VSelectionControl = genericComponent<new <T>(\n props: {\n modelValue?: T\n 'onUpdate:modelValue'?: (val: T) => any\n },\n slots: VSelectionControlSlots,\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VSelectionControl',\n\n directives: { Ripple },\n\n inheritAttrs: false,\n\n props: makeVSelectionControlProps(),\n\n emits: {\n 'update:modelValue': (val: any) => true,\n },\n\n setup (props, { attrs, slots }) {\n const {\n group,\n densityClasses,\n icon,\n model,\n textColorClasses,\n textColorStyles,\n trueValue,\n } = useSelectionControl(props)\n const uid = getUid()\n const id = computed(() => props.id || `input-${uid}`)\n const isFocused = shallowRef(false)\n const isFocusVisible = shallowRef(false)\n const input = ref<HTMLInputElement>()\n\n group?.onForceUpdate(() => {\n if (input.value) {\n input.value.checked = model.value\n }\n })\n\n function onFocus (e: FocusEvent) {\n isFocused.value = true\n if (matchesSelector(e.target as HTMLElement, ':focus-visible') !== false) {\n isFocusVisible.value = true\n }\n }\n\n function onBlur () {\n isFocused.value = false\n isFocusVisible.value = false\n }\n\n function onInput (e: Event) {\n if (props.readonly && group) {\n nextTick(() => group.forceUpdate())\n }\n model.value = (e.target as HTMLInputElement).checked\n }\n\n useRender(() => {\n const label = slots.label\n ? slots.label({\n label: props.label,\n props: { for: id.value },\n })\n : props.label\n const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)\n\n const inputNode = (\n <input\n ref={ input }\n checked={ model.value }\n disabled={ !!(props.readonly || props.disabled) }\n id={ id.value }\n onBlur={ onBlur }\n onFocus={ onFocus }\n onInput={ onInput }\n aria-disabled={ !!(props.readonly || props.disabled) }\n type={ props.type }\n value={ trueValue.value }\n name={ props.name }\n aria-checked={ props.type === 'checkbox' ? model.value : undefined }\n { ...inputAttrs }\n />\n )\n\n return (\n <div\n class={[\n 'v-selection-control',\n {\n 'v-selection-control--dirty': model.value,\n 'v-selection-control--disabled': props.disabled,\n 'v-selection-control--error': props.error,\n 'v-selection-control--focused': isFocused.value,\n 'v-selection-control--focus-visible': isFocusVisible.value,\n 'v-selection-control--inline': props.inline,\n },\n densityClasses.value,\n props.class,\n ]}\n { ...rootAttrs }\n style={ props.style }\n >\n <div\n class={[\n 'v-selection-control__wrapper',\n textColorClasses.value,\n ]}\n style={ textColorStyles.value }\n >\n { slots.default?.() }\n\n <div\n class={[\n 'v-selection-control__input',\n ]}\n v-ripple={ props.ripple && [\n !props.disabled && !props.readonly,\n null,\n ['center', 'circle'],\n ]}\n >\n { slots.input?.({\n model,\n textColorClasses,\n textColorStyles,\n inputNode,\n icon: icon.value,\n props: {\n onFocus,\n onBlur,\n id: id.value,\n },\n } satisfies SelectionControlSlot) ?? (\n <>\n { icon.value && <VIcon key=\"icon\" icon={ icon.value } /> }\n\n { inputNode }\n </>\n )}\n </div>\n </div>\n\n { label && (\n <VLabel for={ id.value } clickable onClick={ (e: Event) => e.stopPropagation() }>\n { label }\n </VLabel>\n )}\n </div>\n )\n })\n\n return {\n isFocused,\n input,\n }\n },\n})\n\nexport type VSelectionControl = InstanceType<typeof VSelectionControl>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,KAAK;AAAA,SACLC,MAAM;AAAA,SACNC,8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AAAQ,SAAA,SAE3BrC,IAAI,CAAC5B,KAAK,IAAAyD,YAAA,CAAAnF,KAAA;QAAA,OAAe,MAAM;QAAA,QAAQsD,IAAI,CAAC5B;MAAK,QAAK,EAEtDwD,SAAS,EAEd,MAAAU,iBAAA,YAvBUhE,KAAK,CAACiE,MAAM,IAAI,CACzB,CAACjE,KAAK,CAACwB,QAAQ,IAAI,CAACxB,KAAK,CAACgB,QAAQ,EAClC,IAAI,EACJ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CACrB,OAuBHtB,KAAK,IAAA6D,YAAA,CAAAlF,MAAA;QAAA,OACSkE,EAAE,CAACzC,KAAK;QAAA;QAAA,WAAwBgD,CAAQ,IAAKA,CAAC,CAACoB,eAAe;MAAE;QAAAL,OAAA,EAAAA,CAAA,MAC1EnE,KAAK;MAAA,EAEV;IAGP,CAAC,CAAC;IAEF,OAAO;MACL8C,SAAS;MACTE;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"VSelectionControl.mjs","names":["VIcon","VLabel","makeSelectionControlGroupProps","VSelectionControlGroupSymbol","useBackgroundColor","useTextColor","makeComponentProps","useDensity","useProxiedModel","Ripple","computed","inject","nextTick","ref","shallowRef","filterInputAttrs","genericComponent","getUid","matchesSelector","propsFactory","useRender","wrapInArray","makeVSelectionControlProps","label","String","trueValue","falseValue","value","useSelectionControl","props","group","undefined","densityClasses","modelValue","isMultiple","multiple","Array","isArray","model","get","val","some","v","valueComparator","set","readonly","currentValue","newVal","filter","item","textColorClasses","textColorStyles","error","disabled","color","backgroundColorClasses","backgroundColorStyles","icon","trueIcon","falseIcon","VSelectionControl","name","directives","inheritAttrs","emits","setup","_ref","attrs","slots","uid","id","isFocused","isFocusVisible","input","onForceUpdate","checked","onFocus","e","target","onBlur","onInput","forceUpdate","for","rootAttrs","inputAttrs","inputNode","_createVNode","_mergeProps","type","inline","class","style","default","_withDirectives","_Fragment","_resolveDirective","ripple","stopPropagation"],"sources":["../../../src/components/VSelectionControl/VSelectionControl.tsx"],"sourcesContent":["// Styles\nimport './VSelectionControl.sass'\n\n// Components\nimport { VIcon } from '@/components/VIcon'\nimport { VLabel } from '@/components/VLabel'\nimport { makeSelectionControlGroupProps, VSelectionControlGroupSymbol } from '@/components/VSelectionControlGroup/VSelectionControlGroup'\n\n// Composables\nimport { useBackgroundColor, useTextColor } from '@/composables/color'\nimport { makeComponentProps } from '@/composables/component'\nimport { useDensity } from '@/composables/density'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Directives\nimport { Ripple } from '@/directives/ripple'\n\n// Utilities\nimport { computed, inject, nextTick, ref, shallowRef } from 'vue'\nimport {\n filterInputAttrs,\n genericComponent,\n getUid,\n matchesSelector,\n propsFactory,\n useRender,\n wrapInArray,\n} from '@/util'\n\n// Types\nimport type { CSSProperties, ExtractPropTypes, Ref, VNode, WritableComputedRef } from 'vue'\nimport type { IconValue } from '@/composables/icons'\nimport type { GenericProps } from '@/util'\n\nexport type SelectionControlSlot = {\n model: WritableComputedRef<any>\n textColorClasses: Ref<string[]>\n textColorStyles: Ref<CSSProperties>\n backgroundColorClasses: Ref<string[]>\n backgroundColorStyles: Ref<CSSProperties>\n inputNode: VNode\n icon: IconValue | undefined\n props: {\n onBlur: (e: Event) => void\n onFocus: (e: FocusEvent) => void\n id: string\n }\n}\n\nexport type VSelectionControlSlots = {\n default: {\n backgroundColorClasses: Ref<string[]>\n backgroundColorStyles: Ref<CSSProperties>\n }\n label: { label: string | undefined, props: Record<string, unknown> }\n input: SelectionControlSlot\n}\n\nexport const makeVSelectionControlProps = propsFactory({\n label: String,\n trueValue: null,\n falseValue: null,\n value: null,\n\n ...makeComponentProps(),\n ...makeSelectionControlGroupProps(),\n}, 'VSelectionControl')\n\nexport function useSelectionControl (\n props: ExtractPropTypes<ReturnType<typeof makeVSelectionControlProps>> & {\n 'onUpdate:modelValue': ((val: any) => void) | undefined\n }\n) {\n const group = inject(VSelectionControlGroupSymbol, undefined)\n const { densityClasses } = useDensity(props)\n const modelValue = useProxiedModel(props, 'modelValue')\n const trueValue = computed(() => (\n props.trueValue !== undefined ? props.trueValue\n : props.value !== undefined ? props.value\n : true\n ))\n const falseValue = computed(() => props.falseValue !== undefined ? props.falseValue : false)\n const isMultiple = computed(() => (\n !!props.multiple ||\n (props.multiple == null && Array.isArray(modelValue.value))\n ))\n const model = computed({\n get () {\n const val = group ? group.modelValue.value : modelValue.value\n\n return isMultiple.value\n ? val.some((v: any) => props.valueComparator(v, trueValue.value))\n : props.valueComparator(val, trueValue.value)\n },\n set (val: boolean) {\n if (props.readonly) return\n\n const currentValue = val ? trueValue.value : falseValue.value\n\n let newVal = currentValue\n\n if (isMultiple.value) {\n newVal = val\n ? [...wrapInArray(modelValue.value), currentValue]\n : wrapInArray(modelValue.value).filter((item: any) => !props.valueComparator(item, trueValue.value))\n }\n\n if (group) {\n group.modelValue.value = newVal\n } else {\n modelValue.value = newVal\n }\n },\n })\n const { textColorClasses, textColorStyles } = useTextColor(computed(() => {\n return (\n model.value &&\n !props.error &&\n !props.disabled\n ) ? props.color : undefined\n }))\n const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(computed(() => {\n return (\n model.value &&\n !props.error &&\n !props.disabled\n ) ? props.color : undefined\n }))\n const icon = computed(() => model.value ? props.trueIcon : props.falseIcon)\n\n return {\n group,\n densityClasses,\n trueValue,\n falseValue,\n model,\n textColorClasses,\n textColorStyles,\n backgroundColorClasses,\n backgroundColorStyles,\n icon,\n }\n}\n\nexport const VSelectionControl = genericComponent<new <T>(\n props: {\n modelValue?: T\n 'onUpdate:modelValue'?: (val: T) => any\n },\n slots: VSelectionControlSlots,\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VSelectionControl',\n\n directives: { Ripple },\n\n inheritAttrs: false,\n\n props: makeVSelectionControlProps(),\n\n emits: {\n 'update:modelValue': (val: any) => true,\n },\n\n setup (props, { attrs, slots }) {\n const {\n group,\n densityClasses,\n icon,\n model,\n textColorClasses,\n textColorStyles,\n backgroundColorClasses,\n backgroundColorStyles,\n trueValue,\n } = useSelectionControl(props)\n const uid = getUid()\n const id = computed(() => props.id || `input-${uid}`)\n const isFocused = shallowRef(false)\n const isFocusVisible = shallowRef(false)\n const input = ref<HTMLInputElement>()\n\n group?.onForceUpdate(() => {\n if (input.value) {\n input.value.checked = model.value\n }\n })\n\n function onFocus (e: FocusEvent) {\n isFocused.value = true\n if (matchesSelector(e.target as HTMLElement, ':focus-visible') !== false) {\n isFocusVisible.value = true\n }\n }\n\n function onBlur () {\n isFocused.value = false\n isFocusVisible.value = false\n }\n\n function onInput (e: Event) {\n if (props.readonly && group) {\n nextTick(() => group.forceUpdate())\n }\n model.value = (e.target as HTMLInputElement).checked\n }\n\n useRender(() => {\n const label = slots.label\n ? slots.label({\n label: props.label,\n props: { for: id.value },\n })\n : props.label\n const [rootAttrs, inputAttrs] = filterInputAttrs(attrs)\n\n const inputNode = (\n <input\n ref={ input }\n checked={ model.value }\n disabled={ !!(props.readonly || props.disabled) }\n id={ id.value }\n onBlur={ onBlur }\n onFocus={ onFocus }\n onInput={ onInput }\n aria-disabled={ !!(props.readonly || props.disabled) }\n type={ props.type }\n value={ trueValue.value }\n name={ props.name }\n aria-checked={ props.type === 'checkbox' ? model.value : undefined }\n { ...inputAttrs }\n />\n )\n\n return (\n <div\n class={[\n 'v-selection-control',\n {\n 'v-selection-control--dirty': model.value,\n 'v-selection-control--disabled': props.disabled,\n 'v-selection-control--error': props.error,\n 'v-selection-control--focused': isFocused.value,\n 'v-selection-control--focus-visible': isFocusVisible.value,\n 'v-selection-control--inline': props.inline,\n },\n densityClasses.value,\n props.class,\n ]}\n { ...rootAttrs }\n style={ props.style }\n >\n <div\n class={[\n 'v-selection-control__wrapper',\n textColorClasses.value,\n ]}\n style={ textColorStyles.value }\n >\n { slots.default?.({\n backgroundColorClasses,\n backgroundColorStyles,\n })}\n\n <div\n class={[\n 'v-selection-control__input',\n ]}\n v-ripple={ props.ripple && [\n !props.disabled && !props.readonly,\n null,\n ['center', 'circle'],\n ]}\n >\n { slots.input?.({\n model,\n textColorClasses,\n textColorStyles,\n backgroundColorClasses,\n backgroundColorStyles,\n inputNode,\n icon: icon.value,\n props: {\n onFocus,\n onBlur,\n id: id.value,\n },\n } satisfies SelectionControlSlot) ?? (\n <>\n { icon.value && <VIcon key=\"icon\" icon={ icon.value } /> }\n\n { inputNode }\n </>\n )}\n </div>\n </div>\n\n { label && (\n <VLabel for={ id.value } clickable onClick={ (e: Event) => e.stopPropagation() }>\n { label }\n </VLabel>\n )}\n </div>\n )\n })\n\n return {\n isFocused,\n input,\n }\n },\n})\n\nexport type VSelectionControl = InstanceType<typeof VSelectionControl>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,KAAK;AAAA,SACLC,MAAM;AAAA,SACNC,8BAA8B,EAAEC,4BAA4B,gEAErE;AAAA,SACSC,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,kBAAkB;AAAA,SAClBC,UAAU;AAAA,SACVC,eAAe,8CAExB;AAAA,SACSC,MAAM,6CAEf;AACA,SAASC,QAAQ,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,UAAU,QAAQ,KAAK;AAAA,SAE/DC,gBAAgB,EAChBC,gBAAgB,EAChBC,MAAM,EACNC,eAAe,EACfC,YAAY,EACZC,SAAS,EACTC,WAAW,gCAGb;AA6BA,OAAO,MAAMC,0BAA0B,GAAGH,YAAY,CAAC;EACrDI,KAAK,EAAEC,MAAM;EACbC,SAAS,EAAE,IAAI;EACfC,UAAU,EAAE,IAAI;EAChBC,KAAK,EAAE,IAAI;EAEX,GAAGrB,kBAAkB,EAAE;EACvB,GAAGJ,8BAA8B;AACnC,CAAC,EAAE,mBAAmB,CAAC;AAEvB,OAAO,SAAS0B,mBAAmBA,CACjCC,KAEC,EACD;EACA,MAAMC,KAAK,GAAGnB,MAAM,CAACR,4BAA4B,EAAE4B,SAAS,CAAC;EAC7D,MAAM;IAAEC;EAAe,CAAC,G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AC,CACrB,OAyBHtB,KAAK,IAAA+D,YAAA,CAAArF,MAAA;QAAA,OACSqE,EAAE,CAAC3C,KAAK;QAAA;QAAA,WAAwBkD,CAAQ,IAAKA,CAAC,CAACoB,eAAe;MAAE;QAAAL,OAAA,EAAAA,CAAA,MAC1ErE,KAAK;MAAA,EAEV;IAGP,CAAC,CAAC;IAEF,OAAO;MACLgD,SAAS;MACTE;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
-
import { ComponentPropsOptions, ExtractPropTypes, VNodeChild, VNode, JSXComponent, PropType, Ref, nextTick, WritableComputedRef
|
|
2
|
+
import { ComponentPropsOptions, ExtractPropTypes, VNodeChild, VNode, JSXComponent, PropType, Ref, CSSProperties, nextTick, WritableComputedRef } from 'vue';
|
|
3
3
|
|
|
4
4
|
type SlotsToProps<U extends RawSlots, T = MakeInternalSlots<U>> = {
|
|
5
5
|
$children?: (VNodeChild | (T extends {
|
|
@@ -41,6 +41,8 @@ type SelectionControlSlot = {
|
|
|
41
41
|
model: WritableComputedRef<any>;
|
|
42
42
|
textColorClasses: Ref<string[]>;
|
|
43
43
|
textColorStyles: Ref<CSSProperties>;
|
|
44
|
+
backgroundColorClasses: Ref<string[]>;
|
|
45
|
+
backgroundColorStyles: Ref<CSSProperties>;
|
|
44
46
|
inputNode: VNode;
|
|
45
47
|
icon: IconValue | undefined;
|
|
46
48
|
props: {
|
|
@@ -50,7 +52,10 @@ type SelectionControlSlot = {
|
|
|
50
52
|
};
|
|
51
53
|
};
|
|
52
54
|
type VSelectionControlSlots = {
|
|
53
|
-
default:
|
|
55
|
+
default: {
|
|
56
|
+
backgroundColorClasses: Ref<string[]>;
|
|
57
|
+
backgroundColorStyles: Ref<CSSProperties>;
|
|
58
|
+
};
|
|
54
59
|
label: {
|
|
55
60
|
label: string | undefined;
|
|
56
61
|
props: Record<string, unknown>;
|
|
@@ -135,7 +140,10 @@ declare const VSelectionControl: {
|
|
|
135
140
|
[x: string]: unknown;
|
|
136
141
|
};
|
|
137
142
|
$slots: Readonly<{
|
|
138
|
-
default?: ((
|
|
143
|
+
default?: ((arg: {
|
|
144
|
+
backgroundColorClasses: Ref<string[]>;
|
|
145
|
+
backgroundColorStyles: Ref<CSSProperties>;
|
|
146
|
+
}) => VNode<vue.RendererNode, vue.RendererElement, {
|
|
139
147
|
[key: string]: any;
|
|
140
148
|
}>[]) | undefined;
|
|
141
149
|
label?: ((arg: {
|
|
@@ -194,7 +202,10 @@ declare const VSelectionControl: {
|
|
|
194
202
|
ripple: boolean;
|
|
195
203
|
valueComparator: typeof deepEqual;
|
|
196
204
|
}, {}, string, vue.SlotsType<Partial<{
|
|
197
|
-
default: (
|
|
205
|
+
default: (arg: {
|
|
206
|
+
backgroundColorClasses: Ref<string[]>;
|
|
207
|
+
backgroundColorStyles: Ref<CSSProperties>;
|
|
208
|
+
}) => VNode<vue.RendererNode, vue.RendererElement, {
|
|
198
209
|
[key: string]: any;
|
|
199
210
|
}>[];
|
|
200
211
|
label: (arg: {
|
|
@@ -301,7 +312,10 @@ declare const VSelectionControl: {
|
|
|
301
312
|
ripple: boolean;
|
|
302
313
|
valueComparator: typeof deepEqual;
|
|
303
314
|
}, {}, string, vue.SlotsType<Partial<{
|
|
304
|
-
default: (
|
|
315
|
+
default: (arg: {
|
|
316
|
+
backgroundColorClasses: Ref<string[]>;
|
|
317
|
+
backgroundColorStyles: Ref<CSSProperties>;
|
|
318
|
+
}) => VNode<vue.RendererNode, vue.RendererElement, {
|
|
305
319
|
[key: string]: any;
|
|
306
320
|
}>[];
|
|
307
321
|
label: (arg: {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
.v-switch .v-label {
|
|
2
2
|
padding-inline-start: 10px;
|
|
3
3
|
}
|
|
4
|
+
.v-switch .v-switch__thumb {
|
|
5
|
+
background-color: rgb(var(--v-theme-surface-bright));
|
|
6
|
+
color: rgb(var(--v-theme-on-surface-bright));
|
|
7
|
+
}
|
|
4
8
|
|
|
5
9
|
.v-switch__loader {
|
|
6
10
|
display: flex;
|
|
@@ -20,13 +24,13 @@
|
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
.v-switch__track {
|
|
23
|
-
background-color:
|
|
27
|
+
background-color: rgb(var(--v-theme-surface-variant));
|
|
24
28
|
border-radius: 9999px;
|
|
25
29
|
height: 14px;
|
|
26
30
|
opacity: 0.6;
|
|
27
31
|
width: 36px;
|
|
28
32
|
cursor: pointer;
|
|
29
|
-
transition: 0.2s color cubic-bezier(0.4, 0, 0.2, 1);
|
|
33
|
+
transition: 0.2s background-color cubic-bezier(0.4, 0, 0.2, 1);
|
|
30
34
|
}
|
|
31
35
|
.v-switch--inset .v-switch__track {
|
|
32
36
|
border-radius: 9999px;
|
|
@@ -37,14 +41,12 @@
|
|
|
37
41
|
.v-switch__thumb {
|
|
38
42
|
align-items: center;
|
|
39
43
|
border-radius: 50%;
|
|
40
|
-
background: rgb(var(--v-theme-surface));
|
|
41
|
-
color: rgb(var(--v-theme-on-surface));
|
|
42
44
|
display: flex;
|
|
43
45
|
height: 20px;
|
|
44
46
|
justify-content: center;
|
|
45
47
|
width: 20px;
|
|
46
48
|
pointer-events: none;
|
|
47
|
-
transition: 0.15s 0.05s transform cubic-bezier(0, 0, 0.2, 1);
|
|
49
|
+
transition: 0.15s 0.05s transform cubic-bezier(0, 0, 0.2, 1), 0.2s color cubic-bezier(0.4, 0, 0.2, 1), 0.2s background-color cubic-bezier(0.4, 0, 0.2, 1);
|
|
48
50
|
position: relative;
|
|
49
51
|
overflow: hidden;
|
|
50
52
|
box-shadow: 0px 2px 4px -1px var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, 0.2)), 0px 4px 5px 0px var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, 0.14)), 0px 1px 10px 0px var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, 0.12));
|