@opentiny/tiny-robot 0.3.0-alpha.12 → 0.3.0-alpha.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { defineComponent as $, useSlots as H, computed as i, ref as f, watch as N, nextTick as W, createElementBlock as _, openBlock as o, createBlock as v, createCommentVNode as R, Fragment as G, renderList as I, unref as h, withCtx as S, createElementVNode as w, resolveDynamicComponent as x, renderSlot as z, createVNode as E, Transition as j, withDirectives as q, normalizeClass as J, withModifiers as K, toDisplayString as Q, vShow as U } from "vue";
2
- import { z as Y } from "../tiny-robot-svgs.js";
1
+ import { defineComponent as $, useSlots as H, computed as i, ref as f, watch as T, nextTick as W, createElementBlock as _, openBlock as o, createBlock as v, createCommentVNode as N, Fragment as G, renderList as I, unref as h, withCtx as S, createElementVNode as w, resolveDynamicComponent as x, renderSlot as L, createVNode as E, Transition as j, withDirectives as q, normalizeClass as J, withModifiers as K, toDisplayString as Q, vShow as U } from "vue";
2
+ import { R as Y } from "../tiny-robot-svgs.js";
3
3
  import { T as M } from "../index2.js";
4
4
  import { o as Z, c as ee } from "../index3.js";
5
5
  import te from "../icon-button/index.js";
@@ -13,14 +13,14 @@ const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae
13
13
  },
14
14
  emits: ["item-click"],
