@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.
- package/CHANGELOG.md +21 -2
- package/dist/json/attributes.json +4 -0
- package/dist/json/importMap.json +4 -4
- package/dist/json/tags.json +1 -0
- package/dist/json/web-types.json +16 -14
- package/dist/vuetify-labs.css +57 -57
- package/dist/vuetify-labs.d.ts +80 -20
- package/dist/vuetify-labs.esm.js +460 -326
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +459 -325
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +19 -19
- package/dist/vuetify.d.ts +37 -15
- package/dist/vuetify.esm.js +448 -316
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +447 -315
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +675 -656
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.mjs +48 -35
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VCombobox/VCombobox.mjs +48 -35
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VSelect/VSelect.mjs +43 -31
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/useScrolling.mjs +69 -0
- package/lib/components/VSelect/useScrolling.mjs.map +1 -0
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs +50 -24
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs.map +1 -1
- package/lib/components/VVirtualScroll/VVirtualScrollItem.mjs +13 -23
- package/lib/components/VVirtualScroll/VVirtualScrollItem.mjs.map +1 -1
- package/lib/components/VVirtualScroll/index.d.mts +37 -15
- package/lib/components/index.d.mts +36 -14
- package/lib/composables/filter.mjs +6 -4
- package/lib/composables/filter.mjs.map +1 -1
- package/lib/composables/resizeObserver.mjs +6 -1
- package/lib/composables/resizeObserver.mjs.map +1 -1
- package/lib/composables/virtual.mjs +17 -17
- package/lib/composables/virtual.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/entry-bundler.mjs.map +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/framework.mjs.map +1 -1
- package/lib/index.d.mts +1 -1
- package/lib/labs/VDataTable/VDataTableVirtual.mjs +12 -10
- package/lib/labs/VDataTable/VDataTableVirtual.mjs.map +1 -1
- package/lib/labs/VDataTable/index.d.mts +44 -6
- package/lib/labs/components.d.mts +44 -6
- package/lib/util/getScrollParent.mjs +7 -1
- package/lib/util/getScrollParent.mjs.map +1 -1
- package/package.json +1 -1
package/dist/vuetify-labs.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Vuetify v3.3.5-
|
|
2
|
+
* Vuetify v3.3.5-pr-17265.042d482
|
|
3
3
|
* Forged by John Leider
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { Fragment, reactive, computed, watchEffect, toRefs, capitalize, warn, watch, onScopeDispose, effectScope, ref, unref, provide, shallowRef, inject as inject$1, defineComponent as defineComponent$1, camelize, h, getCurrentInstance as getCurrentInstance$1, onBeforeUnmount, readonly, onDeactivated, onActivated, onMounted, toRaw, createVNode, TransitionGroup, Transition, mergeProps, onBeforeMount, nextTick, withDirectives, resolveDirective, vShow, isRef, toRef, Text, resolveDynamicComponent, Teleport, cloneVNode, createTextVNode, onBeforeUpdate, vModelText,
|
|
7
|
+
import { Fragment, reactive, computed, watchEffect, toRefs, capitalize, warn, watch, onScopeDispose, effectScope, ref, unref, provide, shallowRef, inject as inject$1, defineComponent as defineComponent$1, camelize, h, getCurrentInstance as getCurrentInstance$1, onBeforeUnmount, readonly, onDeactivated, onActivated, onMounted, toRaw, createVNode, TransitionGroup, Transition, mergeProps, onBeforeMount, nextTick, withDirectives, resolveDirective, vShow, isRef, toRef, Text, resolveDynamicComponent, Teleport, cloneVNode, createTextVNode, onBeforeUpdate, vModelText, withModifiers } from 'vue';
|
|
8
8
|
|
|
9
9
|
// Types
|
|
10
10
|
// eslint-disable-line vue/prefer-import-from-vue
|
|
@@ -1251,8 +1251,9 @@ getUid.reset = () => {
|
|
|
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 @@ function hasScrollbar(el) {
|
|
|
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 @@ function useRender(render) {
|
|
|
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 = ref();
|
|
1320
1327
|
const contentRect = 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
|
-
|
|
1332
|
+
if (box === 'content') {
|
|
1333
|
+
contentRect.value = entries[0].contentRect;
|
|
1334
|
+
} else {
|
|
1335
|
+
contentRect.value = entries[0].target.getBoundingClientRect();
|
|
1336
|
+
}
|
|
1326
1337
|
});
|
|
1327
1338
|
onBeforeUnmount(() => {
|
|
1328
1339
|
observer.disconnect();
|
|
@@ -10379,6 +10390,301 @@ const VTextField = genericComponent()({
|
|
|
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
|
+
watch(() => contentRect.value?.height, height => {
|
|
10415
|
+
if (height != null) emit('update:height', height);
|
|
10416
|
+
});
|
|
10417
|
+
useRender(() => props.renderless ? createVNode(Fragment, null, [slots.default?.({
|
|
10418
|
+
itemRef: resizeRef
|
|
10419
|
+
})]) : createVNode("div", 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 = shallowRef(0);
|
|
10441
|
+
const baseItemHeight = shallowRef(props.itemHeight);
|
|
10442
|
+
const itemHeight = computed({
|
|
10443
|
+
get: () => parseInt(baseItemHeight.value ?? 0, 10),
|
|
10444
|
+
set(val) {
|
|
10445
|
+
baseItemHeight.value = val;
|
|
10446
|
+
}
|
|
10447
|
+
});
|
|
10448
|
+
const containerRef = ref();
|
|
10449
|
+
const {
|
|
10450
|
+
resizeRef,
|
|
10451
|
+
contentRect
|
|
10452
|
+
} = useResizeObserver();
|
|
10453
|
+
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 = 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 = computed(() => Math.min(items.value.length, first.value + visibleItems.value));
|
|
10505
|
+
const computedItems = 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 = computed(() => calculateOffset(first.value));
|
|
10512
|
+
const paddingBottom = computed(() => calculateOffset(items.value.length) - calculateOffset(last.value));
|
|
10513
|
+
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, toRef(props, 'items'));
|
|
10568
|
+
useToggleScope(() => props.renderless, () => {
|
|
10569
|
+
onMounted(() => {
|
|
10570
|
+
containerRef.value = getScrollParent(vm.vnode.el, true);
|
|
10571
|
+
containerRef.value?.addEventListener('scroll', handleScroll);
|
|
10572
|
+
});
|
|
10573
|
+
onScopeDispose(() => {
|
|
10574
|
+
containerRef.value?.removeEventListener('scroll', handleScroll);
|
|
10575
|
+
});
|
|
10576
|
+
});
|
|
10577
|
+
useRender(() => {
|
|
10578
|
+
const children = computedItems.value.map(item => 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 ? createVNode(Fragment, null, [createVNode("div", {
|
|
10590
|
+
"class": "v-virtual-scroll__spacer",
|
|
10591
|
+
"style": {
|
|
10592
|
+
paddingTop: convertToUnit(paddingTop.value)
|
|
10593
|
+
}
|
|
10594
|
+
}, null), children, createVNode("div", {
|
|
10595
|
+
"class": "v-virtual-scroll__spacer",
|
|
10596
|
+
"style": {
|
|
10597
|
+
paddingBottom: convertToUnit(paddingBottom.value)
|
|
10598
|
+
}
|
|
10599
|
+
}, null)]) : createVNode("div", {
|
|
10600
|
+
"ref": containerRef,
|
|
10601
|
+
"class": ['v-virtual-scroll', props.class],
|
|
10602
|
+
"onScroll": handleScroll,
|
|
10603
|
+
"style": [dimensionStyles.value, props.style]
|
|
10604
|
+
}, [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 = 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 = 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 @@ const VSelect = genericComponent()({
|
|
|
10470
10776
|
});
|
|
10471
10777
|
const menuDisabled = computed(() => props.hideNoData && !items.value.length || props.readonly || form?.isReadonly.value);
|
|
10472
10778
|
const listRef = 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 @@ const VSelect = genericComponent()({
|
|
|
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 @@ const VSelect = genericComponent()({
|
|
|
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']?.() ?? createVNode(VListItem, {
|
|
10609
10915
|
"title": t(props.noDataText)
|
|
10610
|
-
}, null)),
|
|
10611
|
-
|
|
10612
|
-
|
|
10613
|
-
|
|
10614
|
-
|
|
10615
|
-
|
|
10616
|
-
|
|
10617
|
-
|
|
10618
|
-
|
|
10619
|
-
|
|
10620
|
-
|
|
10621
|
-
|
|
10622
|
-
|
|
10623
|
-
|
|
10624
|
-
|
|
10625
|
-
|
|
10626
|
-
|
|
10627
|
-
|
|
10628
|
-
|
|
10629
|
-
|
|
10630
|
-
|
|
10631
|
-
|
|
10632
|
-
|
|
10633
|
-
|
|
10916
|
+
}, null)), 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 = 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
|
+
}) ?? createVNode(VListItem, itemProps, {
|
|
10936
|
+
prepend: _ref3 => {
|
|
10937
|
+
let {
|
|
10938
|
+
isSelected
|
|
10939
|
+
} = _ref3;
|
|
10940
|
+
return createVNode(Fragment, null, [props.multiple && !props.hideSelected ? createVNode(VCheckboxBtn, {
|
|
10941
|
+
"key": item.value,
|
|
10942
|
+
"modelValue": isSelected,
|
|
10943
|
+
"ripple": false,
|
|
10944
|
+
"tabindex": "-1"
|
|
10945
|
+
}, null) : undefined, item.props.prependIcon && 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 @@ function useFilter(props, items, query, options) {
|
|
|
10773
11090
|
const filteredMatches = ref(new Map());
|
|
10774
11091
|
const transformedItems = computed(() => options?.transform ? unref(items).map(options?.transform) : unref(items));
|
|
10775
11092
|
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 @@ function useFilter(props, items, query, options) {
|
|
|
10783
11098
|
noFilter: props.noFilter
|
|
10784
11099
|
});
|
|
10785
11100
|
const originalItems = 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
|
-
|
|
10793
|
-
|
|
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 @@ const VAutocomplete = genericComponent()({
|
|
|
10881
11200
|
const {
|
|
10882
11201
|
filteredItems,
|
|
10883
11202
|
getMatches
|
|
10884
|
-
} = useFilter(props, items,
|
|
11203
|
+
} = useFilter(props, items, search);
|
|
10885
11204
|
const selections = 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 @@ const VAutocomplete = genericComponent()({
|
|
|
10901
11220
|
});
|
|
10902
11221
|
const menuDisabled = computed(() => props.hideNoData && !items.value.length || props.readonly || form?.isReadonly.value);
|
|
10903
11222
|
const listRef = 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 @@ const VAutocomplete = genericComponent()({
|
|
|
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 @@ const VAutocomplete = genericComponent()({
|
|
|
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']?.() ?? createVNode(VListItem, {
|
|
11103
11422
|
"title": t(props.noDataText)
|
|
11104
|
-
}, null)),
|
|
11105
|
-
|
|
11106
|
-
|
|
11107
|
-
|
|
11108
|
-
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
|
|
11114
|
-
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
|
|
11122
|
-
|
|
11123
|
-
|
|
11124
|
-
|
|
11125
|
-
|
|
11126
|
-
|
|
11127
|
-
|
|
11128
|
-
|
|
11129
|
-
|
|
11130
|
-
|
|
11131
|
-
|
|
11423
|
+
}, null)), 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 = 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
|
+
}) ?? createVNode(VListItem, itemProps, {
|
|
11444
|
+
prepend: _ref4 => {
|
|
11445
|
+
let {
|
|
11446
|
+
isSelected
|
|
11447
|
+
} = _ref4;
|
|
11448
|
+
return createVNode(Fragment, null, [props.multiple && !props.hideSelected ? createVNode(VCheckboxBtn, {
|
|
11449
|
+
"key": item.value,
|
|
11450
|
+
"modelValue": isSelected,
|
|
11451
|
+
"ripple": false,
|
|
11452
|
+
"tabindex": "-1"
|
|
11453
|
+
}, null) : undefined, item.props.prependIcon && 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 @@ const VCombobox = genericComponent()({
|
|
|
14418
14748
|
const {
|
|
14419
14749
|
filteredItems,
|
|
14420
14750
|
getMatches
|
|
14421
|
-
} = useFilter(props, items,
|
|
14751
|
+
} = useFilter(props, items, search);
|
|
14422
14752
|
const selections = 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 @@ const VCombobox = genericComponent()({
|
|
|
14438
14768
|
});
|
|
14439
14769
|
const menuDisabled = computed(() => props.hideNoData && !items.value.length || props.readonly || form?.isReadonly.value);
|
|
14440
14770
|
const listRef = 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 @@ const VCombobox = genericComponent()({
|
|
|
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 @@ const VCombobox = genericComponent()({
|
|
|
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']?.() ?? createVNode(VListItem, {
|
|
14636
14966
|
"title": t(props.noDataText)
|
|
14637
|
-
}, null)),
|
|
14638
|
-
|
|
14639
|
-
|
|
14640
|
-
|
|
14641
|
-
|
|
14642
|
-
|
|
14643
|
-
|
|
14644
|
-
|
|
14645
|
-
|
|
14646
|
-
|
|
14647
|
-
|
|
14648
|
-
|
|
14649
|
-
|
|
14650
|
-
|
|
14651
|
-
|
|
14652
|
-
|
|
14653
|
-
|
|
14654
|
-
|
|
14655
|
-
|
|
14656
|
-
|
|
14657
|
-
|
|
14658
|
-
|
|
14659
|
-
|
|
14660
|
-
|
|
14661
|
-
|
|
14662
|
-
|
|
14663
|
-
|
|
14664
|
-
|
|
14967
|
+
}, null)), 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 = 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
|
+
}) ?? createVNode(VListItem, itemProps, {
|
|
14988
|
+
prepend: _ref4 => {
|
|
14989
|
+
let {
|
|
14990
|
+
isSelected
|
|
14991
|
+
} = _ref4;
|
|
14992
|
+
return createVNode(Fragment, null, [props.multiple && !props.hideSelected ? createVNode(VCheckboxBtn, {
|
|
14993
|
+
"key": item.value,
|
|
14994
|
+
"modelValue": isSelected,
|
|
14995
|
+
"ripple": false,
|
|
14996
|
+
"tabindex": "-1"
|
|
14997
|
+
}, null) : undefined, item.props.prependIcon && 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 @@ const VValidation = genericComponent()({
|
|
|
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
|
-
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
|
-
onUpdated(updateHeight);
|
|
19037
|
-
useRender(() => props.renderless ? createVNode(Fragment, null, [slots.default?.({
|
|
19038
|
-
props: {
|
|
19039
|
-
ref: props.dynamicHeight ? resizeRef : undefined
|
|
19040
|
-
}
|
|
19041
|
-
})]) : 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 = shallowRef(0);
|
|
19060
|
-
const baseItemHeight = shallowRef(props.itemHeight);
|
|
19061
|
-
const itemHeight = computed({
|
|
19062
|
-
get: () => parseInt(baseItemHeight.value ?? 0, 10),
|
|
19063
|
-
set(val) {
|
|
19064
|
-
baseItemHeight.value = val;
|
|
19065
|
-
}
|
|
19066
|
-
});
|
|
19067
|
-
const containerRef = ref();
|
|
19068
|
-
const {
|
|
19069
|
-
resizeRef,
|
|
19070
|
-
contentRect
|
|
19071
|
-
} = useResizeObserver();
|
|
19072
|
-
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 = 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 = computed(() => items.value.map((item, index) => ({
|
|
19122
|
-
raw: item,
|
|
19123
|
-
index
|
|
19124
|
-
})));
|
|
19125
|
-
const last = computed(() => Math.min(items.value.length, first.value + visibleItems.value));
|
|
19126
|
-
const computedItems = computed(() => allItems.value.slice(first.value, last.value));
|
|
19127
|
-
const paddingTop = computed(() => calculateOffset(first.value));
|
|
19128
|
-
const paddingBottom = computed(() => calculateOffset(items.value.length) - calculateOffset(last.value));
|
|
19129
|
-
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
|
-
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, toRef(props, 'items'));
|
|
19188
|
-
useRender(() => createVNode("div", {
|
|
19189
|
-
"ref": containerRef,
|
|
19190
|
-
"class": ['v-virtual-scroll', props.class],
|
|
19191
|
-
"onScroll": handleScroll,
|
|
19192
|
-
"style": [dimensionStyles.value, props.style]
|
|
19193
|
-
}, [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 => 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
|
// Types
|
|
19216
19348
|
|
|
19217
19349
|
const makeVBottomSheetProps = propsFactory({
|
|
@@ -21192,19 +21324,21 @@ const VDataTableVirtual = genericComponent()({
|
|
|
21192
21324
|
...slots,
|
|
21193
21325
|
item: itemSlotProps => createVNode(VVirtualScrollItem, {
|
|
21194
21326
|
"key": itemSlotProps.item.index,
|
|
21195
|
-
"dynamicHeight": true,
|
|
21196
21327
|
"renderless": true,
|
|
21197
21328
|
"onUpdate:height": height => handleItemResize(itemSlotProps.item.index, height)
|
|
21198
21329
|
}, {
|
|
21199
|
-
default:
|
|
21200
|
-
|
|
21201
|
-
|
|
21202
|
-
|
|
21203
|
-
|
|
21204
|
-
|
|
21205
|
-
|
|
21206
|
-
|
|
21207
|
-
|
|
21330
|
+
default: _ref2 => {
|
|
21331
|
+
let {
|
|
21332
|
+
itemRef
|
|
21333
|
+
} = _ref2;
|
|
21334
|
+
return slots.item?.({
|
|
21335
|
+
...itemSlotProps,
|
|
21336
|
+
itemRef
|
|
21337
|
+
}) ?? createVNode(VDataTableRow, mergeProps(itemSlotProps.props, {
|
|
21338
|
+
"ref": itemRef,
|
|
21339
|
+
"key": itemSlotProps.item.index
|
|
21340
|
+
}), slots);
|
|
21341
|
+
}
|
|
21208
21342
|
})
|
|
21209
21343
|
}), createVNode("tr", {
|
|
21210
21344
|
"style": {
|
|
@@ -23419,7 +23553,7 @@ function createVuetify$1() {
|
|
|
23419
23553
|
date
|
|
23420
23554
|
};
|
|
23421
23555
|
}
|
|
23422
|
-
const version$1 = "3.3.5-
|
|
23556
|
+
const version$1 = "3.3.5-pr-17265.042d482";
|
|
23423
23557
|
createVuetify$1.version = version$1;
|
|
23424
23558
|
|
|
23425
23559
|
// Vue's inject() can only be used in setup
|
|
@@ -23433,7 +23567,7 @@ function inject(key) {
|
|
|
23433
23567
|
|
|
23434
23568
|
/* eslint-disable local-rules/sort-imports */
|
|
23435
23569
|
|
|
23436
|
-
const version = "3.3.5-
|
|
23570
|
+
const version = "3.3.5-pr-17265.042d482";
|
|
23437
23571
|
|
|
23438
23572
|
/* eslint-disable local-rules/sort-imports */
|
|
23439
23573
|
|