vuetify 3.3.13 → 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/attributes.json +70 -66
- package/dist/json/importMap.json +12 -12
- package/dist/json/tags.json +5 -4
- package/dist/json/web-types.json +274 -185
- package/dist/vuetify-labs.css +565 -486
- package/dist/vuetify-labs.d.ts +831 -462
- package/dist/vuetify-labs.esm.js +453 -310
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +452 -309
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +318 -239
- package/dist/vuetify.d.ts +678 -301
- package/dist/vuetify.esm.js +253 -173
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +252 -172
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +842 -830
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VAppBar/VAppBar.mjs.map +1 -1
- package/lib/components/VAppBar/index.d.mts +6 -6
- package/lib/components/VAutocomplete/VAutocomplete.mjs +12 -2
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VBadge/VBadge.css +1 -1
- package/lib/components/VBadge/_variables.scss +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 +2 -2
- package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
- package/lib/components/VCheckbox/VCheckboxBtn.mjs +14 -11
- package/lib/components/VCheckbox/VCheckboxBtn.mjs.map +1 -1
- package/lib/components/VCheckbox/index.d.mts +203 -87
- package/lib/components/VColorPicker/VColorPickerEdit.css +4 -2
- package/lib/components/VColorPicker/VColorPickerPreview.css +11 -6
- package/lib/components/VCombobox/VCombobox.mjs +11 -1
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VField/VField.css +25 -7
- package/lib/components/VField/VField.sass +15 -1
- package/lib/components/VGrid/VGrid.css +153 -142
- 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/VProgressLinear/VProgressLinear.css +3 -2
- package/lib/components/VRadio/index.d.mts +82 -23
- package/lib/components/VRadioGroup/VRadioGroup.mjs +2 -2
- package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
- package/lib/components/VRadioGroup/index.d.mts +75 -109
- package/lib/components/VRangeSlider/index.d.mts +114 -33
- package/lib/components/VSelect/VSelect.mjs +12 -2
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelectionControl/VSelectionControl.mjs +19 -3
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
- package/lib/components/VSelectionControl/index.d.mts +19 -5
- package/lib/components/VSlider/VSlider.mjs.map +1 -1
- package/lib/components/VSlider/VSliderThumb.css +8 -4
- package/lib/components/VSlider/VSliderTrack.css +22 -12
- package/lib/components/VSlider/index.d.mts +114 -33
- package/lib/components/VSwitch/VSwitch.css +7 -5
- package/lib/components/VSwitch/VSwitch.mjs +26 -16
- 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/VTimeline/VTimeline.css +19 -10
- package/lib/components/VTimeline/VTimeline.sass +5 -0
- package/lib/components/VToolbar/VToolbar.css +4 -2
- package/lib/components/index.d.mts +676 -299
- package/lib/composables/color.mjs +6 -1
- package/lib/composables/color.mjs.map +1 -1
- package/lib/composables/defaults.mjs +9 -9
- package/lib/composables/defaults.mjs.map +1 -1
- package/lib/composables/theme.mjs +8 -7
- 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 +3 -3
- package/lib/labs/VDateInput/index.d.mts +2 -2
- package/lib/labs/VDatePicker/VDateCard.mjs +3 -0
- package/lib/labs/VDatePicker/VDateCard.mjs.map +1 -1
- package/lib/labs/VDatePicker/VDatePicker.mjs +51 -21
- package/lib/labs/VDatePicker/VDatePicker.mjs.map +1 -1
- package/lib/labs/VDatePicker/VDatePickerControls.css +1 -1
- package/lib/labs/VDatePicker/VDatePickerControls.mjs +53 -35
- package/lib/labs/VDatePicker/VDatePickerControls.mjs.map +1 -1
- package/lib/labs/VDatePicker/VDatePickerMonth.mjs +37 -28
- package/lib/labs/VDatePicker/VDatePickerMonth.mjs.map +1 -1
- package/lib/labs/VDatePicker/VDatePickerYears.mjs +19 -17
- package/lib/labs/VDatePicker/VDatePickerYears.mjs.map +1 -1
- package/lib/labs/VDatePicker/index.d.mts +148 -156
- package/lib/labs/VDateRangePicker/VDateRangeCard.mjs +3 -0
- package/lib/labs/VDateRangePicker/VDateRangeCard.mjs.map +1 -1
- package/lib/labs/VDateRangePicker/index.d.mts +59 -52
- package/lib/labs/VSkeletonLoader/VSkeletonLoader.mjs.map +1 -1
- package/lib/labs/VSkeletonLoader/index.d.mts +8 -8
- package/lib/labs/components.d.mts +156 -164
- 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/locale/no.mjs +1 -1
- package/lib/locale/no.mjs.map +1 -1
- package/lib/styles/tools/_rtl.sass +4 -2
- package/lib/styles/tools/_states.sass +5 -5
- package/lib/util/colorUtils.mjs +6 -0
- package/lib/util/colorUtils.mjs.map +1 -1
- package/lib/util/helpers.mjs +10 -4
- package/lib/util/helpers.mjs.map +1 -1
- package/lib/util/injectSelf.mjs +2 -1
- package/lib/util/injectSelf.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -8,6 +8,12 @@ interface FilterPropsOptions<PropsOptions extends Readonly<ComponentPropsOptions
|
|
|
8
8
|
type EventProp<T extends any[] = any[], F = (...args: T) => any> = F | F[];
|
|
9
9
|
declare const EventProp: <T extends any[] = any[]>() => PropType<EventProp<T, (...args: T) => any>>;
|
|
10
10
|
|
|
11
|
+
type Tick = {
|
|
12
|
+
value: number;
|
|
13
|
+
position: number;
|
|
14
|
+
label?: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
11
17
|
type VMessageSlot = {
|
|
12
18
|
message: string;
|
|
13
19
|
};
|
|
@@ -76,9 +82,14 @@ declare const VSlider: {
|
|
|
76
82
|
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
77
83
|
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
78
84
|
message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
85
|
+
'thumb-label'?: ((arg: {
|
|
86
|
+
modelValue: number;
|
|
87
|
+
}) => vue.VNodeChild) | undefined;
|
|
88
|
+
'tick-label'?: ((arg: {
|
|
89
|
+
tick: Tick;
|
|
90
|
+
index: number;
|
|
91
|
+
}) => vue.VNodeChild) | undefined;
|
|
79
92
|
label?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
80
|
-
'tick-label'?: (() => vue.VNodeChild) | undefined;
|
|
81
|
-
'thumb-label'?: (() => vue.VNodeChild) | undefined;
|
|
82
93
|
};
|
|
83
94
|
ref?: vue.VNodeRef | undefined;
|
|
84
95
|
ref_for?: boolean | undefined;
|
|
@@ -90,9 +101,14 @@ declare const VSlider: {
|
|
|
90
101
|
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
91
102
|
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
92
103
|
message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
104
|
+
'thumb-label'?: false | ((arg: {
|
|
105
|
+
modelValue: number;
|
|
106
|
+
}) => vue.VNodeChild) | undefined;
|
|
107
|
+
'tick-label'?: false | ((arg: {
|
|
108
|
+
tick: Tick;
|
|
109
|
+
index: number;
|
|
110
|
+
}) => vue.VNodeChild) | undefined;
|
|
93
111
|
label?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
94
|
-
'tick-label'?: false | (() => vue.VNodeChild) | undefined;
|
|
95
|
-
'thumb-label'?: false | (() => vue.VNodeChild) | undefined;
|
|
96
112
|
} | undefined;
|
|
97
113
|
onVnodeBeforeMount?: ((vnode: vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
98
114
|
[key: string]: any;
|
|
@@ -147,12 +163,17 @@ declare const VSlider: {
|
|
|
147
163
|
hint?: string | undefined;
|
|
148
164
|
hideDetails?: boolean | "auto" | undefined;
|
|
149
165
|
"v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
150
|
-
"v-slot:tick-label"?: false | ((
|
|
166
|
+
"v-slot:tick-label"?: false | ((arg: {
|
|
167
|
+
tick: Tick;
|
|
168
|
+
index: number;
|
|
169
|
+
}) => vue.VNodeChild) | undefined;
|
|
151
170
|
trackColor?: string | undefined;
|
|
152
171
|
trackFillColor?: string | undefined;
|
|
153
172
|
thumbColor?: string | undefined;
|
|
154
173
|
ticks?: readonly number[] | Record<number, string> | undefined;
|
|
155
|
-
"v-slot:thumb-label"?: false | ((
|
|
174
|
+
"v-slot:thumb-label"?: false | ((arg: {
|
|
175
|
+
modelValue: number;
|
|
176
|
+
}) => vue.VNodeChild) | undefined;
|
|
156
177
|
onEnd?: ((value: number) => any) | undefined;
|
|
157
178
|
onStart?: ((value: number) => any) | undefined;
|
|
158
179
|
};
|
|
@@ -178,13 +199,18 @@ declare const VSlider: {
|
|
|
178
199
|
message?: ((arg: VMessageSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
179
200
|
[key: string]: any;
|
|
180
201
|
}>[]) | undefined;
|
|
181
|
-
label?: ((arg:
|
|
202
|
+
'thumb-label'?: ((arg: {
|
|
203
|
+
modelValue: number;
|
|
204
|
+
}) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
182
205
|
[key: string]: any;
|
|
183
206
|
}>[]) | undefined;
|
|
184
|
-
'tick-label'?: ((
|
|
207
|
+
'tick-label'?: ((arg: {
|
|
208
|
+
tick: Tick;
|
|
209
|
+
index: number;
|
|
210
|
+
}) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
185
211
|
[key: string]: any;
|
|
186
212
|
}>[]) | undefined;
|
|
187
|
-
|
|
213
|
+
label?: ((arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
188
214
|
[key: string]: any;
|
|
189
215
|
}>[]) | undefined;
|
|
190
216
|
}>;
|
|
@@ -244,9 +270,14 @@ declare const VSlider: {
|
|
|
244
270
|
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
245
271
|
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
246
272
|
message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
273
|
+
'thumb-label'?: ((arg: {
|
|
274
|
+
modelValue: number;
|
|
275
|
+
}) => vue.VNodeChild) | undefined;
|
|
276
|
+
'tick-label'?: ((arg: {
|
|
277
|
+
tick: Tick;
|
|
278
|
+
index: number;
|
|
279
|
+
}) => vue.VNodeChild) | undefined;
|
|
247
280
|
label?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
248
|
-
'tick-label'?: (() => vue.VNodeChild) | undefined;
|
|
249
|
-
'thumb-label'?: (() => vue.VNodeChild) | undefined;
|
|
250
281
|
};
|
|
251
282
|
'v-slots'?: {
|
|
252
283
|
default?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
@@ -254,9 +285,14 @@ declare const VSlider: {
|
|
|
254
285
|
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
255
286
|
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
256
287
|
message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
288
|
+
'thumb-label'?: false | ((arg: {
|
|
289
|
+
modelValue: number;
|
|
290
|
+
}) => vue.VNodeChild) | undefined;
|
|
291
|
+
'tick-label'?: false | ((arg: {
|
|
292
|
+
tick: Tick;
|
|
293
|
+
index: number;
|
|
294
|
+
}) => vue.VNodeChild) | undefined;
|
|
257
295
|
label?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
258
|
-
'tick-label'?: false | (() => vue.VNodeChild) | undefined;
|
|
259
|
-
'thumb-label'?: false | (() => vue.VNodeChild) | undefined;
|
|
260
296
|
} | undefined;
|
|
261
297
|
} & {
|
|
262
298
|
"v-slot:default"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
@@ -264,9 +300,14 @@ declare const VSlider: {
|
|
|
264
300
|
"v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
265
301
|
"v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
266
302
|
"v-slot:message"?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
303
|
+
"v-slot:thumb-label"?: false | ((arg: {
|
|
304
|
+
modelValue: number;
|
|
305
|
+
}) => vue.VNodeChild) | undefined;
|
|
306
|
+
"v-slot:tick-label"?: false | ((arg: {
|
|
307
|
+
tick: Tick;
|
|
308
|
+
index: number;
|
|
309
|
+
}) => vue.VNodeChild) | undefined;
|
|
267
310
|
"v-slot:label"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
268
|
-
"v-slot:tick-label"?: false | (() => vue.VNodeChild) | undefined;
|
|
269
|
-
"v-slot:thumb-label"?: false | (() => vue.VNodeChild) | undefined;
|
|
270
311
|
} & {
|
|
271
312
|
"onUpdate:modelValue"?: ((v: number) => any) | undefined;
|
|
272
313
|
"onUpdate:focused"?: ((value: boolean) => any) | undefined;
|
|
@@ -319,13 +360,18 @@ declare const VSlider: {
|
|
|
319
360
|
message: (arg: VMessageSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
320
361
|
[key: string]: any;
|
|
321
362
|
}>[];
|
|
322
|
-
label: (arg:
|
|
363
|
+
'thumb-label': (arg: {
|
|
364
|
+
modelValue: number;
|
|
365
|
+
}) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
323
366
|
[key: string]: any;
|
|
324
367
|
}>[];
|
|
325
|
-
'tick-label': (
|
|
368
|
+
'tick-label': (arg: {
|
|
369
|
+
tick: Tick;
|
|
370
|
+
index: number;
|
|
371
|
+
}) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
326
372
|
[key: string]: any;
|
|
327
373
|
}>[];
|
|
328
|
-
|
|
374
|
+
label: (arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
329
375
|
[key: string]: any;
|
|
330
376
|
}>[];
|
|
331
377
|
}>>> & {
|
|
@@ -400,9 +446,14 @@ declare const VSlider: {
|
|
|
400
446
|
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
401
447
|
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
402
448
|
message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
449
|
+
'thumb-label'?: ((arg: {
|
|
450
|
+
modelValue: number;
|
|
451
|
+
}) => vue.VNodeChild) | undefined;
|
|
452
|
+
'tick-label'?: ((arg: {
|
|
453
|
+
tick: Tick;
|
|
454
|
+
index: number;
|
|
455
|
+
}) => vue.VNodeChild) | undefined;
|
|
403
456
|
label?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
404
|
-
'tick-label'?: (() => vue.VNodeChild) | undefined;
|
|
405
|
-
'thumb-label'?: (() => vue.VNodeChild) | undefined;
|
|
406
457
|
};
|
|
407
458
|
'v-slots'?: {
|
|
408
459
|
default?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
@@ -410,9 +461,14 @@ declare const VSlider: {
|
|
|
410
461
|
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
411
462
|
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
412
463
|
message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
464
|
+
'thumb-label'?: false | ((arg: {
|
|
465
|
+
modelValue: number;
|
|
466
|
+
}) => vue.VNodeChild) | undefined;
|
|
467
|
+
'tick-label'?: false | ((arg: {
|
|
468
|
+
tick: Tick;
|
|
469
|
+
index: number;
|
|
470
|
+
}) => vue.VNodeChild) | undefined;
|
|
413
471
|
label?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
414
|
-
'tick-label'?: false | (() => vue.VNodeChild) | undefined;
|
|
415
|
-
'thumb-label'?: false | (() => vue.VNodeChild) | undefined;
|
|
416
472
|
} | undefined;
|
|
417
473
|
} & {
|
|
418
474
|
"v-slot:default"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
@@ -420,9 +476,14 @@ declare const VSlider: {
|
|
|
420
476
|
"v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
421
477
|
"v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
422
478
|
"v-slot:message"?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
479
|
+
"v-slot:thumb-label"?: false | ((arg: {
|
|
480
|
+
modelValue: number;
|
|
481
|
+
}) => vue.VNodeChild) | undefined;
|
|
482
|
+
"v-slot:tick-label"?: false | ((arg: {
|
|
483
|
+
tick: Tick;
|
|
484
|
+
index: number;
|
|
485
|
+
}) => vue.VNodeChild) | undefined;
|
|
423
486
|
"v-slot:label"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
424
|
-
"v-slot:tick-label"?: false | (() => vue.VNodeChild) | undefined;
|
|
425
|
-
"v-slot:thumb-label"?: false | (() => vue.VNodeChild) | undefined;
|
|
426
487
|
} & {
|
|
427
488
|
"onUpdate:modelValue"?: ((v: number) => any) | undefined;
|
|
428
489
|
"onUpdate:focused"?: ((value: boolean) => any) | undefined;
|
|
@@ -484,9 +545,14 @@ declare const VSlider: {
|
|
|
484
545
|
append?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
485
546
|
details?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
486
547
|
message?: ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
548
|
+
'thumb-label'?: ((arg: {
|
|
549
|
+
modelValue: number;
|
|
550
|
+
}) => vue.VNodeChild) | undefined;
|
|
551
|
+
'tick-label'?: ((arg: {
|
|
552
|
+
tick: Tick;
|
|
553
|
+
index: number;
|
|
554
|
+
}) => vue.VNodeChild) | undefined;
|
|
487
555
|
label?: ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
488
|
-
'tick-label'?: (() => vue.VNodeChild) | undefined;
|
|
489
|
-
'thumb-label'?: (() => vue.VNodeChild) | undefined;
|
|
490
556
|
};
|
|
491
557
|
'v-slots'?: {
|
|
492
558
|
default?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
@@ -494,9 +560,14 @@ declare const VSlider: {
|
|
|
494
560
|
append?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
495
561
|
details?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
496
562
|
message?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
563
|
+
'thumb-label'?: false | ((arg: {
|
|
564
|
+
modelValue: number;
|
|
565
|
+
}) => vue.VNodeChild) | undefined;
|
|
566
|
+
'tick-label'?: false | ((arg: {
|
|
567
|
+
tick: Tick;
|
|
568
|
+
index: number;
|
|
569
|
+
}) => vue.VNodeChild) | undefined;
|
|
497
570
|
label?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
498
|
-
'tick-label'?: false | (() => vue.VNodeChild) | undefined;
|
|
499
|
-
'thumb-label'?: false | (() => vue.VNodeChild) | undefined;
|
|
500
571
|
} | undefined;
|
|
501
572
|
} & {
|
|
502
573
|
"v-slot:default"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
@@ -504,9 +575,14 @@ declare const VSlider: {
|
|
|
504
575
|
"v-slot:append"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
505
576
|
"v-slot:details"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
506
577
|
"v-slot:message"?: false | ((arg: VMessageSlot) => vue.VNodeChild) | undefined;
|
|
578
|
+
"v-slot:thumb-label"?: false | ((arg: {
|
|
579
|
+
modelValue: number;
|
|
580
|
+
}) => vue.VNodeChild) | undefined;
|
|
581
|
+
"v-slot:tick-label"?: false | ((arg: {
|
|
582
|
+
tick: Tick;
|
|
583
|
+
index: number;
|
|
584
|
+
}) => vue.VNodeChild) | undefined;
|
|
507
585
|
"v-slot:label"?: false | ((arg: VInputSlot) => vue.VNodeChild) | undefined;
|
|
508
|
-
"v-slot:tick-label"?: false | (() => vue.VNodeChild) | undefined;
|
|
509
|
-
"v-slot:thumb-label"?: false | (() => vue.VNodeChild) | undefined;
|
|
510
586
|
} & {
|
|
511
587
|
"onUpdate:modelValue"?: ((v: number) => any) | undefined;
|
|
512
588
|
"onUpdate:focused"?: ((value: boolean) => any) | undefined;
|
|
@@ -559,13 +635,18 @@ declare const VSlider: {
|
|
|
559
635
|
message: (arg: VMessageSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
560
636
|
[key: string]: any;
|
|
561
637
|
}>[];
|
|
562
|
-
label: (arg:
|
|
638
|
+
'thumb-label': (arg: {
|
|
639
|
+
modelValue: number;
|
|
640
|
+
}) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
563
641
|
[key: string]: any;
|
|
564
642
|
}>[];
|
|
565
|
-
'tick-label': (
|
|
643
|
+
'tick-label': (arg: {
|
|
644
|
+
tick: Tick;
|
|
645
|
+
index: number;
|
|
646
|
+
}) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
566
647
|
[key: string]: any;
|
|
567
648
|
}>[];
|
|
568
|
-
|
|
649
|
+
label: (arg: VInputSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
569
650
|
[key: string]: any;
|
|
570
651
|
}>[];
|
|
571
652
|
}>>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & FilterPropsOptions<{
|
|
@@ -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));
|
|
@@ -48,6 +48,7 @@ export const VSwitch = genericComponent()({
|
|
|
48
48
|
focus,
|
|
49
49
|
blur
|
|
50
50
|
} = useFocus(props);
|
|
51
|
+
const control = ref();
|
|
51
52
|
const loaderColor = computed(() => {
|
|
52
53
|
return typeof props.loading === 'string' && props.loading !== '' ? props.loading : props.color;
|
|
53
54
|
});
|
|
@@ -58,16 +59,15 @@ export const VSwitch = genericComponent()({
|
|
|
58
59
|
indeterminate.value = false;
|
|
59
60
|
}
|
|
60
61
|
}
|
|
62
|
+
function onTrackClick(e) {
|
|
63
|
+
e.stopPropagation();
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
control.value?.input?.click();
|
|
66
|
+
}
|
|
61
67
|
useRender(() => {
|
|
62
|
-
const [
|
|
68
|
+
const [rootAttrs, controlAttrs] = filterInputAttrs(attrs);
|
|
63
69
|
const [inputProps, _1] = VInput.filterProps(props);
|
|
64
70
|
const [controlProps, _2] = VSelectionControl.filterProps(props);
|
|
65
|
-
const control = ref();
|
|
66
|
-
function onClick(e) {
|
|
67
|
-
e.stopPropagation();
|
|
68
|
-
e.preventDefault();
|
|
69
|
-
control.value?.input?.click();
|
|
70
|
-
}
|
|
71
71
|
return _createVNode(VInput, _mergeProps({
|
|
72
72
|
"class": ['v-switch', {
|
|
73
73
|
'v-switch--inset': props.inset
|
|
@@ -75,7 +75,7 @@ export const VSwitch = genericComponent()({
|
|
|
75
75
|
'v-switch--indeterminate': indeterminate.value
|
|
76
76
|
}, loaderClasses.value, props.class],
|
|
77
77
|
"style": props.style
|
|
78
|
-
},
|
|
78
|
+
}, rootAttrs, inputProps, {
|
|
79
79
|
"id": id.value,
|
|
80
80
|
"focused": isFocused.value
|
|
81
81
|
}), {
|
|
@@ -103,19 +103,29 @@ export const VSwitch = genericComponent()({
|
|
|
103
103
|
"onBlur": blur
|
|
104
104
|
}, controlAttrs), {
|
|
105
105
|
...slots,
|
|
106
|
-
default:
|
|
107
|
-
"class": "v-switch__track",
|
|
108
|
-
"onClick": onClick
|
|
109
|
-
}, null),
|
|
110
|
-
input: _ref3 => {
|
|
106
|
+
default: _ref3 => {
|
|
111
107
|
let {
|
|
112
|
-
|
|
113
|
-
|
|
108
|
+
backgroundColorClasses,
|
|
109
|
+
backgroundColorStyles
|
|
114
110
|
} = _ref3;
|
|
111
|
+
return _createVNode("div", {
|
|
112
|
+
"class": ['v-switch__track', ...backgroundColorClasses.value],
|
|
113
|
+
"style": backgroundColorStyles.value,
|
|
114
|
+
"onClick": onTrackClick
|
|
115
|
+
}, null);
|
|
116
|
+
},
|
|
117
|
+
input: _ref4 => {
|
|
118
|
+
let {
|
|
119
|
+
inputNode,
|
|
120
|
+
icon,
|
|
121
|
+
backgroundColorClasses,
|
|
122
|
+
backgroundColorStyles
|
|
123
|
+
} = _ref4;
|
|
115
124
|
return _createVNode(_Fragment, null, [inputNode, _createVNode("div", {
|
|
116
125
|
"class": ['v-switch__thumb', {
|
|
117
126
|
'v-switch__thumb--filled': icon || props.loading
|
|
118
|
-
}]
|
|
127
|
+
}, props.inset ? undefined : backgroundColorClasses.value],
|
|
128
|
+
"style": props.inset ? undefined : backgroundColorStyles.value
|
|
119
129
|
}, [_createVNode(VScaleTransition, null, {
|
|
120
130
|
default: () => [!props.loading ? icon && _createVNode(VIcon, {
|
|
121
131
|
"key": icon,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VSwitch.mjs","names":["VScaleTransition","VIcon","makeVInputProps","VInput","VProgressCircular","makeVSelectionControlProps","VSelectionControl","useFocus","LoaderSlot","useLoader","useProxiedModel","computed","ref","filterInputAttrs","genericComponent","getUid","propsFactory","useRender","makeVSwitchProps","indeterminate","Boolean","inset","flat","loading","type","String","default","VSwitch","name","inheritAttrs","props","emits","focused","update:modelValue","val","setup","_ref","attrs","slots","model","loaderClasses","isFocused","focus","blur","loaderColor","color","uid","id","onChange","value","inputAttrs","controlAttrs","inputProps","_1","filterProps","controlProps","_2","control","onClick","e","stopPropagation","preventDefault","input","click","_createVNode","_mergeProps","class","style","_ref2","messagesId","isDisabled","isReadonly","isValid","$event","undefined","_ref3","inputNode","icon","_Fragment","slotProps","loader","isActive"],"sources":["../../../src/components/VSwitch/VSwitch.tsx"],"sourcesContent":["// Styles\nimport './VSwitch.sass'\n\n// Components\nimport { VScaleTransition } from '@/components/transitions'\nimport { VIcon } from '@/components/VIcon'\nimport { makeVInputProps, VInput } from '@/components/VInput/VInput'\nimport { VProgressCircular } from '@/components/VProgressCircular'\nimport { makeVSelectionControlProps, VSelectionControl } from '@/components/VSelectionControl/VSelectionControl'\n\n// Composables\nimport { useFocus } from '@/composables/focus'\nimport { LoaderSlot, useLoader } from '@/composables/loader'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, ref } from 'vue'\nimport { filterInputAttrs, genericComponent, getUid, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { VInputSlots } from '@/components/VInput/VInput'\nimport type { VSelectionControlSlots } from '@/components/VSelectionControl/VSelectionControl'\nimport type { LoaderSlotProps } from '@/composables/loader'\n\nexport type VSwitchSlots =\n & VInputSlots\n & VSelectionControlSlots\n & { loader: LoaderSlotProps }\n\nexport const makeVSwitchProps = propsFactory({\n indeterminate: Boolean,\n inset: Boolean,\n flat: Boolean,\n loading: {\n type: [Boolean, String],\n default: false,\n },\n\n ...makeVInputProps(),\n ...makeVSelectionControlProps(),\n}, 'VSwitch')\n\nexport const VSwitch = genericComponent<VSwitchSlots>()({\n name: 'VSwitch',\n\n inheritAttrs: false,\n\n props: makeVSwitchProps(),\n\n emits: {\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': () => true,\n 'update:indeterminate': (val: boolean) => true,\n },\n\n setup (props, { attrs, slots }) {\n const indeterminate = useProxiedModel(props, 'indeterminate')\n const model = useProxiedModel(props, 'modelValue')\n const { loaderClasses } = useLoader(props)\n const { isFocused, focus, blur } = useFocus(props)\n\n const loaderColor = computed(() => {\n return typeof props.loading === 'string' && props.loading !== ''\n ? props.loading\n : props.color\n })\n\n const uid = getUid()\n const id = computed(() => props.id || `switch-${uid}`)\n\n function onChange () {\n if (indeterminate.value) {\n indeterminate.value = false\n }\n }\n\n useRender(() => {\n const [inputAttrs, controlAttrs] = filterInputAttrs(attrs)\n const [inputProps, _1] = VInput.filterProps(props)\n const [controlProps, _2] = VSelectionControl.filterProps(props)\n const control = ref<VSelectionControl>()\n\n function onClick (e: Event) {\n e.stopPropagation()\n e.preventDefault()\n control.value?.input?.click()\n }\n\n return (\n <VInput\n class={[\n 'v-switch',\n { 'v-switch--inset': props.inset },\n { 'v-switch--indeterminate': indeterminate.value },\n loaderClasses.value,\n props.class,\n ]}\n style={ props.style }\n { ...inputAttrs }\n { ...inputProps }\n id={ id.value }\n focused={ isFocused.value }\n >\n {{\n ...slots,\n default: ({\n id,\n messagesId,\n isDisabled,\n isReadonly,\n isValid,\n }) => (\n <VSelectionControl\n ref={ control }\n { ...controlProps }\n v-model={ model.value }\n id={ id.value }\n aria-describedby={ messagesId.value }\n type=\"checkbox\"\n onUpdate:modelValue={ onChange }\n aria-checked={ indeterminate.value ? 'mixed' : undefined }\n disabled={ isDisabled.value }\n readonly={ isReadonly.value }\n onFocus={ focus }\n onBlur={ blur }\n { ...controlAttrs }\n >\n {{\n ...slots,\n default: () => (<div class=\"v-switch__track\" onClick={ onClick }></div>),\n input: ({ inputNode, icon }) => (\n <>\n { inputNode }\n\n <div\n class={[\n 'v-switch__thumb',\n { 'v-switch__thumb--filled': icon || props.loading },\n ]}\n >\n <VScaleTransition>\n { !props.loading ? (\n icon && <VIcon key={ icon as any } icon={ icon } size=\"x-small\" />\n ) : (\n <LoaderSlot\n name=\"v-switch\"\n active\n color={ isValid.value === false ? undefined : loaderColor.value }\n >\n { slotProps => (\n slots.loader\n ? slots.loader(slotProps)\n : (\n <VProgressCircular\n active={ slotProps.isActive }\n color={ slotProps.color }\n indeterminate\n size=\"16\"\n width=\"2\"\n />\n )\n )}\n </LoaderSlot>\n )}\n </VScaleTransition>\n </div>\n </>\n ),\n }}\n </VSelectionControl>\n ),\n }}\n </VInput>\n )\n })\n\n return {}\n },\n})\n\nexport type VSwitch = InstanceType<typeof VSwitch>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,gBAAgB;AAAA,SAChBC,KAAK;AAAA,SACLC,eAAe,EAAEC,MAAM;AAAA,SACvBC,iBAAiB;AAAA,SACjBC,0BAA0B,EAAEC,iBAAiB,sDAEtD;AAAA,SACSC,QAAQ;AAAA,SACRC,UAAU,EAAEC,SAAS;AAAA,SACrBC,eAAe,8CAExB;AACA,SAASC,QAAQ,EAAEC,GAAG,QAAQ,KAAK;AAAA,SAC1BC,gBAAgB,EAAEC,gBAAgB,EAAEC,MAAM,EAAEC,YAAY,EAAEC,SAAS,gCAE5E;AAUA,OAAO,MAAMC,gBAAgB,GAAGF,YAAY,CAAC;EAC3CG,aAAa,EAAEC,OAAO;EACtBC,KAAK,EAAED,OAAO;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BAAA,SACnBF,SAAS,CAAClC,KAAK;oBAAA;oBAAA,QAElB,IAAI;oBAAA,SACH;kBAAG;gBAGhB,EAEJ;cAAA;YAAA;UAIR;QAAA;MAGN;IAIT,CAAC,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"VSwitch.mjs","names":["VScaleTransition","VIcon","makeVInputProps","VInput","VProgressCircular","makeVSelectionControlProps","VSelectionControl","useFocus","LoaderSlot","useLoader","useProxiedModel","computed","ref","filterInputAttrs","genericComponent","getUid","propsFactory","useRender","makeVSwitchProps","indeterminate","Boolean","inset","flat","loading","type","String","default","VSwitch","name","inheritAttrs","props","emits","focused","update:modelValue","val","setup","_ref","attrs","slots","model","loaderClasses","isFocused","focus","blur","control","loaderColor","color","uid","id","onChange","value","onTrackClick","e","stopPropagation","preventDefault","input","click","rootAttrs","controlAttrs","inputProps","_1","filterProps","controlProps","_2","_createVNode","_mergeProps","class","style","_ref2","messagesId","isDisabled","isReadonly","isValid","$event","undefined","_ref3","backgroundColorClasses","backgroundColorStyles","_ref4","inputNode","icon","_Fragment","slotProps","loader","isActive"],"sources":["../../../src/components/VSwitch/VSwitch.tsx"],"sourcesContent":["// Styles\nimport './VSwitch.sass'\n\n// Components\nimport { VScaleTransition } from '@/components/transitions'\nimport { VIcon } from '@/components/VIcon'\nimport { makeVInputProps, VInput } from '@/components/VInput/VInput'\nimport { VProgressCircular } from '@/components/VProgressCircular'\nimport { makeVSelectionControlProps, VSelectionControl } from '@/components/VSelectionControl/VSelectionControl'\n\n// Composables\nimport { useFocus } from '@/composables/focus'\nimport { LoaderSlot, useLoader } from '@/composables/loader'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, ref } from 'vue'\nimport { filterInputAttrs, genericComponent, getUid, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { VInputSlots } from '@/components/VInput/VInput'\nimport type { VSelectionControlSlots } from '@/components/VSelectionControl/VSelectionControl'\nimport type { LoaderSlotProps } from '@/composables/loader'\n\nexport type VSwitchSlots =\n & VInputSlots\n & VSelectionControlSlots\n & { loader: LoaderSlotProps }\n\nexport const makeVSwitchProps = propsFactory({\n indeterminate: Boolean,\n inset: Boolean,\n flat: Boolean,\n loading: {\n type: [Boolean, String],\n default: false,\n },\n\n ...makeVInputProps(),\n ...makeVSelectionControlProps(),\n}, 'VSwitch')\n\nexport const VSwitch = genericComponent<VSwitchSlots>()({\n name: 'VSwitch',\n\n inheritAttrs: false,\n\n props: makeVSwitchProps(),\n\n emits: {\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': () => true,\n 'update:indeterminate': (val: boolean) => true,\n },\n\n setup (props, { attrs, slots }) {\n const indeterminate = useProxiedModel(props, 'indeterminate')\n const model = useProxiedModel(props, 'modelValue')\n const { loaderClasses } = useLoader(props)\n const { isFocused, focus, blur } = useFocus(props)\n const control = ref<VSelectionControl>()\n\n const loaderColor = computed(() => {\n return typeof props.loading === 'string' && props.loading !== ''\n ? props.loading\n : props.color\n })\n\n const uid = getUid()\n const id = computed(() => props.id || `switch-${uid}`)\n\n function onChange () {\n if (indeterminate.value) {\n indeterminate.value = false\n }\n }\n function onTrackClick (e: Event) {\n e.stopPropagation()\n e.preventDefault()\n control.value?.input?.click()\n }\n\n useRender(() => {\n const [rootAttrs, controlAttrs] = filterInputAttrs(attrs)\n const [inputProps, _1] = VInput.filterProps(props)\n const [controlProps, _2] = VSelectionControl.filterProps(props)\n\n return (\n <VInput\n class={[\n 'v-switch',\n { 'v-switch--inset': props.inset },\n { 'v-switch--indeterminate': indeterminate.value },\n loaderClasses.value,\n props.class,\n ]}\n style={ props.style }\n { ...rootAttrs }\n { ...inputProps }\n id={ id.value }\n focused={ isFocused.value }\n >\n {{\n ...slots,\n default: ({\n id,\n messagesId,\n isDisabled,\n isReadonly,\n isValid,\n }) => (\n <VSelectionControl\n ref={ control }\n { ...controlProps }\n v-model={ model.value }\n id={ id.value }\n aria-describedby={ messagesId.value }\n type=\"checkbox\"\n onUpdate:modelValue={ onChange }\n aria-checked={ indeterminate.value ? 'mixed' : undefined }\n disabled={ isDisabled.value }\n readonly={ isReadonly.value }\n onFocus={ focus }\n onBlur={ blur }\n { ...controlAttrs }\n >\n {{\n ...slots,\n default: ({ backgroundColorClasses, backgroundColorStyles }) => (\n <div\n class={[\n 'v-switch__track',\n ...backgroundColorClasses.value,\n ]}\n style={ backgroundColorStyles.value }\n onClick={ onTrackClick }\n ></div>\n ),\n input: ({ inputNode, icon, backgroundColorClasses, backgroundColorStyles }) => (\n <>\n { inputNode }\n <div\n class={[\n 'v-switch__thumb',\n { 'v-switch__thumb--filled': icon || props.loading },\n props.inset ? undefined : backgroundColorClasses.value,\n ]}\n style={ props.inset ? undefined : backgroundColorStyles.value }\n >\n <VScaleTransition>\n { !props.loading ? (\n icon && <VIcon key={ icon as any } icon={ icon } size=\"x-small\" />\n ) : (\n <LoaderSlot\n name=\"v-switch\"\n active\n color={ isValid.value === false ? undefined : loaderColor.value }\n >\n { slotProps => (\n slots.loader\n ? slots.loader(slotProps)\n : (\n <VProgressCircular\n active={ slotProps.isActive }\n color={ slotProps.color }\n indeterminate\n size=\"16\"\n width=\"2\"\n />\n )\n )}\n </LoaderSlot>\n )}\n </VScaleTransition>\n </div>\n </>\n ),\n }}\n </VSelectionControl>\n ),\n }}\n </VInput>\n )\n })\n\n return {}\n },\n})\n\nexport type VSwitch = InstanceType<typeof VSwitch>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,gBAAgB;AAAA,SAChBC,KAAK;AAAA,SACLC,eAAe,EAAEC,MAAM;AAAA,SACvBC,iBAAiB;AAAA,SACjBC,0BAA0B,EAAEC,iBAAiB,sDAEtD;AAAA,SACSC,QAAQ;AAAA,SACRC,UAAU,EAAEC,SAAS;AAAA,SACrBC,eAAe,8CAExB;AACA,SAASC,QAAQ,EAAEC,GAAG,QAAQ,KAAK;AAAA,SAC1BC,gBAAgB,EAAEC,gBAAgB,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,gBAAA;gBAAA0B,OAAA,EAAAA,CAAA,MAGzD,CAACI,KAAK,CAACP,OAAO,GACdyD,IAAI,IAAAhB,YAAA,CAAA/D,KAAA;kBAAA,OAAiB+E,IAAI;kBAAA,QAAiBA,IAAI;kBAAA,QAAQ;gBAAS,QAAG,GAAAhB,YAAA,CAAAxD,UAAA;kBAAA,QAG3D,UAAU;kBAAA;kBAAA,SAEPgE,OAAO,CAACtB,KAAK,KAAK,KAAK,GAAGwB,SAAS,GAAG7B,WAAW,CAACK;gBAAK;kBAAAxB,OAAA,EAE7DwD,SAAS,IACT5C,KAAK,CAAC6C,MAAM,GACR7C,KAAK,CAAC6C,MAAM,CAACD,SAAS,CAAC,GAAAlB,YAAA,CAAA5D,iBAAA;oBAAA,UAGZ8E,SAAS,CAACE,QAAQ;oBAAA,SACnBF,SAAS,CAACpC,KAAK;oBAAA;oBAAA,QAElB,IAAI;oBAAA,SACH;kBAAG;gBAGhB,EAEJ;cAAA;YAAA;UAIR;QAAA;MAGN;IAIT,CAAC,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC"}
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
.v-label
|
|
8
8
|
padding-inline-start: $switch-label-margin-inline-start
|
|
9
9
|
|
|
10
|
+
.v-switch__thumb
|
|
11
|
+
background-color: $switch-thumb-background
|
|
12
|
+
color: $switch-thumb-color
|
|
13
|
+
|
|
10
14
|
.v-switch__loader
|
|
11
15
|
display: flex
|
|
12
16
|
|
|
@@ -22,7 +26,7 @@
|
|
|
22
26
|
color: $switch-error-color
|
|
23
27
|
|
|
24
28
|
.v-switch__track
|
|
25
|
-
background-color:
|
|
29
|
+
background-color: $switch-track-background
|
|
26
30
|
border-radius: $switch-track-radius
|
|
27
31
|
height: $switch-track-height
|
|
28
32
|
opacity: $switch-track-opacity
|
|
@@ -38,14 +42,12 @@
|
|
|
38
42
|
.v-switch__thumb
|
|
39
43
|
align-items: center
|
|
40
44
|
border-radius: $switch-thumb-radius
|
|
41
|
-
background: $switch-thumb-background
|
|
42
|
-
color: $switch-thumb-color
|
|
43
45
|
display: flex
|
|
44
46
|
height: $switch-thumb-height
|
|
45
47
|
justify-content: center
|
|
46
48
|
width: $switch-thumb-width
|
|
47
49
|
pointer-events: none
|
|
48
|
-
transition:
|
|
50
|
+
transition: $switch-thumb-transition
|
|
49
51
|
position: relative
|
|
50
52
|
overflow: hidden
|
|
51
53
|
|
|
@@ -16,16 +16,18 @@ $switch-inset-track-width: 52px !default;
|
|
|
16
16
|
$switch-label-margin-inline-start: 10px !default;
|
|
17
17
|
$switch-loader-color: rgb(var(--v-theme-surface)) !default;
|
|
18
18
|
|
|
19
|
-
$switch-thumb-background: rgb(var(--v-theme-surface)) !default;
|
|
20
|
-
$switch-thumb-color: rgb(var(--v-theme-on-surface)) !default;
|
|
19
|
+
$switch-thumb-background: rgb(var(--v-theme-surface-bright)) !default;
|
|
20
|
+
$switch-thumb-color: rgb(var(--v-theme-on-surface-bright)) !default;
|
|
21
21
|
$switch-thumb-elevation: 4 !default;
|
|
22
22
|
$switch-thumb-height: 20px !default;
|
|
23
23
|
$switch-thumb-width: 20px !default;
|
|
24
24
|
$switch-thumb-offset: 2px !default;
|
|
25
25
|
$switch-thumb-radius: 50% !default;
|
|
26
|
+
$switch-thumb-transition: .15s .05s transform settings.$decelerated-easing, .2s color settings.$standard-easing, .2s background-color settings.$standard-easing !default;
|
|
26
27
|
|
|
28
|
+
$switch-track-background: rgb(var(--v-theme-surface-variant)) !default;
|
|
27
29
|
$switch-track-radius: 9999px !default;
|
|
28
30
|
$switch-track-width: 36px !default;
|
|
29
31
|
$switch-track-height: 14px !default;
|
|
30
32
|
$switch-track-opacity: .6 !default;
|
|
31
|
-
$switch-track-transition: .2s color settings.$standard-easing !default;
|
|
33
|
+
$switch-track-transition: .2s background-color settings.$standard-easing !default;
|