@webx-ui/module-media 0.6.2 → 0.7.0

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.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { defineComponent as S, useModel as A, ref as R, watch as G, openBlock as h, createBlock as T, unref as e, mergeModels as q, computed as z, resolveDirective as Ge, withCtx as b, createElementBlock as L, Fragment as ce, renderList as me, withDirectives as Ye, createCommentVNode as B, createVNode as g, createTextVNode as O, toDisplayString as U, isRef as ve, useTemplateRef as oe, onMounted as Fe, nextTick as Je, createElementVNode as V, withKeys as Qe, normalizeClass as pe, createSlots as We, inject as Ze, normalizeStyle as fe, mergeProps as ge } from "vue";
1
+ import { defineComponent as S, useModel as A, ref as R, watch as G, openBlock as b, createBlock as T, unref as e, mergeModels as q, computed as z, resolveDirective as Ge, withCtx as w, createElementBlock as L, Fragment as ce, renderList as me, withDirectives as Ye, createCommentVNode as D, createVNode as g, createTextVNode as O, toDisplayString as U, isRef as ve, useTemplateRef as oe, onMounted as Fe, nextTick as Je, createElementVNode as V, withKeys as Qe, normalizeClass as pe, createSlots as We, inject as Ze, normalizeStyle as fe, mergeProps as ge } from "vue";
2
2
  import { useTranslate as H, useAdmin as se, useErrorText as et, adminKey as tt, WxListScreen as lt } from "@webx-ui/module-admin";
