@maas/vue-equipment 1.0.0-beta.6 → 1.0.0-beta.8

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 (141) hide show
  1. package/dist/composables/index.d.ts +5 -5
  2. package/dist/composables/index.js +14 -8
  3. package/dist/composables/index.js.map +1 -1
  4. package/dist/nuxt/module.json +1 -1
  5. package/dist/nuxt/module.mjs +2 -2
  6. package/dist/plugins/.turbo/turbo-lint.log +2 -2
  7. package/dist/plugins/MagicAccordion/demo/data/footer.json +1 -1
  8. package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +3 -3
  9. package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +2 -2
  10. package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +15 -13
  11. package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +6 -157
  12. package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +2 -1
  13. package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +4 -2
  14. package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +1 -1
  15. package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +2 -2
  16. package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +11 -4
  17. package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +32 -0
  18. package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +0 -4
  19. package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +3 -8
  20. package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +5 -7
  21. package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +3 -87
  22. package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +7 -7
  23. package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue.d.ts +1 -4
  24. package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +6 -5
  25. package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +3 -157
  26. package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +3 -3
  27. package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.d.ts +2 -2
  28. package/dist/plugins/MagicCommand/src/composables/private/useCommandState.mjs +1 -1
  29. package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.d.ts +1 -1
  30. package/dist/plugins/MagicCommand/src/symbols/index.d.ts +4 -4
  31. package/dist/plugins/MagicCommand/src/types/index.d.ts +1 -1
  32. package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +3 -3
  33. package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +3 -3
  34. package/dist/plugins/MagicCookie/src/symbols/index.d.ts +2 -2
  35. package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +10 -12
  36. package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +4 -25
  37. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +2 -2
  38. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +4 -4
  39. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +34 -14
  40. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +3 -3
  41. package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +12 -15
  42. package/dist/plugins/MagicDraggable/src/types/index.d.ts +1 -1
  43. package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +20 -21
  44. package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +188 -0
  45. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +34 -14
  46. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +2 -2
  47. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +3 -3
  48. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +1 -1
  49. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.mjs +28 -10
  50. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +2 -2
  51. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +3 -3
  52. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +16 -14
  53. package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.d.ts +1 -1
  54. package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +15 -15
  55. package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +25 -0
  56. package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +1 -1
  57. package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +8 -2
  58. package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +27 -0
  59. package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +3 -6
  60. package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +56 -0
  61. package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +5 -7
  62. package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +53 -0
  63. package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +1 -12
  64. package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +3 -8
  65. package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +6 -6
  66. package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +1 -85
  67. package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +1 -1
  68. package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +2 -2
  69. package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +3 -4
  70. package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +3 -157
  71. package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +3 -3
  72. package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +1 -1
  73. package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.d.ts +3 -3
  74. package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +4 -4
  75. package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +35 -15
  76. package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +1 -1
  77. package/dist/plugins/MagicMenu/src/symbols/index.d.ts +4 -4
  78. package/dist/plugins/MagicModal/src/components/MagicModal.vue +6 -6
  79. package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +60 -0
  80. package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +34 -14
  81. package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +13 -13
  82. package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +1 -5
  83. package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +3 -3
  84. package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +2 -2
  85. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +14 -8
  86. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue.d.ts +1 -4
  87. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +29 -29
  88. package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +34 -0
  89. package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +1 -1
  90. package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +19 -8
  91. package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +1 -4
  92. package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +35 -0
  93. package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +5 -5
  94. package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +3 -4
  95. package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +6 -11
  96. package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue.d.ts +1 -1
  97. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +3 -4
  98. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue.d.ts +1 -4
  99. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +23 -24
  100. package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +73 -0
  101. package/dist/plugins/MagicPlayer/src/components/icons/FullscreenEnter.vue.d.ts +1 -1
  102. package/dist/plugins/MagicPlayer/src/components/icons/FullscreenExit.vue.d.ts +1 -1
  103. package/dist/plugins/MagicPlayer/src/components/icons/Pause.vue.d.ts +1 -1
  104. package/dist/plugins/MagicPlayer/src/components/icons/Play.vue.d.ts +1 -1
  105. package/dist/plugins/MagicPlayer/src/components/icons/VolumeOff.vue.d.ts +1 -1
  106. package/dist/plugins/MagicPlayer/src/components/icons/VolumeOn.vue.d.ts +1 -1
  107. package/dist/plugins/MagicPlayer/src/components/icons/Waiting.vue.d.ts +1 -1
  108. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +2 -2
  109. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +3 -3
  110. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +10 -10
  111. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +15 -9
  112. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +13 -13
  113. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +18 -11
  114. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +3 -3
  115. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +3 -3
  116. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +6 -6
  117. package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +4 -4
  118. package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +20 -20
  119. package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +17 -8
  120. package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +4 -10
  121. package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +7 -7
  122. package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +4 -10
  123. package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +3 -3
  124. package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +17 -9
  125. package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +4 -9
  126. package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +2 -2
  127. package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +3 -3
  128. package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +8 -3
  129. package/dist/plugins/MagicScroll/src/symbols/index.d.ts +1 -1
  130. package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +9 -10
  131. package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +1 -59
  132. package/dist/plugins/MagicToast/src/components/MagicToastView.vue +5 -8
  133. package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +3 -8
  134. package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +22 -22
  135. package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +33 -15
  136. package/dist/plugins/MagicToast/src/types/index.d.ts +1 -1
  137. package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +1 -1
  138. package/dist/utils/index.d.ts +7 -3
  139. package/dist/utils/index.js +25 -0
  140. package/dist/utils/index.js.map +1 -1
  141. package/package.json +3 -3
