@vuetify/nightly 3.7.12-master.2025-02-14 → 3.7.12-master.2025-02-17

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 (41) hide show
  1. package/CHANGELOG.md +12 -3
  2. package/dist/json/attributes.json +2936 -2924
  3. package/dist/json/importMap-labs.json +16 -16
  4. package/dist/json/importMap.json +174 -174
  5. package/dist/json/tags.json +3 -0
  6. package/dist/json/web-types.json +5456 -5428
  7. package/dist/vuetify-labs.css +3803 -3795
  8. package/dist/vuetify-labs.d.ts +80 -29
  9. package/dist/vuetify-labs.esm.js +109 -46
  10. package/dist/vuetify-labs.esm.js.map +1 -1
  11. package/dist/vuetify-labs.js +109 -46
  12. package/dist/vuetify-labs.min.css +2 -2
  13. package/dist/vuetify.css +3706 -3706
  14. package/dist/vuetify.d.ts +86 -74
  15. package/dist/vuetify.esm.js +20 -13
  16. package/dist/vuetify.esm.js.map +1 -1
  17. package/dist/vuetify.js +20 -13
  18. package/dist/vuetify.js.map +1 -1
  19. package/dist/vuetify.min.css +2 -2
  20. package/dist/vuetify.min.js +6 -6
  21. package/dist/vuetify.min.js.map +1 -1
  22. package/lib/components/VDataTable/composables/sort.mjs +12 -8
  23. package/lib/components/VDataTable/composables/sort.mjs.map +1 -1
  24. package/lib/components/VDatePicker/VDatePickerControls.mjs +1 -1
  25. package/lib/components/VDatePicker/VDatePickerControls.mjs.map +1 -1
  26. package/lib/components/VDatePicker/index.d.mts +27 -15
  27. package/lib/components/index.d.mts +27 -15
  28. package/lib/composables/calendar.mjs +4 -1
  29. package/lib/composables/calendar.mjs.map +1 -1
  30. package/lib/entry-bundler.mjs +1 -1
  31. package/lib/framework.mjs +1 -1
  32. package/lib/index.d.mts +59 -59
  33. package/lib/labs/VCalendar/index.d.mts +8 -2
  34. package/lib/labs/VDateInput/index.d.mts +8 -2
  35. package/lib/labs/VNumberInput/VNumberInput.css +10 -2
  36. package/lib/labs/VNumberInput/VNumberInput.mjs +93 -35
  37. package/lib/labs/VNumberInput/VNumberInput.mjs.map +1 -1
  38. package/lib/labs/VNumberInput/VNumberInput.sass +12 -2
  39. package/lib/labs/VNumberInput/index.d.mts +37 -10
  40. package/lib/labs/components.d.mts +53 -14
  41. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vuetify v3.7.12-master.2025-02-14
2
+ * Vuetify v3.7.12-master.2025-02-17
3
3
  * Forged by John Leider
4
4
  * Released under the MIT License.
5
5
  */
@@ -18834,15 +18834,19 @@
18834
18834
  })) ?? [];
18835
18835
  const item = newSortBy.find(x => x.key === column.key);
