@duxweb/dvha-core 1.2.5 → 1.2.6
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/common/icon.cjs +1 -1
- package/dist/cjs/components/common/logo.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/loader/index.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/error.cjs +1 -1
- package/dist/cjs/components/status/exception.cjs +1 -1
- package/dist/cjs/components/status/notAuthorized.cjs +1 -1
- package/dist/cjs/components/status/notFound.cjs +1 -1
- package/dist/cjs/config/color.cjs +1 -1
- package/dist/cjs/directive/permission.cjs +1 -1
- package/dist/cjs/hooks/json/index.cjs +1 -1
- package/dist/cjs/hooks/json/vFor.cjs +1 -1
- package/dist/cjs/hooks/json/vIf.cjs +1 -1
- package/dist/cjs/hooks/json/vModel.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/vText.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/provider/app.cjs +1 -1
- package/dist/cjs/provider/tab.cjs +1 -1
- package/dist/cjs/utils/bus.cjs +1 -1
- package/dist/esm/_virtual/_rolldown/runtime.js +2 -0
- package/dist/esm/components/auth/can.js +3 -1
- package/dist/esm/components/common/icon.js +3 -1
- package/dist/esm/components/common/logo.js +3 -1
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/loader/iframe.js +2 -0
- package/dist/esm/components/loader/index.js +1 -0
- package/dist/esm/components/loader/loader.js +2 -0
- package/dist/esm/components/loader/remote/loader.js +2 -0
- package/dist/esm/components/loader/remote/render.js +3 -1
- package/dist/esm/components/overlay/overlay.js +3 -1
- package/dist/esm/components/status/error.js +3 -1
- package/dist/esm/components/status/exception.js +3 -1
- package/dist/esm/components/status/notAuthorized.js +3 -1
- package/dist/esm/components/status/notFound.js +3 -1
- package/dist/esm/config/color.js +3 -1
- package/dist/esm/directive/permission.js +3 -1
- package/dist/esm/hooks/auth.js +2 -62
- package/dist/esm/hooks/config.js +2 -5
- package/dist/esm/hooks/data.js +2 -47
- package/dist/esm/hooks/export.js +2 -0
- package/dist/esm/hooks/exportCsv.js +2 -0
- package/dist/esm/hooks/form.js +2 -0
- package/dist/esm/hooks/formExtend.js +2 -0
- package/dist/esm/hooks/formValidate.js +2 -0
- package/dist/esm/hooks/i18n.js +2 -0
- package/dist/esm/hooks/import.js +2 -0
- package/dist/esm/hooks/importCsv.js +2 -0
- package/dist/esm/hooks/json/index.js +3 -1
- package/dist/esm/hooks/json/utils/contextManager.js +2 -15
- package/dist/esm/hooks/json/utils/expressionParser.js +1 -0
- package/dist/esm/hooks/json/vFor.js +3 -1
- package/dist/esm/hooks/json/vIf.js +3 -1
- package/dist/esm/hooks/json/vModel.js +3 -1
- package/dist/esm/hooks/json/vOn.js +3 -1
- package/dist/esm/hooks/json/vShow.js +3 -1
- package/dist/esm/hooks/json/vText.js +3 -7
- package/dist/esm/hooks/json.js +2 -22
- package/dist/esm/hooks/list.js +2 -0
- package/dist/esm/hooks/manage.js +2 -6
- package/dist/esm/hooks/menu.js +2 -0
- package/dist/esm/hooks/overlay.js +2 -0
- package/dist/esm/hooks/select.js +2 -0
- package/dist/esm/hooks/theme.js +2 -0
- package/dist/esm/hooks/tree.js +2 -0
- package/dist/esm/hooks/upload/local.js +2 -0
- package/dist/esm/hooks/upload/s3.js +2 -0
- package/dist/esm/hooks/upload.js +2 -0
- package/dist/esm/index.js +30 -26
- package/dist/esm/main.js +2 -0
- package/dist/esm/preset/authProvider.js +2 -0
- package/dist/esm/preset/dataProvider.js +2 -0
- package/dist/esm/preset/i18nProvider.js +2 -0
- package/dist/esm/provider/app.js +45 -43
- package/dist/esm/provider/tab.js +3 -1
- package/dist/esm/router/route.js +2 -0
- package/dist/esm/stores/auth.js +2 -10
- package/dist/esm/stores/i18n.js +2 -10
- package/dist/esm/stores/jsonSchema.js +2 -13
- package/dist/esm/stores/manage.js +2 -15
- package/dist/esm/stores/route.js +2 -10
- package/dist/esm/stores/tab.js +2 -0
- package/dist/esm/stores/theme.js +2 -0
- package/dist/esm/utils/bus.js +3 -1
- package/dist/esm/utils/theme.js +2 -0
- package/dist/esm/utils/tree.js +2 -0
- package/dist/types/components/loader/index.d.ts +1 -0
- package/package.json +16 -16
package/dist/esm/hooks/data.js
CHANGED
|
@@ -3,10 +3,7 @@ import { useError as t, useGetAuth as n } from "./auth.js";
|
|
|
3
3
|
import { computed as r, ref as i, toRef as a, unref as o, watch as s } from "vue";
|
|
4
4
|
import { trimStart as c } from "lodash-es";
|
|
5
5
|
import { useInfiniteQuery as l, useMutation as u, useQuery as d, useQueryClient as f } from "@tanstack/vue-query";
|
|
6
|
-
|
|
7
|
-
* Get list data
|
|
8
|
-
* @param params
|
|
9
|
-
*/
|
|
6
|
+
//#region src/hooks/data.ts
|
|
10
7
|
function p(c) {
|
|
11
8
|
let l = e(), u = n(), f = c.providerName || "default", { mutate: p } = t(), m = a(c.pagination ? c.pagination : {
|
|
12
9
|
page: 1,
|
|
@@ -45,10 +42,6 @@ function p(c) {
|
|
|
45
42
|
pageCount: w
|
|
46
43
|
};
|
|
47
44
|
}
|
|
48
|
-
/**
|
|
49
|
-
* Get infinite list data
|
|
50
|
-
* @param params
|
|
51
|
-
*/
|
|
52
45
|
function m(o) {
|
|
53
46
|
let c = e(), u = n(), d = o.providerName || "default", { mutate: f } = t(), p = a(o, "pagination", {
|
|
54
47
|
page: 1,
|
|
@@ -115,10 +108,6 @@ function m(o) {
|
|
|
115
108
|
pageCount: y
|
|
116
109
|
};
|
|
117
110
|
}
|
|
118
|
-
/**
|
|
119
|
-
* Get one data
|
|
120
|
-
* @param params
|
|
121
|
-
*/
|
|
122
111
|
function h(a) {
|
|
123
112
|
let o = e(), c = n(), l = a.providerName || "default", { mutate: u } = t(), f = r(() => {
|
|
124
113
|
let { onError: e, options: t, ...n } = a;
|
|
@@ -142,10 +131,6 @@ function h(a) {
|
|
|
142
131
|
refetch: p.refetch
|
|
143
132
|
};
|
|
144
133
|
}
|
|
145
|
-
/**
|
|
146
|
-
* Get many data
|
|
147
|
-
* @param params
|
|
148
|
-
*/
|
|
149
134
|
function g(a) {
|
|
150
135
|
let o = e(), c = n(), l = a.providerName || "default", { mutate: u } = t(), f = r(() => {
|
|
151
136
|
let { onError: e, options: t, ...n } = a;
|
|
@@ -169,10 +154,6 @@ function g(a) {
|
|
|
169
154
|
refetch: p.refetch
|
|
170
155
|
};
|
|
171
156
|
}
|
|
172
|
-
/**
|
|
173
|
-
* Create data
|
|
174
|
-
* @param params
|
|
175
|
-
*/
|
|
176
157
|
function _(i) {
|
|
177
158
|
let a = e(), o = n(), s = i.providerName || "default", { mutate: c } = t(), { invalidate: l } = E(), d = r(() => {
|
|
178
159
|
let { onError: e, options: t, ...n } = i;
|
|
@@ -199,10 +180,6 @@ function _(i) {
|
|
|
199
180
|
mutate: f.mutate
|
|
200
181
|
};
|
|
201
182
|
}
|
|
202
|
-
/**
|
|
203
|
-
* Create data
|
|
204
|
-
* @param params
|
|
205
|
-
*/
|
|
206
183
|
function v(i) {
|
|
207
184
|
let a = e(), o = n(), s = i.providerName || "default", { mutate: c } = t(), { invalidate: l } = E(), d = r(() => {
|
|
208
185
|
let { onError: e, options: t, ...n } = i;
|
|
@@ -229,10 +206,6 @@ function v(i) {
|
|
|
229
206
|
mutate: f.mutate
|
|
230
207
|
};
|
|
231
208
|
}
|
|
232
|
-
/**
|
|
233
|
-
* Update data
|
|
234
|
-
* @param params
|
|
235
|
-
*/
|
|
236
209
|
function y(i) {
|
|
237
210
|
let a = e(), o = n(), s = i.providerName || "default", { mutate: c } = t(), { invalidate: l } = E(), d = r(() => {
|
|
238
211
|
let { onError: e, options: t, ...n } = i;
|
|
@@ -285,10 +258,6 @@ function b(i) {
|
|
|
285
258
|
mutate: f.mutate
|
|
286
259
|
};
|
|
287
260
|
}
|
|
288
|
-
/**
|
|
289
|
-
* Update data
|
|
290
|
-
* @param params
|
|
291
|
-
*/
|
|
292
261
|
function x(i) {
|
|
293
262
|
let a = e(), o = n(), s = i.providerName || "default", { mutate: c } = t(), { invalidate: l } = E(), d = r(() => {
|
|
294
263
|
let { onError: e, options: t, ...n } = i;
|
|
@@ -315,10 +284,6 @@ function x(i) {
|
|
|
315
284
|
mutate: f.mutate
|
|
316
285
|
};
|
|
317
286
|
}
|
|
318
|
-
/**
|
|
319
|
-
* Update data
|
|
320
|
-
* @param params
|
|
321
|
-
*/
|
|
322
287
|
function S(i) {
|
|
323
288
|
let a = e(), o = n(), s = i.providerName || "default", { mutate: c } = t(), { invalidate: l } = E(), d = r(() => {
|
|
324
289
|
let { onError: e, options: t, ...n } = i;
|
|
@@ -345,10 +310,6 @@ function S(i) {
|
|
|
345
310
|
mutate: f.mutate
|
|
346
311
|
};
|
|
347
312
|
}
|
|
348
|
-
/**
|
|
349
|
-
* Custom query request
|
|
350
|
-
* @param params
|
|
351
|
-
*/
|
|
352
313
|
function C(a) {
|
|
353
314
|
let o = e(), c = n(), l = a?.providerName || "default", { mutate: u } = t(), f = r(() => {
|
|
354
315
|
if (!a) return {};
|
|
@@ -372,10 +333,6 @@ function C(a) {
|
|
|
372
333
|
refetch: p.refetch
|
|
373
334
|
};
|
|
374
335
|
}
|
|
375
|
-
/**
|
|
376
|
-
* Custom mutation request
|
|
377
|
-
* @param params
|
|
378
|
-
*/
|
|
379
336
|
function w(i) {
|
|
380
337
|
let a = e(), o = n(), s = i?.providerName || "default", { mutate: c } = t(), l = r(() => {
|
|
381
338
|
if (!i) return {};
|
|
@@ -403,9 +360,6 @@ function w(i) {
|
|
|
403
360
|
mutate: d.mutate
|
|
404
361
|
};
|
|
405
362
|
}
|
|
406
|
-
/**
|
|
407
|
-
* Custom request client
|
|
408
|
-
*/
|
|
409
363
|
function T() {
|
|
410
364
|
let t = e(), r = n();
|
|
411
365
|
return { request: (e) => {
|
|
@@ -427,4 +381,5 @@ function E() {
|
|
|
427
381
|
}
|
|
428
382
|
} };
|
|
429
383
|
}
|
|
384
|
+
//#endregion
|
|
430
385
|
export { T as useClient, _ as useCreate, v as useCreateMany, C as useCustom, w as useCustomMutation, x as useDelete, S as useDeleteMany, m as useInfiniteList, E as useInvalidate, p as useList, g as useMany, h as useOne, y as useUpdate, b as useUpdateMany };
|
package/dist/esm/hooks/export.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useInfiniteList as e } from "./data.js";
|
|
2
2
|
import { computed as t, ref as n } from "vue";
|
|
3
|
+
//#region src/hooks/export.ts
|
|
3
4
|
var r = (e) => new Promise((t) => setTimeout(t, e));
|
|
4
5
|
function i(i) {
|
|
5
6
|
let a = n(!1), o = t(() => {
|
|
@@ -30,4 +31,5 @@ function i(i) {
|
|
|
30
31
|
}
|
|
31
32
|
};
|
|
32
33
|
}
|
|
34
|
+
//#endregion
|
|
33
35
|
export { i as useExport };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useExport as e } from "./export.js";
|
|
2
2
|
import { computed as t } from "vue";
|
|
3
3
|
import { json2csv as n } from "json-2-csv";
|
|
4
|
+
//#region src/hooks/exportCsv.ts
|
|
4
5
|
function r(r) {
|
|
5
6
|
let i = t(() => {
|
|
6
7
|
let { filename: e, headers: t, csvOptions: n, ...i } = r;
|
|
@@ -40,4 +41,5 @@ function r(r) {
|
|
|
40
41
|
}
|
|
41
42
|
});
|
|
42
43
|
}
|
|
44
|
+
//#endregion
|
|
43
45
|
export { r as useExportCsv };
|
package/dist/esm/hooks/form.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useCreate as e, useOne as t, useUpdate as n } from "./data.js";
|
|
2
2
|
import { computed as r, ref as i, toRef as a, watch as o } from "vue";
|
|
3
3
|
import { cloneDeep as s } from "lodash-es";
|
|
4
|
+
//#region src/hooks/form.ts
|
|
4
5
|
function c(c) {
|
|
5
6
|
let l = a(c, "form", {}), u = a(c, "id", void 0), d = a(c, "meta", {}), f = a(c, "params", {}), p = i(s(l.value || {})), m = i(s(l.value || {})), h = r(() => c.action === "edit" || !!u.value), { data: g, isLoading: _, refetch: v } = t({
|
|
6
7
|
get path() {
|
|
@@ -84,4 +85,5 @@ function c(c) {
|
|
|
84
85
|
onReset: y
|
|
85
86
|
};
|
|
86
87
|
}
|
|
88
|
+
//#endregion
|
|
87
89
|
export { c as useForm };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useForm as e } from "./form.js";
|
|
2
2
|
import { useValidateForm as t } from "./formValidate.js";
|
|
3
3
|
import { toRef as n } from "vue";
|
|
4
|
+
//#region src/hooks/formExtend.ts
|
|
4
5
|
function r(r) {
|
|
5
6
|
let i = n(r, "form", {}), { validate: a, reset: o } = t({
|
|
6
7
|
data: i,
|
|
@@ -34,4 +35,5 @@ function r(r) {
|
|
|
34
35
|
}
|
|
35
36
|
};
|
|
36
37
|
}
|
|
38
|
+
//#endregion
|
|
37
39
|
export { r as useExtendForm };
|
|
@@ -2,6 +2,7 @@ import { toRef as e, watch as t } from "vue";
|
|
|
2
2
|
import { cloneDeep as n } from "lodash-es";
|
|
3
3
|
import { all as r } from "@vee-validate/rules";
|
|
4
4
|
import { defineRule as i, useForm as a } from "vee-validate";
|
|
5
|
+
//#region src/hooks/formValidate.ts
|
|
5
6
|
function o(r) {
|
|
6
7
|
let i = e(r, "data"), { setValues: o, validate: s, resetForm: c, handleSubmit: l } = a({
|
|
7
8
|
initialValues: n(i.value || {}),
|
|
@@ -22,4 +23,5 @@ function s() {
|
|
|
22
23
|
i(e, t);
|
|
23
24
|
});
|
|
24
25
|
}
|
|
26
|
+
//#endregion
|
|
25
27
|
export { s as initFormValidate, o as useValidateForm };
|
package/dist/esm/hooks/i18n.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useI18nStore as e } from "../stores/i18n.js";
|
|
2
2
|
import "../stores/index.js";
|
|
3
3
|
import { useManage as t } from "./manage.js";
|
|
4
|
+
//#region src/hooks/i18n.ts
|
|
4
5
|
function n() {
|
|
5
6
|
let n = e(), r = t();
|
|
6
7
|
return {
|
|
@@ -12,4 +13,5 @@ function n() {
|
|
|
12
13
|
getLocales: () => r.config?.i18nProvider?.getLocales()
|
|
13
14
|
};
|
|
14
15
|
}
|
|
16
|
+
//#endregion
|
|
15
17
|
export { n as useI18n };
|
package/dist/esm/hooks/import.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useCustomMutation as e } from "./data.js";
|
|
2
2
|
import { computed as t, ref as n } from "vue";
|
|
3
|
+
//#region src/hooks/import.ts
|
|
3
4
|
var r = (e) => new Promise((t) => setTimeout(t, e));
|
|
4
5
|
function i(i) {
|
|
5
6
|
let a = n(!1), o = n({
|
|
@@ -43,4 +44,5 @@ function i(i) {
|
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
46
|
}
|
|
47
|
+
//#endregion
|
|
46
48
|
export { i as useImport };
|
|
@@ -2,6 +2,7 @@ import { useImport as e } from "./import.js";
|
|
|
2
2
|
import { computed as t } from "vue";
|
|
3
3
|
import { csv2json as n } from "json-2-csv";
|
|
4
4
|
import { useFileDialog as r } from "@vueuse/core";
|
|
5
|
+
//#region src/hooks/importCsv.ts
|
|
5
6
|
function i(i) {
|
|
6
7
|
let a = t(() => {
|
|
7
8
|
let { csvOptions: e, ...t } = i;
|
|
@@ -88,4 +89,5 @@ function i(i) {
|
|
|
88
89
|
readFile: l
|
|
89
90
|
};
|
|
90
91
|
}
|
|
92
|
+
//#endregion
|
|
91
93
|
export { i as useImportCsv };
|
|
@@ -4,7 +4,8 @@ import { vModelAdaptor as n } from "./vModel.js";
|
|
|
4
4
|
import { vOnAdaptor as r } from "./vOn.js";
|
|
5
5
|
import { vShowAdaptor as i } from "./vShow.js";
|
|
6
6
|
import { vTextAdaptor as a } from "./vText.js";
|
|
7
|
-
|
|
7
|
+
//#region src/hooks/json/index.ts
|
|
8
|
+
var o = [
|
|
8
9
|
t,
|
|
9
10
|
i,
|
|
10
11
|
e,
|
|
@@ -12,4 +13,5 @@ const o = [
|
|
|
12
13
|
r,
|
|
13
14
|
a
|
|
14
15
|
].sort((e, t) => t.priority - e.priority);
|
|
16
|
+
//#endregion
|
|
15
17
|
export { o as defaultAdaptors };
|
|
@@ -1,28 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
* 从属性中提取上下文
|
|
3
|
-
*/
|
|
1
|
+
//#region src/hooks/json/utils/contextManager.ts
|
|
4
2
|
function e(e) {
|
|
5
3
|
return e._context || {};
|
|
6
4
|
}
|
|
7
|
-
/**
|
|
8
|
-
* 注入上下文到属性
|
|
9
|
-
*/
|
|
10
5
|
function t(e, t) {
|
|
11
6
|
return Object.keys(t).length === 0 ? e : {
|
|
12
7
|
...e,
|
|
13
8
|
_context: t
|
|
14
9
|
};
|
|
15
10
|
}
|
|
16
|
-
/**
|
|
17
|
-
* 清理属性中的内部字段
|
|
18
|
-
*/
|
|
19
11
|
function n(e) {
|
|
20
12
|
let { _context: t, ...n } = e;
|
|
21
13
|
return n;
|
|
22
14
|
}
|
|
23
|
-
/**
|
|
24
|
-
* 创建适配器处理结果
|
|
25
|
-
*/
|
|
26
15
|
function r(e, t = {}) {
|
|
27
16
|
let n = { ...e };
|
|
28
17
|
return t.cleanKeys && t.cleanKeys.forEach((e) => delete n[e]), {
|
|
@@ -31,10 +20,8 @@ function r(e, t = {}) {
|
|
|
31
20
|
nodes: t.nodes
|
|
32
21
|
};
|
|
33
22
|
}
|
|
34
|
-
/**
|
|
35
|
-
* 通用条件求值函数
|
|
36
|
-
*/
|
|
37
23
|
function i(e, t, n) {
|
|
38
24
|
return typeof e == "string" ? !!n(e, t) : !!e;
|
|
39
25
|
}
|
|
26
|
+
//#endregion
|
|
40
27
|
export { n as cleanProps, r as createAdaptorResult, i as evaluateCondition, e as extractContext, t as injectContext };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { cleanProps as e, extractContext as t, injectContext as n } from "./utils/contextManager.js";
|
|
2
2
|
import { parseVForExpression as r } from "./utils/expressionParser.js";
|
|
3
|
-
|
|
3
|
+
//#region src/hooks/json/vFor.ts
|
|
4
|
+
var i = {
|
|
4
5
|
name: "v-for",
|
|
5
6
|
priority: 90,
|
|
6
7
|
process(i, a) {
|
|
@@ -48,4 +49,5 @@ const i = {
|
|
|
48
49
|
};
|
|
49
50
|
}
|
|
50
51
|
};
|
|
52
|
+
//#endregion
|
|
51
53
|
export { i as vForAdaptor };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createAdaptorResult as e, evaluateCondition as t, extractContext as n } from "./utils/contextManager.js";
|
|
2
2
|
import { evaluateExpression as r } from "./utils/expressionParser.js";
|
|
3
|
-
|
|
3
|
+
//#region src/hooks/json/vIf.ts
|
|
4
|
+
var i = {
|
|
4
5
|
name: "v-if",
|
|
5
6
|
priority: 100,
|
|
6
7
|
process(i, a) {
|
|
@@ -15,4 +16,5 @@ const i = {
|
|
|
15
16
|
});
|
|
16
17
|
}
|
|
17
18
|
};
|
|
19
|
+
//#endregion
|
|
18
20
|
export { i as vIfAdaptor };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { extractContext as e } from "./utils/contextManager.js";
|
|
2
2
|
import { evaluateExpression as t } from "./utils/expressionParser.js";
|
|
3
3
|
import { toRef as n } from "vue";
|
|
4
|
-
|
|
4
|
+
//#region src/hooks/json/vModel.ts
|
|
5
|
+
var r = {
|
|
5
6
|
name: "v-model",
|
|
6
7
|
priority: 70,
|
|
7
8
|
process(t, n) {
|
|
@@ -96,4 +97,5 @@ function a(e, t) {
|
|
|
96
97
|
}
|
|
97
98
|
}, e);
|
|
98
99
|
}
|
|
100
|
+
//#endregion
|
|
99
101
|
export { r as vModelAdaptor };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { evaluateCondition as e, extractContext as t } from "./utils/contextManager.js";
|
|
2
2
|
import { evaluateExpression as n } from "./utils/expressionParser.js";
|
|
3
|
-
|
|
3
|
+
//#region src/hooks/json/vShow.ts
|
|
4
|
+
var r = {
|
|
4
5
|
name: "v-show",
|
|
5
6
|
priority: 95,
|
|
6
7
|
process(r, i) {
|
|
@@ -18,4 +19,5 @@ const r = {
|
|
|
18
19
|
} };
|
|
19
20
|
}
|
|
20
21
|
};
|
|
22
|
+
//#endregion
|
|
21
23
|
export { r as vShowAdaptor };
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { evaluateExpression as e } from "./utils/expressionParser.js";
|
|
2
|
-
|
|
3
|
-
* 检查字符串是否包含插值表达式
|
|
4
|
-
*/
|
|
2
|
+
//#region src/hooks/json/vText.ts
|
|
5
3
|
function t(e) {
|
|
6
4
|
return typeof e == "string" && /\{\{.+?\}\}/.test(e);
|
|
7
5
|
}
|
|
8
|
-
/**
|
|
9
|
-
* 处理字符串插值
|
|
10
|
-
*/
|
|
11
6
|
function n(n, r) {
|
|
12
7
|
return t(n) ? n.replace(/\{\{([^}]+)\}\}/g, (t, n) => {
|
|
13
8
|
try {
|
|
@@ -18,7 +13,7 @@ function n(n, r) {
|
|
|
18
13
|
}
|
|
19
14
|
}) : n;
|
|
20
15
|
}
|
|
21
|
-
|
|
16
|
+
var r = {
|
|
22
17
|
name: "v-text",
|
|
23
18
|
priority: 50,
|
|
24
19
|
process(e, r) {
|
|
@@ -44,4 +39,5 @@ const r = {
|
|
|
44
39
|
} : { props: s } : null;
|
|
45
40
|
}
|
|
46
41
|
};
|
|
42
|
+
//#endregion
|
|
47
43
|
export { r as vTextAdaptor };
|
package/dist/esm/hooks/json.js
CHANGED
|
@@ -3,12 +3,10 @@ import { useConfig as t } from "./config.js";
|
|
|
3
3
|
import { injectContext as n } from "./json/utils/contextManager.js";
|
|
4
4
|
import { defaultAdaptors as r } from "./json/index.js";
|
|
5
5
|
import { computed as i, defineComponent as a, h as o, isRef as s, markRaw as c, unref as l } from "vue";
|
|
6
|
+
//#region src/hooks/json.tsx
|
|
6
7
|
function u(e) {
|
|
7
8
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
8
9
|
}
|
|
9
|
-
/**
|
|
10
|
-
* 加载组件到 store
|
|
11
|
-
*/
|
|
12
10
|
function d(e, t) {
|
|
13
11
|
Array.isArray(e) ? e.forEach((e) => {
|
|
14
12
|
let n = e, r = n.name;
|
|
@@ -17,19 +15,12 @@ function d(e, t) {
|
|
|
17
15
|
t.addComponent(c(n), e);
|
|
18
16
|
});
|
|
19
17
|
}
|
|
20
|
-
/**
|
|
21
|
-
* 初始化 JSON Schema 组件
|
|
22
|
-
* 在应用启动时调用,将配置中的组件加载到全局缓存
|
|
23
|
-
*/
|
|
24
18
|
function f(t, n) {
|
|
25
19
|
let r = e(n);
|
|
26
20
|
t.jsonSchema?.components && d(t.jsonSchema.components, r), t.manages?.forEach((e) => {
|
|
27
21
|
e.jsonSchema?.components && d(e.jsonSchema.components, r);
|
|
28
22
|
});
|
|
29
23
|
}
|
|
30
|
-
/**
|
|
31
|
-
* JSON Schema 渲染器
|
|
32
|
-
*/
|
|
33
24
|
function p(f) {
|
|
34
25
|
let p = t(), m = e(), h = [
|
|
35
26
|
...r,
|
|
@@ -41,33 +32,21 @@ function p(f) {
|
|
|
41
32
|
function _() {
|
|
42
33
|
return (s(f?.context) ? f?.context.value : f?.context) || {};
|
|
43
34
|
}
|
|
44
|
-
/**
|
|
45
|
-
* 处理节点属性,解包响应式数据
|
|
46
|
-
*/
|
|
47
35
|
function v(e) {
|
|
48
36
|
let t = {};
|
|
49
37
|
return Object.entries(e).forEach(([e, n]) => {
|
|
50
38
|
e !== "_context" && (t[e] = (e === "modelValue" || e.startsWith("modelValue") || e !== "value" && (e.includes("model") || e.includes("Model"))) && s(n) ? l(n) : n);
|
|
51
39
|
}), t;
|
|
52
40
|
}
|
|
53
|
-
/**
|
|
54
|
-
* 处理插槽内容
|
|
55
|
-
*/
|
|
56
41
|
function y(e, t, n) {
|
|
57
42
|
return typeof e == "string" ? e : typeof e == "function" ? y(e(t), t, n) : Array.isArray(e) ? e.flatMap((e) => y(e, t, n)).filter(Boolean) : e?.tag ? x(e, !0, {
|
|
58
43
|
...n,
|
|
59
44
|
...t
|
|
60
45
|
}) : e;
|
|
61
46
|
}
|
|
62
|
-
/**
|
|
63
|
-
* 处理子元素
|
|
64
|
-
*/
|
|
65
47
|
function b(e, t, n) {
|
|
66
48
|
if (e) return typeof e == "string" ? e : Array.isArray(e) ? e.flatMap((e) => typeof e == "string" ? e : x(e, t, n)).filter(Boolean) : x(e, t, n);
|
|
67
49
|
}
|
|
68
|
-
/**
|
|
69
|
-
* 处理单个节点
|
|
70
|
-
*/
|
|
71
50
|
function x(e, t = !1, r = {}) {
|
|
72
51
|
let { tag: i, attrs: a = {}, children: s, slots: l } = e, d = {
|
|
73
52
|
..._(),
|
|
@@ -132,4 +111,5 @@ function p(f) {
|
|
|
132
111
|
renderAsync: C
|
|
133
112
|
};
|
|
134
113
|
}
|
|
114
|
+
//#endregion
|
|
135
115
|
export { f as initJsonSchemaComponents, p as useJsonSchema };
|
package/dist/esm/hooks/list.js
CHANGED
|
@@ -3,6 +3,7 @@ import { useExportCsv as n } from "./exportCsv.js";
|
|
|
3
3
|
import { useImportCsv as r } from "./importCsv.js";
|
|
4
4
|
import { computed as i, ref as a, toRef as o, unref as s, watch as c } from "vue";
|
|
5
5
|
import { reactiveComputed as l, useCountdown as u } from "@vueuse/core";
|
|
6
|
+
//#region src/hooks/list.tsx
|
|
6
7
|
function d(d) {
|
|
7
8
|
let f = a(s(d.filters) || {}), p = a(s(d.sorters) || {}), m = o(typeof d.pagination == "object" ? d.pagination : {
|
|
8
9
|
page: 1,
|
|
@@ -148,4 +149,5 @@ function d(d) {
|
|
|
148
149
|
isBatching: Z
|
|
149
150
|
};
|
|
150
151
|
}
|
|
152
|
+
//#endregion
|
|
151
153
|
export { d as useExtendList };
|
package/dist/esm/hooks/manage.js
CHANGED
|
@@ -3,12 +3,7 @@ import "../stores/index.js";
|
|
|
3
3
|
import { inject as t } from "vue";
|
|
4
4
|
import { useRoute as n } from "vue-router";
|
|
5
5
|
import { trimStart as r } from "lodash-es";
|
|
6
|
-
|
|
7
|
-
* Manage
|
|
8
|
-
* get manage config
|
|
9
|
-
* @param name Manage name
|
|
10
|
-
* @returns Manage
|
|
11
|
-
*/
|
|
6
|
+
//#region src/hooks/manage.ts
|
|
12
7
|
function i(i) {
|
|
13
8
|
let a = t("dux.manage");
|
|
14
9
|
if (i ||= a?.value, !i) throw Error("manage name is not defined");
|
|
@@ -23,4 +18,5 @@ function i(i) {
|
|
|
23
18
|
}
|
|
24
19
|
};
|
|
25
20
|
}
|
|
21
|
+
//#endregion
|
|
26
22
|
export { i as useManage };
|
package/dist/esm/hooks/menu.js
CHANGED
|
@@ -6,6 +6,7 @@ import { computed as r, ref as i, watch as a } from "vue";
|
|
|
6
6
|
import { useRoute as o } from "vue-router";
|
|
7
7
|
import { storeToRefs as s } from "pinia";
|
|
8
8
|
import { cloneDeep as c } from "lodash-es";
|
|
9
|
+
//#region src/hooks/menu.ts
|
|
9
10
|
function l(l) {
|
|
10
11
|
let { routes: u } = s(e()), d = (e = !0) => c(u.value)?.filter((e) => !!e?.name).filter((t) => !e || t.hidden === void 0 || t.hidden === !1), f = r(() => t(d(!1), {
|
|
11
12
|
idKey: "name",
|
|
@@ -55,4 +56,5 @@ function l(l) {
|
|
|
55
56
|
subActive: _
|
|
56
57
|
};
|
|
57
58
|
}
|
|
59
|
+
//#endregion
|
|
58
60
|
export { l as useMenu };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { DuxOverlay as e } from "../components/overlay/overlay.js";
|
|
2
2
|
import "../components/index.js";
|
|
3
3
|
import { useOverlay as t } from "@overlastic/vue";
|
|
4
|
+
//#region src/hooks/overlay.ts
|
|
4
5
|
function n() {
|
|
5
6
|
let n = t(e);
|
|
6
7
|
return { show: (e) => n(e) };
|
|
7
8
|
}
|
|
9
|
+
//#endregion
|
|
8
10
|
export { n as useOverlay };
|
package/dist/esm/hooks/select.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useList as e, useMany as t } from "./data.js";
|
|
2
2
|
import { computed as n, reactive as r, ref as i, toRef as a, unref as o, watch as s } from "vue";
|
|
3
3
|
import { debounce as c, isArray as l } from "lodash-es";
|
|
4
|
+
//#region src/hooks/select.ts
|
|
4
5
|
function u(u) {
|
|
5
6
|
let d = a(u, "defaultValue"), f = i(), p = n(() => o(u.path) || ""), m = n(() => o(u.params) || {}), h = n(() => o(u.providerName)), g = i({
|
|
6
7
|
page: 1,
|
|
@@ -82,4 +83,5 @@ function u(u) {
|
|
|
82
83
|
pageCount: w
|
|
83
84
|
};
|
|
84
85
|
}
|
|
86
|
+
//#endregion
|
|
85
87
|
export { u as useSelect };
|
package/dist/esm/hooks/theme.js
CHANGED
|
@@ -6,6 +6,7 @@ import { computed as r, readonly as i, watch as a, watchEffect as o } from "vue"
|
|
|
6
6
|
import { storeToRefs as s } from "pinia";
|
|
7
7
|
import { useColorMode as c, useCycleList as l } from "@vueuse/core";
|
|
8
8
|
import { hex2rgb as u } from "colorizr";
|
|
9
|
+
//#region src/hooks/theme.ts
|
|
9
10
|
function d() {
|
|
10
11
|
let d = t(), { mode: f } = s(d), p = c({ storageRef: f }), m = n(), { state: h, next: g, go: _ } = l([
|
|
11
12
|
"dark",
|
|
@@ -287,4 +288,5 @@ function d() {
|
|
|
287
288
|
getSemanticColor: V
|
|
288
289
|
};
|
|
289
290
|
}
|
|
291
|
+
//#endregion
|
|
290
292
|
export { d as useTheme };
|
package/dist/esm/hooks/tree.js
CHANGED
|
@@ -2,6 +2,7 @@ import { useList as e } from "./data.js";
|
|
|
2
2
|
import { arrayToTree as t, treeToArr as n } from "../utils/tree.js";
|
|
3
3
|
import "../utils/index.js";
|
|
4
4
|
import { computed as r, reactive as i, unref as a, watch as o } from "vue";
|
|
5
|
+
//#region src/hooks/tree.ts
|
|
5
6
|
function s(s) {
|
|
6
7
|
let c = r(() => a(s.path) || ""), l = r(() => a(s.params) || {}), u = r(() => a(s.providerName)), d = i({ ...l.value });
|
|
7
8
|
o(l, (e) => {
|
|
@@ -41,4 +42,5 @@ function s(s) {
|
|
|
41
42
|
expanded: h
|
|
42
43
|
};
|
|
43
44
|
}
|
|
45
|
+
//#endregion
|
|
44
46
|
export { s as useTree };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useClient as e } from "../data.js";
|
|
2
2
|
import t from "axios";
|
|
3
|
+
//#region src/hooks/upload/s3.ts
|
|
3
4
|
function n(n) {
|
|
4
5
|
let r = e();
|
|
5
6
|
return { async upload(e, i) {
|
|
@@ -68,4 +69,5 @@ function n(n) {
|
|
|
68
69
|
};
|
|
69
70
|
} };
|
|
70
71
|
}
|
|
72
|
+
//#endregion
|
|
71
73
|
export { n as createS3UploadDriver };
|
package/dist/esm/hooks/upload.js
CHANGED
|
@@ -2,6 +2,7 @@ import { createLocalUploadDriver as e } from "./upload/local.js";
|
|
|
2
2
|
import { computed as t, ref as n, watch as r } from "vue";
|
|
3
3
|
import { uniqueId as i } from "lodash-es";
|
|
4
4
|
import { useFileDialog as a } from "@vueuse/core";
|
|
5
|
+
//#region src/hooks/upload.ts
|
|
5
6
|
function o(o) {
|
|
6
7
|
o ||= {};
|
|
7
8
|
let s = n(!1), c = n([]), l = n(-1), u = n(/* @__PURE__ */ new Map()), d = o.driver || e(), f = t(() => {
|
|
@@ -254,4 +255,5 @@ function o(o) {
|
|
|
254
255
|
cancelFiles: w
|
|
255
256
|
};
|
|
256
257
|
}
|
|
258
|
+
//#endregion
|
|
257
259
|
export { o as useUpload };
|