@duxweb/dvha-core 0.1.23 → 1.0.15
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/loader.cjs +1 -1
- package/dist/cjs/components/loader/remote/loader.cjs +1 -1
- package/dist/cjs/directive/permission.cjs +1 -1
- package/dist/cjs/hooks/data.cjs +1 -1
- package/dist/cjs/hooks/json/vModel.cjs +1 -1
- package/dist/cjs/hooks/json.cjs +1 -1
- package/dist/cjs/hooks/menu.cjs +1 -1
- package/dist/cjs/hooks/overlay.cjs +1 -1
- package/dist/cjs/hooks/tree.cjs +1 -1
- package/dist/cjs/hooks/upload/local.cjs +1 -1
- package/dist/cjs/hooks/upload.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/main.cjs +1 -1
- package/dist/cjs/provider/app.cjs +1 -1
- package/dist/cjs/stores/jsonSchema.cjs +1 -0
- package/dist/cjs/utils/bus.cjs +1 -0
- package/dist/esm/components/auth/can.js +3 -2
- package/dist/esm/components/loader/loader.js +3 -2
- package/dist/esm/components/loader/remote/loader.js +3 -2
- package/dist/esm/directive/permission.js +3 -2
- package/dist/esm/hooks/data.js +166 -158
- package/dist/esm/hooks/json/vModel.js +67 -36
- package/dist/esm/hooks/json.js +109 -57
- package/dist/esm/hooks/menu.js +14 -13
- package/dist/esm/hooks/overlay.js +3 -2
- package/dist/esm/hooks/tree.js +8 -7
- package/dist/esm/hooks/upload/local.js +8 -8
- package/dist/esm/hooks/upload.js +123 -116
- package/dist/esm/index.js +93 -88
- package/dist/esm/main.js +7 -6
- package/dist/esm/provider/app.js +55 -53
- package/dist/esm/stores/jsonSchema.js +43 -0
- package/dist/esm/utils/bus.js +5 -0
- package/dist/types/hooks/data.d.ts +6 -66
- package/dist/types/hooks/json.d.ts +13 -3
- package/dist/types/hooks/upload/local.d.ts +1 -1
- package/dist/types/hooks/upload.d.ts +1 -1
- package/dist/types/stores/index.d.ts +1 -0
- package/dist/types/stores/jsonSchema.d.ts +27 -0
- package/dist/types/types/config.d.ts +6 -0
- package/dist/types/types/manage.d.ts +6 -0
- package/dist/types/utils/bus.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +2 -2
package/dist/esm/provider/app.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { OverlaysProvider as
|
|
3
|
-
import { useRouter as
|
|
4
|
-
import { useCan as
|
|
1
|
+
import { defineComponent as U, inject as V, createVNode as q } from "vue";
|
|
2
|
+
import { OverlaysProvider as B } from "@overlastic/vue";
|
|
3
|
+
import { useRouter as G } from "vue-router";
|
|
4
|
+
import { useCan as H } from "../hooks/auth.js";
|
|
5
5
|
import { useConfig as K } from "../hooks/config.js";
|
|
6
6
|
import "@tanstack/vue-query";
|
|
7
7
|
import { useManage as Q } from "../hooks/manage.js";
|
|
@@ -11,44 +11,46 @@ import "@vee-validate/rules";
|
|
|
11
11
|
import "vee-validate";
|
|
12
12
|
import { useAuthStore as T } from "../stores/auth.js";
|
|
13
13
|
import { useI18nStore as W } from "../stores/i18n.js";
|
|
14
|
+
import "pinia";
|
|
14
15
|
import { useManageStore as X } from "../stores/manage.js";
|
|
15
16
|
import { useRouteStore as Y } from "../stores/route.js";
|
|
16
|
-
import "pinia";
|
|
17
17
|
import "@vueuse/core";
|
|
18
|
+
import { initJsonSchemaComponents as Z } from "../hooks/json.js";
|
|
18
19
|
import "../hooks/json/index.js";
|
|
20
|
+
import "../utils/bus.js";
|
|
19
21
|
import "colorizr";
|
|
20
22
|
import "axios";
|
|
21
23
|
import "clsx";
|
|
22
|
-
import { DuxError as
|
|
23
|
-
import { DuxNotAuthorized as
|
|
24
|
-
import { DuxNotFound as
|
|
25
|
-
const
|
|
24
|
+
import { DuxError as x } from "../components/status/error.js";
|
|
25
|
+
import { DuxNotAuthorized as ee } from "../components/status/notAuthorized.js";
|
|
26
|
+
import { DuxNotFound as oe } from "../components/status/notFound.js";
|
|
27
|
+
const Ie = /* @__PURE__ */ U({
|
|
26
28
|
name: "DuxAppProvider",
|
|
27
29
|
props: {},
|
|
28
30
|
setup(te, {
|
|
29
31
|
slots: c
|
|
30
32
|
}) {
|
|
31
|
-
const f =
|
|
32
|
-
return s.beforeEach(async (
|
|
33
|
-
var P, b, R, A, S, $, k, M, z, D, w, I, N
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
33
|
+
const f = V("dux.manage"), u = K(), s = G();
|
|
34
|
+
return s.beforeEach(async (n, re, a) => {
|
|
35
|
+
var P, b, R, A, S, $, k, M, z, D, w, C, I, N;
|
|
36
|
+
const o = n.meta.manageName, J = n.meta.authorization === !1;
|
|
37
|
+
if (!o) {
|
|
36
38
|
const e = u.defaultManage || ((b = (P = u.manages) == null ? void 0 : P[0]) == null ? void 0 : b.name) || "";
|
|
37
|
-
return
|
|
39
|
+
return a({
|
|
38
40
|
path: `/${e}`,
|
|
39
41
|
replace: !0
|
|
40
42
|
});
|
|
41
43
|
}
|
|
42
|
-
f && (f.value =
|
|
43
|
-
const h = X(
|
|
44
|
-
h.isInit() || h.setConfig((R = u.manages) == null ? void 0 : R.find((e) => e.name ===
|
|
45
|
-
const i = Y(
|
|
44
|
+
f && (f.value = o);
|
|
45
|
+
const h = X(o);
|
|
46
|
+
h.isInit() || h.setConfig((R = u.manages) == null ? void 0 : R.find((e) => e.name === o), u);
|
|
47
|
+
const i = Y(o), r = Q(o), d = T(o), l = W(o);
|
|
46
48
|
if ((A = r.config) != null && A.i18nProvider && !l.isInit()) {
|
|
47
49
|
const e = l.getLocale();
|
|
48
50
|
e && ((S = r.config) == null || S.i18nProvider.changeLocale(e));
|
|
49
51
|
}
|
|
50
|
-
if (!d.isLogin())
|
|
51
|
-
return
|
|
52
|
+
if (Z(u, o), !d.isLogin())
|
|
53
|
+
return J ? a() : a({
|
|
52
54
|
path: r.getRoutePath("login"),
|
|
53
55
|
replace: !0
|
|
54
56
|
});
|
|
@@ -59,28 +61,28 @@ const De = /* @__PURE__ */ V({
|
|
|
59
61
|
if (!i.getRouteInit()) {
|
|
60
62
|
const e = (($ = r.config) == null ? void 0 : $.components) || {}, p = [];
|
|
61
63
|
if (p.push({
|
|
62
|
-
name: `${
|
|
64
|
+
name: `${o}.notFound`,
|
|
63
65
|
label: "404",
|
|
64
66
|
path: ":pathMatch(.*)*",
|
|
65
|
-
component: e.notFound ||
|
|
67
|
+
component: e.notFound || oe,
|
|
66
68
|
hidden: !0,
|
|
67
69
|
meta: {
|
|
68
70
|
can: !1
|
|
69
71
|
}
|
|
70
72
|
}), p.push({
|
|
71
|
-
name: `${
|
|
73
|
+
name: `${o}.notAuthorized`,
|
|
72
74
|
label: "403",
|
|
73
75
|
path: "notAuthorized",
|
|
74
|
-
component: e.notAuthorized ||
|
|
76
|
+
component: e.notAuthorized || ee,
|
|
75
77
|
hidden: !0,
|
|
76
78
|
meta: {
|
|
77
79
|
can: !1
|
|
78
80
|
}
|
|
79
81
|
}), p.push({
|
|
80
|
-
name: `${
|
|
82
|
+
name: `${o}.error`,
|
|
81
83
|
label: "500",
|
|
82
84
|
path: "error",
|
|
83
|
-
component: e.error ||
|
|
85
|
+
component: e.error || x,
|
|
84
86
|
hidden: !0,
|
|
85
87
|
meta: {
|
|
86
88
|
can: !1
|
|
@@ -92,22 +94,22 @@ const De = /* @__PURE__ */ V({
|
|
|
92
94
|
meta: {
|
|
93
95
|
timeout: 5e3
|
|
94
96
|
}
|
|
95
|
-
}, r, d.getUser()).then((
|
|
96
|
-
i.appendRoutes(g(
|
|
97
|
+
}, r, d.getUser()).then((t) => {
|
|
98
|
+
i.appendRoutes(g(t.data || []));
|
|
97
99
|
}));
|
|
98
|
-
} catch (
|
|
99
|
-
console.error(
|
|
100
|
+
} catch (t) {
|
|
101
|
+
console.error(t);
|
|
100
102
|
}
|
|
101
|
-
return i.appendRoutes(p), i.getRoutes().forEach((
|
|
103
|
+
return i.appendRoutes(p), i.getRoutes().forEach((t) => {
|
|
102
104
|
var E, F, y, L;
|
|
103
|
-
if (!
|
|
105
|
+
if (!t.path)
|
|
104
106
|
return;
|
|
105
107
|
const m = {
|
|
106
|
-
name:
|
|
107
|
-
path:
|
|
108
|
-
meta:
|
|
108
|
+
name: t.name,
|
|
109
|
+
path: t.path,
|
|
110
|
+
meta: t.meta
|
|
109
111
|
};
|
|
110
|
-
switch (
|
|
112
|
+
switch (t.loader) {
|
|
111
113
|
case "iframe":
|
|
112
114
|
m.component = ((F = (E = r.config) == null ? void 0 : E.components) == null ? void 0 : F.iframe) || (() => import("../components/loader/iframe.js"));
|
|
113
115
|
break;
|
|
@@ -117,42 +119,42 @@ const De = /* @__PURE__ */ V({
|
|
|
117
119
|
case "link":
|
|
118
120
|
m.beforeEnter = () => {
|
|
119
121
|
var j;
|
|
120
|
-
const _ = ((j =
|
|
122
|
+
const _ = ((j = t.meta) == null ? void 0 : j.url) || t.path;
|
|
121
123
|
return _ && window.open(_, "_blank"), !1;
|
|
122
124
|
}, m.component = () => Promise.resolve({
|
|
123
125
|
template: "<div></div>"
|
|
124
126
|
});
|
|
125
127
|
break;
|
|
126
128
|
default:
|
|
127
|
-
|
|
129
|
+
t.component && (m.component = t.component);
|
|
128
130
|
break;
|
|
129
131
|
}
|
|
130
|
-
s.addRoute(`${
|
|
131
|
-
}),
|
|
132
|
-
path: ((
|
|
132
|
+
s.addRoute(`${o}.auth`, m);
|
|
133
|
+
}), a({
|
|
134
|
+
path: ((C = n.redirectedFrom) == null ? void 0 : C.path) || n.path,
|
|
133
135
|
replace: !0
|
|
134
136
|
});
|
|
135
137
|
}
|
|
136
|
-
const v = ["", "/", `/${
|
|
137
|
-
if (v.includes(
|
|
138
|
+
const v = ["", "/", `/${o}`, `/${o}/`];
|
|
139
|
+
if (v.includes(n.path)) {
|
|
138
140
|
const e = i.getIndexRoute();
|
|
139
|
-
return !(e != null && e.path) || v.includes(e == null ? void 0 : e.path) ? (console.warn("[Dux] index route not found, skip redirect"),
|
|
141
|
+
return !(e != null && e.path) || v.includes(e == null ? void 0 : e.path) ? (console.warn("[Dux] index route not found, skip redirect"), a()) : a({
|
|
140
142
|
path: (e == null ? void 0 : e.path) || "/",
|
|
141
143
|
replace: !0
|
|
142
144
|
});
|
|
143
145
|
}
|
|
144
|
-
const
|
|
145
|
-
return (((
|
|
146
|
-
name: `${
|
|
147
|
-
}) :
|
|
148
|
-
}), () => B
|
|
146
|
+
const O = H(o);
|
|
147
|
+
return (((I = n.meta) == null ? void 0 : I.can) === void 0 || ((N = n.meta) == null ? void 0 : N.can) === !0) && !O(n.name) ? a({
|
|
148
|
+
name: `${o}.notAuthorized`
|
|
149
|
+
}) : a();
|
|
150
|
+
}), () => q(B, null, {
|
|
149
151
|
default: () => {
|
|
150
|
-
var
|
|
151
|
-
return [(
|
|
152
|
+
var n;
|
|
153
|
+
return [(n = c.default) == null ? void 0 : n.call(c)];
|
|
152
154
|
}
|
|
153
155
|
});
|
|
154
156
|
}
|
|
155
157
|
});
|
|
156
158
|
export {
|
|
157
|
-
|
|
159
|
+
Ie as DuxAppProvider
|
|
158
160
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineStore as u } from "pinia";
|
|
2
|
+
import { inject as i, ref as a } from "vue";
|
|
3
|
+
function h(t, e) {
|
|
4
|
+
const o = t.toString ? t.toString() : String(t);
|
|
5
|
+
return `${e}-${o.slice(0, 32)}`;
|
|
6
|
+
}
|
|
7
|
+
function y(t) {
|
|
8
|
+
const e = i("dux.manage");
|
|
9
|
+
if (t || (t = (e == null ? void 0 : e.value) || ""), !t)
|
|
10
|
+
throw new Error("manage not found");
|
|
11
|
+
return l(t)();
|
|
12
|
+
}
|
|
13
|
+
function l(t) {
|
|
14
|
+
return u(`jsonSchema-${t}`, () => {
|
|
15
|
+
const e = a(/* @__PURE__ */ new Map()), o = a(/* @__PURE__ */ new Map());
|
|
16
|
+
return {
|
|
17
|
+
componentCache: e,
|
|
18
|
+
componentsByName: o,
|
|
19
|
+
addComponent: (n, r, s) => {
|
|
20
|
+
const c = h(n, r);
|
|
21
|
+
return e.value.has(c) || (e.value.set(c, {
|
|
22
|
+
component: n,
|
|
23
|
+
name: r,
|
|
24
|
+
originalName: s || r,
|
|
25
|
+
cacheKey: c
|
|
26
|
+
}), o.value.set(r, n)), c;
|
|
27
|
+
},
|
|
28
|
+
getComponent: (n) => {
|
|
29
|
+
var r;
|
|
30
|
+
return (r = e.value.get(n)) == null ? void 0 : r.component;
|
|
31
|
+
},
|
|
32
|
+
getComponentByName: (n) => o.value.get(n),
|
|
33
|
+
hasComponent: (n) => e.value.has(n),
|
|
34
|
+
clearCache: () => {
|
|
35
|
+
e.value.clear(), o.value.clear();
|
|
36
|
+
},
|
|
37
|
+
getCacheSize: () => e.value.size
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
y as useJsonSchemaStore
|
|
43
|
+
};
|
|
@@ -352,17 +352,7 @@ export declare function useInfiniteList(params: IInfiniteListParams): {
|
|
|
352
352
|
fetchNextPage: () => Promise<import("@tanstack/vue-query").InfiniteQueryObserverResult<InfiniteData<IDataProviderResponse | undefined, unknown>, Error>> | undefined;
|
|
353
353
|
hasNextPage: import("vue").Ref<boolean, boolean>;
|
|
354
354
|
refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<InfiniteData<IDataProviderResponse | undefined, unknown>, Error>>;
|
|
355
|
-
pagination: import("vue").Ref<
|
|
356
|
-
page?: number | undefined;
|
|
357
|
-
pageSize?: number | undefined;
|
|
358
|
-
pageCount?: number | undefined;
|
|
359
|
-
total?: number | undefined;
|
|
360
|
-
}, {
|
|
361
|
-
page?: number | undefined;
|
|
362
|
-
pageSize?: number | undefined;
|
|
363
|
-
pageCount?: number | undefined;
|
|
364
|
-
total?: number | undefined;
|
|
365
|
-
}>;
|
|
355
|
+
pagination: import("vue").Ref<IDataProviderPagination, IDataProviderPagination>;
|
|
366
356
|
total: import("vue").Ref<number, number>;
|
|
367
357
|
pageCount: import("vue").Ref<number, number>;
|
|
368
358
|
error: import("vue").Ref<Error, Error>;
|
|
@@ -412,17 +402,7 @@ export declare function useInfiniteList(params: IInfiniteListParams): {
|
|
|
412
402
|
fetchNextPage: () => Promise<import("@tanstack/vue-query").InfiniteQueryObserverResult<InfiniteData<IDataProviderResponse | undefined, unknown>, Error>> | undefined;
|
|
413
403
|
hasNextPage: import("vue").Ref<boolean, boolean>;
|
|
414
404
|
refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<InfiniteData<IDataProviderResponse | undefined, unknown>, Error>>;
|
|
415
|
-
pagination: import("vue").Ref<
|
|
416
|
-
page?: number | undefined;
|
|
417
|
-
pageSize?: number | undefined;
|
|
418
|
-
pageCount?: number | undefined;
|
|
419
|
-
total?: number | undefined;
|
|
420
|
-
}, {
|
|
421
|
-
page?: number | undefined;
|
|
422
|
-
pageSize?: number | undefined;
|
|
423
|
-
pageCount?: number | undefined;
|
|
424
|
-
total?: number | undefined;
|
|
425
|
-
}>;
|
|
405
|
+
pagination: import("vue").Ref<IDataProviderPagination, IDataProviderPagination>;
|
|
426
406
|
total: import("vue").Ref<number, number>;
|
|
427
407
|
pageCount: import("vue").Ref<number, number>;
|
|
428
408
|
error: import("vue").Ref<null, null>;
|
|
@@ -472,17 +452,7 @@ export declare function useInfiniteList(params: IInfiniteListParams): {
|
|
|
472
452
|
fetchNextPage: () => Promise<import("@tanstack/vue-query").InfiniteQueryObserverResult<InfiniteData<IDataProviderResponse | undefined, unknown>, Error>> | undefined;
|
|
473
453
|
hasNextPage: import("vue").Ref<boolean, boolean>;
|
|
474
454
|
refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<InfiniteData<IDataProviderResponse | undefined, unknown>, Error>>;
|
|
475
|
-
pagination: import("vue").Ref<
|
|
476
|
-
page?: number | undefined;
|
|
477
|
-
pageSize?: number | undefined;
|
|
478
|
-
pageCount?: number | undefined;
|
|
479
|
-
total?: number | undefined;
|
|
480
|
-
}, {
|
|
481
|
-
page?: number | undefined;
|
|
482
|
-
pageSize?: number | undefined;
|
|
483
|
-
pageCount?: number | undefined;
|
|
484
|
-
total?: number | undefined;
|
|
485
|
-
}>;
|
|
455
|
+
pagination: import("vue").Ref<IDataProviderPagination, IDataProviderPagination>;
|
|
486
456
|
total: import("vue").Ref<number, number>;
|
|
487
457
|
pageCount: import("vue").Ref<number, number>;
|
|
488
458
|
error: import("vue").Ref<Error, Error>;
|
|
@@ -532,17 +502,7 @@ export declare function useInfiniteList(params: IInfiniteListParams): {
|
|
|
532
502
|
fetchNextPage: () => Promise<import("@tanstack/vue-query").InfiniteQueryObserverResult<InfiniteData<IDataProviderResponse | undefined, unknown>, Error>> | undefined;
|
|
533
503
|
hasNextPage: import("vue").Ref<boolean, boolean>;
|
|
534
504
|
refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<InfiniteData<IDataProviderResponse | undefined, unknown>, Error>>;
|
|
535
|
-
pagination: import("vue").Ref<
|
|
536
|
-
page?: number | undefined;
|
|
537
|
-
pageSize?: number | undefined;
|
|
538
|
-
pageCount?: number | undefined;
|
|
539
|
-
total?: number | undefined;
|
|
540
|
-
}, {
|
|
541
|
-
page?: number | undefined;
|
|
542
|
-
pageSize?: number | undefined;
|
|
543
|
-
pageCount?: number | undefined;
|
|
544
|
-
total?: number | undefined;
|
|
545
|
-
}>;
|
|
505
|
+
pagination: import("vue").Ref<IDataProviderPagination, IDataProviderPagination>;
|
|
546
506
|
total: import("vue").Ref<number, number>;
|
|
547
507
|
pageCount: import("vue").Ref<number, number>;
|
|
548
508
|
error: import("vue").Ref<null, null>;
|
|
@@ -592,17 +552,7 @@ export declare function useInfiniteList(params: IInfiniteListParams): {
|
|
|
592
552
|
fetchNextPage: () => Promise<import("@tanstack/vue-query").InfiniteQueryObserverResult<InfiniteData<IDataProviderResponse | undefined, unknown>, Error>> | undefined;
|
|
593
553
|
hasNextPage: import("vue").Ref<boolean, boolean>;
|
|
594
554
|
refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<InfiniteData<IDataProviderResponse | undefined, unknown>, Error>>;
|
|
595
|
-
pagination: import("vue").Ref<
|
|
596
|
-
page?: number | undefined;
|
|
597
|
-
pageSize?: number | undefined;
|
|
598
|
-
pageCount?: number | undefined;
|
|
599
|
-
total?: number | undefined;
|
|
600
|
-
}, {
|
|
601
|
-
page?: number | undefined;
|
|
602
|
-
pageSize?: number | undefined;
|
|
603
|
-
pageCount?: number | undefined;
|
|
604
|
-
total?: number | undefined;
|
|
605
|
-
}>;
|
|
555
|
+
pagination: import("vue").Ref<IDataProviderPagination, IDataProviderPagination>;
|
|
606
556
|
total: import("vue").Ref<number, number>;
|
|
607
557
|
pageCount: import("vue").Ref<number, number>;
|
|
608
558
|
error: import("vue").Ref<null, null>;
|
|
@@ -652,17 +602,7 @@ export declare function useInfiniteList(params: IInfiniteListParams): {
|
|
|
652
602
|
fetchNextPage: () => Promise<import("@tanstack/vue-query").InfiniteQueryObserverResult<InfiniteData<IDataProviderResponse | undefined, unknown>, Error>> | undefined;
|
|
653
603
|
hasNextPage: import("vue").Ref<boolean, boolean>;
|
|
654
604
|
refetch: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<InfiniteData<IDataProviderResponse | undefined, unknown>, Error>>;
|
|
655
|
-
pagination: import("vue").Ref<
|
|
656
|
-
page?: number | undefined;
|
|
657
|
-
pageSize?: number | undefined;
|
|
658
|
-
pageCount?: number | undefined;
|
|
659
|
-
total?: number | undefined;
|
|
660
|
-
}, {
|
|
661
|
-
page?: number | undefined;
|
|
662
|
-
pageSize?: number | undefined;
|
|
663
|
-
pageCount?: number | undefined;
|
|
664
|
-
total?: number | undefined;
|
|
665
|
-
}>;
|
|
605
|
+
pagination: import("vue").Ref<IDataProviderPagination, IDataProviderPagination>;
|
|
666
606
|
total: import("vue").Ref<number, number>;
|
|
667
607
|
pageCount: import("vue").Ref<number, number>;
|
|
668
608
|
isError: import("vue").Ref<false, false>;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import type { Ref } from 'vue';
|
|
1
|
+
import type { Component, Ref } from 'vue';
|
|
2
|
+
import type { IConfig } from '../types';
|
|
2
3
|
import type { JsonAdaptorOptions, JsonSchemaNode } from './json/index';
|
|
4
|
+
/**
|
|
5
|
+
* 初始化 JSON Schema 组件
|
|
6
|
+
* 在应用启动时调用,将配置中的组件加载到全局缓存
|
|
7
|
+
*/
|
|
8
|
+
export declare function initJsonSchemaComponents(config: IConfig, manageName?: string): void;
|
|
3
9
|
export type JsonSchemaData = JsonSchemaNode[] | Ref<JsonSchemaNode[]>;
|
|
4
10
|
export interface UseJsonSchemaProps extends JsonAdaptorOptions {
|
|
5
|
-
data
|
|
6
|
-
components?: Record<string,
|
|
11
|
+
data?: JsonSchemaData;
|
|
12
|
+
components?: Record<string, Component> | Component[];
|
|
7
13
|
context?: Record<string, any> | Ref<Record<string, any>>;
|
|
8
14
|
}
|
|
9
15
|
/**
|
|
@@ -11,4 +17,8 @@ export interface UseJsonSchemaProps extends JsonAdaptorOptions {
|
|
|
11
17
|
*/
|
|
12
18
|
export declare function useJsonSchema(props?: UseJsonSchemaProps): {
|
|
13
19
|
render: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
20
|
+
renderAsync: (options: {
|
|
21
|
+
data: JsonSchemaNode[];
|
|
22
|
+
context?: Record<string, any>;
|
|
23
|
+
}) => import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
14
24
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { IUploadDriver } from './types';
|
|
2
|
-
export declare
|
|
2
|
+
export declare function createLocalUploadDriver(): IUploadDriver;
|
|
@@ -131,7 +131,7 @@ export declare function useUpload(props?: IUseUploadProps): {
|
|
|
131
131
|
dataFiles: import("vue").ComputedRef<IUseUploadFileData[]>;
|
|
132
132
|
progress: import("vue").ComputedRef<IOverallProgress>;
|
|
133
133
|
open: (localOptions?: Partial<import("@vueuse/core").UseFileDialogOptions>) => void;
|
|
134
|
-
trigger: () => Promise<
|
|
134
|
+
trigger: () => Promise<IUseUploadFile[]>;
|
|
135
135
|
resetFiles: () => void;
|
|
136
136
|
clearFiles: () => void;
|
|
137
137
|
removeFiles: (ids?: string[]) => void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Component, Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 组件缓存项
|
|
4
|
+
*/
|
|
5
|
+
interface ComponentCacheItem {
|
|
6
|
+
component: Component;
|
|
7
|
+
name: string;
|
|
8
|
+
originalName: string;
|
|
9
|
+
cacheKey: string;
|
|
10
|
+
}
|
|
11
|
+
export interface JsonSchemaStoreState {
|
|
12
|
+
componentCache: Ref<Map<string, ComponentCacheItem>>;
|
|
13
|
+
componentsByName: Ref<Map<string, Component>>;
|
|
14
|
+
addComponent: (component: Component, name: string, originalName?: string) => string;
|
|
15
|
+
getComponent: (key: string) => Component | undefined;
|
|
16
|
+
getComponentByName: (name: string) => Component | undefined;
|
|
17
|
+
hasComponent: (key: string) => boolean;
|
|
18
|
+
clearCache: () => void;
|
|
19
|
+
getCacheSize: () => number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* use json schema store
|
|
23
|
+
* @param manageName manage name
|
|
24
|
+
* @returns json schema store
|
|
25
|
+
*/
|
|
26
|
+
export declare function useJsonSchemaStore(manageName?: string): import("pinia").Store<string, Pick<JsonSchemaStoreState, "componentCache" | "componentsByName">, Pick<JsonSchemaStoreState, never>, Pick<JsonSchemaStoreState, "addComponent" | "getComponent" | "getComponentByName" | "hasComponent" | "clearCache" | "getCacheSize">>;
|
|
27
|
+
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
1
2
|
import type { Options } from 'vue3-sfc-loader';
|
|
2
3
|
import type { RouteComponent, RouteRecordRaw } from 'vue-router';
|
|
4
|
+
import type { IJsonAdaptor } from '../hooks';
|
|
3
5
|
import type { IAuthProvider } from './auth';
|
|
4
6
|
import type { IDataProvider } from './data';
|
|
5
7
|
import type { I18nProvider } from './i18n';
|
|
@@ -27,6 +29,10 @@ export interface IConfig {
|
|
|
27
29
|
apiMethod?: string;
|
|
28
30
|
apiRoutePath?: string | ((path: string) => string);
|
|
29
31
|
};
|
|
32
|
+
jsonSchema?: {
|
|
33
|
+
adaptors?: IJsonAdaptor[];
|
|
34
|
+
components?: Record<string, Component> | Component[];
|
|
35
|
+
};
|
|
30
36
|
[key: string]: any;
|
|
31
37
|
}
|
|
32
38
|
export interface IConfigComponent {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
1
2
|
import type { Options } from 'vue3-sfc-loader';
|
|
2
3
|
import type { RouteRecordRaw } from 'vue-router';
|
|
4
|
+
import type { IJsonAdaptor } from '../hooks';
|
|
3
5
|
import type { IAuthProvider } from './auth';
|
|
4
6
|
import type { IConfigComponent } from './config';
|
|
5
7
|
import type { IDataProvider } from './data';
|
|
@@ -32,5 +34,9 @@ export interface IManage {
|
|
|
32
34
|
apiMethod?: string;
|
|
33
35
|
apiRoutePath?: string | ((path: string) => string);
|
|
34
36
|
};
|
|
37
|
+
jsonSchema?: {
|
|
38
|
+
adaptors?: IJsonAdaptor[];
|
|
39
|
+
components?: Record<string, Component> | Component[];
|
|
40
|
+
};
|
|
35
41
|
[key: string]: any;
|
|
36
42
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const emitter: import("mitt").Emitter<Record<import("mitt").EventType, unknown>>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duxweb/dvha-core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.15",
|
|
5
5
|
"author": "DuxWeb",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@overlastic/vue": "^0.8.1",
|
|
32
|
-
"@tanstack/vue-query": "^5.
|
|
32
|
+
"@tanstack/vue-query": "^5.80.7",
|
|
33
33
|
"@vee-validate/rules": "^4.15.1",
|
|
34
34
|
"@vueuse/core": "^13.3.0",
|
|
35
35
|
"@vueuse/integrations": "^13.3.0",
|