@duxweb/dvha-core 1.0.23 → 1.0.24

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.
Files changed (85) hide show
  1. package/dist/cjs/components/auth/can.cjs +1 -1
  2. package/dist/cjs/components/loader/iframe.cjs +1 -1
  3. package/dist/cjs/components/loader/remote/loader.cjs +1 -1
  4. package/dist/cjs/components/loader/remote/render.cjs +1 -1
  5. package/dist/cjs/components/overlay/overlay.cjs +1 -1
  6. package/dist/cjs/components/status/exception.cjs +1 -1
  7. package/dist/cjs/directive/permission.cjs +1 -1
  8. package/dist/cjs/hooks/auth.cjs +1 -1
  9. package/dist/cjs/hooks/data.cjs +1 -1
  10. package/dist/cjs/hooks/export.cjs +1 -1
  11. package/dist/cjs/hooks/exportCsv.cjs +2 -2
  12. package/dist/cjs/hooks/form.cjs +1 -1
  13. package/dist/cjs/hooks/formExtend.cjs +1 -1
  14. package/dist/cjs/hooks/i18n.cjs +1 -1
  15. package/dist/cjs/hooks/import.cjs +1 -1
  16. package/dist/cjs/hooks/importCsv.cjs +2 -2
  17. package/dist/cjs/hooks/json/utils/expressionParser.cjs +1 -1
  18. package/dist/cjs/hooks/json/vFor.cjs +1 -1
  19. package/dist/cjs/hooks/json/vOn.cjs +1 -1
  20. package/dist/cjs/hooks/json/vShow.cjs +1 -1
  21. package/dist/cjs/hooks/json.cjs +1 -1
  22. package/dist/cjs/hooks/list.cjs +1 -1
  23. package/dist/cjs/hooks/manage.cjs +1 -1
  24. package/dist/cjs/hooks/menu.cjs +1 -1
  25. package/dist/cjs/hooks/select.cjs +1 -1
  26. package/dist/cjs/hooks/theme.cjs +3 -3
  27. package/dist/cjs/hooks/tree.cjs +1 -1
  28. package/dist/cjs/hooks/upload/s3.cjs +1 -1
  29. package/dist/cjs/hooks/upload.cjs +1 -1
  30. package/dist/cjs/preset/authProvider.cjs +1 -1
  31. package/dist/cjs/preset/dataProvider.cjs +1 -1
  32. package/dist/cjs/preset/i18nProvider.cjs +1 -1
  33. package/dist/cjs/provider/app.cjs +1 -1
  34. package/dist/cjs/router/route.cjs +1 -1
  35. package/dist/cjs/stores/auth.cjs +1 -1
  36. package/dist/cjs/stores/i18n.cjs +1 -1
  37. package/dist/cjs/stores/jsonSchema.cjs +1 -1
  38. package/dist/cjs/stores/manage.cjs +1 -1
  39. package/dist/cjs/stores/route.cjs +1 -1
  40. package/dist/cjs/stores/tab.cjs +1 -1
  41. package/dist/cjs/stores/theme.cjs +1 -1
  42. package/dist/cjs/utils/tree.cjs +1 -1
  43. package/dist/esm/components/auth/can.js +8 -11
  44. package/dist/esm/components/loader/iframe.js +14 -17
  45. package/dist/esm/components/loader/remote/loader.js +103 -105
  46. package/dist/esm/components/loader/remote/render.js +10 -11
  47. package/dist/esm/components/overlay/overlay.js +7 -7
  48. package/dist/esm/components/status/exception.js +10 -13
  49. package/dist/esm/directive/permission.js +6 -7
  50. package/dist/esm/hooks/auth.js +73 -83
  51. package/dist/esm/hooks/data.js +290 -345
  52. package/dist/esm/hooks/export.js +16 -17
  53. package/dist/esm/hooks/exportCsv.js +26 -27
  54. package/dist/esm/hooks/form.js +49 -54
  55. package/dist/esm/hooks/formExtend.js +24 -25
  56. package/dist/esm/hooks/i18n.js +11 -29
  57. package/dist/esm/hooks/import.js +31 -32
  58. package/dist/esm/hooks/importCsv.js +24 -25
  59. package/dist/esm/hooks/json/utils/expressionParser.js +36 -42
  60. package/dist/esm/hooks/json/vFor.js +15 -16
  61. package/dist/esm/hooks/json/vOn.js +17 -18
  62. package/dist/esm/hooks/json/vShow.js +9 -10
  63. package/dist/esm/hooks/json.js +88 -94
  64. package/dist/esm/hooks/list.js +100 -127
  65. package/dist/esm/hooks/manage.js +13 -17
  66. package/dist/esm/hooks/menu.js +39 -52
  67. package/dist/esm/hooks/select.js +35 -40
  68. package/dist/esm/hooks/theme.js +127 -141
  69. package/dist/esm/hooks/tree.js +22 -28
  70. package/dist/esm/hooks/upload/s3.js +22 -23
  71. package/dist/esm/hooks/upload.js +152 -159
  72. package/dist/esm/preset/authProvider.js +63 -117
  73. package/dist/esm/preset/dataProvider.js +69 -76
  74. package/dist/esm/preset/i18nProvider.js +18 -18
  75. package/dist/esm/provider/app.js +74 -81
  76. package/dist/esm/router/route.js +16 -24
  77. package/dist/esm/stores/auth.js +17 -20
  78. package/dist/esm/stores/i18n.js +10 -10
  79. package/dist/esm/stores/jsonSchema.js +20 -23
  80. package/dist/esm/stores/manage.js +33 -33
  81. package/dist/esm/stores/route.js +38 -50
  82. package/dist/esm/stores/tab.js +38 -54
  83. package/dist/esm/stores/theme.js +28 -29
  84. package/dist/esm/utils/tree.js +23 -24
  85. package/package.json +1 -1
