@finema/core 2.26.1 → 2.26.2

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.
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "2.26.1",
3
+ "version": "2.26.2",
4
4
  "configKey": "core",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.1",
package/dist/module.mjs CHANGED
@@ -4,7 +4,7 @@ import * as lodash from 'lodash-es';
4
4
  import * as theme from '../dist/runtime/theme/index.js';
5
5
 
6
6
  const name = "@finema/core";
7
- const version = "2.26.1";
7
+ const version = "2.26.2";
8
8
 
9
9
  const nuxtAppOptions = {
10
10
  head: {
@@ -10,8 +10,9 @@ export var DialogType = /* @__PURE__ */ ((DialogType2) => {
10
10
  })(DialogType || {});
11
11
  export const useDialog = () => {
12
12
  const overlay = useOverlay();
13
- const modal = overlay.create(Dialog);
13
+ const modalLoading = overlay.create(Dialog);
14
14
  const openDialog = async (payload) => {
15
+ const modal = overlay.create(Dialog);
15
16
  const result = await modal.open(payload);
16
17
  const res = await result.result;
17
18
  return new Promise((resolve, reject) => {
@@ -54,14 +55,21 @@ export const useDialog = () => {
54
55
  });
55
56
  };
56
57
  const loading = async (payload = {}) => {
57
- return openDialog({
58
+ const result = await modalLoading.open({
58
59
  ...payload,
59
60
  title: payload.title || "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14...",
60
61
  type: "loading" /* LOADING */
61
62
  });
63
+ const res = await result.result;
64
+ return new Promise((resolve, reject) => {
65
+ if (res) {
66
+ resolve(true);
67
+ }
68
+ reject(false);
69
+ });
62
70
  };
63
71
  const close = async () => {
64
- return modal.close();
72
+ return modalLoading.close();
65
73
  };
66
74
  return {
67
75
  error,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "2.26.1",
3
+ "version": "2.26.2",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Dev Core Team",