vuetify 3.3.13 → 3.3.14

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.
Files changed (94) hide show
  1. package/dist/json/attributes.json +70 -66
  2. package/dist/json/importMap-labs.json +4 -4
  3. package/dist/json/importMap.json +12 -12
  4. package/dist/json/tags.json +5 -4
  5. package/dist/json/web-types.json +180 -140
  6. package/dist/vuetify-labs.css +363 -304
  7. package/dist/vuetify-labs.d.ts +384 -236
  8. package/dist/vuetify-labs.esm.js +410 -297
  9. package/dist/vuetify-labs.esm.js.map +1 -1
  10. package/dist/vuetify-labs.js +409 -296
  11. package/dist/vuetify-labs.min.css +2 -2
  12. package/dist/vuetify.css +291 -232
  13. package/dist/vuetify.d.ts +232 -76
  14. package/dist/vuetify.esm.js +210 -160
  15. package/dist/vuetify.esm.js.map +1 -1
  16. package/dist/vuetify.js +209 -159
  17. package/dist/vuetify.js.map +1 -1
  18. package/dist/vuetify.min.css +2 -2
  19. package/dist/vuetify.min.js +838 -827
  20. package/dist/vuetify.min.js.map +1 -1
  21. package/lib/components/VAppBar/VAppBar.mjs.map +1 -1
  22. package/lib/components/VAppBar/index.d.mts +6 -6
  23. package/lib/components/VAutocomplete/VAutocomplete.mjs +12 -2
  24. package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
  25. package/lib/components/VBadge/VBadge.css +1 -1
  26. package/lib/components/VBadge/_variables.scss +1 -1
  27. package/lib/components/VCheckbox/VCheckbox.mjs +2 -2
  28. package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
  29. package/lib/components/VCheckbox/VCheckboxBtn.mjs +14 -11
  30. package/lib/components/VCheckbox/VCheckboxBtn.mjs.map +1 -1
  31. package/lib/components/VColorPicker/VColorPickerEdit.css +4 -2
  32. package/lib/components/VColorPicker/VColorPickerPreview.css +11 -6
  33. package/lib/components/VCombobox/VCombobox.mjs +11 -1
  34. package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
  35. package/lib/components/VField/VField.css +22 -7
  36. package/lib/components/VField/VField.sass +8 -1
  37. package/lib/components/VField/_variables.scss +1 -0
  38. package/lib/components/VGrid/VGrid.css +153 -142
  39. package/lib/components/VProgressLinear/VProgressLinear.css +3 -2
  40. package/lib/components/VRadioGroup/VRadioGroup.mjs +2 -2
  41. package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
  42. package/lib/components/VRangeSlider/index.d.mts +114 -33
  43. package/lib/components/VSelect/VSelect.mjs +12 -2
  44. package/lib/components/VSelect/VSelect.mjs.map +1 -1
  45. package/lib/components/VSelectionControl/VSelectionControl.mjs +2 -1
  46. package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
  47. package/lib/components/VSlider/VSlider.mjs.map +1 -1
  48. package/lib/components/VSlider/VSliderThumb.css +8 -4
  49. package/lib/components/VSlider/VSliderTrack.css +22 -12
  50. package/lib/components/VSlider/index.d.mts +114 -33
  51. package/lib/components/VSwitch/VSwitch.mjs +9 -9
  52. package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
  53. package/lib/components/VTimeline/VTimeline.css +19 -10
  54. package/lib/components/VTimeline/VTimeline.sass +5 -0
  55. package/lib/components/VToolbar/VToolbar.css +4 -2
  56. package/lib/components/index.d.mts +228 -72
  57. package/lib/composables/color.mjs +6 -1
  58. package/lib/composables/color.mjs.map +1 -1
  59. package/lib/composables/defaults.mjs +9 -9
  60. package/lib/composables/defaults.mjs.map +1 -1
  61. package/lib/composables/theme.mjs +2 -5
  62. package/lib/composables/theme.mjs.map +1 -1
  63. package/lib/entry-bundler.mjs +1 -1
  64. package/lib/framework.mjs +1 -1
  65. package/lib/index.d.mts +4 -4
  66. package/lib/labs/VDateInput/index.d.mts +2 -2
  67. package/lib/labs/VDatePicker/VDateCard.mjs +3 -0
  68. package/lib/labs/VDatePicker/VDateCard.mjs.map +1 -1
  69. package/lib/labs/VDatePicker/VDatePicker.mjs +51 -21
  70. package/lib/labs/VDatePicker/VDatePicker.mjs.map +1 -1
  71. package/lib/labs/VDatePicker/VDatePickerControls.css +1 -1
  72. package/lib/labs/VDatePicker/VDatePickerControls.mjs +53 -35
  73. package/lib/labs/VDatePicker/VDatePickerControls.mjs.map +1 -1
  74. package/lib/labs/VDatePicker/VDatePickerMonth.mjs +37 -28
  75. package/lib/labs/VDatePicker/VDatePickerMonth.mjs.map +1 -1
  76. package/lib/labs/VDatePicker/VDatePickerYears.mjs +19 -17
  77. package/lib/labs/VDatePicker/VDatePickerYears.mjs.map +1 -1
  78. package/lib/labs/VDatePicker/index.d.mts +148 -156
  79. package/lib/labs/VDateRangePicker/VDateRangeCard.mjs +3 -0
  80. package/lib/labs/VDateRangePicker/VDateRangeCard.mjs.map +1 -1
  81. package/lib/labs/VDateRangePicker/index.d.mts +59 -52
  82. package/lib/labs/VSkeletonLoader/VSkeletonLoader.mjs.map +1 -1
  83. package/lib/labs/VSkeletonLoader/index.d.mts +8 -8
  84. package/lib/labs/components.d.mts +156 -164
  85. package/lib/locale/no.mjs +1 -1
  86. package/lib/locale/no.mjs.map +1 -1
  87. package/lib/styles/tools/_rtl.sass +4 -2
  88. package/lib/util/colorUtils.mjs +6 -0
  89. package/lib/util/colorUtils.mjs.map +1 -1
  90. package/lib/util/helpers.mjs +10 -4
  91. package/lib/util/helpers.mjs.map +1 -1
  92. package/lib/util/injectSelf.mjs +2 -1
  93. package/lib/util/injectSelf.mjs.map +1 -1
  94. package/package.json +2 -2
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * Vuetify v3.3.13
2
+ * Vuetify v3.3.14
3
3
  * Forged by John Leider
