@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.
Files changed (45) hide show
  1. package/dist/cjs/components/auth/can.cjs +1 -1
  2. package/dist/cjs/components/loader/loader.cjs +1 -1
  3. package/dist/cjs/components/loader/remote/loader.cjs +1 -1
  4. package/dist/cjs/directive/permission.cjs +1 -1
  5. package/dist/cjs/hooks/data.cjs +1 -1
  6. package/dist/cjs/hooks/json/vModel.cjs +1 -1
  7. package/dist/cjs/hooks/json.cjs +1 -1
  8. package/dist/cjs/hooks/menu.cjs +1 -1
  9. package/dist/cjs/hooks/overlay.cjs +1 -1
  10. package/dist/cjs/hooks/tree.cjs +1 -1
  11. package/dist/cjs/hooks/upload/local.cjs +1 -1
  12. package/dist/cjs/hooks/upload.cjs +1 -1
  13. package/dist/cjs/index.cjs +1 -1
  14. package/dist/cjs/main.cjs +1 -1
  15. package/dist/cjs/provider/app.cjs +1 -1
  16. package/dist/cjs/stores/jsonSchema.cjs +1 -0
  17. package/dist/cjs/utils/bus.cjs +1 -0
  18. package/dist/esm/components/auth/can.js +3 -2
  19. package/dist/esm/components/loader/loader.js +3 -2
  20. package/dist/esm/components/loader/remote/loader.js +3 -2
  21. package/dist/esm/directive/permission.js +3 -2
  22. package/dist/esm/hooks/data.js +166 -158
  23. package/dist/esm/hooks/json/vModel.js +67 -36
  24. package/dist/esm/hooks/json.js +109 -57
  25. package/dist/esm/hooks/menu.js +14 -13
  26. package/dist/esm/hooks/overlay.js +3 -2
  27. package/dist/esm/hooks/tree.js +8 -7
  28. package/dist/esm/hooks/upload/local.js +8 -8
  29. package/dist/esm/hooks/upload.js +123 -116
  30. package/dist/esm/index.js +93 -88
  31. package/dist/esm/main.js +7 -6
  32. package/dist/esm/provider/app.js +55 -53
  33. package/dist/esm/stores/jsonSchema.js +43 -0
  34. package/dist/esm/utils/bus.js +5 -0
  35. package/dist/types/hooks/data.d.ts +6 -66
  36. package/dist/types/hooks/json.d.ts +13 -3
  37. package/dist/types/hooks/upload/local.d.ts +1 -1
  38. package/dist/types/hooks/upload.d.ts +1 -1
  39. package/dist/types/stores/index.d.ts +1 -0
  40. package/dist/types/stores/jsonSchema.d.ts +27 -0
  41. package/dist/types/types/config.d.ts +6 -0
  42. package/dist/types/types/manage.d.ts +6 -0
  43. package/dist/types/utils/bus.d.ts +1 -0
  44. package/dist/types/utils/index.d.ts +1 -0
  45. package/package.json +2 -2
