@vuetify/nightly 3.3.5-master.2023-06-21 → 3.3.5-pr-17265.042d482

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 (52) hide show
  1. package/CHANGELOG.md +21 -2
  2. package/dist/json/attributes.json +4 -0
  3. package/dist/json/importMap.json +4 -4
  4. package/dist/json/tags.json +1 -0
  5. package/dist/json/web-types.json +16 -14
  6. package/dist/vuetify-labs.css +57 -57
  7. package/dist/vuetify-labs.d.ts +80 -20
  8. package/dist/vuetify-labs.esm.js +460 -326
  9. package/dist/vuetify-labs.esm.js.map +1 -1
  10. package/dist/vuetify-labs.js +459 -325
  11. package/dist/vuetify-labs.min.css +2 -2
  12. package/dist/vuetify.css +19 -19
  13. package/dist/vuetify.d.ts +37 -15
  14. package/dist/vuetify.esm.js +448 -316
  15. package/dist/vuetify.esm.js.map +1 -1
  16. package/dist/vuetify.js +447 -315
  17. package/dist/vuetify.js.map +1 -1
  18. package/dist/vuetify.min.css +2 -2
  19. package/dist/vuetify.min.js +675 -656
  20. package/dist/vuetify.min.js.map +1 -1
  21. package/lib/components/VAutocomplete/VAutocomplete.mjs +48 -35
  22. package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
  23. package/lib/components/VCombobox/VCombobox.mjs +48 -35
  24. package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
  25. package/lib/components/VSelect/VSelect.mjs +43 -31
  26. package/lib/components/VSelect/VSelect.mjs.map +1 -1
  27. package/lib/components/VSelect/useScrolling.mjs +69 -0
  28. package/lib/components/VSelect/useScrolling.mjs.map +1 -0
  29. package/lib/components/VVirtualScroll/VVirtualScroll.mjs +50 -24
  30. package/lib/components/VVirtualScroll/VVirtualScroll.mjs.map +1 -1
  31. package/lib/components/VVirtualScroll/VVirtualScrollItem.mjs +13 -23
  32. package/lib/components/VVirtualScroll/VVirtualScrollItem.mjs.map +1 -1
  33. package/lib/components/VVirtualScroll/index.d.mts +37 -15
  34. package/lib/components/index.d.mts +36 -14
  35. package/lib/composables/filter.mjs +6 -4
  36. package/lib/composables/filter.mjs.map +1 -1
  37. package/lib/composables/resizeObserver.mjs +6 -1
  38. package/lib/composables/resizeObserver.mjs.map +1 -1
  39. package/lib/composables/virtual.mjs +17 -17
  40. package/lib/composables/virtual.mjs.map +1 -1
  41. package/lib/entry-bundler.mjs +1 -1
  42. package/lib/entry-bundler.mjs.map +1 -1
  43. package/lib/framework.mjs +1 -1
  44. package/lib/framework.mjs.map +1 -1
  45. package/lib/index.d.mts +1 -1
  46. package/lib/labs/VDataTable/VDataTableVirtual.mjs +12 -10
  47. package/lib/labs/VDataTable/VDataTableVirtual.mjs.map +1 -1
  48. package/lib/labs/VDataTable/index.d.mts +44 -6
  49. package/lib/labs/components.d.mts +44 -6
  50. package/lib/util/getScrollParent.mjs +7 -1
  51. package/lib/util/getScrollParent.mjs.map +1 -1
  52. package/package.json +1 -1
package/dist/vuetify.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vuetify v3.3.5-master.2023-06-21
2
+ * Vuetify v3.3.5-pr-17265.042d482
3
3
  * Forged by John Leider
4
4
  * Released under the MIT License.
5
5
  */
@@ -1251,8 +1251,9 @@
1251
1251
  };
1252
1252
 
1253
1253
  function getScrollParent(el) {
1254
+ let includeHidden = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1254
1255
  while (el) {
1255
- if (hasScrollbar(el)) return el;
1256
+ if (includeHidden ? isPotentiallyScrollable(el) : hasScrollbar(el)) return el;
1256
1257
  el = el.parentElement;
1257
1258
  }
1258
1259
  return document.scrollingElement;
@@ -1272,6 +1273,11 @@
1272
1273
  const style = window.getComputedStyle(el);
1273
1274
  return style.overflowY === 'scroll' || style.overflowY === 'auto' && el.scrollHeight > el.clientHeight;
1274
1275
  }
1276
+ function isPotentiallyScrollable(el) {
1277
+ if (!el || el.nodeType !== Node.ELEMENT_NODE) return false;
1278
+ const style = window.getComputedStyle(el);
1279
+ return ['scroll', 'auto'].includes(style.overflowY);
1280
+ }
1275
1281
 
1276
1282
  const IN_BROWSER = typeof window !== 'undefined';
1277
1283
  const SUPPORTS_INTERSECTION = IN_BROWSER && 'IntersectionObserver' in window;
@@ -1316,13 +1322,18 @@
1316
1322
  // Types
1317
1323
 