4
4
  * Released under the MIT License.
5
5
  */
6
6
 
7
- import { Fragment, reactive, computed, watchEffect, toRefs, capitalize, warn, watch, onScopeDispose, effectScope, ref, unref, provide, shallowRef, inject as inject$1, defineComponent as defineComponent$1, camelize, h, getCurrentInstance as getCurrentInstance$1, onBeforeUnmount, readonly, onDeactivated, onActivated, onMounted, toRaw, createVNode, TransitionGroup, Transition, mergeProps, onBeforeMount, nextTick, withDirectives, resolveDirective, vShow, isRef, toRef, Text, resolveDynamicComponent, Teleport, cloneVNode, createTextVNode, onBeforeUpdate, vModelText } from 'vue';
7
+ import { Fragment, reactive, computed, watchEffect, toRefs, capitalize, warn, ref, unref, provide, shallowRef, inject as inject$1, defineComponent as defineComponent$1, camelize, h, getCurrentInstance as getCurrentInstance$1, onBeforeUnmount, watch, readonly, onDeactivated, onActivated, onMounted, onScopeDispose, effectScope, toRaw, createVNode, TransitionGroup, Transition, mergeProps, onBeforeMount, nextTick, withDirectives, resolveDirective, vShow, isRef, toRef, Text, resolveDynamicComponent, Teleport, cloneVNode, createTextVNode, onBeforeUpdate, vModelText } from 'vue';
8
8
 
9
9
  // Types
10
10
  // eslint-disable-line vue/prefer-import-from-vue
@@ -224,14 +224,22 @@ function omit(obj, exclude) {
224
224
  exclude.forEach(prop => delete clone[prop]);
225
225
  return clone;
226
226
  }
227
+ const onRE = /^on[^a-z]/;
228
+ const isOn = key => onRE.test(key);
229
+ const bubblingEvents = ['onAfterscriptexecute', 'onAnimationcancel', 'onAnimationend', 'onAnimationiteration', 'onAnimationstart', 'onAuxclick', 'onBeforeinput', 'onBeforescriptexecute', 'onChange', 'onClick', 'onCompositionend', 'onCompositionstart', 'onCompositionupdate', 'onContextmenu', 'onCopy', 'onCut', 'onDblclick', 'onFocusin', 'onFocusout', 'onFullscreenchange', 'onFullscreenerror', 'onGesturechange', 'onGestureend', 'onGesturestart', 'onGotpointercapture', 'onInput', 'onKeydown', 'onKeypress', 'onKeyup', 'onLostpointercapture', 'onMousedown', 'onMousemove', 'onMouseout', 'onMouseover', 'onMouseup', 'onMousewheel', 'onPaste', 'onPointercancel', 'onPointerdown', 'onPointerenter', 'onPointerleave', 'onPointermove', 'onPointerout', 'onPointerover', 'onPointerup', 'onReset', 'onSelect', 'onSubmit', 'onTouchcancel', 'onTouchend', 'onTouchmove', 'onTouchstart', 'onTransitioncancel', 'onTransitionend', 'onTransitionrun', 'onTransitionstart', 'onWheel'];
227
230
 
228
231
  /**
229
232
  * Filter attributes that should be applied to
230
- * the root element of a an input component. Remaining
233
+ * the root element of an input component. Remaining
231
234
  * attributes should be passed to the <input> element inside.
232
235
  */
233
236
  function filterInputAttrs(attrs) {
234
- return pick(attrs, ['class', 'style', 'id', /^data-/]);
237
+ const [events, props] = pick(attrs, [onRE]);
238
+ const inputEvents = omit(events, bubblingEvents);
239
+ const [rootAttrs, inputAttrs] = pick(props, ['class', 'style', 'id', /^data-/]);
240
+ Object.assign(rootAttrs, events);
241
+ Object.assign(inputAttrs, inputEvents);
242
+ return [rootAttrs, inputAttrs];
235
243
  }
