vuetify 3.0.0 → 3.0.1

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 (91) hide show
  1. package/dist/json/attributes.json +487 -523
  2. package/dist/json/importMap.json +18 -18
  3. package/dist/json/tags.json +0 -9
  4. package/dist/json/web-types.json +788 -896
  5. package/dist/vuetify.css +227 -227
  6. package/dist/vuetify.d.ts +4375 -3665
  7. package/dist/vuetify.esm.js +1714 -1666
  8. package/dist/vuetify.esm.js.map +1 -1
  9. package/dist/vuetify.js +1713 -1665
  10. package/dist/vuetify.js.map +1 -1
  11. package/dist/vuetify.min.css +2 -2
  12. package/dist/vuetify.min.js +783 -776
  13. package/dist/vuetify.min.js.map +1 -1
  14. package/lib/components/VAutocomplete/VAutocomplete.mjs +12 -4
  15. package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
  16. package/lib/components/VAutocomplete/index.d.ts +392 -158
  17. package/lib/components/VAvatar/VAvatar.mjs +1 -1
  18. package/lib/components/VAvatar/VAvatar.mjs.map +1 -1
  19. package/lib/components/VBreadcrumbs/index.d.ts +2 -0
  20. package/lib/components/VBtn/index.d.ts +1 -0
  21. package/lib/components/VCard/index.d.ts +1 -0
  22. package/lib/components/VCheckbox/VCheckboxBtn.mjs +1 -1
  23. package/lib/components/VCheckbox/VCheckboxBtn.mjs.map +1 -1
  24. package/lib/components/VCheckbox/index.d.ts +1 -1
  25. package/lib/components/VChip/VChip.mjs +0 -1
  26. package/lib/components/VChip/VChip.mjs.map +1 -1
  27. package/lib/components/VChip/index.d.ts +1 -2
  28. package/lib/components/VCombobox/VCombobox.mjs +12 -4
  29. package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
  30. package/lib/components/VCombobox/index.d.ts +392 -158
  31. package/lib/components/VExpansionPanel/VExpansionPanel.css +2 -2
  32. package/lib/components/VExpansionPanel/VExpansionPanel.sass +2 -2
  33. package/lib/components/VExpansionPanel/VExpansionPanelTitle.mjs +1 -1
  34. package/lib/components/VExpansionPanel/VExpansionPanelTitle.mjs.map +1 -1
  35. package/lib/components/VField/index.d.ts +5 -5
  36. package/lib/components/VFileInput/index.d.ts +6 -6
  37. package/lib/components/VInput/VInput.mjs +1 -1
  38. package/lib/components/VInput/VInput.mjs.map +1 -1
  39. package/lib/components/VInput/index.d.ts +4 -4
  40. package/lib/components/VList/VList.mjs +3 -0
  41. package/lib/components/VList/VList.mjs.map +1 -1
  42. package/lib/components/VList/VListGroup.mjs +1 -1
  43. package/lib/components/VList/VListGroup.mjs.map +1 -1
  44. package/lib/components/VList/VListItem.mjs +3 -1
  45. package/lib/components/VList/VListItem.mjs.map +1 -1
  46. package/lib/components/VList/index.d.ts +19 -8
  47. package/lib/components/VNoSsr/VNoSsr.mjs +1 -3
  48. package/lib/components/VNoSsr/VNoSsr.mjs.map +1 -1
  49. package/lib/components/VOverlay/VOverlay.mjs +3 -1
  50. package/lib/components/VOverlay/VOverlay.mjs.map +1 -1
  51. package/lib/components/VOverlay/locationStrategies.mjs +17 -19
  52. package/lib/components/VOverlay/locationStrategies.mjs.map +1 -1
  53. package/lib/components/VOverlay/scrollStrategies.mjs +1 -1
  54. package/lib/components/VOverlay/scrollStrategies.mjs.map +1 -1
  55. package/lib/components/VOverlay/useActivator.mjs +1 -1
  56. package/lib/components/VOverlay/useActivator.mjs.map +1 -1
  57. package/lib/components/VRadioGroup/index.d.ts +1 -1
  58. package/lib/components/VRangeSlider/index.d.ts +1 -1
  59. package/lib/components/VSelect/VSelect.mjs +16 -8
  60. package/lib/components/VSelect/VSelect.mjs.map +1 -1
  61. package/lib/components/VSelect/index.d.ts +392 -158
  62. package/lib/components/VSelectionControl/VSelectionControl.mjs +1 -1
  63. package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
  64. package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs +1 -1
  65. package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs.map +1 -1
  66. package/lib/components/VSlider/index.d.ts +1 -1
  67. package/lib/components/VSwitch/index.d.ts +1 -1
  68. package/lib/components/VTable/VTable.css +9 -9
  69. package/lib/components/VTable/VTable.sass +20 -15
  70. package/lib/components/VTabs/index.d.ts +1 -0
  71. package/lib/components/VTextField/VTextField.mjs +23 -19
  72. package/lib/components/VTextField/VTextField.mjs.map +1 -1
  73. package/lib/components/VTextField/index.d.ts +58 -58
  74. package/lib/components/VTextarea/index.d.ts +6 -6
  75. package/lib/components/VValidation/index.d.ts +1 -1
  76. package/lib/components/index.d.ts +4131 -3421
  77. package/lib/composables/hydration.mjs +8 -4
  78. package/lib/composables/hydration.mjs.map +1 -1
  79. package/lib/composables/icons.mjs +6 -3
  80. package/lib/composables/icons.mjs.map +1 -1
  81. package/lib/composables/router.mjs +2 -2
  82. package/lib/composables/router.mjs.map +1 -1
  83. package/lib/entry-bundler.mjs +1 -1
  84. package/lib/framework.mjs +16 -10
  85. package/lib/framework.mjs.map +1 -1
  86. package/lib/index.d.ts +5 -5
  87. package/lib/util/defineComponent.mjs +2 -2
  88. package/lib/util/defineComponent.mjs.map +1 -1
  89. package/lib/util/helpers.mjs +10 -2
  90. package/lib/util/helpers.mjs.map +1 -1
  91. package/package.json +2 -2
package/dist/vuetify.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vuetify v3.0.0
2
+ * Vuetify v3.0.1
3
3
  * Forged by John Leider
4
4
  * Released under the MIT License.
5
5
  */
@@ -93,7 +93,11 @@
93
93
  }
