@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.
package/dist/vuetify.js CHANGED
@@ -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
  */
@@ -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'];
@@ -25175,25 +25190,33 @@
25175
25190
  }
25176
25191
  function onBeforeinput(e) {
25177
25192
  if (!e.data) return;
25178
- const existingTxt = e.target?.value;
25179
- const selectionStart = e.target?.selectionStart;
25180
- const selectionEnd = e.target?.selectionEnd;
25193
+ const inputElement = e.target;
25194
+ const {
25195
+ value: existingTxt,
25196
+ selectionStart,
25197
+ selectionEnd
25198
+ } = inputElement ?? {};
25181
25199
  const potentialNewInputVal = existingTxt ? existingTxt.slice(0, selectionStart) + e.data + existingTxt.slice(selectionEnd) : e.data;
25200
+ const potentialNewNumber = extractNumber(potentialNewInputVal, props.precision);
25201
+
25182
25202
  // Only numbers, "-", "." are allowed
25183
25203
  // AND "-", "." are allowed only once
25184
25204
  // AND "-" is only allowed at the start
25185
25205
  if (!/^-?(\d+(\.\d*)?|(\.\d+)|\d*|\.)$/.test(potentialNewInputVal)) {
25186
25206
  e.preventDefault();
25207
+ inputElement.value = potentialNewNumber;
25187
25208
  }
25188
25209
  if (props.precision == null) return;
25189
25210
 
25190
25211
  // Ignore decimal digits above precision limit
25191
25212
  if (potentialNewInputVal.split('.')[1]?.length > props.precision) {
25192
25213
  e.preventDefault();
25214
+ inputElement.value = potentialNewNumber;
25193
25215
  }
25194
25216
  // Ignore decimal separator when precision = 0
25195
25217
  if (props.precision === 0 && potentialNewInputVal.includes('.')) {
25196
25218
  e.preventDefault();
25219
+ inputElement.value = potentialNewNumber;
25197
25220
  }
25198
25221
  }
25199
25222
  async function onKeydown(e) {
@@ -29294,7 +29317,7 @@
29294
29317
  };
29295
29318
  });
29296
29319
  }
29297
- const version$1 = "3.8.6-master.2025-05-22";
29320
+ const version$1 = "3.8.6-master.2025-05-23";
29298
29321
  createVuetify$1.version = version$1;
29299
29322
 
29300
29323
  // Vue's inject() can only be used in setup
@@ -29319,7 +29342,7 @@
29319
29342
  ...options
29320
29343
  });
29321
29344
  };
29322
- const version = "3.8.6-master.2025-05-22";
29345
+ const version = "3.8.6-master.2025-05-23";
29323
29346
  createVuetify.version = version;
29324
29347
 
29325
29348
  exports.blueprints = index;