vuetify 3.2.3 → 3.2.5
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 +9 -9
- package/dist/json/web-types.json +11 -11
- package/dist/vuetify-labs.css +505 -502
- package/dist/vuetify-labs.d.ts +4918 -437
- package/dist/vuetify-labs.esm.js +142 -124
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +142 -124
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +10 -7
- package/dist/vuetify.d.ts +3796 -248
- package/dist/vuetify.esm.js +131 -115
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +131 -115
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +469 -469
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VAlert/VAlert.mjs +1 -2
- package/lib/components/VAlert/VAlert.mjs.map +1 -1
- package/lib/components/VAlert/index.d.ts +52 -0
- package/lib/components/VApp/index.d.ts +16 -0
- package/lib/components/VAppBar/VAppBar.mjs +2 -2
- package/lib/components/VAppBar/VAppBar.mjs.map +1 -1
- package/lib/components/VAppBar/VAppBarNavIcon.mjs +1 -2
- package/lib/components/VAppBar/VAppBarNavIcon.mjs.map +1 -1
- package/lib/components/VAppBar/VAppBarTitle.mjs +1 -2
- package/lib/components/VAppBar/VAppBarTitle.mjs.map +1 -1
- package/lib/components/VAppBar/index.d.ts +84 -0
- package/lib/components/VAutocomplete/VAutocomplete.mjs +5 -5
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/index.d.ts +76 -12
- package/lib/components/VAvatar/index.d.ts +16 -0
- package/lib/components/VBadge/index.d.ts +20 -0
- package/lib/components/VBanner/index.d.ts +60 -0
- package/lib/components/VBottomNavigation/index.d.ts +16 -0
- package/lib/components/VBreadcrumbs/index.d.ts +39 -3
- package/lib/components/VBtn/index.d.ts +28 -0
- package/lib/components/VBtnGroup/index.d.ts +16 -0
- package/lib/components/VBtnToggle/index.d.ts +16 -0
- package/lib/components/VCard/index.d.ts +144 -0
- package/lib/components/VCarousel/index.d.ts +128 -0
- package/lib/components/VCheckbox/index.d.ts +84 -0
- package/lib/components/VChip/VChip.css +4 -3
- package/lib/components/VChip/VChip.sass +3 -3
- package/lib/components/VChip/index.d.ts +28 -0
- package/lib/components/VChipGroup/index.d.ts +16 -0
- package/lib/components/VCode/index.d.ts +16 -0
- package/lib/components/VColorPicker/VColorPickerCanvas.mjs +5 -5
- package/lib/components/VColorPicker/VColorPickerCanvas.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.mjs +5 -5
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/index.d.ts +76 -12
- package/lib/components/VCounter/index.d.ts +16 -0
- package/lib/components/VDefaultsProvider/index.d.ts +16 -0
- package/lib/components/VDialog/index.d.ts +133 -3
- package/lib/components/VDivider/index.d.ts +16 -0
- package/lib/components/VExpansionPanel/index.d.ts +76 -0
- package/lib/components/VField/index.d.ts +23 -3
- package/lib/components/VFileInput/index.d.ts +118 -3
- package/lib/components/VFooter/VFooter.mjs +2 -2
- package/lib/components/VFooter/VFooter.mjs.map +1 -1
- package/lib/components/VFooter/index.d.ts +16 -0
- package/lib/components/VForm/index.d.ts +19 -3
- package/lib/components/VGrid/index.d.ts +64 -0
- package/lib/components/VHover/index.d.ts +28 -0
- package/lib/components/VIcon/index.d.ts +32 -0
- package/lib/components/VImg/VImg.mjs +6 -6
- package/lib/components/VImg/VImg.mjs.map +1 -1
- package/lib/components/VImg/index.d.ts +40 -12
- package/lib/components/VInput/index.d.ts +28 -0
- package/lib/components/VItemGroup/index.d.ts +32 -0
- package/lib/components/VKbd/index.d.ts +16 -0
- package/lib/components/VLabel/index.d.ts +16 -0
- package/lib/components/VLayout/index.d.ts +32 -0
- package/lib/components/VLazy/index.d.ts +16 -0
- package/lib/components/VList/VList.mjs +2 -2
- package/lib/components/VList/VList.mjs.map +1 -1
- package/lib/components/VList/index.d.ts +176 -12
- package/lib/components/VList/list.mjs +4 -4
- package/lib/components/VList/list.mjs.map +1 -1
- package/lib/components/VLocaleProvider/index.d.ts +16 -0
- package/lib/components/VMain/index.d.ts +16 -0
- package/lib/components/VMenu/VMenu.mjs +3 -3
- package/lib/components/VMenu/VMenu.mjs.map +1 -1
- package/lib/components/VMenu/index.d.ts +136 -6
- package/lib/components/VMessages/index.d.ts +16 -0
- package/lib/components/VNavigationDrawer/VNavigationDrawer.css +2 -0
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs +2 -2
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.sass +2 -0
- package/lib/components/VNavigationDrawer/index.d.ts +31 -3
- package/lib/components/VNavigationDrawer/sticky.mjs +5 -4
- package/lib/components/VNavigationDrawer/sticky.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/touch.mjs +4 -4
- package/lib/components/VNavigationDrawer/touch.mjs.map +1 -1
- package/lib/components/VOverlay/index.d.ts +40 -0
- package/lib/components/VOverlay/locationStrategies.mjs +1 -1
- package/lib/components/VOverlay/locationStrategies.mjs.map +1 -1
- package/lib/components/VPagination/VPagination.mjs +2 -2
- package/lib/components/VPagination/VPagination.mjs.map +1 -1
- package/lib/components/VPagination/index.d.ts +32 -0
- package/lib/components/VParallax/index.d.ts +28 -0
- package/lib/components/VProgressCircular/index.d.ts +16 -0
- package/lib/components/VProgressLinear/index.d.ts +28 -0
- package/lib/components/VRadio/index.d.ts +36 -0
- package/lib/components/VRadioGroup/index.d.ts +48 -0
- package/lib/components/VRangeSlider/index.d.ts +36 -0
- package/lib/components/VRating/VRating.mjs +6 -3
- package/lib/components/VRating/VRating.mjs.map +1 -1
- package/lib/components/VRating/index.d.ts +20 -0
- package/lib/components/VResponsive/index.d.ts +20 -0
- package/lib/components/VSelect/VSelect.mjs +2 -2
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/index.d.ts +76 -12
- package/lib/components/VSelectionControl/VSelectionControl.mjs +3 -3
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
- package/lib/components/VSelectionControl/index.d.ts +10 -6
- package/lib/components/VSelectionControlGroup/index.d.ts +16 -0
- package/lib/components/VSheet/index.d.ts +16 -0
- package/lib/components/VSlideGroup/VSlideGroup.mjs +7 -7
- package/lib/components/VSlideGroup/VSlideGroup.mjs.map +1 -1
- package/lib/components/VSlideGroup/index.d.ts +63 -3
- package/lib/components/VSlider/index.d.ts +36 -0
- package/lib/components/VSlider/slider.mjs +3 -3
- package/lib/components/VSlider/slider.mjs.map +1 -1
- package/lib/components/VSnackbar/index.d.ts +129 -3
- package/lib/components/VSwitch/VSwitch.css +3 -3
- package/lib/components/VSwitch/VSwitch.sass +4 -3
- package/lib/components/VSwitch/index.d.ts +52 -0
- package/lib/components/VSystemBar/VSystemBar.mjs +2 -2
- package/lib/components/VSystemBar/VSystemBar.mjs.map +1 -1
- package/lib/components/VSystemBar/index.d.ts +16 -0
- package/lib/components/VTable/index.d.ts +28 -0
- package/lib/components/VTabs/VTab.mjs +4 -5
- package/lib/components/VTabs/VTab.mjs.map +1 -1
- package/lib/components/VTabs/index.d.ts +32 -0
- package/lib/components/VTextField/index.d.ts +121 -6
- package/lib/components/VTextarea/VTextarea.mjs +6 -3
- package/lib/components/VTextarea/VTextarea.mjs.map +1 -1
- package/lib/components/VTextarea/index.d.ts +110 -3
- package/lib/components/VThemeProvider/index.d.ts +16 -0
- package/lib/components/VTimeline/VTimelineItem.mjs +2 -2
- package/lib/components/VTimeline/VTimelineItem.mjs.map +1 -1
- package/lib/components/VTimeline/index.d.ts +40 -0
- package/lib/components/VToolbar/VToolbar.mjs +2 -2
- package/lib/components/VToolbar/VToolbar.mjs.map +1 -1
- package/lib/components/VToolbar/index.d.ts +72 -0
- package/lib/components/VTooltip/index.d.ts +133 -3
- package/lib/components/VValidation/index.d.ts +16 -0
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs +3 -3
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs.map +1 -1
- package/lib/components/VVirtualScroll/index.d.ts +7 -3
- package/lib/components/VWindow/VWindow.mjs +3 -3
- package/lib/components/VWindow/VWindow.mjs.map +1 -1
- package/lib/components/VWindow/VWindowItem.mjs +3 -3
- package/lib/components/VWindow/VWindowItem.mjs.map +1 -1
- package/lib/components/VWindow/index.d.ts +76 -0
- package/lib/components/index.d.ts +3786 -245
- package/lib/components/transitions/index.d.ts +256 -0
- package/lib/composables/display.mjs +3 -3
- package/lib/composables/display.mjs.map +1 -1
- package/lib/composables/form.mjs +4 -4
- package/lib/composables/form.mjs.map +1 -1
- package/lib/composables/hydration.mjs +6 -6
- package/lib/composables/hydration.mjs.map +1 -1
- package/lib/composables/intersectionObserver.mjs +2 -2
- package/lib/composables/intersectionObserver.mjs.map +1 -1
- package/lib/composables/layout.mjs +3 -3
- package/lib/composables/layout.mjs.map +1 -1
- package/lib/composables/lazy.mjs +2 -2
- package/lib/composables/lazy.mjs.map +1 -1
- package/lib/composables/nested/nested.mjs +5 -4
- package/lib/composables/nested/nested.mjs.map +1 -1
- package/lib/composables/scroll.mjs +6 -6
- package/lib/composables/scroll.mjs.map +1 -1
- package/lib/composables/ssrBoot.mjs +2 -2
- package/lib/composables/ssrBoot.mjs.map +1 -1
- package/lib/composables/stack.mjs +5 -4
- package/lib/composables/stack.mjs.map +1 -1
- package/lib/composables/transition.mjs +5 -2
- package/lib/composables/transition.mjs.map +1 -1
- package/lib/composables/validation.mjs +3 -3
- package/lib/composables/validation.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/index.d.ts +9 -2
- package/lib/labs/VDataTable/VDataTable.mjs +2 -1
- package/lib/labs/VDataTable/VDataTable.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableServer.mjs +2 -1
- package/lib/labs/VDataTable/VDataTableServer.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableVirtual.mjs +6 -6
- package/lib/labs/VDataTable/VDataTableVirtual.mjs.map +1 -1
- package/lib/labs/VDataTable/composables/virtual.mjs +3 -3
- package/lib/labs/VDataTable/composables/virtual.mjs.map +1 -1
- package/lib/labs/VDataTable/index.d.ts +894 -2
- package/lib/labs/VInfiniteScroll/index.d.ts +32 -0
- package/lib/labs/VSkeletonLoader/VSkeletonLoader.mjs.map +1 -1
- package/lib/labs/VSkeletonLoader/index.d.ts +25 -9
- package/lib/labs/components.d.ts +951 -11
- package/lib/locale/adapters/vuetify.mjs +8 -5
- package/lib/locale/adapters/vuetify.mjs.map +1 -1
- package/lib/styles/settings/_variables.scss +3 -3
- package/lib/util/defineComponent.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -180,6 +180,31 @@ declare const VCarousel: {
|
|
|
180
180
|
ariaLabel: string;
|
|
181
181
|
};
|
|
182
182
|
}) => vue.VNodeChild) | undefined;
|
|
183
|
+
} & {
|
|
184
|
+
$slots?: {
|
|
185
|
+
default?: ((args_0: {
|
|
186
|
+
group: GroupProvide;
|
|
187
|
+
}) => vue.VNodeChild) | undefined;
|
|
188
|
+
additional?: ((args_0: {
|
|
189
|
+
group: GroupProvide;
|
|
190
|
+
}) => vue.VNodeChild) | undefined;
|
|
191
|
+
prev?: ((args_0: {
|
|
192
|
+
props: {
|
|
193
|
+
icon: IconValue;
|
|
194
|
+
class: string;
|
|
195
|
+
onClick: () => void;
|
|
196
|
+
ariaLabel: string;
|
|
197
|
+
};
|
|
198
|
+
}) => vue.VNodeChild) | undefined;
|
|
199
|
+
next?: ((args_0: {
|
|
200
|
+
props: {
|
|
201
|
+
icon: IconValue;
|
|
202
|
+
class: string;
|
|
203
|
+
onClick: () => void;
|
|
204
|
+
ariaLabel: string;
|
|
205
|
+
};
|
|
206
|
+
}) => vue.VNodeChild) | undefined;
|
|
207
|
+
} | undefined;
|
|
183
208
|
} & {
|
|
184
209
|
"onUpdate:modelValue"?: ((val: any) => any) | undefined;
|
|
185
210
|
} & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, "reverse" | "interval" | "height" | "direction" | "style" | "disabled" | "tag" | "mandatory" | "touch" | "selectedClass" | "continuous" | "nextIcon" | "prevIcon" | "showArrows" | "cycle" | "delimiterIcon" | "hideDelimiters" | "hideDelimiterBackground">;
|
|
@@ -296,6 +321,31 @@ declare const VCarousel: {
|
|
|
296
321
|
ariaLabel: string;
|
|
297
322
|
};
|
|
298
323
|
}) => vue.VNodeChild) | undefined;
|
|
324
|
+
} & {
|
|
325
|
+
$slots?: {
|
|
326
|
+
default?: ((args_0: {
|
|
327
|
+
group: GroupProvide;
|
|
328
|
+
}) => vue.VNodeChild) | undefined;
|
|
329
|
+
additional?: ((args_0: {
|
|
330
|
+
group: GroupProvide;
|
|
331
|
+
}) => vue.VNodeChild) | undefined;
|
|
332
|
+
prev?: ((args_0: {
|
|
333
|
+
props: {
|
|
334
|
+
icon: IconValue;
|
|
335
|
+
class: string;
|
|
336
|
+
onClick: () => void;
|
|
337
|
+
ariaLabel: string;
|
|
338
|
+
};
|
|
339
|
+
}) => vue.VNodeChild) | undefined;
|
|
340
|
+
next?: ((args_0: {
|
|
341
|
+
props: {
|
|
342
|
+
icon: IconValue;
|
|
343
|
+
class: string;
|
|
344
|
+
onClick: () => void;
|
|
345
|
+
ariaLabel: string;
|
|
346
|
+
};
|
|
347
|
+
}) => vue.VNodeChild) | undefined;
|
|
348
|
+
} | undefined;
|
|
299
349
|
} & {
|
|
300
350
|
"onUpdate:modelValue"?: ((val: any) => any) | undefined;
|
|
301
351
|
}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
@@ -439,6 +489,31 @@ declare const VCarousel: {
|
|
|
439
489
|
ariaLabel: string;
|
|
440
490
|
};
|
|
441
491
|
}) => vue.VNodeChild) | undefined;
|
|
492
|
+
} & {
|
|
493
|
+
$slots?: {
|
|
494
|
+
default?: ((args_0: {
|
|
495
|
+
group: GroupProvide;
|
|
496
|
+
}) => vue.VNodeChild) | undefined;
|
|
497
|
+
additional?: ((args_0: {
|
|
498
|
+
group: GroupProvide;
|
|
499
|
+
}) => vue.VNodeChild) | undefined;
|
|
500
|
+
prev?: ((args_0: {
|
|
501
|
+
props: {
|
|
502
|
+
icon: IconValue;
|
|
503
|
+
class: string;
|
|
504
|
+
onClick: () => void;
|
|
505
|
+
ariaLabel: string;
|
|
506
|
+
};
|
|
507
|
+
}) => vue.VNodeChild) | undefined;
|
|
508
|
+
next?: ((args_0: {
|
|
509
|
+
props: {
|
|
510
|
+
icon: IconValue;
|
|
511
|
+
class: string;
|
|
512
|
+
onClick: () => void;
|
|
513
|
+
ariaLabel: string;
|
|
514
|
+
};
|
|
515
|
+
}) => vue.VNodeChild) | undefined;
|
|
516
|
+
} | undefined;
|
|
442
517
|
} & {
|
|
443
518
|
"onUpdate:modelValue"?: ((val: any) => any) | undefined;
|
|
444
519
|
} & vue.ShallowUnwrapRef<{}> & {} & vue.ComponentCustomProperties & {};
|
|
@@ -545,6 +620,31 @@ declare const VCarousel: {
|
|
|
545
620
|
ariaLabel: string;
|
|
546
621
|
};
|
|
547
622
|
}) => vue.VNodeChild) | undefined;
|
|
623
|
+
} & {
|
|
624
|
+
$slots?: {
|
|
625
|
+
default?: ((args_0: {
|
|
626
|
+
group: GroupProvide;
|
|
627
|
+
}) => vue.VNodeChild) | undefined;
|
|
628
|
+
additional?: ((args_0: {
|
|
629
|
+
group: GroupProvide;
|
|
630
|
+
}) => vue.VNodeChild) | undefined;
|
|
631
|
+
prev?: ((args_0: {
|
|
632
|
+
props: {
|
|
633
|
+
icon: IconValue;
|
|
634
|
+
class: string;
|
|
635
|
+
onClick: () => void;
|
|
636
|
+
ariaLabel: string;
|
|
637
|
+
};
|
|
638
|
+
}) => vue.VNodeChild) | undefined;
|
|
639
|
+
next?: ((args_0: {
|
|
640
|
+
props: {
|
|
641
|
+
icon: IconValue;
|
|
642
|
+
class: string;
|
|
643
|
+
onClick: () => void;
|
|
644
|
+
ariaLabel: string;
|
|
645
|
+
};
|
|
646
|
+
}) => vue.VNodeChild) | undefined;
|
|
647
|
+
} | undefined;
|
|
548
648
|
} & {
|
|
549
649
|
"onUpdate:modelValue"?: ((val: any) => any) | undefined;
|
|
550
650
|
}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
@@ -769,6 +869,13 @@ declare const VCarouselItem: {
|
|
|
769
869
|
"v-slot:placeholder"?: false | (() => vue.VNodeChild) | undefined;
|
|
770
870
|
"v-slot:error"?: false | (() => vue.VNodeChild) | undefined;
|
|
771
871
|
"v-slot:sources"?: false | (() => vue.VNodeChild) | undefined;
|
|
872
|
+
} & {
|
|
873
|
+
$slots?: {
|
|
874
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
875
|
+
placeholder?: (() => vue.VNodeChild) | undefined;
|
|
876
|
+
error?: (() => vue.VNodeChild) | undefined;
|
|
877
|
+
sources?: (() => vue.VNodeChild) | undefined;
|
|
878
|
+
} | undefined;
|
|
772
879
|
} & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, "transition" | "style" | "eager" | "disabled" | "options" | "cover" | "src" | "reverseTransition">;
|
|
773
880
|
$attrs: {
|
|
774
881
|
[x: string]: unknown;
|
|
@@ -821,6 +928,13 @@ declare const VCarouselItem: {
|
|
|
821
928
|
"v-slot:placeholder"?: false | (() => vue.VNodeChild) | undefined;
|
|
822
929
|
"v-slot:error"?: false | (() => vue.VNodeChild) | undefined;
|
|
823
930
|
"v-slot:sources"?: false | (() => vue.VNodeChild) | undefined;
|
|
931
|
+
} & {
|
|
932
|
+
$slots?: {
|
|
933
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
934
|
+
placeholder?: (() => vue.VNodeChild) | undefined;
|
|
935
|
+
error?: (() => vue.VNodeChild) | undefined;
|
|
936
|
+
sources?: (() => vue.VNodeChild) | undefined;
|
|
937
|
+
} | undefined;
|
|
824
938
|
}, void, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, {
|
|
825
939
|
transition: string | boolean;
|
|
826
940
|
style: vue.StyleValue;
|
|
@@ -888,6 +1002,13 @@ declare const VCarouselItem: {
|
|
|
888
1002
|
"v-slot:placeholder"?: false | (() => vue.VNodeChild) | undefined;
|
|
889
1003
|
"v-slot:error"?: false | (() => vue.VNodeChild) | undefined;
|
|
890
1004
|
"v-slot:sources"?: false | (() => vue.VNodeChild) | undefined;
|
|
1005
|
+
} & {
|
|
1006
|
+
$slots?: {
|
|
1007
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
1008
|
+
placeholder?: (() => vue.VNodeChild) | undefined;
|
|
1009
|
+
error?: (() => vue.VNodeChild) | undefined;
|
|
1010
|
+
sources?: (() => vue.VNodeChild) | undefined;
|
|
1011
|
+
} | undefined;
|
|
891
1012
|
} & vue.ShallowUnwrapRef<{}> & {} & vue.ComponentCustomProperties & {};
|
|
892
1013
|
__isFragment?: undefined;
|
|
893
1014
|
__isTeleport?: undefined;
|
|
@@ -930,6 +1051,13 @@ declare const VCarouselItem: {
|
|
|
930
1051
|
"v-slot:placeholder"?: false | (() => vue.VNodeChild) | undefined;
|
|
931
1052
|
"v-slot:error"?: false | (() => vue.VNodeChild) | undefined;
|
|
932
1053
|
"v-slot:sources"?: false | (() => vue.VNodeChild) | undefined;
|
|
1054
|
+
} & {
|
|
1055
|
+
$slots?: {
|
|
1056
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
1057
|
+
placeholder?: (() => vue.VNodeChild) | undefined;
|
|
1058
|
+
error?: (() => vue.VNodeChild) | undefined;
|
|
1059
|
+
sources?: (() => vue.VNodeChild) | undefined;
|
|
1060
|
+
} | undefined;
|
|
933
1061
|
}, void, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, {
|
|
934
1062
|
transition: string | boolean;
|
|
935
1063
|
style: vue.StyleValue;
|
|
@@ -141,6 +141,18 @@ declare const VCheckbox: {
|
|
|
141
141
|
props: Record<string, unknown>;
|
|
142
142
|
}) => vue.VNodeChild) | undefined;
|
|
143
143
|
"v-slot:input"?: false | ((args_0: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
144
|
+
} & {
|
|
145
|
+
$slots?: {
|
|
146
|
+
default?: ((...args: never) => vue.VNodeChild) | undefined;
|
|
147
|
+
prepend?: ((args_0: VInputSlot) => vue.VNodeChild) | undefined;
|
|
148
|
+
append?: ((args_0: VInputSlot) => vue.VNodeChild) | undefined;
|
|
149
|
+
details?: ((args_0: VInputSlot) => vue.VNodeChild) | undefined;
|
|
150
|
+
label?: ((args_0: {
|
|
151
|
+
label: string | undefined;
|
|
152
|
+
props: Record<string, unknown>;
|
|
153
|
+
}) => vue.VNodeChild) | undefined;
|
|
154
|
+
input?: ((args_0: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
155
|
+
} | undefined;
|
|
144
156
|
} & {
|
|
145
157
|
"onUpdate:focused"?: ((focused: boolean) => any) | undefined;
|
|
146
158
|
} & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, "error" | "direction" | "style" | "disabled" | "multiple" | "readonly" | "indeterminate" | "messages" | "density" | "ripple" | "focused" | "errorMessages" | "maxErrors" | "rules" | "persistentHint" | "falseIcon" | "trueIcon" | "valueComparator" | "indeterminateIcon">;
|
|
@@ -232,6 +244,18 @@ declare const VCheckbox: {
|
|
|
232
244
|
props: Record<string, unknown>;
|
|
233
245
|
}) => vue.VNodeChild) | undefined;
|
|
234
246
|
"v-slot:input"?: false | ((args_0: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
247
|
+
} & {
|
|
248
|
+
$slots?: {
|
|
249
|
+
default?: ((...args: never) => vue.VNodeChild) | undefined;
|
|
250
|
+
prepend?: ((args_0: VInputSlot) => vue.VNodeChild) | undefined;
|
|
251
|
+
append?: ((args_0: VInputSlot) => vue.VNodeChild) | undefined;
|
|
252
|
+
details?: ((args_0: VInputSlot) => vue.VNodeChild) | undefined;
|
|
253
|
+
label?: ((args_0: {
|
|
254
|
+
label: string | undefined;
|
|
255
|
+
props: Record<string, unknown>;
|
|
256
|
+
}) => vue.VNodeChild) | undefined;
|
|
257
|
+
input?: ((args_0: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
258
|
+
} | undefined;
|
|
235
259
|
} & {
|
|
236
260
|
"onUpdate:focused"?: ((focused: boolean) => any) | undefined;
|
|
237
261
|
}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
@@ -351,6 +375,18 @@ declare const VCheckbox: {
|
|
|
351
375
|
props: Record<string, unknown>;
|
|
352
376
|
}) => vue.VNodeChild) | undefined;
|
|
353
377
|
"v-slot:input"?: false | ((args_0: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
378
|
+
} & {
|
|
379
|
+
$slots?: {
|
|
380
|
+
default?: ((...args: never) => vue.VNodeChild) | undefined;
|
|
381
|
+
prepend?: ((args_0: VInputSlot) => vue.VNodeChild) | undefined;
|
|
382
|
+
append?: ((args_0: VInputSlot) => vue.VNodeChild) | undefined;
|
|
383
|
+
details?: ((args_0: VInputSlot) => vue.VNodeChild) | undefined;
|
|
384
|
+
label?: ((args_0: {
|
|
385
|
+
label: string | undefined;
|
|
386
|
+
props: Record<string, unknown>;
|
|
387
|
+
}) => vue.VNodeChild) | undefined;
|
|
388
|
+
input?: ((args_0: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
389
|
+
} | undefined;
|
|
354
390
|
} & {
|
|
355
391
|
"onUpdate:focused"?: ((focused: boolean) => any) | undefined;
|
|
356
392
|
} & vue.ShallowUnwrapRef<{}> & {} & vue.ComponentCustomProperties & {};
|
|
@@ -432,6 +468,18 @@ declare const VCheckbox: {
|
|
|
432
468
|
props: Record<string, unknown>;
|
|
433
469
|
}) => vue.VNodeChild) | undefined;
|
|
434
470
|
"v-slot:input"?: false | ((args_0: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
471
|
+
} & {
|
|
472
|
+
$slots?: {
|
|
473
|
+
default?: ((...args: never) => vue.VNodeChild) | undefined;
|
|
474
|
+
prepend?: ((args_0: VInputSlot) => vue.VNodeChild) | undefined;
|
|
475
|
+
append?: ((args_0: VInputSlot) => vue.VNodeChild) | undefined;
|
|
476
|
+
details?: ((args_0: VInputSlot) => vue.VNodeChild) | undefined;
|
|
477
|
+
label?: ((args_0: {
|
|
478
|
+
label: string | undefined;
|
|
479
|
+
props: Record<string, unknown>;
|
|
480
|
+
}) => vue.VNodeChild) | undefined;
|
|
481
|
+
input?: ((args_0: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
482
|
+
} | undefined;
|
|
435
483
|
} & {
|
|
436
484
|
"onUpdate:focused"?: ((focused: boolean) => any) | undefined;
|
|
437
485
|
}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
@@ -692,6 +740,15 @@ declare const VCheckboxBtn: {
|
|
|
692
740
|
props: Record<string, unknown>;
|
|
693
741
|
}) => vue.VNodeChild) | undefined;
|
|
694
742
|
"v-slot:input"?: false | ((args_0: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
743
|
+
} & {
|
|
744
|
+
$slots?: {
|
|
745
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
746
|
+
label?: ((args_0: {
|
|
747
|
+
label: string | undefined;
|
|
748
|
+
props: Record<string, unknown>;
|
|
749
|
+
}) => vue.VNodeChild) | undefined;
|
|
750
|
+
input?: ((args_0: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
751
|
+
} | undefined;
|
|
695
752
|
} & {
|
|
696
753
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
697
754
|
"onUpdate:indeterminate"?: ((val: boolean) => any) | undefined;
|
|
@@ -760,6 +817,15 @@ declare const VCheckboxBtn: {
|
|
|
760
817
|
props: Record<string, unknown>;
|
|
761
818
|
}) => vue.VNodeChild) | undefined;
|
|
762
819
|
"v-slot:input"?: false | ((args_0: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
820
|
+
} & {
|
|
821
|
+
$slots?: {
|
|
822
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
823
|
+
label?: ((args_0: {
|
|
824
|
+
label: string | undefined;
|
|
825
|
+
props: Record<string, unknown>;
|
|
826
|
+
}) => vue.VNodeChild) | undefined;
|
|
827
|
+
input?: ((args_0: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
828
|
+
} | undefined;
|
|
763
829
|
} & {
|
|
764
830
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
765
831
|
"onUpdate:indeterminate"?: ((val: boolean) => any) | undefined;
|
|
@@ -851,6 +917,15 @@ declare const VCheckboxBtn: {
|
|
|
851
917
|
props: Record<string, unknown>;
|
|
852
918
|
}) => vue.VNodeChild) | undefined;
|
|
853
919
|
"v-slot:input"?: false | ((args_0: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
920
|
+
} & {
|
|
921
|
+
$slots?: {
|
|
922
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
923
|
+
label?: ((args_0: {
|
|
924
|
+
label: string | undefined;
|
|
925
|
+
props: Record<string, unknown>;
|
|
926
|
+
}) => vue.VNodeChild) | undefined;
|
|
927
|
+
input?: ((args_0: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
928
|
+
} | undefined;
|
|
854
929
|
} & {
|
|
855
930
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
856
931
|
"onUpdate:indeterminate"?: ((val: boolean) => any) | undefined;
|
|
@@ -909,6 +984,15 @@ declare const VCheckboxBtn: {
|
|
|
909
984
|
props: Record<string, unknown>;
|
|
910
985
|
}) => vue.VNodeChild) | undefined;
|
|
911
986
|
"v-slot:input"?: false | ((args_0: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
987
|
+
} & {
|
|
988
|
+
$slots?: {
|
|
989
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
990
|
+
label?: ((args_0: {
|
|
991
|
+
label: string | undefined;
|
|
992
|
+
props: Record<string, unknown>;
|
|
993
|
+
}) => vue.VNodeChild) | undefined;
|
|
994
|
+
input?: ((args_0: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
995
|
+
} | undefined;
|
|
912
996
|
} & {
|
|
913
997
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
914
998
|
"onUpdate:indeterminate"?: ((val: boolean) => any) | undefined;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
align-items: center;
|
|
3
3
|
cursor: default;
|
|
4
4
|
display: inline-flex;
|
|
5
|
-
flex: 1 0;
|
|
6
5
|
font-weight: 400;
|
|
7
6
|
max-width: 100%;
|
|
8
7
|
min-width: 0;
|
|
@@ -351,10 +350,12 @@
|
|
|
351
350
|
border-radius: 4px;
|
|
352
351
|
}
|
|
353
352
|
|
|
353
|
+
.v-chip__content {
|
|
354
|
+
align-items: center;
|
|
355
|
+
display: inline-flex;
|
|
356
|
+
}
|
|
354
357
|
.v-autocomplete__selection .v-chip__content, .v-combobox__selection .v-chip__content, .v-select__selection .v-chip__content {
|
|
355
358
|
overflow: hidden;
|
|
356
|
-
text-overflow: ellipsis;
|
|
357
|
-
white-space: nowrap;
|
|
358
359
|
}
|
|
359
360
|
|
|
360
361
|
.v-chip__filter,
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
align-items: center
|
|
7
7
|
cursor: default
|
|
8
8
|
display: inline-flex
|
|
9
|
-
flex: 1 0
|
|
10
9
|
font-weight: $chip-font-weight
|
|
11
10
|
max-width: $chip-max-width
|
|
12
11
|
min-width: 0
|
|
@@ -39,12 +38,13 @@
|
|
|
39
38
|
|
|
40
39
|
// Elements
|
|
41
40
|
.v-chip__content
|
|
41
|
+
align-items: center
|
|
42
|
+
display: inline-flex
|
|
43
|
+
|
|
42
44
|
.v-autocomplete__selection &,
|
|
43
45
|
.v-combobox__selection &,
|
|
44
46
|
.v-select__selection &
|
|
45
47
|
overflow: hidden
|
|
46
|
-
text-overflow: ellipsis
|
|
47
|
-
white-space: nowrap
|
|
48
48
|
|
|
49
49
|
.v-chip__filter,
|
|
50
50
|
.v-chip__prepend,
|
|
@@ -97,6 +97,13 @@ declare const VChip: {
|
|
|
97
97
|
"v-slot:label"?: false | (() => vue.VNodeChild) | undefined;
|
|
98
98
|
"v-slot:prepend"?: false | (() => vue.VNodeChild) | undefined;
|
|
99
99
|
"v-slot:append"?: false | (() => vue.VNodeChild) | undefined;
|
|
100
|
+
} & {
|
|
101
|
+
$slots?: {
|
|
102
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
103
|
+
label?: (() => vue.VNodeChild) | undefined;
|
|
104
|
+
prepend?: (() => vue.VNodeChild) | undefined;
|
|
105
|
+
append?: (() => vue.VNodeChild) | undefined;
|
|
106
|
+
} | undefined;
|
|
100
107
|
} & {
|
|
101
108
|
onClick?: ((e: MouseEvent | KeyboardEvent) => any) | undefined;
|
|
102
109
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
@@ -177,6 +184,13 @@ declare const VChip: {
|
|
|
177
184
|
"v-slot:label"?: false | (() => vue.VNodeChild) | undefined;
|
|
178
185
|
"v-slot:prepend"?: false | (() => vue.VNodeChild) | undefined;
|
|
179
186
|
"v-slot:append"?: false | (() => vue.VNodeChild) | undefined;
|
|
187
|
+
} & {
|
|
188
|
+
$slots?: {
|
|
189
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
190
|
+
label?: (() => vue.VNodeChild) | undefined;
|
|
191
|
+
prepend?: (() => vue.VNodeChild) | undefined;
|
|
192
|
+
append?: (() => vue.VNodeChild) | undefined;
|
|
193
|
+
} | undefined;
|
|
180
194
|
} & {
|
|
181
195
|
onClick?: ((e: MouseEvent | KeyboardEvent) => any) | undefined;
|
|
182
196
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
@@ -289,6 +303,13 @@ declare const VChip: {
|
|
|
289
303
|
"v-slot:label"?: false | (() => vue.VNodeChild) | undefined;
|
|
290
304
|
"v-slot:prepend"?: false | (() => vue.VNodeChild) | undefined;
|
|
291
305
|
"v-slot:append"?: false | (() => vue.VNodeChild) | undefined;
|
|
306
|
+
} & {
|
|
307
|
+
$slots?: {
|
|
308
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
309
|
+
label?: (() => vue.VNodeChild) | undefined;
|
|
310
|
+
prepend?: (() => vue.VNodeChild) | undefined;
|
|
311
|
+
append?: (() => vue.VNodeChild) | undefined;
|
|
312
|
+
} | undefined;
|
|
292
313
|
} & {
|
|
293
314
|
onClick?: ((e: MouseEvent | KeyboardEvent) => any) | undefined;
|
|
294
315
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
@@ -357,6 +378,13 @@ declare const VChip: {
|
|
|
357
378
|
"v-slot:label"?: false | (() => vue.VNodeChild) | undefined;
|
|
358
379
|
"v-slot:prepend"?: false | (() => vue.VNodeChild) | undefined;
|
|
359
380
|
"v-slot:append"?: false | (() => vue.VNodeChild) | undefined;
|
|
381
|
+
} & {
|
|
382
|
+
$slots?: {
|
|
383
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
384
|
+
label?: (() => vue.VNodeChild) | undefined;
|
|
385
|
+
prepend?: (() => vue.VNodeChild) | undefined;
|
|
386
|
+
append?: (() => vue.VNodeChild) | undefined;
|
|
387
|
+
} | undefined;
|
|
360
388
|
} & {
|
|
361
389
|
onClick?: ((e: MouseEvent | KeyboardEvent) => any) | undefined;
|
|
362
390
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
@@ -48,6 +48,10 @@ declare const VChipGroup: {
|
|
|
48
48
|
} | undefined;
|
|
49
49
|
} & {
|
|
50
50
|
"v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
|
|
51
|
+
} & {
|
|
52
|
+
$slots?: {
|
|
53
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
54
|
+
} | undefined;
|
|
51
55
|
} & {
|
|
52
56
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
53
57
|
} & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, "filter" | "style" | "disabled" | "multiple" | "tag" | "column" | "variant" | "modelValue" | "selectedClass" | "valueComparator">;
|
|
@@ -90,6 +94,10 @@ declare const VChipGroup: {
|
|
|
90
94
|
} | undefined;
|
|
91
95
|
} & {
|
|
92
96
|
"v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
|
|
97
|
+
} & {
|
|
98
|
+
$slots?: {
|
|
99
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
100
|
+
} | undefined;
|
|
93
101
|
} & {
|
|
94
102
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
95
103
|
}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
@@ -151,6 +159,10 @@ declare const VChipGroup: {
|
|
|
151
159
|
} | undefined;
|
|
152
160
|
} & {
|
|
153
161
|
"v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
|
|
162
|
+
} & {
|
|
163
|
+
$slots?: {
|
|
164
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
165
|
+
} | undefined;
|
|
154
166
|
} & {
|
|
155
167
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
156
168
|
} & vue.ShallowUnwrapRef<{}> & {} & vue.ComponentCustomProperties & {};
|
|
@@ -183,6 +195,10 @@ declare const VChipGroup: {
|
|
|
183
195
|
} | undefined;
|
|
184
196
|
} & {
|
|
185
197
|
"v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
|
|
198
|
+
} & {
|
|
199
|
+
$slots?: {
|
|
200
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
201
|
+
} | undefined;
|
|
186
202
|
} & {
|
|
187
203
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
188
204
|
}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
@@ -26,6 +26,10 @@ declare const VCode: {
|
|
|
26
26
|
} | undefined;
|
|
27
27
|
} & {
|
|
28
28
|
"v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
|
|
29
|
+
} & {
|
|
30
|
+
$slots?: {
|
|
31
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
32
|
+
} | undefined;
|
|
29
33
|
} & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, "style" | "tag">;
|
|
30
34
|
$attrs: {
|
|
31
35
|
[x: string]: unknown;
|
|
@@ -54,6 +58,10 @@ declare const VCode: {
|
|
|
54
58
|
} | undefined;
|
|
55
59
|
} & {
|
|
56
60
|
"v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
|
|
61
|
+
} & {
|
|
62
|
+
$slots?: {
|
|
63
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
64
|
+
} | undefined;
|
|
57
65
|
}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
58
66
|
[key: string]: any;
|
|
59
67
|
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, {
|
|
@@ -93,6 +101,10 @@ declare const VCode: {
|
|
|
93
101
|
} | undefined;
|
|
94
102
|
} & {
|
|
95
103
|
"v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
|
|
104
|
+
} & {
|
|
105
|
+
$slots?: {
|
|
106
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
107
|
+
} | undefined;
|
|
96
108
|
} & vue.ShallowUnwrapRef<() => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
97
109
|
[key: string]: any;
|
|
98
110
|
}>> & {} & vue.ComponentCustomProperties & {};
|
|
@@ -113,6 +125,10 @@ declare const VCode: {
|
|
|
113
125
|
} | undefined;
|
|
114
126
|
} & {
|
|
115
127
|
"v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
|
|
128
|
+
} & {
|
|
129
|
+
$slots?: {
|
|
130
|
+
default?: (() => vue.VNodeChild) | undefined;
|
|
131
|
+
} | undefined;
|
|
116
132
|
}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
117
133
|
[key: string]: any;
|
|
118
134
|
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, {
|
|
@@ -6,7 +6,7 @@ import "./VColorPickerCanvas.css";
|
|
|
6
6
|
import { makeComponentProps } from "../../composables/component.mjs";
|
|
7
7
|
import { useResizeObserver } from "../../composables/resizeObserver.mjs"; // Utilities
|
|
8
8
|
import { clamp, convertToUnit, defineComponent, getEventCoordinates, propsFactory, useRender } from "../../util/index.mjs";
|
|
9
|
-
import { computed, onMounted, ref, watch } from 'vue';
|
|
9
|
+
import { computed, onMounted, ref, shallowRef, watch } from 'vue';
|
|
10
10
|
|
|
11
11
|
// Types
|
|
12
12
|
|
|
@@ -40,8 +40,8 @@ export const VColorPickerCanvas = defineComponent({
|
|
|
40
40
|
let {
|
|
41
41
|
emit
|
|
42
42
|
} = _ref;
|
|
43
|
-
const isInteracting =
|
|
44
|
-
const isOutsideUpdate =
|
|
43
|
+
const isInteracting = shallowRef(false);
|
|
44
|
+
const isOutsideUpdate = shallowRef(false);
|
|
45
45
|
const dotPosition = ref({
|
|
46
46
|
x: 0,
|
|
47
47
|
y: 0
|
|
@@ -59,8 +59,8 @@ export const VColorPickerCanvas = defineComponent({
|
|
|
59
59
|
};
|
|
60
60
|
});
|
|
61
61
|
const canvasRef = ref();
|
|
62
|
-
const canvasWidth =
|
|
63
|
-
const canvasHeight =
|
|
62
|
+
const canvasWidth = shallowRef(parseFloat(props.width));
|
|
63
|
+
const canvasHeight = shallowRef(parseFloat(props.height));
|
|
64
64
|
const {
|
|
65
65
|
resizeRef
|
|
66
66
|
} = useResizeObserver(entries => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VColorPickerCanvas.mjs","names":["makeComponentProps","useResizeObserver","clamp","convertToUnit","defineComponent","getEventCoordinates","propsFactory","useRender","computed","onMounted","ref","watch","makeVColorPickerCanvasProps","color","type","Object","disabled","Boolean","dotSize","Number","String","default","height","width","VColorPickerCanvas","name","props","emits","hue","setup","_ref","emit","isInteracting","isOutsideUpdate","dotPosition","x","y","dotStyles","value","radius","parseInt","transform","canvasRef","canvasWidth","parseFloat","canvasHeight","resizeRef","entries","offsetParent","contentRect","updateDotPosition","rect","left","top","handleClick","e","clientX","clientY","getBoundingClientRect","handleMouseDown","preventDefault","window","addEventListener","handleMouseMove","handleMouseUp","coords","removeEventListener","h","s","v","a","updateCanvas","canvas","ctx","getContext","saturationGradient","createLinearGradient","addColorStop","fillStyle","fillRect","valueGradient","immediate","newVal","oldVal","flush","deep","_createVNode","class","style"],"sources":["../../../src/components/VColorPicker/VColorPickerCanvas.tsx"],"sourcesContent":["// Styles\nimport './VColorPickerCanvas.sass'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { useResizeObserver } from '@/composables/resizeObserver'\n\n// Utilities\nimport { clamp, convertToUnit, defineComponent, getEventCoordinates, propsFactory, useRender } from '@/util'\nimport { computed, onMounted, ref, watch } from 'vue'\n\n// Types\nimport type { HSV } from '@/util'\nimport type { PropType } from 'vue'\n\nexport const makeVColorPickerCanvasProps = propsFactory({\n color: {\n type: Object as PropType<HSV | null>,\n },\n disabled: Boolean,\n dotSize: {\n type: [Number, String],\n default: 10,\n },\n height: {\n type: [Number, String],\n default: 150,\n },\n width: {\n type: [Number, String],\n default: 300,\n },\n\n ...makeComponentProps(),\n}, 'v-color-picker-canvas')\n\nexport const VColorPickerCanvas = defineComponent({\n name: 'VColorPickerCanvas',\n\n props: makeVColorPickerCanvasProps(),\n\n emits: {\n 'update:color': (color: HSV) => true,\n 'update:position': (hue: any) => true,\n },\n\n setup (props, { emit }) {\n const isInteracting = ref(false)\n const isOutsideUpdate = ref(false)\n const dotPosition = ref({ x: 0, y: 0 })\n\n const dotStyles = computed(() => {\n const { x, y } = dotPosition.value\n const radius = parseInt(props.dotSize, 10) / 2\n\n return {\n width: convertToUnit(props.dotSize),\n height: convertToUnit(props.dotSize),\n transform: `translate(${convertToUnit(x - radius)}, ${convertToUnit(y - radius)})`,\n }\n })\n\n const canvasRef = ref<HTMLCanvasElement | null>()\n const canvasWidth = ref(parseFloat(props.width))\n const canvasHeight = ref(parseFloat(props.height))\n const { resizeRef } = useResizeObserver(entries => {\n if (!resizeRef.value?.offsetParent) return\n\n const { width, height } = entries[0].contentRect\n\n canvasWidth.value = width\n canvasHeight.value = height\n })\n\n function updateDotPosition (x: number, y: number, rect: DOMRect) {\n const { left, top, width, height } = rect\n dotPosition.value = {\n x: clamp(x - left, 0, width),\n y: clamp(y - top, 0, height),\n }\n }\n\n function handleClick (e: MouseEvent) {\n if (props.disabled || !canvasRef.value) return\n\n updateDotPosition(e.clientX, e.clientY, canvasRef.value.getBoundingClientRect())\n }\n\n function handleMouseDown (e: MouseEvent | TouchEvent) {\n // To prevent selection while moving cursor\n e.preventDefault()\n\n if (props.disabled) return\n\n isInteracting.value = true\n\n window.addEventListener('mousemove', handleMouseMove)\n window.addEventListener('mouseup', handleMouseUp)\n window.addEventListener('touchmove', handleMouseMove)\n window.addEventListener('touchend', handleMouseUp)\n }\n\n function handleMouseMove (e: MouseEvent | TouchEvent) {\n if (props.disabled || !canvasRef.value) return\n\n isInteracting.value = true\n\n const coords = getEventCoordinates(e)\n\n updateDotPosition(coords.clientX, coords.clientY, canvasRef.value.getBoundingClientRect())\n }\n\n function handleMouseUp () {\n window.removeEventListener('mousemove', handleMouseMove)\n window.removeEventListener('mouseup', handleMouseUp)\n window.removeEventListener('touchmove', handleMouseMove)\n window.removeEventListener('touchend', handleMouseUp)\n }\n\n watch(dotPosition, () => {\n if (isOutsideUpdate.value) {\n isOutsideUpdate.value = false\n return\n }\n\n if (!canvasRef.value) return\n\n const { x, y } = dotPosition.value\n\n emit('update:color', {\n h: props.color?.h ?? 0,\n s: clamp(x, 0, canvasWidth.value) / canvasWidth.value,\n v: 1 - clamp(y, 0, canvasHeight.value) / canvasHeight.value,\n a: props.color?.a ?? 1,\n })\n })\n\n function updateCanvas () {\n if (!canvasRef.value) return\n\n const canvas = canvasRef.value\n const ctx = canvas.getContext('2d')\n\n if (!ctx) return\n\n const saturationGradient = ctx.createLinearGradient(0, 0, canvas.width, 0)\n saturationGradient.addColorStop(0, 'hsla(0, 0%, 100%, 1)') // white\n saturationGradient.addColorStop(1, `hsla(${props.color?.h ?? 0}, 100%, 50%, 1)`)\n ctx.fillStyle = saturationGradient\n ctx.fillRect(0, 0, canvas.width, canvas.height)\n\n const valueGradient = ctx.createLinearGradient(0, 0, 0, canvas.height)\n valueGradient.addColorStop(0, 'hsla(0, 0%, 100%, 0)') // transparent\n valueGradient.addColorStop(1, 'hsla(0, 0%, 0%, 1)') // black\n ctx.fillStyle = valueGradient\n ctx.fillRect(0, 0, canvas.width, canvas.height)\n }\n\n watch(() => props.color?.h, updateCanvas, { immediate: true })\n watch(() => [canvasWidth.value, canvasHeight.value], (newVal, oldVal) => {\n updateCanvas()\n dotPosition.value = {\n x: dotPosition.value.x * newVal[0] / oldVal[0],\n y: dotPosition.value.y * newVal[1] / oldVal[1],\n }\n }, { flush: 'post' })\n\n watch(() => props.color, () => {\n if (isInteracting.value) {\n isInteracting.value = false\n return\n }\n\n isOutsideUpdate.value = true\n\n dotPosition.value = props.color ? {\n x: props.color.s * canvasWidth.value,\n y: (1 - props.color.v) * canvasHeight.value,\n } : { x: 0, y: 0 }\n }, { deep: true, immediate: true })\n\n onMounted(() => updateCanvas())\n\n useRender(() => (\n <div\n ref={ resizeRef }\n class={[\n 'v-color-picker-canvas',\n props.class,\n ]}\n style={ props.style }\n onClick={ handleClick }\n onMousedown={ handleMouseDown }\n onTouchstart={ handleMouseDown }\n >\n <canvas\n ref={ canvasRef }\n width={ canvasWidth.value }\n height={ canvasHeight.value }\n />\n { props.color && (\n <div\n class={[\n 'v-color-picker-canvas__dot',\n {\n 'v-color-picker-canvas__dot--disabled': props.disabled,\n },\n ]}\n style={ dotStyles.value }\n />\n )}\n </div>\n ))\n\n return {}\n },\n})\n\nexport type VColorPickerCanvas = InstanceType<typeof VColorPickerCanvas>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,kBAAkB;AAAA,SAClBC,iBAAiB,gDAE1B;AAAA,SACSC,KAAK,EAAEC,aAAa,EAAEC,eAAe,EAAEC,mBAAmB,EAAEC,YAAY,EAAEC,SAAS;AAC5F,SAASC,QAAQ,EAAEC,SAAS,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;;AAErD;;AAIA,OAAO,MAAMC,2BAA2B,GAAGN,YAAY,CAAC;EACtDO,KAAK,EAAE;IACLC,IAAI,EAAEC;EACR,CAAC;EACDC,QAAQ,EAAEC,OAAO;EACjBC,OAAO,EAAE;IACPJ,IAAI,EAAE,CAACK,MAAM,EAAEC,MAAM,CAAC;IACtBC,OAAO,EAAE;EACX,CAAC;EACDC,MAAM,EAAE;IACNR,IAAI,EAAE,CAACK,MAAM,EAAEC,MAAM,CAAC;IACtBC,OAAO,EAAE;EACX,CAAC;EACDE,KAAK,EAAE;IACLT,IAAI,EAAE,CAACK,MAAM,EAAEC,MAAM,CAAC;IACtBC,OAAO,EAAE;EACX,CAAC;EAED,GAAGrB,kBAAkB;AACvB,CAAC,EAAE,uBAAuB,CAAC;AAE3B,OAAO,MAAMwB,kBAAkB,GAAGpB,eAAe,CAAC;EAChDqB,IAAI,EAAE,oBAAoB;EAE1BC,KAAK,EAAEd,2BAA2B,EAAE;EAEpCe,KAAK,EAAE;IACL,cAAc,EAAGd,KAAU,IAAK,IAAI;IACpC,iBAAiB,EAAGe,GAAQ,IAAK;EACnC,CAAC;EAEDC,KAAKA,CAAEH,KAAK,EAAAI,IAAA,EAAY;IAAA,IAAV;MAAEC;IAAK,CAAC,GAAAD,IAAA;IACpB,MAAME,aAAa,GAAGtB,GAAG,CAAC,KAAK,CAAC;IACh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AAA,SACOqB,SAAS,CAACC;IAAK,QAE1B,EAEJ,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"VColorPickerCanvas.mjs","names":["makeComponentProps","useResizeObserver","clamp","convertToUnit","defineComponent","getEventCoordinates","propsFactory","useRender","computed","onMounted","ref","shallowRef","watch","makeVColorPickerCanvasProps","color","type","Object","disabled","Boolean","dotSize","Number","String","default","height","width","VColorPickerCanvas","name","props","emits","hue","setup","_ref","emit","isInteracting","isOutsideUpdate","dotPosition","x","y","dotStyles","value","radius","parseInt","transform","canvasRef","canvasWidth","parseFloat","canvasHeight","resizeRef","entries","offsetParent","contentRect","updateDotPosition","rect","left","top","handleClick","e","clientX","clientY","getBoundingClientRect","handleMouseDown","preventDefault","window","addEventListener","handleMouseMove","handleMouseUp","coords","removeEventListener","h","s","v","a","updateCanvas","canvas","ctx","getContext","saturationGradient","createLinearGradient","addColorStop","fillStyle","fillRect","valueGradient","immediate","newVal","oldVal","flush","deep","_createVNode","class","style"],"sources":["../../../src/components/VColorPicker/VColorPickerCanvas.tsx"],"sourcesContent":["// Styles\nimport './VColorPickerCanvas.sass'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { useResizeObserver } from '@/composables/resizeObserver'\n\n// Utilities\nimport { clamp, convertToUnit, defineComponent, getEventCoordinates, propsFactory, useRender } from '@/util'\nimport { computed, onMounted, ref, shallowRef, watch } from 'vue'\n\n// Types\nimport type { HSV } from '@/util'\nimport type { PropType } from 'vue'\n\nexport const makeVColorPickerCanvasProps = propsFactory({\n color: {\n type: Object as PropType<HSV | null>,\n },\n disabled: Boolean,\n dotSize: {\n type: [Number, String],\n default: 10,\n },\n height: {\n type: [Number, String],\n default: 150,\n },\n width: {\n type: [Number, String],\n default: 300,\n },\n\n ...makeComponentProps(),\n}, 'v-color-picker-canvas')\n\nexport const VColorPickerCanvas = defineComponent({\n name: 'VColorPickerCanvas',\n\n props: makeVColorPickerCanvasProps(),\n\n emits: {\n 'update:color': (color: HSV) => true,\n 'update:position': (hue: any) => true,\n },\n\n setup (props, { emit }) {\n const isInteracting = shallowRef(false)\n const isOutsideUpdate = shallowRef(false)\n const dotPosition = ref({ x: 0, y: 0 })\n\n const dotStyles = computed(() => {\n const { x, y } = dotPosition.value\n const radius = parseInt(props.dotSize, 10) / 2\n\n return {\n width: convertToUnit(props.dotSize),\n height: convertToUnit(props.dotSize),\n transform: `translate(${convertToUnit(x - radius)}, ${convertToUnit(y - radius)})`,\n }\n })\n\n const canvasRef = ref<HTMLCanvasElement | null>()\n const canvasWidth = shallowRef(parseFloat(props.width))\n const canvasHeight = shallowRef(parseFloat(props.height))\n const { resizeRef } = useResizeObserver(entries => {\n if (!resizeRef.value?.offsetParent) return\n\n const { width, height } = entries[0].contentRect\n\n canvasWidth.value = width\n canvasHeight.value = height\n })\n\n function updateDotPosition (x: number, y: number, rect: DOMRect) {\n const { left, top, width, height } = rect\n dotPosition.value = {\n x: clamp(x - left, 0, width),\n y: clamp(y - top, 0, height),\n }\n }\n\n function handleClick (e: MouseEvent) {\n if (props.disabled || !canvasRef.value) return\n\n updateDotPosition(e.clientX, e.clientY, canvasRef.value.getBoundingClientRect())\n }\n\n function handleMouseDown (e: MouseEvent | TouchEvent) {\n // To prevent selection while moving cursor\n e.preventDefault()\n\n if (props.disabled) return\n\n isInteracting.value = true\n\n window.addEventListener('mousemove', handleMouseMove)\n window.addEventListener('mouseup', handleMouseUp)\n window.addEventListener('touchmove', handleMouseMove)\n window.addEventListener('touchend', handleMouseUp)\n }\n\n function handleMouseMove (e: MouseEvent | TouchEvent) {\n if (props.disabled || !canvasRef.value) return\n\n isInteracting.value = true\n\n const coords = getEventCoordinates(e)\n\n updateDotPosition(coords.clientX, coords.clientY, canvasRef.value.getBoundingClientRect())\n }\n\n function handleMouseUp () {\n window.removeEventListener('mousemove', handleMouseMove)\n window.removeEventListener('mouseup', handleMouseUp)\n window.removeEventListener('touchmove', handleMouseMove)\n window.removeEventListener('touchend', handleMouseUp)\n }\n\n watch(dotPosition, () => {\n if (isOutsideUpdate.value) {\n isOutsideUpdate.value = false\n return\n }\n\n if (!canvasRef.value) return\n\n const { x, y } = dotPosition.value\n\n emit('update:color', {\n h: props.color?.h ?? 0,\n s: clamp(x, 0, canvasWidth.value) / canvasWidth.value,\n v: 1 - clamp(y, 0, canvasHeight.value) / canvasHeight.value,\n a: props.color?.a ?? 1,\n })\n })\n\n function updateCanvas () {\n if (!canvasRef.value) return\n\n const canvas = canvasRef.value\n const ctx = canvas.getContext('2d')\n\n if (!ctx) return\n\n const saturationGradient = ctx.createLinearGradient(0, 0, canvas.width, 0)\n saturationGradient.addColorStop(0, 'hsla(0, 0%, 100%, 1)') // white\n saturationGradient.addColorStop(1, `hsla(${props.color?.h ?? 0}, 100%, 50%, 1)`)\n ctx.fillStyle = saturationGradient\n ctx.fillRect(0, 0, canvas.width, canvas.height)\n\n const valueGradient = ctx.createLinearGradient(0, 0, 0, canvas.height)\n valueGradient.addColorStop(0, 'hsla(0, 0%, 100%, 0)') // transparent\n valueGradient.addColorStop(1, 'hsla(0, 0%, 0%, 1)') // black\n ctx.fillStyle = valueGradient\n ctx.fillRect(0, 0, canvas.width, canvas.height)\n }\n\n watch(() => props.color?.h, updateCanvas, { immediate: true })\n watch(() => [canvasWidth.value, canvasHeight.value], (newVal, oldVal) => {\n updateCanvas()\n dotPosition.value = {\n x: dotPosition.value.x * newVal[0] / oldVal[0],\n y: dotPosition.value.y * newVal[1] / oldVal[1],\n }\n }, { flush: 'post' })\n\n watch(() => props.color, () => {\n if (isInteracting.value) {\n isInteracting.value = false\n return\n }\n\n isOutsideUpdate.value = true\n\n dotPosition.value = props.color ? {\n x: props.color.s * canvasWidth.value,\n y: (1 - props.color.v) * canvasHeight.value,\n } : { x: 0, y: 0 }\n }, { deep: true, immediate: true })\n\n onMounted(() => updateCanvas())\n\n useRender(() => (\n <div\n ref={ resizeRef }\n class={[\n 'v-color-picker-canvas',\n props.class,\n ]}\n style={ props.style }\n onClick={ handleClick }\n onMousedown={ handleMouseDown }\n onTouchstart={ handleMouseDown }\n >\n <canvas\n ref={ canvasRef }\n width={ canvasWidth.value }\n height={ canvasHeight.value }\n />\n { props.color && (\n <div\n class={[\n 'v-color-picker-canvas__dot',\n {\n 'v-color-picker-canvas__dot--disabled': props.disabled,\n },\n ]}\n style={ dotStyles.value }\n />\n )}\n </div>\n ))\n\n return {}\n },\n})\n\nexport type VColorPickerCanvas = InstanceType<typeof VColorPickerCanvas>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,kBAAkB;AAAA,SAClBC,iBAAiB,gDAE1B;AAAA,SACSC,KAAK,EAAEC,aAAa,EAAEC,eAAe,EAAEC,mBAAmB,EAAEC,YAAY,EAAEC,SAAS;AAC5F,SAASC,QAAQ,EAAEC,SAAS,EAAEC,GAAG,EAAEC,UAAU,EAAEC,KAAK,QAAQ,KAAK;;AAEjE;;AAIA,OAAO,MAAMC,2BAA2B,GAAGP,YAAY,CAAC;EACtDQ,KAAK,EAAE;IACLC,IAAI,EAAEC;EACR,CAAC;EACDC,QAAQ,EAAEC,OAAO;EACjBC,OAAO,EAAE;IACPJ,IAAI,EAAE,CAACK,MAAM,EAAEC,MAAM,CAAC;IACtBC,OAAO,EAAE;EACX,CAAC;EACDC,MAAM,EAAE;IACNR,IAAI,EAAE,CAACK,MAAM,EAAEC,MAAM,CAAC;IACtBC,OAAO,EAAE;EACX,CAAC;EACDE,KAAK,EAAE;IACLT,IAAI,EAAE,CAACK,MAAM,EAAEC,MAAM,CAAC;IACtBC,OAAO,EAAE;EACX,CAAC;EAED,GAAGtB,kBAAkB;AACvB,CAAC,EAAE,uBAAuB,CAAC;AAE3B,OAAO,MAAMyB,kBAAkB,GAAGrB,eAAe,CAAC;EAChDsB,IAAI,EAAE,oBAAoB;EAE1BC,KAAK,EAAEd,2BAA2B,EAAE;EAEpCe,KAAK,EAAE;IACL,cAAc,EAAGd,KAAU,IAAK,IAAI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SAAS;MAAA,SACPC,WAAW,CAACL,KAAK;MAAA,UAChBO,YAAY,CAACP;IAAK,UAE3BZ,KAAK,CAACb,KAAK,IAAAyE,YAAA;MAAA,SAEF,CACL,4BAA4B,EAC5B;QACE,sCAAsC,EAAE5D,KAAK,CAACV;MAChD,CAAC,CACF;MAAA,SACOqB,SAAS,CAACC;IAAK,QAE1B,EAEJ,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC"}
|
|
@@ -19,7 +19,7 @@ import { useForm } from "../../composables/form.mjs";
|
|
|
19
19
|
import { useLocale } from "../../composables/locale.mjs";
|
|
20
20
|
import { useProxiedModel } from "../../composables/proxiedModel.mjs";
|
|
21
21
|
import { useTextColor } from "../../composables/color.mjs"; // Utility
|
|
22
|
-
import { computed, mergeProps, nextTick, ref, watch } from 'vue';
|
|
22
|
+
import { computed, mergeProps, nextTick, ref, shallowRef, watch } from 'vue';
|
|
23
23
|
import { genericComponent, omit, propsFactory, useRender, wrapInArray } from "../../util/index.mjs";
|
|
24
24
|
import { makeVTextFieldProps } from "../VTextField/VTextField.mjs"; // Types
|
|
25
25
|
function highlightResult(text, matches, length) {
|
|
@@ -69,8 +69,8 @@ export const VCombobox = genericComponent()({
|
|
|
69
69
|
t
|
|
70
70
|
} = useLocale();
|
|
71
71
|
const vTextFieldRef = ref();
|
|
72
|
-
const isFocused =
|
|
73
|
-
const isPristine =
|
|
72
|
+
const isFocused = shallowRef(false);
|
|
73
|
+
const isPristine = shallowRef(true);
|
|
74
74
|
const vMenuRef = ref();
|
|
75
75
|
const _menu = useProxiedModel(props, 'menu');
|
|
76
76
|
const menu = computed({
|
|
@@ -80,7 +80,7 @@ export const VCombobox = genericComponent()({
|
|
|
80
80
|
_menu.value = v;
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
|
-
const selectionIndex =
|
|
83
|
+
const selectionIndex = shallowRef(-1);
|
|
84
84
|
let cleared = false;
|
|
85
85
|
const color = computed(() => vTextFieldRef.value?.color);
|
|
86
86
|
const {
|
|
@@ -97,7 +97,7 @@ export const VCombobox = genericComponent()({
|
|
|
97
97
|
return props.multiple ? transformed : transformed[0] ?? null;
|
|
98
98
|
});
|
|
99
99
|
const form = useForm();
|
|
100
|
-
const _search =
|
|
100
|
+
const _search = shallowRef(!props.multiple ? model.value[0]?.title ?? '' : '');
|
|
101
101
|
const search = computed({
|
|
102
102
|
get: () => {
|
|
103
103
|
return _search.value;
|