@vuetify/nightly 3.7.15-dev.2025-03-06 → 3.7.15-dev.2025-03-08
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 +10 -3
- package/dist/json/attributes.json +2892 -2852
- package/dist/json/importMap-labs.json +20 -20
- package/dist/json/importMap.json +162 -162
- package/dist/json/tags.json +10 -0
- package/dist/json/web-types.json +5263 -5172
- package/dist/vuetify-labs.css +2710 -2709
- package/dist/vuetify-labs.d.ts +238 -182
- package/dist/vuetify-labs.esm.js +849 -838
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +849 -838
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +4710 -4709
- package/dist/vuetify.d.ts +218 -162
- package/dist/vuetify.esm.js +849 -838
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +849 -838
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +479 -476
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.js +2 -13
- package/lib/components/VAutocomplete/VAutocomplete.js.map +1 -1
- package/lib/components/VColorPicker/VColorPicker.css +3 -2
- package/lib/components/VColorPicker/VColorPicker.d.ts +259 -156
- package/lib/components/VColorPicker/VColorPicker.js +16 -17
- package/lib/components/VColorPicker/VColorPicker.js.map +1 -1
- package/lib/components/VColorPicker/VColorPicker.sass +2 -1
- package/lib/components/VColorPicker/_variables.scss +1 -0
- package/lib/components/VCombobox/VCombobox.js +2 -13
- package/lib/components/VCombobox/VCombobox.js.map +1 -1
- package/lib/components/VDatePicker/VDatePicker.d.ts +6 -6
- package/lib/components/VDatePicker/VDatePicker.js +5 -2
- package/lib/components/VDatePicker/VDatePicker.js.map +1 -1
- package/lib/composables/filter.d.ts +13 -9
- package/lib/composables/filter.js +39 -8
- package/lib/composables/filter.js.map +1 -1
- package/lib/entry-bundler.js +1 -1
- package/lib/framework.d.ts +53 -53
- package/lib/framework.js +1 -1
- package/lib/labs/VCalendar/VCalendar.d.ts +6 -6
- package/lib/labs/VDateInput/VDateInput.d.ts +25 -25
- package/package.json +1 -1
package/dist/vuetify.esm.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Vuetify v3.7.15-dev.2025-03-
|
2
|
+
* Vuetify v3.7.15-dev.2025-03-08
|
3
3
|
* Forged by John Leider
|
4
4
|
* Released under the MIT License.
|
5
5
|
*/
|
@@ -13157,17 +13157,31 @@ const VSelect = genericComponent()({
|
|
13157
13157
|
// Types
|
13158
13158
|
|
13159
13159
|
/**
|
13160
|
-
* - match without highlight
|
13161
|
-
* - single match (index), length already known
|
13162
|
-
* - single match (start, end)
|
13163
|
-
* - multiple matches (start, end),
|
13160
|
+
* - boolean: match without highlight
|
13161
|
+
* - number: single match (index), length already known
|
13162
|
+
* - []: single match (start, end)
|
13163
|
+
* - [][]: multiple matches (start, end), shouldn't overlap
|
13164
13164
|
*/
|
13165
13165
|
|
13166
13166
|
// Composables
|
13167
13167
|
const defaultFilter = (value, query, item) => {
|
13168
13168
|
if (value == null || query == null) return -1;
|
13169
|
-
|
13169
|
+
value = value.toString().toLocaleLowerCase();
|
13170
|
+
query = query.toString().toLocaleLowerCase();
|
13171
|
+
const result = [];
|
13172
|
+
let idx = value.indexOf(query);
|
13173
|
+
while (~idx) {
|
13174
|
+
result.push([idx, idx + query.length]);
|
13175
|
+
idx = value.indexOf(query, idx + query.length);
|
13176
|
+
}
|
13177
|
+
return result.length ? result : -1;
|
13170
13178
|
};
|
13179
|
+
function normaliseMatch(match, query) {
|
13180
|
+
if (match == null || typeof match === 'boolean' || match === -1) return;
|
13181
|
+
if (typeof match === 'number') return [[match, query.length]];
|
13182
|
+
if (Array.isArray(match[0])) return match;
|
13183
|
+
return [match];
|
13184
|
+
}
|
13171
13185
|
const makeFilterProps = propsFactory({
|
13172
13186
|
customFilter: Function,
|
13173
13187
|
customKeyFilter: Object,
|
@@ -13198,7 +13212,7 @@ function filterItems(items, query, options) {
|
|
13198
13212
|
const keyFilter = options?.customKeyFilter?.[key];
|
13199
13213
|
match = keyFilter ? keyFilter(value, query, item) : filter(value, query, item);
|
13200
13214
|
if (match !== -1 && match !== false) {
|
13201
|
-
if (keyFilter) customMatches[key] = match;else defaultMatches[key] = match;
|
13215
|
+
if (keyFilter) customMatches[key] = normaliseMatch(match, query);else defaultMatches[key] = normaliseMatch(match, query);
|
13202
13216
|
} else if (options?.filterMode === 'every') {
|
13203
13217
|
continue loop;
|
13204
13218
|
}
|
@@ -13206,7 +13220,7 @@ function filterItems(items, query, options) {
|
|
13206
13220
|
} else {
|
13207
13221
|
match = filter(item, query, item);
|
13208
13222
|
if (match !== -1 && match !== false) {
|
13209
|
-
defaultMatches.title = match;
|
13223
|
+
defaultMatches.title = normaliseMatch(match, query);
|
13210
13224
|
}
|
13211
13225
|
}
|
13212
13226
|
const defaultMatchesLength = Object.keys(defaultMatches).length;
|
@@ -13266,20 +13280,26 @@ function useFilter(props, items, query, options) {
|
|
13266
13280
|
getMatches
|
13267
13281
|
};
|
13268
13282
|
}
|
13283
|
+
function highlightResult(name, text, matches) {
|
13284
|
+
if (matches == null || !matches.length) return text;
|
13285
|
+
return matches.map((match, i) => {
|
13286
|
+
const start = i === 0 ? 0 : matches[i - 1][1];
|
13287
|
+
const result = [createVNode("span", {
|
13288
|
+
"class": `${name}__unmask`
|
13289
|
+
}, [text.slice(start, match[0])]), createVNode("span", {
|
13290
|
+
"class": `${name}__mask`
|
13291
|
+
}, [text.slice(match[0], match[1])])];
|
13292
|
+
if (i === matches.length - 1) {
|
13293
|
+
result.push(createVNode("span", {
|
13294
|
+
"class": `${name}__unmask`
|
13295
|
+
}, [text.slice(match[1])]));
|
13296
|
+
}
|
13297
|
+
return createVNode(Fragment, null, [result]);
|
13298
|
+
});
|
13299
|
+
}
|
13269
13300
|
|
13270
13301
|
// Types
|
13271
13302
|
|
13272
|
-
function highlightResult$1(text, matches, length) {
|
13273
|
-
if (matches == null) return text;
|
13274
|
-
if (Array.isArray(matches)) throw new Error('Multiple matches is not implemented');
|
13275
|
-
return typeof matches === 'number' && ~matches ? createVNode(Fragment, null, [createVNode("span", {
|
13276
|
-
"class": "v-autocomplete__unmask"
|
13277
|
-
}, [text.substr(0, matches)]), createVNode("span", {
|
13278
|
-
"class": "v-autocomplete__mask"
|
13279
|
-
}, [text.substr(matches, length)]), createVNode("span", {
|
13280
|
-
"class": "v-autocomplete__unmask"
|
13281
|
-
}, [text.substr(matches + length)])]) : text;
|
13282
|
-
}
|
13283
13303
|
const makeVAutocompleteProps = propsFactory({
|
13284
13304
|
autoSelectFirst: {
|
13285
13305
|
type: [Boolean, String]
|
@@ -13651,7 +13671,7 @@ const VAutocomplete = genericComponent()({
|
|
13651
13671
|
}, null)]);
|
13652
13672
|
},
|
13653
13673
|
title: () => {
|
13654
|
-
return isPristine.value ? item.title : highlightResult
|
13674
|
+
return isPristine.value ? item.title : highlightResult('v-autocomplete', item.title, getMatches(item)?.title);
|
13655
13675
|
}
|
13656
13676
|
});
|
13657
13677
|
}
|
@@ -16937,6 +16957,9 @@ const VColorPickerSwatches = defineComponent({
|
|
16937
16957
|
}
|
16938
16958
|
});
|
16939
16959
|
|
16960
|
+
// Utilities
|
16961
|
+
const VPickerTitle = createSimpleFunctional('v-picker-title');
|
16962
|
+
|
16940
16963
|
const makeVSheetProps = propsFactory({
|
16941
16964
|
color: String,
|
16942
16965
|
...makeBorderProps(),
|
@@ -16991,676 +17014,66 @@ const VSheet = genericComponent()({
|
|
16991
17014
|
|
16992
17015
|
// Types
|
16993
17016
|
|
16994
|
-
const
|
16995
|
-
|
16996
|
-
|
16997
|
-
|
16998
|
-
|
16999
|
-
|
17000
|
-
|
17001
|
-
|
17002
|
-
|
17003
|
-
|
17004
|
-
|
17005
|
-
|
17006
|
-
|
17007
|
-
|
17008
|
-
type: String,
|
17009
|
-
default: 'rgba',
|
17010
|
-
validator: v => Object.keys(modes).includes(v)
|
17011
|
-
},
|
17012
|
-
modes: {
|
17013
|
-
type: Array,
|
17014
|
-
default: () => Object.keys(modes),
|
17015
|
-
validator: v => Array.isArray(v) && v.every(m => Object.keys(modes).includes(m))
|
17016
|
-
},
|
17017
|
-
showSwatches: Boolean,
|
17018
|
-
swatches: Array,
|
17019
|
-
swatchesMaxHeight: {
|
17020
|
-
type: [Number, String],
|
17021
|
-
default: 150
|
17022
|
-
},
|
17023
|
-
modelValue: {
|
17024
|
-
type: [Object, String]
|
17025
|
-
},
|
17026
|
-
...omit(makeVSheetProps({
|
17027
|
-
width: 300
|
17028
|
-
}), ['height', 'location', 'minHeight', 'maxHeight', 'minWidth', 'maxWidth'])
|
17029
|
-
}, 'VColorPicker');
|
17030
|
-
const VColorPicker = defineComponent({
|
17031
|
-
name: 'VColorPicker',
|
17032
|
-
props: makeVColorPickerProps(),
|
17033
|
-
emits: {
|
17034
|
-
'update:modelValue': color => true,
|
17035
|
-
'update:mode': mode => true
|
17036
|
-
},
|
17037
|
-
setup(props) {
|
17038
|
-
const mode = useProxiedModel(props, 'mode');
|
17039
|
-
const hue = ref(null);
|
17040
|
-
const model = useProxiedModel(props, 'modelValue', undefined, v => {
|
17041
|
-
if (v == null || v === '') return null;
|
17042
|
-
let c;
|
17043
|
-
try {
|
17044
|
-
c = RGBtoHSV(parseColor(v));
|
17045
|
-
} catch (err) {
|
17046
|
-
consoleWarn(err);
|
17047
|
-
return null;
|
17048
|
-
}
|
17049
|
-
return c;
|
17050
|
-
}, v => {
|
17051
|
-
if (!v) return null;
|
17052
|
-
return extractColor(v, props.modelValue);
|
17053
|
-
});
|
17054
|
-
const currentColor = computed(() => {
|
17055
|
-
return model.value ? {
|
17056
|
-
...model.value,
|
17057
|
-
h: hue.value ?? model.value.h
|
17058
|
-
} : null;
|
17059
|
-
});
|
17017
|
+
const makeVPickerProps = propsFactory({
|
17018
|
+
bgColor: String,
|
17019
|
+
landscape: Boolean,
|
17020
|
+
title: String,
|
17021
|
+
hideHeader: Boolean,
|
17022
|
+
...makeVSheetProps()
|
17023
|
+
}, 'VPicker');
|
17024
|
+
const VPicker = genericComponent()({
|
17025
|
+
name: 'VPicker',
|
17026
|
+
props: makeVPickerProps(),
|
17027
|
+
setup(props, _ref) {
|
17028
|
+
let {
|
17029
|
+
slots
|
17030
|
+
} = _ref;
|
17060
17031
|
const {
|
17061
|
-
|
17062
|
-
|
17063
|
-
|
17064
|
-
watch(model, v => {
|
17065
|
-
if (!externalChange) {
|
17066
|
-
// prevent hue shift from rgb conversion inaccuracy
|
17067
|
-
externalChange = true;
|
17068
|
-
return;
|
17069
|
-
}
|
17070
|
-
if (!v) return;
|
17071
|
-
hue.value = v.h;
|
17072
|
-
}, {
|
17073
|
-
immediate: true
|
17074
|
-
});
|
17075
|
-
const updateColor = hsva => {
|
17076
|
-
externalChange = false;
|
17077
|
-
hue.value = hsva.h;
|
17078
|
-
model.value = hsva;
|
17079
|
-
};
|
17080
|
-
onBeforeMount(() => {
|
17081
|
-
if (!props.modes.includes(mode.value)) mode.value = props.modes[0];
|
17082
|
-
});
|
17083
|
-
provideDefaults({
|
17084
|
-
VSlider: {
|
17085
|
-
color: undefined,
|
17086
|
-
trackColor: undefined,
|
17087
|
-
trackFillColor: undefined
|
17088
|
-
}
|
17089
|
-
});
|
17032
|
+
backgroundColorClasses,
|
17033
|
+
backgroundColorStyles
|
17034
|
+
} = useBackgroundColor(toRef(props, 'color'));
|
17090
17035
|
useRender(() => {
|
17091
17036
|
const sheetProps = VSheet.filterProps(props);
|
17092
|
-
|
17093
|
-
|
17094
|
-
"
|
17095
|
-
"
|
17096
|
-
|
17097
|
-
|
17098
|
-
|
17099
|
-
|
17100
|
-
a: 1
|
17101
|
-
})
|
17102
|
-
}, props.style]
|
17103
|
-
}, sheetProps, {
|
17104
|
-
"maxWidth": props.width
|
17037
|
+
const hasTitle = !!(props.title || slots.title);
|
17038
|
+
return createVNode(VSheet, mergeProps(sheetProps, {
|
17039
|
+
"color": props.bgColor,
|
17040
|
+
"class": ['v-picker', {
|
17041
|
+
'v-picker--landscape': props.landscape,
|
17042
|
+
'v-picker--with-actions': !!slots.actions
|
17043
|
+
}, props.class],
|
17044
|
+
"style": props.style
|
17105
17045
|
}), {
|
17106
|
-
default: () => [!props.
|
17107
|
-
"key": "
|
17108
|
-
"
|
17109
|
-
"
|
17110
|
-
|
17111
|
-
"
|
17112
|
-
|
17113
|
-
|
17114
|
-
}
|
17115
|
-
"
|
17116
|
-
|
17117
|
-
|
17118
|
-
|
17119
|
-
"
|
17120
|
-
|
17121
|
-
|
17122
|
-
|
17123
|
-
|
17124
|
-
|
17125
|
-
|
17126
|
-
"
|
17127
|
-
|
17128
|
-
|
17129
|
-
|
17130
|
-
"disabled": props.disabled
|
17131
|
-
}, null)]), props.showSwatches && createVNode(VColorPickerSwatches, {
|
17132
|
-
"key": "swatches",
|
17133
|
-
"color": currentColor.value,
|
17134
|
-
"onUpdate:color": updateColor,
|
17135
|
-
"maxHeight": props.swatchesMaxHeight,
|
17136
|
-
"swatches": props.swatches,
|
17137
|
-
"disabled": props.disabled
|
17138
|
-
}, null)]
|
17046
|
+
default: () => [!props.hideHeader && createVNode("div", {
|
17047
|
+
"key": "header",
|
17048
|
+
"class": [backgroundColorClasses.value],
|
17049
|
+
"style": [backgroundColorStyles.value]
|
17050
|
+
}, [hasTitle && createVNode(VPickerTitle, {
|
17051
|
+
"key": "picker-title"
|
17052
|
+
}, {
|
17053
|
+
default: () => [slots.title?.() ?? props.title]
|
17054
|
+
}), slots.header && createVNode("div", {
|
17055
|
+
"class": "v-picker__header"
|
17056
|
+
}, [slots.header()])]), createVNode("div", {
|
17057
|
+
"class": "v-picker__body"
|
17058
|
+
}, [slots.default?.()]), slots.actions && createVNode(VDefaultsProvider, {
|
17059
|
+
"defaults": {
|
17060
|
+
VBtn: {
|
17061
|
+
slim: true,
|
17062
|
+
variant: 'text'
|
17063
|
+
}
|
17064
|
+
}
|
17065
|
+
}, {
|
17066
|
+
default: () => [createVNode("div", {
|
17067
|
+
"class": "v-picker__actions"
|
17068
|
+
}, [slots.actions()])]
|
17069
|
+
})]
|
17139
17070
|
});
|
17140
17071
|
});
|
17141
17072
|
return {};
|
17142
17073
|
}
|
17143
17074
|
});
|
17144
|
-
|
17145
|
-
//
|
17146
|
-
|
17147
|
-
function highlightResult(text, matches, length) {
|
17148
|
-
if (matches == null) return text;
|
17149
|
-
if (Array.isArray(matches)) throw new Error('Multiple matches is not implemented');
|
17150
|
-
return typeof matches === 'number' && ~matches ? createVNode(Fragment, null, [createVNode("span", {
|
17151
|
-
"class": "v-combobox__unmask"
|
17152
|
-
}, [text.substr(0, matches)]), createVNode("span", {
|
17153
|
-
"class": "v-combobox__mask"
|
17154
|
-
}, [text.substr(matches, length)]), createVNode("span", {
|
17155
|
-
"class": "v-combobox__unmask"
|
17156
|
-
}, [text.substr(matches + length)])]) : text;
|
17157
|
-
}
|
17158
|
-
const makeVComboboxProps = propsFactory({
|
17159
|
-
autoSelectFirst: {
|
17160
|
-
type: [Boolean, String]
|
17161
|
-
},
|
17162
|
-
clearOnSelect: {
|
17163
|
-
type: Boolean,
|
17164
|
-
default: true
|
17165
|
-
},
|
17166
|
-
delimiters: Array,
|
17167
|
-
...makeFilterProps({
|
17168
|
-
filterKeys: ['title']
|
17169
|
-
}),
|
17170
|
-
...makeSelectProps({
|
17171
|
-
hideNoData: true,
|
17172
|
-
returnObject: true
|
17173
|
-
}),
|
17174
|
-
...omit(makeVTextFieldProps({
|
17175
|
-
modelValue: null,
|
17176
|
-
role: 'combobox'
|
17177
|
-
}), ['validationValue', 'dirty', 'appendInnerIcon']),
|
17178
|
-
...makeTransitionProps({
|
17179
|
-
transition: false
|
17180
|
-
})
|
17181
|
-
}, 'VCombobox');
|
17182
|
-
const VCombobox = genericComponent()({
|
17183
|
-
name: 'VCombobox',
|
17184
|
-
props: makeVComboboxProps(),
|
17185
|
-
emits: {
|
17186
|
-
'update:focused': focused => true,
|
17187
|
-
'update:modelValue': value => true,
|
17188
|
-
'update:search': value => true,
|
17189
|
-
'update:menu': value => true
|
17190
|
-
},
|
17191
|
-
setup(props, _ref) {
|
17192
|
-
let {
|
17193
|
-
emit,
|
17194
|
-
slots
|
17195
|
-
} = _ref;
|
17196
|
-
const {
|
17197
|
-
t
|
17198
|
-
} = useLocale();
|
17199
|
-
const vTextFieldRef = ref();
|
17200
|
-
const isFocused = shallowRef(false);
|
17201
|
-
const isPristine = shallowRef(true);
|
17202
|
-
const listHasFocus = shallowRef(false);
|
17203
|
-
const vMenuRef = ref();
|
17204
|
-
const vVirtualScrollRef = ref();
|
17205
|
-
const _menu = useProxiedModel(props, 'menu');
|
17206
|
-
const menu = computed({
|
17207
|
-
get: () => _menu.value,
|
17208
|
-
set: v => {
|
17209
|
-
if (_menu.value && !v && vMenuRef.value?.ΨopenChildren.size) return;
|
17210
|
-
_menu.value = v;
|
17211
|
-
}
|
17212
|
-
});
|
17213
|
-
const selectionIndex = shallowRef(-1);
|
17214
|
-
let cleared = false;
|
17215
|
-
const color = computed(() => vTextFieldRef.value?.color);
|
17216
|
-
const label = computed(() => menu.value ? props.closeText : props.openText);
|
17217
|
-
const {
|
17218
|
-
items,
|
17219
|
-
transformIn,
|
17220
|
-
transformOut
|
17221
|
-
} = useItems(props);
|
17222
|
-
const {
|
17223
|
-
textColorClasses,
|
17224
|
-
textColorStyles
|
17225
|
-
} = useTextColor(color);
|
17226
|
-
const model = useProxiedModel(props, 'modelValue', [], v => transformIn(wrapInArray(v)), v => {
|
17227
|
-
const transformed = transformOut(v);
|
17228
|
-
return props.multiple ? transformed : transformed[0] ?? null;
|
17229
|
-
});
|
17230
|
-
const form = useForm(props);
|
17231
|
-
const hasChips = computed(() => !!(props.chips || slots.chip));
|
17232
|
-
const hasSelectionSlot = computed(() => hasChips.value || !!slots.selection);
|
17233
|
-
const _search = shallowRef(!props.multiple && !hasSelectionSlot.value ? model.value[0]?.title ?? '' : '');
|
17234
|
-
const search = computed({
|
17235
|
-
get: () => {
|
17236
|
-
return _search.value;
|
17237
|
-
},
|
17238
|
-
set: val => {
|
17239
|
-
_search.value = val ?? '';
|
17240
|
-
if (!props.multiple && !hasSelectionSlot.value) {
|
17241
|
-
model.value = [transformItem$3(props, val)];
|
17242
|
-
}
|
17243
|
-
if (val && props.multiple && props.delimiters?.length) {
|
17244
|
-
const values = val.split(new RegExp(`(?:${props.delimiters.join('|')})+`));
|
17245
|
-
if (values.length > 1) {
|
17246
|
-
values.forEach(v => {
|
17247
|
-
v = v.trim();
|
17248
|
-
if (v) select(transformItem$3(props, v));
|
17249
|
-
});
|
17250
|
-
_search.value = '';
|
17251
|
-
}
|
17252
|
-
}
|
17253
|
-
if (!val) selectionIndex.value = -1;
|
17254
|
-
isPristine.value = !val;
|
17255
|
-
}
|
17256
|
-
});
|
17257
|
-
const counterValue = computed(() => {
|
17258
|
-
return typeof props.counterValue === 'function' ? props.counterValue(model.value) : typeof props.counterValue === 'number' ? props.counterValue : props.multiple ? model.value.length : search.value.length;
|
17259
|
-
});
|
17260
|
-
watch(_search, value => {
|
17261
|
-
if (cleared) {
|
17262
|
-
// wait for clear to finish, VTextField sets _search to null
|
17263
|
-
// then search computed triggers and updates _search to ''
|
17264
|
-
nextTick(() => cleared = false);
|
17265
|
-
} else if (isFocused.value && !menu.value) {
|
17266
|
-
menu.value = true;
|
17267
|
-
}
|
17268
|
-
emit('update:search', value);
|
17269
|
-
});
|
17270
|
-
watch(model, value => {
|
17271
|
-
if (!props.multiple && !hasSelectionSlot.value) {
|
17272
|
-
_search.value = value[0]?.title ?? '';
|
17273
|
-
}
|
17274
|
-
});
|
17275
|
-
const {
|
17276
|
-
filteredItems,
|
17277
|
-
getMatches
|
17278
|
-
} = useFilter(props, items, () => isPristine.value ? '' : search.value);
|
17279
|
-
const displayItems = computed(() => {
|
17280
|
-
if (props.hideSelected) {
|
17281
|
-
return filteredItems.value.filter(filteredItem => !model.value.some(s => s.value === filteredItem.value));
|
17282
|
-
}
|
17283
|
-
return filteredItems.value;
|
17284
|
-
});
|
17285
|
-
const selectedValues = computed(() => model.value.map(selection => selection.value));
|
17286
|
-
const highlightFirst = computed(() => {
|
17287
|
-
const selectFirst = props.autoSelectFirst === true || props.autoSelectFirst === 'exact' && search.value === displayItems.value[0]?.title;
|
17288
|
-
return selectFirst && displayItems.value.length > 0 && !isPristine.value && !listHasFocus.value;
|
17289
|
-
});
|
17290
|
-
const menuDisabled = computed(() => props.hideNoData && !displayItems.value.length || form.isReadonly.value || form.isDisabled.value);
|
17291
|
-
const listRef = ref();
|
17292
|
-
const listEvents = useScrolling(listRef, vTextFieldRef);
|
17293
|
-
function onClear(e) {
|
17294
|
-
cleared = true;
|
17295
|
-
if (props.openOnClear) {
|
17296
|
-
menu.value = true;
|
17297
|
-
}
|
17298
|
-
}
|
17299
|
-
function onMousedownControl() {
|
17300
|
-
if (menuDisabled.value) return;
|
17301
|
-
menu.value = true;
|
17302
|
-
}
|
17303
|
-
function onMousedownMenuIcon(e) {
|
17304
|
-
if (menuDisabled.value) return;
|
17305
|
-
if (isFocused.value) {
|
17306
|
-
e.preventDefault();
|
17307
|
-
e.stopPropagation();
|
17308
|
-
}
|
17309
|
-
menu.value = !menu.value;
|
17310
|
-
}
|
17311
|
-
function onListKeydown(e) {
|
17312
|
-
if (e.key !== ' ' && checkPrintable(e)) {
|
17313
|
-
vTextFieldRef.value?.focus();
|
17314
|
-
}
|
17315
|
-
}
|
17316
|
-
// eslint-disable-next-line complexity
|
17317
|
-
function onKeydown(e) {
|
17318
|
-
if (isComposingIgnoreKey(e) || form.isReadonly.value) return;
|
17319
|
-
const selectionStart = vTextFieldRef.value.selectionStart;
|
17320
|
-
const length = model.value.length;
|
17321
|
-
if (['Enter', 'ArrowDown', 'ArrowUp'].includes(e.key)) {
|
17322
|
-
e.preventDefault();
|
17323
|
-
}
|
17324
|
-
if (['Enter', 'ArrowDown'].includes(e.key)) {
|
17325
|
-
menu.value = true;
|
17326
|
-
}
|
17327
|
-
if (['Escape'].includes(e.key)) {
|
17328
|
-
menu.value = false;
|
17329
|
-
}
|
17330
|
-
if (['Enter', 'Escape', 'Tab'].includes(e.key)) {
|
17331
|
-
if (highlightFirst.value && ['Enter', 'Tab'].includes(e.key) && !model.value.some(_ref2 => {
|
17332
|
-
let {
|
17333
|
-
value
|
17334
|
-
} = _ref2;
|
17335
|
-
return value === displayItems.value[0].value;
|
17336
|
-
})) {
|
17337
|
-
select(filteredItems.value[0]);
|
17338
|
-
}
|
17339
|
-
isPristine.value = true;
|
17340
|
-
}
|
17341
|
-
if (e.key === 'ArrowDown' && highlightFirst.value) {
|
17342
|
-
listRef.value?.focus('next');
|
17343
|
-
}
|
17344
|
-
if (e.key === 'Enter' && search.value) {
|
17345
|
-
select(transformItem$3(props, search.value));
|
17346
|
-
if (hasSelectionSlot.value) _search.value = '';
|
17347
|
-
}
|
17348
|
-
if (['Backspace', 'Delete'].includes(e.key)) {
|
17349
|
-
if (!props.multiple && hasSelectionSlot.value && model.value.length > 0 && !search.value) return select(model.value[0], false);
|
17350
|
-
if (~selectionIndex.value) {
|
17351
|
-
e.preventDefault();
|
17352
|
-
const originalSelectionIndex = selectionIndex.value;
|
17353
|
-
select(model.value[selectionIndex.value], false);
|
17354
|
-
selectionIndex.value = originalSelectionIndex >= length - 1 ? length - 2 : originalSelectionIndex;
|
17355
|
-
} else if (e.key === 'Backspace' && !search.value) {
|
17356
|
-
selectionIndex.value = length - 1;
|
17357
|
-
}
|
17358
|
-
return;
|
17359
|
-
}
|
17360
|
-
if (!props.multiple) return;
|
17361
|
-
if (e.key === 'ArrowLeft') {
|
17362
|
-
if (selectionIndex.value < 0 && selectionStart > 0) return;
|
17363
|
-
const prev = selectionIndex.value > -1 ? selectionIndex.value - 1 : length - 1;
|
17364
|
-
if (model.value[prev]) {
|
17365
|
-
selectionIndex.value = prev;
|
17366
|
-
} else {
|
17367
|
-
selectionIndex.value = -1;
|
17368
|
-
vTextFieldRef.value.setSelectionRange(search.value.length, search.value.length);
|
17369
|
-
}
|
17370
|
-
} else if (e.key === 'ArrowRight') {
|
17371
|
-
if (selectionIndex.value < 0) return;
|
17372
|
-
const next = selectionIndex.value + 1;
|
17373
|
-
if (model.value[next]) {
|
17374
|
-
selectionIndex.value = next;
|
17375
|
-
} else {
|
17376
|
-
selectionIndex.value = -1;
|
17377
|
-
vTextFieldRef.value.setSelectionRange(0, 0);
|
17378
|
-
}
|
17379
|
-
} else if (~selectionIndex.value && checkPrintable(e)) {
|
17380
|
-
selectionIndex.value = -1;
|
17381
|
-
}
|
17382
|
-
}
|
17383
|
-
function onAfterEnter() {
|
17384
|
-
if (props.eager) {
|
17385
|
-
vVirtualScrollRef.value?.calculateVisibleItems();
|
17386
|
-
}
|
17387
|
-
}
|
17388
|
-
function onAfterLeave() {
|
17389
|
-
if (isFocused.value) {
|
17390
|
-
isPristine.value = true;
|
17391
|
-
vTextFieldRef.value?.focus();
|
17392
|
-
}
|
17393
|
-
}
|
17394
|
-
/** @param set - null means toggle */
|
17395
|
-
function select(item) {
|
17396
|
-
let set = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
17397
|
-
if (!item || item.props.disabled) return;
|
17398
|
-
if (props.multiple) {
|
17399
|
-
const index = model.value.findIndex(selection => (props.valueComparator || deepEqual)(selection.value, item.value));
|
17400
|
-
const add = set == null ? !~index : set;
|
17401
|
-
if (~index) {
|
17402
|
-
const value = add ? [...model.value, item] : [...model.value];
|
17403
|
-
value.splice(index, 1);
|
17404
|
-
model.value = value;
|
17405
|
-
} else if (add) {
|
17406
|
-
model.value = [...model.value, item];
|
17407
|
-
}
|
17408
|
-
if (props.clearOnSelect) {
|
17409
|
-
search.value = '';
|
17410
|
-
}
|
17411
|
-
} else {
|
17412
|
-
const add = set !== false;
|
17413
|
-
model.value = add ? [item] : [];
|
17414
|
-
_search.value = add && !hasSelectionSlot.value ? item.title : '';
|
17415
|
-
|
17416
|
-
// watch for search watcher to trigger
|
17417
|
-
nextTick(() => {
|
17418
|
-
menu.value = false;
|
17419
|
-
isPristine.value = true;
|
17420
|
-
});
|
17421
|
-
}
|
17422
|
-
}
|
17423
|
-
function onFocusin(e) {
|
17424
|
-
isFocused.value = true;
|
17425
|
-
setTimeout(() => {
|
17426
|
-
listHasFocus.value = true;
|
17427
|
-
});
|
17428
|
-
}
|
17429
|
-
function onFocusout(e) {
|
17430
|
-
listHasFocus.value = false;
|
17431
|
-
}
|
17432
|
-
function onUpdateModelValue(v) {
|
17433
|
-
if (v == null || v === '' && !props.multiple && !hasSelectionSlot.value) model.value = [];
|
17434
|
-
}
|
17435
|
-
watch(isFocused, (val, oldVal) => {
|
17436
|
-
if (val || val === oldVal) return;
|
17437
|
-
selectionIndex.value = -1;
|
17438
|
-
menu.value = false;
|
17439
|
-
if (search.value) {
|
17440
|
-
if (props.multiple) {
|
17441
|
-
select(transformItem$3(props, search.value));
|
17442
|
-
return;
|
17443
|
-
}
|
17444
|
-
if (!hasSelectionSlot.value) return;
|
17445
|
-
if (model.value.some(_ref3 => {
|
17446
|
-
let {
|
17447
|
-
title
|
17448
|
-
} = _ref3;
|
17449
|
-
return title === search.value;
|
17450
|
-
})) {
|
17451
|
-
_search.value = '';
|
17452
|
-
} else {
|
17453
|
-
select(transformItem$3(props, search.value));
|
17454
|
-
}
|
17455
|
-
}
|
17456
|
-
});
|
17457
|
-
watch(menu, () => {
|
17458
|
-
if (!props.hideSelected && menu.value && model.value.length) {
|
17459
|
-
const index = displayItems.value.findIndex(item => model.value.some(s => (props.valueComparator || deepEqual)(s.value, item.value)));
|
17460
|
-
IN_BROWSER && window.requestAnimationFrame(() => {
|
17461
|
-
index >= 0 && vVirtualScrollRef.value?.scrollToIndex(index);
|
17462
|
-
});
|
17463
|
-
}
|
17464
|
-
});
|
17465
|
-
watch(() => props.items, (newVal, oldVal) => {
|
17466
|
-
if (menu.value) return;
|
17467
|
-
if (isFocused.value && !oldVal.length && newVal.length) {
|
17468
|
-
menu.value = true;
|
17469
|
-
}
|
17470
|
-
});
|
17471
|
-
useRender(() => {
|
17472
|
-
const hasList = !!(!props.hideNoData || displayItems.value.length || slots['prepend-item'] || slots['append-item'] || slots['no-data']);
|
17473
|
-
const isDirty = model.value.length > 0;
|
17474
|
-
const textFieldProps = VTextField.filterProps(props);
|
17475
|
-
return createVNode(VTextField, mergeProps({
|
17476
|
-
"ref": vTextFieldRef
|
17477
|
-
}, textFieldProps, {
|
17478
|
-
"modelValue": search.value,
|
17479
|
-
"onUpdate:modelValue": [$event => search.value = $event, onUpdateModelValue],
|
17480
|
-
"focused": isFocused.value,
|
17481
|
-
"onUpdate:focused": $event => isFocused.value = $event,
|
17482
|
-
"validationValue": model.externalValue,
|
17483
|
-
"counterValue": counterValue.value,
|
17484
|
-
"dirty": isDirty,
|
17485
|
-
"class": ['v-combobox', {
|
17486
|
-
'v-combobox--active-menu': menu.value,
|
17487
|
-
'v-combobox--chips': !!props.chips,
|
17488
|
-
'v-combobox--selection-slot': !!hasSelectionSlot.value,
|
17489
|
-
'v-combobox--selecting-index': selectionIndex.value > -1,
|
17490
|
-
[`v-combobox--${props.multiple ? 'multiple' : 'single'}`]: true
|
17491
|
-
}, props.class],
|
17492
|
-
"style": props.style,
|
17493
|
-
"readonly": form.isReadonly.value,
|
17494
|
-
"placeholder": isDirty ? undefined : props.placeholder,
|
17495
|
-
"onClick:clear": onClear,
|
17496
|
-
"onMousedown:control": onMousedownControl,
|
17497
|
-
"onKeydown": onKeydown
|
17498
|
-
}), {
|
17499
|
-
...slots,
|
17500
|
-
default: () => createVNode(Fragment, null, [createVNode(VMenu, mergeProps({
|
17501
|
-
"ref": vMenuRef,
|
17502
|
-
"modelValue": menu.value,
|
17503
|
-
"onUpdate:modelValue": $event => menu.value = $event,
|
17504
|
-
"activator": "parent",
|
17505
|
-
"contentClass": "v-combobox__content",
|
17506
|
-
"disabled": menuDisabled.value,
|
17507
|
-
"eager": props.eager,
|
17508
|
-
"maxHeight": 310,
|
17509
|
-
"openOnClick": false,
|
17510
|
-
"closeOnContentClick": false,
|
17511
|
-
"transition": props.transition,
|
17512
|
-
"onAfterEnter": onAfterEnter,
|
17513
|
-
"onAfterLeave": onAfterLeave
|
17514
|
-
}, props.menuProps), {
|
17515
|
-
default: () => [hasList && createVNode(VList, mergeProps({
|
17516
|
-
"ref": listRef,
|
17517
|
-
"selected": selectedValues.value,
|
17518
|
-
"selectStrategy": props.multiple ? 'independent' : 'single-independent',
|
17519
|
-
"onMousedown": e => e.preventDefault(),
|
17520
|
-
"onKeydown": onListKeydown,
|
17521
|
-
"onFocusin": onFocusin,
|
17522
|
-
"onFocusout": onFocusout,
|
17523
|
-
"tabindex": "-1",
|
17524
|
-
"aria-live": "polite",
|
17525
|
-
"color": props.itemColor ?? props.color
|
17526
|
-
}, listEvents, props.listProps), {
|
17527
|
-
default: () => [slots['prepend-item']?.(), !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? createVNode(VListItem, {
|
17528
|
-
"key": "no-data",
|
17529
|
-
"title": t(props.noDataText)
|
17530
|
-
}, null)), createVNode(VVirtualScroll, {
|
17531
|
-
"ref": vVirtualScrollRef,
|
17532
|
-
"renderless": true,
|
17533
|
-
"items": displayItems.value,
|
17534
|
-
"itemKey": "value"
|
17535
|
-
}, {
|
17536
|
-
default: _ref4 => {
|
17537
|
-
let {
|
17538
|
-
item,
|
17539
|
-
index,
|
17540
|
-
itemRef
|
17541
|
-
} = _ref4;
|
17542
|
-
const itemProps = mergeProps(item.props, {
|
17543
|
-
ref: itemRef,
|
17544
|
-
key: item.value,
|
17545
|
-
active: highlightFirst.value && index === 0 ? true : undefined,
|
17546
|
-
onClick: () => select(item, null)
|
17547
|
-
});
|
17548
|
-
return slots.item?.({
|
17549
|
-
item,
|
17550
|
-
index,
|
17551
|
-
props: itemProps
|
17552
|
-
}) ?? createVNode(VListItem, mergeProps(itemProps, {
|
17553
|
-
"role": "option"
|
17554
|
-
}), {
|
17555
|
-
prepend: _ref5 => {
|
17556
|
-
let {
|
17557
|
-
isSelected
|
17558
|
-
} = _ref5;
|
17559
|
-
return createVNode(Fragment, null, [props.multiple && !props.hideSelected ? createVNode(VCheckboxBtn, {
|
17560
|
-
"key": item.value,
|
17561
|
-
"modelValue": isSelected,
|
17562
|
-
"ripple": false,
|
17563
|
-
"tabindex": "-1"
|
17564
|
-
}, null) : undefined, item.props.prependAvatar && createVNode(VAvatar, {
|
17565
|
-
"image": item.props.prependAvatar
|
17566
|
-
}, null), item.props.prependIcon && createVNode(VIcon, {
|
17567
|
-
"icon": item.props.prependIcon
|
17568
|
-
}, null)]);
|
17569
|
-
},
|
17570
|
-
title: () => {
|
17571
|
-
return isPristine.value ? item.title : highlightResult(item.title, getMatches(item)?.title, search.value?.length ?? 0);
|
17572
|
-
}
|
17573
|
-
});
|
17574
|
-
}
|
17575
|
-
}), slots['append-item']?.()]
|
17576
|
-
})]
|
17577
|
-
}), model.value.map((item, index) => {
|
17578
|
-
function onChipClose(e) {
|
17579
|
-
e.stopPropagation();
|
17580
|
-
e.preventDefault();
|
17581
|
-
select(item, false);
|
17582
|
-
}
|
17583
|
-
const slotProps = {
|
17584
|
-
'onClick:close': onChipClose,
|
17585
|
-
onKeydown(e) {
|
17586
|
-
if (e.key !== 'Enter' && e.key !== ' ') return;
|
17587
|
-
e.preventDefault();
|
17588
|
-
e.stopPropagation();
|
17589
|
-
onChipClose(e);
|
17590
|
-
},
|
17591
|
-
onMousedown(e) {
|
17592
|
-
e.preventDefault();
|
17593
|
-
e.stopPropagation();
|
17594
|
-
},
|
17595
|
-
modelValue: true,
|
17596
|
-
'onUpdate:modelValue': undefined
|
17597
|
-
};
|
17598
|
-
const hasSlot = hasChips.value ? !!slots.chip : !!slots.selection;
|
17599
|
-
const slotContent = hasSlot ? ensureValidVNode(hasChips.value ? slots.chip({
|
17600
|
-
item,
|
17601
|
-
index,
|
17602
|
-
props: slotProps
|
17603
|
-
}) : slots.selection({
|
17604
|
-
item,
|
17605
|
-
index
|
17606
|
-
})) : undefined;
|
17607
|
-
if (hasSlot && !slotContent) return undefined;
|
17608
|
-
return createVNode("div", {
|
17609
|
-
"key": item.value,
|
17610
|
-
"class": ['v-combobox__selection', index === selectionIndex.value && ['v-combobox__selection--selected', textColorClasses.value]],
|
17611
|
-
"style": index === selectionIndex.value ? textColorStyles.value : {}
|
17612
|
-
}, [hasChips.value ? !slots.chip ? createVNode(VChip, mergeProps({
|
17613
|
-
"key": "chip",
|
17614
|
-
"closable": props.closableChips,
|
17615
|
-
"size": "small",
|
17616
|
-
"text": item.title,
|
17617
|
-
"disabled": item.props.disabled
|
17618
|
-
}, slotProps), null) : createVNode(VDefaultsProvider, {
|
17619
|
-
"key": "chip-defaults",
|
17620
|
-
"defaults": {
|
17621
|
-
VChip: {
|
17622
|
-
closable: props.closableChips,
|
17623
|
-
size: 'small',
|
17624
|
-
text: item.title
|
17625
|
-
}
|
17626
|
-
}
|
17627
|
-
}, {
|
17628
|
-
default: () => [slotContent]
|
17629
|
-
}) : slotContent ?? createVNode("span", {
|
17630
|
-
"class": "v-combobox__selection-text"
|
17631
|
-
}, [item.title, props.multiple && index < model.value.length - 1 && createVNode("span", {
|
17632
|
-
"class": "v-combobox__selection-comma"
|
17633
|
-
}, [createTextVNode(",")])])]);
|
17634
|
-
})]),
|
17635
|
-
'append-inner': function () {
|
17636
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
17637
|
-
args[_key] = arguments[_key];
|
17638
|
-
}
|
17639
|
-
return createVNode(Fragment, null, [slots['append-inner']?.(...args), (!props.hideNoData || props.items.length) && props.menuIcon ? createVNode(VIcon, {
|
17640
|
-
"class": "v-combobox__menu-icon",
|
17641
|
-
"icon": props.menuIcon,
|
17642
|
-
"onMousedown": onMousedownMenuIcon,
|
17643
|
-
"onClick": noop,
|
17644
|
-
"aria-label": t(label.value),
|
17645
|
-
"title": t(label.value),
|
17646
|
-
"tabindex": "-1"
|
17647
|
-
}, null) : undefined]);
|
17648
|
-
}
|
17649
|
-
});
|
17650
|
-
});
|
17651
|
-
return forwardRefs({
|
17652
|
-
isFocused,
|
17653
|
-
isPristine,
|
17654
|
-
menu,
|
17655
|
-
search,
|
17656
|
-
selectionIndex,
|
17657
|
-
filteredItems,
|
17658
|
-
select
|
17659
|
-
}, vTextFieldRef);
|
17660
|
-
}
|
17661
|
-
});
|
17662
|
-
|
17663
|
-
// Utilities
|
17075
|
+
|
17076
|
+
// Utilities
|
17664
17077
|
|
17665
17078
|
// Types
|
17666
17079
|
|
@@ -18382,101 +17795,760 @@ class VuetifyDateAdapter {
|
|
18382
17795
|
endOfYear(date) {
|
18383
17796
|
return endOfYear(date);
|
18384
17797
|
}
|
18385
|
-
}
|
17798
|
+
}
|
17799
|
+
|
17800
|
+
// Composables
|
17801
|
+
const DateOptionsSymbol = Symbol.for('vuetify:date-options');
|
17802
|
+
const DateAdapterSymbol = Symbol.for('vuetify:date-adapter');
|
17803
|
+
function createDate(options, locale) {
|
17804
|
+
const _options = mergeDeep({
|
17805
|
+
adapter: VuetifyDateAdapter,
|
17806
|
+
locale: {
|
17807
|
+
af: 'af-ZA',
|
17808
|
+
// ar: '', # not the same value for all variants
|
17809
|
+
bg: 'bg-BG',
|
17810
|
+
ca: 'ca-ES',
|
17811
|
+
ckb: '',
|
17812
|
+
cs: 'cs-CZ',
|
17813
|
+
de: 'de-DE',
|
17814
|
+
el: 'el-GR',
|
17815
|
+
en: 'en-US',
|
17816
|
+
// es: '', # not the same value for all variants
|
17817
|
+
et: 'et-EE',
|
17818
|
+
fa: 'fa-IR',
|
17819
|
+
fi: 'fi-FI',
|
17820
|
+
// fr: '', #not the same value for all variants
|
17821
|
+
hr: 'hr-HR',
|
17822
|
+
hu: 'hu-HU',
|
17823
|
+
he: 'he-IL',
|
17824
|
+
id: 'id-ID',
|
17825
|
+
it: 'it-IT',
|
17826
|
+
ja: 'ja-JP',
|
17827
|
+
ko: 'ko-KR',
|
17828
|
+
lv: 'lv-LV',
|
17829
|
+
lt: 'lt-LT',
|
17830
|
+
nl: 'nl-NL',
|
17831
|
+
no: 'no-NO',
|
17832
|
+
pl: 'pl-PL',
|
17833
|
+
pt: 'pt-PT',
|
17834
|
+
ro: 'ro-RO',
|
17835
|
+
ru: 'ru-RU',
|
17836
|
+
sk: 'sk-SK',
|
17837
|
+
sl: 'sl-SI',
|
17838
|
+
srCyrl: 'sr-SP',
|
17839
|
+
srLatn: 'sr-SP',
|
17840
|
+
sv: 'sv-SE',
|
17841
|
+
th: 'th-TH',
|
17842
|
+
tr: 'tr-TR',
|
17843
|
+
az: 'az-AZ',
|
17844
|
+
uk: 'uk-UA',
|
17845
|
+
vi: 'vi-VN',
|
17846
|
+
zhHans: 'zh-CN',
|
17847
|
+
zhHant: 'zh-TW'
|
17848
|
+
}
|
17849
|
+
}, options);
|
17850
|
+
return {
|
17851
|
+
options: _options,
|
17852
|
+
instance: createInstance(_options, locale)
|
17853
|
+
};
|
17854
|
+
}
|
17855
|
+
function createInstance(options, locale) {
|
17856
|
+
const instance = reactive(typeof options.adapter === 'function'
|
17857
|
+
// eslint-disable-next-line new-cap
|
17858
|
+
? new options.adapter({
|
17859
|
+
locale: options.locale[locale.current.value] ?? locale.current.value,
|
17860
|
+
formats: options.formats
|
17861
|
+
}) : options.adapter);
|
17862
|
+
watch(locale.current, value => {
|
17863
|
+
instance.locale = options.locale[value] ?? value ?? instance.locale;
|
17864
|
+
});
|
17865
|
+
return instance;
|
17866
|
+
}
|
17867
|
+
function useDate() {
|
17868
|
+
const options = inject$1(DateOptionsSymbol);
|
17869
|
+
if (!options) throw new Error('[Vuetify] Could not find injected date options');
|
17870
|
+
const locale = useLocale();
|
17871
|
+
return createInstance(options, locale);
|
17872
|
+
}
|
17873
|
+
|
17874
|
+
// https://stackoverflow.com/questions/274861/how-do-i-calculate-the-week-number-given-a-date/275024#275024
|
17875
|
+
function getWeek(adapter, value) {
|
17876
|
+
const date = adapter.toJsDate(value);
|
17877
|
+
let year = date.getFullYear();
|
17878
|
+
let d1w1 = new Date(year, 0, 1);
|
17879
|
+
if (date < d1w1) {
|
17880
|
+
year = year - 1;
|
17881
|
+
d1w1 = new Date(year, 0, 1);
|
17882
|
+
} else {
|
17883
|
+
const tv = new Date(year + 1, 0, 1);
|
17884
|
+
if (date >= tv) {
|
17885
|
+
year = year + 1;
|
17886
|
+
d1w1 = tv;
|
17887
|
+
}
|
17888
|
+
}
|
17889
|
+
const diffTime = Math.abs(date.getTime() - d1w1.getTime());
|
17890
|
+
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
17891
|
+
return Math.floor(diffDays / 7) + 1;
|
17892
|
+
}
|
17893
|
+
|
17894
|
+
// Types
|
17895
|
+
|
17896
|
+
const makeVColorPickerProps = propsFactory({
|
17897
|
+
canvasHeight: {
|
17898
|
+
type: [String, Number],
|
17899
|
+
default: 150
|
17900
|
+
},
|
17901
|
+
disabled: Boolean,
|
17902
|
+
dotSize: {
|
17903
|
+
type: [Number, String],
|
17904
|
+
default: 10
|
17905
|
+
},
|
17906
|
+
hideCanvas: Boolean,
|
17907
|
+
hideSliders: Boolean,
|
17908
|
+
hideInputs: Boolean,
|
17909
|
+
mode: {
|
17910
|
+
type: String,
|
17911
|
+
default: 'rgba',
|
17912
|
+
validator: v => Object.keys(modes).includes(v)
|
17913
|
+
},
|
17914
|
+
modes: {
|
17915
|
+
type: Array,
|
17916
|
+
default: () => Object.keys(modes),
|
17917
|
+
validator: v => Array.isArray(v) && v.every(m => Object.keys(modes).includes(m))
|
17918
|
+
},
|
17919
|
+
showSwatches: Boolean,
|
17920
|
+
swatches: Array,
|
17921
|
+
swatchesMaxHeight: {
|
17922
|
+
type: [Number, String],
|
17923
|
+
default: 150
|
17924
|
+
},
|
17925
|
+
modelValue: {
|
17926
|
+
type: [Object, String]
|
17927
|
+
},
|
17928
|
+
...makeVPickerProps({
|
17929
|
+
hideHeader: true
|
17930
|
+
})
|
17931
|
+
}, 'VColorPicker');
|
17932
|
+
const VColorPicker = defineComponent({
|
17933
|
+
name: 'VColorPicker',
|
17934
|
+
props: makeVColorPickerProps(),
|
17935
|
+
emits: {
|
17936
|
+
'update:modelValue': color => true,
|
17937
|
+
'update:mode': mode => true
|
17938
|
+
},
|
17939
|
+
setup(props, _ref) {
|
17940
|
+
let {
|
17941
|
+
slots
|
17942
|
+
} = _ref;
|
17943
|
+
const mode = useProxiedModel(props, 'mode');
|
17944
|
+
const hue = ref(null);
|
17945
|
+
const model = useProxiedModel(props, 'modelValue', undefined, v => {
|
17946
|
+
if (v == null || v === '') return null;
|
17947
|
+
let c;
|
17948
|
+
try {
|
17949
|
+
c = RGBtoHSV(parseColor(v));
|
17950
|
+
} catch (err) {
|
17951
|
+
consoleWarn(err);
|
17952
|
+
return null;
|
17953
|
+
}
|
17954
|
+
return c;
|
17955
|
+
}, v => {
|
17956
|
+
if (!v) return null;
|
17957
|
+
return extractColor(v, props.modelValue);
|
17958
|
+
});
|
17959
|
+
const currentColor = computed(() => {
|
17960
|
+
return model.value ? {
|
17961
|
+
...model.value,
|
17962
|
+
h: hue.value ?? model.value.h
|
17963
|
+
} : null;
|
17964
|
+
});
|
17965
|
+
const {
|
17966
|
+
rtlClasses
|
17967
|
+
} = useRtl();
|
17968
|
+
let externalChange = true;
|
17969
|
+
watch(model, v => {
|
17970
|
+
if (!externalChange) {
|
17971
|
+
// prevent hue shift from rgb conversion inaccuracy
|
17972
|
+
externalChange = true;
|
17973
|
+
return;
|
17974
|
+
}
|
17975
|
+
if (!v) return;
|
17976
|
+
hue.value = v.h;
|
17977
|
+
}, {
|
17978
|
+
immediate: true
|
17979
|
+
});
|
17980
|
+
const updateColor = hsva => {
|
17981
|
+
externalChange = false;
|
17982
|
+
hue.value = hsva.h;
|
17983
|
+
model.value = hsva;
|
17984
|
+
};
|
17985
|
+
onBeforeMount(() => {
|
17986
|
+
if (!props.modes.includes(mode.value)) mode.value = props.modes[0];
|
17987
|
+
});
|
17988
|
+
provideDefaults({
|
17989
|
+
VSlider: {
|
17990
|
+
color: undefined,
|
17991
|
+
trackColor: undefined,
|
17992
|
+
trackFillColor: undefined
|
17993
|
+
}
|
17994
|
+
});
|
17995
|
+
useRender(() => {
|
17996
|
+
const pickerProps = VPicker.filterProps(props);
|
17997
|
+
return createVNode(VPicker, mergeProps(pickerProps, {
|
17998
|
+
"class": ['v-color-picker', rtlClasses.value, props.class],
|
17999
|
+
"style": [{
|
18000
|
+
'--v-color-picker-color-hsv': HSVtoCSS({
|
18001
|
+
...(currentColor.value ?? nullColor),
|
18002
|
+
a: 1
|
18003
|
+
})
|
18004
|
+
}, props.style]
|
18005
|
+
}), {
|
18006
|
+
...slots,
|
18007
|
+
default: () => createVNode(Fragment, null, [!props.hideCanvas && createVNode(VColorPickerCanvas, {
|
18008
|
+
"key": "canvas",
|
18009
|
+
"color": currentColor.value,
|
18010
|
+
"onUpdate:color": updateColor,
|
18011
|
+
"disabled": props.disabled,
|
18012
|
+
"dotSize": props.dotSize,
|
18013
|
+
"width": props.width,
|
18014
|
+
"height": props.canvasHeight
|
18015
|
+
}, null), (!props.hideSliders || !props.hideInputs) && createVNode("div", {
|
18016
|
+
"key": "controls",
|
18017
|
+
"class": "v-color-picker__controls"
|
18018
|
+
}, [!props.hideSliders && createVNode(VColorPickerPreview, {
|
18019
|
+
"key": "preview",
|
18020
|
+
"color": currentColor.value,
|
18021
|
+
"onUpdate:color": updateColor,
|
18022
|
+
"hideAlpha": !mode.value.endsWith('a'),
|
18023
|
+
"disabled": props.disabled
|
18024
|
+
}, null), !props.hideInputs && createVNode(VColorPickerEdit, {
|
18025
|
+
"key": "edit",
|
18026
|
+
"modes": props.modes,
|
18027
|
+
"mode": mode.value,
|
18028
|
+
"onUpdate:mode": m => mode.value = m,
|
18029
|
+
"color": currentColor.value,
|
18030
|
+
"onUpdate:color": updateColor,
|
18031
|
+
"disabled": props.disabled
|
18032
|
+
}, null)]), props.showSwatches && createVNode(VColorPickerSwatches, {
|
18033
|
+
"key": "swatches",
|
18034
|
+
"color": currentColor.value,
|
18035
|
+
"onUpdate:color": updateColor,
|
18036
|
+
"maxHeight": props.swatchesMaxHeight,
|
18037
|
+
"swatches": props.swatches,
|
18038
|
+
"disabled": props.disabled
|
18039
|
+
}, null)])
|
18040
|
+
});
|
18041
|
+
});
|
18042
|
+
return {};
|
18043
|
+
}
|
18044
|
+
});
|
18386
18045
|
|
18387
|
-
//
|
18388
|
-
|
18389
|
-
const
|
18390
|
-
|
18391
|
-
|
18392
|
-
|
18393
|
-
|
18394
|
-
|
18395
|
-
|
18396
|
-
|
18397
|
-
|
18398
|
-
|
18399
|
-
|
18400
|
-
|
18401
|
-
|
18402
|
-
|
18403
|
-
|
18404
|
-
|
18405
|
-
|
18406
|
-
|
18407
|
-
|
18408
|
-
|
18409
|
-
|
18410
|
-
|
18411
|
-
|
18412
|
-
|
18413
|
-
|
18414
|
-
|
18415
|
-
|
18416
|
-
|
18417
|
-
|
18418
|
-
|
18419
|
-
|
18420
|
-
|
18421
|
-
|
18422
|
-
|
18423
|
-
|
18424
|
-
|
18425
|
-
|
18426
|
-
|
18427
|
-
|
18428
|
-
|
18429
|
-
|
18430
|
-
|
18431
|
-
|
18432
|
-
|
18433
|
-
|
18434
|
-
|
18046
|
+
// Types
|
18047
|
+
|
18048
|
+
const makeVComboboxProps = propsFactory({
|
18049
|
+
autoSelectFirst: {
|
18050
|
+
type: [Boolean, String]
|
18051
|
+
},
|
18052
|
+
clearOnSelect: {
|
18053
|
+
type: Boolean,
|
18054
|
+
default: true
|
18055
|
+
},
|
18056
|
+
delimiters: Array,
|
18057
|
+
...makeFilterProps({
|
18058
|
+
filterKeys: ['title']
|
18059
|
+
}),
|
18060
|
+
...makeSelectProps({
|
18061
|
+
hideNoData: true,
|
18062
|
+
returnObject: true
|
18063
|
+
}),
|
18064
|
+
...omit(makeVTextFieldProps({
|
18065
|
+
modelValue: null,
|
18066
|
+
role: 'combobox'
|
18067
|
+
}), ['validationValue', 'dirty', 'appendInnerIcon']),
|
18068
|
+
...makeTransitionProps({
|
18069
|
+
transition: false
|
18070
|
+
})
|
18071
|
+
}, 'VCombobox');
|
18072
|
+
const VCombobox = genericComponent()({
|
18073
|
+
name: 'VCombobox',
|
18074
|
+
props: makeVComboboxProps(),
|
18075
|
+
emits: {
|
18076
|
+
'update:focused': focused => true,
|
18077
|
+
'update:modelValue': value => true,
|
18078
|
+
'update:search': value => true,
|
18079
|
+
'update:menu': value => true
|
18080
|
+
},
|
18081
|
+
setup(props, _ref) {
|
18082
|
+
let {
|
18083
|
+
emit,
|
18084
|
+
slots
|
18085
|
+
} = _ref;
|
18086
|
+
const {
|
18087
|
+
t
|
18088
|
+
} = useLocale();
|
18089
|
+
const vTextFieldRef = ref();
|
18090
|
+
const isFocused = shallowRef(false);
|
18091
|
+
const isPristine = shallowRef(true);
|
18092
|
+
const listHasFocus = shallowRef(false);
|
18093
|
+
const vMenuRef = ref();
|
18094
|
+
const vVirtualScrollRef = ref();
|
18095
|
+
const _menu = useProxiedModel(props, 'menu');
|
18096
|
+
const menu = computed({
|
18097
|
+
get: () => _menu.value,
|
18098
|
+
set: v => {
|
18099
|
+
if (_menu.value && !v && vMenuRef.value?.ΨopenChildren.size) return;
|
18100
|
+
_menu.value = v;
|
18101
|
+
}
|
18102
|
+
});
|
18103
|
+
const selectionIndex = shallowRef(-1);
|
18104
|
+
let cleared = false;
|
18105
|
+
const color = computed(() => vTextFieldRef.value?.color);
|
18106
|
+
const label = computed(() => menu.value ? props.closeText : props.openText);
|
18107
|
+
const {
|
18108
|
+
items,
|
18109
|
+
transformIn,
|
18110
|
+
transformOut
|
18111
|
+
} = useItems(props);
|
18112
|
+
const {
|
18113
|
+
textColorClasses,
|
18114
|
+
textColorStyles
|
18115
|
+
} = useTextColor(color);
|
18116
|
+
const model = useProxiedModel(props, 'modelValue', [], v => transformIn(wrapInArray(v)), v => {
|
18117
|
+
const transformed = transformOut(v);
|
18118
|
+
return props.multiple ? transformed : transformed[0] ?? null;
|
18119
|
+
});
|
18120
|
+
const form = useForm(props);
|
18121
|
+
const hasChips = computed(() => !!(props.chips || slots.chip));
|
18122
|
+
const hasSelectionSlot = computed(() => hasChips.value || !!slots.selection);
|
18123
|
+
const _search = shallowRef(!props.multiple && !hasSelectionSlot.value ? model.value[0]?.title ?? '' : '');
|
18124
|
+
const search = computed({
|
18125
|
+
get: () => {
|
18126
|
+
return _search.value;
|
18127
|
+
},
|
18128
|
+
set: val => {
|
18129
|
+
_search.value = val ?? '';
|
18130
|
+
if (!props.multiple && !hasSelectionSlot.value) {
|
18131
|
+
model.value = [transformItem$3(props, val)];
|
18132
|
+
}
|
18133
|
+
if (val && props.multiple && props.delimiters?.length) {
|
18134
|
+
const values = val.split(new RegExp(`(?:${props.delimiters.join('|')})+`));
|
18135
|
+
if (values.length > 1) {
|
18136
|
+
values.forEach(v => {
|
18137
|
+
v = v.trim();
|
18138
|
+
if (v) select(transformItem$3(props, v));
|
18139
|
+
});
|
18140
|
+
_search.value = '';
|
18141
|
+
}
|
18142
|
+
}
|
18143
|
+
if (!val) selectionIndex.value = -1;
|
18144
|
+
isPristine.value = !val;
|
18145
|
+
}
|
18146
|
+
});
|
18147
|
+
const counterValue = computed(() => {
|
18148
|
+
return typeof props.counterValue === 'function' ? props.counterValue(model.value) : typeof props.counterValue === 'number' ? props.counterValue : props.multiple ? model.value.length : search.value.length;
|
18149
|
+
});
|
18150
|
+
watch(_search, value => {
|
18151
|
+
if (cleared) {
|
18152
|
+
// wait for clear to finish, VTextField sets _search to null
|
18153
|
+
// then search computed triggers and updates _search to ''
|
18154
|
+
nextTick(() => cleared = false);
|
18155
|
+
} else if (isFocused.value && !menu.value) {
|
18156
|
+
menu.value = true;
|
18157
|
+
}
|
18158
|
+
emit('update:search', value);
|
18159
|
+
});
|
18160
|
+
watch(model, value => {
|
18161
|
+
if (!props.multiple && !hasSelectionSlot.value) {
|
18162
|
+
_search.value = value[0]?.title ?? '';
|
18163
|
+
}
|
18164
|
+
});
|
18165
|
+
const {
|
18166
|
+
filteredItems,
|
18167
|
+
getMatches
|
18168
|
+
} = useFilter(props, items, () => isPristine.value ? '' : search.value);
|
18169
|
+
const displayItems = computed(() => {
|
18170
|
+
if (props.hideSelected) {
|
18171
|
+
return filteredItems.value.filter(filteredItem => !model.value.some(s => s.value === filteredItem.value));
|
18172
|
+
}
|
18173
|
+
return filteredItems.value;
|
18174
|
+
});
|
18175
|
+
const selectedValues = computed(() => model.value.map(selection => selection.value));
|
18176
|
+
const highlightFirst = computed(() => {
|
18177
|
+
const selectFirst = props.autoSelectFirst === true || props.autoSelectFirst === 'exact' && search.value === displayItems.value[0]?.title;
|
18178
|
+
return selectFirst && displayItems.value.length > 0 && !isPristine.value && !listHasFocus.value;
|
18179
|
+
});
|
18180
|
+
const menuDisabled = computed(() => props.hideNoData && !displayItems.value.length || form.isReadonly.value || form.isDisabled.value);
|
18181
|
+
const listRef = ref();
|
18182
|
+
const listEvents = useScrolling(listRef, vTextFieldRef);
|
18183
|
+
function onClear(e) {
|
18184
|
+
cleared = true;
|
18185
|
+
if (props.openOnClear) {
|
18186
|
+
menu.value = true;
|
18187
|
+
}
|
18435
18188
|
}
|
18436
|
-
|
18437
|
-
|
18438
|
-
|
18439
|
-
|
18440
|
-
|
18441
|
-
|
18442
|
-
|
18443
|
-
|
18444
|
-
|
18445
|
-
|
18446
|
-
|
18447
|
-
|
18448
|
-
|
18449
|
-
|
18450
|
-
|
18451
|
-
|
18452
|
-
|
18453
|
-
|
18454
|
-
function
|
18455
|
-
|
18456
|
-
|
18457
|
-
|
18458
|
-
|
18459
|
-
|
18189
|
+
function onMousedownControl() {
|
18190
|
+
if (menuDisabled.value) return;
|
18191
|
+
menu.value = true;
|
18192
|
+
}
|
18193
|
+
function onMousedownMenuIcon(e) {
|
18194
|
+
if (menuDisabled.value) return;
|
18195
|
+
if (isFocused.value) {
|
18196
|
+
e.preventDefault();
|
18197
|
+
e.stopPropagation();
|
18198
|
+
}
|
18199
|
+
menu.value = !menu.value;
|
18200
|
+
}
|
18201
|
+
function onListKeydown(e) {
|
18202
|
+
if (e.key !== ' ' && checkPrintable(e)) {
|
18203
|
+
vTextFieldRef.value?.focus();
|
18204
|
+
}
|
18205
|
+
}
|
18206
|
+
// eslint-disable-next-line complexity
|
18207
|
+
function onKeydown(e) {
|
18208
|
+
if (isComposingIgnoreKey(e) || form.isReadonly.value) return;
|
18209
|
+
const selectionStart = vTextFieldRef.value.selectionStart;
|
18210
|
+
const length = model.value.length;
|
18211
|
+
if (['Enter', 'ArrowDown', 'ArrowUp'].includes(e.key)) {
|
18212
|
+
e.preventDefault();
|
18213
|
+
}
|
18214
|
+
if (['Enter', 'ArrowDown'].includes(e.key)) {
|
18215
|
+
menu.value = true;
|
18216
|
+
}
|
18217
|
+
if (['Escape'].includes(e.key)) {
|
18218
|
+
menu.value = false;
|
18219
|
+
}
|
18220
|
+
if (['Enter', 'Escape', 'Tab'].includes(e.key)) {
|
18221
|
+
if (highlightFirst.value && ['Enter', 'Tab'].includes(e.key) && !model.value.some(_ref2 => {
|
18222
|
+
let {
|
18223
|
+
value
|
18224
|
+
} = _ref2;
|
18225
|
+
return value === displayItems.value[0].value;
|
18226
|
+
})) {
|
18227
|
+
select(filteredItems.value[0]);
|
18228
|
+
}
|
18229
|
+
isPristine.value = true;
|
18230
|
+
}
|
18231
|
+
if (e.key === 'ArrowDown' && highlightFirst.value) {
|
18232
|
+
listRef.value?.focus('next');
|
18233
|
+
}
|
18234
|
+
if (e.key === 'Enter' && search.value) {
|
18235
|
+
select(transformItem$3(props, search.value));
|
18236
|
+
if (hasSelectionSlot.value) _search.value = '';
|
18237
|
+
}
|
18238
|
+
if (['Backspace', 'Delete'].includes(e.key)) {
|
18239
|
+
if (!props.multiple && hasSelectionSlot.value && model.value.length > 0 && !search.value) return select(model.value[0], false);
|
18240
|
+
if (~selectionIndex.value) {
|
18241
|
+
e.preventDefault();
|
18242
|
+
const originalSelectionIndex = selectionIndex.value;
|
18243
|
+
select(model.value[selectionIndex.value], false);
|
18244
|
+
selectionIndex.value = originalSelectionIndex >= length - 1 ? length - 2 : originalSelectionIndex;
|
18245
|
+
} else if (e.key === 'Backspace' && !search.value) {
|
18246
|
+
selectionIndex.value = length - 1;
|
18247
|
+
}
|
18248
|
+
return;
|
18249
|
+
}
|
18250
|
+
if (!props.multiple) return;
|
18251
|
+
if (e.key === 'ArrowLeft') {
|
18252
|
+
if (selectionIndex.value < 0 && selectionStart > 0) return;
|
18253
|
+
const prev = selectionIndex.value > -1 ? selectionIndex.value - 1 : length - 1;
|
18254
|
+
if (model.value[prev]) {
|
18255
|
+
selectionIndex.value = prev;
|
18256
|
+
} else {
|
18257
|
+
selectionIndex.value = -1;
|
18258
|
+
vTextFieldRef.value.setSelectionRange(search.value.length, search.value.length);
|
18259
|
+
}
|
18260
|
+
} else if (e.key === 'ArrowRight') {
|
18261
|
+
if (selectionIndex.value < 0) return;
|
18262
|
+
const next = selectionIndex.value + 1;
|
18263
|
+
if (model.value[next]) {
|
18264
|
+
selectionIndex.value = next;
|
18265
|
+
} else {
|
18266
|
+
selectionIndex.value = -1;
|
18267
|
+
vTextFieldRef.value.setSelectionRange(0, 0);
|
18268
|
+
}
|
18269
|
+
} else if (~selectionIndex.value && checkPrintable(e)) {
|
18270
|
+
selectionIndex.value = -1;
|
18271
|
+
}
|
18272
|
+
}
|
18273
|
+
function onAfterEnter() {
|
18274
|
+
if (props.eager) {
|
18275
|
+
vVirtualScrollRef.value?.calculateVisibleItems();
|
18276
|
+
}
|
18277
|
+
}
|
18278
|
+
function onAfterLeave() {
|
18279
|
+
if (isFocused.value) {
|
18280
|
+
isPristine.value = true;
|
18281
|
+
vTextFieldRef.value?.focus();
|
18282
|
+
}
|
18283
|
+
}
|
18284
|
+
/** @param set - null means toggle */
|
18285
|
+
function select(item) {
|
18286
|
+
let set = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
18287
|
+
if (!item || item.props.disabled) return;
|
18288
|
+
if (props.multiple) {
|
18289
|
+
const index = model.value.findIndex(selection => (props.valueComparator || deepEqual)(selection.value, item.value));
|
18290
|
+
const add = set == null ? !~index : set;
|
18291
|
+
if (~index) {
|
18292
|
+
const value = add ? [...model.value, item] : [...model.value];
|
18293
|
+
value.splice(index, 1);
|
18294
|
+
model.value = value;
|
18295
|
+
} else if (add) {
|
18296
|
+
model.value = [...model.value, item];
|
18297
|
+
}
|
18298
|
+
if (props.clearOnSelect) {
|
18299
|
+
search.value = '';
|
18300
|
+
}
|
18301
|
+
} else {
|
18302
|
+
const add = set !== false;
|
18303
|
+
model.value = add ? [item] : [];
|
18304
|
+
_search.value = add && !hasSelectionSlot.value ? item.title : '';
|
18460
18305
|
|
18461
|
-
//
|
18462
|
-
|
18463
|
-
|
18464
|
-
|
18465
|
-
|
18466
|
-
|
18467
|
-
|
18468
|
-
|
18469
|
-
|
18470
|
-
|
18471
|
-
|
18472
|
-
|
18473
|
-
d1w1 = tv;
|
18306
|
+
// watch for search watcher to trigger
|
18307
|
+
nextTick(() => {
|
18308
|
+
menu.value = false;
|
18309
|
+
isPristine.value = true;
|
18310
|
+
});
|
18311
|
+
}
|
18312
|
+
}
|
18313
|
+
function onFocusin(e) {
|
18314
|
+
isFocused.value = true;
|
18315
|
+
setTimeout(() => {
|
18316
|
+
listHasFocus.value = true;
|
18317
|
+
});
|
18474
18318
|
}
|
18319
|
+
function onFocusout(e) {
|
18320
|
+
listHasFocus.value = false;
|
18321
|
+
}
|
18322
|
+
function onUpdateModelValue(v) {
|
18323
|
+
if (v == null || v === '' && !props.multiple && !hasSelectionSlot.value) model.value = [];
|
18324
|
+
}
|
18325
|
+
watch(isFocused, (val, oldVal) => {
|
18326
|
+
if (val || val === oldVal) return;
|
18327
|
+
selectionIndex.value = -1;
|
18328
|
+
menu.value = false;
|
18329
|
+
if (search.value) {
|
18330
|
+
if (props.multiple) {
|
18331
|
+
select(transformItem$3(props, search.value));
|
18332
|
+
return;
|
18333
|
+
}
|
18334
|
+
if (!hasSelectionSlot.value) return;
|
18335
|
+
if (model.value.some(_ref3 => {
|
18336
|
+
let {
|
18337
|
+
title
|
18338
|
+
} = _ref3;
|
18339
|
+
return title === search.value;
|
18340
|
+
})) {
|
18341
|
+
_search.value = '';
|
18342
|
+
} else {
|
18343
|
+
select(transformItem$3(props, search.value));
|
18344
|
+
}
|
18345
|
+
}
|
18346
|
+
});
|
18347
|
+
watch(menu, () => {
|
18348
|
+
if (!props.hideSelected && menu.value && model.value.length) {
|
18349
|
+
const index = displayItems.value.findIndex(item => model.value.some(s => (props.valueComparator || deepEqual)(s.value, item.value)));
|
18350
|
+
IN_BROWSER && window.requestAnimationFrame(() => {
|
18351
|
+
index >= 0 && vVirtualScrollRef.value?.scrollToIndex(index);
|
18352
|
+
});
|
18353
|
+
}
|
18354
|
+
});
|
18355
|
+
watch(() => props.items, (newVal, oldVal) => {
|
18356
|
+
if (menu.value) return;
|
18357
|
+
if (isFocused.value && !oldVal.length && newVal.length) {
|
18358
|
+
menu.value = true;
|
18359
|
+
}
|
18360
|
+
});
|
18361
|
+
useRender(() => {
|
18362
|
+
const hasList = !!(!props.hideNoData || displayItems.value.length || slots['prepend-item'] || slots['append-item'] || slots['no-data']);
|
18363
|
+
const isDirty = model.value.length > 0;
|
18364
|
+
const textFieldProps = VTextField.filterProps(props);
|
18365
|
+
return createVNode(VTextField, mergeProps({
|
18366
|
+
"ref": vTextFieldRef
|
18367
|
+
}, textFieldProps, {
|
18368
|
+
"modelValue": search.value,
|
18369
|
+
"onUpdate:modelValue": [$event => search.value = $event, onUpdateModelValue],
|
18370
|
+
"focused": isFocused.value,
|
18371
|
+
"onUpdate:focused": $event => isFocused.value = $event,
|
18372
|
+
"validationValue": model.externalValue,
|
18373
|
+
"counterValue": counterValue.value,
|
18374
|
+
"dirty": isDirty,
|
18375
|
+
"class": ['v-combobox', {
|
18376
|
+
'v-combobox--active-menu': menu.value,
|
18377
|
+
'v-combobox--chips': !!props.chips,
|
18378
|
+
'v-combobox--selection-slot': !!hasSelectionSlot.value,
|
18379
|
+
'v-combobox--selecting-index': selectionIndex.value > -1,
|
18380
|
+
[`v-combobox--${props.multiple ? 'multiple' : 'single'}`]: true
|
18381
|
+
}, props.class],
|
18382
|
+
"style": props.style,
|
18383
|
+
"readonly": form.isReadonly.value,
|
18384
|
+
"placeholder": isDirty ? undefined : props.placeholder,
|
18385
|
+
"onClick:clear": onClear,
|
18386
|
+
"onMousedown:control": onMousedownControl,
|
18387
|
+
"onKeydown": onKeydown
|
18388
|
+
}), {
|
18389
|
+
...slots,
|
18390
|
+
default: () => createVNode(Fragment, null, [createVNode(VMenu, mergeProps({
|
18391
|
+
"ref": vMenuRef,
|
18392
|
+
"modelValue": menu.value,
|
18393
|
+
"onUpdate:modelValue": $event => menu.value = $event,
|
18394
|
+
"activator": "parent",
|
18395
|
+
"contentClass": "v-combobox__content",
|
18396
|
+
"disabled": menuDisabled.value,
|
18397
|
+
"eager": props.eager,
|
18398
|
+
"maxHeight": 310,
|
18399
|
+
"openOnClick": false,
|
18400
|
+
"closeOnContentClick": false,
|
18401
|
+
"transition": props.transition,
|
18402
|
+
"onAfterEnter": onAfterEnter,
|
18403
|
+
"onAfterLeave": onAfterLeave
|
18404
|
+
}, props.menuProps), {
|
18405
|
+
default: () => [hasList && createVNode(VList, mergeProps({
|
18406
|
+
"ref": listRef,
|
18407
|
+
"selected": selectedValues.value,
|
18408
|
+
"selectStrategy": props.multiple ? 'independent' : 'single-independent',
|
18409
|
+
"onMousedown": e => e.preventDefault(),
|
18410
|
+
"onKeydown": onListKeydown,
|
18411
|
+
"onFocusin": onFocusin,
|
18412
|
+
"onFocusout": onFocusout,
|
18413
|
+
"tabindex": "-1",
|
18414
|
+
"aria-live": "polite",
|
18415
|
+
"color": props.itemColor ?? props.color
|
18416
|
+
}, listEvents, props.listProps), {
|
18417
|
+
default: () => [slots['prepend-item']?.(), !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? createVNode(VListItem, {
|
18418
|
+
"key": "no-data",
|
18419
|
+
"title": t(props.noDataText)
|
18420
|
+
}, null)), createVNode(VVirtualScroll, {
|
18421
|
+
"ref": vVirtualScrollRef,
|
18422
|
+
"renderless": true,
|
18423
|
+
"items": displayItems.value,
|
18424
|
+
"itemKey": "value"
|
18425
|
+
}, {
|
18426
|
+
default: _ref4 => {
|
18427
|
+
let {
|
18428
|
+
item,
|
18429
|
+
index,
|
18430
|
+
itemRef
|
18431
|
+
} = _ref4;
|
18432
|
+
const itemProps = mergeProps(item.props, {
|
18433
|
+
ref: itemRef,
|
18434
|
+
key: item.value,
|
18435
|
+
active: highlightFirst.value && index === 0 ? true : undefined,
|
18436
|
+
onClick: () => select(item, null)
|
18437
|
+
});
|
18438
|
+
return slots.item?.({
|
18439
|
+
item,
|
18440
|
+
index,
|
18441
|
+
props: itemProps
|
18442
|
+
}) ?? createVNode(VListItem, mergeProps(itemProps, {
|
18443
|
+
"role": "option"
|
18444
|
+
}), {
|
18445
|
+
prepend: _ref5 => {
|
18446
|
+
let {
|
18447
|
+
isSelected
|
18448
|
+
} = _ref5;
|
18449
|
+
return createVNode(Fragment, null, [props.multiple && !props.hideSelected ? createVNode(VCheckboxBtn, {
|
18450
|
+
"key": item.value,
|
18451
|
+
"modelValue": isSelected,
|
18452
|
+
"ripple": false,
|
18453
|
+
"tabindex": "-1"
|
18454
|
+
}, null) : undefined, item.props.prependAvatar && createVNode(VAvatar, {
|
18455
|
+
"image": item.props.prependAvatar
|
18456
|
+
}, null), item.props.prependIcon && createVNode(VIcon, {
|
18457
|
+
"icon": item.props.prependIcon
|
18458
|
+
}, null)]);
|
18459
|
+
},
|
18460
|
+
title: () => {
|
18461
|
+
return isPristine.value ? item.title : highlightResult('v-combobox', item.title, getMatches(item)?.title);
|
18462
|
+
}
|
18463
|
+
});
|
18464
|
+
}
|
18465
|
+
}), slots['append-item']?.()]
|
18466
|
+
})]
|
18467
|
+
}), model.value.map((item, index) => {
|
18468
|
+
function onChipClose(e) {
|
18469
|
+
e.stopPropagation();
|
18470
|
+
e.preventDefault();
|
18471
|
+
select(item, false);
|
18472
|
+
}
|
18473
|
+
const slotProps = {
|
18474
|
+
'onClick:close': onChipClose,
|
18475
|
+
onKeydown(e) {
|
18476
|
+
if (e.key !== 'Enter' && e.key !== ' ') return;
|
18477
|
+
e.preventDefault();
|
18478
|
+
e.stopPropagation();
|
18479
|
+
onChipClose(e);
|
18480
|
+
},
|
18481
|
+
onMousedown(e) {
|
18482
|
+
e.preventDefault();
|
18483
|
+
e.stopPropagation();
|
18484
|
+
},
|
18485
|
+
modelValue: true,
|
18486
|
+
'onUpdate:modelValue': undefined
|
18487
|
+
};
|
18488
|
+
const hasSlot = hasChips.value ? !!slots.chip : !!slots.selection;
|
18489
|
+
const slotContent = hasSlot ? ensureValidVNode(hasChips.value ? slots.chip({
|
18490
|
+
item,
|
18491
|
+
index,
|
18492
|
+
props: slotProps
|
18493
|
+
}) : slots.selection({
|
18494
|
+
item,
|
18495
|
+
index
|
18496
|
+
})) : undefined;
|
18497
|
+
if (hasSlot && !slotContent) return undefined;
|
18498
|
+
return createVNode("div", {
|
18499
|
+
"key": item.value,
|
18500
|
+
"class": ['v-combobox__selection', index === selectionIndex.value && ['v-combobox__selection--selected', textColorClasses.value]],
|
18501
|
+
"style": index === selectionIndex.value ? textColorStyles.value : {}
|
18502
|
+
}, [hasChips.value ? !slots.chip ? createVNode(VChip, mergeProps({
|
18503
|
+
"key": "chip",
|
18504
|
+
"closable": props.closableChips,
|
18505
|
+
"size": "small",
|
18506
|
+
"text": item.title,
|
18507
|
+
"disabled": item.props.disabled
|
18508
|
+
}, slotProps), null) : createVNode(VDefaultsProvider, {
|
18509
|
+
"key": "chip-defaults",
|
18510
|
+
"defaults": {
|
18511
|
+
VChip: {
|
18512
|
+
closable: props.closableChips,
|
18513
|
+
size: 'small',
|
18514
|
+
text: item.title
|
18515
|
+
}
|
18516
|
+
}
|
18517
|
+
}, {
|
18518
|
+
default: () => [slotContent]
|
18519
|
+
}) : slotContent ?? createVNode("span", {
|
18520
|
+
"class": "v-combobox__selection-text"
|
18521
|
+
}, [item.title, props.multiple && index < model.value.length - 1 && createVNode("span", {
|
18522
|
+
"class": "v-combobox__selection-comma"
|
18523
|
+
}, [createTextVNode(",")])])]);
|
18524
|
+
})]),
|
18525
|
+
'append-inner': function () {
|
18526
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
18527
|
+
args[_key] = arguments[_key];
|
18528
|
+
}
|
18529
|
+
return createVNode(Fragment, null, [slots['append-inner']?.(...args), (!props.hideNoData || props.items.length) && props.menuIcon ? createVNode(VIcon, {
|
18530
|
+
"class": "v-combobox__menu-icon",
|
18531
|
+
"icon": props.menuIcon,
|
18532
|
+
"onMousedown": onMousedownMenuIcon,
|
18533
|
+
"onClick": noop,
|
18534
|
+
"aria-label": t(label.value),
|
18535
|
+
"title": t(label.value),
|
18536
|
+
"tabindex": "-1"
|
18537
|
+
}, null) : undefined]);
|
18538
|
+
}
|
18539
|
+
});
|
18540
|
+
});
|
18541
|
+
return forwardRefs({
|
18542
|
+
isFocused,
|
18543
|
+
isPristine,
|
18544
|
+
menu,
|
18545
|
+
search,
|
18546
|
+
selectionIndex,
|
18547
|
+
filteredItems,
|
18548
|
+
select
|
18549
|
+
}, vTextFieldRef);
|
18475
18550
|
}
|
18476
|
-
|
18477
|
-
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
18478
|
-
return Math.floor(diffDays / 7) + 1;
|
18479
|
-
}
|
18551
|
+
});
|
18480
18552
|
|
18481
18553
|
// Types
|
18482
18554
|
|
@@ -22425,70 +22497,6 @@ const VDatePickerYears = genericComponent()({
|
|
22425
22497
|
}
|
22426
22498
|
});
|
22427
22499
|
|
22428
|
-
// Utilities
|
22429
|
-
const VPickerTitle = createSimpleFunctional('v-picker-title');
|
22430
|
-
|
22431
|
-
// Types
|
22432
|
-
|
22433
|
-
const makeVPickerProps = propsFactory({
|
22434
|
-
bgColor: String,
|
22435
|
-
landscape: Boolean,
|
22436
|
-
title: String,
|
22437
|
-
hideHeader: Boolean,
|
22438
|
-
...makeVSheetProps()
|
22439
|
-
}, 'VPicker');
|
22440
|
-
const VPicker = genericComponent()({
|
22441
|
-
name: 'VPicker',
|
22442
|
-
props: makeVPickerProps(),
|
22443
|
-
setup(props, _ref) {
|
22444
|
-
let {
|
22445
|
-
slots
|
22446
|
-
} = _ref;
|
22447
|
-
const {
|
22448
|
-
backgroundColorClasses,
|
22449
|
-
backgroundColorStyles
|
22450
|
-
} = useBackgroundColor(toRef(props, 'color'));
|
22451
|
-
useRender(() => {
|
22452
|
-
const sheetProps = VSheet.filterProps(props);
|
22453
|
-
const hasTitle = !!(props.title || slots.title);
|
22454
|
-
return createVNode(VSheet, mergeProps(sheetProps, {
|
22455
|
-
"color": props.bgColor,
|
22456
|
-
"class": ['v-picker', {
|
22457
|
-
'v-picker--landscape': props.landscape,
|
22458
|
-
'v-picker--with-actions': !!slots.actions
|
22459
|
-
}, props.class],
|
22460
|
-
"style": props.style
|
22461
|
-
}), {
|
22462
|
-
default: () => [!props.hideHeader && createVNode("div", {
|
22463
|
-
"key": "header",
|
22464
|
-
"class": [backgroundColorClasses.value],
|
22465
|
-
"style": [backgroundColorStyles.value]
|
22466
|
-
}, [hasTitle && createVNode(VPickerTitle, {
|
22467
|
-
"key": "picker-title"
|
22468
|
-
}, {
|
22469
|
-
default: () => [slots.title?.() ?? props.title]
|
22470
|
-
}), slots.header && createVNode("div", {
|
22471
|
-
"class": "v-picker__header"
|
22472
|
-
}, [slots.header()])]), createVNode("div", {
|
22473
|
-
"class": "v-picker__body"
|
22474
|
-
}, [slots.default?.()]), slots.actions && createVNode(VDefaultsProvider, {
|
22475
|
-
"defaults": {
|
22476
|
-
VBtn: {
|
22477
|
-
slim: true,
|
22478
|
-
variant: 'text'
|
22479
|
-
}
|
22480
|
-
}
|
22481
|
-
}, {
|
22482
|
-
default: () => [createVNode("div", {
|
22483
|
-
"class": "v-picker__actions"
|
22484
|
-
}, [slots.actions()])]
|
22485
|
-
})]
|
22486
|
-
});
|
22487
|
-
});
|
22488
|
-
return {};
|
22489
|
-
}
|
22490
|
-
});
|
22491
|
-
|
22492
22500
|
// Types
|
22493
22501
|
|
22494
22502
|
// Types
|
@@ -22549,6 +22557,9 @@ const VDatePicker = genericComponent()({
|
|
22549
22557
|
const {
|
22550
22558
|
t
|
22551
22559
|
} = useLocale();
|
22560
|
+
const {
|
22561
|
+
rtlClasses
|
22562
|
+
} = useRtl();
|
22552
22563
|
const model = useProxiedModel(props, 'modelValue', undefined, v => wrapInArray(v), v => props.multiple ? v : v[0]);
|
22553
22564
|
const viewMode = useProxiedModel(props, 'viewMode');
|
22554
22565
|
// const inputMode = useProxiedModel(props, 'inputMode')
|
@@ -22686,7 +22697,7 @@ const VDatePicker = genericComponent()({
|
|
22686
22697
|
return createVNode(VPicker, mergeProps(pickerProps, {
|
22687
22698
|
"class": ['v-date-picker', `v-date-picker--${viewMode.value}`, {
|
22688
22699
|
'v-date-picker--show-week': props.showWeek
|
22689
|
-
}, props.class],
|
22700
|
+
}, rtlClasses.value, props.class],
|
22690
22701
|
"style": props.style
|
22691
22702
|
}), {
|
22692
22703
|
title: () => slots.title?.() ?? createVNode("div", {
|
@@ -28517,7 +28528,7 @@ function createVuetify$1() {
|
|
28517
28528
|
};
|
28518
28529
|
});
|
28519
28530
|
}
|
28520
|
-
const version$1 = "3.7.15-dev.2025-03-
|
28531
|
+
const version$1 = "3.7.15-dev.2025-03-08";
|
28521
28532
|
createVuetify$1.version = version$1;
|
28522
28533
|
|
28523
28534
|
// Vue's inject() can only be used in setup
|
@@ -28542,7 +28553,7 @@ const createVuetify = function () {
|
|
28542
28553
|
...options
|
28543
28554
|
});
|
28544
28555
|
};
|
28545
|
-
const version = "3.7.15-dev.2025-03-
|
28556
|
+
const version = "3.7.15-dev.2025-03-08";
|
28546
28557
|
createVuetify.version = version;
|
28547
28558
|
|
28548
28559
|
export { index as blueprints, components, createVuetify, directives, useDate, useDefaults, useDisplay, useGoTo, useLayout, useLocale, useRtl, useTheme, version };
|