@@ -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(l) {
6
- l = l || {};
7
- const w = g(!1), i = g([]), u = g(-1), d = g(/* @__PURE__ */ new Map()), A = l.driver || W(), $ = v(() => {
8
- const { onProgress: e, onDataCallback: n, onCancel: a, onComplete: t, maxFileSize: c, maxFileCount: o, accept: s, multiple: r, autoUpload: f, options: U, onSuccess: P, onError: x, method: Y, driver: Z, ...J } = l;
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
- }), I = v(() => l.method || "POST"), b = v(() => {
11
- const e = i.value.length, n = i.value.reduce((o, s) => o + (s.filesize || 0), 0);
12
- let a = 0, t = 0;
13
- return i.value.forEach((o, s) => {
14
- var r;
15
- s < u.value ? a += o.filesize || 0 : s === u.value && (a += ((r = o.progress) == null ? void 0 : r.loaded) || 0);
16
- }), n > 0 && (t = Math.round(a / n * 100)), {
17
- index: u.value >= 0 ? u.value + 1 : 0,
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[u.value],
19
+ currentFile: i.value[d.value],
20
20
  totalPercent: t,
21
- totalLoaded: a,
21
+ totalLoaded: l,
22
22
  totalSize: n
23
23
  };
24
- }), y = (e) => {
24
+ }), F = (e) => {
25
25
  if (e === 0)
26
26
  return "0 Bytes";
27
- const n = 1024, a = ["Bytes", "KB", "MB", "GB"], t = Math.floor(Math.log(e) / Math.log(n));
28
- return `${Number.parseFloat((e / n ** t).toFixed(2))} ${a[t]}`;
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, a = ["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))} ${a[t]}`;
34
- }, T = () => R("upload-"), k = async (e, n, a) => {
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", o = atob(t), s = new Uint8Array(o.length);
50
- for (let f = 0; f < o.length; f++)
51
- s[f] = o.charCodeAt(f);
52
- const r = new Blob([s], { type: c });
53
- return new File([r], "base64-file", { type: c });
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
- }, z = (e) => {
65
- if (l.maxFileSize && e.size > l.maxFileSize)
66
- throw new Error(`File size cannot exceed ${y(l.maxFileSize)}`);
67
- if (l.maxFileCount && i.value.length >= l.maxFileCount)
68
- throw new Error(`File count cannot exceed ${l.maxFileCount}`);
69
- }, D = async (e, n, a) => {
70
- const t = await k(e, n);
71
- z(t);
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: T(),
73
+ id: z(),
74
74
  file: t,
75
75
  filename: t.name,
76
76
  filesize: t.size,
77
77
  filetype: t.type,
78
- filesizeText: y(t.size),
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 a = i.value.findIndex((t) => t.id === e);
93
- a !== -1 && (i.value[a] = { ...i.value[a], ...n });
94
- }, C = () => {
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((a) => a.status !== "uploading") && ((n = l.onComplete) == null || n.call(l, i.value));
97
- }, F = (e) => {
98
- var a;
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 = d.value.get(e);
104
- t && (t.abort(), d.value.delete(e));
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
- }), (a = l.onCancel) == null || a.call(l, e), C(), !0;
109
- }, G = (e) => {
110
- e ? e.forEach((n) => F(n)) : i.value.forEach((n) => F(n.id));
111
- }, K = async (e) => {
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
- z(e.file);
114
+ C(e.file);
115
115
  const n = new AbortController();
116
- d.value.set(e.id, n);
117
- const a = Date.now();
118
- m(e.id, { status: "uploading" }), await A.upload(e.file, {
119
- ...$.value,
120
- method: I.value,
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 x;
124
- const s = (Date.now() - a) / 1e3, r = s > 0 ? t.loaded / s : 0, f = (t.total || 0) - t.loaded, U = r > 0 ? f / r : 0, P = {
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(r),
129
- speedText: h(r),
130
- uploadTime: Math.round(s),
131
- remainingTime: Math.round(U)
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
- }), (x = l.onProgress) == null || x.call(l, b.value);
136
+ }), (b = a.onProgress) == null || b.call(a, T.value);
137
137
  }
