@vuetify/nightly 3.3.12-dev.2023-08-15 → 3.3.12-dev.2023-08-17

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 (50) hide show
  1. package/CHANGELOG.md +3 -2
  2. package/dist/json/attributes.json +31 -7
  3. package/dist/json/importMap.json +46 -46
  4. package/dist/json/tags.json +6 -0
  5. package/dist/json/web-types.json +62 -8
  6. package/dist/vuetify-labs.css +884 -884
  7. package/dist/vuetify-labs.d.ts +227 -110
  8. package/dist/vuetify-labs.esm.js +96 -42
  9. package/dist/vuetify-labs.esm.js.map +1 -1
  10. package/dist/vuetify-labs.js +96 -42
  11. package/dist/vuetify-labs.min.css +2 -2
  12. package/dist/vuetify.css +240 -240
  13. package/dist/vuetify.d.ts +227 -116
  14. package/dist/vuetify.esm.js +96 -42
  15. package/dist/vuetify.esm.js.map +1 -1
  16. package/dist/vuetify.js +96 -42
  17. package/dist/vuetify.js.map +1 -1
  18. package/dist/vuetify.min.css +2 -2
  19. package/dist/vuetify.min.js +740 -739
  20. package/dist/vuetify.min.js.map +1 -1
  21. package/lib/components/VAutocomplete/index.d.mts +14 -8
  22. package/lib/components/VCombobox/index.d.mts +14 -8
  23. package/lib/components/VDialog/index.d.mts +41 -20
  24. package/lib/components/VMenu/index.d.mts +41 -20
  25. package/lib/components/VOverlay/VOverlay.mjs +9 -4
  26. package/lib/components/VOverlay/VOverlay.mjs.map +1 -1
  27. package/lib/components/VOverlay/index.d.mts +17 -8
  28. package/lib/components/VOverlay/locationStrategies.mjs +9 -9
  29. package/lib/components/VOverlay/locationStrategies.mjs.map +1 -1
  30. package/lib/components/VOverlay/scrollStrategies.mjs +3 -3
  31. package/lib/components/VOverlay/scrollStrategies.mjs.map +1 -1
  32. package/lib/components/VOverlay/useActivator.mjs +50 -21
  33. package/lib/components/VOverlay/useActivator.mjs.map +1 -1
  34. package/lib/components/VSelect/index.d.mts +14 -8
  35. package/lib/components/VSnackbar/index.d.mts +41 -20
  36. package/lib/components/VTooltip/index.d.mts +41 -20
  37. package/lib/components/index.d.mts +215 -104
  38. package/lib/components/transitions/dialog-transition.mjs +4 -3
  39. package/lib/components/transitions/dialog-transition.mjs.map +1 -1
  40. package/lib/components/transitions/index.d.mts +6 -6
  41. package/lib/entry-bundler.mjs +1 -1
  42. package/lib/framework.mjs +1 -1
  43. package/lib/index.d.mts +12 -12
  44. package/lib/labs/VBottomSheet/index.d.mts +14 -8
  45. package/lib/labs/components.d.mts +14 -8
  46. package/lib/util/box.mjs +12 -0
  47. package/lib/util/box.mjs.map +1 -1
  48. package/lib/util/helpers.mjs +9 -1
  49. package/lib/util/helpers.mjs.map +1 -1
  50. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vuetify v3.3.12-dev.2023-08-15
2
+ * Vuetify v3.3.12-dev.2023-08-17
3
3
  * Forged by John Leider
4
4
  * Released under the MIT License.
5
5
  */
@@ -158,7 +158,15 @@ function isObject(obj) {
158
158
  return obj !== null && typeof obj === 'object' && !Array.isArray(obj);
159
159
  }
160
160
  function refElement(obj) {
161
- return obj && '$el' in obj ? obj.$el : obj;
161
+ if (obj && '$el' in obj) {
162
+ const el = obj.$el;
163
+ if (el?.nodeType === Node.TEXT_NODE) {
164
+ // Multi-root component, use the first element
165
+ return el.nextElementSibling;
166
+ }
167
+ return el;
168
+ }
169
+ return obj;
162
170
  }
163
171
 
164
172
  // KeyboardEvent.keyCode aliases
@@ -551,6 +559,18 @@ function getOverflow(a, b) {
551
559
  }
552
560
  };
553
561
  }
562
+ function getTargetBox(target) {
563
+ if (Array.isArray(target)) {
564
+ return new Box({
565
+ x: target[0],
566
+ y: target[1],
567
+ width: 0,
568
+ height: 0
569
+ });
570
+ } else {
571
+ return target.getBoundingClientRect();
572
+ }
573
+ }
554
574
 