94
94
  function getPropertyFromItem(item, property, fallback) {
95
95
  if (property == null) return item === undefined ? fallback : item;
96
- if (item !== Object(item)) return fallback;
96
+ if (item !== Object(item)) {
97
+ if (typeof property !== 'function') return fallback;
98
+ const value = property(item, fallback);
99
+ return typeof value === 'undefined' ? fallback : value;
100
+ }
97
101
  if (typeof property === 'string') return getObjectValueByPath(item, property, fallback);
98
102
  if (Array.isArray(property)) return getNestedValue(item, property, fallback);
99
103
  if (typeof property !== 'function') return fallback;
@@ -341,6 +345,10 @@
341
345
  const onRE = /^on[^a-z]/;
342
346
  const isOn = key => onRE.test(key);
343
347
  const EventProp = [Function, Array];
348
+ function hasEvent(props, name) {
349
+ name = 'on' + vue.capitalize(name);
350
+ return !!(props[name] || props[`${name}Once`] || props[`${name}Capture`] || props[`${name}OnceCapture`] || props[`${name}CaptureOnce`]);
351
+ }
344
352
  function callEvent(handler) {
345
353
  for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
346
354
  args[_key2 - 1] = arguments[_key2];
@@ -985,7 +993,7 @@
985
993
  }
986
994
  if (options._setup) {
987
995
  options.props = options.props ?? {};
988
- options.props = propsFactory(options.props, options.name)();
996
+ options.props = propsFactory(options.props, toKebabCase(options.name))();
989
997
  options.props._as = String;
990
998
  options.setup = function setup(props, ctx) {
991
999
  const vm = vue.getCurrentInstance();
@@ -1000,7 +1008,7 @@
1000
1008
  if (componentDefaults) {
1001
1009
  const subComponents = Object.entries(componentDefaults).filter(_ref => {
1002
1010
  let [key] = _ref;
1003
- return key.startsWith('V');
1011
+ return key.startsWith(key[0].toUpperCase());
1004
1012
  });
1005
1013
  if (subComponents.length) _subcomponentDefaults.value = Object.fromEntries(subComponents);
1006
1014
  }
@@ -3798,9 +3806,12 @@
3798
3806
  const iconAlias = vue.isRef(props) ? props.value : props.icon;
3799
3807
  if (!iconAlias) throw new Error('Icon value is undefined or null');
3800
3808
  let icon = iconAlias;
3801
- if (typeof iconAlias === 'string' && iconAlias.includes('$')) {
3802
- var _icons$aliases;
3803
- icon = (_icons$aliases = icons.aliases) == null ? void 0 : _icons$aliases[iconAlias.slice(iconAlias.indexOf('$') + 1)];
3809
+ if (typeof icon === 'string') {
3810
+ icon = icon.trim();
3811
+ if (icon.startsWith('$')) {
3812
+ var _icons$aliases;
3813
+ icon = (_icons$aliases = icons.aliases) == null ? void 0 : _icons$aliases[icon.slice(1)];
3814
+ }
3804
3815
  }
3805
3816
  if (!icon) throw new Error(`Could not find aliased icon "${iconAlias}"`);
3806
3817
  if (typeof icon !== 'string') {
@@ -4631,7 +4642,7 @@
4631
4642
  const RouterLink = vue.resolveDynamicComponent('RouterLink');
4632
4643
  const isLink = vue.computed(() => !!(props.href || props.to));
4633
4644
  const isClickable = vue.computed(() => {
4634
- return (isLink == null ? void 0 : isLink.value) || !!(attrs.onClick || attrs.onClickOnce);
4645
+ return (isLink == null ? void 0 : isLink.value) || hasEvent(attrs, 'click') || hasEvent(props, 'click');
4635
4646
  });
4636
4647
  if (typeof RouterLink === 'string') {
4637
4648
  return {
@@ -5126,178 +5137,75 @@
5126
5137
  }
5127
5138
  });
5128
5139
 
5129
- // Types
5140
+ function useInputIcon(props) {
5141
+ const {
5142
+ t
5143
+ } = useLocale();
5144
+ function InputIcon(_ref) {
5145
+ let {
5146
+ name
5147
+ } = _ref;
5148
+ const localeKey = {
5149
+ prepend: 'prependAction',
5150
+ prependInner: 'prependAction',
5151
+ append: 'appendAction',
5152
+ appendInner: 'appendAction',
5153
+ clear: 'clear'
5154
+ }[name];
5155
+ const listener = props[`onClick:${name}`];
5156
+ const label = listener && localeKey ? t(`$vuetify.input.${localeKey}`, props.label ?? '') : undefined;
5157
+ return vue.createVNode(VIcon, {
5158
+ "icon": props[`${name}Icon`],
5159
+ "aria-label": label,
5160
+ "onClick": listener
5161
+ }, null);
5162
+ }
5163
+ return {
5164
+ InputIcon
5165
+ };
5166
+ }
5130
5167
 
5131
- const VMessages = defineComponent({
5132
- name: 'VMessages',
5168
+ const VLabel = defineComponent({
5169
+ name: 'VLabel',
5133
5170
  props: {
5134
- active: Boolean,
5135
- color: String,
5136
- messages: {
5137
- type: [Array, String],
5138
- default: () => []
5139
- },
5140
- ...makeTransitionProps({
5141
- transition: {
5142
- component: VSlideYTransition,
5143
- leaveAbsolute: true,
5144
- group: true
5145
- }
5146
- })
5171
+ text: String,
5172
+ clickable: Boolean,
5173
+ ...makeThemeProps()
5147
5174
  },
5148
5175
  setup(props, _ref) {
5149
5176
  let {
5150
5177
  slots
5151
5178
  } = _ref;
5152
- const messages = vue.computed(() => wrapInArray(props.messages));
5153
- const {
5154
- textColorClasses,
5155
- textColorStyles
5156
- } = useTextColor(vue.computed(() => props.color));
5157
- useRender(() => vue.createVNode(MaybeTransition, {
5158
- "transition": props.transition,
5159
- "tag": "div",
5160
- "class": ['v-messages', textColorClasses.value],
5161
- "style": textColorStyles.value
5162
- }, {
5163
- default: () => [props.active && messages.value.map((message, i) => vue.createVNode("div", {
5164
- "class": "v-messages__message",
5165
- "key": `${i}-${messages.value}`
5166
- }, [slots.message ? slots.message({
5167
- message
5168
- }) : message]))]
5169
- }));
5179
+ useRender(() => {
5180
+ var _slots$default;
5181
+ return vue.createVNode("label", {
5182
+ "class": ['v-label', {
5183
+ 'v-label--clickable': props.clickable
5184
+ }]
5185
+ }, [props.text, (_slots$default = slots.default) == null ? void 0 : _slots$default.call(slots)]);
5186
+ });
5170
5187
  return {};
5171
5188
  }
5172
5189
  });
5173
5190
 
5174
- // Utilities
5175
-
5176
- // Types
5177
-
5178
- const FormKey = Symbol.for('vuetify:form');
5179
- const makeFormProps = propsFactory({
5180
- disabled: Boolean,
5181
- fastFail: Boolean,
5182
- lazyValidation: Boolean,
5183
- readonly: Boolean,
5184
- modelValue: {
5185
- type: Boolean,
5186
- default: null
5191
+ const VFieldLabel = defineComponent({
5192
+ name: 'VFieldLabel',
5193
+ props: {
5194
+ floating: Boolean
5187
5195
  },
5188
- validateOn: {
5189
- type: String,
5190
- default: 'input'
5191
- }
5192
- }, 'form');
5193
- function createForm(props) {
5194
- const model = useProxiedModel(props, 'modelValue');
5195
- const isDisabled = vue.computed(() => props.disabled);
5196
- const isReadonly = vue.computed(() => props.readonly);
5197
- const isValidating = vue.ref(false);
5198
- const items = vue.ref([]);
5199
- const errors = vue.ref([]);
5200
- async function validate() {
5201
- const results = [];
5202
- let valid = true;
5203
- errors.value = [];
5204
- isValidating.value = true;
5205
- for (const item of items.value) {
5206
- const itemErrorMessages = await item.validate();
5207
- if (itemErrorMessages.length > 0) {
5208
- valid = false;
5209
- results.push({
5210
- id: item.id,
5211
- errorMessages: itemErrorMessages
5212
- });
5213
- }
5214
- if (!valid && props.fastFail) break;
5215
- }
5216
- errors.value = results;
5217
- isValidating.value = false;
5218
- return {
5219
- valid,
5220
- errors: errors.value
5221
- };
5222
- }
5223
- function reset() {
5224
- items.value.forEach(item => item.reset());
5225
- model.value = null;
5226
- }
5227
- function resetValidation() {
5228
- items.value.forEach(item => item.resetValidation());
5229
- errors.value = [];
5230
- model.value = null;
5196
+ setup(props, _ref) {
5197
+ let {
5198
+ slots
5199
+ } = _ref;
5200
+ useRender(() => vue.createVNode(VLabel, {
5201
+ "class": ['v-field-label', {
5202
+ 'v-field-label--floating': props.floating
5203
+ }],
5204
+ "aria-hidden": props.floating || undefined
5205
+ }, slots));
5206
+ return {};
5231
5207
  }
5232
- vue.watch(items, () => {
5233
- let valid = 0;
5234
- let invalid = 0;
5235
- const results = [];
5236
- for (const item of items.value) {
5237
- if (item.isValid === false) {
5238
- invalid++;
5239
- results.push({
5240
- id: item.id,
5241
- errorMessages: item.errorMessages
5242
- });
5243
- } else if (item.isValid === true) valid++;
5244
- }
5245
- errors.value = results;
5246
- model.value = invalid > 0 ? false : valid === items.value.length ? true : null;
5247
- }, {
5248
- deep: true
5249
- });
5250
- vue.provide(FormKey, {
5251
- register: _ref => {
5252
- let {
5253
- id,
5254
- validate,
5255
- reset,
5256
- resetValidation
5257
- } = _ref;
5258
- if (items.value.some(item => item.id === id)) {
5259
- consoleWarn(`Duplicate input name "${id}"`);
5260
- }
5261
- items.value.push({
5262
- id,
5263
- validate,
5264
- reset,
5265
- resetValidation,
5266
- isValid: null,
5267
- errorMessages: []
5268
- });
5269
- },
5270
- unregister: id => {
5271
- items.value = items.value.filter(item => {
5272
- return item.id !== id;
5273
- });
5274
- },
5275
- update: (id, isValid, errorMessages) => {
5276
- const found = items.value.find(item => item.id === id);
5277
- if (!found) return;
5278
- found.isValid = isValid;
5279
- found.errorMessages = errorMessages;
5280
- },
5281
- isDisabled,
5282
- isReadonly,
5283
- isValidating,
5284
- items,
5285
- validateOn: vue.toRef(props, 'validateOn')
5286
- });
5287
- return {
5288
- errors,
5289
- isDisabled,
5290
- isReadonly,
5291
- isValidating,
5292
- items,
5293
- validate,
5294
- reset,
5295
- resetValidation
5296
- };
5297
- }
5298
- function useForm() {
5299
- return vue.inject(FormKey, null);
5300
- }
5208
+ });
5301
5209
 
5302
5210
  // Components
5303
5211
 
@@ -5329,346 +5237,1012 @@
5329
5237
  };
5330
5238
  }
5331
5239
 
5332
- // Composables
5333
-
5334
5240
  // Types
5335
5241
 
5336
- const makeValidationProps = propsFactory({
5242
+ const allowedVariants$1 = ['underlined', 'outlined', 'filled', 'solo', 'plain'];
5243
+ const makeVFieldProps = propsFactory({
5244
+ appendInnerIcon: IconValue,
5245
+ bgColor: String,
5246
+ clearable: Boolean,
5247
+ clearIcon: {
5248
+ type: IconValue,
5249
+ default: '$clear'
5250
+ },
5251
+ active: Boolean,
5252
+ color: String,
5253
+ dirty: Boolean,
5337
5254
  disabled: Boolean,
5338
5255
  error: Boolean,
5339
- errorMessages: {
5340
- type: [Array, String],
5341
- default: () => []
5342
- },
5343
- maxErrors: {
5344
- type: [Number, String],
5345
- default: 1
5346
- },
5347
- name: String,
5348
5256
  label: String,
5349
- readonly: Boolean,
5350
- rules: {
5351
- type: Array,
5352
- default: () => []
5257
+ persistentClear: Boolean,
5258
+ prependInnerIcon: IconValue,
5259
+ reverse: Boolean,
5260
+ singleLine: Boolean,
5261
+ variant: {
5262
+ type: String,
5263
+ default: 'filled',
5264
+ validator: v => allowedVariants$1.includes(v)
5353
5265
  },
5354
- modelValue: null,
5355
- validateOn: String,
5356
- validationValue: null,
5357
- ...makeFocusProps()
5358
- }, 'validation');
5359
- function useValidation(props) {
5360
- let name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getCurrentInstanceName();
5361
- let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : getUid();
5362
- const model = useProxiedModel(props, 'modelValue');
5363
- const validationModel = vue.computed(() => props.validationValue === undefined ? model.value : props.validationValue);
5364
- const form = useForm();
5365
- const internalErrorMessages = vue.ref([]);
5366
- const isPristine = vue.ref(true);
5367
- const isDirty = vue.computed(() => !!(wrapInArray(model.value === '' ? null : model.value).length || wrapInArray(validationModel.value === '' ? null : validationModel.value).length));
5368
- const isDisabled = vue.computed(() => !!(props.disabled || form != null && form.isDisabled.value));
5369
- const isReadonly = vue.computed(() => !!(props.readonly || form != null && form.isReadonly.value));
5370
- const errorMessages = vue.computed(() => {
5371
- return props.errorMessages.length ? wrapInArray(props.errorMessages) : internalErrorMessages.value;
5372
- });
5373
- const isValid = vue.computed(() => {
5374
- if (props.error || errorMessages.value.length) return false;
5375
- if (!props.rules.length) return true;
5376
- return isPristine.value ? null : true;
5377
- });
5378
- const isValidating = vue.ref(false);
5379
- const validationClasses = vue.computed(() => {
5380
- return {
5381
- [`${name}--error`]: isValid.value === false,
5382
- [`${name}--dirty`]: isDirty.value,
5383
- [`${name}--disabled`]: isDisabled.value,
5384
- [`${name}--readonly`]: isReadonly.value
5385
- };
5386
- });
5387
- const uid = vue.computed(() => props.name ?? vue.unref(id));
5388
- vue.onBeforeMount(() => {
5389
- form == null ? void 0 : form.register({
5390
- id: uid.value,
5391
- validate,
5392
- reset,
5393
- resetValidation
5394
- });
5395
- });
5396
- vue.onBeforeUnmount(() => {
5397
- form == null ? void 0 : form.unregister(uid.value);
5398
- });
5399
- const validateOn = vue.computed(() => props.validateOn || (form == null ? void 0 : form.validateOn.value) || 'input');
5400
-
5401
- // Set initial valid state, for inputs that might not have rules
5402
- vue.onMounted(() => form == null ? void 0 : form.update(uid.value, isValid.value, errorMessages.value));
5403
- useToggleScope(() => validateOn.value === 'input', () => {
5404
- vue.watch(validationModel, () => {
5405
- if (validationModel.value != null) {
5406
- validate();
5407
- } else if (props.focused) {
5408
- const unwatch = vue.watch(() => props.focused, val => {
5409
- if (!val) validate();
5410
- unwatch();
5411
- });
5412
- }
5413
- });
5414
- });
5415
- useToggleScope(() => validateOn.value === 'blur', () => {
5416
- vue.watch(() => props.focused, val => {
5417
- if (!val) validate();
5418
- });
5419
- });
5420
- vue.watch(isValid, () => {
5421
- form == null ? void 0 : form.update(uid.value, isValid.value, errorMessages.value);
5422
- });
5423
- function reset() {
5424
- resetValidation();
5425
- model.value = null;
5426
- }
5427
- function resetValidation() {
5428
- isPristine.value = true;
5429
- internalErrorMessages.value = [];
5430
- }
5431
- async function validate() {
5432
- const results = [];
5433
- isValidating.value = true;
5434
- for (const rule of props.rules) {
5435
- if (results.length >= (props.maxErrors || 1)) {
5436
- break;
5437
- }
5438
- const handler = typeof rule === 'function' ? rule : () => rule;
5439
- const result = await handler(validationModel.value);
5440
- if (result === true) continue;
5441
- if (typeof result !== 'string') {
5442
- // eslint-disable-next-line no-console
5443
- console.warn(`${result} is not a valid value. Rule functions must return boolean true or a string.`);
5444
- continue;
5445
- }
5446
- results.push(result);
5447
- }
5448
- internalErrorMessages.value = results;
5449
- isValidating.value = false;
5450
- isPristine.value = false;
5451
- return internalErrorMessages.value;
5452
- }
5453
- return {
5454
- errorMessages,
5455
- isDirty,
5456
- isDisabled,
5457
- isReadonly,
5458
- isPristine,
5459
- isValid,
5460
- isValidating,
5461
- reset,
5462
- resetValidation,
5463
- validate,
5464
- validationClasses
5465
- };
5466
- }
5467
-
5468
- function useInputIcon(props) {
5469
- const {
5470
- t
5471
- } = useLocale();
5472
- function InputIcon(_ref) {
5473
- let {
5474
- name
5475
- } = _ref;
5476
- const localeKey = {
5477
- prepend: 'prependAction',
5478
- prependInner: 'prependAction',
5479
- append: 'appendAction',
5480
- appendInner: 'appendAction',
5481
- clear: 'clear'
5482
- }[name];
5483
- const listener = props[`onClick:${name}`];
5484
- const label = listener && localeKey ? t(`$vuetify.input.${localeKey}`, props.label ?? '') : undefined;
5485
- return vue.createVNode(VIcon, {
5486
- "icon": props[`${name}Icon`],
5487
- "aria-label": label,
5488
- "onClick": listener
5489
- }, null);
5490
- }
5491
- return {
5492
- InputIcon
5493
- };
5494
- }
5495
-
5496
- const makeVInputProps = propsFactory({
5497
- id: String,
5498
- appendIcon: IconValue,
5499
- prependIcon: IconValue,
5500
- hideDetails: [Boolean, String],
5501
- messages: {
5502
- type: [Array, String],
5503
- default: () => []
5504
- },
5505
- direction: {
5506
- type: String,
5507
- default: 'horizontal',
5508
- validator: v => ['horizontal', 'vertical'].includes(v)
5509
- },
5510
- 'onClick:prepend': EventProp,
5511
- 'onClick:append': EventProp,
5512
- ...makeDensityProps(),
5513
- ...makeValidationProps()
5514
- }, 'VInput');
5515
- const VInput = genericComponent()({
5516
- name: 'VInput',
5266
+ 'onClick:clear': EventProp,
5267
+ 'onClick:appendInner': EventProp,
5268
+ 'onClick:prependInner': EventProp,
5269
+ ...makeThemeProps(),
5270
+ ...makeLoaderProps()
5271
+ }, 'v-field');
5272
+ const VField = genericComponent()({
5273
+ name: 'VField',
5274
+ inheritAttrs: false,
5517
5275
  props: {
5518
- ...makeVInputProps()
5276
+ id: String,
5277
+ ...makeFocusProps(),
5278
+ ...makeVFieldProps()
5519
5279
  },
5520
5280
  emits: {
5281
+ 'click:control': e => true,
5282
+ 'update:focused': focused => true,
5521
5283
  'update:modelValue': val => true
5522
5284
  },
5523
5285
  setup(props, _ref) {
5524
5286
  let {
5525
5287
  attrs,
5526
- slots,
5527
- emit
5288
+ emit,
5289
+ slots
5528
5290
  } = _ref;
5529
5291
  const {
5530
- densityClasses
5531
- } = useDensity(props);
5292
+ themeClasses
5293
+ } = provideTheme(props);
5294
+ const {
5295
+ loaderClasses
5296
+ } = useLoader(props);
5297
+ const {
5298
+ focusClasses,
5299
+ isFocused,
5300
+ focus,
5301
+ blur
5302
+ } = useFocus(props);
5532
5303
  const {
5533
5304
  InputIcon
5534
5305
  } = useInputIcon(props);
5306
+ const isActive = vue.computed(() => props.dirty || props.active);
5307
+ const hasLabel = vue.computed(() => !props.singleLine && !!(props.label || slots.label));
5535
5308
  const uid = getUid();
5536
5309
  const id = vue.computed(() => props.id || `input-${uid}`);
5310
+ const labelRef = vue.ref();
5311
+ const floatingLabelRef = vue.ref();
5312
+ const controlRef = vue.ref();
5537
5313
  const {
5538
- errorMessages,
5539
- isDirty,
5540
- isDisabled,
5541
- isReadonly,
5542
- isPristine,
5543
- isValid,
5544
- isValidating,
5545
- reset,
5546
- resetValidation,
5547
- validate,
5548
- validationClasses
5549
- } = useValidation(props, 'v-input', id);
5550
- const slotProps = vue.computed(() => ({
5551
- id,
5552
- isDirty,
5553
- isDisabled,
5554
- isReadonly,
5555
- isPristine,
5556
- isValid,
5557
- isValidating,
5558
- reset,
5559
- resetValidation,
5560
- validate
5314
+ backgroundColorClasses,
5315
+ backgroundColorStyles
5316
+ } = useBackgroundColor(vue.toRef(props, 'bgColor'));
5317
+ const {
5318
+ textColorClasses,
5319
+ textColorStyles
5320
+ } = useTextColor(vue.computed(() => {
5321
+ return isActive.value && isFocused.value && !props.error && !props.disabled ? props.color : undefined;
5561
5322
  }));
5562
- useRender(() => {
5563
- var _props$messages, _slots$prepend, _slots$default, _slots$append, _slots$details;
5564
- const hasPrepend = !!(slots.prepend || props.prependIcon);
5565
- const hasAppend = !!(slots.append || props.appendIcon);
5566
- const hasMessages = !!((_props$messages = props.messages) != null && _props$messages.length || errorMessages.value.length);
5567
- const hasDetails = !props.hideDetails || props.hideDetails === 'auto' && (hasMessages || !!slots.details);
5568
- return vue.createVNode("div", {
5569
- "class": ['v-input', `v-input--${props.direction}`, densityClasses.value, validationClasses.value]
5570
- }, [hasPrepend && vue.createVNode("div", {
5571
- "key": "prepend",
5572
- "class": "v-input__prepend"
5573
- }, [(_slots$prepend = slots.prepend) == null ? void 0 : _slots$prepend.call(slots, slotProps.value), props.prependIcon && vue.createVNode(InputIcon, {
5574
- "key": "prepend-icon",
5575
- "name": "prepend"
5576
- }, null)]), slots.default && vue.createVNode("div", {
5577
- "class": "v-input__control"
5578
- }, [(_slots$default = slots.default) == null ? void 0 : _slots$default.call(slots, slotProps.value)]), hasAppend && vue.createVNode("div", {
5579
- "key": "append",
5580
- "class": "v-input__append"
5581
- }, [props.appendIcon && vue.createVNode(InputIcon, {
5582
- "key": "append-icon",
5583
- "name": "append"
5584
- }, null), (_slots$append = slots.append) == null ? void 0 : _slots$append.call(slots, slotProps.value)]), hasDetails && vue.createVNode("div", {
5585
- "class": "v-input__details"
5586
- }, [vue.createVNode(VMessages, {
5587
- "active": hasMessages,
5588
- "messages": errorMessages.value.length > 0 ? errorMessages.value : props.messages
5589
- }, {
5590
- message: slots.message
5591
- }), (_slots$details = slots.details) == null ? void 0 : _slots$details.call(slots, slotProps.value)])]);
5323
+ vue.watch(isActive, val => {
5324
+ if (hasLabel.value) {
5325
+ const el = labelRef.value.$el;
5326
+ const targetEl = floatingLabelRef.value.$el;
5327
+ const rect = nullifyTransforms(el);
5328
+ const targetRect = targetEl.getBoundingClientRect();
5329
+ const x = targetRect.x - rect.x;
5330
+ const y = targetRect.y - rect.y - (rect.height / 2 - targetRect.height / 2);
5331
+ const targetWidth = targetRect.width / 0.75;
5332
+ const width = Math.abs(targetWidth - rect.width) > 1 ? {
5333
+ maxWidth: convertToUnit(targetWidth)
5334
+ } : undefined;
5335
+ const style = getComputedStyle(el);
5336
+ const targetStyle = getComputedStyle(targetEl);
5337
+ const duration = parseFloat(style.transitionDuration) * 1000 || 150;
5338
+ const scale = parseFloat(targetStyle.getPropertyValue('--v-field-label-scale'));
5339
+ const color = targetStyle.getPropertyValue('color');
5340
+ el.style.visibility = 'visible';
5341
+ targetEl.style.visibility = 'hidden';
5342
+ animate(el, {
5343
+ transform: `translate(${x}px, ${y}px) scale(${scale})`,
5344
+ color,
5345
+ ...width
5346
+ }, {
5347
+ duration,
5348
+ easing: standardEasing,
5349
+ direction: val ? 'normal' : 'reverse'
5350
+ }).finished.then(() => {
5351
+ el.style.removeProperty('visibility');
5352
+ targetEl.style.removeProperty('visibility');
5353
+ });
5354
+ }
5355
+ }, {
5356
+ flush: 'post'
5357
+ });
5358
+ const slotProps = vue.computed(() => ({
5359
+ isActive,
5360
+ isFocused,
5361
+ controlRef,
5362
+ blur,
5363
+ focus
5364
+ }));
5365
+ function onClick(e) {
5366
+ if (e.target !== document.activeElement) {
5367
+ e.preventDefault();
5368
+ }
5369
+ emit('click:control', e);
5370
+ }
5371
+ useRender(() => {
5372
+ var _slots$prependInner, _slots$default, _slots$appendInner;
5373
+ const isOutlined = props.variant === 'outlined';
5374
+ const hasPrepend = slots['prepend-inner'] || props.prependInnerIcon;
5375
+ const hasClear = !!(props.clearable || slots.clear);
5376
+ const hasAppend = !!(slots['append-inner'] || props.appendInnerIcon || hasClear);
5377
+ const label = slots.label ? slots.label({
5378
+ label: props.label,
5379
+ props: {
5380
+ for: id.value
5381
+ }
5382
+ }) : props.label;
5383
+ return vue.createVNode("div", vue.mergeProps({
5384
+ "class": ['v-field', {
5385
+ 'v-field--active': isActive.value,
5386
+ 'v-field--appended': hasAppend,
5387
+ 'v-field--disabled': props.disabled,
5388
+ 'v-field--dirty': props.dirty,
5389
+ 'v-field--error': props.error,
5390
+ 'v-field--has-background': !!props.bgColor,
5391
+ 'v-field--persistent-clear': props.persistentClear,
5392
+ 'v-field--prepended': hasPrepend,
5393
+ 'v-field--reverse': props.reverse,
5394
+ 'v-field--single-line': props.singleLine,
5395
+ 'v-field--no-label': !label,
5396
+ [`v-field--variant-${props.variant}`]: true
5397
+ }, themeClasses.value, backgroundColorClasses.value, focusClasses.value, loaderClasses.value],
5398
+ "style": [backgroundColorStyles.value, textColorStyles.value],
5399
+ "onClick": onClick
5400
+ }, attrs), [vue.createVNode("div", {
5401
+ "class": "v-field__overlay"
5402
+ }, null), vue.createVNode(LoaderSlot, {
5403
+ "name": "v-field",
5404
+ "active": props.loading,
5405
+ "color": props.error ? 'error' : props.color
5406
+ }, {
5407
+ default: slots.loader
5408
+ }), hasPrepend && vue.createVNode("div", {
5409
+ "key": "prepend",
5410
+ "class": "v-field__prepend-inner"
5411
+ }, [props.prependInnerIcon && vue.createVNode(InputIcon, {
5412
+ "key": "prepend-icon",
5413
+ "name": "prependInner"
5414
+ }, null), (_slots$prependInner = slots['prepend-inner']) == null ? void 0 : _slots$prependInner.call(slots, slotProps.value)]), vue.createVNode("div", {
5415
+ "class": "v-field__field",
5416
+ "data-no-activator": ""
5417
+ }, [['solo', 'filled'].includes(props.variant) && hasLabel.value && vue.createVNode(VFieldLabel, {
5418
+ "key": "floating-label",
5419
+ "ref": floatingLabelRef,
5420
+ "class": [textColorClasses.value],
5421
+ "floating": true,
5422
+ "for": id.value
5423
+ }, {
5424
+ default: () => [label]
5425
+ }), vue.createVNode(VFieldLabel, {
5426
+ "ref": labelRef,
5427
+ "for": id.value
5428
+ }, {
5429
+ default: () => [label]
5430
+ }), (_slots$default = slots.default) == null ? void 0 : _slots$default.call(slots, {
5431
+ ...slotProps.value,
5432
+ props: {
5433
+ id: id.value,
5434
+ class: 'v-field__input'
5435
+ },
5436
+ focus,
5437
+ blur
5438
+ })]), hasClear && vue.createVNode(VExpandXTransition, {
5439
+ "key": "clear"
5440
+ }, {
5441
+ default: () => [vue.withDirectives(vue.createVNode("div", {
5442
+ "class": "v-field__clearable"
5443
+ }, [slots.clear ? slots.clear() : vue.createVNode(InputIcon, {
5444
+ "name": "clear"
5445
+ }, null)]), [[vue.vShow, props.dirty]])]
5446
+ }), hasAppend && vue.createVNode("div", {
5447
+ "key": "append",
5448
+ "class": "v-field__append-inner"
5449
+ }, [(_slots$appendInner = slots['append-inner']) == null ? void 0 : _slots$appendInner.call(slots, slotProps.value), props.appendInnerIcon && vue.createVNode(InputIcon, {
5450
+ "key": "append-icon",
5451
+ "name": "appendInner"
5452
+ }, null)]), vue.createVNode("div", {
5453
+ "class": ['v-field__outline', textColorClasses.value]
5454
+ }, [isOutlined && vue.createVNode(vue.Fragment, null, [vue.createVNode("div", {
5455
+ "class": "v-field__outline__start"
5456
+ }, null), hasLabel.value && vue.createVNode("div", {
5457
+ "class": "v-field__outline__notch"
5458
+ }, [vue.createVNode(VFieldLabel, {
5459
+ "ref": floatingLabelRef,
5460
+ "floating": true,
5461
+ "for": id.value
5462
+ }, {
5463
+ default: () => [label]
5464
+ })]), vue.createVNode("div", {
5465
+ "class": "v-field__outline__end"
5466
+ }, null)]), ['plain', 'underlined'].includes(props.variant) && hasLabel.value && vue.createVNode(VFieldLabel, {
5467
+ "ref": floatingLabelRef,
5468
+ "floating": true,
5469
+ "for": id.value
5470
+ }, {
5471
+ default: () => [label]
5472
+ })])]);
5592
5473
  });
5593
5474
  return {
5594
- reset,
5595
- resetValidation,
5596
- validate
5475
+ controlRef
5597
5476
  };
5598
5477
  }
5599
5478
  });
5600
- function filterInputProps(props) {
5601
- const keys = Object.keys(VInput.props).filter(k => !isOn(k));
5602
- return pick(props, keys);
5479
+ // TODO: this is kinda slow, might be better to implicitly inherit props instead
5480
+ function filterFieldProps(attrs) {
5481
+ const keys = Object.keys(VField.props).filter(k => !isOn(k));
5482
+ return pick(attrs, keys);
5603
5483
  }
5604
5484
 
5605
- const VLabel = defineComponent({
5606
- name: 'VLabel',
5485
+ // Types
5486
+
5487
+ const VMessages = defineComponent({
5488
+ name: 'VMessages',
5607
5489
  props: {
5608
- text: String,
5609
- clickable: Boolean,
5610
- ...makeThemeProps()
5490
+ active: Boolean,
5491
+ color: String,
5492
+ messages: {
5493
+ type: [Array, String],
5494
+ default: () => []
5495
+ },
5496
+ ...makeTransitionProps({
5497
+ transition: {
5498
+ component: VSlideYTransition,
5499
+ leaveAbsolute: true,
5500
+ group: true
5501
+ }
5502
+ })
5611
5503
  },
5612
5504
  setup(props, _ref) {
5613
5505
  let {
5614
5506
  slots
5615
5507
  } = _ref;
5616
- useRender(() => {
5617
- var _slots$default;
5618
- return vue.createVNode("label", {
5619
- "class": ['v-label', {
5620
- 'v-label--clickable': props.clickable
5621
- }]
5622
- }, [props.text, (_slots$default = slots.default) == null ? void 0 : _slots$default.call(slots)]);
5623
- });
5508
+ const messages = vue.computed(() => wrapInArray(props.messages));
5509
+ const {
5510
+ textColorClasses,
5511
+ textColorStyles
5512
+ } = useTextColor(vue.computed(() => props.color));
5513
+ useRender(() => vue.createVNode(MaybeTransition, {
5514
+ "transition": props.transition,
5515
+ "tag": "div",
5516
+ "class": ['v-messages', textColorClasses.value],
5517
+ "style": textColorStyles.value
5518
+ }, {
5519
+ default: () => [props.active && messages.value.map((message, i) => vue.createVNode("div", {
5520
+ "class": "v-messages__message",
5521
+ "key": `${i}-${messages.value}`
5522
+ }, [slots.message ? slots.message({
5523
+ message
5524
+ }) : message]))]
5525
+ }));
5624
5526
  return {};
5625
5527
  }
5626
5528
  });
5627
5529
 
5530
+ // Utilities
5531
+
5628
5532
  // Types
5629
5533
 
5630
- const VSelectionControlGroupSymbol = Symbol.for('vuetify:selection-control-group');
5631
- const makeSelectionControlGroupProps = propsFactory({
5632
- color: String,
5534
+ const FormKey = Symbol.for('vuetify:form');
5535
+ const makeFormProps = propsFactory({
5633
5536
  disabled: Boolean,
5634
- error: Boolean,
5635
- id: String,
5636
- inline: Boolean,
5637
- falseIcon: IconValue,
5638
- trueIcon: IconValue,
5639
- ripple: {
5640
- type: Boolean,
5641
- default: true
5642
- },
5643
- multiple: {
5537
+ fastFail: Boolean,
5538
+ lazyValidation: Boolean,
5539
+ readonly: Boolean,
5540
+ modelValue: {
5644
5541
  type: Boolean,
5645
5542
  default: null
5646
5543
  },
5647
- name: String,
5648
- readonly: Boolean,
5649
- modelValue: null,
5650
- type: String,
5651
- valueComparator: {
5652
- type: Function,
5653
- default: deepEqual
5654
- },
5655
- ...makeThemeProps(),
5656
- ...makeDensityProps()
5657
- }, 'VSelectionControlGroup');
5658
- const VSelectionControlGroup = defineComponent({
5659
- name: 'VSelectionControlGroup',
5660
- props: {
5661
- defaultsTarget: {
5662
- type: String,
5663
- default: 'VSelectionControl'
5664
- },
5665
- ...makeSelectionControlGroupProps()
5666
- },
5667
- emits: {
5668
- 'update:modelValue': val => true
5669
- },
5670
- setup(props, _ref) {
5671
- let {
5544
+ validateOn: {
5545
+ type: String,
5546
+ default: 'input'
5547
+ }
5548
+ }, 'form');
5549
+ function createForm(props) {
5550
+ const model = useProxiedModel(props, 'modelValue');
5551
+ const isDisabled = vue.computed(() => props.disabled);
5552
+ const isReadonly = vue.computed(() => props.readonly);
5553
+ const isValidating = vue.ref(false);
5554
+ const items = vue.ref([]);
5555
+ const errors = vue.ref([]);
5556
+ async function validate() {
5557
+ const results = [];
5558
+ let valid = true;
5559
+ errors.value = [];
5560
+ isValidating.value = true;
5561
+ for (const item of items.value) {
5562
+ const itemErrorMessages = await item.validate();
5563
+ if (itemErrorMessages.length > 0) {
5564
+ valid = false;
5565
+ results.push({
5566
+ id: item.id,
5567
+ errorMessages: itemErrorMessages
5568
+ });
5569
+ }
5570
+ if (!valid && props.fastFail) break;
5571
+ }
5572
+ errors.value = results;
5573
+ isValidating.value = false;
5574
+ return {
5575
+ valid,
5576
+ errors: errors.value
5577
+ };
5578
+ }
5579
+ function reset() {
5580
+ items.value.forEach(item => item.reset());
5581
+ model.value = null;
5582
+ }
5583
+ function resetValidation() {
5584
+ items.value.forEach(item => item.resetValidation());
5585
+ errors.value = [];
5586
+ model.value = null;
5587
+ }
5588
+ vue.watch(items, () => {
5589
+ let valid = 0;
5590
+ let invalid = 0;
5591
+ const results = [];
5592
+ for (const item of items.value) {
5593
+ if (item.isValid === false) {
5594
+ invalid++;
5595
+ results.push({
5596
+ id: item.id,
5597
+ errorMessages: item.errorMessages
5598
+ });
5599
+ } else if (item.isValid === true) valid++;
5600
+ }
5601
+ errors.value = results;
5602
+ model.value = invalid > 0 ? false : valid === items.value.length ? true : null;
5603
+ }, {
5604
+ deep: true
5605
+ });
5606
+ vue.provide(FormKey, {
5607
+ register: _ref => {
5608
+ let {
5609
+ id,
5610
+ validate,
5611
+ reset,
5612
+ resetValidation
5613
+ } = _ref;
5614
+ if (items.value.some(item => item.id === id)) {
5615
+ consoleWarn(`Duplicate input name "${id}"`);
5616
+ }
5617
+ items.value.push({
5618
+ id,
5619
+ validate,
5620
+ reset,
5621
+ resetValidation,
5622
+ isValid: null,
5623
+ errorMessages: []
5624
+ });
5625
+ },
5626
+ unregister: id => {
5627
+ items.value = items.value.filter(item => {
5628
+ return item.id !== id;
5629
+ });
5630
+ },
5631
+ update: (id, isValid, errorMessages) => {
5632
+ const found = items.value.find(item => item.id === id);
5633
+ if (!found) return;
5634
+ found.isValid = isValid;
5635
+ found.errorMessages = errorMessages;
5636
+ },
5637
+ isDisabled,
5638
+ isReadonly,
5639
+ isValidating,
5640
+ items,
5641
+ validateOn: vue.toRef(props, 'validateOn')
5642
+ });
5643
+ return {
5644
+ errors,
5645
+ isDisabled,
5646
+ isReadonly,
5647
+ isValidating,
5648
+ items,
5649
+ validate,
5650
+ reset,
5651
+ resetValidation
5652
+ };
5653
+ }
5654
+ function useForm() {
5655
+ return vue.inject(FormKey, null);
5656
+ }
5657
+
5658
+ // Composables
5659
+
5660
+ // Types
5661
+
5662
+ const makeValidationProps = propsFactory({
5663
+ disabled: Boolean,
5664
+ error: Boolean,
5665
+ errorMessages: {
5666
+ type: [Array, String],
5667
+ default: () => []
5668
+ },
5669
+ maxErrors: {
5670
+ type: [Number, String],
5671
+ default: 1
5672
+ },
5673
+ name: String,
5674
+ label: String,
5675
+ readonly: Boolean,
5676
+ rules: {
5677
+ type: Array,
5678
+ default: () => []
5679
+ },
5680
+ modelValue: null,
5681
+ validateOn: String,
5682
+ validationValue: null,
5683
+ ...makeFocusProps()
5684
+ }, 'validation');
5685
+ function useValidation(props) {
5686
+ let name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getCurrentInstanceName();
5687
+ let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : getUid();
5688
+ const model = useProxiedModel(props, 'modelValue');
5689
+ const validationModel = vue.computed(() => props.validationValue === undefined ? model.value : props.validationValue);
5690
+ const form = useForm();
5691
+ const internalErrorMessages = vue.ref([]);
5692
+ const isPristine = vue.ref(true);
5693
+ const isDirty = vue.computed(() => !!(wrapInArray(model.value === '' ? null : model.value).length || wrapInArray(validationModel.value === '' ? null : validationModel.value).length));
5694
+ const isDisabled = vue.computed(() => !!(props.disabled || form != null && form.isDisabled.value));
5695
+ const isReadonly = vue.computed(() => !!(props.readonly || form != null && form.isReadonly.value));
5696
+ const errorMessages = vue.computed(() => {
5697
+ return props.errorMessages.length ? wrapInArray(props.errorMessages) : internalErrorMessages.value;
5698
+ });
5699
+ const isValid = vue.computed(() => {
5700
+ if (props.error || errorMessages.value.length) return false;
5701
+ if (!props.rules.length) return true;
5702
+ return isPristine.value ? null : true;
5703
+ });
5704
+ const isValidating = vue.ref(false);
5705
+ const validationClasses = vue.computed(() => {
5706
+ return {
5707
+ [`${name}--error`]: isValid.value === false,
5708
+ [`${name}--dirty`]: isDirty.value,
5709
+ [`${name}--disabled`]: isDisabled.value,
5710
+ [`${name}--readonly`]: isReadonly.value
5711
+ };
5712
+ });
5713
+ const uid = vue.computed(() => props.name ?? vue.unref(id));
5714
+ vue.onBeforeMount(() => {
5715
+ form == null ? void 0 : form.register({
5716
+ id: uid.value,
5717
+ validate,
5718
+ reset,
5719
+ resetValidation
5720
+ });
5721
+ });
5722
+ vue.onBeforeUnmount(() => {
5723
+ form == null ? void 0 : form.unregister(uid.value);
5724
+ });
5725
+ const validateOn = vue.computed(() => props.validateOn || (form == null ? void 0 : form.validateOn.value) || 'input');
5726
+
5727
+ // Set initial valid state, for inputs that might not have rules
5728
+ vue.onMounted(() => form == null ? void 0 : form.update(uid.value, isValid.value, errorMessages.value));
5729
+ useToggleScope(() => validateOn.value === 'input', () => {
5730
+ vue.watch(validationModel, () => {
5731
+ if (validationModel.value != null) {
5732
+ validate();
5733
+ } else if (props.focused) {
5734
+ const unwatch = vue.watch(() => props.focused, val => {
5735
+ if (!val) validate();
5736
+ unwatch();
5737
+ });
5738
+ }
5739
+ });
5740
+ });
5741
+ useToggleScope(() => validateOn.value === 'blur', () => {
5742
+ vue.watch(() => props.focused, val => {
5743
+ if (!val) validate();
5744
+ });
5745
+ });
5746
+ vue.watch(isValid, () => {
5747
+ form == null ? void 0 : form.update(uid.value, isValid.value, errorMessages.value);
5748
+ });
5749
+ function reset() {
5750
+ resetValidation();
5751
+ model.value = null;
5752
+ }
5753
+ function resetValidation() {
5754
+ isPristine.value = true;
5755
+ internalErrorMessages.value = [];
5756
+ }
5757
+ async function validate() {
5758
+ const results = [];
5759
+ isValidating.value = true;
5760
+ for (const rule of props.rules) {
5761
+ if (results.length >= (props.maxErrors || 1)) {
5762
+ break;
5763
+ }
5764
+ const handler = typeof rule === 'function' ? rule : () => rule;
5765
+ const result = await handler(validationModel.value);
5766
+ if (result === true) continue;
5767
+ if (typeof result !== 'string') {
5768
+ // eslint-disable-next-line no-console
5769
+ console.warn(`${result} is not a valid value. Rule functions must return boolean true or a string.`);
5770
+ continue;
5771
+ }
5772
+ results.push(result);
5773
+ }
5774
+ internalErrorMessages.value = results;
5775
+ isValidating.value = false;
5776
+ isPristine.value = false;
5777
+ return internalErrorMessages.value;
5778
+ }
5779
+ return {
5780
+ errorMessages,
5781
+ isDirty,
5782
+ isDisabled,
5783
+ isReadonly,
5784
+ isPristine,
5785
+ isValid,
5786
+ isValidating,
5787
+ reset,
5788
+ resetValidation,
5789
+ validate,
5790
+ validationClasses
5791
+ };
5792
+ }
5793
+
5794
+ const makeVInputProps = propsFactory({
5795
+ id: String,
5796
+ appendIcon: IconValue,
5797
+ prependIcon: IconValue,
5798
+ hideDetails: [Boolean, String],
5799
+ messages: {
5800
+ type: [Array, String],
5801
+ default: () => []
5802
+ },
5803
+ direction: {
5804
+ type: String,
5805
+ default: 'horizontal',
5806
+ validator: v => ['horizontal', 'vertical'].includes(v)
5807
+ },
5808
+ 'onClick:prepend': EventProp,
5809
+ 'onClick:append': EventProp,
5810
+ ...makeDensityProps(),
5811
+ ...makeValidationProps()
5812
+ }, 'v-input');
5813
+ const VInput = genericComponent()({
5814
+ name: 'VInput',
5815
+ props: {
5816
+ ...makeVInputProps()
5817
+ },
5818
+ emits: {
5819
+ 'update:modelValue': val => true
5820
+ },
5821
+ setup(props, _ref) {
5822
+ let {
5823
+ attrs,
5824
+ slots,
5825
+ emit
5826
+ } = _ref;
5827
+ const {
5828
+ densityClasses
5829
+ } = useDensity(props);
5830
+ const {
5831
+ InputIcon
5832
+ } = useInputIcon(props);
5833
+ const uid = getUid();
5834
+ const id = vue.computed(() => props.id || `input-${uid}`);
5835
+ const {
5836
+ errorMessages,
5837
+ isDirty,
5838
+ isDisabled,
5839
+ isReadonly,
5840
+ isPristine,
5841
+ isValid,
5842
+ isValidating,
5843
+ reset,
5844
+ resetValidation,
5845
+ validate,
5846
+ validationClasses
5847
+ } = useValidation(props, 'v-input', id);
5848
+ const slotProps = vue.computed(() => ({
5849
+ id,
5850
+ isDirty,
5851
+ isDisabled,
5852
+ isReadonly,
5853
+ isPristine,
5854
+ isValid,
5855
+ isValidating,
5856
+ reset,
5857
+ resetValidation,
5858
+ validate
5859
+ }));
5860
+ useRender(() => {
5861
+ var _props$messages, _slots$prepend, _slots$default, _slots$append, _slots$details;
5862
+ const hasPrepend = !!(slots.prepend || props.prependIcon);
5863
+ const hasAppend = !!(slots.append || props.appendIcon);
5864
+ const hasMessages = !!((_props$messages = props.messages) != null && _props$messages.length || errorMessages.value.length);
5865
+ const hasDetails = !props.hideDetails || props.hideDetails === 'auto' && (hasMessages || !!slots.details);
5866
+ return vue.createVNode("div", {
5867
+ "class": ['v-input', `v-input--${props.direction}`, densityClasses.value, validationClasses.value]
5868
+ }, [hasPrepend && vue.createVNode("div", {
5869
+ "key": "prepend",
5870
+ "class": "v-input__prepend"
5871
+ }, [(_slots$prepend = slots.prepend) == null ? void 0 : _slots$prepend.call(slots, slotProps.value), props.prependIcon && vue.createVNode(InputIcon, {
5872
+ "key": "prepend-icon",
5873
+ "name": "prepend"
5874
+ }, null)]), slots.default && vue.createVNode("div", {
5875
+ "class": "v-input__control"
5876
+ }, [(_slots$default = slots.default) == null ? void 0 : _slots$default.call(slots, slotProps.value)]), hasAppend && vue.createVNode("div", {
5877
+ "key": "append",
5878
+ "class": "v-input__append"
5879
+ }, [props.appendIcon && vue.createVNode(InputIcon, {
5880
+ "key": "append-icon",
5881
+ "name": "append"
5882
+ }, null), (_slots$append = slots.append) == null ? void 0 : _slots$append.call(slots, slotProps.value)]), hasDetails && vue.createVNode("div", {
5883
+ "class": "v-input__details"
5884
+ }, [vue.createVNode(VMessages, {
5885
+ "active": hasMessages,
5886
+ "messages": errorMessages.value.length > 0 ? errorMessages.value : props.messages
5887
+ }, {
5888
+ message: slots.message
5889
+ }), (_slots$details = slots.details) == null ? void 0 : _slots$details.call(slots, slotProps.value)])]);
5890
+ });
5891
+ return {
5892
+ reset,
5893
+ resetValidation,
5894
+ validate
5895
+ };
5896
+ }
5897
+ });
5898
+ function filterInputProps(props) {
5899
+ const keys = Object.keys(VInput.props).filter(k => !isOn(k));
5900
+ return pick(props, keys);
5901
+ }
5902
+
5903
+ const VCounter = defineComponent({
5904
+ name: 'VCounter',
5905
+ functional: true,
5906
+ props: {
5907
+ active: Boolean,
5908
+ max: [Number, String],
5909
+ value: {
5910
+ type: [Number, String],
5911
+ default: 0
5912
+ },
5913
+ ...makeTransitionProps({
5914
+ transition: {
5915
+ component: VSlideYTransition
5916
+ }
5917
+ })
5918
+ },
5919
+ setup(props, _ref) {
5920
+ let {
5921
+ slots
5922
+ } = _ref;
5923
+ const counter = vue.computed(() => {
5924
+ return props.max ? `${props.value} / ${props.max}` : String(props.value);
5925
+ });
5926
+ useRender(() => vue.createVNode(MaybeTransition, {
5927
+ "transition": props.transition
5928
+ }, {
5929
+ default: () => [vue.withDirectives(vue.createVNode("div", {
5930
+ "class": "v-counter"
5931
+ }, [slots.default ? slots.default({
5932
+ counter: counter.value,
5933
+ max: props.max,
5934
+ value: props.value
5935
+ }) : counter.value]), [[vue.vShow, props.active]])]
5936
+ }));
5937
+ return {};
5938
+ }
5939
+ });
5940
+
5941
+ const Refs = Symbol('Forwarded refs');
5942
+
5943
+ /** Omit properties starting with P */
5944
+
5945
+ function forwardRefs(target) {
5946
+ for (var _len = arguments.length, refs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
5947
+ refs[_key - 1] = arguments[_key];
5948
+ }
5949
+ target[Refs] = refs;
5950
+ return new Proxy(target, {
5951
+ get(target, key) {
5952
+ if (Reflect.has(target, key)) {
5953
+ return Reflect.get(target, key);
5954
+ }
5955
+ for (const ref of refs) {
5956
+ if (ref.value && Reflect.has(ref.value, key)) {
5957
+ const val = Reflect.get(ref.value, key);
5958
+ return typeof val === 'function' ? val.bind(ref.value) : val;
5959
+ }
5960
+ }
5961
+ },
5962
+ getOwnPropertyDescriptor(target, key) {
5963
+ const descriptor = Reflect.getOwnPropertyDescriptor(target, key);
5964
+ if (descriptor) return descriptor;
5965
+
5966
+ // Skip internal properties
5967
+ if (typeof key === 'symbol' || key.startsWith('__')) return;
5968
+
5969
+ // Check each ref's own properties
5970
+ for (const ref of refs) {
5971
+ if (!ref.value) continue;
5972
+ const descriptor = Reflect.getOwnPropertyDescriptor(ref.value, key);
5973
+ if (descriptor) return descriptor;
5974
+ if ('_' in ref.value && 'setupState' in ref.value._) {
5975
+ const descriptor = Reflect.getOwnPropertyDescriptor(ref.value._.setupState, key);
5976
+ if (descriptor) return descriptor;
5977
+ }
5978
+ }
5979
+ // Recursive search up each ref's prototype
5980
+ for (const ref of refs) {
5981
+ let obj = ref.value && Object.getPrototypeOf(ref.value);
5982
+ while (obj) {
5983
+ const descriptor = Reflect.getOwnPropertyDescriptor(obj, key);
5984
+ if (descriptor) return descriptor;
5985
+ obj = Object.getPrototypeOf(obj);
5986
+ }
5987
+ }
5988
+ // Call forwarded refs' proxies
5989
+ for (const ref of refs) {
5990
+ const childRefs = ref.value && ref.value[Refs];
5991
+ if (!childRefs) continue;
5992
+ const queue = childRefs.slice();
5993
+ while (queue.length) {
5994
+ const ref = queue.shift();
5995
+ const descriptor = Reflect.getOwnPropertyDescriptor(ref.value, key);
5996
+ if (descriptor) return descriptor;
5997
+ const childRefs = ref.value && ref.value[Refs];
5998
+ if (childRefs) queue.push(...childRefs);
5999
+ }
6000
+ }
6001
+ return undefined;
6002
+ }
6003
+ });
6004
+ }
6005
+
6006
+ // Types
6007
+
6008
+ const activeTypes = ['color', 'file', 'time', 'date', 'datetime-local', 'week', 'month'];
6009
+ const makeVTextFieldProps = propsFactory({
6010
+ autofocus: Boolean,
6011
+ counter: [Boolean, Number, String],
6012
+ counterValue: Function,
6013
+ hint: String,
6014
+ persistentHint: Boolean,
6015
+ prefix: String,
6016
+ placeholder: String,
6017
+ persistentPlaceholder: Boolean,
6018
+ persistentCounter: Boolean,
6019
+ suffix: String,
6020
+ type: {
6021
+ type: String,
6022
+ default: 'text'
6023
+ },
6024
+ ...makeVInputProps(),
6025
+ ...makeVFieldProps()
6026
+ }, 'v-text-field');
6027
+ const VTextField = genericComponent()({
6028
+ name: 'VTextField',
6029
+ directives: {
6030
+ Intersect
6031
+ },
6032
+ inheritAttrs: false,
6033
+ props: makeVTextFieldProps(),
6034
+ emits: {
6035
+ 'click:control': e => true,
6036
+ 'click:input': e => true,
6037
+ 'update:focused': focused => true,
6038
+ 'update:modelValue': val => true
6039
+ },
6040
+ setup(props, _ref) {
6041
+ let {
6042
+ attrs,
6043
+ emit,
6044
+ slots
6045
+ } = _ref;
6046
+ const model = useProxiedModel(props, 'modelValue');
6047
+ const {
6048
+ isFocused,
6049
+ focus,
6050
+ blur
6051
+ } = useFocus(props);
6052
+ const counterValue = vue.computed(() => {
6053
+ return typeof props.counterValue === 'function' ? props.counterValue(model.value) : (model.value ?? '').toString().length;
6054
+ });
6055
+ const max = vue.computed(() => {
6056
+ if (attrs.maxlength) return attrs.maxlength;
6057
+ if (!props.counter || typeof props.counter !== 'number' && typeof props.counter !== 'string') return undefined;
6058
+ return props.counter;
6059
+ });
6060
+ function onIntersect(isIntersecting, entries) {
6061
+ var _entries$0$target, _entries$0$target$foc;
6062
+ if (!props.autofocus || !isIntersecting) return;
6063
+ (_entries$0$target = entries[0].target) == null ? void 0 : (_entries$0$target$foc = _entries$0$target.focus) == null ? void 0 : _entries$0$target$foc.call(_entries$0$target);
6064
+ }
6065
+ const vInputRef = vue.ref();
6066
+ const vFieldRef = vue.ref();
6067
+ const inputRef = vue.ref();
6068
+ const isActive = vue.computed(() => activeTypes.includes(props.type) || props.persistentPlaceholder || isFocused.value);
6069
+ const messages = vue.computed(() => {
6070
+ return props.messages.length ? props.messages : isFocused.value || props.persistentHint ? props.hint : '';
6071
+ });
6072
+ function onFocus() {
6073
+ if (inputRef.value !== document.activeElement) {
6074
+ var _inputRef$value;
6075
+ (_inputRef$value = inputRef.value) == null ? void 0 : _inputRef$value.focus();
6076
+ }
6077
+ if (!isFocused.value) focus();
6078
+ }
6079
+ function onControlClick(e) {
6080
+ onFocus();
6081
+ emit('click:control', e);
6082
+ }
6083
+ function onClear(e) {
6084
+ e.stopPropagation();
6085
+ onFocus();
6086
+ vue.nextTick(() => {
6087
+ model.value = null;
6088
+ callEvent(props['onClick:clear'], e);
6089
+ });
6090
+ }
6091
+ function onInput(e) {
6092
+ model.value = e.target.value;
6093
+ }
6094
+ useRender(() => {
6095
+ const hasCounter = !!(slots.counter || props.counter || props.counterValue);
6096
+ const hasDetails = !!(hasCounter || slots.details);
6097
+ const [rootAttrs, inputAttrs] = filterInputAttrs(attrs);
6098
+ const [{
6099
+ modelValue: _,
6100
+ ...inputProps
6101
+ }] = filterInputProps(props);
6102
+ const [fieldProps] = filterFieldProps(props);
6103
+ return vue.createVNode(VInput, vue.mergeProps({
6104
+ "ref": vInputRef,
6105
+ "modelValue": model.value,
6106
+ "onUpdate:modelValue": $event => model.value = $event,
6107
+ "class": ['v-text-field', {
6108
+ 'v-text-field--prefixed': props.prefix,
6109
+ 'v-text-field--suffixed': props.suffix,
6110
+ 'v-text-field--flush-details': ['plain', 'underlined'].includes(props.variant)
6111
+ }],
6112
+ "onClick:prepend": props['onClick:prepend'],
6113
+ "onClick:append": props['onClick:append']
6114
+ }, rootAttrs, inputProps, {
6115
+ "focused": isFocused.value,
6116
+ "messages": messages.value
6117
+ }), {
6118
+ ...slots,
6119
+ default: _ref2 => {
6120
+ let {
6121
+ id,
6122
+ isDisabled,
6123
+ isDirty,
6124
+ isReadonly,
6125
+ isValid
6126
+ } = _ref2;
6127
+ return vue.createVNode(VField, vue.mergeProps({
6128
+ "ref": vFieldRef,
6129
+ "onMousedown": e => {
6130
+ if (e.target === inputRef.value) return;
6131
+ e.preventDefault();
6132
+ },
6133
+ "onClick:control": onControlClick,
6134
+ "onClick:clear": onClear,
6135
+ "onClick:prependInner": props['onClick:prependInner'],
6136
+ "onClick:appendInner": props['onClick:appendInner'],
6137
+ "role": "textbox"
6138
+ }, fieldProps, {
6139
+ "id": id.value,
6140
+ "active": isActive.value || isDirty.value,
6141
+ "dirty": isDirty.value || props.dirty,
6142
+ "focused": isFocused.value,
6143
+ "error": isValid.value === false
6144
+ }), {
6145
+ ...slots,
6146
+ default: _ref3 => {
6147
+ let {
6148
+ props: {
6149
+ class: fieldClass,
6150
+ ...slotProps
6151
+ }
6152
+ } = _ref3;
6153
+ const inputNode = vue.withDirectives(vue.createVNode("input", vue.mergeProps({
6154
+ "ref": inputRef,
6155
+ "value": model.value,
6156
+ "onInput": onInput,
6157
+ "autofocus": props.autofocus,
6158
+ "readonly": isReadonly.value,
6159
+ "disabled": isDisabled.value,
6160
+ "name": props.name,
6161
+ "placeholder": props.placeholder,
6162
+ "size": 1,
6163
+ "type": props.type,
6164
+ "onFocus": onFocus,
6165
+ "onBlur": blur
6166
+ }, slotProps, inputAttrs), null), [[vue.resolveDirective("intersect"), {
6167
+ handler: onIntersect
6168
+ }, null, {
6169
+ once: true
6170
+ }]]);
6171
+ return vue.createVNode(vue.Fragment, null, [props.prefix && vue.createVNode("span", {
6172
+ "class": "v-text-field__prefix"
6173
+ }, [props.prefix]), slots.default ? vue.createVNode("div", {
6174
+ "class": fieldClass,
6175
+ "onClick": e => emit('click:input', e),
6176
+ "data-no-activator": ""
6177
+ }, [slots.default(), inputNode]) : vue.cloneVNode(inputNode, {
6178
+ class: fieldClass
6179
+ }), props.suffix && vue.createVNode("span", {
6180
+ "class": "v-text-field__suffix"
6181
+ }, [props.suffix])]);
6182
+ }
6183
+ });
6184
+ },
6185
+ details: hasDetails ? slotProps => {
6186
+ var _slots$details;
6187
+ return vue.createVNode(vue.Fragment, null, [(_slots$details = slots.details) == null ? void 0 : _slots$details.call(slots, slotProps), hasCounter && vue.createVNode(vue.Fragment, null, [vue.createVNode("span", null, null), vue.createVNode(VCounter, {
6188
+ "active": props.persistentCounter || isFocused.value,
6189
+ "value": counterValue.value,
6190
+ "max": max.value
6191
+ }, slots.counter)])]);
6192
+ } : undefined
6193
+ });
6194
+ });
6195
+ return forwardRefs({}, vInputRef, vFieldRef, inputRef);
6196
+ }
6197
+ });
6198
+ function filterVTextFieldProps(props) {
6199
+ return pick(props, Object.keys(VTextField.props));
6200
+ }
6201
+
6202
+ // Types
6203
+
6204
+ const VSelectionControlGroupSymbol = Symbol.for('vuetify:selection-control-group');
6205
+ const makeSelectionControlGroupProps = propsFactory({
6206
+ color: String,
6207
+ disabled: Boolean,
6208
+ error: Boolean,
6209
+ id: String,
6210
+ inline: Boolean,
6211
+ falseIcon: IconValue,
6212
+ trueIcon: IconValue,
6213
+ ripple: {
6214
+ type: Boolean,
6215
+ default: true
6216
+ },
6217
+ multiple: {
6218
+ type: Boolean,
6219
+ default: null
6220
+ },
6221
+ name: String,
6222
+ readonly: Boolean,
6223
+ modelValue: null,
6224
+ type: String,
6225
+ valueComparator: {
6226
+ type: Function,
6227
+ default: deepEqual
6228
+ },
6229
+ ...makeThemeProps(),
6230
+ ...makeDensityProps()
6231
+ }, 'v-selection-control-group');
6232
+ const VSelectionControlGroup = defineComponent({
6233
+ name: 'VSelectionControlGroup',
6234
+ props: {
6235
+ defaultsTarget: {
6236
+ type: String,
6237
+ default: 'VSelectionControl'
6238
+ },
6239
+ ...makeSelectionControlGroupProps()
6240
+ },
6241
+ emits: {
6242
+ 'update:modelValue': val => true
6243
+ },
6244
+ setup(props, _ref) {
6245
+ let {
5672
6246
  slots
5673
6247
  } = _ref;
5674
6248
  const modelValue = useProxiedModel(props, 'modelValue');
@@ -5718,7 +6292,7 @@
5718
6292
  falseValue: null,
5719
6293
  value: null,
5720
6294
  ...makeSelectionControlGroupProps()
5721
- }, 'VSelectionControl');
6295
+ }, 'v-selection-control');
5722
6296
  function useSelectionControl(props) {
5723
6297
  const group = vue.inject(VSelectionControlGroupSymbol, undefined);
5724
6298
  const {
@@ -5883,7 +6457,7 @@
5883
6457
  falseIcon: '$checkboxOff',
5884
6458
  trueIcon: '$checkboxOn'
5885
6459
  })
5886
- }, 'VCheckboxBtn');
6460
+ }, 'v-checkbox-btn');
5887
6461
  const VCheckboxBtn = defineComponent({
5888
6462
  name: 'VCheckboxBtn',
5889
6463
  props: makeVCheckboxBtnProps(),
@@ -5991,7 +6565,7 @@
5991
6565
  ...makeVariantProps({
5992
6566
  variant: 'flat'
5993
6567
  })
5994
- }, 'VAvatar');
6568
+ }, 'v-avatar');
5995
6569
  const VAvatar = defineComponent({
5996
6570
  name: 'VAvatar',
5997
6571
  props: makeVAvatarProps(),
@@ -6157,7 +6731,6 @@
6157
6731
  },
6158
6732
  emits: {
6159
6733
  'click:close': e => true,
6160
- 'update:active': value => true,
6161
6734
  'update:modelValue': value => true,
6162
6735
  'group:selected': val => true
6163
6736
  },
@@ -6834,7 +7407,7 @@
6834
7407
  subgroup: Boolean,
6835
7408
  value: null,
6836
7409
  ...makeTagProps()
6837
- }, 'VListGroup');
7410
+ }, 'v-list-group');
6838
7411
  const VListGroup = genericComponent()({
6839
7412
  name: 'VListGroup',
6840
7413
  props: {
@@ -6937,6 +7510,8 @@
6937
7510
  subtitle: [String, Number, Boolean],
6938
7511
  title: [String, Number, Boolean],
6939
7512
  value: null,
7513
+ onClick: EventProp,
7514
+ onClickOnce: EventProp,
6940
7515
  ...makeBorderProps(),
6941
7516
  ...makeDensityProps(),
6942
7517
  ...makeDimensionProps(),
@@ -7481,7 +8056,10 @@
7481
8056
  focus('first');
7482
8057
  } else if (e.key === 'End') {
7483
8058
  focus('last');
8059
+ } else {
8060
+ return;
7484
8061
  }
8062
+ e.preventDefault();
7485
8063
  }
7486
8064
  function focus(location) {
7487
8065
  if (!contentRef.value) return;
@@ -7637,7 +8215,7 @@
7637
8215
  },
7638
8216
  closeOnContentClick: Boolean,
7639
8217
  ...makeDelayProps()
7640
- }, 'VOverlay/useActivator');
8218
+ }, 'v-overlay-activator');
7641
8219
  function useActivator(props, _ref) {
7642
8220
  let {
7643
8221
  isActive,
@@ -7950,7 +8528,7 @@
7950
8528
  default: 'auto'
7951
8529
  },
7952
8530
  offset: [Number, String, Array]
7953
- }, 'VOverlay/locationStrategies');
8531
+ }, 'v-overlay-location-strategies');
7954
8532
  function useLocationStrategies(props, data) {
7955
8533
  const contentStyles = vue.ref({});
7956
8534
  const updateLocation = vue.ref();
@@ -8068,24 +8646,22 @@
8068
8646
  return typeof props.offset === 'number' ? [props.offset, 0] : [0, 0];
8069
8647
  });
8070
8648
  let observe = false;
8071
- if (IN_BROWSER) {
8072
- const observer = new ResizeObserver(() => {
8073
- if (observe) updateLocation();
8074
- });
8075
- vue.watch([data.activatorEl, data.contentEl], (_ref, _ref2) => {
8076
- let [newActivatorEl, newContentEl] = _ref;
8077
- let [oldActivatorEl, oldContentEl] = _ref2;
8078
- if (oldActivatorEl) observer.unobserve(oldActivatorEl);
8079
- if (newActivatorEl) observer.observe(newActivatorEl);
8080
- if (oldContentEl) observer.unobserve(oldContentEl);
8081
- if (newContentEl) observer.observe(newContentEl);
8082
- }, {
8083
- immediate: true
8084
- });
8085
- vue.onScopeDispose(() => {
8086
- observer.disconnect();
8087
- });
8088
- }
8649
+ const observer = new ResizeObserver(() => {
8650
+ if (observe) updateLocation();
8651
+ });
8652
+ vue.watch([data.activatorEl, data.contentEl], (_ref, _ref2) => {
8653
+ let [newActivatorEl, newContentEl] = _ref;
8654
+ let [oldActivatorEl, oldContentEl] = _ref2;
8655
+ if (oldActivatorEl) observer.unobserve(oldActivatorEl);
8656
+ if (newActivatorEl) observer.observe(newActivatorEl);
8657
+ if (oldContentEl) observer.unobserve(oldContentEl);
8658
+ if (newContentEl) observer.observe(newContentEl);
8659
+ }, {
8660
+ immediate: true
8661
+ });
8662
+ vue.onScopeDispose(() => {
8663
+ observer.disconnect();
8664
+ });
8089
8665
 
8090
8666
  // eslint-disable-next-line max-statements
8091
8667
  function updateLocation() {
@@ -8274,1235 +8850,690 @@
8274
8850
  left: convertToUnit(pixelRound(x)),
8275
8851
  minWidth: convertToUnit(axis === 'y' ? Math.min(minWidth.value, targetBox.width) : minWidth.value),
8276
8852
  maxWidth: convertToUnit(pixelCeil(clamp(available.x, minWidth.value === Infinity ? 0 : minWidth.value, maxWidth.value))),
8277
- maxHeight: convertToUnit(pixelCeil(clamp(available.y, minHeight.value === Infinity ? 0 : minHeight.value, maxHeight.value)))
8278
- });
8279
- }
8280
- vue.watch(() => [preferredAnchor.value, preferredOrigin.value, props.offset, props.minWidth, props.minHeight, props.maxWidth, props.maxHeight], () => updateLocation(), {
8281
- immediate: !activatorFixed
8282
- });
8283
- if (activatorFixed) vue.nextTick(() => updateLocation());
8284
- requestAnimationFrame(() => {
8285
- if (contentStyles.value.maxHeight) updateLocation();
8286
- });
8287
- return {
8288
- updateLocation
8289
- };
8290
- }
8291
- function pixelRound(val) {
8292
- return Math.round(val * devicePixelRatio) / devicePixelRatio;
8293
- }
8294
- function pixelCeil(val) {
8295
- return Math.ceil(val * devicePixelRatio) / devicePixelRatio;
8296
- }
8297
-
8298
- let clean = true;
8299
- const frames = [];
8300
-
8301
- /**
8302
- * Schedule a task to run in an animation frame on its own
8303
- * This is useful for heavy tasks that may cause jank if all ran together
8304
- */
8305
- function requestNewFrame(cb) {
8306
- if (!clean || frames.length) {
8307
- frames.push(cb);
8308
- run();
8309
- } else {
8310
- clean = false;
8311
- cb();
8312
- run();
8313
- }
8314
- }
8315
- let raf = -1;
8316
- function run() {
8317
- cancelAnimationFrame(raf);
8318
- raf = requestAnimationFrame(() => {
8319
- const frame = frames.shift();
8320
- if (frame) frame();
8321
- if (frames.length) run();else clean = true;
8322
- });
8323
- }
8324
-
8325
- // Utilities
8326
-
8327
- // Types
8328
-
8329
- const scrollStrategies = {
8330
- none: null,
8331
- close: closeScrollStrategy,
8332
- block: blockScrollStrategy,
8333
- reposition: repositionScrollStrategy
8334
- };
8335
- const makeScrollStrategyProps = propsFactory({
8336
- scrollStrategy: {
8337
- type: [String, Function],
8338
- default: 'block',
8339
- validator: val => typeof val === 'function' || val in scrollStrategies
8340
- }
8341
- }, 'VOverlay/scrollStrategies');
8342
- function useScrollStrategies(props, data) {
8343
- if (!IN_BROWSER) return;
8344
- let scope;
8345
- vue.watchEffect(async () => {
8346
- var _scope;
8347
- (_scope = scope) == null ? void 0 : _scope.stop();
8348
- if (!(data.isActive.value && props.scrollStrategy)) return;
8349
- scope = vue.effectScope();
8350
- await vue.nextTick();
8351
- scope.run(() => {
8352
- if (typeof props.scrollStrategy === 'function') {
8353
- props.scrollStrategy(data, props);
8354
- } else {
8355
- var _scrollStrategies$pro;
8356
- (_scrollStrategies$pro = scrollStrategies[props.scrollStrategy]) == null ? void 0 : _scrollStrategies$pro.call(scrollStrategies, data, props);
8357
- }
8358
- });
8359
- });
8360
- }
8361
- function closeScrollStrategy(data) {
8362
- function onScroll(e) {
8363
- data.isActive.value = false;
8364
- }
8365
- bindScroll(data.activatorEl.value ?? data.contentEl.value, onScroll);
8366
- }
8367
- function blockScrollStrategy(data, props) {
8368
- var _data$root$value;
8369
- const offsetParent = (_data$root$value = data.root.value) == null ? void 0 : _data$root$value.offsetParent;
8370
- const scrollElements = [...new Set([...getScrollParents(data.activatorEl.value, props.contained ? offsetParent : undefined), ...getScrollParents(data.contentEl.value, props.contained ? offsetParent : undefined)])].filter(el => !el.classList.contains('v-overlay-scroll-blocked'));
8371
- const scrollbarWidth = window.innerWidth - document.documentElement.offsetWidth;
8372
- const scrollableParent = (el => hasScrollbar(el) && el)(offsetParent || document.documentElement);
8373
- if (scrollableParent) {
8374
- data.root.value.classList.add('v-overlay--scroll-blocked');
8375
- }
8376
- scrollElements.forEach((el, i) => {
8377
- el.style.setProperty('--v-body-scroll-x', convertToUnit(-el.scrollLeft));
8378
- el.style.setProperty('--v-body-scroll-y', convertToUnit(-el.scrollTop));
8379
- el.style.setProperty('--v-scrollbar-offset', convertToUnit(scrollbarWidth));
8380
- el.classList.add('v-overlay-scroll-blocked');
8381
- });
8382
- vue.onScopeDispose(() => {
8383
- scrollElements.forEach((el, i) => {
8384
- const x = parseFloat(el.style.getPropertyValue('--v-body-scroll-x'));
8385
- const y = parseFloat(el.style.getPropertyValue('--v-body-scroll-y'));
8386
- el.style.removeProperty('--v-body-scroll-x');
8387
- el.style.removeProperty('--v-body-scroll-y');
8388
- el.style.removeProperty('--v-scrollbar-offset');
8389
- el.classList.remove('v-overlay-scroll-blocked');
8390
- el.scrollLeft = -x;
8391
- el.scrollTop = -y;
8392
- });
8393
- if (scrollableParent) {
8394
- data.root.value.classList.remove('v-overlay--scroll-blocked');
8395
- }
8396
- });
8397
- }
8398
- function repositionScrollStrategy(data) {
8399
- let slow = false;
8400
- let raf = -1;
8401
- function update(e) {
8402
- requestNewFrame(() => {
8403
- var _data$updateLocation$, _data$updateLocation;
8404
- const start = performance.now();
8405
- (_data$updateLocation$ = (_data$updateLocation = data.updateLocation).value) == null ? void 0 : _data$updateLocation$.call(_data$updateLocation, e);
8406
- const time = performance.now() - start;
8407
- slow = time / (1000 / 60) > 2;
8408
- });
8409
- }
8410
- bindScroll(data.activatorEl.value ?? data.contentEl.value, e => {
8411
- if (slow) {
8412
- // If the position calculation is slow,
8413
- // defer updates until scrolling is finished.
8414
- // Browsers usually fire one scroll event per frame so
8415
- // we just wait until we've got two frames without an event
8416
- cancelAnimationFrame(raf);
8417
- raf = requestAnimationFrame(() => {
8418
- raf = requestAnimationFrame(() => {
8419
- update(e);
8420
- });
8421
- });
8422
- } else {
8423
- update(e);
8424
- }
8425
- });
8426
- }
8427
-
8428
- /** @private */
8429
- function bindScroll(el, onScroll) {
8430
- const scrollElements = [document, ...getScrollParents(el)];
8431
- scrollElements.forEach(el => {
8432
- el.addEventListener('scroll', onScroll, {
8433
- passive: true
8434
- });
8435
- });
8436
- vue.onScopeDispose(() => {
8437
- scrollElements.forEach(el => {
8438
- el.removeEventListener('scroll', onScroll);
8439
- });
8440
- });
8441
- }
8442
-
8443
- // Types
8444
-
8445
- const StackSymbol = Symbol.for('vuetify:stack');
8446
- const globalStack = vue.reactive([]);
8447
- function useStack(isActive, zIndex) {
8448
- const vm = getCurrentInstance('useStack');
8449
- const parent = vue.inject(StackSymbol, undefined);
8450
- const stack = vue.reactive({
8451
- activeChildren: new Set()
8452
- });
8453
- vue.provide(StackSymbol, stack);
8454
- const _zIndex = vue.ref(+zIndex.value);
8455
- useToggleScope(isActive, () => {
8456
- var _globalStack$at;
8457
- const lastZIndex = (_globalStack$at = globalStack.at(-1)) == null ? void 0 : _globalStack$at[1];
8458
- _zIndex.value = lastZIndex ? lastZIndex + 10 : +zIndex.value;
8459
- globalStack.push([vm.uid, _zIndex.value]);
8460
- parent == null ? void 0 : parent.activeChildren.add(vm.uid);
8461
- vue.onScopeDispose(() => {
8462
- const idx = globalStack.findIndex(v => v[0] === vm.uid);
8463
- globalStack.splice(idx, 1);
8464
- parent == null ? void 0 : parent.activeChildren.delete(vm.uid);
8465
- });
8466
- });
8467
- const globalTop = vue.ref(true);
8468
- vue.watchEffect(() => {
8469
- var _globalStack$at2;
8470
- const _isTop = ((_globalStack$at2 = globalStack.at(-1)) == null ? void 0 : _globalStack$at2[0]) === vm.uid;
8471
- setTimeout(() => globalTop.value = _isTop);
8472
- });
8473
- const localTop = vue.computed(() => !stack.activeChildren.size);
8474
- return {
8475
- globalTop: vue.readonly(globalTop),
8476
- localTop,
8477
- stackStyles: vue.computed(() => ({
8478
- zIndex: _zIndex.value
8479
- }))
8480
- };
8481
- }
8482
-
8483
- // Utilities
8484
-
8485
- // Types
8486
-
8487
- function useTeleport(target) {
8488
- const teleportTarget = vue.computed(() => {
8489
- const _target = target.value;
8490
- if (_target === true || !IN_BROWSER) return undefined;
8491
- const targetElement = _target === false ? document.body : typeof _target === 'string' ? document.querySelector(_target) : _target;
8492
- if (targetElement == null) {
8493
- vue.warn(`Unable to locate target ${_target}`);
8494
- return undefined;
8495
- }
8496
- if (!useTeleport.cache.has(targetElement)) {
8497
- const el = document.createElement('div');
8498
- el.className = 'v-overlay-container';
8499
- targetElement.appendChild(el);
8500
- useTeleport.cache.set(targetElement, el);
8501
- }
8502
- return useTeleport.cache.get(targetElement);
8853
+ maxHeight: convertToUnit(pixelCeil(clamp(available.y, minHeight.value === Infinity ? 0 : minHeight.value, maxHeight.value)))
8854
+ });
8855
+ }
8856
+ vue.watch(() => [preferredAnchor.value, preferredOrigin.value, props.offset, props.minWidth, props.minHeight, props.maxWidth, props.maxHeight], () => updateLocation(), {
8857
+ immediate: !activatorFixed
8858
+ });
8859
+ if (activatorFixed) vue.nextTick(() => updateLocation());
8860
+ requestAnimationFrame(() => {
8861
+ if (contentStyles.value.maxHeight) updateLocation();
8503
8862
  });