15
15
  setup(r, { emit: k }) {
16
- const l = r, L = H(), F = k, p = i(() => {
16
+ const l = r, F = H(), O = k, p = i(() => {
17
17
  var a, t;
18
- const e = L.default();
18
+ const e = F.default();
19
19
  return Array.isArray(e) ? e.length === 1 && ((a = e[0].type) == null ? void 0 : a.toString()) === "Symbol(v-fgt)" ? e[0].children : e : ((t = e.type) == null ? void 0 : t.toString()) === "Symbol(v-fgt)" ? e.children : [e];
20
20
  }), y = i(() => {
21
21
  const e = l.maxNum ?? Number.MAX_SAFE_INTEGER;
22
22
  return e > 0 ? e : Number.MAX_SAFE_INTEGER;
23
- }), b = i(() => p.value.length > y.value), O = i(() => b.value ? p.value.slice(0, y.value) : p.value), V = i(() => b.value ? p.value.slice(y.value) : []), m = f(null), d = f(null), n = f(!1), P = () => {
23
+ }), b = i(() => p.value.length > y.value), V = i(() => b.value ? p.value.slice(0, y.value) : p.value), z = i(() => b.value ? p.value.slice(y.value) : []), m = f(null), d = f(null), n = f(!1), P = () => {
24
24
  n.value = !n.value;
25
25
  };
26
26
  Z(
@@ -31,21 +31,21 @@ const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae
31
31
  { ignore: [m] }
32
32
  );
33
33
  const A = (e) => {
34
- F("item-click", e), n.value = !1;
35
- }, B = f("placement-bottom"), { height: D } = ee(), T = () => {
34
+ O("item-click", e), n.value = !1;
35
+ }, B = f("placement-bottom"), { height: D } = ee(), R = () => {
36
36
  if (!d.value || !m.value)
37
37
  return "placement-bottom";
38
38
  const e = d.value.getBoundingClientRect(), a = m.value.getBoundingClientRect();
39
39
  B.value = a.bottom + e.height + 16 > D.value ? "placement-top" : "placement-bottom";
40
40
  };
41
- return N(n, (e) => {
41
+ return T(n, (e) => {
42
42
  e && W(() => {
43
- T();
43
+ R();
44
44
  });
45
- }), N(D, () => {
46
- n.value && T();
45
+ }), T(D, () => {
46
+ n.value && R();
47
47
  }), (e, a) => (o(), _("div", ne, [
48
- (o(!0), _(G, null, I(O.value, (t, C) => {
48
+ (o(!0), _(G, null, I(V.value, (t, C) => {
49
49
  var c;
50
50
  return o(), v(h(M), {
51
51
  key: C,
@@ -84,7 +84,7 @@ const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae
84
84
  class: "tr-action-group__btn-wrapper",
85
85
  onClick: P
86
86
  }, [
87
- z(e.$slots, "moreBtn", {}, () => [
87
+ L(e.$slots, "moreBtn", {}, () => [
88
88
  E(h(te), { icon: h(Y) }, null, 8, ["icon"])
89
89
  ], !0),
90
90
  E(j, { name: "tr-action-group-dropdown" }, {
@@ -94,7 +94,7 @@ const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae
94
94
  ref: d,
95
95
  class: J(["tr-action-group__dropdown", B.value])
96
96
  }, [
97
- (o(!0), _(G, null, I(V.value, (t, C) => {
97
+ (o(!0), _(G, null, I(z.value, (t, C) => {
98
98
  var c;
99
99
  return o(), _("li", {
100
100
  class: "tr-action-group__dropdown-item",
@@ -104,7 +104,7 @@ const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae
104
104
  return A((s = t.props) == null ? void 0 : s.name);
105
105
  }, ["stop"])
106
106
  }, [
107
- l.dropDownShowLabelOnly ? R("", !0) : (o(), v(x(t), { key: 0 })),
107
+ l.dropDownShowLabelOnly ? N("", !0) : (o(), v(x(t), { key: 0 })),
108
108
  w("span", ae, Q((c = t.props) == null ? void 0 : c.label), 1)
109
109
  ], 8, le);
110
110
  }), 128))
@@ -117,7 +117,7 @@ const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae
117
117
  ], 512)
118
118
  ]),
119
119
  _: 3
120
- }, 8, ["disabled"])) : R("", !0)
120
+ }, 8, ["disabled"])) : N("", !0)
121
121
  ]));
122
122
  }
123
123
  }), g = /* @__PURE__ */ oe(ce, [["__scopeId", "data-v-f8531261"]]), u = /* @__PURE__ */ $({
@@ -127,7 +127,7 @@ const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae
127
127
  label: {}
128
128
  },
129
129
  setup(r) {
130
- return (k, l) => z(k.$slots, "default");
130
+ return (k, l) => L(k.$slots, "default");
131
131
  }
132
132
  });
133
133
  g.name = "TrActionGroup";
@@ -1,12 +1,12 @@
1
- import { computed as I, ref as P, onUnmounted as Y, defineComponent as B, mergeModels as j, useModel as Z, createElementBlock as d, openBlock as o, withModifiers as x, createElementVNode as p, createVNode as F, unref as f, Fragment as z, renderList as D, normalizeClass as R, h as ee, createCommentVNode as C, createBlock as L, toDisplayString as U, withCtx as te, resolveDynamicComponent as V, watch as se } from "vue";
2
- import { o as ae, r as O, s as q, d as J, c as K, f as G, i as H, U as re, J as ne, I as oe, A as ie, C as E, u as W } from "../tiny-robot-svgs.js";
1
+ import { computed as I, ref as U, onUnmounted as J, defineComponent as z, mergeModels as j, useModel as X, createElementBlock as d, openBlock as o, withModifiers as M, createElementVNode as p, createVNode as F, unref as f, Fragment as D, renderList as A, normalizeClass as L, h as ee, createCommentVNode as C, createBlock as R, toDisplayString as x, withCtx as te, resolveDynamicComponent as V, watch as se } from "vue";
2
+ import { M as ae, H as O, j as q, Z as H, Q, T as Y, N as Z, x as re, h as ne, L as oe, Y as ie, E, W } from "../tiny-robot-svgs.js";
3
3
  import { _ as S } from "../_plugin-vue_export-helper.js";
4
4
  import { T as le } from "../index2.js";
5
- const A = {
6
- image: H,
7
- pdf: G,
8
- word: K,
9
- excel: J,
5
+ const B = {
6
+ image: Z,
7
+ pdf: Y,
8
+ word: Q,
9
+ excel: H,
10
10
  ppt: q,
11
11
  folder: O,
12
12
  other: ae
@@ -20,12 +20,12 @@ const A = {
20
20
  const r = ((u = t.split(".").pop()) == null ? void 0 : u.toLowerCase()) || "";
21
21
  return ["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg"].includes(r);
22
22
  },
23
- icon: H
23
+ icon: Z
24
24
  },
25
25
  {
26
26
  type: "pdf",
27
27
  matcher: (t) => typeof t != "string" ? t.type === "application/pdf" : t.toLowerCase().endsWith(".pdf"),
28
- icon: G
28
+ icon: Y
29
29
  },
30
30
  {
31
31
  type: "word",
@@ -36,7 +36,7 @@ const A = {
36
36
  const r = ((s = t.split(".").pop()) == null ? void 0 : s.toLowerCase()) || "";
37
37
  return ["doc", "docx"].includes(r);
38
38
  },
39
- icon: K
39
+ icon: Q
40
40
  },
41
41
  {
42
42
  type: "excel",
@@ -47,7 +47,7 @@ const A = {
47
47
  const r = ((s = t.split(".").pop()) == null ? void 0 : s.toLowerCase()) || "";
48
48
  return ["xls", "xlsx"].includes(r);
49
49
  },
50
- icon: J
50
+ icon: H
51
51
  },
52
52
  {
53
53
  type: "ppt",
@@ -66,7 +66,7 @@ const A = {
66
66
  icon: O
67
67
  }
68
68
  ];
69
- function Q(t = {}) {
69
+ function K(t = {}) {
70
70
  const { customIcons: r, fileMatchers: s } = t, u = () => {
71
71
  let e = [];
72
72
  return s ? e = s.concat(N) : e = N, e;
@@ -74,7 +74,7 @@ function Q(t = {}) {
74
74
  if (r != null && r[e])
75
75
  return r[e];
76
76
  const a = u().find((_) => _.type === e);
77
- return a != null && a.icon ? a.icon : A[e] ? A[e] : A.other;
77
+ return a != null && a.icon ? a.icon : B[e] ? B[e] : B.other;
78
78
  }), v = (e) => {
79
79
  const n = u();
80
80
  for (const a of n)
@@ -92,11 +92,11 @@ function Q(t = {}) {
92
92
  status: e.status || "success",
93
93
  message: e.message || ""
94
94
  }), c = (e) => {
95
- const n = h(e), a = e.url, _ = e.size, M = a.split("/").pop() || "";
95
+ const n = h(e), a = e.url, _ = e.size, P = a.split("/").pop() || "";
96
96
  return {
97
97
  ...n,
98
- name: n.name || M,
99
- fileType: v(M),
98
+ name: n.name || P,
99
+ fileType: v(P),
100
100
  size: _,
101
101
  url: a
102
102
  };
@@ -128,7 +128,7 @@ const ce = (t, r) => {
128
128
  }
129
129
  };
130
130
  function de(t, r) {
131
- const s = P([]), u = I(() => t.file.fileType === "image"), i = (l) => {
131
+ const s = U([]), u = I(() => t.file.fileType === "image"), i = (l) => {
132
132
  const h = URL.createObjectURL(l);
133
133
  return s.value.push(h), h;
134
134
  }, v = (l) => {
@@ -145,7 +145,7 @@ function de(t, r) {
145
145
  }, w = (l, h) => {
146
146
  h.stopPropagation(), l.handler && l.handler(t.file), l.type === "preview" ? v(h) : l.type === "download" ? y(h) : r("action", { action: l, file: t.file });
147
147
  };
148
- return Y(() => {
148
+ return J(() => {
149
149
  s.value.forEach((l) => {
150
150
  URL.revokeObjectURL(l);
151
151
  }), s.value = [];
@@ -158,7 +158,7 @@ function de(t, r) {
158
158
  handleCustomAction: w
159
159
  };
160
160
  }
161
- const ue = { class: "tr-image-preview__main" }, fe = ["disabled"], pe = { class: "tr-image-preview__content" }, me = ["src", "alt"], _e = ["disabled"], ve = { class: "tr-image-preview__footer" }, he = { class: "tr-image-preview__thumbnails" }, ye = ["onClick"], ge = ["src", "alt"], we = /* @__PURE__ */ B({
161
+ const ue = { class: "tr-image-preview__main" }, fe = ["disabled"], pe = { class: "tr-image-preview__content" }, me = ["src", "alt"], _e = ["disabled"], ve = { class: "tr-image-preview__footer" }, he = { class: "tr-image-preview__thumbnails" }, ye = ["onClick"], ge = ["src", "alt"], we = /* @__PURE__ */ z({
162
162
  __name: "ImagePreview",
163
163
  props: /* @__PURE__ */ j({
164
164
  images: {}
@@ -168,7 +168,7 @@ const ue = { class: "tr-image-preview__main" }, fe = ["disabled"], pe = { class:
168
168
  }),
169
169
  emits: /* @__PURE__ */ j(["close"], ["update:currentIndex"]),
170
170
  setup(t, { emit: r }) {
171
- const s = t, u = r, i = Z(t, "currentIndex"), v = I(() => s.images[i.value]), y = () => {
171
+ const s = t, u = r, i = X(t, "currentIndex"), v = I(() => s.images[i.value]), y = () => {
172
172
  i.value > 0 && i.value--;
173
173
  }, b = () => {
174
174
  i.value < s.images.length - 1 && i.value++;
@@ -182,7 +182,7 @@ const ue = { class: "tr-image-preview__main" }, fe = ["disabled"], pe = { class:
182
182
  var c, m;
183
183
  return o(), d("div", {
184
184
  class: "tr-image-preview",
185
- onClick: x(w, ["self"])
185
+ onClick: M(w, ["self"])
186
186
  }, [
187
187
  p("button", {
188
188
  class: "tr-image-preview__close",
@@ -193,7 +193,7 @@ const ue = { class: "tr-image-preview__main" }, fe = ["disabled"], pe = { class:
193
193
  p("div", ue, [
194
194
  p("button", {
195
195
  class: "tr-image-preview__nav tr-image-preview__nav--left",
196
- onClick: x(y, ["stop"]),
196
+ onClick: M(y, ["stop"]),
197
197
  disabled: i.value === 0
198
198
  }, [
199
199
  F(f(ne))
@@ -207,7 +207,7 @@ const ue = { class: "tr-image-preview__main" }, fe = ["disabled"], pe = { class:
207
207
  ]),
208
208
  p("button", {
209
209
  class: "tr-image-preview__nav tr-image-preview__nav--right",
210
- onClick: x(b, ["stop"]),
210
+ onClick: M(b, ["stop"]),
211
211
  disabled: i.value === l.images.length - 1
212
212
  }, [
213
213
  F(f(oe))
@@ -215,9 +215,9 @@ const ue = { class: "tr-image-preview__main" }, fe = ["disabled"], pe = { class:
215
215
  ]),
216
216
  p("div", ve, [
217
217
  p("div", he, [
218
- (o(!0), d(z, null, D(l.images, (e, n) => (o(), d("div", {
218
+ (o(!0), d(D, null, A(l.images, (e, n) => (o(), d("div", {
219
219
  key: e.id,
220
- class: R(["tr-image-preview__thumbnail", { "tr-image-preview__thumbnail--active": n === i.value }]),
220
+ class: L(["tr-image-preview__thumbnail", { "tr-image-preview__thumbnail--active": n === i.value }]),
221
221
  onClick: (a) => k(n)
222
222
  }, [
223
223
  p("img", {
@@ -232,7 +232,7 @@ const ue = { class: "tr-image-preview__main" }, fe = ["disabled"], pe = { class:
232
232
  }
233
233
  }), be = /* @__PURE__ */ S(we, [["__scopeId", "data-v-027af77c"]]);
234
234
  function ke(t, r, s = {}) {
235
- const u = P(!1), i = P([]), v = P(0), y = (c) => {
235
+ const u = U(!1), i = U([]), v = U(0), y = (c) => {
236
236
  v.value = c;
237
237
  }, b = (c) => {
238
238
  const m = t.value.findIndex((e) => e.id === c.id);
@@ -271,28 +271,28 @@ function Ce(t, r) {
271
271
  const Ie = ["data-file-type"], Fe = {
272
272
  key: 1,
273
273
  class: "tr-file-card__picture-container"
274
- }, Ue = ["src", "alt"], xe = {
274
+ }, xe = ["src", "alt"], Me = {
275
275
  key: 0,
276
276
  class: "tr-file-card__picture-overlay"
277
- }, Me = {
277
+ }, Pe = {
278
278
  key: 1,
279
279
  class: "tr-file-card__status-overlay tr-file-card__status-overlay--picture"
280
- }, Pe = {
280
+ }, Ue = {
281
281
  key: 0,
282
282
  class: "tr-file-card__status-icon tr-file-card__status-icon--loading"
283
- }, Re = {
283
+ }, Le = {
284
284
  key: 0,
285
285
  class: "tr-file-card__status-icon--loading-text"
286
- }, Le = {
286
+ }, Re = {
287
287
  key: 2,
288
288
  class: "tr-file-card__default-container"
289
- }, $e = { class: "tr-file-card__icon-wrapper" }, Te = {
289
+ }, Te = { class: "tr-file-card__icon-wrapper" }, $e = {
290
290
  key: 0,
291
291
  class: "tr-file-card__status-overlay tr-file-card__status-overlay--icon"
292
- }, Ae = {
292
+ }, Be = {
293
293
  key: 0,
294
294
  class: "tr-file-card__status-icon tr-file-card__status-icon--loading"
295
- }, Be = { class: "tr-file-card__content" }, ze = { class: "tr-file-card__info" }, De = ["title"], Se = {
295
+ }, ze = { class: "tr-file-card__content" }, De = { class: "tr-file-card__info" }, Ae = ["title"], Se = {
296
296
  key: 0,
297
297
  class: "tr-file-card__status"
298
298
  }, je = {
@@ -304,13 +304,13 @@ const Ie = ["data-file-type"], Fe = {
304
304
  }, Ve = {
305
305
  key: 0,
306
306
  class: "tr-file-card__actions"
307
- }, Oe = ["href", "target", "onClick"], qe = ["onClick"], Je = {
307
+ }, Oe = ["href", "target", "onClick"], qe = ["onClick"], He = {
308
308
  key: 1,
309
309
  class: "tr-file-card__status-uploading"
310
- }, Ke = {
310
+ }, Qe = {
311
311
  key: 2,
312
312
  class: "tr-file-card__status-error"
313
- }, Ge = /* @__PURE__ */ B({
313
+ }, Ye = /* @__PURE__ */ z({
314
314
  __name: "FileCard",
315
315
  props: {
316
316
  file: {},
@@ -323,7 +323,7 @@ const Ie = ["data-file-type"], Fe = {
323
323
  },
324
324
  emits: ["remove", "preview", "action", "retry", "download"],
325
325
  setup(t, { emit: r }) {
326
- const s = t, u = r, { formatFileSize: i, getIconComponent: v } = Q({
326
+ const s = t, u = r, { formatFileSize: i, getIconComponent: v } = K({
327
327
  customIcons: s.fileIcons,
328
328
  fileMatchers: s.fileMatchers
329
329
  }), { isImage: y, handlePreview: b, handleRemove: k, handleCustomAction: w, handleRetry: l } = de(s, u), h = I(() => v(s.file.fileType).value), c = I(() => s.file.status === "uploading"), m = I(() => s.file.status === "success"), e = I(() => s.file.status === "error"), n = I(() => [
@@ -336,16 +336,16 @@ const Ie = ["data-file-type"], Fe = {
336
336
  }
337
337
  ]);
338
338
  return (a, _) => {
339
- var M;
339
+ var P;
340
340
  return o(), d("div", {
341
- class: R(n.value),
341
+ class: L(n.value),
342
342
  "data-file-type": a.file.fileType || "other",
343
343
  onClick: _[3] || (_[3] = (g) => a.variant === "picture" ? f(b)(g) : void 0)
344
344
  }, [
345
345
  a.disabled ? C("", !0) : (o(), d("button", {
346
346
  key: 0,
347
347
  class: "tr-file-card__close-btn",
348
- onClick: _[0] || (_[0] = x(
348
+ onClick: _[0] || (_[0] = M(
349
349
  //@ts-ignore
350
350
  (...g) => f(k) && f(k)(...g),
351
351
  ["stop"]
@@ -359,15 +359,15 @@ const Ie = ["data-file-type"], Fe = {
359
359
  src: a.file.url,
360
360
  alt: a.file.name,
361
361
  class: "tr-file-card__picture-img"
362
- }, null, 8, Ue),
363
- m.value ? (o(), d("div", xe, _[4] || (_[4] = [
362
+ }, null, 8, xe),
363
+ m.value ? (o(), d("div", Me, _[4] || (_[4] = [
364
364
  p("span", { class: "tr-file-card__picture-overlay-text" }, "预览", -1)
365
365
  ]))) : C("", !0),
366
- c.value || e.value ? (o(), d("div", Me, [
367
- c.value ? (o(), d("div", Pe, [
366
+ c.value || e.value ? (o(), d("div", Pe, [
367
+ c.value ? (o(), d("div", Ue, [
368
368
  F(f(E)),
369
- a.file.message ? (o(), d("span", Re, U(a.file.message), 1)) : C("", !0)
370
- ])) : e.value ? (o(), L(f(le), {
369
+ a.file.message ? (o(), d("span", Le, x(a.file.message), 1)) : C("", !0)
370
+ ])) : e.value ? (o(), R(f(le), {
371
371
  key: 1,
372
372
  content: "解析失败",
373
373
  placement: "top",
@@ -379,38 +379,38 @@ const Ie = ["data-file-type"], Fe = {
379
379
  _: 1
380
380
  })) : C("", !0)
381
381
  ])) : C("", !0)
382
- ])) : (o(), d("div", Le, [
382
+ ])) : (o(), d("div", Re, [
383
383
  p("div", {
384
- class: R(["tr-file-card__icon", { "tr-file-card__icon--clickable": f(y) }]),
385
- onClick: _[1] || (_[1] = x((g) => f(y) ? f(b)(g) : null, ["stop"]))
384
+ class: L(["tr-file-card__icon", { "tr-file-card__icon--clickable": f(y) }]),
385
+ onClick: _[1] || (_[1] = M((g) => f(y) ? f(b)(g) : null, ["stop"]))
386
386
  }, [
387
- p("div", $e, [
388
- (o(), L(V(h.value), { class: "tr-file-card__file-icon" })),
389
- c.value || e.value ? (o(), d("div", Te, [
390
- c.value ? (o(), d("div", Ae, [
387
+ p("div", Te, [
388
+ (o(), R(V(h.value), { class: "tr-file-card__file-icon" })),
389
+ c.value || e.value ? (o(), d("div", $e, [
390
+ c.value ? (o(), d("div", Be, [
391
391
  F(f(E))
392
- ])) : e.value ? (o(), L(f(W), {
392
+ ])) : e.value ? (o(), R(f(W), {
393
393
  key: 1,
394
394
  class: "tr-file-card__status-icon tr-file-card__status-icon--error"
395
395
  })) : C("", !0)
396
396
  ])) : C("", !0)
397
397
  ])
398
398
  ], 2),
399
- p("div", Be, [
400
- p("div", ze, [
399
+ p("div", ze, [
400
+ p("div", De, [
401
401
  p("div", {
402
402
  class: "tr-file-card__name",
403
403
  title: a.file.name
404
- }, U(a.file.name), 9, De),
404
+ }, x(a.file.name), 9, Ae),
405
405
  a.showStatus ? (o(), d("div", Se, [
406
406
  m.value ? (o(), d("div", je, [
407
407
  p("div", Ee, [
408
- p("span", We, U(((M = a.file.fileType) == null ? void 0 : M.toUpperCase()) || "FILE"), 1),
409
- a.file.size ? (o(), d("span", Ne, U(f(i)(a.file.size)), 1)) : C("", !0)
408
+ p("span", We, x(((P = a.file.fileType) == null ? void 0 : P.toUpperCase()) || "FILE"), 1),
409
+ a.file.size ? (o(), d("span", Ne, x(f(i)(a.file.size)), 1)) : C("", !0)
410
410
  ]),
411
411
  a.actions ? (o(), d("div", Ve, [
412
- (o(!0), d(z, null, D(a.actions, (g, X) => (o(), d("div", {
413
- key: X,
412
+ (o(!0), d(D, null, A(a.actions, (g, G) => (o(), d("div", {
413
+ key: G,
414
414
  class: "tr-file-card__action-btn"
415
415
  }, [
416
416
  g.type === "download" ? (o(), d("a", {
@@ -418,17 +418,17 @@ const Ie = ["data-file-type"], Fe = {
418
418
  class: "tr-file-card__action-btn--download",
419
419
  href: a.file.url ?? "javascript:void(0)",
420
420
  target: a.file.url ? "_blank" : "_self",
421
- onClick: (T) => f(w)(g, T)
422
- }, U(g.label), 9, Oe)) : (o(), d("button", {
421
+ onClick: ($) => f(w)(g, $)
422
+ }, x(g.label), 9, Oe)) : (o(), d("button", {
423
423
  key: 1,
424
- class: R(`tr-file-card__action-btn--${g.type}`),
425
- onClick: (T) => f(w)(g, T)
426
- }, U(g.label), 11, qe))
424
+ class: L(`tr-file-card__action-btn--${g.type}`),
425
+ onClick: ($) => f(w)(g, $)
426
+ }, x(g.label), 11, qe))
427
427
  ]))), 128))
428
428
  ])) : C("", !0)
429
- ])) : c.value ? (o(), d("div", Je, _[5] || (_[5] = [
429
+ ])) : c.value ? (o(), d("div", He, _[5] || (_[5] = [
430
430
  p("span", { class: "tr-file-card__uploading-text" }, "上传中...", -1)
431
- ]))) : e.value ? (o(), d("div", Ke, [
431
+ ]))) : e.value ? (o(), d("div", Qe, [
432
432
  _[6] || (_[6] = p("span", { class: "tr-file-card__error-text" }, "上传失败", -1)),
433
433
  p("button", {
434
434
  class: "tr-file-card__retry-btn",
@@ -443,7 +443,7 @@ const Ie = ["data-file-type"], Fe = {
443
443
  ], 10, Ie);
444
444
  };
445
445
  }
446
- }), He = /* @__PURE__ */ S(Ge, [["__scopeId", "data-v-06df896e"]]), Qe = { class: "tr-attachments" }, Xe = /* @__PURE__ */ B({
446
+ }), Ze = /* @__PURE__ */ S(Ye, [["__scopeId", "data-v-06df896e"]]), Ke = { class: "tr-attachments" }, Ge = /* @__PURE__ */ z({
447
447
  __name: "index",
448
448
  props: {
449
449
  items: {},
@@ -465,7 +465,7 @@ const Ie = ["data-file-type"], Fe = {
465
465
  },
466
466
  emits: ["update:items", "remove", "download", "retry", "preview", "action"],
467
467
  setup(t, { emit: r }) {
468
- const s = t, u = r, i = P(s.items || []), { actualListType: v } = Ce(i, s.variant), { handlePreview: y, renderPreview: b } = ke(i, u, { enableDownload: !0 });
468
+ const s = t, u = r, i = U(s.items || []), { actualListType: v } = Ce(i, s.variant), { handlePreview: y, renderPreview: b } = ke(i, u, { enableDownload: !0 });
469
469
  function k(e) {
470
470
  if (s.disabled) return;
471
471
  const n = i.value.findIndex((a) => a.id === e.id);
@@ -480,7 +480,7 @@ const Ie = ["data-file-type"], Fe = {
480
480
  function h(e) {
481
481
  u("action", e);
482
482
  }
483
- const c = I(() => s.wrap ? "wrap" : "no-wrap"), { normalizeAttachments: m } = Q({
483
+ const c = I(() => s.wrap ? "wrap" : "no-wrap"), { normalizeAttachments: m } = K({
484
484
  fileMatchers: s.fileMatchers
485
485
  });
486
486
  return se(
@@ -489,14 +489,14 @@ const Ie = ["data-file-type"], Fe = {
489
489
  e && e.length > 0 && (i.value = m(e));
490
490
  },
491
491
  { deep: !0, immediate: !0 }
492
- ), (e, n) => (o(), d("div", Qe, [
492
+ ), (e, n) => (o(), d("div", Ke, [
493
493
  i.value.length > 0 ? (o(), d("div", {
494
494
  key: 0,
495
- class: R(["tr-attachments__file-list", c.value]),
496
- onClick: n[0] || (n[0] = x(() => {
495
+ class: L(["tr-attachments__file-list", c.value]),
496
+ onClick: n[0] || (n[0] = M(() => {
497
497
  }, ["stop"]))
498
498
  }, [
499
- (o(!0), d(z, null, D(i.value, (a) => (o(), L(He, {
499
+ (o(!0), d(D, null, A(i.value, (a) => (o(), R(Ze, {
500
500
  key: a.id,
501
501
  file: a,
502
502
  variant: f(v),
@@ -512,15 +512,15 @@ const Ie = ["data-file-type"], Fe = {
512
512
  onAction: h
513
513
  }, null, 8, ["file", "variant", "file-icons", "disabled", "actions", "file-matchers", "onPreview"]))), 128))
514
514
  ], 2)) : C("", !0),
515
- (o(), L(V(f(b)())))
515
+ (o(), R(V(f(b)())))
516
516
  ]));
517
517
  }
518
- }), $ = /* @__PURE__ */ S(Xe, [["__scopeId", "data-v-e09559ac"]]);
519
- $.name = "TrAttachments";
520
- const Ye = function(t) {
521
- t.component($.name, $);
518
+ }), T = /* @__PURE__ */ S(Ge, [["__scopeId", "data-v-e09559ac"]]);
519
+ T.name = "TrAttachments";
520
+ const Je = function(t) {
521
+ t.component(T.name, T);
522
522
  };
523
- $.install = Ye;
523
+ T.install = Je;
524
524
  export {
525
- $ as default
525
+ T as default
526
526
  };