@vuetify/nightly 3.2.0-dev-20230405.0 → 3.2.0-dev-20230407.0

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 (42) hide show
  1. package/CHANGELOG.md +3 -2
  2. package/dist/json/importMap-labs.json +0 -4
  3. package/dist/json/importMap.json +52 -48
  4. package/dist/json/web-types.json +1 -1
  5. package/dist/vuetify-labs.css +10 -10
  6. package/dist/vuetify-labs.d.ts +164 -164
  7. package/dist/vuetify-labs.esm.js +180 -180
  8. package/dist/vuetify-labs.esm.js.map +1 -1
  9. package/dist/vuetify-labs.js +179 -179
  10. package/dist/vuetify-labs.min.css +2 -2
  11. package/dist/vuetify.css +10 -1
  12. package/dist/vuetify.d.ts +166 -14
  13. package/dist/vuetify.esm.js +176 -4
  14. package/dist/vuetify.esm.js.map +1 -1
  15. package/dist/vuetify.js +175 -3
  16. package/dist/vuetify.js.map +1 -1
  17. package/dist/vuetify.min.css +2 -2
  18. package/dist/vuetify.min.js +222 -206
  19. package/dist/vuetify.min.js.map +1 -1
  20. package/lib/components/VVirtualScroll/VVirtualScroll.mjs.map +1 -0
  21. package/lib/components/VVirtualScroll/VVirtualScrollItem.mjs.map +1 -0
  22. package/lib/components/VVirtualScroll/index.mjs.map +1 -0
  23. package/lib/components/index.d.ts +150 -1
  24. package/lib/components/index.mjs +2 -1
  25. package/lib/components/index.mjs.map +1 -1
  26. package/lib/entry-bundler.mjs +1 -1
  27. package/lib/framework.mjs +1 -1
  28. package/lib/index.d.ts +15 -14
  29. package/lib/labs/VDataTable/index.d.ts +15 -15
  30. package/lib/labs/components.d.ts +16 -165
  31. package/lib/labs/components.mjs +0 -1
  32. package/lib/labs/components.mjs.map +1 -1
  33. package/package.json +1 -1
  34. package/lib/labs/VVirtualScroll/VVirtualScroll.mjs.map +0 -1
  35. package/lib/labs/VVirtualScroll/VVirtualScrollItem.mjs.map +0 -1
  36. package/lib/labs/VVirtualScroll/index.mjs.map +0 -1
  37. /package/lib/{labs → components}/VVirtualScroll/VVirtualScroll.css +0 -0
  38. /package/lib/{labs → components}/VVirtualScroll/VVirtualScroll.mjs +0 -0
  39. /package/lib/{labs → components}/VVirtualScroll/VVirtualScroll.sass +0 -0
  40. /package/lib/{labs → components}/VVirtualScroll/VVirtualScrollItem.mjs +0 -0
  41. /package/lib/{labs → components}/VVirtualScroll/index.d.ts +0 -0
  42. /package/lib/{labs → components}/VVirtualScroll/index.mjs +0 -0
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vuetify v3.2.0-dev-20230405.0
2
+ * Vuetify v3.2.0-dev-20230407.0
3
3
  * Forged by John Leider
4
4
  * Released under the MIT License.
5
5
  */
@@ -17997,6 +17997,177 @@
17997
17997
  }
17998
17998
  });
17999
17999
 
