@vuetify/nightly 3.8.6-master.2025-05-21 → 3.8.6-master.2025-05-23

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/vuetify.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vuetify v3.8.6-master.2025-05-21
2
+ * Vuetify v3.8.6-master.2025-05-23
3
3
  * Forged by John Leider
4
4
  * Released under the MIT License.
5
5
  */
@@ -514,6 +514,21 @@
514
514
  function isPrimitive(value) {
515
515
  return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' || typeof value === 'bigint';
516
516
  }
517
+ function extractNumber(text, decimalDigitsLimit) {
518
+ const cleanText = text.split('').filter(x => /[\d\-.]/.test(x)).filter((x, i, all) => i === 0 && /[-]/.test(x) ||
519
+ // sign allowed at the start
520
+ x === '.' && i === all.indexOf('.') ||
521
+ // decimal separator allowed only once
522
+ /\d/.test(x)).join('');
523
+ if (decimalDigitsLimit === 0) {
524
+ return cleanText.split('.')[0];
525
+ }
526
+ if (decimalDigitsLimit !== null && /\.\d/.test(cleanText)) {
527
+ const parts = cleanText.split('.');
528
+ return [parts[0], parts[1].substring(0, decimalDigitsLimit)].join('.');
529
+ }
530
+ return cleanText;
531
+ }
517
532
 
518
533
  // Utilities
519
534
  const block = ['top', 'bottom'];
@@ -618,6 +633,33 @@
618
633
  return target.getBoundingClientRect();
619
634
  }
620
635
  }
636
+ function getElementBox(el) {
637
+ if (el === document.documentElement) {
638
+ if (!visualViewport) {
639
+ return new Box({
640
+ x: 0,
641
+ y: 0,
642
+ width: document.documentElement.clientWidth,
643
+ height: document.documentElement.clientHeight
644
+ });
645
+ } else {
646
+ return new Box({
647
+ x: visualViewport.scale > 1 ? 0 : visualViewport.offsetLeft,
648
+ y: visualViewport.scale > 1 ? 0 : visualViewport.offsetTop,
649
+ width: visualViewport.width * visualViewport.scale,
650
+ height: visualViewport.height * visualViewport.scale
651
+ });
652
+ }
653
+ } else {
654
+ const rect = el.getBoundingClientRect();
655
+ return new Box({
656
+ x: rect.x,
657
+ y: rect.y,
658
+ width: el.clientWidth,
659
+ height: el.clientHeight
660
+ });
661
+ }
662
+ }
621
663
 
622
664
  // Utilities
623
665
 
@@ -10278,11 +10320,19 @@
10278
10320
  vue.watch(() => props.locationStrategy, reset);
10279
10321
  vue.onScopeDispose(() => {
10280
10322
  window.removeEventListener('resize', onResize);
10323
+ visualViewport?.removeEventListener('resize', onVisualResize);
10324
+ visualViewport?.removeEventListener('scroll', onVisualScroll);
10281
10325
  updateLocation.value = undefined;
10282
10326
  });
10283
10327
  window.addEventListener('resize', onResize, {
10284
10328
  passive: true
10285
10329
  });
10330
+ visualViewport?.addEventListener('resize', onVisualResize, {
10331
+ passive: true
10332
+ });
10333
+ visualViewport?.addEventListener('scroll', onVisualScroll, {
10334
+ passive: true
10335
+ });
10286
10336
  if (typeof props.locationStrategy === 'function') {
10287
10337
  updateLocation.value = props.locationStrategy(data, props, contentStyles)?.updateLocation;
10288
10338
  } else {
@@ -10293,6 +10343,12 @@
10293
10343
  function onResize(e) {
10294
10344
  updateLocation.value?.(e);
10295
10345
  }
10346
+ function onVisualResize(e) {
10347
+ updateLocation.value?.(e);
10348
+ }
10349
+ function onVisualScroll(e) {
10350
+ updateLocation.value?.(e);
10351
+ }
10296
10352
  return {
10297
10353
  contentStyles,
10298
10354
  updateLocation
@@ -10444,13 +10500,7 @@
10444
10500
  }
10445
10501
  }
10446
10502
  const viewport = scrollParents.reduce((box, el) => {
10447
- const rect = el.getBoundingClientRect();
10448
- const scrollBox = new Box({
10449
- x: el === document.documentElement ? 0 : rect.x,
10450
- y: el === document.documentElement ? 0 : rect.y,
10451
- width: el.clientWidth,
10452
- height: el.clientHeight
10453
- });
10503
+ const scrollBox = getElementBox(el);
10454
10504
  if (box) {
10455
10505
  return new Box({
10456
10506
  x: Math.max(box.left, scrollBox.left),
@@ -25140,25 +25190,33 @@
25140
25190
  }
25141
25191
  function onBeforeinput(e) {
25142
25192
  if (!e.data) return;
25143
- const existingTxt = e.target?.value;
25144
- const selectionStart = e.target?.selectionStart;
25145
- const selectionEnd = e.target?.selectionEnd;
25193
+ const inputElement = e.target;
25194
+ const {
25195
+ value: existingTxt,
25196
+ selectionStart,
25197
+ selectionEnd
25198
+ } = inputElement ?? {};
25146
25199
  const potentialNewInputVal = existingTxt ? existingTxt.slice(0, selectionStart) + e.data + existingTxt.slice(selectionEnd) : e.data;
25200
+ const potentialNewNumber = extractNumber(potentialNewInputVal, props.precision);
25201
+
25147
25202
  // Only numbers, "-", "." are allowed
25148
25203
  // AND "-", "." are allowed only once
25149
25204
  // AND "-" is only allowed at the start
25150
25205
  if (!/^-?(\d+(\.\d*)?|(\.\d+)|\d*|\.)$/.test(potentialNewInputVal)) {
25151
25206
  e.preventDefault();
25207
+ inputElement.value = potentialNewNumber;
25152
25208
  }
25153
25209
  if (props.precision == null) return;
25154
25210
 
25155
25211
  // Ignore decimal digits above precision limit
25156
25212
  if (potentialNewInputVal.split('.')[1]?.length > props.precision) {
25157
25213
  e.preventDefault();
25214
+ inputElement.value = potentialNewNumber;
25158
25215
  }
25159
25216
  // Ignore decimal separator when precision = 0
25160
25217
  if (props.precision === 0 && potentialNewInputVal.includes('.')) {
25161
25218
  e.preventDefault();
25219
+ inputElement.value = potentialNewNumber;
25162
25220
  }
25163
25221
  }
25164
25222
  async function onKeydown(e) {
@@ -29259,7 +29317,7 @@
29259
29317
  };
29260
29318
  });
29261
29319
  }
29262
- const version$1 = "3.8.6-master.2025-05-21";
29320
+ const version$1 = "3.8.6-master.2025-05-23";
29263
29321
  createVuetify$1.version = version$1;
29264
29322
 
29265
29323
  // Vue's inject() can only be used in setup
@@ -29284,7 +29342,7 @@
29284
29342
  ...options
29285
29343
  });
29286
29344
  };
29287
- const version = "3.8.6-master.2025-05-21";
29345
+ const version = "3.8.6-master.2025-05-23";
29288
29346
  createVuetify.version = version;
29289
29347
 
29290
29348
  exports.blueprints = index;