vuetify 3.8.4 → 3.8.5

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 (57) hide show
  1. package/dist/_component-variables-labs.sass +1 -0
  2. package/dist/json/attributes.json +3194 -2850
  3. package/dist/json/importMap-labs.json +28 -24
  4. package/dist/json/importMap.json +158 -158
  5. package/dist/json/tags.json +91 -0
  6. package/dist/json/web-types.json +6341 -5124
  7. package/dist/vuetify-labs.cjs +277 -18
  8. package/dist/vuetify-labs.css +3763 -3735
  9. package/dist/vuetify-labs.d.ts +1380 -300
  10. package/dist/vuetify-labs.esm.js +277 -18
  11. package/dist/vuetify-labs.esm.js.map +1 -1
  12. package/dist/vuetify-labs.js +277 -18
  13. package/dist/vuetify-labs.min.css +2 -2
  14. package/dist/vuetify.cjs +5 -9
  15. package/dist/vuetify.cjs.map +1 -1
  16. package/dist/vuetify.css +2976 -2951
  17. package/dist/vuetify.d.ts +67 -64
  18. package/dist/vuetify.esm.js +5 -9
  19. package/dist/vuetify.esm.js.map +1 -1
  20. package/dist/vuetify.js +5 -9
  21. package/dist/vuetify.js.map +1 -1
  22. package/dist/vuetify.min.css +2 -2
  23. package/dist/vuetify.min.js +5 -5
  24. package/dist/vuetify.min.js.map +1 -1
  25. package/lib/components/VAutocomplete/VAutocomplete.js +0 -5
  26. package/lib/components/VAutocomplete/VAutocomplete.js.map +1 -1
  27. package/lib/components/VBottomSheet/VBottomSheet.css +1 -1
  28. package/lib/components/VBottomSheet/VBottomSheet.sass +1 -1
  29. package/lib/components/VBtn/VBtn.css +25 -0
  30. package/lib/components/VBtn/VBtn.sass +9 -0
  31. package/lib/components/VBtn/_variables.scss +1 -0
  32. package/lib/components/VSnackbarQueue/VSnackbarQueue.d.ts +3 -1
  33. package/lib/components/VSnackbarQueue/VSnackbarQueue.js.map +1 -1
  34. package/lib/composables/dateFormat.d.ts +24 -0
  35. package/lib/composables/dateFormat.js +112 -0
  36. package/lib/composables/dateFormat.js.map +1 -0
  37. package/lib/entry-bundler.js +1 -1
  38. package/lib/framework.d.ts +67 -64
  39. package/lib/framework.js +1 -1
  40. package/lib/iconsets/mdi.js +2 -1
  41. package/lib/iconsets/mdi.js.map +1 -1
  42. package/lib/labs/VColorInput/VColorInput.css +4 -0
  43. package/lib/labs/VColorInput/VColorInput.d.ts +1767 -0
  44. package/lib/labs/VColorInput/VColorInput.js +129 -0
  45. package/lib/labs/VColorInput/VColorInput.js.map +1 -0
  46. package/lib/labs/VColorInput/VColorInput.sass +7 -0
  47. package/lib/labs/VColorInput/_variables.scss +2 -0
  48. package/lib/labs/VColorInput/index.d.ts +1 -0
  49. package/lib/labs/VColorInput/index.js +2 -0
  50. package/lib/labs/VColorInput/index.js.map +1 -0
  51. package/lib/labs/VDateInput/VDateInput.d.ts +46 -21
  52. package/lib/labs/VDateInput/VDateInput.js +43 -10
  53. package/lib/labs/VDateInput/VDateInput.js.map +1 -1
  54. package/lib/labs/components.d.ts +1 -0
  55. package/lib/labs/components.js +1 -0
  56. package/lib/labs/components.js.map +1 -1
  57. package/package.json +2 -3
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vuetify v3.8.4
2
+ * Vuetify v3.8.5
3
3
  * Forged by John Leider
4
4
  * Released under the MIT License.
5
5
  */
@@ -4510,7 +4510,8 @@
4510
4510
  treeviewCollapse: 'mdi-menu-down',
4511
4511
  treeviewExpand: 'mdi-menu-right',
4512
4512
  eyeDropper: 'mdi-eyedropper',
4513
- upload: 'mdi-cloud-upload'
4513
+ upload: 'mdi-cloud-upload',
4514
+ color: 'mdi-palette'
4514
4515
  };
4515
4516
  const mdi = {
4516
4517
  // Not using mergeProps here, functional components merge props by default (?)
@@ -13506,11 +13507,6 @@
13506
13507
  menu.value = true;
13507
13508
  }