236
244
  function wrapInArray(v) {
237
245
  return v == null ? [] : Array.isArray(v) ? v : [v];
@@ -384,8 +392,6 @@ function destructComputed(getter) {
384
392
  function includes(arr, val) {
385
393
  return arr.includes(val);
386
394
  }
387
- const onRE = /^on[^a-z]/;
388
- const isOn = key => onRE.test(key);
389
395
  function eventName(propName) {
390
396
  return propName[2].toLowerCase() + propName.slice(3);
391
397
  }
@@ -652,6 +658,94 @@ function unbindProps(el, props) {
652
658
  });
653
659
  }
654
660
 
661
+ /**
662
+ * WCAG 3.0 APCA perceptual contrast algorithm from https://github.com/Myndex/SAPC-APCA
663
+ * @licence https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
664
+ * @see https://www.w3.org/WAI/GL/task-forces/silver/wiki/Visual_Contrast_of_Text_Subgroup
665
+ */
666
+ // Types
667
+
668
+ // MAGICAL NUMBERS
669
+
670
+ // sRGB Conversion to Relative Luminance (Y)
671
+
672
+ // Transfer Curve (aka "Gamma") for sRGB linearization
673
+ // Simple power curve vs piecewise described in docs
674
+ // Essentially, 2.4 best models actual display
675
+ // characteristics in combination with the total method
676
+ const mainTRC = 2.4;
677
+ const Rco = 0.2126729; // sRGB Red Coefficient (from matrix)
678
+ const Gco = 0.7151522; // sRGB Green Coefficient (from matrix)
679
+ const Bco = 0.0721750; // sRGB Blue Coefficient (from matrix)
680
+
681
+ // For Finding Raw SAPC Contrast from Relative Luminance (Y)
682
+
683
+ // Constants for SAPC Power Curve Exponents
684
+ // One pair for normal text, and one for reverse
685
+ // These are the "beating heart" of SAPC
686
+ const normBG = 0.55;
687
+ const normTXT = 0.58;
688
+ const revTXT = 0.57;
689
+ const revBG = 0.62;
690
+
691
+ // For Clamping and Scaling Values
692
+
693
+ const blkThrs = 0.03; // Level that triggers the soft black clamp
694
+ const blkClmp = 1.45; // Exponent for the soft black clamp curve
695
+ const deltaYmin = 0.0005; // Lint trap
696
+ const scaleBoW = 1.25; // Scaling for dark text on light
697
+ const scaleWoB = 1.25; // Scaling for light text on dark
698
+ const loConThresh = 0.078; // Threshold for new simple offset scale
699
+ const loConFactor = 12.82051282051282; // = 1/0.078,
700
+ const loConOffset = 0.06; // The simple offset
701
+ const loClip = 0.001; // Output clip (lint trap #2)
702
+
703
+ function APCAcontrast(text, background) {
704
+ // Linearize sRGB
705
+ const Rtxt = (text.r / 255) ** mainTRC;
706
+ const Gtxt = (text.g / 255) ** mainTRC;
707
+ const Btxt = (text.b / 255) ** mainTRC;
708
+ const Rbg = (background.r / 255) ** mainTRC;
709
+ const Gbg = (background.g / 255) ** mainTRC;
710
+ const Bbg = (background.b / 255) ** mainTRC;
711
+
712
+ // Apply the standard coefficients and sum to Y
713
+ let Ytxt = Rtxt * Rco + Gtxt * Gco + Btxt * Bco;
714
+ let Ybg = Rbg * Rco + Gbg * Gco + Bbg * Bco;
715
+
716
+ // Soft clamp Y when near black.
717
+ // Now clamping all colors to prevent crossover errors
718
+ if (Ytxt <= blkThrs) Ytxt += (blkThrs - Ytxt) ** blkClmp;
719
+ if (Ybg <= blkThrs) Ybg += (blkThrs - Ybg) ** blkClmp;
720
+
721
+ // Return 0 Early for extremely low ∆Y (lint trap #1)
722
+ if (Math.abs(Ybg - Ytxt) < deltaYmin) return 0.0;
723
+
724
+ // SAPC CONTRAST
725
+
726
+ let outputContrast; // For weighted final values
727
+ if (Ybg > Ytxt) {
728
+ // For normal polarity, black text on white
729
+ // Calculate the SAPC contrast value and scale
730
+
731
+ const SAPC = (Ybg ** normBG - Ytxt ** normTXT) * scaleBoW;
732
+
733
+ // NEW! SAPC SmoothScale™
734
+ // Low Contrast Smooth Scale Rollout to prevent polarity reversal
735
+ // and also a low clip for very low contrasts (lint trap #2)
736
+ // much of this is for very low contrasts, less than 10
737
+ // therefore for most reversing needs, only loConOffset is important
738
+ outputContrast = SAPC < loClip ? 0.0 : SAPC < loConThresh ? SAPC - SAPC * loConFactor * loConOffset : SAPC - loConOffset;
739
+ } else {
740
+ // For reverse polarity, light text on dark
741
+ // WoB should always return negative value.
742
+
743
+ const SAPC = (Ybg ** revBG - Ytxt ** revTXT) * scaleWoB;
744
+ outputContrast = SAPC > -loClip ? 0.0 : SAPC > -loConThresh ? SAPC - SAPC * loConFactor * loConOffset : SAPC + loConOffset;
745
+ }
746
+ return outputContrast * 100;
747
+ }
748
+
655
749
  /* eslint-disable no-console */
