@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-labs.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
|
*/
|
@@ -12924,17 +12924,31 @@ const VSelect = genericComponent()({
|
|
12924
12924
|
// Types
|
12925
12925
|
|
12926
12926
|
/**
|
12927
|
-
* - match without highlight
|
12928
|
-
* - single match (index), length already known
|
12929
|
-
* - single match (start, end)
|
12930
|
-
* - multiple matches (start, end),
|
12927
|
+
* - boolean: match without highlight
|
12928
|
+
* - number: single match (index), length already known
|
12929
|
+
* - []: single match (start, end)
|
12930
|
+
* - [][]: multiple matches (start, end), shouldn't overlap
|
12931
12931
|
*/
|
12932
12932
|
|
12933
12933
|
// Composables
|
12934
12934
|
const defaultFilter = (value, query, item) => {
|
12935
12935
|
if (value == null || query == null) return -1;
|
12936
|
-
|
12936
|
+
value = value.toString().toLocaleLowerCase();
|
12937
|
+
query = query.toString().toLocaleLowerCase();
|
12938
|
+
const result = [];
|
12939
|
+
let idx = value.indexOf(query);
|
12940
|
+
while (~idx) {
|
12941
|
+
result.push([idx, idx + query.length]);
|
12942
|
+
idx = value.indexOf(query, idx + query.length);
|
12943
|
+
}
|
12944
|
+
return result.length ? result : -1;
|
12937
12945
|
};
|
12946
|
+
function normaliseMatch(match, query) {
|
12947
|
+
if (match == null || typeof match === 'boolean' || match === -1) return;
|
12948
|
+
if (typeof match === 'number') return [[match, query.length]];
|
12949
|
+
if (Array.isArray(match[0])) return match;
|
12950
|
+
return [match];
|
12951
|
+
}
|
12938
12952
|
const makeFilterProps = propsFactory({
|
12939
12953
|
customFilter: Function,
|
12940
12954
|
customKeyFilter: Object,
|
@@ -12965,7 +12979,7 @@ function filterItems(items, query, options) {
|
|
12965
12979
|
const keyFilter = options?.customKeyFilter?.[key];
|
12966
12980
|
match = keyFilter ? keyFilter(value, query, item) : filter(value, query, item);
|
12967
12981
|
if (match !== -1 && match !== false) {
|
12968
|
-
if (keyFilter) customMatches[key] = match;else defaultMatches[key] = match;
|
12982
|
+
if (keyFilter) customMatches[key] = normaliseMatch(match, query);else defaultMatches[key] = normaliseMatch(match, query);
|
12969
12983
|
} else if (options?.filterMode === 'every') {
|
12970
12984
|
continue loop;
|
12971
12985
|
}
|
@@ -12973,7 +12987,7 @@ function filterItems(items, query, options) {
|
|
12973
12987
|
} else {
|
12974
12988
|
match = filter(item, query, item);
|
12975
12989
|
if (match !== -1 && match !== false) {
|
12976
|
-
defaultMatches.title = match;
|
12990
|
+
defaultMatches.title = normaliseMatch(match, query);
|
12977
12991
|
}
|
12978
12992
|
}
|
12979
12993
|
const defaultMatchesLength = Object.keys(defaultMatches).length;
|
@@ -13033,20 +13047,26 @@ function useFilter(props, items, query, options) {
|
|
13033
13047
|
getMatches
|
13034
13048
|
};
|
13035
13049
|
}
|
13050
|
+
function highlightResult(name, text, matches) {
|
13051
|
+
if (matches == null || !matches.length) return text;
|
13052
|
+
return matches.map((match, i) => {
|
13053
|
+
const start = i === 0 ? 0 : matches[i - 1][1];
|
13054
|
+
const result = [createVNode("span", {
|
13055
|
+
"class": `${name}__unmask`
|
13056
|
+
}, [text.slice(start, match[0])]), createVNode("span", {
|
13057
|
+
"class": `${name}__mask`
|
13058
|
+
}, [text.slice(match[0], match[1])])];
|
13059
|
+
if (i === matches.length - 1) {
|
13060
|
+
result.push(createVNode("span", {
|
13061
|
+
"class": `${name}__unmask`
|
13062
|
+
}, [text.slice(match[1])]));
|
13063
|
+
}
|
13064
|
+
return createVNode(Fragment, null, [result]);
|
13065
|
+
});
|
13066
|
+
}
|
13036
13067
|
|
13037
13068
|
// Types
|
13038
13069
|
|
13039
|
-
function highlightResult$1(text, matches, length) {
|
13040
|
-
if (matches == null) return text;
|
13041
|
-
if (Array.isArray(matches)) throw new Error('Multiple matches is not implemented');
|
13042
|
-
return typeof matches === 'number' && ~matches ? createVNode(Fragment, null, [createVNode("span", {
|
13043
|
-
"class": "v-autocomplete__unmask"
|
13044
|
-
}, [text.substr(0, matches)]), createVNode("span", {
|
13045
|
-
"class": "v-autocomplete__mask"
|
13046
|
-
}, [text.substr(matches, length)]), createVNode("span", {
|
13047
|
-
"class": "v-autocomplete__unmask"
|
13048
|
-
}, [text.substr(matches + length)])]) : text;
|
13049
|
-
}
|
13050
13070
|
const makeVAutocompleteProps = propsFactory({
|
13051
13071
|
autoSelectFirst: {
|
13052
13072
|
type: [Boolean, String]
|
@@ -13418,7 +13438,7 @@ const VAutocomplete = genericComponent()({
|
|
13418
13438
|
}, null)]);
|
13419
13439
|
},
|
13420
13440
|
title: () => {
|
13421
|
-
return isPristine.value ? item.title : highlightResult
|
13441
|
+
return isPristine.value ? item.title : highlightResult('v-autocomplete', item.title, getMatches(item)?.title);
|
13422
13442
|
}
|
13423
13443
|
});
|
13424
13444
|
}
|
@@ -16704,6 +16724,9 @@ const VColorPickerSwatches = defineComponent({
|
|
16704
16724
|
}
|
16705
16725
|
});
|
16706
16726
|
|
16727
|
+
// Utilities
|
16728
|
+
const VPickerTitle = createSimpleFunctional('v-picker-title');
|
16729
|
+
|
16707
16730
|
const makeVSheetProps = propsFactory({
|
16708
16731
|
color: String,
|
16709
16732
|
...makeBorderProps(),
|
@@ -16758,676 +16781,66 @@ const VSheet = genericComponent()({
|
|
16758
16781
|
|
16759
16782
|
// Types
|
16760
16783
|
|
16761
|
-
const
|
16762
|
-
|
16763
|
-
|
16764
|
-
|
16765
|
-
|
16766
|
-
|
16767
|
-
|
16768
|
-
|
16769
|
-
|
16770
|
-
|
16771
|
-
|
16772
|
-
|
16773
|
-
|
16774
|
-
|
16775
|
-
type: String,
|
16776
|
-
default: 'rgba',
|
16777
|
-
validator: v => Object.keys(modes).includes(v)
|
16778
|
-
},
|
16779
|
-
modes: {
|
16780
|
-
type: Array,
|
16781
|
-
default: () => Object.keys(modes),
|
16782
|
-
validator: v => Array.isArray(v) && v.every(m => Object.keys(modes).includes(m))
|
16783
|
-
},
|
16784
|
-
showSwatches: Boolean,
|
16785
|
-
swatches: Array,
|
16786
|
-
swatchesMaxHeight: {
|
16787
|
-
type: [Number, String],
|
16788
|
-
default: 150
|
16789
|
-
},
|
16790
|
-
modelValue: {
|
16791
|
-
type: [Object, String]
|
16792
|
-
},
|
16793
|
-
...omit(makeVSheetProps({
|
16794
|
-
width: 300
|
16795
|
-
}), ['height', 'location', 'minHeight', 'maxHeight', 'minWidth', 'maxWidth'])
|
16796
|
-
}, 'VColorPicker');
|
16797
|
-
const VColorPicker = defineComponent({
|
16798
|
-
name: 'VColorPicker',
|
16799
|
-
props: makeVColorPickerProps(),
|
16800
|
-
emits: {
|
16801
|
-
'update:modelValue': color => true,
|
16802
|
-
'update:mode': mode => true
|
16803
|
-
},
|
16804
|
-
setup(props) {
|
16805
|
-
const mode = useProxiedModel(props, 'mode');
|
16806
|
-
const hue = ref(null);
|
16807
|
-
const model = useProxiedModel(props, 'modelValue', undefined, v => {
|
16808
|
-
if (v == null || v === '') return null;
|
16809
|
-
let c;
|
16810
|
-
try {
|
16811
|
-
c = RGBtoHSV(parseColor(v));
|
16812
|
-
} catch (err) {
|
16813
|
-
consoleWarn(err);
|
16814
|
-
return null;
|
16815
|
-
}
|
16816
|
-
return c;
|
16817
|
-
}, v => {
|
16818
|
-
if (!v) return null;
|
16819
|
-
return extractColor(v, props.modelValue);
|
16820
|
-
});
|
16821
|
-
const currentColor = computed(() => {
|
16822
|
-
return model.value ? {
|
16823
|
-
...model.value,
|
16824
|
-
h: hue.value ?? model.value.h
|
16825
|
-
} : null;
|
16826
|
-
});
|
16784
|
+
const makeVPickerProps = propsFactory({
|
16785
|
+
bgColor: String,
|
16786
|
+
landscape: Boolean,
|
16787
|
+
title: String,
|
16788
|
+
hideHeader: Boolean,
|
16789
|
+
...makeVSheetProps()
|
16790
|
+
}, 'VPicker');
|
16791
|
+
const VPicker = genericComponent()({
|
16792
|
+
name: 'VPicker',
|
16793
|
+
props: makeVPickerProps(),
|
16794
|
+
setup(props, _ref) {
|
16795
|
+
let {
|
16796
|
+
slots
|
16797
|
+
} = _ref;
|
16827
16798
|
const {
|
16828
|
-
|
16829
|
-
|
16830
|
-
|
16831
|
-
watch(model, v => {
|
16832
|
-
if (!externalChange) {
|
16833
|
-
// prevent hue shift from rgb conversion inaccuracy
|
16834
|
-
externalChange = true;
|
16835
|
-
return;
|
16836
|
-
}
|
16837
|
-
if (!v) return;
|
16838
|
-
hue.value = v.h;
|
16839
|
-
}, {
|
16840
|
-
immediate: true
|
16841
|
-
});
|
16842
|
-
const updateColor = hsva => {
|
16843
|
-
externalChange = false;
|
16844
|
-
hue.value = hsva.h;
|
16845
|
-
model.value = hsva;
|
16846
|
-
};
|
16847
|
-
onBeforeMount(() => {
|
16848
|
-
if (!props.modes.includes(mode.value)) mode.value = props.modes[0];
|
16849
|
-
});
|
16850
|
-
provideDefaults({
|
16851
|
-
VSlider: {
|
16852
|
-
color: undefined,
|
16853
|
-
trackColor: undefined,
|
16854
|
-
trackFillColor: undefined
|
16855
|
-
}
|
16856
|
-
});
|
16799
|
+
backgroundColorClasses,
|
16800
|
+
backgroundColorStyles
|
16801
|
+
} = useBackgroundColor(toRef(props, 'color'));
|
16857
16802
|
useRender(() => {
|
16858
16803
|
const sheetProps = VSheet.filterProps(props);
|
16859
|
-
|
16860
|
-
|
16861
|
-
"
|
16862
|
-
"
|
16863
|
-
|
16864
|
-
|
16865
|
-
|
16866
|
-
|
16867
|
-
a: 1
|
16868
|
-
})
|
16869
|
-
}, props.style]
|
16870
|
-
}, sheetProps, {
|
16871
|
-
"maxWidth": props.width
|
16804
|
+
const hasTitle = !!(props.title || slots.title);
|
16805
|
+
return createVNode(VSheet, mergeProps(sheetProps, {
|
16806
|
+
"color": props.bgColor,
|
16807
|
+
"class": ['v-picker', {
|
16808
|
+
'v-picker--landscape': props.landscape,
|
16809
|
+
'v-picker--with-actions': !!slots.actions
|
16810
|
+
}, props.class],
|
16811
|
+
"style": props.style
|
16872
16812
|
}), {
|
16873
|
-
default: () => [!props.
|
16874
|
-
"key": "
|
16875
|
-
"
|
16876
|
-
"
|
16877
|
-
|
16878
|
-
"
|
16879
|
-
|
16880
|
-
|
16881
|
-
}
|
16882
|
-
"
|
16883
|
-
|
16884
|
-
|
16885
|
-
|
16886
|
-
"
|
16887
|
-
|
16888
|
-
|
16889
|
-
|
16890
|
-
|
16891
|
-
|
16892
|
-
|
16893
|
-
"
|
16894
|
-
|
16895
|
-
|
16896
|
-
|
16897
|
-
"disabled": props.disabled
|
16898
|
-
}, null)]), props.showSwatches && createVNode(VColorPickerSwatches, {
|
16899
|
-
"key": "swatches",
|
16900
|
-
"color": currentColor.value,
|
16901
|
-
"onUpdate:color": updateColor,
|
16902
|
-
"maxHeight": props.swatchesMaxHeight,
|
16903
|
-
"swatches": props.swatches,
|
16904
|
-
"disabled": props.disabled
|
16905
|
-
}, null)]
|
16813
|
+
default: () => [!props.hideHeader && createVNode("div", {
|
16814
|
+
"key": "header",
|
16815
|
+
"class": [backgroundColorClasses.value],
|
16816
|
+
"style": [backgroundColorStyles.value]
|
16817
|
+
}, [hasTitle && createVNode(VPickerTitle, {
|
16818
|
+
"key": "picker-title"
|
16819
|
+
}, {
|
16820
|
+
default: () => [slots.title?.() ?? props.title]
|
16821
|
+
}), slots.header && createVNode("div", {
|
16822
|
+
"class": "v-picker__header"
|
16823
|
+
}, [slots.header()])]), createVNode("div", {
|
16824
|
+
"class": "v-picker__body"
|
16825
|
+
}, [slots.default?.()]), slots.actions && createVNode(VDefaultsProvider, {
|
16826
|
+
"defaults": {
|
16827
|
+
VBtn: {
|
16828
|
+
slim: true,
|
16829
|
+
variant: 'text'
|
16830
|
+
}
|
16831
|
+
}
|
16832
|
+
}, {
|
16833
|
+
default: () => [createVNode("div", {
|
16834
|
+
"class": "v-picker__actions"
|
16835
|
+
}, [slots.actions()])]
|
16836
|
+
})]
|
16906
16837
|
});
|
16907
16838
|
});
|
16908
16839
|
return {};
|
16909
16840
|
}
|
16910
16841
|
});
|
16911
|
-
|
16912
|
-
//
|
16913
|
-
|
16914
|
-
function highlightResult(text, matches, length) {
|
16915
|
-
if (matches == null) return text;
|
16916
|
-
if (Array.isArray(matches)) throw new Error('Multiple matches is not implemented');
|
16917
|
-
return typeof matches === 'number' && ~matches ? createVNode(Fragment, null, [createVNode("span", {
|
16918
|
-
"class": "v-combobox__unmask"
|
16919
|
-
}, [text.substr(0, matches)]), createVNode("span", {
|
16920
|
-
"class": "v-combobox__mask"
|
16921
|
-
}, [text.substr(matches, length)]), createVNode("span", {
|
16922
|
-
"class": "v-combobox__unmask"
|
16923
|
-
}, [text.substr(matches + length)])]) : text;
|
16924
|
-
}
|
16925
|
-
const makeVComboboxProps = propsFactory({
|
16926
|
-
autoSelectFirst: {
|
16927
|
-
type: [Boolean, String]
|
16928
|
-
},
|
16929
|
-
clearOnSelect: {
|
16930
|
-
type: Boolean,
|
16931
|
-
default: true
|
16932
|
-
},
|
16933
|
-
delimiters: Array,
|
16934
|
-
...makeFilterProps({
|
16935
|
-
filterKeys: ['title']
|
16936
|
-
}),
|
16937
|
-
...makeSelectProps({
|
16938
|
-
hideNoData: true,
|
16939
|
-
returnObject: true
|
16940
|
-
}),
|
16941
|
-
...omit(makeVTextFieldProps({
|
16942
|
-
modelValue: null,
|
16943
|
-
role: 'combobox'
|
16944
|
-
}), ['validationValue', 'dirty', 'appendInnerIcon']),
|
16945
|
-
...makeTransitionProps({
|
16946
|
-
transition: false
|
16947
|
-
})
|
16948
|
-
}, 'VCombobox');
|
16949
|
-
const VCombobox = genericComponent()({
|
16950
|
-
name: 'VCombobox',
|
16951
|
-
props: makeVComboboxProps(),
|
16952
|
-
emits: {
|
16953
|
-
'update:focused': focused => true,
|
16954
|
-
'update:modelValue': value => true,
|
16955
|
-
'update:search': value => true,
|
16956
|
-
'update:menu': value => true
|
16957
|
-
},
|
16958
|
-
setup(props, _ref) {
|
16959
|
-
let {
|
16960
|
-
emit,
|
16961
|
-
slots
|
16962
|
-
} = _ref;
|
16963
|
-
const {
|
16964
|
-
t
|
16965
|
-
} = useLocale();
|
16966
|
-
const vTextFieldRef = ref();
|
16967
|
-
const isFocused = shallowRef(false);
|
16968
|
-
const isPristine = shallowRef(true);
|
16969
|
-
const listHasFocus = shallowRef(false);
|
16970
|
-
const vMenuRef = ref();
|
16971
|
-
const vVirtualScrollRef = ref();
|
16972
|
-
const _menu = useProxiedModel(props, 'menu');
|
16973
|
-
const menu = computed({
|
16974
|
-
get: () => _menu.value,
|
16975
|
-
set: v => {
|
16976
|
-
if (_menu.value && !v && vMenuRef.value?.ΨopenChildren.size) return;
|
16977
|
-
_menu.value = v;
|
16978
|
-
}
|
16979
|
-
});
|
16980
|
-
const selectionIndex = shallowRef(-1);
|
16981
|
-
let cleared = false;
|
16982
|
-
const color = computed(() => vTextFieldRef.value?.color);
|
16983
|
-
const label = computed(() => menu.value ? props.closeText : props.openText);
|
16984
|
-
const {
|
16985
|
-
items,
|
16986
|
-
transformIn,
|
16987
|
-
transformOut
|
16988
|
-
} = useItems(props);
|
16989
|
-
const {
|
16990
|
-
textColorClasses,
|
16991
|
-
textColorStyles
|
16992
|
-
} = useTextColor(color);
|
16993
|
-
const model = useProxiedModel(props, 'modelValue', [], v => transformIn(wrapInArray(v)), v => {
|
16994
|
-
const transformed = transformOut(v);
|
16995
|
-
return props.multiple ? transformed : transformed[0] ?? null;
|
16996
|
-
});
|
16997
|
-
const form = useForm(props);
|
16998
|
-
const hasChips = computed(() => !!(props.chips || slots.chip));
|
16999
|
-
const hasSelectionSlot = computed(() => hasChips.value || !!slots.selection);
|
17000
|
-
const _search = shallowRef(!props.multiple && !hasSelectionSlot.value ? model.value[0]?.title ?? '' : '');
|
17001
|
-
const search = computed({
|
17002
|
-
get: () => {
|
17003
|
-
return _search.value;
|
17004
|
-
},
|
17005
|
-
set: val => {
|
17006
|
-
_search.value = val ?? '';
|
17007
|
-
if (!props.multiple && !hasSelectionSlot.value) {
|
17008
|
-
model.value = [transformItem$3(props, val)];
|
17009
|
-
}
|
17010
|
-
if (val && props.multiple && props.delimiters?.length) {
|
17011
|
-
const values = val.split(new RegExp(`(?:${props.delimiters.join('|')})+`));
|
17012
|
-
if (values.length > 1) {
|
17013
|
-
values.forEach(v => {
|
17014
|
-
v = v.trim();
|
17015
|
-
if (v) select(transformItem$3(props, v));
|
17016
|
-
});
|
17017
|
-
_search.value = '';
|
17018
|
-
}
|
17019
|
-
}
|
17020
|
-
if (!val) selectionIndex.value = -1;
|
17021
|
-
isPristine.value = !val;
|
17022
|
-
}
|
17023
|
-
});
|
17024
|
-
const counterValue = computed(() => {
|
17025
|
-
return typeof props.counterValue === 'function' ? props.counterValue(model.value) : typeof props.counterValue === 'number' ? props.counterValue : props.multiple ? model.value.length : search.value.length;
|
17026
|
-
});
|
17027
|
-
watch(_search, value => {
|
17028
|
-
if (cleared) {
|
17029
|
-
// wait for clear to finish, VTextField sets _search to null
|
17030
|
-
// then search computed triggers and updates _search to ''
|
17031
|
-
nextTick(() => cleared = false);
|
17032
|
-
} else if (isFocused.value && !menu.value) {
|
17033
|
-
menu.value = true;
|
17034
|
-
}
|
17035
|
-
emit('update:search', value);
|
17036
|
-
});
|
17037
|
-
watch(model, value => {
|
17038
|
-
if (!props.multiple && !hasSelectionSlot.value) {
|
17039
|
-
_search.value = value[0]?.title ?? '';
|
17040
|
-
}
|
17041
|
-
});
|
17042
|
-
const {
|
17043
|
-
filteredItems,
|
17044
|
-
getMatches
|
17045
|
-
} = useFilter(props, items, () => isPristine.value ? '' : search.value);
|
17046
|
-
const displayItems = computed(() => {
|
17047
|
-
if (props.hideSelected) {
|
17048
|
-
return filteredItems.value.filter(filteredItem => !model.value.some(s => s.value === filteredItem.value));
|
17049
|
-
}
|
17050
|
-
return filteredItems.value;
|
17051
|
-
});
|
17052
|
-
const selectedValues = computed(() => model.value.map(selection => selection.value));
|
17053
|
-
const highlightFirst = computed(() => {
|
17054
|
-
const selectFirst = props.autoSelectFirst === true || props.autoSelectFirst === 'exact' && search.value === displayItems.value[0]?.title;
|
17055
|
-
return selectFirst && displayItems.value.length > 0 && !isPristine.value && !listHasFocus.value;
|
17056
|
-
});
|
17057
|
-
const menuDisabled = computed(() => props.hideNoData && !displayItems.value.length || form.isReadonly.value || form.isDisabled.value);
|
17058
|
-
const listRef = ref();
|
17059
|
-
const listEvents = useScrolling(listRef, vTextFieldRef);
|
17060
|
-
function onClear(e) {
|
17061
|
-
cleared = true;
|
17062
|
-
if (props.openOnClear) {
|
17063
|
-
menu.value = true;
|
17064
|
-
}
|
17065
|
-
}
|
17066
|
-
function onMousedownControl() {
|
17067
|
-
if (menuDisabled.value) return;
|
17068
|
-
menu.value = true;
|
17069
|
-
}
|
17070
|
-
function onMousedownMenuIcon(e) {
|
17071
|
-
if (menuDisabled.value) return;
|
17072
|
-
if (isFocused.value) {
|
17073
|
-
e.preventDefault();
|
17074
|
-
e.stopPropagation();
|
17075
|
-
}
|
17076
|
-
menu.value = !menu.value;
|
17077
|
-
}
|
17078
|
-
function onListKeydown(e) {
|
17079
|
-
if (e.key !== ' ' && checkPrintable(e)) {
|
17080
|
-
vTextFieldRef.value?.focus();
|
17081
|
-
}
|
17082
|
-
}
|
17083
|
-
// eslint-disable-next-line complexity
|
17084
|
-
function onKeydown(e) {
|
17085
|
-
if (isComposingIgnoreKey(e) || form.isReadonly.value) return;
|
17086
|
-
const selectionStart = vTextFieldRef.value.selectionStart;
|
17087
|
-
const length = model.value.length;
|
17088
|
-
if (['Enter', 'ArrowDown', 'ArrowUp'].includes(e.key)) {
|
17089
|
-
e.preventDefault();
|
17090
|
-
}
|
17091
|
-
if (['Enter', 'ArrowDown'].includes(e.key)) {
|
17092
|
-
menu.value = true;
|
17093
|
-
}
|
17094
|
-
if (['Escape'].includes(e.key)) {
|
17095
|
-
menu.value = false;
|
17096
|
-
}
|
17097
|
-
if (['Enter', 'Escape', 'Tab'].includes(e.key)) {
|
17098
|
-
if (highlightFirst.value && ['Enter', 'Tab'].includes(e.key) && !model.value.some(_ref2 => {
|
17099
|
-
let {
|
17100
|
-
value
|
17101
|
-
} = _ref2;
|
17102
|
-
return value === displayItems.value[0].value;
|
17103
|
-
})) {
|
17104
|
-
select(filteredItems.value[0]);
|
17105
|
-
}
|
17106
|
-
isPristine.value = true;
|
17107
|
-
}
|
17108
|
-
if (e.key === 'ArrowDown' && highlightFirst.value) {
|
17109
|
-
listRef.value?.focus('next');
|
17110
|
-
}
|
17111
|
-
if (e.key === 'Enter' && search.value) {
|
17112
|
-
select(transformItem$3(props, search.value));
|
17113
|
-
if (hasSelectionSlot.value) _search.value = '';
|
17114
|
-
}
|
17115
|
-
if (['Backspace', 'Delete'].includes(e.key)) {
|
17116
|
-
if (!props.multiple && hasSelectionSlot.value && model.value.length > 0 && !search.value) return select(model.value[0], false);
|
17117
|
-
if (~selectionIndex.value) {
|
17118
|
-
e.preventDefault();
|
17119
|
-
const originalSelectionIndex = selectionIndex.value;
|
17120
|
-
select(model.value[selectionIndex.value], false);
|
17121
|
-
selectionIndex.value = originalSelectionIndex >= length - 1 ? length - 2 : originalSelectionIndex;
|
17122
|
-
} else if (e.key === 'Backspace' && !search.value) {
|
17123
|
-
selectionIndex.value = length - 1;
|
17124
|
-
}
|
17125
|
-
return;
|
17126
|
-
}
|
17127
|
-
if (!props.multiple) return;
|
17128
|
-
if (e.key === 'ArrowLeft') {
|
17129
|
-
if (selectionIndex.value < 0 && selectionStart > 0) return;
|
17130
|
-
const prev = selectionIndex.value > -1 ? selectionIndex.value - 1 : length - 1;
|
17131
|
-
if (model.value[prev]) {
|
17132
|
-
selectionIndex.value = prev;
|
17133
|
-
} else {
|
17134
|
-
selectionIndex.value = -1;
|
17135
|
-
vTextFieldRef.value.setSelectionRange(search.value.length, search.value.length);
|
17136
|
-
}
|
17137
|
-
} else if (e.key === 'ArrowRight') {
|
17138
|
-
if (selectionIndex.value < 0) return;
|
17139
|
-
const next = selectionIndex.value + 1;
|
17140
|
-
if (model.value[next]) {
|
17141
|
-
selectionIndex.value = next;
|
17142
|
-
} else {
|
17143
|
-
selectionIndex.value = -1;
|
17144
|
-
vTextFieldRef.value.setSelectionRange(0, 0);
|
17145
|
-
}
|
17146
|
-
} else if (~selectionIndex.value && checkPrintable(e)) {
|
17147
|
-
selectionIndex.value = -1;
|
17148
|
-
}
|
17149
|
-
}
|
17150
|
-
function onAfterEnter() {
|
17151
|
-
if (props.eager) {
|
17152
|
-
vVirtualScrollRef.value?.calculateVisibleItems();
|
17153
|
-
}
|
17154
|
-
}
|
17155
|
-
function onAfterLeave() {
|
17156
|
-
if (isFocused.value) {
|
17157
|
-
isPristine.value = true;
|
17158
|
-
vTextFieldRef.value?.focus();
|
17159
|
-
}
|
17160
|
-
}
|
17161
|
-
/** @param set - null means toggle */
|
17162
|
-
function select(item) {
|
17163
|
-
let set = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
17164
|
-
if (!item || item.props.disabled) return;
|
17165
|
-
if (props.multiple) {
|
17166
|
-
const index = model.value.findIndex(selection => (props.valueComparator || deepEqual)(selection.value, item.value));
|
17167
|
-
const add = set == null ? !~index : set;
|
17168
|
-
if (~index) {
|
17169
|
-
const value = add ? [...model.value, item] : [...model.value];
|
17170
|
-
value.splice(index, 1);
|
17171
|
-
model.value = value;
|
17172
|
-
} else if (add) {
|
17173
|
-
model.value = [...model.value, item];
|
17174
|
-
}
|
17175
|
-
if (props.clearOnSelect) {
|
17176
|
-
search.value = '';
|
17177
|
-
}
|
17178
|
-
} else {
|
17179
|
-
const add = set !== false;
|
17180
|
-
model.value = add ? [item] : [];
|
17181
|
-
_search.value = add && !hasSelectionSlot.value ? item.title : '';
|
17182
|
-
|
17183
|
-
// watch for search watcher to trigger
|
17184
|
-
nextTick(() => {
|
17185
|
-
menu.value = false;
|
17186
|
-
isPristine.value = true;
|
17187
|
-
});
|
17188
|
-
}
|
17189
|
-
}
|
17190
|
-
function onFocusin(e) {
|
17191
|
-
isFocused.value = true;
|
17192
|
-
setTimeout(() => {
|
17193
|
-
listHasFocus.value = true;
|
17194
|
-
});
|
17195
|
-
}
|
17196
|
-
function onFocusout(e) {
|
17197
|
-
listHasFocus.value = false;
|
17198
|
-
}
|
17199
|
-
function onUpdateModelValue(v) {
|
17200
|
-
if (v == null || v === '' && !props.multiple && !hasSelectionSlot.value) model.value = [];
|
17201
|
-
}
|
17202
|
-
watch(isFocused, (val, oldVal) => {
|
17203
|
-
if (val || val === oldVal) return;
|
17204
|
-
selectionIndex.value = -1;
|
17205
|
-
menu.value = false;
|
17206
|
-
if (search.value) {
|
17207
|
-
if (props.multiple) {
|
17208
|
-
select(transformItem$3(props, search.value));
|
17209
|
-
return;
|
17210
|
-
}
|
17211
|
-
if (!hasSelectionSlot.value) return;
|
17212
|
-
if (model.value.some(_ref3 => {
|
17213
|
-
let {
|
17214
|
-
title
|
17215
|
-
} = _ref3;
|
17216
|
-
return title === search.value;
|
17217
|
-
})) {
|
17218
|
-
_search.value = '';
|
17219
|
-
} else {
|
17220
|
-
select(transformItem$3(props, search.value));
|
17221
|
-
}
|
17222
|
-
}
|
17223
|
-
});
|
17224
|
-
watch(menu, () => {
|
17225
|
-
if (!props.hideSelected && menu.value && model.value.length) {
|
17226
|
-
const index = displayItems.value.findIndex(item => model.value.some(s => (props.valueComparator || deepEqual)(s.value, item.value)));
|
17227
|
-
IN_BROWSER && window.requestAnimationFrame(() => {
|
17228
|
-
index >= 0 && vVirtualScrollRef.value?.scrollToIndex(index);
|
17229
|
-
});
|
17230
|
-
}
|
17231
|
-
});
|
17232
|
-
watch(() => props.items, (newVal, oldVal) => {
|
17233
|
-
if (menu.value) return;
|
17234
|
-
if (isFocused.value && !oldVal.length && newVal.length) {
|
17235
|
-
menu.value = true;
|
17236
|
-
}
|
17237
|
-
});
|
17238
|
-
useRender(() => {
|
17239
|
-
const hasList = !!(!props.hideNoData || displayItems.value.length || slots['prepend-item'] || slots['append-item'] || slots['no-data']);
|
17240
|
-
const isDirty = model.value.length > 0;
|
17241
|
-
const textFieldProps = VTextField.filterProps(props);
|
17242
|
-
return createVNode(VTextField, mergeProps({
|
17243
|
-
"ref": vTextFieldRef
|
17244
|
-
}, textFieldProps, {
|
17245
|
-
"modelValue": search.value,
|
17246
|
-
"onUpdate:modelValue": [$event => search.value = $event, onUpdateModelValue],
|
17247
|
-
"focused": isFocused.value,
|
17248
|
-
"onUpdate:focused": $event => isFocused.value = $event,
|
17249
|
-
"validationValue": model.externalValue,
|
17250
|
-
"counterValue": counterValue.value,
|
17251
|
-
"dirty": isDirty,
|
17252
|
-
"class": ['v-combobox', {
|
17253
|
-
'v-combobox--active-menu': menu.value,
|
17254
|
-
'v-combobox--chips': !!props.chips,
|
17255
|
-
'v-combobox--selection-slot': !!hasSelectionSlot.value,
|
17256
|
-
'v-combobox--selecting-index': selectionIndex.value > -1,
|
17257
|
-
[`v-combobox--${props.multiple ? 'multiple' : 'single'}`]: true
|
17258
|
-
}, props.class],
|
17259
|
-
"style": props.style,
|
17260
|
-
"readonly": form.isReadonly.value,
|
17261
|
-
"placeholder": isDirty ? undefined : props.placeholder,
|
17262
|
-
"onClick:clear": onClear,
|
17263
|
-
"onMousedown:control": onMousedownControl,
|
17264
|
-
"onKeydown": onKeydown
|
17265
|
-
}), {
|
17266
|
-
...slots,
|
17267
|
-
default: () => createVNode(Fragment, null, [createVNode(VMenu, mergeProps({
|
17268
|
-
"ref": vMenuRef,
|
17269
|
-
"modelValue": menu.value,
|
17270
|
-
"onUpdate:modelValue": $event => menu.value = $event,
|
17271
|
-
"activator": "parent",
|
17272
|
-
"contentClass": "v-combobox__content",
|
17273
|
-
"disabled": menuDisabled.value,
|
17274
|
-
"eager": props.eager,
|
17275
|
-
"maxHeight": 310,
|
17276
|
-
"openOnClick": false,
|
17277
|
-
"closeOnContentClick": false,
|
17278
|
-
"transition": props.transition,
|
17279
|
-
"onAfterEnter": onAfterEnter,
|
17280
|
-
"onAfterLeave": onAfterLeave
|
17281
|
-
}, props.menuProps), {
|
17282
|
-
default: () => [hasList && createVNode(VList, mergeProps({
|
17283
|
-
"ref": listRef,
|
17284
|
-
"selected": selectedValues.value,
|
17285
|
-
"selectStrategy": props.multiple ? 'independent' : 'single-independent',
|
17286
|
-
"onMousedown": e => e.preventDefault(),
|
17287
|
-
"onKeydown": onListKeydown,
|
17288
|
-
"onFocusin": onFocusin,
|
17289
|
-
"onFocusout": onFocusout,
|
17290
|
-
"tabindex": "-1",
|
17291
|
-
"aria-live": "polite",
|
17292
|
-
"color": props.itemColor ?? props.color
|
17293
|
-
}, listEvents, props.listProps), {
|
17294
|
-
default: () => [slots['prepend-item']?.(), !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? createVNode(VListItem, {
|
17295
|
-
"key": "no-data",
|
17296
|
-
"title": t(props.noDataText)
|
17297
|
-
}, null)), createVNode(VVirtualScroll, {
|
17298
|
-
"ref": vVirtualScrollRef,
|
17299
|
-
"renderless": true,
|
17300
|
-
"items": displayItems.value,
|
17301
|
-
"itemKey": "value"
|
17302
|
-
}, {
|
17303
|
-
default: _ref4 => {
|
17304
|
-
let {
|
17305
|
-
item,
|
17306
|
-
index,
|
17307
|
-
itemRef
|
17308
|
-
} = _ref4;
|
17309
|
-
const itemProps = mergeProps(item.props, {
|
17310
|
-
ref: itemRef,
|
17311
|
-
key: item.value,
|
17312
|
-
active: highlightFirst.value && index === 0 ? true : undefined,
|
17313
|
-
onClick: () => select(item, null)
|
17314
|
-
});
|
17315
|
-
return slots.item?.({
|
17316
|
-
item,
|
17317
|
-
index,
|
17318
|
-
props: itemProps
|
17319
|
-
}) ?? createVNode(VListItem, mergeProps(itemProps, {
|
17320
|
-
"role": "option"
|
17321
|
-
}), {
|
17322
|
-
prepend: _ref5 => {
|
17323
|
-
let {
|
17324
|
-
isSelected
|
17325
|
-
} = _ref5;
|
17326
|
-
return createVNode(Fragment, null, [props.multiple && !props.hideSelected ? createVNode(VCheckboxBtn, {
|
17327
|
-
"key": item.value,
|
17328
|
-
"modelValue": isSelected,
|
17329
|
-
"ripple": false,
|
17330
|
-
"tabindex": "-1"
|
17331
|
-
}, null) : undefined, item.props.prependAvatar && createVNode(VAvatar, {
|
17332
|
-
"image": item.props.prependAvatar
|
17333
|
-
}, null), item.props.prependIcon && createVNode(VIcon, {
|
17334
|
-
"icon": item.props.prependIcon
|
17335
|
-
}, null)]);
|
17336
|
-
},
|
17337
|
-
title: () => {
|
17338
|
-
return isPristine.value ? item.title : highlightResult(item.title, getMatches(item)?.title, search.value?.length ?? 0);
|
17339
|
-
}
|
17340
|
-
});
|
17341
|
-
}
|
17342
|
-
}), slots['append-item']?.()]
|
17343
|
-
})]
|
17344
|
-
}), model.value.map((item, index) => {
|
17345
|
-
function onChipClose(e) {
|
17346
|
-
e.stopPropagation();
|
17347
|
-
e.preventDefault();
|
17348
|
-
select(item, false);
|
17349
|
-
}
|
17350
|
-
const slotProps = {
|
17351
|
-
'onClick:close': onChipClose,
|
17352
|
-
onKeydown(e) {
|
17353
|
-
if (e.key !== 'Enter' && e.key !== ' ') return;
|
17354
|
-
e.preventDefault();
|
17355
|
-
e.stopPropagation();
|
17356
|
-
onChipClose(e);
|
17357
|
-
},
|
17358
|
-
onMousedown(e) {
|
17359
|
-
e.preventDefault();
|
17360
|
-
e.stopPropagation();
|
17361
|
-
},
|
17362
|
-
modelValue: true,
|
17363
|
-
'onUpdate:modelValue': undefined
|
17364
|
-
};
|
17365
|
-
const hasSlot = hasChips.value ? !!slots.chip : !!slots.selection;
|
17366
|
-
const slotContent = hasSlot ? ensureValidVNode(hasChips.value ? slots.chip({
|
17367
|
-
item,
|
17368
|
-
index,
|
17369
|
-
props: slotProps
|
17370
|
-
}) : slots.selection({
|
17371
|
-
item,
|
17372
|
-
index
|
17373
|
-
})) : undefined;
|
17374
|
-
if (hasSlot && !slotContent) return undefined;
|
17375
|
-
return createVNode("div", {
|
17376
|
-
"key": item.value,
|
17377
|
-
"class": ['v-combobox__selection', index === selectionIndex.value && ['v-combobox__selection--selected', textColorClasses.value]],
|
17378
|
-
"style": index === selectionIndex.value ? textColorStyles.value : {}
|
17379
|
-
}, [hasChips.value ? !slots.chip ? createVNode(VChip, mergeProps({
|
17380
|
-
"key": "chip",
|
17381
|
-
"closable": props.closableChips,
|
17382
|
-
"size": "small",
|
17383
|
-
"text": item.title,
|
17384
|
-
"disabled": item.props.disabled
|
17385
|
-
}, slotProps), null) : createVNode(VDefaultsProvider, {
|
17386
|
-
"key": "chip-defaults",
|
17387
|
-
"defaults": {
|
17388
|
-
VChip: {
|
17389
|
-
closable: props.closableChips,
|
17390
|
-
size: 'small',
|
17391
|
-
text: item.title
|
17392
|
-
}
|
17393
|
-
}
|
17394
|
-
}, {
|
17395
|
-
default: () => [slotContent]
|
17396
|
-
}) : slotContent ?? createVNode("span", {
|
17397
|
-
"class": "v-combobox__selection-text"
|
17398
|
-
}, [item.title, props.multiple && index < model.value.length - 1 && createVNode("span", {
|
17399
|
-
"class": "v-combobox__selection-comma"
|
17400
|
-
}, [createTextVNode(",")])])]);
|
17401
|
-
})]),
|
17402
|
-
'append-inner': function () {
|
17403
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
17404
|
-
args[_key] = arguments[_key];
|
17405
|
-
}
|
17406
|
-
return createVNode(Fragment, null, [slots['append-inner']?.(...args), (!props.hideNoData || props.items.length) && props.menuIcon ? createVNode(VIcon, {
|
17407
|
-
"class": "v-combobox__menu-icon",
|
17408
|
-
"icon": props.menuIcon,
|
17409
|
-
"onMousedown": onMousedownMenuIcon,
|
17410
|
-
"onClick": noop,
|
17411
|
-
"aria-label": t(label.value),
|
17412
|
-
"title": t(label.value),
|
17413
|
-
"tabindex": "-1"
|
17414
|
-
}, null) : undefined]);
|
17415
|
-
}
|
17416
|
-
});
|
17417
|
-
});
|
17418
|
-
return forwardRefs({
|
17419
|
-
isFocused,
|
17420
|
-
isPristine,
|
17421
|
-
menu,
|
17422
|
-
search,
|
17423
|
-
selectionIndex,
|
17424
|
-
filteredItems,
|
17425
|
-
select
|
17426
|
-
}, vTextFieldRef);
|
17427
|
-
}
|
17428
|
-
});
|
17429
|
-
|
17430
|
-
// Utilities
|
16842
|
+
|
16843
|
+
// Utilities
|
17431
16844
|
|
17432
16845
|
// Types
|
17433
16846
|
|
@@ -18149,101 +17562,760 @@ class VuetifyDateAdapter {
|
|
18149
17562
|
endOfYear(date) {
|
18150
17563
|
return endOfYear(date);
|
18151
17564
|
}
|
18152
|
-
}
|
17565
|
+
}
|
17566
|
+
|
17567
|
+
// Composables
|
17568
|
+
const DateOptionsSymbol = Symbol.for('vuetify:date-options');
|
17569
|
+
const DateAdapterSymbol = Symbol.for('vuetify:date-adapter');
|
17570
|
+
function createDate(options, locale) {
|
17571
|
+
const _options = mergeDeep({
|
17572
|
+
adapter: VuetifyDateAdapter,
|
17573
|
+
locale: {
|
17574
|
+
af: 'af-ZA',
|
17575
|
+
// ar: '', # not the same value for all variants
|
17576
|
+
bg: 'bg-BG',
|
17577
|
+
ca: 'ca-ES',
|
17578
|
+
ckb: '',
|
17579
|
+
cs: 'cs-CZ',
|
17580
|
+
de: 'de-DE',
|
17581
|
+
el: 'el-GR',
|
17582
|
+
en: 'en-US',
|
17583
|
+
// es: '', # not the same value for all variants
|
17584
|
+
et: 'et-EE',
|
17585
|
+
fa: 'fa-IR',
|
17586
|
+
fi: 'fi-FI',
|
17587
|
+
// fr: '', #not the same value for all variants
|
17588
|
+
hr: 'hr-HR',
|
17589
|
+
hu: 'hu-HU',
|
17590
|
+
he: 'he-IL',
|
17591
|
+
id: 'id-ID',
|
17592
|
+
it: 'it-IT',
|
17593
|
+
ja: 'ja-JP',
|
17594
|
+
ko: 'ko-KR',
|
17595
|
+
lv: 'lv-LV',
|
17596
|
+
lt: 'lt-LT',
|
17597
|
+
nl: 'nl-NL',
|
17598
|
+
no: 'no-NO',
|
17599
|
+
pl: 'pl-PL',
|
17600
|
+
pt: 'pt-PT',
|
17601
|
+
ro: 'ro-RO',
|
17602
|
+
ru: 'ru-RU',
|
17603
|
+
sk: 'sk-SK',
|
17604
|
+
sl: 'sl-SI',
|
17605
|
+
srCyrl: 'sr-SP',
|
17606
|
+
srLatn: 'sr-SP',
|
17607
|
+
sv: 'sv-SE',
|
17608
|
+
th: 'th-TH',
|
17609
|
+
tr: 'tr-TR',
|
17610
|
+
az: 'az-AZ',
|
17611
|
+
uk: 'uk-UA',
|
17612
|
+
vi: 'vi-VN',
|
17613
|
+
zhHans: 'zh-CN',
|
17614
|
+
zhHant: 'zh-TW'
|
17615
|
+
}
|
17616
|
+
}, options);
|
17617
|
+
return {
|
17618
|
+
options: _options,
|
17619
|
+
instance: createInstance(_options, locale)
|
17620
|
+
};
|
17621
|
+
}
|
17622
|
+
function createInstance(options, locale) {
|
17623
|
+
const instance = reactive(typeof options.adapter === 'function'
|
17624
|
+
// eslint-disable-next-line new-cap
|
17625
|
+
? new options.adapter({
|
17626
|
+
locale: options.locale[locale.current.value] ?? locale.current.value,
|
17627
|
+
formats: options.formats
|
17628
|
+
}) : options.adapter);
|
17629
|
+
watch(locale.current, value => {
|
17630
|
+
instance.locale = options.locale[value] ?? value ?? instance.locale;
|
17631
|
+
});
|
17632
|
+
return instance;
|
17633
|
+
}
|
17634
|
+
function useDate() {
|
17635
|
+
const options = inject$1(DateOptionsSymbol);
|
17636
|
+
if (!options) throw new Error('[Vuetify] Could not find injected date options');
|
17637
|
+
const locale = useLocale();
|
17638
|
+
return createInstance(options, locale);
|
17639
|
+
}
|
17640
|
+
|
17641
|
+
// https://stackoverflow.com/questions/274861/how-do-i-calculate-the-week-number-given-a-date/275024#275024
|
17642
|
+
function getWeek(adapter, value) {
|
17643
|
+
const date = adapter.toJsDate(value);
|
17644
|
+
let year = date.getFullYear();
|
17645
|
+
let d1w1 = new Date(year, 0, 1);
|
17646
|
+
if (date < d1w1) {
|
17647
|
+
year = year - 1;
|
17648
|
+
d1w1 = new Date(year, 0, 1);
|
17649
|
+
} else {
|
17650
|
+
const tv = new Date(year + 1, 0, 1);
|
17651
|
+
if (date >= tv) {
|
17652
|
+
year = year + 1;
|
17653
|
+
d1w1 = tv;
|
17654
|
+
}
|
17655
|
+
}
|
17656
|
+
const diffTime = Math.abs(date.getTime() - d1w1.getTime());
|
17657
|
+
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
17658
|
+
return Math.floor(diffDays / 7) + 1;
|
17659
|
+
}
|
17660
|
+
|
17661
|
+
// Types
|
17662
|
+
|
17663
|
+
const makeVColorPickerProps = propsFactory({
|
17664
|
+
canvasHeight: {
|
17665
|
+
type: [String, Number],
|
17666
|
+
default: 150
|
17667
|
+
},
|
17668
|
+
disabled: Boolean,
|
17669
|
+
dotSize: {
|
17670
|
+
type: [Number, String],
|
17671
|
+
default: 10
|
17672
|
+
},
|
17673
|
+
hideCanvas: Boolean,
|
17674
|
+
hideSliders: Boolean,
|
17675
|
+
hideInputs: Boolean,
|
17676
|
+
mode: {
|
17677
|
+
type: String,
|
17678
|
+
default: 'rgba',
|
17679
|
+
validator: v => Object.keys(modes).includes(v)
|
17680
|
+
},
|
17681
|
+
modes: {
|
17682
|
+
type: Array,
|
17683
|
+
default: () => Object.keys(modes),
|
17684
|
+
validator: v => Array.isArray(v) && v.every(m => Object.keys(modes).includes(m))
|
17685
|
+
},
|
17686
|
+
showSwatches: Boolean,
|
17687
|
+
swatches: Array,
|
17688
|
+
swatchesMaxHeight: {
|
17689
|
+
type: [Number, String],
|
17690
|
+
default: 150
|
17691
|
+
},
|
17692
|
+
modelValue: {
|
17693
|
+
type: [Object, String]
|
17694
|
+
},
|
17695
|
+
...makeVPickerProps({
|
17696
|
+
hideHeader: true
|
17697
|
+
})
|
17698
|
+
}, 'VColorPicker');
|
17699
|
+
const VColorPicker = defineComponent({
|
17700
|
+
name: 'VColorPicker',
|
17701
|
+
props: makeVColorPickerProps(),
|
17702
|
+
emits: {
|
17703
|
+
'update:modelValue': color => true,
|
17704
|
+
'update:mode': mode => true
|
17705
|
+
},
|
17706
|
+
setup(props, _ref) {
|
17707
|
+
let {
|
17708
|
+
slots
|
17709
|
+
} = _ref;
|
17710
|
+
const mode = useProxiedModel(props, 'mode');
|
17711
|
+
const hue = ref(null);
|
17712
|
+
const model = useProxiedModel(props, 'modelValue', undefined, v => {
|
17713
|
+
if (v == null || v === '') return null;
|
17714
|
+
let c;
|
17715
|
+
try {
|
17716
|
+
c = RGBtoHSV(parseColor(v));
|
17717
|
+
} catch (err) {
|
17718
|
+
consoleWarn(err);
|
17719
|
+
return null;
|
17720
|
+
}
|
17721
|
+
return c;
|
17722
|
+
}, v => {
|
17723
|
+
if (!v) return null;
|
17724
|
+
return extractColor(v, props.modelValue);
|
17725
|
+
});
|
17726
|
+
const currentColor = computed(() => {
|
17727
|
+
return model.value ? {
|
17728
|
+
...model.value,
|
17729
|
+
h: hue.value ?? model.value.h
|
17730
|
+
} : null;
|
17731
|
+
});
|
17732
|
+
const {
|
17733
|
+
rtlClasses
|
17734
|
+
} = useRtl();
|
17735
|
+
let externalChange = true;
|
17736
|
+
watch(model, v => {
|
17737
|
+
if (!externalChange) {
|
17738
|
+
// prevent hue shift from rgb conversion inaccuracy
|
17739
|
+
externalChange = true;
|
17740
|
+
return;
|
17741
|
+
}
|
17742
|
+
if (!v) return;
|
17743
|
+
hue.value = v.h;
|
17744
|
+
}, {
|
17745
|
+
immediate: true
|
17746
|
+
});
|
17747
|
+
const updateColor = hsva => {
|
17748
|
+
externalChange = false;
|
17749
|
+
hue.value = hsva.h;
|
17750
|
+
model.value = hsva;
|
17751
|
+
};
|
17752
|
+
onBeforeMount(() => {
|
17753
|
+
if (!props.modes.includes(mode.value)) mode.value = props.modes[0];
|
17754
|
+
});
|
17755
|
+
provideDefaults({
|
17756
|
+
VSlider: {
|
17757
|
+
color: undefined,
|
17758
|
+
trackColor: undefined,
|
17759
|
+
trackFillColor: undefined
|
17760
|
+
}
|
17761
|
+
});
|
17762
|
+
useRender(() => {
|
17763
|
+
const pickerProps = VPicker.filterProps(props);
|
17764
|
+
return createVNode(VPicker, mergeProps(pickerProps, {
|
17765
|
+
"class": ['v-color-picker', rtlClasses.value, props.class],
|
17766
|
+
"style": [{
|
17767
|
+
'--v-color-picker-color-hsv': HSVtoCSS({
|
17768
|
+
...(currentColor.value ?? nullColor),
|
17769
|
+
a: 1
|
17770
|
+
})
|
17771
|
+
}, props.style]
|
17772
|
+
}), {
|
17773
|
+
...slots,
|
17774
|
+
default: () => createVNode(Fragment, null, [!props.hideCanvas && createVNode(VColorPickerCanvas, {
|
17775
|
+
"key": "canvas",
|
17776
|
+
"color": currentColor.value,
|
17777
|
+
"onUpdate:color": updateColor,
|
17778
|
+
"disabled": props.disabled,
|
17779
|
+
"dotSize": props.dotSize,
|
17780
|
+
"width": props.width,
|
17781
|
+
"height": props.canvasHeight
|
17782
|
+
}, null), (!props.hideSliders || !props.hideInputs) && createVNode("div", {
|
17783
|
+
"key": "controls",
|
17784
|
+
"class": "v-color-picker__controls"
|
17785
|
+
}, [!props.hideSliders && createVNode(VColorPickerPreview, {
|
17786
|
+
"key": "preview",
|
17787
|
+
"color": currentColor.value,
|
17788
|
+
"onUpdate:color": updateColor,
|
17789
|
+
"hideAlpha": !mode.value.endsWith('a'),
|
17790
|
+
"disabled": props.disabled
|
17791
|
+
}, null), !props.hideInputs && createVNode(VColorPickerEdit, {
|
17792
|
+
"key": "edit",
|
17793
|
+
"modes": props.modes,
|
17794
|
+
"mode": mode.value,
|
17795
|
+
"onUpdate:mode": m => mode.value = m,
|
17796
|
+
"color": currentColor.value,
|
17797
|
+
"onUpdate:color": updateColor,
|
17798
|
+
"disabled": props.disabled
|
17799
|
+
}, null)]), props.showSwatches && createVNode(VColorPickerSwatches, {
|
17800
|
+
"key": "swatches",
|
17801
|
+
"color": currentColor.value,
|
17802
|
+
"onUpdate:color": updateColor,
|
17803
|
+
"maxHeight": props.swatchesMaxHeight,
|
17804
|
+
"swatches": props.swatches,
|
17805
|
+
"disabled": props.disabled
|
17806
|
+
}, null)])
|
17807
|
+
});
|
17808
|
+
});
|
17809
|
+
return {};
|
17810
|
+
}
|
17811
|
+
});
|
18153
17812
|
|
18154
|
-
//
|
18155
|
-
|
18156
|
-
const
|
18157
|
-
|
18158
|
-
|
18159
|
-
|
18160
|
-
|
18161
|
-
|
18162
|
-
|
18163
|
-
|
18164
|
-
|
18165
|
-
|
18166
|
-
|
18167
|
-
|
18168
|
-
|
18169
|
-
|
18170
|
-
|
18171
|
-
|
18172
|
-
|
18173
|
-
|
18174
|
-
|
18175
|
-
|
18176
|
-
|
18177
|
-
|
18178
|
-
|
18179
|
-
|
18180
|
-
|
18181
|
-
|
18182
|
-
|
18183
|
-
|
18184
|
-
|
18185
|
-
|
18186
|
-
|
18187
|
-
|
18188
|
-
|
18189
|
-
|
18190
|
-
|
18191
|
-
|
18192
|
-
|
18193
|
-
|
18194
|
-
|
18195
|
-
|
18196
|
-
|
18197
|
-
|
18198
|
-
|
18199
|
-
|
18200
|
-
|
18201
|
-
|
17813
|
+
// Types
|
17814
|
+
|
17815
|
+
const makeVComboboxProps = propsFactory({
|
17816
|
+
autoSelectFirst: {
|
17817
|
+
type: [Boolean, String]
|
17818
|
+
},
|
17819
|
+
clearOnSelect: {
|
17820
|
+
type: Boolean,
|
17821
|
+
default: true
|
17822
|
+
},
|
17823
|
+
delimiters: Array,
|
17824
|
+
...makeFilterProps({
|
17825
|
+
filterKeys: ['title']
|
17826
|
+
}),
|
17827
|
+
...makeSelectProps({
|
17828
|
+
hideNoData: true,
|
17829
|
+
returnObject: true
|
17830
|
+
}),
|
17831
|
+
...omit(makeVTextFieldProps({
|
17832
|
+
modelValue: null,
|
17833
|
+
role: 'combobox'
|
17834
|
+
}), ['validationValue', 'dirty', 'appendInnerIcon']),
|
17835
|
+
...makeTransitionProps({
|
17836
|
+
transition: false
|
17837
|
+
})
|
17838
|
+
}, 'VCombobox');
|
17839
|
+
const VCombobox = genericComponent()({
|
17840
|
+
name: 'VCombobox',
|
17841
|
+
props: makeVComboboxProps(),
|
17842
|
+
emits: {
|
17843
|
+
'update:focused': focused => true,
|
17844
|
+
'update:modelValue': value => true,
|
17845
|
+
'update:search': value => true,
|
17846
|
+
'update:menu': value => true
|
17847
|
+
},
|
17848
|
+
setup(props, _ref) {
|
17849
|
+
let {
|
17850
|
+
emit,
|
17851
|
+
slots
|
17852
|
+
} = _ref;
|
17853
|
+
const {
|
17854
|
+
t
|
17855
|
+
} = useLocale();
|
17856
|
+
const vTextFieldRef = ref();
|
17857
|
+
const isFocused = shallowRef(false);
|
17858
|
+
const isPristine = shallowRef(true);
|
17859
|
+
const listHasFocus = shallowRef(false);
|
17860
|
+
const vMenuRef = ref();
|
17861
|
+
const vVirtualScrollRef = ref();
|
17862
|
+
const _menu = useProxiedModel(props, 'menu');
|
17863
|
+
const menu = computed({
|
17864
|
+
get: () => _menu.value,
|
17865
|
+
set: v => {
|
17866
|
+
if (_menu.value && !v && vMenuRef.value?.ΨopenChildren.size) return;
|
17867
|
+
_menu.value = v;
|
17868
|
+
}
|
17869
|
+
});
|
17870
|
+
const selectionIndex = shallowRef(-1);
|
17871
|
+
let cleared = false;
|
17872
|
+
const color = computed(() => vTextFieldRef.value?.color);
|
17873
|
+
const label = computed(() => menu.value ? props.closeText : props.openText);
|
17874
|
+
const {
|
17875
|
+
items,
|
17876
|
+
transformIn,
|
17877
|
+
transformOut
|
17878
|
+
} = useItems(props);
|
17879
|
+
const {
|
17880
|
+
textColorClasses,
|
17881
|
+
textColorStyles
|
17882
|
+
} = useTextColor(color);
|
17883
|
+
const model = useProxiedModel(props, 'modelValue', [], v => transformIn(wrapInArray(v)), v => {
|
17884
|
+
const transformed = transformOut(v);
|
17885
|
+
return props.multiple ? transformed : transformed[0] ?? null;
|
17886
|
+
});
|
17887
|
+
const form = useForm(props);
|
17888
|
+
const hasChips = computed(() => !!(props.chips || slots.chip));
|
17889
|
+
const hasSelectionSlot = computed(() => hasChips.value || !!slots.selection);
|
17890
|
+
const _search = shallowRef(!props.multiple && !hasSelectionSlot.value ? model.value[0]?.title ?? '' : '');
|
17891
|
+
const search = computed({
|
17892
|
+
get: () => {
|
17893
|
+
return _search.value;
|
17894
|
+
},
|
17895
|
+
set: val => {
|
17896
|
+
_search.value = val ?? '';
|
17897
|
+
if (!props.multiple && !hasSelectionSlot.value) {
|
17898
|
+
model.value = [transformItem$3(props, val)];
|
17899
|
+
}
|
17900
|
+
if (val && props.multiple && props.delimiters?.length) {
|
17901
|
+
const values = val.split(new RegExp(`(?:${props.delimiters.join('|')})+`));
|
17902
|
+
if (values.length > 1) {
|
17903
|
+
values.forEach(v => {
|
17904
|
+
v = v.trim();
|
17905
|
+
if (v) select(transformItem$3(props, v));
|
17906
|
+
});
|
17907
|
+
_search.value = '';
|
17908
|
+
}
|
17909
|
+
}
|
17910
|
+
if (!val) selectionIndex.value = -1;
|
17911
|
+
isPristine.value = !val;
|
17912
|
+
}
|
17913
|
+
});
|
17914
|
+
const counterValue = computed(() => {
|
17915
|
+
return typeof props.counterValue === 'function' ? props.counterValue(model.value) : typeof props.counterValue === 'number' ? props.counterValue : props.multiple ? model.value.length : search.value.length;
|
17916
|
+
});
|
17917
|
+
watch(_search, value => {
|
17918
|
+
if (cleared) {
|
17919
|
+
// wait for clear to finish, VTextField sets _search to null
|
17920
|
+
// then search computed triggers and updates _search to ''
|
17921
|
+
nextTick(() => cleared = false);
|
17922
|
+
} else if (isFocused.value && !menu.value) {
|
17923
|
+
menu.value = true;
|
17924
|
+
}
|
17925
|
+
emit('update:search', value);
|
17926
|
+
});
|
17927
|
+
watch(model, value => {
|
17928
|
+
if (!props.multiple && !hasSelectionSlot.value) {
|
17929
|
+
_search.value = value[0]?.title ?? '';
|
17930
|
+
}
|
17931
|
+
});
|
17932
|
+
const {
|
17933
|
+
filteredItems,
|
17934
|
+
getMatches
|
17935
|
+
} = useFilter(props, items, () => isPristine.value ? '' : search.value);
|
17936
|
+
const displayItems = computed(() => {
|
17937
|
+
if (props.hideSelected) {
|
17938
|
+
return filteredItems.value.filter(filteredItem => !model.value.some(s => s.value === filteredItem.value));
|
17939
|
+
}
|
17940
|
+
return filteredItems.value;
|
17941
|
+
});
|
17942
|
+
const selectedValues = computed(() => model.value.map(selection => selection.value));
|
17943
|
+
const highlightFirst = computed(() => {
|
17944
|
+
const selectFirst = props.autoSelectFirst === true || props.autoSelectFirst === 'exact' && search.value === displayItems.value[0]?.title;
|
17945
|
+
return selectFirst && displayItems.value.length > 0 && !isPristine.value && !listHasFocus.value;
|
17946
|
+
});
|
17947
|
+
const menuDisabled = computed(() => props.hideNoData && !displayItems.value.length || form.isReadonly.value || form.isDisabled.value);
|
17948
|
+
const listRef = ref();
|
17949
|
+
const listEvents = useScrolling(listRef, vTextFieldRef);
|
17950
|
+
function onClear(e) {
|
17951
|
+
cleared = true;
|
17952
|
+
if (props.openOnClear) {
|
17953
|
+
menu.value = true;
|
17954
|
+
}
|
18202
17955
|
}
|
18203
|
-
|
18204
|
-
|
18205
|
-
|
18206
|
-
|
18207
|
-
|
18208
|
-
|
18209
|
-
|
18210
|
-
|
18211
|
-
|
18212
|
-
|
18213
|
-
|
18214
|
-
|
18215
|
-
|
18216
|
-
|
18217
|
-
|
18218
|
-
|
18219
|
-
|
18220
|
-
|
18221
|
-
function
|
18222
|
-
|
18223
|
-
|
18224
|
-
|
18225
|
-
|
18226
|
-
|
17956
|
+
function onMousedownControl() {
|
17957
|
+
if (menuDisabled.value) return;
|
17958
|
+
menu.value = true;
|
17959
|
+
}
|
17960
|
+
function onMousedownMenuIcon(e) {
|
17961
|
+
if (menuDisabled.value) return;
|
17962
|
+
if (isFocused.value) {
|
17963
|
+
e.preventDefault();
|
17964
|
+
e.stopPropagation();
|
17965
|
+
}
|
17966
|
+
menu.value = !menu.value;
|
17967
|
+
}
|
17968
|
+
function onListKeydown(e) {
|
17969
|
+
if (e.key !== ' ' && checkPrintable(e)) {
|
17970
|
+
vTextFieldRef.value?.focus();
|
17971
|
+
}
|
17972
|
+
}
|
17973
|
+
// eslint-disable-next-line complexity
|
17974
|
+
function onKeydown(e) {
|
17975
|
+
if (isComposingIgnoreKey(e) || form.isReadonly.value) return;
|
17976
|
+
const selectionStart = vTextFieldRef.value.selectionStart;
|
17977
|
+
const length = model.value.length;
|
17978
|
+
if (['Enter', 'ArrowDown', 'ArrowUp'].includes(e.key)) {
|
17979
|
+
e.preventDefault();
|
17980
|
+
}
|
17981
|
+
if (['Enter', 'ArrowDown'].includes(e.key)) {
|
17982
|
+
menu.value = true;
|
17983
|
+
}
|
17984
|
+
if (['Escape'].includes(e.key)) {
|
17985
|
+
menu.value = false;
|
17986
|
+
}
|
17987
|
+
if (['Enter', 'Escape', 'Tab'].includes(e.key)) {
|
17988
|
+
if (highlightFirst.value && ['Enter', 'Tab'].includes(e.key) && !model.value.some(_ref2 => {
|
17989
|
+
let {
|
17990
|
+
value
|
17991
|
+
} = _ref2;
|
17992
|
+
return value === displayItems.value[0].value;
|
17993
|
+
})) {
|
17994
|
+
select(filteredItems.value[0]);
|
17995
|
+
}
|
17996
|
+
isPristine.value = true;
|
17997
|
+
}
|
17998
|
+
if (e.key === 'ArrowDown' && highlightFirst.value) {
|
17999
|
+
listRef.value?.focus('next');
|
18000
|
+
}
|
18001
|
+
if (e.key === 'Enter' && search.value) {
|
18002
|
+
select(transformItem$3(props, search.value));
|
18003
|
+
if (hasSelectionSlot.value) _search.value = '';
|
18004
|
+
}
|
18005
|
+
if (['Backspace', 'Delete'].includes(e.key)) {
|
18006
|
+
if (!props.multiple && hasSelectionSlot.value && model.value.length > 0 && !search.value) return select(model.value[0], false);
|
18007
|
+
if (~selectionIndex.value) {
|
18008
|
+
e.preventDefault();
|
18009
|
+
const originalSelectionIndex = selectionIndex.value;
|
18010
|
+
select(model.value[selectionIndex.value], false);
|
18011
|
+
selectionIndex.value = originalSelectionIndex >= length - 1 ? length - 2 : originalSelectionIndex;
|
18012
|
+
} else if (e.key === 'Backspace' && !search.value) {
|
18013
|
+
selectionIndex.value = length - 1;
|
18014
|
+
}
|
18015
|
+
return;
|
18016
|
+
}
|
18017
|
+
if (!props.multiple) return;
|
18018
|
+
if (e.key === 'ArrowLeft') {
|
18019
|
+
if (selectionIndex.value < 0 && selectionStart > 0) return;
|
18020
|
+
const prev = selectionIndex.value > -1 ? selectionIndex.value - 1 : length - 1;
|
18021
|
+
if (model.value[prev]) {
|
18022
|
+
selectionIndex.value = prev;
|
18023
|
+
} else {
|
18024
|
+
selectionIndex.value = -1;
|
18025
|
+
vTextFieldRef.value.setSelectionRange(search.value.length, search.value.length);
|
18026
|
+
}
|
18027
|
+
} else if (e.key === 'ArrowRight') {
|
18028
|
+
if (selectionIndex.value < 0) return;
|
18029
|
+
const next = selectionIndex.value + 1;
|
18030
|
+
if (model.value[next]) {
|
18031
|
+
selectionIndex.value = next;
|
18032
|
+
} else {
|
18033
|
+
selectionIndex.value = -1;
|
18034
|
+
vTextFieldRef.value.setSelectionRange(0, 0);
|
18035
|
+
}
|
18036
|
+
} else if (~selectionIndex.value && checkPrintable(e)) {
|
18037
|
+
selectionIndex.value = -1;
|
18038
|
+
}
|
18039
|
+
}
|
18040
|
+
function onAfterEnter() {
|
18041
|
+
if (props.eager) {
|
18042
|
+
vVirtualScrollRef.value?.calculateVisibleItems();
|
18043
|
+
}
|
18044
|
+
}
|
18045
|
+
function onAfterLeave() {
|
18046
|
+
if (isFocused.value) {
|
18047
|
+
isPristine.value = true;
|
18048
|
+
vTextFieldRef.value?.focus();
|
18049
|
+
}
|
18050
|
+
}
|
18051
|
+
/** @param set - null means toggle */
|
18052
|
+
function select(item) {
|
18053
|
+
let set = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
18054
|
+
if (!item || item.props.disabled) return;
|
18055
|
+
if (props.multiple) {
|
18056
|
+
const index = model.value.findIndex(selection => (props.valueComparator || deepEqual)(selection.value, item.value));
|
18057
|
+
const add = set == null ? !~index : set;
|
18058
|
+
if (~index) {
|
18059
|
+
const value = add ? [...model.value, item] : [...model.value];
|
18060
|
+
value.splice(index, 1);
|
18061
|
+
model.value = value;
|
18062
|
+
} else if (add) {
|
18063
|
+
model.value = [...model.value, item];
|
18064
|
+
}
|
18065
|
+
if (props.clearOnSelect) {
|
18066
|
+
search.value = '';
|
18067
|
+
}
|
18068
|
+
} else {
|
18069
|
+
const add = set !== false;
|
18070
|
+
model.value = add ? [item] : [];
|
18071
|
+
_search.value = add && !hasSelectionSlot.value ? item.title : '';
|
18227
18072
|
|
18228
|
-
//
|
18229
|
-
|
18230
|
-
|
18231
|
-
|
18232
|
-
|
18233
|
-
|
18234
|
-
|
18235
|
-
|
18236
|
-
|
18237
|
-
|
18238
|
-
|
18239
|
-
|
18240
|
-
d1w1 = tv;
|
18073
|
+
// watch for search watcher to trigger
|
18074
|
+
nextTick(() => {
|
18075
|
+
menu.value = false;
|
18076
|
+
isPristine.value = true;
|
18077
|
+
});
|
18078
|
+
}
|
18079
|
+
}
|
18080
|
+
function onFocusin(e) {
|
18081
|
+
isFocused.value = true;
|
18082
|
+
setTimeout(() => {
|
18083
|
+
listHasFocus.value = true;
|
18084
|
+
});
|
18241
18085
|
}
|
18086
|
+
function onFocusout(e) {
|
18087
|
+
listHasFocus.value = false;
|
18088
|
+
}
|
18089
|
+
function onUpdateModelValue(v) {
|
18090
|
+
if (v == null || v === '' && !props.multiple && !hasSelectionSlot.value) model.value = [];
|
18091
|
+
}
|
18092
|
+
watch(isFocused, (val, oldVal) => {
|
18093
|
+
if (val || val === oldVal) return;
|
18094
|
+
selectionIndex.value = -1;
|
18095
|
+
menu.value = false;
|
18096
|
+
if (search.value) {
|
18097
|
+
if (props.multiple) {
|
18098
|
+
select(transformItem$3(props, search.value));
|
18099
|
+
return;
|
18100
|
+
}
|
18101
|
+
if (!hasSelectionSlot.value) return;
|
18102
|
+
if (model.value.some(_ref3 => {
|
18103
|
+
let {
|
18104
|
+
title
|
18105
|
+
} = _ref3;
|
18106
|
+
return title === search.value;
|
18107
|
+
})) {
|
18108
|
+
_search.value = '';
|
18109
|
+
} else {
|
18110
|
+
select(transformItem$3(props, search.value));
|
18111
|
+
}
|
18112
|
+
}
|
18113
|
+
});
|
18114
|
+
watch(menu, () => {
|
18115
|
+
if (!props.hideSelected && menu.value && model.value.length) {
|
18116
|
+
const index = displayItems.value.findIndex(item => model.value.some(s => (props.valueComparator || deepEqual)(s.value, item.value)));
|
18117
|
+
IN_BROWSER && window.requestAnimationFrame(() => {
|
18118
|
+
index >= 0 && vVirtualScrollRef.value?.scrollToIndex(index);
|
18119
|
+
});
|
18120
|
+
}
|
18121
|
+
});
|
18122
|
+
watch(() => props.items, (newVal, oldVal) => {
|
18123
|
+
if (menu.value) return;
|
18124
|
+
if (isFocused.value && !oldVal.length && newVal.length) {
|
18125
|
+
menu.value = true;
|
18126
|
+
}
|
18127
|
+
});
|
18128
|
+
useRender(() => {
|
18129
|
+
const hasList = !!(!props.hideNoData || displayItems.value.length || slots['prepend-item'] || slots['append-item'] || slots['no-data']);
|
18130
|
+
const isDirty = model.value.length > 0;
|
18131
|
+
const textFieldProps = VTextField.filterProps(props);
|
18132
|
+
return createVNode(VTextField, mergeProps({
|
18133
|
+
"ref": vTextFieldRef
|
18134
|
+
}, textFieldProps, {
|
18135
|
+
"modelValue": search.value,
|
18136
|
+
"onUpdate:modelValue": [$event => search.value = $event, onUpdateModelValue],
|
18137
|
+
"focused": isFocused.value,
|
18138
|
+
"onUpdate:focused": $event => isFocused.value = $event,
|
18139
|
+
"validationValue": model.externalValue,
|
18140
|
+
"counterValue": counterValue.value,
|
18141
|
+
"dirty": isDirty,
|
18142
|
+
"class": ['v-combobox', {
|
18143
|
+
'v-combobox--active-menu': menu.value,
|
18144
|
+
'v-combobox--chips': !!props.chips,
|
18145
|
+
'v-combobox--selection-slot': !!hasSelectionSlot.value,
|
18146
|
+
'v-combobox--selecting-index': selectionIndex.value > -1,
|
18147
|
+
[`v-combobox--${props.multiple ? 'multiple' : 'single'}`]: true
|
18148
|
+
}, props.class],
|
18149
|
+
"style": props.style,
|
18150
|
+
"readonly": form.isReadonly.value,
|
18151
|
+
"placeholder": isDirty ? undefined : props.placeholder,
|
18152
|
+
"onClick:clear": onClear,
|
18153
|
+
"onMousedown:control": onMousedownControl,
|
18154
|
+
"onKeydown": onKeydown
|
18155
|
+
}), {
|
18156
|
+
...slots,
|
18157
|
+
default: () => createVNode(Fragment, null, [createVNode(VMenu, mergeProps({
|
18158
|
+
"ref": vMenuRef,
|
18159
|
+
"modelValue": menu.value,
|
18160
|
+
"onUpdate:modelValue": $event => menu.value = $event,
|
18161
|
+
"activator": "parent",
|
18162
|
+
"contentClass": "v-combobox__content",
|
18163
|
+
"disabled": menuDisabled.value,
|
18164
|
+
"eager": props.eager,
|
18165
|
+
"maxHeight": 310,
|
18166
|
+
"openOnClick": false,
|
18167
|
+
"closeOnContentClick": false,
|
18168
|
+
"transition": props.transition,
|
18169
|
+
"onAfterEnter": onAfterEnter,
|
18170
|
+
"onAfterLeave": onAfterLeave
|
18171
|
+
}, props.menuProps), {
|
18172
|
+
default: () => [hasList && createVNode(VList, mergeProps({
|
18173
|
+
"ref": listRef,
|
18174
|
+
"selected": selectedValues.value,
|
18175
|
+
"selectStrategy": props.multiple ? 'independent' : 'single-independent',
|
18176
|
+
"onMousedown": e => e.preventDefault(),
|
18177
|
+
"onKeydown": onListKeydown,
|
18178
|
+
"onFocusin": onFocusin,
|
18179
|
+
"onFocusout": onFocusout,
|
18180
|
+
"tabindex": "-1",
|
18181
|
+
"aria-live": "polite",
|
18182
|
+
"color": props.itemColor ?? props.color
|
18183
|
+
}, listEvents, props.listProps), {
|
18184
|
+
default: () => [slots['prepend-item']?.(), !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? createVNode(VListItem, {
|
18185
|
+
"key": "no-data",
|
18186
|
+
"title": t(props.noDataText)
|
18187
|
+
}, null)), createVNode(VVirtualScroll, {
|
18188
|
+
"ref": vVirtualScrollRef,
|
18189
|
+
"renderless": true,
|
18190
|
+
"items": displayItems.value,
|
18191
|
+
"itemKey": "value"
|
18192
|
+
}, {
|
18193
|
+
default: _ref4 => {
|
18194
|
+
let {
|
18195
|
+
item,
|
18196
|
+
index,
|
18197
|
+
itemRef
|
18198
|
+
} = _ref4;
|
18199
|
+
const itemProps = mergeProps(item.props, {
|
18200
|
+
ref: itemRef,
|
18201
|
+
key: item.value,
|
18202
|
+
active: highlightFirst.value && index === 0 ? true : undefined,
|
18203
|
+
onClick: () => select(item, null)
|
18204
|
+
});
|
18205
|
+
return slots.item?.({
|
18206
|
+
item,
|
18207
|
+
index,
|
18208
|
+
props: itemProps
|
18209
|
+
}) ?? createVNode(VListItem, mergeProps(itemProps, {
|
18210
|
+
"role": "option"
|
18211
|
+
}), {
|
18212
|
+
prepend: _ref5 => {
|
18213
|
+
let {
|
18214
|
+
isSelected
|
18215
|
+
} = _ref5;
|
18216
|
+
return createVNode(Fragment, null, [props.multiple && !props.hideSelected ? createVNode(VCheckboxBtn, {
|
18217
|
+
"key": item.value,
|
18218
|
+
"modelValue": isSelected,
|
18219
|
+
"ripple": false,
|
18220
|
+
"tabindex": "-1"
|
18221
|
+
}, null) : undefined, item.props.prependAvatar && createVNode(VAvatar, {
|
18222
|
+
"image": item.props.prependAvatar
|
18223
|
+
}, null), item.props.prependIcon && createVNode(VIcon, {
|
18224
|
+
"icon": item.props.prependIcon
|
18225
|
+
}, null)]);
|
18226
|
+
},
|
18227
|
+
title: () => {
|
18228
|
+
return isPristine.value ? item.title : highlightResult('v-combobox', item.title, getMatches(item)?.title);
|
18229
|
+
}
|
18230
|
+
});
|
18231
|
+
}
|
18232
|
+
}), slots['append-item']?.()]
|
18233
|
+
})]
|
18234
|
+
}), model.value.map((item, index) => {
|
18235
|
+
function onChipClose(e) {
|
18236
|
+
e.stopPropagation();
|
18237
|
+
e.preventDefault();
|
18238
|
+
select(item, false);
|
18239
|
+
}
|
18240
|
+
const slotProps = {
|
18241
|
+
'onClick:close': onChipClose,
|
18242
|
+
onKeydown(e) {
|
18243
|
+
if (e.key !== 'Enter' && e.key !== ' ') return;
|
18244
|
+
e.preventDefault();
|
18245
|
+
e.stopPropagation();
|
18246
|
+
onChipClose(e);
|
18247
|
+
},
|
18248
|
+
onMousedown(e) {
|
18249
|
+
e.preventDefault();
|
18250
|
+
e.stopPropagation();
|
18251
|
+
},
|
18252
|
+
modelValue: true,
|
18253
|
+
'onUpdate:modelValue': undefined
|
18254
|
+
};
|
18255
|
+
const hasSlot = hasChips.value ? !!slots.chip : !!slots.selection;
|
18256
|
+
const slotContent = hasSlot ? ensureValidVNode(hasChips.value ? slots.chip({
|
18257
|
+
item,
|
18258
|
+
index,
|
18259
|
+
props: slotProps
|
18260
|
+
}) : slots.selection({
|
18261
|
+
item,
|
18262
|
+
index
|
18263
|
+
})) : undefined;
|
18264
|
+
if (hasSlot && !slotContent) return undefined;
|
18265
|
+
return createVNode("div", {
|
18266
|
+
"key": item.value,
|
18267
|
+
"class": ['v-combobox__selection', index === selectionIndex.value && ['v-combobox__selection--selected', textColorClasses.value]],
|
18268
|
+
"style": index === selectionIndex.value ? textColorStyles.value : {}
|
18269
|
+
}, [hasChips.value ? !slots.chip ? createVNode(VChip, mergeProps({
|
18270
|
+
"key": "chip",
|
18271
|
+
"closable": props.closableChips,
|
18272
|
+
"size": "small",
|
18273
|
+
"text": item.title,
|
18274
|
+
"disabled": item.props.disabled
|
18275
|
+
}, slotProps), null) : createVNode(VDefaultsProvider, {
|
18276
|
+
"key": "chip-defaults",
|
18277
|
+
"defaults": {
|
18278
|
+
VChip: {
|
18279
|
+
closable: props.closableChips,
|
18280
|
+
size: 'small',
|
18281
|
+
text: item.title
|
18282
|
+
}
|
18283
|
+
}
|
18284
|
+
}, {
|
18285
|
+
default: () => [slotContent]
|
18286
|
+
}) : slotContent ?? createVNode("span", {
|
18287
|
+
"class": "v-combobox__selection-text"
|
18288
|
+
}, [item.title, props.multiple && index < model.value.length - 1 && createVNode("span", {
|
18289
|
+
"class": "v-combobox__selection-comma"
|
18290
|
+
}, [createTextVNode(",")])])]);
|
18291
|
+
})]),
|
18292
|
+
'append-inner': function () {
|
18293
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
18294
|
+
args[_key] = arguments[_key];
|
18295
|
+
}
|
18296
|
+
return createVNode(Fragment, null, [slots['append-inner']?.(...args), (!props.hideNoData || props.items.length) && props.menuIcon ? createVNode(VIcon, {
|
18297
|
+
"class": "v-combobox__menu-icon",
|
18298
|
+
"icon": props.menuIcon,
|
18299
|
+
"onMousedown": onMousedownMenuIcon,
|
18300
|
+
"onClick": noop,
|
18301
|
+
"aria-label": t(label.value),
|
18302
|
+
"title": t(label.value),
|
18303
|
+
"tabindex": "-1"
|
18304
|
+
}, null) : undefined]);
|
18305
|
+
}
|
18306
|
+
});
|
18307
|
+
});
|
18308
|
+
return forwardRefs({
|
18309
|
+
isFocused,
|
18310
|
+
isPristine,
|
18311
|
+
menu,
|
18312
|
+
search,
|
18313
|
+
selectionIndex,
|
18314
|
+
filteredItems,
|
18315
|
+
select
|
18316
|
+
}, vTextFieldRef);
|
18242
18317
|
}
|
18243
|
-
|
18244
|
-
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
18245
|
-
return Math.floor(diffDays / 7) + 1;
|
18246
|
-
}
|
18318
|
+
});
|
18247
18319
|
|
18248
18320
|
// Types
|
18249
18321
|
|
@@ -22192,70 +22264,6 @@ const VDatePickerYears = genericComponent()({
|
|
22192
22264
|
}
|
22193
22265
|
});
|
22194
22266
|
|
22195
|
-
// Utilities
|
22196
|
-
const VPickerTitle = createSimpleFunctional('v-picker-title');
|
22197
|
-
|
22198
|
-
// Types
|
22199
|
-
|
22200
|
-
const makeVPickerProps = propsFactory({
|
22201
|
-
bgColor: String,
|
22202
|
-
landscape: Boolean,
|
22203
|
-
title: String,
|
22204
|
-
hideHeader: Boolean,
|
22205
|
-
...makeVSheetProps()
|
22206
|
-
}, 'VPicker');
|
22207
|
-
const VPicker = genericComponent()({
|
22208
|
-
name: 'VPicker',
|
22209
|
-
props: makeVPickerProps(),
|
22210
|
-
setup(props, _ref) {
|
22211
|
-
let {
|
22212
|
-
slots
|
22213
|
-
} = _ref;
|
22214
|
-
const {
|
22215
|
-
backgroundColorClasses,
|
22216
|
-
backgroundColorStyles
|
22217
|
-
} = useBackgroundColor(toRef(props, 'color'));
|
22218
|
-
useRender(() => {
|
22219
|
-
const sheetProps = VSheet.filterProps(props);
|
22220
|
-
const hasTitle = !!(props.title || slots.title);
|
22221
|
-
return createVNode(VSheet, mergeProps(sheetProps, {
|
22222
|
-
"color": props.bgColor,
|
22223
|
-
"class": ['v-picker', {
|
22224
|
-
'v-picker--landscape': props.landscape,
|
22225
|
-
'v-picker--with-actions': !!slots.actions
|
22226
|
-
}, props.class],
|
22227
|
-
"style": props.style
|
22228
|
-
}), {
|
22229
|
-
default: () => [!props.hideHeader && createVNode("div", {
|
22230
|
-
"key": "header",
|
22231
|
-
"class": [backgroundColorClasses.value],
|
22232
|
-
"style": [backgroundColorStyles.value]
|
22233
|
-
}, [hasTitle && createVNode(VPickerTitle, {
|
22234
|
-
"key": "picker-title"
|
22235
|
-
}, {
|
22236
|
-
default: () => [slots.title?.() ?? props.title]
|
22237
|
-
}), slots.header && createVNode("div", {
|
22238
|
-
"class": "v-picker__header"
|
22239
|
-
}, [slots.header()])]), createVNode("div", {
|
22240
|
-
"class": "v-picker__body"
|
22241
|
-
}, [slots.default?.()]), slots.actions && createVNode(VDefaultsProvider, {
|
22242
|
-
"defaults": {
|
22243
|
-
VBtn: {
|
22244
|
-
slim: true,
|
22245
|
-
variant: 'text'
|
22246
|
-
}
|
22247
|
-
}
|
22248
|
-
}, {
|
22249
|
-
default: () => [createVNode("div", {
|
22250
|
-
"class": "v-picker__actions"
|
22251
|
-
}, [slots.actions()])]
|
22252
|
-
})]
|
22253
|
-
});
|
22254
|
-
});
|
22255
|
-
return {};
|
22256
|
-
}
|
22257
|
-
});
|
22258
|
-
|
22259
22267
|
// Types
|
22260
22268
|
|
22261
22269
|
// Types
|
@@ -22316,6 +22324,9 @@ const VDatePicker = genericComponent()({
|
|
22316
22324
|
const {
|
22317
22325
|
t
|
22318
22326
|
} = useLocale();
|
22327
|
+
const {
|
22328
|
+
rtlClasses
|
22329
|
+
} = useRtl();
|
22319
22330
|
const model = useProxiedModel(props, 'modelValue', undefined, v => wrapInArray(v), v => props.multiple ? v : v[0]);
|
22320
22331
|
const viewMode = useProxiedModel(props, 'viewMode');
|
22321
22332
|
// const inputMode = useProxiedModel(props, 'inputMode')
|
@@ -22453,7 +22464,7 @@ const VDatePicker = genericComponent()({
|
|
22453
22464
|
return createVNode(VPicker, mergeProps(pickerProps, {
|
22454
22465
|
"class": ['v-date-picker', `v-date-picker--${viewMode.value}`, {
|
22455
22466
|
'v-date-picker--show-week': props.showWeek
|
22456
|
-
}, props.class],
|
22467
|
+
}, rtlClasses.value, props.class],
|
22457
22468
|
"style": props.style
|
22458
22469
|
}), {
|
22459
22470
|
title: () => slots.title?.() ?? createVNode("div", {
|
@@ -31148,7 +31159,7 @@ function createVuetify$1() {
|
|
31148
31159
|
};
|
31149
31160
|
});
|
31150
31161
|
}
|
31151
|
-
const version$1 = "3.7.15-dev.2025-03-
|
31162
|
+
const version$1 = "3.7.15-dev.2025-03-08";
|
31152
31163
|
createVuetify$1.version = version$1;
|
31153
31164
|
|
31154
31165
|
// Vue's inject() can only be used in setup
|
@@ -31401,7 +31412,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
31401
31412
|
|
31402
31413
|
/* eslint-disable local-rules/sort-imports */
|
31403
31414
|
|
31404
|
-
const version = "3.7.15-dev.2025-03-
|
31415
|
+
const version = "3.7.15-dev.2025-03-08";
|
31405
31416
|
|
31406
31417
|
/* eslint-disable local-rules/sort-imports */
|
31407
31418
|
|