1318
1324
  function useResizeObserver(callback) {
1325
+ let box = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'content';
1319
1326
  const resizeRef = vue.ref();
1320
1327
  const contentRect = vue.ref();
1321
1328
  if (IN_BROWSER) {
1322
1329
  const observer = new ResizeObserver(entries => {
1323
1330
  callback?.(entries, observer);
1324
1331
  if (!entries.length) return;
1325
- contentRect.value = entries[0].contentRect;
1332
+ if (box === 'content') {
1333
+ contentRect.value = entries[0].contentRect;
1334
+ } else {
1335
+ contentRect.value = entries[0].target.getBoundingClientRect();
1336
+ }
1326
1337
  });
1327
1338
  vue.onBeforeUnmount(() => {
1328
1339
  observer.disconnect();
@@ -10379,6 +10390,301 @@
10379
10390
 
10380
10391
  // Types
10381
10392
 
10393
+ const makeVVirtualScrollItemProps = propsFactory({
10394
+ renderless: Boolean,
10395
+ ...makeComponentProps()
10396
+ }, 'VVirtualScrollItem');
10397
+ const VVirtualScrollItem = genericComponent()({
10398
+ name: 'VVirtualScrollItem',
10399
+ inheritAttrs: false,
10400
+ props: makeVVirtualScrollItemProps(),
10401
+ emits: {
10402
+ 'update:height': height => true
10403
+ },
10404
+ setup(props, _ref) {
10405
+ let {
10406
+ attrs,
10407
+ emit,
10408
+ slots
10409
+ } = _ref;
10410
+ const {
10411
+ resizeRef,
10412
+ contentRect
10413
+ } = useResizeObserver(undefined, 'border');
10414
+ vue.watch(() => contentRect.value?.height, height => {
10415
+ if (height != null) emit('update:height', height);
10416
+ });
10417
+ useRender(() => props.renderless ? vue.createVNode(vue.Fragment, null, [slots.default?.({
10418
+ itemRef: resizeRef
10419
+ })]) : vue.createVNode("div", vue.mergeProps({
10420
+ "ref": resizeRef,
10421
+ "class": ['v-virtual-scroll__item', props.class],
10422
+ "style": props.style
10423
+ }, attrs), [slots.default?.()]));
10424
+ }
10425
+ });
10426
+
10427
+ // Composables
10428
+
10429
+ // Types
10430
+
10431
+ const UP = -1;
10432
+ const DOWN = 1;
10433
+ const makeVirtualProps = propsFactory({
10434
+ itemHeight: {
10435
+ type: [Number, String],
10436
+ default: 48
10437
+ }
10438
+ }, 'virtual');
10439
+ function useVirtual(props, items, offset) {
10440
+ const first = vue.shallowRef(0);
10441
+ const baseItemHeight = vue.shallowRef(props.itemHeight);
10442
+ const itemHeight = vue.computed({
10443
+ get: () => parseInt(baseItemHeight.value ?? 0, 10),
10444
+ set(val) {
10445
+ baseItemHeight.value = val;
10446
+ }
10447
+ });
10448
+ const containerRef = vue.ref();
10449
+ const {
10450
+ resizeRef,
10451
+ contentRect
10452
+ } = useResizeObserver();
10453
+ vue.watchEffect(() => {
10454
+ resizeRef.value = containerRef.value;
10455
+ });
10456
+ const display = useDisplay();
10457
+ const sizeMap = new Map();
10458
+ let sizes = Array.from({
10459
+ length: items.value.length
10460
+ });
10461
+ const visibleItems = vue.computed(() => {
10462
+ const height = (!contentRect.value || containerRef.value === document.documentElement ? display.height.value : contentRect.value.height) - (offset?.value ?? 0);
10463
+ return Math.ceil(height / itemHeight.value * 1.7 + 1);
10464
+ });
10465
+ function handleItemResize(index, height) {
10466
+ itemHeight.value = Math.max(itemHeight.value, height);
10467
+ sizes[index] = height;
10468
+ sizeMap.set(items.value[index], height);
10469
+ }
10470
+ function calculateOffset(index) {
10471
+ return sizes.slice(0, index).reduce((acc, val) => acc + (val || itemHeight.value), 0);
10472
+ }
10473
+ function calculateMidPointIndex(scrollTop) {
10474
+ const end = items.value.length;
10475
+ let middle = 0;
10476
+ let middleOffset = 0;
10477
+ while (middleOffset < scrollTop && middle < end) {
10478
+ middleOffset += sizes[middle++] || itemHeight.value;
10479
+ }
10480
+ return middle - 1;
10481
+ }
10482
+ let lastScrollTop = 0;
10483
+ function handleScroll() {
10484
+ if (!containerRef.value || !contentRect.value) return;
10485
+ const height = contentRect.value.height - 56;
10486
+ const scrollTop = containerRef.value.scrollTop;
10487
+ const direction = scrollTop < lastScrollTop ? UP : DOWN;
10488
+ const midPointIndex = calculateMidPointIndex(scrollTop + height / 2);
10489
+ const buffer = Math.round(visibleItems.value / 3);
10490
+ const firstIndex = midPointIndex - buffer;
10491
+ const lastIndex = first.value + buffer * 2 - 1;
10492
+ if (direction === UP && midPointIndex <= lastIndex) {
10493
+ first.value = clamp(firstIndex, 0, items.value.length);
10494
+ } else if (direction === DOWN && midPointIndex >= lastIndex) {
10495
+ first.value = clamp(firstIndex, 0, items.value.length - visibleItems.value);
10496
+ }
10497
+ lastScrollTop = scrollTop;
10498
+ }
10499
+ function scrollToIndex(index) {
10500
+ if (!containerRef.value) return;
10501
+ const offset = calculateOffset(index);
10502
+ containerRef.value.scrollTop = offset;
10503
+ }
10504
+ const last = vue.computed(() => Math.min(items.value.length, first.value + visibleItems.value));
10505
+ const computedItems = vue.computed(() => {
10506
+ return items.value.slice(first.value, last.value).map((item, index) => ({
10507
+ raw: item,
10508
+ index: index + first.value
10509
+ }));
10510
+ });
10511
+ const paddingTop = vue.computed(() => calculateOffset(first.value));
10512
+ const paddingBottom = vue.computed(() => calculateOffset(items.value.length) - calculateOffset(last.value));
10513
+ vue.watch(() => items.value.length, () => {
10514
+ sizes = createRange(items.value.length).map(() => itemHeight.value);
10515
+ sizeMap.forEach((height, item) => {
10516
+ const index = items.value.indexOf(item);
10517
+ if (index === -1) {
10518
+ sizeMap.delete(item);
10519
+ } else {
10520
+ sizes[index] = height;
10521
+ }
10522
+ });
10523
+ });
10524
+ return {
10525
+ containerRef,
10526
+ computedItems,
10527
+ itemHeight,
10528
+ paddingTop,
10529
+ paddingBottom,
10530
+ scrollToIndex,
10531
+ handleScroll,
10532
+ handleItemResize
10533
+ };
10534
+ }
10535
+
10536
+ // Types
10537
+
10538
+ const makeVVirtualScrollProps = propsFactory({
10539
+ items: {
10540
+ type: Array,
10541
+ default: () => []
10542
+ },
10543
+ renderless: Boolean,
10544
+ ...makeVirtualProps(),
10545
+ ...makeComponentProps(),
10546
+ ...makeDimensionProps()
10547
+ }, 'VVirtualScroll');
10548
+ const VVirtualScroll = genericComponent()({
10549
+ name: 'VVirtualScroll',
10550
+ props: makeVVirtualScrollProps(),
10551
+ setup(props, _ref) {
10552
+ let {
10553
+ slots
10554
+ } = _ref;
10555
+ const vm = getCurrentInstance('VVirtualScroll');
10556
+ const {
10557
+ dimensionStyles
10558
+ } = useDimension(props);
10559
+ const {
10560
+ containerRef,
10561
+ handleScroll,
10562
+ handleItemResize,
10563
+ scrollToIndex,
10564
+ paddingTop,
10565
+ paddingBottom,
10566
+ computedItems
10567
+ } = useVirtual(props, vue.toRef(props, 'items'));
10568
+ useToggleScope(() => props.renderless, () => {
10569
+ vue.onMounted(() => {
10570
+ containerRef.value = getScrollParent(vm.vnode.el, true);
10571
+ containerRef.value?.addEventListener('scroll', handleScroll);
10572
+ });
10573
+ vue.onScopeDispose(() => {
10574
+ containerRef.value?.removeEventListener('scroll', handleScroll);
10575
+ });
10576
+ });
10577
+ useRender(() => {
10578
+ const children = computedItems.value.map(item => vue.createVNode(VVirtualScrollItem, {
10579
+ "key": item.index,
10580
+ "renderless": props.renderless,
10581
+ "onUpdate:height": height => handleItemResize(item.index, height)
10582
+ }, {
10583
+ default: slotProps => slots.default?.({
10584
+ item: item.raw,
10585
+ index: item.index,
10586
+ ...slotProps
10587
+ })
10588
+ }));
10589
+ return props.renderless ? vue.createVNode(vue.Fragment, null, [vue.createVNode("div", {
10590
+ "class": "v-virtual-scroll__spacer",
10591
+ "style": {
10592
+ paddingTop: convertToUnit(paddingTop.value)
10593
+ }
10594
+ }, null), children, vue.createVNode("div", {
10595
+ "class": "v-virtual-scroll__spacer",
10596
+ "style": {
10597
+ paddingBottom: convertToUnit(paddingBottom.value)
10598
+ }
10599
+ }, null)]) : vue.createVNode("div", {
10600
+ "ref": containerRef,
10601
+ "class": ['v-virtual-scroll', props.class],
10602
+ "onScroll": handleScroll,
10603
+ "style": [dimensionStyles.value, props.style]
10604
+ }, [vue.createVNode("div", {
10605
+ "class": "v-virtual-scroll__container",
10606
+ "style": {
10607
+ paddingTop: convertToUnit(paddingTop.value),
10608
+ paddingBottom: convertToUnit(paddingBottom.value)
10609
+ }
10610
+ }, [children])]);
10611
+ });
10612
+ return {
10613
+ scrollToIndex
10614
+ };
10615
+ }
10616
+ });
10617
+
10618
+ // Utilities
10619
+
10620
+ // Types
10621
+
10622
+ function useScrolling(listRef, textFieldRef) {
10623
+ const isScrolling = vue.shallowRef(false);
10624
+ let scrollTimeout;
10625
+ function onListScroll(e) {
10626
+ cancelAnimationFrame(scrollTimeout);
10627
+ isScrolling.value = true;
10628
+ scrollTimeout = requestAnimationFrame(() => {
10629
+ scrollTimeout = requestAnimationFrame(() => {
10630
+ isScrolling.value = false;
10631
+ });
10632
+ });
10633
+ }
10634
+ async function finishScrolling() {
10635
+ await new Promise(resolve => requestAnimationFrame(resolve));
10636
+ await new Promise(resolve => requestAnimationFrame(resolve));
10637
+ await new Promise(resolve => requestAnimationFrame(resolve));
10638
+ await new Promise(resolve => {
10639
+ if (isScrolling.value) {
10640
+ const stop = vue.watch(isScrolling, () => {
10641
+ stop();
10642
+ resolve();
10643
+ });
10644
+ } else resolve();
10645
+ });
10646
+ }
10647
+ async function onListKeydown(e) {
10648
+ if (e.key === 'Tab') {
10649
+ textFieldRef.value?.focus();
10650
+ }
10651
+ if (!['PageDown', 'PageUp', 'Home', 'End'].includes(e.key)) return;
10652
+ const el = listRef.value?.$el;
10653
+ if (!el) return;
10654
+ if (e.key === 'Home' || e.key === 'End') {
10655
+ el.scrollTo({
10656
+ top: e.key === 'Home' ? 0 : el.scrollHeight,
10657
+ behavior: 'smooth'
10658
+ });
10659
+ }
10660
+ await finishScrolling();
10661
+ const children = el.querySelectorAll(':scope > :not(.v-virtual-scroll__spacer)');
10662
+ if (e.key === 'PageDown' || e.key === 'Home') {
10663
+ const top = el.getBoundingClientRect().top;
10664
+ for (const child of children) {
10665
+ if (child.getBoundingClientRect().top >= top) {
10666
+ child.focus();
10667
+ break;
10668
+ }
10669
+ }
10670
+ } else {
10671
+ const bottom = el.getBoundingClientRect().bottom;
10672
+ for (const child of [...children].reverse()) {
10673
+ if (child.getBoundingClientRect().bottom <= bottom) {
10674
+ child.focus();
10675
+ break;
10676
+ }
10677
+ }
10678
+ }
10679
+ }
10680
+ return {
10681
+ onListScroll,
10682
+ onListKeydown
10683
+ };
10684
+ }
10685
+
10686
+ // Types
10687
+
10382
10688
  const makeSelectProps = propsFactory({
10383
10689
  chips: Boolean,
10384
10690
  closableChips: Boolean,
@@ -10470,6 +10776,10 @@
10470
10776
  });
10471
10777
  const menuDisabled = vue.computed(() => props.hideNoData && !items.value.length || props.readonly || form?.isReadonly.value);
10472
10778
  const listRef = vue.ref();
10779
+ const {
10780
+ onListScroll,
10781
+ onListKeydown
10782
+ } = useScrolling(listRef, vTextFieldRef);
10473
10783
  function onClear(e) {
10474
10784
  if (props.openOnClear) {
10475
10785
  menu.value = true;
@@ -10516,11 +10826,6 @@
10516
10826
  model.value = [item];
10517
10827
  }
10518
10828
  }
10519
- function onListKeydown(e) {
10520
- if (e.key === 'Tab') {
10521
- vTextFieldRef.value?.focus();
10522
- }
10523
- }
10524
10829
  function select(item) {
10525
10830
  if (props.multiple) {
10526
10831
  const index = selected.value.findIndex(selection => props.valueComparator(selection, item.value));
@@ -10603,34 +10908,46 @@
10603
10908
  "onMousedown": e => e.preventDefault(),
10604
10909
  "onKeydown": onListKeydown,
10605
10910
  "onFocusin": onFocusin,
10911
+ "onScrollPassive": onListScroll,
10606
10912
  "tabindex": "-1"
10607
10913
  }, {
10608
10914
  default: () => [slots['prepend-item']?.(), !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? vue.createVNode(VListItem, {
10609
10915
  "title": t(props.noDataText)
10610
- }, null)), displayItems.value.map((item, index) => {
10611
- const itemProps = vue.mergeProps(item.props, {
10612
- key: index,
10613
- onClick: () => select(item)
10614
- });
10615
- return slots.item?.({
10616
- item,
10617
- index,
10618
- props: itemProps
10619
- }) ?? vue.createVNode(VListItem, itemProps, {
10620
- prepend: _ref2 => {
10621
- let {
10622
- isSelected
10623
- } = _ref2;
10624
- return vue.createVNode(vue.Fragment, null, [props.multiple && !props.hideSelected ? vue.createVNode(VCheckboxBtn, {
10625
- "key": item.value,
10626
- "modelValue": isSelected,
10627
- "ripple": false,
10628
- "tabindex": "-1"
10629
- }, null) : undefined, item.props.prependIcon && vue.createVNode(VIcon, {
10630
- "icon": item.props.prependIcon
10631
- }, null)]);
10632
- }
10633
- });
10916
+ }, null)), vue.createVNode(VVirtualScroll, {
10917
+ "renderless": true,
10918
+ "items": displayItems.value
10919
+ }, {
10920
+ default: _ref2 => {
10921
+ let {
10922
+ item,
10923
+ index,
10924
+ itemRef
10925
+ } = _ref2;
10926
+ const itemProps = vue.mergeProps(item.props, {
10927
+ ref: itemRef,
10928
+ key: index,
10929
+ onClick: () => select(item)
10930
+ });
10931
+ return slots.item?.({
10932
+ item,
10933
+ index,
10934
+ props: itemProps
10935
+ }) ?? vue.createVNode(VListItem, itemProps, {
10936
+ prepend: _ref3 => {
10937
+ let {
10938
+ isSelected
10939
+ } = _ref3;
10940
+ return vue.createVNode(vue.Fragment, null, [props.multiple && !props.hideSelected ? vue.createVNode(VCheckboxBtn, {
10941
+ "key": item.value,
10942
+ "modelValue": isSelected,
10943
+ "ripple": false,
10944
+ "tabindex": "-1"
10945
+ }, null) : undefined, item.props.prependIcon && vue.createVNode(VIcon, {
10946
+ "icon": item.props.prependIcon
10947
+ }, null)]);
10948
+ }
10949
+ });
10950
+ }
10634
10951
  }), slots['append-item']?.()]
10635
10952
  })]
10636
10953
  }), selections.value.map((item, index) => {
@@ -10773,8 +11090,6 @@
10773
11090
  const filteredMatches = vue.ref(new Map());
10774
11091
  const transformedItems = vue.computed(() => options?.transform ? vue.unref(items).map(options?.transform) : vue.unref(items));
10775
11092
  vue.watchEffect(() => {
10776
- filteredItems.value = [];
10777
- filteredMatches.value = new Map();
10778
11093
  const results = filterItems(transformedItems.value, strQuery.value, {
10779
11094
  customKeyFilter: props.customKeyFilter,
10780
11095
  default: props.customFilter,
@@ -10783,15 +11098,19 @@
10783
11098
  noFilter: props.noFilter
10784
11099
  });
10785
11100
  const originalItems = vue.unref(items);
11101
+ const _filteredItems = [];
11102
+ const _filteredMatches = new Map();
10786
11103
  results.forEach(_ref => {
10787
11104
  let {
10788
11105
  index,
10789
11106
  matches
10790
11107
  } = _ref;
10791
11108
  const item = originalItems[index];
10792
- filteredItems.value.push(item);
10793
- filteredMatches.value.set(item.value, matches);
11109
+ _filteredItems.push(item);
11110
+ _filteredMatches.set(item.value, matches);
10794
11111
  });
11112
+ filteredItems.value = _filteredItems;
11113
+ filteredMatches.value = _filteredMatches;
10795
11114
  });
10796
11115
  function getMatches(item) {
10797
11116
  return filteredMatches.value.get(item.value);
@@ -10881,7 +11200,7 @@
10881
11200
  const {
10882
11201
  filteredItems,
10883
11202
  getMatches
10884
- } = useFilter(props, items, vue.computed(() => isPristine.value ? undefined : search.value));
11203
+ } = useFilter(props, items, search);
10885
11204
  const selections = vue.computed(() => {
10886
11205
  return model.value.map(v => {
10887
11206
  return items.value.find(item => props.valueComparator(item.value, v.value)) || v;
@@ -10901,6 +11220,10 @@
10901
11220
  });
10902
11221
  const menuDisabled = vue.computed(() => props.hideNoData && !items.value.length || props.readonly || form?.isReadonly.value);
10903
11222
  const listRef = vue.ref();
11223
+ const {
11224
+ onListScroll,
11225
+ onListKeydown
11226
+ } = useScrolling(listRef, vTextFieldRef);
10904
11227
  function onClear(e) {
10905
11228
  if (props.openOnClear) {
10906
11229
  menu.value = true;
@@ -10974,11 +11297,6 @@
10974
11297
  }
10975
11298
  }
10976
11299
  }
10977
- function onListKeydown(e) {
10978
- if (e.key === 'Tab') {
10979
- vTextFieldRef.value?.focus();
10980
- }
10981
- }
10982
11300
  function onInput(e) {
10983
11301
  search.value = e.target.value;
10984
11302
  }
@@ -11097,38 +11415,50 @@
11097
11415
  "onKeydown": onListKeydown,
11098
11416
  "onFocusin": onFocusin,
11099
11417
  "onFocusout": onFocusout,
11418
+ "onScrollPassive": onListScroll,
11100
11419
  "tabindex": "-1"
11101
11420
  }, {
11102
11421
  default: () => [slots['prepend-item']?.(), !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? vue.createVNode(VListItem, {
11103
11422
  "title": t(props.noDataText)
11104
- }, null)), displayItems.value.map((item, index) => {
11105
- const itemProps = vue.mergeProps(item.props, {
11106
- key: index,
11107
- active: highlightFirst.value && index === 0 ? true : undefined,
11108
- onClick: () => select(item)
11109
- });
11110
- return slots.item?.({
11111
- item,
11112
- index,
11113
- props: itemProps
11114
- }) ?? vue.createVNode(VListItem, itemProps, {
11115
- prepend: _ref3 => {
11116
- let {
11117
- isSelected
11118
- } = _ref3;
11119
- return vue.createVNode(vue.Fragment, null, [props.multiple && !props.hideSelected ? vue.createVNode(VCheckboxBtn, {
11120
- "key": item.value,
11121
- "modelValue": isSelected,
11122
- "ripple": false,
11123
- "tabindex": "-1"
11124
- }, null) : undefined, item.props.prependIcon && vue.createVNode(VIcon, {
11125
- "icon": item.props.prependIcon
11126
- }, null)]);
11127
- },
11128
- title: () => {
11129
- return isPristine.value ? item.title : highlightResult$1(item.title, getMatches(item)?.title, search.value?.length ?? 0);
11130
- }
11131
- });
11423
+ }, null)), vue.createVNode(VVirtualScroll, {
11424
+ "renderless": true,
11425
+ "items": displayItems.value
11426
+ }, {
11427
+ default: _ref3 => {
11428
+ let {
11429
+ item,
11430
+ index,
11431
+ itemRef
11432
+ } = _ref3;
11433
+ const itemProps = vue.mergeProps(item.props, {
11434
+ ref: itemRef,
11435
+ key: index,
11436
+ active: highlightFirst.value && index === 0 ? true : undefined,
11437
+ onClick: () => select(item)
11438
+ });
11439
+ return slots.item?.({
11440
+ item,
11441
+ index,
11442
+ props: itemProps
11443
+ }) ?? vue.createVNode(VListItem, itemProps, {
11444
+ prepend: _ref4 => {
11445
+ let {
11446
+ isSelected
11447
+ } = _ref4;
11448
+ return vue.createVNode(vue.Fragment, null, [props.multiple && !props.hideSelected ? vue.createVNode(VCheckboxBtn, {
11449
+ "key": item.value,
11450
+ "modelValue": isSelected,
11451
+ "ripple": false,
11452
+ "tabindex": "-1"
11453
+ }, null) : undefined, item.props.prependIcon && vue.createVNode(VIcon, {
11454
+ "icon": item.props.prependIcon
11455
+ }, null)]);
11456
+ },
11457
+ title: () => {
11458
+ return isPristine.value ? item.title : highlightResult$1(item.title, getMatches(item)?.title, search.value?.length ?? 0);
11459
+ }
11460
+ });
11461
+ }
11132
11462
  }), slots['append-item']?.()]
11133
11463
  })]