656
750
 
657
751
  function consoleWarn(message) {
@@ -1008,36 +1102,13 @@ function getContrast(first, second) {
1008
1102
  const dark = Math.min(l1, l2);
1009
1103
  return (light + 0.05) / (dark + 0.05);
1010
1104
  }
1011
-
1012
- // Utilities
1013
-
1014
- // Types
1015
-
1016
- function useToggleScope(source, fn) {
1017
- let scope;
1018
- function start() {
1019
- scope = effectScope();
1020
- scope.run(() => fn.length ? fn(() => {
1021
- scope?.stop();
1022
- start();
1023
- }) : fn());
1024
- }
1025
- watch(source, active => {
1026
- if (active && !scope) {
1027
- start();
1028
- } else if (!active) {
1029
- scope?.stop();
1030
- scope = undefined;
1031
- }
1032
- }, {
1033
- immediate: true
1034
- });
1035
- onScopeDispose(() => {
1036
- scope?.stop();
1037
- });
1105
+ function getForeground(color) {
1106
+ const blackContrast = Math.abs(APCAcontrast(parseColor(0), parseColor(color)));
1107
+ const whiteContrast = Math.abs(APCAcontrast(parseColor(0xffffff), parseColor(color)));
1108
+ return whiteContrast > Math.min(blackContrast, 50) ? '#fff' : '#000';
1038
1109
  }
1039
1110
 
1040
- // Composables
1111
+ // Utilities
1041
1112
 
1042
1113
  // Types
1043
1114
 
@@ -1059,6 +1130,7 @@ function provideDefaults(defaults, options) {
1059
1130
  const scoped = unref(options?.scoped);
1060
1131
  const reset = unref(options?.reset);
1061
1132
  const root = unref(options?.root);
1133
+ if (providedDefaults.value == null && !(scoped || reset || root)) return injectedDefaults.value;
1062
1134
  let properties = mergeDeep(providedDefaults.value, {
1063
1135
  prev: injectedDefaults.value
1064
1136
  });
@@ -1114,16 +1186,16 @@ function internalUseDefaults() {
1114
1186
  let [key] = _ref;
1115
1187
  return key.startsWith(key[0].toUpperCase());
1116
1188
  });
1117
- if (subComponents.length) _subcomponentDefaults.value = Object.fromEntries(subComponents);
1189
+ _subcomponentDefaults.value = subComponents.length ? Object.fromEntries(subComponents) : undefined;
1190
+ } else {
1191
+ _subcomponentDefaults.value = undefined;
1118
1192
  }
1119
1193
  });
1120
1194
  function provideSubDefaults() {
1121
- // If subcomponent defaults are provided, override any
1122
- // subcomponents provided by the component's setup function.
1123
- // This uses injectSelf so must be done after the original setup to work.
1124
- useToggleScope(_subcomponentDefaults, () => {
1125
- provideDefaults(mergeDeep(injectSelf(DefaultsSymbol)?.value ?? {}, _subcomponentDefaults.value));
1126
- });
1195
+ const injected = injectSelf(DefaultsSymbol, vm);
1196
+ provide(DefaultsSymbol, computed(() => {
1197
+ return _subcomponentDefaults.value ? mergeDeep(injected?.value ?? {}, _subcomponentDefaults.value) : injected?.value;
1198
+ }));
1127
1199
  }
