vuetify 3.3.15 → 3.3.17
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 +1415 -1399
- package/dist/json/tags.json +10 -6
- package/dist/json/web-types.json +2261 -2200
- package/dist/vuetify-labs.css +201 -162
- package/dist/vuetify-labs.d.ts +704 -602
- package/dist/vuetify-labs.esm.js +211 -192
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +211 -192
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +25 -22
- package/dist/vuetify.d.ts +99 -81
- package/dist/vuetify.esm.js +144 -154
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +144 -154
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +233 -231
- package/dist/vuetify.min.js.map +1 -1
- package/lib/blueprints/index.d.mts +2 -0
- package/lib/blueprints/md1.d.mts +2 -0
- package/lib/blueprints/md2.d.mts +2 -0
- package/lib/blueprints/md3.d.mts +2 -0
- package/lib/blueprints/md3.mjs +3 -0
- package/lib/blueprints/md3.mjs.map +1 -1
- package/lib/components/VApp/VApp.mjs +1 -2
- package/lib/components/VApp/VApp.mjs.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.mjs +16 -26
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/index.d.mts +40 -38
- package/lib/components/VColorPicker/VColorPickerCanvas.css +1 -0
- package/lib/components/VColorPicker/VColorPickerCanvas.mjs +28 -34
- package/lib/components/VColorPicker/VColorPickerCanvas.mjs.map +1 -1
- package/lib/components/VColorPicker/VColorPickerCanvas.sass +1 -0
- package/lib/components/VCombobox/VCombobox.mjs +15 -25
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/index.d.mts +40 -38
- package/lib/components/VField/VField.css +3 -2
- package/lib/components/VField/VField.sass +3 -2
- package/lib/components/VLabel/VLabel.css +1 -0
- package/lib/components/VLabel/VLabel.sass +1 -0
- package/lib/components/VLabel/_variables.scss +1 -1
- package/lib/components/VList/index.d.mts +21 -3
- package/lib/components/VRangeSlider/VRangeSlider.mjs +2 -2
- package/lib/components/VRangeSlider/VRangeSlider.mjs.map +1 -1
- package/lib/components/VSelect/VSelect.mjs +9 -23
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/index.d.mts +14 -11
- package/lib/components/VSelectionControl/VSelectionControl.css +0 -1
- package/lib/components/VSelectionControl/VSelectionControl.sass +0 -1
- package/lib/components/VSlider/VSlider.mjs +2 -2
- package/lib/components/VSlider/VSlider.mjs.map +1 -1
- package/lib/components/VTabs/VTab.css +1 -0
- package/lib/components/VTabs/VTab.mjs +2 -3
- package/lib/components/VTabs/VTab.mjs.map +1 -1
- package/lib/components/VTabs/VTab.sass +1 -0
- package/lib/components/VTabs/VTabs.mjs +4 -4
- package/lib/components/VTabs/VTabs.mjs.map +1 -1
- package/lib/components/VTabs/_variables.scss +1 -0
- package/lib/components/VTabs/index.d.mts +1 -1
- package/lib/components/index.d.mts +97 -81
- package/lib/composables/color.mjs +7 -4
- package/lib/composables/color.mjs.map +1 -1
- package/lib/composables/filter.mjs +4 -4
- package/lib/composables/filter.mjs.map +1 -1
- package/lib/composables/layout.mjs +1 -1
- package/lib/composables/layout.mjs.map +1 -1
- package/lib/composables/list-items.mjs +26 -15
- package/lib/composables/list-items.mjs.map +1 -1
- package/lib/composables/theme.mjs +0 -11
- 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.mts +2 -0
- package/lib/labs/VBottomSheet/VBottomSheet.css +1 -0
- package/lib/labs/VBottomSheet/VBottomSheet.mjs +1 -1
- package/lib/labs/VBottomSheet/VBottomSheet.mjs.map +1 -1
- package/lib/labs/VBottomSheet/VBottomSheet.sass +2 -0
- package/lib/labs/VBottomSheet/_variables.scss +1 -0
- package/lib/labs/VBottomSheet/index.d.mts +3 -11
- package/lib/labs/VDataIterator/index.d.mts +30 -26
- package/lib/labs/VDataTable/composables/select.mjs +1 -1
- package/lib/labs/VDataTable/composables/select.mjs.map +1 -1
- package/lib/labs/VDataTable/index.d.mts +43 -39
- package/lib/labs/VDataTable/types.mjs.map +1 -1
- package/lib/labs/VDatePicker/VDatePicker.mjs +20 -8
- package/lib/labs/VDatePicker/VDatePicker.mjs.map +1 -1
- package/lib/labs/VDatePicker/VDatePickerControls.css +29 -2
- package/lib/labs/VDatePicker/VDatePickerControls.mjs +22 -21
- package/lib/labs/VDatePicker/VDatePickerControls.mjs.map +1 -1
- package/lib/labs/VDatePicker/VDatePickerControls.sass +30 -2
- package/lib/labs/VDatePicker/VDatePickerHeader.css +10 -1
- package/lib/labs/VDatePicker/VDatePickerHeader.mjs +12 -4
- package/lib/labs/VDatePicker/VDatePickerHeader.mjs.map +1 -1
- package/lib/labs/VDatePicker/VDatePickerHeader.sass +11 -1
- package/lib/labs/VDatePicker/VDatePickerMonth.mjs +1 -2
- package/lib/labs/VDatePicker/VDatePickerMonth.mjs.map +1 -1
- package/lib/labs/VDatePicker/VDatePickerYears.css +1 -1
- package/lib/labs/VDatePicker/VDatePickerYears.mjs +1 -1
- package/lib/labs/VDatePicker/VDatePickerYears.mjs.map +1 -1
- package/lib/labs/VDatePicker/VDatePickerYears.sass +1 -1
- package/lib/labs/VDatePicker/index.d.mts +208 -125
- package/lib/labs/VDateRangePicker/index.d.mts +75 -69
- package/lib/labs/VPicker/VPicker.css +0 -1
- package/lib/labs/VPicker/VPicker.mjs +16 -5
- package/lib/labs/VPicker/VPicker.mjs.map +1 -1
- package/lib/labs/VPicker/VPicker.sass +1 -1
- package/lib/labs/VPicker/index.d.mts +47 -35
- package/lib/labs/components.d.mts +1580 -1492
- package/lib/labs/date/DateAdapter.mjs.map +1 -1
- package/lib/labs/date/adapters/vuetify.d.mts +4 -0
- package/lib/labs/date/adapters/vuetify.mjs +18 -0
- package/lib/labs/date/adapters/vuetify.mjs.map +1 -1
- package/lib/labs/date/index.d.mts +4 -0
- package/lib/locale/pl.mjs +14 -14
- package/lib/locale/pl.mjs.map +1 -1
- package/lib/util/colorUtils.mjs +11 -0
- package/lib/util/colorUtils.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.17
|
|
3
3
|
* Forged by John Leider
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -1117,6 +1117,17 @@
|
|
|
1117
1117
|
function getForeground(color) {
|
|
1118
1118
|
const blackContrast = Math.abs(APCAcontrast(parseColor(0), parseColor(color)));
|
|
1119
1119
|
const whiteContrast = Math.abs(APCAcontrast(parseColor(0xffffff), parseColor(color)));
|
|
1120
|
+
|
|
1121
|
+
// TODO: warn about poor color selections
|
|
1122
|
+
// const contrastAsText = Math.abs(APCAcontrast(colorVal, colorToInt(theme.colors.background)))
|
|
1123
|
+
// const minContrast = Math.max(blackContrast, whiteContrast)
|
|
1124
|
+
// if (minContrast < 60) {
|
|
1125
|
+
// consoleInfo(`${key} theme color ${color} has poor contrast (${minContrast.toFixed()}%)`)
|
|
1126
|
+
// } else if (contrastAsText < 60 && !['background', 'surface'].includes(color)) {
|
|
1127
|
+
// consoleInfo(`${key} theme color ${color} has poor contrast as text (${contrastAsText.toFixed()}%)`)
|
|
1128
|
+
// }
|
|
1129
|
+
|
|
1130
|
+
// Prefer white text if both have an acceptable contrast ratio
|
|
1120
1131
|
return whiteContrast > Math.min(blackContrast, 50) ? '#fff' : '#000';
|
|
1121
1132
|
}
|
|
1122
1133
|
|
|
@@ -1714,7 +1725,7 @@
|
|
|
1714
1725
|
'v-layout--full-height': props.fullHeight
|
|
1715
1726
|
}]);
|
|
1716
1727
|
const layoutStyles = vue.computed(() => ({
|
|
1717
|
-
zIndex: rootZIndex.value,
|
|
1728
|
+
zIndex: parentLayout ? rootZIndex.value : undefined,
|
|
1718
1729
|
position: parentLayout ? 'relative' : undefined,
|
|
1719
1730
|
overflow: parentLayout ? 'hidden' : undefined
|
|
1720
1731
|
}));
|
|
@@ -2235,17 +2246,6 @@
|
|
|
2235
2246
|
if (/^on-[a-z]/.test(color) || theme.colors[`on-${color}`]) continue;
|
|
2236
2247
|
const onColor = `on-${color}`;
|
|
2237
2248
|
const colorVal = parseColor(theme.colors[color]);
|
|
2238
|
-
|
|
2239
|
-
// TODO: warn about poor color selections
|
|
2240
|
-
// const contrastAsText = Math.abs(APCAcontrast(colorVal, colorToInt(theme.colors.background)))
|
|
2241
|
-
// const minContrast = Math.max(blackContrast, whiteContrast)
|
|
2242
|
-
// if (minContrast < 60) {
|
|
2243
|
-
// consoleInfo(`${key} theme color ${color} has poor contrast (${minContrast.toFixed()}%)`)
|
|
2244
|
-
// } else if (contrastAsText < 60 && !['background', 'surface'].includes(color)) {
|
|
2245
|
-
// consoleInfo(`${key} theme color ${color} has poor contrast as text (${contrastAsText.toFixed()}%)`)
|
|
2246
|
-
// }
|
|
2247
|
-
|
|
2248
|
-
// Prefer white text if both have an acceptable contrast ratio
|
|
2249
2249
|
theme.colors[onColor] = getForeground(colorVal);
|
|
2250
2250
|
}
|
|
2251
2251
|
}
|
|
@@ -2405,7 +2405,6 @@
|
|
|
2405
2405
|
const theme = provideTheme(props);
|
|
2406
2406
|
const {
|
|
2407
2407
|
layoutClasses,
|
|
2408
|
-
layoutStyles,
|
|
2409
2408
|
getLayoutItem,
|
|
2410
2409
|
items,
|
|
2411
2410
|
layoutRef
|
|
@@ -2416,7 +2415,7 @@
|
|
|
2416
2415
|
useRender(() => vue.createVNode("div", {
|
|
2417
2416
|
"ref": layoutRef,
|
|
2418
2417
|
"class": ['v-application', theme.themeClasses.value, layoutClasses.value, rtlClasses.value, props.class],
|
|
2419
|
-
"style": [
|
|
2418
|
+
"style": [props.style]
|
|
2420
2419
|
}, [vue.createVNode("div", {
|
|
2421
2420
|
"class": "v-application__wrap"
|
|
2422
2421
|
}, [slots.default?.()])]));
|
|
@@ -3278,9 +3277,12 @@
|
|
|
3278
3277
|
if (isCssColor(colors.value.background)) {
|
|
3279
3278
|
styles.backgroundColor = colors.value.background;
|
|
3280
3279
|
if (!colors.value.text) {
|
|
3281
|
-
const
|
|
3282
|
-
|
|
3283
|
-
|
|
3280
|
+
const backgroundColor = parseColor(colors.value.background);
|
|
3281
|
+
if (backgroundColor.a == null || backgroundColor.a === 1) {
|
|
3282
|
+
const textColor = getForeground(backgroundColor);
|
|
3283
|
+
styles.color = textColor;
|
|
3284
|
+
styles.caretColor = textColor;
|
|
3285
|
+
}
|
|
3284
3286
|
}
|
|
3285
3287
|
} else {
|
|
3286
3288
|
classes.push(`bg-${colors.value.background}`);
|
|
@@ -7985,11 +7987,15 @@
|
|
|
7985
7987
|
type: [Boolean, String, Array, Function],
|
|
7986
7988
|
default: 'props'
|
|
7987
7989
|
},
|
|
7988
|
-
returnObject: Boolean
|
|
7990
|
+
returnObject: Boolean,
|
|
7991
|
+
valueComparator: {
|
|
7992
|
+
type: Function,
|
|
7993
|
+
default: deepEqual
|
|
7994
|
+
}
|
|
7989
7995
|
}, 'list-items');
|
|
7990
7996
|
function transformItem$3(props, item) {
|
|
7991
7997
|
const title = getPropertyFromItem(item, props.itemTitle, item);
|
|
7992
|
-
const value =
|
|
7998
|
+
const value = getPropertyFromItem(item, props.itemValue, title);
|
|
7993
7999
|
const children = getPropertyFromItem(item, props.itemChildren);
|
|
7994
8000
|
const itemProps = props.itemProps === true ? typeof item === 'object' && item != null && !Array.isArray(item) ? 'children' in item ? pick(item, ['children'])[1] : item : undefined : getPropertyFromItem(item, props.itemProps);
|
|
7995
8001
|
const _props = {
|
|
@@ -8014,25 +8020,32 @@
|
|
|
8014
8020
|
}
|
|
8015
8021
|
function useItems(props) {
|
|
8016
8022
|
const items = vue.computed(() => transformItems$3(props, props.items));
|
|
8017
|
-
|
|
8018
|
-
}
|
|
8019
|
-
function useTransformItems(items, transform) {
|
|
8023
|
+
const hasNullItem = vue.computed(() => items.value.some(item => item.value === null));
|
|
8020
8024
|
function transformIn(value) {
|
|
8021
|
-
|
|
8022
|
-
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
|
|
8026
|
-
|
|
8027
|
-
|
|
8028
|
-
|
|
8025
|
+
if (!hasNullItem.value) {
|
|
8026
|
+
// When the model value is null, return an InternalItem
|
|
8027
|
+
// based on null only if null is one of the items
|
|
8028
|
+
value = value.filter(v => v !== null);
|
|
8029
|
+
}
|
|
8030
|
+
return value.map(v => {
|
|
8031
|
+
if (props.returnObject && typeof v === 'string') {
|
|
8032
|
+
// String model value means value is a custom input value from combobox
|
|
8033
|
+
// Don't look up existing items if the model value is a string
|
|
8034
|
+
return transformItem$3(props, v);
|
|
8035
|
+
}
|
|
8036
|
+
return items.value.find(item => props.valueComparator(v, item.value)) || transformItem$3(props, v);
|
|
8029
8037
|
});
|
|
8030
8038
|
}
|
|
8031
8039
|
function transformOut(value) {
|
|
8032
|
-
return value.map(_ref => {
|
|
8040
|
+
return props.returnObject ? value.map(_ref => {
|
|
8033
8041
|
let {
|
|
8034
|
-
|
|
8042
|
+
raw
|
|
8035
8043
|
} = _ref;
|
|
8044
|
+
return raw;
|
|
8045
|
+
}) : value.map(_ref2 => {
|
|
8046
|
+
let {
|
|
8047
|
+
value
|
|
8048
|
+
} = _ref2;
|
|
8036
8049
|
return value;
|
|
8037
8050
|
});
|
|
8038
8051
|
}
|
|
@@ -10863,10 +10876,6 @@
|
|
|
10863
10876
|
default: '$vuetify.noDataText'
|
|
10864
10877
|
},
|
|
10865
10878
|
openOnClear: Boolean,
|
|
10866
|
-
valueComparator: {
|
|
10867
|
-
type: Function,
|
|
10868
|
-
default: deepEqual
|
|
10869
|
-
},
|
|
10870
10879
|
itemColor: String,
|
|
10871
10880
|
...makeItemsProps({
|
|
10872
10881
|
itemChildren: false
|
|
@@ -10920,24 +10929,14 @@
|
|
|
10920
10929
|
return props.multiple ? transformed : transformed[0] ?? null;
|
|
10921
10930
|
});
|
|
10922
10931
|
const form = useForm();
|
|
10923
|
-
const
|
|
10924
|
-
return model.value.map(v => {
|
|
10925
|
-
return items.value.find(item => {
|
|
10926
|
-
const itemRawValue = getPropertyFromItem(item.raw, props.itemValue);
|
|
10927
|
-
const modelRawValue = getPropertyFromItem(v.raw, props.itemValue);
|
|
10928
|
-
if (itemRawValue === undefined || modelRawValue === undefined) return false;
|
|
10929
|
-
return props.returnObject ? props.valueComparator(itemRawValue, modelRawValue) : props.valueComparator(item.value, v.value);
|
|
10930
|
-
}) || v;
|
|
10931
|
-
});
|
|
10932
|
-
});
|
|
10933
|
-
const selected = vue.computed(() => selections.value.map(selection => selection.props.value));
|
|
10932
|
+
const selectedValues = vue.computed(() => model.value.map(selection => selection.value));
|
|
10934
10933
|
const isFocused = vue.shallowRef(false);
|
|
10935
10934
|
const label = vue.computed(() => menu.value ? props.closeText : props.openText);
|
|
10936
10935
|
let keyboardLookupPrefix = '';
|
|
10937
10936
|
let keyboardLookupLastTime;
|
|
10938
10937
|
const displayItems = vue.computed(() => {
|
|
10939
10938
|
if (props.hideSelected) {
|
|
10940
|
-
return items.value.filter(item => !
|
|
10939
|
+
return items.value.filter(item => !model.value.some(s => s === item));
|
|
10941
10940
|
}
|
|
10942
10941
|
return items.value;
|
|
10943
10942
|
});
|
|
@@ -10995,7 +10994,7 @@
|
|
|
10995
10994
|
}
|
|
10996
10995
|
function select(item) {
|
|
10997
10996
|
if (props.multiple) {
|
|
10998
|
-
const index =
|
|
10997
|
+
const index = model.value.findIndex(selection => props.valueComparator(selection.value, item.value));
|
|
10999
10998
|
if (index === -1) {
|
|
11000
10999
|
model.value = [...model.value, item];
|
|
11001
11000
|
} else {
|
|
@@ -11032,8 +11031,8 @@
|
|
|
11032
11031
|
}
|
|
11033
11032
|
}
|
|
11034
11033
|
vue.watch(menu, () => {
|
|
11035
|
-
if (!props.hideSelected && menu.value &&
|
|
11036
|
-
const index = displayItems.value.findIndex(item =>
|
|
11034
|
+
if (!props.hideSelected && menu.value && model.value.length) {
|
|
11035
|
+
const index = displayItems.value.findIndex(item => model.value.some(s => props.valueComparator(s.value, item.value)));
|
|
11037
11036
|
IN_BROWSER && window.requestAnimationFrame(() => {
|
|
11038
11037
|
index >= 0 && vVirtualScrollRef.value?.scrollToIndex(index);
|
|
11039
11038
|
});
|
|
@@ -11088,7 +11087,7 @@
|
|
|
11088
11087
|
}, props.menuProps), {
|
|
11089
11088
|
default: () => [hasList && vue.createVNode(VList, {
|
|
11090
11089
|
"ref": listRef,
|
|
11091
|
-
"selected":
|
|
11090
|
+
"selected": selectedValues.value,
|
|
11092
11091
|
"selectStrategy": props.multiple ? 'independent' : 'single-independent',
|
|
11093
11092
|
"onMousedown": e => e.preventDefault(),
|
|
11094
11093
|
"onKeydown": onListKeydown,
|
|
@@ -11137,7 +11136,7 @@
|
|
|
11137
11136
|
}
|
|
11138
11137
|
}), slots['append-item']?.()]
|
|
11139
11138
|
})]
|
|
11140
|
-
}),
|
|
11139
|
+
}), model.value.map((item, index) => {
|
|
11141
11140
|
function onChipClose(e) {
|
|
11142
11141
|
e.stopPropagation();
|
|
11143
11142
|
e.preventDefault();
|
|
@@ -11180,7 +11179,7 @@
|
|
|
11180
11179
|
index
|
|
11181
11180
|
}) ?? vue.createVNode("span", {
|
|
11182
11181
|
"class": "v-select__selection-text"
|
|
11183
|
-
}, [item.title, props.multiple && index <
|
|
11182
|
+
}, [item.title, props.multiple && index < model.value.length - 1 && vue.createVNode("span", {
|
|
11184
11183
|
"class": "v-select__selection-comma"
|
|
11185
11184
|
}, [vue.createTextVNode(",")])])]);
|
|
11186
11185
|
})]),
|
|
@@ -11232,15 +11231,15 @@
|
|
|
11232
11231
|
const customFiltersLength = Object.keys(options?.customKeyFilter ?? {}).length;
|
|
11233
11232
|
if (!items?.length) return array;
|
|
11234
11233
|
loop: for (let i = 0; i < items.length; i++) {
|
|
11235
|
-
const item = items[i];
|
|
11234
|
+
const [item, transformed = item] = wrapInArray(items[i]);
|
|
11236
11235
|
const customMatches = {};
|
|
11237
11236
|
const defaultMatches = {};
|
|
11238
11237
|
let match = -1;
|
|
11239
11238
|
if (query && !options?.noFilter) {
|
|
11240
11239
|
if (typeof item === 'object') {
|
|
11241
|
-
const filterKeys = keys || Object.keys(
|
|
11240
|
+
const filterKeys = keys || Object.keys(transformed);
|
|
11242
11241
|
for (const key of filterKeys) {
|
|
11243
|
-
const value = getPropertyFromItem(
|
|
11242
|
+
const value = getPropertyFromItem(transformed, key, transformed);
|
|
11244
11243
|
const keyFilter = options?.customKeyFilter?.[key];
|
|
11245
11244
|
match = keyFilter ? keyFilter(value, query, item) : filter(value, query, item);
|
|
11246
11245
|
if (match !== -1 && match !== false) {
|
|
@@ -11274,7 +11273,7 @@
|
|
|
11274
11273
|
function useFilter(props, items, query, options) {
|
|
11275
11274
|
const filteredItems = vue.ref([]);
|
|
11276
11275
|
const filteredMatches = vue.ref(new Map());
|
|
11277
|
-
const transformedItems = vue.computed(() => options?.transform ? vue.unref(items).map(options
|
|
11276
|
+
const transformedItems = vue.computed(() => options?.transform ? vue.unref(items).map(item => [item, options.transform(item)]) : vue.unref(items));
|
|
11278
11277
|
vue.watchEffect(() => {
|
|
11279
11278
|
const _query = typeof query === 'function' ? query() : vue.unref(query);
|
|
11280
11279
|
const strQuery = typeof _query !== 'string' && typeof _query !== 'number' ? '' : String(_query);
|
|
@@ -11392,24 +11391,13 @@
|
|
|
11392
11391
|
filteredItems,
|
|
11393
11392
|
getMatches
|
|
11394
11393
|
} = useFilter(props, items, () => isPristine.value ? '' : search.value);
|
|
11395
|
-
const selections = vue.computed(() => {
|
|
11396
|
-
return model.value.map(v => {
|
|
11397
|
-
return items.value.find(item => {
|
|
11398
|
-
const itemRawValue = getPropertyFromItem(item.raw, props.itemValue);
|
|
11399
|
-
const modelRawValue = getPropertyFromItem(v.raw, props.itemValue);
|
|
11400
|
-
if (itemRawValue === undefined || modelRawValue === undefined) return false;
|
|
11401
|
-
return props.returnObject ? props.valueComparator(itemRawValue, modelRawValue) : props.valueComparator(item.value, v.value);
|
|
11402
|
-
}) || v;
|
|
11403
|
-
});
|
|
11404
|
-
});
|
|
11405
11394
|
const displayItems = vue.computed(() => {
|
|
11406
11395
|
if (props.hideSelected) {
|
|
11407
|
-
return filteredItems.value.filter(filteredItem => !
|
|
11396
|
+
return filteredItems.value.filter(filteredItem => !model.value.some(s => s.value === filteredItem.value));
|
|
11408
11397
|
}
|
|
11409
11398
|
return filteredItems.value;
|
|
11410
11399
|
});
|
|
11411
|
-
const
|
|
11412
|
-
const selection = vue.computed(() => selections.value[selectionIndex.value]);
|
|
11400
|
+
const selectedValues = vue.computed(() => model.value.map(selection => selection.props.value));
|
|
11413
11401
|
const highlightFirst = vue.computed(() => {
|
|
11414
11402
|
const selectFirst = props.autoSelectFirst === true || props.autoSelectFirst === 'exact' && search.value === displayItems.value[0]?.title;
|
|
11415
11403
|
return selectFirst && displayItems.value.length > 0 && !isPristine.value && !listHasFocus.value;
|
|
@@ -11441,7 +11429,7 @@
|
|
|
11441
11429
|
function onKeydown(e) {
|
|
11442
11430
|
if (props.readonly || form?.isReadonly.value) return;
|
|
11443
11431
|
const selectionStart = vTextFieldRef.value.selectionStart;
|
|
11444
|
-
const length =
|
|
11432
|
+
const length = model.value.length;
|
|
11445
11433
|
if (selectionIndex.value > -1 || ['Enter', 'ArrowDown', 'ArrowUp'].includes(e.key)) {
|
|
11446
11434
|
e.preventDefault();
|
|
11447
11435
|
}
|
|
@@ -11466,13 +11454,14 @@
|
|
|
11466
11454
|
return;
|
|
11467
11455
|
}
|
|
11468
11456
|
const originalSelectionIndex = selectionIndex.value;
|
|
11469
|
-
|
|
11457
|
+
const selectedItem = model.value[selectionIndex.value];
|
|
11458
|
+
if (selectedItem) select(selectedItem);
|
|
11470
11459
|
selectionIndex.value = originalSelectionIndex >= length - 1 ? length - 2 : originalSelectionIndex;
|
|
11471
11460
|
}
|
|
11472
11461
|
if (e.key === 'ArrowLeft') {
|
|
11473
11462
|
if (selectionIndex.value < 0 && selectionStart > 0) return;
|
|
11474
11463
|
const prev = selectionIndex.value > -1 ? selectionIndex.value - 1 : length - 1;
|
|
11475
|
-
if (
|
|
11464
|
+
if (model.value[prev]) {
|
|
11476
11465
|
selectionIndex.value = prev;
|
|
11477
11466
|
} else {
|
|
11478
11467
|
selectionIndex.value = -1;
|
|
@@ -11482,7 +11471,7 @@
|
|
|
11482
11471
|
if (e.key === 'ArrowRight') {
|
|
11483
11472
|
if (selectionIndex.value < 0) return;
|
|
11484
11473
|
const next = selectionIndex.value + 1;
|
|
11485
|
-
if (
|
|
11474
|
+
if (model.value[next]) {
|
|
11486
11475
|
selectionIndex.value = next;
|
|
11487
11476
|
} else {
|
|
11488
11477
|
selectionIndex.value = -1;
|
|
@@ -11522,7 +11511,7 @@
|
|
|
11522
11511
|
const isSelecting = vue.shallowRef(false);
|
|
11523
11512
|
function select(item) {
|
|
11524
11513
|
if (props.multiple) {
|
|
11525
|
-
const index =
|
|
11514
|
+
const index = model.value.findIndex(selection => props.valueComparator(selection.value, item.value));
|
|
11526
11515
|
if (index === -1) {
|
|
11527
11516
|
model.value = [...model.value, item];
|
|
11528
11517
|
} else {
|
|
@@ -11543,11 +11532,11 @@
|
|
|
11543
11532
|
if (val === oldVal) return;
|
|
11544
11533
|
if (val) {
|
|
11545
11534
|
isSelecting.value = true;
|
|
11546
|
-
search.value = props.multiple ? '' : String(
|
|
11535
|
+
search.value = props.multiple ? '' : String(model.value.at(-1)?.props.title ?? '');
|
|
11547
11536
|
isPristine.value = true;
|
|
11548
11537
|
vue.nextTick(() => isSelecting.value = false);
|
|
11549
11538
|
} else {
|
|
11550
|
-
if (!props.multiple && !search.value) model.value = [];else if (highlightFirst.value && !listHasFocus.value && !
|
|
11539
|
+
if (!props.multiple && !search.value) model.value = [];else if (highlightFirst.value && !listHasFocus.value && !model.value.some(_ref2 => {
|
|
11551
11540
|
let {
|
|
11552
11541
|
value
|
|
11553
11542
|
} = _ref2;
|
|
@@ -11566,8 +11555,8 @@
|
|
|
11566
11555
|
isPristine.value = !val;
|
|
11567
11556
|
});
|
|
11568
11557
|
vue.watch(menu, () => {
|
|
11569
|
-
if (!props.hideSelected && menu.value &&
|
|
11570
|
-
const index = displayItems.value.findIndex(item =>
|
|
11558
|
+
if (!props.hideSelected && menu.value && model.value.length) {
|
|
11559
|
+
const index = displayItems.value.findIndex(item => model.value.some(s => item.value === s.value));
|
|
11571
11560
|
IN_BROWSER && window.requestAnimationFrame(() => {
|
|
11572
11561
|
index >= 0 && vVirtualScrollRef.value?.scrollToIndex(index);
|
|
11573
11562
|
});
|
|
@@ -11619,7 +11608,7 @@
|
|
|
11619
11608
|
}, props.menuProps), {
|
|
11620
11609
|
default: () => [hasList && vue.createVNode(VList, {
|
|
11621
11610
|
"ref": listRef,
|
|
11622
|
-
"selected":
|
|
11611
|
+
"selected": selectedValues.value,
|
|
11623
11612
|
"selectStrategy": props.multiple ? 'independent' : 'single-independent',
|
|
11624
11613
|
"onMousedown": e => e.preventDefault(),
|
|
11625
11614
|
"onKeydown": onListKeydown,
|
|
@@ -11673,7 +11662,7 @@
|
|
|
11673
11662
|
}
|
|
11674
11663
|
}), slots['append-item']?.()]
|
|
11675
11664
|
})]
|
|
11676
|
-
}),
|
|
11665
|
+
}), model.value.map((item, index) => {
|
|
11677
11666
|
function onChipClose(e) {
|
|
11678
11667
|
e.stopPropagation();
|
|
11679
11668
|
e.preventDefault();
|
|
@@ -11717,7 +11706,7 @@
|
|
|
11717
11706
|
index
|
|
11718
11707
|
}) ?? vue.createVNode("span", {
|
|
11719
11708
|
"class": "v-autocomplete__selection-text"
|
|
11720
|
-
}, [item.title, props.multiple && index <
|
|
11709
|
+
}, [item.title, props.multiple && index < model.value.length - 1 && vue.createVNode("span", {
|
|
11721
11710
|
"class": "v-autocomplete__selection-comma"
|
|
11722
11711
|
}, [vue.createTextVNode(",")])])]);
|
|
11723
11712
|
})]),
|
|
@@ -13115,11 +13104,29 @@
|
|
|
13115
13104
|
emit
|
|
13116
13105
|
} = _ref;
|
|
13117
13106
|
const isInteracting = vue.shallowRef(false);
|
|
13118
|
-
const
|
|
13119
|
-
const
|
|
13107
|
+
const canvasRef = vue.ref();
|
|
13108
|
+
const canvasWidth = vue.shallowRef(parseFloat(props.width));
|
|
13109
|
+
const canvasHeight = vue.shallowRef(parseFloat(props.height));
|
|
13110
|
+
const _dotPosition = vue.ref({
|
|
13120
13111
|
x: 0,
|
|
13121
13112
|
y: 0
|
|
13122
13113
|
});
|
|
13114
|
+
const dotPosition = vue.computed({
|
|
13115
|
+
get: () => _dotPosition.value,
|
|
13116
|
+
set(val) {
|
|
13117
|
+
if (!canvasRef.value) return;
|
|
13118
|
+
const {
|
|
13119
|
+
x,
|
|
13120
|
+
y
|
|
13121
|
+
} = val;
|
|
13122
|
+
emit('update:color', {
|
|
13123
|
+
h: props.color?.h ?? 0,
|
|
13124
|
+
s: clamp(x, 0, canvasWidth.value) / canvasWidth.value,
|
|
13125
|
+
v: 1 - clamp(y, 0, canvasHeight.value) / canvasHeight.value,
|
|
13126
|
+
a: props.color?.a ?? 1
|
|
13127
|
+
});
|
|
13128
|
+
}
|
|
13129
|
+
});
|
|
13123
13130
|
const dotStyles = vue.computed(() => {
|
|
13124
13131
|
const {
|
|
13125
13132
|
x,
|
|
@@ -13132,9 +13139,6 @@
|
|
|
13132
13139
|
transform: `translate(${convertToUnit(x - radius)}, ${convertToUnit(y - radius)})`
|
|
13133
13140
|
};
|
|
13134
13141
|
});
|
|
13135
|
-
const canvasRef = vue.ref();
|
|
13136
|
-
const canvasWidth = vue.shallowRef(parseFloat(props.width));
|
|
13137
|
-
const canvasHeight = vue.shallowRef(parseFloat(props.height));
|
|
13138
13142
|
const {
|
|
13139
13143
|
resizeRef
|
|
13140
13144
|
} = useResizeObserver(entries => {
|
|
@@ -13158,15 +13162,13 @@
|
|
|
13158
13162
|
y: clamp(y - top, 0, height)
|
|
13159
13163
|
};
|
|
13160
13164
|
}
|
|
13161
|
-
function handleClick(e) {
|
|
13162
|
-
if (props.disabled || !canvasRef.value) return;
|
|
13163
|
-
updateDotPosition(e.clientX, e.clientY, canvasRef.value.getBoundingClientRect());
|
|
13164
|
-
}
|
|
13165
13165
|
function handleMouseDown(e) {
|
|
13166
|
-
|
|
13167
|
-
|
|
13166
|
+
if (e.type === 'mousedown') {
|
|
13167
|
+
// Prevent text selection while dragging
|
|
13168
|
+
e.preventDefault();
|
|
13169
|
+
}
|
|
13168
13170
|
if (props.disabled) return;
|
|
13169
|
-
|
|
13171
|
+
handleMouseMove(e);
|
|
13170
13172
|
window.addEventListener('mousemove', handleMouseMove);
|
|
13171
13173
|
window.addEventListener('mouseup', handleMouseUp);
|
|
13172
13174
|
window.addEventListener('touchmove', handleMouseMove);
|
|
@@ -13184,23 +13186,6 @@
|
|
|
13184
13186
|
window.removeEventListener('touchmove', handleMouseMove);
|
|
13185
13187
|
window.removeEventListener('touchend', handleMouseUp);
|
|
13186
13188
|
}
|
|
13187
|
-
vue.watch(dotPosition, () => {
|
|
13188
|
-
if (isOutsideUpdate.value) {
|
|
13189
|
-
isOutsideUpdate.value = false;
|
|
13190
|
-
return;
|
|
13191
|
-
}
|
|
13192
|
-
if (!canvasRef.value) return;
|
|
13193
|
-
const {
|
|
13194
|
-
x,
|
|
13195
|
-
y
|
|
13196
|
-
} = dotPosition.value;
|
|
13197
|
-
emit('update:color', {
|
|
13198
|
-
h: props.color?.h ?? 0,
|
|
13199
|
-
s: clamp(x, 0, canvasWidth.value) / canvasWidth.value,
|
|
13200
|
-
v: 1 - clamp(y, 0, canvasHeight.value) / canvasHeight.value,
|
|
13201
|
-
a: props.color?.a ?? 1
|
|
13202
|
-
});
|
|
13203
|
-
});
|
|
13204
13189
|
function updateCanvas() {
|
|
13205
13190
|
if (!canvasRef.value) return;
|
|
13206
13191
|
const canvas = canvasRef.value;
|
|
@@ -13222,7 +13207,7 @@
|
|
|
13222
13207
|
});
|
|
13223
13208
|
vue.watch(() => [canvasWidth.value, canvasHeight.value], (newVal, oldVal) => {
|
|
13224
13209
|
updateCanvas();
|
|
13225
|
-
|
|
13210
|
+
_dotPosition.value = {
|
|
13226
13211
|
x: dotPosition.value.x * newVal[0] / oldVal[0],
|
|
13227
13212
|
y: dotPosition.value.y * newVal[1] / oldVal[1]
|
|
13228
13213
|
};
|
|
@@ -13234,8 +13219,7 @@
|
|
|
13234
13219
|
isInteracting.value = false;
|
|
13235
13220
|
return;
|
|
13236
13221
|
}
|
|
13237
|
-
|
|
13238
|
-
dotPosition.value = props.color ? {
|
|
13222
|
+
_dotPosition.value = props.color ? {
|
|
13239
13223
|
x: props.color.s * canvasWidth.value,
|
|
13240
13224
|
y: (1 - props.color.v) * canvasHeight.value
|
|
13241
13225
|
} : {
|
|
@@ -13251,9 +13235,8 @@
|
|
|
13251
13235
|
"ref": resizeRef,
|
|
13252
13236
|
"class": ['v-color-picker-canvas', props.class],
|
|
13253
13237
|
"style": props.style,
|
|
13254
|
-
"onClick": handleClick,
|
|
13255
13238
|
"onMousedown": handleMouseDown,
|
|
13256
|
-
"
|
|
13239
|
+
"onTouchstartPassive": handleMouseDown
|
|
13257
13240
|
}, [vue.createVNode("canvas", {
|
|
13258
13241
|
"ref": canvasRef,
|
|
13259
13242
|
"width": canvasWidth.value,
|
|
@@ -14163,11 +14146,11 @@
|
|
|
14163
14146
|
"focused": isFocused.value
|
|
14164
14147
|
}), {
|
|
14165
14148
|
...slots,
|
|
14166
|
-
prepend: hasPrepend ? slotProps => vue.createVNode(vue.Fragment, null, [slots.label?.(slotProps) ?? props.label ? vue.createVNode(VLabel, {
|
|
14149
|
+
prepend: hasPrepend ? slotProps => vue.createVNode(vue.Fragment, null, [slots.label?.(slotProps) ?? (props.label ? vue.createVNode(VLabel, {
|
|
14167
14150
|
"id": slotProps.id.value,
|
|
14168
14151
|
"class": "v-slider__label",
|
|
14169
14152
|
"text": props.label
|
|
14170
|
-
}, null) : undefined, slots.prepend?.(slotProps)]) : undefined,
|
|
14153
|
+
}, null) : undefined), slots.prepend?.(slotProps)]) : undefined,
|
|
14171
14154
|
default: _ref4 => {
|
|
14172
14155
|
let {
|
|
14173
14156
|
id,
|
|
@@ -14974,24 +14957,13 @@
|
|
|
14974
14957
|
filteredItems,
|
|
14975
14958
|
getMatches
|
|
14976
14959
|
} = useFilter(props, items, () => isPristine.value ? '' : search.value);
|
|
14977
|
-
const selections = vue.computed(() => {
|
|
14978
|
-
return model.value.map(v => {
|
|
14979
|
-
return items.value.find(item => {
|
|
14980
|
-
const itemRawValue = getPropertyFromItem(item.raw, props.itemValue);
|
|
14981
|
-
const modelRawValue = getPropertyFromItem(v.raw, props.itemValue);
|
|
14982
|
-
if (itemRawValue === undefined || modelRawValue === undefined) return false;
|
|
14983
|
-
return props.returnObject ? props.valueComparator(itemRawValue, modelRawValue) : props.valueComparator(item.value, v.value);
|
|
14984
|
-
}) || v;
|
|
14985
|
-
});
|
|
14986
|
-
});
|
|
14987
14960
|
const displayItems = vue.computed(() => {
|
|
14988
14961
|
if (props.hideSelected) {
|
|
14989
|
-
return filteredItems.value.filter(filteredItem => !
|
|
14962
|
+
return filteredItems.value.filter(filteredItem => !model.value.some(s => s.value === filteredItem.value));
|
|
14990
14963
|
}
|
|
14991
14964
|
return filteredItems.value;
|
|
14992
14965
|
});
|
|
14993
|
-
const
|
|
14994
|
-
const selection = vue.computed(() => selections.value[selectionIndex.value]);
|
|
14966
|
+
const selectedValues = vue.computed(() => model.value.map(selection => selection.value));
|
|
14995
14967
|
const highlightFirst = vue.computed(() => {
|
|
14996
14968
|
const selectFirst = props.autoSelectFirst === true || props.autoSelectFirst === 'exact' && search.value === displayItems.value[0]?.title;
|
|
14997
14969
|
return selectFirst && displayItems.value.length > 0 && !isPristine.value && !listHasFocus.value;
|
|
@@ -15023,7 +14995,7 @@
|
|
|
15023
14995
|
function onKeydown(e) {
|
|
15024
14996
|
if (props.readonly || form?.isReadonly.value) return;
|
|
15025
14997
|
const selectionStart = vTextFieldRef.value.selectionStart;
|
|
15026
|
-
const length =
|
|
14998
|
+
const length = model.value.length;
|
|
15027
14999
|
if (selectionIndex.value > -1 || ['Enter', 'ArrowDown', 'ArrowUp'].includes(e.key)) {
|
|
15028
15000
|
e.preventDefault();
|
|
15029
15001
|
}
|
|
@@ -15051,13 +15023,14 @@
|
|
|
15051
15023
|
return;
|
|
15052
15024
|
}
|
|
15053
15025
|
const originalSelectionIndex = selectionIndex.value;
|
|
15054
|
-
|
|
15026
|
+
const selectedItem = model.value[selectionIndex.value];
|
|
15027
|
+
if (selectedItem) select(selectedItem);
|
|
15055
15028
|
selectionIndex.value = originalSelectionIndex >= length - 1 ? length - 2 : originalSelectionIndex;
|
|
15056
15029
|
}
|
|
15057
15030
|
if (e.key === 'ArrowLeft') {
|
|
15058
15031
|
if (selectionIndex.value < 0 && selectionStart > 0) return;
|
|
15059
15032
|
const prev = selectionIndex.value > -1 ? selectionIndex.value - 1 : length - 1;
|
|
15060
|
-
if (
|
|
15033
|
+
if (model.value[prev]) {
|
|
15061
15034
|
selectionIndex.value = prev;
|
|
15062
15035
|
} else {
|
|
15063
15036
|
selectionIndex.value = -1;
|
|
@@ -15067,7 +15040,7 @@
|
|
|
15067
15040
|
if (e.key === 'ArrowRight') {
|
|
15068
15041
|
if (selectionIndex.value < 0) return;
|
|
15069
15042
|
const next = selectionIndex.value + 1;
|
|
15070
|
-
if (
|
|
15043
|
+
if (model.value[next]) {
|
|
15071
15044
|
selectionIndex.value = next;
|
|
15072
15045
|
} else {
|
|
15073
15046
|
selectionIndex.value = -1;
|
|
@@ -15087,7 +15060,7 @@
|
|
|
15087
15060
|
}
|
|
15088
15061
|
function select(item) {
|
|
15089
15062
|
if (props.multiple) {
|
|
15090
|
-
const index =
|
|
15063
|
+
const index = model.value.findIndex(selection => props.valueComparator(selection.value, item.value));
|
|
15091
15064
|
if (index === -1) {
|
|
15092
15065
|
model.value = [...model.value, item];
|
|
15093
15066
|
} else {
|
|
@@ -15126,7 +15099,7 @@
|
|
|
15126
15099
|
if (val || val === oldVal) return;
|
|
15127
15100
|
selectionIndex.value = -1;
|
|
15128
15101
|
menu.value = false;
|
|
15129
|
-
if (highlightFirst.value && !listHasFocus.value && !
|
|
15102
|
+
if (highlightFirst.value && !listHasFocus.value && !model.value.some(_ref2 => {
|
|
15130
15103
|
let {
|
|
15131
15104
|
value
|
|
15132
15105
|
} = _ref2;
|
|
@@ -15139,8 +15112,8 @@
|
|
|
15139
15112
|
}
|
|
15140
15113
|
});
|
|
15141
15114
|
vue.watch(menu, () => {
|
|
15142
|
-
if (!props.hideSelected && menu.value &&
|
|
15143
|
-
const index = displayItems.value.findIndex(item =>
|
|
15115
|
+
if (!props.hideSelected && menu.value && model.value.length) {
|
|
15116
|
+
const index = displayItems.value.findIndex(item => model.value.some(s => props.valueComparator(s.value, item.value)));
|
|
15144
15117
|
IN_BROWSER && window.requestAnimationFrame(() => {
|
|
15145
15118
|
index >= 0 && vVirtualScrollRef.value?.scrollToIndex(index);
|
|
15146
15119
|
});
|
|
@@ -15191,7 +15164,7 @@
|
|
|
15191
15164
|
}, props.menuProps), {
|
|
15192
15165
|
default: () => [hasList && vue.createVNode(VList, {
|
|
15193
15166
|
"ref": listRef,
|
|
15194
|
-
"selected":
|
|
15167
|
+
"selected": selectedValues.value,
|
|
15195
15168
|
"selectStrategy": props.multiple ? 'independent' : 'single-independent',
|
|
15196
15169
|
"onMousedown": e => e.preventDefault(),
|
|
15197
15170
|
"onKeydown": onListKeydown,
|
|
@@ -15245,7 +15218,7 @@
|
|
|
15245
15218
|
}
|
|
15246
15219
|
}), slots['append-item']?.()]
|
|
15247
15220
|
})]
|
|
15248
|
-
}),
|
|
15221
|
+
}), model.value.map((item, index) => {
|
|
15249
15222
|
function onChipClose(e) {
|
|
15250
15223
|
e.stopPropagation();
|
|
15251
15224
|
e.preventDefault();
|
|
@@ -15289,7 +15262,7 @@
|
|
|
15289
15262
|
index
|
|
15290
15263
|
}) ?? vue.createVNode("span", {
|
|
15291
15264
|
"class": "v-combobox__selection-text"
|
|
15292
|
-
}, [item.title, props.multiple && index <
|
|
15265
|
+
}, [item.title, props.multiple && index < model.value.length - 1 && vue.createVNode("span", {
|
|
15293
15266
|
"class": "v-combobox__selection-comma"
|
|
15294
15267
|
}, [vue.createTextVNode(",")])])]);
|
|
15295
15268
|
})]),
|
|
@@ -17758,10 +17731,10 @@
|
|
|
17758
17731
|
"focused": isFocused.value
|
|
17759
17732
|
}), {
|
|
17760
17733
|
...slots,
|
|
17761
|
-
prepend: hasPrepend ? slotProps => vue.createVNode(vue.Fragment, null, [slots.label?.(slotProps) ?? props.label ? vue.createVNode(VLabel, {
|
|
17734
|
+
prepend: hasPrepend ? slotProps => vue.createVNode(vue.Fragment, null, [slots.label?.(slotProps) ?? (props.label ? vue.createVNode(VLabel, {
|
|
17762
17735
|
"class": "v-slider__label",
|
|
17763
17736
|
"text": props.label
|
|
17764
|
-
}, null) : undefined, slots.prepend?.(slotProps)]) : undefined,
|
|
17737
|
+
}, null) : undefined), slots.prepend?.(slotProps)]) : undefined,
|
|
17765
17738
|
default: _ref4 => {
|
|
17766
17739
|
let {
|
|
17767
17740
|
id,
|
|
@@ -18826,11 +18799,10 @@
|
|
|
18826
18799
|
"tabindex": isSelected.value ? 0 : -1,
|
|
18827
18800
|
"role": "tab",
|
|
18828
18801
|
"aria-selected": String(isSelected.value),
|
|
18829
|
-
"active": false
|
|
18802
|
+
"active": false
|
|
18803
|
+
}, btnProps, attrs, {
|
|
18830
18804
|
"block": props.fixed,
|
|
18831
18805
|
"maxWidth": props.fixed ? 300 : undefined,
|
|
18832
|
-
"rounded": 0
|
|
18833
|
-
}, btnProps, attrs, {
|
|
18834
18806
|
"onGroup:selected": updateSlider
|
|
18835
18807
|
}), {
|
|
18836
18808
|
default: () => [slots.default?.() ?? props.text, !props.hideSlider && vue.createVNode("div", {
|
|
@@ -18847,8 +18819,8 @@
|
|
|
18847
18819
|
function parseItems(items) {
|
|
18848
18820
|
if (!items) return [];
|
|
18849
18821
|
return items.map(item => {
|
|
18850
|
-
if (
|
|
18851
|
-
|
|
18822
|
+
if (!isObject(item)) return {
|
|
18823
|
+
text: item,
|
|
18852
18824
|
value: item
|
|
18853
18825
|
};
|
|
18854
18826
|
return item;
|
|
@@ -18926,7 +18898,7 @@
|
|
|
18926
18898
|
"symbol": VTabsSymbol
|
|
18927
18899
|
}), {
|
|
18928
18900
|
default: () => [slots.default ? slots.default() : parsedItems.value.map(item => vue.createVNode(VTab, vue.mergeProps(item, {
|
|
18929
|
-
"key": item.
|
|
18901
|
+
"key": item.text
|
|
18930
18902
|
}), null))]
|
|
18931
18903
|
});
|
|
18932
18904
|
});
|
|
@@ -19619,7 +19591,6 @@
|
|
|
19619
19591
|
const makeVBottomSheetProps = propsFactory({
|
|
19620
19592
|
inset: Boolean,
|
|
19621
19593
|
...makeVDialogProps({
|
|
19622
|
-
contentClass: 'v-bottom-sheet__content',
|
|
19623
19594
|
transition: 'bottom-sheet-transition'
|
|
19624
19595
|
})
|
|
19625
19596
|
}, 'VBottomSheet');
|
|
@@ -19637,6 +19608,7 @@
|
|
|
19637
19608
|
useRender(() => {
|
|
19638
19609
|
const [dialogProps] = VDialog.filterProps(props);
|
|
19639
19610
|
return vue.createVNode(VDialog, vue.mergeProps(dialogProps, {
|
|
19611
|
+
"contentClass": ['v-bottom-sheet__content', props.contentClass],
|
|
19640
19612
|
"modelValue": isActive.value,
|
|
19641
19613
|
"onUpdate:modelValue": $event => isActive.value = $event,
|
|
19642
19614
|
"class": ['v-bottom-sheet', {
|
|
@@ -20169,7 +20141,7 @@
|
|
|
20169
20141
|
allItems: allSelectable.value,
|
|
20170
20142
|
currentPage: currentPageSelectable.value
|
|
20171
20143
|
});
|
|
20172
|
-
return isSelected(items);
|
|
20144
|
+
return !!items.length && isSelected(items);
|
|
20173
20145
|
});
|
|
20174
20146
|
const data = {
|
|
20175
20147
|
toggleSelect,
|
|
@@ -21810,7 +21782,7 @@
|
|
|
21810
21782
|
const makeVDatePickerControlsProps = propsFactory({
|
|
21811
21783
|
displayDate: String,
|
|
21812
21784
|
disabled: {
|
|
21813
|
-
type: [Boolean, String],
|
|
21785
|
+
type: [Boolean, String, Array],
|
|
21814
21786
|
default: false
|
|
21815
21787
|
},
|
|
21816
21788
|
nextIcon: {
|
|
@@ -21821,13 +21793,13 @@
|
|
|
21821
21793
|
type: [String],
|
|
21822
21794
|
default: '$prev'
|
|
21823
21795
|
},
|
|
21824
|
-
|
|
21796
|
+
modeIcon: {
|
|
21825
21797
|
type: [String],
|
|
21826
|
-
default: '$
|
|
21798
|
+
default: '$subgroup'
|
|
21827
21799
|
},
|
|
21828
|
-
|
|
21829
|
-
type:
|
|
21830
|
-
default: '
|
|
21800
|
+
variant: {
|
|
21801
|
+
type: String,
|
|
21802
|
+
default: 'modern'
|
|
21831
21803
|
},
|
|
21832
21804
|
viewMode: {
|
|
21833
21805
|
type: String,
|
|
@@ -21846,17 +21818,14 @@
|
|
|
21846
21818
|
let {
|
|
21847
21819
|
emit
|
|
21848
21820
|
} = _ref;
|
|
21849
|
-
const modeIcon = vue.computed(() => {
|
|
21850
|
-
return props.viewMode === 'month' ? props.expandIcon : props.collapseIcon;
|
|
21851
|
-
});
|
|
21852
21821
|
const disableMode = vue.computed(() => {
|
|
21853
|
-
return Array.isArray(props.disabled) ? props.disabled.includes('mode') : props.disabled;
|
|
21822
|
+
return Array.isArray(props.disabled) ? props.disabled.includes('mode') : !!props.disabled;
|
|
21854
21823
|
});
|
|
21855
21824
|
const disablePrev = vue.computed(() => {
|
|
21856
|
-
return Array.isArray(props.disabled) ? props.disabled.includes('prev') : props.disabled;
|
|
21825
|
+
return Array.isArray(props.disabled) ? props.disabled.includes('prev') : !!props.disabled;
|
|
21857
21826
|
});
|
|
21858
21827
|
const disableNext = vue.computed(() => {
|
|
21859
|
-
return Array.isArray(props.disabled) ? props.disabled.includes('next') : props.disabled;
|
|
21828
|
+
return Array.isArray(props.disabled) ? props.disabled.includes('next') : !!props.disabled;
|
|
21860
21829
|
});
|
|
21861
21830
|
function onClickPrev() {
|
|
21862
21831
|
emit('click:prev');
|
|
@@ -21868,17 +21837,21 @@
|
|
|
21868
21837
|
emit('click:mode');
|
|
21869
21838
|
}
|
|
21870
21839
|
useRender(() => {
|
|
21871
|
-
|
|
21872
|
-
"class": "v-date-picker-controls"
|
|
21873
|
-
}, [vue.createVNode("div", {
|
|
21840
|
+
const displayDate = vue.createVNode("div", {
|
|
21874
21841
|
"class": "v-date-picker-controls__date"
|
|
21875
|
-
}, [props.displayDate])
|
|
21842
|
+
}, [props.displayDate]);
|
|
21843
|
+
return vue.createVNode("div", {
|
|
21844
|
+
"class": ['v-date-picker-controls', `v-date-picker-controls--variant-${props.variant}`]
|
|
21845
|
+
}, [props.variant === 'modern' && vue.createVNode(vue.Fragment, null, [displayDate, vue.createVNode(VBtn, {
|
|
21846
|
+
"key": "mode-btn",
|
|
21876
21847
|
"disabled": disableMode.value,
|
|
21877
|
-
"
|
|
21878
|
-
"icon": modeIcon
|
|
21848
|
+
"density": "comfortable",
|
|
21849
|
+
"icon": props.modeIcon,
|
|
21879
21850
|
"variant": "text",
|
|
21880
21851
|
"onClick": onClickMode
|
|
21881
|
-
}, null), vue.createVNode(VSpacer,
|
|
21852
|
+
}, null), vue.createVNode(VSpacer, {
|
|
21853
|
+
"key": "mode-spacer"
|
|
21854
|
+
}, null)]), vue.createVNode("div", {
|
|
21882
21855
|
"key": "month-buttons",
|
|
21883
21856
|
"class": "v-date-picker-controls__month"
|
|
21884
21857
|
}, [vue.createVNode(VBtn, {
|
|
@@ -21886,7 +21859,7 @@
|
|
|
21886
21859
|
"icon": props.prevIcon,
|
|
21887
21860
|
"variant": "text",
|
|
21888
21861
|
"onClick": onClickPrev
|
|
21889
|
-
}, null), vue.createVNode(VBtn, {
|
|
21862
|
+
}, null), props.variant === 'classic' && displayDate, vue.createVNode(VBtn, {
|
|
21890
21863
|
"disabled": disableNext.value,
|
|
21891
21864
|
"icon": props.nextIcon,
|
|
21892
21865
|
"variant": "text",
|
|
@@ -22163,6 +22136,11 @@
|
|
|
22163
22136
|
day: 'numeric'
|
|
22164
22137
|
};
|
|
22165
22138
|
break;
|
|
22139
|
+
case 'shortDate':
|
|
22140
|
+
options = {
|
|
22141
|
+
year: 'numeric'
|
|
22142
|
+
};
|
|
22143
|
+
break;
|
|
22166
22144
|
default:
|
|
22167
22145
|
options = {
|
|
22168
22146
|
timeZone: 'UTC',
|
|
@@ -22197,6 +22175,7 @@
|
|
|
22197
22175
|
return isAfter(date, range[0]) && isBefore(date, range[1]);
|
|
22198
22176
|
}
|
|
22199
22177
|
function isValid(date) {
|
|
22178
|
+
if (!date || date == null) return false;
|
|
22200
22179
|
const d = new Date(date);
|
|
22201
22180
|
return d instanceof Date && !isNaN(d.getTime());
|
|
22202
22181
|
}
|
|
@@ -22228,6 +22207,12 @@
|
|
|
22228
22207
|
d.setFullYear(year);
|
|
22229
22208
|
return d;
|
|
22230
22209
|
}
|
|
22210
|
+
function startOfDay(date) {
|
|
22211
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
22212
|
+
}
|
|
22213
|
+
function endOfDay(date) {
|
|
22214
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59, 999);
|
|
22215
|
+
}
|
|
22231
22216
|
class VuetifyDateAdapter {
|
|
22232
22217
|
constructor(options) {
|
|
22233
22218
|
this.locale = options.locale;
|
|
@@ -22292,6 +22277,12 @@
|
|
|
22292
22277
|
getMonth(date) {
|
|
22293
22278
|
return getMonth(date);
|
|
22294
22279
|
}
|
|
22280
|
+
startOfDay(date) {
|
|
22281
|
+
return startOfDay(date);
|
|
22282
|
+
}
|
|
22283
|
+
endOfDay(date) {
|
|
22284
|
+
return endOfDay(date);
|
|
22285
|
+
}
|
|
22295
22286
|
startOfYear(date) {
|
|
22296
22287
|
return startOfYear(date);
|
|
22297
22288
|
}
|
|
@@ -22775,8 +22766,7 @@
|
|
|
22775
22766
|
"key": "in-hover",
|
|
22776
22767
|
"class": "v-date-picker-month__day--hover"
|
|
22777
22768
|
}, null), (props.showAdjacentMonths || !item.isAdjacent) && vue.createVNode(VBtn, {
|
|
22778
|
-
"
|
|
22779
|
-
"color": color,
|
|
22769
|
+
"color": !item.isToday || item.isSelected ? color : undefined,
|
|
22780
22770
|
"disabled": item.isDisabled,
|
|
22781
22771
|
"icon": true,
|
|
22782
22772
|
"ripple": false,
|
|
@@ -22811,7 +22801,7 @@
|
|
|
22811
22801
|
const years = vue.computed(() => {
|
|
22812
22802
|
const min = props.min ? adapter.date(props.min).getFullYear() : displayYear.value - 100;
|
|
22813
22803
|
const max = props.max ? adapter.date(props.max).getFullYear() : displayYear.value + 50;
|
|
22814
|
-
return createRange(max - min, min);
|
|
22804
|
+
return createRange(max - min + 1, min);
|
|
22815
22805
|
});
|
|
22816
22806
|
const yearRef = vue.ref();
|
|
22817
22807
|
vue.onMounted(() => {
|
|
@@ -22949,12 +22939,14 @@
|
|
|
22949
22939
|
appendIcon: String,
|
|
22950
22940
|
color: String,
|
|
22951
22941
|
header: String,
|
|
22952
|
-
transition: String
|
|
22942
|
+
transition: String,
|
|
22943
|
+
onClick: EventProp()
|
|
22953
22944
|
}, 'VDatePickerHeader');
|
|
22954
22945
|
const VDatePickerHeader = genericComponent()({
|
|
22955
22946
|
name: 'VDatePickerHeader',
|
|
22956
22947
|
props: makeVDatePickerHeaderProps(),
|
|
22957
22948
|
emits: {
|
|
22949
|
+
click: () => true,
|
|
22958
22950
|
'click:append': () => true
|
|
22959
22951
|
},
|
|
22960
22952
|
setup(props, _ref) {
|
|
@@ -22966,6 +22958,9 @@
|
|
|
22966
22958
|
backgroundColorClasses,
|
|
22967
22959
|
backgroundColorStyles
|
|
22968
22960
|
} = useBackgroundColor(props, 'color');
|
|
22961
|
+
function onClick() {
|
|
22962
|
+
emit('click');
|
|
22963
|
+
}
|
|
22969
22964
|
function onClickAppend() {
|
|
22970
22965
|
emit('click:append');
|
|
22971
22966
|
}
|
|
@@ -22973,8 +22968,11 @@
|
|
|
22973
22968
|
const hasContent = !!(slots.default || props.header);
|
|
22974
22969
|
const hasAppend = !!(slots.append || props.appendIcon);
|
|
22975
22970
|
return vue.createVNode("div", {
|
|
22976
|
-
"class": ['v-date-picker-header',
|
|
22977
|
-
|
|
22971
|
+
"class": ['v-date-picker-header', {
|
|
22972
|
+
'v-date-picker-header--clickable': !!props.onClick
|
|
22973
|
+
}, backgroundColorClasses.value],
|
|
22974
|
+
"style": backgroundColorStyles.value,
|
|
22975
|
+
"onClick": onClick
|
|
22978
22976
|
}, [slots.prepend && vue.createVNode("div", {
|
|
22979
22977
|
"key": "prepend",
|
|
22980
22978
|
"class": "v-date-picker-header__prepend"
|
|
@@ -23016,9 +23014,10 @@
|
|
|
23016
23014
|
// Types
|
|
23017
23015
|
|
|
23018
23016
|
const makeVPickerProps = propsFactory({
|
|
23017
|
+
bgColor: String,
|
|
23019
23018
|
landscape: Boolean,
|
|
23020
23019
|
title: String,
|
|
23021
|
-
...
|
|
23020
|
+
...makeVSheetProps()
|
|
23022
23021
|
}, 'VPicker');
|
|
23023
23022
|
const VPicker = genericComponent()({
|
|
23024
23023
|
name: 'VPicker',
|
|
@@ -23027,23 +23026,31 @@
|
|
|
23027
23026
|
let {
|
|
23028
23027
|
slots
|
|
23029
23028
|
} = _ref;
|
|
23029
|
+
const {
|
|
23030
|
+
backgroundColorClasses,
|
|
23031
|
+
backgroundColorStyles
|
|
23032
|
+
} = useBackgroundColor(vue.toRef(props, 'color'));
|
|
23030
23033
|
useRender(() => {
|
|
23031
23034
|
const [sheetProps] = VSheet.filterProps(props);
|
|
23032
23035
|
const hasTitle = !!(props.title || slots.title);
|
|
23033
23036
|
return vue.createVNode(VSheet, vue.mergeProps(sheetProps, {
|
|
23037
|
+
"color": props.bgColor,
|
|
23034
23038
|
"class": ['v-picker', {
|
|
23035
23039
|
'v-picker--landscape': props.landscape,
|
|
23036
23040
|
'v-picker--with-actions': !!slots.actions
|
|
23037
23041
|
}, props.class],
|
|
23038
23042
|
"style": props.style
|
|
23039
23043
|
}), {
|
|
23040
|
-
default: () => [
|
|
23044
|
+
default: () => [vue.createVNode("div", {
|
|
23045
|
+
"class": [backgroundColorClasses.value],
|
|
23046
|
+
"style": [backgroundColorStyles.value]
|
|
23047
|
+
}, [hasTitle && vue.createVNode(VPickerTitle, {
|
|
23041
23048
|
"key": "picker-title"
|
|
23042
23049
|
}, {
|
|
23043
23050
|
default: () => [slots.title?.() ?? props.title]
|
|
23044
23051
|
}), slots.header && vue.createVNode("div", {
|
|
23045
23052
|
"class": "v-picker__header"
|
|
23046
|
-
}, [slots.header()]), vue.createVNode("div", {
|
|
23053
|
+
}, [slots.header()])]), vue.createVNode("div", {
|
|
23047
23054
|
"class": "v-picker__body"
|
|
23048
23055
|
}, [slots.default?.()]), slots.actions?.()[0]?.children && vue.createVNode("div", {
|
|
23049
23056
|
"class": "v-picker__actions"
|
|
@@ -23121,7 +23128,9 @@
|
|
|
23121
23128
|
const isReversing = vue.shallowRef(false);
|
|
23122
23129
|
const inputModel = vue.ref(model.value.map(date => adapter.format(date, 'keyboardDate')));
|
|
23123
23130
|
const temporaryModel = vue.ref(model.value);
|
|
23124
|
-
const title = vue.computed(() =>
|
|
23131
|
+
const title = vue.computed(() => {
|
|
23132
|
+
return props.variant === 'modern' ? t(props.title) : adapter.format(displayDate.value, 'shortDate');
|
|
23133
|
+
});
|
|
23125
23134
|
const header = vue.computed(() => model.value.length ? adapter.format(model.value[0], 'normalDateWithWeekday') : t(props.header));
|
|
23126
23135
|
const headerIcon = vue.computed(() => inputMode.value === 'calendar' ? props.keyboardIcon : props.calendarIcon);
|
|
23127
23136
|
const headerTransition = vue.computed(() => `date-picker-header${isReversing.value ? '-reverse' : ''}-transition`);
|
|
@@ -23160,9 +23169,11 @@
|
|
|
23160
23169
|
function updateFromInput(input, index) {
|
|
23161
23170
|
const {
|
|
23162
23171
|
isValid,
|
|
23163
|
-
date
|
|
23172
|
+
date,
|
|
23173
|
+
isAfter
|
|
23164
23174
|
} = adapter;
|
|
23165
|
-
|
|
23175
|
+
const inputDate = date(input);
|
|
23176
|
+
if (isValid(input) && (!minDate.value || !isAfter(minDate.value, inputDate)) && (!maxDate.value || !isAfter(inputDate, maxDate.value))) {
|
|
23166
23177
|
const newModel = model.value.slice();
|
|
23167
23178
|
newModel[index] = date(input);
|
|
23168
23179
|
if (props.hideActions) {
|
|
@@ -23191,6 +23202,9 @@
|
|
|
23191
23202
|
function onClickMode() {
|
|
23192
23203
|
viewMode.value = viewMode.value === 'month' ? 'year' : 'month';
|
|
23193
23204
|
}
|
|
23205
|
+
function onClickHeader() {
|
|
23206
|
+
viewMode.value = 'month';
|
|
23207
|
+
}
|
|
23194
23208
|
const headerSlotProps = vue.computed(() => ({
|
|
23195
23209
|
header: header.value,
|
|
23196
23210
|
appendIcon: headerIcon.value,
|
|
@@ -23203,15 +23217,20 @@
|
|
|
23203
23217
|
const [datePickerMonthProps] = VDatePickerMonth.filterProps(props);
|
|
23204
23218
|
const [datePickerYearsProps] = VDatePickerYears.filterProps(props);
|
|
23205
23219
|
return vue.createVNode(VPicker, vue.mergeProps(pickerProps, {
|
|
23206
|
-
"class": ['v-date-picker', props.class],
|
|
23220
|
+
"class": ['v-date-picker', `v-date-picker--${viewMode.value}`, props.class],
|
|
23207
23221
|
"style": props.style,
|
|
23208
|
-
"title": title.value,
|
|
23209
23222
|
"width": props.showWeek ? 408 : 360
|
|
23210
23223
|
}), {
|
|
23224
|
+
title: () => slots.title?.() ?? vue.createVNode("div", {
|
|
23225
|
+
"class": "v-date-picker__title",
|
|
23226
|
+
"onClick": props.variant === 'classic' ? onClickMode : undefined
|
|
23227
|
+
}, [title.value]),
|
|
23211
23228
|
header: () => slots.header?.(headerSlotProps.value) ?? vue.createVNode(VDatePickerHeader, vue.mergeProps({
|
|
23212
23229
|
"key": "header"
|
|
23213
|
-
}, headerSlotProps.value
|
|
23214
|
-
|
|
23230
|
+
}, headerSlotProps.value, {
|
|
23231
|
+
"onClick": viewMode.value === 'year' ? onClickHeader : undefined
|
|
23232
|
+
}), null),
|
|
23233
|
+
default: () => inputMode.value === 'calendar' ? vue.createVNode(vue.Fragment, null, [(props.variant !== 'classic' || viewMode.value !== 'year') && vue.createVNode(VDatePickerControls, vue.mergeProps(datePickerControlsProps, {
|
|
23215
23234
|
"disabled": disabled.value,
|
|
23216
23235
|
"displayDate": adapter.format(displayDate.value, 'monthAndYear'),
|
|
23217
23236
|
"onClick:next": onClickNext,
|
|
@@ -24578,7 +24597,7 @@
|
|
|
24578
24597
|
date
|
|
24579
24598
|
};
|
|
24580
24599
|
}
|
|
24581
|
-
const version$1 = "3.3.
|
|
24600
|
+
const version$1 = "3.3.17";
|
|
24582
24601
|
createVuetify$1.version = version$1;
|
|
24583
24602
|
|
|
24584
24603
|
// Vue's inject() can only be used in setup
|
|
@@ -24592,7 +24611,7 @@
|
|
|
24592
24611
|
|
|
24593
24612
|
/* eslint-disable local-rules/sort-imports */
|
|
24594
24613
|
|
|
24595
|
-
const version = "3.3.
|
|
24614
|
+
const version = "3.3.17";
|
|
24596
24615
|
|
|
24597
24616
|
/* eslint-disable local-rules/sort-imports */
|
|
24598
24617
|
|