@maas/vue-equipment 1.0.0-beta.62 → 1.0.0-beta.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maas/vue-equipment/nuxt",
3
3
  "configKey": "vueEquipment",
4
- "version": "1.0.0-beta.61",
4
+ "version": "1.0.0-beta.63",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -11,11 +11,11 @@ type __VLS_Slots = {} & {
11
11
  default?: (props: typeof __VLS_1) => any;
12
12
  };
13
13
  declare const __VLS_base: import("vue").DefineComponent<MagicCommandItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
- click: (event: MouseEvent) => any;
15
14
  enter: () => any;
15
+ click: (event: MouseEvent) => any;
16
16
  }, string, import("vue").PublicProps, Readonly<MagicCommandItemProps> & Readonly<{
17
- onClick?: ((event: MouseEvent) => any) | undefined;
18
17
  onEnter?: (() => any) | undefined;
18
+ onClick?: ((event: MouseEvent) => any) | undefined;
19
19
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
20
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
21
21
  declare const _default: typeof __VLS_export;
@@ -11,11 +11,11 @@ type __VLS_Slots = {} & {
11
11
  default?: (props: typeof __VLS_1) => any;
12
12
  };
13
13
  declare const __VLS_base: import("vue").DefineComponent<MagicCommandItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
- click: (event: MouseEvent) => any;
15
14
  enter: () => any;
15
+ click: (event: MouseEvent) => any;
16
16
  }, string, import("vue").PublicProps, Readonly<MagicCommandItemProps> & Readonly<{
17
- onClick?: ((event: MouseEvent) => any) | undefined;
18
17
  onEnter?: (() => any) | undefined;
18
+ onClick?: ((event: MouseEvent) => any) | undefined;
19
19
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
20
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
21
21
  declare const _default: typeof __VLS_export;
@@ -10,11 +10,11 @@ type __VLS_Slots = {} & {
10
10
  default?: (props: typeof __VLS_1) => any;
11
11
  };
12
12
  declare const __VLS_base: import("vue").DefineComponent<MagicMenuItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
13
- click: (event: MouseEvent) => any;
14
13
  enter: () => any;
14
+ click: (event: MouseEvent) => any;
15
15
  }, string, import("vue").PublicProps, Readonly<MagicMenuItemProps> & Readonly<{
16
- onClick?: ((event: MouseEvent) => any) | undefined;
17
16
  onEnter?: (() => any) | undefined;
17
+ onClick?: ((event: MouseEvent) => any) | undefined;
18
18
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
19
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
20
20
  declare const _default: typeof __VLS_export;
@@ -10,11 +10,11 @@ type __VLS_Slots = {} & {
10
10
  default?: (props: typeof __VLS_1) => any;
11
11
  };
12
12
  declare const __VLS_base: import("vue").DefineComponent<MagicMenuItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
13
- click: (event: MouseEvent) => any;
14
13
  enter: () => any;
14
+ click: (event: MouseEvent) => any;
15
15
  }, string, import("vue").PublicProps, Readonly<MagicMenuItemProps> & Readonly<{
16
- onClick?: ((event: MouseEvent) => any) | undefined;
17
16
  onEnter?: (() => any) | undefined;
17
+ onClick?: ((event: MouseEvent) => any) | undefined;
18
18
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
19
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
20
20
  declare const _default: typeof __VLS_export;
@@ -1,8 +1,8 @@
1
1
  import '@maas/vue-equipment/utils/css/keyframes/fade-in.css';
2
2
  import '@maas/vue-equipment/utils/css/keyframes/fade-out.css';
3
- declare var __VLS_22: {};
3
+ declare var __VLS_24: {};
4
4
  type __VLS_Slots = {} & {
5
- default?: (props: typeof __VLS_22) => any;
5
+ default?: (props: typeof __VLS_24) => any;
6
6
  };
7
7
  declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
8
8
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -18,7 +18,9 @@
18
18
  :is="state.options.tag"
19
19
  v-show="active.innerActive"
20
20
  class="magic-modal-content__inner"
21
- @click.self="guardedClose"
21
+ @pointerdown="onPointerdown"
22
+ @touchstart="onTouchstart"
23
+ @click.self="guardedClick"
22
24
  >
23
25
  <slot />
24
26
  </component>
@@ -76,8 +78,17 @@ const {
76
78
  releaseFocus,
77
79
  active
78
80
  });
