@vuetify/nightly 3.7.15-dev.2025-03-07 → 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.
Files changed (36) hide show
  1. package/CHANGELOG.md +9 -3
  2. package/dist/json/attributes.json +3379 -3339
  3. package/dist/json/importMap-labs.json +24 -24
  4. package/dist/json/importMap.json +170 -170
  5. package/dist/json/tags.json +10 -0
  6. package/dist/json/web-types.json +6242 -6151
  7. package/dist/vuetify-labs.css +3410 -3409
  8. package/dist/vuetify-labs.d.ts +234 -181
  9. package/dist/vuetify-labs.esm.js +810 -808
  10. package/dist/vuetify-labs.esm.js.map +1 -1
  11. package/dist/vuetify-labs.js +810 -808
  12. package/dist/vuetify-labs.min.css +2 -2
  13. package/dist/vuetify.css +2799 -2798
  14. package/dist/vuetify.d.ts +214 -161
  15. package/dist/vuetify.esm.js +810 -808
  16. package/dist/vuetify.esm.js.map +1 -1
  17. package/dist/vuetify.js +810 -808
  18. package/dist/vuetify.js.map +1 -1
  19. package/dist/vuetify.min.css +2 -2
  20. package/dist/vuetify.min.js +176 -175
  21. package/dist/vuetify.min.js.map +1 -1
  22. package/lib/components/VColorPicker/VColorPicker.css +3 -2
  23. package/lib/components/VColorPicker/VColorPicker.d.ts +259 -156
  24. package/lib/components/VColorPicker/VColorPicker.js +16 -17
  25. package/lib/components/VColorPicker/VColorPicker.js.map +1 -1
  26. package/lib/components/VColorPicker/VColorPicker.sass +2 -1
  27. package/lib/components/VColorPicker/_variables.scss +1 -0
  28. package/lib/components/VDatePicker/VDatePicker.d.ts +6 -6
  29. package/lib/components/VDatePicker/VDatePicker.js +5 -2
  30. package/lib/components/VDatePicker/VDatePicker.js.map +1 -1
  31. package/lib/entry-bundler.js +1 -1
  32. package/lib/framework.d.ts +57 -57
  33. package/lib/framework.js +1 -1
  34. package/lib/labs/VCalendar/VCalendar.d.ts +6 -6
  35. package/lib/labs/VDateInput/VDateInput.d.ts +25 -25
  36. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vuetify v3.7.15-dev.2025-03-07
2
+ * Vuetify v3.7.15-dev.2025-03-08
3
3
  * Forged by John Leider
4
4
  * Released under the MIT License.
5
5
  */
@@ -16724,6 +16724,9 @@ const VColorPickerSwatches = defineComponent({
16724
16724
  }
16725
16725
  });
16726
16726
 
