@duxweb/dvha-core 0.1.23 → 1.0.14
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/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 +62 -47
- 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 +24 -22
- package/dist/esm/main.js +7 -6
- package/dist/esm/provider/app.js +3 -2
- package/dist/esm/utils/bus.js +5 -0
- package/dist/types/hooks/data.d.ts +6 -66
- package/dist/types/hooks/json.d.ts +5 -1
- package/dist/types/hooks/upload/local.d.ts +1 -1
- package/dist/types/hooks/upload.d.ts +1 -1
- 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/hooks/upload.js
CHANGED
|
@@ -2,36 +2,36 @@ import { useFileDialog as Q } from "@vueuse/core";
|
|
|
2
2
|
import { uniqueId as R } from "lodash-es";
|
|
3
3
|
import { ref as g, computed as v, watch as V } from "vue";
|
|
4
4
|
import { createLocalUploadDriver as W } from "./upload/local.js";
|
|
5
|
-
function ne(
|
|
6
|
-
|
|
7
|
-
const w = g(!1), i = g([]),
|
|
8
|
-
const { onProgress: e, onDataCallback: n, onCancel:
|
|
5
|
+
function ne(a) {
|
|
6
|
+
a = a || {};
|
|
7
|
+
const w = g(!1), i = g([]), d = g(-1), f = g(/* @__PURE__ */ new Map()), $ = a.driver || W(), I = v(() => {
|
|
8
|
+
const { onProgress: e, onDataCallback: n, onCancel: l, onComplete: t, maxFileSize: c, maxFileCount: r, accept: o, multiple: s, autoUpload: u, options: A, onSuccess: P, onError: b, method: Y, driver: Z, ...J } = a;
|
|
9
9
|
return J;
|
|
10
|
-
}),
|
|
11
|
-
const e = i.value.length, n = i.value.reduce((
|
|
12
|
-
let
|
|
13
|
-
return i.value.forEach((
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
}), n > 0 && (t = Math.round(
|
|
17
|
-
index:
|
|
10
|
+
}), k = v(() => a.method || "POST"), T = v(() => {
|
|
11
|
+
const e = i.value.length, n = i.value.reduce((r, o) => r + (o.filesize || 0), 0);
|
|
12
|
+
let l = 0, t = 0;
|
|
13
|
+
return i.value.forEach((r, o) => {
|
|
14
|
+
var s;
|
|
15
|
+
o < d.value ? l += r.filesize || 0 : o === d.value && (l += ((s = r.progress) == null ? void 0 : s.loaded) || 0);
|
|
16
|
+
}), n > 0 && (t = Math.round(l / n * 100)), {
|
|
17
|
+
index: d.value >= 0 ? d.value + 1 : 0,
|
|
18
18
|
totalFiles: e,
|
|
19
|
-
currentFile: i.value[
|
|
19
|
+
currentFile: i.value[d.value],
|
|
20
20
|
totalPercent: t,
|
|
21
|
-
totalLoaded:
|
|
21
|
+
totalLoaded: l,
|
|
22
22
|
totalSize: n
|
|
23
23
|
};
|
|
24
|
-
}),
|
|
24
|
+
}), F = (e) => {
|
|
25
25
|
if (e === 0)
|
|
26
26
|
return "0 Bytes";
|
|
27
|
-
const n = 1024,
|
|
28
|
-
return `${Number.parseFloat((e / n ** t).toFixed(2))} ${
|
|
27
|
+
const n = 1024, l = ["Bytes", "KB", "MB", "GB"], t = Math.floor(Math.log(e) / Math.log(n));
|
|
28
|
+
return `${Number.parseFloat((e / n ** t).toFixed(2))} ${l[t]}`;
|
|
29
29
|
}, h = (e) => {
|
|
30
30
|
if (e === 0)
|
|
31
31
|
return "0 B/s";
|
|
32
|
-
const n = 1024,
|
|
33
|
-
return `${Number.parseFloat((e / n ** t).toFixed(2))} ${
|
|
34
|
-
},
|
|
32
|
+
const n = 1024, l = ["B/s", "KB/s", "MB/s", "GB/s"], t = Math.floor(Math.log(e) / Math.log(n));
|
|
33
|
+
return `${Number.parseFloat((e / n ** t).toFixed(2))} ${l[t]}`;
|
|
34
|
+
}, z = () => R("upload-"), D = async (e, n, l) => {
|
|
35
35
|
switch (n) {
|
|
36
36
|
case "file": {
|
|
37
37
|
if (!(e instanceof File))
|
|
@@ -46,11 +46,11 @@ function ne(l) {
|
|
|
46
46
|
case "base64": {
|
|
47
47
|
if (typeof e != "string")
|
|
48
48
|
throw new TypeError('Payload must be a string when type is "base64"');
|
|
49
|
-
const t = e.includes(",") ? e.split(",")[1] : e, c = e.includes(",") ? e.split(",")[0].split(":")[1].split(";")[0] : "application/octet-stream",
|
|
50
|
-
for (let
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
return new File([
|
|
49
|
+
const t = e.includes(",") ? e.split(",")[1] : e, c = e.includes(",") ? e.split(",")[0].split(":")[1].split(";")[0] : "application/octet-stream", r = atob(t), o = new Uint8Array(r.length);
|
|
50
|
+
for (let u = 0; u < r.length; u++)
|
|
51
|
+
o[u] = r.charCodeAt(u);
|
|
52
|
+
const s = new Blob([o], { type: c });
|
|
53
|
+
return new File([s], "base64-file", { type: c });
|
|
54
54
|
}
|
|
55
55
|
case "arrayBuffer": {
|
|
56
56
|
if (!(e instanceof ArrayBuffer))
|
|
@@ -61,21 +61,21 @@ function ne(l) {
|
|
|
61
61
|
default:
|
|
62
62
|
throw new Error(`Unsupported upload type: ${n}`);
|
|
63
63
|
}
|
|
64
|
-
},
|
|
65
|
-
if (
|
|
66
|
-
throw new Error(`File size cannot exceed ${
|
|
67
|
-
if (
|
|
68
|
-
throw new Error(`File count cannot exceed ${
|
|
69
|
-
},
|
|
70
|
-
const t = await
|
|
71
|
-
|
|
64
|
+
}, C = (e) => {
|
|
65
|
+
if (a.maxFileSize && e.size > a.maxFileSize)
|
|
66
|
+
throw new Error(`File size cannot exceed ${F(a.maxFileSize)}`);
|
|
67
|
+
if (a.maxFileCount && i.value.length >= a.maxFileCount)
|
|
68
|
+
throw new Error(`File count cannot exceed ${a.maxFileCount}`);
|
|
69
|
+
}, G = async (e, n, l) => {
|
|
70
|
+
const t = await D(e, n);
|
|
71
|
+
C(t);
|
|
72
72
|
const c = {
|
|
73
|
-
id:
|
|
73
|
+
id: z(),
|
|
74
74
|
file: t,
|
|
75
75
|
filename: t.name,
|
|
76
76
|
filesize: t.size,
|
|
77
77
|
filetype: t.type,
|
|
78
|
-
filesizeText:
|
|
78
|
+
filesizeText: F(t.size),
|
|
79
79
|
status: "pending",
|
|
80
80
|
progress: {
|
|
81
81
|
loaded: 0,
|
|
@@ -89,58 +89,58 @@ function ne(l) {
|
|
|
89
89
|
};
|
|
90
90
|
return i.value.push(c), c;
|
|
91
91
|
}, m = (e, n) => {
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
},
|
|
92
|
+
const l = i.value.findIndex((t) => t.id === e);
|
|
93
|
+
l !== -1 && (i.value[l] = { ...i.value[l], ...n });
|
|
94
|
+
}, E = () => {
|
|
95
95
|
var n;
|
|
96
|
-
i.value.every((
|
|
97
|
-
},
|
|
98
|
-
var
|
|
96
|
+
i.value.every((l) => l.status !== "uploading") && ((n = a.onComplete) == null || n.call(a, i.value));
|
|
97
|
+
}, y = (e) => {
|
|
98
|
+
var l;
|
|
99
99
|
const n = i.value.find((t) => t.id === e);
|
|
100
100
|
if (!n || n.status !== "pending" && n.status !== "uploading")
|
|
101
101
|
return !1;
|
|
102
102
|
if (n.status === "uploading") {
|
|
103
|
-
const t =
|
|
104
|
-
t && (t.abort(),
|
|
103
|
+
const t = f.value.get(e);
|
|
104
|
+
t && (t.abort(), f.value.delete(e));
|
|
105
105
|
}
|
|
106
106
|
return m(e, {
|
|
107
107
|
status: "cancelled"
|
|
108
|
-
}), (
|
|
109
|
-
},
|
|
110
|
-
e ? e.forEach((n) =>
|
|
111
|
-
},
|
|
108
|
+
}), (l = a.onCancel) == null || l.call(a, e), E(), !0;
|
|
109
|
+
}, K = (e) => {
|
|
110
|
+
e ? e.forEach((n) => y(n)) : i.value.forEach((n) => y(n.id));
|
|
111
|
+
}, L = async (e) => {
|
|
112
112
|
if (!e.file)
|
|
113
113
|
throw new Error("File not found");
|
|
114
|
-
|
|
114
|
+
C(e.file);
|
|
115
115
|
const n = new AbortController();
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
m(e.id, { status: "uploading" }),
|
|
119
|
-
|
|
120
|
-
method:
|
|
116
|
+
f.value.set(e.id, n);
|
|
117
|
+
const l = Date.now();
|
|
118
|
+
return m(e.id, { status: "uploading" }), $.upload(e.file, {
|
|
119
|
+
...I.value,
|
|
120
|
+
method: k.value,
|
|
121
121
|
signal: n.signal,
|
|
122
122
|
onUploadProgress: (t) => {
|
|
123
|
-
var
|
|
124
|
-
const
|
|
123
|
+
var b;
|
|
124
|
+
const o = (Date.now() - l) / 1e3, s = o > 0 ? t.loaded / o : 0, u = (t.total || 0) - t.loaded, A = s > 0 ? u / s : 0, P = {
|
|
125
125
|
loaded: t.loaded,
|
|
126
126
|
total: t.total,
|
|
127
127
|
percent: t.percent || 0,
|
|
128
|
-
speed: Math.round(
|
|
129
|
-
speedText: h(
|
|
130
|
-
uploadTime: Math.round(
|
|
131
|
-
remainingTime: Math.round(
|
|
128
|
+
speed: Math.round(s),
|
|
129
|
+
speedText: h(s),
|
|
130
|
+
uploadTime: Math.round(o),
|
|
131
|
+
remainingTime: Math.round(A)
|
|
132
132
|
};
|
|
133
133
|
m(e.id, {
|
|
134
134
|
status: "uploading",
|
|
135
135
|
progress: P
|
|
136
|
-
}), (
|
|
136
|
+
}), (b = a.onProgress) == null || b.call(a, T.value);
|
|
137
137
|
}
|
|
138
138
|
}).then((t) => {
|
|
139
|
-
var s,
|
|
139
|
+
var s, u;
|
|
140
140
|
if (e.status === "cancelled")
|
|
141
|
-
|
|
142
|
-
const c = ((s =
|
|
143
|
-
|
|
141
|
+
throw new Error("Upload cancelled");
|
|
142
|
+
const c = ((s = a.onDataCallback) == null ? void 0 : s.call(a, t, e)) || t.data, r = Math.round((Date.now() - l) / 1e3), o = {
|
|
143
|
+
...e,
|
|
144
144
|
status: "success",
|
|
145
145
|
data: t,
|
|
146
146
|
...c,
|
|
@@ -150,80 +150,86 @@ function ne(l) {
|
|
|
150
150
|
percent: 100,
|
|
151
151
|
speed: 0,
|
|
152
152
|
speedText: h(0),
|
|
153
|
-
uploadTime:
|
|
153
|
+
uploadTime: r,
|
|
154
154
|
remainingTime: 0
|
|
155
155
|
}
|
|
156
|
-
}
|
|
156
|
+
};
|
|
157
|
+
return m(e.id, o), f.value.delete(e.id), (u = a.onSuccess) == null || u.call(a, t), o;
|
|
157
158
|
}).catch((t) => {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}), d.value.delete(e.id), t;
|
|
159
|
+
throw t.message === "canceled" || e.status === "cancelled" ? new Error("Upload cancelled") : (m(e.id, {
|
|
160
|
+
status: "error",
|
|
161
|
+
error: t.message
|
|
162
|
+
}), f.value.delete(e.id), t);
|
|
163
163
|
}).finally(() => {
|
|
164
|
-
|
|
164
|
+
E();
|
|
165
165
|
});
|
|
166
166
|
}, B = async () => {
|
|
167
167
|
var n;
|
|
168
|
-
const e = i.value.filter((
|
|
169
|
-
if (e.length
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
message: (a == null ? void 0 : a.message) || "upload failed"
|
|
180
|
-
}), a;
|
|
181
|
-
} finally {
|
|
182
|
-
w.value = !1, u.value = -1;
|
|
168
|
+
const e = i.value.filter((l) => l.status === "pending");
|
|
169
|
+
if (e.length === 0)
|
|
170
|
+
return [];
|
|
171
|
+
w.value = !0;
|
|
172
|
+
try {
|
|
173
|
+
const l = [];
|
|
174
|
+
for (let t = 0; t < e.length; t++) {
|
|
175
|
+
const c = e[t], r = i.value.findIndex((s) => s.id === c.id);
|
|
176
|
+
d.value = r;
|
|
177
|
+
const o = await L(c);
|
|
178
|
+
l.push(o);
|
|
183
179
|
}
|
|
180
|
+
return l;
|
|
181
|
+
} catch (l) {
|
|
182
|
+
throw (n = a.onError) == null || n.call(a, {
|
|
183
|
+
status: (l == null ? void 0 : l.status) || 500,
|
|
184
|
+
message: (l == null ? void 0 : l.message) || "upload failed"
|
|
185
|
+
}), l;
|
|
186
|
+
} finally {
|
|
187
|
+
w.value = !1, d.value = -1;
|
|
184
188
|
}
|
|
185
|
-
},
|
|
186
|
-
|
|
189
|
+
}, x = () => {
|
|
190
|
+
i.value.forEach((e) => {
|
|
191
|
+
y(e.id);
|
|
192
|
+
}), f.value.clear(), i.value = [], d.value = -1;
|
|
193
|
+
}, M = async (e, n = "file") => {
|
|
194
|
+
var l;
|
|
187
195
|
try {
|
|
188
|
-
if (!
|
|
196
|
+
if (!a.multiple && e.length > 1)
|
|
189
197
|
throw new Error("Single file mode: only one file can be selected");
|
|
190
|
-
if (
|
|
191
|
-
throw new Error(`Adding ${e.length} files would exceed the maximum limit of ${
|
|
198
|
+
if (!a.multiple && i.value.length > 0 && x(), a.maxFileCount && i.value.length + e.length > a.maxFileCount)
|
|
199
|
+
throw new Error(`Adding ${e.length} files would exceed the maximum limit of ${a.maxFileCount}`);
|
|
192
200
|
for (const t of e)
|
|
193
|
-
await
|
|
201
|
+
await G(t, n);
|
|
194
202
|
} catch (t) {
|
|
195
|
-
throw (
|
|
203
|
+
throw (l = a.onError) == null || l.call(a, {
|
|
196
204
|
status: (t == null ? void 0 : t.status) || 400,
|
|
197
205
|
message: (t == null ? void 0 : t.message) || "Failed to add files"
|
|
198
206
|
}), t;
|
|
199
207
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}), d.value.clear(), i.value = [], u.value = -1;
|
|
205
|
-
}, M = (e) => {
|
|
208
|
+
a.autoUpload && B().catch((t) => {
|
|
209
|
+
console.warn("Auto upload failed:", t);
|
|
210
|
+
});
|
|
211
|
+
}, U = (e) => {
|
|
206
212
|
const n = i.value.find((t) => t.id === e);
|
|
207
213
|
if (n && n.status === "uploading") {
|
|
208
214
|
m(e, {
|
|
209
215
|
status: "cancelled"
|
|
210
216
|
});
|
|
211
|
-
const t =
|
|
217
|
+
const t = f.value.get(e);
|
|
212
218
|
if (!t)
|
|
213
219
|
return;
|
|
214
|
-
t.abort(),
|
|
220
|
+
t.abort(), f.value.delete(e);
|
|
215
221
|
}
|
|
216
|
-
const
|
|
217
|
-
|
|
222
|
+
const l = i.value.findIndex((t) => t.id === e);
|
|
223
|
+
l !== -1 && i.value.splice(l, 1);
|
|
218
224
|
}, N = (e) => {
|
|
219
|
-
e ? e.forEach((n) =>
|
|
225
|
+
e ? e.forEach((n) => U(n)) : i.value.forEach((n) => U(n.id));
|
|
220
226
|
}, { files: q, open: O, reset: S } = Q({
|
|
221
|
-
accept:
|
|
222
|
-
multiple:
|
|
227
|
+
accept: a.accept,
|
|
228
|
+
multiple: a.multiple || !1
|
|
223
229
|
}), j = (e) => ({
|
|
224
|
-
id:
|
|
230
|
+
id: z(),
|
|
225
231
|
...e,
|
|
226
|
-
filesizeText: e.filesize ?
|
|
232
|
+
filesizeText: e.filesize ? F(e.filesize) : void 0,
|
|
227
233
|
status: e.url ? "success" : "pending",
|
|
228
234
|
progress: {
|
|
229
235
|
loaded: 0,
|
|
@@ -238,8 +244,8 @@ function ne(l) {
|
|
|
238
244
|
V(q, async (e) => {
|
|
239
245
|
if (e && e.length > 0) {
|
|
240
246
|
const n = Array.from(e);
|
|
241
|
-
S(), await
|
|
242
|
-
console.warn("Failed to add selected files:",
|
|
247
|
+
S(), await M(n, "file").catch((l) => {
|
|
248
|
+
console.warn("Failed to add selected files:", l);
|
|
243
249
|
});
|
|
244
250
|
}
|
|
245
251
|
});
|
|
@@ -253,18 +259,19 @@ function ne(l) {
|
|
|
253
259
|
isUploading: w,
|
|
254
260
|
uploadFiles: i,
|
|
255
261
|
dataFiles: H,
|
|
256
|
-
progress:
|
|
262
|
+
progress: T,
|
|
257
263
|
open: O,
|
|
258
264
|
trigger: B,
|
|
259
265
|
resetFiles: S,
|
|
260
|
-
clearFiles:
|
|
266
|
+
clearFiles: x,
|
|
261
267
|
removeFiles: N,
|
|
262
|
-
addFiles:
|
|
268
|
+
addFiles: M,
|
|
263
269
|
addDataFiles: (e) => {
|
|
264
|
-
|
|
270
|
+
!a.multiple && i.value.length > 0 && x();
|
|
271
|
+
const n = e.map((l) => j(l));
|
|
265
272
|
i.value.push(...n);
|
|
266
273
|
},
|
|
267
|
-
cancelFiles:
|
|
274
|
+
cancelFiles: K
|
|
268
275
|
};
|
|
269
276
|
}
|
|
270
277
|
export {
|
package/dist/esm/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { DuxLogo as p } from "./components/common/logo.js";
|
|
|
3
3
|
import { DuxLogoIcon as x } from "./components/common/icon.js";
|
|
4
4
|
import { default as s } from "./components/loader/iframe.js";
|
|
5
5
|
import { DuxOverlay as a } from "./components/overlay/overlay.js";
|
|
6
|
-
import { DuxError as
|
|
6
|
+
import { DuxError as d } from "./components/status/error.js";
|
|
7
7
|
import { DuxException as l } from "./components/status/exception.js";
|
|
8
8
|
import { DuxNotAuthorized as D } from "./components/status/notAuthorized.js";
|
|
9
9
|
import { DuxNotFound as h } from "./components/status/notFound.js";
|
|
@@ -18,7 +18,7 @@ import { useExtendForm as oe } from "./hooks/formExtend.js";
|
|
|
18
18
|
import { initFormValidate as pe, useValidateForm as ue } from "./hooks/formValidate.js";
|
|
19
19
|
import { useI18n as me } from "./hooks/i18n.js";
|
|
20
20
|
import { useImport as fe } from "./hooks/import.js";
|
|
21
|
-
import { useImportCsv as
|
|
21
|
+
import { useImportCsv as ie } from "./hooks/importCsv.js";
|
|
22
22
|
import { useJsonSchema as ne } from "./hooks/json.js";
|
|
23
23
|
import { defaultAdaptors as ve } from "./hooks/json/index.js";
|
|
24
24
|
import { useExtendList as Ae } from "./hooks/list.js";
|
|
@@ -44,18 +44,19 @@ import { useManageStore as rr } from "./stores/manage.js";
|
|
|
44
44
|
import { useRouteStore as tr } from "./stores/route.js";
|
|
45
45
|
import { createTabStore as ur, useTabStore as xr } from "./stores/tab.js";
|
|
46
46
|
import { useThemeStore as sr } from "./stores/theme.js";
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
47
|
+
import { emitter as ar } from "./utils/bus.js";
|
|
48
|
+
import { themePreset as dr } from "./utils/theme.js";
|
|
49
|
+
import { arrayToTree as lr, searchTree as vr, treeToArr as Dr } from "./utils/tree.js";
|
|
50
|
+
import { vForAdaptor as hr } from "./hooks/json/vFor.js";
|
|
51
|
+
import { vIfAdaptor as cr } from "./hooks/json/vIf.js";
|
|
52
|
+
import { vModelAdaptor as Tr } from "./hooks/json/vModel.js";
|
|
53
|
+
import { vOnAdaptor as Ir } from "./hooks/json/vOn.js";
|
|
54
|
+
import { vShowAdaptor as Mr } from "./hooks/json/vShow.js";
|
|
55
|
+
import { vTextAdaptor as Er } from "./hooks/json/vText.js";
|
|
55
56
|
export {
|
|
56
57
|
He as DuxAppProvider,
|
|
57
58
|
o as DuxCan,
|
|
58
|
-
|
|
59
|
+
d as DuxError,
|
|
59
60
|
l as DuxException,
|
|
60
61
|
s as DuxLoaderIframe,
|
|
61
62
|
p as DuxLogo,
|
|
@@ -64,21 +65,22 @@ export {
|
|
|
64
65
|
h as DuxNotFound,
|
|
65
66
|
a as DuxOverlay,
|
|
66
67
|
Qe as DuxTabRouterView,
|
|
67
|
-
|
|
68
|
+
lr as arrayToTree,
|
|
68
69
|
Ne as createDux,
|
|
69
70
|
Oe as createLocalUploadDriver,
|
|
70
71
|
be as createS3UploadDriver,
|
|
71
72
|
ur as createTabStore,
|
|
72
73
|
ve as defaultAdaptors,
|
|
74
|
+
ar as emitter,
|
|
73
75
|
qe as i18nProvider,
|
|
74
76
|
pe as initFormValidate,
|
|
75
77
|
Xe as initRouter,
|
|
76
|
-
|
|
78
|
+
vr as searchTree,
|
|
77
79
|
ze as simpleAuthProvider,
|
|
78
80
|
Je as simpleDataProvider,
|
|
79
81
|
c as themeColor,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
+
dr as themePreset,
|
|
83
|
+
Dr as treeToArr,
|
|
82
84
|
Ze as useAuthStore,
|
|
83
85
|
T as useCan,
|
|
84
86
|
g as useCheck,
|
|
@@ -101,7 +103,7 @@ export {
|
|
|
101
103
|
me as useI18n,
|
|
102
104
|
$e as useI18nStore,
|
|
103
105
|
fe as useImport,
|
|
104
|
-
|
|
106
|
+
ie as useImportCsv,
|
|
105
107
|
j as useInfiniteList,
|
|
106
108
|
q as useInvalidate,
|
|
107
109
|
y as useIsLogin,
|
|
@@ -127,10 +129,10 @@ export {
|
|
|
127
129
|
U as useUpdatePassword,
|
|
128
130
|
Ue as useUpload,
|
|
129
131
|
ue as useValidateForm,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
132
|
+
hr as vForAdaptor,
|
|
133
|
+
cr as vIfAdaptor,
|
|
134
|
+
Tr as vModelAdaptor,
|
|
135
|
+
Ir as vOnAdaptor,
|
|
136
|
+
Mr as vShowAdaptor,
|
|
137
|
+
Er as vTextAdaptor
|
|
136
138
|
};
|
package/dist/esm/main.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { VueQueryPlugin as e } from "@tanstack/vue-query";
|
|
2
2
|
import { createPinia as m } from "pinia";
|
|
3
3
|
import n from "pinia-plugin-persistedstate";
|
|
4
|
-
import { ref as
|
|
5
|
-
import { permissionDirective as
|
|
4
|
+
import { ref as p } from "vue";
|
|
5
|
+
import { permissionDirective as u } from "./directive/permission.js";
|
|
6
6
|
import "vue-router";
|
|
7
7
|
import "lodash-es";
|
|
8
8
|
import "json-2-csv";
|
|
9
9
|
import { initFormValidate as d } from "./hooks/formValidate.js";
|
|
10
10
|
import "@vueuse/core";
|
|
11
11
|
import "./hooks/json/index.js";
|
|
12
|
+
import "./utils/bus.js";
|
|
12
13
|
import "@overlastic/vue";
|
|
13
14
|
import "clsx";
|
|
14
15
|
import "colorizr";
|
|
15
16
|
import "axios";
|
|
16
17
|
import { initRouter as a } from "./router/route.js";
|
|
17
|
-
function
|
|
18
|
+
function j(i) {
|
|
18
19
|
const o = m();
|
|
19
20
|
return o.use(n), {
|
|
20
21
|
install(r) {
|
|
@@ -24,11 +25,11 @@ function h(i) {
|
|
|
24
25
|
"background:#41b883 ; padding: 1px; border-radius: 0 3px 3px 0; color: #fff",
|
|
25
26
|
"background:transparent"
|
|
26
27
|
), d();
|
|
27
|
-
const t =
|
|
28
|
-
r.provide("dux.config", i), r.provide("dux.manage", t), r.directive("can",
|
|
28
|
+
const t = p();
|
|
29
|
+
r.provide("dux.config", i), r.provide("dux.manage", t), r.directive("can", u), r.use(o), r.use(e), r.use(a(i));
|
|
29
30
|
}
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
export {
|
|
33
|
-
|
|
34
|
+
j as createDux
|
|
34
35
|
};
|
package/dist/esm/provider/app.js
CHANGED
|
@@ -16,13 +16,14 @@ import { useRouteStore as Y } from "../stores/route.js";
|
|
|
16
16
|
import "pinia";
|
|
17
17
|
import "@vueuse/core";
|
|
18
18
|
import "../hooks/json/index.js";
|
|
19
|
+
import "../utils/bus.js";
|
|
19
20
|
import "colorizr";
|
|
20
21
|
import "axios";
|
|
21
22
|
import "clsx";
|
|
22
23
|
import { DuxError as Z } from "../components/status/error.js";
|
|
23
24
|
import { DuxNotAuthorized as x } from "../components/status/notAuthorized.js";
|
|
24
25
|
import { DuxNotFound as ee } from "../components/status/notFound.js";
|
|
25
|
-
const
|
|
26
|
+
const we = /* @__PURE__ */ V({
|
|
26
27
|
name: "DuxAppProvider",
|
|
27
28
|
props: {},
|
|
28
29
|
setup(te, {
|
|
@@ -154,5 +155,5 @@ const De = /* @__PURE__ */ V({
|
|
|
154
155
|
}
|
|
155
156
|
});
|
|
156
157
|
export {
|
|
157
|
-
|
|
158
|
+
we as DuxAppProvider
|
|
158
159
|
};
|
|
@@ -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>;
|