@vuetify/nightly 3.7.18-master.2025-03-24 → 3.7.19-master.2025-03-26

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vuetify v3.7.18-master.2025-03-24
2
+ * Vuetify v3.7.19-master.2025-03-26
3
3
  * Forged by John Leider
4
4
  * Released under the MIT License.
5
5
  */
@@ -13269,12 +13269,7 @@
13269
13269
  } else {
13270
13270
  if (!props.multiple && search.value == null) model.value = [];
13271
13271
  menu.value = false;
13272
- if (!model.value.some(_ref3 => {
13273
- let {
13274
- title
13275
- } = _ref3;
13276
- return title === search.value;
13277
- })) search.value = '';
13272
+ if (props.multiple || hasSelectionSlot.value) search.value = '';
13278
13273
  selectionIndex.value = -1;
13279
13274
  }
13280
13275
  });
@@ -13361,12 +13356,12 @@
13361
13356
  "renderless": true,
13362
13357
  "items": displayItems.value
13363
13358
  }, {
13364
- default: _ref4 => {
13359
+ default: _ref3 => {
13365
13360
  let {
13366
13361
  item,
13367
13362
  index,
13368
13363
  itemRef
13369
- } = _ref4;
13364
+ } = _ref3;
13370
13365
  const itemProps = vue.mergeProps(item.props, {
13371
13366
  ref: itemRef,
13372
13367
  key: item.value,
@@ -13380,10 +13375,10 @@
13380
13375
  }) ?? vue.createVNode(VListItem, vue.mergeProps(itemProps, {
13381
13376
  "role": "option"
13382
13377
  }), {
13383
- prepend: _ref5 => {
13378
+ prepend: _ref4 => {
13384
13379
  let {
13385
13380
  isSelected
13386
- } = _ref5;
13381
+ } = _ref4;
13387
13382
  return vue.createVNode(vue.Fragment, null, [props.multiple && !props.hideSelected ? vue.createVNode(VCheckboxBtn, {
13388
13383
  "key": item.value,
13389
13384
  "modelValue": isSelected,
@@ -28256,11 +28251,13 @@
28256
28251
  // Types
28257
28252
 
28258
28253
  const makeVDateInputProps = propsFactory({
28254
+ displayFormat: [Function, String],
28259
28255
  hideActions: Boolean,
28260
28256
  location: {
28261
28257
  type: String,
28262
28258
  default: 'bottom start'
28263
28259
  },
28260
+ ...makeDisplayProps(),
28264
28261
  ...makeFocusProps(),
28265
28262
  ...makeVConfirmEditProps(),
28266
28263
  ...makeVTextFieldProps({
@@ -28276,16 +28273,22 @@
28276
28273
  name: 'VDateInput',
28277
28274
  props: makeVDateInputProps(),
28278
28275
  emits: {
28276
+ save: value => true,
28277
+ cancel: () => true,
28279
28278
  'update:modelValue': val => true
28280
28279
  },
28281
28280
  setup(props, _ref) {
28282
28281
  let {
28282
+ emit,
28283
28283
  slots
28284
28284
  } = _ref;
28285
28285
  const {
28286
28286
  t
28287
28287
  } = useLocale();
28288
28288
  const adapter = useDate();
28289
+ const {
28290
+ mobile
28291
+ } = useDisplay(props);
28289
28292
  const {
28290
28293
  isFocused,
28291
28294
  focus,
@@ -28293,7 +28296,14 @@
28293
28296
  } = useFocus(props);
28294
28297
  const model = useProxiedModel(props, 'modelValue', props.multiple ? [] : null, val => Array.isArray(val) ? val.map(item => adapter.toJsDate(item)) : val ? adapter.toJsDate(val) : val, val => Array.isArray(val) ? val.map(item => adapter.date(item)) : val ? adapter.date(val) : val);
28295
28298
  const menu = vue.shallowRef(false);
28299
+ const isEditingInput = vue.shallowRef(false);
28296
28300
  const vDateInputRef = vue.ref();
28301
+ function format(date) {
28302
+ if (typeof props.displayFormat === 'function') {
28303
+ return props.displayFormat(date);
28304
+ }
28305
+ return adapter.format(date, props.displayFormat ?? 'keyboardDate');
28306
+ }
28297
28307
  const display = vue.computed(() => {
28298
28308
  const value = wrapInArray(model.value);
28299
28309
  if (!value.length) return null;
@@ -28303,11 +28313,22 @@
28303
28313
  if (props.multiple === 'range') {
28304
28314
  const start = value[0];
28305
28315
  const end = value[value.length - 1];
28306
- return adapter.isValid(start) && adapter.isValid(end) ? `${adapter.format(adapter.date(start), 'keyboardDate')} - ${adapter.format(adapter.date(end), 'keyboardDate')}` : '';
28316
+ if (!adapter.isValid(start) || !adapter.isValid(end)) return '';
28317
+ return `${format(adapter.date(start))} - ${format(adapter.date(end))}`;
28307
28318
  }
28308
- return adapter.isValid(model.value) ? adapter.format(adapter.date(model.value), 'keyboardDate') : '';
28319
+ return adapter.isValid(model.value) ? format(adapter.date(model.value)) : '';
28320
+ });
28321
+ const inputmode = vue.computed(() => {
28322
+ if (!mobile.value) return undefined;
28323
+ if (isEditingInput.value) return 'text';
28324
+ return 'none';
28309
28325
  });
28310
28326
  const isInteractive = vue.computed(() => !props.disabled && !props.readonly);
28327
+ const isReadonly = vue.computed(() => !(mobile.value && isEditingInput.value) && props.readonly);
28328
+ vue.watch(menu, val => {
28329
+ if (val) return;
28330
+ isEditingInput.value = false;
28331
+ });
28311
28332
  function onKeydown(e) {
28312
28333
  if (e.key !== 'Enter') return;
28313
28334
  if (!menu.value || !isFocused.value) {
@@ -28315,20 +28336,39 @@
28315
28336
  return;
28316
28337
  }
28317
28338
  const target = e.target;
28318
- model.value = target.value === '' ? null : target.value;
28339
+ model.value = adapter.isValid(target.value) ? target.value : null;
28319
28340
  }
28320
28341
  function onClick(e) {
28321
28342
  e.preventDefault();
28322
28343
  e.stopPropagation();
28323
- menu.value = true;
28344
+ if (menu.value && mobile.value) {
28345
+ isEditingInput.value = true;
28346
+ } else {
28347
+ menu.value = true;
28348
+ }
28349
+ }
28350
+ function onCancel() {
28351
+ emit('cancel');
28352
+ menu.value = false;
28353
+ isEditingInput.value = false;
28324
28354
  }
28325
- function onSave() {
28355
+ function onSave(value) {
28356
+ emit('save', value);
28326
28357
  menu.value = false;
28327
28358
  }
28328
- function onUpdateModel(value) {
28359
+ function onUpdateDisplayModel(value) {
28329
28360
  if (value != null) return;
28330
28361
  model.value = null;
28331
28362
  }
28363
+ function onBlur() {
28364
+ blur();
28365
+
28366
+ // When in mobile mode and editing is done (due to keyboard dismissal), close the menu
28367
+ if (mobile.value && isEditingInput.value && !isFocused.value) {
28368
+ menu.value = false;
28369
+ isEditingInput.value = false;
28370
+ }
28371
+ }
28332
28372
  useRender(() => {
28333
28373
  const confirmEditProps = VConfirmEdit.filterProps(props);
28334
28374
  const datePickerProps = VDatePicker.filterProps(omit(props, ['active', 'location', 'rounded']));
@@ -28339,13 +28379,15 @@
28339
28379
  "class": props.class,
28340
28380
  "style": props.style,
28341
28381
  "modelValue": display.value,
28382
+ "inputmode": inputmode.value,
28383
+ "readonly": isReadonly.value,
28342
28384
  "onKeydown": isInteractive.value ? onKeydown : undefined,
28343
28385
  "focused": menu.value || isFocused.value,
28344
28386
  "onFocus": focus,
28345
- "onBlur": blur,
28387
+ "onBlur": onBlur,
28346
28388
  "onClick:control": isInteractive.value ? onClick : undefined,
28347
28389
  "onClick:prepend": isInteractive.value ? onClick : undefined,
28348
- "onUpdate:modelValue": onUpdateModel
28390
+ "onUpdate:modelValue": onUpdateDisplayModel
28349
28391
  }), {
28350
28392
  ...slots,
28351
28393
  default: () => vue.createVNode(vue.Fragment, null, [vue.createVNode(VMenu, {
@@ -28362,7 +28404,7 @@
28362
28404
  "modelValue": model.value,
28363
28405
  "onUpdate:modelValue": $event => model.value = $event,
28364
28406
  "onSave": onSave,
28365
- "onCancel": () => menu.value = false
28407
+ "onCancel": onCancel
28366
28408
  }), {
28367
28409
  default: _ref2 => {
28368
28410
  let {
@@ -28372,16 +28414,21 @@
28372
28414
  cancel,
28373
28415
  isPristine
28374
28416
  } = _ref2;
28417
+ function onUpdateModel(value) {
28418
+ if (!props.hideActions) {
28419
+ proxyModel.value = value;
28420
+ } else {
28421
+ model.value = value;
28422
+ if (!props.multiple) {
28423
+ menu.value = false;
28424
+ }
28425
+ }
28426
+ emit('save', value);
28427
+ vDateInputRef.value?.blur();
28428
+ }
28375
28429
  return vue.createVNode(VDatePicker, vue.mergeProps(datePickerProps, {
28376
28430
  "modelValue": props.hideActions ? model.value : proxyModel.value,
28377
- "onUpdate:modelValue": val => {
28378
- if (!props.hideActions) {
28379
- proxyModel.value = val;
28380
- } else {
28381
- model.value = val;
28382
- if (!props.multiple) menu.value = false;
28383
- }
28384
- },
28431
+ "onUpdate:modelValue": value => onUpdateModel(value),
28385
28432
  "onMousedown": e => e.preventDefault()
28386
28433
  }), {
28387
28434
  actions: !props.hideActions ? () => slots.actions?.({
@@ -31099,7 +31146,7 @@
31099
31146
  goTo
31100
31147
  };
31101
31148
  }
31102
- const version$1 = "3.7.18-master.2025-03-24";
31149
+ const version$1 = "3.7.19-master.2025-03-26";
31103
31150
  createVuetify$1.version = version$1;
31104
31151
 
31105
31152
  // Vue's inject() can only be used in setup
@@ -31352,7 +31399,7 @@
31352
31399
 
31353
31400
  /* eslint-disable local-rules/sort-imports */
31354
31401
 
31355
- const version = "3.7.18-master.2025-03-24";
31402
+ const version = "3.7.19-master.2025-03-26";
31356
31403
 
31357
31404
  /* eslint-disable local-rules/sort-imports */
31358
31405