vuetify 3.1.3 → 3.1.4

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 (120) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/json/attributes.json +682 -642
  3. package/dist/json/importMap-labs.json +4 -0
  4. package/dist/json/importMap.json +34 -34
  5. package/dist/json/tags.json +18 -3
  6. package/dist/json/web-types.json +943 -830
  7. package/dist/vuetify-labs.css +2987 -2985
  8. package/dist/vuetify-labs.d.ts +211 -50
  9. package/dist/vuetify-labs.esm.js +97 -79
  10. package/dist/vuetify-labs.esm.js.map +1 -1
  11. package/dist/vuetify-labs.js +96 -78
  12. package/dist/vuetify-labs.min.css +2 -2
  13. package/dist/vuetify.css +43 -40
  14. package/dist/vuetify.d.ts +144 -13
  15. package/dist/vuetify.esm.js +40 -31
  16. package/dist/vuetify.esm.js.map +1 -1
  17. package/dist/vuetify.js +40 -31
  18. package/dist/vuetify.js.map +1 -1
  19. package/dist/vuetify.min.css +2 -2
  20. package/dist/vuetify.min.js +487 -484
  21. package/dist/vuetify.min.js.map +1 -1
  22. package/lib/components/VAppBar/VAppBarTitle.mjs +3 -4
  23. package/lib/components/VAppBar/VAppBarTitle.mjs.map +1 -1
  24. package/lib/components/VAppBar/index.d.ts +14 -2
  25. package/lib/components/VBottomSheet/VBottomSheet.mjs +1 -4
  26. package/lib/components/VBottomSheet/VBottomSheet.mjs.map +1 -1
  27. package/lib/components/VBtn/VBtn.css +7 -7
  28. package/lib/components/VBtnGroup/VBtnGroup.mjs +15 -11
  29. package/lib/components/VBtnGroup/VBtnGroup.mjs.map +1 -1
  30. package/lib/components/VBtnGroup/index.d.ts +2 -1
  31. package/lib/components/VBtnToggle/VBtnToggle.mjs +9 -5
  32. package/lib/components/VBtnToggle/VBtnToggle.mjs.map +1 -1
  33. package/lib/components/VBtnToggle/index.d.ts +122 -1
  34. package/lib/components/VCalendar/VCalendar.mjs +3 -0
  35. package/lib/components/VCalendar/VCalendar.mjs.map +1 -1
  36. package/lib/components/VCalendar/VCalendarCategory.sass +9 -3
  37. package/lib/components/VCalendar/VCalendarDaily.mjs +20 -8
  38. package/lib/components/VCalendar/VCalendarDaily.mjs.map +1 -1
  39. package/lib/components/VCalendar/VCalendarWeekly.mjs +25 -5
  40. package/lib/components/VCalendar/VCalendarWeekly.mjs.map +1 -1
  41. package/lib/components/VCalendar/mixins/calendar-with-events.mjs +20 -16
  42. package/lib/components/VCalendar/mixins/calendar-with-events.mjs.map +1 -1
  43. package/lib/components/VCalendar/mixins/mouse.mjs +16 -30
  44. package/lib/components/VCalendar/mixins/mouse.mjs.map +1 -1
  45. package/lib/components/VCard/VCard.css +7 -7
  46. package/lib/components/VChip/VChip.css +7 -7
  47. package/lib/components/VChip/VChip.mjs +6 -1
  48. package/lib/components/VChip/VChip.mjs.map +1 -1
  49. package/lib/components/VData/VData.mjs +2 -4
  50. package/lib/components/VData/VData.mjs.map +1 -1
  51. package/lib/components/VDatePicker/VDatePicker.mjs +7 -5
  52. package/lib/components/VDatePicker/VDatePicker.mjs.map +1 -1
  53. package/lib/components/VExpansionPanel/VExpansionPanel.css +7 -7
  54. package/lib/components/VField/VField.css +2 -2
  55. package/lib/components/VField/VField.sass +2 -2
  56. package/lib/components/VList/VListItem.css +7 -7
  57. package/lib/components/VOtpInput/VOtpInput.mjs +22 -46
  58. package/lib/components/VOtpInput/VOtpInput.mjs.map +1 -1
  59. package/lib/components/VOverflowBtn/VOverflowBtn.mjs +3 -0
  60. package/lib/components/VOverflowBtn/VOverflowBtn.mjs.map +1 -1
  61. package/lib/components/VSelectionControl/VSelectionControl.css +2 -2
  62. package/lib/components/VSkeletonLoader/VSkeletonLoader.sass +1 -1
  63. package/lib/components/VStepper/VStepper.sass +6 -6
  64. package/lib/components/VStepper/VStepperStep.mjs +12 -2
  65. package/lib/components/VStepper/VStepperStep.mjs.map +1 -1
  66. package/lib/components/VTimePicker/VTimePicker.mjs.map +1 -1
  67. package/lib/components/VTimeline/_mixins.sass +1 -1
  68. package/lib/components/VToolbar/VToolbarTitle.mjs +6 -5
  69. package/lib/components/VToolbar/VToolbarTitle.mjs.map +1 -1
  70. package/lib/components/VTreeview/VTreeview.mjs +1 -1
  71. package/lib/components/VTreeview/VTreeview.mjs.map +1 -1
  72. package/lib/components/index.d.ts +135 -4
  73. package/lib/composables/nested/nested.mjs +2 -1
  74. package/lib/composables/nested/nested.mjs.map +1 -1
  75. package/lib/directives/ripple/VRipple.css +3 -0
  76. package/lib/directives/ripple/VRipple.sass +3 -0
  77. package/lib/directives/ripple/_variables.scss +1 -1
  78. package/lib/directives/ripple/index.mjs +2 -7
  79. package/lib/directives/ripple/index.mjs.map +1 -1
  80. package/lib/entry-bundler.mjs +1 -1
  81. package/lib/framework.mjs +1 -1
  82. package/lib/index.d.ts +9 -9
  83. package/lib/labs/VDataTable/VDataTable.mjs +1 -5
  84. package/lib/labs/VDataTable/VDataTable.mjs.map +1 -1
  85. package/lib/labs/VDataTable/VDataTableFooter.mjs +1 -1
  86. package/lib/labs/VDataTable/VDataTableFooter.mjs.map +1 -1
  87. package/lib/labs/VDataTable/VDataTableServer.mjs +1 -7
  88. package/lib/labs/VDataTable/VDataTableServer.mjs.map +1 -1
  89. package/lib/labs/VDataTable/VDataTableVirtual.mjs +0 -3
  90. package/lib/labs/VDataTable/VDataTableVirtual.mjs.map +1 -1
  91. package/lib/labs/VDataTable/composables/options.mjs +0 -6
  92. package/lib/labs/VDataTable/composables/options.mjs.map +1 -1
  93. package/lib/labs/VDataTable/composables/paginate.mjs +1 -1
  94. package/lib/labs/VDataTable/composables/paginate.mjs.map +1 -1
  95. package/lib/labs/VDataTable/index.d.ts +60 -1
  96. package/lib/labs/VDataTable/index.mjs +1 -0
  97. package/lib/labs/VDataTable/index.mjs.map +1 -1
  98. package/lib/labs/VVirtualScroll/VVirtualScroll.css +0 -1
  99. package/lib/labs/VVirtualScroll/VVirtualScroll.mjs +40 -22
  100. package/lib/labs/VVirtualScroll/VVirtualScroll.mjs.map +1 -1
  101. package/lib/labs/VVirtualScroll/VVirtualScroll.sass +0 -1
  102. package/lib/labs/VVirtualScroll/VVirtualScrollItem.mjs +20 -8
  103. package/lib/labs/VVirtualScroll/VVirtualScrollItem.mjs.map +1 -1
  104. package/lib/labs/VVirtualScroll/index.d.ts +15 -46
  105. package/lib/labs/components.d.ts +75 -47
  106. package/lib/locale/ar.mjs +20 -20
  107. package/lib/locale/ar.mjs.map +1 -1
  108. package/lib/locale/es.mjs +3 -3
  109. package/lib/locale/es.mjs.map +1 -1
  110. package/lib/locale/fi.mjs +5 -5
  111. package/lib/locale/fi.mjs.map +1 -1
  112. package/lib/locale/it.mjs +6 -6
  113. package/lib/locale/it.mjs.map +1 -1
  114. package/lib/locale/sv.mjs +7 -7
  115. package/lib/locale/sv.mjs.map +1 -1
  116. package/lib/styles/settings/_variables.scss +6 -6
  117. package/lib/styles/tools/_states.sass +3 -3
  118. package/lib/util/helpers.mjs +0 -18
  119. package/lib/util/helpers.mjs.map +1 -1
  120. package/package.json +2 -2
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * Vuetify v3.1.3
2
+ * Vuetify v3.1.4
3
3
  * Forged by John Leider