16727
+ // Utilities
16728
+ const VPickerTitle = createSimpleFunctional('v-picker-title');
16729
+
16727
16730
  const makeVSheetProps = propsFactory({
16728
16731
  color: String,
16729
16732
  ...makeBorderProps(),
@@ -16778,665 +16781,66 @@ const VSheet = genericComponent()({
16778
16781
 
16779
16782
  // Types
16780
16783
 
16781
- const makeVColorPickerProps = propsFactory({
16782
- canvasHeight: {
16783
- type: [String, Number],
16784
- default: 150
16785
- },
16786
- disabled: Boolean,
16787
- dotSize: {
16788
- type: [Number, String],
16789
- default: 10
16790
- },
16791
- hideCanvas: Boolean,
16792
- hideSliders: Boolean,
16793
- hideInputs: Boolean,
16794
- mode: {
16795
- type: String,
16796
- default: 'rgba',
16797
- validator: v => Object.keys(modes).includes(v)
16798
- },
16799
- modes: {
16800
- type: Array,
16801
- default: () => Object.keys(modes),
16802
- validator: v => Array.isArray(v) && v.every(m => Object.keys(modes).includes(m))
16803
- },
16804
- showSwatches: Boolean,
16805
- swatches: Array,
16806
- swatchesMaxHeight: {
16807
- type: [Number, String],
16808
- default: 150
16809
- },
16810
- modelValue: {
16811
- type: [Object, String]
16812
- },
16813
- ...omit(makeVSheetProps({
16814
- width: 300
16815
- }), ['height', 'location', 'minHeight', 'maxHeight', 'minWidth', 'maxWidth'])
16816
- }, 'VColorPicker');
16817
- const VColorPicker = defineComponent({
16818
- name: 'VColorPicker',
16819
- props: makeVColorPickerProps(),
16820
- emits: {
16821
- 'update:modelValue': color => true,
16822
- 'update:mode': mode => true
16823
- },
16824
- setup(props) {
16825
- const mode = useProxiedModel(props, 'mode');
16826
- const hue = ref(null);
16827
- const model = useProxiedModel(props, 'modelValue', undefined, v => {
16828
- if (v == null || v === '') return null;
16829
- let c;
16830
- try {
16831
- c = RGBtoHSV(parseColor(v));
16832
- } catch (err) {
16833
- consoleWarn(err);
16834
- return null;
16835
- }
16836
- return c;
16837
- }, v => {
16838
- if (!v) return null;
16839
- return extractColor(v, props.modelValue);
16840
- });
16841
- const currentColor = computed(() => {
16842
- return model.value ? {
16843
- ...model.value,
16844
- h: hue.value ?? model.value.h
16845
- } : null;
16846
- });
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;
16847
16798
  const {
16848
- rtlClasses
16849
- } = useRtl();
16850
- let externalChange = true;
16851
- watch(model, v => {
16852
- if (!externalChange) {
16853
- // prevent hue shift from rgb conversion inaccuracy
16854
- externalChange = true;
16855
- return;
16856
- }
16857
- if (!v) return;
16858
- hue.value = v.h;
16859
- }, {
16860
- immediate: true
16861
- });
16862
- const updateColor = hsva => {
16863
- externalChange = false;
16864
- hue.value = hsva.h;
16865
- model.value = hsva;
16866
- };
16867
- onBeforeMount(() => {
16868
- if (!props.modes.includes(mode.value)) mode.value = props.modes[0];
16869
- });
16870
- provideDefaults({
16871
- VSlider: {
16872
- color: undefined,
16873
- trackColor: undefined,
16874
- trackFillColor: undefined
16875
- }
16876
- });
16799
+ backgroundColorClasses,
16800
+ backgroundColorStyles
16801
+ } = useBackgroundColor(toRef(props, 'color'));
16877
16802
  useRender(() => {
16878
16803
  const sheetProps = VSheet.filterProps(props);
16879
- return createVNode(VSheet, mergeProps({
16880
- "rounded": props.rounded,
16881
- "elevation": props.elevation,
16882
- "theme": props.theme,
16883
- "class": ['v-color-picker', rtlClasses.value, props.class],
16884
- "style": [{
16885
- '--v-color-picker-color-hsv': HSVtoCSS({
16886
- ...(currentColor.value ?? nullColor),
16887
- a: 1
16888
- })
16889
- }, props.style]
16890
- }, sheetProps, {
16891
- "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
16892
16812
  }), {
16893
- default: () => [!props.hideCanvas && createVNode(VColorPickerCanvas, {
16894
- "key": "canvas",
16895
- "color": currentColor.value,
16896
- "onUpdate:color": updateColor,
16897
- "disabled": props.disabled,
16898
- "dotSize": props.dotSize,
16899
- "width": props.width,
16900
- "height": props.canvasHeight
16901
- }, null), (!props.hideSliders || !props.hideInputs) && createVNode("div", {
16902
- "key": "controls",
16903
- "class": "v-color-picker__controls"
16904
- }, [!props.hideSliders && createVNode(VColorPickerPreview, {
16905
- "key": "preview",
16906
- "color": currentColor.value,
16907
- "onUpdate:color": updateColor,
16908
- "hideAlpha": !mode.value.endsWith('a'),
16909
- "disabled": props.disabled
16910
- }, null), !props.hideInputs && createVNode(VColorPickerEdit, {
16911
- "key": "edit",
16912
- "modes": props.modes,
16913
- "mode": mode.value,
16914
- "onUpdate:mode": m => mode.value = m,
16915
- "color": currentColor.value,
16916
- "onUpdate:color": updateColor,
16917
- "disabled": props.disabled
16918
- }, null)]), props.showSwatches && createVNode(VColorPickerSwatches, {
16919
- "key": "swatches",
16920
- "color": currentColor.value,
16921
- "onUpdate:color": updateColor,
16922
- "maxHeight": props.swatchesMaxHeight,
16923
- "swatches": props.swatches,
16924
- "disabled": props.disabled
16925
- }, 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
+ })]
16926
16837
  });
16927
16838
  });
16928
16839
  return {};
16929
16840
  }
16930
16841
  });
16931
-
16932
- // Types
16933
-
16934
- const makeVComboboxProps = propsFactory({
16935
- autoSelectFirst: {
16936
- type: [Boolean, String]
16937
- },
16938
- clearOnSelect: {
16939
- type: Boolean,
16940
- default: true
16941
- },
16942
- delimiters: Array,
16943
- ...makeFilterProps({
16944
- filterKeys: ['title']
16945
- }),
16946
- ...makeSelectProps({
16947
- hideNoData: true,
16948
- returnObject: true
16949
- }),
16950
- ...omit(makeVTextFieldProps({
16951
- modelValue: null,
16952
- role: 'combobox'
16953
- }), ['validationValue', 'dirty', 'appendInnerIcon']),
16954
- ...makeTransitionProps({
16955
- transition: false
16956
- })
16957
- }, 'VCombobox');
16958
- const VCombobox = genericComponent()({
16959
- name: 'VCombobox',
16960
- props: makeVComboboxProps(),
16961
- emits: {
16962
- 'update:focused': focused => true,
16963
- 'update:modelValue': value => true,
16964
- 'update:search': value => true,
16965
- 'update:menu': value => true
16966
- },
16967
- setup(props, _ref) {
16968
- let {
16969
- emit,
16970
- slots
16971
- } = _ref;
16972
- const {
16973
- t
16974
- } = useLocale();
16975
- const vTextFieldRef = ref();
16976
- const isFocused = shallowRef(false);
16977
- const isPristine = shallowRef(true);
16978
- const listHasFocus = shallowRef(false);
16979
- const vMenuRef = ref();
16980
- const vVirtualScrollRef = ref();
16981
- const _menu = useProxiedModel(props, 'menu');
16982
- const menu = computed({
16983
- get: () => _menu.value,
16984
- set: v => {
16985
- if (_menu.value && !v && vMenuRef.value?.ΨopenChildren.size) return;
16986
- _menu.value = v;
16987
- }
16988
- });
16989
- const selectionIndex = shallowRef(-1);
16990
- let cleared = false;
16991
- const color = computed(() => vTextFieldRef.value?.color);
16992
- const label = computed(() => menu.value ? props.closeText : props.openText);
16993
- const {
16994
- items,
16995
- transformIn,
16996
- transformOut
16997
- } = useItems(props);
16998
- const {
16999
- textColorClasses,
17000
- textColorStyles
17001
- } = useTextColor(color);
17002
- const model = useProxiedModel(props, 'modelValue', [], v => transformIn(wrapInArray(v)), v => {
17003
- const transformed = transformOut(v);
17004
- return props.multiple ? transformed : transformed[0] ?? null;
17005
- });
17006
- const form = useForm(props);
17007
- const hasChips = computed(() => !!(props.chips || slots.chip));
17008
- const hasSelectionSlot = computed(() => hasChips.value || !!slots.selection);
17009
- const _search = shallowRef(!props.multiple && !hasSelectionSlot.value ? model.value[0]?.title ?? '' : '');
17010
- const search = computed({
17011
- get: () => {
17012
- return _search.value;
17013
- },
17014
- set: val => {
17015
- _search.value = val ?? '';
17016
- if (!props.multiple && !hasSelectionSlot.value) {
17017
- model.value = [transformItem$3(props, val)];
17018
- }
17019
- if (val && props.multiple && props.delimiters?.length) {
17020
- const values = val.split(new RegExp(`(?:${props.delimiters.join('|')})+`));
17021
- if (values.length > 1) {
17022
- values.forEach(v => {
17023
- v = v.trim();
17024
- if (v) select(transformItem$3(props, v));
17025
- });
17026
- _search.value = '';
17027
- }
17028
- }
17029
- if (!val) selectionIndex.value = -1;
17030
- isPristine.value = !val;
17031
- }
17032
- });
17033
- const counterValue = computed(() => {
17034
- return typeof props.counterValue === 'function' ? props.counterValue(model.value) : typeof props.counterValue === 'number' ? props.counterValue : props.multiple ? model.value.length : search.value.length;
17035
- });
17036
- watch(_search, value => {
17037
- if (cleared) {
17038
- // wait for clear to finish, VTextField sets _search to null
17039
- // then search computed triggers and updates _search to ''
17040
- nextTick(() => cleared = false);
17041
- } else if (isFocused.value && !menu.value) {
17042
- menu.value = true;
17043
- }
17044
- emit('update:search', value);
17045
- });
17046
- watch(model, value => {
17047
- if (!props.multiple && !hasSelectionSlot.value) {
17048
- _search.value = value[0]?.title ?? '';
17049
- }
17050
- });
17051
- const {
17052
- filteredItems,
17053
- getMatches
17054
- } = useFilter(props, items, () => isPristine.value ? '' : search.value);
17055
- const displayItems = computed(() => {
17056
- if (props.hideSelected) {
17057
- return filteredItems.value.filter(filteredItem => !model.value.some(s => s.value === filteredItem.value));
17058
- }
17059
- return filteredItems.value;
17060
- });
17061
- const selectedValues = computed(() => model.value.map(selection => selection.value));
17062
- const highlightFirst = computed(() => {
17063
- const selectFirst = props.autoSelectFirst === true || props.autoSelectFirst === 'exact' && search.value === displayItems.value[0]?.title;
17064
- return selectFirst && displayItems.value.length > 0 && !isPristine.value && !listHasFocus.value;
17065
- });
17066
- const menuDisabled = computed(() => props.hideNoData && !displayItems.value.length || form.isReadonly.value || form.isDisabled.value);
17067
- const listRef = ref();
17068
- const listEvents = useScrolling(listRef, vTextFieldRef);
17069
- function onClear(e) {
17070
- cleared = true;
17071
- if (props.openOnClear) {
17072
- menu.value = true;
17073
- }
17074
- }
17075
- function onMousedownControl() {
17076
- if (menuDisabled.value) return;
17077
- menu.value = true;
17078
- }
17079
- function onMousedownMenuIcon(e) {
17080
- if (menuDisabled.value) return;
17081
- if (isFocused.value) {
17082
- e.preventDefault();
17083
- e.stopPropagation();
17084
- }
17085
- menu.value = !menu.value;
17086
- }
17087
- function onListKeydown(e) {
17088
- if (e.key !== ' ' && checkPrintable(e)) {
17089
- vTextFieldRef.value?.focus();
17090
- }
17091
- }
17092
- // eslint-disable-next-line complexity
17093
- function onKeydown(e) {
17094
- if (isComposingIgnoreKey(e) || form.isReadonly.value) return;
17095
- const selectionStart = vTextFieldRef.value.selectionStart;
17096
- const length = model.value.length;
17097
- if (['Enter', 'ArrowDown', 'ArrowUp'].includes(e.key)) {
17098
- e.preventDefault();
17099
- }
17100
- if (['Enter', 'ArrowDown'].includes(e.key)) {
17101
- menu.value = true;
17102
- }
17103
- if (['Escape'].includes(e.key)) {
17104
- menu.value = false;
17105
- }
17106
- if (['Enter', 'Escape', 'Tab'].includes(e.key)) {
17107
- if (highlightFirst.value && ['Enter', 'Tab'].includes(e.key) && !model.value.some(_ref2 => {
17108
- let {
17109
- value
17110
- } = _ref2;
17111
- return value === displayItems.value[0].value;
17112
- })) {
17113
- select(filteredItems.value[0]);
17114
- }
17115
- isPristine.value = true;
17116
- }
17117
- if (e.key === 'ArrowDown' && highlightFirst.value) {
17118
- listRef.value?.focus('next');
17119
- }
17120
- if (e.key === 'Enter' && search.value) {
17121
- select(transformItem$3(props, search.value));
17122
- if (hasSelectionSlot.value) _search.value = '';
17123
- }
17124
- if (['Backspace', 'Delete'].includes(e.key)) {
17125
- if (!props.multiple && hasSelectionSlot.value && model.value.length > 0 && !search.value) return select(model.value[0], false);
17126
- if (~selectionIndex.value) {
17127
- e.preventDefault();
17128
- const originalSelectionIndex = selectionIndex.value;
17129
- select(model.value[selectionIndex.value], false);
17130
- selectionIndex.value = originalSelectionIndex >= length - 1 ? length - 2 : originalSelectionIndex;
17131
- } else if (e.key === 'Backspace' && !search.value) {
17132
- selectionIndex.value = length - 1;
17133
- }
17134
- return;
17135
- }
17136
- if (!props.multiple) return;
17137
- if (e.key === 'ArrowLeft') {
17138
- if (selectionIndex.value < 0 && selectionStart > 0) return;
17139
- const prev = selectionIndex.value > -1 ? selectionIndex.value - 1 : length - 1;
17140
- if (model.value[prev]) {
17141
- selectionIndex.value = prev;
17142
- } else {
17143
- selectionIndex.value = -1;
17144
- vTextFieldRef.value.setSelectionRange(search.value.length, search.value.length);
17145
- }
17146
- } else if (e.key === 'ArrowRight') {
17147
- if (selectionIndex.value < 0) return;
17148
- const next = selectionIndex.value + 1;
17149
- if (model.value[next]) {
17150
- selectionIndex.value = next;
17151
- } else {
17152
- selectionIndex.value = -1;
17153
- vTextFieldRef.value.setSelectionRange(0, 0);
17154
- }
17155
- } else if (~selectionIndex.value && checkPrintable(e)) {
17156
- selectionIndex.value = -1;
17157
- }
17158
- }
17159
- function onAfterEnter() {
17160
- if (props.eager) {
17161
- vVirtualScrollRef.value?.calculateVisibleItems();
17162
- }
17163
- }
17164
- function onAfterLeave() {
17165
- if (isFocused.value) {
17166
- isPristine.value = true;
17167
- vTextFieldRef.value?.focus();
17168
- }
17169
- }
17170
- /** @param set - null means toggle */
17171
- function select(item) {
17172
- let set = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
17173
- if (!item || item.props.disabled) return;
17174
- if (props.multiple) {
17175
- const index = model.value.findIndex(selection => (props.valueComparator || deepEqual)(selection.value, item.value));
17176
- const add = set == null ? !~index : set;
17177
- if (~index) {
17178
- const value = add ? [...model.value, item] : [...model.value];
17179
- value.splice(index, 1);
17180
- model.value = value;
17181
- } else if (add) {
17182
- model.value = [...model.value, item];
17183
- }
17184
- if (props.clearOnSelect) {
17185
- search.value = '';
17186
- }
17187
- } else {
17188
- const add = set !== false;
17189
- model.value = add ? [item] : [];
17190
- _search.value = add && !hasSelectionSlot.value ? item.title : '';
17191
-
17192
- // watch for search watcher to trigger
17193
- nextTick(() => {
17194
- menu.value = false;
17195
- isPristine.value = true;
17196
- });
17197
- }
17198
- }
17199
- function onFocusin(e) {
17200
- isFocused.value = true;
17201
- setTimeout(() => {
17202
- listHasFocus.value = true;
17203
- });
17204
- }
17205
- function onFocusout(e) {
17206
- listHasFocus.value = false;
17207
- }
17208
- function onUpdateModelValue(v) {
17209
- if (v == null || v === '' && !props.multiple && !hasSelectionSlot.value) model.value = [];
17210
- }
17211
- watch(isFocused, (val, oldVal) => {
17212
- if (val || val === oldVal) return;
17213
- selectionIndex.value = -1;
17214
- menu.value = false;
17215
- if (search.value) {
17216
- if (props.multiple) {
17217
- select(transformItem$3(props, search.value));
17218
- return;
17219
- }
17220
- if (!hasSelectionSlot.value) return;
17221
- if (model.value.some(_ref3 => {
17222
- let {
17223
- title
17224
- } = _ref3;
17225
- return title === search.value;
17226
- })) {
17227
- _search.value = '';
17228
- } else {
17229
- select(transformItem$3(props, search.value));
17230
- }
17231
- }
17232
- });
17233
- watch(menu, () => {
17234
- if (!props.hideSelected && menu.value && model.value.length) {
17235
- const index = displayItems.value.findIndex(item => model.value.some(s => (props.valueComparator || deepEqual)(s.value, item.value)));
17236
- IN_BROWSER && window.requestAnimationFrame(() => {
17237
- index >= 0 && vVirtualScrollRef.value?.scrollToIndex(index);
17238
- });
17239
- }
17240
- });
17241
- watch(() => props.items, (newVal, oldVal) => {
17242
- if (menu.value) return;
17243
- if (isFocused.value && !oldVal.length && newVal.length) {
17244
- menu.value = true;
17245
- }
17246
- });
17247
- useRender(() => {
17248
- const hasList = !!(!props.hideNoData || displayItems.value.length || slots['prepend-item'] || slots['append-item'] || slots['no-data']);
17249
- const isDirty = model.value.length > 0;
17250
- const textFieldProps = VTextField.filterProps(props);
17251
- return createVNode(VTextField, mergeProps({
17252
- "ref": vTextFieldRef
17253
- }, textFieldProps, {
17254
- "modelValue": search.value,
17255
- "onUpdate:modelValue": [$event => search.value = $event, onUpdateModelValue],
17256
- "focused": isFocused.value,
17257
- "onUpdate:focused": $event => isFocused.value = $event,
17258
- "validationValue": model.externalValue,
17259
- "counterValue": counterValue.value,
17260
- "dirty": isDirty,
17261
- "class": ['v-combobox', {
17262
- 'v-combobox--active-menu': menu.value,
17263
- 'v-combobox--chips': !!props.chips,
17264
- 'v-combobox--selection-slot': !!hasSelectionSlot.value,
17265
- 'v-combobox--selecting-index': selectionIndex.value > -1,
17266
- [`v-combobox--${props.multiple ? 'multiple' : 'single'}`]: true
17267
- }, props.class],
17268
- "style": props.style,
17269
- "readonly": form.isReadonly.value,
17270
- "placeholder": isDirty ? undefined : props.placeholder,
17271
- "onClick:clear": onClear,
17272
- "onMousedown:control": onMousedownControl,
17273
- "onKeydown": onKeydown
17274
- }), {
17275
- ...slots,
17276
- default: () => createVNode(Fragment, null, [createVNode(VMenu, mergeProps({
17277
- "ref": vMenuRef,
17278
- "modelValue": menu.value,
17279
- "onUpdate:modelValue": $event => menu.value = $event,
17280
- "activator": "parent",
17281
- "contentClass": "v-combobox__content",
17282
- "disabled": menuDisabled.value,
17283
- "eager": props.eager,
17284
- "maxHeight": 310,
17285
- "openOnClick": false,
17286
- "closeOnContentClick": false,
17287
- "transition": props.transition,
17288
- "onAfterEnter": onAfterEnter,
17289
- "onAfterLeave": onAfterLeave
17290
- }, props.menuProps), {
17291
- default: () => [hasList && createVNode(VList, mergeProps({
17292
- "ref": listRef,
17293
- "selected": selectedValues.value,
17294
- "selectStrategy": props.multiple ? 'independent' : 'single-independent',
17295
- "onMousedown": e => e.preventDefault(),
17296
- "onKeydown": onListKeydown,
17297
- "onFocusin": onFocusin,
17298
- "onFocusout": onFocusout,
17299
- "tabindex": "-1",
17300
- "aria-live": "polite",
17301
- "color": props.itemColor ?? props.color
17302
- }, listEvents, props.listProps), {
17303
- default: () => [slots['prepend-item']?.(), !displayItems.value.length && !props.hideNoData && (slots['no-data']?.() ?? createVNode(VListItem, {
17304
- "key": "no-data",
17305
- "title": t(props.noDataText)
17306
- }, null)), createVNode(VVirtualScroll, {
17307
- "ref": vVirtualScrollRef,
17308
- "renderless": true,
17309
- "items": displayItems.value,
17310
- "itemKey": "value"
17311
- }, {
17312
- default: _ref4 => {
17313
- let {
17314
- item,
17315
- index,
17316
- itemRef
17317
- } = _ref4;
17318
- const itemProps = mergeProps(item.props, {
17319
- ref: itemRef,
17320
- key: item.value,
17321
- active: highlightFirst.value && index === 0 ? true : undefined,
17322
- onClick: () => select(item, null)
17323
- });
17324
- return slots.item?.({
17325
- item,
17326
- index,
17327
- props: itemProps
17328
- }) ?? createVNode(VListItem, mergeProps(itemProps, {
17329
- "role": "option"
17330
- }), {
17331
- prepend: _ref5 => {
17332
- let {
17333
- isSelected
17334
- } = _ref5;
17335
- return createVNode(Fragment, null, [props.multiple && !props.hideSelected ? createVNode(VCheckboxBtn, {
17336
- "key": item.value,
17337
- "modelValue": isSelected,
17338
- "ripple": false,
17339
- "tabindex": "-1"
17340
- }, null) : undefined, item.props.prependAvatar && createVNode(VAvatar, {
17341
- "image": item.props.prependAvatar
17342
- }, null), item.props.prependIcon && createVNode(VIcon, {
17343
- "icon": item.props.prependIcon
17344
- }, null)]);
17345
- },
17346
- title: () => {
17347
- return isPristine.value ? item.title : highlightResult('v-combobox', item.title, getMatches(item)?.title);
17348
- }
17349
- });
17350
- }
17351
- }), slots['append-item']?.()]
17352
- })]
17353
- }), model.value.map((item, index) => {
17354
- function onChipClose(e) {
17355
- e.stopPropagation();
17356
- e.preventDefault();
17357
- select(item, false);
17358
- }
17359
- const slotProps = {
17360
- 'onClick:close': onChipClose,
17361
- onKeydown(e) {
17362
- if (e.key !== 'Enter' && e.key !== ' ') return;
17363
- e.preventDefault();
17364
- e.stopPropagation();
17365
- onChipClose(e);
17366
- },
17367
- onMousedown(e) {
17368
- e.preventDefault();
17369
- e.stopPropagation();
17370
- },
17371
- modelValue: true,
17372
- 'onUpdate:modelValue': undefined
17373
- };
17374
- const hasSlot = hasChips.value ? !!slots.chip : !!slots.selection;
17375
- const slotContent = hasSlot ? ensureValidVNode(hasChips.value ? slots.chip({
17376
- item,
17377
- index,
17378
- props: slotProps
17379
- }) : slots.selection({
17380
- item,
17381
- index
17382
- })) : undefined;
17383
- if (hasSlot && !slotContent) return undefined;
17384
- return createVNode("div", {
17385
- "key": item.value,
17386
- "class": ['v-combobox__selection', index === selectionIndex.value && ['v-combobox__selection--selected', textColorClasses.value]],
17387
- "style": index === selectionIndex.value ? textColorStyles.value : {}
17388
- }, [hasChips.value ? !slots.chip ? createVNode(VChip, mergeProps({
17389
- "key": "chip",
17390
- "closable": props.closableChips,
17391
- "size": "small",
17392
- "text": item.title,
17393
- "disabled": item.props.disabled
17394
- }, slotProps), null) : createVNode(VDefaultsProvider, {
17395
- "key": "chip-defaults",
17396
- "defaults": {
17397
- VChip: {
17398
- closable: props.closableChips,
17399
- size: 'small',
17400
- text: item.title
17401
- }
17402
- }
17403
- }, {
17404
- default: () => [slotContent]
17405
- }) : slotContent ?? createVNode("span", {
17406
- "class": "v-combobox__selection-text"
17407
- }, [item.title, props.multiple && index < model.value.length - 1 && createVNode("span", {
17408
- "class": "v-combobox__selection-comma"
17409
- }, [createTextVNode(",")])])]);
17410
- })]),
17411
- 'append-inner': function () {
17412
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
17413
- args[_key] = arguments[_key];
17414
- }
17415
- return createVNode(Fragment, null, [slots['append-inner']?.(...args), (!props.hideNoData || props.items.length) && props.menuIcon ? createVNode(VIcon, {
17416
- "class": "v-combobox__menu-icon",
17417
- "icon": props.menuIcon,
17418
- "onMousedown": onMousedownMenuIcon,
17419
- "onClick": noop,
17420
- "aria-label": t(label.value),
17421
- "title": t(label.value),
17422
- "tabindex": "-1"
17423
- }, null) : undefined]);
17424
- }
17425
- });
17426
- });
17427
- return forwardRefs({
17428
- isFocused,
17429
- isPristine,
17430
- menu,
17431
- search,
17432
- selectionIndex,
17433
- filteredItems,
17434
- select
17435
- }, vTextFieldRef);
17436
- }
17437
- });
17438
-
17439
- // Utilities
16842
+
16843
+ // Utilities
17440
16844
 
17441
16845
  // Types
17442
16846
 
@@ -18158,101 +17562,760 @@ class VuetifyDateAdapter {
18158
17562
  endOfYear(date) {
18159
17563
  return endOfYear(date);
18160
17564
  }
18161
- }
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
+ });
18162
17812
 
