vuetify 3.4.0 → 3.4.2
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 +1860 -1856
- package/dist/json/importMap.json +140 -140
- package/dist/json/tags.json +1 -0
- package/dist/json/web-types.json +3641 -3631
- package/dist/vuetify-labs.css +1393 -1386
- package/dist/vuetify-labs.d.ts +1936 -9147
- package/dist/vuetify-labs.esm.js +91 -79
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +91 -79
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +940 -933
- package/dist/vuetify.d.ts +2081 -9282
- package/dist/vuetify.esm.js +91 -79
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +91 -79
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +67 -66
- package/dist/vuetify.min.js.map +1 -1
- package/lib/blueprints/index.d.mts +0 -2
- package/lib/blueprints/md1.d.mts +0 -2
- package/lib/blueprints/md2.d.mts +0 -2
- package/lib/blueprints/md3.d.mts +0 -2
- package/lib/components/VAutocomplete/VAutocomplete.mjs +3 -3
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/index.d.mts +74 -98
- package/lib/components/VBottomNavigation/VBottomNavigation.mjs +1 -1
- package/lib/components/VBottomNavigation/VBottomNavigation.mjs.map +1 -1
- package/lib/components/VBottomNavigation/index.d.mts +44 -69
- package/lib/components/VBtn/VBtn.mjs +1 -1
- package/lib/components/VBtn/VBtn.mjs.map +1 -1
- package/lib/components/VBtn/index.d.mts +11 -11
- package/lib/components/VBtnToggle/VBtnToggle.mjs.map +1 -1
- package/lib/components/VBtnToggle/index.d.mts +45 -71
- package/lib/components/VCarousel/VCarousel.mjs +1 -1
- package/lib/components/VCarousel/VCarousel.mjs.map +1 -1
- package/lib/components/VCarousel/index.d.mts +73 -513
- package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
- package/lib/components/VCheckbox/VCheckboxBtn.mjs +1 -1
- package/lib/components/VCheckbox/VCheckboxBtn.mjs.map +1 -1
- package/lib/components/VCheckbox/index.d.mts +100 -482
- package/lib/components/VChip/index.d.mts +15 -18
- package/lib/components/VChipGroup/VChipGroup.mjs.map +1 -1
- package/lib/components/VChipGroup/index.d.mts +49 -189
- package/lib/components/VCombobox/VCombobox.mjs +3 -3
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/index.d.mts +74 -98
- package/lib/components/VDataIterator/index.d.mts +8 -6
- package/lib/components/VDataTable/VDataTable.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableRow.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableRows.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableServer.mjs.map +1 -1
- package/lib/components/VDataTable/VDataTableVirtual.mjs +2 -1
- package/lib/components/VDataTable/VDataTableVirtual.mjs.map +1 -1
- package/lib/components/VDataTable/composables/items.mjs.map +1 -1
- package/lib/components/VDataTable/composables/paginate.mjs.map +1 -1
- package/lib/components/VDataTable/composables/select.mjs.map +1 -1
- package/lib/components/VDataTable/index.d.mts +411 -4142
- package/lib/components/VDataTable/types.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePicker.css +4 -0
- package/lib/components/VDatePicker/VDatePicker.mjs +29 -22
- package/lib/components/VDatePicker/VDatePicker.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePicker.sass +4 -0
- package/lib/components/VDatePicker/VDatePickerMonth.mjs +3 -1
- package/lib/components/VDatePicker/VDatePickerMonth.mjs.map +1 -1
- package/lib/components/VDatePicker/VDatePickerYears.mjs +1 -1
- package/lib/components/VDatePicker/VDatePickerYears.mjs.map +1 -1
- package/lib/components/VDatePicker/index.d.mts +32 -36
- package/lib/components/VDialog/VDialog.css +4 -1
- package/lib/components/VDialog/VDialog.sass +4 -3
- package/lib/components/VField/VField.mjs +1 -1
- package/lib/components/VField/VField.mjs.map +1 -1
- package/lib/components/VField/index.d.mts +33 -41
- package/lib/components/VFileInput/index.d.mts +144 -385
- package/lib/components/VImg/VImg.mjs +10 -2
- package/lib/components/VImg/VImg.mjs.map +1 -1
- package/lib/components/VInput/VInput.mjs +1 -1
- package/lib/components/VInput/VInput.mjs.map +1 -1
- package/lib/components/VInput/index.d.mts +72 -154
- package/lib/components/VItemGroup/VItemGroup.mjs +1 -1
- package/lib/components/VItemGroup/VItemGroup.mjs.map +1 -1
- package/lib/components/VItemGroup/index.d.mts +49 -189
- package/lib/components/VList/VList.mjs +2 -2
- package/lib/components/VList/VList.mjs.map +1 -1
- package/lib/components/VList/index.d.mts +58 -95
- package/lib/components/VOtpInput/index.d.mts +8 -11
- package/lib/components/VRadio/index.d.mts +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.mjs +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
- package/lib/components/VRadioGroup/index.d.mts +77 -211
- package/lib/components/VRangeSlider/index.d.mts +22 -25
- package/lib/components/VSelect/VSelect.mjs +2 -2
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/index.d.mts +67 -91
- package/lib/components/VSelectionControl/VSelectionControl.mjs +2 -2
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
- package/lib/components/VSelectionControl/index.d.mts +9 -18
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs +1 -1
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs.map +1 -1
- package/lib/components/VSelectionControlGroup/index.d.mts +46 -68
- package/lib/components/VSlideGroup/VSlideGroup.mjs.map +1 -1
- package/lib/components/VSlideGroup/index.d.mts +47 -101
- package/lib/components/VSlider/index.d.mts +22 -25
- package/lib/components/VSwitch/VSwitch.mjs +7 -5
- package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
- package/lib/components/VSwitch/index.d.mts +90 -303
- package/lib/components/VTextField/index.d.mts +173 -451
- package/lib/components/VTextarea/index.d.mts +144 -385
- package/lib/components/VValidation/VValidation.mjs +2 -2
- package/lib/components/VValidation/VValidation.mjs.map +1 -1
- package/lib/components/VValidation/index.d.mts +88 -359
- package/lib/components/VWindow/VWindow.mjs +1 -1
- package/lib/components/VWindow/VWindow.mjs.map +1 -1
- package/lib/components/VWindow/index.d.mts +58 -245
- package/lib/components/index.d.mts +1933 -9130
- package/lib/composables/date/DateAdapter.mjs.map +1 -1
- package/lib/composables/date/adapters/vuetify.mjs +1 -13
- package/lib/composables/date/adapters/vuetify.mjs.map +1 -1
- package/lib/composables/date/date.mjs +1 -1
- package/lib/composables/date/date.mjs.map +1 -1
- package/lib/composables/form.mjs.map +1 -1
- package/lib/composables/group.mjs.map +1 -1
- package/lib/composables/nested/nested.mjs.map +1 -1
- package/lib/composables/proxiedModel.mjs.map +1 -1
- package/lib/composables/validation.mjs.map +1 -1
- package/lib/composables/virtual.mjs +11 -13
- package/lib/composables/virtual.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/index.d.mts +40 -44
- package/lib/labs/VConfirmEdit/index.d.mts +0 -10
- package/lib/labs/components.d.mts +0 -10
- package/lib/util/defineComponent.mjs.map +1 -1
- package/lib/util/helpers.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
-
import { ComponentPropsOptions, ExtractPropTypes, JSXComponent, PropType, ComponentInternalInstance, Ref, ComputedRef, InjectionKey, UnwrapRef } from 'vue';
|
|
2
|
+
import { ComponentPropsOptions, ExtractPropTypes, VNodeChild, VNode, JSXComponent, PropType, ComponentInternalInstance, Ref, ComputedRef, InjectionKey, UnwrapRef } from 'vue';
|
|
3
3
|
|
|
4
|
+
type SlotsToProps<U extends RawSlots, T = MakeInternalSlots<U>> = {
|
|
5
|
+
$children?: (VNodeChild | (T extends {
|
|
6
|
+
default: infer V;
|
|
7
|
+
} ? V : {}) | {
|
|
8
|
+
[K in keyof T]?: T[K];
|
|
9
|
+
});
|
|
10
|
+
'v-slots'?: {
|
|
11
|
+
[K in keyof T]?: T[K] | false;
|
|
12
|
+
};
|
|
13
|
+
} & {
|
|
14
|
+
[K in keyof T as `v-slot:${K & string}`]?: T[K] | false;
|
|
15
|
+
};
|
|
16
|
+
type RawSlots = Record<string, unknown>;
|
|
17
|
+
type Slot<T> = [T] extends [never] ? () => VNodeChild : (arg: T) => VNodeChild;
|
|
18
|
+
type VueSlot<T> = [T] extends [never] ? () => VNode[] : (arg: T) => VNode[];
|
|
19
|
+
type MakeInternalSlots<T extends RawSlots> = {
|
|
20
|
+
[K in keyof T]: Slot<T[K]>;
|
|
21
|
+
};
|
|
22
|
+
type MakeSlots<T extends RawSlots> = {
|
|
23
|
+
[K in keyof T]: VueSlot<T[K]>;
|
|
24
|
+
};
|
|
25
|
+
type GenericProps<Props, Slots extends Record<string, unknown>> = {
|
|
26
|
+
$props: Props & SlotsToProps<Slots>;
|
|
27
|
+
$slots: MakeSlots<Slots>;
|
|
28
|
+
};
|
|
4
29
|
interface FilterPropsOptions<PropsOptions extends Readonly<ComponentPropsOptions>, Props = ExtractPropTypes<PropsOptions>> {
|
|
5
30
|
filterProps<T extends Partial<Props>, U extends Exclude<keyof Props, Exclude<keyof Props, keyof T>>>(props: T): Partial<Pick<T, U>>;
|
|
6
31
|
}
|
|
@@ -51,6 +76,11 @@ interface SlideGroupSlot {
|
|
|
51
76
|
select: GroupProvide['select'];
|
|
52
77
|
isSelected: GroupProvide['isSelected'];
|
|
53
78
|
}
|
|
79
|
+
type VSlideGroupSlots = {
|
|
80
|
+
default: SlideGroupSlot;
|
|
81
|
+
prev: SlideGroupSlot;
|
|
82
|
+
next: SlideGroupSlot;
|
|
83
|
+
};
|
|
54
84
|
declare const VSlideGroup: {
|
|
55
85
|
new (...args: any[]): {
|
|
56
86
|
$: vue.ComponentInternalInstance;
|
|
@@ -62,7 +92,6 @@ declare const VSlideGroup: {
|
|
|
62
92
|
disabled: boolean;
|
|
63
93
|
multiple: boolean;
|
|
64
94
|
tag: string;
|
|
65
|
-
modelValue: any;
|
|
66
95
|
selectedClass: string;
|
|
67
96
|
nextIcon: IconValue;
|
|
68
97
|
prevIcon: IconValue;
|
|
@@ -81,23 +110,8 @@ declare const VSlideGroup: {
|
|
|
81
110
|
max?: number | undefined;
|
|
82
111
|
class?: any;
|
|
83
112
|
mandatory?: boolean | "force" | undefined;
|
|
84
|
-
modelValue?: any;
|
|
85
113
|
mobileBreakpoint?: number | DisplayBreakpoint | undefined;
|
|
86
114
|
showArrows?: string | boolean | undefined;
|
|
87
|
-
$children?: vue.VNodeChild | {
|
|
88
|
-
default?: ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
89
|
-
prev?: ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
90
|
-
next?: ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
91
|
-
} | ((arg: SlideGroupSlot) => vue.VNodeChild);
|
|
92
|
-
'v-slots'?: {
|
|
93
|
-
default?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
94
|
-
prev?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
95
|
-
next?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
96
|
-
} | undefined;
|
|
97
|
-
"v-slot:default"?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
98
|
-
"v-slot:prev"?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
99
|
-
"v-slot:next"?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
100
|
-
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
101
115
|
} & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & {
|
|
102
116
|
symbol: any;
|
|
103
117
|
direction: "horizontal" | "vertical";
|
|
@@ -113,27 +127,9 @@ declare const VSlideGroup: {
|
|
|
113
127
|
max?: number | undefined;
|
|
114
128
|
class?: any;
|
|
115
129
|
mandatory?: boolean | "force" | undefined;
|
|
116
|
-
modelValue?: any;
|
|
117
130
|
mobileBreakpoint?: number | DisplayBreakpoint | undefined;
|
|
118
131
|
showArrows?: string | boolean | undefined;
|
|
119
|
-
} & {
|
|
120
|
-
$children?: vue.VNodeChild | {
|
|
121
|
-
default?: ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
122
|
-
prev?: ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
123
|
-
next?: ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
124
|
-
} | ((arg: SlideGroupSlot) => vue.VNodeChild);
|
|
125
|
-
'v-slots'?: {
|
|
126
|
-
default?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
127
|
-
prev?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
128
|
-
next?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
129
|
-
} | undefined;
|
|
130
|
-
} & {
|
|
131
|
-
"v-slot:default"?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
132
|
-
"v-slot:prev"?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
133
|
-
"v-slot:next"?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
134
|
-
} & {
|
|
135
|
-
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
136
|
-
}, "symbol" | "direction" | "style" | "disabled" | "multiple" | "tag" | "modelValue" | "selectedClass" | "nextIcon" | "prevIcon" | "centerActive">;
|
|
132
|
+
} & {}, "symbol" | "direction" | "style" | "disabled" | "multiple" | "tag" | "selectedClass" | "nextIcon" | "prevIcon" | "centerActive">;
|
|
137
133
|
$attrs: {
|
|
138
134
|
[x: string]: unknown;
|
|
139
135
|
};
|
|
@@ -153,7 +149,7 @@ declare const VSlideGroup: {
|
|
|
153
149
|
}>;
|
|
154
150
|
$root: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
155
151
|
$parent: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
|
|
156
|
-
$emit: (event:
|
|
152
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
157
153
|
$el: any;
|
|
158
154
|
$options: vue.ComponentOptionsBase<{
|
|
159
155
|
symbol: any;
|
|
@@ -170,41 +166,22 @@ declare const VSlideGroup: {
|
|
|
170
166
|
max?: number | undefined;
|
|
171
167
|
class?: any;
|
|
172
168
|
mandatory?: boolean | "force" | undefined;
|
|
173
|
-
modelValue?: any;
|
|
174
169
|
mobileBreakpoint?: number | DisplayBreakpoint | undefined;
|
|
175
170
|
showArrows?: string | boolean | undefined;
|
|
176
|
-
} & {
|
|
177
|
-
$children?: vue.VNodeChild | {
|
|
178
|
-
default?: ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
179
|
-
prev?: ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
180
|
-
next?: ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
181
|
-
} | ((arg: SlideGroupSlot) => vue.VNodeChild);
|
|
182
|
-
'v-slots'?: {
|
|
183
|
-
default?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
184
|
-
prev?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
185
|
-
next?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
186
|
-
} | undefined;
|
|
187
|
-
} & {
|
|
188
|
-
"v-slot:default"?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
189
|
-
"v-slot:prev"?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
190
|
-
"v-slot:next"?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
191
|
-
} & {
|
|
192
|
-
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
193
|
-
}, {
|
|
171
|
+
} & {}, {
|
|
194
172
|
selected: vue.Ref<readonly number[]>;
|
|
195
173
|
scrollTo: (location: 'prev' | 'next') => void;
|
|
196
174
|
scrollOffset: vue.ShallowRef<number>;
|
|
197
175
|
focus: (location?: 'next' | 'prev' | 'first' | 'last') => void;
|
|
198
|
-
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
176
|
+
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
|
199
177
|
'update:modelValue': (value: any) => boolean;
|
|
200
|
-
}, string, {
|
|
178
|
+
}, "$children" | "v-slot:default" | "v-slots" | "modelValue" | "update:modelValue" | "v-slot:next" | "v-slot:prev">, string, {
|
|
201
179
|
symbol: any;
|
|
202
180
|
direction: "horizontal" | "vertical";
|
|
203
181
|
style: vue.StyleValue;
|
|
204
182
|
disabled: boolean;
|
|
205
183
|
multiple: boolean;
|
|
206
184
|
tag: string;
|
|
207
|
-
modelValue: any;
|
|
208
185
|
selectedClass: string;
|
|
209
186
|
nextIcon: IconValue;
|
|
210
187
|
prevIcon: IconValue;
|
|
@@ -254,27 +231,9 @@ declare const VSlideGroup: {
|
|
|
254
231
|
max?: number | undefined;
|
|
255
232
|
class?: any;
|
|
256
233
|
mandatory?: boolean | "force" | undefined;
|
|
257
|
-
modelValue?: any;
|
|
258
234
|
mobileBreakpoint?: number | DisplayBreakpoint | undefined;
|
|
259
235
|
showArrows?: string | boolean | undefined;
|
|
260
|
-
} & {
|
|
261
|
-
$children?: vue.VNodeChild | {
|
|
262
|
-
default?: ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
263
|
-
prev?: ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
264
|
-
next?: ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
265
|
-
} | ((arg: SlideGroupSlot) => vue.VNodeChild);
|
|
266
|
-
'v-slots'?: {
|
|
267
|
-
default?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
268
|
-
prev?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
269
|
-
next?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
270
|
-
} | undefined;
|
|
271
|
-
} & {
|
|
272
|
-
"v-slot:default"?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
273
|
-
"v-slot:prev"?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
274
|
-
"v-slot:next"?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
275
|
-
} & {
|
|
276
|
-
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
277
|
-
} & vue.ShallowUnwrapRef<{
|
|
236
|
+
} & {} & vue.ShallowUnwrapRef<{
|
|
278
237
|
selected: vue.Ref<readonly number[]>;
|
|
279
238
|
scrollTo: (location: 'prev' | 'next') => void;
|
|
280
239
|
scrollOffset: vue.ShallowRef<number>;
|
|
@@ -298,41 +257,22 @@ declare const VSlideGroup: {
|
|
|
298
257
|
max?: number | undefined;
|
|
299
258
|
class?: any;
|
|
300
259
|
mandatory?: boolean | "force" | undefined;
|
|
301
|
-
modelValue?: any;
|
|
302
260
|
mobileBreakpoint?: number | DisplayBreakpoint | undefined;
|
|
303
261
|
showArrows?: string | boolean | undefined;
|
|
304
|
-
} & {
|
|
305
|
-
$children?: vue.VNodeChild | {
|
|
306
|
-
default?: ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
307
|
-
prev?: ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
308
|
-
next?: ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
309
|
-
} | ((arg: SlideGroupSlot) => vue.VNodeChild);
|
|
310
|
-
'v-slots'?: {
|
|
311
|
-
default?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
312
|
-
prev?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
313
|
-
next?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
314
|
-
} | undefined;
|
|
315
|
-
} & {
|
|
316
|
-
"v-slot:default"?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
317
|
-
"v-slot:prev"?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
318
|
-
"v-slot:next"?: false | ((arg: SlideGroupSlot) => vue.VNodeChild) | undefined;
|
|
319
|
-
} & {
|
|
320
|
-
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
321
|
-
}, {
|
|
262
|
+
} & {}, {
|
|
322
263
|
selected: vue.Ref<readonly number[]>;
|
|
323
264
|
scrollTo: (location: 'prev' | 'next') => void;
|
|
324
265
|
scrollOffset: vue.ShallowRef<number>;
|
|
325
266
|
focus: (location?: 'next' | 'prev' | 'first' | 'last') => void;
|
|
326
|
-
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
267
|
+
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
|
327
268
|
'update:modelValue': (value: any) => boolean;
|
|
328
|
-
}, string, {
|
|
269
|
+
}, "$children" | "v-slot:default" | "v-slots" | "modelValue" | "update:modelValue" | "v-slot:next" | "v-slot:prev">, string, {
|
|
329
270
|
symbol: any;
|
|
330
271
|
direction: "horizontal" | "vertical";
|
|
331
272
|
style: vue.StyleValue;
|
|
332
273
|
disabled: boolean;
|
|
333
274
|
multiple: boolean;
|
|
334
275
|
tag: string;
|
|
335
|
-
modelValue: any;
|
|
336
276
|
selectedClass: string;
|
|
337
277
|
nextIcon: IconValue;
|
|
338
278
|
prevIcon: IconValue;
|
|
@@ -347,7 +287,13 @@ declare const VSlideGroup: {
|
|
|
347
287
|
next: (arg: SlideGroupSlot) => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
348
288
|
[key: string]: any;
|
|
349
289
|
}>[];
|
|
350
|
-
}>>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps &
|
|
290
|
+
}>>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new <T_1>(props: {
|
|
291
|
+
modelValue?: T_1 | undefined;
|
|
292
|
+
'onUpdate:modelValue'?: ((value: T_1) => void) | undefined;
|
|
293
|
+
}, slots: VSlideGroupSlots) => GenericProps<{
|
|
294
|
+
modelValue?: T_1 | undefined;
|
|
295
|
+
'onUpdate:modelValue'?: ((value: T_1) => void) | undefined;
|
|
296
|
+
}, VSlideGroupSlots>) & FilterPropsOptions<{
|
|
351
297
|
modelValue: {
|
|
352
298
|
type: null;
|
|
353
299
|
default: undefined;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
-
import { ComponentPropsOptions, ExtractPropTypes,
|
|
2
|
+
import { ComponentPropsOptions, ExtractPropTypes, JSXComponent, PropType, 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): Partial<Pick<T, U>>;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
type EventProp<T extends any[] = any[], F = (...args: T) => any> = F | F[];
|
|
9
|
-
declare const EventProp: <T extends any[] = any[]>() => PropType<EventProp<T, (...args: T) => any>>;
|
|
10
|
-
|
|
11
8
|
type Tick = {
|
|
12
9
|
value: number;
|
|
13
10
|
position: number;
|
|
@@ -106,9 +103,9 @@ declare const VSlider: {
|
|
|
106
103
|
rounded?: string | number | boolean | undefined;
|
|
107
104
|
prependIcon?: IconValue | undefined;
|
|
108
105
|
appendIcon?: IconValue | undefined;
|
|
109
|
-
'onClick:append'?:
|
|
110
|
-
'onClick:prepend'?:
|
|
111
|
-
'onUpdate:focused'?: (
|
|
106
|
+
'onClick:append'?: ((args_0: MouseEvent) => void) | undefined;
|
|
107
|
+
'onClick:prepend'?: ((args_0: MouseEvent) => void) | undefined;
|
|
108
|
+
'onUpdate:focused'?: (((args_0: boolean) => void) & ((value: boolean) => any)) | undefined;
|
|
112
109
|
validateOn?: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
113
110
|
validationValue?: any;
|
|
114
111
|
hint?: string | undefined;
|
|
@@ -199,9 +196,9 @@ declare const VSlider: {
|
|
|
199
196
|
rounded?: string | number | boolean | undefined;
|
|
200
197
|
prependIcon?: IconValue | undefined;
|
|
201
198
|
appendIcon?: IconValue | undefined;
|
|
202
|
-
'onClick:append'?:
|
|
203
|
-
'onClick:prepend'?:
|
|
204
|
-
'onUpdate:focused'?:
|
|
199
|
+
'onClick:append'?: ((args_0: MouseEvent) => void) | undefined;
|
|
200
|
+
'onClick:prepend'?: ((args_0: MouseEvent) => void) | undefined;
|
|
201
|
+
'onUpdate:focused'?: ((args_0: boolean) => void) | undefined;
|
|
205
202
|
validateOn?: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
206
203
|
validationValue?: any;
|
|
207
204
|
hint?: string | undefined;
|
|
@@ -338,9 +335,9 @@ declare const VSlider: {
|
|
|
338
335
|
rounded?: string | number | boolean | undefined;
|
|
339
336
|
prependIcon?: IconValue | undefined;
|
|
340
337
|
appendIcon?: IconValue | undefined;
|
|
341
|
-
'onClick:append'?:
|
|
342
|
-
'onClick:prepend'?:
|
|
343
|
-
'onUpdate:focused'?:
|
|
338
|
+
'onClick:append'?: ((args_0: MouseEvent) => void) | undefined;
|
|
339
|
+
'onClick:prepend'?: ((args_0: MouseEvent) => void) | undefined;
|
|
340
|
+
'onUpdate:focused'?: ((args_0: boolean) => void) | undefined;
|
|
344
341
|
validateOn?: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
345
342
|
validationValue?: any;
|
|
346
343
|
hint?: string | undefined;
|
|
@@ -518,9 +515,9 @@ declare const VSlider: {
|
|
|
518
515
|
rounded?: string | number | boolean | undefined;
|
|
519
516
|
prependIcon?: IconValue | undefined;
|
|
520
517
|
appendIcon?: IconValue | undefined;
|
|
521
|
-
'onClick:append'?:
|
|
522
|
-
'onClick:prepend'?:
|
|
523
|
-
'onUpdate:focused'?:
|
|
518
|
+
'onClick:append'?: ((args_0: MouseEvent) => void) | undefined;
|
|
519
|
+
'onClick:prepend'?: ((args_0: MouseEvent) => void) | undefined;
|
|
520
|
+
'onUpdate:focused'?: ((args_0: boolean) => void) | undefined;
|
|
524
521
|
validateOn?: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
525
522
|
validationValue?: any;
|
|
526
523
|
hint?: string | undefined;
|
|
@@ -619,9 +616,9 @@ declare const VSlider: {
|
|
|
619
616
|
rounded?: string | number | boolean | undefined;
|
|
620
617
|
prependIcon?: IconValue | undefined;
|
|
621
618
|
appendIcon?: IconValue | undefined;
|
|
622
|
-
'onClick:append'?:
|
|
623
|
-
'onClick:prepend'?:
|
|
624
|
-
'onUpdate:focused'?:
|
|
619
|
+
'onClick:append'?: ((args_0: MouseEvent) => void) | undefined;
|
|
620
|
+
'onClick:prepend'?: ((args_0: MouseEvent) => void) | undefined;
|
|
621
|
+
'onUpdate:focused'?: ((args_0: boolean) => void) | undefined;
|
|
625
622
|
validateOn?: "lazy" | ("input" | "blur" | "submit") | "input lazy" | "blur lazy" | "submit lazy" | "lazy input" | "lazy blur" | "lazy submit" | undefined;
|
|
626
623
|
validationValue?: any;
|
|
627
624
|
hint?: string | undefined;
|
|
@@ -750,7 +747,7 @@ declare const VSlider: {
|
|
|
750
747
|
default: number;
|
|
751
748
|
};
|
|
752
749
|
focused: BooleanConstructor;
|
|
753
|
-
'onUpdate:focused': vue.PropType<
|
|
750
|
+
'onUpdate:focused': vue.PropType<(args_0: boolean) => void>;
|
|
754
751
|
disabled: {
|
|
755
752
|
type: vue.PropType<boolean | null>;
|
|
756
753
|
default: null;
|
|
@@ -806,8 +803,8 @@ declare const VSlider: {
|
|
|
806
803
|
default: string;
|
|
807
804
|
validator: (v: any) => boolean;
|
|
808
805
|
};
|
|
809
|
-
'onClick:prepend': vue.PropType<
|
|
810
|
-
'onClick:append': vue.PropType<
|
|
806
|
+
'onClick:prepend': vue.PropType<(args_0: MouseEvent) => void>;
|
|
807
|
+
'onClick:append': vue.PropType<(args_0: MouseEvent) => void>;
|
|
811
808
|
ripple: {
|
|
812
809
|
type: BooleanConstructor;
|
|
813
810
|
default: boolean;
|
|
@@ -871,7 +868,7 @@ declare const VSlider: {
|
|
|
871
868
|
default: number;
|
|
872
869
|
};
|
|
873
870
|
focused: BooleanConstructor;
|
|
874
|
-
'onUpdate:focused': vue.PropType<
|
|
871
|
+
'onUpdate:focused': vue.PropType<(args_0: boolean) => void>;
|
|
875
872
|
disabled: {
|
|
876
873
|
type: vue.PropType<boolean | null>;
|
|
877
874
|
default: null;
|
|
@@ -927,8 +924,8 @@ declare const VSlider: {
|
|
|
927
924
|
default: string;
|
|
928
925
|
validator: (v: any) => boolean;
|
|
929
926
|
};
|
|
930
|
-
'onClick:prepend': vue.PropType<
|
|
931
|
-
'onClick:append': vue.PropType<
|
|
927
|
+
'onClick:prepend': vue.PropType<(args_0: MouseEvent) => void>;
|
|
928
|
+
'onClick:append': vue.PropType<(args_0: MouseEvent) => void>;
|
|
932
929
|
ripple: {
|
|
933
930
|
type: BooleanConstructor;
|
|
934
931
|
default: boolean;
|
|
@@ -30,8 +30,8 @@ export const VSwitch = genericComponent()({
|
|
|
30
30
|
props: makeVSwitchProps(),
|
|
31
31
|
emits: {
|
|
32
32
|
'update:focused': focused => true,
|
|
33
|
-
'update:modelValue':
|
|
34
|
-
'update:indeterminate':
|
|
33
|
+
'update:modelValue': value => true,
|
|
34
|
+
'update:indeterminate': value => true
|
|
35
35
|
},
|
|
36
36
|
setup(props, _ref) {
|
|
37
37
|
let {
|
|
@@ -73,11 +73,13 @@ export const VSwitch = genericComponent()({
|
|
|
73
73
|
'v-switch--inset': props.inset
|
|
74
74
|
}, {
|
|
75
75
|
'v-switch--indeterminate': indeterminate.value
|
|
76
|
-
}, loaderClasses.value, props.class]
|
|
77
|
-
"style": props.style
|
|
76
|
+
}, loaderClasses.value, props.class]
|
|
78
77
|
}, rootAttrs, inputProps, {
|
|
78
|
+
"modelValue": model.value,
|
|
79
|
+
"onUpdate:modelValue": $event => model.value = $event,
|
|
79
80
|
"id": id.value,
|
|
80
|
-
"focused": isFocused.value
|
|
81
|
+
"focused": isFocused.value,
|
|
82
|
+
"style": props.style
|
|
81
83
|
}), {
|
|
82
84
|
...slots,
|
|
83
85
|
default: _ref2 => {
|
|
@@ -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","control","loaderColor","color","uid","id","onChange","value","onTrackClick","e","stopPropagation","preventDefault","input","click","rootAttrs","controlAttrs","inputProps","filterProps","controlProps","_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 = VInput.filterProps(props)\n const controlProps = 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,EAAEC,MAAM,EAAEC,YAAY,EAAEC,SAAS,gCAE5E;AAUA,OAAO,MAAMC,gBAAgB,GAAGF,YAAY,CAAC;EAC3CG,aAAa,EAAEC,OAAO;EACtBC,KAAK,EAAED,OAAO;EACdE,IAAI,EAAEF,OAAO;EACbG,OAAO,EAAE;IACPC,IAAI,EAAE,CAACJ,OAAO,EAAEK,MAAM,CAAC;IACvBC,OAAO,EAAE;EACX,CAAC;EAED,GAAGxB,eAAe,EAAE;EACpB,GAAGG,0BAA0B;AAC/B,CAAC,EAAE,SAAS,CAAC;AAEb,OAAO,MAAMsB,OAAO,GAAGb,gBAAgB,EAAgB,CAAC;EACtDc,IAAI,EAAE,SAAS;EAEfC,YAAY,EAAE,KAAK;EAEnBC,KAAK,EAAEZ,gBAAgB,EAAE;EAEzBa,KAAK,EAAE;IACL,gBAAgB,EAAGC,OAAgB,IAAK,IAAI;IAC5C,mBAAmB,EAAEC,CAAA,KAAM,IAAI;IAC/B,sBAAsB,EAAGC,GAAY,IAAK;EAC5C,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|
|
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","value","setup","_ref","attrs","slots","model","loaderClasses","isFocused","focus","blur","control","loaderColor","color","uid","id","onChange","onTrackClick","e","stopPropagation","preventDefault","input","click","rootAttrs","controlAttrs","inputProps","filterProps","controlProps","_createVNode","_mergeProps","class","$event","style","_ref2","messagesId","isDisabled","isReadonly","isValid","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'\nimport type { GenericProps } from '@/util'\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<new <T>(\n props: {\n modelValue?: T | null\n 'onUpdate:modelValue'?: (value: T | null) => void\n },\n slots: VSwitchSlots,\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VSwitch',\n\n inheritAttrs: false,\n\n props: makeVSwitchProps(),\n\n emits: {\n 'update:focused': (focused: boolean) => true,\n 'update:modelValue': (value: any) => true,\n 'update:indeterminate': (value: 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 = VInput.filterProps(props)\n const controlProps = 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 { ...rootAttrs }\n { ...inputProps }\n v-model={ model.value }\n id={ id.value }\n focused={ isFocused.value }\n style={ props.style }\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,EAAEC,MAAM,EAAEC,YAAY,EAAEC,SAAS,gCAE5E;AAWA,OAAO,MAAMC,gBAAgB,GAAGF,YAAY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