@@ -1,14 +1,18 @@
1
- import { ref } from "vue";
1
+ import { ref, shallowRef } from "vue";
2
2
  import { defu } from "defu";
3
3
  import { useScrollLock } from "@vueuse/core";
4
4
  import { useFocusTrap } from "@vueuse/integrations/useFocusTrap";
5
- import { matchClass } from "@maas/vue-equipment/utils";
5
+ import {
6
+ matchClass,
7
+ scrollbarGutterSupport,
8
+ scrollbarWidth
9
+ } from "@maas/vue-equipment/utils";
6
10
  const defaultOptions = {
7
11
  focusTrap: false,
8
12
  focusTarget: void 0,
9
13
  scrollLock: true
10
14
  };
11
- const scrollLock = typeof window !== "undefined" ? useScrollLock(document?.documentElement) : ref(false);
15
+ const scrollLock = typeof window !== "undefined" ? useScrollLock(document?.documentElement) : shallowRef(false);
12
16
  export function useDrawerDOM(args) {
13
17
  const positionFixedElements = ref([]);
14
18
  const mappedOptions = defu(args, defaultOptions);
@@ -36,24 +40,40 @@ export function useDrawerDOM(args) {
36
40
  function addScrollLockPadding() {
37
41
  if (typeof window === "undefined") return;
38
42
  const exclude = new RegExp(/magic-drawer(__backdrop)?/);
39
- const scrollbarWidth = window.innerWidth - document.body.offsetWidth;
40
- document.body.style.setProperty("--scrollbar-width", `${scrollbarWidth}px`);
41
- document.body.style.paddingRight = "var(--scrollbar-width)";
43
+ document.body.style.setProperty(
44
+ "--scrollbar-width",
45
+ `${scrollbarWidth()}px`
46
+ );
42
47
  positionFixedElements.value = [
43
48
  ...document.body.getElementsByTagName("*")
44
49
  ].filter(
45
- (x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && !matchClass(x, exclude)
46
- );
47
- positionFixedElements.value.forEach(
48
- (elem) => elem.style.paddingRight = "var(--scrollbar-width)"
50
+ (x) => getComputedStyle(x, null).getPropertyValue("position") === "fixed" && getComputedStyle(x, null).getPropertyValue("right") === "0px" && !matchClass(x, exclude)
49
51
  );
52
+ switch (scrollbarGutterSupport()) {
53
+ case true:
54
+ document.documentElement.style.scrollbarGutter = "stable";
55
+ positionFixedElements.value.forEach((elem) => {
56
+ elem.style.scrollbarGutter = "stable";
57
+ elem.style.overflow = "auto";
58
+ });
59
+ break;
60
+ case false:
61
+ document.body.style.paddingRight = "var(--scrollbar-width)";
62
+ positionFixedElements.value.forEach(
63
+ (elem) => elem.style.paddingRight = "var(--scrollbar-width)"
64
+ );
65
+ break;
66
+ }
50
67
  }
51
68
  function removeScrollLockPadding() {
52
- document.body.style.paddingRight = "";
69
+ document.documentElement.style.scrollbarGutter = "";
53
70
  document.body.style.removeProperty("--scrollbar-width");
54
- positionFixedElements.value.forEach(
55
- (elem) => elem.style.paddingRight = ""
56
- );
71
+ document.body.style.paddingRight = "";
72
+ positionFixedElements.value.forEach((elem) => {
73
+ elem.style.paddingRight = "";
74
+ elem.style.scrollbarGutter = "";
75
+ elem.style.overflow = "";
76
+ });
57
77
  }
58
78
  return {
59
79
  trapFocus,
@@ -2,8 +2,8 @@ import { type Ref, type MaybeRef } from 'vue';
2
2
  import type { DrawerDefaultOptions } from '../../types/index.js';
3
3
  type UseDrawerDragArgs = {
4
4
  id: MaybeRef<string>;
5
- elRef: Ref<HTMLElement | undefined>;
6
- wrapperRef: Ref<HTMLDivElement | undefined>;
5
+ elRef: Ref<HTMLElement | null>;
6
+ wrapperRef: Ref<HTMLDivElement | null>;
7
7
  position: MaybeRef<DrawerDefaultOptions['position']>;
8
8
  snapPoints: MaybeRef<DrawerDefaultOptions['snapPoints']>;
9
9
  threshold: MaybeRef<DrawerDefaultOptions['threshold']>;
@@ -383,9 +383,9 @@ export function useDrawerDrag(args) {
383
383
  shouldClose.value = false;
384
384
  checkDirection({ x: e.screenX, y: e.screenY });
385
385
  if (!scrollLock) {
386
- const target = lockScroll(e.target);
387
- if (target) {
388
- scrollLock = useScrollLock(target);
386
+ const scrollLockTarget = lockScroll(e.target);
387
+ if (scrollLockTarget) {
388
+ scrollLock = useScrollLock(scrollLockTarget);
389
389
  scrollLock.value = true;
390
390
  }
391
391
  }
@@ -1,7 +1,7 @@
1
1
  import { type Ref, type MaybeRef } from 'vue';
2
2
  import type { DrawerSnapPoint, DrawerDefaultOptions } from '../../types/index.js';
3
3
  interface UseDrawerGuardsArgs {
4
- elRef: Ref<HTMLElement | undefined>;
4
+ elRef: Ref<HTMLElement | null>;
5
5
  absDirectionX: MaybeRef<'with' | 'against' | undefined>;
6
6
  absDirectionY: MaybeRef<'with' | 'against' | undefined>;
7
7
  position: MaybeRef<DrawerDefaultOptions['position']>;
@@ -8,6 +8,20 @@ export function useDrawerGuards(args) {
8
8
  const canSnap = computed(() => {
9
9
  return toValue(activeSnapPoint) !== 1 && !!toValue(activeSnapPoint);
10
10
  });
11
+ function canScrollY(element) {
12
+ const style = window.getComputedStyle(element);
13
+ const overflowY = style.overflowY;
14
+ const canScroll = ["auto", "scroll"].includes(overflowY);
15
+ const hasOverflow = Math.round(element.scrollHeight) > Math.round(element.clientHeight);
16
+ return canScroll && hasOverflow;
17
+ }
18
+ function canScrollX(element) {
19
+ const style = window.getComputedStyle(element);
20
+ const overflowX = style.overflowX;
21
+ const canScroll = ["auto", "scroll"].includes(overflowX);
22
+ const hasOverflow = Math.round(element.scrollWidth) > Math.round(element.clientWidth);
23
+ return canScroll && hasOverflow;
24
+ }
11
25
  function canDrag(el) {
12
26
  let element = el;
13
27
  if (hasCursor.value) {
@@ -22,7 +36,7 @@ export function useDrawerGuards(args) {
22
36
  }
23
37
  switch (position) {
24
38
  case "bottom":
25
- if (element.scrollHeight > element.clientHeight) {
39
+ if (canScrollY(element)) {
26
40
  if (element.scrollTop > 0) {
27
41
  return false;
28
42
  }
@@ -35,7 +49,7 @@ export function useDrawerGuards(args) {
35
49
  }
36
50
  break;
37
51
  case "top":
38
- if (element.scrollHeight > element.clientHeight) {
52
+ if (canScrollY(element)) {
39
53
  const maxScroll = element.scrollHeight - element.clientHeight;
40
54
  if (element.scrollTop < maxScroll) {
41
55
  return false;
@@ -49,7 +63,7 @@ export function useDrawerGuards(args) {
49
63
  }
50
64
  break;
51
65
  case "right":
52
- if (element.scrollWidth > element.clientWidth) {
66
+ if (canScrollX(element)) {
53
67
  if (element.scrollLeft > 0) {
54
68
  return false;
55
69
  }
@@ -62,7 +76,7 @@ export function useDrawerGuards(args) {
62
76
  }
63
77
  break;
64
78
  case "left":
65
- if (element.scrollWidth > element.clientWidth) {
79
+ if (canScrollX(element)) {
66
80
  const maxScroll = element.scrollWidth - element.clientWidth;
67
81
  if (element.scrollLeft < maxScroll) {
68
82
  return false;
@@ -89,13 +103,13 @@ export function useDrawerGuards(args) {
89
103
  switch (position) {
90
104
  case "bottom":
91
105
  case "top":
92
- if (element.scrollHeight > element.clientHeight) {
106
+ if (canScrollY(element)) {
93
107
  return false;
94
108
  }
95
109
  break;
96
110
  case "left":
97
111
  case "right":
98
- if (element.scrollWidth > element.clientWidth) {
112
+ if (canScrollX(element)) {
99
113
  return false;
100
114
  }
101
115
  break;
@@ -117,41 +131,45 @@ export function useDrawerGuards(args) {
117
131
  }
118
132
  switch (position) {
119
133
  case "bottom":
120
- if (element.scrollHeight > element.clientHeight) {
134
+ if (canScrollY(element)) {
121
135
  if (element.scrollTop === 0 || canSnap.value) {
122
136
  if (toValue(absDirectionY) === "against") {
123
137
  return element;
124
138
  }
125
139
  }
140
+ return void 0;
126
141
  }
127
142
  break;
128
143
  case "top":
129
- if (element.scrollHeight > element.clientHeight) {
144
+ if (canScrollY(element)) {
130
145
  const maxScroll = element.scrollHeight - element.clientHeight;
131
146
  if (element.scrollTop === maxScroll || canSnap.value) {
132
147
  if (toValue(absDirectionY) === "against") {
133
148
  return element;
134
149
  }
135
150
  }
151
+ return void 0;
136
152
  }
137
153
  break;
138
154
  case "right":
139
- if (element.scrollWidth > element.clientWidth) {
155
+ if (canScrollX(element)) {
140
156
  if (element.scrollLeft === 0 || canSnap.value) {
141
157
  if (toValue(absDirectionX) === "against") {
142
158
  return element;
143
159
  }
144
160
  }
161
+ return void 0;
145
162
  }
146
163
  break;
147
164
  case "left":
148
- if (element.scrollWidth > element.clientWidth) {
165
+ if (canScrollX(element)) {
149
166
  const maxScroll = element.scrollWidth - element.clientWidth;
150
167
  if (element.scrollLeft === maxScroll || canSnap.value) {
151
168
  if (toValue(absDirectionX) === "against") {
152
169
  return element;
153
170
  }
154
171
  }
172
+ return void 0;
155
173
  }
156
174
  break;
157
175
  }
@@ -2,8 +2,8 @@ import { type Ref, type MaybeRef } from 'vue';
2
2
  import type { DrawerDefaultOptions } from '../../types/index.js';
3
3
  interface UseDrawerProgressArgs {
4
4
  id: MaybeRef<string>;
5
- elRef: Ref<HTMLElement | undefined>;
6
- drawerRef: Ref<HTMLDivElement | undefined>;
5
+ elRef: Ref<HTMLElement | null>;
6
+ drawerRef: Ref<HTMLDivElement | null>;
7
7
  position: MaybeRef<DrawerDefaultOptions['position']>;
8
8
  overshoot: MaybeRef<number>;
9
9
  }
@@ -27,9 +27,9 @@ type InterpolateDraggedArgs = {
27
27
  easing?: (t: number) => number;
28
28
  };
29
29
  export declare function useDrawerSnap(args: UseDrawerSnapArgs): {
30
- snappedY: Ref<number, number>;
31
- snappedX: Ref<number, number>;
32
- activeSnapPoint: Ref<DrawerSnapPoint | undefined, DrawerSnapPoint | undefined>;
30
+ snappedY: import("vue").ShallowRef<number, number>;
31
+ snappedX: import("vue").ShallowRef<number, number>;
32
+ activeSnapPoint: import("vue").ShallowRef<DrawerSnapPoint | undefined, DrawerSnapPoint | undefined>;
33
33
  snapTo: (args: SnapToArgs) => Promise<void>;
34
34
  findClosestSnapPoint: (args: FindClosestSnapPointArgs) => number | undefined;
35
35
  interpolateDragged: (args: InterpolateDraggedArgs) => void;
@@ -1,4 +1,9 @@
1
- import { ref, computed, toValue, nextTick } from "vue";
1
+ import {
2
+ shallowRef,
3
+ computed,
4
+ toValue,
5
+ nextTick
6
+ } from "vue";
2
7
  import { computedWithControl } from "@vueuse/core";
3
8
  import { mapValue, interpolate } from "@maas/vue-equipment/utils";
4
9
  import { useMagicEmitter } from "@maas/vue-equipment/plugins";
@@ -31,22 +36,19 @@ export function useDrawerSnap(args) {
31
36
  () => toValue(snapPoints),
32
37
  () => {
33
38
  const extended = toValue(preventDragClose) ? toValue(snapPoints) : [...toValue(snapPoints), 0];
34
- const mapped = extended.reduce(
35
- (acc, current) => {
36
- const key = mapSnapPoint(current);
37
- if (key || key === 0) {
38
- acc[key] = current;
39
- }
40
- return acc;
41
- },
42
- {}
43
- );
39
+ const mapped = extended.reduce((acc, current) => {
40
+ const key = mapSnapPoint(current);
41
+ if (key || key === 0) {
42
+ acc[key] = current;
43
+ }
44
+ return acc;
45
+ }, {});
44
46
  return mapped;
45
47
  }
46
48
  );
47
- const snappedY = ref(0);
48
- const snappedX = ref(0);
49
- const activeSnapPoint = ref(void 0);
49
+ const snappedY = shallowRef(0);
50
+ const snappedX = shallowRef(0);
51
+ const activeSnapPoint = shallowRef(void 0);
50
52
  const drawerHeight = computed(() => {
51
53
  const rect = toValue(wrapperRect);
52
54
  if (rect === void 0) {
@@ -2,7 +2,7 @@ import { type Ref, type MaybeRef, type ComputedRef } from 'vue';
2
2
  import type { DrawerDefaultOptions } from '../../types/index.js';
3
3
  type UseDrawerWheelArgs = {
4
4
  id: MaybeRef<string>;
5
- elRef: Ref<HTMLElement | undefined>;
5
+ elRef: Ref<HTMLElement | null>;
6
6
  position: MaybeRef<DrawerDefaultOptions['position']>;
7
7
  disabled: ComputedRef<boolean>;
8
8
  };
@@ -1,8 +1,16 @@
1
1
  <script>
2
2
  import { defineComponent as _defineComponent } from "vue";
3
3
  import { renderSlot as _renderSlot, createElementVNode as _createElementVNode, unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
4
- const _hoisted_1 = { class: "magic-marquee__track" };
5
- import { ref, onMounted, onBeforeUnmount } from "vue";
4
+ const _hoisted_1 = {
5
+ ref: "parent",
6
+ class: "magic-marquee"
7
+ };
8
+ const _hoisted_2 = { class: "magic-marquee__track" };
9
+ const _hoisted_3 = {
10
+ ref: "child",
11
+ class: "magic-marquee__content"
12
+ };
13
+ import { useTemplateRef, onMounted, onBeforeUnmount } from "vue";
6
14
  import { useMarqueeApi } from "../composables/private/useMarqueeApi";
7
15
  import { useMarqueeState } from "../composables/private/useMarqueeState";
8
16
  export default /* @__PURE__ */ _defineComponent({
@@ -14,8 +22,8 @@ export default /* @__PURE__ */ _defineComponent({
14
22
  setup(__props) {
15
23
  const { deleteState, initializeState } = useMarqueeState(__props.id);
16
24
  initializeState(__props.options);
17
- const parentRef = ref(void 0);
18
- const childRef = ref(void 0);
25
+ const parentRef = useTemplateRef("parent");
26
+ const childRef = useTemplateRef("child");
19
27
  const { duplicates, initialize } = useMarqueeApi({
20
28
  child: childRef,
21
29
  parent: parentRef,
@@ -30,20 +38,12 @@ export default /* @__PURE__ */ _defineComponent({
30
38
  return (_ctx, _cache) => {
31
39
  return _openBlock(), _createElementBlock(
32
40
  "div",
33
- {
34
- ref_key: "parentRef",
35
- ref: parentRef,
36
- class: "magic-marquee"
37
- },
41
+ _hoisted_1,
38
42
  [
39
- _createElementVNode("div", _hoisted_1, [
43
+ _createElementVNode("div", _hoisted_2, [
40
44
  _createElementVNode(
41
45
  "div",
42
- {
43
- ref_key: "childRef",
44
- ref: childRef,
45
- class: "magic-marquee__content"
46
- },
46
+ _hoisted_3,
47
47
  [
48
48
  _renderSlot(_ctx.$slots, "default")
49
49
  ],
@@ -0,0 +1,25 @@
1
+ import { type MaybeRef } from 'vue';
2
+ import type { MagicMarqueeOptions } from '../types/index.js';
3
+ interface MagicMarqueeProps {
4
+ id: MaybeRef<string>;
5
+ options?: MagicMarqueeOptions;
6
+ }
7
+ declare const duplicates: import("vue").ShallowRef<number, number>;
8
+ declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
9
+ declare var __VLS_1: {}, __VLS_3: {};
10
+ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
11
+ default?: (props: typeof __VLS_1) => any;
12
+ } & {
13
+ default?: (props: typeof __VLS_3) => any;
14
+ }>;
15
+ declare const __VLS_self: import("vue").DefineComponent<MagicMarqueeProps, {
16
+ duplicates: typeof duplicates;
17
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMarqueeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const __VLS_component: import("vue").DefineComponent<MagicMarqueeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMarqueeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
20
+ export default _default;
21
+ type __VLS_WithSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
@@ -5,7 +5,7 @@ export type UseMarqueeApiParams = {
5
5
  instanceId: MaybeRef<string>;
6
6
  };
7
7
  export declare function useMarqueeApi({ child, parent, instanceId, }: UseMarqueeApiParams): {
8
- duplicates: import("vue").Ref<number, number>;
8
+ duplicates: import("vue").ShallowRef<number, number>;
9
9
  play: () => void;
10
10
  pause: () => void;
11
11
  initialize: () => Promise<void>;
@@ -1,4 +1,10 @@
1
- import { ref, computed, nextTick, watch, toValue } from "vue";
1
+ import {
2
+ shallowRef,
3
+ computed,
4
+ nextTick,
5
+ watch,
6
+ toValue
7
+ } from "vue";
2
8
  import { useElementBounding, useElementSize, useThrottleFn } from "@vueuse/core";
3
9
  import { useMarqueeState } from "./useMarqueeState.mjs";
4
10
  export function useMarqueeApi({
@@ -8,7 +14,7 @@ export function useMarqueeApi({
8
14
  }) {
9
15
  const { initializeState } = useMarqueeState(instanceId);
10
16
  const state = initializeState();
11
- const duplicates = ref(1);
17
+ const duplicates = shallowRef(1);
12
18
  const childRect = useElementBounding(child);
13
19
  const parentRect = useElementBounding(parent);
14
20
  const { width } = useElementSize(parent);
@@ -0,0 +1,27 @@
1
+ interface MagicMenuChannelProps {
2
+ id: string;
3
+ transition?: string;
4
+ }
5
+ declare const state: import("../types").MenuState;
6
+ declare const mappedId: import("vue").ComputedRef<string>;
7
+ declare const mappedTransition: import("vue").ComputedRef<string>;
8
+ declare const channel: import("../types").MenuChannel;
9
+ declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
10
+ declare var __VLS_5: {};
11
+ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
12
+ default?: (props: typeof __VLS_5) => any;
13
+ }>;
14
+ declare const __VLS_self: import("vue").DefineComponent<MagicMenuChannelProps, {
15
+ state: typeof state;
16
+ mappedId: typeof mappedId;
17
+ mappedTransition: typeof mappedTransition;
18
+ channel: typeof channel;
19
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuChannelProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ declare const __VLS_component: import("vue").DefineComponent<MagicMenuChannelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuChannelProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
22
+ export default _default;
23
+ type __VLS_WithSlots<T, S> = T & {
24
+ new (): {
25
+ $slots: S;
26
+ };
27
+ };
@@ -4,7 +4,7 @@ import { unref as _unref, renderSlot as _renderSlot, createElementVNode as _crea
4
4
  const _hoisted_1 = ["data-id"];
5
5
  const _hoisted_2 = ["data-pointer-disabled"];
6
6
  import {
7
- ref,
7
+ shallowRef,
8
8
  inject,
9
9
  provide,
10
10
  nextTick,
@@ -38,7 +38,6 @@ export default /* @__PURE__ */ _defineComponent({
38
38
  referenceEl: { type: null, required: false }
39
39
  },
40
40
  setup(__props) {
41
- const contentRef = ref(void 0);
42
41
  const instanceId = inject(MagicMenuInstanceId, void 0);
43
42
  const viewId = inject(MagicMenuViewId, void 0);
44
43
  if (!instanceId) {
@@ -64,8 +63,8 @@ export default /* @__PURE__ */ _defineComponent({
64
63
  return ModeTransitions[state.options.mode];
65
64
  }
66
65
  });
67
- const innerActive = ref(false);
68
- const wrapperActive = ref(false);
66
+ const innerActive = shallowRef(false);
67
+ const wrapperActive = shallowRef(false);
69
68
  const {
70
69
  lockScroll,
71
70
  unlockScroll,
@@ -182,8 +181,6 @@ export default /* @__PURE__ */ _defineComponent({
182
181
  }, _createSlots({
183
182
  default: _withCtx(() => [
184
183
  _createElementVNode("div", {
185
- ref_key: "contentRef",
186
- ref: contentRef,
187
184
  class: "magic-menu-content__inner",
188
185
  "data-pointer-disabled": pointerDisabled.value
189
186
  }, [
@@ -0,0 +1,56 @@
1
+ import { type MaybeRef, type ComponentPublicInstance } from 'vue';
2
+ import type { Middleware } from '@floating-ui/vue';
3
+ import '@maas/vue-equipment/utils/css/animations/fade-in.css';
4
+ import '@maas/vue-equipment/utils/css/animations/fade-out.css';
5
+ interface MagicMenuContentProps {
6
+ arrow?: boolean | undefined;
7
+ middleware?: Middleware[];
8
+ transition?: string;
9
+ referenceEl?: MaybeRef<HTMLElement | ComponentPublicInstance>;
10
+ }
11
+ declare const viewId: string | undefined;
12
+ declare const view: import("../types").MenuView | undefined;
13
+ declare const state: import("../types").MenuState;
14
+ declare const pointerDisabled: import("vue").ComputedRef<boolean>;
15
+ declare const mappedTransition: import("vue").ComputedRef<string>;
16
+ declare const innerActive: import("vue").ShallowRef<boolean, boolean>;
17
+ declare const wrapperActive: import("vue").ShallowRef<boolean, boolean>;
18
+ declare const onBeforeEnter: () => void, onEnter: () => void, onAfterEnter: () => void, onBeforeLeave: () => void, onLeave: () => void, onAfterLeave: () => void;
19
+ declare const coords: import("vue").Ref<{
20
+ x: number;
21
+ y: number;
22
+ }[], import("../types").Coordinates[] | {
23
+ x: number;
24
+ y: number;
25
+ }[]>;
26
+ declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
27
+ declare var __VLS_13: {}, __VLS_15: {};
28
+ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
29
+ arrow?: (props: typeof __VLS_13) => any;
30
+ } & {
31
+ default?: (props: typeof __VLS_15) => any;
32
+ }>;
33
+ declare const __VLS_self: import("vue").DefineComponent<MagicMenuContentProps, {
34
+ viewId: typeof viewId;
35
+ view: typeof view;
36
+ state: typeof state;
37
+ pointerDisabled: typeof pointerDisabled;
38
+ mappedTransition: typeof mappedTransition;
39
+ innerActive: typeof innerActive;
40
+ wrapperActive: typeof wrapperActive;
41
+ onBeforeEnter: typeof onBeforeEnter;
42
+ onEnter: typeof onEnter;
43
+ onAfterEnter: typeof onAfterEnter;
44
+ onBeforeLeave: typeof onBeforeLeave;
45
+ onLeave: typeof onLeave;
46
+ onAfterLeave: typeof onAfterLeave;
47
+ coords: typeof coords;
48
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuContentProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
49
+ declare const __VLS_component: import("vue").DefineComponent<MagicMenuContentProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuContentProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
50
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
51
+ export default _default;
52
+ type __VLS_WithSlots<T, S> = T & {
53
+ new (): {
54
+ $slots: S;
55
+ };
56
+ };
@@ -7,7 +7,7 @@ const _hoisted_1 = {
7
7
  };
8
8
  const _hoisted_2 = ["points"];
9
9
  import {
10
- ref,
10
+ useTemplateRef,
11
11
  computed,
12
12
  inject,
13
13
  toValue
@@ -33,8 +33,8 @@ export default /* @__PURE__ */ _defineComponent({
33
33
  referenceEl: { type: null, required: false }
34
34
  },
35
35
  setup(__props) {
36
- const elRef = ref(void 0);
37
- const arrowRef = ref(void 0);
36
+ const elRef = useTemplateRef("el");
37
+ const arrowRef = useTemplateRef("arrow");
38
38
  const instanceId = inject(MagicMenuInstanceId, void 0);
39
39
  const viewId = inject(MagicMenuViewId, void 0);
40
40
  const { initializeState } = useMenuState(instanceId ?? "");
@@ -185,8 +185,7 @@ export default /* @__PURE__ */ _defineComponent({
185
185
  return _openBlock(), _createElementBlock(
186
186
  "div",
187
187
  {
188
- ref_key: "elRef",
189
- ref: elRef,
188
+ ref: "el",
190
189
  class: _normalizeClass(["magic-menu-float", placementClasses.value]),
191
190
  style: _normalizeStyle(_unref(floatingStyles))
192
191
  },
@@ -195,8 +194,7 @@ export default /* @__PURE__ */ _defineComponent({
195
194
  "div",
196
195
  {
197
196
  key: 0,
198
- ref_key: "arrowRef",
199
- ref: arrowRef,
197
+ ref: "arrow",
200
198
  class: "magic-menu-float__arrow",
201
199
  style: _normalizeStyle(arrowStyles.value)
202
200
  },
@@ -0,0 +1,53 @@
1
+ import { type MaybeRef, type ComponentPublicInstance } from 'vue';
2
+ import { type Placement, type Middleware } from '@floating-ui/vue';
3
+ interface MagicMenuFloatProps {
4
+ placement?: Placement;
5
+ middleware?: Middleware[];
6
+ arrow?: boolean;
7
+ referenceEl?: MaybeRef<HTMLElement | ComponentPublicInstance>;
8
+ }
9
+ declare const arrow: boolean;
10
+ declare const hasArrow: import("vue").ComputedRef<boolean>;
11
+ declare const floatingStyles: Readonly<import("vue").Ref<{
12
+ position: import("@floating-ui/vue").Strategy;
13
+ top: string;
14
+ left: string;
15
+ transform?: string;
16
+ willChange?: string;
17
+ }, {
18
+ position: import("@floating-ui/vue").Strategy;
19
+ top: string;
20
+ left: string;
21
+ transform?: string;
22
+ willChange?: string;
23
+ }>>;
24
+ declare const arrowStyles: import("vue").ComputedRef<{
25
+ transform?: undefined;
26
+ } | {
27
+ transform: string;
28
+ }>;
29
+ declare const placementClasses: import("vue").ComputedRef<string>;
30
+ declare const polygonPoints: import("vue").ComputedRef<"50,50 100,100 0,100" | "50,50 100,0 0,0" | "50,50 100,100 100,0" | "50,50 0,100 0,0" | undefined>;
31
+ declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
32
+ declare var __VLS_1: {}, __VLS_3: {};
33
+ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
34
+ arrow?: (props: typeof __VLS_1) => any;
35
+ } & {
36
+ default?: (props: typeof __VLS_3) => any;
37
+ }>;
38
+ declare const __VLS_self: import("vue").DefineComponent<MagicMenuFloatProps, {
39
+ arrow: typeof arrow;
40
+ hasArrow: typeof hasArrow;
41
+ floatingStyles: typeof floatingStyles;
42
+ arrowStyles: typeof arrowStyles;
43
+ placementClasses: typeof placementClasses;
44
+ polygonPoints: typeof polygonPoints;
45
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuFloatProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
46
+ declare const __VLS_component: import("vue").DefineComponent<MagicMenuFloatProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicMenuFloatProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
47
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
48
+ export default _default;
49
+ type __VLS_WithSlots<T, S> = T & {
50
+ new (): {
51
+ $slots: S;
52
+ };
53
+ };