vuetify 3.3.13 → 3.4.0-alpha.0
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 +107 -11
- package/dist/json/importMap.json +16 -16
- package/dist/json/tags.json +24 -0
- package/dist/json/web-types.json +305 -38
- package/dist/vuetify-labs.css +1483 -408
- package/dist/vuetify-labs.d.ts +711 -241
- package/dist/vuetify-labs.esm.js +279 -134
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +278 -133
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +1370 -295
- package/dist/vuetify.d.ts +699 -235
- package/dist/vuetify.esm.js +279 -134
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +278 -133
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +912 -897
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VAutocomplete/index.d.mts +20 -14
- package/lib/components/VAvatar/VAvatar.mjs +2 -1
- package/lib/components/VAvatar/VAvatar.mjs.map +1 -1
- package/lib/components/VAvatar/index.d.mts +6 -0
- package/lib/components/VBanner/VBanner.mjs +5 -3
- package/lib/components/VBanner/VBanner.mjs.map +1 -1
- package/lib/components/VBanner/index.d.mts +10 -0
- package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs +9 -4
- package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs.map +1 -1
- package/lib/components/VBreadcrumbs/index.d.mts +28 -2
- package/lib/components/VCarousel/index.d.mts +26 -0
- package/lib/components/VCheckbox/VCheckbox.mjs +2 -2
- package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
- package/lib/components/VCheckbox/VCheckboxBtn.mjs +14 -11
- package/lib/components/VCheckbox/VCheckboxBtn.mjs.map +1 -1
- package/lib/components/VCheckbox/index.d.mts +12 -0
- package/lib/components/VColorPicker/VColorPickerEdit.css +4 -2
- package/lib/components/VColorPicker/VColorPickerPreview.css +16 -6
- package/lib/components/VColorPicker/VColorPickerPreview.mjs +28 -2
- package/lib/components/VColorPicker/VColorPickerPreview.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerPreview.sass +4 -0
- package/lib/components/VColorPicker/_variables.scss +1 -0
- package/lib/components/VCombobox/index.d.mts +20 -14
- package/lib/components/VDialog/index.d.mts +41 -20
- package/lib/components/VField/VField.css +10 -6
- package/lib/components/VField/index.d.mts +4 -4
- package/lib/components/VFileInput/index.d.mts +4 -4
- package/lib/components/VGrid/VGrid.css +153 -142
- package/lib/components/VImg/VImg.mjs +13 -1
- package/lib/components/VImg/VImg.mjs.map +1 -1
- package/lib/components/VImg/index.d.mts +26 -0
- package/lib/components/VList/index.d.mts +12 -12
- package/lib/components/VMenu/index.d.mts +41 -20
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs +5 -3
- package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs.map +1 -1
- package/lib/components/VNavigationDrawer/index.d.mts +10 -0
- package/lib/components/VOverlay/VOverlay.mjs +9 -4
- package/lib/components/VOverlay/VOverlay.mjs.map +1 -1
- package/lib/components/VOverlay/index.d.mts +17 -8
- package/lib/components/VOverlay/locationStrategies.mjs +9 -9
- package/lib/components/VOverlay/locationStrategies.mjs.map +1 -1
- package/lib/components/VOverlay/scrollStrategies.mjs +3 -3
- package/lib/components/VOverlay/scrollStrategies.mjs.map +1 -1
- package/lib/components/VOverlay/useActivator.mjs +50 -21
- package/lib/components/VOverlay/useActivator.mjs.map +1 -1
- package/lib/components/VProgressLinear/VProgressLinear.css +3 -2
- package/lib/components/VRadio/index.d.mts +6 -0
- package/lib/components/VRadioGroup/VRadioGroup.mjs +2 -2
- package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
- package/lib/components/VRangeSlider/VRangeSlider.mjs +4 -2
- package/lib/components/VRangeSlider/VRangeSlider.mjs.map +1 -1
- package/lib/components/VRangeSlider/index.d.mts +128 -33
- package/lib/components/VSelect/index.d.mts +20 -14
- package/lib/components/VSelectionControl/VSelectionControl.mjs +5 -2
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
- package/lib/components/VSelectionControl/index.d.mts +6 -0
- package/lib/components/VSlideGroup/VSlideGroup.mjs +5 -3
- package/lib/components/VSlideGroup/VSlideGroup.mjs.map +1 -1
- package/lib/components/VSlideGroup/index.d.mts +10 -0
- package/lib/components/VSlider/VSlider.mjs +2 -1
- package/lib/components/VSlider/VSlider.mjs.map +1 -1
- package/lib/components/VSlider/VSliderThumb.css +8 -4
- package/lib/components/VSlider/VSliderTrack.css +22 -12
- package/lib/components/VSlider/index.d.mts +128 -33
- package/lib/components/VSlider/slider.mjs +5 -1
- package/lib/components/VSlider/slider.mjs.map +1 -1
- package/lib/components/VSnackbar/index.d.mts +41 -20
- package/lib/components/VSwitch/VSwitch.mjs +9 -9
- package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
- package/lib/components/VSwitch/index.d.mts +6 -0
- package/lib/components/VTabs/index.d.mts +10 -0
- package/lib/components/VTextField/index.d.mts +16 -16
- package/lib/components/VTextarea/index.d.mts +4 -4
- package/lib/components/VTimeline/VTimeline.css +15 -10
- package/lib/components/VToolbar/VToolbar.css +4 -2
- package/lib/components/VTooltip/index.d.mts +41 -20
- package/lib/components/index.d.mts +667 -230
- package/lib/components/transitions/dialog-transition.mjs +4 -3
- package/lib/components/transitions/dialog-transition.mjs.map +1 -1
- package/lib/components/transitions/index.d.mts +6 -6
- package/lib/composables/defaults.mjs +9 -9
- package/lib/composables/defaults.mjs.map +1 -1
- package/lib/composables/directiveComponent.mjs +69 -0
- package/lib/composables/directiveComponent.mjs.map +1 -0
- package/lib/composables/display.mjs +23 -3
- package/lib/composables/display.mjs.map +1 -1
- package/lib/composables/theme.mjs +7 -7
- package/lib/composables/theme.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/entry-bundler.mjs.map +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/framework.mjs.map +1 -1
- package/lib/iconsets/fa.mjs +2 -1
- package/lib/iconsets/fa.mjs.map +1 -1
- package/lib/iconsets/fa4.mjs +2 -1
- package/lib/iconsets/fa4.mjs.map +1 -1
- package/lib/iconsets/md.mjs +2 -1
- package/lib/iconsets/md.mjs.map +1 -1
- package/lib/iconsets/mdi-svg.mjs +2 -1
- package/lib/iconsets/mdi-svg.mjs.map +1 -1
- package/lib/iconsets/mdi.mjs +2 -1
- package/lib/iconsets/mdi.mjs.map +1 -1
- package/lib/index.d.mts +36 -5
- package/lib/labs/VBottomSheet/index.d.mts +14 -8
- package/lib/labs/VDateInput/index.d.mts +4 -4
- package/lib/labs/VDatePicker/VDatePickerControls.css +1 -1
- package/lib/labs/VOtpInput/index.d.mts +4 -4
- package/lib/labs/components.d.mts +18 -12
- package/lib/styles/main.css +1026 -0
- package/lib/styles/settings/_utilities.scss +20 -0
- package/lib/styles/tools/_rtl.sass +4 -2
- package/lib/util/box.mjs +12 -0
- package/lib/util/box.mjs.map +1 -1
- package/lib/util/globals.mjs +1 -0
- package/lib/util/globals.mjs.map +1 -1
- package/lib/util/helpers.mjs +19 -5
- package/lib/util/helpers.mjs.map +1 -1
- package/lib/util/injectSelf.mjs +2 -1
- package/lib/util/injectSelf.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -964,6 +964,7 @@ declare const VCarouselItem: {
|
|
|
964
964
|
inline?: boolean | undefined;
|
|
965
965
|
transition?: string | boolean | undefined;
|
|
966
966
|
style?: vue.StyleValue | undefined;
|
|
967
|
+
draggable?: boolean | "false" | "true" | undefined;
|
|
967
968
|
eager?: boolean | undefined;
|
|
968
969
|
disabled?: boolean | undefined;
|
|
969
970
|
options?: IntersectionObserverInit | undefined;
|
|
@@ -986,7 +987,9 @@ declare const VCarouselItem: {
|
|
|
986
987
|
error?: (() => vue.VNodeChild) | undefined;
|
|
987
988
|
sources?: (() => vue.VNodeChild) | undefined;
|
|
988
989
|
};
|
|
990
|
+
referrerpolicy?: "origin" | "same-origin" | "no-referrer" | "no-referrer-when-downgrade" | "origin-when-cross-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url" | undefined;
|
|
989
991
|
alt?: string | undefined;
|
|
992
|
+
crossorigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
990
993
|
sizes?: string | undefined;
|
|
991
994
|
srcset?: string | undefined;
|
|
992
995
|
ref?: vue.VNodeRef | undefined;
|
|
@@ -1087,8 +1090,11 @@ declare const VCarouselItem: {
|
|
|
1087
1090
|
minWidth?: string | number | undefined;
|
|
1088
1091
|
transition?: string | boolean | undefined;
|
|
1089
1092
|
value?: any;
|
|
1093
|
+
draggable?: boolean | "false" | "true" | undefined;
|
|
1090
1094
|
class?: any;
|
|
1095
|
+
referrerpolicy?: "origin" | "same-origin" | "no-referrer" | "no-referrer-when-downgrade" | "origin-when-cross-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url" | undefined;
|
|
1091
1096
|
alt?: string | undefined;
|
|
1097
|
+
crossorigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
1092
1098
|
sizes?: string | undefined;
|
|
1093
1099
|
srcset?: string | undefined;
|
|
1094
1100
|
contentClass?: string | undefined;
|
|
@@ -1118,6 +1124,7 @@ declare const VCarouselItem: {
|
|
|
1118
1124
|
inline: boolean;
|
|
1119
1125
|
transition: string | boolean;
|
|
1120
1126
|
style: vue.StyleValue;
|
|
1127
|
+
draggable: boolean | "false" | "true";
|
|
1121
1128
|
eager: boolean;
|
|
1122
1129
|
disabled: boolean;
|
|
1123
1130
|
options: IntersectionObserverInit;
|
|
@@ -1175,8 +1182,11 @@ declare const VCarouselItem: {
|
|
|
1175
1182
|
minWidth?: string | number | undefined;
|
|
1176
1183
|
transition?: string | boolean | undefined;
|
|
1177
1184
|
value?: any;
|
|
1185
|
+
draggable?: boolean | "false" | "true" | undefined;
|
|
1178
1186
|
class?: any;
|
|
1187
|
+
referrerpolicy?: "origin" | "same-origin" | "no-referrer" | "no-referrer-when-downgrade" | "origin-when-cross-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url" | undefined;
|
|
1179
1188
|
alt?: string | undefined;
|
|
1189
|
+
crossorigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
1180
1190
|
sizes?: string | undefined;
|
|
1181
1191
|
srcset?: string | undefined;
|
|
1182
1192
|
contentClass?: string | undefined;
|
|
@@ -1224,8 +1234,11 @@ declare const VCarouselItem: {
|
|
|
1224
1234
|
minWidth?: string | number | undefined;
|
|
1225
1235
|
transition?: string | boolean | undefined;
|
|
1226
1236
|
value?: any;
|
|
1237
|
+
draggable?: boolean | "false" | "true" | undefined;
|
|
1227
1238
|
class?: any;
|
|
1239
|
+
referrerpolicy?: "origin" | "same-origin" | "no-referrer" | "no-referrer-when-downgrade" | "origin-when-cross-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url" | undefined;
|
|
1228
1240
|
alt?: string | undefined;
|
|
1241
|
+
crossorigin?: "" | "anonymous" | "use-credentials" | undefined;
|
|
1229
1242
|
sizes?: string | undefined;
|
|
1230
1243
|
srcset?: string | undefined;
|
|
1231
1244
|
contentClass?: string | undefined;
|
|
@@ -1255,6 +1268,7 @@ declare const VCarouselItem: {
|
|
|
1255
1268
|
inline: boolean;
|
|
1256
1269
|
transition: string | boolean;
|
|
1257
1270
|
style: vue.StyleValue;
|
|
1271
|
+
draggable: boolean | "false" | "true";
|
|
1258
1272
|
eager: boolean;
|
|
1259
1273
|
disabled: boolean;
|
|
1260
1274
|
options: IntersectionObserverInit;
|
|
@@ -1303,6 +1317,10 @@ declare const VCarouselItem: {
|
|
|
1303
1317
|
inline: BooleanConstructor;
|
|
1304
1318
|
alt: StringConstructor;
|
|
1305
1319
|
cover: BooleanConstructor;
|
|
1320
|
+
draggable: {
|
|
1321
|
+
type: vue.PropType<boolean | "false" | "true">;
|
|
1322
|
+
default: undefined;
|
|
1323
|
+
};
|
|
1306
1324
|
gradient: StringConstructor;
|
|
1307
1325
|
lazySrc: StringConstructor;
|
|
1308
1326
|
options: {
|
|
@@ -1318,6 +1336,8 @@ declare const VCarouselItem: {
|
|
|
1318
1336
|
type: vue.PropType<string | srcObject>;
|
|
1319
1337
|
default: string;
|
|
1320
1338
|
};
|
|
1339
|
+
crossorigin: vue.PropType<"" | "anonymous" | "use-credentials">;
|
|
1340
|
+
referrerpolicy: vue.PropType<"origin" | "same-origin" | "no-referrer" | "no-referrer-when-downgrade" | "origin-when-cross-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url">;
|
|
1321
1341
|
srcset: StringConstructor;
|
|
1322
1342
|
}, vue.ExtractPropTypes<{
|
|
1323
1343
|
eager: BooleanConstructor;
|
|
@@ -1348,6 +1368,10 @@ declare const VCarouselItem: {
|
|
|
1348
1368
|
inline: BooleanConstructor;
|
|
1349
1369
|
alt: StringConstructor;
|
|
1350
1370
|
cover: BooleanConstructor;
|
|
1371
|
+
draggable: {
|
|
1372
|
+
type: vue.PropType<boolean | "false" | "true">;
|
|
1373
|
+
default: undefined;
|
|
1374
|
+
};
|
|
1351
1375
|
gradient: StringConstructor;
|
|
1352
1376
|
lazySrc: StringConstructor;
|
|
1353
1377
|
options: {
|
|
@@ -1363,6 +1387,8 @@ declare const VCarouselItem: {
|
|
|
1363
1387
|
type: vue.PropType<string | srcObject>;
|
|
1364
1388
|
default: string;
|
|
1365
1389
|
};
|
|
1390
|
+
crossorigin: vue.PropType<"" | "anonymous" | "use-credentials">;
|
|
1391
|
+
referrerpolicy: vue.PropType<"origin" | "same-origin" | "no-referrer" | "no-referrer-when-downgrade" | "origin-when-cross-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url">;
|
|
1366
1392
|
srcset: StringConstructor;
|
|
1367
1393
|
}>>;
|
|
1368
1394
|
type VCarouselItem = InstanceType<typeof VCarouselItem>;
|
|
@@ -35,12 +35,12 @@ export const VCheckbox = genericComponent()({
|
|
|
35
35
|
const uid = getUid();
|
|
36
36
|
const id = computed(() => props.id || `checkbox-${uid}`);
|
|
37
37
|
useRender(() => {
|
|
38
|
-
const [
|
|
38
|
+
const [rootAttrs, controlAttrs] = filterInputAttrs(attrs);
|
|
39
39
|
const [inputProps, _1] = VInput.filterProps(props);
|
|
40
40
|
const [checkboxProps, _2] = VCheckboxBtn.filterProps(props);
|
|
41
41
|
return _createVNode(VInput, _mergeProps({
|
|
42
42
|
"class": ['v-checkbox', props.class]
|
|
43
|
-
},
|
|
43
|
+
}, rootAttrs, inputProps, {
|
|
44
44
|
"modelValue": model.value,
|
|
45
45
|
"onUpdate:modelValue": $event => model.value = $event,
|
|
46
46
|
"id": id.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VCheckbox.mjs","names":["makeVCheckboxBtnProps","VCheckboxBtn","makeVInputProps","VInput","useFocus","useProxiedModel","computed","filterInputAttrs","genericComponent","getUid","omit","propsFactory","useRender","makeVCheckboxProps","VCheckbox","name","inheritAttrs","props","emits","value","focused","setup","_ref","attrs","slots","model","isFocused","focus","blur","uid","id","
|
|
1
|
+
{"version":3,"file":"VCheckbox.mjs","names":["makeVCheckboxBtnProps","VCheckboxBtn","makeVInputProps","VInput","useFocus","useProxiedModel","computed","filterInputAttrs","genericComponent","getUid","omit","propsFactory","useRender","makeVCheckboxProps","VCheckbox","name","inheritAttrs","props","emits","value","focused","setup","_ref","attrs","slots","model","isFocused","focus","blur","uid","id","rootAttrs","controlAttrs","inputProps","_1","filterProps","checkboxProps","_2","_createVNode","_mergeProps","class","$event","style","default","_ref2","messagesId","isDisabled","isReadonly"],"sources":["../../../src/components/VCheckbox/VCheckbox.tsx"],"sourcesContent":["// Styles\nimport './VCheckbox.sass'\n\n// Components\nimport { makeVCheckboxBtnProps, VCheckboxBtn } from './VCheckboxBtn'\nimport { makeVInputProps, VInput } from '@/components/VInput/VInput'\n\n// Composables\nimport { useFocus } from '@/composables/focus'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed } from 'vue'\nimport { filterInputAttrs, genericComponent, getUid, omit, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { VSelectionControlSlots } from '../VSelectionControl/VSelectionControl'\nimport type { VInputSlots } from '@/components/VInput/VInput'\n\nexport type VCheckboxSlots = VInputSlots & VSelectionControlSlots\n\nexport const makeVCheckboxProps = propsFactory({\n ...makeVInputProps(),\n ...omit(makeVCheckboxBtnProps(), ['inline']),\n}, 'VCheckbox')\n\nexport const VCheckbox = genericComponent<VCheckboxSlots>()({\n name: 'VCheckbox',\n\n inheritAttrs: false,\n\n props: makeVCheckboxProps(),\n\n emits: {\n 'update:modelValue': (value: boolean) => true,\n 'update:focused': (focused: boolean) => true,\n },\n\n setup (props, { attrs, slots }) {\n const model = useProxiedModel(props, 'modelValue')\n const { isFocused, focus, blur } = useFocus(props)\n\n const uid = getUid()\n const id = computed(() => props.id || `checkbox-${uid}`)\n\n useRender(() => {\n const [rootAttrs, controlAttrs] = filterInputAttrs(attrs)\n const [inputProps, _1] = VInput.filterProps(props)\n const [checkboxProps, _2] = VCheckboxBtn.filterProps(props)\n\n return (\n <VInput\n class={[\n 'v-checkbox',\n props.class,\n ]}\n { ...rootAttrs }\n { ...inputProps }\n v-model={ model.value }\n id={ id.value }\n focused={ isFocused.value }\n style={ props.style }\n >\n {{\n ...slots,\n default: ({\n id,\n messagesId,\n isDisabled,\n isReadonly,\n }) => (\n <VCheckboxBtn\n { ...checkboxProps }\n id={ id.value }\n aria-describedby={ messagesId.value }\n disabled={ isDisabled.value }\n readonly={ isReadonly.value }\n { ...controlAttrs }\n v-model={ model.value }\n onFocus={ focus }\n onBlur={ blur }\n v-slots={ slots }\n />\n ),\n }}\n </VInput>\n )\n })\n\n return {}\n },\n})\n\nexport type VCheckbox = InstanceType<typeof VCheckbox>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,qBAAqB,EAAEC,YAAY;AAAA,SACnCC,eAAe,EAAEC,MAAM,gCAEhC;AAAA,SACSC,QAAQ;AAAA,SACRC,eAAe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AAClB,KAAK,CAAC;MAE3D,OAAAqB,YAAA,CAAAnC,MAAA,EAAAoC,WAAA;QAAA,SAEW,CACL,YAAY,EACZtB,KAAK,CAACuB,KAAK;MACZ,GACIT,SAAS,EACTE,UAAU;QAAA,cACLR,KAAK,CAACN,KAAK;QAAA,uBAAAsB,MAAA,IAAXhB,KAAK,CAACN,KAAK,GAAAsB,MAAA;QAAA,MAChBX,EAAE,CAACX,KAAK;QAAA,WACHO,SAAS,CAACP,KAAK;QAAA,SACjBF,KAAK,CAACyB;MAAK;QAGjB,GAAGlB,KAAK;QACRmB,OAAO,EAAEC,KAAA;UAAA,IAAC;YACRd,EAAE;YACFe,UAAU;YACVC,UAAU;YACVC;UACF,CAAC,GAAAH,KAAA;UAAA,OAAAN,YAAA,CAAArC,YAAA,EAAAsC,WAAA,CAEQH,aAAa;YAAA,MACbN,EAAE,CAACX,KAAK;YAAA,oBACM0B,UAAU,CAAC1B,KAAK;YAAA,YACxB2B,UAAU,CAAC3B,KAAK;YAAA,YAChB4B,UAAU,CAAC5B;UAAK,GACtBa,YAAY;YAAA,cACPP,KAAK,CAACN,KAAK;YAAA,uBAAAsB,MAAA,IAAXhB,KAAK,CAACN,KAAK,GAAAsB,MAAA;YAAA,WACXd,KAAK;YAAA,UACNC;UAAI,IACHJ,KAAK;QAAA;MAElB;IAIT,CAAC,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { makeVSelectionControlProps, VSelectionControl } from "../VSelectionCont
|
|
|
4
4
|
import { IconValue } from "../../composables/icons.mjs";
|
|
5
5
|
import { useProxiedModel } from "../../composables/proxiedModel.mjs"; // Utilities
|
|
6
6
|
import { computed } from 'vue';
|
|
7
|
-
import { genericComponent, propsFactory, useRender } from "../../util/index.mjs"; // Types
|
|
7
|
+
import { genericComponent, omit, propsFactory, useRender } from "../../util/index.mjs"; // Types
|
|
8
8
|
export const makeVCheckboxBtnProps = propsFactory({
|
|
9
9
|
indeterminate: Boolean,
|
|
10
10
|
indeterminateIcon: {
|
|
@@ -40,16 +40,19 @@ export const VCheckboxBtn = genericComponent()({
|
|
|
40
40
|
const trueIcon = computed(() => {
|
|
41
41
|
return indeterminate.value ? props.indeterminateIcon : props.trueIcon;
|
|
42
42
|
});
|
|
43
|
-
useRender(() =>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
useRender(() => {
|
|
44
|
+
const controlProps = omit(VSelectionControl.filterProps(props)[0], ['modelValue']);
|
|
45
|
+
return _createVNode(VSelectionControl, _mergeProps(controlProps, {
|
|
46
|
+
"modelValue": model.value,
|
|
47
|
+
"onUpdate:modelValue": [$event => model.value = $event, onChange],
|
|
48
|
+
"class": ['v-checkbox-btn', props.class],
|
|
49
|
+
"style": props.style,
|
|
50
|
+
"type": "checkbox",
|
|
51
|
+
"falseIcon": falseIcon.value,
|
|
52
|
+
"trueIcon": trueIcon.value,
|
|
53
|
+
"aria-checked": indeterminate.value ? 'mixed' : undefined
|
|
54
|
+
}), slots);
|
|
55
|
+
});
|
|
53
56
|
return {};
|
|
54
57
|
}
|
|
55
58
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VCheckboxBtn.mjs","names":["makeVSelectionControlProps","VSelectionControl","IconValue","useProxiedModel","computed","genericComponent","propsFactory","useRender","makeVCheckboxBtnProps","indeterminate","Boolean","indeterminateIcon","type","default","falseIcon","trueIcon","VCheckboxBtn","name","props","emits","value","val","setup","_ref","slots","model","onChange","v","_createVNode","_mergeProps","$event","class","style","undefined"],"sources":["../../../src/components/VCheckbox/VCheckboxBtn.tsx"],"sourcesContent":["// Components\nimport { makeVSelectionControlProps, VSelectionControl } from '@/components/VSelectionControl/VSelectionControl'\n\n// Composables\nimport { IconValue } from '@/composables/icons'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed } from 'vue'\nimport { genericComponent, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { VSelectionControlSlots } from '@/components/VSelectionControl/VSelectionControl'\n\nexport const makeVCheckboxBtnProps = propsFactory({\n indeterminate: Boolean,\n indeterminateIcon: {\n type: IconValue,\n default: '$checkboxIndeterminate',\n },\n\n ...makeVSelectionControlProps({\n falseIcon: '$checkboxOff',\n trueIcon: '$checkboxOn',\n }),\n}, 'VCheckboxBtn')\n\nexport const VCheckboxBtn = genericComponent<VSelectionControlSlots>()({\n name: 'VCheckboxBtn',\n\n props: makeVCheckboxBtnProps(),\n\n emits: {\n 'update:modelValue': (value: any) => true,\n 'update:indeterminate': (val: boolean) => true,\n },\n\n setup (props, { slots }) {\n const indeterminate = useProxiedModel(props, 'indeterminate')\n const model = useProxiedModel(props, 'modelValue')\n\n function onChange (v: any) {\n if (indeterminate.value) {\n indeterminate.value = false\n }\n }\n\n const falseIcon = computed(() => {\n return indeterminate.value\n ? props.indeterminateIcon\n : props.falseIcon\n })\n\n const trueIcon = computed(() => {\n return indeterminate.value\n ? props.indeterminateIcon\n : props.trueIcon\n })\n\n useRender(() => (\n <VSelectionControl\n
|
|
1
|
+
{"version":3,"file":"VCheckboxBtn.mjs","names":["makeVSelectionControlProps","VSelectionControl","IconValue","useProxiedModel","computed","genericComponent","omit","propsFactory","useRender","makeVCheckboxBtnProps","indeterminate","Boolean","indeterminateIcon","type","default","falseIcon","trueIcon","VCheckboxBtn","name","props","emits","value","val","setup","_ref","slots","model","onChange","v","controlProps","filterProps","_createVNode","_mergeProps","$event","class","style","undefined"],"sources":["../../../src/components/VCheckbox/VCheckboxBtn.tsx"],"sourcesContent":["// Components\nimport { makeVSelectionControlProps, VSelectionControl } from '@/components/VSelectionControl/VSelectionControl'\n\n// Composables\nimport { IconValue } from '@/composables/icons'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed } from 'vue'\nimport { genericComponent, omit, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { VSelectionControlSlots } from '@/components/VSelectionControl/VSelectionControl'\n\nexport const makeVCheckboxBtnProps = propsFactory({\n indeterminate: Boolean,\n indeterminateIcon: {\n type: IconValue,\n default: '$checkboxIndeterminate',\n },\n\n ...makeVSelectionControlProps({\n falseIcon: '$checkboxOff',\n trueIcon: '$checkboxOn',\n }),\n}, 'VCheckboxBtn')\n\nexport const VCheckboxBtn = genericComponent<VSelectionControlSlots>()({\n name: 'VCheckboxBtn',\n\n props: makeVCheckboxBtnProps(),\n\n emits: {\n 'update:modelValue': (value: any) => true,\n 'update:indeterminate': (val: boolean) => true,\n },\n\n setup (props, { slots }) {\n const indeterminate = useProxiedModel(props, 'indeterminate')\n const model = useProxiedModel(props, 'modelValue')\n\n function onChange (v: any) {\n if (indeterminate.value) {\n indeterminate.value = false\n }\n }\n\n const falseIcon = computed(() => {\n return indeterminate.value\n ? props.indeterminateIcon\n : props.falseIcon\n })\n\n const trueIcon = computed(() => {\n return indeterminate.value\n ? props.indeterminateIcon\n : props.trueIcon\n })\n\n useRender(() => {\n const controlProps = omit(VSelectionControl.filterProps(props)[0], ['modelValue'])\n return (\n <VSelectionControl\n { ...controlProps }\n v-model={ model.value }\n class={[\n 'v-checkbox-btn',\n props.class,\n ]}\n style={ props.style }\n type=\"checkbox\"\n onUpdate:modelValue={ onChange }\n falseIcon={ falseIcon.value }\n trueIcon={ trueIcon.value }\n aria-checked={ indeterminate.value ? 'mixed' : undefined }\n v-slots={ slots }\n />\n )\n })\n\n return {}\n },\n})\n\nexport type VCheckboxBtn = InstanceType<typeof VCheckboxBtn>\n"],"mappings":";AAAA;AAAA,SACSA,0BAA0B,EAAEC,iBAAiB,sDAEtD;AAAA,SACSC,SAAS;AAAA,SACTC,eAAe,8CAExB;AACA,SAASC,QAAQ,QAAQ,KAAK;AAAA,SACrBC,gBAAgB,EAAEC,IAAI,EAAEC,YAAY,EAAEC,SAAS,gCAExD;AAGA,OAAO,MAAMC,qBAAqB,GAAGF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AAE,CAAC,YAAY,CAAC,CAAC;MAClF,OAAAY,YAAA,CAAA9B,iBAAA,EAAA+B,WAAA,CAESH,YAAY;QAAA,cACPH,KAAK,CAACL,KAAK;QAAA,wBAAAY,MAAA,IAAXP,KAAK,CAACL,KAAK,GAAAY,MAAA,EAOCN,QAAQ;QAAA,SANzB,CACL,gBAAgB,EAChBR,KAAK,CAACe,KAAK,CACZ;QAAA,SACOf,KAAK,CAACgB,KAAK;QAAA,QACZ,UAAU;QAAA,aAEHpB,SAAS,CAACM,KAAK;QAAA,YAChBL,QAAQ,CAACK,KAAK;QAAA,gBACZX,aAAa,CAACW,KAAK,GAAG,OAAO,GAAGe;MAAS,IAC5CX,KAAK;IAGrB,CAAC,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC"}
|
|
@@ -155,6 +155,7 @@ declare const VCheckbox: {
|
|
|
155
155
|
prependIcon?: IconValue | undefined;
|
|
156
156
|
appendIcon?: IconValue | undefined;
|
|
157
157
|
defaultsTarget?: string | undefined;
|
|
158
|
+
baseColor?: string | undefined;
|
|
158
159
|
trueValue?: any;
|
|
159
160
|
falseValue?: any;
|
|
160
161
|
"v-slot:input"?: false | ((arg: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
@@ -242,6 +243,7 @@ declare const VCheckbox: {
|
|
|
242
243
|
prependIcon?: IconValue | undefined;
|
|
243
244
|
appendIcon?: IconValue | undefined;
|
|
244
245
|
defaultsTarget?: string | undefined;
|
|
246
|
+
baseColor?: string | undefined;
|
|
245
247
|
trueValue?: any;
|
|
246
248
|
falseValue?: any;
|
|
247
249
|
'onClick:append'?: EventProp<[MouseEvent], (args_0: MouseEvent) => any> | undefined;
|
|
@@ -393,6 +395,7 @@ declare const VCheckbox: {
|
|
|
393
395
|
prependIcon?: IconValue | undefined;
|
|
394
396
|
appendIcon?: IconValue | undefined;
|
|
395
397
|
defaultsTarget?: string | undefined;
|
|
398
|
+
baseColor?: string | undefined;
|
|
396
399
|
trueValue?: any;
|
|
397
400
|
falseValue?: any;
|
|
398
401
|
'onClick:append'?: EventProp<[MouseEvent], (args_0: MouseEvent) => any> | undefined;
|
|
@@ -479,6 +482,7 @@ declare const VCheckbox: {
|
|
|
479
482
|
prependIcon?: IconValue | undefined;
|
|
480
483
|
appendIcon?: IconValue | undefined;
|
|
481
484
|
defaultsTarget?: string | undefined;
|
|
485
|
+
baseColor?: string | undefined;
|
|
482
486
|
trueValue?: any;
|
|
483
487
|
falseValue?: any;
|
|
484
488
|
'onClick:append'?: EventProp<[MouseEvent], (args_0: MouseEvent) => any> | undefined;
|
|
@@ -623,6 +627,7 @@ declare const VCheckbox: {
|
|
|
623
627
|
type: vue.PropType<typeof deepEqual>;
|
|
624
628
|
default: typeof deepEqual;
|
|
625
629
|
};
|
|
630
|
+
baseColor: StringConstructor;
|
|
626
631
|
trueValue: null;
|
|
627
632
|
falseValue: null;
|
|
628
633
|
indeterminateIcon: {
|
|
@@ -712,6 +717,7 @@ declare const VCheckbox: {
|
|
|
712
717
|
type: vue.PropType<typeof deepEqual>;
|
|
713
718
|
default: typeof deepEqual;
|
|
714
719
|
};
|
|
720
|
+
baseColor: StringConstructor;
|
|
715
721
|
trueValue: null;
|
|
716
722
|
falseValue: null;
|
|
717
723
|
indeterminateIcon: {
|
|
@@ -845,6 +851,7 @@ declare const VCheckboxBtn: {
|
|
|
845
851
|
modelValue?: any;
|
|
846
852
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
847
853
|
defaultsTarget?: string | undefined;
|
|
854
|
+
baseColor?: string | undefined;
|
|
848
855
|
trueValue?: any;
|
|
849
856
|
falseValue?: any;
|
|
850
857
|
"v-slot:input"?: false | ((arg: SelectionControlSlot) => vue.VNodeChild) | undefined;
|
|
@@ -903,6 +910,7 @@ declare const VCheckboxBtn: {
|
|
|
903
910
|
theme?: string | undefined;
|
|
904
911
|
modelValue?: any;
|
|
905
912
|
defaultsTarget?: string | undefined;
|
|
913
|
+
baseColor?: string | undefined;
|
|
906
914
|
trueValue?: any;
|
|
907
915
|
falseValue?: any;
|
|
908
916
|
} & {
|
|
@@ -1007,6 +1015,7 @@ declare const VCheckboxBtn: {
|
|
|
1007
1015
|
theme?: string | undefined;
|
|
1008
1016
|
modelValue?: any;
|
|
1009
1017
|
defaultsTarget?: string | undefined;
|
|
1018
|
+
baseColor?: string | undefined;
|
|
1010
1019
|
trueValue?: any;
|
|
1011
1020
|
falseValue?: any;
|
|
1012
1021
|
} & {
|
|
@@ -1065,6 +1074,7 @@ declare const VCheckboxBtn: {
|
|
|
1065
1074
|
theme?: string | undefined;
|
|
1066
1075
|
modelValue?: any;
|
|
1067
1076
|
defaultsTarget?: string | undefined;
|
|
1077
|
+
baseColor?: string | undefined;
|
|
1068
1078
|
trueValue?: any;
|
|
1069
1079
|
falseValue?: any;
|
|
1070
1080
|
} & {
|
|
@@ -1170,6 +1180,7 @@ declare const VCheckboxBtn: {
|
|
|
1170
1180
|
default: typeof deepEqual;
|
|
1171
1181
|
};
|
|
1172
1182
|
label: StringConstructor;
|
|
1183
|
+
baseColor: StringConstructor;
|
|
1173
1184
|
trueValue: null;
|
|
1174
1185
|
falseValue: null;
|
|
1175
1186
|
value: null;
|
|
@@ -1224,6 +1235,7 @@ declare const VCheckboxBtn: {
|
|
|
1224
1235
|
default: typeof deepEqual;
|
|
1225
1236
|
};
|
|
1226
1237
|
label: StringConstructor;
|
|
1238
|
+
baseColor: StringConstructor;
|
|
1227
1239
|
trueValue: null;
|
|
1228
1240
|
falseValue: null;
|
|
1229
1241
|
value: null;
|
|
@@ -10,12 +10,14 @@
|
|
|
10
10
|
justify-content: center;
|
|
11
11
|
text-align: center;
|
|
12
12
|
}
|
|
13
|
-
.v-color-picker-edit__input:not(:last-child)
|
|
13
|
+
.v-locale--is-ltr.v-color-picker-edit__input:not(:last-child), .v-locale--is-ltr .v-color-picker-edit__input:not(:last-child) {
|
|
14
14
|
margin-right: 8px;
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
.v-locale--is-rtl.v-color-picker-edit__input:not(:last-child), .v-locale--is-rtl .v-color-picker-edit__input:not(:last-child) {
|
|
17
18
|
margin-left: 8px;
|
|
18
19
|
}
|
|
20
|
+
|
|
19
21
|
.v-color-picker-edit__input input {
|
|
20
22
|
border-radius: 4px;
|
|
21
23
|
margin-bottom: 8px;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
.v-color-picker-preview__alpha .v-slider-track__background {
|
|
2
2
|
background-color: transparent !important;
|
|
3
3
|
}
|
|
4
|
-
.v-color-picker-preview__alpha .v-slider-track__background
|
|
4
|
+
.v-locale--is-ltr.v-color-picker-preview__alpha .v-slider-track__background, .v-locale--is-ltr .v-color-picker-preview__alpha .v-slider-track__background {
|
|
5
5
|
background-image: linear-gradient(to right, transparent, var(--v-color-picker-color-hsv));
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
.v-locale--is-rtl.v-color-picker-preview__alpha .v-slider-track__background, .v-locale--is-rtl .v-color-picker-preview__alpha .v-slider-track__background {
|
|
8
9
|
background-image: linear-gradient(to left, transparent, var(--v-color-picker-color-hsv));
|
|
9
10
|
}
|
|
11
|
+
|
|
10
12
|
.v-color-picker-preview__alpha .v-slider-track__background::after {
|
|
11
13
|
content: "";
|
|
12
14
|
z-index: -1;
|
|
@@ -33,21 +35,24 @@
|
|
|
33
35
|
border-radius: 50%;
|
|
34
36
|
overflow: hidden;
|
|
35
37
|
}
|
|
36
|
-
.v-color-picker-preview__dot
|
|
38
|
+
.v-locale--is-ltr.v-color-picker-preview__dot, .v-locale--is-ltr .v-color-picker-preview__dot {
|
|
37
39
|
margin-right: 24px;
|
|
38
40
|
}
|
|
39
|
-
|
|
41
|
+
|
|
42
|
+
.v-locale--is-rtl.v-color-picker-preview__dot, .v-locale--is-rtl .v-color-picker-preview__dot {
|
|
40
43
|
margin-left: 24px;
|
|
41
44
|
}
|
|
45
|
+
|
|
42
46
|
.v-color-picker-preview__dot > div {
|
|
43
47
|
width: 100%;
|
|
44
48
|
height: 100%;
|
|
45
49
|
}
|
|
46
50
|
|
|
47
|
-
.v-color-picker-preview__hue:not(.v-input--is-disabled) .v-slider-track__background
|
|
51
|
+
.v-locale--is-ltr.v-color-picker-preview__hue:not(.v-input--is-disabled) .v-slider-track__background, .v-locale--is-ltr .v-color-picker-preview__hue:not(.v-input--is-disabled) .v-slider-track__background {
|
|
48
52
|
background: linear-gradient(to right, #F00 0%, #FF0 16.66%, #0F0 33.33%, #0FF 50%, #00F 66.66%, #F0F 83.33%, #F00 100%);
|
|
49
53
|
}
|
|
50
|
-
|
|
54
|
+
|
|
55
|
+
.v-locale--is-rtl.v-color-picker-preview__hue:not(.v-input--is-disabled) .v-slider-track__background, .v-locale--is-rtl .v-color-picker-preview__hue:not(.v-input--is-disabled) .v-slider-track__background {
|
|
51
56
|
background: linear-gradient(to left, #F00 0%, #FF0 16.66%, #0F0 33.33%, #0FF 50%, #00F 66.66%, #F0F 83.33%, #F00 100%);
|
|
52
57
|
}
|
|
53
58
|
|
|
@@ -64,4 +69,9 @@
|
|
|
64
69
|
align-items: center;
|
|
65
70
|
display: flex;
|
|
66
71
|
margin-bottom: 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.v-color-picker-preview__eye-dropper {
|
|
75
|
+
position: relative;
|
|
76
|
+
margin-right: 12px;
|
|
67
77
|
}
|
|
@@ -3,10 +3,12 @@ import { createVNode as _createVNode } from "vue";
|
|
|
3
3
|
import "./VColorPickerPreview.css";
|
|
4
4
|
|
|
5
5
|
// Components
|
|
6
|
+
import { VBtn } from "../VBtn/index.mjs";
|
|
6
7
|
import { VSlider } from "../VSlider/index.mjs"; // Composables
|
|
7
8
|
import { makeComponentProps } from "../../composables/component.mjs"; // Utilities
|
|
9
|
+
import { onUnmounted } from 'vue';
|
|
8
10
|
import { nullColor } from "./util/index.mjs";
|
|
9
|
-
import { defineComponent, HSVtoCSS, propsFactory, useRender } from "../../util/index.mjs"; // Types
|
|
11
|
+
import { defineComponent, HexToHSV, HSVtoCSS, propsFactory, SUPPORTS_EYE_DROPPER, useRender } from "../../util/index.mjs"; // Types
|
|
10
12
|
export const makeVColorPickerPreviewProps = propsFactory({
|
|
11
13
|
color: {
|
|
12
14
|
type: Object
|
|
@@ -25,12 +27,36 @@ export const VColorPickerPreview = defineComponent({
|
|
|
25
27
|
let {
|
|
26
28
|
emit
|
|
27
29
|
} = _ref;
|
|
30
|
+
const abortController = new AbortController();
|
|
31
|
+
onUnmounted(() => abortController.abort());
|
|
32
|
+
async function openEyeDropper() {
|
|
33
|
+
if (!SUPPORTS_EYE_DROPPER) return;
|
|
34
|
+
const eyeDropper = new window.EyeDropper();
|
|
35
|
+
try {
|
|
36
|
+
const result = await eyeDropper.open({
|
|
37
|
+
signal: abortController.signal
|
|
38
|
+
});
|
|
39
|
+
const colorHexValue = HexToHSV(result.sRGBHex);
|
|
40
|
+
emit('update:color', {
|
|
41
|
+
...(props.color ?? nullColor),
|
|
42
|
+
...colorHexValue
|
|
43
|
+
});
|
|
44
|
+
} catch (e) {}
|
|
45
|
+
}
|
|
28
46
|
useRender(() => _createVNode("div", {
|
|
29
47
|
"class": ['v-color-picker-preview', {
|
|
30
48
|
'v-color-picker-preview--hide-alpha': props.hideAlpha
|
|
31
49
|
}, props.class],
|
|
32
50
|
"style": props.style
|
|
33
|
-
}, [_createVNode("div", {
|
|
51
|
+
}, [SUPPORTS_EYE_DROPPER && _createVNode("div", {
|
|
52
|
+
"class": "v-color-picker-preview__eye-dropper",
|
|
53
|
+
"key": "eyeDropper"
|
|
54
|
+
}, [_createVNode(VBtn, {
|
|
55
|
+
"onClick": openEyeDropper,
|
|
56
|
+
"icon": "$eyeDropper",
|
|
57
|
+
"variant": "plain",
|
|
58
|
+
"density": "comfortable"
|
|
59
|
+
}, null)]), _createVNode("div", {
|
|
34
60
|
"class": "v-color-picker-preview__dot"
|
|
35
61
|
}, [_createVNode("div", {
|
|
36
62
|
"style": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VColorPickerPreview.mjs","names":["VSlider","makeComponentProps","nullColor","defineComponent","HSVtoCSS","propsFactory","useRender","makeVColorPickerPreviewProps","color","type","Object","disabled","Boolean","hideAlpha","VColorPickerPreview","name","props","emits","setup","_ref","emit","_createVNode","class","style","background","h","a"],"sources":["../../../src/components/VColorPicker/VColorPickerPreview.tsx"],"sourcesContent":["// Styles\nimport './VColorPickerPreview.sass'\n\n// Components\nimport { VSlider } from '@/components/VSlider'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\n\n// Utilities\nimport { nullColor } from './util'\nimport {
|
|
1
|
+
{"version":3,"file":"VColorPickerPreview.mjs","names":["VBtn","VSlider","makeComponentProps","onUnmounted","nullColor","defineComponent","HexToHSV","HSVtoCSS","propsFactory","SUPPORTS_EYE_DROPPER","useRender","makeVColorPickerPreviewProps","color","type","Object","disabled","Boolean","hideAlpha","VColorPickerPreview","name","props","emits","setup","_ref","emit","abortController","AbortController","abort","openEyeDropper","eyeDropper","window","EyeDropper","result","open","signal","colorHexValue","sRGBHex","e","_createVNode","class","style","background","h","a"],"sources":["../../../src/components/VColorPicker/VColorPickerPreview.tsx"],"sourcesContent":["// Styles\nimport './VColorPickerPreview.sass'\n\n// Components\nimport { VBtn } from '@/components/VBtn'\nimport { VSlider } from '@/components/VSlider'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\n\n// Utilities\nimport { onUnmounted } from 'vue'\nimport { nullColor } from './util'\nimport {\n defineComponent,\n HexToHSV,\n HSVtoCSS,\n propsFactory,\n SUPPORTS_EYE_DROPPER,\n useRender,\n} from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\nimport type { Hex, HSV } from '@/util'\n\nexport const makeVColorPickerPreviewProps = propsFactory({\n color: {\n type: Object as PropType<HSV | null>,\n },\n disabled: Boolean,\n hideAlpha: Boolean,\n\n ...makeComponentProps(),\n}, 'VColorPickerPreview')\n\nexport const VColorPickerPreview = defineComponent({\n name: 'VColorPickerPreview',\n\n props: makeVColorPickerPreviewProps(),\n\n emits: {\n 'update:color': (color: HSV) => true,\n },\n\n setup (props, { emit }) {\n const abortController = new AbortController()\n\n onUnmounted(() => abortController.abort())\n\n async function openEyeDropper () {\n if (!SUPPORTS_EYE_DROPPER) return\n\n const eyeDropper = new window.EyeDropper()\n try {\n const result = await eyeDropper.open({ signal: abortController.signal })\n const colorHexValue = HexToHSV(result.sRGBHex as Hex)\n emit('update:color', { ...(props.color ?? nullColor), ...colorHexValue })\n } catch (e) {}\n }\n\n useRender(() => (\n <div\n class={[\n 'v-color-picker-preview',\n {\n 'v-color-picker-preview--hide-alpha': props.hideAlpha,\n },\n props.class,\n ]}\n style={ props.style }\n >\n { SUPPORTS_EYE_DROPPER && (\n <div class=\"v-color-picker-preview__eye-dropper\" key=\"eyeDropper\">\n <VBtn onClick={ openEyeDropper } icon=\"$eyeDropper\" variant=\"plain\" density=\"comfortable\" />\n </div>\n )}\n\n <div class=\"v-color-picker-preview__dot\">\n <div style={{ background: HSVtoCSS(props.color ?? nullColor) }} />\n </div>\n\n <div class=\"v-color-picker-preview__sliders\">\n <VSlider\n class=\"v-color-picker-preview__track v-color-picker-preview__hue\"\n modelValue={ props.color?.h }\n onUpdate:modelValue={ h => emit('update:color', { ...(props.color ?? nullColor), h }) }\n step={ 0 }\n min={ 0 }\n max={ 360 }\n disabled={ props.disabled }\n thumbSize={ 14 }\n trackSize={ 8 }\n trackFillColor=\"white\"\n hideDetails\n />\n\n { !props.hideAlpha && (\n <VSlider\n class=\"v-color-picker-preview__track v-color-picker-preview__alpha\"\n modelValue={ props.color?.a ?? 1 }\n onUpdate:modelValue={ a => emit('update:color', { ...(props.color ?? nullColor), a }) }\n step={ 1 / 256 }\n min={ 0 }\n max={ 1 }\n disabled={ props.disabled }\n thumbSize={ 14 }\n trackSize={ 8 }\n trackFillColor=\"white\"\n hideDetails\n />\n )}\n </div>\n </div>\n ))\n\n return {}\n },\n})\n\nexport type VColorPickerPreview = Instan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