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