@vuetify/nightly 3.8.6-master.2025-05-22 → 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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vuetify v3.8.6-master.2025-05-22
2
+ * Vuetify v3.8.6-master.2025-05-23
3
3
  * Forged by John Leider
4
4
  * Released under the MIT License.
5
5
  */
@@ -591,6 +591,21 @@
591
591
  function isPrimitive(value) {
592
592
  return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' || typeof value === 'bigint';
593
593
  }
594
+ function extractNumber(text, decimalDigitsLimit) {
595
+ const cleanText = text.split('').filter(x => /[\d\-.]/.test(x)).filter((x, i, all) => i === 0 && /[-]/.test(x) ||
596
+ // sign allowed at the start
597
+ x === '.' && i === all.indexOf('.') ||
598
+ // decimal separator allowed only once
599
+ /\d/.test(x)).join('');
600
+ if (decimalDigitsLimit === 0) {
601
+ return cleanText.split('.')[0];
602
+ }
603
+ if (decimalDigitsLimit !== null && /\.\d/.test(cleanText)) {
604
+ const parts = cleanText.split('.');
605
+ return [parts[0], parts[1].substring(0, decimalDigitsLimit)].join('.');
606
+ }
607
+ return cleanText;
608
+ }
594
609
 
595
610
  // Utilities
596
611
  const block = ['top', 'bottom'];
@@ -24897,25 +24912,33 @@
24897
24912
  }
24898
24913
  function onBeforeinput(e) {
24899
24914
  if (!e.data) return;
24900
- const existingTxt = e.target?.value;
24901
- const selectionStart = e.target?.selectionStart;
24902
- const selectionEnd = e.target?.selectionEnd;
24915
+ const inputElement = e.target;
24916
+ const {
24917
+ value: existingTxt,
24918
+ selectionStart,
24919
+ selectionEnd
24920
+ } = inputElement ?? {};
24903
24921
  const potentialNewInputVal = existingTxt ? existingTxt.slice(0, selectionStart) + e.data + existingTxt.slice(selectionEnd) : e.data;
24922
+ const potentialNewNumber = extractNumber(potentialNewInputVal, props.precision);
24923
+
24904
24924
  // Only numbers, "-", "." are allowed
24905
24925
  // AND "-", "." are allowed only once
24906
24926
  // AND "-" is only allowed at the start
24907
24927
  if (!/^-?(\d+(\.\d*)?|(\.\d+)|\d*|\.)$/.test(potentialNewInputVal)) {
24908
24928
  e.preventDefault();
24929
+ inputElement.value = potentialNewNumber;
24909
24930
  }
24910
24931
  if (props.precision == null) return;
24911
24932
 
24912
24933
  // Ignore decimal digits above precision limit
24913
24934
  if (potentialNewInputVal.split('.')[1]?.length > props.precision) {
24914
24935
  e.preventDefault();
24936
+ inputElement.value = potentialNewNumber;
24915
24937
  }
24916
24938
  // Ignore decimal separator when precision = 0
24917
24939
  if (props.precision === 0 && potentialNewInputVal.includes('.')) {
24918
24940
  e.preventDefault();
24941
+ inputElement.value = potentialNewNumber;
24919
24942
  }
24920
24943
  }
24921
24944
  async function onKeydown(e) {
@@ -31989,7 +32012,7 @@
31989
32012
  };
31990
32013
  });
31991
32014
  }
31992
- const version$1 = "3.8.6-master.2025-05-22";
32015
+ const version$1 = "3.8.6-master.2025-05-23";
31993
32016
  createVuetify$1.version = version$1;
31994
32017
 
31995
32018
  // Vue's inject() can only be used in setup
@@ -32287,7 +32310,7 @@
32287
32310
 
32288
32311
  /* eslint-disable local-rules/sort-imports */
32289
32312
 
32290
- const version = "3.8.6-master.2025-05-22";
32313
+ const version = "3.8.6-master.2025-05-23";
32291
32314
 
32292
32315
  /* eslint-disable local-rules/sort-imports */
32293
32316