@duxweb/dvha-core 1.0.23 → 1.0.25
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/cjs/components/auth/can.cjs +1 -1
- package/dist/cjs/components/loader/iframe.cjs +1 -1
- package/dist/cjs/components/loader/remote/loader.cjs +1 -1
- package/dist/cjs/components/loader/remote/render.cjs +1 -1
- package/dist/cjs/components/overlay/overlay.cjs +1 -1
- package/dist/cjs/components/status/exception.cjs +1 -1
- package/dist/cjs/directive/permission.cjs +1 -1
- package/dist/cjs/hooks/auth.cjs +1 -1
- package/dist/cjs/hooks/data.cjs +1 -1
- package/dist/cjs/hooks/export.cjs +1 -1
- package/dist/cjs/hooks/exportCsv.cjs +2 -2
- package/dist/cjs/hooks/form.cjs +1 -1
- package/dist/cjs/hooks/formExtend.cjs +1 -1
- package/dist/cjs/hooks/i18n.cjs +1 -1
- package/dist/cjs/hooks/import.cjs +1 -1
- package/dist/cjs/hooks/importCsv.cjs +2 -2
- package/dist/cjs/hooks/json/utils/expressionParser.cjs +1 -1
- package/dist/cjs/hooks/json/vFor.cjs +1 -1
- package/dist/cjs/hooks/json/vOn.cjs +1 -1
- package/dist/cjs/hooks/json/vShow.cjs +1 -1
- package/dist/cjs/hooks/json.cjs +1 -1
- package/dist/cjs/hooks/list.cjs +1 -1
- package/dist/cjs/hooks/manage.cjs +1 -1
- package/dist/cjs/hooks/menu.cjs +1 -1
- package/dist/cjs/hooks/select.cjs +1 -1
- package/dist/cjs/hooks/theme.cjs +3 -3
- package/dist/cjs/hooks/tree.cjs +1 -1
- package/dist/cjs/hooks/upload/s3.cjs +1 -1
- package/dist/cjs/hooks/upload.cjs +1 -1
- package/dist/cjs/preset/authProvider.cjs +1 -1
- package/dist/cjs/preset/dataProvider.cjs +1 -1
- package/dist/cjs/preset/i18nProvider.cjs +1 -1
- package/dist/cjs/provider/app.cjs +1 -1
- package/dist/cjs/router/route.cjs +1 -1
- package/dist/cjs/stores/auth.cjs +1 -1
- package/dist/cjs/stores/i18n.cjs +1 -1
- package/dist/cjs/stores/jsonSchema.cjs +1 -1
- package/dist/cjs/stores/manage.cjs +1 -1
- package/dist/cjs/stores/route.cjs +1 -1
- package/dist/cjs/stores/tab.cjs +1 -1
- package/dist/cjs/stores/theme.cjs +1 -1
- package/dist/cjs/utils/tree.cjs +1 -1
- package/dist/esm/components/auth/can.js +8 -11
- package/dist/esm/components/loader/iframe.js +14 -17
- package/dist/esm/components/loader/remote/loader.js +103 -105
- package/dist/esm/components/loader/remote/render.js +10 -11
- package/dist/esm/components/overlay/overlay.js +7 -7
- package/dist/esm/components/status/exception.js +10 -13
- package/dist/esm/directive/permission.js +6 -7
- package/dist/esm/hooks/auth.js +73 -83
- package/dist/esm/hooks/data.js +290 -345
- package/dist/esm/hooks/export.js +16 -17
- package/dist/esm/hooks/exportCsv.js +26 -27
- package/dist/esm/hooks/form.js +49 -54
- package/dist/esm/hooks/formExtend.js +24 -25
- package/dist/esm/hooks/i18n.js +11 -29
- package/dist/esm/hooks/import.js +31 -32
- package/dist/esm/hooks/importCsv.js +24 -25
- package/dist/esm/hooks/json/utils/expressionParser.js +36 -42
- package/dist/esm/hooks/json/vFor.js +15 -16
- package/dist/esm/hooks/json/vOn.js +17 -18
- package/dist/esm/hooks/json/vShow.js +9 -10
- package/dist/esm/hooks/json.js +88 -94
- package/dist/esm/hooks/list.js +100 -127
- package/dist/esm/hooks/manage.js +13 -17
- package/dist/esm/hooks/menu.js +39 -52
- package/dist/esm/hooks/select.js +35 -40
- package/dist/esm/hooks/theme.js +127 -141
- package/dist/esm/hooks/tree.js +22 -28
- package/dist/esm/hooks/upload/s3.js +22 -23
- package/dist/esm/hooks/upload.js +152 -159
- package/dist/esm/preset/authProvider.js +63 -117
- package/dist/esm/preset/dataProvider.js +69 -76
- package/dist/esm/preset/i18nProvider.js +18 -18
- package/dist/esm/provider/app.js +74 -81
- package/dist/esm/router/route.js +16 -24
- package/dist/esm/stores/auth.js +17 -20
- package/dist/esm/stores/i18n.js +10 -10
- package/dist/esm/stores/jsonSchema.js +20 -23
- package/dist/esm/stores/manage.js +33 -33
- package/dist/esm/stores/route.js +38 -50
- package/dist/esm/stores/tab.js +38 -54
- package/dist/esm/stores/theme.js +28 -29
- package/dist/esm/utils/tree.js +23 -24
- package/package.json +1 -1
package/dist/esm/stores/auth.js
CHANGED
|
@@ -1,38 +1,35 @@
|
|
|
1
1
|
import { defineStore as u } from "pinia";
|
|
2
|
-
import { inject as
|
|
3
|
-
function
|
|
4
|
-
const o =
|
|
5
|
-
if (e || (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
|
|
7
|
+
return c(e)();
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function c(e) {
|
|
10
10
|
return u(`auths-${e}`, () => {
|
|
11
|
-
const o =
|
|
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
|
|
18
|
-
id: t
|
|
19
|
-
info: t
|
|
20
|
-
permission: t
|
|
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
|
|
33
|
-
id: t
|
|
34
|
-
info: t
|
|
35
|
-
permission: t
|
|
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
|
-
|
|
47
|
+
k as useAuthStore
|
|
51
48
|
};
|
package/dist/esm/stores/i18n.js
CHANGED
|
@@ -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(
|
|
4
|
-
const
|
|
5
|
-
if (
|
|
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(
|
|
7
|
+
return u(t)();
|
|
8
8
|
}
|
|
9
|
-
function u(
|
|
10
|
-
return i(`i18n-${
|
|
11
|
-
const
|
|
9
|
+
function u(t) {
|
|
10
|
+
return i(`i18n-${t}`, () => {
|
|
11
|
+
const e = r(""), n = r(!1);
|
|
12
12
|
return {
|
|
13
|
-
lang:
|
|
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
|
-
|
|
19
|
+
e.value = o;
|
|
20
20
|
},
|
|
21
|
-
getLocale: () =>
|
|
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
|
|
3
|
-
function d(
|
|
2
|
+
import { inject as h, ref as c } from "vue";
|
|
3
|
+
function d(t) {
|
|
4
4
|
const e = h("dux.manage");
|
|
5
|
-
if (
|
|
5
|
+
if (t || (t = e?.value || ""), !t)
|
|
6
6
|
throw new Error("manage not found");
|
|
7
|
-
return
|
|
7
|
+
return m(t)();
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
return u(`jsonSchema-${
|
|
11
|
-
const e =
|
|
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:
|
|
15
|
-
addComponent: (
|
|
16
|
-
const
|
|
17
|
-
return e.value.has(
|
|
18
|
-
component:
|
|
19
|
-
name:
|
|
20
|
-
originalName: s ||
|
|
21
|
-
cacheKey:
|
|
22
|
-
}),
|
|
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: (
|
|
25
|
-
|
|
26
|
-
|
|
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(),
|
|
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
|
|
2
|
-
import { defineStore as
|
|
3
|
-
import { inject as
|
|
4
|
-
function
|
|
5
|
-
return
|
|
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(
|
|
8
|
-
const
|
|
9
|
-
if (
|
|
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
|
|
11
|
+
return h(r)();
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return
|
|
15
|
-
const
|
|
13
|
+
function h(r) {
|
|
14
|
+
return v(`manages-${r}`, () => {
|
|
15
|
+
const n = u(), a = u(!1);
|
|
16
16
|
return {
|
|
17
|
-
config:
|
|
17
|
+
config: n,
|
|
18
18
|
isInit: () => {
|
|
19
|
-
const
|
|
20
|
-
return
|
|
19
|
+
const c = a.value;
|
|
20
|
+
return a.value = !0, c;
|
|
21
21
|
},
|
|
22
|
-
setConfig: (
|
|
23
|
-
const t =
|
|
24
|
-
t.title &&
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}) :
|
|
29
|
-
|
|
30
|
-
}) :
|
|
31
|
-
...
|
|
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
|
|
35
|
-
...
|
|
34
|
+
const i = {
|
|
35
|
+
...e.components,
|
|
36
36
|
...t.components
|
|
37
37
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}), t.components =
|
|
41
|
-
...
|
|
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
|
-
},
|
|
43
|
+
}, n.value = t;
|
|
44
44
|
},
|
|
45
|
-
getConfig: () =>
|
|
45
|
+
getConfig: () => n.value
|
|
46
46
|
};
|
|
47
47
|
});
|
|
48
48
|
}
|
package/dist/esm/stores/route.js
CHANGED
|
@@ -1,67 +1,55 @@
|
|
|
1
|
-
import { defineStore as
|
|
2
|
-
import { inject as
|
|
3
|
-
function
|
|
4
|
-
const t =
|
|
5
|
-
if (
|
|
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
|
|
7
|
+
return I(r)();
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
return
|
|
11
|
-
const t =
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
},
|
|
15
|
+
}, R = (e) => {
|
|
23
16
|
t.value = e;
|
|
24
|
-
},
|
|
17
|
+
}, p = () => t.value, h = () => {
|
|
25
18
|
t.value = [];
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
-
return
|
|
30
|
+
for (const o of e || []) {
|
|
31
|
+
const u = n(o);
|
|
32
|
+
if (u)
|
|
33
|
+
return u;
|
|
46
34
|
}
|
|
47
|
-
},
|
|
35
|
+
}, i = l(!1);
|
|
48
36
|
return {
|
|
49
37
|
routes: t,
|
|
50
|
-
searchRoute:
|
|
51
|
-
searchRouteName:
|
|
52
|
-
appendRoute:
|
|
53
|
-
appendRoutes:
|
|
54
|
-
setRoutes:
|
|
55
|
-
getRoutes:
|
|
56
|
-
clearRoutes:
|
|
57
|
-
getIndexRoute:
|
|
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 =
|
|
60
|
-
return
|
|
47
|
+
const e = i.value;
|
|
48
|
+
return i.value = !0, e;
|
|
61
49
|
}
|
|
62
50
|
};
|
|
63
51
|
});
|
|
64
52
|
}
|
|
65
53
|
export {
|
|
66
|
-
|
|
54
|
+
E as useRouteStore
|
|
67
55
|
};
|
package/dist/esm/stores/tab.js
CHANGED
|
@@ -1,78 +1,62 @@
|
|
|
1
|
-
import { defineStore as
|
|
2
|
-
import { inject as
|
|
3
|
-
function
|
|
4
|
-
const u =
|
|
5
|
-
if (
|
|
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
|
|
7
|
+
return b(o)();
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
return
|
|
11
|
-
const u =
|
|
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((
|
|
16
|
-
addTab: (t,
|
|
17
|
-
t.path && (e.value.some((
|
|
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,
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
|
|
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(
|
|
28
|
+
e.value.splice(a, 1), l?.(r);
|
|
36
29
|
},
|
|
37
|
-
changeTab: (t,
|
|
38
|
-
const
|
|
39
|
-
|
|
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,
|
|
42
|
-
e.value = e.value.filter((
|
|
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,
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
e.value = [...e.value.slice(0,
|
|
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,
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
e.value = [...e.value.slice(0,
|
|
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
|
|
67
|
-
|
|
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,
|
|
54
|
+
u.value = void 0, v.value = void 0, e.value = [];
|
|
71
55
|
}
|
|
72
56
|
};
|
|
73
57
|
});
|
|
74
58
|
}
|
|
75
59
|
export {
|
|
76
|
-
|
|
77
|
-
|
|
60
|
+
b as createTabStore,
|
|
61
|
+
R as useTabStore
|
|
78
62
|
};
|
package/dist/esm/stores/theme.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineStore as
|
|
2
|
-
import { inject as
|
|
3
|
-
import { useManageStore as
|
|
4
|
-
const
|
|
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
|
|
13
|
-
const o =
|
|
14
|
-
if (e || (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
|
|
16
|
+
return v(e)();
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
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
|
|
26
|
-
u.value =
|
|
24
|
+
function f(n) {
|
|
25
|
+
u.value = n;
|
|
27
26
|
}
|
|
28
|
-
function
|
|
29
|
-
t.value[
|
|
27
|
+
function m(n, d) {
|
|
28
|
+
t.value[n] = d;
|
|
30
29
|
}
|
|
31
|
-
function
|
|
32
|
-
Object.assign(t.value,
|
|
30
|
+
function a(n) {
|
|
31
|
+
Object.assign(t.value, n);
|
|
33
32
|
}
|
|
34
|
-
function
|
|
35
|
-
t.value = { ...
|
|
33
|
+
function h() {
|
|
34
|
+
t.value = { ...c };
|
|
36
35
|
}
|
|
37
|
-
function
|
|
36
|
+
function l() {
|
|
38
37
|
return t.value;
|
|
39
38
|
}
|
|
40
39
|
return {
|
|
41
40
|
mode: u,
|
|
42
|
-
setMode:
|
|
41
|
+
setMode: f,
|
|
43
42
|
theme: t,
|
|
44
43
|
cssInit: s,
|
|
45
|
-
setCssInit:
|
|
46
|
-
setThemeColor:
|
|
47
|
-
setThemeColors:
|
|
48
|
-
resetTheme:
|
|
49
|
-
getTheme:
|
|
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
|
-
|
|
57
|
+
C as useThemeStore
|
|
59
58
|
};
|
package/dist/esm/utils/tree.js
CHANGED
|
@@ -1,38 +1,37 @@
|
|
|
1
|
-
function c(h,
|
|
2
|
-
let
|
|
3
|
-
return h.forEach((
|
|
4
|
-
if (
|
|
5
|
-
const f = c(h,
|
|
6
|
-
f.length > 0 && (
|
|
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
|
-
}),
|
|
8
|
+
}), r = r.sort((n, f) => n[t.sortKey] - f[t.sortKey]), r;
|
|
9
9
|
}
|
|
10
|
-
function l(h,
|
|
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 (
|
|
16
|
-
return
|
|
17
|
-
if (r
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
return
|
|
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
|
-
|
|
21
|
+
e.pop();
|
|
23
22
|
}
|
|
24
23
|
return [];
|
|
25
24
|
}
|
|
26
|
-
function u(h,
|
|
27
|
-
let
|
|
25
|
+
function u(h, t, e) {
|
|
26
|
+
let r = [];
|
|
28
27
|
if (!h || !h.length)
|
|
29
|
-
return
|
|
30
|
-
for (const
|
|
31
|
-
if (
|
|
32
|
-
const f = u(
|
|
33
|
-
f.length && (
|
|
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
|
|
34
|
+
return r;
|
|
36
35
|
}
|
|
37
36
|
export {
|
|
38
37
|
c as arrayToTree,
|