@duxweb/dvha-pro 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 (157) hide show
  1. package/dist/cjs/component.cjs +1 -1
  2. package/dist/cjs/components/card/card.cjs +1 -1
  3. package/dist/cjs/components/card/store.cjs +1 -1
  4. package/dist/cjs/components/carousel/carousel.cjs +1 -1
  5. package/dist/cjs/components/crop/imageCrop.cjs +1 -1
  6. package/dist/cjs/components/crop/imageCropModal.cjs +1 -1
  7. package/dist/cjs/components/dashboard/hello.cjs +1 -1
  8. package/dist/cjs/components/dashboard/helloBig.cjs +1 -1
  9. package/dist/cjs/components/dashboard/quick.cjs +1 -1
  10. package/dist/cjs/components/data/dynamicData.cjs +1 -1
  11. package/dist/cjs/components/data/dynamicSelect.cjs +1 -1
  12. package/dist/cjs/components/data/selectModal.cjs +1 -1
  13. package/dist/cjs/components/dialog/dialog.cjs +1 -1
  14. package/dist/cjs/components/drawer/drawer.cjs +1 -1
  15. package/dist/cjs/components/drawer/drawerPage.cjs +1 -1
  16. package/dist/cjs/components/editor/aiEditor.cjs +1 -1
  17. package/dist/cjs/components/form/drawerForm.cjs +1 -0
  18. package/dist/cjs/components/form/formItem.cjs +1 -1
  19. package/dist/cjs/components/form/formLayout.cjs +1 -1
  20. package/dist/cjs/components/form/modalForm.cjs +1 -1
  21. package/dist/cjs/components/form/pageForm.cjs +1 -1
  22. package/dist/cjs/components/form/settingForm.cjs +1 -1
  23. package/dist/cjs/components/icon/iconPicker.cjs +1 -1
  24. package/dist/cjs/components/layout/filter.cjs +1 -1
  25. package/dist/cjs/components/layout/filterLayout.cjs +1 -1
  26. package/dist/cjs/components/layout/list.cjs +1 -1
  27. package/dist/cjs/components/layout/table.cjs +1 -1
  28. package/dist/cjs/components/layout/tools.cjs +1 -1
  29. package/dist/cjs/components/list/card.cjs +1 -1
  30. package/dist/cjs/components/list/list.cjs +1 -1
  31. package/dist/cjs/components/media/media.cjs +1 -1
  32. package/dist/cjs/components/modal/modal.cjs +1 -1
  33. package/dist/cjs/components/modal/modalPage.cjs +1 -1
  34. package/dist/cjs/components/modal/modalTab.cjs +1 -1
  35. package/dist/cjs/components/panel/alert.cjs +1 -1
  36. package/dist/cjs/components/panel/collapse.cjs +1 -1
  37. package/dist/cjs/components/panel/setting.cjs +1 -1
  38. package/dist/cjs/components/select/cardSelect.cjs +1 -1
  39. package/dist/cjs/components/status/listEmpty.cjs +1 -1
  40. package/dist/cjs/components/table/tablePage.cjs +1 -1
  41. package/dist/cjs/components/tree/treeFilter.cjs +1 -1
  42. package/dist/cjs/components/upload/config.cjs +1 -1
  43. package/dist/cjs/components/upload/file.cjs +1 -1
  44. package/dist/cjs/components/upload/image.cjs +1 -1
  45. package/dist/cjs/components/upload/manage/item.cjs +1 -1
  46. package/dist/cjs/components/upload/manager.cjs +1 -1
  47. package/dist/cjs/components/widget/connect.cjs +1 -1
  48. package/dist/cjs/dvha-pro.css +1 -1
  49. package/dist/cjs/hooks/action.cjs +1 -1
  50. package/dist/cjs/hooks/download.cjs +1 -1
  51. package/dist/cjs/hooks/echart.cjs +1 -1
  52. package/dist/cjs/hooks/image.cjs +1 -1
  53. package/dist/cjs/hooks/level.cjs +1 -1
  54. package/dist/cjs/hooks/table/color.cjs +1 -0
  55. package/dist/cjs/hooks/table/column.cjs +1 -1
  56. package/dist/cjs/hooks/table/image.cjs +1 -1
  57. package/dist/cjs/hooks/table/input.cjs +1 -1
  58. package/dist/cjs/hooks/table/map.cjs +1 -1
  59. package/dist/cjs/hooks/table/status.cjs +1 -1
  60. package/dist/cjs/hooks/table/switch.cjs +1 -1
  61. package/dist/cjs/hooks/table.cjs +1 -1
  62. package/dist/cjs/index.cjs +1 -1
  63. package/dist/cjs/pages/layout/global.cjs +1 -1
  64. package/dist/cjs/pages/layout/tab.cjs +1 -1
  65. package/dist/cjs/pages/login.cjs +1 -1
  66. package/dist/cjs/pages/menu/avatar.cjs +1 -1
  67. package/dist/cjs/pages/menu/button.cjs +1 -1
  68. package/dist/cjs/pages/menu/cmd.cjs +1 -1
  69. package/dist/cjs/pages/page.cjs +1 -1
  70. package/dist/cjs/pages/pageStatus.cjs +1 -1
  71. package/dist/cjs/stores/ui.cjs +1 -1
  72. package/dist/cjs/theme/uno.css.cjs +2 -1
  73. package/dist/esm/component.js +3 -3
  74. package/dist/esm/components/card/card.js +24 -27
  75. package/dist/esm/components/card/store.js +33 -39
  76. package/dist/esm/components/carousel/carousel.js +16 -19
  77. package/dist/esm/components/crop/imageCrop.js +32 -35
  78. package/dist/esm/components/crop/imageCropModal.js +36 -37
  79. package/dist/esm/components/dashboard/hello.js +27 -30
  80. package/dist/esm/components/dashboard/helloBig.js +328 -331
  81. package/dist/esm/components/dashboard/quick.js +30 -33
  82. package/dist/esm/components/data/dynamicData.js +86 -98
  83. package/dist/esm/components/data/dynamicSelect.js +29 -31
  84. package/dist/esm/components/data/selectModal.js +45 -49
  85. package/dist/esm/components/dialog/dialog.js +54 -55
  86. package/dist/esm/components/drawer/drawer.js +23 -22
  87. package/dist/esm/components/drawer/drawerPage.js +39 -49
  88. package/dist/esm/components/editor/aiEditor.js +64 -70
  89. package/dist/esm/components/form/drawerForm.js +149 -0
  90. package/dist/esm/components/form/formItem.js +44 -50
  91. package/dist/esm/components/form/formLayout.js +7 -10
  92. package/dist/esm/components/form/modalForm.js +50 -50
  93. package/dist/esm/components/form/pageForm.js +47 -50
  94. package/dist/esm/components/form/settingForm.js +34 -37
  95. package/dist/esm/components/icon/iconPicker.js +54 -58
  96. package/dist/esm/components/layout/filter.js +13 -16
  97. package/dist/esm/components/layout/filterLayout.js +7 -10
  98. package/dist/esm/components/layout/list.js +299 -326
  99. package/dist/esm/components/layout/table.js +268 -283
  100. package/dist/esm/components/layout/tools.js +38 -41
  101. package/dist/esm/components/list/card.js +35 -38
  102. package/dist/esm/components/list/list.js +15 -18
  103. package/dist/esm/components/media/media.js +35 -36
  104. package/dist/esm/components/modal/modal.js +10 -10
  105. package/dist/esm/components/modal/modalPage.js +32 -36
  106. package/dist/esm/components/modal/modalTab.js +39 -45
  107. package/dist/esm/components/panel/alert.js +19 -22
  108. package/dist/esm/components/panel/collapse.js +33 -36
  109. package/dist/esm/components/panel/setting.js +25 -31
  110. package/dist/esm/components/select/cardSelect.js +27 -28
  111. package/dist/esm/components/status/listEmpty.js +13 -13
  112. package/dist/esm/components/table/tablePage.js +25 -25
  113. package/dist/esm/components/tree/treeFilter.js +137 -147
  114. package/dist/esm/components/upload/config.js +15 -27
  115. package/dist/esm/components/upload/file.js +90 -94
  116. package/dist/esm/components/upload/image.js +116 -123
  117. package/dist/esm/components/upload/manage/item.js +44 -47
  118. package/dist/esm/components/upload/manager.js +190 -207
  119. package/dist/esm/components/widget/connect.js +103 -106
  120. package/dist/esm/dvha-pro.css +1 -1
  121. package/dist/esm/hooks/action.js +141 -157
  122. package/dist/esm/hooks/download.js +55 -56
  123. package/dist/esm/hooks/echart.js +156 -179
  124. package/dist/esm/hooks/image.js +14 -15
  125. package/dist/esm/hooks/level.js +7 -7
  126. package/dist/esm/hooks/table/color.js +19 -0
  127. package/dist/esm/hooks/table/column.js +25 -23
  128. package/dist/esm/hooks/table/image.js +2 -2
  129. package/dist/esm/hooks/table/input.js +28 -28
  130. package/dist/esm/hooks/table/map.js +7 -7
  131. package/dist/esm/hooks/table/status.js +8 -9
  132. package/dist/esm/hooks/table/switch.js +19 -19
  133. package/dist/esm/hooks/table.js +27 -31
  134. package/dist/esm/index.js +162 -158
  135. package/dist/esm/pages/layout/global.js +12 -15
  136. package/dist/esm/pages/layout/tab.js +58 -71
  137. package/dist/esm/pages/login.js +81 -85
  138. package/dist/esm/pages/menu/avatar.js +136 -149
  139. package/dist/esm/pages/menu/button.js +16 -20
  140. package/dist/esm/pages/menu/cmd.js +68 -74
  141. package/dist/esm/pages/page.js +21 -25
  142. package/dist/esm/pages/pageStatus.js +21 -24
  143. package/dist/esm/stores/ui.js +15 -15
  144. package/dist/esm/theme/uno.css.js +2 -1
  145. package/dist/types/components/drawer/drawerPage.d.ts +1 -1
  146. package/dist/types/components/form/drawerForm.d.ts +104 -0
  147. package/dist/types/components/form/index.d.ts +1 -0
  148. package/dist/types/components/form/modalForm.d.ts +6 -0
  149. package/dist/types/components/form/pageForm.d.ts +6 -0
  150. package/dist/types/components/form/settingForm.d.ts +6 -0
  151. package/dist/types/components/layout/table.d.ts +9 -0
  152. package/dist/types/components/table/tablePage.d.ts +9 -0
  153. package/dist/types/hooks/table/color.d.ts +13 -0
  154. package/dist/types/hooks/table/column.d.ts +1 -0
  155. package/dist/types/hooks/table/index.d.ts +1 -0
  156. package/dist/types/hooks/table/types.d.ts +2 -2
  157. package/package.json +3 -3