555
575
  // Utilities
556
576
 
@@ -2628,7 +2648,7 @@ function ExpandTransitionGenerator () {
2628
2648
  // Types
2629
2649
 
2630
2650
  const makeVDialogTransitionProps = propsFactory({
2631
- target: Object
2651
+ target: [Object, Array]
2632
2652
  }, 'v-dialog-transition');
2633
2653
  const VDialogTransition = genericComponent()({
2634
2654
  name: 'VDialogTransition',
@@ -2730,7 +2750,7 @@ function getChildren(el) {
2730
2750
  return els && [...els];
2731
2751
  }
2732
2752
  function getDimensions(target, el) {
2733
- const targetBox = target.getBoundingClientRect();
2753
+ const targetBox = getTargetBox(target);
2734
2754
  const elBox = nullifyTransforms(el);
2735
2755
  const [originX, originY] = getComputedStyle(el).transformOrigin.split(' ').map(v => parseFloat(v));
2736
2756
  const [anchorSide, anchorOffset] = getComputedStyle(el).getPropertyValue('--v-overlay-anchor-origin').split(' ');
@@ -8416,7 +8436,7 @@ function getIntrinsicSize(el, isRtl) {
8416
8436
  return contentBox;
8417
8437
  }
8418
8438
  function connectedLocationStrategy(data, props, contentStyles) {
8419
- const activatorFixed = isFixedPosition(data.activatorEl.value);
8439
+ const activatorFixed = Array.isArray(data.target.value) || isFixedPosition(data.target.value);
8420
8440
  if (activatorFixed) {
8421
8441
  Object.assign(contentStyles.value, {
8422
8442
  position: 'fixed',
@@ -8465,11 +8485,11 @@ function connectedLocationStrategy(data, props, contentStyles) {
8465
8485
  const observer = new ResizeObserver(() => {
8466
8486
  if (observe) updateLocation();
8467
8487
  });
8468
- watch([data.activatorEl, data.contentEl], (_ref, _ref2) => {
8469
- let [newActivatorEl, newContentEl] = _ref;
8470
- let [oldActivatorEl, oldContentEl] = _ref2;
8471
- if (oldActivatorEl) observer.unobserve(oldActivatorEl);
8472
- if (newActivatorEl) observer.observe(newActivatorEl);
8488
+ watch([data.target, data.contentEl], (_ref, _ref2) => {
8489
+ let [newTarget, newContentEl] = _ref;
8490
+ let [oldTarget, oldContentEl] = _ref2;
8491
+ if (oldTarget && !Array.isArray(oldTarget)) observer.unobserve(oldTarget);
8492
+ if (newTarget && !Array.isArray(newTarget)) observer.observe(newTarget);
8473
8493
  if (oldContentEl) observer.unobserve(oldContentEl);
8474
8494
  if (newContentEl) observer.observe(newContentEl);
8475
8495
  }, {
@@ -8485,8 +8505,8 @@ function connectedLocationStrategy(data, props, contentStyles) {
8485
8505
  requestAnimationFrame(() => {
8486
8506
  requestAnimationFrame(() => observe = true);
8487
8507
  });
8488
- if (!data.activatorEl.value || !data.contentEl.value) return;
8489
- const targetBox = data.activatorEl.value.getBoundingClientRect();
8508
+ if (!data.target.value || !data.contentEl.value) return;
8509
+ const targetBox = getTargetBox(data.target.value);
8490
8510
  const contentBox = getIntrinsicSize(data.contentEl.value, data.isRtl.value);
8491
8511
  const scrollParents = getScrollParents(data.contentEl.value);
8492
8512
  const viewportMargin = 12;
@@ -8773,11 +8793,11 @@ function closeScrollStrategy(data) {
8773
8793
  function onScroll(e) {
8774
8794
  data.isActive.value = false;
8775
8795
  }
8776
- bindScroll(data.activatorEl.value ?? data.contentEl.value, onScroll);
8796
+ bindScroll(data.targetEl.value ?? data.contentEl.value, onScroll);
8777
8797
  }
8778
8798
  function blockScrollStrategy(data, props) {
8779
8799
  const offsetParent = data.root.value?.offsetParent;
8780
- 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'));
8800
+ const scrollElements = [...new Set([...getScrollParents(data.targetEl.value, props.contained ? offsetParent : undefined), ...getScrollParents(data.contentEl.value, props.contained ? offsetParent : undefined)])].filter(el => !el.classList.contains('v-overlay-scroll-blocked'));
8781
8801
  const scrollbarWidth = window.innerWidth - document.documentElement.offsetWidth;
8782
8802
  const scrollableParent = (el => hasScrollbar(el) && el)(offsetParent || document.documentElement);
8783
8803
  if (scrollableParent) {
@@ -8821,7 +8841,7 @@ function repositionScrollStrategy(data, props, scope) {
8821
8841
  }
8822
8842
  ric = (typeof requestIdleCallback === 'undefined' ? cb => cb() : requestIdleCallback)(() => {
8823
8843
  scope.run(() => {
8824
- bindScroll(data.activatorEl.value ?? data.contentEl.value, e => {
8844
+ bindScroll(data.targetEl.value ?? data.contentEl.value, e => {
8825
8845
  if (slow) {
8826
8846
  // If the position calculation is slow,
8827
8847
  // defer updates until scrolling is finished.
@@ -8902,6 +8922,7 @@ function useDelay(props, cb) {
8902
8922
  // Types
8903
8923
 
8904
8924
  const makeActivatorProps = propsFactory({
8925
+ target: [String, Object],
8905
8926
  activator: [String, Object],
8906
8927
  activatorProps: {
8907
8928
  type: Object,
@@ -8924,6 +8945,7 @@ function useActivator(props, _ref) {
8924
8945
  isActive,
8925
8946
  isTop
8926
8947
  } = _ref;
8948
+ const vm = getCurrentInstance('useActivator');
8927
8949
  const activatorEl = ref();
8928
8950
  let isHovered = false;
8929
8951
  let isFocused = false;
@@ -8941,10 +8963,14 @@ function useActivator(props, _ref) {
8941
8963
  isActive.value = value;
8942
8964
  }
8943
8965
  });
8966
+ const cursorTarget = ref();
8944
8967
  const availableEvents = {
8945
8968
  onClick: e => {
8946
8969
  e.stopPropagation();
8947
8970
  activatorEl.value = e.currentTarget || e.target;
8971
+ if (!isActive.value) {
8972
+ cursorTarget.value = [e.clientX, e.clientY];
8973
+ }
8948
8974
  isActive.value = !isActive.value;
8949
8975
  },
8950
8976
  onMouseenter: e => {
@@ -9038,6 +9064,15 @@ function useActivator(props, _ref) {
9038
9064
  isActive.value = false;
9039
9065
  }
9040
9066
  });
9067
+ watch(isActive, val => {
9068
+ if (!val) {
9069
+ setTimeout(() => {
9070
+ cursorTarget.value = undefined;
9071
+ });
9072
+ }
9073
+ }, {
9074
+ flush: 'post'
9075
+ });
9041
9076
  const activatorRef = ref();
9042
9077
  watchEffect(() => {
9043
9078
  if (!activatorRef.value) return;
@@ -9045,7 +9080,15 @@ function useActivator(props, _ref) {
9045
9080
  activatorEl.value = refElement(activatorRef.value);
9046
9081
  });
9047
9082
  });
9048
- const vm = getCurrentInstance('useActivator');
9083
+ const targetRef = ref();
9084
+ const target = computed(() => {
9085
+ if (props.target === 'cursor' && cursorTarget.value) return cursorTarget.value;
9086
+ if (targetRef.value) return refElement(targetRef.value);
9087
+ return getTarget(props.target, vm) || activatorEl.value;
9088
+ });
9089
+ const targetEl = computed(() => {
9090
+ return Array.isArray(target.value) ? undefined : target.value;
9091
+ });
9049
9092
  let scope;
9050
9093
  watch(() => !!props.activator, val => {
9051
9094
  if (val && IN_BROWSER) {
@@ -9069,6 +9112,9 @@ function useActivator(props, _ref) {
9069
9112
  return {
9070
9113
  activatorEl,
9071
9114
  activatorRef,
9115
+ target,
9116
+ targetEl,
9117
+ targetRef,
9072
9118
  activatorEvents,
9073
9119
  contentEvents,
9074
9120
  scrimEvents
@@ -9110,31 +9156,34 @@ function _useActivator(props, vm, _ref2) {
9110
9156
  }
9111
9157
  function getActivator() {
9112
9158
  let selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : props.activator;
9113
- let activator;
9114
- if (selector) {
9115
- if (selector === 'parent') {
9116
- let el = vm?.proxy?.$el?.parentNode;
9117
- while (el.hasAttribute('data-no-activator')) {
9118
- el = el.parentNode;
9119
- }
9120
- activator = el;
9121
- } else if (typeof selector === 'string') {
9122
- // Selector
9123
- activator = document.querySelector(selector);
9124
- } else if ('$el' in selector) {
9125
- // Component (ref)
9126
- activator = selector.$el;
9127
- } else {
9128
- // HTMLElement | Element
9129
- activator = selector;
9130
- }
9131
- }
9159
+ const activator = getTarget(selector, vm);
9132
9160
 
9133
9161
  // The activator should only be a valid element (Ignore comments and text nodes)
9134
- activatorEl.value = activator?.nodeType === Node.ELEMENT_NODE ? activator : null;
9162
+ activatorEl.value = activator?.nodeType === Node.ELEMENT_NODE ? activator : undefined;
9135
9163
  return activatorEl.value;
9136
9164
  }
9137
9165
  }
9166
+ function getTarget(selector, vm) {
9167
+ if (!selector) return;
9168
+ let target;
9169
+ if (selector === 'parent') {
9170
+ let el = vm?.proxy?.$el?.parentNode;
9171
+ while (el.hasAttribute('data-no-activator')) {
9172
+ el = el.parentNode;
9173
+ }
9174
+ target = el;
9175
+ } else if (typeof selector === 'string') {
9176
+ // Selector
9177
+ target = document.querySelector(selector);
9178
+ } else if ('$el' in selector) {
9179
+ // Component (ref)
9180
+ target = selector.$el;
9181
+ } else {
9182
+ // HTMLElement | Element | [x, y]
9183
+ target = selector;
9184
+ }
9185
+ return target;
9186
+ }
9138
9187
 
9139
9188
  // Utilities
9140
9189
 
@@ -9578,6 +9627,9 @@ const VOverlay = genericComponent()({
9578
9627
  const {
9579
9628
  activatorEl,
9580
9629
  activatorRef,
9630
+ target,
9631
+ targetEl,
9632
+ targetRef,
9581
9633
  activatorEvents,
9582
9634
  contentEvents,
9583
9635
  scrimEvents
@@ -9603,13 +9655,13 @@ const VOverlay = genericComponent()({
9603
9655
  } = useLocationStrategies(props, {
9604
9656
  isRtl,
9605
9657
  contentEl,
9606
- activatorEl,
9658
+ target,
9607
9659
  isActive
9608
9660
  });
9609
9661
  useScrollStrategies(props, {
9610
9662
  root,
9611
9663
  contentEl,
9612
- activatorEl,
9664
+ targetEl,
9613
9665
  isActive,
9614
9666
  updateLocation
9615
9667
  });
@@ -9677,7 +9729,8 @@ const VOverlay = genericComponent()({
9677
9729
  useRender(() => createVNode(Fragment, null, [slots.activator?.({
9678
9730
  isActive: isActive.value,
9679
9731
  props: mergeProps({
9680
- ref: activatorRef
9732
+ ref: activatorRef,
9733
+ targetRef
9681
9734
  }, activatorEvents.value, props.activatorProps)
9682
9735
  }), isMounted.value && hasContent.value && createVNode(Teleport, {
9683
9736
  "disabled": !teleportTarget.value,
@@ -9700,7 +9753,7 @@ const VOverlay = genericComponent()({
9700
9753
  "appear": true,
9701
9754
  "persisted": true,
9702
9755
  "transition": props.transition,
9703
- "target": activatorEl.value,
9756
+ "target": target.value,
9704
9757
  "onAfterLeave": () => {
9705
9758
  onAfterLeave();
9706
9759
  emit('afterLeave');
@@ -9721,6 +9774,7 @@ const VOverlay = genericComponent()({
9721
9774
  })]));
9722
9775
  return {
9723
9776
  activatorEl,
9777
+ target,
9724
9778
  animateClick,
9725
9779
  contentEl,
9726
9780
  globalTop,
@@ -24482,7 +24536,7 @@ function createVuetify$1() {
24482
24536
  date
24483
24537
  };
24484
24538
  }
24485
- const version$1 = "3.3.12-dev.2023-08-15";
24539
+ const version$1 = "3.3.12-dev.2023-08-17";
24486
24540
  createVuetify$1.version = version$1;
24487
24541
 
24488
24542
  // Vue's inject() can only be used in setup
@@ -24496,7 +24550,7 @@ function inject(key) {
24496
24550
 
24497
24551
  /* eslint-disable local-rules/sort-imports */
24498
24552
 
24499
- const version = "3.3.12-dev.2023-08-15";
24553
+ const version = "3.3.12-dev.2023-08-17";
24500
24554
 
24501
24555
  /* eslint-disable local-rules/sort-imports */
24502
24556