vuetify 3.10.9 → 3.10.10

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 (57) hide show
  1. package/dist/json/attributes.json +3507 -3507
  2. package/dist/json/importMap-labs.json +22 -22
  3. package/dist/json/importMap.json +170 -170
  4. package/dist/json/web-types.json +6186 -6186
  5. package/dist/vuetify-labs.cjs +201 -213
  6. package/dist/vuetify-labs.css +5293 -5301
  7. package/dist/vuetify-labs.d.ts +79 -79
  8. package/dist/vuetify-labs.esm.js +201 -213
  9. package/dist/vuetify-labs.esm.js.map +1 -1
  10. package/dist/vuetify-labs.js +201 -213
  11. package/dist/vuetify-labs.min.css +2 -2
  12. package/dist/vuetify.cjs +133 -96
  13. package/dist/vuetify.cjs.map +1 -1
  14. package/dist/vuetify.css +3094 -3090
  15. package/dist/vuetify.d.ts +63 -63
  16. package/dist/vuetify.esm.js +133 -96
  17. package/dist/vuetify.esm.js.map +1 -1
  18. package/dist/vuetify.js +133 -96
  19. package/dist/vuetify.js.map +1 -1
  20. package/dist/vuetify.min.css +2 -2
  21. package/dist/vuetify.min.js +332 -328
  22. package/dist/vuetify.min.js.map +1 -1
  23. package/lib/components/VAvatar/VAvatar.css +1 -1
  24. package/lib/components/VAvatar/_variables.scss +1 -1
  25. package/lib/components/VBtnToggle/VBtnToggle.sass +1 -1
  26. package/lib/components/VCard/VCard.js +8 -1
  27. package/lib/components/VCard/VCard.js.map +1 -1
  28. package/lib/components/VDatePicker/VDatePicker.js +7 -16
  29. package/lib/components/VDatePicker/VDatePicker.js.map +1 -1
  30. package/lib/components/VTextField/VTextField.js +17 -7
  31. package/lib/components/VTextField/VTextField.js.map +1 -1
  32. package/lib/components/VTextarea/VTextarea.js +17 -7
  33. package/lib/components/VTextarea/VTextarea.js.map +1 -1
  34. package/lib/composables/calendar.d.ts +6 -0
  35. package/lib/composables/calendar.js +37 -2
  36. package/lib/composables/calendar.js.map +1 -1
  37. package/lib/composables/delay.js +3 -2
  38. package/lib/composables/delay.js.map +1 -1
  39. package/lib/composables/hotkey/hotkey.js +42 -53
  40. package/lib/composables/hotkey/hotkey.js.map +1 -1
  41. package/lib/entry-bundler.js +1 -1
  42. package/lib/entry-bundler.js.map +1 -1
  43. package/lib/framework.d.ts +63 -63
  44. package/lib/framework.js +1 -1
  45. package/lib/framework.js.map +1 -1
  46. package/lib/labs/VDateInput/VDateInput.js +8 -12
  47. package/lib/labs/VDateInput/VDateInput.js.map +1 -1
  48. package/lib/labs/VHotkey/VHotkey.css +4 -16
  49. package/lib/labs/VHotkey/VHotkey.d.ts +29 -29
  50. package/lib/labs/VHotkey/VHotkey.js +62 -106
  51. package/lib/labs/VHotkey/VHotkey.js.map +1 -1
  52. package/lib/labs/VHotkey/VHotkey.scss +8 -25
  53. package/lib/styles/main.css +4 -0
  54. package/lib/styles/settings/_variables.scss +1 -0
  55. package/lib/util/box.js +3 -8
  56. package/lib/util/box.js.map +1 -1
  57. package/package.json +1 -1
package/dist/vuetify.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vuetify v3.10.9
2
+ * Vuetify v3.10.10
3
3
  * Forged by John Leider
4
4
  * Released under the MIT License.
5
5
  */