13508
13509
  });
13509
- vue.watch(model, value => {
13510
- if (!props.multiple && !hasSelectionSlot.value) {
13511
- search.value = value[0]?.title ?? '';
13512
- }
13513
- });
13514
13510
  useRender(() => {
13515
13511
  const hasList = !!(!props.hideNoData || displayItems.value.length || slots['prepend-item'] || slots['append-item'] || slots['no-data']);
13516
13512
  const isDirty = model.value.length > 0;
@@ -29081,6 +29077,236 @@
29081
29077
 
29082
29078
  // Types
29083
29079
 
29080
+ const makeVColorInputProps = propsFactory({
29081
+ pip: Boolean,
29082
+ pipIcon: {
29083
+ type: String,
29084
+ default: '$color'
29085
+ },
29086
+ ...makeFocusProps(),
29087
+ ...makeVConfirmEditProps(),
29088
+ ...makeVTextFieldProps(),
29089
+ ...omit(makeVColorPickerProps(), ['width'])
29090
+ }, 'VColorInput');
29091
+ const VColorInput = genericComponent()({
29092
+ name: 'VColorInput',
29093
+ props: makeVColorInputProps(),
29094
+ emits: {
29095
+ 'update:modelValue': val => true
29096
+ },
29097
+ setup(props, _ref) {
29098
+ let {
29099
+ slots
29100
+ } = _ref;
29101
+ const {
29102
+ isFocused,
29103
+ focus,
29104
+ blur
29105
+ } = useFocus(props);
29106
+ const model = useProxiedModel(props, 'modelValue');
29107
+ const menu = vue.shallowRef(false);
29108
+ const isInteractive = vue.computed(() => !props.disabled && !props.readonly);
29109
+ const display = vue.computed(() => model.value || null);
29110
+ function onKeydown(e) {
29111
+ if (e.key !== 'Enter') return;
29112
+ if (!menu.value || !isFocused.value) {
29113
+ menu.value = true;
29114
+ return;
29115
+ }
29116
+ const target = e.target;
29117
+ model.value = target.value;
29118
+ }
29119
+ function onClick(e) {
29120
+ e.preventDefault();
29121
+ e.stopPropagation();
29122
+ menu.value = true;
29123
+ }
29124
+ function onSave() {
29125
+ menu.value = false;
29126
+ }
29127
+ useRender(() => {
29128
+ const confirmEditProps = VConfirmEdit.filterProps(props);
29129
+ const colorPickerProps = VColorPicker.filterProps(omit(props, ['active', 'color']));
29130
+ const textFieldProps = VTextField.filterProps(omit(props, ['prependInnerIcon']));
29131
+ const hasPrepend = !!(slots.prepend || props.pipIcon);
29132
+ return vue.createVNode(VTextField, vue.mergeProps(textFieldProps, {
29133
+ "class": ['v-color-input', props.class],
29134
+ "style": props.style,
29135
+ "modelValue": display.value,
29136
+ "onKeydown": isInteractive.value ? onKeydown : undefined,
29137
+ "focused": menu.value || isFocused.value,
29138
+ "onFocus": focus,
29139
+ "onBlur": blur,
29140
+ "onClick:control": isInteractive.value ? onClick : undefined,
29141
+ "onClick:prependInner": isInteractive.value ? onClick : undefined,
29142
+ "onClick:appendInner": isInteractive.value ? onClick : undefined,
29143
+ "onUpdate:modelValue": val => {
29144
+ model.value = val;
29145
+ }
29146
+ }), {
29147
+ ...slots,
29148
+ prepend: props.pipIcon ? arg => vue.createVNode(vue.Fragment, null, [hasPrepend && vue.createVNode(VIcon, {
29149
+ "color": props.pip ? model.value : undefined,
29150
+ "icon": props.pipIcon
29151
+ }, null), slots.prepend?.(arg)]) : undefined,
29152
+ default: () => vue.createVNode(vue.Fragment, null, [vue.createVNode(VMenu, {
29153
+ "modelValue": menu.value,
29154
+ "onUpdate:modelValue": $event => menu.value = $event,
29155
+ "activator": "parent",
29156
+ "min-width": "0",
29157
+ "closeOnContentClick": false,
29158
+ "openOnClick": false
29159
+ }, {
29160
+ default: () => [vue.createVNode(VConfirmEdit, vue.mergeProps(confirmEditProps, {
29161
+ "modelValue": model.value,
29162
+ "onUpdate:modelValue": $event => model.value = $event,
29163
+ "onSave": onSave
29164
+ }), {
29165
+ default: _ref2 => {
29166
+ let {
29167
+ actions,
29168
+ model: proxyModel,
29169
+ save,
29170
+ cancel,
29171
+ isPristine
29172
+ } = _ref2;
29173
+ return vue.createVNode(VColorPicker, vue.mergeProps(colorPickerProps, {
29174
+ "modelValue": proxyModel.value,
29175
+ "onUpdate:modelValue": val => {
29176
+ proxyModel.value = val;
29177
+ model.value = val;
29178
+ },
29179
+ "onMousedown": e => e.preventDefault()
29180
+ }), {
29181
+ actions: !props.hideActions ? () => slots.actions?.({
29182
+ save,
29183
+ cancel,
29184
+ isPristine
29185
+ }) ?? actions() : undefined
29186
+ });
29187
+ }
29188
+ })]
29189
+ }), slots.default?.()])
29190
+ });
29191
+ });
29192
+ }
29193
+ });
29194
+
29195
+ // Composables
29196
+
29197
+ // Types
29198
+
29199
+ // Types
29200
+
29201
+ class DateFormatSpec {
29202
+ constructor(order,
29203
+ // mdy | dmy | ymd
29204
+ separator // / | - | .
29205
+ ) {
29206
+ this.order = order;
29207
+ this.separator = separator;
29208
+ }
29209
+ get format() {
29210
+ return this.order.split('').map(sign => `${sign}${sign}`).join(this.separator).replace('yy', 'yyyy');
29211
+ }
29212
+ static canBeParsed(v) {
29213
+ if (typeof v !== 'string') return false;
29214
+ const lowercase = v.toLowerCase();
29215
+ return ['y', 'm', 'd'].every(sign => lowercase.includes(sign)) && ['/', '-', '.'].some(sign => v.includes(sign));
29216
+ }
29217
+ static parse(v) {
29218
+ if (!DateFormatSpec.canBeParsed(v)) {
29219
+ throw new Error(`[${v}] cannot be parsed into date format specification`);
29220
+ }
29221
+ const order = v.toLowerCase().split('').filter((c, i, all) => 'dmy'.includes(c) && all.indexOf(c) === i).join('');
29222
+ const separator = ['/', '-', '.'].find(sign => v.includes(sign));
29223
+ return new DateFormatSpec(order, separator);
29224
+ }
29225
+ }
29226
+ const makeDateFormatProps = propsFactory({
29227
+ inputFormat: {
29228
+ type: String,
29229
+ validator: v => !v || DateFormatSpec.canBeParsed(v)
29230
+ }
29231
+ }, 'date-format');
29232
+ function useDateFormat(props, locale) {
29233
+ const adapter = useDate();
29234
+ function inferFromLocale() {
29235
+ const localeForDateFormat = locale.value ?? 'en-US';
29236
+ const formatFromLocale = Intl.DateTimeFormat(localeForDateFormat, {
29237
+ year: 'numeric',
29238
+ month: '2-digit',
29239
+ day: '2-digit'
29240
+ }).format(adapter.toJsDate(adapter.parseISO('1999-12-07'))).replace(/(07)|(٠٧)|(٢٩)|(۱۶)|(০৭)/, 'dd').replace(/(12)|(١٢)|(٠٨)|(۰۹)|(১২)/, 'mm').replace(/(1999)|(2542)|(١٩٩٩)|(١٤٢٠)|(۱۳۷۸)|(১৯৯৯)/, 'yyyy').replace(/[^ymd\-/.]/g, '').replace(/\.$/, '');
29241
+ if (!DateFormatSpec.canBeParsed(formatFromLocale)) {
29242
+ consoleWarn(`Date format inferred from locale [${localeForDateFormat}] is invalid: [${formatFromLocale}]`);
29243
+ return 'mm/dd/yyyy';
29244
+ }
29245
+ return formatFromLocale;
29246
+ }
29247
+ const currentFormat = vue.toRef(() => {
29248
+ return DateFormatSpec.canBeParsed(props.inputFormat) ? DateFormatSpec.parse(props.inputFormat) : DateFormatSpec.parse(inferFromLocale());
29249
+ });
29250
+ function parseDate(dateString) {
29251
+ function parseDateParts(text) {
29252
+ const parts = text.trim().split(currentFormat.value.separator);
29253
+ return {
29254
+ y: Number(parts[currentFormat.value.order.indexOf('y')]),
29255
+ m: Number(parts[currentFormat.value.order.indexOf('m')]),
29256
+ d: Number(parts[currentFormat.value.order.indexOf('d')])
29257
+ };
29258
+ }
29259
+ function validateDateParts(dateParts) {
29260
+ const {
29261
+ y: year,
29262
+ m: month,
29263
+ d: day
29264
+ } = dateParts;
29265
+ if (!year || !month || !day) return null;
29266
+ if (month < 1 || month > 12) return null;
29267
+ if (day < 1 || day > 31) return null;
29268
+ return {
29269
+ year: autoFixYear(year),
29270
+ month,
29271
+ day
29272
+ };
29273
+ }
29274
+ function autoFixYear(year) {
29275
+ const currentYear = adapter.getYear(adapter.date());
29276
+ if (year > 100 || currentYear % 100 >= 50) {
29277
+ return year;
29278
+ }
29279
+ const currentCentury = ~~(currentYear / 100) * 100;
29280
+ return year < 50 ? currentCentury + year : currentCentury - 100 + year;
29281
+ }
29282
+ const dateParts = parseDateParts(dateString);
29283
+ const validatedParts = validateDateParts(dateParts);
29284
+ if (!validatedParts) return null;
29285
+ const {
29286
+ year,
29287
+ month,
29288
+ day
29289
+ } = validatedParts;
29290
+ const pad = v => String(v).padStart(2, '0');
29291
+ return adapter.parseISO(`${year}-${pad(month)}-${pad(day)}`);
29292
+ }
29293
+ function isValid(text) {
29294
+ return !!parseDate(text);
29295
+ }
29296
+ function formatDate(value) {
29297
+ const parts = adapter.toISO(value).split('-');
29298
+ return currentFormat.value.order.split('').map(sign => parts['ymd'.indexOf(sign)]).join(currentFormat.value.separator);
29299
+ }
29300
+ return {
29301
+ isValid,
29302
+ parseDate,
29303
+ formatDate,
29304
+ parserFormat: vue.toRef(() => currentFormat.value.format)
29305
+ };
29306
+ }
29307
+
29308
+ // Types
29309
+
29084
29310
  // Types
29085
29311
 
29086
29312
  const makeVDateInputProps = propsFactory({
@@ -29089,10 +29315,12 @@
29089
29315
  type: String,
29090
29316
  default: 'bottom start'
29091
29317
  },
29318
+ menu: Boolean,
29092
29319
  updateOn: {
29093
29320
  type: Array,
29094
29321
  default: () => ['blur', 'enter']
29095
29322
  },
29323
+ ...makeDateFormatProps(),
29096
29324
  ...makeDisplayProps({
29097
29325
  mobile: null
29098
29326
  }),
@@ -29101,7 +29329,6 @@
29101
29329
  hideActions: true
29102
29330
  }),
29103
29331
  ...makeVTextFieldProps({
29104
- placeholder: 'mm/dd/yyyy',
29105
29332
  prependIcon: '$calendar'
29106
29333
  }),
29107
29334
  ...omit(makeVDatePickerProps({
@@ -29115,7 +29342,8 @@
29115
29342
  emits: {
29116
29343
  save: value => true,
29117
29344
  cancel: () => true,
29118
- 'update:modelValue': val => true
29345
+ 'update:modelValue': val => true,
29346
+ 'update:menu': val => true
29119
29347
  },
29120
29348
  setup(props, _ref) {
29121
29349
  let {
@@ -29123,9 +29351,16 @@
29123
29351
  slots
29124
29352
  } = _ref;
29125
29353
  const {
29126
- t
29354
+ t,
29355
+ current: currentLocale
29127
29356
  } = useLocale();
29128
29357
  const adapter = useDate();
29358
+ const {
29359
+ isValid,
29360
+ parseDate,
29361
+ formatDate,
29362
+ parserFormat
29363
+ } = useDateFormat(props, currentLocale);
29129
29364
  const {
29130
29365
  mobile
29131
29366
  } = useDisplay(props);
@@ -29136,7 +29371,7 @@
29136
29371
  } = useFocus(props);
29137
29372
  const emptyModelValue = () => props.multiple ? [] : null;
29138
29373
  const model = useProxiedModel(props, 'modelValue', emptyModelValue(), 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);
29139
- const menu = vue.shallowRef(false);
29374
+ const menu = useProxiedModel(props, 'menu');
29140
29375
  const isEditingInput = vue.shallowRef(false);
29141
29376
  const vTextFieldRef = vue.ref();
29142
29377
  const disabledActions = vue.ref(['save']);
@@ -29144,7 +29379,10 @@
29144
29379
  if (typeof props.displayFormat === 'function') {
29145
29380
  return props.displayFormat(date);
29146
29381
  }
29147
- return adapter.format(date, props.displayFormat ?? 'keyboardDate');
29382
+ if (props.displayFormat) {
29383
+ return adapter.format(date, props.displayFormat ?? 'keyboardDate');
29384
+ }
29385
+ return formatDate(date);
29148
29386
  }
29149
29387
  const display = vue.computed(() => {
29150
29388
  const value = wrapInArray(model.value);
@@ -29179,7 +29417,6 @@
29179
29417
  if (e.key !== 'Enter') return;
29180
29418
  if (!menu.value || !isFocused.value) {
29181
29419
  menu.value = true;
29182
- return;
29183
29420
  }
29184
29421
  if (props.updateOn.includes('enter')) {
29185
29422
  onUserInput(e.target);
@@ -29223,13 +29460,32 @@
29223
29460
  let {
29224
29461
  value
29225
29462
  } = _ref2;
29226
- if (value && !adapter.isValid(value)) return;
29227
- model.value = !value ? emptyModelValue() : value;
29463
+ if (!value.trim()) {
29464
+ model.value = emptyModelValue();
29465
+ } else if (!props.multiple) {
29466
+ if (isValid(value)) {
29467
+ model.value = parseDate(value);
29468
+ }
29469
+ } else {
29470
+ const parts = value.trim().split(/\D+-\D+|[^\d\-/.]+/);
29471
+ if (parts.every(isValid)) {
29472
+ if (props.multiple === 'range') {
29473
+ model.value = getRange(parts);
29474
+ } else {
29475
+ model.value = parts.map(parseDate);
29476
+ }
29477
+ }
29478
+ }
29479
+ }
29480
+ function getRange(inputDates) {
29481
+ const [start, stop] = inputDates.map(parseDate).toSorted((a, b) => adapter.isAfter(a, b) ? 1 : -1);
29482
+ const diff = adapter.getDiff(stop ?? start, start, 'days');
29483
+ return [start, ...createRange(diff, 1).map(i => adapter.addDays(start, i))];
29228
29484
  }
29229
29485
  useRender(() => {
29230
29486
  const confirmEditProps = VConfirmEdit.filterProps(props);
29231
29487
  const datePickerProps = VDatePicker.filterProps(omit(props, ['active', 'location', 'rounded']));
29232
- const textFieldProps = VTextField.filterProps(props);
29488
+ const textFieldProps = VTextField.filterProps(omit(props, ['placeholder']));
29233
29489
  return vue.createVNode(VTextField, vue.mergeProps({
29234
29490
  "ref": vTextFieldRef
29235
29491
  }, textFieldProps, {
@@ -29237,11 +29493,13 @@
29237
29493
  "style": props.style,
29238
29494
  "modelValue": display.value,
29239
29495
  "inputmode": inputmode.value,
29496
+ "placeholder": props.placeholder ?? parserFormat.value,
29240
29497
  "readonly": isReadonly.value,
29241
29498
  "onKeydown": isInteractive.value ? onKeydown : undefined,
29242
29499
  "focused": menu.value || isFocused.value,
29243
29500
  "onFocus": focus,
29244
29501
  "onBlur": onBlur,
29502
+ "validationValue": model.value,
29245
29503
  "onClick:control": isInteractive.value ? onClick : undefined,
29246
29504
  "onClick:prepend": isInteractive.value ? onClick : undefined,
29247
29505
  "onUpdate:modelValue": onUpdateDisplayModel
@@ -31208,6 +31466,7 @@
31208
31466
  VClassIcon: VClassIcon,
31209
31467
  VCode: VCode,
31210
31468
  VCol: VCol,
31469
+ VColorInput: VColorInput,
31211
31470
  VColorPicker: VColorPicker,
31212
31471
  VCombobox: VCombobox,
31213
31472
  VComponentIcon: VComponentIcon,
@@ -31674,7 +31933,7 @@
31674
31933
  };
31675
31934
  });
31676
31935
  }
31677
- const version$1 = "3.8.4";
31936
+ const version$1 = "3.8.5";
31678
31937
  createVuetify$1.version = version$1;
31679
31938
 
31680
31939
  // Vue's inject() can only be used in setup
@@ -31972,7 +32231,7 @@
31972
32231
 
31973
32232
  /* eslint-disable local-rules/sort-imports */
31974
32233
 
31975
- const version = "3.8.4";
32234
+ const version = "3.8.5";
31976
32235
 
31977
32236
  /* eslint-disable local-rules/sort-imports */
31978
32237