4
4
  * Released under the MIT License.
5
5
  */
6
6
 
7
- import { ref, onBeforeUnmount, watch, readonly, reactive, computed, watchEffect, toRefs, capitalize, getCurrentInstance as getCurrentInstance$1, unref, provide, inject as inject$1, onScopeDispose, effectScope, shallowRef, defineComponent as defineComponent$1, camelize, h, onDeactivated, onActivated, onMounted, createVNode, TransitionGroup, Transition, mergeProps, onBeforeMount, nextTick, withDirectives, Fragment, resolveDirective, vShow, isRef, toRef, Text, resolveDynamicComponent, cloneVNode, warn, toHandlers, Teleport, createTextVNode, onBeforeUpdate, vModelText } from 'vue';
7
+ import { ref, onBeforeUnmount, watch, readonly, reactive, computed, watchEffect, toRefs, capitalize, getCurrentInstance as getCurrentInstance$1, unref, provide, inject as inject$1, onScopeDispose, effectScope, shallowRef, defineComponent as defineComponent$1, camelize, h, onDeactivated, onActivated, onMounted, createVNode, TransitionGroup, Transition, mergeProps, onBeforeMount, nextTick, withDirectives, Fragment, resolveDirective, vShow, isRef, toRef, Text, resolveDynamicComponent, cloneVNode, warn, toHandlers, Teleport, createTextVNode, onBeforeUpdate, vModelText, onUpdated } from 'vue';
8
8
 
