vuetify 3.0.1 → 3.0.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 +1 -1
- package/dist/json/importMap.json +64 -60
- package/dist/json/web-types.json +3 -3
- package/dist/vuetify.css +303 -304
- package/dist/vuetify.d.ts +31 -30
- package/dist/vuetify.esm.js +47 -40
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +46 -39
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +330 -327
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VCard/VCard.css +0 -3
- package/lib/components/VCard/VCard.mjs +2 -1
- package/lib/components/VCard/VCard.mjs.map +1 -1
- package/lib/components/VCard/VCard.sass +0 -3
- package/lib/components/VCard/VCardItem.mjs +1 -2
- package/lib/components/VCard/VCardItem.mjs.map +1 -1
- package/lib/components/VDefaultsProvider/VDefaultsProvider.mjs +1 -1
- package/lib/components/VDefaultsProvider/VDefaultsProvider.mjs.map +1 -1
- package/lib/components/VOverlay/scrollStrategies.mjs +4 -0
- package/lib/components/VOverlay/scrollStrategies.mjs.map +1 -1
- package/lib/components/VOverlay/useActivator.mjs +4 -0
- package/lib/components/VOverlay/useActivator.mjs.map +1 -1
- package/lib/components/VProgressLinear/VProgressLinear.mjs +1 -0
- package/lib/components/VProgressLinear/VProgressLinear.mjs.map +1 -1
- package/lib/components/VRating/VRating.mjs +7 -6
- package/lib/components/VRating/VRating.mjs.map +1 -1
- package/lib/components/VRating/index.d.ts +14 -14
- package/lib/components/VSlideGroup/VSlideGroup.css +1 -0
- package/lib/components/VSlideGroup/VSlideGroup.sass +1 -0
- package/lib/components/VToolbar/VToolbar.css +1 -0
- package/lib/components/VToolbar/VToolbar.sass +1 -0
- package/lib/components/index.d.ts +14 -14
- package/lib/components/transitions/index.mjs +1 -1
- package/lib/components/transitions/index.mjs.map +1 -1
- package/lib/composables/nested/nested.mjs +2 -2
- package/lib/composables/nested/nested.mjs.map +1 -1
- package/lib/composables/toggleScope.mjs +6 -2
- package/lib/composables/toggleScope.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/index.d.ts +17 -16
- package/lib/util/defineComponent.mjs +8 -13
- package/lib/util/defineComponent.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -46,7 +46,7 @@ declare const VRating: {
|
|
|
46
46
|
readonly: boolean;
|
|
47
47
|
tag: string;
|
|
48
48
|
density: Density;
|
|
49
|
-
modelValue: number;
|
|
49
|
+
modelValue: string | number;
|
|
50
50
|
ripple: boolean;
|
|
51
51
|
clearable: boolean;
|
|
52
52
|
hover: boolean;
|
|
@@ -95,7 +95,7 @@ declare const VRating: {
|
|
|
95
95
|
};
|
|
96
96
|
readonly: BooleanConstructor;
|
|
97
97
|
modelValue: {
|
|
98
|
-
type: NumberConstructor;
|
|
98
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
99
99
|
default: number;
|
|
100
100
|
};
|
|
101
101
|
itemLabels: Prop<string[], string[]>;
|
|
@@ -106,7 +106,7 @@ declare const VRating: {
|
|
|
106
106
|
};
|
|
107
107
|
ripple: BooleanConstructor;
|
|
108
108
|
}, "$children" | "v-slots" | "v-slot:item" | "v-slot:item-label">>> & {
|
|
109
|
-
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
109
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
110
110
|
} & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, "length" | "disabled" | "size" | "readonly" | "tag" | "density" | "modelValue" | "ripple" | "clearable" | "hover" | "halfIncrements" | "itemAriaLabel" | "emptyIcon" | "fullIcon" | "itemLabelPosition">;
|
|
111
111
|
$attrs: {
|
|
112
112
|
[x: string]: unknown;
|
|
@@ -119,7 +119,7 @@ declare const VRating: {
|
|
|
119
119
|
}>;
|
|
120
120
|
$root: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
121
121
|
$parent: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
122
|
-
$emit: (event: "update:modelValue", value: number) => void;
|
|
122
|
+
$emit: (event: "update:modelValue", value: string | number) => void;
|
|
123
123
|
$el: any;
|
|
124
124
|
$options: vue.ComponentOptionsBase<Readonly<vue.ExtractPropTypes<Omit<{
|
|
125
125
|
theme: StringConstructor;
|
|
@@ -161,7 +161,7 @@ declare const VRating: {
|
|
|
161
161
|
};
|
|
162
162
|
readonly: BooleanConstructor;
|
|
163
163
|
modelValue: {
|
|
164
|
-
type: NumberConstructor;
|
|
164
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
165
165
|
default: number;
|
|
166
166
|
};
|
|
167
167
|
itemLabels: Prop<string[], string[]>;
|
|
@@ -172,9 +172,9 @@ declare const VRating: {
|
|
|
172
172
|
};
|
|
173
173
|
ripple: BooleanConstructor;
|
|
174
174
|
}, "$children" | "v-slots" | "v-slot:item" | "v-slot:item-label">>> & {
|
|
175
|
-
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
175
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
176
176
|
}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
|
177
|
-
'update:modelValue': (value: number) => boolean;
|
|
177
|
+
'update:modelValue': (value: number | string) => boolean;
|
|
178
178
|
}, "$children" | "v-slots" | "v-slot:item" | "v-slot:item-label">, string, {
|
|
179
179
|
length: string | number;
|
|
180
180
|
disabled: boolean;
|
|
@@ -182,7 +182,7 @@ declare const VRating: {
|
|
|
182
182
|
readonly: boolean;
|
|
183
183
|
tag: string;
|
|
184
184
|
density: Density;
|
|
185
|
-
modelValue: number;
|
|
185
|
+
modelValue: string | number;
|
|
186
186
|
ripple: boolean;
|
|
187
187
|
clearable: boolean;
|
|
188
188
|
hover: boolean;
|
|
@@ -251,7 +251,7 @@ declare const VRating: {
|
|
|
251
251
|
};
|
|
252
252
|
readonly: BooleanConstructor;
|
|
253
253
|
modelValue: {
|
|
254
|
-
type: NumberConstructor;
|
|
254
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
255
255
|
default: number;
|
|
256
256
|
};
|
|
257
257
|
itemLabels: Prop<string[], string[]>;
|
|
@@ -262,7 +262,7 @@ declare const VRating: {
|
|
|
262
262
|
};
|
|
263
263
|
ripple: BooleanConstructor;
|
|
264
264
|
}, "$children" | "v-slots" | "v-slot:item" | "v-slot:item-label">>> & {
|
|
265
|
-
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
265
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
266
266
|
} & vue.ShallowUnwrapRef<{}> & {} & vue.ComponentCustomProperties;
|
|
267
267
|
__isFragment?: undefined;
|
|
268
268
|
__isTeleport?: undefined;
|
|
@@ -307,7 +307,7 @@ declare const VRating: {
|
|
|
307
307
|
};
|
|
308
308
|
readonly: BooleanConstructor;
|
|
309
309
|
modelValue: {
|
|
310
|
-
type: NumberConstructor;
|
|
310
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
311
311
|
default: number;
|
|
312
312
|
};
|
|
313
313
|
itemLabels: Prop<string[], string[]>;
|
|
@@ -318,9 +318,9 @@ declare const VRating: {
|
|
|
318
318
|
};
|
|
319
319
|
ripple: BooleanConstructor;
|
|
320
320
|
}, "$children" | "v-slots" | "v-slot:item" | "v-slot:item-label">>> & {
|
|
321
|
-
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
321
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
322
322
|
}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
|
323
|
-
'update:modelValue': (value: number) => boolean;
|
|
323
|
+
'update:modelValue': (value: number | string) => boolean;
|
|
324
324
|
}, "$children" | "v-slots" | "v-slot:item" | "v-slot:item-label">, string, {
|
|
325
325
|
length: string | number;
|
|
326
326
|
disabled: boolean;
|
|
@@ -328,7 +328,7 @@ declare const VRating: {
|
|
|
328
328
|
readonly: boolean;
|
|
329
329
|
tag: string;
|
|
330
330
|
density: Density;
|
|
331
|
-
modelValue: number;
|
|
331
|
+
modelValue: string | number;
|
|
332
332
|
ripple: boolean;
|
|
333
333
|
clearable: boolean;
|
|
334
334
|
hover: boolean;
|
|
@@ -15026,7 +15026,7 @@ declare const VRating: {
|
|
|
15026
15026
|
readonly: boolean;
|
|
15027
15027
|
tag: string;
|
|
15028
15028
|
density: Density;
|
|
15029
|
-
modelValue: number;
|
|
15029
|
+
modelValue: string | number;
|
|
15030
15030
|
ripple: boolean;
|
|
15031
15031
|
clearable: boolean;
|
|
15032
15032
|
hover: boolean;
|
|
@@ -15075,7 +15075,7 @@ declare const VRating: {
|
|
|
15075
15075
|
};
|
|
15076
15076
|
readonly: BooleanConstructor;
|
|
15077
15077
|
modelValue: {
|
|
15078
|
-
type: NumberConstructor;
|
|
15078
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
15079
15079
|
default: number;
|
|
15080
15080
|
};
|
|
15081
15081
|
itemLabels: Prop<string[], string[]>;
|
|
@@ -15086,7 +15086,7 @@ declare const VRating: {
|
|
|
15086
15086
|
};
|
|
15087
15087
|
ripple: BooleanConstructor;
|
|
15088
15088
|
}, "$children" | "v-slots" | "v-slot:item" | "v-slot:item-label">>> & {
|
|
15089
|
-
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
15089
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
15090
15090
|
} & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, "length" | "disabled" | "size" | "readonly" | "tag" | "density" | "modelValue" | "ripple" | "clearable" | "hover" | "halfIncrements" | "itemAriaLabel" | "emptyIcon" | "fullIcon" | "itemLabelPosition">;
|
|
15091
15091
|
$attrs: {
|
|
15092
15092
|
[x: string]: unknown;
|
|
@@ -15099,7 +15099,7 @@ declare const VRating: {
|
|
|
15099
15099
|
}>;
|
|
15100
15100
|
$root: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
15101
15101
|
$parent: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
15102
|
-
$emit: (event: "update:modelValue", value: number) => void;
|
|
15102
|
+
$emit: (event: "update:modelValue", value: string | number) => void;
|
|
15103
15103
|
$el: any;
|
|
15104
15104
|
$options: vue.ComponentOptionsBase<Readonly<vue.ExtractPropTypes<Omit<{
|
|
15105
15105
|
theme: StringConstructor;
|
|
@@ -15141,7 +15141,7 @@ declare const VRating: {
|
|
|
15141
15141
|
};
|
|
15142
15142
|
readonly: BooleanConstructor;
|
|
15143
15143
|
modelValue: {
|
|
15144
|
-
type: NumberConstructor;
|
|
15144
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
15145
15145
|
default: number;
|
|
15146
15146
|
};
|
|
15147
15147
|
itemLabels: Prop<string[], string[]>;
|
|
@@ -15152,9 +15152,9 @@ declare const VRating: {
|
|
|
15152
15152
|
};
|
|
15153
15153
|
ripple: BooleanConstructor;
|
|
15154
15154
|
}, "$children" | "v-slots" | "v-slot:item" | "v-slot:item-label">>> & {
|
|
15155
|
-
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
15155
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
15156
15156
|
}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
|
15157
|
-
'update:modelValue': (value: number) => boolean;
|
|
15157
|
+
'update:modelValue': (value: number | string) => boolean;
|
|
15158
15158
|
}, "$children" | "v-slots" | "v-slot:item" | "v-slot:item-label">, string, {
|
|
15159
15159
|
length: string | number;
|
|
15160
15160
|
disabled: boolean;
|
|
@@ -15162,7 +15162,7 @@ declare const VRating: {
|
|
|
15162
15162
|
readonly: boolean;
|
|
15163
15163
|
tag: string;
|
|
15164
15164
|
density: Density;
|
|
15165
|
-
modelValue: number;
|
|
15165
|
+
modelValue: string | number;
|
|
15166
15166
|
ripple: boolean;
|
|
15167
15167
|
clearable: boolean;
|
|
15168
15168
|
hover: boolean;
|
|
@@ -15231,7 +15231,7 @@ declare const VRating: {
|
|
|
15231
15231
|
};
|
|
15232
15232
|
readonly: BooleanConstructor;
|
|
15233
15233
|
modelValue: {
|
|
15234
|
-
type: NumberConstructor;
|
|
15234
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
15235
15235
|
default: number;
|
|
15236
15236
|
};
|
|
15237
15237
|
itemLabels: Prop<string[], string[]>;
|
|
@@ -15242,7 +15242,7 @@ declare const VRating: {
|
|
|
15242
15242
|
};
|
|
15243
15243
|
ripple: BooleanConstructor;
|
|
15244
15244
|
}, "$children" | "v-slots" | "v-slot:item" | "v-slot:item-label">>> & {
|
|
15245
|
-
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
15245
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
15246
15246
|
} & vue.ShallowUnwrapRef<{}> & {} & vue.ComponentCustomProperties;
|
|
15247
15247
|
__isFragment?: undefined;
|
|
15248
15248
|
__isTeleport?: undefined;
|
|
@@ -15287,7 +15287,7 @@ declare const VRating: {
|
|
|
15287
15287
|
};
|
|
15288
15288
|
readonly: BooleanConstructor;
|
|
15289
15289
|
modelValue: {
|
|
15290
|
-
type: NumberConstructor;
|
|
15290
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
15291
15291
|
default: number;
|
|
15292
15292
|
};
|
|
15293
15293
|
itemLabels: Prop<string[], string[]>;
|
|
@@ -15298,9 +15298,9 @@ declare const VRating: {
|
|
|
15298
15298
|
};
|
|
15299
15299
|
ripple: BooleanConstructor;
|
|
15300
15300
|
}, "$children" | "v-slots" | "v-slot:item" | "v-slot:item-label">>> & {
|
|
15301
|
-
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
15301
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
15302
15302
|
}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
|
15303
|
-
'update:modelValue': (value: number) => boolean;
|
|
15303
|
+
'update:modelValue': (value: number | string) => boolean;
|
|
15304
15304
|
}, "$children" | "v-slots" | "v-slot:item" | "v-slot:item-label">, string, {
|
|
15305
15305
|
length: string | number;
|
|
15306
15306
|
disabled: boolean;
|
|
@@ -15308,7 +15308,7 @@ declare const VRating: {
|
|
|
15308
15308
|
readonly: boolean;
|
|
15309
15309
|
tag: string;
|
|
15310
15310
|
density: Density;
|
|
15311
|
-
modelValue: number;
|
|
15311
|
+
modelValue: string | number;
|
|
15312
15312
|
ripple: boolean;
|
|
15313
15313
|
clearable: boolean;
|
|
15314
15314
|
hover: boolean;
|
|
@@ -19,5 +19,5 @@ export const VSlideYReverseTransition = createCssTransition('slide-y-reverse-tra
|
|
|
19
19
|
// Javascript transitions
|
|
20
20
|
export const VExpandTransition = createJavascriptTransition('expand-transition', ExpandTransitionGenerator());
|
|
21
21
|
export const VExpandXTransition = createJavascriptTransition('expand-x-transition', ExpandTransitionGenerator('', true));
|
|
22
|
-
export
|
|
22
|
+
export { VDialogTransition } from "./dialog-transition.mjs";
|
|
23
23
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["createCssTransition","createJavascriptTransition","ExpandTransitionGenerator","VFabTransition","VDialogBottomTransition","VDialogTopTransition","VFadeTransition","VScaleTransition","VScrollXTransition","VScrollXReverseTransition","VScrollYTransition","VScrollYReverseTransition","VSlideXTransition","VSlideXReverseTransition","VSlideYTransition","VSlideYReverseTransition","VExpandTransition","VExpandXTransition"],"sources":["../../../src/components/transitions/index.ts"],"sourcesContent":["import {\n createCssTransition,\n createJavascriptTransition,\n} from './createTransition'\n\nimport ExpandTransitionGenerator from './expand-transition'\n\n// Component specific transitions\nexport const VFabTransition = createCssTransition('fab-transition', 'center center', 'out-in')\n\n// Generic transitions\nexport const VDialogBottomTransition = createCssTransition('dialog-bottom-transition')\nexport const VDialogTopTransition = createCssTransition('dialog-top-transition')\nexport const VFadeTransition = createCssTransition('fade-transition')\nexport const VScaleTransition = createCssTransition('scale-transition')\nexport const VScrollXTransition = createCssTransition('scroll-x-transition')\nexport const VScrollXReverseTransition = createCssTransition('scroll-x-reverse-transition')\nexport const VScrollYTransition = createCssTransition('scroll-y-transition')\nexport const VScrollYReverseTransition = createCssTransition('scroll-y-reverse-transition')\nexport const VSlideXTransition = createCssTransition('slide-x-transition')\nexport const VSlideXReverseTransition = createCssTransition('slide-x-reverse-transition')\nexport const VSlideYTransition = createCssTransition('slide-y-transition')\nexport const VSlideYReverseTransition = createCssTransition('slide-y-reverse-transition')\n\n// Javascript transitions\nexport const VExpandTransition = createJavascriptTransition('expand-transition', ExpandTransitionGenerator())\nexport const VExpandXTransition = createJavascriptTransition('expand-x-transition', ExpandTransitionGenerator('', true))\n\nexport
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["createCssTransition","createJavascriptTransition","ExpandTransitionGenerator","VFabTransition","VDialogBottomTransition","VDialogTopTransition","VFadeTransition","VScaleTransition","VScrollXTransition","VScrollXReverseTransition","VScrollYTransition","VScrollYReverseTransition","VSlideXTransition","VSlideXReverseTransition","VSlideYTransition","VSlideYReverseTransition","VExpandTransition","VExpandXTransition","VDialogTransition"],"sources":["../../../src/components/transitions/index.ts"],"sourcesContent":["import {\n createCssTransition,\n createJavascriptTransition,\n} from './createTransition'\n\nimport ExpandTransitionGenerator from './expand-transition'\n\n// Component specific transitions\nexport const VFabTransition = createCssTransition('fab-transition', 'center center', 'out-in')\n\n// Generic transitions\nexport const VDialogBottomTransition = createCssTransition('dialog-bottom-transition')\nexport const VDialogTopTransition = createCssTransition('dialog-top-transition')\nexport const VFadeTransition = createCssTransition('fade-transition')\nexport const VScaleTransition = createCssTransition('scale-transition')\nexport const VScrollXTransition = createCssTransition('scroll-x-transition')\nexport const VScrollXReverseTransition = createCssTransition('scroll-x-reverse-transition')\nexport const VScrollYTransition = createCssTransition('scroll-y-transition')\nexport const VScrollYReverseTransition = createCssTransition('scroll-y-reverse-transition')\nexport const VSlideXTransition = createCssTransition('slide-x-transition')\nexport const VSlideXReverseTransition = createCssTransition('slide-x-reverse-transition')\nexport const VSlideYTransition = createCssTransition('slide-y-transition')\nexport const VSlideYReverseTransition = createCssTransition('slide-y-reverse-transition')\n\n// Javascript transitions\nexport const VExpandTransition = createJavascriptTransition('expand-transition', ExpandTransitionGenerator())\nexport const VExpandXTransition = createJavascriptTransition('expand-x-transition', ExpandTransitionGenerator('', true))\n\nexport { VDialogTransition } from './dialog-transition'\n\nexport type VFabTransition = InstanceType<typeof VFabTransition>\nexport type VDialogBottomTransition = InstanceType<typeof VDialogBottomTransition>\nexport type VDialogTopTransition = InstanceType<typeof VDialogTopTransition>\nexport type VFadeTransition = InstanceType<typeof VFadeTransition>\nexport type VScaleTransition = InstanceType<typeof VScaleTransition>\nexport type VScrollXTransition = InstanceType<typeof VScrollXTransition>\nexport type VScrollXReverseTransition = InstanceType<typeof VScrollXReverseTransition>\nexport type VScrollYTransition = InstanceType<typeof VScrollYTransition>\nexport type VScrollYReverseTransition = InstanceType<typeof VScrollYReverseTransition>\nexport type VSlideXTransition = InstanceType<typeof VSlideXTransition>\nexport type VSlideXReverseTransition = InstanceType<typeof VSlideXReverseTransition>\nexport type VSlideYTransition = InstanceType<typeof VSlideYTransition>\nexport type VSlideYReverseTransition = InstanceType<typeof VSlideYReverseTransition>\nexport type VExpandTransition = InstanceType<typeof VExpandTransition>\nexport type VExpandXTransition = InstanceType<typeof VExpandXTransition>\n"],"mappings":"SAC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ps = propsFactory({
|
|
23
23
|
selectStrategy: [String, Function],
|
|
24
|
-
openStrategy: [String,
|
|
24
|
+
openStrategy: [String, Object],
|
|
25
25
|
opened: Array,
|
|
26
26
|
selected: Array,
|
|
27
27
|
mandatory: Boolean
|
|
@@ -48,7 +48,7 @@ export const useNested = props => {
|
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
50
|
const openStrategy = computed(() => {
|
|
51
|
-
if (typeof props.openStrategy === '
|
|
51
|
+
if (typeof props.openStrategy === 'object') return props.openStrategy;
|
|
52
52
|
switch (props.openStrategy) {
|
|
53
53
|
case 'list':
|
|
54
54
|
return listOpenStrategy;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nested.mjs","names":["useProxiedModel","getCurrentInstance","getUid","propsFactory","computed","inject","onBeforeUnmount","provide","ref","listOpenStrategy","multipleOpenStrategy","singleOpenStrategy","classicSelectStrategy","independentSelectStrategy","independentSingleSelectStrategy","leafSelectStrategy","leafSingleSelectStrategy","VNestedSymbol","Symbol","for","emptyNested","id","root","register","unregister","parents","Map","children","open","openOnSelect","select","opened","Set","selected","selectedValues","makeNestedProps","selectStrategy","String","Function","openStrategy","Array","mandatory","Boolean","useNested","props","isUnmounted","v","values","value","in","out","getPath","path","parent","unshift","get","vm","nested","arr","key","entries","push","parentId","isGroup","set","delete","list","filter","child","event","emit","newOpened","newSelected","useNestedItem","computedId","item","e","isOpen","has","isSelected","isIndeterminate","isLeaf","isGroupActivator","useNestedGroupActivator"],"sources":["../../../src/composables/nested/nested.ts"],"sourcesContent":["import { useProxiedModel } from '@/composables/proxiedModel'\nimport { getCurrentInstance, getUid, propsFactory } from '@/util'\nimport { computed, inject, onBeforeUnmount, provide, ref } from 'vue'\nimport { listOpenStrategy, multipleOpenStrategy, singleOpenStrategy } from './openStrategies'\nimport {\n classicSelectStrategy,\n independentSelectStrategy,\n independentSingleSelectStrategy,\n leafSelectStrategy,\n leafSingleSelectStrategy,\n} from './selectStrategies'\n\n// Types\nimport type { InjectionKey, PropType, Ref } from 'vue'\nimport type { SelectStrategyFn } from './selectStrategies'\nimport type { OpenStrategy } from './openStrategies'\n\nexport type SelectStrategy = 'single-leaf' | 'leaf' | 'independent' | 'single-independent' | 'classic' | SelectStrategyFn\nexport type OpenStrategyProp = 'single' | 'multiple' | 'list' | OpenStrategy\n\nexport interface NestedProps {\n selectStrategy: SelectStrategy | undefined\n openStrategy: OpenStrategyProp | undefined\n selected: unknown[] | undefined\n opened: unknown[] | undefined\n mandatory: boolean\n 'onUpdate:selected': ((val: unknown[]) => void) | undefined\n 'onUpdate:opened': ((val: unknown[]) => void) | undefined\n}\n\ntype NestedProvide = {\n id: Ref<unknown>\n isGroupActivator?: boolean\n root: {\n children: Ref<Map<unknown, unknown[]>>\n parents: Ref<Map<unknown, unknown>>\n opened: Ref<Set<unknown>>\n selected: Ref<Map<unknown, 'on' | 'off' | 'indeterminate'>>\n selectedValues: Ref<unknown[]>\n register: (id: unknown, parentId: unknown, isGroup?: boolean) => void\n unregister: (id: unknown) => void\n open: (id: unknown, value: boolean, event?: Event) => void\n select: (id: unknown, value: boolean, event?: Event) => void\n openOnSelect: (id: unknown, value: boolean, event?: Event) => void\n }\n}\n\nexport const VNestedSymbol: InjectionKey<NestedProvide> = Symbol.for('vuetify:nested')\n\nexport const emptyNested: NestedProvide = {\n id: ref(),\n root: {\n register: () => null,\n unregister: () => null,\n parents: ref(new Map()),\n children: ref(new Map()),\n open: () => null,\n openOnSelect: () => null,\n select: () => null,\n opened: ref(new Set()),\n selected: ref(new Map()),\n selectedValues: ref([]),\n },\n}\n\nexport const makeNestedProps = propsFactory({\n selectStrategy: [String, Function] as PropType<SelectStrategy>,\n openStrategy: [String, Function] as PropType<OpenStrategyProp>,\n opened: Array as PropType<unknown[]>,\n selected: Array as PropType<unknown[]>,\n mandatory: Boolean,\n}, 'nested')\n\nexport const useNested = (props: NestedProps) => {\n let isUnmounted = false\n const children = ref(new Map<unknown, unknown[]>())\n const parents = ref(new Map<unknown, unknown>())\n\n const opened = useProxiedModel(props, 'opened', props.opened, v => new Set(v), v => [...v.values()])\n\n const selectStrategy = computed(() => {\n if (typeof props.selectStrategy === 'object') return props.selectStrategy\n\n switch (props.selectStrategy) {\n case 'single-leaf': return leafSingleSelectStrategy(props.mandatory)\n case 'leaf': return leafSelectStrategy(props.mandatory)\n case 'independent': return independentSelectStrategy(props.mandatory)\n case 'single-independent': return independentSingleSelectStrategy(props.mandatory)\n case 'classic':\n default: return classicSelectStrategy(props.mandatory)\n }\n })\n\n const openStrategy = computed(() => {\n if (typeof props.openStrategy === 'function') return props.openStrategy\n\n switch (props.openStrategy) {\n case 'list': return listOpenStrategy\n case 'single': return singleOpenStrategy\n case 'multiple':\n default: return multipleOpenStrategy\n }\n })\n\n const selected = useProxiedModel(\n props,\n 'selected',\n props.selected,\n v => selectStrategy.value.in(v, children.value, parents.value),\n v => selectStrategy.value.out(v, children.value, parents.value),\n )\n\n onBeforeUnmount(() => {\n isUnmounted = true\n })\n\n function getPath (id: unknown) {\n const path: unknown[] = []\n let parent: unknown = id\n\n while (parent != null) {\n path.unshift(parent)\n parent = parents.value.get(parent)\n }\n\n return path\n }\n\n const vm = getCurrentInstance('nested')\n\n const nested: NestedProvide = {\n id: ref(),\n root: {\n opened,\n selected,\n selectedValues: computed(() => {\n const arr = []\n\n for (const [key, value] of selected.value.entries()) {\n if (value === 'on') arr.push(key)\n }\n\n return arr\n }),\n register: (id, parentId, isGroup) => {\n parentId && id !== parentId && parents.value.set(id, parentId)\n\n isGroup && children.value.set(id, [])\n\n if (parentId != null) {\n children.value.set(parentId, [...children.value.get(parentId) || [], id])\n }\n },\n unregister: id => {\n if (isUnmounted) return\n\n children.value.delete(id)\n const parent = parents.value.get(id)\n if (parent) {\n const list = children.value.get(parent) ?? []\n children.value.set(parent, list.filter(child => child !== id))\n }\n parents.value.delete(id)\n opened.value.delete(id)\n },\n open: (id, value, event) => {\n vm.emit('click:open', { id, value, path: getPath(id), event })\n\n const newOpened = openStrategy.value.open({\n id,\n value,\n opened: new Set(opened.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n\n newOpened && (opened.value = newOpened)\n },\n openOnSelect: (id, value, event) => {\n const newOpened = openStrategy.value.select({\n id,\n value,\n selected: new Map(selected.value),\n opened: new Set(opened.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n newOpened && (opened.value = newOpened)\n },\n select: (id, value, event) => {\n vm.emit('click:select', { id, value, path: getPath(id), event })\n\n const newSelected = selectStrategy.value.select({\n id,\n value,\n selected: new Map(selected.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n newSelected && (selected.value = newSelected)\n\n nested.root.openOnSelect(id, value, event)\n },\n children,\n parents,\n },\n }\n\n provide(VNestedSymbol, nested)\n\n return nested.root\n}\n\nexport const useNestedItem = (id: Ref<unknown>, isGroup: boolean) => {\n const parent = inject(VNestedSymbol, emptyNested)\n\n const computedId = computed(() => id.value ?? Symbol(getUid()))\n\n const item = {\n ...parent,\n id: computedId,\n open: (open: boolean, e: Event) => parent.root.open(computedId.value, open, e),\n openOnSelect: (open: boolean, e?: Event) => parent.root.openOnSelect(computedId.value, open, e),\n isOpen: computed(() => parent.root.opened.value.has(computedId.value)),\n parent: computed(() => parent.root.parents.value.get(computedId.value)),\n select: (selected: boolean, e?: Event) => parent.root.select(computedId.value, selected, e),\n isSelected: computed(() => parent.root.selected.value.get(computedId.value) === 'on'),\n isIndeterminate: computed(() => parent.root.selected.value.get(computedId.value) === 'indeterminate'),\n isLeaf: computed(() => !parent.root.children.value.get(computedId.value)),\n isGroupActivator: parent.isGroupActivator,\n }\n\n !parent.isGroupActivator && parent.root.register(computedId.value, parent.id.value, isGroup)\n\n onBeforeUnmount(() => {\n !parent.isGroupActivator && parent.root.unregister(computedId.value)\n })\n\n isGroup && provide(VNestedSymbol, item)\n\n return item\n}\n\nexport const useNestedGroupActivator = () => {\n const parent = inject(VNestedSymbol, emptyNested)\n\n provide(VNestedSymbol, { ...parent, isGroupActivator: true })\n}\n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AO,CAACU,aAAa,EAAE;IAAE,GAAGoC,MAAM;IAAE6B,gBAAgB,EAAE;EAAK,CAAC,CAAC;AAC/D,CAAC"}
|
|
1
|
+
{"version":3,"file":"nested.mjs","names":["useProxiedModel","getCurrentInstance","getUid","propsFactory","computed","inject","onBeforeUnmount","provide","ref","listOpenStrategy","multipleOpenStrategy","singleOpenStrategy","classicSelectStrategy","independentSelectStrategy","independentSingleSelectStrategy","leafSelectStrategy","leafSingleSelectStrategy","VNestedSymbol","Symbol","for","emptyNested","id","root","register","unregister","parents","Map","children","open","openOnSelect","select","opened","Set","selected","selectedValues","makeNestedProps","selectStrategy","String","Function","openStrategy","Object","Array","mandatory","Boolean","useNested","props","isUnmounted","v","values","value","in","out","getPath","path","parent","unshift","get","vm","nested","arr","key","entries","push","parentId","isGroup","set","delete","list","filter","child","event","emit","newOpened","newSelected","useNestedItem","computedId","item","e","isOpen","has","isSelected","isIndeterminate","isLeaf","isGroupActivator","useNestedGroupActivator"],"sources":["../../../src/composables/nested/nested.ts"],"sourcesContent":["import { useProxiedModel } from '@/composables/proxiedModel'\nimport { getCurrentInstance, getUid, propsFactory } from '@/util'\nimport { computed, inject, onBeforeUnmount, provide, ref } from 'vue'\nimport { listOpenStrategy, multipleOpenStrategy, singleOpenStrategy } from './openStrategies'\nimport {\n classicSelectStrategy,\n independentSelectStrategy,\n independentSingleSelectStrategy,\n leafSelectStrategy,\n leafSingleSelectStrategy,\n} from './selectStrategies'\n\n// Types\nimport type { InjectionKey, PropType, Ref } from 'vue'\nimport type { SelectStrategyFn } from './selectStrategies'\nimport type { OpenStrategy } from './openStrategies'\n\nexport type SelectStrategy = 'single-leaf' | 'leaf' | 'independent' | 'single-independent' | 'classic' | SelectStrategyFn\nexport type OpenStrategyProp = 'single' | 'multiple' | 'list' | OpenStrategy\n\nexport interface NestedProps {\n selectStrategy: SelectStrategy | undefined\n openStrategy: OpenStrategyProp | undefined\n selected: unknown[] | undefined\n opened: unknown[] | undefined\n mandatory: boolean\n 'onUpdate:selected': ((val: unknown[]) => void) | undefined\n 'onUpdate:opened': ((val: unknown[]) => void) | undefined\n}\n\ntype NestedProvide = {\n id: Ref<unknown>\n isGroupActivator?: boolean\n root: {\n children: Ref<Map<unknown, unknown[]>>\n parents: Ref<Map<unknown, unknown>>\n opened: Ref<Set<unknown>>\n selected: Ref<Map<unknown, 'on' | 'off' | 'indeterminate'>>\n selectedValues: Ref<unknown[]>\n register: (id: unknown, parentId: unknown, isGroup?: boolean) => void\n unregister: (id: unknown) => void\n open: (id: unknown, value: boolean, event?: Event) => void\n select: (id: unknown, value: boolean, event?: Event) => void\n openOnSelect: (id: unknown, value: boolean, event?: Event) => void\n }\n}\n\nexport const VNestedSymbol: InjectionKey<NestedProvide> = Symbol.for('vuetify:nested')\n\nexport const emptyNested: NestedProvide = {\n id: ref(),\n root: {\n register: () => null,\n unregister: () => null,\n parents: ref(new Map()),\n children: ref(new Map()),\n open: () => null,\n openOnSelect: () => null,\n select: () => null,\n opened: ref(new Set()),\n selected: ref(new Map()),\n selectedValues: ref([]),\n },\n}\n\nexport const makeNestedProps = propsFactory({\n selectStrategy: [String, Function] as PropType<SelectStrategy>,\n openStrategy: [String, Object] as PropType<OpenStrategyProp>,\n opened: Array as PropType<unknown[]>,\n selected: Array as PropType<unknown[]>,\n mandatory: Boolean,\n}, 'nested')\n\nexport const useNested = (props: NestedProps) => {\n let isUnmounted = false\n const children = ref(new Map<unknown, unknown[]>())\n const parents = ref(new Map<unknown, unknown>())\n\n const opened = useProxiedModel(props, 'opened', props.opened, v => new Set(v), v => [...v.values()])\n\n const selectStrategy = computed(() => {\n if (typeof props.selectStrategy === 'object') return props.selectStrategy\n\n switch (props.selectStrategy) {\n case 'single-leaf': return leafSingleSelectStrategy(props.mandatory)\n case 'leaf': return leafSelectStrategy(props.mandatory)\n case 'independent': return independentSelectStrategy(props.mandatory)\n case 'single-independent': return independentSingleSelectStrategy(props.mandatory)\n case 'classic':\n default: return classicSelectStrategy(props.mandatory)\n }\n })\n\n const openStrategy = computed(() => {\n if (typeof props.openStrategy === 'object') return props.openStrategy\n\n switch (props.openStrategy) {\n case 'list': return listOpenStrategy\n case 'single': return singleOpenStrategy\n case 'multiple':\n default: return multipleOpenStrategy\n }\n })\n\n const selected = useProxiedModel(\n props,\n 'selected',\n props.selected,\n v => selectStrategy.value.in(v, children.value, parents.value),\n v => selectStrategy.value.out(v, children.value, parents.value),\n )\n\n onBeforeUnmount(() => {\n isUnmounted = true\n })\n\n function getPath (id: unknown) {\n const path: unknown[] = []\n let parent: unknown = id\n\n while (parent != null) {\n path.unshift(parent)\n parent = parents.value.get(parent)\n }\n\n return path\n }\n\n const vm = getCurrentInstance('nested')\n\n const nested: NestedProvide = {\n id: ref(),\n root: {\n opened,\n selected,\n selectedValues: computed(() => {\n const arr = []\n\n for (const [key, value] of selected.value.entries()) {\n if (value === 'on') arr.push(key)\n }\n\n return arr\n }),\n register: (id, parentId, isGroup) => {\n parentId && id !== parentId && parents.value.set(id, parentId)\n\n isGroup && children.value.set(id, [])\n\n if (parentId != null) {\n children.value.set(parentId, [...children.value.get(parentId) || [], id])\n }\n },\n unregister: id => {\n if (isUnmounted) return\n\n children.value.delete(id)\n const parent = parents.value.get(id)\n if (parent) {\n const list = children.value.get(parent) ?? []\n children.value.set(parent, list.filter(child => child !== id))\n }\n parents.value.delete(id)\n opened.value.delete(id)\n },\n open: (id, value, event) => {\n vm.emit('click:open', { id, value, path: getPath(id), event })\n\n const newOpened = openStrategy.value.open({\n id,\n value,\n opened: new Set(opened.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n\n newOpened && (opened.value = newOpened)\n },\n openOnSelect: (id, value, event) => {\n const newOpened = openStrategy.value.select({\n id,\n value,\n selected: new Map(selected.value),\n opened: new Set(opened.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n newOpened && (opened.value = newOpened)\n },\n select: (id, value, event) => {\n vm.emit('click:select', { id, value, path: getPath(id), event })\n\n const newSelected = selectStrategy.value.select({\n id,\n value,\n selected: new Map(selected.value),\n children: children.value,\n parents: parents.value,\n event,\n })\n newSelected && (selected.value = newSelected)\n\n nested.root.openOnSelect(id, value, event)\n },\n children,\n parents,\n },\n }\n\n provide(VNestedSymbol, nested)\n\n return nested.root\n}\n\nexport const useNestedItem = (id: Ref<unknown>, isGroup: boolean) => {\n const parent = inject(VNestedSymbol, emptyNested)\n\n const computedId = computed(() => id.value ?? Symbol(getUid()))\n\n const item = {\n ...parent,\n id: computedId,\n open: (open: boolean, e: Event) => parent.root.open(computedId.value, open, e),\n openOnSelect: (open: boolean, e?: Event) => parent.root.openOnSelect(computedId.value, open, e),\n isOpen: computed(() => parent.root.opened.value.has(computedId.value)),\n parent: computed(() => parent.root.parents.value.get(computedId.value)),\n select: (selected: boolean, e?: Event) => parent.root.select(computedId.value, selected, e),\n isSelected: computed(() => parent.root.selected.value.get(computedId.value) === 'on'),\n isIndeterminate: computed(() => parent.root.selected.value.get(computedId.value) === 'indeterminate'),\n isLeaf: computed(() => !parent.root.children.value.get(computedId.value)),\n isGroupActivator: parent.isGroupActivator,\n }\n\n !parent.isGroupActivator && parent.root.register(computedId.value, parent.id.value, isGroup)\n\n onBeforeUnmount(() => {\n !parent.isGroupActivator && parent.root.unregister(computedId.value)\n })\n\n isGroup && provide(VNestedSymbol, item)\n\n return item\n}\n\nexport const useNestedGroupActivator = () => {\n const parent = inject(VNestedSymbol, emptyNested)\n\n provide(VNestedSymbol, { ...parent, isGroupActivator: true })\n}\n"],"mappings":"SAASA,eAAe;AAAA,SACfC,kBAAkB,EAAEC,MAAM,EAAEC,YAAY;AACjD,SAASC,QAAQ,EAAEC,MAAM,EAAEC,eAAe,EAAEC,OAAO,EAAEC,GAAG,QAAQ,KAAK;AAAA,SAC5DC,gBAAgB,EAAEC,oBAAoB,EAAEC,kBAAkB;AAAA,SAEjEC,qBAAqB,EACrBC,yBAAyB,EACzBC,+BAA+B,EAC/BC,kBAAkB,EAClBC,wBAAwB,kCAG1B;AAmCA,OAAO,MA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CAAC,KAAK,IAAI,CAAC;IACrFgC,eAAe,EAAE7E,QAAQ,CAAC,MAAMkD,MAAM,CAAChC,IAAI,CAACW,QAAQ,CAACgB,KAAK,CAACO,GAAG,CAACmB,UAAU,CAAC1B,KAAK,CAAC,KAAK,eAAe,CAAC;IACrGiC,MAAM,EAAE9E,QAAQ,CAAC,MAAM,CAACkD,MAAM,CAAChC,IAAI,CAACK,QAAQ,CAACsB,KAAK,CAACO,GAAG,CAACmB,UAAU,CAAC1B,KAAK,CAAC,CAAC;IACzEkC,gBAAgB,EAAE7B,MAAM,CAAC6B;EAC3B,CAAC;EAED,CAAC7B,MAAM,CAAC6B,gBAAgB,IAAI7B,MAAM,CAAChC,IAAI,CAACC,QAAQ,CAACoD,UAAU,CAAC1B,KAAK,EAAEK,MAAM,CAACjC,EAAE,CAAC4B,KAAK,EAAEe,OAAO,CAAC;EAE5F1D,eAAe,CAAC,MAAM;IACpB,CAACgD,MAAM,CAAC6B,gBAAgB,IAAI7B,MAAM,CAAChC,IAAI,CAACE,UAAU,CAACmD,UAAU,CAAC1B,KAAK,CAAC;EACtE,CAAC,CAAC;EAEFe,OAAO,IAAIzD,OAAO,CAACU,aAAa,EAAE2D,IAAI,CAAC;EAEvC,OAAOA,IAAI;AACb,CAAC;AAED,OAAO,MAAMQ,uBAAuB,GAAG,MAAM;EAC3C,MAAM9B,MAAM,GAAGjD,MAAM,CAACY,aAAa,EAAEG,WAAW,CAAC;EAEjDb,OAAO,CAACU,aAAa,EAAE;IAAE,GAAGqC,MAAM;IAAE6B,gBAAgB,EAAE;EAAK,CAAC,CAAC;AAC/D,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { effectScope, watch } from 'vue';
|
|
1
|
+
import { effectScope, onScopeDispose, watch } from 'vue';
|
|
2
2
|
export function useToggleScope(source, cb) {
|
|
3
3
|
let scope;
|
|
4
4
|
watch(source, active => {
|
|
5
5
|
if (active && !scope) {
|
|
6
6
|
scope = effectScope();
|
|
7
7
|
scope.run(cb);
|
|
8
|
-
} else {
|
|
8
|
+
} else if (!active) {
|
|
9
9
|
var _scope;
|
|
10
10
|
(_scope = scope) == null ? void 0 : _scope.stop();
|
|
11
11
|
scope = undefined;
|
|
@@ -13,5 +13,9 @@ export function useToggleScope(source, cb) {
|
|
|
13
13
|
}, {
|
|
14
14
|
immediate: true
|
|
15
15
|
});
|
|
16
|
+
onScopeDispose(() => {
|
|
17
|
+
var _scope2;
|
|
18
|
+
(_scope2 = scope) == null ? void 0 : _scope2.stop();
|
|
19
|
+
});
|
|
16
20
|
}
|
|
17
21
|
//# sourceMappingURL=toggleScope.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggleScope.mjs","names":["effectScope","watch","useToggleScope","source","cb","scope","active","run","stop","undefined","immediate"],"sources":["../../src/composables/toggleScope.ts"],"sourcesContent":["import { effectScope, watch } from 'vue'\nimport type { EffectScope, WatchSource } from 'vue'\n\nexport function useToggleScope (source: WatchSource<boolean>, cb: () => void) {\n let scope: EffectScope | undefined\n watch(source, active => {\n if (active && !scope) {\n scope = effectScope()\n scope.run(cb)\n } else {\n scope?.stop()\n scope = undefined\n }\n }, { immediate: true })\n}\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,KAAK,QAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"toggleScope.mjs","names":["effectScope","onScopeDispose","watch","useToggleScope","source","cb","scope","active","run","stop","undefined","immediate"],"sources":["../../src/composables/toggleScope.ts"],"sourcesContent":["import { effectScope, onScopeDispose, watch } from 'vue'\nimport type { EffectScope, WatchSource } from 'vue'\n\nexport function useToggleScope (source: WatchSource<boolean>, cb: () => void) {\n let scope: EffectScope | undefined\n watch(source, active => {\n if (active && !scope) {\n scope = effectScope()\n scope.run(cb)\n } else if (!active) {\n scope?.stop()\n scope = undefined\n }\n }, { immediate: true })\n\n onScopeDispose(() => {\n scope?.stop()\n })\n}\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,cAAc,EAAEC,KAAK,QAAQ,KAAK;AAGxD,OAAO,SAASC,cAAc,CAAEC,MAA4B,EAAEC,EAAc,EAAE;EAC5E,IAAIC,KAA8B;EAClCJ,KAAK,CAACE,MAAM,EAAEG,MAAM,IAAI;IACtB,IAAIA,MAAM,IAAI,CAACD,KAAK,EAAE;MACpBA,KAAK,GAAGN,WAAW,EAAE;MACrBM,KAAK,CAACE,GAAG,CAACH,EAAE,CAAC;IACf,CAAC,MAAM,IAAI,CAACE,MAAM,EAAE;MAAA;MAClB,UAAAD,KAAK,qBAAL,OAAOG,IAAI,EAAE;MACbH,KAAK,GAAGI,SAAS;IACnB;EACF,CAAC,EAAE;IAAEC,SAAS,EAAE;EAAK,CAAC,CAAC;EAEvBV,cAAc,CAAC,MAAM;IAAA;IACnB,WAAAK,KAAK,qBAAL,QAAOG,IAAI,EAAE;EACf,CAAC,CAAC;AACJ"}
|
package/lib/entry-bundler.mjs
CHANGED
package/lib/framework.mjs
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -315,15 +315,15 @@ declare module '@vue/runtime-core' {
|
|
|
315
315
|
export interface GlobalComponents {
|
|
316
316
|
VApp: typeof import('vuetify/components')['VApp']
|
|
317
317
|
VDefaultsProvider: typeof import('vuetify/components')['VDefaultsProvider']
|
|
318
|
-
VForm: typeof import('vuetify/components')['VForm']
|
|
319
318
|
VContainer: typeof import('vuetify/components')['VContainer']
|
|
320
319
|
VCol: typeof import('vuetify/components')['VCol']
|
|
321
320
|
VRow: typeof import('vuetify/components')['VRow']
|
|
322
321
|
VSpacer: typeof import('vuetify/components')['VSpacer']
|
|
323
322
|
VHover: typeof import('vuetify/components')['VHover']
|
|
323
|
+
VForm: typeof import('vuetify/components')['VForm']
|
|
324
|
+
VLazy: typeof import('vuetify/components')['VLazy']
|
|
324
325
|
VLayout: typeof import('vuetify/components')['VLayout']
|
|
325
326
|
VLayoutItem: typeof import('vuetify/components')['VLayoutItem']
|
|
326
|
-
VLazy: typeof import('vuetify/components')['VLazy']
|
|
327
327
|
VLocaleProvider: typeof import('vuetify/components')['VLocaleProvider']
|
|
328
328
|
VNoSsr: typeof import('vuetify/components')['VNoSsr']
|
|
329
329
|
VParallax: typeof import('vuetify/components')['VParallax']
|
|
@@ -347,24 +347,25 @@ declare module '@vue/runtime-core' {
|
|
|
347
347
|
VSlideYReverseTransition: typeof import('vuetify/components')['VSlideYReverseTransition']
|
|
348
348
|
VExpandTransition: typeof import('vuetify/components')['VExpandTransition']
|
|
349
349
|
VExpandXTransition: typeof import('vuetify/components')['VExpandXTransition']
|
|
350
|
-
|
|
351
|
-
VAppBarNavIcon: typeof import('vuetify/components')['VAppBarNavIcon']
|
|
352
|
-
VAppBarTitle: typeof import('vuetify/components')['VAppBarTitle']
|
|
350
|
+
VDialogTransition: typeof import('vuetify/components')['VDialogTransition']
|
|
353
351
|
VAlert: typeof import('vuetify/components')['VAlert']
|
|
354
352
|
VAlertTitle: typeof import('vuetify/components')['VAlertTitle']
|
|
355
353
|
VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
|
|
356
354
|
VAvatar: typeof import('vuetify/components')['VAvatar']
|
|
357
355
|
VBadge: typeof import('vuetify/components')['VBadge']
|
|
356
|
+
VAppBar: typeof import('vuetify/components')['VAppBar']
|
|
357
|
+
VAppBarNavIcon: typeof import('vuetify/components')['VAppBarNavIcon']
|
|
358
|
+
VAppBarTitle: typeof import('vuetify/components')['VAppBarTitle']
|
|
358
359
|
VBanner: typeof import('vuetify/components')['VBanner']
|
|
359
360
|
VBannerActions: typeof import('vuetify/components')['VBannerActions']
|
|
360
361
|
VBannerText: typeof import('vuetify/components')['VBannerText']
|
|
361
|
-
VBottomNavigation: typeof import('vuetify/components')['VBottomNavigation']
|
|
362
362
|
VBreadcrumbs: typeof import('vuetify/components')['VBreadcrumbs']
|
|
363
363
|
VBreadcrumbsItem: typeof import('vuetify/components')['VBreadcrumbsItem']
|
|
364
364
|
VBreadcrumbsDivider: typeof import('vuetify/components')['VBreadcrumbsDivider']
|
|
365
365
|
VBtn: typeof import('vuetify/components')['VBtn']
|
|
366
|
-
|
|
366
|
+
VBottomNavigation: typeof import('vuetify/components')['VBottomNavigation']
|
|
367
367
|
VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
|
|
368
|
+
VBtnGroup: typeof import('vuetify/components')['VBtnGroup']
|
|
368
369
|
VCard: typeof import('vuetify/components')['VCard']
|
|
369
370
|
VCardActions: typeof import('vuetify/components')['VCardActions']
|
|
370
371
|
VCardItem: typeof import('vuetify/components')['VCardItem']
|
|
@@ -373,13 +374,14 @@ declare module '@vue/runtime-core' {
|
|
|
373
374
|
VCardTitle: typeof import('vuetify/components')['VCardTitle']
|
|
374
375
|
VCarousel: typeof import('vuetify/components')['VCarousel']
|
|
375
376
|
VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
|
|
377
|
+
VChipGroup: typeof import('vuetify/components')['VChipGroup']
|
|
378
|
+
VCode: typeof import('vuetify/components')['VCode']
|
|
376
379
|
VCheckbox: typeof import('vuetify/components')['VCheckbox']
|
|
377
380
|
VCheckboxBtn: typeof import('vuetify/components')['VCheckboxBtn']
|
|
378
381
|
VChip: typeof import('vuetify/components')['VChip']
|
|
379
|
-
VChipGroup: typeof import('vuetify/components')['VChipGroup']
|
|
380
382
|
VColorPicker: typeof import('vuetify/components')['VColorPicker']
|
|
381
|
-
VCombobox: typeof import('vuetify/components')['VCombobox']
|
|
382
383
|
VCounter: typeof import('vuetify/components')['VCounter']
|
|
384
|
+
VCombobox: typeof import('vuetify/components')['VCombobox']
|
|
383
385
|
VDialog: typeof import('vuetify/components')['VDialog']
|
|
384
386
|
VDivider: typeof import('vuetify/components')['VDivider']
|
|
385
387
|
VExpansionPanels: typeof import('vuetify/components')['VExpansionPanels']
|
|
@@ -390,13 +392,13 @@ declare module '@vue/runtime-core' {
|
|
|
390
392
|
VFieldLabel: typeof import('vuetify/components')['VFieldLabel']
|
|
391
393
|
VFileInput: typeof import('vuetify/components')['VFileInput']
|
|
392
394
|
VFooter: typeof import('vuetify/components')['VFooter']
|
|
395
|
+
VImg: typeof import('vuetify/components')['VImg']
|
|
396
|
+
VInput: typeof import('vuetify/components')['VInput']
|
|
393
397
|
VIcon: typeof import('vuetify/components')['VIcon']
|
|
394
398
|
VComponentIcon: typeof import('vuetify/components')['VComponentIcon']
|
|
395
399
|
VSvgIcon: typeof import('vuetify/components')['VSvgIcon']
|
|
396
400
|
VLigatureIcon: typeof import('vuetify/components')['VLigatureIcon']
|
|
397
401
|
VClassIcon: typeof import('vuetify/components')['VClassIcon']
|
|
398
|
-
VImg: typeof import('vuetify/components')['VImg']
|
|
399
|
-
VInput: typeof import('vuetify/components')['VInput']
|
|
400
402
|
VItemGroup: typeof import('vuetify/components')['VItemGroup']
|
|
401
403
|
VItem: typeof import('vuetify/components')['VItem']
|
|
402
404
|
VKbd: typeof import('vuetify/components')['VKbd']
|
|
@@ -411,9 +413,9 @@ declare module '@vue/runtime-core' {
|
|
|
411
413
|
VListItemTitle: typeof import('vuetify/components')['VListItemTitle']
|
|
412
414
|
VListSubheader: typeof import('vuetify/components')['VListSubheader']
|
|
413
415
|
VMain: typeof import('vuetify/components')['VMain']
|
|
414
|
-
VMenu: typeof import('vuetify/components')['VMenu']
|
|
415
416
|
VMessages: typeof import('vuetify/components')['VMessages']
|
|
416
417
|
VNavigationDrawer: typeof import('vuetify/components')['VNavigationDrawer']
|
|
418
|
+
VMenu: typeof import('vuetify/components')['VMenu']
|
|
417
419
|
VOverlay: typeof import('vuetify/components')['VOverlay']
|
|
418
420
|
VPagination: typeof import('vuetify/components')['VPagination']
|
|
419
421
|
VProgressCircular: typeof import('vuetify/components')['VProgressCircular']
|
|
@@ -426,23 +428,22 @@ declare module '@vue/runtime-core' {
|
|
|
426
428
|
VSheet: typeof import('vuetify/components')['VSheet']
|
|
427
429
|
VSlideGroup: typeof import('vuetify/components')['VSlideGroup']
|
|
428
430
|
VSlideGroupItem: typeof import('vuetify/components')['VSlideGroupItem']
|
|
429
|
-
VSlider: typeof import('vuetify/components')['VSlider']
|
|
430
431
|
VSnackbar: typeof import('vuetify/components')['VSnackbar']
|
|
432
|
+
VSlider: typeof import('vuetify/components')['VSlider']
|
|
431
433
|
VSwitch: typeof import('vuetify/components')['VSwitch']
|
|
432
434
|
VSystemBar: typeof import('vuetify/components')['VSystemBar']
|
|
433
435
|
VTabs: typeof import('vuetify/components')['VTabs']
|
|
434
436
|
VTab: typeof import('vuetify/components')['VTab']
|
|
435
437
|
VTable: typeof import('vuetify/components')['VTable']
|
|
436
438
|
VTextarea: typeof import('vuetify/components')['VTextarea']
|
|
437
|
-
VTextField: typeof import('vuetify/components')['VTextField']
|
|
438
439
|
VTimeline: typeof import('vuetify/components')['VTimeline']
|
|
439
440
|
VTimelineItem: typeof import('vuetify/components')['VTimelineItem']
|
|
441
|
+
VTextField: typeof import('vuetify/components')['VTextField']
|
|
442
|
+
VTooltip: typeof import('vuetify/components')['VTooltip']
|
|
440
443
|
VToolbar: typeof import('vuetify/components')['VToolbar']
|
|
441
444
|
VToolbarTitle: typeof import('vuetify/components')['VToolbarTitle']
|
|
442
445
|
VToolbarItems: typeof import('vuetify/components')['VToolbarItems']
|
|
443
|
-
VTooltip: typeof import('vuetify/components')['VTooltip']
|
|
444
446
|
VWindow: typeof import('vuetify/components')['VWindow']
|
|
445
447
|
VWindowItem: typeof import('vuetify/components')['VWindowItem']
|
|
446
|
-
VCode: typeof import('vuetify/components')['VCode']
|
|
447
448
|
}
|
|
448
449
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
// Utils
|
|
2
|
-
import { defineComponent as _defineComponent,
|
|
2
|
+
import { defineComponent as _defineComponent,
|
|
3
|
+
// eslint-disable-line no-restricted-imports
|
|
4
|
+
getCurrentInstance, shallowReactive, shallowRef, toRaw, watchEffect } from 'vue';
|
|
3
5
|
import { consoleWarn } from "./console.mjs";
|
|
4
6
|
import { mergeDeep, toKebabCase } from "./helpers.mjs";
|
|
5
7
|
import { injectSelf } from "./injectSelf.mjs";
|
|
6
|
-
import { DefaultsSymbol, provideDefaults, useDefaults } from "../composables/defaults.mjs";
|
|
8
|
+
import { DefaultsSymbol, provideDefaults, useDefaults } from "../composables/defaults.mjs";
|
|
9
|
+
import { useToggleScope } from "../composables/toggleScope.mjs"; // Types
|
|
7
10
|
import { propsFactory } from "./propsFactory.mjs";
|
|
8
11
|
function propIsDefined(vnode, prop) {
|
|
9
12
|
var _vnode$props, _vnode$props2;
|
|
@@ -47,17 +50,9 @@ export const defineComponent = function defineComponent(options) {
|
|
|
47
50
|
}
|
|
48
51
|
});
|
|
49
52
|
const setupBindings = options._setup(_props, ctx);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
scope = effectScope();
|
|
54
|
-
scope.run(() => {
|
|
55
|
-
var _injectSelf;
|
|
56
|
-
provideDefaults(mergeDeep(((_injectSelf = injectSelf(DefaultsSymbol)) == null ? void 0 : _injectSelf.value) ?? {}, val));
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}, {
|
|
60
|
-
immediate: true
|
|
53
|
+
useToggleScope(_subcomponentDefaults, () => {
|
|
54
|
+
var _injectSelf;
|
|
55
|
+
provideDefaults(mergeDeep(((_injectSelf = injectSelf(DefaultsSymbol)) == null ? void 0 : _injectSelf.value) ?? {}, _subcomponentDefaults.value));
|
|
61
56
|
});
|
|
62
57
|
return setupBindings;
|
|
63
58
|
};
|