@vuetify/nightly 3.2.0-dev-20230405.0 → 3.2.0-dev-20230415.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -2
- package/dist/json/attributes.json +24 -8
- package/dist/json/importMap-labs.json +0 -4
- package/dist/json/importMap.json +56 -52
- package/dist/json/tags.json +5 -1
- package/dist/json/web-types.json +83 -47
- package/dist/vuetify-labs.css +2296 -2277
- package/dist/vuetify-labs.d.ts +712 -662
- package/dist/vuetify-labs.esm.js +269 -227
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +268 -226
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +32 -4
- package/dist/vuetify.d.ts +593 -417
- package/dist/vuetify.esm.js +247 -34
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +246 -33
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +319 -293
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.mjs +5 -2
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/index.d.ts +38 -32
- package/lib/components/VCheckbox/index.d.ts +14 -14
- package/lib/components/VChip/VChip.mjs +2 -2
- package/lib/components/VChip/VChip.mjs.map +1 -1
- package/lib/components/VChip/index.d.ts +14 -14
- package/lib/components/VCombobox/VCombobox.mjs +6 -3
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/index.d.ts +38 -32
- package/lib/components/VField/VField.mjs +3 -3
- package/lib/components/VField/VField.mjs.map +1 -1
- package/lib/components/VField/index.d.ts +20 -20
- package/lib/components/VFileInput/VFileInput.mjs +0 -1
- package/lib/components/VFileInput/VFileInput.mjs.map +1 -1
- package/lib/components/VFileInput/index.d.ts +50 -56
- package/lib/components/VImg/VImg.mjs +3 -3
- package/lib/components/VImg/VImg.mjs.map +1 -1
- package/lib/components/VImg/index.d.ts +19 -19
- package/lib/components/VInput/VInput.mjs +2 -2
- package/lib/components/VInput/VInput.mjs.map +1 -1
- package/lib/components/VInput/index.d.ts +14 -14
- package/lib/components/VList/VList.mjs +2 -1
- package/lib/components/VList/VList.mjs.map +1 -1
- package/lib/components/VList/VListItem.css +12 -0
- package/lib/components/VList/VListItem.mjs +2 -2
- package/lib/components/VList/VListItem.mjs.map +1 -1
- package/lib/components/VList/VListItem.sass +5 -0
- package/lib/components/VList/index.d.ts +14 -14
- package/lib/components/VOverlay/useActivator.mjs +1 -0
- package/lib/components/VOverlay/useActivator.mjs.map +1 -1
- package/lib/components/VProgressCircular/VProgressCircular.css +3 -1
- package/lib/components/VProgressCircular/VProgressCircular.sass +3 -1
- package/lib/components/VProgressCircular/_variables.scss +1 -0
- package/lib/components/VProgressLinear/VProgressLinear.css +5 -2
- package/lib/components/VProgressLinear/VProgressLinear.sass +3 -0
- package/lib/components/VProgressLinear/_variables.scss +1 -1
- package/lib/components/VRadioGroup/index.d.ts +14 -14
- package/lib/components/VRangeSlider/index.d.ts +14 -14
- package/lib/components/VSelect/VSelect.mjs +31 -2
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/index.d.ts +38 -32
- package/lib/components/VSlider/index.d.ts +14 -14
- package/lib/components/VSwitch/index.d.ts +14 -14
- package/lib/components/VTextField/VTextField.mjs +2 -2
- package/lib/components/VTextField/VTextField.mjs.map +1 -1
- package/lib/components/VTextField/index.d.ts +83 -77
- package/lib/components/VTextarea/VTextarea.mjs +8 -5
- package/lib/components/VTextarea/VTextarea.mjs.map +1 -1
- package/lib/components/VTextarea/index.d.ts +56 -50
- package/lib/components/VToolbar/VToolbar.css +2 -0
- package/lib/components/VToolbar/VToolbar.sass +2 -0
- package/lib/components/VVirtualScroll/VVirtualScroll.mjs.map +1 -0
- package/lib/components/VVirtualScroll/VVirtualScrollItem.mjs.map +1 -0
- package/lib/components/VVirtualScroll/index.mjs.map +1 -0
- package/lib/components/index.d.ts +576 -403
- package/lib/components/index.mjs +2 -1
- package/lib/components/index.mjs.map +1 -1
- package/lib/composables/proxiedModel.mjs +2 -1
- package/lib/composables/proxiedModel.mjs.map +1 -1
- package/lib/composables/theme.mjs +1 -1
- package/lib/composables/theme.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/index.d.ts +16 -15
- package/lib/labs/VDataTable/VDataTable.mjs +4 -4
- package/lib/labs/VDataTable/VDataTable.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableRows.mjs +5 -7
- package/lib/labs/VDataTable/VDataTableRows.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableServer.mjs +4 -3
- package/lib/labs/VDataTable/VDataTableServer.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableVirtual.mjs +5 -3
- package/lib/labs/VDataTable/VDataTableVirtual.mjs.map +1 -1
- package/lib/labs/VDataTable/index.d.ts +137 -111
- package/lib/labs/components.d.ts +138 -261
- package/lib/labs/components.mjs +0 -1
- package/lib/labs/components.mjs.map +1 -1
- package/lib/util/helpers.mjs +1 -1
- package/lib/util/helpers.mjs.map +1 -1
- package/package.json +2 -2
- package/lib/labs/VVirtualScroll/VVirtualScroll.mjs.map +0 -1
- package/lib/labs/VVirtualScroll/VVirtualScrollItem.mjs.map +0 -1
- package/lib/labs/VVirtualScroll/index.mjs.map +0 -1
- /package/lib/{labs → components}/VVirtualScroll/VVirtualScroll.css +0 -0
- /package/lib/{labs → components}/VVirtualScroll/VVirtualScroll.mjs +0 -0
- /package/lib/{labs → components}/VVirtualScroll/VVirtualScroll.sass +0 -0
- /package/lib/{labs → components}/VVirtualScroll/VVirtualScrollItem.mjs +0 -0
- /package/lib/{labs → components}/VVirtualScroll/index.d.ts +0 -0
- /package/lib/{labs → components}/VVirtualScroll/index.mjs +0 -0
package/dist/vuetify-labs.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Vuetify v3.2.0-dev-
|
|
2
|
+
* Vuetify v3.2.0-dev-20230415.0
|
|
3
3
|
* Forged by John Leider
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { ref, onBeforeUnmount, watch, readonly, reactive, computed, watchEffect, toRefs, capitalize, getCurrentInstance as getCurrentInstance$1, unref, provide, inject as inject$1, onScopeDispose, effectScope, shallowRef, defineComponent as defineComponent$1, camelize, h, onDeactivated, onActivated, onMounted, toRaw, createVNode, TransitionGroup, Transition, mergeProps, onBeforeMount, nextTick, withDirectives, Fragment, resolveDirective, vShow, isRef, toRef, Text, resolveDynamicComponent, cloneVNode, warn, toHandlers, Teleport, createTextVNode, onBeforeUpdate, vModelText,
|
|
7
|
+
import { ref, onBeforeUnmount, watch, readonly, reactive, computed, watchEffect, toRefs, capitalize, getCurrentInstance as getCurrentInstance$1, unref, provide, inject as inject$1, onScopeDispose, effectScope, shallowRef, defineComponent as defineComponent$1, camelize, h, onDeactivated, onActivated, onMounted, toRaw, createVNode, TransitionGroup, Transition, mergeProps, onBeforeMount, nextTick, withDirectives, Fragment, resolveDirective, vShow, isRef, toRef, Text, resolveDynamicComponent, cloneVNode, warn, toHandlers, Teleport, createTextVNode, onBeforeUpdate, vModelText, onUpdated, withModifiers } from 'vue';
|
|
8
8
|
|
|
9
9
|
const IN_BROWSER = typeof window !== 'undefined';
|
|
10
10
|
const SUPPORTS_INTERSECTION = IN_BROWSER && 'IntersectionObserver' in window;
|
|
@@ -339,7 +339,7 @@ function includes(arr, val) {
|
|
|
339
339
|
}
|
|
340
340
|
const onRE = /^on[^a-z]/;
|
|
341
341
|
const isOn = key => onRE.test(key);
|
|
342
|
-
const EventProp = [Function, Array];
|
|
342
|
+
const EventProp = () => [Function, Array];
|
|
343
343
|
function hasEvent(props, name) {
|
|
344
344
|
name = 'on' + capitalize(name);
|
|
345
345
|
return !!(props[name] || props[`${name}Once`] || props[`${name}Capture`] || props[`${name}OnceCapture`] || props[`${name}CaptureOnce`]);
|
|
@@ -1703,7 +1703,7 @@ function createTheme(options) {
|
|
|
1703
1703
|
if (/^on-[a-z]/.test(key)) {
|
|
1704
1704
|
createCssClass(fgLines, `.${key}`, [`color: rgb(var(--v-theme-${key})) !important`]);
|
|
1705
1705
|
} else {
|
|
1706
|
-
createCssClass(bgLines, `.bg-${key}`, [`--v-theme-overlay-multiplier: var(--v-theme-${key}-overlay-multiplier)`, `background: rgb(var(--v-theme-${key})) !important`, `color: rgb(var(--v-theme-on-${key})) !important`]);
|
|
1706
|
+
createCssClass(bgLines, `.bg-${key}`, [`--v-theme-overlay-multiplier: var(--v-theme-${key}-overlay-multiplier)`, `background-color: rgb(var(--v-theme-${key})) !important`, `color: rgb(var(--v-theme-on-${key})) !important`]);
|
|
1707
1707
|
createCssClass(fgLines, `.text-${key}`, [`color: rgb(var(--v-theme-${key})) !important`]);
|
|
1708
1708
|
createCssClass(fgLines, `.border-${key}`, [`--v-border-color: var(--v-theme-${key})`]);
|
|
1709
1709
|
}
|
|
@@ -1841,7 +1841,8 @@ function useProxiedModel(props, prop, defaultValue) {
|
|
|
1841
1841
|
});
|
|
1842
1842
|
const model = computed({
|
|
1843
1843
|
get() {
|
|
1844
|
-
|
|
1844
|
+
const externalValue = props[prop];
|
|
1845
|
+
return transformIn(isControlled.value ? externalValue : internal.value);
|
|
1845
1846
|
},
|
|
1846
1847
|
set(internalValue) {
|
|
1847
1848
|
const newValue = transformOut(internalValue);
|
|
@@ -2715,9 +2716,9 @@ const VImg = genericComponent()({
|
|
|
2715
2716
|
...makeTransitionProps()
|
|
2716
2717
|
},
|
|
2717
2718
|
emits: {
|
|
2718
|
-
loadstart:
|
|
2719
|
-
load:
|
|
2720
|
-
error:
|
|
2719
|
+
loadstart: value => true,
|
|
2720
|
+
load: value => true,
|
|
2721
|
+
error: value => true
|
|
2721
2722
|
},
|
|
2722
2723
|
setup(props, _ref) {
|
|
2723
2724
|
let {
|
|
@@ -5342,9 +5343,9 @@ const makeVFieldProps = propsFactory({
|
|
|
5342
5343
|
default: 'filled',
|
|
5343
5344
|
validator: v => allowedVariants$1.includes(v)
|
|
5344
5345
|
},
|
|
5345
|
-
'onClick:clear': EventProp,
|
|
5346
|
-
'onClick:appendInner': EventProp,
|
|
5347
|
-
'onClick:prependInner': EventProp,
|
|
5346
|
+
'onClick:clear': EventProp(),
|
|
5347
|
+
'onClick:appendInner': EventProp(),
|
|
5348
|
+
'onClick:prependInner': EventProp(),
|
|
5348
5349
|
...makeThemeProps(),
|
|
5349
5350
|
...makeLoaderProps()
|
|
5350
5351
|
}, 'v-field');
|
|
@@ -5890,8 +5891,8 @@ const makeVInputProps = propsFactory({
|
|
|
5890
5891
|
default: 'horizontal',
|
|
5891
5892
|
validator: v => ['horizontal', 'vertical'].includes(v)
|
|
5892
5893
|
},
|
|
5893
|
-
'onClick:prepend': EventProp,
|
|
5894
|
-
'onClick:append': EventProp,
|
|
5894
|
+
'onClick:prepend': EventProp(),
|
|
5895
|
+
'onClick:append': EventProp(),
|
|
5895
5896
|
...makeDensityProps(),
|
|
5896
5897
|
...makeValidationProps()
|
|
5897
5898
|
}, 'v-input');
|
|
@@ -6122,6 +6123,7 @@ const makeVTextFieldProps = propsFactory({
|
|
|
6122
6123
|
type: String,
|
|
6123
6124
|
default: 'text'
|
|
6124
6125
|
},
|
|
6126
|
+
modelModifiers: Object,
|
|
6125
6127
|
...makeVInputProps(),
|
|
6126
6128
|
...makeVFieldProps()
|
|
6127
6129
|
}, 'v-text-field');
|
|
@@ -6196,7 +6198,7 @@ const VTextField = genericComponent()({
|
|
|
6196
6198
|
function onInput(e) {
|
|
6197
6199
|
const el = e.target;
|
|
6198
6200
|
model.value = el.value;
|
|
6199
|
-
if (['text', 'search', 'password', 'tel', 'url'].includes(props.type)) {
|
|
6201
|
+
if (props.modelModifiers?.trim && ['text', 'search', 'password', 'tel', 'url'].includes(props.type)) {
|
|
6200
6202
|
const caretPosition = [el.selectionStart, el.selectionEnd];
|
|
6201
6203
|
nextTick(() => {
|
|
6202
6204
|
el.selectionStart = caretPosition[0];
|
|
@@ -6833,8 +6835,8 @@ const VChip = genericComponent()({
|
|
|
6833
6835
|
type: Boolean,
|
|
6834
6836
|
default: true
|
|
6835
6837
|
},
|
|
6836
|
-
onClick: EventProp,
|
|
6837
|
-
onClickOnce: EventProp,
|
|
6838
|
+
onClick: EventProp(),
|
|
6839
|
+
onClickOnce: EventProp(),
|
|
6838
6840
|
...makeBorderProps(),
|
|
6839
6841
|
...makeDensityProps(),
|
|
6840
6842
|
...makeElevationProps(),
|
|
@@ -7678,8 +7680,8 @@ const VListItem = genericComponent()({
|
|
|
7678
7680
|
subtitle: [String, Number, Boolean],
|
|
7679
7681
|
title: [String, Number, Boolean],
|
|
7680
7682
|
value: null,
|
|
7681
|
-
onClick: EventProp,
|
|
7682
|
-
onClickOnce: EventProp,
|
|
7683
|
+
onClick: EventProp(),
|
|
7684
|
+
onClickOnce: EventProp(),
|
|
7683
7685
|
...makeBorderProps(),
|
|
7684
7686
|
...makeDensityProps(),
|
|
7685
7687
|
...makeDimensionProps(),
|
|
@@ -8221,7 +8223,8 @@ const VList = genericComponent()({
|
|
|
8221
8223
|
}
|
|
8222
8224
|
function focus(location) {
|
|
8223
8225
|
if (!contentRef.value) return;
|
|
8224
|
-
const
|
|
8226
|
+
const targets = ['button', '[href]', 'input', 'select', 'textarea', '[tabindex]'].map(s => `${s}:not([tabindex="-1"])`).join(', ');
|
|
8227
|
+
const focusable = [...contentRef.value.querySelectorAll(targets)].filter(el => !el.hasAttribute('disabled'));
|
|
8225
8228
|
const idx = focusable.indexOf(document.activeElement);
|
|
8226
8229
|
if (!location) {
|
|
8227
8230
|
if (!contentRef.value.contains(document.activeElement)) {
|
|
@@ -8402,6 +8405,7 @@ function useActivator(props, _ref) {
|
|
|
8402
8405
|
isActive.value = !isActive.value;
|
|
8403
8406
|
},
|
|
8404
8407
|
mouseenter: e => {
|
|
8408
|
+
if (e.sourceCapabilities?.firesTouchEvents) return;
|
|
8405
8409
|
isHovered = true;
|
|
8406
8410
|
activatorEl.value = e.currentTarget || e.target;
|
|
8407
8411
|
runOpenDelay();
|
|
@@ -9928,6 +9932,9 @@ const VSelect = genericComponent()({
|
|
|
9928
9932
|
});
|
|
9929
9933
|
});
|
|
9930
9934
|
const selected = computed(() => selections.value.map(selection => selection.props.value));
|
|
9935
|
+
const isFocused = ref(false);
|
|
9936
|
+
let keyboardLookupPrefix = '';
|
|
9937
|
+
let keyboardLookupLastTime;
|
|
9931
9938
|
const displayItems = computed(() => {
|
|
9932
9939
|
if (props.hideSelected) {
|
|
9933
9940
|
return items.value.filter(item => !selections.value.some(s => s === item));
|
|
@@ -9964,6 +9971,26 @@ const VSelect = genericComponent()({
|
|
|
9964
9971
|
} else if (e.key === 'End') {
|
|
9965
9972
|
listRef.value?.focus('last');
|
|
9966
9973
|
}
|
|
9974
|
+
|
|
9975
|
+
// html select hotkeys
|
|
9976
|
+
const KEYBOARD_LOOKUP_THRESHOLD = 1000; // milliseconds
|
|
9977
|
+
|
|
9978
|
+
function checkPrintable(e) {
|
|
9979
|
+
const isPrintableChar = e.key.length === 1;
|
|
9980
|
+
const noModifier = !e.ctrlKey && !e.metaKey && !e.altKey;
|
|
9981
|
+
return isPrintableChar && noModifier;
|
|
9982
|
+
}
|
|
9983
|
+
if (props.multiple || !checkPrintable(e)) return;
|
|
9984
|
+
const now = performance.now();
|
|
9985
|
+
if (now - keyboardLookupLastTime > KEYBOARD_LOOKUP_THRESHOLD) {
|
|
9986
|
+
keyboardLookupPrefix = '';
|
|
9987
|
+
}
|
|
9988
|
+
keyboardLookupPrefix += e.key.toLowerCase();
|
|
9989
|
+
keyboardLookupLastTime = now;
|
|
9990
|
+
const item = items.value.find(item => item.title.toLowerCase().startsWith(keyboardLookupPrefix));
|
|
9991
|
+
if (item !== undefined) {
|
|
9992
|
+
model.value = [item];
|
|
9993
|
+
}
|
|
9967
9994
|
}
|
|
9968
9995
|
function select(item) {
|
|
9969
9996
|
if (props.multiple) {
|
|
@@ -9993,7 +10020,9 @@ const VSelect = genericComponent()({
|
|
|
9993
10020
|
useRender(() => {
|
|
9994
10021
|
const hasChips = !!(props.chips || slots.chip);
|
|
9995
10022
|
const hasList = !!(!props.hideNoData || displayItems.value.length || slots.prepend || slots.append || slots['no-data']);
|
|
10023
|
+
const isDirty = model.value.length > 0;
|
|
9996
10024
|
const [textFieldProps] = VTextField.filterProps(props);
|
|
10025
|
+
const placeholder = isDirty || !isFocused.value && props.label && !props.persistentPlaceholder ? undefined : props.placeholder;
|
|
9997
10026
|
return createVNode(VTextField, mergeProps({
|
|
9998
10027
|
"ref": vTextFieldRef
|
|
9999
10028
|
}, textFieldProps, {
|
|
@@ -10001,8 +10030,10 @@ const VSelect = genericComponent()({
|
|
|
10001
10030
|
"onUpdate:modelValue": v => {
|
|
10002
10031
|
if (v == null) model.value = [];
|
|
10003
10032
|
},
|
|
10033
|
+
"focused": isFocused.value,
|
|
10034
|
+
"onUpdate:focused": $event => isFocused.value = $event,
|
|
10004
10035
|
"validationValue": model.externalValue,
|
|
10005
|
-
"dirty":
|
|
10036
|
+
"dirty": isDirty,
|
|
10006
10037
|
"class": ['v-select', {
|
|
10007
10038
|
'v-select--active-menu': menu.value,
|
|
10008
10039
|
'v-select--chips': !!props.chips,
|
|
@@ -10011,6 +10042,7 @@ const VSelect = genericComponent()({
|
|
|
10011
10042
|
}],
|
|
10012
10043
|
"appendInnerIcon": props.menuIcon,
|
|
10013
10044
|
"readonly": true,
|
|
10045
|
+
"placeholder": placeholder,
|
|
10014
10046
|
"onClick:clear": onClear,
|
|
10015
10047
|
"onMousedown:control": onMousedownControl,
|
|
10016
10048
|
"onBlur": onBlur,
|
|
@@ -10059,7 +10091,8 @@ const VSelect = genericComponent()({
|
|
|
10059
10091
|
} = _ref2;
|
|
10060
10092
|
return props.multiple && !props.hideSelected ? createVNode(VCheckboxBtn, {
|
|
10061
10093
|
"modelValue": isSelected,
|
|
10062
|
-
"ripple": false
|
|
10094
|
+
"ripple": false,
|
|
10095
|
+
"tabindex": "-1"
|
|
10063
10096
|
}, null) : undefined;
|
|
10064
10097
|
}
|
|
10065
10098
|
});
|
|
@@ -10386,6 +10419,7 @@ const VAutocomplete = genericComponent()({
|
|
|
10386
10419
|
useRender(() => {
|
|
10387
10420
|
const hasChips = !!(props.chips || slots.chip);
|
|
10388
10421
|
const hasList = !!(!props.hideNoData || displayItems.value.length || slots.prepend || slots.append || slots['no-data']);
|
|
10422
|
+
const isDirty = model.value.length > 0;
|
|
10389
10423
|
const [textFieldProps] = VTextField.filterProps(props);
|
|
10390
10424
|
return createVNode(VTextField, mergeProps({
|
|
10391
10425
|
"ref": vTextFieldRef
|
|
@@ -10395,7 +10429,7 @@ const VAutocomplete = genericComponent()({
|
|
|
10395
10429
|
if (v == null) model.value = [];
|
|
10396
10430
|
},
|
|
10397
10431
|
"validationValue": model.externalValue,
|
|
10398
|
-
"dirty":
|
|
10432
|
+
"dirty": isDirty,
|
|
10399
10433
|
"onInput": onInput,
|
|
10400
10434
|
"class": ['v-autocomplete', {
|
|
10401
10435
|
'v-autocomplete--active-menu': menu.value,
|
|
@@ -10405,6 +10439,7 @@ const VAutocomplete = genericComponent()({
|
|
|
10405
10439
|
}],
|
|
10406
10440
|
"appendInnerIcon": props.menuIcon,
|
|
10407
10441
|
"readonly": props.readonly,
|
|
10442
|
+
"placeholder": isDirty ? undefined : props.placeholder,
|
|
10408
10443
|
"onClick:clear": onClear,
|
|
10409
10444
|
"onMousedown:control": onMousedownControl,
|
|
10410
10445
|
"onFocus": () => isFocused.value = true,
|
|
@@ -10451,7 +10486,8 @@ const VAutocomplete = genericComponent()({
|
|
|
10451
10486
|
} = _ref2;
|
|
10452
10487
|
return props.multiple && !props.hideSelected ? createVNode(VCheckboxBtn, {
|
|
10453
10488
|
"modelValue": isSelected,
|
|
10454
|
-
"ripple": false
|
|
10489
|
+
"ripple": false,
|
|
10490
|
+
"tabindex": "-1"
|
|
10455
10491
|
}, null) : undefined;
|
|
10456
10492
|
},
|
|
10457
10493
|
title: () => {
|
|
@@ -13567,7 +13603,7 @@ const VCombobox = genericComponent()({
|
|
|
13567
13603
|
textColorClasses,
|
|
13568
13604
|
textColorStyles
|
|
13569
13605
|
} = useTextColor(color);
|
|
13570
|
-
const model = useProxiedModel(props, 'modelValue', [], v => transformIn(wrapInArray(v
|
|
13606
|
+
const model = useProxiedModel(props, 'modelValue', [], v => transformIn(wrapInArray(v)), v => {
|
|
13571
13607
|
const transformed = transformOut(v);
|
|
13572
13608
|
return props.multiple ? transformed : transformed[0] ?? null;
|
|
13573
13609
|
});
|
|
@@ -13745,6 +13781,7 @@ const VCombobox = genericComponent()({
|
|
|
13745
13781
|
useRender(() => {
|
|
13746
13782
|
const hasChips = !!(props.chips || slots.chip);
|
|
13747
13783
|
const hasList = !!(!props.hideNoData || displayItems.value.length || slots.prepend || slots.append || slots['no-data']);
|
|
13784
|
+
const isDirty = model.value.length > 0;
|
|
13748
13785
|
const [textFieldProps] = VTextField.filterProps(props);
|
|
13749
13786
|
return createVNode(VTextField, mergeProps({
|
|
13750
13787
|
"ref": vTextFieldRef
|
|
@@ -13754,7 +13791,7 @@ const VCombobox = genericComponent()({
|
|
|
13754
13791
|
if (v == null) model.value = [];
|
|
13755
13792
|
}],
|
|
13756
13793
|
"validationValue": model.externalValue,
|
|
13757
|
-
"dirty":
|
|
13794
|
+
"dirty": isDirty,
|
|
13758
13795
|
"class": ['v-combobox', {
|
|
13759
13796
|
'v-combobox--active-menu': menu.value,
|
|
13760
13797
|
'v-combobox--chips': !!props.chips,
|
|
@@ -13763,6 +13800,7 @@ const VCombobox = genericComponent()({
|
|
|
13763
13800
|
}],
|
|
13764
13801
|
"appendInnerIcon": props.items.length ? props.menuIcon : undefined,
|
|
13765
13802
|
"readonly": props.readonly,
|
|
13803
|
+
"placeholder": isDirty ? undefined : props.placeholder,
|
|
13766
13804
|
"onClick:clear": onClear,
|
|
13767
13805
|
"onMousedown:control": onMousedownControl,
|
|
13768
13806
|
"onFocus": () => isFocused.value = true,
|
|
@@ -13809,7 +13847,8 @@ const VCombobox = genericComponent()({
|
|
|
13809
13847
|
} = _ref2;
|
|
13810
13848
|
return props.multiple && !props.hideSelected ? createVNode(VCheckboxBtn, {
|
|
13811
13849
|
"modelValue": isSelected,
|
|
13812
|
-
"ripple": false
|
|
13850
|
+
"ripple": false,
|
|
13851
|
+
"tabindex": "-1"
|
|
13813
13852
|
}, null) : undefined;
|
|
13814
13853
|
},
|
|
13815
13854
|
title: () => {
|
|
@@ -14219,7 +14258,6 @@ const VFileInput = genericComponent()({
|
|
|
14219
14258
|
multiple: Boolean,
|
|
14220
14259
|
hint: String,
|
|
14221
14260
|
persistentHint: Boolean,
|
|
14222
|
-
placeholder: String,
|
|
14223
14261
|
showSize: {
|
|
14224
14262
|
type: [Boolean, Number],
|
|
14225
14263
|
default: false,
|
|
@@ -17435,6 +17473,7 @@ const VTextarea = genericComponent()({
|
|
|
17435
17473
|
validator: v => !isNaN(parseFloat(v))
|
|
17436
17474
|
},
|
|
17437
17475
|
suffix: String,
|
|
17476
|
+
modelModifiers: Object,
|
|
17438
17477
|
...makeVInputProps(),
|
|
17439
17478
|
...makeVFieldProps()
|
|
17440
17479
|
},
|
|
@@ -17499,12 +17538,14 @@ const VTextarea = genericComponent()({
|
|
|
17499
17538
|
}
|
|
17500
17539
|
function onInput(e) {
|
|
17501
17540
|
const el = e.target;
|
|
17502
|
-
const caretPosition = [el.selectionStart, el.selectionEnd];
|
|
17503
17541
|
model.value = el.value;
|
|
17504
|
-
|
|
17505
|
-
el.selectionStart
|
|
17506
|
-
|
|
17507
|
-
|
|
17542
|
+
if (props.modelModifiers?.trim) {
|
|
17543
|
+
const caretPosition = [el.selectionStart, el.selectionEnd];
|
|
17544
|
+
nextTick(() => {
|
|
17545
|
+
el.selectionStart = caretPosition[0];
|
|
17546
|
+
el.selectionEnd = caretPosition[1];
|
|
17547
|
+
});
|
|
17548
|
+
}
|
|
17508
17549
|
}
|
|
17509
17550
|
const sizerRef = ref();
|
|
17510
17551
|
function calculateInputHeight() {
|
|
@@ -17993,6 +18034,177 @@ const VValidation = genericComponent()({
|
|
|
17993
18034
|
}
|
|
17994
18035
|
});
|
|
17995
18036
|
|
|
18037
|
+
const VVirtualScrollItem = genericComponent()({
|
|
18038
|
+
name: 'VVirtualScrollItem',
|
|
18039
|
+
props: {
|
|
18040
|
+
dynamicHeight: Boolean
|
|
18041
|
+
},
|
|
18042
|
+
emits: {
|
|
18043
|
+
'update:height': height => true
|
|
18044
|
+
},
|
|
18045
|
+
setup(props, _ref) {
|
|
18046
|
+
let {
|
|
18047
|
+
emit,
|
|
18048
|
+
slots
|
|
18049
|
+
} = _ref;
|
|
18050
|
+
const {
|
|
18051
|
+
resizeRef,
|
|
18052
|
+
contentRect
|
|
18053
|
+
} = useResizeObserver();
|
|
18054
|
+
useToggleScope(() => props.dynamicHeight, () => {
|
|
18055
|
+
watch(() => contentRect.value?.height, height => {
|
|
18056
|
+
if (height != null) emit('update:height', height);
|
|
18057
|
+
});
|
|
18058
|
+
});
|
|
18059
|
+
function updateHeight() {
|
|
18060
|
+
if (props.dynamicHeight && contentRect.value) {
|
|
18061
|
+
emit('update:height', contentRect.value.height);
|
|
18062
|
+
}
|
|
18063
|
+
}
|
|
18064
|
+
onUpdated(updateHeight);
|
|
18065
|
+
useRender(() => createVNode("div", {
|
|
18066
|
+
"ref": props.dynamicHeight ? resizeRef : undefined,
|
|
18067
|
+
"class": "v-virtual-scroll__item"
|
|
18068
|
+
}, [slots.default?.()]));
|
|
18069
|
+
}
|
|
18070
|
+
});
|
|
18071
|
+
|
|
18072
|
+
// Types
|
|
18073
|
+
|
|
18074
|
+
const UP$1 = -1;
|
|
18075
|
+
const DOWN$1 = 1;
|
|
18076
|
+
const VVirtualScroll = genericComponent()({
|
|
18077
|
+
name: 'VVirtualScroll',
|
|
18078
|
+
props: {
|
|
18079
|
+
items: {
|
|
18080
|
+
type: Array,
|
|
18081
|
+
default: () => []
|
|
18082
|
+
},
|
|
18083
|
+
itemHeight: [Number, String],
|
|
18084
|
+
visibleItems: [Number, String],
|
|
18085
|
+
...makeDimensionProps()
|
|
18086
|
+
},
|
|
18087
|
+
setup(props, _ref) {
|
|
18088
|
+
let {
|
|
18089
|
+
slots
|
|
18090
|
+
} = _ref;
|
|
18091
|
+
const first = ref(0);
|
|
18092
|
+
const baseItemHeight = ref(props.itemHeight);
|
|
18093
|
+
const itemHeight = computed({
|
|
18094
|
+
get: () => parseInt(baseItemHeight.value ?? 0, 10),
|
|
18095
|
+
set(val) {
|
|
18096
|
+
baseItemHeight.value = val;
|
|
18097
|
+
}
|
|
18098
|
+
});
|
|
18099
|
+
const rootEl = ref();
|
|
18100
|
+
const {
|
|
18101
|
+
resizeRef,
|
|
18102
|
+
contentRect
|
|
18103
|
+
} = useResizeObserver();
|
|
18104
|
+
watchEffect(() => {
|
|
18105
|
+
resizeRef.value = rootEl.value;
|
|
18106
|
+
});
|
|
18107
|
+
const display = useDisplay();
|
|
18108
|
+
const sizeMap = new Map();
|
|
18109
|
+
let sizes = createRange(props.items.length).map(() => itemHeight.value);
|
|
18110
|
+
const visibleItems = computed(() => {
|
|
18111
|
+
return props.visibleItems ? parseInt(props.visibleItems, 10) : Math.max(12, Math.ceil((contentRect.value?.height ?? display.height.value) / itemHeight.value * 1.7 + 1));
|
|
18112
|
+
});
|
|
18113
|
+
function handleItemResize(index, height) {
|
|
18114
|
+
itemHeight.value = Math.max(itemHeight.value, height);
|
|
18115
|
+
sizes[index] = height;
|
|
18116
|
+
sizeMap.set(props.items[index], height);
|
|
18117
|
+
}
|
|
18118
|
+
function calculateOffset(index) {
|
|
18119
|
+
return sizes.slice(0, index).reduce((curr, value) => curr + (value || itemHeight.value), 0);
|
|
18120
|
+
}
|
|
18121
|
+
function calculateMidPointIndex(scrollTop) {
|
|
18122
|
+
let start = 0;
|
|
18123
|
+
let end = props.items.length;
|
|
18124
|
+
while (start <= end) {
|
|
18125
|
+
const middle = start + Math.floor((end - start) / 2);
|
|
18126
|
+
const middleOffset = calculateOffset(middle);
|
|
18127
|
+
if (middleOffset === scrollTop) {
|
|
18128
|
+
return middle;
|
|
18129
|
+
} else if (middleOffset < scrollTop) {
|
|
18130
|
+
start = middle + 1;
|
|
18131
|
+
} else if (middleOffset > scrollTop) {
|
|
18132
|
+
end = middle - 1;
|
|
18133
|
+
}
|
|
18134
|
+
}
|
|
18135
|
+
return start;
|
|
18136
|
+
}
|
|
18137
|
+
let lastScrollTop = 0;
|
|
18138
|
+
function handleScroll() {
|
|
18139
|
+
if (!rootEl.value || !contentRect.value) return;
|
|
18140
|
+
const height = contentRect.value.height;
|
|
18141
|
+
const scrollTop = rootEl.value.scrollTop;
|
|
18142
|
+
const direction = scrollTop < lastScrollTop ? UP$1 : DOWN$1;
|
|
18143
|
+
const midPointIndex = calculateMidPointIndex(scrollTop + height / 2);
|
|
18144
|
+
const buffer = Math.round(visibleItems.value / 3);
|
|
18145
|
+
if (direction === UP$1 && midPointIndex <= first.value + buffer * 2 - 1) {
|
|
18146
|
+
first.value = clamp(midPointIndex - buffer, 0, props.items.length);
|
|
18147
|
+
} else if (direction === DOWN$1 && midPointIndex >= first.value + buffer * 2 - 1) {
|
|
18148
|
+
first.value = clamp(midPointIndex - buffer, 0, props.items.length - visibleItems.value);
|
|
18149
|
+
}
|
|
18150
|
+
lastScrollTop = rootEl.value.scrollTop;
|
|
18151
|
+
}
|
|
18152
|
+
function scrollToIndex(index) {
|
|
18153
|
+
if (!rootEl.value) return;
|
|
18154
|
+
const offset = calculateOffset(index);
|
|
18155
|
+
rootEl.value.scrollTop = offset;
|
|
18156
|
+
}
|
|
18157
|
+
const last = computed(() => Math.min(props.items.length, first.value + visibleItems.value));
|
|
18158
|
+
const computedItems = computed(() => props.items.slice(first.value, last.value));
|
|
18159
|
+
const paddingTop = computed(() => calculateOffset(first.value));
|
|
18160
|
+
const paddingBottom = computed(() => calculateOffset(props.items.length) - calculateOffset(last.value));
|
|
18161
|
+
const {
|
|
18162
|
+
dimensionStyles
|
|
18163
|
+
} = useDimension(props);
|
|
18164
|
+
onMounted(() => {
|
|
18165
|
+
if (!itemHeight.value) {
|
|
18166
|
+
// If itemHeight prop is not set, then calculate an estimated height from the average of inital items
|
|
18167
|
+
itemHeight.value = sizes.slice(first.value, last.value).reduce((curr, height) => curr + height, 0) / visibleItems.value;
|
|
18168
|
+
}
|
|
18169
|
+
});
|
|
18170
|
+
watch(() => props.items.length, () => {
|
|
18171
|
+
sizes = createRange(props.items.length).map(() => itemHeight.value);
|
|
18172
|
+
sizeMap.forEach((height, item) => {
|
|
18173
|
+
const index = props.items.indexOf(item);
|
|
18174
|
+
if (index === -1) {
|
|
18175
|
+
sizeMap.delete(item);
|
|
18176
|
+
} else {
|
|
18177
|
+
sizes[index] = height;
|
|
18178
|
+
}
|
|
18179
|
+
});
|
|
18180
|
+
});
|
|
18181
|
+
useRender(() => createVNode("div", {
|
|
18182
|
+
"ref": rootEl,
|
|
18183
|
+
"class": "v-virtual-scroll",
|
|
18184
|
+
"onScroll": handleScroll,
|
|
18185
|
+
"style": dimensionStyles.value
|
|
18186
|
+
}, [createVNode("div", {
|
|
18187
|
+
"class": "v-virtual-scroll__container",
|
|
18188
|
+
"style": {
|
|
18189
|
+
paddingTop: convertToUnit(paddingTop.value),
|
|
18190
|
+
paddingBottom: convertToUnit(paddingBottom.value)
|
|
18191
|
+
}
|
|
18192
|
+
}, [computedItems.value.map((item, index) => createVNode(VVirtualScrollItem, {
|
|
18193
|
+
"key": index,
|
|
18194
|
+
"dynamicHeight": !props.itemHeight,
|
|
18195
|
+
"onUpdate:height": height => handleItemResize(index + first.value, height)
|
|
18196
|
+
}, {
|
|
18197
|
+
default: () => [slots.default?.({
|
|
18198
|
+
item,
|
|
18199
|
+
index: index + first.value
|
|
18200
|
+
})]
|
|
18201
|
+
}))])]));
|
|
18202
|
+
return {
|
|
18203
|
+
scrollToIndex
|
|
18204
|
+
};
|
|
18205
|
+
}
|
|
18206
|
+
});
|
|
18207
|
+
|
|
17996
18208
|
const VDataTableColumn = defineFunctionalComponent({
|
|
17997
18209
|
align: {
|
|
17998
18210
|
type: String,
|
|
@@ -18848,10 +19060,8 @@ const VDataTableRows = genericComponent()({
|
|
|
18848
19060
|
type: String,
|
|
18849
19061
|
default: '$vuetify.noDataText'
|
|
18850
19062
|
},
|
|
18851
|
-
rowHeight: Number
|
|
18852
|
-
|
|
18853
|
-
emits: {
|
|
18854
|
-
'click:row': (event, value) => true
|
|
19063
|
+
rowHeight: Number,
|
|
19064
|
+
'onClick:row': Function
|
|
18855
19065
|
},
|
|
18856
19066
|
setup(props, _ref) {
|
|
18857
19067
|
let {
|
|
@@ -18915,14 +19125,14 @@ const VDataTableRows = genericComponent()({
|
|
|
18915
19125
|
};
|
|
18916
19126
|
return createVNode(Fragment, null, [slots.item ? slots.item(slotProps) : createVNode(VDataTableRow, {
|
|
18917
19127
|
"key": `item_${item.value}`,
|
|
18918
|
-
"onClick": event => {
|
|
19128
|
+
"onClick": expandOnClick.value || props['onClick:row'] ? event => {
|
|
18919
19129
|
if (expandOnClick.value) {
|
|
18920
19130
|
toggleExpand(item);
|
|
18921
19131
|
}
|
|
18922
|
-
|
|
19132
|
+
props['onClick:row']?.(event, {
|
|
18923
19133
|
item
|
|
18924
19134
|
});
|
|
18925
|
-
},
|
|
19135
|
+
} : undefined,
|
|
18926
19136
|
"index": index,
|
|
18927
19137
|
"item": item
|
|
18928
19138
|
}, slots), isExpanded(item) && slots['expanded-row']?.(slotProps)]);
|
|
@@ -19233,7 +19443,8 @@ const makeVDataTableProps = propsFactory({
|
|
|
19233
19443
|
height: [String, Number],
|
|
19234
19444
|
width: [String, Number],
|
|
19235
19445
|
fixedHeader: Boolean,
|
|
19236
|
-
fixedFooter: Boolean
|
|
19446
|
+
fixedFooter: Boolean,
|
|
19447
|
+
'onClick:row': Function
|
|
19237
19448
|
}, 'v-data-table');
|
|
19238
19449
|
const VDataTable = genericComponent()({
|
|
19239
19450
|
name: 'VDataTable',
|
|
@@ -19254,8 +19465,7 @@ const VDataTable = genericComponent()({
|
|
|
19254
19465
|
'update:sortBy': value => true,
|
|
19255
19466
|
'update:options': value => true,
|
|
19256
19467
|
'update:groupBy': value => true,
|
|
19257
|
-
'update:expanded': value => true
|
|
19258
|
-
'click:row': (event, value) => true
|
|
19468
|
+
'update:expanded': value => true
|
|
19259
19469
|
},
|
|
19260
19470
|
setup(props, _ref) {
|
|
19261
19471
|
let {
|
|
@@ -19361,7 +19571,7 @@ const VDataTable = genericComponent()({
|
|
|
19361
19571
|
"multiSort": props.multiSort
|
|
19362
19572
|
}, slots)]), slots.thead?.(), createVNode("tbody", null, [slots.body ? slots.body() : createVNode(VDataTableRows, {
|
|
19363
19573
|
"items": paginatedItems.value,
|
|
19364
|
-
"onClick:row":
|
|
19574
|
+
"onClick:row": props['onClick:row']
|
|
19365
19575
|
}, slots)]), slots.tbody?.(), slots.tfoot?.()])),
|
|
19366
19576
|
bottom: slots.bottom ?? (() => createVNode(VDataTableFooter, null, {
|
|
19367
19577
|
prepend: slots['footer.prepend']
|
|
@@ -19385,8 +19595,8 @@ const makeDataTableVirtualProps = propsFactory({
|
|
|
19385
19595
|
default: 52
|
|
19386
19596
|
}
|
|
19387
19597
|
}, 'virtual');
|
|
19388
|
-
const UP
|
|
19389
|
-
const DOWN
|
|
19598
|
+
const UP = -1;
|
|
19599
|
+
const DOWN = 1;
|
|
19390
19600
|
|
|
19391
19601
|
// TODO: Replace this with composable from v-virtual-scroll
|
|
19392
19602
|
function useVirtual(props, items) {
|
|
@@ -19424,12 +19634,12 @@ function useVirtual(props, items) {
|
|
|
19424
19634
|
isScrolling.value = false;
|
|
19425
19635
|
}, 100);
|
|
19426
19636
|
const scrollTop = containerRef.value.scrollTop;
|
|
19427
|
-
const direction = scrollTop < lastScrollTop ? UP
|
|
19637
|
+
const direction = scrollTop < lastScrollTop ? UP : DOWN;
|
|
19428
19638
|
const midPointIndex = calculateMidPointIndex(scrollTop);
|
|
19429
19639
|
const buffer = Math.round(visibleItems.value / 3);
|
|
19430
|
-
if (direction === UP
|
|
19640
|
+
if (direction === UP && midPointIndex <= startIndex.value) {
|
|
19431
19641
|
startIndex.value = Math.max(midPointIndex - buffer, 0);
|
|
19432
|
-
} else if (direction === DOWN
|
|
19642
|
+
} else if (direction === DOWN && midPointIndex >= startIndex.value + buffer * 2) {
|
|
19433
19643
|
startIndex.value = Math.min(Math.max(0, midPointIndex - buffer), items.value.length - visibleItems.value);
|
|
19434
19644
|
}
|
|
19435
19645
|
lastScrollTop = containerRef.value.scrollTop;
|
|
@@ -19472,7 +19682,7 @@ const VDataTableVirtual = genericComponent()({
|
|
|
19472
19682
|
'update:options': value => true,
|
|
19473
19683
|
'update:groupBy': value => true,
|
|
19474
19684
|
'update:expanded': value => true,
|
|
19475
|
-
'click:row': (
|
|
19685
|
+
'click:row': (e, value) => true
|
|
19476
19686
|
},
|
|
19477
19687
|
setup(props, _ref) {
|
|
19478
19688
|
let {
|
|
@@ -19556,8 +19766,10 @@ const VDataTableVirtual = genericComponent()({
|
|
|
19556
19766
|
"style": {
|
|
19557
19767
|
'--v-table-row-height': convertToUnit(itemHeight.value)
|
|
19558
19768
|
},
|
|
19769
|
+
"fixedHeader": props.fixedHeader,
|
|
19770
|
+
"fixedFooter": props.fixedFooter,
|
|
19559
19771
|
"height": props.height,
|
|
19560
|
-
"
|
|
19772
|
+
"hover": props.hover
|
|
19561
19773
|
}, {
|
|
19562
19774
|
top: slots.top,
|
|
19563
19775
|
wrapper: () => createVNode("div", {
|
|
@@ -19583,7 +19795,7 @@ const VDataTableVirtual = genericComponent()({
|
|
|
19583
19795
|
}
|
|
19584
19796
|
}, null)]), createVNode(VDataTableRows, {
|
|
19585
19797
|
"items": visibleItems.value,
|
|
19586
|
-
"onClick:row":
|
|
19798
|
+
"onClick:row": props['onClick:row']
|
|
19587
19799
|
}, slots), createVNode("tr", {
|
|
19588
19800
|
"style": {
|
|
19589
19801
|
height: convertToUnit(paddingBottom.value),
|
|
@@ -19633,7 +19845,7 @@ const VDataTableServer = genericComponent()({
|
|
|
19633
19845
|
'update:options': options => true,
|
|
19634
19846
|
'update:expanded': options => true,
|
|
19635
19847
|
'update:groupBy': value => true,
|
|
19636
|
-
'click:row': (
|
|
19848
|
+
'click:row': (e, value) => true
|
|
19637
19849
|
},
|
|
19638
19850
|
setup(props, _ref) {
|
|
19639
19851
|
let {
|
|
@@ -19711,7 +19923,8 @@ const VDataTableServer = genericComponent()({
|
|
|
19711
19923
|
}],
|
|
19712
19924
|
"fixedHeader": props.fixedHeader,
|
|
19713
19925
|
"fixedFooter": props.fixedFooter,
|
|
19714
|
-
"height": props.height
|
|
19926
|
+
"height": props.height,
|
|
19927
|
+
"hover": props.hover
|
|
19715
19928
|
}, {
|
|
19716
19929
|
top: slots.top,
|
|
19717
19930
|
default: slots.default ?? (() => createVNode(Fragment, null, [slots.colgroup?.({
|
|
@@ -19728,7 +19941,7 @@ const VDataTableServer = genericComponent()({
|
|
|
19728
19941
|
"role": "rowgroup"
|
|
19729
19942
|
}, [slots.body ? slots.body() : createVNode(VDataTableRows, {
|
|
19730
19943
|
"items": flatItems.value,
|
|
19731
|
-
"onClick:row":
|
|
19944
|
+
"onClick:row": props['onClick:row']
|
|
19732
19945
|
}, slots)]), slots.tbody?.(), slots.tfoot?.()])),
|
|
19733
19946
|
bottom: slots.bottom ?? (() => createVNode(VDataTableFooter, null, {
|
|
19734
19947
|
prepend: slots['footer.prepend']
|
|
@@ -19868,177 +20081,6 @@ const VSkeletonLoader = genericComponent()({
|
|
|
19868
20081
|
}
|
|
19869
20082
|
});
|
|
19870
20083
|
|
|
19871
|
-
const VVirtualScrollItem = genericComponent()({
|
|
19872
|
-
name: 'VVirtualScrollItem',
|
|
19873
|
-
props: {
|
|
19874
|
-
dynamicHeight: Boolean
|
|
19875
|
-
},
|
|
19876
|
-
emits: {
|
|
19877
|
-
'update:height': height => true
|
|
19878
|
-
},
|
|
19879
|
-
setup(props, _ref) {
|
|
19880
|
-
let {
|
|
19881
|
-
emit,
|
|
19882
|
-
slots
|
|
19883
|
-
} = _ref;
|
|
19884
|
-
const {
|
|
19885
|
-
resizeRef,
|
|
19886
|
-
contentRect
|
|
19887
|
-
} = useResizeObserver();
|
|
19888
|
-
useToggleScope(() => props.dynamicHeight, () => {
|
|
19889
|
-
watch(() => contentRect.value?.height, height => {
|
|
19890
|
-
if (height != null) emit('update:height', height);
|
|
19891
|
-
});
|
|
19892
|
-
});
|
|
19893
|
-
function updateHeight() {
|
|
19894
|
-
if (props.dynamicHeight && contentRect.value) {
|
|
19895
|
-
emit('update:height', contentRect.value.height);
|
|
19896
|
-
}
|
|
19897
|
-
}
|
|
19898
|
-
onUpdated(updateHeight);
|
|
19899
|
-
useRender(() => createVNode("div", {
|
|
19900
|
-
"ref": props.dynamicHeight ? resizeRef : undefined,
|
|
19901
|
-
"class": "v-virtual-scroll__item"
|
|
19902
|
-
}, [slots.default?.()]));
|
|
19903
|
-
}
|
|
19904
|
-
});
|
|
19905
|
-
|
|
19906
|
-
// Types
|
|
19907
|
-
|
|
19908
|
-
const UP = -1;
|
|
19909
|
-
const DOWN = 1;
|
|
19910
|
-
const VVirtualScroll = genericComponent()({
|
|
19911
|
-
name: 'VVirtualScroll',
|
|
19912
|
-
props: {
|
|
19913
|
-
items: {
|
|
19914
|
-
type: Array,
|
|
19915
|
-
default: () => []
|
|
19916
|
-
},
|
|
19917
|
-
itemHeight: [Number, String],
|
|
19918
|
-
visibleItems: [Number, String],
|
|
19919
|
-
...makeDimensionProps()
|
|
19920
|
-
},
|
|
19921
|
-
setup(props, _ref) {
|
|
19922
|
-
let {
|
|
19923
|
-
slots
|
|
19924
|
-
} = _ref;
|
|
19925
|
-
const first = ref(0);
|
|
19926
|
-
const baseItemHeight = ref(props.itemHeight);
|
|
19927
|
-
const itemHeight = computed({
|
|
19928
|
-
get: () => parseInt(baseItemHeight.value ?? 0, 10),
|
|
19929
|
-
set(val) {
|
|
19930
|
-
baseItemHeight.value = val;
|
|
19931
|
-
}
|
|
19932
|
-
});
|
|
19933
|
-
const rootEl = ref();
|
|
19934
|
-
const {
|
|
19935
|
-
resizeRef,
|
|
19936
|
-
contentRect
|
|
19937
|
-
} = useResizeObserver();
|
|
19938
|
-
watchEffect(() => {
|
|
19939
|
-
resizeRef.value = rootEl.value;
|
|
19940
|
-
});
|
|
19941
|
-
const display = useDisplay();
|
|
19942
|
-
const sizeMap = new Map();
|
|
19943
|
-
let sizes = createRange(props.items.length).map(() => itemHeight.value);
|
|
19944
|
-
const visibleItems = computed(() => {
|
|
19945
|
-
return props.visibleItems ? parseInt(props.visibleItems, 10) : Math.max(12, Math.ceil((contentRect.value?.height ?? display.height.value) / itemHeight.value * 1.7 + 1));
|
|
19946
|
-
});
|
|
19947
|
-
function handleItemResize(index, height) {
|
|
19948
|
-
itemHeight.value = Math.max(itemHeight.value, height);
|
|
19949
|
-
sizes[index] = height;
|
|
19950
|
-
sizeMap.set(props.items[index], height);
|
|
19951
|
-
}
|
|
19952
|
-
function calculateOffset(index) {
|
|
19953
|
-
return sizes.slice(0, index).reduce((curr, value) => curr + (value || itemHeight.value), 0);
|
|
19954
|
-
}
|
|
19955
|
-
function calculateMidPointIndex(scrollTop) {
|
|
19956
|
-
let start = 0;
|
|
19957
|
-
let end = props.items.length;
|
|
19958
|
-
while (start <= end) {
|
|
19959
|
-
const middle = start + Math.floor((end - start) / 2);
|
|
19960
|
-
const middleOffset = calculateOffset(middle);
|
|
19961
|
-
if (middleOffset === scrollTop) {
|
|
19962
|
-
return middle;
|
|
19963
|
-
} else if (middleOffset < scrollTop) {
|
|
19964
|
-
start = middle + 1;
|
|
19965
|
-
} else if (middleOffset > scrollTop) {
|
|
19966
|
-
end = middle - 1;
|
|
19967
|
-
}
|
|
19968
|
-
}
|
|
19969
|
-
return start;
|
|
19970
|
-
}
|
|
19971
|
-
let lastScrollTop = 0;
|
|
19972
|
-
function handleScroll() {
|
|
19973
|
-
if (!rootEl.value || !contentRect.value) return;
|
|
19974
|
-
const height = contentRect.value.height;
|
|
19975
|
-
const scrollTop = rootEl.value.scrollTop;
|
|
19976
|
-
const direction = scrollTop < lastScrollTop ? UP : DOWN;
|
|
19977
|
-
const midPointIndex = calculateMidPointIndex(scrollTop + height / 2);
|
|
19978
|
-
const buffer = Math.round(visibleItems.value / 3);
|
|
19979
|
-
if (direction === UP && midPointIndex <= first.value + buffer * 2 - 1) {
|
|
19980
|
-
first.value = clamp(midPointIndex - buffer, 0, props.items.length);
|
|
19981
|
-
} else if (direction === DOWN && midPointIndex >= first.value + buffer * 2 - 1) {
|
|
19982
|
-
first.value = clamp(midPointIndex - buffer, 0, props.items.length - visibleItems.value);
|
|
19983
|
-
}
|
|
19984
|
-
lastScrollTop = rootEl.value.scrollTop;
|
|
19985
|
-
}
|
|
19986
|
-
function scrollToIndex(index) {
|
|
19987
|
-
if (!rootEl.value) return;
|
|
19988
|
-
const offset = calculateOffset(index);
|
|
19989
|
-
rootEl.value.scrollTop = offset;
|
|
19990
|
-
}
|
|
19991
|
-
const last = computed(() => Math.min(props.items.length, first.value + visibleItems.value));
|
|
19992
|
-
const computedItems = computed(() => props.items.slice(first.value, last.value));
|
|
19993
|
-
const paddingTop = computed(() => calculateOffset(first.value));
|
|
19994
|
-
const paddingBottom = computed(() => calculateOffset(props.items.length) - calculateOffset(last.value));
|
|
19995
|
-
const {
|
|
19996
|
-
dimensionStyles
|
|
19997
|
-
} = useDimension(props);
|
|
19998
|
-
onMounted(() => {
|
|
19999
|
-
if (!itemHeight.value) {
|
|
20000
|
-
// If itemHeight prop is not set, then calculate an estimated height from the average of inital items
|
|
20001
|
-
itemHeight.value = sizes.slice(first.value, last.value).reduce((curr, height) => curr + height, 0) / visibleItems.value;
|
|
20002
|
-
}
|
|
20003
|
-
});
|
|
20004
|
-
watch(() => props.items.length, () => {
|
|
20005
|
-
sizes = createRange(props.items.length).map(() => itemHeight.value);
|
|
20006
|
-
sizeMap.forEach((height, item) => {
|
|
20007
|
-
const index = props.items.indexOf(item);
|
|
20008
|
-
if (index === -1) {
|
|
20009
|
-
sizeMap.delete(item);
|
|
20010
|
-
} else {
|
|
20011
|
-
sizes[index] = height;
|
|
20012
|
-
}
|
|
20013
|
-
});
|
|
20014
|
-
});
|
|
20015
|
-
useRender(() => createVNode("div", {
|
|
20016
|
-
"ref": rootEl,
|
|
20017
|
-
"class": "v-virtual-scroll",
|
|
20018
|
-
"onScroll": handleScroll,
|
|
20019
|
-
"style": dimensionStyles.value
|
|
20020
|
-
}, [createVNode("div", {
|
|
20021
|
-
"class": "v-virtual-scroll__container",
|
|
20022
|
-
"style": {
|
|
20023
|
-
paddingTop: convertToUnit(paddingTop.value),
|
|
20024
|
-
paddingBottom: convertToUnit(paddingBottom.value)
|
|
20025
|
-
}
|
|
20026
|
-
}, [computedItems.value.map((item, index) => createVNode(VVirtualScrollItem, {
|
|
20027
|
-
"key": index,
|
|
20028
|
-
"dynamicHeight": !props.itemHeight,
|
|
20029
|
-
"onUpdate:height": height => handleItemResize(index + first.value, height)
|
|
20030
|
-
}, {
|
|
20031
|
-
default: () => [slots.default?.({
|
|
20032
|
-
item,
|
|
20033
|
-
index: index + first.value
|
|
20034
|
-
})]
|
|
20035
|
-
}))])]));
|
|
20036
|
-
return {
|
|
20037
|
-
scrollToIndex
|
|
20038
|
-
};
|
|
20039
|
-
}
|
|
20040
|
-
});
|
|
20041
|
-
|
|
20042
20084
|
var components = /*#__PURE__*/Object.freeze({
|
|
20043
20085
|
__proto__: null,
|
|
20044
20086
|
VAlert: VAlert,
|
|
@@ -20391,7 +20433,7 @@ function createVuetify$1() {
|
|
|
20391
20433
|
locale
|
|
20392
20434
|
};
|
|
20393
20435
|
}
|
|
20394
|
-
const version$1 = "3.2.0-dev-
|
|
20436
|
+
const version$1 = "3.2.0-dev-20230415.0";
|
|
20395
20437
|
createVuetify$1.version = version$1;
|
|
20396
20438
|
|
|
20397
20439
|
// Vue's inject() can only be used in setup
|
|
@@ -20403,7 +20445,7 @@ function inject(key) {
|
|
|
20403
20445
|
}
|
|
20404
20446
|
}
|
|
20405
20447
|
|
|
20406
|
-
const version = "3.2.0-dev-
|
|
20448
|
+
const version = "3.2.0-dev-20230415.0";
|
|
20407
20449
|
|
|
20408
20450
|
const createVuetify = function () {
|
|
20409
20451
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|