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

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.18-master.2025-03-25
3
3
  * Forged by John Leider
4
4
  * Released under the MIT License.
5
5
  */
@@ -28256,11 +28256,13 @@
28256
28256
  // Types
28257
28257
 
28258
28258
  const makeVDateInputProps = propsFactory({
28259
+ displayFormat: [Function, String],
28259
28260
  hideActions: Boolean,
28260
28261
  location: {
28261
28262
  type: String,
28262
28263
  default: 'bottom start'
28263
28264
  },
28265
+ ...makeDisplayProps(),
28264
28266
  ...makeFocusProps(),
28265
28267
  ...makeVConfirmEditProps(),
28266
28268
  ...makeVTextFieldProps({
@@ -28276,16 +28278,22 @@
28276
28278
  name: 'VDateInput',
28277
28279
  props: makeVDateInputProps(),
28278
28280
  emits: {
28281
+ save: value => true,
28282
+ cancel: () => true,
28279
28283
  'update:modelValue': val => true
28280
28284
  },
28281
28285
  setup(props, _ref) {
28282
28286
  let {
28287
+ emit,
28283
28288
  slots
28284
28289
  } = _ref;
28285
28290
  const {
28286
28291
  t
28287
28292
  } = useLocale();
28288
28293
  const adapter = useDate();
28294
+ const {
28295
+ mobile
28296
+ } = useDisplay();
28289
28297
  const {
28290
28298
  isFocused,
28291
28299
  focus,
@@ -28293,7 +28301,14 @@
28293
28301
  } = useFocus(props);
28294
28302
  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
28303
  const menu = vue.shallowRef(false);
28304
+ const isEditingInput = vue.shallowRef(false);
28296
28305
  const vDateInputRef = vue.ref();
28306
+ function format(date) {
28307
+ if (typeof props.displayFormat === 'function') {
28308
+ return props.displayFormat(date);
28309
+ }
28310
+ return adapter.format(date, props.displayFormat ?? 'keyboardDate');
28311
+ }
28297
28312
  const display = vue.computed(() => {
28298
28313
  const value = wrapInArray(model.value);
28299
28314
  if (!value.length) return null;
@@ -28303,11 +28318,22 @@
28303
28318
  if (props.multiple === 'range') {
28304
28319
  const start = value[0];
28305
28320
  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')}` : '';
28321
+ if (!adapter.isValid(start) || !adapter.isValid(end)) return '';
28322
+ return `${format(adapter.date(start))} - ${format(adapter.date(end))}`;
28307
28323
  }
28308
- return adapter.isValid(model.value) ? adapter.format(adapter.date(model.value), 'keyboardDate') : '';
28324
+ return adapter.isValid(model.value) ? format(adapter.date(model.value)) : '';
28325
+ });
28326
+ const inputmode = vue.computed(() => {
28327
+ if (!mobile.value) return undefined;
28328
+ if (isEditingInput.value) return 'text';
28329
+ return 'none';
28309
28330
  });
28310
28331
  const isInteractive = vue.computed(() => !props.disabled && !props.readonly);
28332
+ const isReadonly = vue.computed(() => !(mobile.value && isEditingInput.value) && props.readonly);
28333
+ vue.watch(menu, val => {
28334
+ if (val) return;
28335
+ isEditingInput.value = false;
28336
+ });
28311
28337
  function onKeydown(e) {
28312
28338
  if (e.key !== 'Enter') return;
28313
28339
  if (!menu.value || !isFocused.value) {
@@ -28320,15 +28346,38 @@
28320
28346
  function onClick(e) {
28321
28347
  e.preventDefault();
28322
28348
  e.stopPropagation();
28323
- menu.value = true;
28349
+ if (menu.value && mobile.value) {
28350
+ isEditingInput.value = true;
28351
+ } else {
28352
+ menu.value = true;
28353
+ }
28354
+ }
28355
+ function onCancel() {
28356
+ emit('cancel');
28357
+ menu.value = false;
28358
+ isEditingInput.value = false;
28324
28359
  }
28325
- function onSave() {
28360
+ function onSave(value) {
28361
+ emit('save', value);
28326
28362
  menu.value = false;
28327
28363
  }
28328
- function onUpdateModel(value) {
28364
+ function onUpdateDisplayModel(value) {
28329
28365
  if (value != null) return;
28330
28366
  model.value = null;
28331
28367
  }
28368
+ function onUpdateMenuModel(isMenuOpen) {
28369
+ if (isMenuOpen) return;
28370
+ isEditingInput.value = false;
28371
+ }
28372
+ function onBlur() {
28373
+ blur();
28374
+
28375
+ // When in mobile mode and editing is done (due to keyboard dismissal), close the menu
28376
+ if (mobile.value && isEditingInput.value && !isFocused.value) {
28377
+ menu.value = false;
28378
+ isEditingInput.value = false;
28379
+ }
28380
+ }
28332
28381
  useRender(() => {
28333
28382
  const confirmEditProps = VConfirmEdit.filterProps(props);
28334
28383
  const datePickerProps = VDatePicker.filterProps(omit(props, ['active', 'location', 'rounded']));
@@ -28339,18 +28388,20 @@
28339
28388
  "class": props.class,
28340
28389
  "style": props.style,
28341
28390
  "modelValue": display.value,
28391
+ "inputmode": inputmode.value,
28392
+ "readonly": isReadonly.value,
28342
28393
  "onKeydown": isInteractive.value ? onKeydown : undefined,
28343
28394
  "focused": menu.value || isFocused.value,
28344
28395
  "onFocus": focus,
28345
- "onBlur": blur,
28396
+ "onBlur": onBlur,
28346
28397
  "onClick:control": isInteractive.value ? onClick : undefined,
28347
28398
  "onClick:prepend": isInteractive.value ? onClick : undefined,
28348
- "onUpdate:modelValue": onUpdateModel
28399
+ "onUpdate:modelValue": onUpdateDisplayModel
28349
28400
  }), {
28350
28401
  ...slots,
28351
28402
  default: () => vue.createVNode(vue.Fragment, null, [vue.createVNode(VMenu, {
28352
28403
  "modelValue": menu.value,
28353
- "onUpdate:modelValue": $event => menu.value = $event,
28404
+ "onUpdate:modelValue": [$event => menu.value = $event, onUpdateMenuModel],
28354
28405
  "activator": "parent",
28355
28406
  "min-width": "0",
28356
28407
  "eager": isFocused.value,
@@ -28362,7 +28413,7 @@
28362
28413
  "modelValue": model.value,
28363
28414
  "onUpdate:modelValue": $event => model.value = $event,
28364
28415
  "onSave": onSave,
28365
- "onCancel": () => menu.value = false
28416
+ "onCancel": onCancel
28366
28417
  }), {
28367
28418
  default: _ref2 => {
28368
28419
  let {
@@ -28372,16 +28423,21 @@
28372
28423
  cancel,
28373
28424
  isPristine
28374
28425
  } = _ref2;
28426
+ function onUpdateModel(value) {
28427
+ if (!props.hideActions) {
28428
+ proxyModel.value = value;
28429
+ } else {
28430
+ model.value = value;
28431
+ if (!props.multiple) {
28432
+ menu.value = false;
28433
+ }
28434
+ }
28435
+ emit('save', value);
28436
+ vDateInputRef.value?.blur();
28437
+ }
28375
28438
  return vue.createVNode(VDatePicker, vue.mergeProps(datePickerProps, {
28376
28439
  "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
- },
28440
+ "onUpdate:modelValue": value => onUpdateModel(value),
28385
28441
  "onMousedown": e => e.preventDefault()
28386
28442
  }), {
28387
28443
  actions: !props.hideActions ? () => slots.actions?.({
@@ -31099,7 +31155,7 @@
31099
31155
  goTo
31100
31156
  };
31101
31157
  }
31102
- const version$1 = "3.7.18-master.2025-03-24";
31158
+ const version$1 = "3.7.18-master.2025-03-25";
31103
31159
  createVuetify$1.version = version$1;
31104
31160
 
31105
31161
  // Vue's inject() can only be used in setup
@@ -31352,7 +31408,7 @@
31352
31408
 
31353
31409
  /* eslint-disable local-rules/sort-imports */
31354
31410
 
31355
- const version = "3.7.18-master.2025-03-24";
31411
+ const version = "3.7.18-master.2025-03-25";
31356
31412
 
31357
31413
  /* eslint-disable local-rules/sort-imports */
31358
31414