1128
1200
  return {
1129
1201
  props: _props,
@@ -1301,9 +1373,10 @@ function isPotentiallyScrollable(el) {
1301
1373
  // Types
1302
1374
 
1303
1375
  function injectSelf(key) {
1376
+ let vm = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getCurrentInstance('injectSelf');
1304
1377
  const {
1305
1378
  provides
1306
- } = getCurrentInstance('injectSelf');
1379
+ } = vm;
1307
1380
  if (provides && key in provides) {
1308
1381
  // TS doesn't allow symbol as index type
1309
1382
  return provides[key];
@@ -1780,6 +1853,34 @@ const defaultRtl = {
1780
1853
  zhHant: false
1781
1854
  };
1782
1855
 
1856
+ // Utilities
1857
+
1858
+ // Types
1859
+
1860
+ function useToggleScope(source, fn) {
1861
+ let scope;
1862
+ function start() {
1863
+ scope = effectScope();
1864
+ scope.run(() => fn.length ? fn(() => {
1865
+ scope?.stop();
1866
+ start();
1867
+ }) : fn());
1868
+ }
1869
+ watch(source, active => {
1870
+ if (active && !scope) {
1871
+ start();
1872
+ } else if (!active) {
1873
+ scope?.stop();
1874
+ scope = undefined;
1875
+ }
1876
+ }, {
1877
+ immediate: true
1878
+ });
1879
+ onScopeDispose(() => {
1880
+ scope?.stop();
1881
+ });
1882
+ }
1883
+
1783
1884
  // Composables
1784
1885
 
1785
1886
  // Types
@@ -1981,94 +2082,6 @@ function useRtl() {
1981
2082
  };
1982
2083
  }
1983
2084
 
1984
- /**
1985
- * WCAG 3.0 APCA perceptual contrast algorithm from https://github.com/Myndex/SAPC-APCA
1986
- * @licence https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
1987
- * @see https://www.w3.org/WAI/GL/task-forces/silver/wiki/Visual_Contrast_of_Text_Subgroup
1988
- */
1989
- // Types
1990
-
1991
- // MAGICAL NUMBERS
1992
-
1993
- // sRGB Conversion to Relative Luminance (Y)
1994
-
1995
- // Transfer Curve (aka "Gamma") for sRGB linearization
1996
- // Simple power curve vs piecewise described in docs
1997
- // Essentially, 2.4 best models actual display
1998
- // characteristics in combination with the total method
1999
- const mainTRC = 2.4;
2000
- const Rco = 0.2126729; // sRGB Red Coefficient (from matrix)
2001
- const Gco = 0.7151522; // sRGB Green Coefficient (from matrix)
2002
- const Bco = 0.0721750; // sRGB Blue Coefficient (from matrix)
2003
-
2004
- // For Finding Raw SAPC Contrast from Relative Luminance (Y)
2005
-
2006
- // Constants for SAPC Power Curve Exponents
2007
- // One pair for normal text, and one for reverse
2008
- // These are the "beating heart" of SAPC
2009
- const normBG = 0.55;
2010
- const normTXT = 0.58;
2011
- const revTXT = 0.57;
2012
- const revBG = 0.62;
2013
-
2014
- // For Clamping and Scaling Values
2015
-
2016
- const blkThrs = 0.03; // Level that triggers the soft black clamp
2017
- const blkClmp = 1.45; // Exponent for the soft black clamp curve
2018
- const deltaYmin = 0.0005; // Lint trap
2019
- const scaleBoW = 1.25; // Scaling for dark text on light
2020
- const scaleWoB = 1.25; // Scaling for light text on dark
2021
- const loConThresh = 0.078; // Threshold for new simple offset scale
2022
- const loConFactor = 12.82051282051282; // = 1/0.078,
2023
- const loConOffset = 0.06; // The simple offset
2024
- const loClip = 0.001; // Output clip (lint trap #2)
2025
-
2026
- function APCAcontrast(text, background) {
2027
- // Linearize sRGB
2028
- const Rtxt = (text.r / 255) ** mainTRC;
2029
- const Gtxt = (text.g / 255) ** mainTRC;
2030
- const Btxt = (text.b / 255) ** mainTRC;
2031
- const Rbg = (background.r / 255) ** mainTRC;
2032
- const Gbg = (background.g / 255) ** mainTRC;
2033
- const Bbg = (background.b / 255) ** mainTRC;
2034
-
2035
- // Apply the standard coefficients and sum to Y
2036
- let Ytxt = Rtxt * Rco + Gtxt * Gco + Btxt * Bco;
2037
- let Ybg = Rbg * Rco + Gbg * Gco + Bbg * Bco;
2038
-
2039
- // Soft clamp Y when near black.
2040
- // Now clamping all colors to prevent crossover errors
2041
- if (Ytxt <= blkThrs) Ytxt += (blkThrs - Ytxt) ** blkClmp;
2042
- if (Ybg <= blkThrs) Ybg += (blkThrs - Ybg) ** blkClmp;
2043
-
2044
- // Return 0 Early for extremely low ∆Y (lint trap #1)
2045
- if (Math.abs(Ybg - Ytxt) < deltaYmin) return 0.0;
2046
-
2047
- // SAPC CONTRAST
2048
-
2049
- let outputContrast; // For weighted final values
2050
- if (Ybg > Ytxt) {
2051
- // For normal polarity, black text on white
2052
- // Calculate the SAPC contrast value and scale
2053
-
2054
- const SAPC = (Ybg ** normBG - Ytxt ** normTXT) * scaleBoW;
2055
-
2056
- // NEW! SAPC SmoothScale™
2057
- // Low Contrast Smooth Scale Rollout to prevent polarity reversal
2058
- // and also a low clip for very low contrasts (lint trap #2)
2059
- // much of this is for very low contrasts, less than 10
2060
- // therefore for most reversing needs, only loConOffset is important
2061
- outputContrast = SAPC < loClip ? 0.0 : SAPC < loConThresh ? SAPC - SAPC * loConFactor * loConOffset : SAPC - loConOffset;
2062
- } else {
2063
- // For reverse polarity, light text on dark
2064
- // WoB should always return negative value.
2065
-
2066
- const SAPC = (Ybg ** revBG - Ytxt ** revTXT) * scaleWoB;
2067
- outputContrast = SAPC > -loClip ? 0.0 : SAPC > -loConThresh ? SAPC - SAPC * loConFactor * loConOffset : SAPC + loConOffset;
2068
- }
2069
- return outputContrast * 100;
2070
- }
2071
-
2072
2085
  // Utilities
2073
2086
 
2074
2087
  // Types
@@ -2204,8 +2217,6 @@ function createTheme(options) {
2204
2217
  if (/^on-[a-z]/.test(color) || theme.colors[`on-${color}`]) continue;
2205
2218
  const onColor = `on-${color}`;
2206
2219
  const colorVal = parseColor(theme.colors[color]);
2207
- const blackContrast = Math.abs(APCAcontrast(parseColor(0), colorVal));
2208
- const whiteContrast = Math.abs(APCAcontrast(parseColor(0xffffff), colorVal));
2209
2220
 
2210
2221
  // TODO: warn about poor color selections
2211
2222
  // const contrastAsText = Math.abs(APCAcontrast(colorVal, colorToInt(theme.colors.background)))
@@ -2217,7 +2228,7 @@ function createTheme(options) {
2217
2228
  // }
2218
2229
 
2219
2230
  // Prefer white text if both have an acceptable contrast ratio
2220
- theme.colors[onColor] = whiteContrast > Math.min(blackContrast, 50) ? '#fff' : '#000';
2231
+ theme.colors[onColor] = getForeground(colorVal);
2221
2232
  }
2222
2233
  }
2223
2234
  return acc;
@@ -3246,6 +3257,11 @@ function useColor(colors) {
3246
3257
  if (colors.value.background) {
3247
3258
  if (isCssColor(colors.value.background)) {
3248
3259
  styles.backgroundColor = colors.value.background;
3260
+ if (!colors.value.text) {
3261
+ const textColor = getForeground(styles.backgroundColor);
3262
+ styles.color = textColor;
3263
+ styles.caretColor = textColor;
3264
+ }
3249
3265
  } else {
3250
3266
  classes.push(`bg-${colors.value.background}`);
3251
3267
  }
@@ -5891,7 +5907,8 @@ const VSelectionControl = genericComponent()({
5891
5907
  "icon": icon.value
5892
5908
  }, null), inputNode])]), [[resolveDirective("ripple"), props.ripple && [!props.disabled && !props.readonly, null, ['center', 'circle']]]])]), label && createVNode(VLabel, {
5893
5909
  "for": id.value,
5894
- "clickable": true
5910
+ "clickable": true,
5911
+ "onClick": e => e.stopPropagation()
5895
5912
  }, {
5896
5913
  default: () => [label]
5897
5914
  })]);