18163
- // Composables
18164
- const DateOptionsSymbol = Symbol.for('vuetify:date-options');
18165
- const DateAdapterSymbol = Symbol.for('vuetify:date-adapter');
18166
- function createDate(options, locale) {
18167
- const _options = mergeDeep({
18168
- adapter: VuetifyDateAdapter,
18169
- locale: {
18170
- af: 'af-ZA',
18171
- // ar: '', # not the same value for all variants
18172
- bg: 'bg-BG',
18173
- ca: 'ca-ES',
18174
- ckb: '',
18175
- cs: 'cs-CZ',
18176
- de: 'de-DE',
18177
- el: 'el-GR',
18178
- en: 'en-US',
18179
- // es: '', # not the same value for all variants
18180
- et: 'et-EE',
18181
- fa: 'fa-IR',
18182
- fi: 'fi-FI',
18183
- // fr: '', #not the same value for all variants
18184
- hr: 'hr-HR',
18185
- hu: 'hu-HU',
18186
- he: 'he-IL',
18187
- id: 'id-ID',
18188
- it: 'it-IT',
18189
- ja: 'ja-JP',
18190
- ko: 'ko-KR',
18191
- lv: 'lv-LV',
18192
- lt: 'lt-LT',
18193
- nl: 'nl-NL',
18194
- no: 'no-NO',
18195
- pl: 'pl-PL',
18196
- pt: 'pt-PT',
18197
- ro: 'ro-RO',
18198
- ru: 'ru-RU',
18199
- sk: 'sk-SK',
18200
- sl: 'sl-SI',
18201
- srCyrl: 'sr-SP',
18202
- srLatn: 'sr-SP',
18203
- sv: 'sv-SE',
18204
- th: 'th-TH',
18205
- tr: 'tr-TR',
18206
- az: 'az-AZ',
18207
- uk: 'uk-UA',
18208
- vi: 'vi-VN',
18209
- zhHans: 'zh-CN',
18210
- zhHant: 'zh-TW'
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
+ }
18211
17955
  }
18212
- }, options);
18213
- return {
18214
- options: _options,
18215
- instance: createInstance(_options, locale)
18216
- };
18217
- }
18218
- function createInstance(options, locale) {
18219
- const instance = reactive(typeof options.adapter === 'function'
18220
- // eslint-disable-next-line new-cap
18221
- ? new options.adapter({
18222
- locale: options.locale[locale.current.value] ?? locale.current.value,
18223
- formats: options.formats
18224
- }) : options.adapter);
18225
- watch(locale.current, value => {
18226
- instance.locale = options.locale[value] ?? value ?? instance.locale;
18227
- });
18228
- return instance;
18229
- }
18230
- function useDate() {
18231
- const options = inject$1(DateOptionsSymbol);
18232
- if (!options) throw new Error('[Vuetify] Could not find injected date options');
18233
- const locale = useLocale();
18234
- return createInstance(options, locale);
18235
- }
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 : '';
18236
18072
 
