@effect-app/vue-components 1.6.3 → 1.6.5

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.
@@ -4,7 +4,7 @@ export type DialogClosing = {
4
4
  };
5
5
  export declare const injectBus: () => import("mitt").Emitter<{
6
6
  "dialog-closing": DialogClosing;
7
- }> | undefined;
7
+ }> | null;
8
8
  export declare const provideBus: () => import("mitt").Emitter<{
9
9
  "dialog-closing": DialogClosing;
10
10
  }>;
@@ -1,27 +1,27 @@
1
1
  import r from "./vue-components.es21.js";
2
2
  import { inject as c, provide as l } from "vue";
3
3
  import { onMountedWithCleanup as u } from "./vue-components.es22.js";
4
- const f = () => r(), i = Symbol("dialog"), p = () => c(i), g = () => {
5
- const n = f();
6
- return l(i, n), n;
7
- }, d = (n) => {
4
+ const f = () => r(), i = Symbol("DialogBus"), p = () => c(i, null), g = () => {
5
+ const e = f();
6
+ return l(i, e), e;
7
+ }, d = (e) => {
8
8
  const o = p();
9
9
  if (!o)
10
10
  return;
11
- const s = n();
11
+ const s = e();
12
12
  u(() => {
13
- const e = (t) => {
13
+ const n = (t) => {
14
14
  s.value && (confirm("Es sind ungespeicherte Änderungen vorhanden. Wirklich schließen?") || (t.prevent = !0));
15
15
  };
16
- return o.on("dialog-closing", e), () => o.off("dialog-closing", e);
16
+ return o.on("dialog-closing", n), () => o.off("dialog-closing", n);
17
17
  });
18
- }, h = (n) => {
18
+ }, h = (e) => {
19
19
  const o = g();
20
20
  return () => {
21
- const e = {};
22
- o.emit("dialog-closing", e), e.prevent ? typeof e.prevent == "object" && "then" in e.prevent && e.prevent.then((t) => {
23
- t !== !1 && n();
24
- }) : n();
21
+ const n = {};
22
+ o.emit("dialog-closing", n), n.prevent ? typeof n.prevent == "object" && "then" in n.prevent && n.prevent.then((t) => {
23
+ t !== !1 && e();
24
+ }) : e();
25
25
  };
26
26
  };
27
27
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect-app/vue-components",
3
- "version": "1.6.3",
3
+ "version": "1.6.5",
4
4
  "peerDependencies": {
5
5
  "@mdi/js": "^7.4.47",
6
6
  "effect": "^3.18.0",
@@ -51,8 +51,8 @@
51
51
  "highlight.js": "^11.11.1",
52
52
  "mitt": "^3.0.1",
53
53
  "vue3-highlightjs": "^1.0.5",
54
- "@effect-app/vue": "2.84.1",
55
- "effect-app": "3.10.0"
54
+ "@effect-app/vue": "2.84.2",
55
+ "effect-app": "3.10.1"
56
56
  },
57
57
  "scripts": {
58
58
  "build": "pnpm build:run",
@@ -5,9 +5,9 @@ import { onMountedWithCleanup } from "./onMountedWithCleanup"
5
5
  export type DialogClosing = { prevent?: boolean | Promise<boolean> }
6
6
  const makeBus = () => mitt<{ "dialog-closing": DialogClosing }>()
7
7
 
8
- const Bus = Symbol("dialog") as InjectionKey<ReturnType<typeof makeBus>>
8
+ const Bus = Symbol("DialogBus") as InjectionKey<ReturnType<typeof makeBus>>
9
9
 
10
- export const injectBus = () => inject(Bus)
10
+ export const injectBus = () => inject(Bus, null)
11
11
  export const provideBus = () => {
12
12
  const bus = makeBus()
13
13
  provide(Bus, bus)