vuetify 3.3.6 → 3.3.7
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/dist/json/attributes.json +14 -10
- package/dist/json/importMap.json +76 -76
- package/dist/json/tags.json +1 -0
- package/dist/json/web-types.json +26 -24
- package/dist/vuetify-labs.css +127 -111
- package/dist/vuetify-labs.d.ts +178 -76
- package/dist/vuetify-labs.esm.js +486 -337
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +485 -336
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +36 -20
- package/dist/vuetify.d.ts +157 -93
- package/dist/vuetify.esm.js +469 -326
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +468 -325
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +688 -669
- 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/VBtn/VBtn.mjs +1 -1
- package/lib/components/VBtn/VBtn.mjs.map +1 -1
- package/lib/components/VCheckbox/index.d.mts +28 -16
- package/lib/components/VCombobox/VCombobox.mjs +48 -35
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VField/VField.css +17 -6
- package/lib/components/VField/VField.sass +17 -6
- package/lib/components/VField/_variables.scss +2 -2
- package/lib/components/VIcon/VIcon.css +1 -0
- package/lib/components/VIcon/VIcon.sass +1 -0
- package/lib/components/VImg/VImg.css +4 -2
- package/lib/components/VImg/VImg.mjs +4 -2
- package/lib/components/VImg/VImg.mjs.map +1 -1
- package/lib/components/VImg/VImg.sass +3 -4
- package/lib/components/VOverlay/VOverlay.css +2 -0
- package/lib/components/VOverlay/VOverlay.sass +3 -1
- package/lib/components/VOverlay/scrollStrategies.mjs +3 -1
- package/lib/components/VOverlay/scrollStrategies.mjs.map +1 -1
- package/lib/components/VRadio/index.d.mts +14 -8
- package/lib/components/VRadioGroup/index.d.mts +14 -8
- package/lib/components/VResponsive/VResponsive.css +6 -11
- package/lib/components/VResponsive/VResponsive.sass +5 -10
- 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/VSelectionControl/VSelectionControl.mjs +2 -2
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
- package/lib/components/VSelectionControl/index.d.mts +14 -8
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs +4 -1
- package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs.map +1 -1
- package/lib/components/VSelectionControlGroup/index.d.mts +14 -8
- package/lib/components/VSwitch/index.d.mts +14 -8
- package/lib/components/VTextField/VTextField.css +5 -0
- package/lib/components/VTextField/VTextField.mjs +6 -2
- package/lib/components/VTextField/VTextField.mjs.map +1 -1
- package/lib/components/VTextField/VTextField.sass +5 -0
- package/lib/components/VTextField/_variables.scss +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 +134 -70
- package/lib/composables/filter.mjs +9 -7
- 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/framework.mjs +1 -1
- package/lib/index.d.mts +23 -23
- package/lib/labs/VDataTable/VDataTableVirtual.mjs +12 -10
- package/lib/labs/VDataTable/VDataTableVirtual.mjs.map +1 -1
- package/lib/labs/VDataTable/composables/headers.mjs +6 -2
- package/lib/labs/VDataTable/composables/headers.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 +2 -2
package/dist/vuetify-labs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Vuetify v3.3.
|
|
2
|
+
* Vuetify v3.3.7
|
|
3
3
|
* Forged by John Leider
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -1258,8 +1258,9 @@
|
|
|
1258
1258
|
};
|
|
1259
1259
|
|
|
1260
1260
|
function getScrollParent(el) {
|
|
1261
|
+
let includeHidden = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1261
1262
|
while (el) {
|
|
1262
|
-
if (hasScrollbar(el)) return el;
|
|
1263
|
+
if (includeHidden ? isPotentiallyScrollable(el) : hasScrollbar(el)) return el;
|
|
1263
1264
|
el = el.parentElement;
|
|
1264
1265
|
}
|
|
1265
1266
|
return document.scrollingElement;
|
|
@@ -1279,6 +1280,11 @@
|
|
|
1279
1280
|
const style = window.getComputedStyle(el);
|
|
1280
1281
|
return style.overflowY === 'scroll' || style.overflowY === 'auto' && el.scrollHeight > el.clientHeight;
|
|
1281
1282
|
}
|
|
1283
|
+
function isPotentiallyScrollable(el) {
|
|
1284
|
+
if (!el || el.nodeType !== Node.ELEMENT_NODE) return false;
|
|
1285
|
+
const style = window.getComputedStyle(el);
|
|
1286
|
+
return ['scroll', 'auto'].includes(style.overflowY);
|
|
1287
|
+
}
|
|
1282
1288
|
|
|
1283
1289
|
const IN_BROWSER = typeof window !== 'undefined';
|
|
1284
1290
|
const SUPPORTS_INTERSECTION = IN_BROWSER && 'IntersectionObserver' in window;
|
|
@@ -1324,13 +1330,18 @@
|
|
|
1324
1330
|
// Types
|
|
1325
1331
|
|
|
1326
1332
|
function useResizeObserver(callback) {
|
|
1333
|
+
let box = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'content';
|
|
1327
1334
|
const resizeRef = vue.ref();
|
|
1328
1335
|
const contentRect = vue.ref();
|
|
1329
1336
|
if (IN_BROWSER) {
|
|
1330
1337
|
const observer = new ResizeObserver(entries => {
|
|
1331
1338
|
callback?.(entries, observer);
|
|
1332
1339
|
if (!entries.length) return;
|
|
1333
|
-
|
|
1340
|
+
if (box === 'content') {
|
|
1341
|
+
contentRect.value = entries[0].contentRect;
|
|
1342
|
+
} else {
|
|
1343
|
+
contentRect.value = entries[0].target.getBoundingClientRect();
|
|
1344
|
+
}
|
|
1334
1345
|
});
|
|
1335
1346
|
vue.onBeforeUnmount(() => {
|
|
1336
1347
|
observer.disconnect();
|
|
@@ -3152,7 +3163,9 @@
|
|
|
3152
3163
|
"class": ['v-img', {
|
|
3153
3164
|
'v-img--booting': !isBooted.value
|
|
3154
3165
|
}, props.class],
|
|
3155
|
-
"style":
|
|
3166
|
+
"style": [{
|
|
3167
|
+
width: convertToUnit(props.width === 'auto' ? naturalWidth.value : props.width)
|
|
3168
|
+
}, props.style]
|
|
3156
3169
|
}, responsiveProps, {
|
|
3157
3170
|
"aspectRatio": aspectRatio.value,
|
|
3158
3171
|
"aria-label": props.alt,
|
|
@@ -5271,7 +5284,7 @@
|
|
|
5271
5284
|
return Object(props.value) === props.value ? JSON.stringify(props.value, null, 0) : props.value;
|
|
5272
5285
|
});
|
|
5273
5286
|
function onClick(e) {
|
|
5274
|
-
if (isDisabled.value) return;
|
|
5287
|
+
if (isDisabled.value || link.isLink.value && (e.metaKey || e.ctrlKey || e.shiftKey || e.button !== 0 || attrs.target === '_blank')) return;
|
|
5275
5288
|
link.navigate?.(e);
|
|
5276
5289
|
group?.toggle();
|
|
5277
5290
|
}
|
|
@@ -5610,7 +5623,10 @@
|
|
|
5610
5623
|
const VSelectionControlGroupSymbol = Symbol.for('vuetify:selection-control-group');
|
|
5611
5624
|
const makeSelectionControlGroupProps = propsFactory({
|
|
5612
5625
|
color: String,
|
|
5613
|
-
disabled:
|
|
5626
|
+
disabled: {
|
|
5627
|
+
type: Boolean,
|
|
5628
|
+
default: null
|
|
5629
|
+
},
|
|
5614
5630
|
defaultsTarget: String,
|
|
5615
5631
|
error: Boolean,
|
|
5616
5632
|
id: String,
|
|
@@ -5834,12 +5850,12 @@
|
|
|
5834
5850
|
}, null), vue.createVNode("input", vue.mergeProps({
|
|
5835
5851
|
"ref": input,
|
|
5836
5852
|
"checked": model.value,
|
|
5837
|
-
"disabled": props.disabled,
|
|
5853
|
+
"disabled": !!(props.readonly || props.disabled),
|
|
5838
5854
|
"id": id.value,
|
|
5839
5855
|
"onBlur": onBlur,
|
|
5840
5856
|
"onFocus": onFocus,
|
|
5841
5857
|
"onInput": onInput,
|
|
5842
|
-
"aria-disabled": props.readonly,
|
|
5858
|
+
"aria-disabled": !!(props.readonly || props.disabled),
|
|
5843
5859
|
"type": props.type,
|
|
5844
5860
|
"value": trueValue.value,
|
|
5845
5861
|
"name": props.name,
|
|
@@ -8710,7 +8726,9 @@
|
|
|
8710
8726
|
scrollElements.forEach((el, i) => {
|
|
8711
8727
|
el.style.setProperty('--v-body-scroll-x', convertToUnit(-el.scrollLeft));
|
|
8712
8728
|
el.style.setProperty('--v-body-scroll-y', convertToUnit(-el.scrollTop));
|
|
8713
|
-
el.
|
|
8729
|
+
if (el !== document.documentElement) {
|
|
8730
|
+
el.style.setProperty('--v-scrollbar-offset', convertToUnit(scrollbarWidth));
|
|
8731
|
+
}
|
|
8714
8732
|
el.classList.add('v-overlay-scroll-blocked');
|
|
8715
8733
|
});
|
|
8716
8734
|
vue.onScopeDispose(() => {
|
|
@@ -10365,12 +10383,16 @@
|
|
|
10365
10383
|
}]]);
|
|
10366
10384
|
return vue.createVNode(vue.Fragment, null, [props.prefix && vue.createVNode("span", {
|
|
10367
10385
|
"class": "v-text-field__prefix"
|
|
10368
|
-
}, [
|
|
10386
|
+
}, [vue.createVNode("span", {
|
|
10387
|
+
"class": "v-text-field__prefix__text"
|
|
10388
|
+
}, [props.prefix])]), vue.createVNode("div", {
|
|
10369
10389
|
"class": fieldClass,
|
|
10370
10390
|
"data-no-activator": ""
|
|
10371
10391
|
}, [slots.default ? vue.createVNode(vue.Fragment, null, [slots.default(), inputNode]) : vue.cloneVNode(inputNode)]), props.suffix && vue.createVNode("span", {
|
|
10372
10392
|
"class": "v-text-field__suffix"
|
|
10373
|
-
}, [
|
|
10393
|
+
}, [vue.createVNode("span", {
|
|
10394
|
+
"class": "v-text-field__suffix__text"
|
|
10395
|
+
}, [props.suffix])])]);
|
|
10374
10396
|
}
|
|
10375
10397
|
});
|
|
10376
10398
|
},
|
|
@@ -10387,6 +10409,301 @@
|
|
|
10387
10409
|
|
|
10388
10410
|
// Types
|
|
10389
10411
|
|
|
10412
|
+
const makeVVirtualScrollItemProps = propsFactory({
|
|
10413
|
+
renderless: Boolean,
|
|
10414
|
+
...makeComponentProps()
|
|
10415
|
+
}, 'VVirtualScrollItem');
|
|
10416
|
+
const VVirtualScrollItem = genericComponent()({
|
|
10417
|
+
name: 'VVirtualScrollItem',
|
|
10418
|
+
inheritAttrs: false,
|
|
10419
|
+
props: makeVVirtualScrollItemProps(),
|
|
10420
|
+
emits: {
|
|
10421
|
+
'update:height': height => true
|
|
10422
|
+
},
|
|
10423
|
+
setup(props, _ref) {
|
|
10424
|
+
let {
|
|
10425
|
+
attrs,
|
|
10426
|
+
emit,
|
|
10427
|
+
slots
|
|
10428
|
+
} = _ref;
|
|
10429
|
+
const {
|
|
10430
|
+
resizeRef,
|
|
10431
|
+
contentRect
|
|
10432
|
+
} = useResizeObserver(undefined, 'border');
|
|
10433
|
+
vue.watch(() => contentRect.value?.height, height => {
|
|
10434
|
+
if (height != null) emit('update:height', height);
|
|
10435
|
+
});
|
|
10436
|
+
useRender(() => props.renderless ? vue.createVNode(vue.Fragment, null, [slots.default?.({
|
|
10437
|
+
itemRef: resizeRef
|
|
10438
|
+
})]) : vue.createVNode("div", vue.mergeProps({
|
|
10439
|
+
"ref": resizeRef,
|
|
10440
|
+
"class": ['v-virtual-scroll__item', props.class],
|
|
10441
|
+
"style": props.style
|
|
10442
|
+
}, attrs), [slots.default?.()]));
|
|
10443
|
+
}
|
|
10444
|
+
});
|
|
10445
|
+
|
|
10446
|
+
// Composables
|
|
10447
|
+
|
|
10448
|
+
// Types
|
|
10449
|
+
|
|
10450
|
+
const UP = -1;
|
|
10451
|
+
const DOWN = 1;
|
|
10452
|
+
const makeVirtualProps = propsFactory({
|
|
10453
|
+
itemHeight: {
|
|
10454
|
+
type: [Number, String],
|
|
10455
|
+
default: 48
|
|
10456
|
+
}
|
|
10457
|
+
}, 'virtual');
|
|
10458
|
+
function useVirtual(props, items, offset) {
|
|
10459
|
+
const first = vue.shallowRef(0);
|
|
10460
|
+
const baseItemHeight = vue.shallowRef(props.itemHeight);
|
|
10461
|
+
const itemHeight = vue.computed({
|
|
10462
|
+
get: () => parseInt(baseItemHeight.value ?? 0, 10),
|
|
10463
|
+
set(val) {
|
|
10464
|
+
baseItemHeight.value = val;
|
|
10465
|
+
}
|
|
10466
|
+
});
|
|
10467
|
+
const containerRef = vue.ref();
|
|
10468
|
+
const {
|
|
10469
|
+
resizeRef,
|
|
10470
|
+
contentRect
|
|
10471
|
+
} = useResizeObserver();
|
|
10472
|
+
vue.watchEffect(() => {
|
|
10473
|
+
resizeRef.value = containerRef.value;
|
|
10474
|
+
});
|
|
10475
|
+
const display = useDisplay();
|
|
10476
|
+
const sizeMap = new Map();
|
|
10477
|
+
let sizes = Array.from({
|
|
10478
|
+
length: items.value.length
|
|
10479
|
+
});
|
|
10480
|
+
const visibleItems = vue.computed(() => {
|
|
10481
|
+
const height = (!contentRect.value || containerRef.value === document.documentElement ? display.height.value : contentRect.value.height) - (offset?.value ?? 0);
|
|
10482
|
+
return Math.ceil(height / itemHeight.value * 1.7 + 1);
|
|
10483
|
+
});
|
|
10484
|
+
function handleItemResize(index, height) {
|
|
10485
|
+
itemHeight.value = Math.max(itemHeight.value, height);
|
|
10486
|
+
sizes[index] = height;
|
|
10487
|
+
sizeMap.set(items.value[index], height);
|
|
10488
|
+
}
|
|
10489
|
+
function calculateOffset(index) {
|
|
10490
|
+
return sizes.slice(0, index).reduce((acc, val) => acc + (val || itemHeight.value), 0);
|
|
10491
|
+
}
|
|
10492
|
+
function calculateMidPointIndex(scrollTop) {
|
|
10493
|
+
const end = items.value.length;
|
|
10494
|
+
let middle = 0;
|
|
10495
|
+
let middleOffset = 0;
|
|
10496
|
+
while (middleOffset < scrollTop && middle < end) {
|
|
10497
|
+
middleOffset += sizes[middle++] || itemHeight.value;
|
|
10498
|
+
}
|
|
10499
|
+
return middle - 1;
|
|
10500
|
+
}
|
|
10501
|
+
let lastScrollTop = 0;
|
|
10502
|
+
function handleScroll() {
|
|
10503
|
+
if (!containerRef.value || !contentRect.value) return;
|
|
10504
|
+
const height = contentRect.value.height - 56;
|
|
10505
|
+
const scrollTop = containerRef.value.scrollTop;
|
|
10506
|
+
const direction = scrollTop < lastScrollTop ? UP : DOWN;
|
|
10507
|
+
const midPointIndex = calculateMidPointIndex(scrollTop + height / 2);
|
|
10508
|
+
const buffer = Math.round(visibleItems.value / 3);
|
|
10509
|
+
const firstIndex = midPointIndex - buffer;
|
|
10510
|
+
const lastIndex = first.value + buffer * 2 - 1;
|
|
10511
|
+
if (direction === UP && midPointIndex <= lastIndex) {
|
|
10512
|
+
first.value = clamp(firstIndex, 0, items.value.length);
|
|
10513
|
+
} else if (direction === DOWN && midPointIndex >= lastIndex) {
|
|
10514
|
+
first.value = clamp(firstIndex, 0, items.value.length - visibleItems.value);
|
|
10515
|
+
}
|
|
10516
|
+
lastScrollTop = scrollTop;
|
|
10517
|
+
}
|
|
10518
|
+
function scrollToIndex(index) {
|
|
10519
|
+
if (!containerRef.value) return;
|
|
10520
|
+
const offset = calculateOffset(index);
|
|
10521
|
+
containerRef.value.scrollTop = offset;
|
|
10522
|
+
}
|
|
10523
|
+
const last = vue.computed(() => Math.min(items.value.length, first.value + visibleItems.value));
|
|
10524
|
+
const computedItems = vue.computed(() => {
|
|
10525
|
+
return items.value.slice(first.value, last.value).map((item, index) => ({
|
|
10526
|
+
raw: item,
|
|
10527
|
+
index: index + first.value
|
|
10528
|
+
}));
|
|
10529
|
+
});
|
|
10530
|
+
const paddingTop = vue.computed(() => calculateOffset(first.value));
|
|
10531
|
+
const paddingBottom = vue.computed(() => calculateOffset(items.value.length) - calculateOffset(last.value));
|
|
10532
|
+
vue.watch(() => items.value.length, () => {
|
|
10533
|
+
sizes = createRange(items.value.length).map(() => itemHeight.value);
|
|
10534
|
+
sizeMap.forEach((height, item) => {
|
|
10535
|
+
const index = items.value.indexOf(item);
|
|
10536
|
+
if (index === -1) {
|
|
10537
|
+
sizeMap.delete(item);
|
|
10538
|
+
} else {
|
|
10539
|
+
sizes[index] = height;
|
|
10540
|
+
}
|
|
10541
|
+
});
|
|
10542
|
+
});
|
|
10543
|
+
return {
|
|
10544
|
+
containerRef,
|
|
10545
|
+
computedItems,
|
|
10546
|
+
itemHeight,
|
|
10547
|
+
paddingTop,
|
|
10548
|
+
paddingBottom,
|
|
10549
|
+
scrollToIndex,
|
|
10550
|
+
handleScroll,
|
|
10551
|
+
handleItemResize
|
|
10552
|
+
};
|
|
10553
|
+
}
|
|
10554
|
+
|
|
10555
|
+
// Types
|
|
10556
|
+
|
|
10557
|
+
const makeVVirtualScrollProps = propsFactory({
|
|
10558
|
+
items: {
|
|
10559
|
+
type: Array,
|
|
10560
|
+
default: () => []
|
|
10561
|
+
},
|
|
10562
|
+
renderless: Boolean,
|
|
10563
|
+
...makeVirtualProps(),
|
|
10564
|
+
...makeComponentProps(),
|
|
10565
|
+
...makeDimensionProps()
|
|
10566
|
+
}, 'VVirtualScroll');
|
|
10567
|
+
const VVirtualScroll = genericComponent()({
|
|
10568
|
+
name: 'VVirtualScroll',
|
|
10569
|
+
props: makeVVirtualScrollProps(),
|
|
10570
|
+
setup(props, _ref) {
|
|
10571
|
+
let {
|
|
10572
|
+
slots
|
|
10573
|
+
} = _ref;
|
|
10574
|
+
const vm = getCurrentInstance('VVirtualScroll');
|
|
10575
|
+
const {
|
|
10576
|
+
dimensionStyles
|
|
10577
|
+
} = useDimension(props);
|
|
10578
|
+
const {
|
|
10579
|
+
containerRef,
|
|
10580
|
+
handleScroll,
|
|
10581
|
+
handleItemResize,
|
|
10582
|
+
scrollToIndex,
|
|
10583
|
+
paddingTop,
|
|
10584
|
+
paddingBottom,
|
|
10585
|
+
computedItems
|
|
10586
|
+
} = useVirtual(props, vue.toRef(props, 'items'));
|
|
10587
|
+
useToggleScope(() => props.renderless, () => {
|
|
10588
|
+
vue.onMounted(() => {
|
|
10589
|
+
containerRef.value = getScrollParent(vm.vnode.el, true);
|
|
10590
|
+
containerRef.value?.addEventListener('scroll', handleScroll);
|
|
10591
|
+
});
|
|
10592
|
+
vue.onScopeDispose(() => {
|
|
10593
|
+
containerRef.value?.removeEventListener('scroll', handleScroll);
|
|
10594
|
+
});
|
|
10595
|
+
});
|
|
10596
|
+
useRender(() => {
|
|
10597
|
+
const children = computedItems.value.map(item => vue.createVNode(VVirtualScrollItem, {
|
|
10598
|
+
"key": item.index,
|
|
10599
|
+
"renderless": props.renderless,
|
|
10600
|
+
"onUpdate:height": height => handleItemResize(item.index, height)
|
|
10601
|
+
}, {
|
|
10602
|
+
default: slotProps => slots.default?.({
|
|
10603
|
+
item: item.raw,
|
|
10604
|
+
index: item.index,
|
|
10605
|
+
...slotProps
|
|
10606
|
+
})
|
|
10607
|
+
}));
|
|
10608
|
+
return props.renderless ? vue.createVNode(vue.Fragment, null, [vue.createVNode("div", {
|
|
10609
|
+
"class": "v-virtual-scroll__spacer",
|
|
10610
|
+
"style": {
|
|
10611
|
+
paddingTop: convertToUnit(paddingTop.value)
|
|
10612
|
+
}
|
|
10613
|
+
}, null), children, vue.createVNode("div", {
|
|
10614
|
+
"class": "v-virtual-scroll__spacer",
|
|
10615
|
+
"style": {
|
|
10616
|
+
paddingBottom: convertToUnit(paddingBottom.value)
|
|
10617
|
+
}
|
|
10618
|
+
}, null)]) : vue.createVNode("div", {
|
|
10619
|
+
"ref": containerRef,
|
|
10620
|
+
"class": ['v-virtual-scroll', props.class],
|
|
10621
|
+
"onScroll": handleScroll,
|
|
10622
|
+
"style": [dimensionStyles.value, props.style]
|
|
10623
|
+
}, [vue.createVNode("div", {
|
|
10624
|
+
"class": "v-virtual-scroll__container",
|
|
10625
|
+
"style": {
|
|
10626
|
+
paddingTop: convertToUnit(paddingTop.value),
|
|
10627
|
+
paddingBottom: convertToUnit(paddingBottom.value)
|
|
10628
|
+
}
|
|
10629
|
+
}, [children])]);
|
|
10630
|
+
});
|
|
10631
|
+
return {
|
|
10632
|
+
scrollToIndex
|
|
10633
|
+
};
|
|
10634
|
+
}
|
|
10635
|
+
});
|
|
10636
|
+
|
|
10637
|
+
// Utilities
|
|
10638
|
+
|
|
10639
|
+
// Types
|
|
10640
|
+
|
|
10641
|
+
function useScrolling(listRef, textFieldRef) {
|
|
10642
|
+
const isScrolling = vue.shallowRef(false);
|
|
10643
|
+
let scrollTimeout;
|
|
10644
|
+
function onListScroll(e) {
|
|
10645
|
+
cancelAnimationFrame(scrollTimeout);
|
|
10646
|
+
isScrolling.value = true;
|
|
10647
|
+
scrollTimeout = requestAnimationFrame(() => {
|
|
10648
|
+
scrollTimeout = requestAnimationFrame(() => {
|
|
10649
|
+
isScrolling.value = false;
|
|
10650
|
+
});
|
|
10651
|
+
});
|
|
10652
|
+
}
|
|
10653
|
+
async function finishScrolling() {
|
|
10654
|
+
await new Promise(resolve => requestAnimationFrame(resolve));
|
|
10655
|
+
await new Promise(resolve => requestAnimationFrame(resolve));
|
|
10656
|
+
await new Promise(resolve => requestAnimationFrame(resolve));
|
|
10657
|
+
await new Promise(resolve => {
|
|
10658
|
+
if (isScrolling.value) {
|
|
10659
|
+
const stop = vue.watch(isScrolling, () => {
|
|
10660
|
+
stop();
|
|
10661
|
+
resolve();
|
|
10662
|
+
});
|
|
10663
|
+
} else resolve();
|
|
10664
|
+
});
|
|
10665
|
+
}
|
|
10666
|
+
async function onListKeydown(e) {
|
|
10667
|
+
if (e.key === 'Tab') {
|
|
10668
|
+
textFieldRef.value?.focus();
|
|
10669
|
+
}
|
|
10670
|
+
if (!['PageDown', 'PageUp', 'Home', 'End'].includes(e.key)) return;
|
|
10671
|
+
const el = listRef.value?.$el;
|
|
10672
|
+
if (!el) return;
|
|
10673
|
+
if (e.key === 'Home' || e.key === 'End') {
|
|
10674
|
+
el.scrollTo({
|
|
10675
|
+
top: e.key === 'Home' ? 0 : el.scrollHeight,
|
|
10676
|
+
behavior: 'smooth'
|
|
10677
|
+
});
|
|
10678
|
+
}
|
|
10679
|
+
await finishScrolling();
|
|
10680
|
+
const children = el.querySelectorAll(':scope > :not(.v-virtual-scroll__spacer)');
|
|
10681
|
+
if (e.key === 'PageDown' || e.key === 'Home') {
|
|
10682
|
+
const top = el.getBoundingClientRect().top;
|
|
10683
|
+
for (const child of children) {
|
|
10684
|
+
if (child.getBoundingClientRect().top >= top) {
|
|
10685
|
+
child.focus();
|
|
10686
|
+
break;
|
|
10687
|
+
}
|
|
10688
|
+
}
|
|
10689
|
+
} else {
|
|
10690
|
+
const bottom = el.getBoundingClientRect().bottom;
|
|
10691
|
+
for (const child of [...children].reverse()) {
|
|
10692
|
+
if (child.getBoundingClientRect().bottom <= bottom) {
|
|
10693
|
+
child.focus();
|
|
10694
|
+
break;
|
|
10695
|
+
}
|
|
10696
|
+
}
|
|
10697
|
+
}
|
|
10698
|
+
}
|
|
10699
|
+
return {
|
|
10700
|
+
onListScroll,
|
|
10701
|
+
onListKeydown
|
|
10702
|
+
};
|
|
10703
|
+
}
|
|
10704
|
+
|
|
10705
|
+
// Types
|
|
10706
|
+
|
|
10390
10707
|
const makeSelectProps = propsFactory({
|
|
10391
10708
|
chips: Boolean,
|
|
10392
10709
|
closableChips: Boolean,
|
|
@@ -10478,6 +10795,10 @@
|
|
|
10478
10795
|
});
|
|
10479
10796
|
const menuDisabled = vue.computed(() => props.hideNoData && !items.value.length || props.readonly || form?.isReadonly.value);
|
|
10480
10797
|
const listRef = vue.ref();
|
|
10798
|
+
const {
|
|
10799
|
+
onListScroll,
|
|
10800
|
+
onListKeydown
|
|
10801
|
+
} = useScrolling(listRef, vTextFieldRef);
|
|
10481
10802
|
function onClear(e) {
|
|
10482
10803
|
if (props.openOnClear) {
|
|
10483
10804
|
menu.value = true;
|
|
@@ -10524,11 +10845,6 @@
|
|
|
10524
10845
|
model.value = [item];
|
|
10525
10846
|
}
|
|
10526
10847
|
}
|
|
10527
|
-
function onListKeydown(e) {
|
|
10528
|
-
if (e.key === 'Tab') {
|
|
10529
|
-
vTextFieldRef.value?.focus();
|
|
10530
|
-
}
|
|
10531
|
-
}
|
|
10532
10848
|
function select(item) {
|
|
10533
10849
|
if (props.multiple) {
|
|
10534
10850
|
const index = selected.value.findIndex(selection => props.valueComparator(selection, item.value));
|
|
@@ -10611,34 +10927,46 @@
|
|
|
10611
10927
|
"onMousedown": e => e.preventDefault(),
|
|
10612
10928
|
"onKeydown": onListKeydown,
|
|
10613
10929
|
"onFocusin": onFocusin,
|
|
10930
|
+
"onScrollPassive": onListScroll,
|
|
10614
10931
|
"tabindex": "-1"
|
|
10615
10932
|
}, {
|
|
10616
10933
|
default: () => [slots['prepend-item']?.(), !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? vue.createVNode(VListItem, {
|
|
10617
10934
|
"title": t(props.noDataText)
|
|
10618
|
-
}, null)),
|
|
10619
|
-
|
|
10620
|
-
|
|
10621
|
-
|
|
10622
|
-
|
|
10623
|
-
|
|
10624
|
-
|
|
10625
|
-
|
|
10626
|
-
|
|
10627
|
-
|
|
10628
|
-
|
|
10629
|
-
|
|
10630
|
-
|
|
10631
|
-
|
|
10632
|
-
|
|
10633
|
-
|
|
10634
|
-
|
|
10635
|
-
|
|
10636
|
-
|
|
10637
|
-
|
|
10638
|
-
|
|
10639
|
-
|
|
10640
|
-
|
|
10641
|
-
|
|
10935
|
+
}, null)), vue.createVNode(VVirtualScroll, {
|
|
10936
|
+
"renderless": true,
|
|
10937
|
+
"items": displayItems.value
|
|
10938
|
+
}, {
|
|
10939
|
+
default: _ref2 => {
|
|
10940
|
+
let {
|
|
10941
|
+
item,
|
|
10942
|
+
index,
|
|
10943
|
+
itemRef
|
|
10944
|
+
} = _ref2;
|
|
10945
|
+
const itemProps = vue.mergeProps(item.props, {
|
|
10946
|
+
ref: itemRef,
|
|
10947
|
+
key: index,
|
|
10948
|
+
onClick: () => select(item)
|
|
10949
|
+
});
|
|
10950
|
+
return slots.item?.({
|
|
10951
|
+
item,
|
|
10952
|
+
index,
|
|
10953
|
+
props: itemProps
|
|
10954
|
+
}) ?? vue.createVNode(VListItem, itemProps, {
|
|
10955
|
+
prepend: _ref3 => {
|
|
10956
|
+
let {
|
|
10957
|
+
isSelected
|
|
10958
|
+
} = _ref3;
|
|
10959
|
+
return vue.createVNode(vue.Fragment, null, [props.multiple && !props.hideSelected ? vue.createVNode(VCheckboxBtn, {
|
|
10960
|
+
"key": item.value,
|
|
10961
|
+
"modelValue": isSelected,
|
|
10962
|
+
"ripple": false,
|
|
10963
|
+
"tabindex": "-1"
|
|
10964
|
+
}, null) : undefined, item.props.prependIcon && vue.createVNode(VIcon, {
|
|
10965
|
+
"icon": item.props.prependIcon
|
|
10966
|
+
}, null)]);
|
|
10967
|
+
}
|
|
10968
|
+
});
|
|
10969
|
+
}
|
|
10642
10970
|
}), slots['append-item']?.()]
|
|
10643
10971
|
})]
|
|
10644
10972
|
}), selections.value.map((item, index) => {
|
|
@@ -10776,14 +11104,12 @@
|
|
|
10776
11104
|
return array;
|
|
10777
11105
|
}
|
|
10778
11106
|
function useFilter(props, items, query, options) {
|
|
10779
|
-
const strQuery = vue.computed(() => typeof query?.value !== 'string' && typeof query?.value !== 'number' ? '' : String(query.value));
|
|
10780
11107
|
const filteredItems = vue.ref([]);
|
|
10781
11108
|
const filteredMatches = vue.ref(new Map());
|
|
10782
11109
|
const transformedItems = vue.computed(() => options?.transform ? vue.unref(items).map(options?.transform) : vue.unref(items));
|
|
10783
11110
|
vue.watchEffect(() => {
|
|
10784
|
-
|
|
10785
|
-
|
|
10786
|
-
const results = filterItems(transformedItems.value, strQuery.value, {
|
|
11111
|
+
const strQuery = typeof vue.toValue(query) !== 'string' && typeof vue.toValue(query) !== 'number' ? '' : String(vue.toValue(query));
|
|
11112
|
+
const results = filterItems(transformedItems.value, strQuery, {
|
|
10787
11113
|
customKeyFilter: props.customKeyFilter,
|
|
10788
11114
|
default: props.customFilter,
|
|
10789
11115
|
filterKeys: props.filterKeys,
|
|
@@ -10791,15 +11117,19 @@
|
|
|
10791
11117
|
noFilter: props.noFilter
|
|
10792
11118
|
});
|
|
10793
11119
|
const originalItems = vue.unref(items);
|
|
11120
|
+
const _filteredItems = [];
|
|
11121
|
+
const _filteredMatches = new Map();
|
|
10794
11122
|
results.forEach(_ref => {
|
|
10795
11123
|
let {
|
|
10796
11124
|
index,
|
|
10797
11125
|
matches
|
|
10798
11126
|
} = _ref;
|
|
10799
11127
|
const item = originalItems[index];
|
|
10800
|
-
|
|
10801
|
-
|
|
11128
|
+
_filteredItems.push(item);
|
|
11129
|
+
_filteredMatches.set(item.value, matches);
|
|
10802
11130
|
});
|
|
11131
|
+
filteredItems.value = _filteredItems;
|
|
11132
|
+
filteredMatches.value = _filteredMatches;
|
|
10803
11133
|
});
|
|
10804
11134
|
function getMatches(item) {
|
|
10805
11135
|
return filteredMatches.value.get(item.value);
|
|
@@ -10889,7 +11219,7 @@
|
|
|
10889
11219
|
const {
|
|
10890
11220
|
filteredItems,
|
|
10891
11221
|
getMatches
|
|
10892
|
-
} = useFilter(props, items,
|
|
11222
|
+
} = useFilter(props, items, () => isPristine.value ? '' : search.value);
|
|
10893
11223
|
const selections = vue.computed(() => {
|
|
10894
11224
|
return model.value.map(v => {
|
|
10895
11225
|
return items.value.find(item => props.valueComparator(item.value, v.value)) || v;
|
|
@@ -10909,6 +11239,10 @@
|
|
|
10909
11239
|
});
|
|
10910
11240
|
const menuDisabled = vue.computed(() => props.hideNoData && !items.value.length || props.readonly || form?.isReadonly.value);
|
|
10911
11241
|
const listRef = vue.ref();
|
|
11242
|
+
const {
|
|
11243
|
+
onListScroll,
|
|
11244
|
+
onListKeydown
|
|
11245
|
+
} = useScrolling(listRef, vTextFieldRef);
|
|
10912
11246
|
function onClear(e) {
|
|
10913
11247
|
if (props.openOnClear) {
|
|
10914
11248
|
menu.value = true;
|
|
@@ -10982,11 +11316,6 @@
|
|
|
10982
11316
|
}
|
|
10983
11317
|
}
|
|
10984
11318
|
}
|
|
10985
|
-
function onListKeydown(e) {
|
|
10986
|
-
if (e.key === 'Tab') {
|
|
10987
|
-
vTextFieldRef.value?.focus();
|
|
10988
|
-
}
|
|
10989
|
-
}
|
|
10990
11319
|
function onInput(e) {
|
|
10991
11320
|
search.value = e.target.value;
|
|
10992
11321
|
}
|
|
@@ -11105,38 +11434,50 @@
|
|
|
11105
11434
|
"onKeydown": onListKeydown,
|
|
11106
11435
|
"onFocusin": onFocusin,
|
|
11107
11436
|
"onFocusout": onFocusout,
|
|
11437
|
+
"onScrollPassive": onListScroll,
|
|
11108
11438
|
"tabindex": "-1"
|
|
11109
11439
|
}, {
|
|
11110
11440
|
default: () => [slots['prepend-item']?.(), !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? vue.createVNode(VListItem, {
|
|
11111
11441
|
"title": t(props.noDataText)
|
|
11112
|
-
}, null)),
|
|
11113
|
-
|
|
11114
|
-
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
|
|
11122
|
-
|
|
11123
|
-
|
|
11124
|
-
|
|
11125
|
-
|
|
11126
|
-
|
|
11127
|
-
|
|
11128
|
-
|
|
11129
|
-
|
|
11130
|
-
|
|
11131
|
-
|
|
11132
|
-
|
|
11133
|
-
|
|
11134
|
-
|
|
11135
|
-
|
|
11136
|
-
|
|
11137
|
-
|
|
11138
|
-
|
|
11139
|
-
|
|
11442
|
+
}, null)), vue.createVNode(VVirtualScroll, {
|
|
11443
|
+
"renderless": true,
|
|
11444
|
+
"items": displayItems.value
|
|
11445
|
+
}, {
|
|
11446
|
+
default: _ref3 => {
|
|
11447
|
+
let {
|
|
11448
|
+
item,
|
|
11449
|
+
index,
|
|
11450
|
+
itemRef
|
|
11451
|
+
} = _ref3;
|
|
11452
|
+
const itemProps = vue.mergeProps(item.props, {
|
|
11453
|
+
ref: itemRef,
|
|
11454
|
+
key: index,
|
|
11455
|
+
active: highlightFirst.value && index === 0 ? true : undefined,
|
|
11456
|
+
onClick: () => select(item)
|
|
11457
|
+
});
|
|
11458
|
+
return slots.item?.({
|
|
11459
|
+
item,
|
|
11460
|
+
index,
|
|
11461
|
+
props: itemProps
|
|
11462
|
+
}) ?? vue.createVNode(VListItem, itemProps, {
|
|
11463
|
+
prepend: _ref4 => {
|
|
11464
|
+
let {
|
|
11465
|
+
isSelected
|
|
11466
|
+
} = _ref4;
|
|
11467
|
+
return vue.createVNode(vue.Fragment, null, [props.multiple && !props.hideSelected ? vue.createVNode(VCheckboxBtn, {
|
|
11468
|
+
"key": item.value,
|
|
11469
|
+
"modelValue": isSelected,
|
|
11470
|
+
"ripple": false,
|
|
11471
|
+
"tabindex": "-1"
|
|
11472
|
+
}, null) : undefined, item.props.prependIcon && vue.createVNode(VIcon, {
|
|
11473
|
+
"icon": item.props.prependIcon
|
|
11474
|
+
}, null)]);
|
|
11475
|
+
},
|
|
11476
|
+
title: () => {
|
|
11477
|
+
return isPristine.value ? item.title : highlightResult$1(item.title, getMatches(item)?.title, search.value?.length ?? 0);
|
|
11478
|
+
}
|
|
11479
|
+
});
|
|
11480
|
+
}
|
|
11140
11481
|
}), slots['append-item']?.()]
|
|
11141
11482
|
})]
|
|
11142
11483
|
}), selections.value.map((item, index) => {
|
|
@@ -14430,7 +14771,7 @@
|
|
|
14430
14771
|
const {
|
|
14431
14772
|
filteredItems,
|
|
14432
14773
|
getMatches
|
|
14433
|
-
} = useFilter(props, items,
|
|
14774
|
+
} = useFilter(props, items, () => isPristine.value ? '' : search.value);
|
|
14434
14775
|
const selections = vue.computed(() => {
|
|
14435
14776
|
return model.value.map(v => {
|
|
14436
14777
|
return items.value.find(item => props.valueComparator(item.value, v.value)) || v;
|
|
@@ -14450,6 +14791,10 @@
|
|
|
14450
14791
|
});
|
|
14451
14792
|
const menuDisabled = vue.computed(() => props.hideNoData && !items.value.length || props.readonly || form?.isReadonly.value);
|
|
14452
14793
|
const listRef = vue.ref();
|
|
14794
|
+
const {
|
|
14795
|
+
onListScroll,
|
|
14796
|
+
onListKeydown
|
|
14797
|
+
} = useScrolling(listRef, vTextFieldRef);
|
|
14453
14798
|
function onClear(e) {
|
|
14454
14799
|
cleared = true;
|
|
14455
14800
|
if (props.openOnClear) {
|
|
@@ -14527,11 +14872,6 @@
|
|
|
14527
14872
|
search.value = '';
|
|
14528
14873
|
}
|
|
14529
14874
|
}
|
|
14530
|
-
function onListKeydown(e) {
|
|
14531
|
-
if (e.key === 'Tab') {
|
|
14532
|
-
vTextFieldRef.value?.focus();
|
|
14533
|
-
}
|
|
14534
|
-
}
|
|
14535
14875
|
function onAfterLeave() {
|
|
14536
14876
|
if (isFocused.value) {
|
|
14537
14877
|
isPristine.value = true;
|
|
@@ -14642,38 +14982,50 @@
|
|
|
14642
14982
|
"onKeydown": onListKeydown,
|
|
14643
14983
|
"onFocusin": onFocusin,
|
|
14644
14984
|
"onFocusout": onFocusout,
|
|
14985
|
+
"onScrollPassive": onListScroll,
|
|
14645
14986
|
"tabindex": "-1"
|
|
14646
14987
|
}, {
|
|
14647
14988
|
default: () => [slots['prepend-item']?.(), !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? vue.createVNode(VListItem, {
|
|
14648
14989
|
"title": t(props.noDataText)
|
|
14649
|
-
}, null)),
|
|
14650
|
-
|
|
14651
|
-
|
|
14652
|
-
|
|
14653
|
-
|
|
14654
|
-
|
|
14655
|
-
|
|
14656
|
-
|
|
14657
|
-
|
|
14658
|
-
|
|
14659
|
-
|
|
14660
|
-
|
|
14661
|
-
|
|
14662
|
-
|
|
14663
|
-
|
|
14664
|
-
|
|
14665
|
-
|
|
14666
|
-
|
|
14667
|
-
|
|
14668
|
-
|
|
14669
|
-
|
|
14670
|
-
|
|
14671
|
-
|
|
14672
|
-
|
|
14673
|
-
|
|
14674
|
-
|
|
14675
|
-
|
|
14676
|
-
|
|
14990
|
+
}, null)), vue.createVNode(VVirtualScroll, {
|
|
14991
|
+
"renderless": true,
|
|
14992
|
+
"items": displayItems.value
|
|
14993
|
+
}, {
|
|
14994
|
+
default: _ref3 => {
|
|
14995
|
+
let {
|
|
14996
|
+
item,
|
|
14997
|
+
index,
|
|
14998
|
+
itemRef
|
|
14999
|
+
} = _ref3;
|
|
15000
|
+
const itemProps = vue.mergeProps(item.props, {
|
|
15001
|
+
ref: itemRef,
|
|
15002
|
+
key: index,
|
|
15003
|
+
active: highlightFirst.value && index === 0 ? true : undefined,
|
|
15004
|
+
onClick: () => select(item)
|
|
15005
|
+
});
|
|
15006
|
+
return slots.item?.({
|
|
15007
|
+
item,
|
|
15008
|
+
index,
|
|
15009
|
+
props: itemProps
|
|
15010
|
+
}) ?? vue.createVNode(VListItem, itemProps, {
|
|
15011
|
+
prepend: _ref4 => {
|
|
15012
|
+
let {
|
|
15013
|
+
isSelected
|
|
15014
|
+
} = _ref4;
|
|
15015
|
+
return vue.createVNode(vue.Fragment, null, [props.multiple && !props.hideSelected ? vue.createVNode(VCheckboxBtn, {
|
|
15016
|
+
"key": item.value,
|
|
15017
|
+
"modelValue": isSelected,
|
|
15018
|
+
"ripple": false,
|
|
15019
|
+
"tabindex": "-1"
|
|
15020
|
+
}, null) : undefined, item.props.prependIcon && vue.createVNode(VIcon, {
|
|
15021
|
+
"icon": item.props.prependIcon
|
|
15022
|
+
}, null)]);
|
|
15023
|
+
},
|
|
15024
|
+
title: () => {
|
|
15025
|
+
return isPristine.value ? item.title : highlightResult(item.title, getMatches(item)?.title, search.value?.length ?? 0);
|
|
15026
|
+
}
|
|
15027
|
+
});
|
|
15028
|
+
}
|
|
14677
15029
|
}), slots['append-item']?.()]
|
|
14678
15030
|
})]
|
|
14679
15031
|
}), selections.value.map((item, index) => {
|
|
@@ -19017,215 +19369,6 @@
|
|
|
19017
19369
|
}
|
|
19018
19370
|
});
|
|
19019
19371
|
|
|
19020
|
-
const makeVVirtualScrollItemProps = propsFactory({
|
|
19021
|
-
dynamicHeight: Boolean,
|
|
19022
|
-
renderless: Boolean,
|
|
19023
|
-
...makeComponentProps()
|
|
19024
|
-
}, 'VVirtualScrollItem');
|
|
19025
|
-
const VVirtualScrollItem = genericComponent()({
|
|
19026
|
-
name: 'VVirtualScrollItem',
|
|
19027
|
-
props: makeVVirtualScrollItemProps(),
|
|
19028
|
-
emits: {
|
|
19029
|
-
'update:height': height => true
|
|
19030
|
-
},
|
|
19031
|
-
setup(props, _ref) {
|
|
19032
|
-
let {
|
|
19033
|
-
emit,
|
|
19034
|
-
slots
|
|
19035
|
-
} = _ref;
|
|
19036
|
-
const {
|
|
19037
|
-
resizeRef,
|
|
19038
|
-
contentRect
|
|
19039
|
-
} = useResizeObserver();
|
|
19040
|
-
useToggleScope(() => props.dynamicHeight, () => {
|
|
19041
|
-
vue.watch(() => contentRect.value?.height, height => {
|
|
19042
|
-
if (height != null) emit('update:height', height);
|
|
19043
|
-
});
|
|
19044
|
-
});
|
|
19045
|
-
function updateHeight() {
|
|
19046
|
-
if (props.dynamicHeight && contentRect.value) {
|
|
19047
|
-
emit('update:height', contentRect.value.height);
|
|
19048
|
-
}
|
|
19049
|
-
}
|
|
19050
|
-
vue.onUpdated(updateHeight);
|
|
19051
|
-
useRender(() => props.renderless ? vue.createVNode(vue.Fragment, null, [slots.default?.({
|
|
19052
|
-
props: {
|
|
19053
|
-
ref: props.dynamicHeight ? resizeRef : undefined
|
|
19054
|
-
}
|
|
19055
|
-
})]) : vue.createVNode("div", {
|
|
19056
|
-
"ref": props.dynamicHeight ? resizeRef : undefined,
|
|
19057
|
-
"class": ['v-virtual-scroll__item', props.class],
|
|
19058
|
-
"style": props.style
|
|
19059
|
-
}, [slots.default?.()]));
|
|
19060
|
-
}
|
|
19061
|
-
});
|
|
19062
|
-
|
|
19063
|
-
// Composables
|
|
19064
|
-
|
|
19065
|
-
// Types
|
|
19066
|
-
|
|
19067
|
-
const UP = -1;
|
|
19068
|
-
const DOWN = 1;
|
|
19069
|
-
const makeVirtualProps = propsFactory({
|
|
19070
|
-
itemHeight: [Number, String]
|
|
19071
|
-
}, 'virtual');
|
|
19072
|
-
function useVirtual(props, items, offset) {
|
|
19073
|
-
const first = vue.shallowRef(0);
|
|
19074
|
-
const baseItemHeight = vue.shallowRef(props.itemHeight);
|
|
19075
|
-
const itemHeight = vue.computed({
|
|
19076
|
-
get: () => parseInt(baseItemHeight.value ?? 0, 10),
|
|
19077
|
-
set(val) {
|
|
19078
|
-
baseItemHeight.value = val;
|
|
19079
|
-
}
|
|
19080
|
-
});
|
|
19081
|
-
const containerRef = vue.ref();
|
|
19082
|
-
const {
|
|
19083
|
-
resizeRef,
|
|
19084
|
-
contentRect
|
|
19085
|
-
} = useResizeObserver();
|
|
19086
|
-
vue.watchEffect(() => {
|
|
19087
|
-
resizeRef.value = containerRef.value;
|
|
19088
|
-
});
|
|
19089
|
-
const display = useDisplay();
|
|
19090
|
-
const sizeMap = new Map();
|
|
19091
|
-
let sizes = createRange(items.value.length).map(() => itemHeight.value);
|
|
19092
|
-
const visibleItems = vue.computed(() => {
|
|
19093
|
-
const height = (contentRect.value?.height ?? display.height.value) - (offset?.value ?? 0);
|
|
19094
|
-
return itemHeight.value ? Math.max(12, Math.ceil(height / itemHeight.value * 1.7 + 1)) : 12;
|
|
19095
|
-
});
|
|
19096
|
-
function handleItemResize(index, height) {
|
|
19097
|
-
itemHeight.value = Math.max(itemHeight.value, height);
|
|
19098
|
-
sizes[index] = height;
|
|
19099
|
-
sizeMap.set(items.value[index], height);
|
|
19100
|
-
}
|
|
19101
|
-
function calculateOffset(index) {
|
|
19102
|
-
return sizes.slice(0, index).reduce((curr, value) => curr + (value || itemHeight.value), 0);
|
|
19103
|
-
}
|
|
19104
|
-
function calculateMidPointIndex(scrollTop) {
|
|
19105
|
-
const end = items.value.length;
|
|
19106
|
-
let middle = 0;
|
|
19107
|
-
let middleOffset = 0;
|
|
19108
|
-
while (middleOffset < scrollTop && middle < end) {
|
|
19109
|
-
middleOffset += sizes[middle++] || itemHeight.value;
|
|
19110
|
-
}
|
|
19111
|
-
return middle - 1;
|
|
19112
|
-
}
|
|
19113
|
-
let lastScrollTop = 0;
|
|
19114
|
-
function handleScroll() {
|
|
19115
|
-
if (!containerRef.value || !contentRect.value) return;
|
|
19116
|
-
const height = contentRect.value.height - 56;
|
|
19117
|
-
const scrollTop = containerRef.value.scrollTop;
|
|
19118
|
-
const direction = scrollTop < lastScrollTop ? UP : DOWN;
|
|
19119
|
-
const midPointIndex = calculateMidPointIndex(scrollTop + height / 2);
|
|
19120
|
-
const buffer = Math.round(visibleItems.value / 3);
|
|
19121
|
-
const firstIndex = midPointIndex - buffer;
|
|
19122
|
-
const lastIndex = first.value + buffer * 2 - 1;
|
|
19123
|
-
if (direction === UP && midPointIndex <= lastIndex) {
|
|
19124
|
-
first.value = clamp(firstIndex, 0, items.value.length);
|
|
19125
|
-
} else if (direction === DOWN && midPointIndex >= lastIndex) {
|
|
19126
|
-
first.value = clamp(firstIndex, 0, items.value.length - visibleItems.value);
|
|
19127
|
-
}
|
|
19128
|
-
lastScrollTop = scrollTop;
|
|
19129
|
-
}
|
|
19130
|
-
function scrollToIndex(index) {
|
|
19131
|
-
if (!containerRef.value) return;
|
|
19132
|
-
const offset = calculateOffset(index);
|
|
19133
|
-
containerRef.value.scrollTop = offset;
|
|
19134
|
-
}
|
|
19135
|
-
const allItems = vue.computed(() => items.value.map((item, index) => ({
|
|
19136
|
-
raw: item,
|
|
19137
|
-
index
|
|
19138
|
-
})));
|
|
19139
|
-
const last = vue.computed(() => Math.min(items.value.length, first.value + visibleItems.value));
|
|
19140
|
-
const computedItems = vue.computed(() => allItems.value.slice(first.value, last.value));
|
|
19141
|
-
const paddingTop = vue.computed(() => calculateOffset(first.value));
|
|
19142
|
-
const paddingBottom = vue.computed(() => calculateOffset(items.value.length) - calculateOffset(last.value));
|
|
19143
|
-
vue.onMounted(() => {
|
|
19144
|
-
if (!itemHeight.value) {
|
|
19145
|
-
// If itemHeight prop is not set, then calculate an estimated height from the average of inital items
|
|
19146
|
-
itemHeight.value = sizes.slice(first.value, last.value).reduce((curr, height) => curr + height, 0) / visibleItems.value;
|
|
19147
|
-
}
|
|
19148
|
-
});
|
|
19149
|
-
vue.watch(() => items.value.length, () => {
|
|
19150
|
-
sizes = createRange(items.value.length).map(() => itemHeight.value);
|
|
19151
|
-
sizeMap.forEach((height, item) => {
|
|
19152
|
-
const index = items.value.indexOf(item);
|
|
19153
|
-
if (index === -1) {
|
|
19154
|
-
sizeMap.delete(item);
|
|
19155
|
-
} else {
|
|
19156
|
-
sizes[index] = height;
|
|
19157
|
-
}
|
|
19158
|
-
});
|
|
19159
|
-
});
|
|
19160
|
-
return {
|
|
19161
|
-
containerRef,
|
|
19162
|
-
computedItems,
|
|
19163
|
-
itemHeight,
|
|
19164
|
-
paddingTop,
|
|
19165
|
-
paddingBottom,
|
|
19166
|
-
scrollToIndex,
|
|
19167
|
-
handleScroll,
|
|
19168
|
-
handleItemResize
|
|
19169
|
-
};
|
|
19170
|
-
}
|
|
19171
|
-
|
|
19172
|
-
// Types
|
|
19173
|
-
|
|
19174
|
-
const makeVVirtualScrollProps = propsFactory({
|
|
19175
|
-
items: {
|
|
19176
|
-
type: Array,
|
|
19177
|
-
default: () => []
|
|
19178
|
-
},
|
|
19179
|
-
...makeVirtualProps(),
|
|
19180
|
-
...makeComponentProps(),
|
|
19181
|
-
...makeDimensionProps()
|
|
19182
|
-
}, 'VVirtualScroll');
|
|
19183
|
-
const VVirtualScroll = genericComponent()({
|
|
19184
|
-
name: 'VVirtualScroll',
|
|
19185
|
-
props: makeVVirtualScrollProps(),
|
|
19186
|
-
setup(props, _ref) {
|
|
19187
|
-
let {
|
|
19188
|
-
slots
|
|
19189
|
-
} = _ref;
|
|
19190
|
-
const {
|
|
19191
|
-
dimensionStyles
|
|
19192
|
-
} = useDimension(props);
|
|
19193
|
-
const {
|
|
19194
|
-
containerRef,
|
|
19195
|
-
handleScroll,
|
|
19196
|
-
handleItemResize,
|
|
19197
|
-
scrollToIndex,
|
|
19198
|
-
paddingTop,
|
|
19199
|
-
paddingBottom,
|
|
19200
|
-
computedItems
|
|
19201
|
-
} = useVirtual(props, vue.toRef(props, 'items'));
|
|
19202
|
-
useRender(() => vue.createVNode("div", {
|
|
19203
|
-
"ref": containerRef,
|
|
19204
|
-
"class": ['v-virtual-scroll', props.class],
|
|
19205
|
-
"onScroll": handleScroll,
|
|
19206
|
-
"style": [dimensionStyles.value, props.style]
|
|
19207
|
-
}, [vue.createVNode("div", {
|
|
19208
|
-
"class": "v-virtual-scroll__container",
|
|
19209
|
-
"style": {
|
|
19210
|
-
paddingTop: convertToUnit(paddingTop.value),
|
|
19211
|
-
paddingBottom: convertToUnit(paddingBottom.value)
|
|
19212
|
-
}
|
|
19213
|
-
}, [computedItems.value.map(item => vue.createVNode(VVirtualScrollItem, {
|
|
19214
|
-
"key": item.index,
|
|
19215
|
-
"dynamicHeight": !props.itemHeight,
|
|
19216
|
-
"onUpdate:height": height => handleItemResize(item.index, height)
|
|
19217
|
-
}, {
|
|
19218
|
-
default: () => [slots.default?.({
|
|
19219
|
-
item: item.raw,
|
|
19220
|
-
index: item.index
|
|
19221
|
-
})]
|
|
19222
|
-
}))])]));
|
|
19223
|
-
return {
|
|
19224
|
-
scrollToIndex
|
|
19225
|
-
};
|
|
19226
|
-
}
|
|
19227
|
-
});
|
|
19228
|
-
|
|
19229
19372
|
// Types
|
|
19230
19373
|
|
|
19231
19374
|
const makeVBottomSheetProps = propsFactory({
|
|
@@ -20344,7 +20487,11 @@
|
|
|
20344
20487
|
column,
|
|
20345
20488
|
row
|
|
20346
20489
|
} = _ref4;
|
|
20347
|
-
|
|
20490
|
+
let key = column.key;
|
|
20491
|
+
if (key == null) {
|
|
20492
|
+
consoleWarn('The header key value must not be null or undefined');
|
|
20493
|
+
key = '';
|
|
20494
|
+
}
|
|
20348
20495
|
for (let i = row; i <= row + (column.rowspan ?? 1) - 1; i++) {
|
|
20349
20496
|
fixedRows[i].push({
|
|
20350
20497
|
...column,
|
|
@@ -21209,19 +21356,21 @@
|
|
|
21209
21356
|
...slots,
|
|
21210
21357
|
item: itemSlotProps => vue.createVNode(VVirtualScrollItem, {
|
|
21211
21358
|
"key": itemSlotProps.item.index,
|
|
21212
|
-
"dynamicHeight": true,
|
|
21213
21359
|
"renderless": true,
|
|
21214
21360
|
"onUpdate:height": height => handleItemResize(itemSlotProps.item.index, height)
|
|
21215
21361
|
}, {
|
|
21216
|
-
default:
|
|
21217
|
-
|
|
21218
|
-
|
|
21219
|
-
|
|
21220
|
-
|
|
21221
|
-
|
|
21222
|
-
|
|
21223
|
-
|
|
21224
|
-
|
|
21362
|
+
default: _ref2 => {
|
|
21363
|
+
let {
|
|
21364
|
+
itemRef
|
|
21365
|
+
} = _ref2;
|
|
21366
|
+
return slots.item?.({
|
|
21367
|
+
...itemSlotProps,
|
|
21368
|
+
itemRef
|
|
21369
|
+
}) ?? vue.createVNode(VDataTableRow, vue.mergeProps(itemSlotProps.props, {
|
|
21370
|
+
"ref": itemRef,
|
|
21371
|
+
"key": itemSlotProps.item.index
|
|
21372
|
+
}), slots);
|
|
21373
|
+
}
|
|
21225
21374
|
})
|
|
21226
21375
|
}), vue.createVNode("tr", {
|
|
21227
21376
|
"style": {
|
|
@@ -23451,7 +23600,7 @@
|
|
|
23451
23600
|
date
|
|
23452
23601
|
};
|
|
23453
23602
|
}
|
|
23454
|
-
const version$1 = "3.3.
|
|
23603
|
+
const version$1 = "3.3.7";
|
|
23455
23604
|
createVuetify$1.version = version$1;
|
|
23456
23605
|
|
|
23457
23606
|
// Vue's inject() can only be used in setup
|
|
@@ -23465,7 +23614,7 @@
|
|
|
23465
23614
|
|
|
23466
23615
|
/* eslint-disable local-rules/sort-imports */
|
|
23467
23616
|
|
|
23468
|
-
const version = "3.3.
|
|
23617
|
+
const version = "3.3.7";
|
|
23469
23618
|
|
|
23470
23619
|
/* eslint-disable local-rules/sort-imports */
|
|
23471
23620
|
|