8504
8863
  return {
8505
- teleportTarget
8864
+ updateLocation
8506
8865
  };
8507
8866
  }
8508
- useTeleport.cache = new WeakMap();
8509
-
8510
- function defaultConditional() {
8511
- return true;
8512
- }
8513
- function checkEvent(e, el, binding) {
8514
- // The include element callbacks below can be expensive
8515
- // so we should avoid calling them when we're not active.
8516
- // Explicitly check for false to allow fallback compatibility
8517
- // with non-toggleable components
8518
- if (!e || checkIsActive(e, binding) === false) return false;
8519
-
8520
- // If we're clicking inside the shadowroot, then the app root doesn't get the same
8521
- // level of introspection as to _what_ we're clicking. We want to check to see if
8522
- // our target is the shadowroot parent container, and if it is, ignore.
8523
- const root = attachedRoot(el);
8524
- if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot && root.host === e.target) return false;
8525
-
8526
- // Check if additional elements were passed to be included in check
8527
- // (click must be outside all included elements, if any)
8528
- const elements = (typeof binding.value === 'object' && binding.value.include || (() => []))();
8529
- // Add the root element for the component this directive was defined on
8530
- elements.push(el);
8531
-
8532
- // Check if it's a click outside our elements, and then if our callback returns true.
8533
- // Non-toggleable components should take action in their callback and return falsy.
8534
- // Toggleable can return true if it wants to deactivate.
8535
- // Note that, because we're in the capture phase, this callback will occur before
8536
- // the bubbling click event on any outside elements.
8537
- return !elements.some(el => el == null ? void 0 : el.contains(e.target));
8538
- }
8539
- function checkIsActive(e, binding) {
8540
- const isActive = typeof binding.value === 'object' && binding.value.closeConditional || defaultConditional;
8541
- return isActive(e);
8542
- }
8543
- function directive(e, el, binding) {
8544
- const handler = typeof binding.value === 'function' ? binding.value : binding.value.handler;
8545
- el._clickOutside.lastMousedownWasOutside && checkEvent(e, el, binding) && setTimeout(() => {
8546
- checkIsActive(e, binding) && handler && handler(e);
8547
- }, 0);
8867
+ function pixelRound(val) {
8868
+ return Math.round(val * devicePixelRatio) / devicePixelRatio;
8548
8869
  }
8549
- function handleShadow(el, callback) {
8550
- const root = attachedRoot(el);
8551
- callback(document);
8552
- if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot) {
8553
- callback(root);
8554
- }
8870
+ function pixelCeil(val) {
8871
+ return Math.ceil(val * devicePixelRatio) / devicePixelRatio;
8555
8872
  }
8556
- const ClickOutside = {
8557
- // [data-app] may not be found
8558
- // if using bind, inserted makes
8559
- // sure that the root element is
8560
- // available, iOS does not support
8561
- // clicks on body
8562
- mounted(el, binding) {
8563
- const onClick = e => directive(e, el, binding);
8564
- const onMousedown = e => {
8565
- el._clickOutside.lastMousedownWasOutside = checkEvent(e, el, binding);
8566
- };
8567
- handleShadow(el, app => {
8568
- app.addEventListener('click', onClick, true);
8569
- app.addEventListener('mousedown', onMousedown, true);
8570
- });
8571
- if (!el._clickOutside) {
8572
- el._clickOutside = {
8573
- lastMousedownWasOutside: true
8574
- };
8575
- }
8576
- el._clickOutside[binding.instance.$.uid] = {
8577
- onClick,
8578
- onMousedown
8579
- };
8580
- },
8581
- unmounted(el, binding) {
8582
- if (!el._clickOutside) return;
8583
- handleShadow(el, app => {
8584
- var _el$_clickOutside;
8585
- if (!app || !((_el$_clickOutside = el._clickOutside) != null && _el$_clickOutside[binding.instance.$.uid])) return;
8586
- const {
8587
- onClick,
8588
- onMousedown
8589
- } = el._clickOutside[binding.instance.$.uid];
8590
- app.removeEventListener('click', onClick, true);
8591
- app.removeEventListener('mousedown', onMousedown, true);
8592
- });
8593
- delete el._clickOutside[binding.instance.$.uid];
8594
- }
8595
- };
8596
8873
 
8597
- // Types
8874
+ let clean = true;
8875
+ const frames = [];
8598
8876
 
8599
- function Scrim(props) {
8600
- const {
8601
- modelValue,
8602
- color,
8603
- ...rest
8604
- } = props;
8605
- return vue.createVNode(vue.Transition, {
8606
- "name": "fade-transition",
8607
- "appear": true
8608
- }, {
8609
- default: () => [props.modelValue && vue.createVNode("div", vue.mergeProps({
8610
- "class": ['v-overlay__scrim', props.color.backgroundColorClasses.value],
8611
- "style": props.color.backgroundColorStyles.value
8612
- }, rest), null)]
8613
- });
8877
+ /**
8878
+ * Schedule a task to run in an animation frame on its own
8879
+ * This is useful for heavy tasks that may cause jank if all ran together
8880
+ */
8881
+ function requestNewFrame(cb) {
8882
+ if (!clean || frames.length) {
8883
+ frames.push(cb);
8884
+ run();
8885
+ } else {
8886
+ clean = false;
8887
+ cb();
8888
+ run();
8889
+ }
8614
8890
  }
8615
- const makeVOverlayProps = propsFactory({
8616
- absolute: Boolean,
8617
- attach: [Boolean, String, Object],
8618
- closeOnBack: {
8619
- type: Boolean,
8620
- default: true
8621
- },
8622
- contained: Boolean,
8623
- contentClass: null,
8624
- contentProps: null,
8625
- disabled: Boolean,
8626
- noClickAnimation: Boolean,
8627
- modelValue: Boolean,
8628
- persistent: Boolean,
8629
- scrim: {
8630
- type: [String, Boolean],
8631
- default: true
8632
- },
8633
- zIndex: {
8634
- type: [Number, String],
8635
- default: 2000
8636
- },
8637
- ...makeActivatorProps(),
8638
- ...makeDimensionProps(),
8639
- ...makeLazyProps(),
8640
- ...makeLocationStrategyProps(),
8641
- ...makeScrollStrategyProps(),
8642
- ...makeThemeProps(),
8643
- ...makeTransitionProps()
8644
- }, 'v-overlay');
8645
- const VOverlay = genericComponent()({
8646
- name: 'VOverlay',
8647
- directives: {
8648
- ClickOutside
8649
- },
8650
- inheritAttrs: false,
8651
- props: makeVOverlayProps(),
8652
- emits: {
8653
- 'click:outside': e => true,
8654
- 'update:modelValue': value => true,
8655
- afterLeave: () => true
8656
- },
8657
- setup(props, _ref) {
8658
- let {
8659
- slots,
8660
- attrs,
8661
- emit
8662
- } = _ref;
8663
- const model = useProxiedModel(props, 'modelValue');
8664
- const isActive = vue.computed({
8665
- get: () => model.value,
8666
- set: v => {
8667
- if (!(v && props.disabled)) model.value = v;
8668
- }
8669
- });
8670
- const {
8671
- teleportTarget
8672
- } = useTeleport(vue.computed(() => props.attach || props.contained));
8673
- const {
8674
- themeClasses
8675
- } = provideTheme(props);
8676
- const {
8677
- rtlClasses,
8678
- isRtl
8679
- } = useRtl();
8680
- const {
8681
- hasContent,
8682
- onAfterLeave
8683
- } = useLazy(props, isActive);
8684
- const scrimColor = useBackgroundColor(vue.computed(() => {
8685
- return typeof props.scrim === 'string' ? props.scrim : null;
8686
- }));
8687
- const {
8688
- globalTop,
8689
- localTop,
8690
- stackStyles
8691
- } = useStack(isActive, vue.toRef(props, 'zIndex'));
8692
- const {
8693
- activatorEl,
8694
- activatorRef,
8695
- activatorEvents,
8696
- contentEvents,
8697
- scrimEvents
8698
- } = useActivator(props, {
8699
- isActive,
8700
- isTop: localTop
8701
- });
8702
- const {
8703
- dimensionStyles
8704
- } = useDimension(props);
8705
- vue.watch(() => props.disabled, v => {
8706
- if (v) isActive.value = false;
8707
- });
8708
- const root = vue.ref();
8709
- const contentEl = vue.ref();
8710
- const {
8711
- contentStyles,
8712
- updateLocation
8713
- } = useLocationStrategies(props, {
8714
- isRtl,
8715
- contentEl,
8716
- activatorEl,
8717
- isActive
8718
- });
8719
- useScrollStrategies(props, {
8720
- root,
8721
- contentEl,
8722
- activatorEl,
8723
- isActive,
8724
- updateLocation
8725
- });
8726
- function onClickOutside(e) {
8727
- emit('click:outside', e);
8728
- if (!props.persistent) isActive.value = false;else animateClick();
8729
- }
8730
- function closeConditional() {
8731
- return isActive.value && globalTop.value;
8732
- }
8733
- IN_BROWSER && vue.watch(isActive, val => {
8734
- if (val) {
8735
- window.addEventListener('keydown', onKeydown);
8891
+ let raf = -1;
8892
+ function run() {
8893
+ cancelAnimationFrame(raf);
8894
+ raf = requestAnimationFrame(() => {
8895
+ const frame = frames.shift();
8896
+ if (frame) frame();
8897
+ if (frames.length) run();else clean = true;
8898
+ });
8899
+ }
8900
+
8901
+ // Utilities
8902
+
8903
+ // Types
8904
+
8905
+ const scrollStrategies = {
8906
+ none: null,
8907
+ close: closeScrollStrategy,
8908
+ block: blockScrollStrategy,
8909
+ reposition: repositionScrollStrategy
8910
+ };
8911
+ const makeScrollStrategyProps = propsFactory({
8912
+ scrollStrategy: {
8913
+ type: [String, Function],
8914
+ default: 'block',
8915
+ validator: val => typeof val === 'function' || val in scrollStrategies
8916
+ }
8917
+ }, 'v-overlay-scroll-strategies');
8918
+ function useScrollStrategies(props, data) {
8919
+ if (!IN_BROWSER) return;
8920
+ let scope;
8921
+ vue.watchEffect(async () => {
8922
+ var _scope;
8923
+ (_scope = scope) == null ? void 0 : _scope.stop();
8924
+ if (!(data.isActive.value && props.scrollStrategy)) return;
8925
+ scope = vue.effectScope();
8926
+ await vue.nextTick();
8927
+ scope.run(() => {
8928
+ if (typeof props.scrollStrategy === 'function') {
8929
+ props.scrollStrategy(data, props);
8736
8930
  } else {
8737
- window.removeEventListener('keydown', onKeydown);
8931
+ var _scrollStrategies$pro;
8932
+ (_scrollStrategies$pro = scrollStrategies[props.scrollStrategy]) == null ? void 0 : _scrollStrategies$pro.call(scrollStrategies, data, props);
8738
8933
  }
8739
- }, {
8740
- immediate: true
8741
8934
  });
8742
- function onKeydown(e) {
8743
- if (e.key === 'Escape' && globalTop.value) {
8744
- if (!props.persistent) {
8745
- isActive.value = false;
8746
- } else animateClick();
8747
- }
8748
- }
8749
- const router = useRouter();
8750
- useToggleScope(() => props.closeOnBack, () => {
8751
- useBackButton(router, next => {
8752
- if (globalTop.value && isActive.value) {
8753
- next(false);
8754
- if (!props.persistent) isActive.value = false;else animateClick();
8755
- } else {
8756
- next();
8757
- }
8758
- });
8935
+ });
8936
+ }
8937
+ function closeScrollStrategy(data) {
8938
+ function onScroll(e) {
8939
+ data.isActive.value = false;
8940
+ }
8941
+ bindScroll(data.activatorEl.value ?? data.contentEl.value, onScroll);
8942
+ }
8943
+ function blockScrollStrategy(data, props) {
8944
+ var _data$root$value;
8945
+ const offsetParent = (_data$root$value = data.root.value) == null ? void 0 : _data$root$value.offsetParent;
8946
+ const scrollElements = [...new Set([...getScrollParents(data.activatorEl.value, props.contained ? offsetParent : undefined), ...getScrollParents(data.contentEl.value, props.contained ? offsetParent : undefined)])].filter(el => !el.classList.contains('v-overlay-scroll-blocked'));
8947
+ const scrollbarWidth = window.innerWidth - document.documentElement.offsetWidth;
8948
+ const scrollableParent = (el => hasScrollbar(el) && el)(offsetParent || document.documentElement);
8949
+ if (scrollableParent) {
8950
+ data.root.value.classList.add('v-overlay--scroll-blocked');
8951
+ }
8952
+ scrollElements.forEach((el, i) => {
8953
+ el.style.setProperty('--v-body-scroll-x', convertToUnit(-el.scrollLeft));
8954
+ el.style.setProperty('--v-body-scroll-y', convertToUnit(-el.scrollTop));
8955
+ el.style.setProperty('--v-scrollbar-offset', convertToUnit(scrollbarWidth));
8956
+ el.classList.add('v-overlay-scroll-blocked');
8957
+ });
8958
+ vue.onScopeDispose(() => {
8959
+ scrollElements.forEach((el, i) => {
8960
+ const x = parseFloat(el.style.getPropertyValue('--v-body-scroll-x'));
8961
+ const y = parseFloat(el.style.getPropertyValue('--v-body-scroll-y'));
8962
+ el.style.removeProperty('--v-body-scroll-x');
8963
+ el.style.removeProperty('--v-body-scroll-y');
8964
+ el.style.removeProperty('--v-scrollbar-offset');
8965
+ el.classList.remove('v-overlay-scroll-blocked');
8966
+ el.scrollLeft = -x;
8967
+ el.scrollTop = -y;
8759
8968
  });
8760
- const top = vue.ref();
8761
- vue.watch(() => isActive.value && (props.absolute || props.contained) && teleportTarget.value == null, val => {
8762
- if (val) {
8763
- const scrollParent = getScrollParent(root.value);
8764
- if (scrollParent && scrollParent !== document.scrollingElement) {
8765
- top.value = scrollParent.scrollTop;
8766
- }
8767
- }
8969
+ if (scrollableParent) {
8970
+ data.root.value.classList.remove('v-overlay--scroll-blocked');
8971
+ }
8972
+ });
8973
+ }
8974
+ function repositionScrollStrategy(data) {
8975
+ let slow = false;
8976
+ let raf = -1;
8977
+ function update(e) {
8978
+ requestNewFrame(() => {
8979
+ var _data$updateLocation$, _data$updateLocation;
8980
+ const start = performance.now();
8981
+ (_data$updateLocation$ = (_data$updateLocation = data.updateLocation).value) == null ? void 0 : _data$updateLocation$.call(_data$updateLocation, e);
8982
+ const time = performance.now() - start;
8983
+ slow = time / (1000 / 60) > 2;
8768
8984
  });
8769
-
8770
- // Add a quick "bounce" animation to the content
8771
- function animateClick() {
8772
- if (props.noClickAnimation) return;
8773
- contentEl.value && animate(contentEl.value, [{
8774
- transformOrigin: 'center'
8775
- }, {
8776
- transform: 'scale(1.03)'
8777
- }, {
8778
- transformOrigin: 'center'
8779
- }], {
8780
- duration: 150,
8781
- easing: standardEasing
8985
+ }
8986
+ bindScroll(data.activatorEl.value ?? data.contentEl.value, e => {
8987
+ if (slow) {
8988
+ // If the position calculation is slow,
8989
+ // defer updates until scrolling is finished.
8990
+ // Browsers usually fire one scroll event per frame so
8991
+ // we just wait until we've got two frames without an event
8992
+ cancelAnimationFrame(raf);
8993
+ raf = requestAnimationFrame(() => {
8994
+ raf = requestAnimationFrame(() => {
8995
+ update(e);
8996
+ });
8782
8997
  });
8998
+ } else {
8999
+ update(e);
8783
9000
  }
8784
- useRender(() => {
8785
- var _slots$activator, _slots$default;
8786
- return vue.createVNode(vue.Fragment, null, [(_slots$activator = slots.activator) == null ? void 0 : _slots$activator.call(slots, {
8787
- isActive: isActive.value,
8788
- props: vue.mergeProps({
8789
- ref: activatorRef
8790
- }, vue.toHandlers(activatorEvents.value), props.activatorProps)
8791
- }), IN_BROWSER && vue.createVNode(vue.Teleport, {
8792
- "disabled": !teleportTarget.value,
8793
- "to": teleportTarget.value
8794
- }, {
8795
- default: () => [hasContent.value && vue.createVNode("div", vue.mergeProps({
8796
- "class": ['v-overlay', {
8797
- 'v-overlay--absolute': props.absolute || props.contained,
8798
- 'v-overlay--active': isActive.value,
8799
- 'v-overlay--contained': props.contained
8800
- }, themeClasses.value, rtlClasses.value],
8801
- "style": [stackStyles.value, {
8802
- top: convertToUnit(top.value)
8803
- }],
8804
- "ref": root
8805
- }, attrs), [vue.createVNode(Scrim, vue.mergeProps({
8806
- "color": scrimColor,
8807
- "modelValue": isActive.value && !!props.scrim
8808
- }, vue.toHandlers(scrimEvents.value)), null), vue.createVNode(MaybeTransition, {
8809
- "appear": true,
8810
- "persisted": true,
8811
- "transition": props.transition,
8812
- "target": activatorEl.value,
8813
- "onAfterLeave": () => {
8814
- onAfterLeave();
8815
- emit('afterLeave');
8816
- }
8817
- }, {
8818
- default: () => [vue.withDirectives(vue.createVNode("div", vue.mergeProps({
8819
- "ref": contentEl,
8820
- "class": ['v-overlay__content', props.contentClass],
8821
- "style": [dimensionStyles.value, contentStyles.value]
8822
- }, vue.toHandlers(contentEvents.value), props.contentProps), [(_slots$default = slots.default) == null ? void 0 : _slots$default.call(slots, {
8823
- isActive
8824
- })]), [[vue.vShow, isActive.value], [vue.resolveDirective("click-outside"), {
8825
- handler: onClickOutside,
8826
- closeConditional,
8827
- include: () => [activatorEl.value]
8828
- }]])]
8829
- })])]
8830
- })]);
9001
+ });
9002
+ }
9003
+
9004
+ /** @private */
9005
+ function bindScroll(el, onScroll) {
9006
+ const scrollElements = [document, ...getScrollParents(el)];
9007
+ scrollElements.forEach(el => {
9008
+ el.addEventListener('scroll', onScroll, {
9009
+ passive: true
8831
9010
  });
8832
- return {
8833
- activatorEl,
8834
- animateClick,
8835
- contentEl,
8836
- globalTop,
8837
- localTop,
8838
- updateLocation
8839
- };
9011
+ });
9012
+ vue.onScopeDispose(() => {
9013
+ scrollElements.forEach(el => {
9014
+ el.removeEventListener('scroll', onScroll);
9015
+ });
9016
+ });
9017
+ }
9018
+
9019
+ // Utilities
9020
+ function useHydration() {
9021
+ var _vm$root, _vm$root$appContext, _vm$root$appContext$a;
9022
+ if (!IN_BROWSER) return vue.ref(false);
9023
+ const vm = getCurrentInstance('useHydration');
9024
+ const rootEl = vm == null ? void 0 : (_vm$root = vm.root) == null ? void 0 : (_vm$root$appContext = _vm$root.appContext) == null ? void 0 : (_vm$root$appContext$a = _vm$root$appContext.app) == null ? void 0 : _vm$root$appContext$a._container;
9025
+ const isMounted = vue.ref(!!(rootEl != null && rootEl.__vue_app__));
9026
+ if (!isMounted.value) {
9027
+ vue.onMounted(() => isMounted.value = true);
8840
9028
  }
8841
- });
8842
- function filterVOverlayProps(props) {
8843
- return pick(props, Object.keys(VOverlay.props));
9029
+ return isMounted;
8844
9030
  }
8845
9031
 
8846
- const Refs = Symbol('Forwarded refs');
9032
+ // Types
8847
9033
 
8848
- /** Omit properties starting with P */
9034
+ const StackSymbol = Symbol.for('vuetify:stack');
9035
+ const globalStack = vue.reactive([]);
9036
+ function useStack(isActive, zIndex) {
9037
+ const vm = getCurrentInstance('useStack');
9038
+ const parent = vue.inject(StackSymbol, undefined);
9039
+ const stack = vue.reactive({
9040
+ activeChildren: new Set()
9041
+ });
9042
+ vue.provide(StackSymbol, stack);
9043
+ const _zIndex = vue.ref(+zIndex.value);
9044
+ useToggleScope(isActive, () => {
9045
+ var _globalStack$at;
9046
+ const lastZIndex = (_globalStack$at = globalStack.at(-1)) == null ? void 0 : _globalStack$at[1];
9047
+ _zIndex.value = lastZIndex ? lastZIndex + 10 : +zIndex.value;
9048
+ globalStack.push([vm.uid, _zIndex.value]);
9049
+ parent == null ? void 0 : parent.activeChildren.add(vm.uid);
9050
+ vue.onScopeDispose(() => {
9051
+ const idx = globalStack.findIndex(v => v[0] === vm.uid);
9052
+ globalStack.splice(idx, 1);
9053
+ parent == null ? void 0 : parent.activeChildren.delete(vm.uid);
9054
+ });
9055
+ });
9056
+ const globalTop = vue.ref(true);
9057
+ vue.watchEffect(() => {
9058
+ var _globalStack$at2;
9059
+ const _isTop = ((_globalStack$at2 = globalStack.at(-1)) == null ? void 0 : _globalStack$at2[0]) === vm.uid;
9060
+ setTimeout(() => globalTop.value = _isTop);
9061
+ });
9062
+ const localTop = vue.computed(() => !stack.activeChildren.size);
9063
+ return {
9064
+ globalTop: vue.readonly(globalTop),
9065
+ localTop,
9066
+ stackStyles: vue.computed(() => ({
9067
+ zIndex: _zIndex.value
9068
+ }))
9069
+ };
9070
+ }
8849
9071
 
8850
- function forwardRefs(target) {
8851
- for (var _len = arguments.length, refs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
8852
- refs[_key - 1] = arguments[_key];
8853
- }
8854
- target[Refs] = refs;
8855
- return new Proxy(target, {
8856
- get(target, key) {
8857
- if (Reflect.has(target, key)) {
8858
- return Reflect.get(target, key);
8859
- }
8860
- for (const ref of refs) {
8861
- if (ref.value && Reflect.has(ref.value, key)) {
8862
- const val = Reflect.get(ref.value, key);
8863
- return typeof val === 'function' ? val.bind(ref.value) : val;
8864
- }
8865
- }
8866
- },
8867
- getOwnPropertyDescriptor(target, key) {
8868
- const descriptor = Reflect.getOwnPropertyDescriptor(target, key);
8869
- if (descriptor) return descriptor;
9072
+ // Utilities
8870
9073
 
8871
- // Skip internal properties
8872
- if (typeof key === 'symbol' || key.startsWith('__')) return;
9074
+ // Types
8873
9075
 
8874
- // Check each ref's own properties
8875
- for (const ref of refs) {
8876
- if (!ref.value) continue;
8877
- const descriptor = Reflect.getOwnPropertyDescriptor(ref.value, key);
8878
- if (descriptor) return descriptor;
8879
- if ('_' in ref.value && 'setupState' in ref.value._) {
8880
- const descriptor = Reflect.getOwnPropertyDescriptor(ref.value._.setupState, key);
8881
- if (descriptor) return descriptor;
8882
- }
8883
- }
8884
- // Recursive search up each ref's prototype
8885
- for (const ref of refs) {
8886
- let obj = ref.value && Object.getPrototypeOf(ref.value);
8887
- while (obj) {
8888
- const descriptor = Reflect.getOwnPropertyDescriptor(obj, key);
8889
- if (descriptor) return descriptor;
8890
- obj = Object.getPrototypeOf(obj);
8891
- }
8892
- }
8893
- // Call forwarded refs' proxies
8894
- for (const ref of refs) {
8895
- const childRefs = ref.value && ref.value[Refs];
8896
- if (!childRefs) continue;
8897
- const queue = childRefs.slice();
8898
- while (queue.length) {
8899
- const ref = queue.shift();
8900
- const descriptor = Reflect.getOwnPropertyDescriptor(ref.value, key);
8901
- if (descriptor) return descriptor;
8902
- const childRefs = ref.value && ref.value[Refs];
8903
- if (childRefs) queue.push(...childRefs);
8904
- }
8905
- }
9076
+ function useTeleport(target) {
9077
+ const teleportTarget = vue.computed(() => {
9078
+ const _target = target.value;
9079
+ if (_target === true || !IN_BROWSER) return undefined;
9080
+ const targetElement = _target === false ? document.body : typeof _target === 'string' ? document.querySelector(_target) : _target;
9081
+ if (targetElement == null) {
9082
+ vue.warn(`Unable to locate target ${_target}`);
8906
9083
  return undefined;
8907
9084
  }
9085
+ if (!useTeleport.cache.has(targetElement)) {
9086
+ const el = document.createElement('div');
9087
+ el.className = 'v-overlay-container';
9088
+ targetElement.appendChild(el);
9089
+ useTeleport.cache.set(targetElement, el);
9090
+ }
9091
+ return useTeleport.cache.get(targetElement);
8908
9092
  });
8909
- }
8910
-
8911
- function useScopeId() {
8912
- const vm = getCurrentInstance('useScopeId');
8913
- const scopeId = vm.vnode.scopeId;
8914
9093
  return {
8915
- scopeId: scopeId ? {
8916
- [scopeId]: ''
8917
- } : undefined
9094
+ teleportTarget
8918
9095
  };
8919
9096
  }
9097
+ useTeleport.cache = new WeakMap();
8920
9098
 
8921
- // Types
9099
+ function defaultConditional() {
9100
+ return true;
9101
+ }
9102
+ function checkEvent(e, el, binding) {
9103
+ // The include element callbacks below can be expensive
9104
+ // so we should avoid calling them when we're not active.
9105
+ // Explicitly check for false to allow fallback compatibility
9106
+ // with non-toggleable components
9107
+ if (!e || checkIsActive(e, binding) === false) return false;
8922
9108
 
8923
- const VMenu = genericComponent()({
8924
- name: 'VMenu',
8925
- props: {
8926
- // TODO
8927
- // disableKeys: Boolean,
8928
- id: String,
8929
- ...omit(makeVOverlayProps({
8930
- closeDelay: 250,
8931
- closeOnContentClick: true,
8932
- locationStrategy: 'connected',
8933
- openDelay: 300,
8934
- scrim: false,
8935
- scrollStrategy: 'reposition',
8936
- transition: {
8937
- component: VDialogTransition
8938
- }
8939
- }), ['absolute'])
8940
- },
8941
- emits: {
8942
- 'update:modelValue': value => true
8943
- },
8944
- setup(props, _ref) {
8945
- let {
8946
- slots
8947
- } = _ref;
8948
- const isActive = useProxiedModel(props, 'modelValue');
8949
- const {
8950
- scopeId
8951
- } = useScopeId();
8952
- const uid = getUid();
8953
- const id = vue.computed(() => props.id || `v-menu-${uid}`);
8954
- const overlay = vue.ref();
8955
- const parent = vue.inject(VMenuSymbol, null);
8956
- let openChildren = 0;
8957
- vue.provide(VMenuSymbol, {
8958
- register() {
8959
- ++openChildren;
8960
- },
8961
- unregister() {
8962
- --openChildren;
8963
- },
8964
- closeParents() {
8965
- setTimeout(() => {
8966
- if (!openChildren) {
8967
- isActive.value = false;
8968
- parent == null ? void 0 : parent.closeParents();
8969
- }
8970
- }, 40);
8971
- }
8972
- });
8973
- vue.watch(isActive, val => {
8974
- val ? parent == null ? void 0 : parent.register() : parent == null ? void 0 : parent.unregister();
9109
+ // If we're clicking inside the shadowroot, then the app root doesn't get the same
9110
+ // level of introspection as to _what_ we're clicking. We want to check to see if
9111
+ // our target is the shadowroot parent container, and if it is, ignore.
9112
+ const root = attachedRoot(el);
9113
+ if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot && root.host === e.target) return false;
9114
+
9115
+ // Check if additional elements were passed to be included in check
9116
+ // (click must be outside all included elements, if any)
9117
+ const elements = (typeof binding.value === 'object' && binding.value.include || (() => []))();
9118
+ // Add the root element for the component this directive was defined on
9119
+ elements.push(el);
9120
+
9121
+ // Check if it's a click outside our elements, and then if our callback returns true.
9122
+ // Non-toggleable components should take action in their callback and return falsy.
9123
+ // Toggleable can return true if it wants to deactivate.
9124
+ // Note that, because we're in the capture phase, this callback will occur before
9125
+ // the bubbling click event on any outside elements.
9126
+ return !elements.some(el => el == null ? void 0 : el.contains(e.target));
9127
+ }
9128
+ function checkIsActive(e, binding) {
9129
+ const isActive = typeof binding.value === 'object' && binding.value.closeConditional || defaultConditional;
9130
+ return isActive(e);
9131
+ }
9132
+ function directive(e, el, binding) {
9133
+ const handler = typeof binding.value === 'function' ? binding.value : binding.value.handler;
9134
+ el._clickOutside.lastMousedownWasOutside && checkEvent(e, el, binding) && setTimeout(() => {
9135
+ checkIsActive(e, binding) && handler && handler(e);
9136
+ }, 0);
9137
+ }
9138
+ function handleShadow(el, callback) {
9139
+ const root = attachedRoot(el);
9140
+ callback(document);
9141
+ if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot) {
9142
+ callback(root);
9143
+ }
9144
+ }
9145
+ const ClickOutside = {
9146
+ // [data-app] may not be found
9147
+ // if using bind, inserted makes
9148
+ // sure that the root element is
9149
+ // available, iOS does not support
9150
+ // clicks on body
9151
+ mounted(el, binding) {
9152
+ const onClick = e => directive(e, el, binding);
9153
+ const onMousedown = e => {
9154
+ el._clickOutside.lastMousedownWasOutside = checkEvent(e, el, binding);
9155
+ };
9156
+ handleShadow(el, app => {
9157
+ app.addEventListener('click', onClick, true);
9158
+ app.addEventListener('mousedown', onMousedown, true);
8975
9159
  });
8976
- function onClickOutside() {
8977
- parent == null ? void 0 : parent.closeParents();
9160
+ if (!el._clickOutside) {
9161
+ el._clickOutside = {
9162
+ lastMousedownWasOutside: true
9163
+ };
8978
9164
  }
8979
- useRender(() => {
8980
- const [overlayProps] = filterVOverlayProps(props);
8981
- return vue.createVNode(VOverlay, vue.mergeProps({
8982
- "ref": overlay,
8983
- "class": ['v-menu']
8984
- }, overlayProps, {
8985
- "modelValue": isActive.value,
8986
- "onUpdate:modelValue": $event => isActive.value = $event,
8987
- "absolute": true,
8988
- "activatorProps": vue.mergeProps({
8989
- 'aria-haspopup': 'menu',
8990
- 'aria-expanded': String(isActive.value),
8991
- 'aria-owns': id.value
8992
- }, props.activatorProps),
8993
- "onClick:outside": onClickOutside
8994
- }, scopeId), {
8995
- activator: slots.activator,
8996
- default: function () {
8997
- var _slots$default;
8998
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
8999
- args[_key] = arguments[_key];
9000
- }
9001
- return vue.createVNode(VDefaultsProvider, {
9002
- "root": true
9003
- }, {
9004
- default: () => [(_slots$default = slots.default) == null ? void 0 : _slots$default.call(slots, ...args)]
9005
- });
9006
- }
9007
- });
9008
- });
9009
- return forwardRefs({
9010
- id
9011
- }, overlay);
9012
- }
9013
- });
9014
-
9015
- const VFieldLabel = defineComponent({
9016
- name: 'VFieldLabel',
9017
- props: {
9018
- floating: Boolean
9165
+ el._clickOutside[binding.instance.$.uid] = {
9166
+ onClick,
9167
+ onMousedown
9168
+ };
9019
9169
  },
9020
- setup(props, _ref) {
9021
- let {
9022
- slots
9023
- } = _ref;
9024
- useRender(() => vue.createVNode(VLabel, {
9025
- "class": ['v-field-label', {
9026
- 'v-field-label--floating': props.floating
9027
- }],
9028
- "aria-hidden": props.floating || undefined
9029
- }, slots));
9030
- return {};
9170
+ unmounted(el, binding) {
9171
+ if (!el._clickOutside) return;
9172
+ handleShadow(el, app => {
9173
+ var _el$_clickOutside;
9174
+ if (!app || !((_el$_clickOutside = el._clickOutside) != null && _el$_clickOutside[binding.instance.$.uid])) return;
9175
+ const {
9176
+ onClick,
9177
+ onMousedown
9178
+ } = el._clickOutside[binding.instance.$.uid];
9179
+ app.removeEventListener('click', onClick, true);
9180
+ app.removeEventListener('mousedown', onMousedown, true);
9181
+ });
9182
+ delete el._clickOutside[binding.instance.$.uid];
9031
9183
  }
9032
- });
9184
+ };
9033
9185
 
9034
9186
  // Types
9035
9187
 
9036
- const allowedVariants$1 = ['underlined', 'outlined', 'filled', 'solo', 'plain'];
9037
- const makeVFieldProps = propsFactory({
9038
- appendInnerIcon: IconValue,
9039
- bgColor: String,
9040
- clearable: Boolean,
9041
- clearIcon: {
9042
- type: IconValue,
9043
- default: '$clear'
9188
+ function Scrim(props) {
9189
+ const {
9190
+ modelValue,
9191
+ color,
9192
+ ...rest
9193
+ } = props;
9194
+ return vue.createVNode(vue.Transition, {
9195
+ "name": "fade-transition",
9196
+ "appear": true
9197
+ }, {
9198
+ default: () => [props.modelValue && vue.createVNode("div", vue.mergeProps({
9199
+ "class": ['v-overlay__scrim', props.color.backgroundColorClasses.value],
9200
+ "style": props.color.backgroundColorStyles.value
9201
+ }, rest), null)]
9202
+ });
9203
+ }
9204
+ const makeVOverlayProps = propsFactory({
9205
+ absolute: Boolean,
9206
+ attach: [Boolean, String, Object],
9207
+ closeOnBack: {
9208
+ type: Boolean,
9209
+ default: true
9044
9210
  },
9045
- active: Boolean,
9046
- color: String,
9047
- dirty: Boolean,
9211
+ contained: Boolean,
9212
+ contentClass: null,
9213
+ contentProps: null,
9048
9214
  disabled: Boolean,
9049
- error: Boolean,
9050
- label: String,
9051
- persistentClear: Boolean,
9052
- prependInnerIcon: IconValue,
9053
- reverse: Boolean,
9054
- singleLine: Boolean,
9055
- variant: {
9056
- type: String,
9057
- default: 'filled',
9058
- validator: v => allowedVariants$1.includes(v)
9215
+ noClickAnimation: Boolean,
9216
+ modelValue: Boolean,
9217
+ persistent: Boolean,
9218
+ scrim: {
9219
+ type: [String, Boolean],
9220
+ default: true
9059
9221
  },
9060
- 'onClick:clear': EventProp,
9061
- 'onClick:appendInner': EventProp,
9062
- 'onClick:prependInner': EventProp,
9222
+ zIndex: {
9223
+ type: [Number, String],
9224
+ default: 2000
9225
+ },
9226
+ ...makeActivatorProps(),
9227
+ ...makeDimensionProps(),
9228
+ ...makeLazyProps(),
9229
+ ...makeLocationStrategyProps(),
9230
+ ...makeScrollStrategyProps(),
9063
9231
  ...makeThemeProps(),
9064
- ...makeLoaderProps()
9065
- }, 'v-field');
9066
- const VField = genericComponent()({
9067
- name: 'VField',
9068
- inheritAttrs: false,
9069
- props: {
9070
- id: String,
9071
- ...makeFocusProps(),
9072
- ...makeVFieldProps()
9232
+ ...makeTransitionProps()
9233
+ }, 'v-overlay');
9234
+ const VOverlay = genericComponent()({
9235
+ name: 'VOverlay',
9236
+ directives: {
9237
+ ClickOutside
9073
9238
  },
9239
+ inheritAttrs: false,
9240
+ props: makeVOverlayProps(),
9074
9241
  emits: {
9075
- 'click:control': e => true,
9076
- 'update:focused': focused => true,
9077
- 'update:modelValue': val => true
9242
+ 'click:outside': e => true,
9243
+ 'update:modelValue': value => true,
9244
+ afterLeave: () => true
9078
9245
  },
9079
9246
  setup(props, _ref) {
9080
9247
  let {
9248
+ slots,
9081
9249
  attrs,
9082
- emit,
9083
- slots
9250
+ emit
9084
9251
  } = _ref;
9252
+ const model = useProxiedModel(props, 'modelValue');
9253
+ const isActive = vue.computed({
9254
+ get: () => model.value,
9255
+ set: v => {
9256
+ if (!(v && props.disabled)) model.value = v;
9257
+ }
9258
+ });
9259
+ const {
9260
+ teleportTarget
9261
+ } = useTeleport(vue.computed(() => props.attach || props.contained));
9085
9262
  const {
9086
9263
  themeClasses
9087
9264
  } = provideTheme(props);
9088
9265
  const {
9089
- loaderClasses
9090
- } = useLoader(props);
9266
+ rtlClasses,
9267
+ isRtl
9268
+ } = useRtl();
9091
9269
  const {
9092
- focusClasses,
9093
- isFocused,
9094
- focus,
9095
- blur
9096
- } = useFocus(props);
9270
+ hasContent,
9271
+ onAfterLeave
9272
+ } = useLazy(props, isActive);
9273
+ const scrimColor = useBackgroundColor(vue.computed(() => {
9274
+ return typeof props.scrim === 'string' ? props.scrim : null;
9275
+ }));
9097
9276
  const {
9098
- InputIcon
9099
- } = useInputIcon(props);
9100
- const isActive = vue.computed(() => props.dirty || props.active);
9101
- const hasLabel = vue.computed(() => !props.singleLine && !!(props.label || slots.label));
9102
- const uid = getUid();
9103
- const id = vue.computed(() => props.id || `input-${uid}`);
9104
- const labelRef = vue.ref();
9105
- const floatingLabelRef = vue.ref();
9106
- const controlRef = vue.ref();
9277
+ globalTop,
9278
+ localTop,
9279
+ stackStyles
9280
+ } = useStack(isActive, vue.toRef(props, 'zIndex'));
9107
9281
  const {
9108
- backgroundColorClasses,
9109
- backgroundColorStyles
9110
- } = useBackgroundColor(vue.toRef(props, 'bgColor'));
9282
+ activatorEl,
9283
+ activatorRef,
9284
+ activatorEvents,
9285
+ contentEvents,
9286
+ scrimEvents
9287
+ } = useActivator(props, {
9288
+ isActive,
9289
+ isTop: localTop
9290
+ });
9111
9291
  const {
9112
- textColorClasses,
9113
- textColorStyles
9114
- } = useTextColor(vue.computed(() => {
9115
- return isActive.value && isFocused.value && !props.error && !props.disabled ? props.color : undefined;
9116
- }));
9117
- vue.watch(isActive, val => {
9118
- if (hasLabel.value) {
9119
- const el = labelRef.value.$el;
9120
- const targetEl = floatingLabelRef.value.$el;
9121
- const rect = nullifyTransforms(el);
9122
- const targetRect = targetEl.getBoundingClientRect();
9123
- const x = targetRect.x - rect.x;
9124
- const y = targetRect.y - rect.y - (rect.height / 2 - targetRect.height / 2);
9125
- const targetWidth = targetRect.width / 0.75;
9126
- const width = Math.abs(targetWidth - rect.width) > 1 ? {
9127
- maxWidth: convertToUnit(targetWidth)
9128
- } : undefined;
9129
- const style = getComputedStyle(el);
9130
- const targetStyle = getComputedStyle(targetEl);
9131
- const duration = parseFloat(style.transitionDuration) * 1000 || 150;
9132
- const scale = parseFloat(targetStyle.getPropertyValue('--v-field-label-scale'));
9133
- const color = targetStyle.getPropertyValue('color');
9134
- el.style.visibility = 'visible';
9135
- targetEl.style.visibility = 'hidden';
9136
- animate(el, {
9137
- transform: `translate(${x}px, ${y}px) scale(${scale})`,
9138
- color,
9139
- ...width
9140
- }, {
9141
- duration,
9142
- easing: standardEasing,
9143
- direction: val ? 'normal' : 'reverse'
9144
- }).finished.then(() => {
9145
- el.style.removeProperty('visibility');
9146
- targetEl.style.removeProperty('visibility');
9147
- });
9292
+ dimensionStyles
9293
+ } = useDimension(props);
9294
+ const isMounted = useHydration();
9295
+ vue.watch(() => props.disabled, v => {
9296
+ if (v) isActive.value = false;
9297
+ });
9298
+ const root = vue.ref();
9299
+ const contentEl = vue.ref();
9300
+ const {
9301
+ contentStyles,
9302
+ updateLocation
9303
+ } = useLocationStrategies(props, {
9304
+ isRtl,
9305
+ contentEl,
9306
+ activatorEl,
9307
+ isActive
9308
+ });
9309
+ useScrollStrategies(props, {
9310
+ root,
9311
+ contentEl,
9312
+ activatorEl,
9313
+ isActive,
9314
+ updateLocation
9315
+ });
9316
+ function onClickOutside(e) {
9317
+ emit('click:outside', e);
9318
+ if (!props.persistent) isActive.value = false;else animateClick();
9319
+ }
9320
+ function closeConditional() {
9321
+ return isActive.value && globalTop.value;
9322
+ }
9323
+ IN_BROWSER && vue.watch(isActive, val => {
9324
+ if (val) {
9325
+ window.addEventListener('keydown', onKeydown);
9326
+ } else {
9327
+ window.removeEventListener('keydown', onKeydown);
9328
+ }
9329
+ }, {
9330
+ immediate: true
9331
+ });
9332
+ function onKeydown(e) {
9333
+ if (e.key === 'Escape' && globalTop.value) {
9334
+ if (!props.persistent) {
9335
+ isActive.value = false;
9336
+ } else animateClick();
9337
+ }
9338
+ }
9339
+ const router = useRouter();
9340
+ useToggleScope(() => props.closeOnBack, () => {
9341
+ useBackButton(router, next => {
9342
+ if (globalTop.value && isActive.value) {
9343
+ next(false);
9344
+ if (!props.persistent) isActive.value = false;else animateClick();
9345
+ } else {
9346
+ next();
9347
+ }
9348
+ });
9349
+ });
9350
+ const top = vue.ref();
9351
+ vue.watch(() => isActive.value && (props.absolute || props.contained) && teleportTarget.value == null, val => {
9352
+ if (val) {
9353
+ const scrollParent = getScrollParent(root.value);
9354
+ if (scrollParent && scrollParent !== document.scrollingElement) {
9355
+ top.value = scrollParent.scrollTop;
9356
+ }
9148
9357
  }
9149
- }, {
9150
- flush: 'post'
9151
9358
  });
9152
- const slotProps = vue.computed(() => ({
9153
- isActive,
9154
- isFocused,
9155
- controlRef,
9156
- blur,
9157
- focus
9158
- }));
9159
- function onClick(e) {
9160
- if (e.target !== document.activeElement) {
9161
- e.preventDefault();
9162
- }
9163
- emit('click:control', e);
9164
- }
9165
- useRender(() => {
9166
- var _slots$prependInner, _slots$default, _slots$appendInner;
9167
- const isOutlined = props.variant === 'outlined';
9168
- const hasPrepend = slots['prepend-inner'] || props.prependInnerIcon;
9169
- const hasClear = !!(props.clearable || slots.clear);
9170
- const hasAppend = !!(slots['append-inner'] || props.appendInnerIcon || hasClear);
9171
- const label = slots.label ? slots.label({
9172
- label: props.label,
9173
- props: {
9174
- for: id.value
9175
- }
9176
- }) : props.label;
9177
- return vue.createVNode("div", vue.mergeProps({
9178
- "class": ['v-field', {
9179
- 'v-field--active': isActive.value,
9180
- 'v-field--appended': hasAppend,
9181
- 'v-field--disabled': props.disabled,
9182
- 'v-field--dirty': props.dirty,
9183
- 'v-field--error': props.error,
9184
- 'v-field--has-background': !!props.bgColor,
9185
- 'v-field--persistent-clear': props.persistentClear,
9186
- 'v-field--prepended': hasPrepend,
9187
- 'v-field--reverse': props.reverse,
9188
- 'v-field--single-line': props.singleLine,
9189
- 'v-field--no-label': !label,
9190
- [`v-field--variant-${props.variant}`]: true
9191
- }, themeClasses.value, backgroundColorClasses.value, focusClasses.value, loaderClasses.value],
9192
- "style": [backgroundColorStyles.value, textColorStyles.value],
9193
- "onClick": onClick
9194
- }, attrs), [vue.createVNode("div", {
9195
- "class": "v-field__overlay"
9196
- }, null), vue.createVNode(LoaderSlot, {
9197
- "name": "v-field",
9198
- "active": props.loading,
9199
- "color": props.error ? 'error' : props.color
9200
- }, {
9201
- default: slots.loader
9202
- }), hasPrepend && vue.createVNode("div", {
9203
- "key": "prepend",
9204
- "class": "v-field__prepend-inner"
9205
- }, [props.prependInnerIcon && vue.createVNode(InputIcon, {
9206
- "key": "prepend-icon",
9207
- "name": "prependInner"
9208
- }, null), (_slots$prependInner = slots['prepend-inner']) == null ? void 0 : _slots$prependInner.call(slots, slotProps.value)]), vue.createVNode("div", {
9209
- "class": "v-field__field",
9210
- "data-no-activator": ""
9211
- }, [['solo', 'filled'].includes(props.variant) && hasLabel.value && vue.createVNode(VFieldLabel, {
9212
- "key": "floating-label",
9213
- "ref": floatingLabelRef,
9214
- "class": [textColorClasses.value],
9215
- "floating": true,
9216
- "for": id.value
9217
- }, {
9218
- default: () => [label]
9219
- }), vue.createVNode(VFieldLabel, {
9220
- "ref": labelRef,
9221
- "for": id.value
9222
- }, {
9223
- default: () => [label]
9224
- }), (_slots$default = slots.default) == null ? void 0 : _slots$default.call(slots, {
9225
- ...slotProps.value,
9226
- props: {
9227
- id: id.value,
9228
- class: 'v-field__input'
9229
- },
9230
- focus,
9231
- blur
9232
- })]), hasClear && vue.createVNode(VExpandXTransition, {
9233
- "key": "clear"
9359
+
9360
+ // Add a quick "bounce" animation to the content
9361
+ function animateClick() {
9362
+ if (props.noClickAnimation) return;
9363
+ contentEl.value && animate(contentEl.value, [{
9364
+ transformOrigin: 'center'
9234
9365
  }, {
9235
- default: () => [vue.withDirectives(vue.createVNode("div", {
9236
- "class": "v-field__clearable"
9237
- }, [slots.clear ? slots.clear() : vue.createVNode(InputIcon, {
9238
- "name": "clear"
9239
- }, null)]), [[vue.vShow, props.dirty]])]
9240
- }), hasAppend && vue.createVNode("div", {
9241
- "key": "append",
9242
- "class": "v-field__append-inner"
9243
- }, [(_slots$appendInner = slots['append-inner']) == null ? void 0 : _slots$appendInner.call(slots, slotProps.value), props.appendInnerIcon && vue.createVNode(InputIcon, {
9244
- "key": "append-icon",
9245
- "name": "appendInner"
9246
- }, null)]), vue.createVNode("div", {
9247
- "class": ['v-field__outline', textColorClasses.value]
9248
- }, [isOutlined && vue.createVNode(vue.Fragment, null, [vue.createVNode("div", {
9249
- "class": "v-field__outline__start"
9250
- }, null), hasLabel.value && vue.createVNode("div", {
9251
- "class": "v-field__outline__notch"
9252
- }, [vue.createVNode(VFieldLabel, {
9253
- "ref": floatingLabelRef,
9254
- "floating": true,
9255
- "for": id.value
9366
+ transform: 'scale(1.03)'
9256
9367
  }, {
9257
- default: () => [label]
9258
- })]), vue.createVNode("div", {
9259
- "class": "v-field__outline__end"
9260
- }, null)]), ['plain', 'underlined'].includes(props.variant) && hasLabel.value && vue.createVNode(VFieldLabel, {
9261
- "ref": floatingLabelRef,
9262
- "floating": true,
9263
- "for": id.value
9368
+ transformOrigin: 'center'
9369
+ }], {
9370
+ duration: 150,
9371
+ easing: standardEasing
9372
+ });
9373
+ }
9374
+ useRender(() => {
9375
+ var _slots$activator, _slots$default;
9376
+ return vue.createVNode(vue.Fragment, null, [(_slots$activator = slots.activator) == null ? void 0 : _slots$activator.call(slots, {
9377
+ isActive: isActive.value,
9378
+ props: vue.mergeProps({
9379
+ ref: activatorRef
9380
+ }, vue.toHandlers(activatorEvents.value), props.activatorProps)
9381
+ }), isMounted.value && vue.createVNode(vue.Teleport, {
9382
+ "disabled": !teleportTarget.value,
9383
+ "to": teleportTarget.value
9264
9384
  }, {
9265
- default: () => [label]
9266
- })])]);
9385
+ default: () => [hasContent.value && vue.createVNode("div", vue.mergeProps({
9386
+ "class": ['v-overlay', {
9387
+ 'v-overlay--absolute': props.absolute || props.contained,
9388
+ 'v-overlay--active': isActive.value,
9389
+ 'v-overlay--contained': props.contained
9390
+ }, themeClasses.value, rtlClasses.value],
9391
+ "style": [stackStyles.value, {
9392
+ top: convertToUnit(top.value)
9393
+ }],
9394
+ "ref": root
9395
+ }, attrs), [vue.createVNode(Scrim, vue.mergeProps({
9396
+ "color": scrimColor,
9397
+ "modelValue": isActive.value && !!props.scrim
9398
+ }, vue.toHandlers(scrimEvents.value)), null), vue.createVNode(MaybeTransition, {
9399
+ "appear": true,
9400
+ "persisted": true,
9401
+ "transition": props.transition,
9402
+ "target": activatorEl.value,
9403
+ "onAfterLeave": () => {
9404
+ onAfterLeave();
9405
+ emit('afterLeave');
9406
+ }
9407
+ }, {
9408
+ default: () => [vue.withDirectives(vue.createVNode("div", vue.mergeProps({
9409
+ "ref": contentEl,
9410
+ "class": ['v-overlay__content', props.contentClass],
9411
+ "style": [dimensionStyles.value, contentStyles.value]
9412
+ }, vue.toHandlers(contentEvents.value), props.contentProps), [(_slots$default = slots.default) == null ? void 0 : _slots$default.call(slots, {
9413
+ isActive
9414
+ })]), [[vue.vShow, isActive.value], [vue.resolveDirective("click-outside"), {
9415
+ handler: onClickOutside,
9416
+ closeConditional,
9417
+ include: () => [activatorEl.value]
9418
+ }]])]
9419
+ })])]
9420
+ })]);
9267
9421
  });
9268
9422
  return {
9269
- controlRef
9423
+ activatorEl,
9424
+ animateClick,
9425
+ contentEl,
9426
+ globalTop,
9427
+ localTop,
9428
+ updateLocation
9270
9429
  };
9271
9430
  }
9272
9431
  });
9273
- // TODO: this is kinda slow, might be better to implicitly inherit props instead
9274
- function filterFieldProps(attrs) {
9275
- const keys = Object.keys(VField.props).filter(k => !isOn(k));
9276
- return pick(attrs, keys);
9432
+ function filterVOverlayProps(props) {
9433
+ return pick(props, Object.keys(VOverlay.props));
9277
9434
  }
9278
9435
 
9279
- const VCounter = defineComponent({
9280
- name: 'VCounter',
9281
- functional: true,
9282
- props: {
9283
- active: Boolean,
9284
- max: [Number, String],
9285
- value: {
9286
- type: [Number, String],
9287
- default: 0
9288
- },
9289
- ...makeTransitionProps({
9290
- transition: {
9291
- component: VSlideYTransition
9292
- }
9293
- })
9294
- },
9295
- setup(props, _ref) {
9296
- let {
9297
- slots
9298
- } = _ref;
9299
- const counter = vue.computed(() => {
9300
- return props.max ? `${props.value} / ${props.max}` : String(props.value);
9301
- });
9302
- useRender(() => vue.createVNode(MaybeTransition, {
9303
- "transition": props.transition
9304
- }, {
9305
- default: () => [vue.withDirectives(vue.createVNode("div", {
9306
- "class": "v-counter"
9307
- }, [slots.default ? slots.default({
9308
- counter: counter.value,
9309
- max: props.max,
9310
- value: props.value
9311
- }) : counter.value]), [[vue.vShow, props.active]])]
9312
- }));
9313
- return {};
9314
- }
9315
- });
9316
-
9317
- // Types
9318
-
9319
- const activeTypes = ['color', 'file', 'time', 'date', 'datetime-local', 'week', 'month'];
9320
- const VTextField = genericComponent()({
9321
- name: 'VTextField',
9322
- directives: {
9323
- Intersect
9324
- },
9325
- inheritAttrs: false,
9326
- props: {
9327
- autofocus: Boolean,
9328
- counter: [Boolean, Number, String],
9329
- counterValue: Function,
9330
- hint: String,
9331
- persistentHint: Boolean,
9332
- prefix: String,
9333
- placeholder: String,
9334
- persistentPlaceholder: Boolean,
9335
- persistentCounter: Boolean,
9336
- suffix: String,
9337
- type: {
9338
- type: String,
9339
- default: 'text'
9340
- },
9341
- ...makeVInputProps(),
9342
- ...makeVFieldProps()
9436
+ function useScopeId() {
9437
+ const vm = getCurrentInstance('useScopeId');
9438
+ const scopeId = vm.vnode.scopeId;
9439
+ return {
9440
+ scopeId: scopeId ? {
9441
+ [scopeId]: ''
9442
+ } : undefined
9443
+ };
9444
+ }
9445
+
9446
+ // Types
9447
+
9448
+ const VMenu = genericComponent()({
9449
+ name: 'VMenu',
9450
+ props: {
9451
+ // TODO
9452
+ // disableKeys: Boolean,
9453
+ id: String,
9454
+ ...omit(makeVOverlayProps({
9455
+ closeDelay: 250,
9456
+ closeOnContentClick: true,
9457
+ locationStrategy: 'connected',
9458
+ openDelay: 300,
9459
+ scrim: false,
9460
+ scrollStrategy: 'reposition',
9461
+ transition: {
9462
+ component: VDialogTransition
9463
+ }
9464
+ }), ['absolute'])
9343
9465
  },
9344
9466
  emits: {
9345
- 'click:control': e => true,
9346
- 'click:input': e => true,
9347
- 'update:focused': focused => true,
9348
- 'update:modelValue': val => true
9467
+ 'update:modelValue': value => true
9349
9468
  },
9350
9469
  setup(props, _ref) {
9351
9470
  let {
9352
- attrs,
9353
- emit,
9354
9471
  slots
9355
9472
  } = _ref;
9356
- const model = useProxiedModel(props, 'modelValue');
9473
+ const isActive = useProxiedModel(props, 'modelValue');
9357
9474
  const {
9358
- isFocused,
9359
- focus,
9360
- blur
9361
- } = useFocus(props);
9362
- const counterValue = vue.computed(() => {
9363
- return typeof props.counterValue === 'function' ? props.counterValue(model.value) : (model.value ?? '').toString().length;
9364
- });
9365
- const max = vue.computed(() => {
9366
- if (attrs.maxlength) return attrs.maxlength;
9367
- if (!props.counter || typeof props.counter !== 'number' && typeof props.counter !== 'string') return undefined;
9368
- return props.counter;
9475
+ scopeId
9476
+ } = useScopeId();
9477
+ const uid = getUid();
9478
+ const id = vue.computed(() => props.id || `v-menu-${uid}`);
9479
+ const overlay = vue.ref();
9480
+ const parent = vue.inject(VMenuSymbol, null);
9481
+ let openChildren = 0;
9482
+ vue.provide(VMenuSymbol, {
9483
+ register() {
9484
+ ++openChildren;
9485
+ },
9486
+ unregister() {
9487
+ --openChildren;
9488
+ },
9489
+ closeParents() {
9490
+ setTimeout(() => {
9491
+ if (!openChildren) {
9492
+ isActive.value = false;
9493
+ parent == null ? void 0 : parent.closeParents();
9494
+ }
9495
+ }, 40);
9496
+ }
9369
9497
  });
9370
- function onIntersect(isIntersecting, entries) {
9371
- var _entries$0$target, _entries$0$target$foc;
9372
- if (!props.autofocus || !isIntersecting) return;
9373
- (_entries$0$target = entries[0].target) == null ? void 0 : (_entries$0$target$foc = _entries$0$target.focus) == null ? void 0 : _entries$0$target$foc.call(_entries$0$target);
9374
- }
9375
- const vInputRef = vue.ref();
9376
- const vFieldRef = vue.ref();
9377
- const inputRef = vue.ref();
9378
- const isActive = vue.computed(() => activeTypes.includes(props.type) || props.persistentPlaceholder || isFocused.value);
9379
- const messages = vue.computed(() => {
9380
- return props.messages.length ? props.messages : isFocused.value || props.persistentHint ? props.hint : '';
9498
+ vue.watch(isActive, val => {
9499
+ val ? parent == null ? void 0 : parent.register() : parent == null ? void 0 : parent.unregister();
9381
9500
  });
9382
- function onFocus() {
9383
- if (inputRef.value !== document.activeElement) {
9384
- var _inputRef$value;
9385
- (_inputRef$value = inputRef.value) == null ? void 0 : _inputRef$value.focus();
9386
- }
9387
- if (!isFocused.value) focus();
9388
- }
9389
- function onControlClick(e) {
9390
- onFocus();
9391
- emit('click:control', e);
9392
- }
9393
- function onClear(e) {
9394
- e.stopPropagation();
9395
- onFocus();
9396
- vue.nextTick(() => {
9397
- model.value = null;
9398
- callEvent(props['onClick:clear'], e);
9399
- });
9400
- }
9401
- function onInput(e) {
9402
- model.value = e.target.value;
9501
+ function onClickOutside() {
9502
+ parent == null ? void 0 : parent.closeParents();
9403
9503
  }
9404
9504
  useRender(() => {
9405
- const hasCounter = !!(slots.counter || props.counter || props.counterValue);
9406
- const hasDetails = !!(hasCounter || slots.details);
9407
- const [rootAttrs, inputAttrs] = filterInputAttrs(attrs);
9408
- const [{
9409
- modelValue: _,
9410
- ...inputProps
9411
- }] = filterInputProps(props);
9412
- const [fieldProps] = filterFieldProps(props);
9413
- return vue.createVNode(VInput, vue.mergeProps({
9414
- "ref": vInputRef,
9415
- "modelValue": model.value,
9416
- "onUpdate:modelValue": $event => model.value = $event,
9417
- "class": ['v-text-field', {
9418
- 'v-text-field--prefixed': props.prefix,
9419
- 'v-text-field--suffixed': props.suffix,
9420
- 'v-text-field--flush-details': ['plain', 'underlined'].includes(props.variant)
9421
- }],
9422
- "onClick:prepend": props['onClick:prepend'],
9423
- "onClick:append": props['onClick:append']
9424
- }, rootAttrs, inputProps, {
9425
- "focused": isFocused.value,
9426
- "messages": messages.value
9427
- }), {
9428
- ...slots,
9429
- default: _ref2 => {
9430
- let {
9431
- id,
9432
- isDisabled,
9433
- isDirty,
9434
- isReadonly,
9435
- isValid
9436
- } = _ref2;
9437
- return vue.createVNode(VField, vue.mergeProps({
9438
- "ref": vFieldRef,
9439
- "onMousedown": e => {
9440
- if (e.target === inputRef.value) return;
9441
- e.preventDefault();
9442
- },
9443
- "onClick:control": onControlClick,
9444
- "onClick:clear": onClear,
9445
- "onClick:prependInner": props['onClick:prependInner'],
9446
- "onClick:appendInner": props['onClick:appendInner'],
9447
- "role": "textbox"
9448
- }, fieldProps, {
9449
- "id": id.value,
9450
- "active": isActive.value || isDirty.value,
9451
- "dirty": isDirty.value || props.dirty,
9452
- "focused": isFocused.value,
9453
- "error": isValid.value === false
9454
- }), {
9455
- ...slots,
9456
- default: _ref3 => {
9457
- let {
9458
- props: {
9459
- class: fieldClass,
9460
- ...slotProps
9461
- }
9462
- } = _ref3;
9463
- const inputNode = vue.withDirectives(vue.createVNode("input", vue.mergeProps({
9464
- "ref": inputRef,
9465
- "value": model.value,
9466
- "onInput": onInput,
9467
- "autofocus": props.autofocus,
9468
- "readonly": isReadonly.value,
9469
- "disabled": isDisabled.value,
9470
- "name": props.name,
9471
- "placeholder": props.placeholder,
9472
- "size": 1,
9473
- "type": props.type,
9474
- "onFocus": onFocus,
9475
- "onBlur": blur
9476
- }, slotProps, inputAttrs), null), [[vue.resolveDirective("intersect"), {
9477
- handler: onIntersect
9478
- }, null, {
9479
- once: true
9480
- }]]);
9481
- return vue.createVNode(vue.Fragment, null, [props.prefix && vue.createVNode("span", {
9482
- "class": "v-text-field__prefix"
9483
- }, [props.prefix]), slots.default ? vue.createVNode("div", {
9484
- "class": fieldClass,
9485
- "onClick": e => emit('click:input', e),
9486
- "data-no-activator": ""
9487
- }, [slots.default(), inputNode]) : vue.cloneVNode(inputNode, {
9488
- class: fieldClass
9489
- }), props.suffix && vue.createVNode("span", {
9490
- "class": "v-text-field__suffix"
9491
- }, [props.suffix])]);
9492
- }
9505
+ const [overlayProps] = filterVOverlayProps(props);
9506
+ return vue.createVNode(VOverlay, vue.mergeProps({
9507
+ "ref": overlay,
9508
+ "class": ['v-menu']
9509
+ }, overlayProps, {
9510
+ "modelValue": isActive.value,
9511
+ "onUpdate:modelValue": $event => isActive.value = $event,
9512
+ "absolute": true,
9513
+ "activatorProps": vue.mergeProps({
9514
+ 'aria-haspopup': 'menu',
9515
+ 'aria-expanded': String(isActive.value),
9516
+ 'aria-owns': id.value
9517
+ }, props.activatorProps),
9518
+ "onClick:outside": onClickOutside
9519
+ }, scopeId), {
9520
+ activator: slots.activator,
9521
+ default: function () {
9522
+ var _slots$default;
9523
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
9524
+ args[_key] = arguments[_key];
9525
+ }
9526
+ return vue.createVNode(VDefaultsProvider, {
9527
+ "root": true
9528
+ }, {
9529
+ default: () => [(_slots$default = slots.default) == null ? void 0 : _slots$default.call(slots, ...args)]
9493
9530
  });
9494
- },
9495
- details: hasDetails ? slotProps => {
9496
- var _slots$details;
9497
- return vue.createVNode(vue.Fragment, null, [(_slots$details = slots.details) == null ? void 0 : _slots$details.call(slots, slotProps), hasCounter && vue.createVNode(vue.Fragment, null, [vue.createVNode("span", null, null), vue.createVNode(VCounter, {
9498
- "active": props.persistentCounter || isFocused.value,
9499
- "value": counterValue.value,
9500
- "max": max.value
9501
- }, slots.counter)])]);
9502
- } : undefined
9531
+ }
9503
9532
  });
9504
9533
  });
9505
- return forwardRefs({}, vInputRef, vFieldRef, inputRef);
9534
+ return forwardRefs({
9535
+ id
9536
+ }, overlay);
9506
9537
  }
9507
9538
  });
9508
9539
 
@@ -9522,22 +9553,23 @@
9522
9553
  menuProps: {
9523
9554
  type: Object
9524
9555
  },
9525
- modelValue: null,
9526
9556
  multiple: Boolean,
9527
9557
  noDataText: {
9528
9558
  type: String,
9529
9559
  default: '$vuetify.noDataText'
9530
9560
  },
9531
9561
  openOnClear: Boolean,
9532
- readonly: Boolean,
9533
9562
  ...makeItemsProps({
9534
9563
  itemChildren: false
9535
9564
  })
9536
- }, 'select');
9565
+ }, 'v-select');
9537
9566
  const VSelect = genericComponent()({
9538
9567
  name: 'VSelect',
9539
9568
  props: {
9540
9569
  ...makeSelectProps(),
9570
+ ...omit(makeVTextFieldProps({
9571
+ modelValue: null
9572
+ }), ['validationValue', 'dirty', 'appendInnerIcon']),
9541
9573
  ...makeTransitionProps({
9542
9574
  transition: {
9543
9575
  component: VDialogTransition
@@ -9586,6 +9618,7 @@
9586
9618
  function onKeydown(e) {
9587
9619
  if (props.readonly) return;
9588
9620
  if (['Enter', 'ArrowDown', ' '].includes(e.key)) {
9621
+ e.preventDefault();
9589
9622
  menu.value = true;
9590
9623
  }
9591
9624
  if (['Escape', 'Tab'].includes(e.key)) {
@@ -9596,12 +9629,15 @@
9596
9629
  (_listRef$value = listRef.value) == null ? void 0 : _listRef$value.focus('next');
9597
9630
  } else if (e.key === 'ArrowUp') {
9598
9631
  var _listRef$value2;
9632
+ e.preventDefault();
9599
9633
  (_listRef$value2 = listRef.value) == null ? void 0 : _listRef$value2.focus('prev');
9600
9634
  } else if (e.key === 'Home') {
9601
9635
  var _listRef$value3;
9636
+ e.preventDefault();
9602
9637
  (_listRef$value3 = listRef.value) == null ? void 0 : _listRef$value3.focus('first');
9603
9638
  } else if (e.key === 'End') {
9604
9639
  var _listRef$value4;
9640
+ e.preventDefault();
9605
9641
  (_listRef$value4 = listRef.value) == null ? void 0 : _listRef$value4.focus('last');
9606
9642
  }
9607
9643
  }
@@ -9634,8 +9670,10 @@
9634
9670
  }
9635
9671
  useRender(() => {
9636
9672
  const hasChips = !!(props.chips || slots.chip);
9637
- return vue.createVNode(VTextField, {
9638
- "ref": vTextFieldRef,
9673
+ const [textFieldProps] = filterVTextFieldProps(props);
9674
+ return vue.createVNode(VTextField, vue.mergeProps({
9675
+ "ref": vTextFieldRef
9676
+ }, textFieldProps, {
9639
9677
  "modelValue": model.value.map(v => v.props.value).join(', '),
9640
9678
  "onUpdate:modelValue": v => {
9641
9679
  if (v == null) model.value = [];
@@ -9654,7 +9692,7 @@
9654
9692
  "onClick:control": onClickControl,
9655
9693
  "onBlur": onBlur,
9656
9694
  "onKeydown": onKeydown
9657
- }, {
9695
+ }), {
9658
9696
  ...slots,
9659
9697
  default: () => {
9660
9698
  var _slots$noData, _slots$prependItem, _slots$appendItem;
@@ -9865,6 +9903,9 @@
9865
9903
  filterKeys: ['title']
9866
9904
  }),
9867
9905
  ...makeSelectProps(),
9906
+ ...omit(makeVTextFieldProps({
9907
+ modelValue: null
9908
+ }), ['validationValue', 'dirty', 'appendInnerIcon']),
9868
9909
  ...makeTransitionProps({
9869
9910
  transition: false
9870
9911
  })
@@ -9929,9 +9970,11 @@
9929
9970
  }
9930
9971
  if (e.key === 'ArrowDown') {
9931
9972
  var _listRef$value;
9973
+ e.preventDefault();
9932
9974
  (_listRef$value = listRef.value) == null ? void 0 : _listRef$value.focus('next');
9933
9975
  } else if (e.key === 'ArrowUp') {
9934
9976
  var _listRef$value2;
9977
+ e.preventDefault();
9935
9978
  (_listRef$value2 = listRef.value) == null ? void 0 : _listRef$value2.focus('prev');
9936
9979
  }
9937
9980
  }
@@ -9992,8 +10035,10 @@
9992
10035
  });
9993
10036
  useRender(() => {
9994
10037
  const hasChips = !!(props.chips || slots.chip);
9995
- return vue.createVNode(VTextField, {
9996
- "ref": vTextFieldRef,
10038
+ const [textFieldProps] = filterVTextFieldProps(props);
10039
+ return vue.createVNode(VTextField, vue.mergeProps({
10040
+ "ref": vTextFieldRef
10041
+ }, textFieldProps, {
9997
10042
  "modelValue": search.value,
9998
10043
  "onUpdate:modelValue": v => {
9999
10044
  if (v == null) model.value = [];
@@ -10015,7 +10060,7 @@
10015
10060
  "onFocus": () => isFocused.value = true,
10016
10061
  "onBlur": () => isFocused.value = false,
10017
10062
  "onKeydown": onKeydown
10018
- }, {
10063
+ }), {
10019
10064
  ...slots,
10020
10065
  default: () => {
10021
10066
  var _slots$noData, _slots$prependItem, _slots$appendItem;
@@ -13228,6 +13273,9 @@
13228
13273
  hideNoData: true,
13229
13274
  returnObject: true
13230
13275
  }),
13276
+ ...omit(makeVTextFieldProps({
13277
+ modelValue: null
13278
+ }), ['validationValue', 'dirty', 'appendInnerIcon']),
13231
13279
  ...makeTransitionProps({
13232
13280
  transition: false
13233
13281
  })
@@ -13340,9 +13388,11 @@
13340
13388
  }
13341
13389
  if (e.key === 'ArrowDown') {
13342
13390
  var _listRef$value;
13391
+ e.preventDefault();
13343
13392
  (_listRef$value = listRef.value) == null ? void 0 : _listRef$value.focus('next');
13344
13393
  } else if (e.key === 'ArrowUp') {
13345
13394
  var _listRef$value2;
13395
+ e.preventDefault();
13346
13396
  (_listRef$value2 = listRef.value) == null ? void 0 : _listRef$value2.focus('prev');
13347
13397
  }
13348
13398
  if (!props.multiple) return;
@@ -13430,8 +13480,10 @@
13430
13480
  });
13431
13481
  useRender(() => {
13432
13482
  const hasChips = !!(props.chips || slots.chip);
13433
- return vue.createVNode(VTextField, {
13434
- "ref": vTextFieldRef,
13483
+ const [textFieldProps] = filterVTextFieldProps(props);
13484
+ return vue.createVNode(VTextField, vue.mergeProps({
13485
+ "ref": vTextFieldRef
13486
+ }, textFieldProps, {
13435
13487
  "modelValue": search.value,
13436
13488
  "onUpdate:modelValue": [$event => search.value = $event, v => {
13437
13489
  if (v == null) model.value = [];
@@ -13452,7 +13504,7 @@
13452
13504
  "onFocus": () => isFocused.value = true,
13453
13505
  "onBlur": () => isFocused.value = false,
13454
13506
  "onKeydown": onKeydown
13455
- }, {
13507
+ }), {
13456
13508
  ...slots,
13457
13509
  default: () => {
13458
13510
  var _slots$noData, _slots$prependItem, _slots$appendItem;
@@ -13734,7 +13786,7 @@
13734
13786
  default: false
13735
13787
  },
13736
13788
  readonly: Boolean
13737
- }, 'VExpansionPanelTitle');
13789
+ }, 'v-expansion-panel-title');
13738
13790
  const VExpansionPanelTitle = defineComponent({
13739
13791
  name: 'VExpansionPanelTitle',
13740
13792
  directives: {
@@ -15307,15 +15359,6 @@
15307
15359
  }
15308
15360
  });
15309
15361
 
15310
- // Utilities
15311
- function useHydration(callback) {
15312
- var _vm$root, _vm$root$appContext, _vm$root$appContext$a;
15313
- if (!IN_BROWSER) return;
15314
- const vm = getCurrentInstance('useHydration');
15315
- const rootEl = vm == null ? void 0 : (_vm$root = vm.root) == null ? void 0 : (_vm$root$appContext = _vm$root.appContext) == null ? void 0 : (_vm$root$appContext$a = _vm$root$appContext.app) == null ? void 0 : _vm$root$appContext$a._container;
15316
- return rootEl != null && rootEl.__vue_app__ ? callback() : vue.onMounted(callback);
15317
- }
15318
-
15319
15362
  // Composables
15320
15363
  const VNoSsr = defineComponent({
15321
15364
  name: 'VNoSsr',
@@ -15323,8 +15366,7 @@
15323
15366
  let {
15324
15367
  slots
15325
15368
  } = _ref;
15326
- const show = vue.ref(false);
15327
- useHydration(() => show.value = true);
15369
+ const show = useHydration();
15328
15370
  return () => {
15329
15371
  var _slots$default;
15330
15372
  return show.value && ((_slots$default = slots.default) == null ? void 0 : _slots$default.call(slots));
@@ -18078,15 +18120,21 @@
18078
18120
  app.provide(IconSymbol, icons);
18079
18121
  app.provide(LocaleSymbol, locale);
18080
18122
  if (IN_BROWSER && options.ssr) {
18081
- const {
18082
- mount
18083
- } = app;
18084
- app.mount = function () {
18085
- const vm = mount(...arguments);
18086
- vue.nextTick(() => display.update());
18087
- app.mount = mount;
18088
- return vm;
18089
- };
18123
+ if (app.$nuxt) {
18124
+ app.$nuxt.hook('app:suspense:resolve', () => {
18125
+ display.update();
18126
+ });
18127
+ } else {
18128
+ const {
18129
+ mount
18130
+ } = app;
18131
+ app.mount = function () {
18132
+ const vm = mount(...arguments);
18133
+ vue.nextTick(() => display.update());
18134
+ app.mount = mount;
18135
+ return vm;
18136
+ };
18137
+ }
18090
18138
  }
18091
18139
  getUid.reset();
18092
18140
  app.mixin({
@@ -18112,7 +18160,7 @@
18112
18160
  locale
18113
18161
  };
18114
18162
  }
18115
- const version$1 = "3.0.0";
18163
+ const version$1 = "3.0.1";
18116
18164
  createVuetify$1.version = version$1;
18117
18165
 
18118
18166
  // Vue's inject() can only be used in setup
@@ -18133,7 +18181,7 @@
18133
18181
  ...options
18134
18182
  });
18135
18183
  };
18136
- const version = "3.0.0";
18184
+ const version = "3.0.1";
18137
18185
  createVuetify.version = version;
18138
18186
 
18139
18187
  exports.components = components;