@@ -5940,16 +5957,19 @@ const VCheckboxBtn = genericComponent()({
5940
5957
  const trueIcon = computed(() => {
5941
5958
  return indeterminate.value ? props.indeterminateIcon : props.trueIcon;
5942
5959
  });
5943
- useRender(() => createVNode(VSelectionControl, mergeProps(props, {
5944
- "modelValue": model.value,
5945
- "onUpdate:modelValue": [$event => model.value = $event, onChange],
5946
- "class": ['v-checkbox-btn', props.class],
5947
- "style": props.style,
5948
- "type": "checkbox",
5949
- "falseIcon": falseIcon.value,
5950
- "trueIcon": trueIcon.value,
5951
- "aria-checked": indeterminate.value ? 'mixed' : undefined
5952
- }), slots));
5960
+ useRender(() => {
5961
+ const controlProps = omit(VSelectionControl.filterProps(props)[0], ['modelValue']);
5962
+ return createVNode(VSelectionControl, mergeProps(controlProps, {
5963
+ "modelValue": model.value,
5964
+ "onUpdate:modelValue": [$event => model.value = $event, onChange],
5965
+ "class": ['v-checkbox-btn', props.class],
5966
+ "style": props.style,
5967
+ "type": "checkbox",
5968
+ "falseIcon": falseIcon.value,
5969
+ "trueIcon": trueIcon.value,
5970
+ "aria-checked": indeterminate.value ? 'mixed' : undefined
5971
+ }), slots);
5972
+ });
5953
5973
  return {};
5954
5974
  }
5955
5975
  });
