@duxweb/dvha-pro 1.1.5 → 1.1.7

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.
@@ -1,10 +1,10 @@
1
- import { defineComponent as q, toRef as S, ref as u, watch as V, computed as C, createVNode as n, mergeProps as G, Fragment as H } from "vue";
2
- import { useI18n as J, useTree as Q, useCustomMutation as W } from "@duxweb/dvha-core";
1
+ import { defineComponent as Y, toRef as w, ref as u, watch as C, computed as K, createVNode as n, mergeProps as q, Fragment as G } from "vue";
2
+ import { useI18n as H, useTree as Q, useCustomMutation as W } from "@duxweb/dvha-core";
3
3
  import { useVModel as Z } from "@vueuse/core";
4
4
  import $ from "clsx";
5
- import { NTree as K, NInput as ee, NButton as le, NScrollbar as te, NSpin as ne, NDropdown as ae } from "naive-ui";
5
+ import { NTree as N, NInput as ee, NButton as le, NScrollbar as te, NSpin as ne, NDropdown as ae } from "naive-ui";
6
6
  import { DuxCard as ie } from "../card/card.js";
7
- const fe = /* @__PURE__ */ q({
7
+ const fe = /* @__PURE__ */ Y({
8
8
  name: "DuxTreeFilter",
9
9
  props: {
10
10
  title: String,
@@ -24,32 +24,32 @@ const fe = /* @__PURE__ */ q({
24
24
  default: !1
25
25
  }
26
26
  },
27
- extends: K,
27
+ extends: N,
28
28
  setup(t, {
29
29
  emit: T,
30
30
  slots: b
31
31
  }) {
32
- const w = Z(t, "value", T, {
32
+ const F = Z(t, "value", T, {
33
33
  passive: !1,
34
34
  defaultValue: t.defaultValue
35
- }), U = S(t, "params", {}), A = S(t, "path", ""), I = S(t, "sortPath", ""), F = u(), P = u(0), k = u(0), r = u([]), y = u(), {
36
- t: N
37
- } = J(), {
38
- options: E,
39
- loading: B,
40
- expanded: j
35
+ }), U = w(t, "params", {}), A = w(t, "path", ""), I = w(t, "sortPath", ""), k = u(), P = u(0), O = u(0), o = u([]), y = u(), {
36
+ t: E
37
+ } = H(), {
38
+ options: B,
39
+ loading: j,
40
+ expanded: L
41
41
  } = Q({
42
42
  path: A.value,
43
43
  params: U.value,
44
44
  ...t.treeOptions
45
45
  });
46
- V(E, (e) => {
47
- r.value = e;
46
+ C(B, (e) => {
47
+ o.value = e;
48
48
  }, {
49
49
  immediate: !0,
50
50
  deep: !0
51
51
  });
52
- const p = u(!1), L = C(() => t.menus?.map((e) => ({
52
+ const p = u(!1), g = K(() => t.menus?.map((e) => ({
53
53
  label: e.label,
54
54
  key: e.value,
55
55
  icon: e?.icon ? () => n("div", {
@@ -58,34 +58,34 @@ const fe = /* @__PURE__ */ q({
58
58
  onSelect: e.onSelect
59
59
  })) || []), M = (e) => {
60
60
  const l = t.menus?.find((a) => a.value === e);
61
- l && l.onSelect(F.value), p.value = !1;
61
+ l && l.onSelect(k.value), p.value = !1;
62
62
  }, _ = W({
63
63
  path: I.value,
64
64
  method: "POST"
65
- }), g = (e, l) => {
65
+ }), S = (e, l) => {
66
66
  for (const a of e)
67
67
  if (a.children) {
68
68
  for (const i of a.children)
69
69
  if (i.id === l)
70
70
  return a;
71
- const o = g(a.children, l);
72
- if (o)
73
- return o;
71
+ const r = S(a.children, l);
72
+ if (r)
73
+ return r;
74
74
  }
75
75
  }, z = ({
76
76
  node: e,
77
77
  dragNode: l,
78
78
  dropPosition: a
79
79
  }) => {
80
- const o = g(r.value, l.id), i = !o, m = [...r.value];
80
+ const r = S(o.value, l.id), i = !r, m = [...o.value];
81
81
  if (i) {
82
- const d = r.value.findIndex((O) => O.id === l.id);
82
+ const d = o.value.findIndex((V) => V.id === l.id);
83
83
  d >= 0 && m.splice(d, 1);
84
84
  } else {
85
- const d = o?.children?.indexOf(l) || 0;
86
- o?.children?.splice(d, 1);
85
+ const d = r?.children?.indexOf(l) || 0;
86
+ r?.children?.splice(d, 1);
87
87
  }
88
- let h = g(m, e.id), x, s = h?.children || m, c = 0;
88
+ let h = S(m, e.id), x, s = h?.children || m, c = 0;
89
89
  switch (a) {
90
90
  case "before":
91
91
  c = s.findIndex((d) => d.id === e.id), c > 0 && (x = s[c - 1].id);
@@ -97,7 +97,7 @@ const fe = /* @__PURE__ */ q({
97
97
  c = s.findIndex((d) => d.id === e.id) + 1, x = e.id;
98
98
  break;
99
99
  }
100
- s.splice(c, 0, l), r.value = m, _.mutate({
100
+ s.splice(c, 0, l), o.value = m, _.mutate({
101
101
  payload: {
102
102
  parent_id: h?.id,
103
103
  before_id: x,
@@ -105,26 +105,26 @@ const fe = /* @__PURE__ */ q({
105
105
  }
106
106
  });
107
107
  }, f = u([]), v = u(!1);
108
- V(j, (e) => {
108
+ C(L, (e) => {
109
109
  f?.value?.length > 0 || (v.value = e.length > 0, f.value = e);
110
110
  }, {
111
111
  immediate: !0
112
112
  });
113
113
  const D = (e) => {
114
- const l = [], a = (o) => {
115
- o.forEach((i) => {
114
+ const l = [], a = (r) => {
115
+ r.forEach((i) => {
116
116
  i.children && i.children.length > 0 && (l.push(i.key || i.id), a(i.children));
117
117
  });
118
118
  };
119
119
  return a(e), l;
120
- }, R = () => {
121
- v.value ? (f.value = [], v.value = !1) : (f.value = D(r.value), v.value = !0);
122
- }, X = C(() => {
120
+ }, J = () => {
121
+ v.value ? (f.value = [], v.value = !1) : (f.value = D(o.value), v.value = !0);
122
+ }, R = K(() => {
123
123
  const {
124
124
  title: e,
125
125
  path: l,
126
126
  sortPath: a,
127
- params: o,
127
+ params: r,
128
128
  menus: i,
129
129
  numField: m,
130
130
  iconField: h,
@@ -132,10 +132,10 @@ const fe = /* @__PURE__ */ q({
132
132
  value: s,
133
133
  defaultValue: c,
134
134
  onUpdateValue: d,
135
- bordered: O,
136
- ...Y
135
+ bordered: V,
136
+ ...X
137
137
  } = t;
138
- return Y;
138
+ return X;
139
139
  });
140
140
  return () => n(ie, {
141
141
  class: "h-full",
@@ -151,11 +151,11 @@ const fe = /* @__PURE__ */ q({
151
151
  }, [b.header ? b.header() : n(ee, {
152
152
  value: y.value,
153
153
  "onUpdate:value": (e) => y.value = e,
154
- placeholder: N("common.keyword")
154
+ placeholder: E("common.keyword")
155
155
  }, {
156
156
  prefix: () => n(le, {
157
157
  text: !0,
158
- onClick: R,
158
+ onClick: J,
159
159
  class: "mr-1!"
160
160
  }, {
161
161
  icon: () => n("div", {
@@ -169,27 +169,28 @@ const fe = /* @__PURE__ */ q({
169
169
  default: () => [n("div", {
170
170
  class: "p-2"
171
171
  }, [n(ne, {
172
- show: B.value,
172
+ show: j.value,
173
173
  class: "h-full"
174
174
  }, {
175
- default: () => [n(K, G(X.value, {
176
- data: r.value || [],
175
+ default: () => [n(N, q(R.value, {
176
+ key: JSON.stringify(o.value),
177
+ data: o.value || [],
177
178
  expandedKeys: f.value,
178
179
  onUpdateExpandedKeys: (e) => {
179
180
  f.value = e;
180
- const l = D(r.value);
181
+ const l = D(o.value);
181
182
  v.value = l.length > 0 && l.every((a) => e.includes(a));
182
183
  },
183
184
  blockLine: !0,
184
- selectedKeys: w.value,
185
+ selectedKeys: F.value,
185
186
  onUpdateSelectedKeys: (e) => {
186
- w.value = e, t?.onUpdateValue?.(e);
187
+ F.value = e, t?.onUpdateValue?.(e);
187
188
  },
188
189
  onDrop: z,
189
190
  pattern: y.value,
190
191
  renderPrefix: t?.numField || t?.iconField ? ({
191
192
  option: e
192
- }) => n(H, null, [t.iconField && e[t.iconField] && n("div", {
193
+ }) => n(G, null, [t.iconField && e[t.iconField] && n("div", {
193
194
  class: $(e[t.iconField] || "", "size-4")
194
195
  }, null), t.numField && n("div", {
195
196
  class: "rounded-full bg-primary px-2 text-xs text-white"
@@ -198,18 +199,18 @@ const fe = /* @__PURE__ */ q({
198
199
  option: e
199
200
  }) => ({
200
201
  onContextmenu: (l) => {
201
- F.value = e, p.value = !0, P.value = l.clientX, k.value = l.clientY, l.preventDefault();
202
+ g.value?.length && (k.value = e, p.value = !0, P.value = l.clientX, O.value = l.clientY, l.preventDefault());
202
203
  }
203
204
  })
204
205
  }), null)]
205
206
  })])]
206
- }), n(ae, {
207
+ }), g.value?.length > 0 && n(ae, {
207
208
  trigger: "manual",
208
209
  placement: "bottom-start",
209
210
  show: p.value,
210
- options: L.value,
211
+ options: g.value,
211
212
  x: P.value,
212
- y: k.value,
213
+ y: O.value,
213
214
  width: 100,
214
215
  onSelect: M,
215
216
  onClickoutside: () => {
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as U, ref as c, computed as s, watch as b, nextTick as w, createVNode as o, Fragment as Z, createTextVNode as j, isVNode as O } from "vue";
2
2
  import { useI18n as B, useUpload as T } from "@duxweb/dvha-core";
3
- import { useVModel as X, useDropZone as E } from "@vueuse/core";
4
- import L from "mime";
3
+ import { useVModel as X, useDropZone as L } from "@vueuse/core";
4
+ import E from "mime";
5
5
  import { useMessage as I, NDataTable as W, NProgress as G, NButton as F } from "naive-ui";
6
6
  import "vue-router";
7
7
  import "@overlastic/vue";
@@ -130,6 +130,7 @@ const d = {
130
130
  setup(t, {
131
131
  emit: S
132
132
  }) {
133
+ console.log("props", t);
133
134
  const u = X(t, "value", S, {
134
135
  passive: !0,
135
136
  deep: !0,
@@ -148,7 +149,7 @@ const d = {
148
149
  uploadPath: t?.path,
149
150
  managePath: t?.managePath,
150
151
  method: t?.method
151
- }), n = T({
152
+ }), l = T({
152
153
  path: g.value,
153
154
  multiple: t.multiple,
154
155
  maxFileCount: t.maxNum,
@@ -159,29 +160,27 @@ const d = {
159
160
  driver: k.value,
160
161
  method: v.value
161
162
  }), {
162
- isOverDropZone: x
163
- } = E(f, {
163
+ isOverDropZone: h
164
+ } = L(f, {
164
165
  onDrop: (e) => {
165
- e && e.length > 0 && n.addFiles(Array.from(e), "file");
166
+ e && e.length > 0 && l.addFiles(Array.from(e), "file");
166
167
  }
167
168
  }), p = c(!1);
168
- b(n.dataFiles, (e) => {
169
+ b(l.dataFiles, (e) => {
169
170
  const i = t.multiple ? e : e[0];
170
171
  p.value = !0, u.value = i, t.onUpdateValue?.(i), w(() => {
171
172
  p.value = !1;
172
173
  });
173
174
  });
174
- const h = s(() => t.accept ? t.accept.split(",").map((e) => {
175
+ const x = s(() => t.accept ? t.accept.split(",").map((e) => {
175
176
  const i = e.trim();
176
177
  if (d[i]) return d[i];
177
178
  if (i.includes("*")) {
178
179
  const A = i.split("/")[0];
179
- return d[i] || a("common.fileExtension", {
180
- ext: A.toUpperCase()
181
- });
180
+ return d[i] || A.toUpperCase();
182
181
  }
183
- const l = L.getExtension(i);
184
- return l ? l.toUpperCase() : i;
182
+ const n = E.getExtension(i);
183
+ return n ? n.toUpperCase() : i;
185
184
  }).filter(Boolean).join(", ") : ""), z = s(() => ({
186
185
  pending: o("div", {
187
186
  class: "text-info"
@@ -195,13 +194,13 @@ const d = {
195
194
  error: o("div", {
196
195
  class: "text-error"
197
196
  }, [a("components.upload.status.error")])
198
- })), D = s(() => [r.dropZone.base, x.value ? r.dropZone.active : r.dropZone.hover]), M = s(() => [n.uploadFiles.value.length === 0 && "border-b border-muted"]), y = c(!1);
197
+ })), D = s(() => [r.dropZone.base, h.value ? r.dropZone.active : r.dropZone.hover]), M = s(() => [l.uploadFiles.value.length === 0 && "border-b border-muted"]), y = c(!1);
199
198
  return b(u, (e) => {
200
199
  if (p.value || !e || !e?.length || y.value)
201
200
  return;
202
201
  y.value = !0;
203
202
  const i = Array.isArray(e) ? e : [e];
204
- n.addDataFiles(i);
203
+ l.addDataFiles(i);
205
204
  }, {
206
205
  immediate: !0
207
206
  }), () => o("div", {
@@ -209,7 +208,7 @@ const d = {
209
208
  }, [o("div", {
210
209
  ref: f,
211
210
  class: D.value,
212
- onClick: () => n.open()
211
+ onClick: () => l.open()
213
212
  }, [o("div", {
214
213
  class: r.content
215
214
  }, [o("div", {
@@ -231,7 +230,7 @@ const d = {
231
230
  }
232
231
  }
233
232
  }).then((i) => {
234
- n.addDataFiles(i);
233
+ l.addDataFiles(i);
235
234
  }));
236
235
  }
237
236
  }, [o("div", {
@@ -240,10 +239,10 @@ const d = {
240
239
  class: r.text.title
241
240
  }, [a("components.upload.desc")]), o("div", {
242
241
  class: r.text.desc
243
- }, [x.value ? o("span", {
242
+ }, [h.value ? o("span", {
244
243
  class: r.text.highlight
245
- }, [a("components.upload.dropHere")]) : o(Z, null, [h.value ? a("components.upload.supportFormats", {
246
- formats: h.value
244
+ }, [a("components.upload.dropHere")]) : o(Z, null, [x.value ? a("components.upload.supportFormats", {
245
+ formats: x.value
247
246
  }) : a("components.upload.allFormats"), j(","), " ", a("components.upload.maxSize", {
248
247
  size: m.value
249
248
  })])])])]), o(W, {
@@ -284,7 +283,7 @@ const d = {
284
283
  title: a("components.upload.actions"),
285
284
  width: 120,
286
285
  render: (e) => {
287
- let i, l;
286
+ let i, n;
288
287
  return o("div", {
289
288
  class: r.table.actions
290
289
  }, [o(F, {
@@ -292,20 +291,20 @@ const d = {
292
291
  size: "small",
293
292
  text: !0,
294
293
  disabled: ["success", "error", "cancelled"].includes(e.status),
295
- onClick: () => n.cancelFiles([e.id])
294
+ onClick: () => l.cancelFiles([e.id])
296
295
  }, P(i = a("components.upload.cancel")) ? i : {
297
296
  default: () => [i]
298
297
  }), o(F, {
299
298
  type: "error",
300
299
  size: "small",
301
300
  text: !0,
302
- onClick: () => n.removeFiles([e.id])
303
- }, P(l = a("components.upload.delete")) ? l : {
304
- default: () => [l]
301
+ onClick: () => l.removeFiles([e.id])
302
+ }, P(n = a("components.upload.delete")) ? n : {
303
+ default: () => [n]
305
304
  })]);
306
305
  }
307
306
  }],
308
- data: n.uploadFiles.value
307
+ data: l.uploadFiles.value
309
308
  }, {
310
309
  empty: () => o("div", {
311
310
  class: r.table.empty
@@ -1,8 +1,8 @@
1
- import { defineComponent as U, computed as m, watch as c, ref as k, createVNode as a } from "vue";
1
+ import { defineComponent as k, computed as n, watch as g, createVNode as r } from "vue";
2
2
  import { useI18n as w, useUpload as I } from "@duxweb/dvha-core";
3
3
  import { useVModel as V } from "@vueuse/core";
4
- import j from "clsx";
5
- import { useMessage as A, NImage as D, NButton as g, NProgress as B } from "naive-ui";
4
+ import A from "clsx";
5
+ import { useMessage as j, NImage as B, NButton as v, NProgress as D } from "naive-ui";
6
6
  import { VueDraggable as M } from "vue-draggable-plus";
7
7
  import "vue-router";
8
8
  import "@overlastic/vue";
@@ -63,7 +63,7 @@ import "dayjs";
63
63
  import { useImagePreview as q } from "../../hooks/image.js";
64
64
  import "@tanstack/vue-query";
65
65
  import "pinia";
66
- const Ze = /* @__PURE__ */ U({
66
+ const Ze = /* @__PURE__ */ k({
67
67
  name: "DuxImageUpload",
68
68
  props: {
69
69
  path: {
@@ -95,14 +95,14 @@ const Ze = /* @__PURE__ */ U({
95
95
  method: String
96
96
  },
97
97
  setup(t, {
98
- emit: v
98
+ emit: h
99
99
  }) {
100
- const n = V(t, "value", v, {
100
+ const u = V(t, "value", h, {
101
101
  passive: !0,
102
102
  deep: !0,
103
103
  defaultValue: t.defaultValue
104
- }), h = A(), f = q(), {
105
- t: u
104
+ }), f = j(), b = q(), {
105
+ t: s
106
106
  } = w(), i = {
107
107
  container: "flex gap-2",
108
108
  imageItem: "size-80px rounded border border-muted relative group draggable flex items-center",
@@ -111,11 +111,11 @@ const Ze = /* @__PURE__ */ U({
111
111
  uploadContent: "flex-1 flex flex-col justify-center items-center gap-1 relative",
112
112
  progressContainer: "size-80px flex items-center justify-center rounded",
113
113
  progressBar: "absolute left-2 right-2 bottom-2"
114
- }, b = m(() => t.maxSize), {
115
- uploadPath: s,
116
- managePath: x,
117
- driver: y,
118
- method: d
114
+ }, x = n(() => t.maxSize), {
115
+ uploadPath: d,
116
+ managePath: y,
117
+ driver: z,
118
+ method: p
119
119
  } = O({
120
120
  driver: t?.driver,
121
121
  signPath: t?.signPath,
@@ -123,119 +123,115 @@ const Ze = /* @__PURE__ */ U({
123
123
  uploadPath: t?.path,
124
124
  managePath: t?.managePath,
125
125
  method: t?.method
126
- }), r = I({
127
- path: s.value,
126
+ }), a = I({
127
+ path: d.value,
128
128
  multiple: t.multiple,
129
129
  maxFileCount: t.maxNum,
130
- maxFileSize: b.value * 1024 * 1024,
130
+ maxFileSize: x.value * 1024 * 1024,
131
131
  autoUpload: !0,
132
132
  accept: "image/*",
133
- method: d.value,
133
+ method: p.value,
134
134
  onError: (e) => {
135
- h.error(e.message || u("components.upload.error"));
135
+ f.error(e.message || s("components.upload.error"));
136
136
  },
137
- driver: y.value
137
+ driver: z.value
138
138
  });
139
- c(r.dataFiles, (e) => {
139
+ g(a.dataFiles, (e) => {
140
140
  const o = t.multiple ? e?.map((l) => l.url) : e?.[0]?.url;
141
- n.value = o, t.onUpdateValue?.(o);
141
+ u.value = o, t.onUpdateValue?.(o);
142
142
  });
143
- const z = m(() => r.progress.value.totalPercent), F = m(() => r.isUploading.value), P = async () => {
144
- r.open();
145
- }, C = m(() => t.multiple ? t.maxNum && r.uploadFiles.value.length >= t.maxNum : !0), S = m(() => r.dataFiles.value?.map((e) => e.url)), N = L(), p = k(!1);
146
- return c(n, (e) => {
147
- if (!e || !e?.length || p.value)
148
- return;
149
- p.value = !0;
150
- const o = typeof e == "string" ? [e] : Array.isArray(e) ? e : [];
151
- r.addDataFiles(o.map((l) => ({
152
- url: l
143
+ const F = n(() => a.progress.value.totalPercent), P = n(() => a.isUploading.value), C = async () => {
144
+ a.open();
145
+ }, S = n(() => t.multiple ? t.maxNum && a.uploadFiles.value.length >= t.maxNum : !0), N = n(() => a.dataFiles.value?.map((e) => e.url)), U = L();
146
+ return g(u, (e) => {
147
+ if (!e || !(Array.isArray(e) ? e.length : String(e).length)) return;
148
+ const o = typeof e == "string" ? [e] : Array.isArray(e) ? e : [], l = (a.dataFiles.value || []).map((m) => m.url).filter(Boolean), c = o.filter((m) => !l.includes(m));
149
+ c.length && a.addDataFiles(c.map((m) => ({
150
+ url: m
153
151
  })));
154
- }, {
155
- immediate: !0
156
- }), () => a("div", null, [a(M, {
157
- modelValue: r.uploadFiles.value,
158
- "onUpdate:modelValue": (e) => r.uploadFiles.value = e,
152
+ }), () => r("div", null, [r(M, {
153
+ modelValue: a.uploadFiles.value,
154
+ "onUpdate:modelValue": (e) => a.uploadFiles.value = e,
159
155
  class: i.container,
160
156
  draggable: ".draggable"
161
157
  }, {
162
- default: () => [r.uploadFiles.value?.map((e, o) => {
158
+ default: () => [a.uploadFiles.value?.map((e, o) => {
163
159
  const l = e.url || URL.createObjectURL(e.file);
164
- return a("div", {
160
+ return r("div", {
165
161
  key: o,
166
- class: j(i.imageItem)
167
- }, [a(D, {
162
+ class: A(i.imageItem)
163
+ }, [r(B, {
168
164
  class: "z-0 rounded",
169
165
  objectFit: "scale-down",
170
166
  width: 78,
171
167
  height: 78,
172
168
  previewDisabled: !0,
173
169
  src: l
174
- }, null), a("div", {
170
+ }, null), r("div", {
175
171
  class: i.imageOverlay
176
- }, [e.status === "success" && a(g, {
172
+ }, [e.status === "success" && r(v, {
177
173
  quaternary: !0,
178
174
  circle: !0,
179
175
  size: "small",
180
- renderIcon: () => a("div", {
176
+ renderIcon: () => r("div", {
181
177
  class: "n-icon i-tabler:eye"
182
178
  }, null),
183
- onClick: () => f.show(S.value, o)
184
- }, null), a(g, {
179
+ onClick: () => b.show(N.value, o)
180
+ }, null), r(v, {
185
181
  quaternary: !0,
186
182
  circle: !0,
187
183
  size: "small",
188
- renderIcon: () => a("div", {
184
+ renderIcon: () => r("div", {
189
185
  class: "n-icon i-tabler:trash"
190
186
  }, null),
191
187
  onClick: () => {
192
- r.removeFiles([e.id]);
188
+ a.removeFiles([e.id]);
193
189
  }
194
190
  }, null)])]);
195
- }), (r.uploadFiles.value.length === 0 || !C.value) && a("div", {
191
+ }), (a.uploadFiles.value.length === 0 || !S.value) && r("div", {
196
192
  class: i.uploadArea,
197
193
  onClick: () => {
198
- P();
194
+ C();
199
195
  }
200
- }, [t.manager && a("div", {
196
+ }, [t.manager && r("div", {
201
197
  class: " py-1 text-xs bg-muted border-b border-dashed border-accented flex items-center justify-center",
202
198
  onClick: (e) => {
203
- e.stopPropagation(), N.show({
204
- title: u("components.upload.title"),
199
+ e.stopPropagation(), U.show({
200
+ title: s("components.upload.title"),
205
201
  width: "800px",
206
202
  component: () => import("./manager.js"),
207
203
  componentProps: {
208
- path: x.value,
204
+ path: y.value,
209
205
  type: "image",
210
206
  multiple: t.multiple,
211
207
  uploadParams: {
212
- path: s.value,
208
+ path: d.value,
213
209
  accept: "image/*",
214
210
  maxNum: t.maxNum,
215
211
  maxSize: t.maxSize,
216
- method: d.value
212
+ method: p.value
217
213
  }
218
214
  }
219
215
  }).then((o) => {
220
- r.addDataFiles(o);
216
+ a.addDataFiles(o);
221
217
  });
222
218
  }
223
- }, [a("div", {
219
+ }, [r("div", {
224
220
  class: "i-tabler:folder size-4"
225
- }, null)]), a("div", {
221
+ }, null)]), r("div", {
226
222
  class: i.uploadContent
227
- }, [F.value ? a("div", {
223
+ }, [P.value ? r("div", {
228
224
  class: i.progressContainer
229
- }, [a("div", {
225
+ }, [r("div", {
230
226
  class: "i-tabler:photo size-6"
231
- }, null), a("div", {
227
+ }, null), r("div", {
232
228
  class: i.progressBar
233
- }, [a(B, {
229
+ }, [r(D, {
234
230
  type: "line",
235
- percentage: z.value,
231
+ percentage: F.value,
236
232
  showIndicator: !1,
237
233
  height: 4
238
- }, null)])]) : a("div", {
234
+ }, null)])]) : r("div", {
239
235
  class: "i-tabler:plus size-4"
240
236
  }, null)])])]
241
237
  })]);
@@ -1,28 +1,24 @@
1
- import { defineComponent as r, createVNode as t, h as m, mergeProps as d } from "vue";
2
- import { NImage as i } from "naive-ui";
3
- import { DuxPlaceholder as h } from "./placeholder.js";
4
- const o = /* @__PURE__ */ r({
1
+ import { defineComponent as i, createVNode as t, h as m, mergeProps as d } from "vue";
2
+ import { NImage as h } from "naive-ui";
3
+ import { DuxPlaceholder as r } from "./placeholder.js";
4
+ const a = /* @__PURE__ */ i({
5
5
  name: "DuxImage",
6
6
  props: {},
7
- extends: i,
7
+ extends: h,
8
8
  setup(e) {
9
- return () => e.src ? t(i, d(e, {
9
+ return () => e.src ? t(h, d(e, {
10
10
  src: e.src
11
11
  }), {
12
- placeholder: () => t(h, {
13
- width: e.width,
14
- height: e.height
15
- }, null),
16
- error: () => t(h, {
12
+ placeholder: () => t(r, {
17
13
  width: e.width,
18
14
  height: e.height
19
15
  }, null)
20
- }) : m(h, {
16
+ }) : m(r, {
21
17
  width: e.width,
22
18
  height: e.height
23
19
  });
24
20
  }
25
21
  });
26
22
  export {
27
- o as DuxImage
23
+ a as DuxImage
28
24
  };