@duxweb/dvha-core 1.0.22 → 1.0.24

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 (85) hide show
  1. package/dist/cjs/components/auth/can.cjs +1 -1
  2. package/dist/cjs/components/loader/iframe.cjs +1 -1
  3. package/dist/cjs/components/loader/remote/loader.cjs +1 -1
  4. package/dist/cjs/components/loader/remote/render.cjs +1 -1
  5. package/dist/cjs/components/overlay/overlay.cjs +1 -1
  6. package/dist/cjs/components/status/exception.cjs +1 -1
  7. package/dist/cjs/directive/permission.cjs +1 -1
  8. package/dist/cjs/hooks/auth.cjs +1 -1
  9. package/dist/cjs/hooks/data.cjs +1 -1
  10. package/dist/cjs/hooks/export.cjs +1 -1
  11. package/dist/cjs/hooks/exportCsv.cjs +2 -2
  12. package/dist/cjs/hooks/form.cjs +1 -1
  13. package/dist/cjs/hooks/formExtend.cjs +1 -1
  14. package/dist/cjs/hooks/i18n.cjs +1 -1
  15. package/dist/cjs/hooks/import.cjs +1 -1
  16. package/dist/cjs/hooks/importCsv.cjs +2 -2
  17. package/dist/cjs/hooks/json/utils/expressionParser.cjs +1 -1
  18. package/dist/cjs/hooks/json/vFor.cjs +1 -1
  19. package/dist/cjs/hooks/json/vOn.cjs +1 -1
  20. package/dist/cjs/hooks/json/vShow.cjs +1 -1
  21. package/dist/cjs/hooks/json.cjs +1 -1
  22. package/dist/cjs/hooks/list.cjs +1 -1
  23. package/dist/cjs/hooks/manage.cjs +1 -1
  24. package/dist/cjs/hooks/menu.cjs +1 -1
  25. package/dist/cjs/hooks/select.cjs +1 -1
  26. package/dist/cjs/hooks/theme.cjs +3 -3
  27. package/dist/cjs/hooks/tree.cjs +1 -1
  28. package/dist/cjs/hooks/upload/s3.cjs +1 -1
  29. package/dist/cjs/hooks/upload.cjs +1 -1
  30. package/dist/cjs/preset/authProvider.cjs +1 -1
  31. package/dist/cjs/preset/dataProvider.cjs +1 -1
  32. package/dist/cjs/preset/i18nProvider.cjs +1 -1
  33. package/dist/cjs/provider/app.cjs +1 -1
  34. package/dist/cjs/router/route.cjs +1 -1
  35. package/dist/cjs/stores/auth.cjs +1 -1
  36. package/dist/cjs/stores/i18n.cjs +1 -1
  37. package/dist/cjs/stores/jsonSchema.cjs +1 -1
  38. package/dist/cjs/stores/manage.cjs +1 -1
  39. package/dist/cjs/stores/route.cjs +1 -1
  40. package/dist/cjs/stores/tab.cjs +1 -1
  41. package/dist/cjs/stores/theme.cjs +1 -1
  42. package/dist/cjs/utils/tree.cjs +1 -1
  43. package/dist/esm/components/auth/can.js +8 -11
  44. package/dist/esm/components/loader/iframe.js +14 -17
  45. package/dist/esm/components/loader/remote/loader.js +103 -105
  46. package/dist/esm/components/loader/remote/render.js +10 -11
  47. package/dist/esm/components/overlay/overlay.js +7 -7
  48. package/dist/esm/components/status/exception.js +10 -13
  49. package/dist/esm/directive/permission.js +6 -7
  50. package/dist/esm/hooks/auth.js +73 -83
  51. package/dist/esm/hooks/data.js +290 -345
  52. package/dist/esm/hooks/export.js +16 -17
  53. package/dist/esm/hooks/exportCsv.js +26 -27
  54. package/dist/esm/hooks/form.js +49 -54
  55. package/dist/esm/hooks/formExtend.js +24 -25
  56. package/dist/esm/hooks/i18n.js +11 -29
  57. package/dist/esm/hooks/import.js +31 -32
  58. package/dist/esm/hooks/importCsv.js +24 -25
  59. package/dist/esm/hooks/json/utils/expressionParser.js +36 -42
  60. package/dist/esm/hooks/json/vFor.js +15 -16
  61. package/dist/esm/hooks/json/vOn.js +17 -18
  62. package/dist/esm/hooks/json/vShow.js +9 -10
  63. package/dist/esm/hooks/json.js +88 -94
  64. package/dist/esm/hooks/list.js +100 -127
  65. package/dist/esm/hooks/manage.js +13 -17
  66. package/dist/esm/hooks/menu.js +39 -52
  67. package/dist/esm/hooks/select.js +35 -40
  68. package/dist/esm/hooks/theme.js +127 -141
  69. package/dist/esm/hooks/tree.js +22 -28
  70. package/dist/esm/hooks/upload/s3.js +22 -23
  71. package/dist/esm/hooks/upload.js +152 -159
  72. package/dist/esm/preset/authProvider.js +63 -117
  73. package/dist/esm/preset/dataProvider.js +69 -76
  74. package/dist/esm/preset/i18nProvider.js +18 -18
  75. package/dist/esm/provider/app.js +74 -81
  76. package/dist/esm/router/route.js +16 -24
  77. package/dist/esm/stores/auth.js +17 -20
  78. package/dist/esm/stores/i18n.js +10 -10
  79. package/dist/esm/stores/jsonSchema.js +20 -23
  80. package/dist/esm/stores/manage.js +33 -33
  81. package/dist/esm/stores/route.js +38 -50
  82. package/dist/esm/stores/tab.js +38 -54
  83. package/dist/esm/stores/theme.js +28 -29
  84. package/dist/esm/utils/tree.js +23 -24
  85. package/package.json +1 -1