@@ -613,7 +613,8 @@
613
613
  class Box {
614
614
  constructor(args) {
615
615
  const pageScale = document.body.currentCSSZoom ?? 1;
616
- const factor = args instanceof DOMRect ? 1 + (1 - pageScale) / pageScale : 1;
616
+ const ignoreZoom = args.top === undefined; // detect DOMRect without breaking in jsdom
617
+ const factor = ignoreZoom ? 1 : 1 + (1 - pageScale) / pageScale;
617
618
  const {
618
619
  x,
619
620
  y,
@@ -683,13 +684,7 @@
683
684
  });
684
685
  }
685
686
  } else {
686
- const rect = el.getBoundingClientRect();
687
- return new Box({
688
- x: rect.x,
689
- y: rect.y,
690
- width: el.clientWidth,
691
- height: el.clientHeight
692
- });
687
+ return new Box(el.getBoundingClientRect());
693
688
  }
694
689
  }
695
690
 
@@ -11575,9 +11570,10 @@
11575
11570
  let clearDelay = () => {};
11576
11571
  function runDelay(isOpening, options) {
11577
11572
  clearDelay?.();
11578
- const delay = Math.max(options?.minDelay ?? 0, Number(isOpening ? props.openDelay : props.closeDelay));
11573
+ const delay = isOpening ? props.openDelay : props.closeDelay;
11574
+ const normalizedDelay = Math.max(options?.minDelay ?? 0, Number(delay ?? 0));
11579
11575
  return new Promise(resolve => {
11580
- clearDelay = defer(delay, () => {
11576
+ clearDelay = defer(normalizedDelay, () => {
11581
11577
  cb?.(isOpening);
11582
11578
  resolve(isOpening);
11583
11579
  });
@@ -13084,14 +13080,24 @@
13084
13080
  }
13085
13081
  function onInput(e) {
13086
13082
  const el = e.target;
13087
- model.value = el.value;
13088
- if (props.modelModifiers?.trim && ['text', 'search', 'password', 'tel', 'url'].includes(props.type)) {
13089
- const caretPosition = [el.selectionStart, el.selectionEnd];
13090
- vue.nextTick(() => {
13091
- el.selectionStart = caretPosition[0];
13092
- el.selectionEnd = caretPosition[1];
13093
- });
13083
+ if (!(props.modelModifiers?.trim && ['text', 'search', 'password', 'tel', 'url'].includes(props.type))) {
13084
+ model.value = el.value;
13085
+ return;
13094
13086
  }
13087
+ const value = el.value;
13088
+ const start = el.selectionStart;
13089
+ const end = el.selectionEnd;
13090
+ model.value = value;
13091
+ vue.nextTick(() => {
13092
+ let offset = 0;
13093
+ if (value.trimStart().length === el.value.length) {
13094
+ // #22307 - Whitespace has been removed from the
13095
+ // start, offset the caret position to compensate
13096
+ offset = value.length - el.value.length;
13097
+ }
13098
+ if (start != null) el.selectionStart = start - offset;
13099
+ if (end != null) el.selectionEnd = end - offset;
13100
+ });
13095
13101
  }
13096
13102
  useRender(() => {
13097
13103
  const hasCounter = !!(slots.counter || props.counter !== false && props.counter != null);
@@ -15818,6 +15824,12 @@
15818
15824
  roundedClasses
15819
15825
  } = useRounded(props);
15820
15826
  const link = useLink(props, attrs);
15827
+ const loadingColor = vue.shallowRef(undefined);
15828
+ vue.watch(() => props.loading, (val, old) => {
15829
+ loadingColor.value = !val && typeof old === 'string' ? old : typeof val === 'boolean' ? undefined : val;
15830
+ }, {
15831
+ immediate: true
15832
+ });
15821
15833
  useRender(() => {
15822
15834
  const isLink = props.link !== false && link.isLink.value;
15823
15835
  const isClickable = !props.disabled && props.link !== false && (props.link || link.isClickable.value);
@@ -15860,7 +15872,7 @@
15860
15872
  }, slots.image)]), vue.createVNode(LoaderSlot, {
15861
15873
  "name": "v-card",
15862
15874
  "active": !!props.loading,
15863
- "color": typeof props.loading === 'boolean' ? undefined : props.loading
15875
+ "color": loadingColor.value
15864
15876
  }, {
15865
15877
  default: slots.loader
15866
15878
  }), hasCardItem && vue.createVNode(VCardItem, {
@@ -19283,11 +19295,6 @@
19283
19295
  let keyGroups;
19284
19296
  let isSequence = false;
19285
19297
  let groupIndex = 0;
19286
- function clearTimer() {
19287
- if (!timeout) return;
19288
- clearTimeout(timeout);
19289
- timeout = 0;
19290
- }
19291
19298
  function isInputFocused() {
19292
19299
  if (vue.toValue(inputs)) return false;
19293
19300
  const activeElement = document.activeElement;
@@ -19295,12 +19302,12 @@
19295
19302
  }
19296
19303
  function resetSequence() {
19297
19304
  groupIndex = 0;
19298
- clearTimer();
19305
+ clearTimeout(timeout);
19299
19306
  }
19300
19307
  function handler(e) {
19301
19308
  const group = keyGroups[groupIndex];
19302
19309
  if (!group || isInputFocused()) return;
19303
- if (!matchesKeyGroup(e, group)) {
19310
+ if (!matchesKeyGroup(e, group, isMac)) {
19304
19311
  if (isSequence) resetSequence();
19305
19312
  return;
19306
19313
  }
@@ -19309,7 +19316,7 @@
19309
19316
  callback(e);
19310
19317
  return;
19311
19318
  }
19312
- clearTimer();
19319
+ clearTimeout(timeout);
19313
19320
  groupIndex++;
19314
19321
  if (groupIndex === keyGroups.length) {
19315
19322
  callback(e);
@@ -19320,12 +19327,12 @@
19320
19327
  }
19321
19328
  function cleanup() {
19322
19329
  window.removeEventListener(vue.toValue(event), handler);
19323
- clearTimer();
19330
+ clearTimeout(timeout);
19324
19331
  }
19325
- vue.watch(() => vue.toValue(keys), function (unrefKeys) {
19332
+ vue.watch(() => vue.toValue(keys), newKeys => {
19326
19333
  cleanup();
19327
- if (unrefKeys) {
19328
- const groups = splitKeySequence(unrefKeys.toLowerCase());
19334
+ if (newKeys) {
19335
+ const groups = splitKeySequence(newKeys.toLowerCase());
19329
19336
  isSequence = groups.length > 1;
19330
19337
  keyGroups = groups;
19331
19338
  resetSequence();
@@ -19336,55 +19343,50 @@
19336
19343
  });
19337
19344
 
19338
19345
  // Watch for changes in the event type to re-register the listener
19339
- vue.watch(() => vue.toValue(event), function (newEvent, oldEvent) {
19346
+ vue.watch(() => vue.toValue(event), (newEvent, oldEvent) => {
19340
19347
  if (oldEvent && keyGroups && keyGroups.length > 0) {
19341
19348
  window.removeEventListener(oldEvent, handler);
19342
19349
  window.addEventListener(newEvent, handler);
19343
19350
  }
19344
19351
  });
19345
- try {
19346
- getCurrentInstance('useHotkey');
19347
- vue.onBeforeUnmount(cleanup);
19348
- } catch {
19349
- // Not in Vue setup context
19350
- }
19351
- function parseKeyGroup(group) {
19352
- const MODIFIERS = ['ctrl', 'shift', 'alt', 'meta', 'cmd'];
19352
+ vue.onScopeDispose(cleanup, true);
19353
+ return cleanup;
19354
+ }
19355
+ function matchesKeyGroup(e, group, isMac) {
19356
+ const {
19357
+ modifiers,
19358
+ actualKey
19359
+ } = parseKeyGroup(group);
19360
+ const expectCtrl = modifiers.ctrl || !isMac && (modifiers.cmd || modifiers.meta);
19361
+ const expectMeta = isMac && (modifiers.cmd || modifiers.meta);
19362
+ return e.ctrlKey === expectCtrl && e.metaKey === expectMeta && e.shiftKey === modifiers.shift && e.altKey === modifiers.alt && e.key.toLowerCase() === actualKey?.toLowerCase();
19363
+ }
19364
+ function parseKeyGroup(group) {
19365
+ const MODIFIERS = ['ctrl', 'shift', 'alt', 'meta', 'cmd'];
19353
19366
 
19354
- // Use the shared combination splitting logic
19355
- const parts = splitKeyCombination(group.toLowerCase());
19367
+ // Use the shared combination splitting logic
19368
+ const parts = splitKeyCombination(group.toLowerCase());
19356
19369
 
19357
- // If the combination is invalid, return empty result
19358
- if (parts.length === 0) {
19359
- return {
19360
- modifiers: Object.fromEntries(MODIFIERS.map(m => [m, false])),
19361
- actualKey: undefined
19362
- };
19363
- }
19364
- const modifiers = Object.fromEntries(MODIFIERS.map(m => [m, false]));
19365
- let actualKey;
19366
- for (const part of parts) {
19367
- if (MODIFIERS.includes(part)) {
19368
- modifiers[part] = true;
19369
- } else {
19370
- actualKey = part;
19371
- }
19372
- }
19370
+ // If the combination is invalid, return empty result
19371
+ if (parts.length === 0) {
19373
19372
  return {
19374
- modifiers,
19375
- actualKey
19373
+ modifiers: Object.fromEntries(MODIFIERS.map(m => [m, false])),
19374
+ actualKey: undefined
19376
19375
  };
19377
19376
  }
19378
- function matchesKeyGroup(e, group) {
19379
- const {
19380
- modifiers,
19381
- actualKey
19382
- } = parseKeyGroup(group);
19383
- const expectCtrl = modifiers.ctrl || !isMac && (modifiers.cmd || modifiers.meta);
19384
- const expectMeta = isMac && (modifiers.cmd || modifiers.meta);
19385
- return e.ctrlKey === expectCtrl && e.metaKey === expectMeta && e.shiftKey === modifiers.shift && e.altKey === modifiers.alt && e.key.toLowerCase() === actualKey?.toLowerCase();
19377
+ const modifiers = Object.fromEntries(MODIFIERS.map(m => [m, false]));
19378
+ let actualKey;
19379
+ for (const part of parts) {
19380
+ if (MODIFIERS.includes(part)) {
19381
+ modifiers[part] = true;
19382
+ } else {
19383
+ actualKey = part;
19384
+ }
19386
19385
  }
19387
- return cleanup;
19386
+ return {
19387
+ modifiers,
19388
+ actualKey
19389
+ };
19388
19390
  }
19389
19391
 
19390
19392
  // Utilities
@@ -24005,11 +24007,15 @@
24005
24007
  return week.length ? adapter.getWeek(week[0], props.firstDayOfWeek, props.firstDayOfYear) : null;
24006
24008
  });
24007
24009
  });
24010
+ const {
24011
+ minDate,
24012
+ maxDate
24013
+ } = useCalendarRange(props);
24008
24014
  function isDisabled(value) {
24009
24015
  if (props.disabled) return true;
24010
24016
  const date = adapter.date(value);
24011
- if (props.min && adapter.isBefore(adapter.endOfDay(date), adapter.date(props.min))) return true;
24012
- if (props.max && adapter.isAfter(date, adapter.date(props.max))) return true;
24017
+ if (minDate.value && adapter.isBefore(adapter.endOfDay(date), minDate.value)) return true;
24018
+ if (maxDate.value && adapter.isAfter(date, maxDate.value)) return true;
24013
24019
  if (Array.isArray(props.allowedDates) && props.allowedDates.length > 0) {
24014
24020
  return !props.allowedDates.some(d => adapter.isSameDay(adapter.date(d), date));
24015
24021
  }
@@ -24029,6 +24035,37 @@
24029
24035
  weekNumbers
24030
24036
  };
24031
24037
  }
24038
+ function useCalendarRange(props) {
24039
+ const adapter = useDate();
24040
+ const minDate = vue.computed(() => {
24041
+ if (!props.min) return null;
24042
+ const date = adapter.date(props.min);
24043
+ return adapter.isValid(date) ? date : null;
24044
+ });
24045
+ const maxDate = vue.computed(() => {
24046
+ if (!props.max) return null;
24047
+ const date = adapter.date(props.max);
24048
+ return adapter.isValid(date) ? date : null;
24049
+ });
24050
+ function clampDate(date) {
24051
+ if (minDate.value && adapter.isBefore(date, minDate.value)) {
24052
+ return minDate.value;
24053
+ }
24054
+ if (maxDate.value && adapter.isAfter(date, maxDate.value)) {
24055
+ return maxDate.value;
24056
+ }
24057
+ return date;
24058
+ }
24059
+ function isInAllowedRange(date) {
24060
+ return (!minDate.value || adapter.isAfter(date, minDate.value)) && (!maxDate.value || adapter.isBefore(date, maxDate.value));
24061
+ }
24062
+ return {
24063
+ minDate,
24064
+ maxDate,
24065
+ clampDate,
24066
+ isInAllowedRange
24067
+ };
24068
+ }
24032
24069
 
24033
24070
  // Types
24034
24071
 
@@ -24469,24 +24506,14 @@
24469
24506
  const viewMode = useProxiedModel(props, 'viewMode');
24470
24507
  // const inputMode = useProxiedModel(props, 'inputMode')
24471
24508
 
24472
- const minDate = vue.computed(() => {
24473
- const date = adapter.date(props.min);
24474
- return props.min && adapter.isValid(date) ? date : null;
24475
- });
24476
- const maxDate = vue.computed(() => {
24477
- const date = adapter.date(props.max);
24478
- return props.max && adapter.isValid(date) ? date : null;
24479
- });
24509
+ const {
24510
+ minDate,
24511
+ maxDate,
24512
+ clampDate
24513
+ } = useCalendarRange(props);
24480
24514
  const internal = vue.computed(() => {
24481
24515
  const today = adapter.date();
24482
- let value = today;
24483
- if (model.value?.[0]) {
24484
- value = adapter.date(model.value[0]);
24485
- } else if (minDate.value && adapter.isBefore(today, minDate.value)) {
24486
- value = minDate.value;
24487
- } else if (maxDate.value && adapter.isAfter(today, maxDate.value)) {
24488
- value = maxDate.value;
24489
- }
24516
+ const value = model.value?.[0] ? adapter.date(model.value[0]) : clampDate(today);
24490
24517
  return value && adapter.isValid(value) ? value : today;
24491
24518
  });
24492
24519
  const headerColor = vue.toRef(() => props.headerColor ?? props.color);
@@ -30273,14 +30300,24 @@
30273
30300
  }
30274
30301
  function onInput(e) {
30275
30302
  const el = e.target;
30276
- model.value = el.value;
30277
- if (props.modelModifiers?.trim) {
30278
- const caretPosition = [el.selectionStart, el.selectionEnd];
30279
- vue.nextTick(() => {
30280
- el.selectionStart = caretPosition[0];
30281
- el.selectionEnd = caretPosition[1];
30282
- });
30303
+ if (!props.modelModifiers?.trim) {
30304
+ model.value = el.value;
30305
+ return;
30283
30306
  }
30307
+ const value = el.value;
30308
+ const start = el.selectionStart;
30309
+ const end = el.selectionEnd;
30310
+ model.value = value;
30311
+ vue.nextTick(() => {
30312
+ let offset = 0;
30313
+ if (value.trimStart().length === el.value.length) {
30314
+ // #22307 - Whitespace has been removed from the
30315
+ // start, offset the caret position to compensate
30316
+ offset = value.length - el.value.length;
30317
+ }
30318
+ if (start != null) el.selectionStart = start - offset;
30319
+ if (end != null) el.selectionEnd = end - offset;
30320
+ });
30284
30321
  }
30285
30322
  const sizerRef = vue.ref();
30286
30323
  const rows = vue.ref(Number(props.rows));
@@ -32519,7 +32556,7 @@
32519
32556
  };
32520
32557
  });
32521
32558
  }
32522
- const version$1 = "3.10.9";
32559
+ const version$1 = "3.10.10";
32523
32560
  createVuetify$1.version = version$1;
32524
32561
 
32525
32562
  // Vue's inject() can only be used in setup
@@ -32544,7 +32581,7 @@
32544
32581
  ...options
32545
32582
  });
32546
32583
  };
32547
- const version = "3.10.9";
32584
+ const version = "3.10.10";
32548
32585
  createVuetify.version = version;
32549
32586
 
32550
32587
  exports.blueprints = index;