138
138
  }).then((t) => {
139
- var s, r;
139
+ var s, u;
140
140
  if (e.status === "cancelled")
141
- return;
142
- const c = ((s = l.onDataCallback) == null ? void 0 : s.call(l, t, e)) || {}, o = Math.round((Date.now() - a) / 1e3);
143
- m(e.id, {
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: o,
153
+ uploadTime: r,
154
154
  remainingTime: 0
155
155
  }
156
- }), d.value.delete(e.id), (r = l.onSuccess) == null || r.call(l, t);
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
- if (!(t.message === "canceled" || e.status === "cancelled"))
159
- throw m(e.id, {
160
- status: "error",
161
- error: t.message
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
- C();
164
+ E();
165
165
  });
166
166
  }, B = async () => {
167
167
  var n;
168
- const e = i.value.filter((a) => a.status === "pending");
169
- if (e.length !== 0) {
170
- w.value = !0;
171
- try {
172
- for (let a = 0; a < e.length; a++) {
173
- const t = e[a], c = i.value.findIndex((o) => o.id === t.id);
174
- u.value = c, await K(t);
175
- }
176
- } catch (a) {
177
- throw (n = l.onError) == null || n.call(l, {
178
- status: (a == null ? void 0 : a.status) || 500,
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
- }, E = async (e, n = "file") => {
186
- var a;
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 (!l.multiple && e.length > 1)
196
+ if (!a.multiple && e.length > 1)
189
197
  throw new Error("Single file mode: only one file can be selected");
190
- if (l.maxFileCount && i.value.length + e.length > l.maxFileCount)
191
- throw new Error(`Adding ${e.length} files would exceed the maximum limit of ${l.maxFileCount}`);
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 D(t, n);
201
+ await G(t, n);
194
202
  } catch (t) {
195
- throw (a = l.onError) == null || a.call(l, {
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
- l.autoUpload && B();
201
- }, L = () => {
202
- i.value.forEach((e) => {
203
- F(e.id);
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 = d.value.get(e);
217
+ const t = f.value.get(e);
212
218
  if (!t)
213
219
  return;
214
- t.abort(), d.value.delete(e);
220
+ t.abort(), f.value.delete(e);
215
221
  }
216
- const a = i.value.findIndex((t) => t.id === e);
217
- a !== -1 && i.value.splice(a, 1);
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) => M(n)) : i.value.forEach((n) => M(n.id));
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: l.accept,
222
- multiple: l.multiple || !1
227
+ accept: a.accept,
228
+ multiple: a.multiple || !1
223
229
  }), j = (e) => ({
224
- id: T(),
230
+ id: z(),
225
231
  ...e,
226
- filesizeText: e.filesize ? y(e.filesize) : void 0,
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 E(n, "file").catch((a) => {
242
- console.warn("Failed to add selected files:", a);
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: b,
262
+ progress: T,
257
263
  open: O,
258
264
  trigger: B,
259
265
  resetFiles: S,
260
- clearFiles: L,
266
+ clearFiles: x,
261
267
  removeFiles: N,
262
- addFiles: E,
268
+ addFiles: M,
263
269
  addDataFiles: (e) => {
264
- const n = e.map((a) => j(a));
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: G
274
+ cancelFiles: K
268
275
  };
269
276
  }
270
277
  export {
package/dist/esm/index.js CHANGED
@@ -1,136 +1,141 @@
1
- import { DuxCan as o } from "./components/auth/can.js";
1
+ import { DuxCan as r } from "./components/auth/can.js";
2
2
  import { DuxLogo as p } from "./components/common/logo.js";
3
- import { DuxLogoIcon as x } from "./components/common/icon.js";
3
+ import { DuxLogoIcon as u } 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
6
  import { DuxError as i } 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
- import { DuxNotFound as h } from "./components/status/notFound.js";
10
- import { themeColor as c } from "./config/color.js";
9
+ import { DuxNotFound as S } from "./components/status/notFound.js";
10
+ import { themeColor as A } from "./config/color.js";
11
11
  import { useCan as T, useCheck as g, useError as I, useForgotPassword as L, useGetAuth as M, useIsLogin as y, useLogin as E, useLogout as F, useRegister as P, useUpdatePassword as U } from "./hooks/auth.js";
12
12
  import { useConfig as O } from "./hooks/config.js";
13
- import { useClient as b, useCreate as V, useCreateMany as N, useCustom as k, useCustomMutation as z, useDelete as G, useDeleteMany as J, useInfiniteList as j, useInvalidate as q, useList as B, useMany as H, useOne as K, useUpdate as Q, useUpdateMany as W } from "./hooks/data.js";
13
+ import { useClient as b, useCreate as J, useCreateMany as V, useCustom as N, useCustomMutation as k, useDelete as z, useDeleteMany as G, useInfiniteList as j, useInvalidate as q, useList as B, useMany as H, useOne as K, useUpdate as Q, useUpdateMany as W } from "./hooks/data.js";
14
14
  import { useExport as Y } from "./hooks/export.js";
15
15
  import { useExportCsv as _ } from "./hooks/exportCsv.js";
16
16
  import { useForm as ee } from "./hooks/form.js";
17
- import { useExtendForm as oe } from "./hooks/formExtend.js";
18
- import { initFormValidate as pe, useValidateForm as ue } from "./hooks/formValidate.js";
19
- import { useI18n as me } from "./hooks/i18n.js";
17
+ import { useExtendForm as re } from "./hooks/formExtend.js";
18
+ import { initFormValidate as pe, useValidateForm as me } from "./hooks/formValidate.js";
19
+ import { useI18n as xe } from "./hooks/i18n.js";
20
20
  import { useImport as fe } from "./hooks/import.js";
21
- import { useImportCsv as de } from "./hooks/importCsv.js";
22
- import { useJsonSchema as ne } from "./hooks/json.js";
23
- import { defaultAdaptors as ve } from "./hooks/json/index.js";
24
- import { useExtendList as Ae } from "./hooks/list.js";
25
- import { useManage as Ce } from "./hooks/manage.js";
26
- import { useMenu as Se } from "./hooks/menu.js";
27
- import { useOverlay as ge } from "./hooks/overlay.js";
28
- import { useSelect as Le } from "./hooks/select.js";
29
- import { useTheme as ye } from "./hooks/theme.js";
30
- import { useTree as Fe } from "./hooks/tree.js";
31
- import { useUpload as Ue } from "./hooks/upload.js";
32
- import { createLocalUploadDriver as Oe } from "./hooks/upload/local.js";
33
- import { createS3UploadDriver as be } from "./hooks/upload/s3.js";
21
+ import { useImportCsv as ne } from "./hooks/importCsv.js";
22
+ import { initJsonSchemaComponents as de, useJsonSchema as le } from "./hooks/json.js";
23
+ import { defaultAdaptors as De } from "./hooks/json/index.js";
24
+ import { useExtendList as Se } from "./hooks/list.js";
25
+ import { useManage as Ae } from "./hooks/manage.js";
26
+ import { useMenu as Te } from "./hooks/menu.js";
27
+ import { useOverlay as Ie } from "./hooks/overlay.js";
28
+ import { useSelect as Me } from "./hooks/select.js";
29
+ import { useTheme as Ee } from "./hooks/theme.js";
30
+ import { useTree as Pe } from "./hooks/tree.js";
31
+ import { useUpload as we } from "./hooks/upload.js";
32
+ import { createLocalUploadDriver as Re } from "./hooks/upload/local.js";
33
+ import { createS3UploadDriver as Je } from "./hooks/upload/s3.js";
34
34
  import { createDux as Ne } from "./main.js";
35
35
  import { simpleAuthProvider as ze } from "./preset/authProvider.js";
36
- import { simpleDataProvider as Je } from "./preset/dataProvider.js";
37
- import { i18nProvider as qe } from "./preset/i18nProvider.js";
38
- import { DuxAppProvider as He } from "./provider/app.js";
39
- import { DuxTabRouterView as Qe } from "./provider/tab.js";
40
- import { initRouter as Xe } from "./router/route.js";
41
- import { useAuthStore as Ze } from "./stores/auth.js";
42
- import { useI18nStore as $e } from "./stores/i18n.js";
43
- import { useManageStore as rr } from "./stores/manage.js";
44
- import { useRouteStore as tr } from "./stores/route.js";
45
- import { createTabStore as ur, useTabStore as xr } from "./stores/tab.js";
46
- import { useThemeStore as sr } from "./stores/theme.js";
47
- import { themePreset as ar } from "./utils/theme.js";
48
- import { arrayToTree as ir, searchTree as nr, treeToArr as lr } from "./utils/tree.js";
49
- import { vForAdaptor as Dr } from "./hooks/json/vFor.js";
50
- import { vIfAdaptor as hr } from "./hooks/json/vIf.js";
51
- import { vModelAdaptor as cr } from "./hooks/json/vModel.js";
52
- import { vOnAdaptor as Tr } from "./hooks/json/vOn.js";
53
- import { vShowAdaptor as Ir } from "./hooks/json/vShow.js";
54
- import { vTextAdaptor as Mr } from "./hooks/json/vText.js";
36
+ import { simpleDataProvider as je } from "./preset/dataProvider.js";
37
+ import { i18nProvider as Be } from "./preset/i18nProvider.js";
38
+ import { DuxAppProvider as Ke } from "./provider/app.js";
39
+ import { DuxTabRouterView as We } from "./provider/tab.js";
40
+ import { initRouter as Ye } from "./router/route.js";
41
+ import { useAuthStore as _e } from "./stores/auth.js";
42
+ import { useI18nStore as eo } from "./stores/i18n.js";
43
+ import { useJsonSchemaStore as ro } from "./stores/jsonSchema.js";
44
+ import { useManageStore as po } from "./stores/manage.js";
45
+ import { useRouteStore as uo } from "./stores/route.js";
46
+ import { createTabStore as so, useTabStore as fo } from "./stores/tab.js";
47
+ import { useThemeStore as no } from "./stores/theme.js";
48
+ import { emitter as lo } from "./utils/bus.js";
49
+ import { themePreset as Do } from "./utils/theme.js";
50
+ import { arrayToTree as So, searchTree as co, treeToArr as Ao } from "./utils/tree.js";
51
+ import { vForAdaptor as To } from "./hooks/json/vFor.js";
52
+ import { vIfAdaptor as Io } from "./hooks/json/vIf.js";
53
+ import { vModelAdaptor as Mo } from "./hooks/json/vModel.js";
54
+ import { vOnAdaptor as Eo } from "./hooks/json/vOn.js";
55
+ import { vShowAdaptor as Po } from "./hooks/json/vShow.js";
56
+ import { vTextAdaptor as wo } from "./hooks/json/vText.js";
55
57
  export {
56
- He as DuxAppProvider,
57
- o as DuxCan,
58
+ Ke as DuxAppProvider,
59
+ r as DuxCan,
58
60
  i as DuxError,
59
61
  l as DuxException,
60
62
  s as DuxLoaderIframe,
61
63
  p as DuxLogo,
62
- x as DuxLogoIcon,
64
+ u as DuxLogoIcon,
63
65
  D as DuxNotAuthorized,
64
- h as DuxNotFound,
66
+ S as DuxNotFound,
65
67
  a as DuxOverlay,
66
- Qe as DuxTabRouterView,
67
- ir as arrayToTree,
68
+ We as DuxTabRouterView,
69
+ So as arrayToTree,
68
70
  Ne as createDux,
69
- Oe as createLocalUploadDriver,
70
- be as createS3UploadDriver,
71
- ur as createTabStore,
72
- ve as defaultAdaptors,
73
- qe as i18nProvider,
71
+ Re as createLocalUploadDriver,
72
+ Je as createS3UploadDriver,
73
+ so as createTabStore,
74
+ De as defaultAdaptors,
75
+ lo as emitter,
76
+ Be as i18nProvider,
74
77
  pe as initFormValidate,
75
- Xe as initRouter,
76
- nr as searchTree,
78
+ de as initJsonSchemaComponents,
79
+ Ye as initRouter,
80
+ co as searchTree,
77
81
  ze as simpleAuthProvider,
78
- Je as simpleDataProvider,
79
- c as themeColor,
80
- ar as themePreset,
81
- lr as treeToArr,
82
- Ze as useAuthStore,
82
+ je as simpleDataProvider,
83
+ A as themeColor,
84
+ Do as themePreset,
85
+ Ao as treeToArr,
86
+ _e as useAuthStore,
83
87
  T as useCan,
84
88
  g as useCheck,
85
89
  b as useClient,
86
90
  O as useConfig,
87
- V as useCreate,
88
- N as useCreateMany,
89
- k as useCustom,
90
- z as useCustomMutation,
91
- G as useDelete,
92
- J as useDeleteMany,
91
+ J as useCreate,
92
+ V as useCreateMany,
93
+ N as useCustom,
94
+ k as useCustomMutation,
95
+ z as useDelete,
96
+ G as useDeleteMany,
93
97
  I as useError,
94
98
  Y as useExport,
95
99
  _ as useExportCsv,
96
- oe as useExtendForm,
97
- Ae as useExtendList,
100
+ re as useExtendForm,
101
+ Se as useExtendList,
98
102
  L as useForgotPassword,
99
103
  ee as useForm,
100
104
  M as useGetAuth,
101
- me as useI18n,
102
- $e as useI18nStore,
105
+ xe as useI18n,
106
+ eo as useI18nStore,
103
107
  fe as useImport,
104
- de as useImportCsv,
108
+ ne as useImportCsv,
105
109
  j as useInfiniteList,
106
110
  q as useInvalidate,
107
111
  y as useIsLogin,
108
- ne as useJsonSchema,
112
+ le as useJsonSchema,
113
+ ro as useJsonSchemaStore,
109
114
  B as useList,
110
115
  E as useLogin,
111
116
  F as useLogout,
112
- Ce as useManage,
113
- rr as useManageStore,
117
+ Ae as useManage,
118
+ po as useManageStore,
114
119
  H as useMany,
115
- Se as useMenu,
120
+ Te as useMenu,
116
121
  K as useOne,
117
- ge as useOverlay,
122
+ Ie as useOverlay,
118
123
  P as useRegister,
119
- tr as useRouteStore,
120
- Le as useSelect,
121
- xr as useTabStore,
122
- ye as useTheme,
123
- sr as useThemeStore,
124
- Fe as useTree,
124
+ uo as useRouteStore,
125
+ Me as useSelect,
126
+ fo as useTabStore,
127
+ Ee as useTheme,
128
+ no as useThemeStore,
129
+ Pe as useTree,
125
130
  Q as useUpdate,
126
131
  W as useUpdateMany,
127
132
  U as useUpdatePassword,
128
- Ue as useUpload,
129
- ue as useValidateForm,
130
- Dr as vForAdaptor,
131
- hr as vIfAdaptor,
132
- cr as vModelAdaptor,
133
- Tr as vOnAdaptor,
134
- Ir as vShowAdaptor,
135
- Mr as vTextAdaptor
133
+ we as useUpload,
134
+ me as useValidateForm,
135
+ To as vForAdaptor,
136
+ Io as vIfAdaptor,
137
+ Mo as vModelAdaptor,
138
+ Eo as vOnAdaptor,
139
+ Po as vShowAdaptor,
140
+ wo as vTextAdaptor
136
141
  };
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 u } from "vue";
5
- import { permissionDirective as p } from "./directive/permission.js";
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 h(i) {
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 = u();
28
- r.provide("dux.config", i), r.provide("dux.manage", t), r.directive("can", p), r.use(o), r.use(e), r.use(a(i));
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
- h as createDux
34
+ j as createDux
34
35
  };