18237
- // https://stackoverflow.com/questions/274861/how-do-i-calculate-the-week-number-given-a-date/275024#275024
18238
- function getWeek(adapter, value) {
18239
- const date = adapter.toJsDate(value);
18240
- let year = date.getFullYear();
18241
- let d1w1 = new Date(year, 0, 1);
18242
- if (date < d1w1) {
18243
- year = year - 1;
18244
- d1w1 = new Date(year, 0, 1);
18245
- } else {
18246
- const tv = new Date(year + 1, 0, 1);
18247
- if (date >= tv) {
18248
- year = year + 1;
18249
- 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
+ });
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 = [];
18250
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);
18251
18317
  }
18252
- const diffTime = Math.abs(date.getTime() - d1w1.getTime());
18253
- const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
18254
- return Math.floor(diffDays / 7) + 1;
18255
- }
18318
+ });
18256
18319
 
18257
18320
  // Types
18258
18321
 
@@ -22201,70 +22264,6 @@ const VDatePickerYears = genericComponent()({
22201
22264
  }
22202
22265
  });
22203
22266
 
22204
- // Utilities
22205
- const VPickerTitle = createSimpleFunctional('v-picker-title');
22206
-
22207
- // Types
22208
-
22209
- const makeVPickerProps = propsFactory({
22210
- bgColor: String,
22211
- landscape: Boolean,
22212
- title: String,
22213
- hideHeader: Boolean,
22214
- ...makeVSheetProps()
22215
- }, 'VPicker');
22216
- const VPicker = genericComponent()({
22217
- name: 'VPicker',
22218
- props: makeVPickerProps(),
22219
- setup(props, _ref) {
22220
- let {
22221
- slots
22222
- } = _ref;
22223
- const {
22224
- backgroundColorClasses,
22225
- backgroundColorStyles
22226
- } = useBackgroundColor(toRef(props, 'color'));
22227
- useRender(() => {
22228
- const sheetProps = VSheet.filterProps(props);
22229
- const hasTitle = !!(props.title || slots.title);
22230
- return createVNode(VSheet, mergeProps(sheetProps, {
22231
- "color": props.bgColor,
22232
- "class": ['v-picker', {
22233
- 'v-picker--landscape': props.landscape,
22234
- 'v-picker--with-actions': !!slots.actions
22235
- }, props.class],
22236
- "style": props.style
22237
- }), {
22238
- default: () => [!props.hideHeader && createVNode("div", {
22239
- "key": "header",
22240
- "class": [backgroundColorClasses.value],
22241
- "style": [backgroundColorStyles.value]
22242
- }, [hasTitle && createVNode(VPickerTitle, {
22243
- "key": "picker-title"
22244
- }, {
22245
- default: () => [slots.title?.() ?? props.title]
22246
- }), slots.header && createVNode("div", {
22247
- "class": "v-picker__header"
22248
- }, [slots.header()])]), createVNode("div", {
22249
- "class": "v-picker__body"
22250
- }, [slots.default?.()]), slots.actions && createVNode(VDefaultsProvider, {
22251
- "defaults": {
22252
- VBtn: {
22253
- slim: true,
22254
- variant: 'text'
22255
- }
22256
- }
22257
- }, {
22258
- default: () => [createVNode("div", {
22259
- "class": "v-picker__actions"
22260
- }, [slots.actions()])]
22261
- })]
22262
- });
22263
- });
22264
- return {};
22265
- }
22266
- });
22267
-
22268
22267
  // Types