@@ -6513,12 +6533,12 @@ const VCheckbox = genericComponent()({
6513
6533
  const uid = getUid();
6514
6534
  const id = computed(() => props.id || `checkbox-${uid}`);
6515
6535
  useRender(() => {
6516
- const [inputAttrs, controlAttrs] = filterInputAttrs(attrs);
6536
+ const [rootAttrs, controlAttrs] = filterInputAttrs(attrs);
6517
6537
  const [inputProps, _1] = VInput.filterProps(props);
6518
6538
  const [checkboxProps, _2] = VCheckboxBtn.filterProps(props);
6519
6539
  return createVNode(VInput, mergeProps({
6520
6540
  "class": ['v-checkbox', props.class]
6521
- }, inputAttrs, inputProps, {
6541
+ }, rootAttrs, inputProps, {
6522
6542
  "modelValue": model.value,
6523
6543
  "onUpdate:modelValue": $event => model.value = $event,
6524
6544
  "id": id.value,
@@ -10846,6 +10866,7 @@ const VSelect = genericComponent()({
10846
10866
  } = useLocale();
10847
10867
  const vTextFieldRef = ref();
10848
10868
  const vMenuRef = ref();
10869
+ const vVirtualScrollRef = ref();
10849
10870
  const _menu = useProxiedModel(props, 'menu');
10850
10871
  const menu = computed({
10851
10872
  get: () => _menu.value,
@@ -10975,6 +10996,14 @@ const VSelect = genericComponent()({
10975
10996
  vTextFieldRef.value.value = '';
10976
10997
  }
10977
10998
  }
10999
+ watch(menu, () => {
11000
+ if (!props.hideSelected && menu.value && selections.value.length) {
11001
+ const index = displayItems.value.findIndex(item => selections.value.some(s => item.value === s.value));
11002
+ IN_BROWSER && window.requestAnimationFrame(() => {
11003
+ index >= 0 && vVirtualScrollRef.value?.scrollToIndex(index);
11004
+ });
11005
+ }
11006
+ });
10978
11007
  useRender(() => {
10979
11008
  const hasChips = !!(props.chips || slots.chip);
10980
11009
  const hasList = !!(!props.hideNoData || displayItems.value.length || slots['prepend-item'] || slots['append-item'] || slots['no-data']);
@@ -11036,6 +11065,7 @@ const VSelect = genericComponent()({
11036
11065
  default: () => [slots['prepend-item']?.(), !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? createVNode(VListItem, {
11037
11066
  "title": t(props.noDataText)
11038
11067
  }, null)), createVNode(VVirtualScroll, {
11068
+ "ref": vVirtualScrollRef,
11039
11069
  "renderless": true,
11040
11070
  "items": displayItems.value
11041
11071
  }, {
@@ -11296,6 +11326,7 @@ const VAutocomplete = genericComponent()({
11296
11326
  const isPristine = shallowRef(true);
11297
11327
  const listHasFocus = shallowRef(false);
11298
11328
  const vMenuRef = ref();
11329
+ const vVirtualScrollRef = ref();
11299
11330
  const _menu = useProxiedModel(props, 'menu');
11300
11331
  const menu = computed({
11301
11332
  get: () => _menu.value,
@@ -11386,7 +11417,7 @@ const VAutocomplete = genericComponent()({
11386
11417
  menu.value = false;
11387
11418
  }
11388
11419
  if (highlightFirst.value && ['Enter', 'Tab'].includes(e.key)) {
11389
- select(filteredItems.value[0]);
11420
+ select(displayItems.value[0]);
11390
11421
  }
11391
11422
  if (e.key === 'ArrowDown' && highlightFirst.value) {
11392
11423
  listRef.value?.focus('next');
@@ -11499,6 +11530,14 @@ const VAutocomplete = genericComponent()({
11499
11530
  if (val) menu.value = true;
11500
11531
  isPristine.value = !val;
11501
11532
  });
11533
+ watch(menu, () => {
11534
+ if (!props.hideSelected && menu.value && selections.value.length) {
11535
+ const index = displayItems.value.findIndex(item => selections.value.some(s => item.value === s.value));
11536
+ IN_BROWSER && window.requestAnimationFrame(() => {
11537
+ index >= 0 && vVirtualScrollRef.value?.scrollToIndex(index);
11538
+ });
11539
+ }
11540
+ });
11502
11541
  useRender(() => {
11503
11542
  const hasChips = !!(props.chips || slots.chip);
11504
11543
  const hasList = !!(!props.hideNoData || displayItems.value.length || slots['prepend-item'] || slots['append-item'] || slots['no-data']);
@@ -11558,6 +11597,7 @@ const VAutocomplete = genericComponent()({
11558
11597
  default: () => [slots['prepend-item']?.(), !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? createVNode(VListItem, {
11559
11598
  "title": t(props.noDataText)
11560
11599
  }, null)), createVNode(VVirtualScroll, {
11600
+ "ref": vVirtualScrollRef,
11561
11601
  "renderless": true,
11562
11602
  "items": displayItems.value
11563
11603
  }, {
@@ -14829,6 +14869,7 @@ const VCombobox = genericComponent()({
14829
14869
  const isPristine = shallowRef(true);
14830
14870
  const listHasFocus = shallowRef(false);
14831
14871
  const vMenuRef = ref();
14872
+ const vVirtualScrollRef = ref();
14832
14873
  const _menu = useProxiedModel(props, 'menu');
14833
14874
  const menu = computed({
14834
14875
  get: () => _menu.value,
@@ -15062,6 +15103,14 @@ const VCombobox = genericComponent()({
15062
15103
  search.value = '';
15063
15104
  }
15064
15105
  });
15106
+ watch(menu, () => {
15107
+ if (!props.hideSelected && menu.value && selections.value.length) {
15108
+ const index = displayItems.value.findIndex(item => selections.value.some(s => item.value === s.value));
15109
+ IN_BROWSER && window.requestAnimationFrame(() => {
15110
+ index >= 0 && vVirtualScrollRef.value?.scrollToIndex(index);
15111
+ });
15112
+ }
15113
+ });
15065
15114
  useRender(() => {
15066
15115
  const hasChips = !!(props.chips || slots.chip);
15067
15116
  const hasList = !!(!props.hideNoData || displayItems.value.length || slots['prepend-item'] || slots['append-item'] || slots['no-data']);
@@ -15120,6 +15169,7 @@ const VCombobox = genericComponent()({
15120
15169
  default: () => [slots['prepend-item']?.(), !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? createVNode(VListItem, {
15121
15170
  "title": t(props.noDataText)
15122
15171
  }, null)), createVNode(VVirtualScroll, {
15172
+ "ref": vVirtualScrollRef,
15123
15173
  "renderless": true,
15124
15174
  "items": displayItems.value
15125
15175
  }, {
@@ -17511,7 +17561,7 @@ const VRadioGroup = genericComponent()({
17511
17561
  const id = computed(() => props.id || `radio-group-${uid}`);
17512
17562
  const model = useProxiedModel(props, 'modelValue');
17513
17563
  useRender(() => {
17514
- const [inputAttrs, controlAttrs] = filterInputAttrs(attrs);
17564
+ const [rootAttrs, controlAttrs] = filterInputAttrs(attrs);
17515
17565
  const [inputProps, _1] = VInput.filterProps(props);
17516
17566
  const [controlProps, _2] = VSelectionControl.filterProps(props);
17517
17567
  const label = slots.label ? slots.label({
@@ -17523,7 +17573,7 @@ const VRadioGroup = genericComponent()({
17523
17573
  return createVNode(VInput, mergeProps({
17524
17574
  "class": ['v-radio-group', props.class],
17525
17575
  "style": props.style
17526
- }, inputAttrs, inputProps, {
17576
+ }, rootAttrs, inputProps, {
17527
17577
  "modelValue": model.value,
17528
17578
  "onUpdate:modelValue": $event => model.value = $event,
17529
17579
  "id": id.value
@@ -18500,6 +18550,7 @@ const VSwitch = genericComponent()({
18500
18550
  focus,
18501
18551
  blur
18502
18552
  } = useFocus(props);
18553
+ const control = ref();
18503
18554
  const loaderColor = computed(() => {
18504
18555
  return typeof props.loading === 'string' && props.loading !== '' ? props.loading : props.color;
18505
18556
  });
@@ -18510,16 +18561,15 @@ const VSwitch = genericComponent()({
18510
18561
  indeterminate.value = false;
18511
18562
  }
18512
18563
  }
18564
+ function onTrackClick(e) {
18565
+ e.stopPropagation();
18566
+ e.preventDefault();
18567
+ control.value?.input?.click();
18568
+ }
18513
18569
  useRender(() => {
18514
- const [inputAttrs, controlAttrs] = filterInputAttrs(attrs);
18570
+ const [rootAttrs, controlAttrs] = filterInputAttrs(attrs);
18515
18571
  const [inputProps, _1] = VInput.filterProps(props);
18516
18572
  const [controlProps, _2] = VSelectionControl.filterProps(props);
18517
- const control = ref();
18518
- function onClick(e) {
18519
- e.stopPropagation();
18520
- e.preventDefault();
18521
- control.value?.input?.click();
18522
- }
18523
18573
  return createVNode(VInput, mergeProps({
18524
18574
  "class": ['v-switch', {
18525
18575
  'v-switch--inset': props.inset
@@ -18527,7 +18577,7 @@ const VSwitch = genericComponent()({
18527
18577
  'v-switch--indeterminate': indeterminate.value
18528
18578
  }, loaderClasses.value, props.class],
18529
18579
  "style": props.style
18530
- }, inputAttrs, inputProps, {
18580
+ }, rootAttrs, inputProps, {
18531
18581
  "id": id.value,
18532
18582
  "focused": isFocused.value
18533
18583
  }), {
@@ -18557,7 +18607,7 @@ const VSwitch = genericComponent()({
18557
18607
  ...slots,
18558
18608
  default: () => createVNode("div", {
18559
18609
  "class": "v-switch__track",
18560
- "onClick": onClick
18610
+ "onClick": onTrackClick
18561
18611
  }, null),
18562
18612
  input: _ref3 => {
18563
18613
  let {
@@ -20328,7 +20378,7 @@ function createVuetify$1() {
20328
20378
  date
20329
20379
  };
20330
20380
  }
20331
- const version$1 = "3.3.13";
20381
+ const version$1 = "3.3.14";
20332
20382
  createVuetify$1.version = version$1;
20333
20383
 
20334
20384
  // Vue's inject() can only be used in setup
@@ -20353,7 +20403,7 @@ const createVuetify = function () {
20353
20403
  ...options
20354
20404
  });
20355
20405
  };
20356
- const version = "3.3.13";
20406
+ const version = "3.3.14";
20357
20407
  createVuetify.version = version;
20358
20408
 
20359
20409
  export { components, createVuetify, directives, useDefaults, useDisplay, useLayout, useLocale, useRtl, useTheme, version };