18000
+ const VVirtualScrollItem = genericComponent()({
18001
+ name: 'VVirtualScrollItem',
18002
+ props: {
18003
+ dynamicHeight: Boolean
18004
+ },
18005
+ emits: {
18006
+ 'update:height': height => true
18007
+ },
18008
+ setup(props, _ref) {
18009
+ let {
18010
+ emit,
18011
+ slots
18012
+ } = _ref;
18013
+ const {
18014
+ resizeRef,
18015
+ contentRect
18016
+ } = useResizeObserver();
18017
+ useToggleScope(() => props.dynamicHeight, () => {
18018
+ vue.watch(() => contentRect.value?.height, height => {
18019
+ if (height != null) emit('update:height', height);
18020
+ });
18021
+ });
18022
+ function updateHeight() {
18023
+ if (props.dynamicHeight && contentRect.value) {
18024
+ emit('update:height', contentRect.value.height);
18025
+ }
18026
+ }
18027
+ vue.onUpdated(updateHeight);
18028
+ useRender(() => vue.createVNode("div", {
18029
+ "ref": props.dynamicHeight ? resizeRef : undefined,
18030
+ "class": "v-virtual-scroll__item"
18031
+ }, [slots.default?.()]));
18032
+ }
18033
+ });
18034
+
18035
+ // Types
18036
+
18037
+ const UP$1 = -1;
18038
+ const DOWN$1 = 1;
18039
+ const VVirtualScroll = genericComponent()({
18040
+ name: 'VVirtualScroll',
18041
+ props: {
18042
+ items: {
18043
+ type: Array,
18044
+ default: () => []
18045
+ },
18046
+ itemHeight: [Number, String],
18047
+ visibleItems: [Number, String],
18048
+ ...makeDimensionProps()
18049
+ },
18050
+ setup(props, _ref) {
18051
+ let {
18052
+ slots
18053
+ } = _ref;
18054
+ const first = vue.ref(0);
18055
+ const baseItemHeight = vue.ref(props.itemHeight);
18056
+ const itemHeight = vue.computed({
18057
+ get: () => parseInt(baseItemHeight.value ?? 0, 10),
18058
+ set(val) {
18059
+ baseItemHeight.value = val;
18060
+ }
18061
+ });
18062
+ const rootEl = vue.ref();
18063
+ const {
18064
+ resizeRef,
18065
+ contentRect
18066
+ } = useResizeObserver();
18067
+ vue.watchEffect(() => {
18068
+ resizeRef.value = rootEl.value;
18069
+ });
18070
+ const display = useDisplay();
18071
+ const sizeMap = new Map();
18072
+ let sizes = createRange(props.items.length).map(() => itemHeight.value);
18073
+ const visibleItems = vue.computed(() => {
18074
+ return props.visibleItems ? parseInt(props.visibleItems, 10) : Math.max(12, Math.ceil((contentRect.value?.height ?? display.height.value) / itemHeight.value * 1.7 + 1));
18075
+ });
18076
+ function handleItemResize(index, height) {
18077
+ itemHeight.value = Math.max(itemHeight.value, height);
18078
+ sizes[index] = height;
18079
+ sizeMap.set(props.items[index], height);
18080
+ }
18081
+ function calculateOffset(index) {
18082
+ return sizes.slice(0, index).reduce((curr, value) => curr + (value || itemHeight.value), 0);
18083
+ }
18084
+ function calculateMidPointIndex(scrollTop) {
18085
+ let start = 0;
18086
+ let end = props.items.length;
18087
+ while (start <= end) {
18088
+ const middle = start + Math.floor((end - start) / 2);
18089
+ const middleOffset = calculateOffset(middle);
18090
+ if (middleOffset === scrollTop) {
18091
+ return middle;
18092
+ } else if (middleOffset < scrollTop) {
18093
+ start = middle + 1;
18094
+ } else if (middleOffset > scrollTop) {
18095
+ end = middle - 1;
18096
+ }
18097
+ }
18098
+ return start;
18099
+ }
18100
+ let lastScrollTop = 0;
18101
+ function handleScroll() {
18102
+ if (!rootEl.value || !contentRect.value) return;
18103
+ const height = contentRect.value.height;
18104
+ const scrollTop = rootEl.value.scrollTop;
18105
+ const direction = scrollTop < lastScrollTop ? UP$1 : DOWN$1;
18106
+ const midPointIndex = calculateMidPointIndex(scrollTop + height / 2);
18107
+ const buffer = Math.round(visibleItems.value / 3);
18108
+ if (direction === UP$1 && midPointIndex <= first.value + buffer * 2 - 1) {
18109
+ first.value = clamp(midPointIndex - buffer, 0, props.items.length);
18110
+ } else if (direction === DOWN$1 && midPointIndex >= first.value + buffer * 2 - 1) {
18111
+ first.value = clamp(midPointIndex - buffer, 0, props.items.length - visibleItems.value);
18112
+ }
18113
+ lastScrollTop = rootEl.value.scrollTop;
18114
+ }
18115
+ function scrollToIndex(index) {
18116
+ if (!rootEl.value) return;
18117
+ const offset = calculateOffset(index);
18118
+ rootEl.value.scrollTop = offset;
18119
+ }
18120
+ const last = vue.computed(() => Math.min(props.items.length, first.value + visibleItems.value));
18121
+ const computedItems = vue.computed(() => props.items.slice(first.value, last.value));
18122
+ const paddingTop = vue.computed(() => calculateOffset(first.value));
18123
+ const paddingBottom = vue.computed(() => calculateOffset(props.items.length) - calculateOffset(last.value));
18124
+ const {
18125
+ dimensionStyles
18126
+ } = useDimension(props);
18127
+ vue.onMounted(() => {
18128
+ if (!itemHeight.value) {
18129
+ // If itemHeight prop is not set, then calculate an estimated height from the average of inital items
18130
+ itemHeight.value = sizes.slice(first.value, last.value).reduce((curr, height) => curr + height, 0) / visibleItems.value;
18131
+ }
18132
+ });
18133
+ vue.watch(() => props.items.length, () => {
18134
+ sizes = createRange(props.items.length).map(() => itemHeight.value);
18135
+ sizeMap.forEach((height, item) => {
18136
+ const index = props.items.indexOf(item);
18137
+ if (index === -1) {
18138
+ sizeMap.delete(item);
18139
+ } else {
18140
+ sizes[index] = height;
18141
+ }
18142
+ });
18143
+ });
18144
+ useRender(() => vue.createVNode("div", {
18145
+ "ref": rootEl,
18146
+ "class": "v-virtual-scroll",
18147
+ "onScroll": handleScroll,
18148
+ "style": dimensionStyles.value
18149
+ }, [vue.createVNode("div", {
18150
+ "class": "v-virtual-scroll__container",
18151
+ "style": {
18152
+ paddingTop: convertToUnit(paddingTop.value),
18153
+ paddingBottom: convertToUnit(paddingBottom.value)
18154
+ }
18155
+ }, [computedItems.value.map((item, index) => vue.createVNode(VVirtualScrollItem, {
18156
+ "key": index,
18157
+ "dynamicHeight": !props.itemHeight,
18158
+ "onUpdate:height": height => handleItemResize(index + first.value, height)
18159
+ }, {
18160
+ default: () => [slots.default?.({
18161
+ item,
18162
+ index: index + first.value
18163
+ })]
18164
+ }))])]));
18165
+ return {
18166
+ scrollToIndex
18167
+ };
18168
+ }
18169
+ });
18170
+
18000
18171
  const VDataTableColumn = defineFunctionalComponent({
18001
18172
  align: {
18002
18173
  type: String,
@@ -19389,8 +19560,8 @@
19389
19560
  default: 52
19390
19561
  }
19391
19562
  }, 'virtual');