22269
22268
 
22270
22269
  // Types
@@ -22325,6 +22324,9 @@ const VDatePicker = genericComponent()({
22325
22324
  const {
22326
22325
  t
22327
22326
  } = useLocale();
22327
+ const {
22328
+ rtlClasses
22329
+ } = useRtl();
22328
22330
  const model = useProxiedModel(props, 'modelValue', undefined, v => wrapInArray(v), v => props.multiple ? v : v[0]);
22329
22331
  const viewMode = useProxiedModel(props, 'viewMode');
22330
22332
  // const inputMode = useProxiedModel(props, 'inputMode')
@@ -22462,7 +22464,7 @@ const VDatePicker = genericComponent()({
22462
22464
  return createVNode(VPicker, mergeProps(pickerProps, {
22463
22465
  "class": ['v-date-picker', `v-date-picker--${viewMode.value}`, {
22464
22466
  'v-date-picker--show-week': props.showWeek
22465
- }, props.class],
22467
+ }, rtlClasses.value, props.class],
22466
22468
  "style": props.style
22467
22469
  }), {
22468
22470
  title: () => slots.title?.() ?? createVNode("div", {
@@ -31157,7 +31159,7 @@ function createVuetify$1() {
31157
31159
  };
31158
31160
  });
31159
31161
  }
31160
- const version$1 = "3.7.15-dev.2025-03-07";
31162
+ const version$1 = "3.7.15-dev.2025-03-08";
31161
31163
  createVuetify$1.version = version$1;
31162
31164
 
31163
31165
  // Vue's inject() can only be used in setup
@@ -31410,7 +31412,7 @@ var index = /*#__PURE__*/Object.freeze({
31410
31412
 
31411
31413
  /* eslint-disable local-rules/sort-imports */
31412
31414
 
31413
- const version = "3.7.15-dev.2025-03-07";
31415
+ const version = "3.7.15-dev.2025-03-08";
31414
31416
 
31415
31417
  /* eslint-disable local-rules/sort-imports */
31416
31418