3
- import { WxTree as at, WxSelectionArea as it, WxFileCard as Le, WxEmpty as nt, toast as J, WxAction as D, WxInput as Z, WxDropdown as Ve, WxDropdownItem as Te, WxActions as le, useModal as ye, WxDialog as he, WxSelect as ot, WxSpace as be, WxButton as I, useElementWidth as st, createModal as ae, WxPagination as rt, WxDrawer as dt, confirm as ue, openImageEditor as ut, WxSortableList as ct, WxPopover as Re, WxPopconfirm as Be, WxImage as mt, WxCard as pt } from "@webx-ui/core";
3
+ import { WxTree as at, WxSelectionArea as it, WxFileCard as Le, WxEmpty as nt, toast as J, WxAction as B, WxInput as Z, WxDropdown as Ve, WxDropdownItem as Te, WxActions as le, useModal as ye, WxDialog as he, WxSelect as ot, WxSpace as be, WxButton as I, useElementWidth as st, createModal as ae, WxPagination as rt, WxDrawer as dt, confirm as ue, openImageEditor as ut, WxSortableList as ct, WxPopover as Re, WxPopconfirm as De, WxImage as mt, WxCard as pt } from "@webx-ui/core";
4
4
  function we(a) {
5
5
  const i = `${a.apiPath}/media`, n = (l) => l.data;
6
6
  return {
@@ -67,7 +67,7 @@ function ft() {
67
67
  const a = document.cookie.split("; ").find((i) => i.startsWith("XSRF-TOKEN="));
68
68
  return a ? decodeURIComponent(a.slice(11)) : null;
69
69
  }
70
- function De(a) {
70
+ function Be(a) {
71
71
  const i = ["B", "KB", "MB", "GB", "TB"];
72
72
  let n = a, l = 0;
73
73
  for (; n >= 1024 && l < i.length - 1; )
@@ -109,13 +109,13 @@ const ze = /* @__PURE__ */ S({
109
109
  const k = u.zone === "inside" ? u.target : u.parent;
110
110
  k && r("move", u.node.id, k.id);
111
111
  }
112
- return (u, k) => (h(), T(e(at), {
112
+ return (u, k) => (b(), T(e(at), {
113
113
  selected: l.value,
114
- "onUpdate:selected": k[0] || (k[0] = (w) => l.value = w),
114
+ "onUpdate:selected": k[0] || (k[0] = (h) => l.value = h),
115
115
  expanded: t.value,
116
- "onUpdate:expanded": k[1] || (k[1] = (w) => t.value = w),
116
+ "onUpdate:expanded": k[1] || (k[1] = (h) => t.value = h),
117
117
  modelValue: v.value,
118
- "onUpdate:modelValue": k[2] || (k[2] = (w) => v.value = w),
118
+ "onUpdate:modelValue": k[2] || (k[2] = (h) => v.value = h),
119
119
  class: "wx-media-tree",
120
120
  "node-key": "id",
121
121
  draggable: "",
@@ -159,47 +159,49 @@ const ze = /* @__PURE__ */ S({
159
159
  }
160
160
  return (y, s) => {
161
161
  const u = Ge("wx-select");
162
- return a.files.length > 0 ? (h(), T(e(it), {
162
+ return a.files.length > 0 ? (b(), T(e(it), {
163
163
  key: 0,
164
164
  modelValue: l.value,
165
165
  "onUpdate:modelValue": s[0] || (s[0] = (k) => l.value = k),
166
166
  class: "wx-media-grid",
167
167
  multiple: !a.single
168
168
  }, {
169
- default: b(({ isSelected: k }) => [
170
- (h(!0), L(ce, null, me(a.files, (w) => Ye((h(), T(e(Le), {
171
- key: w.id,
169
+ default: w(({ isSelected: k }) => [
170
+ (b(!0), L(ce, null, me(a.files, (h) => Ye((b(), T(e(Le), {
171
+ key: h.id,
172
172
  class: "wx-media-grid__card",
173
- name: w.name,
174
- url: w.url,
175
- thumbnail: a.api.thumb(w, 320, 320) ?? void 0,
176
- type: w.mime,
177
- selected: k(w.id),
173
+ name: h.name,
174
+ url: h.url,
175
+ thumbnail: a.api.thumb(h, 320, 320) ?? void 0,
176
+ type: h.mime,
177
+ selected: k(h.id),
178
178
  renamable: "",
179
- editable: w.editable,
179
+ editable: h.editable,
180
180
  removable: "",
181
181
  copyable: "",
182
182
  "actions-menu": "",
183
183
  "rename-label": e(d)("manager.rename"),
184
184
  "edit-label": e(d)("manager.edit"),
185
185
  "remove-label": e(d)("manager.delete"),
186
- "remove-confirm-text": e(d)("dialogs.delete-file", { name: w.name }),
186
+ "remove-confirm-text": e(d)("dialogs.delete-file", { name: h.name }),
187
187
  "cancel-label": e(d)("manager.cancel"),
188
188
  "save-label": e(d)("manager.save"),
189
+ "download-url": h.source ?? h.url,
189
190
  "copy-label": e(d)("manager.copy-link"),
191
+ "download-label": e(d)("manager.download"),
190
192
  "copied-label": e(d)("manager.link-copied"),
191
- onRename: (o) => r("rename", w, o),
192
- onEdit: (o) => r("edit", w),
193
- onRemove: (o) => r("remove", w),
193
+ onRename: (o) => r("rename", h, o),
194
+ onEdit: (o) => r("edit", h),
195
+ onRemove: (o) => r("remove", h),
194
196
  onCopy: t,
195
- onCopyError: (o) => x(w),
196
- onDblclick: (o) => r("open", w)
197
- }, null, 8, ["name", "url", "thumbnail", "type", "selected", "editable", "rename-label", "edit-label", "remove-label", "remove-confirm-text", "cancel-label", "save-label", "copy-label", "copied-label", "onRename", "onEdit", "onRemove", "onCopyError", "onDblclick"])), [
198
- [u, w.id]
197
+ onCopyError: (o) => x(h),
198
+ onDblclick: (o) => r("open", h)
199
+ }, null, 8, ["name", "url", "thumbnail", "type", "selected", "editable", "rename-label", "edit-label", "remove-label", "remove-confirm-text", "cancel-label", "save-label", "download-url", "copy-label", "download-label", "copied-label", "onRename", "onEdit", "onRemove", "onCopyError", "onDblclick"])), [
200
+ [u, h.id]
199
201
  ])), 128))
200
202
  ]),
201
203
  _: 1
202
- }, 8, ["modelValue", "multiple"])) : (h(), T(e(nt), {
204
+ }, 8, ["modelValue", "multiple"])) : (b(), T(e(nt), {
203
205
  key: 1,
204
206
  description: v.value
205
207
  }, null, 8, ["description"]));
@@ -235,37 +237,37 @@ const ze = /* @__PURE__ */ S({
235
237
  { value: "name", label: t("manager.sort-name") },
236
238
  { value: "-size", label: t("manager.sort-size") }
237
239
  ]), s = z(() => x.value.find((k) => k.value === r.value)?.label ?? ""), u = z(() => y.value.find((k) => k.value === d.value)?.label ?? "");
238
- return (k, w) => (h(), L("header", yt, [
239
- a.compact ? (h(), T(e(D), {
240
+ return (k, h) => (b(), L("header", yt, [
241
+ a.compact ? (b(), T(e(B), {
240
242
  key: 0,
241
243
  icon: "sidebar",
242
244
  title: e(t)("manager.folders"),
243
245
  size: "sm",
244
- onClick: w[0] || (w[0] = (o) => v("folders"))
245
- }, null, 8, ["title"])) : B("", !0),
246
+ onClick: h[0] || (h[0] = (o) => v("folders"))
247
+ }, null, 8, ["title"])) : D("", !0),
246
248
  g(e(Z), {
247
249
  modelValue: l.value,
248
- "onUpdate:modelValue": w[1] || (w[1] = (o) => l.value = o),
250
+ "onUpdate:modelValue": h[1] || (h[1] = (o) => l.value = o),
249
251
  class: "wx-media-toolbar__search",
250
252
  placeholder: e(t)("manager.search"),
251
253
  clearable: "",
252
254
  size: "sm"
253
255
  }, null, 8, ["modelValue", "placeholder"]),
254
- a.fixedType ? B("", !0) : (h(), T(e(Ve), { key: 1 }, {
255
- trigger: b(() => [
256
- g(e(D), {
256
+ a.fixedType ? D("", !0) : (b(), T(e(Ve), { key: 1 }, {
257
+ trigger: w(() => [
258
+ g(e(B), {
257
259
  icon: "filter",
258
260
  title: `${e(t)("manager.all-types")}: ${s.value}`,
259
261
  size: "sm"
260
262
  }, null, 8, ["title"])
261
263
  ]),
262
- default: b(() => [
263
- (h(!0), L(ce, null, me(x.value, (o) => (h(), T(e(Te), {
264
+ default: w(() => [
265
+ (b(!0), L(ce, null, me(x.value, (o) => (b(), T(e(Te), {
264
266
  key: String(o.value),
265
267
  active: o.value === r.value,
266
268
  onClick: ($) => r.value = o.value
267
269
  }, {
268
- default: b(() => [
270
+ default: w(() => [
269
271
  O(U(o.label), 1)
270
272
  ]),
271
273
  _: 2
@@ -274,20 +276,20 @@ const ze = /* @__PURE__ */ S({
274
276
  _: 1
275
277
  })),
276
278
  g(e(Ve), null, {
277
- trigger: b(() => [
278
- g(e(D), {
279
+ trigger: w(() => [
280
+ g(e(B), {
279
281
  icon: "arrow-down",
280
282
  title: u.value,
281
283
  size: "sm"
282
284
  }, null, 8, ["title"])
283
285
  ]),
284
- default: b(() => [
285
- (h(!0), L(ce, null, me(y.value, (o) => (h(), T(e(Te), {
286
+ default: w(() => [
287
+ (b(!0), L(ce, null, me(y.value, (o) => (b(), T(e(Te), {
286
288
  key: o.value,
287
289
  active: o.value === d.value,
288
290
  onClick: ($) => d.value = o.value
289
291
  }, {
290
- default: b(() => [
292
+ default: w(() => [
291
293
  O(U(o.label), 1)
292
294
  ]),
293
295
  _: 2
@@ -295,33 +297,33 @@ const ze = /* @__PURE__ */ S({
295
297
  ]),
296
298
  _: 1
297
299
  }),
298
- a.canUpload ? (h(), T(e(D), {
300
+ a.canUpload ? (b(), T(e(B), {
299
301
  key: 2,
300
302
  type: "upload",
301
303
  title: e(t)("manager.upload"),
302
304
  size: "sm",
303
- onClick: w[2] || (w[2] = (o) => v("upload"))
304
- }, null, 8, ["title"])) : B("", !0),
305
- a.canManage ? (h(), T(e(le), {
305
+ onClick: h[2] || (h[2] = (o) => v("upload"))
306
+ }, null, 8, ["title"])) : D("", !0),
307
+ a.canManage ? (b(), T(e(le), {
306
308
  key: 3,
307
309
  size: "sm"
308
310
  }, {
309
- default: b(() => [
310
- g(e(D), {
311
+ default: w(() => [
312
+ g(e(B), {
311
313
  icon: "folder-move",
312
314
  title: e(t)("manager.move"),
313
315
  disabled: n.selected === 0,
314
- onClick: w[3] || (w[3] = (o) => v("move"))
316
+ onClick: h[3] || (h[3] = (o) => v("move"))
315
317
  }, null, 8, ["title", "disabled"]),
316
- g(e(D), {
318
+ g(e(B), {
317
319
  type: "remove",
318
320
  title: e(t)("manager.delete"),
319
321
  disabled: n.selected === 0,
320
- onClick: w[4] || (w[4] = (o) => v("remove"))
322
+ onClick: h[4] || (h[4] = (o) => v("remove"))
321
323
  }, null, 8, ["title", "disabled"])
322
324
  ]),
323
325
  _: 1
324
- })) : B("", !0)
326
+ })) : D("", !0)
325
327
  ]));
326
328
  }
327
329
  }), bt = /* @__PURE__ */ S({
@@ -345,20 +347,20 @@ const ze = /* @__PURE__ */ S({
345
347
  ...x(s.children ?? [])
346
348
  ]);
347
349
  }
348
- return (y, s) => (h(), T(e(he), {
350
+ return (y, s) => (b(), T(e(he), {
349
351
  open: e(n),
350
352
  "onUpdate:open": s[3] || (s[3] = (u) => ve(n) ? n.value = u : null),
351
353
  title: e(d)("manager.move-to"),
352
354
  width: 420
353
355
  }, {
354
- footer: b(() => [
356
+ footer: w(() => [
355
357
  g(e(be), { size: "sm" }, {
356
- default: b(() => [
358
+ default: w(() => [
357
359
  g(e(I), {
358
360
  variant: "outline",
359
361
  onClick: s[1] || (s[1] = (u) => e(r)())
360
362
  }, {
361
- default: b(() => [
363
+ default: w(() => [
362
364
  O(U(e(d)("manager.cancel")), 1)
363
365
  ]),
364
366
  _: 1
@@ -368,7 +370,7 @@ const ze = /* @__PURE__ */ S({
368
370
  disabled: t.value === null,
369
371
  onClick: s[2] || (s[2] = (u) => e(l)(t.value))
370
372
  }, {
371
- default: b(() => [
373
+ default: w(() => [
372
374
  O(U(e(d)("manager.move")), 1)
373
375
  ]),
374
376
  _: 1
@@ -377,7 +379,7 @@ const ze = /* @__PURE__ */ S({
377
379
  _: 1
378
380
  })
379
381
  ]),
380
- default: b(() => [
382
+ default: w(() => [
381
383
  g(e(ot), {
382
384
  modelValue: t.value,
383
385
  "onUpdate:modelValue": s[0] || (s[0] = (u) => t.value = u),
@@ -404,20 +406,20 @@ const ze = /* @__PURE__ */ S({
404
406
  const y = v.value.trim();
405
407
  y !== "" && l(y);
406
408
  }
407
- return (y, s) => (h(), T(e(he), {
409
+ return (y, s) => (b(), T(e(he), {
408
410
  open: e(n),
409
411
  "onUpdate:open": s[2] || (s[2] = (u) => ve(n) ? n.value = u : null),
410
412
  title: a.title,
411
413
  width: 420
412
414
  }, {
413
- footer: b(() => [
415
+ footer: w(() => [
414
416
  g(e(be), { size: "sm" }, {
415
- default: b(() => [
417
+ default: w(() => [
416
418
  g(e(I), {
417
419
  variant: "outline",
418
420
  onClick: s[1] || (s[1] = (u) => e(r)())
419
421
  }, {
420
- default: b(() => [
422
+ default: w(() => [
421
423
  O(U(e(d)("manager.cancel")), 1)
422
424
  ]),
423
425
  _: 1
@@ -427,7 +429,7 @@ const ze = /* @__PURE__ */ S({
427
429
  disabled: v.value.trim() === "",
428
430
  onClick: x
429
431
  }, {
430
- default: b(() => [
432
+ default: w(() => [
431
433
  O(U(a.confirmText ?? e(d)("manager.save")), 1)
432
434
  ]),
433
435
  _: 1
@@ -436,7 +438,7 @@ const ze = /* @__PURE__ */ S({
436
438
  _: 1
437
439
  })
438
440
  ]),
439
- default: b(() => [
441
+ default: w(() => [
440
442
  V("div", {
441
443
  ref_key: "input",
442
444
  ref: t
@@ -489,6 +491,7 @@ const ze = /* @__PURE__ */ S({
489
491
  folders: "Folders",
490
492
  edit: "Edit",
491
493
  "copy-link": "Copy the link",
494
+ download: "Download",
492
495
  "link-copied": "Link copied",
493
496
  "status-files": "Files: :count",
494
497
  "status-selected": "selected: :count",
@@ -632,7 +635,7 @@ const kt = {
632
635
  errorText: t("editor.error")
633
636
  };
634
637
  }
635
- const s = oe("root"), u = st(s), k = z(() => u.value > 0 && u.value < 640), w = R([]), o = R(null), $ = R(null), F = R([]), K = R(""), X = A(a, "type");
638
+ const s = oe("root"), u = st(s), k = z(() => u.value > 0 && u.value < 640), h = R([]), o = R(null), $ = R(null), F = R([]), K = R(""), X = A(a, "type");
636
639
  l.accept && (X.value = l.accept), G(
637
640
  () => l.accept,
638
641
  (p) => {
@@ -656,7 +659,7 @@ const kt = {
656
659
  p || (j.value = !1);
657
660
  });
658
661
  async function c() {
659
- w.value = await v.directories(), o.value ??= w.value[0]?.id ?? null, await m(1);
662
+ h.value = await v.directories(), o.value ??= h.value[0]?.id ?? null, await m(1);
660
663
  }
661
664
  async function m(p = $.value?.meta.current_page ?? 1) {
662
665
  ee.value = !0;
@@ -745,7 +748,7 @@ const kt = {
745
748
  const Ee = ae(bt);
746
749
  async function Pe() {
747
750
  const p = await Ee({
748
- directories: w.value,
751
+ directories: h.value,
749
752
  from: o.value,
750
753
  count: F.value.length
751
754
  });
@@ -800,7 +803,7 @@ const kt = {
800
803
  }
801
804
  return null;
802
805
  };
803
- return p === null ? null : f(w.value);
806
+ return p === null ? null : f(h.value);
804
807
  }
805
808
  function Xe(p) {
806
809
  const f = p?.body;
@@ -813,36 +816,36 @@ const kt = {
813
816
  clearTimeout(_), _ = setTimeout(p, f);
814
817
  };
815
818
  }
816
- return (p, f) => (h(), L("div", {
819
+ return (p, f) => (b(), L("div", {
817
820
  ref_key: "root",
818
821
  ref: s,
819
822
  class: pe(["wx-media", { "wx-media--compact": k.value }])
820
823
  }, [
821
- k.value ? B("", !0) : (h(), L("aside", kt, [
824
+ k.value ? D("", !0) : (b(), L("aside", kt, [
822
825
  g(ze, {
823
826
  selected: o.value,
824
827
  "onUpdate:selected": f[0] || (f[0] = (_) => o.value = _),
825
- directories: w.value,
828
+ directories: h.value,
826
829
  onMove: Me
827
830
  }, null, 8, ["selected", "directories"]),
828
- Q.value ? (h(), T(e(le), {
831
+ Q.value ? (b(), T(e(le), {
829
832
  key: 0,
830
833
  size: "sm",
831
834
  align: "start"
832
835
  }, {
833
- default: b(() => [
834
- g(e(D), {
836
+ default: w(() => [
837
+ g(e(B), {
835
838
  type: "add",
836
839
  title: e(t)("manager.new-folder"),
837
840
  onClick: $e
838
841
  }, null, 8, ["title"]),
839
- g(e(D), {
842
+ g(e(B), {
840
843
  type: "edit",
841
844
  title: e(t)("manager.rename"),
842
845
  disabled: !E.value || E.value.is_root,
843
846
  onClick: _e
844
847
  }, null, 8, ["title", "disabled"]),
845
- g(e(D), {
848
+ g(e(B), {
846
849
  type: "remove",
847
850
  title: e(t)("manager.delete"),
848
851
  disabled: !E.value || E.value.is_root,
@@ -850,7 +853,7 @@ const kt = {
850
853
  }, null, 8, ["title", "disabled"])
851
854
  ]),
852
855
  _: 1
853
- })) : B("", !0)
856
+ })) : D("", !0)
854
857
  ])),
855
858
  V("section", $t, [
856
859
  g(ht, {
@@ -893,10 +896,10 @@ const kt = {
893
896
  }, null, 8, ["selected", "files", "api", "query", "single"]),
894
897
  V("footer", Ct, [
895
898
  V("span", null, U(e(t)("manager.status-files", { count: $.value?.stats.files ?? 0 })), 1),
896
- F.value.length > 0 ? (h(), L("span", Mt, U(e(t)("manager.status-selected", { count: F.value.length })), 1)) : B("", !0),
897
- V("span", null, U(e(t)("manager.status-size", { size: e(De)($.value?.stats.size ?? 0) })), 1)
899
+ F.value.length > 0 ? (b(), L("span", Mt, U(e(t)("manager.status-selected", { count: F.value.length })), 1)) : D("", !0),
900
+ V("span", null, U(e(t)("manager.status-size", { size: e(Be)($.value?.stats.size ?? 0) })), 1)
898
901
  ]),
899
- $.value && $.value.meta.last_page > 1 ? (h(), T(e(rt), {
902
+ $.value && $.value.meta.last_page > 1 ? (b(), T(e(rt), {
900
903
  key: 0,
901
904
  page: $.value.meta.current_page,
902
905
  "per-page": $.value.meta.per_page,
@@ -905,7 +908,7 @@ const kt = {
905
908
  disabled: ee.value,
906
909
  size: "sm",
907
910
  onChange: f[6] || (f[6] = ({ page: _ }) => m(_))
908
- }, null, 8, ["page", "per-page", "total", "last-page", "disabled"])) : B("", !0)
911
+ }, null, 8, ["page", "per-page", "total", "last-page", "disabled"])) : D("", !0)
909
912
  ]),
910
913
  g(e(dt), {
911
914
  open: j.value,
@@ -914,7 +917,7 @@ const kt = {
914
917
  title: e(t)("manager.folders"),
915
918
  size: 280
916
919
  }, {
917
- default: b(() => [
920
+ default: w(() => [
918
921
  V("div", Vt, [
919
922
  g(ze, {
920
923
  selected: o.value,
@@ -922,27 +925,27 @@ const kt = {
922
925
  f[7] || (f[7] = (_) => o.value = _),
923
926
  f[8] || (f[8] = (_) => j.value = !1)
924
927
  ],
925
- directories: w.value,
928
+ directories: h.value,
926
929
  onMove: Me
927
930
  }, null, 8, ["selected", "directories"]),
928
- Q.value ? (h(), T(e(le), {
931
+ Q.value ? (b(), T(e(le), {
929
932
  key: 0,
930
933
  size: "sm",
931
934
  align: "start"
932
935
  }, {
933
- default: b(() => [
934
- g(e(D), {
936
+ default: w(() => [
937
+ g(e(B), {
935
938
  type: "add",
936
939
  title: e(t)("manager.new-folder"),
937
940
  onClick: $e
938
941
  }, null, 8, ["title"]),
939
- g(e(D), {
942
+ g(e(B), {
940
943
  type: "edit",
941
944
  title: e(t)("manager.rename"),
942
945
  disabled: !E.value || E.value.is_root,
943
946
  onClick: _e
944
947
  }, null, 8, ["title", "disabled"]),
945
- g(e(D), {
948
+ g(e(B), {
946
949
  type: "remove",
947
950
  title: e(t)("manager.delete"),
948
951
  disabled: !E.value || E.value.is_root,
@@ -950,7 +953,7 @@ const kt = {
950
953
  }, null, 8, ["title", "disabled"])
951
954
  ]),
952
955
  _: 1
953
- })) : B("", !0)
956
+ })) : D("", !0)
954
957
  ])
955
958
  ]),
956
959
  _: 1
@@ -971,13 +974,13 @@ const kt = {
971
974
  },
972
975
  setup(a) {
973
976
  const { open: i, resolve: n, dismiss: l } = ye(), r = H("webx-media"), d = R([]);
974
- return (v, t) => (h(), T(e(he), {
977
+ return (v, t) => (b(), T(e(he), {
975
978
  open: e(i),
976
979
  "onUpdate:open": t[4] || (t[4] = (x) => ve(i) ? i.value = x : null),
977
980
  title: a.title ?? e(r)("module.title"),
978
981
  width: 960
979
982
  }, We({
980
- default: b(() => [
983
+ default: w(() => [
981
984
  V("div", Tt, [
982
985
  g(Se, {
983
986
  picking: !a.manage,
@@ -993,15 +996,15 @@ const kt = {
993
996
  }, [
994
997
  a.multiple && !a.manage ? {
995
998
  name: "footer",
996
- fn: b(() => [
999
+ fn: w(() => [
997
1000
  g(e(be), { size: "sm" }, {
998
- default: b(() => [
999
- a.max !== null && a.max > 0 ? (h(), L("span", zt, U(e(r)("manager.chosen", { count: d.value.length, max: a.max })), 1)) : B("", !0),
1001
+ default: w(() => [
1002
+ a.max !== null && a.max > 0 ? (b(), L("span", zt, U(e(r)("manager.chosen", { count: d.value.length, max: a.max })), 1)) : D("", !0),
1000
1003
  g(e(I), {
1001
1004
  variant: "outline",
1002
1005
  onClick: t[2] || (t[2] = (x) => e(l)())
1003
1006
  }, {
1004
- default: b(() => [
1007
+ default: w(() => [
1005
1008
  O(U(e(r)("manager.cancel")), 1)
1006
1009
  ]),
1007
1010
  _: 1
@@ -1012,7 +1015,7 @@ const kt = {
1012
1015
  disabled: d.value.length === 0,
1013
1016
  onClick: t[3] || (t[3] = (x) => e(n)(d.value))
1014
1017
  }, {
1015
- default: b(() => [
1018
+ default: w(() => [
1016
1019
  O(U(e(r)("manager.pick", { count: d.value.length })), 1)
1017
1020
  ]),
1018
1021
  _: 1
@@ -1036,7 +1039,7 @@ const kt = {
1036
1039
  }, Rt = {
1037
1040
  key: 0,
1038
1041
  class: "wx-media-list__missing"
1039
- }, Bt = { key: 1 }, Dt = {
1042
+ }, Dt = { key: 1 }, Bt = {
1040
1043
  key: 0,
1041
1044
  class: "wx-media-list__tools"
1042
1045
  }, St = { class: "wx-media-list__captions" }, Et = { class: "wx-media-list__caption" }, Pt = { class: "wx-media-list__caption" }, Ot = { class: "wx-media-list__captions-footer" }, At = { class: "wx-media-list__footer" }, Nt = {
@@ -1090,7 +1093,7 @@ const kt = {
1090
1093
  },
1091
1094
  { immediate: !0 }
1092
1095
  );
1093
- function w(c) {
1096
+ function h(c) {
1094
1097
  s.value = { ...s.value, ...Object.fromEntries(c.map((m) => [m.path, m])) };
1095
1098
  }
1096
1099
  function o(c) {
@@ -1109,7 +1112,7 @@ const kt = {
1109
1112
  function X(c) {
1110
1113
  const m = o(c);
1111
1114
  if (!m) return "";
1112
- const M = De(m.size);
1115
+ const M = Be(m.size);
1113
1116
  return m.width && m.height ? `${m.width}×${m.height} · ${M}` : M;
1114
1117
  }
1115
1118
  const N = R(null);
@@ -1129,7 +1132,7 @@ const kt = {
1129
1132
  if (i.disabled) return;
1130
1133
  const c = x.value === null ? null : x.value - t.value.length, m = await Ft({ accept: i.accept, max: c });
1131
1134
  if (!m || m.length === 0) return;
1132
- w(m);
1135
+ h(m);
1133
1136
  const M = new Set(t.value.map((W) => W.path)), C = m.filter((W) => !M.has(W.path)).map((W) => ({ path: W.path }));
1134
1137
  t.value = i.single ? C.slice(0, 1) : [...t.value, ...C];
1135
1138
  }
@@ -1151,11 +1154,11 @@ const kt = {
1151
1154
  const c = t.value.length;
1152
1155
  return i.min && c < i.min ? l("field.at-least", { count: i.min }) : x.value === null ? "" : l("field.count", { count: c, max: x.value });
1153
1156
  });
1154
- return (c, m) => (h(), L("div", {
1157
+ return (c, m) => (b(), L("div", {
1155
1158
  class: pe(["wx-media-list", [`wx-media-list--${a.layout}`, { "is-disabled": a.disabled }]]),
1156
1159
  style: fe(E.value)
1157
1160
  }, [
1158
- a.label ? (h(), L("span", Lt, U(a.label), 1)) : B("", !0),
1161
+ a.label ? (b(), L("span", Lt, U(a.label), 1)) : D("", !0),
1159
1162
  g(e(ct), {
1160
1163
  modelValue: t.value,
1161
1164
  "onUpdate:modelValue": m[1] || (m[1] = (M) => t.value = M),
@@ -1167,7 +1170,7 @@ const kt = {
1167
1170
  "drag-label": e(l)("field.reorder"),
1168
1171
  "empty-text": e(l)("field.empty")
1169
1172
  }, {
1170
- default: b(({ item: M, index: C }) => [
1173
+ default: w(({ item: M, index: C }) => [
1171
1174
  V("div", {
1172
1175
  class: pe(["wx-media-list__cell", { "is-broken": $(M), "is-busy": N.value === C }])
1173
1176
  }, [
@@ -1177,15 +1180,15 @@ const kt = {
1177
1180
  type: o(M)?.mime,
1178
1181
  size: a.layout === "rows" ? "sm" : "md"
1179
1182
  }, {
1180
- meta: b(() => [
1181
- $(M) ? (h(), L("span", Rt, U(e(l)("field.missing")), 1)) : (h(), L("span", Bt, U(X(M)), 1))
1183
+ meta: w(() => [
1184
+ $(M) ? (b(), L("span", Rt, U(e(l)("field.missing")), 1)) : (b(), L("span", Dt, U(X(M)), 1))
1182
1185
  ]),
1183
1186
  _: 2
1184
1187
  }, 1032, ["name", "thumbnail", "type", "size"]),
1185
- a.disabled ? B("", !0) : (h(), L("div", Dt, [
1188
+ a.disabled ? D("", !0) : (b(), L("div", Bt, [
1186
1189
  g(e(le), { size: "sm" }, {
1187
- default: b(() => [
1188
- a.captions ? (h(), T(e(Re), {
1190
+ default: w(() => [
1191
+ a.captions ? (b(), T(e(Re), {
1189
1192
  key: 0,
1190
1193
  open: N.value === C,
1191
1194
  title: e(l)("field.captions"),
@@ -1194,13 +1197,13 @@ const kt = {
1194
1197
  teleport: "",
1195
1198
  "onUpdate:open": (W) => N.value = W ? C : null
1196
1199
  }, {
1197
- trigger: b(() => [
1198
- g(e(D), {
1200
+ trigger: w(() => [
1201
+ g(e(B), {
1199
1202
  type: "edit",
1200
1203
  title: e(l)("field.captions")
1201
1204
  }, null, 8, ["title"])
1202
1205
  ]),
1203
- default: b(() => [
1206
+ default: w(() => [
1204
1207
  V("div", St, [
1205
1208
  V("div", Et, [
1206
1209
  m[2] || (m[2] = V("span", { class: "wx-media-list__caption-label" }, "alt", -1)),
@@ -1226,7 +1229,7 @@ const kt = {
1226
1229
  type: "primary",
1227
1230
  onClick: m[0] || (m[0] = (W) => N.value = null)
1228
1231
  }, {
1229
- default: b(() => [
1232
+ default: w(() => [
1230
1233
  O(U(e(l)("manager.save")), 1)
1231
1234
  ]),
1232
1235
  _: 1
@@ -1235,14 +1238,14 @@ const kt = {
1235
1238
  ])
1236
1239
  ]),
1237
1240
  _: 2
1238
- }, 1032, ["open", "title", "onUpdate:open"])) : B("", !0),
1239
- $(M) ? B("", !0) : (h(), T(e(D), {
1241
+ }, 1032, ["open", "title", "onUpdate:open"])) : D("", !0),
1242
+ $(M) ? D("", !0) : (b(), T(e(B), {
1240
1243
  key: 1,
1241
1244
  type: "goto",
1242
1245
  title: e(l)("field.open"),
1243
1246
  onClick: (W) => de(M)
1244
1247
  }, null, 8, ["title", "onClick"])),
1245
- g(e(Be), {
1248
+ g(e(De), {
1246
1249
  title: e(l)("field.remove-title"),
1247
1250
  description: e(l)("field.remove-text"),
1248
1251
  "confirm-text": e(l)("field.remove-confirm"),
@@ -1251,8 +1254,8 @@ const kt = {
1251
1254
  side: "top",
1252
1255
  onConfirm: (W) => Q(C)
1253
1256
  }, {
1254
- trigger: b(() => [
1255
- g(e(D), {
1257
+ trigger: w(() => [
1258
+ g(e(B), {
1256
1259
  type: "remove",
1257
1260
  title: e(l)("field.remove-confirm")
1258
1261
  }, null, 8, ["title"])
@@ -1274,12 +1277,12 @@ const kt = {
1274
1277
  disabled: a.disabled || y.value,
1275
1278
  onClick: ie
1276
1279
  }, {
1277
- default: b(() => [
1280
+ default: w(() => [
1278
1281
  O(U(e(l)("field.add")), 1)
1279
1282
  ]),
1280
1283
  _: 1
1281
1284
  }, 8, ["disabled"]),
1282
- ne.value ? (h(), L("span", Nt, U(ne.value), 1)) : B("", !0)
1285
+ ne.value ? (b(), L("span", Nt, U(ne.value), 1)) : D("", !0)
1283
1286
  ])
1284
1287
  ], 6));
1285
1288
  }
@@ -1299,7 +1302,7 @@ const kt = {
1299
1302
  i.value = l[0] ?? null;
1300
1303
  }
1301
1304
  });
1302
- return (l, r) => (h(), T(ke, ge(l.$attrs, {
1305
+ return (l, r) => (b(), T(ke, ge(l.$attrs, {
1303
1306
  modelValue: n.value,
1304
1307
  "onUpdate:modelValue": r[0] || (r[0] = (d) => n.value = d),
1305
1308
  layout: "rows",
@@ -1317,7 +1320,7 @@ const kt = {
1317
1320
  emits: ["update:modelValue"],
1318
1321
  setup(a) {
1319
1322
  const i = A(a, "modelValue");
1320
- return (n, l) => (h(), T(ke, ge(n.$attrs, {
1323
+ return (n, l) => (b(), T(ke, ge(n.$attrs, {
1321
1324
  modelValue: i.value,
1322
1325
  "onUpdate:modelValue": l[0] || (l[0] = (r) => i.value = r),
1323
1326
  layout: "rows"
@@ -1334,7 +1337,7 @@ const kt = {
1334
1337
  emits: ["update:modelValue"],
1335
1338
  setup(a) {
1336
1339
  const i = A(a, "modelValue");
1337
- return (n, l) => (h(), T(ke, ge(n.$attrs, {
1340
+ return (n, l) => (b(), T(ke, ge(n.$attrs, {
1338
1341
  modelValue: i.value,
1339
1342
  "onUpdate:modelValue": l[0] || (l[0] = (r) => i.value = r),
1340
1343
  layout: "grid",
@@ -1396,14 +1399,14 @@ const kt = {
1396
1399
  async function k() {
1397
1400
  if (i.disabled) return;
1398
1401
  const o = await Ut({ accept: i.accept });
1399
- o && (n.value = { ...n.value, path: o.path, url: o.url });
1402
+ o && (t.value = { ...t.value, [o.path]: o.url }, n.value = { ...n.value, path: o.path, url: o.url });
1400
1403
  }
1401
- function w() {
1404
+ function h() {
1402
1405
  n.value = null, v.value = !1;
1403
1406
  }
1404
- return (o, $) => (h(), L("div", Xt, [
1405
- a.label ? (h(), L("span", Kt, U(a.label), 1)) : B("", !0),
1406
- n.value ? (h(), L("div", {
1407
+ return (o, $) => (b(), L("div", Xt, [
1408
+ a.label ? (b(), L("span", Kt, U(a.label), 1)) : D("", !0),
1409
+ n.value ? (b(), L("div", {
1407
1410
  key: 2,
1408
1411
  class: "wx-media-field__frame",
1409
1412
  style: fe(y.value)
@@ -1415,18 +1418,18 @@ const kt = {
1415
1418
  title: e(l)("field.replace"),
1416
1419
  onClick: k
1417
1420
  }, [
1418
- x.value ? (h(), T(e(mt), {
1421
+ x.value ? (b(), T(e(mt), {
1419
1422
  key: 0,
1420
1423
  src: x.value,
1421
1424
  fit: "contain",
1422
1425
  width: "100%",
1423
1426
  height: "100%"
1424
- }, null, 8, ["src"])) : (h(), L("span", Yt, U(e(l)("field.no-preview")), 1))
1427
+ }, null, 8, ["src"])) : (b(), L("span", Yt, U(e(l)("field.no-preview")), 1))
1425
1428
  ], 8, Gt),
1426
- a.disabled ? B("", !0) : (h(), L("div", Jt, [
1429
+ a.disabled ? D("", !0) : (b(), L("div", Jt, [
1427
1430
  g(e(le), { size: "sm" }, {
1428
- default: b(() => [
1429
- a.captions ? (h(), T(e(Re), {
1431
+ default: w(() => [
1432
+ a.captions ? (b(), T(e(Re), {
1430
1433
  key: 0,
1431
1434
  open: v.value,
1432
1435
  "onUpdate:open": $[3] || ($[3] = (F) => v.value = F),
@@ -1435,13 +1438,13 @@ const kt = {
1435
1438
  side: "top",
1436
1439
  teleport: ""
1437
1440
  }, {
1438
- trigger: b(() => [
1439
- g(e(D), {
1441
+ trigger: w(() => [
1442
+ g(e(B), {
1440
1443
  type: "edit",
1441
1444
  title: e(l)("field.edit")
1442
1445
  }, null, 8, ["title"])
1443
1446
  ]),
1444
- default: b(() => [
1447
+ default: w(() => [
1445
1448
  V("div", Qt, [
1446
1449
  V("div", Zt, [
1447
1450
  $[4] || ($[4] = V("label", {
@@ -1475,7 +1478,7 @@ const kt = {
1475
1478
  type: "primary",
1476
1479
  onClick: $[2] || ($[2] = (F) => v.value = !1)
1477
1480
  }, {
1478
- default: b(() => [
1481
+ default: w(() => [
1479
1482
  O(U(e(l)("manager.save")), 1)
1480
1483
  ]),
1481
1484
  _: 1
@@ -1484,18 +1487,18 @@ const kt = {
1484
1487
  ])
1485
1488
  ]),
1486
1489
  _: 1
1487
- }, 8, ["open", "title"])) : B("", !0),
1488
- g(e(Be), {
1490
+ }, 8, ["open", "title"])) : D("", !0),
1491
+ g(e(De), {
1489
1492
  title: e(l)("field.clear-title"),
1490
1493
  description: e(l)("field.clear-text"),
1491
1494
  "confirm-text": e(l)("field.clear-confirm"),
1492
1495
  "cancel-text": e(l)("manager.cancel"),
1493
1496
  "confirm-type": "danger",
1494
1497
  side: "top",
1495
- onConfirm: w
1498
+ onConfirm: h
1496
1499
  }, {
1497
- trigger: b(() => [
1498
- g(e(D), {
1500
+ trigger: w(() => [
1501
+ g(e(B), {
1499
1502
  type: "remove",
1500
1503
  title: e(l)("field.clear-confirm")
1501
1504
  }, null, 8, ["title"])
@@ -1506,7 +1509,7 @@ const kt = {
1506
1509
  _: 1
1507
1510
  })
1508
1511
  ]))
1509
- ], 4)) : (h(), L("div", {
1512
+ ], 4)) : (b(), L("div", {
1510
1513
  key: 1,
1511
1514
  class: "wx-media-field__frame is-empty",
1512
1515
  style: fe(y.value)
@@ -1534,7 +1537,7 @@ const kt = {
1534
1537
  label: n(`manager.${y}`)
1535
1538
  }))
1536
1539
  ]);
1537
- return (y, s) => (h(), T(e(lt), {
1540
+ return (y, s) => (b(), T(e(lt), {
1538
1541
  view: r.value,
1539
1542
  "onUpdate:view": s[1] || (s[1] = (u) => r.value = u),
1540
1543
  title: t.value,
@@ -1542,12 +1545,12 @@ const kt = {
1542
1545
  card: !1,
1543
1546
  fill: ""
1544
1547
  }, We({
1545
- default: b(() => [
1548
+ default: w(() => [
1546
1549
  g(e(pt), {
1547
1550
  class: "wx-media-page",
1548
1551
  padding: "md"
1549
1552
  }, {
1550
- default: b(() => [
1553
+ default: w(() => [
1551
1554
  g(Se, {
1552
1555
  ref_key: "manager",
1553
1556
  ref: l,
@@ -1562,13 +1565,13 @@ const kt = {
1562
1565
  }, [
1563
1566
  v.value ? {
1564
1567
  name: "actions",
1565
- fn: b(() => [
1568
+ fn: w(() => [
1566
1569
  g(e(I), {
1567
1570
  type: "primary",
1568
1571
  icon: "upload",
1569
1572
  onClick: s[0] || (s[0] = (u) => l.value?.upload())
1570
1573
  }, {
1571
- default: b(() => [
1574
+ default: w(() => [
1572
1575
  O(U(e(n)("manager.upload")), 1)
1573
1576
  ]),
1574
1577
  _: 1