19392
- const UP$1 = -1;
19393
- const DOWN$1 = 1;
19563
+ const UP = -1;
19564
+ const DOWN = 1;
19394
19565
 
19395
19566
  // TODO: Replace this with composable from v-virtual-scroll
19396
19567
  function useVirtual(props, items) {
@@ -19428,12 +19599,12 @@
19428
19599
  isScrolling.value = false;
19429
19600
  }, 100);
19430
19601
  const scrollTop = containerRef.value.scrollTop;
19431
- const direction = scrollTop < lastScrollTop ? UP$1 : DOWN$1;
19602
+ const direction = scrollTop < lastScrollTop ? UP : DOWN;
19432
19603
  const midPointIndex = calculateMidPointIndex(scrollTop);
19433
19604
  const buffer = Math.round(visibleItems.value / 3);
19434
- if (direction === UP$1 && midPointIndex <= startIndex.value) {
19605
+ if (direction === UP && midPointIndex <= startIndex.value) {
19435
19606
  startIndex.value = Math.max(midPointIndex - buffer, 0);
19436
- } else if (direction === DOWN$1 && midPointIndex >= startIndex.value + buffer * 2) {
19607
+ } else if (direction === DOWN && midPointIndex >= startIndex.value + buffer * 2) {
19437
19608
  startIndex.value = Math.min(Math.max(0, midPointIndex - buffer), items.value.length - visibleItems.value);
19438
19609
  }
19439
19610
  lastScrollTop = containerRef.value.scrollTop;
@@ -19872,177 +20043,6 @@
19872
20043
  }