11134
11464
  }), selections.value.map((item, index) => {
@@ -14418,7 +14748,7 @@
14418
14748
  const {
14419
14749
  filteredItems,
14420
14750
  getMatches
14421
- } = useFilter(props, items, vue.computed(() => isPristine.value ? undefined : search.value));
14751
+ } = useFilter(props, items, search);
14422
14752
  const selections = vue.computed(() => {
14423
14753
  return model.value.map(v => {
14424
14754
  return items.value.find(item => props.valueComparator(item.value, v.value)) || v;
@@ -14438,6 +14768,10 @@
14438
14768
  });
14439
14769
  const menuDisabled = vue.computed(() => props.hideNoData && !items.value.length || props.readonly || form?.isReadonly.value);
14440
14770
  const listRef = vue.ref();
14771
+ const {
14772
+ onListScroll,
14773
+ onListKeydown
14774
+ } = useScrolling(listRef, vTextFieldRef);
14441
14775
  function onClear(e) {
14442
14776
  cleared = true;
14443
14777
  if (props.openOnClear) {
@@ -14515,11 +14849,6 @@
14515
14849
  search.value = '';
14516
14850
  }
14517
14851
  }
14518
- function onListKeydown(e) {
14519
- if (e.key === 'Tab') {
14520
- vTextFieldRef.value?.focus();
14521
- }
14522
- }
14523
14852
  function onAfterLeave() {
14524
14853
  if (isFocused.value) {
14525
14854
  isPristine.value = true;
@@ -14630,38 +14959,50 @@
14630
14959
  "onKeydown": onListKeydown,
14631
14960
  "onFocusin": onFocusin,
14632
14961
  "onFocusout": onFocusout,
14962
+ "onScrollPassive": onListScroll,
14633
14963
  "tabindex": "-1"
14634
14964
  }, {
14635
14965
  default: () => [slots['prepend-item']?.(), !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? vue.createVNode(VListItem, {
14636
14966
  "title": t(props.noDataText)
14637
- }, null)), displayItems.value.map((item, index) => {
14638
- const itemProps = vue.mergeProps(item.props, {
14639
- key: index,
14640
- active: highlightFirst.value && index === 0 ? true : undefined,
14641
- onClick: () => select(item)
14642
- });
14643
- return slots.item?.({
14644
- item,
14645
- index,
14646
- props: itemProps
14647
- }) ?? vue.createVNode(VListItem, itemProps, {
14648
- prepend: _ref3 => {
14649
- let {
14650
- isSelected
14651
- } = _ref3;
14652
- return vue.createVNode(vue.Fragment, null, [props.multiple && !props.hideSelected ? vue.createVNode(VCheckboxBtn, {
14653
- "key": item.value,
14654
- "modelValue": isSelected,
14655
- "ripple": false,
14656
- "tabindex": "-1"
14657
- }, null) : undefined, item.props.prependIcon && vue.createVNode(VIcon, {
14658
- "icon": item.props.prependIcon
14659
- }, null)]);
14660
- },
14661
- title: () => {
14662
- return isPristine.value ? item.title : highlightResult(item.title, getMatches(item)?.title, search.value?.length ?? 0);
14663
- }
14664
- });
14967
+ }, null)), vue.createVNode(VVirtualScroll, {
14968
+ "renderless": true,
14969
+ "items": displayItems.value
14970
+ }, {
14971
+ default: _ref3 => {
14972
+ let {
14973
+ item,
14974
+ index,
14975
+ itemRef
14976
+ } = _ref3;
14977
+ const itemProps = vue.mergeProps(item.props, {
14978
+ ref: itemRef,
14979
+ key: index,
14980
+ active: highlightFirst.value && index === 0 ? true : undefined,
14981
+ onClick: () => select(item)
14982
+ });
14983
+ return slots.item?.({
14984
+ item,
14985
+ index,
14986
+ props: itemProps
14987
+ }) ?? vue.createVNode(VListItem, itemProps, {
14988
+ prepend: _ref4 => {
14989
+ let {
14990
+ isSelected
14991
+ } = _ref4;
14992
+ return vue.createVNode(vue.Fragment, null, [props.multiple && !props.hideSelected ? vue.createVNode(VCheckboxBtn, {
14993
+ "key": item.value,
14994
+ "modelValue": isSelected,
14995
+ "ripple": false,
14996
+ "tabindex": "-1"
14997
+ }, null) : undefined, item.props.prependIcon && vue.createVNode(VIcon, {
14998
+ "icon": item.props.prependIcon
14999
+ }, null)]);
15000
+ },
15001
+ title: () => {
15002
+ return isPristine.value ? item.title : highlightResult(item.title, getMatches(item)?.title, search.value?.length ?? 0);
15003
+ }
15004
+ });
15005
+ }
14665
15006
  }), slots['append-item']?.()]
14666
15007
  })]