@@ -1,47 +1,43 @@
1
- import { useColorMode as Q, useCycleList as W } from "@vueuse/core";
2
- import { hex2rgb as X } from "colorizr";
3
- import { storeToRefs as Y } from "pinia";
4
- import { watchEffect as Z, computed as g, watch as _, readonly as I } from "vue";
5
- import { themeColor as N } from "../config/color.js";
1
+ import { useColorMode as H, useCycleList as J } from "@vueuse/core";
2
+ import { hex2rgb as K } from "colorizr";
3
+ import { storeToRefs as P } from "pinia";
4
+ import { watchEffect as Q, computed as f, watch as W, readonly as j } from "vue";
5
+ import { themeColor as X } from "../config/color.js";
6
6
  import "lodash-es";
7
- import { useThemeStore as ee } from "../stores/theme.js";
8
- import { useManage as te } from "./manage.js";
9
- function de() {
10
- var V, M;
11
- const f = ee(), { mode: L } = Y(f), C = Q({
12
- storageRef: L
13
- }), h = te(), { state: x, next: O, go: p } = W(["dark", "light", "auto"], {
14
- initialValue: C.store.value
7
+ import { useThemeStore as Y } from "../stores/theme.js";
8
+ import { useManage as Z } from "./manage.js";
9
+ function ie() {
10
+ const s = Y(), { mode: B } = P(s), $ = H({
11
+ storageRef: B
12
+ }), b = Z(), { state: S, next: V, go: v } = J(["dark", "light", "auto"], {
13
+ initialValue: $.store.value
15
14
  });
16
- Z(() => {
17
- C.value = x.value;
15
+ Q(() => {
16
+ $.value = S.value;
18
17
  });
19
- const R = (t) => {
18
+ const M = (t) => {
20
19
  switch (t) {
21
20
  case "auto":
22
- p(2);
21
+ v(2);
23
22
  break;
24
23
  case "light":
25
- p(1);
24
+ v(1);
26
25
  break;
27
26
  case "dark":
28
- p(0);
27
+ v(0);
29
28
  break;
30
29
  }
31
- }, b = g(() => {
32
- const { system: t, store: e } = C;
30
+ }, u = f(() => {
31
+ const { system: t, store: e } = $;
33
32
  return e.value === "auto" ? t.value === "dark" : e.value === "dark";
34
- }), z = g(() => {
35
- var t, e, o, c, i, l, r, s;
36
- return b.value ? {
37
- logo: (e = (t = h.config) == null ? void 0 : t.theme) == null ? void 0 : e.darkLogo,
38
- banner: (c = (o = h.config) == null ? void 0 : o.theme) == null ? void 0 : c.darkBanner
39
- } : {
40
- logo: (l = (i = h.config) == null ? void 0 : i.theme) == null ? void 0 : l.logo,
41
- banner: (s = (r = h.config) == null ? void 0 : r.theme) == null ? void 0 : s.banner
42
- };
43
- }), n = { ...{
44
- colors: N,
33
+ }), y = f(() => u.value ? {
34
+ logo: b.config?.theme?.darkLogo,
35
+ banner: b.config?.theme?.darkBanner
36
+ } : {
37
+ logo: b.config?.theme?.logo,
38
+ banner: b.config?.theme?.banner
39
+ }), r = { ...{
40
+ colors: X,
45
41
  // 色彩类型
46
42
  colorTypes: ["primary", "info", "success", "warning", "error", "gray"],
47
43
  // 色彩色阶
@@ -69,164 +65,154 @@ function de() {
69
65
  }
70
66
  },
71
67
  colorBase: { white: "#ffffff", black: "#000000" }
72
- }, ...(M = (V = h.config) == null ? void 0 : V.theme) == null ? void 0 : M.config }, { colorShades: k, colorTypes: w } = n, m = g(() => f.theme), v = g(() => Object.keys(n.colors)), T = ["default", "hover", "pressed", "focus", "disabled"];
73
- function y() {
74
- return b.value ? n.colorScenes.dark : n.colorScenes.light;
68
+ }, ...b.config?.theme?.config }, { colorShades: C, colorTypes: x } = r, d = f(() => s.theme), h = f(() => Object.keys(r.colors)), k = ["default", "hover", "pressed", "focus", "disabled"];
69
+ function I() {
70
+ return u.value ? r.colorScenes.dark : r.colorScenes.light;
75
71
  }
76
- function E(t, e) {
77
- var i;
78
- const o = y(), c = o.default;
79
- if ((i = o.overrides) != null && i[t]) {
80
- const l = o.overrides[t], r = l == null ? void 0 : l[e];
81
- if (r)
82
- return r;
72
+ function w(t, e) {
73
+ const o = I(), l = o.default;
74
+ if (o.overrides?.[t]) {
75
+ const i = o.overrides[t]?.[e];
76
+ if (i)
77
+ return i;
83
78
  }
84
- return c[e] || "500";
79
+ return l[e] || "500";
85
80
  }
86
- function j(t, e) {
87
- var c;
88
- const o = m.value[t];
89
- return ((c = n.colors[o]) == null ? void 0 : c[e]) || "";
81
+ function T(t, e) {
82
+ const o = d.value[t];
83
+ return r.colors[o]?.[e] || "";
90
84
  }
91
- function a(t, e, o) {
92
- const i = (b.value ? n.colorSemantic.dark : n.colorSemantic.light)[t][e];
93
- return i === "white" || i === "black" ? `var(--ui-color-${i})` : `var(--base-color-${o}-${i})`;
85
+ function n(t, e, o) {
86
+ const c = (u.value ? r.colorSemantic.dark : r.colorSemantic.light)[t][e];
87
+ return c === "white" || c === "black" ? `var(--ui-color-${c})` : `var(--base-color-${o}-${c})`;
94
88
  }
95
- const S = (t) => {
96
- const e = X(t);
89
+ const p = (t) => {
90
+ const e = K(t);
97
91
  return `${e.r} ${e.g} ${e.b}`;
98
92
  };
99
- function D() {
100
- var i, l;
93
+ function L() {
101
94
  const t = [];
102
- Object.entries(n.colors).forEach(([r, s]) => {
103
- typeof s == "object" && Object.entries(s).forEach(([u, d]) => {
95
+ Object.entries(r.colors).forEach(([c, i]) => {
96
+ typeof i == "object" && Object.entries(i).forEach(([a, g]) => {
104
97
  try {
105
- t.push(`--base-color-${r}-${u}: ${S(d)};`);
98
+ t.push(`--base-color-${c}-${a}: ${p(g)};`);
106
99
  } catch {
107
- t.push(`--base-color-${r}-${u}: ${d};`);
100
+ t.push(`--base-color-${c}-${a}: ${g};`);
108
101
  }
109
102
  });
110
103
  });
111
104
  const e = [];
112
- w.forEach((r) => {
113
- const s = m.value[r];
114
- k.forEach((u) => {
115
- e.push(`--ui-color-${r}-${u}: var(--base-color-${s}-${u});`);
116
- }), T.forEach((u) => {
117
- const d = E(r, u);
118
- u === "default" ? e.push(`--ui-color-${r}: var(--base-color-${s}-${d});`) : e.push(`--ui-color-${r}-${u}: var(--base-color-${s}-${d});`);
105
+ x.forEach((c) => {
106
+ const i = d.value[c];
107
+ C.forEach((a) => {
108
+ e.push(`--ui-color-${c}-${a}: var(--base-color-${i}-${a});`);
109
+ }), k.forEach((a) => {
110
+ const g = w(c, a);
111
+ a === "default" ? e.push(`--ui-color-${c}: var(--base-color-${i}-${g});`) : e.push(`--ui-color-${c}-${a}: var(--base-color-${i}-${g});`);
119
112
  });
120
113
  });
121
- const o = m.value.gray, c = [
122
- `--ui-color-white: ${S(((i = n.colorBase) == null ? void 0 : i.white) || "#ffffff")};`,
123
- `--ui-color-black: ${S(((l = n.colorBase) == null ? void 0 : l.black) || "#000000")};`,
124
- `--ui-text-dimmed: ${a("text", "dimmed", o)};`,
125
- `--ui-text-muted: ${a("text", "muted", o)};`,
126
- `--ui-text-toned: ${a("text", "toned", o)};`,
127
- `--ui-text: ${a("text", "base", o)};`,
128
- `--ui-text-highlighted: ${a("text", "highlighted", o)};`,
129
- `--ui-text-inverted: ${a("text", "inverted", o)};`,
130
- `--ui-bg: ${a("bg", "base", o)};`,
131
- `--ui-bg-muted: ${a("bg", "muted", o)};`,
132
- `--ui-bg-elevated: ${a("bg", "elevated", o)};`,
133
- `--ui-bg-accented: ${a("bg", "accented", o)};`,
134
- `--ui-bg-inverted: ${a("bg", "inverted", o)};`,
135
- `--ui-border: ${a("border", "base", o)};`,
136
- `--ui-border-muted: ${a("border", "muted", o)};`,
137
- `--ui-border-accented: ${a("border", "accented", o)};`,
138
- `--ui-border-inverted: ${a("border", "inverted", o)};`
114
+ const o = d.value.gray, l = [
115
+ `--ui-color-white: ${p(r.colorBase?.white || "#ffffff")};`,
116
+ `--ui-color-black: ${p(r.colorBase?.black || "#000000")};`,
117
+ `--ui-text-dimmed: ${n("text", "dimmed", o)};`,
118
+ `--ui-text-muted: ${n("text", "muted", o)};`,
119
+ `--ui-text-toned: ${n("text", "toned", o)};`,
120
+ `--ui-text: ${n("text", "base", o)};`,
121
+ `--ui-text-highlighted: ${n("text", "highlighted", o)};`,
122
+ `--ui-text-inverted: ${n("text", "inverted", o)};`,
123
+ `--ui-bg: ${n("bg", "base", o)};`,
124
+ `--ui-bg-muted: ${n("bg", "muted", o)};`,
125
+ `--ui-bg-elevated: ${n("bg", "elevated", o)};`,
126
+ `--ui-bg-accented: ${n("bg", "accented", o)};`,
127
+ `--ui-bg-inverted: ${n("bg", "inverted", o)};`,
128
+ `--ui-border: ${n("border", "base", o)};`,
129
+ `--ui-border-muted: ${n("border", "muted", o)};`,
130
+ `--ui-border-accented: ${n("border", "accented", o)};`,
131
+ `--ui-border-inverted: ${n("border", "inverted", o)};`
139
132
  ];
140
133
  return `:root {
141
134
  ${t.join(`
142
135
  `)}
143
136
  ${e.join(`
144
137
  `)}
145
- ${c.join(`
138
+ ${l.join(`
146
139
  `)}
147
140
  }`;
148
141
  }
149
- let $ = null;
150
- function B() {
151
- const t = D();
152
- $ || ($ = document.createElement("style"), $.id = "dvha-variables", document.head.appendChild($)), $.textContent = t;
142
+ let m = null;
143
+ function E() {
144
+ const t = L();
145
+ m || (m = document.createElement("style"), m.id = "dvha-variables", document.head.appendChild(m)), m.textContent = t;
153
146
  }
154
- function G() {
155
- f.cssInit || (f.setCssInit(), B());
147
+ function O() {
148
+ s.cssInit || (s.setCssInit(), E());
156
149
  }
157
- _([m, b], () => {
158
- f.cssInit && B();
150
+ W([d, u], () => {
151
+ s.cssInit && E();
159
152
  }, { deep: !0, immediate: !1 });
160
- function U(t, e) {
161
- v.value.includes(e) ? f.setThemeColor(t, e) : console.warn(`Color "${e}" is not available`);
153
+ function R(t, e) {
154
+ h.value.includes(e) ? s.setThemeColor(t, e) : console.warn(`Color "${e}" is not available`);
162
155
  }
163
- function q(t) {
164
- f.setThemeColors(t);
156
+ function z(t) {
157
+ s.setThemeColors(t);
165
158
  }
166
- function A() {
167
- f.resetTheme();
159
+ function D() {
160
+ s.resetTheme();
168
161
  }
169
- function F(t, e, o = !1) {
170
- return o ? `--ui-color-${t}-${e}` : j(t, e);
162
+ function G(t, e, o = !1) {
163
+ return o ? `--ui-color-${t}-${e}` : T(t, e);
171
164
  }
172
- function H(t, e, o = !1) {
165
+ function U(t, e, o = !1) {
173
166
  if (e || (e = "default"), o)
174
167
  return e === "default" ? `--ui-color-${t})` : `--ui-color-${t}-${e})`;
175
- const c = E(t, e);
176
- return j(t, c);
168
+ const l = w(t, e);
169
+ return T(t, l);
177
170
  }
178
- function J(t, e, o = !1) {
179
- var r, s, u;
171
+ function q(t, e, o = !1) {
180
172
  if (o) {
181
- let d;
173
+ let a;
182
174
  switch (t) {
183
175
  case "text":
184
- d = e === "base" ? "--ui-text" : `--ui-text-${e}`;
176
+ a = e === "base" ? "--ui-text" : `--ui-text-${e}`;
185
177
  break;
186
178
  case "bg":
187
- d = e === "base" ? "--ui-bg" : `--ui-bg-${e}`;
179
+ a = e === "base" ? "--ui-bg" : `--ui-bg-${e}`;
188
180
  break;
189
181
  case "border":
190
- d = e === "base" ? "--ui-border" : `--ui-border-${e}`;
182
+ a = e === "base" ? "--ui-border" : `--ui-border-${e}`;
191
183
  break;
192
184
  default:
193
- d = `--ui-${t}-${e}`;
185
+ a = `--ui-${t}-${e}`;
194
186
  }
195
- return `${d}`;
187
+ return `${a}`;
196
188
  }
197
- const c = m.value.gray, l = (b.value ? n.colorSemantic.dark : n.colorSemantic.light)[t][e];
198
- return l === "white" ? ((r = n.colorBase) == null ? void 0 : r.white) || "#ffffff" : l === "black" ? ((s = n.colorBase) == null ? void 0 : s.black) || "#000000" : ((u = n.colors[c]) == null ? void 0 : u[l]) || "";
189
+ const l = d.value.gray, i = (u.value ? r.colorSemantic.dark : r.colorSemantic.light)[t][e];
190
+ return i === "white" ? r.colorBase?.white || "#ffffff" : i === "black" ? r.colorBase?.black || "#000000" : r.colors[l]?.[i] || "";
199
191
  }
200
- const K = g(() => {
201
- var t;
202
- return (t = v.value) == null ? void 0 : t.filter((e) => ["slate", "gray", "zinc", "neutral", "stone"].includes(e));
203
- }), P = g(() => {
204
- var t;
205
- return (t = v.value) == null ? void 0 : t.filter((e) => !["slate", "gray", "zinc", "neutral", "stone"].includes(e));
206
- });
192
+ const A = f(() => h.value?.filter((t) => ["slate", "gray", "zinc", "neutral", "stone"].includes(t))), F = f(() => h.value?.filter((t) => !["slate", "gray", "zinc", "neutral", "stone"].includes(t)));
207
193
  return {
208
- toggle: O,
209
- mode: x,
210
- setMode: R,
211
- isDark: b,
212
- resources: z,
213
- config: I(n),
214
- colorMapping: I(m),
215
- colors: v,
216
- neutralColors: K,
217
- primaryColors: P,
218
- colorShades: k,
219
- colorTypes: w,
220
- colorScenes: T,
221
- cssInit: G,
222
- cssReset: A,
223
- setColor: U,
224
- setColors: q,
225
- getSceneColor: H,
226
- getShadeColor: F,
227
- getSemanticColor: J
194
+ toggle: V,
195
+ mode: S,
196
+ setMode: M,
197
+ isDark: u,
198
+ resources: y,
199
+ config: j(r),
200
+ colorMapping: j(d),
201
+ colors: h,
202
+ neutralColors: A,
203
+ primaryColors: F,
204
+ colorShades: C,
205
+ colorTypes: x,
206
+ colorScenes: k,
207
+ cssInit: O,
208
+ cssReset: D,
209
+ setColor: R,
210
+ setColors: z,
211
+ getSceneColor: U,
212
+ getShadeColor: G,
213
+ getSemanticColor: q
228
214
  };
229
215
  }
230
216
  export {
231
- de as useTheme
217
+ ie as useTheme
232
218
  };
@@ -1,36 +1,30 @@
1
- import { toRef as o, computed as a } from "vue";
1
+ import { toRef as n, computed as r } from "vue";
2
2
  import "../utils/bus.js";
3
- import { arrayToTree as K, treeToArr as f } from "../utils/tree.js";
4
- import { useList as O } from "./data.js";
5
- function D(e) {
6
- const u = o(e, "path"), m = o(e, "params"), h = o(e, "providerName"), { data: d, isLoading: v } = O({
7
- path: u.value || "",
8
- filters: m.value,
9
- providerName: h.value
10
- }), s = a(() => {
11
- var r, n, i, t, l, c;
12
- return e.converTree ? K(((n = d.value) == null ? void 0 : n.data) || [], {
13
- idKey: ((i = e.treeOptions) == null ? void 0 : i.valueKey) || "id",
14
- parentKey: ((t = e.treeOptions) == null ? void 0 : t.parentKey) || "parent_id",
15
- sortKey: ((l = e.treeOptions) == null ? void 0 : l.sortKey) || "sort",
16
- childrenKey: ((c = e.treeOptions) == null ? void 0 : c.childrenKey) || "children"
17
- }) : ((r = d.value) == null ? void 0 : r.data) || [];
18
- }), p = a(() => {
19
- var r, n;
20
- return f(s.value, ((r = e.treeOptions) == null ? void 0 : r.valueKey) || "id", ((n = e.treeOptions) == null ? void 0 : n.childrenKey) || "children");
21
- }), y = a(() => v.value);
3
+ import { arrayToTree as p, treeToArr as y } from "../utils/tree.js";
4
+ import { useList as K } from "./data.js";
5
+ function N(e) {
6
+ const d = n(e, "path"), s = n(e, "params"), l = n(e, "providerName"), { data: i, isLoading: c } = K({
7
+ path: d.value || "",
8
+ filters: s.value,
9
+ providerName: l.value
10
+ }), a = r(() => e.converTree ? p(i.value?.data || [], {
11
+ idKey: e.treeOptions?.valueKey || "id",
12
+ parentKey: e.treeOptions?.parentKey || "parent_id",
13
+ sortKey: e.treeOptions?.sortKey || "sort",
14
+ childrenKey: e.treeOptions?.childrenKey || "children"
15
+ }) : i.value?.data || []), u = r(() => y(a.value, e.treeOptions?.valueKey || "id", e.treeOptions?.childrenKey || "children")), m = r(() => c.value);
22
16
  return {
23
- options: a(() => {
24
- const r = (n) => n.map((i) => {
25
- const t = { ...i };
26
- return Array.isArray(t.children) && (t.children.length === 0 ? delete t.children : t.children = r(t.children)), t;
17
+ options: r(() => {
18
+ const o = (h) => h.map((v) => {
19
+ const t = { ...v };
20
+ return Array.isArray(t.children) && (t.children.length === 0 ? delete t.children : t.children = o(t.children)), t;
27
21
  });
28
- return r(s.value || []);
22
+ return o(a.value || []);
29
23
  }),
30
- loading: y,
31
- expanded: p
24
+ loading: m,
25
+ expanded: u
32
26
  };
33
27
  }
34
28
  export {
35
- D as useTree
29
+ N as useTree
36
30
  };
@@ -1,13 +1,12 @@
1
- import { useClient as y } from "../data.js";
2
- import P from "axios";
3
- function q(s) {
4
- const h = y();
1
+ import { useClient as c } from "../data.js";
2
+ import U from "axios";
3
+ function w(n) {
4
+ const i = c();
5
5
  return {
6
6
  async upload(a, t) {
7
- var m, i, c, U;
8
- const o = await h.request({
7
+ const o = await i.request({
9
8
  method: "GET",
10
- path: s.signPath,
9
+ path: n.signPath,
11
10
  query: {
12
11
  name: a.name,
13
12
  size: a.size,
@@ -16,45 +15,45 @@ function q(s) {
16
15
  },
17
16
  signal: t.signal,
18
17
  onUploadProgress: t.onUploadProgress
19
- }), r = ((m = s.signCallback) == null ? void 0 : m.call(s, o)) || {
20
- uploadUrl: (i = o.data) == null ? void 0 : i.uploadUrl,
21
- url: (c = o.data) == null ? void 0 : c.url,
22
- params: (U = o.data) == null ? void 0 : U.params
18
+ }), r = n.signCallback?.(o) || {
19
+ uploadUrl: o.data?.uploadUrl,
20
+ url: o.data?.url,
21
+ params: o.data?.params
23
22
  };
24
23
  if (!r.uploadUrl)
25
24
  throw new Error("Upload URL is required");
26
25
  if (!r.url)
27
26
  throw new Error("File URL is required");
28
27
  const p = t.method || "POST";
29
- let l = null;
28
+ let s = null;
30
29
  const u = t.headers || {};
31
30
  if (p === "PUT")
32
- l = a, u["Content-Type"] = a.type || "application/octet-stream";
31
+ s = a, u["Content-Type"] = a.type || "application/octet-stream";
33
32
  else {
34
33
  const e = new FormData();
35
- e.append("Content-Type", a.type || "application/octet-stream"), e.append("file", a), r.params && Object.entries(r.params).forEach(([n, w]) => {
36
- e.append(n, String(w));
37
- }), l = e;
34
+ e.append("Content-Type", a.type || "application/octet-stream"), e.append("file", a), r.params && Object.entries(r.params).forEach(([d, m]) => {
35
+ e.append(d, String(m));
36
+ }), s = e;
38
37
  }
39
- const d = await P.request({
38
+ const l = await U.request({
40
39
  method: p,
41
40
  url: r.uploadUrl,
42
- data: l,
41
+ data: s,
43
42
  signal: t.signal,
44
43
  headers: u,
45
44
  onUploadProgress: (e) => {
46
45
  if (t.onUploadProgress && e.total) {
47
- const n = Math.round(e.loaded * 100 / e.total);
46
+ const d = Math.round(e.loaded * 100 / e.total);
48
47
  t.onUploadProgress({
49
48
  loaded: e.loaded,
50
49
  total: e.total,
51
- percent: n
50
+ percent: d
52
51
  });
53
52
  }
54
53
  }
55
54
  });
56
- if (d.status < 200 || d.status >= 300)
57
- throw new Error(`S3 upload failed: ${d.statusText}`);
55
+ if (l.status < 200 || l.status >= 300)
56
+ throw new Error(`S3 upload failed: ${l.statusText}`);
58
57
  return {
59
58
  data: {
60
59
  url: r.url,
@@ -68,5 +67,5 @@ function q(s) {
68
67
  };
69
68
  }
70
69
  export {
71
- q as createS3UploadDriver
70
+ w as createS3UploadDriver
72
71
  };