@quidgest/ui 0.16.57 → 0.16.59

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,21 +1,28 @@
1
- import { reactive as r } from "vue";
2
- import { useId as s } from "../uid.js";
3
- const i = r({ dialogs: [] });
4
- function c() {
5
- function n(e, o, d) {
6
- const t = s(o).value;
7
- return i.dialogs.push({ id: t, props: { ...e, modelValue: !0 }, options: d }), t;
1
+ import { reactive as s } from "vue";
2
+ import { useId as g } from "../uid.js";
3
+ const t = s({ dialogs: [] });
4
+ function m() {
5
+ function r(n, e, u, o) {
6
+ const i = g(e).value;
7
+ return t.dialogs.push({
8
+ id: i,
9
+ props: { ...n, modelValue: !0 },
10
+ options: u,
11
+ handlers: o
12
+ }), o != null && o.onEnter && o.onEnter(), i;
8
13
  }
9
- function a(e) {
10
- const o = i.dialogs.findIndex((d) => d.id === e);
11
- o !== -1 && i.dialogs.splice(o, 1);
14
+ function a(n) {
15
+ var o, i, d;
16
+ const e = t.dialogs.findIndex((l) => l.id === n);
17
+ if (e === -1) return;
18
+ (((d = (i = (o = t.dialogs[e]) == null ? void 0 : o.handlers) == null ? void 0 : i.onLeave) == null ? void 0 : d.call(i)) ?? !0) && t.dialogs.splice(e, 1);
12
19
  }
13
20
  return {
14
- ...i,
15
- addDialog: n,
21
+ ...t,
22
+ addDialog: r,
16
23
  removeDialog: a
17
24
  };
18
25
  }
19
26
  export {
20
- c as useDialog
27
+ m as useDialog
21
28
  };
@@ -1,4 +1,4 @@
1
- import { QDialogProps, QDialogOptions } from '../../components/QDialog/types.ts';
1
+ import { QDialogProps, QDialogOptions, QDialogHandlers } from '../../components/QDialog/types.ts';
2
2
  /**
3
3
  * Represents an instance of a dialog component.
4
4
  */
@@ -15,6 +15,10 @@ export type DialogInstance = {
15
15
  * The options applied to the dialog, conforming to `QDialogOptions`.
16
16
  */
17
17
  options?: QDialogOptions;
18
+ /**
19
+ * Event handlers, conforming to `QDialogHandlers`.
20
+ */
21
+ handlers?: QDialogHandlers;
18
22
  };
19
23
  /**
20
24
  * Represents the state for dialog management.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/composables/useDialog/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAErF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,KAAK,EAAE,YAAY,CAAA;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;CACxB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACzB;;OAEG;IACH,OAAO,EAAE,cAAc,EAAE,CAAA;CACzB,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/composables/useDialog/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,YAAY,EACZ,cAAc,EACd,eAAe,EACf,MAAM,mCAAmC,CAAA;AAE1C;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,KAAK,EAAE,YAAY,CAAA;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAA;CAC1B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACzB;;OAEG;IACH,OAAO,EAAE,cAAc,EAAE,CAAA;CACzB,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@quidgest/ui",
3
3
  "description": "Quidgest's UI framework",
4
- "version": "0.16.57",
4
+ "version": "0.16.59",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "author": "Quidgest",