@maas/vue-equipment 1.0.0-beta.59 → 1.0.0-beta.60

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.58",
4
+ "version": "1.0.0-beta.59",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -32,7 +32,7 @@ const functions$1 = [
32
32
  {
33
33
  name: "MagicDrawer",
34
34
  "package": "plugins",
35
- lastUpdated: 1716533739000,
35
+ lastUpdated: 1780407194000,
36
36
  docs: "https://maas.egineering/vue-equipment/plugins/MagicDrawer/",
37
37
  description: "MagicDrawer is a flexible"
38
38
  },
@@ -67,7 +67,7 @@ const functions$1 = [
67
67
  {
68
68
  name: "MagicModal",
69
69
  "package": "plugins",
70
- lastUpdated: 1716533739000,
70
+ lastUpdated: 1780410511000,
71
71
  docs: "https://maas.egineering/vue-equipment/plugins/MagicModal/",
72
72
  description: "MagicModal is a flexible"
73
73
  },
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <magic-drawer-provider :id="id" :options="options">
3
3
  <magic-drawer-teleport>
4
- <magic-drawer-backdrop v-if="showBackdrop">
4
+ <magic-drawer-backdrop>
5
5
  <slot name="backdrop" />
6
6
  </magic-drawer-backdrop>
7
7
  <magic-drawer-content v-bind="$attrs">
@@ -12,8 +12,7 @@
12
12
  </template>
13
13
 
14
14
  <script setup>
15
- import { computed, useSlots } from "vue";
16
- import { useDrawerState } from "../composables/private/useDrawerState";
15
+ import {} from "vue";
17
16
  import MagicDrawerProvider from "./MagicDrawerProvider.vue";
18
17
  import MagicDrawerTeleport from "./MagicDrawerTeleport.vue";
19
18
  import MagicDrawerBackdrop from "./MagicDrawerBackdrop.vue";
@@ -25,8 +24,4 @@ const { options, id } = defineProps({
25
24
  id: { type: null, required: true },
26
25
  options: { type: Object, required: false }
27
26
  });
28
- const slots = useSlots();
29
- const { initializeState } = useDrawerState(id);
30
- const state = initializeState(options);
31
- const showBackdrop = computed(() => state.options?.backdrop || !!slots.backdrop);
32
27
  </script>
@@ -1,10 +1,13 @@
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
+ interface MagicDrawerBackdropProps {
4
+ transition?: string;
5
+ }
3
6
  declare var __VLS_6: {};
4
7
  type __VLS_Slots = {} & {
5
8
  default?: (props: typeof __VLS_6) => any;
6
9
  };
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>;
10
+ declare const __VLS_base: import("vue").DefineComponent<MagicDrawerBackdropProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicDrawerBackdropProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
11
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
9
12
  declare const _default: typeof __VLS_export;
10
13
  export default _default;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <transition :name="state.options.transition.backdrop">
2
+ <transition :name="transitionName">
3
3
  <div
4
4
  v-show="active.innerActive"
5
5
  class="magic-drawer-backdrop"
@@ -12,7 +12,7 @@
12
12
  </template>
13
13
 
14
14
  <script setup>
15
- import { inject } from "vue";
15
+ import { inject, computed } from "vue";
16
16
  import {
17
17
  useMagicError
18
18
  } from "@maas/vue-equipment/plugins/MagicError";
@@ -21,6 +21,9 @@ import { useDrawerState } from "../composables/private/useDrawerState";
21
21
  import { MagicDrawerInstanceId, MagicDrawerActiveKey } from "../symbols";
22
22
  import "@maas/vue-equipment/utils/css/keyframes/fade-in.css";
23
23
  import "@maas/vue-equipment/utils/css/keyframes/fade-out.css";
24
+ const { transition } = defineProps({
25
+ transition: { type: String, required: false }
26
+ });
24
27
  const instanceId = inject(MagicDrawerInstanceId, void 0);
25
28
  const active = inject(MagicDrawerActiveKey, {
26
29
  wrapperActive: false,
@@ -36,6 +39,9 @@ magicError.assert(instanceId, {
36
39
  });
37
40
  const { initializeState } = useDrawerState(instanceId ?? "");
38
41
  const state = initializeState();
42
+ const transitionName = computed(
43
+ () => transition ?? state.options.transition.backdrop
44
+ );
39
45
  const { close } = useMagicDrawer(instanceId ?? "");
40
46
  function guardedClose() {
41
47
  if (!state.options.disabled) {
@@ -1,10 +1,13 @@
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
+ interface MagicDrawerBackdropProps {
4
+ transition?: string;
5
+ }
3
6
  declare var __VLS_6: {};
4
7
  type __VLS_Slots = {} & {
5
8
  default?: (props: typeof __VLS_6) => any;
6
9
  };
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>;
10
+ declare const __VLS_base: import("vue").DefineComponent<MagicDrawerBackdropProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicDrawerBackdropProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
11
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
9
12
  declare const _default: typeof __VLS_export;
10
13
  export default _default;
@@ -2,7 +2,6 @@ import { type Options as FocusTrapOptions } from 'focus-trap';
2
2
  export type DrawerSnapPoint = number | `${number}px`;
3
3
  export interface MagicDrawerOptions {
4
4
  position?: 'top' | 'right' | 'bottom' | 'left';
5
- backdrop?: boolean;
6
5
  tag?: 'dialog' | 'div';
7
6
  focusTrap?: boolean | FocusTrapOptions;
8
7
  scrollLock?: boolean | {
@@ -1,6 +1,5 @@
1
1
  const defaultOptions = {
2
2
  position: "bottom",
3
- backdrop: true,
4
3
  tag: "dialog",
5
4
  focusTrap: {
6
5
  initialFocus: false,
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <magic-modal-provider :id="id" :options="options">
3
3
  <magic-modal-teleport>
4
- <magic-modal-backdrop v-if="showBackdrop">
4
+ <magic-modal-backdrop>
5
5
  <slot name="backdrop" />
6
6
  </magic-modal-backdrop>
7
7
  <magic-modal-content v-bind="$attrs">
@@ -12,8 +12,7 @@
12
12
  </template>
13
13
 
14
14
  <script setup>
15
- import { computed, useSlots } from "vue";
16
- import { useModalState } from "../composables/private/useModalState";
15
+ import {} from "vue";
17
16
  import MagicModalProvider from "./MagicModalProvider.vue";
18
17
  import MagicModalTeleport from "./MagicModalTeleport.vue";
19
18
  import MagicModalBackdrop from "./MagicModalBackdrop.vue";
@@ -25,8 +24,4 @@ const { options, id } = defineProps({
25
24
  id: { type: null, required: true },
26
25
  options: { type: Object, required: false }
27
26
  });
28
- const slots = useSlots();
29
- const { initializeState } = useModalState(id);
30
- const state = initializeState(options);
31
- const showBackdrop = computed(() => state.options?.backdrop || !!slots.backdrop);
32
27
  </script>
@@ -1,10 +1,13 @@
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
+ interface MagicModalBackdropProps {
4
+ transition?: string;
5
+ }
3
6
  declare var __VLS_6: {};
4
7
  type __VLS_Slots = {} & {
5
8
  default?: (props: typeof __VLS_6) => any;
6
9
  };
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>;
10
+ declare const __VLS_base: import("vue").DefineComponent<MagicModalBackdropProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicModalBackdropProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
11
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
9
12
  declare const _default: typeof __VLS_export;
10
13
  export default _default;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <transition :name="state.options.transition.backdrop">
2
+ <transition :name="transitionName">
3
3
  <div
4
4
  v-show="active.innerActive"
5
5
  class="magic-modal-backdrop"
@@ -11,7 +11,7 @@
11
11
  </template>
12
12
 
13
13
  <script setup>
14
- import { inject } from "vue";
14
+ import { inject, computed } from "vue";
15
15
  import {
16
16
  useMagicError
17
17
  } from "@maas/vue-equipment/plugins/MagicError";
@@ -20,6 +20,9 @@ import { useModalState } from "../composables/private/useModalState";
20
20
  import { MagicModalInstanceId, MagicModalActiveKey } from "../symbols";
21
21
  import "@maas/vue-equipment/utils/css/keyframes/fade-in.css";
22
22
  import "@maas/vue-equipment/utils/css/keyframes/fade-out.css";
23
+ const { transition } = defineProps({
24
+ transition: { type: String, required: false }
25
+ });
23
26
  const instanceId = inject(MagicModalInstanceId, void 0);
24
27
  const active = inject(MagicModalActiveKey, {
25
28
  wrapperActive: false,
@@ -35,6 +38,9 @@ magicError.assert(instanceId, {
35
38
  });
36
39
  const { initializeState } = useModalState(instanceId ?? "");
37
40
  const state = initializeState();
41
+ const transitionName = computed(
42
+ () => transition ?? state.options.transition.backdrop
43
+ );
38
44
  const { close } = useMagicModal(instanceId ?? "");
39
45
  function guardedClose() {
40
46
  close();
@@ -1,10 +1,13 @@
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
+ interface MagicModalBackdropProps {
4
+ transition?: string;
5
+ }
3
6
  declare var __VLS_6: {};
4
7
  type __VLS_Slots = {} & {
5
8
  default?: (props: typeof __VLS_6) => any;
6
9
  };
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>;
10
+ declare const __VLS_base: import("vue").DefineComponent<MagicModalBackdropProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MagicModalBackdropProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
11
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
9
12
  declare const _default: typeof __VLS_export;
10
13
  export default _default;
@@ -1,6 +1,5 @@
1
1
  import { type Options as FocusTrapOptions } from 'focus-trap';
2
2
  export interface MagicModalOptions {
3
- backdrop?: boolean;
4
3
  tag?: 'dialog' | 'div';
5
4
  focusTrap?: boolean | FocusTrapOptions;
6
5
  scrollLock?: boolean | {
@@ -1,5 +1,4 @@
1
1
  const defaultOptions = {
2
- backdrop: true,
3
2
  tag: "dialog",
4
3
  focusTrap: {
5
4
  initialFocus: false,
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.59",
4
+ "version": "1.0.0-beta.60",
5
5
  "contributors": [
6
6
  {
7
7
  "name": "Robin Scholz",