@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.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
|
*/
|
|
@@ -1255,8 +1255,9 @@
|
|
|
1255
1255
|
};
|
|
1256
1256
|
|
|
1257
1257
|
function getScrollParent(el) {
|
|
1258
|
+
let includeHidden = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1258
1259
|
while (el) {
|
|
1259
|
-
if (hasScrollbar(el)) return el;
|
|
1260
|
+
if (includeHidden ? isPotentiallyScrollable(el) : hasScrollbar(el)) return el;
|
|
1260
1261
|
el = el.parentElement;
|
|
1261
1262
|
}
|
|
1262
1263
|
return document.scrollingElement;
|
|
@@ -1276,6 +1277,11 @@
|
|
|
1276
1277
|
const style = window.getComputedStyle(el);
|
|
1277
1278
|
return style.overflowY === 'scroll' || style.overflowY === 'auto' && el.scrollHeight > el.clientHeight;
|
|
1278
1279
|
}
|
|
1280
|
+
function isPotentiallyScrollable(el) {
|
|
1281
|
+
if (!el || el.nodeType !== Node.ELEMENT_NODE) return false;
|
|
1282
|
+
const style = window.getComputedStyle(el);
|
|
1283
|
+
return ['scroll', 'auto'].includes(style.overflowY);
|
|
1284
|
+
}
|
|
1279
1285
|
|
|
1280
1286
|
const IN_BROWSER = typeof window !== 'undefined';
|
|
1281
1287
|
const SUPPORTS_INTERSECTION = IN_BROWSER && 'IntersectionObserver' in window;
|
|
@@ -1320,13 +1326,18 @@
|
|
|
1320
1326
|
// Types
|
|
1321
1327
|
|
|
1322
1328
|
function useResizeObserver(callback) {
|
|
1329
|
+
let box = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'content';
|
|
1323
1330
|
const resizeRef = vue.ref();
|
|
1324
1331
|
const contentRect = vue.ref();
|
|
1325
1332
|
if (IN_BROWSER) {
|
|
1326
1333
|
const observer = new ResizeObserver(entries => {
|
|
1327
1334
|
callback?.(entries, observer);
|
|
1328
1335
|
if (!entries.length) return;
|
|
1329
|
-
|
|
1336
|
+
if (box === 'content') {
|
|
1337
|
+
contentRect.value = entries[0].contentRect;
|
|
1338
|
+
} else {
|
|
1339
|
+
contentRect.value = entries[0].target.getBoundingClientRect();
|
|
1340
|
+
}
|
|
1330
1341
|
});
|
|
1331
1342
|
vue.onBeforeUnmount(() => {
|
|
1332
1343
|
observer.disconnect();
|
|
@@ -10383,6 +10394,301 @@
|
|
|
10383
10394
|
|
|
10384
10395
|
// Types
|
|
10385
10396
|
|
|
10397
|
+
const makeVVirtualScrollItemProps = propsFactory({
|
|
10398
|
+
renderless: Boolean,
|
|
10399
|
+
...makeComponentProps()
|
|
10400
|
+
}, 'VVirtualScrollItem');
|
|
10401
|
+
const VVirtualScrollItem = genericComponent()({
|
|
10402
|
+
name: 'VVirtualScrollItem',
|
|
10403
|
+
inheritAttrs: false,
|
|
10404
|
+
props: makeVVirtualScrollItemProps(),
|
|
10405
|
+
emits: {
|
|
10406
|
+
'update:height': height => true
|
|
10407
|
+
},
|
|
10408
|
+
setup(props, _ref) {
|
|
10409
|
+
let {
|
|
10410
|
+
attrs,
|
|
10411
|
+
emit,
|
|
10412
|
+
slots
|
|
10413
|
+
} = _ref;
|
|
10414
|
+
const {
|
|
10415
|
+
resizeRef,
|
|
10416
|
+
contentRect
|
|
10417
|
+
} = useResizeObserver(undefined, 'border');
|
|
10418
|
+
vue.watch(() => contentRect.value?.height, height => {
|
|
10419
|
+
if (height != null) emit('update:height', height);
|
|
10420
|
+
});
|
|
10421
|
+
useRender(() => props.renderless ? vue.createVNode(vue.Fragment, null, [slots.default?.({
|
|
10422
|
+
itemRef: resizeRef
|
|
10423
|
+
})]) : vue.createVNode("div", vue.mergeProps({
|
|
10424
|
+
"ref": resizeRef,
|
|
10425
|
+
"class": ['v-virtual-scroll__item', props.class],
|
|
10426
|
+
"style": props.style
|
|
10427
|
+
}, attrs), [slots.default?.()]));
|
|
10428
|
+
}
|
|
10429
|
+
});
|
|
10430
|
+
|
|
10431
|
+
// Composables
|
|
10432
|
+
|
|
10433
|
+
// Types
|
|
10434
|
+
|
|
10435
|
+
const UP = -1;
|
|
10436
|
+
const DOWN = 1;
|
|
10437
|
+
const makeVirtualProps = propsFactory({
|
|
10438
|
+
itemHeight: {
|
|
10439
|
+
type: [Number, String],
|
|
10440
|
+
default: 48
|
|
10441
|
+
}
|
|
10442
|
+
}, 'virtual');
|
|
10443
|
+
function useVirtual(props, items, offset) {
|
|
10444
|
+
const first = vue.shallowRef(0);
|
|
10445
|
+
const baseItemHeight = vue.shallowRef(props.itemHeight);
|
|
10446
|
+
const itemHeight = vue.computed({
|
|
10447
|
+
get: () => parseInt(baseItemHeight.value ?? 0, 10),
|
|
10448
|
+
set(val) {
|
|
10449
|
+
baseItemHeight.value = val;
|
|
10450
|
+
}
|
|
10451
|
+
});
|
|
10452
|
+
const containerRef = vue.ref();
|
|
10453
|
+
const {
|
|
10454
|
+
resizeRef,
|
|
10455
|
+
contentRect
|
|
10456
|
+
} = useResizeObserver();
|
|
10457
|
+
vue.watchEffect(() => {
|
|
10458
|
+
resizeRef.value = containerRef.value;
|
|
10459
|
+
});
|
|
10460
|
+
const display = useDisplay();
|
|
10461
|
+
const sizeMap = new Map();
|
|
10462
|
+
let sizes = Array.from({
|
|
10463
|
+
length: items.value.length
|
|
10464
|
+
});
|
|
10465
|
+
const visibleItems = vue.computed(() => {
|
|
10466
|
+
const height = (!contentRect.value || containerRef.value === document.documentElement ? display.height.value : contentRect.value.height) - (offset?.value ?? 0);
|
|
10467
|
+
return Math.ceil(height / itemHeight.value * 1.7 + 1);
|
|
10468
|
+
});
|
|
10469
|
+
function handleItemResize(index, height) {
|
|
10470
|
+
itemHeight.value = Math.max(itemHeight.value, height);
|
|
10471
|
+
sizes[index] = height;
|
|
10472
|
+
sizeMap.set(items.value[index], height);
|
|
10473
|
+
}
|
|
10474
|
+
function calculateOffset(index) {
|
|
10475
|
+
return sizes.slice(0, index).reduce((acc, val) => acc + (val || itemHeight.value), 0);
|
|
10476
|
+
}
|
|
10477
|
+
function calculateMidPointIndex(scrollTop) {
|
|
10478
|
+
const end = items.value.length;
|
|
10479
|
+
let middle = 0;
|
|
10480
|
+
let middleOffset = 0;
|
|
10481
|
+
while (middleOffset < scrollTop && middle < end) {
|
|
10482
|
+
middleOffset += sizes[middle++] || itemHeight.value;
|
|
10483
|
+
}
|
|
10484
|
+
return middle - 1;
|
|
10485
|
+
}
|
|
10486
|
+
let lastScrollTop = 0;
|
|
10487
|
+
function handleScroll() {
|
|
10488
|
+
if (!containerRef.value || !contentRect.value) return;
|
|
10489
|
+
const height = contentRect.value.height - 56;
|
|
10490
|
+
const scrollTop = containerRef.value.scrollTop;
|
|
10491
|
+
const direction = scrollTop < lastScrollTop ? UP : DOWN;
|
|
10492
|
+
const midPointIndex = calculateMidPointIndex(scrollTop + height / 2);
|
|
10493
|
+
const buffer = Math.round(visibleItems.value / 3);
|
|
10494
|
+
const firstIndex = midPointIndex - buffer;
|
|
10495
|
+
const lastIndex = first.value + buffer * 2 - 1;
|
|
10496
|
+
if (direction === UP && midPointIndex <= lastIndex) {
|
|
10497
|
+
first.value = clamp(firstIndex, 0, items.value.length);
|
|
10498
|
+
} else if (direction === DOWN && midPointIndex >= lastIndex) {
|
|
10499
|
+
first.value = clamp(firstIndex, 0, items.value.length - visibleItems.value);
|
|
10500
|
+
}
|
|
10501
|
+
lastScrollTop = scrollTop;
|
|
10502
|
+
}
|
|
10503
|
+
function scrollToIndex(index) {
|
|
10504
|
+
if (!containerRef.value) return;
|
|
10505
|
+
const offset = calculateOffset(index);
|
|
10506
|
+
containerRef.value.scrollTop = offset;
|
|
10507
|
+
}
|
|
10508
|
+
const last = vue.computed(() => Math.min(items.value.length, first.value + visibleItems.value));
|
|
10509
|
+
const computedItems = vue.computed(() => {
|
|
10510
|
+
return items.value.slice(first.value, last.value).map((item, index) => ({
|
|
10511
|
+
raw: item,
|
|
10512
|
+
index: index + first.value
|
|
10513
|
+
}));
|
|
10514
|
+
});
|
|
10515
|
+
const paddingTop = vue.computed(() => calculateOffset(first.value));
|
|
10516
|
+
const paddingBottom = vue.computed(() => calculateOffset(items.value.length) - calculateOffset(last.value));
|
|
10517
|
+
vue.watch(() => items.value.length, () => {
|
|
10518
|
+
sizes = createRange(items.value.length).map(() => itemHeight.value);
|
|
10519
|
+
sizeMap.forEach((height, item) => {
|
|
10520
|
+
const index = items.value.indexOf(item);
|
|
10521
|
+
if (index === -1) {
|
|
10522
|
+
sizeMap.delete(item);
|
|
10523
|
+
} else {
|
|
10524
|
+
sizes[index] = height;
|
|
10525
|
+
}
|
|
10526
|
+
});
|
|
10527
|
+
});
|
|
10528
|
+
return {
|
|
10529
|
+
containerRef,
|
|
10530
|
+
computedItems,
|
|
10531
|
+
itemHeight,
|
|
10532
|
+
paddingTop,
|
|
10533
|
+
paddingBottom,
|
|
10534
|
+
scrollToIndex,
|
|
10535
|
+
handleScroll,
|
|
10536
|
+
handleItemResize
|
|
10537
|
+
};
|
|
10538
|
+
}
|
|
10539
|
+
|
|
10540
|
+
// Types
|
|
10541
|
+
|
|
10542
|
+
const makeVVirtualScrollProps = propsFactory({
|
|
10543
|
+
items: {
|
|
10544
|
+
type: Array,
|
|
10545
|
+
default: () => []
|
|
10546
|
+
},
|
|
10547
|
+
renderless: Boolean,
|
|
10548
|
+
...makeVirtualProps(),
|
|
10549
|
+
...makeComponentProps(),
|
|
10550
|
+
...makeDimensionProps()
|
|
10551
|
+
}, 'VVirtualScroll');
|
|
10552
|
+
const VVirtualScroll = genericComponent()({
|
|
10553
|
+
name: 'VVirtualScroll',
|
|
10554
|
+
props: makeVVirtualScrollProps(),
|
|
10555
|
+
setup(props, _ref) {
|
|
10556
|
+
let {
|
|
10557
|
+
slots
|
|
10558
|
+
} = _ref;
|
|
10559
|
+
const vm = getCurrentInstance('VVirtualScroll');
|
|
10560
|
+
const {
|
|
10561
|
+
dimensionStyles
|
|
10562
|
+
} = useDimension(props);
|
|
10563
|
+
const {
|
|
10564
|
+
containerRef,
|
|
10565
|
+
handleScroll,
|
|
10566
|
+
handleItemResize,
|
|
10567
|
+
scrollToIndex,
|
|
10568
|
+
paddingTop,
|
|
10569
|
+
paddingBottom,
|
|
10570
|
+
computedItems
|
|
10571
|
+
} = useVirtual(props, vue.toRef(props, 'items'));
|
|
10572
|
+
useToggleScope(() => props.renderless, () => {
|
|
10573
|
+
vue.onMounted(() => {
|
|
10574
|
+
containerRef.value = getScrollParent(vm.vnode.el, true);
|
|
10575
|
+
containerRef.value?.addEventListener('scroll', handleScroll);
|
|
10576
|
+
});
|
|
10577
|
+
vue.onScopeDispose(() => {
|
|
10578
|
+
containerRef.value?.removeEventListener('scroll', handleScroll);
|
|
10579
|
+
});
|
|
10580
|
+
});
|
|
10581
|
+
useRender(() => {
|
|
10582
|
+
const children = computedItems.value.map(item => vue.createVNode(VVirtualScrollItem, {
|
|
10583
|
+
"key": item.index,
|
|
10584
|
+
"renderless": props.renderless,
|
|
10585
|
+
"onUpdate:height": height => handleItemResize(item.index, height)
|
|
10586
|
+
}, {
|
|
10587
|
+
default: slotProps => slots.default?.({
|
|
10588
|
+
item: item.raw,
|
|
10589
|
+
index: item.index,
|
|
10590
|
+
...slotProps
|
|
10591
|
+
})
|
|
10592
|
+
}));
|
|
10593
|
+
return props.renderless ? vue.createVNode(vue.Fragment, null, [vue.createVNode("div", {
|
|
10594
|
+
"class": "v-virtual-scroll__spacer",
|
|
10595
|
+
"style": {
|
|
10596
|
+
paddingTop: convertToUnit(paddingTop.value)
|
|
10597
|
+
}
|
|
10598
|
+
}, null), children, vue.createVNode("div", {
|
|
10599
|
+
"class": "v-virtual-scroll__spacer",
|
|
10600
|
+
"style": {
|
|
10601
|
+
paddingBottom: convertToUnit(paddingBottom.value)
|
|
10602
|
+
}
|
|
10603
|
+
}, null)]) : vue.createVNode("div", {
|
|
10604
|
+
"ref": containerRef,
|
|
10605
|
+
"class": ['v-virtual-scroll', props.class],
|
|
10606
|
+
"onScroll": handleScroll,
|
|
10607
|
+
"style": [dimensionStyles.value, props.style]
|
|
10608
|
+
}, [vue.createVNode("div", {
|
|
10609
|
+
"class": "v-virtual-scroll__container",
|
|
10610
|
+
"style": {
|
|
10611
|
+
paddingTop: convertToUnit(paddingTop.value),
|
|
10612
|
+
paddingBottom: convertToUnit(paddingBottom.value)
|
|
10613
|
+
}
|
|
10614
|
+
}, [children])]);
|
|
10615
|
+
});
|
|
10616
|
+
return {
|
|
10617
|
+
scrollToIndex
|
|
10618
|
+
};
|
|
10619
|
+
}
|
|
10620
|
+
});
|
|
10621
|
+
|
|
10622
|
+
// Utilities
|
|
10623
|
+
|
|
10624
|
+
// Types
|
|
10625
|
+
|
|
10626
|
+
function useScrolling(listRef, textFieldRef) {
|
|
10627
|
+
const isScrolling = vue.shallowRef(false);
|
|
10628
|
+
let scrollTimeout;
|
|
10629
|
+
function onListScroll(e) {
|
|
10630
|
+
cancelAnimationFrame(scrollTimeout);
|
|
10631
|
+
isScrolling.value = true;
|
|
10632
|
+
scrollTimeout = requestAnimationFrame(() => {
|
|
10633
|
+
scrollTimeout = requestAnimationFrame(() => {
|
|
10634
|
+
isScrolling.value = false;
|
|
10635
|
+
});
|
|
10636
|
+
});
|
|
10637
|
+
}
|
|
10638
|
+
async function finishScrolling() {
|
|
10639
|
+
await new Promise(resolve => requestAnimationFrame(resolve));
|
|
10640
|
+
await new Promise(resolve => requestAnimationFrame(resolve));
|
|
10641
|
+
await new Promise(resolve => requestAnimationFrame(resolve));
|
|
10642
|
+
await new Promise(resolve => {
|
|
10643
|
+
if (isScrolling.value) {
|
|
10644
|
+
const stop = vue.watch(isScrolling, () => {
|
|
10645
|
+
stop();
|
|
10646
|
+
resolve();
|
|
10647
|
+
});
|
|
10648
|
+
} else resolve();
|
|
10649
|
+
});
|
|
10650
|
+
}
|
|
10651
|
+
async function onListKeydown(e) {
|
|
10652
|
+
if (e.key === 'Tab') {
|
|
10653
|
+
textFieldRef.value?.focus();
|
|
10654
|
+
}
|
|
10655
|
+
if (!['PageDown', 'PageUp', 'Home', 'End'].includes(e.key)) return;
|
|
10656
|
+
const el = listRef.value?.$el;
|
|
10657
|
+
if (!el) return;
|
|
10658
|
+
if (e.key === 'Home' || e.key === 'End') {
|
|
10659
|
+
el.scrollTo({
|
|
10660
|
+
top: e.key === 'Home' ? 0 : el.scrollHeight,
|
|
10661
|
+
behavior: 'smooth'
|
|
10662
|
+
});
|
|
10663
|
+
}
|
|
10664
|
+
await finishScrolling();
|
|
10665
|
+
const children = el.querySelectorAll(':scope > :not(.v-virtual-scroll__spacer)');
|
|
10666
|
+
if (e.key === 'PageDown' || e.key === 'Home') {
|
|
10667
|
+
const top = el.getBoundingClientRect().top;
|
|
10668
|
+
for (const child of children) {
|
|
10669
|
+
if (child.getBoundingClientRect().top >= top) {
|
|
10670
|
+
child.focus();
|
|
10671
|
+
break;
|
|
10672
|
+
}
|
|
10673
|
+
}
|
|
10674
|
+
} else {
|
|
10675
|
+
const bottom = el.getBoundingClientRect().bottom;
|
|
10676
|
+
for (const child of [...children].reverse()) {
|
|
10677
|
+
if (child.getBoundingClientRect().bottom <= bottom) {
|
|
10678
|
+
child.focus();
|
|
10679
|
+
break;
|
|
10680
|
+
}
|
|
10681
|
+
}
|
|
10682
|
+
}
|
|
10683
|
+
}
|
|
10684
|
+
return {
|
|
10685
|
+
onListScroll,
|
|
10686
|
+
onListKeydown
|
|
10687
|
+
};
|
|
10688
|
+
}
|
|
10689
|
+
|
|
10690
|
+
// Types
|
|
10691
|
+
|
|
10386
10692
|
const makeSelectProps = propsFactory({
|
|
10387
10693
|
chips: Boolean,
|
|
10388
10694
|
closableChips: Boolean,
|
|
@@ -10474,6 +10780,10 @@
|
|
|
10474
10780
|
});
|
|
10475
10781
|
const menuDisabled = vue.computed(() => props.hideNoData && !items.value.length || props.readonly || form?.isReadonly.value);
|
|
10476
10782
|
const listRef = vue.ref();
|
|
10783
|
+
const {
|
|
10784
|
+
onListScroll,
|
|
10785
|
+
onListKeydown
|
|
10786
|
+
} = useScrolling(listRef, vTextFieldRef);
|
|
10477
10787
|
function onClear(e) {
|
|
10478
10788
|
if (props.openOnClear) {
|
|
10479
10789
|
menu.value = true;
|
|
@@ -10520,11 +10830,6 @@
|
|
|
10520
10830
|
model.value = [item];
|
|
10521
10831
|
}
|
|
10522
10832
|
}
|
|
10523
|
-
function onListKeydown(e) {
|
|
10524
|
-
if (e.key === 'Tab') {
|
|
10525
|
-
vTextFieldRef.value?.focus();
|
|
10526
|
-
}
|
|
10527
|
-
}
|
|
10528
10833
|
function select(item) {
|
|
10529
10834
|
if (props.multiple) {
|
|
10530
10835
|
const index = selected.value.findIndex(selection => props.valueComparator(selection, item.value));
|
|
@@ -10607,34 +10912,46 @@
|
|
|
10607
10912
|
"onMousedown": e => e.preventDefault(),
|
|
10608
10913
|
"onKeydown": onListKeydown,
|
|
10609
10914
|
"onFocusin": onFocusin,
|
|
10915
|
+
"onScrollPassive": onListScroll,
|
|
10610
10916
|
"tabindex": "-1"
|
|
10611
10917
|
}, {
|
|
10612
10918
|
default: () => [slots['prepend-item']?.(), !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? vue.createVNode(VListItem, {
|
|
10613
10919
|
"title": t(props.noDataText)
|
|
10614
|
-
}, null)),
|
|
10615
|
-
|
|
10616
|
-
|
|
10617
|
-
|
|
10618
|
-
|
|
10619
|
-
|
|
10620
|
-
|
|
10621
|
-
|
|
10622
|
-
|
|
10623
|
-
|
|
10624
|
-
|
|
10625
|
-
|
|
10626
|
-
|
|
10627
|
-
|
|
10628
|
-
|
|
10629
|
-
|
|
10630
|
-
|
|
10631
|
-
|
|
10632
|
-
|
|
10633
|
-
|
|
10634
|
-
|
|
10635
|
-
|
|
10636
|
-
|
|
10637
|
-
|
|
10920
|
+
}, null)), vue.createVNode(VVirtualScroll, {
|
|
10921
|
+
"renderless": true,
|
|
10922
|
+
"items": displayItems.value
|
|
10923
|
+
}, {
|
|
10924
|
+
default: _ref2 => {
|
|
10925
|
+
let {
|
|
10926
|
+
item,
|
|
10927
|
+
index,
|
|
10928
|
+
itemRef
|
|
10929
|
+
} = _ref2;
|
|
10930
|
+
const itemProps = vue.mergeProps(item.props, {
|
|
10931
|
+
ref: itemRef,
|
|
10932
|
+
key: index,
|
|
10933
|
+
onClick: () => select(item)
|
|
10934
|
+
});
|
|
10935
|
+
return slots.item?.({
|
|
10936
|
+
item,
|
|
10937
|
+
index,
|
|
10938
|
+
props: itemProps
|
|
10939
|
+
}) ?? vue.createVNode(VListItem, itemProps, {
|
|
10940
|
+
prepend: _ref3 => {
|
|
10941
|
+
let {
|
|
10942
|
+
isSelected
|
|
10943
|
+
} = _ref3;
|
|
10944
|
+
return vue.createVNode(vue.Fragment, null, [props.multiple && !props.hideSelected ? vue.createVNode(VCheckboxBtn, {
|
|
10945
|
+
"key": item.value,
|
|
10946
|
+
"modelValue": isSelected,
|
|
10947
|
+
"ripple": false,
|
|
10948
|
+
"tabindex": "-1"
|
|
10949
|
+
}, null) : undefined, item.props.prependIcon && vue.createVNode(VIcon, {
|
|
10950
|
+
"icon": item.props.prependIcon
|
|
10951
|
+
}, null)]);
|
|
10952
|
+
}
|
|
10953
|
+
});
|
|
10954
|
+
}
|
|
10638
10955
|
}), slots['append-item']?.()]
|
|
10639
10956
|
})]
|
|
10640
10957
|
}), selections.value.map((item, index) => {
|
|
@@ -10777,8 +11094,6 @@
|
|
|
10777
11094
|
const filteredMatches = vue.ref(new Map());
|
|
10778
11095
|
const transformedItems = vue.computed(() => options?.transform ? vue.unref(items).map(options?.transform) : vue.unref(items));
|
|
10779
11096
|
vue.watchEffect(() => {
|
|
10780
|
-
filteredItems.value = [];
|
|
10781
|
-
filteredMatches.value = new Map();
|
|
10782
11097
|
const results = filterItems(transformedItems.value, strQuery.value, {
|
|
10783
11098
|
customKeyFilter: props.customKeyFilter,
|
|
10784
11099
|
default: props.customFilter,
|
|
@@ -10787,15 +11102,19 @@
|
|
|
10787
11102
|
noFilter: props.noFilter
|
|
10788
11103
|
});
|
|
10789
11104
|
const originalItems = vue.unref(items);
|
|
11105
|
+
const _filteredItems = [];
|
|
11106
|
+
const _filteredMatches = new Map();
|
|
10790
11107
|
results.forEach(_ref => {
|
|
10791
11108
|
let {
|
|
10792
11109
|
index,
|
|
10793
11110
|
matches
|
|
10794
11111
|
} = _ref;
|
|
10795
11112
|
const item = originalItems[index];
|
|
10796
|
-
|
|
10797
|
-
|
|
11113
|
+
_filteredItems.push(item);
|
|
11114
|
+
_filteredMatches.set(item.value, matches);
|
|
10798
11115
|
});
|
|
11116
|
+
filteredItems.value = _filteredItems;
|
|
11117
|
+
filteredMatches.value = _filteredMatches;
|
|
10799
11118
|
});
|
|
10800
11119
|
function getMatches(item) {
|
|
10801
11120
|
return filteredMatches.value.get(item.value);
|
|
@@ -10885,7 +11204,7 @@
|
|
|
10885
11204
|
const {
|
|
10886
11205
|
filteredItems,
|
|
10887
11206
|
getMatches
|
|
10888
|
-
} = useFilter(props, items,
|
|
11207
|
+
} = useFilter(props, items, search);
|
|
10889
11208
|
const selections = vue.computed(() => {
|
|
10890
11209
|
return model.value.map(v => {
|
|
10891
11210
|
return items.value.find(item => props.valueComparator(item.value, v.value)) || v;
|
|
@@ -10905,6 +11224,10 @@
|
|
|
10905
11224
|
});
|
|
10906
11225
|
const menuDisabled = vue.computed(() => props.hideNoData && !items.value.length || props.readonly || form?.isReadonly.value);
|
|
10907
11226
|
const listRef = vue.ref();
|
|
11227
|
+
const {
|
|
11228
|
+
onListScroll,
|
|
11229
|
+
onListKeydown
|
|
11230
|
+
} = useScrolling(listRef, vTextFieldRef);
|
|
10908
11231
|
function onClear(e) {
|
|
10909
11232
|
if (props.openOnClear) {
|
|
10910
11233
|
menu.value = true;
|
|
@@ -10978,11 +11301,6 @@
|
|
|
10978
11301
|
}
|
|
10979
11302
|
}
|
|
10980
11303
|
}
|
|
10981
|
-
function onListKeydown(e) {
|
|
10982
|
-
if (e.key === 'Tab') {
|
|
10983
|
-
vTextFieldRef.value?.focus();
|
|
10984
|
-
}
|
|
10985
|
-
}
|
|
10986
11304
|
function onInput(e) {
|
|
10987
11305
|
search.value = e.target.value;
|
|
10988
11306
|
}
|
|
@@ -11101,38 +11419,50 @@
|
|
|
11101
11419
|
"onKeydown": onListKeydown,
|
|
11102
11420
|
"onFocusin": onFocusin,
|
|
11103
11421
|
"onFocusout": onFocusout,
|
|
11422
|
+
"onScrollPassive": onListScroll,
|
|
11104
11423
|
"tabindex": "-1"
|
|
11105
11424
|
}, {
|
|
11106
11425
|
default: () => [slots['prepend-item']?.(), !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? vue.createVNode(VListItem, {
|
|
11107
11426
|
"title": t(props.noDataText)
|
|
11108
|
-
}, null)),
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
|
|
11114
|
-
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
|
|
11122
|
-
|
|
11123
|
-
|
|
11124
|
-
|
|
11125
|
-
|
|
11126
|
-
|
|
11127
|
-
|
|
11128
|
-
|
|
11129
|
-
|
|
11130
|
-
|
|
11131
|
-
|
|
11132
|
-
|
|
11133
|
-
|
|
11134
|
-
|
|
11135
|
-
|
|
11427
|
+
}, null)), vue.createVNode(VVirtualScroll, {
|
|
11428
|
+
"renderless": true,
|
|
11429
|
+
"items": displayItems.value
|
|
11430
|
+
}, {
|
|
11431
|
+
default: _ref3 => {
|
|
11432
|
+
let {
|
|
11433
|
+
item,
|
|
11434
|
+
index,
|
|
11435
|
+
itemRef
|
|
11436
|
+
} = _ref3;
|
|
11437
|
+
const itemProps = vue.mergeProps(item.props, {
|
|
11438
|
+
ref: itemRef,
|
|
11439
|
+
key: index,
|
|
11440
|
+
active: highlightFirst.value && index === 0 ? true : undefined,
|
|
11441
|
+
onClick: () => select(item)
|
|
11442
|
+
});
|
|
11443
|
+
return slots.item?.({
|
|
11444
|
+
item,
|
|
11445
|
+
index,
|
|
11446
|
+
props: itemProps
|
|
11447
|
+
}) ?? vue.createVNode(VListItem, itemProps, {
|
|
11448
|
+
prepend: _ref4 => {
|
|
11449
|
+
let {
|
|
11450
|
+
isSelected
|
|
11451
|
+
} = _ref4;
|
|
11452
|
+
return vue.createVNode(vue.Fragment, null, [props.multiple && !props.hideSelected ? vue.createVNode(VCheckboxBtn, {
|
|
11453
|
+
"key": item.value,
|
|
11454
|
+
"modelValue": isSelected,
|
|
11455
|
+
"ripple": false,
|
|
11456
|
+
"tabindex": "-1"
|
|
11457
|
+
}, null) : undefined, item.props.prependIcon && vue.createVNode(VIcon, {
|
|
11458
|
+
"icon": item.props.prependIcon
|
|
11459
|
+
}, null)]);
|
|
11460
|
+
},
|
|
11461
|
+
title: () => {
|
|
11462
|
+
return isPristine.value ? item.title : highlightResult$1(item.title, getMatches(item)?.title, search.value?.length ?? 0);
|
|
11463
|
+
}
|
|
11464
|
+
});
|
|
11465
|
+
}
|
|
11136
11466
|
}), slots['append-item']?.()]
|
|
11137
11467
|
})]
|
|
11138
11468
|
}), selections.value.map((item, index) => {
|
|
@@ -14422,7 +14752,7 @@
|
|
|
14422
14752
|
const {
|
|
14423
14753
|
filteredItems,
|
|
14424
14754
|
getMatches
|
|
14425
|
-
} = useFilter(props, items,
|
|
14755
|
+
} = useFilter(props, items, search);
|
|
14426
14756
|
const selections = vue.computed(() => {
|
|
14427
14757
|
return model.value.map(v => {
|
|
14428
14758
|
return items.value.find(item => props.valueComparator(item.value, v.value)) || v;
|
|
@@ -14442,6 +14772,10 @@
|
|
|
14442
14772
|
});
|
|
14443
14773
|
const menuDisabled = vue.computed(() => props.hideNoData && !items.value.length || props.readonly || form?.isReadonly.value);
|
|
14444
14774
|
const listRef = vue.ref();
|
|
14775
|
+
const {
|
|
14776
|
+
onListScroll,
|
|
14777
|
+
onListKeydown
|
|
14778
|
+
} = useScrolling(listRef, vTextFieldRef);
|
|
14445
14779
|
function onClear(e) {
|
|
14446
14780
|
cleared = true;
|
|
14447
14781
|
if (props.openOnClear) {
|
|
@@ -14519,11 +14853,6 @@
|
|
|
14519
14853
|
search.value = '';
|
|
14520
14854
|
}
|
|
14521
14855
|
}
|
|
14522
|
-
function onListKeydown(e) {
|
|
14523
|
-
if (e.key === 'Tab') {
|
|
14524
|
-
vTextFieldRef.value?.focus();
|
|
14525
|
-
}
|
|
14526
|
-
}
|
|
14527
14856
|
function onAfterLeave() {
|
|
14528
14857
|
if (isFocused.value) {
|
|
14529
14858
|
isPristine.value = true;
|
|
@@ -14634,38 +14963,50 @@
|
|
|
14634
14963
|
"onKeydown": onListKeydown,
|
|
14635
14964
|
"onFocusin": onFocusin,
|
|
14636
14965
|
"onFocusout": onFocusout,
|
|
14966
|
+
"onScrollPassive": onListScroll,
|
|
14637
14967
|
"tabindex": "-1"
|
|
14638
14968
|
}, {
|
|
14639
14969
|
default: () => [slots['prepend-item']?.(), !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? vue.createVNode(VListItem, {
|
|
14640
14970
|
"title": t(props.noDataText)
|
|
14641
|
-
}, null)),
|
|
14642
|
-
|
|
14643
|
-
|
|
14644
|
-
|
|
14645
|
-
|
|
14646
|
-
|
|
14647
|
-
|
|
14648
|
-
|
|
14649
|
-
|
|
14650
|
-
|
|
14651
|
-
|
|
14652
|
-
|
|
14653
|
-
|
|
14654
|
-
|
|
14655
|
-
|
|
14656
|
-
|
|
14657
|
-
|
|
14658
|
-
|
|
14659
|
-
|
|
14660
|
-
|
|
14661
|
-
|
|
14662
|
-
|
|
14663
|
-
|
|
14664
|
-
|
|
14665
|
-
|
|
14666
|
-
|
|
14667
|
-
|
|
14668
|
-
|
|
14971
|
+
}, null)), vue.createVNode(VVirtualScroll, {
|
|
14972
|
+
"renderless": true,
|
|
14973
|
+
"items": displayItems.value
|
|
14974
|
+
}, {
|
|
14975
|
+
default: _ref3 => {
|
|
14976
|
+
let {
|
|
14977
|
+
item,
|
|
14978
|
+
index,
|
|
14979
|
+
itemRef
|
|
14980
|
+
} = _ref3;
|
|
14981
|
+
const itemProps = vue.mergeProps(item.props, {
|
|
14982
|
+
ref: itemRef,
|
|
14983
|
+
key: index,
|
|
14984
|
+
active: highlightFirst.value && index === 0 ? true : undefined,
|
|
14985
|
+
onClick: () => select(item)
|
|
14986
|
+
});
|
|
14987
|
+
return slots.item?.({
|
|
14988
|
+
item,
|
|
14989
|
+
index,
|
|
14990
|
+
props: itemProps
|
|
14991
|
+
}) ?? vue.createVNode(VListItem, itemProps, {
|
|
14992
|
+
prepend: _ref4 => {
|
|
14993
|
+
let {
|
|
14994
|
+
isSelected
|
|
14995
|
+
} = _ref4;
|
|
14996
|
+
return vue.createVNode(vue.Fragment, null, [props.multiple && !props.hideSelected ? vue.createVNode(VCheckboxBtn, {
|
|
14997
|
+
"key": item.value,
|
|
14998
|
+
"modelValue": isSelected,
|
|
14999
|
+
"ripple": false,
|
|
15000
|
+
"tabindex": "-1"
|
|
15001
|
+
}, null) : undefined, item.props.prependIcon && vue.createVNode(VIcon, {
|
|
15002
|
+
"icon": item.props.prependIcon
|
|
15003
|
+
}, null)]);
|
|
15004
|
+
},
|
|
15005
|
+
title: () => {
|
|
15006
|
+
return isPristine.value ? item.title : highlightResult(item.title, getMatches(item)?.title, search.value?.length ?? 0);
|
|
15007
|
+
}
|
|
15008
|
+
});
|
|
15009
|
+
}
|
|
14669
15010
|
}), slots['append-item']?.()]
|
|
14670
15011
|
})]
|
|
14671
15012
|
}), selections.value.map((item, index) => {
|
|
@@ -19007,215 +19348,6 @@
|
|
|
19007
19348
|
}
|
|
19008
19349
|
});
|
|
19009
19350
|
|
|
19010
|
-
const makeVVirtualScrollItemProps = propsFactory({
|
|
19011
|
-
dynamicHeight: Boolean,
|
|
19012
|
-
renderless: Boolean,
|
|
19013
|
-
...makeComponentProps()
|
|
19014
|
-
}, 'VVirtualScrollItem');
|
|
19015
|
-
const VVirtualScrollItem = genericComponent()({
|
|
19016
|
-
name: 'VVirtualScrollItem',
|
|
19017
|
-
props: makeVVirtualScrollItemProps(),
|
|
19018
|
-
emits: {
|
|
19019
|
-
'update:height': height => true
|
|
19020
|
-
},
|
|
19021
|
-
setup(props, _ref) {
|
|
19022
|
-
let {
|
|
19023
|
-
emit,
|
|
19024
|
-
slots
|
|
19025
|
-
} = _ref;
|
|
19026
|
-
const {
|
|
19027
|
-
resizeRef,
|
|
19028
|
-
contentRect
|
|
19029
|
-
} = useResizeObserver();
|
|
19030
|
-
useToggleScope(() => props.dynamicHeight, () => {
|
|
19031
|
-
vue.watch(() => contentRect.value?.height, height => {
|
|
19032
|
-
if (height != null) emit('update:height', height);
|
|
19033
|
-
});
|
|
19034
|
-
});
|
|
19035
|
-
function updateHeight() {
|
|
19036
|
-
if (props.dynamicHeight && contentRect.value) {
|
|
19037
|
-
emit('update:height', contentRect.value.height);
|
|
19038
|
-
}
|
|
19039
|
-
}
|
|
19040
|
-
vue.onUpdated(updateHeight);
|
|
19041
|
-
useRender(() => props.renderless ? vue.createVNode(vue.Fragment, null, [slots.default?.({
|
|
19042
|
-
props: {
|
|
19043
|
-
ref: props.dynamicHeight ? resizeRef : undefined
|
|
19044
|
-
}
|
|
19045
|
-
})]) : vue.createVNode("div", {
|
|
19046
|
-
"ref": props.dynamicHeight ? resizeRef : undefined,
|
|
19047
|
-
"class": ['v-virtual-scroll__item', props.class],
|
|
19048
|
-
"style": props.style
|
|
19049
|
-
}, [slots.default?.()]));
|
|
19050
|
-
}
|
|
19051
|
-
});
|
|
19052
|
-
|
|
19053
|
-
// Composables
|
|
19054
|
-
|
|
19055
|
-
// Types
|
|
19056
|
-
|
|
19057
|
-
const UP = -1;
|
|
19058
|
-
const DOWN = 1;
|
|
19059
|
-
const makeVirtualProps = propsFactory({
|
|
19060
|
-
itemHeight: [Number, String]
|
|
19061
|
-
}, 'virtual');
|
|
19062
|
-
function useVirtual(props, items, offset) {
|
|
19063
|
-
const first = vue.shallowRef(0);
|
|
19064
|
-
const baseItemHeight = vue.shallowRef(props.itemHeight);
|
|
19065
|
-
const itemHeight = vue.computed({
|
|
19066
|
-
get: () => parseInt(baseItemHeight.value ?? 0, 10),
|
|
19067
|
-
set(val) {
|
|
19068
|
-
baseItemHeight.value = val;
|
|
19069
|
-
}
|
|
19070
|
-
});
|
|
19071
|
-
const containerRef = vue.ref();
|
|
19072
|
-
const {
|
|
19073
|
-
resizeRef,
|
|
19074
|
-
contentRect
|
|
19075
|
-
} = useResizeObserver();
|
|
19076
|
-
vue.watchEffect(() => {
|
|
19077
|
-
resizeRef.value = containerRef.value;
|
|
19078
|
-
});
|
|
19079
|
-
const display = useDisplay();
|
|
19080
|
-
const sizeMap = new Map();
|
|
19081
|
-
let sizes = createRange(items.value.length).map(() => itemHeight.value);
|
|
19082
|
-
const visibleItems = vue.computed(() => {
|
|
19083
|
-
const height = (contentRect.value?.height ?? display.height.value) - (offset?.value ?? 0);
|
|
19084
|
-
return itemHeight.value ? Math.max(12, Math.ceil(height / itemHeight.value * 1.7 + 1)) : 12;
|
|
19085
|
-
});
|
|
19086
|
-
function handleItemResize(index, height) {
|
|
19087
|
-
itemHeight.value = Math.max(itemHeight.value, height);
|
|
19088
|
-
sizes[index] = height;
|
|
19089
|
-
sizeMap.set(items.value[index], height);
|
|
19090
|
-
}
|
|
19091
|
-
function calculateOffset(index) {
|
|
19092
|
-
return sizes.slice(0, index).reduce((curr, value) => curr + (value || itemHeight.value), 0);
|
|
19093
|
-
}
|
|
19094
|
-
function calculateMidPointIndex(scrollTop) {
|
|
19095
|
-
const end = items.value.length;
|
|
19096
|
-
let middle = 0;
|
|
19097
|
-
let middleOffset = 0;
|
|
19098
|
-
while (middleOffset < scrollTop && middle < end) {
|
|
19099
|
-
middleOffset += sizes[middle++] || itemHeight.value;
|
|
19100
|
-
}
|
|
19101
|
-
return middle - 1;
|
|
19102
|
-
}
|
|
19103
|
-
let lastScrollTop = 0;
|
|
19104
|
-
function handleScroll() {
|
|
19105
|
-
if (!containerRef.value || !contentRect.value) return;
|
|
19106
|
-
const height = contentRect.value.height - 56;
|
|
19107
|
-
const scrollTop = containerRef.value.scrollTop;
|
|
19108
|
-
const direction = scrollTop < lastScrollTop ? UP : DOWN;
|
|
19109
|
-
const midPointIndex = calculateMidPointIndex(scrollTop + height / 2);
|
|
19110
|
-
const buffer = Math.round(visibleItems.value / 3);
|
|
19111
|
-
const firstIndex = midPointIndex - buffer;
|
|
19112
|
-
const lastIndex = first.value + buffer * 2 - 1;
|
|
19113
|
-
if (direction === UP && midPointIndex <= lastIndex) {
|
|
19114
|
-
first.value = clamp(firstIndex, 0, items.value.length);
|
|
19115
|
-
} else if (direction === DOWN && midPointIndex >= lastIndex) {
|
|
19116
|
-
first.value = clamp(firstIndex, 0, items.value.length - visibleItems.value);
|
|
19117
|
-
}
|
|
19118
|
-
lastScrollTop = scrollTop;
|
|
19119
|
-
}
|
|
19120
|
-
function scrollToIndex(index) {
|
|
19121
|
-
if (!containerRef.value) return;
|
|
19122
|
-
const offset = calculateOffset(index);
|
|
19123
|
-
containerRef.value.scrollTop = offset;
|
|
19124
|
-
}
|
|
19125
|
-
const allItems = vue.computed(() => items.value.map((item, index) => ({
|
|
19126
|
-
raw: item,
|
|
19127
|
-
index
|
|
19128
|
-
})));
|
|
19129
|
-
const last = vue.computed(() => Math.min(items.value.length, first.value + visibleItems.value));
|
|
19130
|
-
const computedItems = vue.computed(() => allItems.value.slice(first.value, last.value));
|
|
19131
|
-
const paddingTop = vue.computed(() => calculateOffset(first.value));
|
|
19132
|
-
const paddingBottom = vue.computed(() => calculateOffset(items.value.length) - calculateOffset(last.value));
|
|
19133
|
-
vue.onMounted(() => {
|
|
19134
|
-
if (!itemHeight.value) {
|
|
19135
|
-
// If itemHeight prop is not set, then calculate an estimated height from the average of inital items
|
|
19136
|
-
itemHeight.value = sizes.slice(first.value, last.value).reduce((curr, height) => curr + height, 0) / visibleItems.value;
|
|
19137
|
-
}
|
|
19138
|
-
});
|
|
19139
|
-
vue.watch(() => items.value.length, () => {
|
|
19140
|
-
sizes = createRange(items.value.length).map(() => itemHeight.value);
|
|
19141
|
-
sizeMap.forEach((height, item) => {
|
|
19142
|
-
const index = items.value.indexOf(item);
|
|
19143
|
-
if (index === -1) {
|
|
19144
|
-
sizeMap.delete(item);
|
|
19145
|
-
} else {
|
|
19146
|
-
sizes[index] = height;
|
|
19147
|
-
}
|
|
19148
|
-
});
|
|
19149
|
-
});
|
|
19150
|
-
return {
|
|
19151
|
-
containerRef,
|
|
19152
|
-
computedItems,
|
|
19153
|
-
itemHeight,
|
|
19154
|
-
paddingTop,
|
|
19155
|
-
paddingBottom,
|
|
19156
|
-
scrollToIndex,
|
|
19157
|
-
handleScroll,
|
|
19158
|
-
handleItemResize
|
|
19159
|
-
};
|
|
19160
|
-
}
|
|
19161
|
-
|
|
19162
|
-
// Types
|
|
19163
|
-
|
|
19164
|
-
const makeVVirtualScrollProps = propsFactory({
|
|
19165
|
-
items: {
|
|
19166
|
-
type: Array,
|
|
19167
|
-
default: () => []
|
|
19168
|
-
},
|
|
19169
|
-
...makeVirtualProps(),
|
|
19170
|
-
...makeComponentProps(),
|
|
19171
|
-
...makeDimensionProps()
|
|
19172
|
-
}, 'VVirtualScroll');
|
|
19173
|
-
const VVirtualScroll = genericComponent()({
|
|
19174
|
-
name: 'VVirtualScroll',
|
|
19175
|
-
props: makeVVirtualScrollProps(),
|
|
19176
|
-
setup(props, _ref) {
|
|
19177
|
-
let {
|
|
19178
|
-
slots
|
|
19179
|
-
} = _ref;
|
|
19180
|
-
const {
|
|
19181
|
-
dimensionStyles
|
|
19182
|
-
} = useDimension(props);
|
|
19183
|
-
const {
|
|
19184
|
-
containerRef,
|
|
19185
|
-
handleScroll,
|
|
19186
|
-
handleItemResize,
|
|
19187
|
-
scrollToIndex,
|
|
19188
|
-
paddingTop,
|
|
19189
|
-
paddingBottom,
|
|
19190
|
-
computedItems
|
|
19191
|
-
} = useVirtual(props, vue.toRef(props, 'items'));
|
|
19192
|
-
useRender(() => vue.createVNode("div", {
|
|
19193
|
-
"ref": containerRef,
|
|
19194
|
-
"class": ['v-virtual-scroll', props.class],
|
|
19195
|
-
"onScroll": handleScroll,
|
|
19196
|
-
"style": [dimensionStyles.value, props.style]
|
|
19197
|
-
}, [vue.createVNode("div", {
|
|
19198
|
-
"class": "v-virtual-scroll__container",
|
|
19199
|
-
"style": {
|
|
19200
|
-
paddingTop: convertToUnit(paddingTop.value),
|
|
19201
|
-
paddingBottom: convertToUnit(paddingBottom.value)
|
|
19202
|
-
}
|
|
19203
|
-
}, [computedItems.value.map(item => vue.createVNode(VVirtualScrollItem, {
|
|
19204
|
-
"key": item.index,
|
|
19205
|
-
"dynamicHeight": !props.itemHeight,
|
|
19206
|
-
"onUpdate:height": height => handleItemResize(item.index, height)
|
|
19207
|
-
}, {
|
|
19208
|
-
default: () => [slots.default?.({
|
|
19209
|
-
item: item.raw,
|
|
19210
|
-
index: item.index
|
|
19211
|
-
})]
|
|
19212
|
-
}))])]));
|
|
19213
|
-
return {
|
|
19214
|
-
scrollToIndex
|
|
19215
|
-
};
|
|
19216
|
-
}
|
|
19217
|
-
});
|
|
19218
|
-
|
|
19219
19351
|
// Types
|
|
19220
19352
|
|
|
19221
19353
|
const makeVBottomSheetProps = propsFactory({
|
|
@@ -21196,19 +21328,21 @@
|
|
|
21196
21328
|
...slots,
|
|
21197
21329
|
item: itemSlotProps => vue.createVNode(VVirtualScrollItem, {
|
|
21198
21330
|
"key": itemSlotProps.item.index,
|
|
21199
|
-
"dynamicHeight": true,
|
|
21200
21331
|
"renderless": true,
|
|
21201
21332
|
"onUpdate:height": height => handleItemResize(itemSlotProps.item.index, height)
|
|
21202
21333
|
}, {
|
|
21203
|
-
default:
|
|
21204
|
-
|
|
21205
|
-
|
|
21206
|
-
|
|
21207
|
-
|
|
21208
|
-
|
|
21209
|
-
|
|
21210
|
-
|
|
21211
|
-
|
|
21334
|
+
default: _ref2 => {
|
|
21335
|
+
let {
|
|
21336
|
+
itemRef
|
|
21337
|
+
} = _ref2;
|
|
21338
|
+
return slots.item?.({
|
|
21339
|
+
...itemSlotProps,
|
|
21340
|
+
itemRef
|
|
21341
|
+
}) ?? vue.createVNode(VDataTableRow, vue.mergeProps(itemSlotProps.props, {
|
|
21342
|
+
"ref": itemRef,
|
|
21343
|
+
"key": itemSlotProps.item.index
|
|
21344
|
+
}), slots);
|
|
21345
|
+
}
|
|
21212
21346
|
})
|
|
21213
21347
|
}), vue.createVNode("tr", {
|
|
21214
21348
|
"style": {
|
|
@@ -23423,7 +23557,7 @@
|
|
|
23423
23557
|
date
|
|
23424
23558
|
};
|
|
23425
23559
|
}
|
|
23426
|
-
const version$1 = "3.3.5-
|
|
23560
|
+
const version$1 = "3.3.5-pr-17265.042d482";
|
|
23427
23561
|
createVuetify$1.version = version$1;
|
|
23428
23562
|
|
|
23429
23563
|
// Vue's inject() can only be used in setup
|
|
@@ -23437,7 +23571,7 @@
|
|
|
23437
23571
|
|
|
23438
23572
|
/* eslint-disable local-rules/sort-imports */
|
|
23439
23573
|
|
|
23440
|
-
const version = "3.3.5-
|
|
23574
|
+
const version = "3.3.5-pr-17265.042d482";
|
|
23441
23575
|
|
|
23442
23576
|
/* eslint-disable local-rules/sort-imports */
|
|
23443
23577
|
|