@@ -1,38 +1,35 @@
1
1
  import { defineStore as u } from "pinia";
2
- import { inject as c, ref as d } from "vue";
3
- function x(e) {
4
- const o = c("dux.manage");
5
- if (e || (e = (o == null ? void 0 : o.value) || ""), !e)
2
+ import { inject as r, ref as s } from "vue";
3
+ function k(e) {
4
+ const o = r("dux.manage");
5
+ if (e || (e = o?.value || ""), !e)
6
6
  throw new Error("manage not found");
7
- return f(e)();
7
+ return c(e)();
8
8
  }
9
- function f(e) {
9
+ function c(e) {
10
10
  return u(`auths-${e}`, () => {
11
- const o = d();
11
+ const o = s();
12
12
  return {
13
13
  data: o,
14
14
  getUser: () => o.value || {},
15
15
  login: (t) => {
16
16
  o.value = {
17
- token: t == null ? void 0 : t.token,
18
- id: t == null ? void 0 : t.id,
19
- info: t == null ? void 0 : t.info,
20
- permission: t == null ? void 0 : t.permission
17
+ token: t?.token,
18
+ id: t?.id,
19
+ info: t?.info,
20
+ permission: t?.permission
21
21
  };
22
22
  },
23
- isLogin: () => {
24
- var t;
25
- return !!((t = o.value) != null && t.token);
26
- },
23
+ isLogin: () => !!o.value?.token,
27
24
  logout: () => {
28
25
  o.value = void 0;
29
26
  },
30
27
  update: (t) => {
31
28
  o.value = {
32
- token: t == null ? void 0 : t.token,
33
- id: t == null ? void 0 : t.id,
34
- info: t == null ? void 0 : t.info,
35
- permission: t == null ? void 0 : t.permission
29
+ token: t?.token,
30
+ id: t?.id,
31
+ info: t?.info,
32
+ permission: t?.permission
36
33
  };
37
34
  },
38
35
  updateKey: (t, i) => {
@@ -47,5 +44,5 @@ function f(e) {
47
44
  });
48
45
  }
49
46
  export {
50
- x as useAuthStore
47
+ k as useAuthStore
51
48
  };
@@ -1,24 +1,24 @@
1
1
  import { defineStore as i } from "pinia";
2
2
  import { inject as c, ref as r } from "vue";
3
- function p(e) {
4
- const t = c("dux.manage");
5
- if (e || (e = (t == null ? void 0 : t.value) || ""), !e)
3
+ function p(t) {
4
+ const e = c("dux.manage");
5
+ if (t || (t = e?.value || ""), !t)
6
6
  throw new Error("manage not found");
7
- return u(e)();
7
+ return u(t)();
8
8
  }
9
- function u(e) {
10
- return i(`i18n-${e}`, () => {
11
- const t = r(""), n = r(!1);
9
+ function u(t) {
10
+ return i(`i18n-${t}`, () => {
11
+ const e = r(""), n = r(!1);
12
12
  return {
13
- lang: t,
13
+ lang: e,
14
14
  isInit: () => {
15
15
  const o = n.value;
16
16
  return n.value = !0, o;
17
17
  },
18
18
  setLocale: (o) => {
19
- t.value = o;
19
+ e.value = o;
20
20
  },
21
- getLocale: () => t.value
21
+ getLocale: () => e.value
22
22
  };
23
23
  }, {
24
24
  persist: {
@@ -1,34 +1,31 @@
1
1
  import { defineStore as u } from "pinia";
2
- import { inject as h, ref as a } from "vue";
3
- function d(o) {
2
+ import { inject as h, ref as c } from "vue";
3
+ function d(t) {
4
4
  const e = h("dux.manage");
5
- if (o || (o = (e == null ? void 0 : e.value) || ""), !o)
5
+ if (t || (t = e?.value || ""), !t)
6
6
  throw new Error("manage not found");
7
- return i(o)();
7
+ return m(t)();
8
8
  }
9
- function i(o) {
10
- return u(`jsonSchema-${o}`, () => {
11
- const e = a(/* @__PURE__ */ new Map()), r = a(/* @__PURE__ */ new Map());
9
+ function m(t) {
10
+ return u(`jsonSchema-${t}`, () => {
11
+ const e = c(/* @__PURE__ */ new Map()), o = c(/* @__PURE__ */ new Map());
12
12
  return {
13
13
  componentCache: e,
14
- componentsByName: r,
15
- addComponent: (t, n, s) => {
16
- const c = n;
17
- return e.value.has(c) || (e.value.set(c, {
18
- component: t,
19
- name: n,
20
- originalName: s || n,
21
- cacheKey: c
22
- }), r.value.set(n, t)), c;
14
+ componentsByName: o,
15
+ addComponent: (n, r, s) => {
16
+ const a = r;
17
+ return e.value.has(a) || (e.value.set(a, {
18
+ component: n,
19
+ name: r,
20
+ originalName: s || r,
21
+ cacheKey: a
22
+ }), o.value.set(r, n)), a;
23
23
  },
24
- getComponent: (t) => {
25
- var n;
26
- return (n = e.value.get(t)) == null ? void 0 : n.component;
27
- },
28
- getComponentByName: (t) => r.value.get(t),
29
- hasComponent: (t) => e.value.has(t),
24
+ getComponent: (n) => e.value.get(n)?.component,
25
+ getComponentByName: (n) => o.value.get(n),
26
+ hasComponent: (n) => e.value.has(n),
30
27
  clearCache: () => {
31
- e.value.clear(), r.value.clear();
28
+ e.value.clear(), o.value.clear();
32
29
  },
33
30
  getCacheSize: () => e.value.size
34
31
  };
@@ -1,48 +1,48 @@
1
- import { cloneDeep as P } from "lodash-es";
2
- import { defineStore as h } from "pinia";
3
- import { inject as m, ref as p, markRaw as y } from "vue";
4
- function v(e) {
5
- return e != null && typeof e == "object" && !Array.isArray(e) && typeof e.getList != "function";
1
+ import { cloneDeep as m } from "lodash-es";
2
+ import { defineStore as v } from "pinia";
3
+ import { inject as f, ref as u, markRaw as P } from "vue";
4
+ function p(r) {
5
+ return r != null && typeof r == "object" && !Array.isArray(r) && typeof r.getList != "function";
6
6
  }
7
- function O(e) {
8
- const d = m("dux.manage");
9
- if (e || (e = (d == null ? void 0 : d.value) || ""), !e)
7
+ function O(r) {
8
+ const n = f("dux.manage");
9
+ if (r || (r = n?.value || ""), !r)
10
10
  throw new Error("manage not found");
11
- return j(e)();
11
+ return h(r)();
12
12
  }
13
- function j(e) {
14
- return h(`manages-${e}`, () => {
15
- const d = p(), o = p(!1);
13
+ function h(r) {
14
+ return v(`manages-${r}`, () => {
15
+ const n = u(), a = u(!1);
16
16
  return {
17
- config: d,
17
+ config: n,
18
18
  isInit: () => {
19
- const n = o.value;
20
- return o.value = !0, n;
19
+ const c = a.value;
20
+ return a.value = !0, c;
21
21
  },
22
- setConfig: (n, r) => {
23
- const t = P(n), u = [];
24
- t.title && u.push(t.title), r.title && u.push(r.title), t.title = u.join(" - "), t.copyright = t.copyright || r.copyright, t.description = t.description || r.description, t.theme = { ...r == null ? void 0 : r.theme, ...t == null ? void 0 : t.theme };
25
- const s = {};
26
- r != null && r.dataProvider && (v(r.dataProvider) ? Object.keys(r.dataProvider).forEach((i) => {
27
- s[i] = r.dataProvider[i];
28
- }) : s.default = r.dataProvider), t != null && t.dataProvider && (v(t.dataProvider) ? Object.keys(t.dataProvider).forEach((i) => {
29
- s[i] = t.dataProvider[i];
30
- }) : s.default = t.dataProvider), t.authProvider = (r == null ? void 0 : r.authProvider) || (t == null ? void 0 : t.authProvider), t.dataProvider = s, t.i18nProvider = (r == null ? void 0 : r.i18nProvider) || (t == null ? void 0 : t.i18nProvider), t.layoutComponent = {
31
- ...r.layoutComponent,
22
+ setConfig: (c, e) => {
23
+ const t = m(c), s = [];
24
+ t.title && s.push(t.title), e.title && s.push(e.title), t.title = s.join(" - "), t.copyright = t.copyright || e.copyright, t.description = t.description || e.description, t.theme = { ...e?.theme, ...t?.theme };
25
+ const d = {};
26
+ e?.dataProvider && (p(e.dataProvider) ? Object.keys(e.dataProvider).forEach((o) => {
27
+ d[o] = e.dataProvider[o];
28
+ }) : d.default = e.dataProvider), t?.dataProvider && (p(t.dataProvider) ? Object.keys(t.dataProvider).forEach((o) => {
29
+ d[o] = t.dataProvider[o];
30
+ }) : d.default = t.dataProvider), t.authProvider = e?.authProvider || t?.authProvider, t.dataProvider = d, t.i18nProvider = e?.i18nProvider || t?.i18nProvider, t.layoutComponent = {
31
+ ...e.layoutComponent,
32
32
  ...t.layoutComponent
33
33
  };
34
- const c = {
35
- ...r.components,
34
+ const i = {
35
+ ...e.components,
36
36
  ...t.components
37
37
  };
38
- c && Object.keys(c).forEach((i) => {
39
- c[i] && (c[i] = y(c[i]));
40
- }), t.components = c, t.remote = {
41
- ...r.remote,
38
+ i && Object.keys(i).forEach((o) => {
39
+ i[o] && (i[o] = P(i[o]));
40
+ }), t.components = i, t.remote = {
41
+ ...e.remote,
42
42
  ...t.remote
43
- }, d.value = t;
43
+ }, n.value = t;
44
44
  },
45
- getConfig: () => d.value
45
+ getConfig: () => n.value
46
46
  };
47
47
  });
48
48
  }
@@ -1,67 +1,55 @@
1
- import { defineStore as w } from "pinia";
2
- import { inject as j, ref as R } from "vue";
3
- function b(u) {
4
- const t = j("dux.manage");
5
- if (u || (u = (t == null ? void 0 : t.value) || ""), !u)
1
+ import { defineStore as g } from "pinia";
2
+ import { inject as m, ref as l } from "vue";
3
+ function E(r) {
4
+ const t = m("dux.manage");
5
+ if (r || (r = t?.value || ""), !r)
6
6
  throw new Error("manage not found");
7
- return E(u)();
7
+ return I(r)();
8
8
  }
9
- function E(u) {
10
- return w(`routes-${u}`, () => {
11
- const t = R([]), l = (e) => {
12
- var o;
13
- return (o = t.value) == null ? void 0 : o.find((s) => s.path === e);
14
- }, p = (e) => {
15
- var o;
16
- return (o = t.value) == null ? void 0 : o.find((s) => s.name === e);
17
- }, h = (e) => {
18
- var o;
19
- (o = t.value) == null || o.push(e);
20
- }, S = (e) => {
9
+ function I(r) {
10
+ return g(`routes-${r}`, () => {
11
+ const t = l([]), a = (e) => t.value?.find((n) => n.path === e), f = (e) => t.value?.find((n) => n.name === e), d = (e) => {
12
+ t.value?.push(e);
13
+ }, v = (e) => {
21
14
  t.value = [...t.value, ...e];
22
- }, I = (e) => {
15
+ }, R = (e) => {
23
16
  t.value = e;
24
- }, x = () => t.value, g = () => {
17
+ }, p = () => t.value, h = () => {
25
18
  t.value = [];
26
- }, m = () => {
27
- var s, d;
28
- const e = (d = (s = t.value) == null ? void 0 : s.filter((r) => {
29
- var n, c;
30
- return !r.parent && !((n = r.name) != null && n.includes("404")) && !((c = r.name) != null && c.includes("403"));
31
- })) == null ? void 0 : d.sort((r, n) => (r.sort || 0) - (n.sort || 0)), o = (r) => {
32
- var c, v;
33
- if (r.path)
34
- return r;
35
- const n = (v = (c = t.value) == null ? void 0 : c.filter((i) => i.parent === r.name)) == null ? void 0 : v.sort((i, a) => (i.sort || 0) - (a.sort || 0));
36
- for (const i of n || []) {
37
- const a = o(i);
38
- if (a)
39
- return a;
19
+ }, S = () => {
20
+ const e = t.value?.filter((o) => !o.parent && !o.name?.includes("404") && !o.name?.includes("403"))?.sort((o, u) => (o.sort || 0) - (u.sort || 0)), n = (o) => {
21
+ if (o.path)
22
+ return o;
23
+ const u = t.value?.filter((s) => s.parent === o.name)?.sort((s, c) => (s.sort || 0) - (c.sort || 0));
24
+ for (const s of u || []) {
25
+ const c = n(s);
26
+ if (c)
27
+ return c;
40
28
  }
41
29
  };
42
- for (const r of e || []) {
43
- const n = o(r);
44
- if (n)
45
- return n;
30
+ for (const o of e || []) {
31
+ const u = n(o);
32
+ if (u)
33
+ return u;
46
34
  }
47
- }, f = R(!1);
35
+ }, i = l(!1);
48
36
  return {
49
37
  routes: t,
50
- searchRoute: l,
51
- searchRouteName: p,
52
- appendRoute: h,
53
- appendRoutes: S,
54
- setRoutes: I,
55
- getRoutes: x,
56
- clearRoutes: g,
57
- getIndexRoute: m,
38
+ searchRoute: a,
39
+ searchRouteName: f,
40
+ appendRoute: d,
41
+ appendRoutes: v,
42
+ setRoutes: R,
43
+ getRoutes: p,
44
+ clearRoutes: h,
45
+ getIndexRoute: S,
58
46
  getRouteInit: () => {
59
- const e = f.value;
60
- return f.value = !0, e;
47
+ const e = i.value;
48
+ return i.value = !0, e;
61
49
  }
62
50
  };
63
51
  });
64
52
  }
65
53
  export {
66
- b as useRouteStore
54
+ E as useRouteStore
67
55
  };
@@ -1,78 +1,62 @@
1
- import { defineStore as p } from "pinia";
2
- import { inject as c, ref as s, nextTick as h } from "vue";
3
- function E(i) {
4
- const u = c("dux.manage");
5
- if (i || (i = (u == null ? void 0 : u.value) || ""), !i)
1
+ import { defineStore as d } from "pinia";
2
+ import { inject as h, ref as c, nextTick as f } from "vue";
3
+ function R(o) {
4
+ const u = h("dux.manage");
5
+ if (o || (o = u?.value || ""), !o)
6
6
  throw new Error("manage not found");
7
- return T(i)();
7
+ return b(o)();
8
8
  }
9
- function T(i) {
10
- return p(`tab-${i}`, () => {
11
- const u = s(), o = s(), e = s([]);
9
+ function b(o) {
10
+ return d(`tab-${o}`, () => {
11
+ const u = c(), v = c(), e = c([]);
12
12
  return {
13
13
  current: u,
14
14
  tabs: e,
15
- isTab: (t) => e.value.some((a) => a.path === t),
16
- addTab: (t, a) => {
17
- t.path && (e.value.some((l) => l.path === t.path) ? (u.value && u.value !== t.path && (o.value = e.value.find((l) => l.path === u.value)), u.value = t.path) : (u.value && (o.value = e.value.find((l) => l.path === u.value)), e.value.push(t), a == null || a(t), u.value = t.path));
15
+ isTab: (t) => e.value.some((l) => l.path === t),
16
+ addTab: (t, l) => {
17
+ t.path && (e.value.some((a) => a.path === t.path) ? (u.value && u.value !== t.path && (v.value = e.value.find((a) => a.path === u.value)), u.value = t.path) : (u.value && (v.value = e.value.find((a) => a.path === u.value)), e.value.push(t), l?.(t), u.value = t.path));
18
18
  },
19
- delTab: (t, a) => {
20
- var d;
21
- const l = e.value.findIndex((r) => r.path === t);
22
- if (l === -1 || e.value.length <= 1)
19
+ delTab: (t, l) => {
20
+ const a = e.value.findIndex((i) => i.path === t);
21
+ if (a === -1 || e.value.length <= 1 || e.value[a]?.meta?.lock)
23
22
  return;
24
- const n = e.value[l];
25
- if ((d = n == null ? void 0 : n.meta) != null && d.lock)
26
- return;
27
- let v;
28
- if (t === u.value && o.value && (v = e.value.find((r) => {
29
- var f;
30
- return r.path === ((f = o.value) == null ? void 0 : f.path) && r.path !== t;
31
- })), !v) {
32
- const r = e.value[l - 1], f = e.value[l + 1];
33
- v = r || f;
23
+ let r;
24
+ if (t === u.value && v.value && (r = e.value.find((i) => i.path === v.value?.path && i.path !== t)), !r) {
25
+ const i = e.value[a - 1], s = e.value[a + 1];
26
+ r = i || s;
34
27
  }
35
- e.value.splice(l, 1), a == null || a(v);
28
+ e.value.splice(a, 1), l?.(r);
36
29
  },
37
- changeTab: (t, a) => {
38
- const l = e.value.find((n) => n.path === t);
39
- l && (u.value && u.value !== t && (o.value = e.value.find((n) => n.path === u.value)), u.value = t, a == null || a(l));
30
+ changeTab: (t, l) => {
31
+ const a = e.value.find((n) => n.path === t);
32
+ a && (u.value && u.value !== t && (v.value = e.value.find((n) => n.path === u.value)), u.value = t, l?.(a));
40
33
  },
41
- delOther: (t, a) => {
42
- e.value = e.value.filter((l) => {
43
- var n;
44
- return l.path === t || ((n = l.meta) == null ? void 0 : n.lock);
45
- }), a == null || a();
34
+ delOther: (t, l) => {
35
+ e.value = e.value.filter((a) => a.path === t || a.meta?.lock), l?.();
46
36
  },
47
- delLeft: (t, a) => {
48
- const l = e.value.findIndex((n) => n.path === t);
49
- l <= 0 || h(() => {
50
- e.value = [...e.value.slice(0, l).filter((n) => {
51
- var v;
52
- return (v = n.meta) == null ? void 0 : v.lock;
53
- }), ...e.value.slice(l)], a == null || a();
37
+ delLeft: (t, l) => {
38
+ const a = e.value.findIndex((n) => n.path === t);
39
+ a <= 0 || f(() => {
40
+ e.value = [...e.value.slice(0, a).filter((n) => n.meta?.lock), ...e.value.slice(a)], l?.();
54
41
  });
55
42
  },
56
- delRight: (t, a) => {
57
- const l = e.value.findIndex((n) => n.path === t);
58
- l === -1 || l === e.value.length - 1 || h(() => {
59
- e.value = [...e.value.slice(0, l + 1), ...e.value.slice(l + 1).filter((n) => {
60
- var v;
61
- return (v = n.meta) == null ? void 0 : v.lock;
62
- })], a == null || a();
43
+ delRight: (t, l) => {
44
+ const a = e.value.findIndex((n) => n.path === t);
45
+ a === -1 || a === e.value.length - 1 || f(() => {
46
+ e.value = [...e.value.slice(0, a + 1), ...e.value.slice(a + 1).filter((n) => n.meta?.lock)], l?.();
63
47
  });
64
48
  },
65
49
  lockTab: (t) => {
66
- const a = e.value.findIndex((l) => l.path === t);
67
- a !== -1 && e.value[a] && (e.value[a].meta || (e.value[a].meta = {}), e.value[a].meta.lock = !e.value[a].meta.lock);
50
+ const l = e.value.findIndex((a) => a.path === t);
51
+ l !== -1 && e.value[l] && (e.value[l].meta || (e.value[l].meta = {}), e.value[l].meta.lock = !e.value[l].meta.lock);
68
52
  },
69
53
  clearTab: () => {
70
- u.value = void 0, o.value = void 0, e.value = [];
54
+ u.value = void 0, v.value = void 0, e.value = [];
71
55
  }
72
56
  };
73
57
  });
74
58
  }
75
59
  export {
76
- T as createTabStore,
77
- E as useTabStore
60
+ b as createTabStore,
61
+ R as useTabStore
78
62
  };
@@ -1,7 +1,7 @@
1
- import { defineStore as v } from "pinia";
2
- import { inject as S, ref as n } from "vue";
3
- import { useManageStore as g } from "./manage.js";
4
- const f = {
1
+ import { defineStore as T } from "pinia";
2
+ import { inject as g, ref as r } from "vue";
3
+ import { useManageStore as p } from "./manage.js";
4
+ const c = {
5
5
  primary: "emerald",
6
6
  info: "cyan",
7
7
  success: "green",
@@ -9,44 +9,43 @@ const f = {
9
9
  error: "red",
10
10
  gray: "zinc"
11
11
  };
12
- function j(e) {
13
- const o = S("dux.manage");
14
- if (e || (e = (o == null ? void 0 : o.value) || ""), !e)
12
+ function C(e) {
13
+ const o = g("dux.manage");
14
+ if (e || (e = o?.value || ""), !e)
15
15
  throw new Error("manage not found");
16
- return w(e)();
16
+ return v(e)();
17
17
  }
18
- function w(e) {
19
- return v(`theme-${e}`, () => {
20
- var c, i;
21
- const o = g(e), t = n(((i = (c = o.config) == null ? void 0 : c.theme) == null ? void 0 : i.defaultTheme) || f), u = n("auto"), s = n(!1);
22
- function m() {
18
+ function v(e) {
19
+ return T(`theme-${e}`, () => {
20
+ const o = p(e), t = r(o.config?.theme?.defaultTheme || c), u = r("auto"), s = r(!1);
21
+ function i() {
23
22
  s.value = !0;
24
23
  }
25
- function h(r) {
26
- u.value = r;
24
+ function f(n) {
25
+ u.value = n;
27
26
  }
28
- function a(r, p) {
29
- t.value[r] = p;
27
+ function m(n, d) {
28
+ t.value[n] = d;
30
29
  }
31
- function l(r) {
32
- Object.assign(t.value, r);
30
+ function a(n) {
31
+ Object.assign(t.value, n);
33
32
  }
34
- function d() {
35
- t.value = { ...f };
33
+ function h() {
34
+ t.value = { ...c };
36
35
  }
37
- function T() {
36
+ function l() {
38
37
  return t.value;
39
38
  }
40
39
  return {
41
40
  mode: u,
42
- setMode: h,
41
+ setMode: f,
43
42
  theme: t,
44
43
  cssInit: s,
45
- setCssInit: m,
46
- setThemeColor: a,
47
- setThemeColors: l,
48
- resetTheme: d,
49
- getTheme: T
44
+ setCssInit: i,
45
+ setThemeColor: m,
46
+ setThemeColors: a,
47
+ resetTheme: h,
48
+ getTheme: l
50
49
  };
51
50
  }, {
52
51
  persist: {
@@ -55,5 +54,5 @@ function w(e) {
55
54
  });
56
55
  }
57
56
  export {
58
- j as useThemeStore
57
+ C as useThemeStore
59
58
  };
@@ -1,38 +1,37 @@
1
- function c(h, e, t) {
2
- let n = [];
3
- return h.forEach((r) => {
4
- if (r[e.parentKey] === t) {
5
- const f = c(h, e, r[e.idKey]);
6
- f.length > 0 && (r[e.childrenKey] = f), n.push(r);
1
+ function c(h, t, e) {
2
+ let r = [];
3
+ return h.forEach((n) => {
4
+ if (n[t.parentKey] === e) {
5
+ const f = c(h, t, n[t.idKey]);
6
+ f.length > 0 && (n[t.childrenKey] = f), r.push(n);
7
7
  }
8
- }), n = n.sort((r, f) => r[e.sortKey] - f[e.sortKey]), n;
8
+ }), r = r.sort((n, f) => n[t.sortKey] - f[t.sortKey]), r;
9
9
  }
10
- function l(h, e, t = []) {
11
- var n;
10
+ function l(h, t, e = []) {
12
11
  if (!h || !h.length)
13
12
  return [];
14
13
  for (const r of h) {
15
- if (t.push(r), e(r))
16
- return t;
17
- if (r != null && r.children && ((n = r == null ? void 0 : r.children) != null && n.length)) {
18
- const f = l(r.children, e, t);
19
- if (f.length)
20
- return f;
14
+ if (e.push(r), t(r))
15
+ return e;
16
+ if (r?.children && r?.children?.length) {
17
+ const n = l(r.children, t, e);
18
+ if (n.length)
19
+ return n;
21
20
  }
22
- t.pop();
21
+ e.pop();
23
22
  }
24
23
  return [];
25
24
  }
26
- function u(h, e, t) {
27
- let n = [];
25
+ function u(h, t, e) {
26
+ let r = [];
28
27
  if (!h || !h.length)
29
- return n;
30
- for (const r of h)
31
- if (n.push(r[e]), r[t] && r[t].length) {
32
- const f = u(r[t], e, t);
33
- f.length && (n = n.concat(f));
28
+ return r;
29
+ for (const n of h)
30
+ if (r.push(n[t]), n[e] && n[e].length) {
31
+ const f = u(n[e], t, e);
32
+ f.length && (r = r.concat(f));
34
33
  }
35
- return n;
34
+ return r;
36
35
  }
37
36
  export {
38
37
  c as arrayToTree,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@duxweb/dvha-core",
3
3
  "type": "module",
4
- "version": "1.0.23",
4
+ "version": "1.0.24",
5
5
  "author": "DuxWeb",
6
6
  "license": "MIT",
7
7
  "repository": {