19873
20044
  });
19874
20045
 
19875
- const VVirtualScrollItem = genericComponent()({
19876
- name: 'VVirtualScrollItem',
19877
- props: {
19878
- dynamicHeight: Boolean
19879
- },
19880
- emits: {
19881
- 'update:height': height => true
19882
- },
19883
- setup(props, _ref) {
19884
- let {
19885
- emit,
19886
- slots
19887
- } = _ref;
19888
- const {
19889
- resizeRef,
19890
- contentRect
19891
- } = useResizeObserver();
19892
- useToggleScope(() => props.dynamicHeight, () => {
19893
- vue.watch(() => contentRect.value?.height, height => {
19894
- if (height != null) emit('update:height', height);
19895
- });
19896
- });
19897
- function updateHeight() {
19898
- if (props.dynamicHeight && contentRect.value) {
19899
- emit('update:height', contentRect.value.height);
19900
- }
19901
- }
19902
- vue.onUpdated(updateHeight);
19903
- useRender(() => vue.createVNode("div", {
19904
- "ref": props.dynamicHeight ? resizeRef : undefined,
19905
- "class": "v-virtual-scroll__item"
19906
- }, [slots.default?.()]));
19907
- }
19908
- });
19909
-
19910
- // Types
19911
-
19912
- const UP = -1;
19913
- const DOWN = 1;
19914
- const VVirtualScroll = genericComponent()({
19915
- name: 'VVirtualScroll',
19916
- props: {
19917
- items: {
19918
- type: Array,
19919
- default: () => []
19920
- },
19921
- itemHeight: [Number, String],
19922
- visibleItems: [Number, String],
19923
- ...makeDimensionProps()
19924
- },
19925
- setup(props, _ref) {
19926
- let {
19927
- slots
19928
- } = _ref;
19929
- const first = vue.ref(0);
19930
- const baseItemHeight = vue.ref(props.itemHeight);
19931
- const itemHeight = vue.computed({
19932
- get: () => parseInt(baseItemHeight.value ?? 0, 10),
19933
- set(val) {
19934
- baseItemHeight.value = val;
19935
- }
19936
- });
19937
- const rootEl = vue.ref();
19938
- const {
19939
- resizeRef,
19940
- contentRect
19941
- } = useResizeObserver();
19942
- vue.watchEffect(() => {
19943
- resizeRef.value = rootEl.value;
19944
- });
19945
- const display = useDisplay();
19946
- const sizeMap = new Map();
19947
- let sizes = createRange(props.items.length).map(() => itemHeight.value);
19948
- const visibleItems = vue.computed(() => {
19949
- return props.visibleItems ? parseInt(props.visibleItems, 10) : Math.max(12, Math.ceil((contentRect.value?.height ?? display.height.value) / itemHeight.value * 1.7 + 1));
19950
- });
19951
- function handleItemResize(index, height) {
19952
- itemHeight.value = Math.max(itemHeight.value, height);
19953
- sizes[index] = height;
19954
- sizeMap.set(props.items[index], height);
19955
- }
19956
- function calculateOffset(index) {
19957
- return sizes.slice(0, index).reduce((curr, value) => curr + (value || itemHeight.value), 0);
19958
- }
19959
- function calculateMidPointIndex(scrollTop) {
19960
- let start = 0;
19961
- let end = props.items.length;
19962
- while (start <= end) {
19963
- const middle = start + Math.floor((end - start) / 2);
19964
- const middleOffset = calculateOffset(middle);
19965
- if (middleOffset === scrollTop) {
19966
- return middle;
19967
- } else if (middleOffset < scrollTop) {
19968
- start = middle + 1;
19969
- } else if (middleOffset > scrollTop) {
19970
- end = middle - 1;
19971
- }
19972
- }
19973
- return start;
19974
- }
19975
- let lastScrollTop = 0;
19976
- function handleScroll() {
19977
- if (!rootEl.value || !contentRect.value) return;
19978
- const height = contentRect.value.height;
19979
- const scrollTop = rootEl.value.scrollTop;
19980
- const direction = scrollTop < lastScrollTop ? UP : DOWN;
19981
- const midPointIndex = calculateMidPointIndex(scrollTop + height / 2);
19982
- const buffer = Math.round(visibleItems.value / 3);
19983
- if (direction === UP && midPointIndex <= first.value + buffer * 2 - 1) {
19984
- first.value = clamp(midPointIndex - buffer, 0, props.items.length);
19985
- } else if (direction === DOWN && midPointIndex >= first.value + buffer * 2 - 1) {
19986
- first.value = clamp(midPointIndex - buffer, 0, props.items.length - visibleItems.value);
19987
- }
19988
- lastScrollTop = rootEl.value.scrollTop;
19989
- }
19990
- function scrollToIndex(index) {
19991
- if (!rootEl.value) return;
19992
- const offset = calculateOffset(index);
19993
- rootEl.value.scrollTop = offset;
19994
- }
19995
- const last = vue.computed(() => Math.min(props.items.length, first.value + visibleItems.value));
19996
- const computedItems = vue.computed(() => props.items.slice(first.value, last.value));
19997
- const paddingTop = vue.computed(() => calculateOffset(first.value));
19998
- const paddingBottom = vue.computed(() => calculateOffset(props.items.length) - calculateOffset(last.value));
19999
- const {
20000
- dimensionStyles
20001
- } = useDimension(props);
20002
- vue.onMounted(() => {
20003
- if (!itemHeight.value) {
20004
- // If itemHeight prop is not set, then calculate an estimated height from the average of inital items
20005
- itemHeight.value = sizes.slice(first.value, last.value).reduce((curr, height) => curr + height, 0) / visibleItems.value;
20006
- }
20007
- });
20008
- vue.watch(() => props.items.length, () => {
20009
- sizes = createRange(props.items.length).map(() => itemHeight.value);
20010
- sizeMap.forEach((height, item) => {
20011
- const index = props.items.indexOf(item);
20012
- if (index === -1) {
20013
- sizeMap.delete(item);
20014
- } else {
20015
- sizes[index] = height;
20016
- }
20017
- });
20018
- });
20019
- useRender(() => vue.createVNode("div", {
20020
- "ref": rootEl,
20021
- "class": "v-virtual-scroll",
20022
- "onScroll": handleScroll,
20023
- "style": dimensionStyles.value
20024
- }, [vue.createVNode("div", {
20025
- "class": "v-virtual-scroll__container",
20026
- "style": {
20027
- paddingTop: convertToUnit(paddingTop.value),
20028
- paddingBottom: convertToUnit(paddingBottom.value)
20029
- }
20030
- }, [computedItems.value.map((item, index) => vue.createVNode(VVirtualScrollItem, {
20031
- "key": index,
20032
- "dynamicHeight": !props.itemHeight,
20033
- "onUpdate:height": height => handleItemResize(index + first.value, height)
20034
- }, {
20035
- default: () => [slots.default?.({
20036
- item,
20037
- index: index + first.value
20038
- })]
20039
- }))])]));
20040
- return {
20041
- scrollToIndex
20042
- };
20043
- }
20044
- });
20045
-
20046
20046
  var components = /*#__PURE__*/Object.freeze({
20047
20047
  __proto__: null,
20048
20048
  VAlert: VAlert,
@@ -20395,7 +20395,7 @@
20395
20395
  locale
20396
20396
  };
20397
20397
  }
20398
- const version$1 = "3.2.0-dev-20230405.0";
20398
+ const version$1 = "3.2.0-dev-20230407.0";
20399
20399
  createVuetify$1.version = version$1;
20400
20400
 
20401
20401
  // Vue's inject() can only be used in setup
@@ -20407,7 +20407,7 @@
20407
20407
  }
20408
20408
  }
20409
20409
 
20410
- const version = "3.2.0-dev-20230405.0";
20410
+ const version = "3.2.0-dev-20230407.0";
20411
20411
 
20412
20412
  const createVuetify = function () {
20413
20413
  let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};