18836
18836
  if (!item) {
18837
- if (multiSort.value) newSortBy = [...newSortBy, {
18838
- key: column.key,
18839
- order: 'asc'
18840
- }];else newSortBy = [{
18841
- key: column.key,
18842
- order: 'asc'
18843
- }];
18837
+ if (multiSort.value) {
18838
+ newSortBy.push({
18839
+ key: column.key,
18840
+ order: 'asc'
18841
+ });
18842
+ } else {
18843
+ newSortBy = [{
18844
+ key: column.key,
18845
+ order: 'asc'
18846
+ }];
18847
+ }
18844
18848
  } else if (item.order === 'desc') {
18845
- if (mustSort.value) {
18849
+ if (mustSort.value && newSortBy.length === 1) {
18846
18850
  item.order = 'asc';
18847
18851
  } else {
18848
18852
  newSortBy = newSortBy.filter(x => x.key !== column.key);
@@ -21467,7 +21471,7 @@
21467
21471
  },
21468
21472
  disabled: {
21469
21473
  type: [Boolean, String, Array],
21470
- default: false
21474
+ default: null
21471
21475
  },
21472
21476
  nextIcon: {
21473
21477
  type: IconValue,
@@ -21649,7 +21653,10 @@
21649
21653
  // Composables
21650
21654
  const makeCalendarProps = propsFactory({
21651
21655
  allowedDates: [Array, Function],
21652
- disabled: Boolean,
21656
+ disabled: {
21657
+ type: Boolean,
21658
+ default: null
21659
+ },
21653
21660
  displayValue: null,
21654
21661
  modelValue: Array,
21655
21662
  month: [Number, String],
@@ -28675,7 +28682,11 @@
28675
28682
  type: Number,
28676
28683
  default: 1
28677
28684
  },
28678
- ...omit(makeVTextFieldProps({}), ['appendInnerIcon', 'modelValue', 'prependInnerIcon'])
28685
+ precision: {
28686
+ type: Number,
28687
+ default: 0
28688
+ },
28689
+ ...omit(makeVTextFieldProps({}), ['modelValue'])
28679
28690
  }, 'VNumberInput');
28680
28691
  const VNumberInput = genericComponent()({
28681
28692
  name: 'VNumberInput',
@@ -28689,27 +28700,37 @@
28689
28700
  let {
28690
28701
  slots
28691
28702
  } = _ref;
28692
- const _model = useProxiedModel(props, 'modelValue');
28693
- const model = vue.computed({
28694
- get: () => _model.value,
28695
- // model.value could be empty string from VTextField
28696
- // but _model.value should be eventually kept in type Number | null
28703
+ const vTextFieldRef = vue.ref();
28704
+ const form = useForm(props);
28705
+ const controlsDisabled = vue.computed(() => form.isDisabled.value || form.isReadonly.value);
28706
+ const isFocused = vue.ref(false);
28707
+ function correctPrecision(val) {
28708
+ let precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : props.precision;
28709
+ const fixed = precision == null ? String(val) : val.toFixed(precision);
28710
+ return isFocused.value ? Number(fixed).toString() // trim zeros
28711
+ : fixed;
28712
+ }
28713
+ const model = useProxiedModel(props, 'modelValue', null, val => val ?? null, val => val == null ? val ?? null : clamp(+val, props.min, props.max));
28714
+ const _inputText = vue.shallowRef(null);
28715
+ vue.watchEffect(() => {
28716
+ if (isFocused.value && !controlsDisabled.value) ; else if (model.value == null || controlsDisabled.value) {
28717
+ _inputText.value = model.value && !isNaN(model.value) ? String(model.value) : null;
28718
+ } else if (!isNaN(model.value)) {
28719
+ _inputText.value = correctPrecision(model.value);
28720
+ }
28721
+ });
28722
+ const inputText = vue.computed({
28723
+ get: () => _inputText.value,
28697
28724
  set(val) {
28698
28725
  if (val === null || val === '') {
28699
- _model.value = null;
28700
- return;
28701
- }
28702
- const value = Number(val);
28703
- if (!isNaN(value) && value <= props.max && value >= props.min) {
28704
- _model.value = value;
28726
+ model.value = null;
28727
+ _inputText.value = null;
28728
+ } else if (!isNaN(+val) && +val <= props.max && +val >= props.min) {
28729
+ model.value = +val;
28730
+ _inputText.value = val;
28705
28731
  }
28706
28732
  }
28707
28733
  });
28708
- const vTextFieldRef = vue.ref();
28709
- const stepDecimals = vue.computed(() => getDecimals(props.step));
28710
- const modelDecimals = vue.computed(() => typeof model.value === 'number' ? getDecimals(model.value) : 0);
28711
- const form = useForm(props);
28712
- const controlsDisabled = vue.computed(() => form.isDisabled.value || form.isReadonly.value);
28713
28734
  const canIncrease = vue.computed(() => {
28714
28735
  if (controlsDisabled.value) return false;
28715
28736
  return (model.value ?? 0) + props.step <= props.max;
@@ -28731,23 +28752,29 @@
28731
28752
  const decrementSlotProps = vue.computed(() => ({
28732
28753
  click: onClickDown
28733
28754
  }));
28755
+ vue.watch(() => props.precision, () => formatInputValue());
28734
28756
  vue.onMounted(() => {
28735
- if (!controlsDisabled.value) {
28736
- clampModel();
28737
- }
28757
+ clampModel();
28738
28758
  });
28759
+ function inferPrecision(value) {
28760
+ if (value == null) return 0;
28761
+ const str = value.toString();
28762
+ const idx = str.indexOf('.');
28763
+ return ~idx ? str.length - idx : 0;
28764
+ }
28739
28765
  function toggleUpDown() {
28740
28766
  let increment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
28741
28767
  if (controlsDisabled.value) return;
28742
28768
  if (model.value == null) {
28743
- model.value = clamp(0, props.min, props.max);
28769
+ inputText.value = correctPrecision(clamp(0, props.min, props.max));
28744
28770
  return;
28745
28771
  }
28746
- const decimals = Math.max(modelDecimals.value, stepDecimals.value);
28772
+ let inferredPrecision = Math.max(inferPrecision(model.value), inferPrecision(props.step));
28773
+ if (props.precision != null) inferredPrecision = Math.max(inferredPrecision, props.precision);
28747
28774
  if (increment) {
28748
- if (canIncrease.value) model.value = +(model.value + props.step).toFixed(decimals);
28775
+ if (canIncrease.value) inputText.value = correctPrecision(model.value + props.step, inferredPrecision);
28749
28776
  } else {
28750
- if (canDecrease.value) model.value = +(model.value - props.step).toFixed(decimals);
28777
+ if (canDecrease.value) inputText.value = correctPrecision(model.value - props.step, inferredPrecision);
28751
28778
  }
28752
28779
  }
28753
28780
  function onClickUp(e) {
@@ -28770,6 +28797,16 @@
28770
28797
  if (!/^-?(\d+(\.\d*)?|(\.\d+)|\d*|\.)$/.test(potentialNewInputVal)) {
28771
28798
  e.preventDefault();
28772
28799
  }
28800
+ if (props.precision == null) return;
28801
+
28802
+ // Ignore decimal digits above precision limit
28803
+ if (potentialNewInputVal.split('.')[1]?.length > props.precision) {
28804
+ e.preventDefault();
28805
+ }
28806
+ // Ignore decimal separator when precision = 0
28807
+ if (props.precision === 0 && potentialNewInputVal.includes('.')) {
28808
+ e.preventDefault();
28809
+ }
28773
28810
  }
28774
28811
  async function onKeydown(e) {
28775
28812
  if (['Enter', 'ArrowLeft', 'ArrowRight', 'Backspace', 'Delete', 'Tab'].includes(e.key) || e.ctrlKey) return;
@@ -28789,14 +28826,39 @@
28789
28826
  e.stopPropagation();
28790
28827
  }
28791
28828
  function clampModel() {
28829
+ if (controlsDisabled.value) return;
28792
28830
  if (!vTextFieldRef.value) return;
28793
- const inputText = vTextFieldRef.value.value;
28794
- if (inputText && !isNaN(+inputText)) {
28795
- model.value = clamp(+inputText, props.min, props.max);
28831
+ const actualText = vTextFieldRef.value.value;
28832
+ if (actualText && !isNaN(+actualText)) {
28833
+ inputText.value = correctPrecision(clamp(+actualText, props.min, props.max));
28796
28834
  } else {
28797
- model.value = null;
28835
+ inputText.value = null;
28798
28836
  }
28799
28837
  }
28838
+ function formatInputValue() {
28839
+ if (controlsDisabled.value) return;
28840
+ if (model.value === null || isNaN(model.value)) {
28841
+ inputText.value = null;
28842
+ return;
28843
+ }
28844
+ inputText.value = props.precision == null ? String(model.value) : model.value.toFixed(props.precision);
28845
+ }
28846
+ function trimDecimalZeros() {
28847
+ if (controlsDisabled.value) return;
28848
+ if (model.value === null || isNaN(model.value)) {
28849
+ inputText.value = null;
28850
+ return;
28851
+ }
28852
+ inputText.value = model.value.toString();
28853
+ }
28854
+ function onFocus() {
28855
+ isFocused.value = true;
28856
+ trimDecimalZeros();
28857
+ }
28858
+ function onBlur() {
28859
+ isFocused.value = false;
28860
+ clampModel();
28861
+ }
28800
28862
  useRender(() => {
28801
28863
  const {
28802
28864
  modelValue: _,
@@ -28874,20 +28936,21 @@
28874
28936
  "class": "v-number-input__control"
28875
28937
  }, [vue.createVNode(VDivider, {
28876
28938
  "vertical": true
28877
- }, null), incrementControlNode()]) : props.reverse ? undefined : vue.createVNode(vue.Fragment, null, [dividerNode(), controlNode()]);
28939
+ }, null), incrementControlNode()]) : props.reverse || controlVariant.value === 'hidden' ? undefined : vue.createVNode(vue.Fragment, null, [dividerNode(), controlNode()]);
28878
28940
  const hasAppendInner = slots['append-inner'] || appendInnerControl;
28879
28941
  const prependInnerControl = controlVariant.value === 'split' ? vue.createVNode("div", {
28880
28942
  "class": "v-number-input__control"
28881
28943
  }, [decrementControlNode(), vue.createVNode(VDivider, {
28882
28944
  "vertical": true
28883
- }, null)]) : props.reverse ? vue.createVNode(vue.Fragment, null, [controlNode(), dividerNode()]) : undefined;
28945
+ }, null)]) : props.reverse && controlVariant.value !== 'hidden' ? vue.createVNode(vue.Fragment, null, [controlNode(), dividerNode()]) : undefined;
28884
28946
  const hasPrependInner = slots['prepend-inner'] || prependInnerControl;
28885
28947
  return vue.createVNode(VTextField, vue.mergeProps({
28886
28948
  "ref": vTextFieldRef,
28887
- "modelValue": model.value,
28888
- "onUpdate:modelValue": $event => model.value = $event,
28949
+ "modelValue": inputText.value,
28950
+ "onUpdate:modelValue": $event => inputText.value = $event,
28889
28951
  "onBeforeinput": onBeforeinput,
28890
- "onChange": clampModel,
28952
+ "onFocus": onFocus,
28953
+ "onBlur": onBlur,
28891
28954
  "onKeydown": onKeydown,
28892
28955
  "class": ['v-number-input', {
28893
28956
  'v-number-input--default': controlVariant.value === 'default',
@@ -30907,7 +30970,7 @@
30907
30970
  goTo
30908
30971
  };
30909
30972
  }
30910
- const version$1 = "3.7.12-master.2025-02-14";
30973
+ const version$1 = "3.7.12-master.2025-02-17";
30911
30974
  createVuetify$1.version = version$1;
30912
30975
 
30913
30976
  // Vue's inject() can only be used in setup
@@ -31160,7 +31223,7 @@
31160
31223
 
31161
31224
  /* eslint-disable local-rules/sort-imports */
31162
31225
 
31163
- const version = "3.7.12-master.2025-02-14";
31226
+ const version = "3.7.12-master.2025-02-17";
31164
31227
 
31165
31228
  /* eslint-disable local-rules/sort-imports */
31166
31229