@@ -1,10 +1,10 @@
1
- import { defineComponent as Y, toRef as g, ref as r, watch as P, computed as C, createVNode as n, mergeProps as q, Fragment as G } from "vue";
2
- import { useI18n as H, useTree as J, useCustomMutation as Q } from "@duxweb/dvha-core";
3
- import { useVModel as W } from "@vueuse/core";
4
- import Z from "clsx";
5
- import { NTree as T, NInput as $, NScrollbar as p, NSpin as ee, NDropdown as te } from "naive-ui";
6
- import { DuxCard as le } from "../card/card.js";
7
- const oe = /* @__PURE__ */ Y({
1
+ import { defineComponent as R, toRef as S, ref as u, watch as O, computed as V, createVNode as n, mergeProps as X, Fragment as Y } from "vue";
2
+ import { useI18n as q, useTree as G, useCustomMutation as H } from "@duxweb/dvha-core";
3
+ import { useVModel as J } from "@vueuse/core";
4
+ import Q from "clsx";
5
+ import { NTree as k, NInput as W, NScrollbar as Z, NSpin as $, NDropdown as ee } from "naive-ui";
6
+ import { DuxCard as te } from "../card/card.js";
7
+ const re = /* @__PURE__ */ R({
8
8
  name: "DuxTreeFilter",
9
9
  props: {
10
10
  title: String,
@@ -24,190 +24,180 @@ const oe = /* @__PURE__ */ Y({
24
24
  default: !1
25
25
  }
26
26
  },
27
- extends: T,
27
+ extends: k,
28
28
  setup(t, {
29
- emit: U,
30
- slots: v
29
+ emit: C,
30
+ slots: x
31
31
  }) {
32
- const D = W(t, "value", U, {
32
+ const F = J(t, "value", C, {
33
33
  passive: !1,
34
34
  defaultValue: t.defaultValue
35
- }), I = g(t, "params", {}), N = g(t, "path", ""), A = g(t, "sortPath", ""), O = r(), V = r(0), k = r(0), s = r([]), S = r(), {
35
+ }), T = S(t, "params", {}), U = S(t, "path", ""), I = S(t, "sortPath", ""), w = u(), g = u(0), P = u(0), s = u([]), b = u(), {
36
36
  t: K
37
- } = H(), {
38
- options: j,
39
- loading: B,
40
- expanded: L
41
- } = J({
42
- path: N.value,
43
- params: I.value,
37
+ } = q(), {
38
+ options: N,
39
+ loading: A,
40
+ expanded: j
41
+ } = G({
42
+ path: U.value,
43
+ params: T.value,
44
44
  ...t.treeOptions
45
45
  });
46
- P(j, (l) => {
47
- s.value = l;
46
+ O(N, (e) => {
47
+ s.value = e;
48
48
  }, {
49
49
  immediate: !0,
50
50
  deep: !0
51
51
  });
52
- const h = r(!1), M = C(() => {
53
- var l;
54
- return ((l = t.menus) == null ? void 0 : l.map((e) => ({
55
- label: e.label,
56
- key: e.value,
57
- icon: e != null && e.icon ? () => n("div", {
58
- class: e == null ? void 0 : e.icon
59
- }, null) : void 0,
60
- onSelect: e.onSelect
61
- }))) || [];
62
- }), _ = (l) => {
63
- var a;
64
- const e = (a = t.menus) == null ? void 0 : a.find((i) => i.value === l);
65
- e && e.onSelect(O.value), h.value = !1;
66
- }, z = Q({
67
- path: A.value,
52
+ const v = u(!1), B = V(() => t.menus?.map((e) => ({
53
+ label: e.label,
54
+ key: e.value,
55
+ icon: e?.icon ? () => n("div", {
56
+ class: e?.icon
57
+ }, null) : void 0,
58
+ onSelect: e.onSelect
59
+ })) || []), L = (e) => {
60
+ const l = t.menus?.find((a) => a.value === e);
61
+ l && l.onSelect(w.value), v.value = !1;
62
+ }, M = H({
63
+ path: I.value,
68
64
  method: "POST"
69
- }), y = (l, e) => {
70
- for (const a of l)
65
+ }), y = (e, l) => {
66
+ for (const a of e)
71
67
  if (a.children) {
72
- for (const x of a.children)
73
- if (x.id === e)
68
+ for (const h of a.children)
69
+ if (h.id === l)
74
70
  return a;
75
- const i = y(a.children, e);
76
- if (i)
77
- return i;
71
+ const d = y(a.children, l);
72
+ if (d)
73
+ return d;
78
74
  }
79
- }, E = ({
80
- node: l,
81
- dragNode: e,
75
+ }, _ = ({
76
+ node: e,
77
+ dragNode: l,
82
78
  dropPosition: a
83
79
  }) => {
84
- var F, w;
85
- const i = y(s.value, e.id), x = !i, m = [...s.value];
86
- if (x) {
87
- const u = s.value.findIndex((X) => X.id === e.id);
88
- u >= 0 && m.splice(u, 1);
80
+ const d = y(s.value, l.id), h = !d, f = [...s.value];
81
+ if (h) {
82
+ const i = s.value.findIndex((D) => D.id === l.id);
83
+ i >= 0 && f.splice(i, 1);
89
84
  } else {
90
- const u = ((F = i == null ? void 0 : i.children) == null ? void 0 : F.indexOf(e)) || 0;
91
- (w = i == null ? void 0 : i.children) == null || w.splice(u, 1);
85
+ const i = d?.children?.indexOf(l) || 0;
86
+ d?.children?.splice(i, 1);
92
87
  }
93
- let d = y(m, l.id), b, c = (d == null ? void 0 : d.children) || m, o = 0;
88
+ let c = y(f, e.id), p, o = c?.children || f, r = 0;
94
89
  switch (a) {
95
90
  case "before":
96
- o = c.findIndex((u) => u.id === l.id), o > 0 && (b = c[o - 1].id);
91
+ r = o.findIndex((i) => i.id === e.id), r > 0 && (p = o[r - 1].id);
97
92
  break;
98
93
  case "inside":
99
- d = l, c = d.children = d.children || [], o = c.length;
94
+ c = e, o = c.children = c.children || [], r = o.length;
100
95
  break;
101
96
  case "after":
102
- o = c.findIndex((u) => u.id === l.id) + 1, b = l.id;
97
+ r = o.findIndex((i) => i.id === e.id) + 1, p = e.id;
103
98
  break;
104
99
  }
105
- c.splice(o, 0, e), s.value = m, z.mutate({
100
+ o.splice(r, 0, l), s.value = f, M.mutate({
106
101
  payload: {
107
- parent_id: d == null ? void 0 : d.id,
108
- before_id: b,
109
- id: e.id
102
+ parent_id: c?.id,
103
+ before_id: p,
104
+ id: l.id
110
105
  }
111
106
  });
112
- }, f = r([]);
113
- P(L, (l) => {
114
- var e;
115
- ((e = f == null ? void 0 : f.value) == null ? void 0 : e.length) > 0 || (f.value = l);
107
+ }, m = u([]);
108
+ O(j, (e) => {
109
+ m?.value?.length > 0 || (m.value = e);
116
110
  }, {
117
111
  immediate: !0
118
112
  });
119
- const R = C(() => {
113
+ const z = V(() => {
120
114
  const {
121
- title: l,
122
- path: e,
115
+ title: e,
116
+ path: l,
123
117
  sortPath: a,
124
- params: i,
125
- menus: x,
126
- numField: m,
127
- iconField: d,
128
- treeOptions: b,
129
- value: c,
130
- defaultValue: o,
131
- onUpdateValue: F,
132
- bordered: w,
133
- ...u
118
+ params: d,
119
+ menus: h,
120
+ numField: f,
121
+ iconField: c,
122
+ treeOptions: p,
123
+ value: o,
124
+ defaultValue: r,
125
+ onUpdateValue: i,
126
+ bordered: D,
127
+ ...E
134
128
  } = t;
135
- return u;
129
+ return E;
136
130
  });
137
- return () => n(le, {
131
+ return () => n(te, {
138
132
  class: "h-full",
139
133
  contentClass: "flex flex-col",
140
134
  bordered: t.bordered
141
135
  }, {
142
- default: () => {
143
- var l;
144
- return [(t == null ? void 0 : t.title) && n("div", {
145
- class: "px-2 py-3 pb-1 text-base font-bold"
146
- }, [t.title]), n("div", {
147
- class: "p-2 flex gap-2 items-center"
148
- }, [n("div", {
149
- class: "flex-1"
150
- }, [v.header ? v.header() : n($, {
151
- value: S.value,
152
- "onUpdate:value": (e) => S.value = e,
153
- placeholder: K("common.keyword")
154
- }, null)]), (l = v.tools) == null ? void 0 : l.call(v)]), n(p, {
155
- class: "flex-1 min-h-0",
156
- xScrollable: !0
136
+ default: () => [t?.title && n("div", {
137
+ class: "px-2 py-3 pb-1 text-base font-bold"
138
+ }, [t.title]), n("div", {
139
+ class: "p-2 flex gap-2 items-center"
140
+ }, [n("div", {
141
+ class: "flex-1"
142
+ }, [x.header ? x.header() : n(W, {
143
+ value: b.value,
144
+ "onUpdate:value": (e) => b.value = e,
145
+ placeholder: K("common.keyword")
146
+ }, null)]), x.tools?.()]), n(Z, {
147
+ class: "flex-1 min-h-0",
148
+ xScrollable: !0
149
+ }, {
150
+ default: () => [n("div", {
151
+ class: "p-2"
152
+ }, [n($, {
153
+ show: A.value,
154
+ class: "h-full"
157
155
  }, {
158
- default: () => [n("div", {
159
- class: "p-2"
160
- }, [n(ee, {
161
- show: B.value,
162
- class: "h-full"
163
- }, {
164
- default: () => [n(T, q(R.value, {
165
- data: s.value || [],
166
- expandedKeys: f.value,
167
- onUpdateExpandedKeys: (e) => {
168
- f.value = e;
169
- },
170
- blockLine: !0,
171
- selectedKeys: D.value,
172
- onUpdateSelectedKeys: (e) => {
173
- var a;
174
- D.value = e, (a = t == null ? void 0 : t.onUpdateValue) == null || a.call(t, e);
175
- },
176
- onDrop: E,
177
- pattern: S.value,
178
- renderPrefix: t != null && t.numField || t != null && t.iconField ? ({
179
- option: e
180
- }) => n(G, null, [t.iconField && e[t.iconField] && n("div", {
181
- class: Z(e[t.iconField] || "", "size-4")
182
- }, null), t.numField && n("div", {
183
- class: "rounded-full bg-primary px-2 text-xs text-white"
184
- }, [e[t.numField] || 0])]) : void 0,
185
- nodeProps: ({
186
- option: e
187
- }) => ({
188
- onContextmenu: (a) => {
189
- O.value = e, h.value = !0, V.value = a.clientX, k.value = a.clientY, a.preventDefault();
190
- }
191
- })
192
- }), null)]
193
- })])]
194
- }), n(te, {
195
- trigger: "manual",
196
- placement: "bottom-start",
197
- show: h.value,
198
- options: M.value,
199
- x: V.value,
200
- y: k.value,
201
- width: 100,
202
- onSelect: _,
203
- onClickoutside: () => {
204
- h.value = !1;
205
- }
206
- }, null)];
207
- }
156
+ default: () => [n(k, X(z.value, {
157
+ data: s.value || [],
158
+ expandedKeys: m.value,
159
+ onUpdateExpandedKeys: (e) => {
160
+ m.value = e;
161
+ },
162
+ blockLine: !0,
163
+ selectedKeys: F.value,
164
+ onUpdateSelectedKeys: (e) => {
165
+ F.value = e, t?.onUpdateValue?.(e);
166
+ },
167
+ onDrop: _,
168
+ pattern: b.value,
169
+ renderPrefix: t?.numField || t?.iconField ? ({
170
+ option: e
171
+ }) => n(Y, null, [t.iconField && e[t.iconField] && n("div", {
172
+ class: Q(e[t.iconField] || "", "size-4")
173
+ }, null), t.numField && n("div", {
174
+ class: "rounded-full bg-primary px-2 text-xs text-white"
175
+ }, [e[t.numField] || 0])]) : void 0,
176
+ nodeProps: ({
177
+ option: e
178
+ }) => ({
179
+ onContextmenu: (l) => {
180
+ w.value = e, v.value = !0, g.value = l.clientX, P.value = l.clientY, l.preventDefault();
181
+ }
182
+ })
183
+ }), null)]
184
+ })])]
185
+ }), n(ee, {
186
+ trigger: "manual",
187
+ placement: "bottom-start",
188
+ show: v.value,
189
+ options: B.value,
190
+ x: g.value,
191
+ y: P.value,
192
+ width: 100,
193
+ onSelect: L,
194
+ onClickoutside: () => {
195
+ v.value = !1;
196
+ }
197
+ }, null)]
208
198
  });
209
199
  }
210
200
  });
211
201
  export {
212
- oe as DuxTreeFilter
202
+ re as DuxTreeFilter
213
203
  };
@@ -1,32 +1,20 @@
1
- import { useManage as r, createS3UploadDriver as v, createLocalUploadDriver as U } from "@duxweb/dvha-core";
2
- import { computed as u } from "vue";
3
- const b = (a) => {
4
- const n = r(), d = u(() => {
5
- var t, l;
6
- return (a == null ? void 0 : a.uploadPath) || ((l = (t = n.config) == null ? void 0 : t.apiPath) == null ? void 0 : l.upload) || "upload";
7
- }), P = u(() => {
8
- var t, l;
9
- return (a == null ? void 0 : a.managePath) || ((l = (t = n.config) == null ? void 0 : t.apiPath) == null ? void 0 : l.uploadManager) || "uploadManager";
10
- }), f = u(() => {
11
- var t, l, e, c;
12
- return (a == null ? void 0 : a.driver) === "s3" ? v({
13
- signPath: (a == null ? void 0 : a.signPath) || ((l = (t = n.config) == null ? void 0 : t.apiPath) == null ? void 0 : l.upload) || d.value || "",
14
- signCallback: (a == null ? void 0 : a.signCallback) || ((c = (e = n.config) == null ? void 0 : e.upload) == null ? void 0 : c.signCallback) || ((i) => {
15
- var g, m, h;
16
- return {
17
- uploadUrl: (g = i.data) == null ? void 0 : g.uploadUrl,
18
- url: (m = i.data) == null ? void 0 : m.url,
19
- params: (h = i.data) == null ? void 0 : h.params
20
- };
21
- })
22
- }) : U();
23
- });
1
+ import { useManage as u, createS3UploadDriver as d, createLocalUploadDriver as e } from "@duxweb/dvha-core";
2
+ import { computed as r } from "vue";
3
+ const p = (a) => {
4
+ const t = u(), o = r(() => a?.uploadPath || t.config?.apiPath?.upload || "upload"), n = r(() => a?.managePath || t.config?.apiPath?.uploadManager || "uploadManager"), i = r(() => a?.driver === "s3" ? d({
5
+ signPath: a?.signPath || t.config?.apiPath?.upload || o.value || "",
6
+ signCallback: a?.signCallback || t.config?.upload?.signCallback || ((l) => ({
7
+ uploadUrl: l.data?.uploadUrl,
8
+ url: l.data?.url,
9
+ params: l.data?.params
10
+ }))
11
+ }) : e());
24
12
  return {
25
- uploadPath: d,
26
- managePath: P,
27
- driver: f
13
+ uploadPath: o,
14
+ managePath: n,
15
+ driver: i
28
16
  };
29
17
  };
30
18
  export {
31
- b as useUploadConfig
19
+ p as useUploadConfig
32
20
  };