79
- function guardedClose() {
80
- close();
81
+ let target = void 0;
82
+ function onPointerdown(e) {
83
+ target = e.target;
84
+ }
85
+ function onTouchstart(e) {
86
+ target = e.target;
87
+ }
88
+ function guardedClick(e) {
89
+ if (e.currentTarget === target) {
90
+ close();
91
+ }
81
92
  }
82
93
  onUnmounted(() => {
83
94
  if (state.options.scrollLock) {
@@ -88,6 +99,7 @@ onUnmounted(() => {
88
99
  if (state.options.focusTrap) {
89
100
  releaseFocus();
90
101
  }
102
+ target = void 0;
91
103
  });
92
104
  </script>
93
105
 
@@ -1,8 +1,8 @@
1
1
  import '@maas/vue-equipment/utils/css/keyframes/fade-in.css';
2
2
  import '@maas/vue-equipment/utils/css/keyframes/fade-out.css';
3
- declare var __VLS_22: {};
3
+ declare var __VLS_24: {};
4
4
  type __VLS_Slots = {} & {
5
- default?: (props: typeof __VLS_22) => any;
5
+ default?: (props: typeof __VLS_24) => any;
6
6
  };
7
7
  declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
8
8
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,4 +1,5 @@
1
1
  import {
2
+ computed,
2
3
  shallowRef,
3
4
  inject,
4
5
  toValue
@@ -22,7 +23,9 @@ export function useScrollApi(args) {
22
23
  };
23
24
  const childBoundingRect = useElementBounding(child);
24
25
  const parentBoundingRect = useElementBounding(parent);
25
- const mappedParentBoundingRect = toValue(parent) ? parentBoundingRect : windowBoundingRect;
26
+ const mappedParentBoundingRect = computed(
27
+ () => toValue(parent) ? parentBoundingRect : windowBoundingRect
28
+ );
26
29
  function splitLocation(location) {
27
30
  return {
28
31
  child: location.match(/^[a-z]+/)[0],
@@ -32,8 +35,8 @@ export function useScrollApi(args) {
32
35
  function getOffsetTop(points) {
33
36
  let y = 0;
34
37
  const scrollY = toValue(scrollReturn?.y) || 0;
35
- const parentTop = mappedParentBoundingRect.top.value;
36
- const parentHeight = mappedParentBoundingRect.height.value;
38
+ const parentTop = mappedParentBoundingRect.value.top.value;
39
+ const parentHeight = mappedParentBoundingRect.value.height.value;
37
40
  const childTop = childBoundingRect.top.value;
38
41
  const childHeight = childBoundingRect.height.value;
39
42
  if (!childHeight) {
@@ -50,7 +53,7 @@ export function useScrollApi(args) {
50
53
  y += childTop + childHeight + scrollY;
51
54
  break;
52
55
  }
53
- if (!mappedParentBoundingRect.height.value) {
56
+ if (!parentHeight) {
54
57
  return y;
55
58
  }
56
59
  switch (points.parent) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maas/vue-equipment",
3
3
  "description": "Our Frontend Toolkit, Free and Open Source",
4
- "version": "1.0.0-beta.62",
4
+ "version": "1.0.0-beta.64",
5
5
  "contributors": [
6
6
  {
7
7
  "name": "Robin Scholz",
@@ -1 +0,0 @@
1
- export { useModalState } from './useModalState.js';
@@ -1 +0,0 @@
1
- export { useModalState } from "./useModalState.mjs";