9
9
  const IN_BROWSER = typeof window !== 'undefined';
10
10
  const SUPPORTS_INTERSECTION = IN_BROWSER && 'IntersectionObserver' in window;
@@ -2925,12 +2925,13 @@ const makeTagProps = propsFactory({
2925
2925
 
2926
2926
  // Types
2927
2927
 
2928
+ const makeVToolbarTitleProps = propsFactory({
2929
+ text: String,
2930
+ ...makeTagProps()
2931
+ }, 'v-toolbar-title');
2928
2932
  const VToolbarTitle = genericComponent()({
2929
2933
  name: 'VToolbarTitle',
2930
- props: {
2931
- text: String,
2932
- ...makeTagProps()
2933
- },
2934
+ props: makeVToolbarTitleProps(),
2934
2935
  setup(props, _ref) {
2935
2936
  let {
2936
2937
  slots
@@ -3382,18 +3383,21 @@ function useVariant(props) {
3382
3383
  };
3383
3384
  }
3384
3385
 
3386
+ // Types
3387
+
3388
+ const makeVBtnGroupProps = propsFactory({
3389
+ divided: Boolean,
3390
+ ...makeBorderProps(),
3391
+ ...makeDensityProps(),
3392
+ ...makeElevationProps(),
3393
+ ...makeRoundedProps(),
3394
+ ...makeTagProps(),
3395
+ ...makeThemeProps(),
3396
+ ...makeVariantProps()
3397
+ }, 'v-btn-group');
3385
3398
  const VBtnGroup = defineComponent({
3386
3399
  name: 'VBtnGroup',
3387
- props: {
3388
- divided: Boolean,
3389
- ...makeBorderProps(),
3390
- ...makeDensityProps(),
3391
- ...makeElevationProps(),
3392
- ...makeRoundedProps(),
3393
- ...makeTagProps(),
3394
- ...makeThemeProps(),
3395
- ...makeVariantProps()
3396
- },
3400
+ props: makeVBtnGroupProps(),
3397
3401
  setup(props, _ref) {
3398
3402
  let {
3399
3403
  slots
@@ -3431,6 +3435,9 @@ const VBtnGroup = defineComponent({
3431
3435
  });
3432
3436
  }
3433
3437
  });
3438
+ function filterVBtnGroupProps(props) {
3439
+ return pick(props, Object.keys(VBtnGroup.props));
3440
+ }
3434
3441
 
3435
3442
  // Composables
3436
3443
 
@@ -3638,7 +3645,10 @@ function getValues(items, ids) {
3638
3645
  const VBtnToggleSymbol = Symbol.for('vuetify:v-btn-toggle');
3639
3646
  const VBtnToggle = genericComponent()({
3640
3647
  name: 'VBtnToggle',
3641
- props: makeGroupProps(),
3648
+ props: {
3649
+ ...makeVBtnGroupProps(),
3650
+ ...makeGroupProps()
3651
+ },
3642
3652
  emits: {
3643
3653
  'update:modelValue': value => true
3644
3654
  },
@@ -3655,9 +3665,10 @@ const VBtnToggle = genericComponent()({
3655
3665
  } = useGroup(props, VBtnToggleSymbol);
3656
3666
  useRender(() => {
3657
3667
  var _slots$default;
3658
- return createVNode(VBtnGroup, {
3668
+ const [btnGroupProps] = filterVBtnGroupProps(props);
3669
+ return createVNode(VBtnGroup, mergeProps({
3659
3670
  "class": "v-btn-toggle"
3660
- }, {
3671
+ }, btnGroupProps), {
3661
3672
  default: () => [(_slots$default = slots.default) == null ? void 0 : _slots$default.call(slots, {
3662
3673
  isSelected,
3663
3674
  next,
@@ -4112,9 +4123,6 @@ function transform(el, value) {
4112
4123
  el.style.transform = value;
4113
4124
  el.style.webkitTransform = value;
4114
4125
  }
4115
- function opacity(el, value) {
4116
- el.style.opacity = `calc(${value} * var(--v-theme-overlay-multiplier))`;
4117
- }
4118
4126
  function isTouchEvent(e) {
4119
4127
  return e.constructor.name === 'TouchEvent';
4120
4128
  }
@@ -4190,13 +4198,11 @@ const ripples = {
4190
4198
  animation.classList.add('v-ripple__animation--enter');
4191
4199
  animation.classList.add('v-ripple__animation--visible');
4192
4200
  transform(animation, `translate(${x}, ${y}) scale3d(${scale},${scale},${scale})`);
4193
- opacity(animation, 0);
4194
4201
  animation.dataset.activated = String(performance.now());
4195
4202
  setTimeout(() => {
4196
4203
  animation.classList.remove('v-ripple__animation--enter');
4197
4204
  animation.classList.add('v-ripple__animation--in');
4198
4205
  transform(animation, `translate(${centerX}, ${centerY}) scale3d(1,1,1)`);
4199
- opacity(animation, 0.08);
4200
4206
  }, 0);
4201
4207
  },
4202
4208
  hide(el) {
@@ -4211,14 +4217,14 @@ const ripples = {
4211
4217
  setTimeout(() => {
4212
4218
  animation.classList.remove('v-ripple__animation--in');
4213
4219
  animation.classList.add('v-ripple__animation--out');
4214
- opacity(animation, 0);
4215
4220
  setTimeout(() => {
4221
+ var _animation$parentNode;
4216
4222
  const ripples = el.getElementsByClassName('v-ripple__animation');
4217
4223
  if (ripples.length === 1 && el.dataset.previousPosition) {
4218
4224
  el.style.position = el.dataset.previousPosition;
4219
4225
  delete el.dataset.previousPosition;
4220
4226
  }
4221
- animation.parentNode && el.removeChild(animation.parentNode);
4227
+ if (((_animation$parentNode = animation.parentNode) == null ? void 0 : _animation$parentNode.parentNode) === el) el.removeChild(animation.parentNode);
4222
4228
  }, 300);
4223
4229
  }, delay);
4224
4230
  }
@@ -5005,9 +5011,7 @@ const VToolbarItems = defineComponent({
5005
5011
 
5006
5012
  const VAppBarTitle = defineComponent({
5007
5013
  name: 'VAppBarTitle',
5008
- props: {
5009
- ...VToolbarTitle.props
5010
- },
5014
+ props: makeVToolbarTitleProps(),
5011
5015
  setup(props, _ref) {
5012
5016
  let {
5013
5017
  slots
@@ -6833,6 +6837,9 @@ const VChip = defineComponent({
6833
6837
  emit,
6834
6838
  slots
6835
6839
  } = _ref;
6840
+ const {
6841
+ t
6842
+ } = useLocale();
6836
6843
  const {
6837
6844
  borderClasses
6838
6845
  } = useBorder(props);
@@ -6969,6 +6976,7 @@ const VChip = defineComponent({
6969
6976
  }, {
6970
6977
  default: () => [createVNode("div", {
6971
6978
  "class": "v-chip__close",
6979
+ "aria-label": t(props.closeLabel),
6972
6980
  "onClick": onCloseClick
6973
6981
  }, [slots.close ? slots.close() : createVNode(VIcon, null, null)])]
6974
6982
  })]
@@ -7454,7 +7462,8 @@ const useNested = props => {
7454
7462
  };
7455
7463
  const useNestedItem = (id, isGroup) => {
7456
7464
  const parent = inject$1(VNestedSymbol, emptyNested);
7457
- const computedId = computed(() => id.value ?? Symbol(getUid()));
7465
+ const uidSymbol = Symbol(getUid());
7466
+ const computedId = computed(() => id.value ?? uidSymbol);
7458
7467
  const item = {
7459
7468
  ...parent,
7460
7469
  id: computedId,
@@ -19054,7 +19063,7 @@ function createPagination(props, items) {
19054
19063
  return Math.min(itemsLength.value, startIndex.value + itemsPerPage.value);
19055
19064
  });
19056
19065
  const pageCount = computed(() => {
19057
- if (itemsPerPage.value === -1) return 1;
19066
+ if (itemsPerPage.value === -1 || itemsLength.value === 0) return 1;
19058
19067
  return Math.ceil(itemsLength.value / itemsPerPage.value);
19059
19068
  });
19060
19069
  watchEffect(() => {
@@ -19157,7 +19166,7 @@ const VDataTableFooter = defineComponent({
19157
19166
  "hide-details": true
19158
19167
  }, null)]), createVNode("div", {
19159
19168
  "class": "v-data-table-footer__info"
19160
- }, [createVNode("div", null, [(startIndex.value ?? -1) + 1, createTextVNode(" - "), stopIndex.value ?? 0, createTextVNode(" of "), itemsLength.value ?? 0])]), createVNode("div", {
19169
+ }, [createVNode("div", null, [!itemsLength.value ? 0 : startIndex.value + 1, createTextVNode(" - "), stopIndex.value, createTextVNode(" of "), itemsLength.value])]), createVNode("div", {
19161
19170
  "class": "v-data-table-footer__pagination"
19162
19171
  }, [createVNode(VBtn, {
19163
19172
  "icon": props.firstIcon,
@@ -19225,18 +19234,12 @@ function useOptions(_ref) {
19225
19234
  page,
19226
19235
  itemsPerPage,
19227
19236
  sortBy,
19228
- startIndex,
19229
- stopIndex,
19230
- pageCount,
19231
19237
  groupBy
19232
19238
  } = _ref;
19233
19239
  const vm = getCurrentInstance('VDataTable');
19234
19240
  const options = computed(() => ({
19235
19241
  page: page.value,
19236
19242
  itemsPerPage: itemsPerPage.value,
19237
- startIndex: startIndex.value,
19238
- stopIndex: stopIndex.value,
19239
- pageCount: pageCount.value,
19240
19243
  sortBy: sortBy.value,
19241
19244
  groupBy: groupBy.value
19242
19245
  }));
@@ -19340,8 +19343,7 @@ const VDataTable = defineComponent({
19340
19343
  page,
19341
19344
  itemsPerPage,
19342
19345
  startIndex,
19343
- stopIndex,
19344
- pageCount
19346
+ stopIndex
19345
19347
  } = createPagination(props, flatItems);
19346
19348
  const {
19347
19349
  paginatedItems
@@ -19353,9 +19355,6 @@ const VDataTable = defineComponent({
19353
19355
  page,
19354
19356
  itemsPerPage,
19355
19357
  sortBy,
19356
- pageCount,
19357
- startIndex,
19358
- stopIndex,
19359
19358
  groupBy
19360
19359
  });
19361
19360
  provideDefaults({
@@ -19550,9 +19549,6 @@ const VDataTableVirtual = defineComponent({
19550
19549
  useOptions({
19551
19550
  sortBy,
19552
19551
  page: ref(1),
19553
- startIndex: ref(0),
19554
- stopIndex: computed(() => flatItems.value.length - 1),
19555
- pageCount: ref(1),
19556
19552
  itemsPerPage: ref(-1),
19557
19553
  groupBy
19558
19554
  });
@@ -19669,10 +19665,7 @@ const VDataTableServer = defineComponent({
19669
19665
  } = createGroupBy(props, groupBy, sortBy);
19670
19666
  const {
19671
19667
  page,
19672
- itemsPerPage,
19673
- startIndex,
19674
- stopIndex,
19675
- pageCount
19668
+ itemsPerPage
19676
19669
  } = createPagination(props, items);
19677
19670
  const {
19678
19671
  flatItems
@@ -19682,9 +19675,6 @@ const VDataTableServer = defineComponent({
19682
19675
  page,
19683
19676
  itemsPerPage,
19684
19677
  sortBy,
19685
- startIndex,
19686
- stopIndex,
19687
- pageCount,
19688
19678
  groupBy
19689
19679
  });
19690
19680
  provide('v-data-table', {
@@ -19746,12 +19736,23 @@ const VVirtualScrollItem = defineComponent({
19746
19736
  slots
19747
19737
  } = _ref;
19748
19738
  const {
19749
- resizeRef
19750
- } = useResizeObserver(entries => {
19751
- if (!entries.length) return;
19752
- const contentRect = entries[0].contentRect;
19753
- emit('update:height', contentRect.height);
19739
+ resizeRef,
19740
+ contentRect
19741
+ } = useResizeObserver();
19742
+ useToggleScope(() => props.dynamicHeight, () => {
19743
+ watch(() => {
19744
+ var _contentRect$value;
19745
+ return (_contentRect$value = contentRect.value) == null ? void 0 : _contentRect$value.height;
19746
+ }, height => {
19747
+ if (height != null) emit('update:height', height);
19748
+ });
19754
19749
  });
19750
+ function updateHeight() {
19751
+ if (props.dynamicHeight && contentRect.value) {
19752
+ emit('update:height', contentRect.value.height);
19753
+ }
19754
+ }
19755
+ onUpdated(updateHeight);
19755
19756
  useRender(() => {
19756
19757
  var _slots$default;
19757
19758
  return createVNode("div", {
@@ -19773,15 +19774,8 @@ const VVirtualScroll = genericComponent()({
19773
19774
  type: Array,
19774
19775
  default: () => []
19775
19776
  },
19776
- itemKey: {
19777
- type: String,
19778
- default: 'value'
19779
- },
19780
19777
  itemHeight: [Number, String],
19781
- visibleItems: {
19782
- type: [Number, String],
19783
- default: 30
19784
- },
19778
+ visibleItems: [Number, String],
19785
19779
  ...makeDimensionProps()
19786
19780
  },
19787
19781
  setup(props, _ref) {
@@ -19796,15 +19790,23 @@ const VVirtualScroll = genericComponent()({
19796
19790
  baseItemHeight.value = val;
19797
19791
  }
19798
19792
  });
19799
- const visibleItems = computed(() => parseInt(props.visibleItems, 10));
19800
19793
  const rootEl = ref();
19801
- const ids = new Map(props.items.map((item, index) => [getPropertyFromItem(item, props.itemKey, item), index]));
19794
+ const {
19795
+ resizeRef,
19796
+ contentRect
19797
+ } = useResizeObserver();
19798
+ watchEffect(() => {
19799
+ resizeRef.value = rootEl.value;
19800
+ });
19801
+ const display = useDisplay();
19802
19802
  const sizes = createRange(props.items.length).map(() => itemHeight.value);
19803
- function handleItemResize(item, height) {
19804
- const index = ids.get(getPropertyFromItem(item, props.itemKey, item));
19805
- if (!index) return;
19803
+ const visibleItems = computed(() => {
19804
+ var _contentRect$value;
19805
+ return props.visibleItems ? parseInt(props.visibleItems, 10) : Math.max(12, Math.ceil((((_contentRect$value = contentRect.value) == null ? void 0 : _contentRect$value.height) ?? display.height.value) / itemHeight.value * 1.7 + 1));
19806
+ });
19807
+ function handleItemResize(index, height) {
19808
+ itemHeight.value = Math.max(itemHeight.value, height);
19806
19809
  sizes[index] = height;
19807
- if (!itemHeight.value) itemHeight.value = height;
19808
19810
  }
19809
19811
  function calculateOffset(index) {
19810
19812
  return sizes.slice(0, index).reduce((curr, value) => curr + (value || itemHeight.value), 0);
@@ -19827,18 +19829,24 @@ const VVirtualScroll = genericComponent()({
19827
19829
  }
19828
19830
  let lastScrollTop = 0;
19829
19831
  function handleScroll() {
19830
- if (!rootEl.value) return;
19832
+ if (!rootEl.value || !contentRect.value) return;
19833
+ const height = contentRect.value.height;
19831
19834
  const scrollTop = rootEl.value.scrollTop;
19832
19835
  const direction = scrollTop < lastScrollTop ? UP : DOWN;
19833
- const midPointIndex = calculateMidPointIndex(scrollTop);
19836
+ const midPointIndex = calculateMidPointIndex(scrollTop + height / 2);
19834
19837
  const buffer = Math.round(visibleItems.value / 3);
19835
- if (direction === UP && midPointIndex <= first.value) {
19838
+ if (direction === UP && midPointIndex <= first.value + buffer * 2 - 1) {
19836
19839
  first.value = Math.max(midPointIndex - buffer, 0);
19837
- } else if (direction === DOWN && midPointIndex >= first.value + buffer * 2) {
19840
+ } else if (direction === DOWN && midPointIndex >= first.value + buffer * 2 - 1) {
19838
19841
  first.value = Math.min(Math.max(0, midPointIndex - buffer), props.items.length - visibleItems.value);
19839
19842
  }
19840
19843
  lastScrollTop = rootEl.value.scrollTop;
19841
19844
  }
19845
+ function scrollToIndex(index) {
19846
+ if (!rootEl.value) return;
19847
+ const offset = calculateOffset(index);
19848
+ rootEl.value.scrollTop = offset;
19849
+ }
19842
19850
  const last = computed(() => Math.min(props.items.length, first.value + visibleItems.value));
19843
19851
  const computedItems = computed(() => props.items.slice(first.value, last.value));
19844
19852
  const paddingTop = computed(() => calculateOffset(first.value));
@@ -19846,6 +19854,12 @@ const VVirtualScroll = genericComponent()({
19846
19854
  const {
19847
19855
  dimensionStyles
19848
19856
  } = useDimension(props);
19857
+ onMounted(() => {
19858
+ if (!itemHeight.value) {
19859
+ // If itemHeight prop is not set, then calculate an estimated height from the average of inital items
19860
+ itemHeight.value = sizes.slice(first.value, last.value).reduce((curr, height) => curr + height, 0) / visibleItems.value;
19861
+ }
19862
+ });
19849
19863
  useRender(() => createVNode("div", {
19850
19864
  "ref": rootEl,
19851
19865
  "class": "v-virtual-scroll",
@@ -19862,7 +19876,7 @@ const VVirtualScroll = genericComponent()({
19862
19876
  return createVNode(VVirtualScrollItem, {
19863
19877
  "key": index,
19864
19878
  "dynamicHeight": !props.itemHeight,
19865
- "onUpdate:height": height => handleItemResize(item, height)
19879
+ "onUpdate:height": height => handleItemResize(index + first.value, height)
19866
19880
  }, {
19867
19881
  default: () => [(_slots$default = slots.default) == null ? void 0 : _slots$default.call(slots, {
19868
19882
  item,
@@ -19870,6 +19884,9 @@ const VVirtualScroll = genericComponent()({
19870
19884
  })]
19871
19885
  });
19872
19886
  })])]));
19887
+ return {
19888
+ scrollToIndex
19889
+ };
19873
19890
  }
19874
19891
  });
19875
19892
 
@@ -20012,6 +20029,7 @@ var components = /*#__PURE__*/Object.freeze({
20012
20029
  VDataTableRow: VDataTableRow,
20013
20030
  VDataTableVirtual: VDataTableVirtual,
20014
20031
  VDataTableServer: VDataTableServer,
20032
+ VDataTableFooter: VDataTableFooter,
20015
20033
  VVirtualScroll: VVirtualScroll
20016
20034
  });
20017
20035
 
@@ -20227,7 +20245,7 @@ function createVuetify$1() {
20227
20245
  locale
20228
20246
  };
20229
20247
  }
20230
- const version$1 = "3.1.3";
20248
+ const version$1 = "3.1.4";
20231
20249
  createVuetify$1.version = version$1;
20232
20250
 
20233
20251
  // Vue's inject() can only be used in setup
@@ -20240,7 +20258,7 @@ function inject(key) {
20240
20258
  }
20241
20259
  }
20242
20260
 
20243
- const version = "3.1.3";
20261
+ const version = "3.1.4";
20244
20262
 
20245
20263
  const createVuetify = function () {
20246
20264
  let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};