@maas/vue-equipment 0.24.6 → 0.24.7

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,5 +1,5 @@
1
1
  {
2
2
  "name": "@maas/vue-equipment/nuxt",
3
3
  "configKey": "vueEquipment",
4
- "version": "0.24.5"
4
+ "version": "0.24.6"
5
5
  }
@@ -268,7 +268,7 @@ function guardedClick(event: PointerEvent) {
268
268
  }
269
269
 
270
270
  function guardedClose() {
271
- if (canClose && !disabled) {
271
+ if (canClose && !disabled.value) {
272
272
  close()
273
273
  }
274
274
  }
@@ -283,7 +283,7 @@ export function useDrawerDrag(args) {
283
283
  snapTo({
284
284
  snapPoint: payload.snapPoint,
285
285
  interpolate: true,
286
- duration: duration.value
286
+ duration: payload.duration || duration.value
287
287
  });
288
288
  }
289
289
  }
@@ -148,7 +148,7 @@ export function useDrawerSnap(args) {
148
148
  }
149
149
  }
150
150
  async function snapTo(args2) {
151
- const { snapPoint, interpolate: interpolate2, duration = 200 } = args2;
151
+ const { snapPoint, interpolate: interpolate2, duration } = args2;
152
152
  await nextTick();
153
153
  switch (position) {
154
154
  case "top":
@@ -189,7 +189,7 @@ export function useDrawerSnap(args) {
189
189
  }
190
190
  }
191
191
  async function interpolateDragged(args2) {
192
- const { to, duration = 200 } = args2;
192
+ const { to, duration = toValue(snap).duration } = args2;
193
193
  const snapPoint = snapPointsMap.value[to];
194
194
  useDrawerEmitter().emit("beforeSnap", { id: toValue(id), snapPoint });
195
195
  switch (position) {
@@ -13,7 +13,7 @@ export declare function useDrawerApi(id?: MaybeRef<string>, options?: UseDrawerA
13
13
  }>;
14
14
  open: () => void;
15
15
  close: () => void;
16
- snapTo: (snapPoint: SnapPoint) => void;
16
+ snapTo: (snapPoint: SnapPoint, duration: number) => void;
17
17
  trapFocus: () => void;
18
18
  releaseFocus: () => void;
19
19
  lockScroll: () => void;
@@ -37,8 +37,12 @@ export function useDrawerApi(id, options) {
37
37
  function close() {
38
38
  removeInstance(mappedId.value);
39
39
  }
40
- function snapTo(snapPoint) {
41
- useDrawerEmitter().emit("snapTo", { id: mappedId.value, snapPoint });
40
+ function snapTo(snapPoint, duration) {
41
+ useDrawerEmitter().emit("snapTo", {
42
+ id: mappedId.value,
43
+ snapPoint,
44
+ duration
45
+ });
42
46
  }
43
47
  function trapFocus() {
44
48
  if (focusTrap) {
@@ -48,6 +48,7 @@ export type DrawerEvents = {
48
48
  snapTo: {
49
49
  id: string;
50
50
  snapPoint: SnapPoint;
51
+ duration?: number;
51
52
  };
52
53
  afterSnap: {
53
54
  id: string;
@@ -3,7 +3,8 @@ const defaultOptions = {
3
3
  backdrop: true,
4
4
  focusTrap: {
5
5
  initialFocus: false,
6
- setReturnFocus: false
6
+ setReturnFocus: false,
7
+ allowOutsideClick: true
7
8
  },
8
9
  scrollLock: true,
9
10
  scrollLockPadding: true,
@@ -2,7 +2,8 @@ const defaultOptions = {
2
2
  backdrop: true,
3
3
  focusTrap: {
4
4
  initialFocus: false,
5
- setReturnFocus: false
5
+ setReturnFocus: false,
6
+ allowOutsideClick: true
6
7
  },
7
8
  scrollLock: true,
8
9
  scrollLockPadding: true,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maas/vue-equipment",
3
3
  "description": "A magic collection of Vue composables, plugins, components and directives",
4
- "version": "0.24.6",
4
+ "version": "0.24.7",
5
5
  "author": "Robin Scholz <https://github.com/robinscholz>, Christoph Jeworutzki <https://github.com/ChristophJeworutzki>",
6
6
  "devDependencies": {
7
7
  "@antfu/ni": "^0.21.12",