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