14667
15008
  }), selections.value.map((item, index) => {
@@ -19003,215 +19344,6 @@
19003
19344
  }
19004
19345
  });
19005
19346
 
19006
- const makeVVirtualScrollItemProps = propsFactory({
19007
- dynamicHeight: Boolean,
19008
- renderless: Boolean,
19009
- ...makeComponentProps()
19010
- }, 'VVirtualScrollItem');
19011
- const VVirtualScrollItem = genericComponent()({
19012
- name: 'VVirtualScrollItem',
19013
- props: makeVVirtualScrollItemProps(),
19014
- emits: {
19015
- 'update:height': height => true
19016
- },
19017
- setup(props, _ref) {
19018
- let {
19019
- emit,
19020
- slots
19021
- } = _ref;
19022
- const {
19023
- resizeRef,
19024
- contentRect
19025
- } = useResizeObserver();
19026
- useToggleScope(() => props.dynamicHeight, () => {
19027
- vue.watch(() => contentRect.value?.height, height => {
19028
- if (height != null) emit('update:height', height);
19029
- });
19030
- });
19031
- function updateHeight() {
19032
- if (props.dynamicHeight && contentRect.value) {
19033
- emit('update:height', contentRect.value.height);
19034
- }
19035
- }
19036
- vue.onUpdated(updateHeight);
19037
- useRender(() => props.renderless ? vue.createVNode(vue.Fragment, null, [slots.default?.({
19038
- props: {
19039
- ref: props.dynamicHeight ? resizeRef : undefined
19040
- }
19041
- })]) : vue.createVNode("div", {
19042
- "ref": props.dynamicHeight ? resizeRef : undefined,
19043
- "class": ['v-virtual-scroll__item', props.class],
19044
- "style": props.style
19045
- }, [slots.default?.()]));
19046
- }
19047
- });
19048
-
19049
- // Composables
19050
-
19051
- // Types
19052
-
19053
- const UP = -1;
19054
- const DOWN = 1;
19055
- const makeVirtualProps = propsFactory({
19056
- itemHeight: [Number, String]
19057
- }, 'virtual');
19058
- function useVirtual(props, items, offset) {
19059
- const first = vue.shallowRef(0);
19060
- const baseItemHeight = vue.shallowRef(props.itemHeight);
19061
- const itemHeight = vue.computed({
19062
- get: () => parseInt(baseItemHeight.value ?? 0, 10),
19063
- set(val) {
19064
- baseItemHeight.value = val;
19065
- }
19066
- });
19067
- const containerRef = vue.ref();
19068
- const {
19069
- resizeRef,
19070
- contentRect
19071
- } = useResizeObserver();
19072
- vue.watchEffect(() => {
19073
- resizeRef.value = containerRef.value;
19074
- });
19075
- const display = useDisplay();
19076
- const sizeMap = new Map();
19077
- let sizes = createRange(items.value.length).map(() => itemHeight.value);
19078
- const visibleItems = vue.computed(() => {
19079
- const height = (contentRect.value?.height ?? display.height.value) - (offset?.value ?? 0);
19080
- return itemHeight.value ? Math.max(12, Math.ceil(height / itemHeight.value * 1.7 + 1)) : 12;
19081
- });
19082
- function handleItemResize(index, height) {
19083
- itemHeight.value = Math.max(itemHeight.value, height);
19084
- sizes[index] = height;
19085
- sizeMap.set(items.value[index], height);
19086
- }
19087
- function calculateOffset(index) {
19088
- return sizes.slice(0, index).reduce((curr, value) => curr + (value || itemHeight.value), 0);
19089
- }
19090
- function calculateMidPointIndex(scrollTop) {
19091
- const end = items.value.length;
19092
- let middle = 0;
19093
- let middleOffset = 0;
19094
- while (middleOffset < scrollTop && middle < end) {
19095
- middleOffset += sizes[middle++] || itemHeight.value;
19096
- }
19097
- return middle - 1;
19098
- }
19099
- let lastScrollTop = 0;
19100
- function handleScroll() {
19101
- if (!containerRef.value || !contentRect.value) return;
19102
- const height = contentRect.value.height - 56;
19103
- const scrollTop = containerRef.value.scrollTop;
19104
- const direction = scrollTop < lastScrollTop ? UP : DOWN;
19105
- const midPointIndex = calculateMidPointIndex(scrollTop + height / 2);
19106
- const buffer = Math.round(visibleItems.value / 3);
19107
- const firstIndex = midPointIndex - buffer;
19108
- const lastIndex = first.value + buffer * 2 - 1;
19109
- if (direction === UP && midPointIndex <= lastIndex) {
19110
- first.value = clamp(firstIndex, 0, items.value.length);
19111
- } else if (direction === DOWN && midPointIndex >= lastIndex) {
19112
- first.value = clamp(firstIndex, 0, items.value.length - visibleItems.value);
19113
- }
19114
- lastScrollTop = scrollTop;
19115
- }
19116
- function scrollToIndex(index) {
19117
- if (!containerRef.value) return;
19118
- const offset = calculateOffset(index);
19119
- containerRef.value.scrollTop = offset;
19120
- }
19121
- const allItems = vue.computed(() => items.value.map((item, index) => ({
19122
- raw: item,
19123
- index
19124
- })));
19125
- const last = vue.computed(() => Math.min(items.value.length, first.value + visibleItems.value));
19126
- const computedItems = vue.computed(() => allItems.value.slice(first.value, last.value));
19127
- const paddingTop = vue.computed(() => calculateOffset(first.value));
19128
- const paddingBottom = vue.computed(() => calculateOffset(items.value.length) - calculateOffset(last.value));
19129
- vue.onMounted(() => {
19130
- if (!itemHeight.value) {
19131
- // If itemHeight prop is not set, then calculate an estimated height from the average of inital items
19132
- itemHeight.value = sizes.slice(first.value, last.value).reduce((curr, height) => curr + height, 0) / visibleItems.value;
19133
- }
19134
- });
19135
- vue.watch(() => items.value.length, () => {
19136
- sizes = createRange(items.value.length).map(() => itemHeight.value);
19137
- sizeMap.forEach((height, item) => {
19138
- const index = items.value.indexOf(item);
19139
- if (index === -1) {
19140
- sizeMap.delete(item);
19141
- } else {
19142
- sizes[index] = height;
19143
- }
19144
- });
19145
- });
19146
- return {
19147
- containerRef,
19148
- computedItems,
19149
- itemHeight,
19150
- paddingTop,
19151
- paddingBottom,
19152
- scrollToIndex,
19153
- handleScroll,
19154
- handleItemResize
19155
- };
19156
- }
19157
-
19158
- // Types
19159
-
19160
- const makeVVirtualScrollProps = propsFactory({
19161
- items: {
19162
- type: Array,
19163
- default: () => []
19164
- },
19165
- ...makeVirtualProps(),
19166
- ...makeComponentProps(),
19167
- ...makeDimensionProps()
19168
- }, 'VVirtualScroll');
19169
- const VVirtualScroll = genericComponent()({
19170
- name: 'VVirtualScroll',
19171
- props: makeVVirtualScrollProps(),
19172
- setup(props, _ref) {
19173
- let {
19174
- slots
19175
- } = _ref;
19176
- const {
19177
- dimensionStyles
19178
- } = useDimension(props);
19179
- const {
19180
- containerRef,
19181
- handleScroll,
19182
- handleItemResize,
19183
- scrollToIndex,
19184
- paddingTop,
19185
- paddingBottom,
19186
- computedItems
19187
- } = useVirtual(props, vue.toRef(props, 'items'));
19188
- useRender(() => vue.createVNode("div", {
19189
- "ref": containerRef,
19190
- "class": ['v-virtual-scroll', props.class],
19191
- "onScroll": handleScroll,
19192
- "style": [dimensionStyles.value, props.style]
19193
- }, [vue.createVNode("div", {
19194
- "class": "v-virtual-scroll__container",
19195
- "style": {
19196
- paddingTop: convertToUnit(paddingTop.value),
19197
- paddingBottom: convertToUnit(paddingBottom.value)
19198
- }
19199
- }, [computedItems.value.map(item => vue.createVNode(VVirtualScrollItem, {
19200
- "key": item.index,
19201
- "dynamicHeight": !props.itemHeight,
19202
- "onUpdate:height": height => handleItemResize(item.index, height)
19203
- }, {
19204
- default: () => [slots.default?.({
19205
- item: item.raw,
19206
- index: item.index
19207
- })]
19208
- }))])]));
19209
- return {
19210
- scrollToIndex
19211
- };
19212
- }
19213
- });
19214
-
19215
19347
  var components = /*#__PURE__*/Object.freeze({
19216
19348
  __proto__: null,
19217
19349
  VAlert: VAlert,
@@ -20010,7 +20142,7 @@
20010
20142
  date
20011
20143
  };
20012
20144
  }
20013
- const version$1 = "3.3.5-master.2023-06-21";
20145
+ const version$1 = "3.3.5-pr-17265.042d482";
20014
20146
  createVuetify$1.version = version$1;
20015
20147
 
20016
20148
  // Vue's inject() can only be used in setup
@@ -20035,7 +20167,7 @@
20035
20167
  ...options
20036
20168
  });
20037
20169
  };
20038
- const version = "3.3.5-master.2023-06-21";
20170
+ const version = "3.3.5-pr-17265.042d482";
20039
20171
  createVuetify.version = version;
20040
20172
 
20041
20173
  exports.components = components;