ik-next-ui 0.0.7 → 0.0.8

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,34 +1,34 @@
1
- import { openBlock as h, createElementBlock as C, createElementVNode as r, inject as X, computed as g, defineComponent as pe, resolveComponent as Oe, normalizeStyle as j, normalizeClass as z, unref as o, createBlock as _, withCtx as b, createCommentVNode as T, Fragment as Y, markRaw as be, ref as O, effectScope as Te, shallowRef as Be, watch as fe, nextTick as Ee, onMounted as Ae, Teleport as Re, createVNode as m, Transition as Ue, withModifiers as je, resolveDynamicComponent as _e, renderList as Le, withDirectives as me, vShow as ve, renderSlot as Se, useCssVars as De, useModel as Fe, mergeProps as Ve, createSlots as Pe, createTextVNode as We, toDisplayString as ue, mergeModels as we } from "vue";
2
- import { useLocale as Xe, useNamespace as Ye, useZIndex as He, ElIcon as N, EVENT_CODE as F, useFormItem as Ze, ElUpload as Ge, ElImage as Je, ElMessage as xe } from "element-plus";
1
+ import { openBlock as p, createElementBlock as z, createElementVNode as s, inject as W, computed as h, defineComponent as pe, resolveComponent as Oe, normalizeStyle as U, normalizeClass as C, unref as a, createBlock as j, withCtx as b, createCommentVNode as T, Fragment as X, markRaw as be, ref as O, effectScope as Te, shallowRef as Be, watch as fe, nextTick as Ae, onMounted as Ee, Teleport as Re, createVNode as m, Transition as Ue, withModifiers as je, resolveDynamicComponent as _e, renderList as Le, withDirectives as me, vShow as ve, renderSlot as Se, useCssVars as De, useModel as Fe, mergeProps as Ve, createSlots as Pe, createTextVNode as We, toDisplayString as ue, mergeModels as we } from "vue";
2
+ import { useLocale as Xe, useNamespace as Ye, useZIndex as He, ElIcon as N, EVENT_CODE as D, useFormItem as Ze, ElUpload as Ge, ElImage as Je, ElMessage as xe } from "element-plus";
3
3
  import { ScaleToOriginal as Ke, FullScreen as qe, Close as Qe, ArrowLeft as et, ArrowRight as tt, ZoomOut as lt, ZoomIn as Me, RefreshLeft as nt, RefreshRight as ot, Download as at, Delete as it } from "@element-plus/icons-vue";
4
- import { paramType as Ce, _ as K, ikFile as st } from "iking-utils-pro";
5
- import { Icon as ze } from "@iconify/vue";
4
+ import { paramType as ze, _ as q, ikFile as st } from "iking-utils-pro";
5
+ import { Icon as Ce } from "@iconify/vue";
6
6
  import { UseImage as Ie } from "@vueuse/components";
7
- import { useEventListener as J } from "@vueuse/core";
8
- const he = (l, w) => (l.install = (e) => {
9
- for (const d of [l, ...Object.values({})])
10
- e.component(d.name, d);
11
- }, l);
12
- function Ne(...l) {
7
+ import { useEventListener as K } from "@vueuse/core";
8
+ const he = (n, w) => (n.install = (t) => {
9
+ for (const r of [n, ...Object.values({})])
10
+ t.component(r.name, r);
11
+ }, n);
12
+ function Ne(...n) {
13
13
  const w = [];
14
- for (const e of l)
15
- if (e) {
16
- if (typeof e == "string")
17
- w.push(e);
18
- else if (Array.isArray(e)) {
19
- const d = Ne(...e);
20
- d && w.push(d);
21
- } else if (typeof e == "object")
22
- for (const [d, k] of Object.entries(e))
23
- k && w.push(d);
14
+ for (const t of n)
15
+ if (t) {
16
+ if (typeof t == "string")
17
+ w.push(t);
18
+ else if (Array.isArray(t)) {
19
+ const r = Ne(...t);
20
+ r && w.push(r);
21
+ } else if (typeof t == "object")
22
+ for (const [r, g] of Object.entries(t))
23
+ g && w.push(r);
24
24
  }
25
25
  return w.join(" ");
26
26
  }
27
- const ge = (l, w) => {
28
- const e = l.__vccOpts || l;
29
- for (const [d, k] of w)
30
- e[d] = k;
31
- return e;
27
+ const ge = (n, w) => {
28
+ const t = n.__vccOpts || n;
29
+ for (const [r, g] of w)
30
+ t[r] = g;
31
+ return t;
32
32
  }, rt = {}, ct = {
33
33
  t: "1686214149488",
34
34
  class: "icon",
@@ -39,9 +39,9 @@ const ge = (l, w) => {
39
39
  width: "200",
40
40
  height: "200"
41
41
  };
42
- function ut(l, w) {
43
- return h(), C("svg", ct, [...w[0] || (w[0] = [
44
- r(
42
+ function ut(n, w) {
43
+ return p(), z("svg", ct, [...w[0] || (w[0] = [
44
+ s(
45
45
  "path",
46
46
  {
47
47
  d: "M369.569592 512.011256c0-14.328333-11.010775-25.945929-24.591071-25.945929L86.980515 486.065328c-13.580297 0-24.591071 11.618619-24.591071 25.945929 0 14.33038 11.010775 25.947975 24.591071 25.947975l257.998005 0C358.55984 537.959232 369.569592 526.341636 369.569592 512.011256z",
@@ -51,7 +51,7 @@ function ut(l, w) {
51
51
  -1
52
52
  /* CACHED */
53
53
  ),
54
- r(
54
+ s(
55
55
  "path",
56
56
  {
57
57
  d: "M937.019485 486.064304 679.020456 486.064304c-13.580297 0-24.591071 11.618619-24.591071 25.945929 0 14.33038 11.010775 25.947975 24.591071 25.947975l257.999029 0c13.580297 0 24.590048-11.618619 24.590048-25.947975C961.609533 497.682923 950.598758 486.064304 937.019485 486.064304z",
@@ -61,7 +61,7 @@ function ut(l, w) {
61
61
  -1
62
62
  /* CACHED */
63
63
  ),
64
- r(
64
+ s(
65
65
  "path",
66
66
  {
67
67
  d: "M512.011768 62.389956c-13.580297 0-24.590048 11.618619-24.590048 25.945929l0 257.170151c0 14.329357 11.010775 25.946952 24.590048 25.946952s24.591071-11.618619 24.591071-25.946952L536.602839 88.335884C536.602839 74.008574 525.591041 62.389956 512.011768 62.389956z",
@@ -71,7 +71,7 @@ function ut(l, w) {
71
71
  -1
72
72
  /* CACHED */
73
73
  ),
74
- r(
74
+ s(
75
75
  "path",
76
76
  {
77
77
  d: "M512.011768 652.544967c-13.580297 0-24.590048 11.618619-24.590048 25.946952l0 257.169127c0 14.33038 11.010775 25.947975 24.590048 25.947975s24.591071-11.618619 24.591071-25.947975L536.602839 678.491918C536.602839 664.162562 525.591041 652.544967 512.011768 652.544967z",
@@ -81,7 +81,7 @@ function ut(l, w) {
81
81
  -1
82
82
  /* CACHED */
83
83
  ),
84
- r(
84
+ s(
85
85
  "path",
86
86
  {
87
87
  d: "M377.001865 413.125085c4.744048 4.737908 10.818393 7.082302 16.882506 7.082302 6.519484 0 13.039991-2.724041 17.879206-8.134261 9.317203-10.414187 8.885368-26.834158-0.9967-36.678364L228.341057 193.559391c-9.832949-9.830903-25.406646-9.388834-34.760688 1.050935-9.317203 10.414187-8.885368 26.834158 0.9967 36.678364L377.001865 413.125085z",
@@ -91,7 +91,7 @@ function ut(l, w) {
91
91
  -1
92
92
  /* CACHED */
93
93
  ),
94
- r(
94
+ s(
95
95
  "path",
96
96
  {
97
97
  d: "M646.997112 610.873892c-9.846252-9.831926-25.419949-9.388834-34.761712 1.051959-9.317203 10.414187-8.885368 26.834158 0.997724 36.678364l182.41354 181.834348c4.743024 4.738931 10.818393 7.083326 16.881482 7.083326 6.520507 0 13.039991-2.723018 17.879206-8.134261 9.317203-10.41521 8.886391-26.834158-0.9967-36.678364L646.997112 610.873892z",
@@ -101,7 +101,7 @@ function ut(l, w) {
101
101
  -1
102
102
  /* CACHED */
103
103
  ),
104
- r(
104
+ s(
105
105
  "path",
106
106
  {
107
107
  d: "M630.114606 420.207387c6.064113 0 12.139481-2.344395 16.882506-7.082302l182.425819-181.836395c9.882068-9.844206 10.313903-26.264177 0.9967-36.678364-9.341762-10.43977-24.915459-10.882861-34.760688-1.050935L613.233124 375.394762c-9.882068 9.844206-10.314926 26.264177-0.997724 36.678364C617.074615 417.483346 623.595123 420.207387 630.114606 420.207387z",
@@ -111,7 +111,7 @@ function ut(l, w) {
111
111
  -1
112
112
  /* CACHED */
113
113
  ),
114
- r(
114
+ s(
115
115
  "path",
116
116
  {
117
117
  d: "M377.025401 610.873892 194.600605 792.710286c-9.881045 9.844206-10.313903 26.263154-0.9967 36.678364 4.839215 5.411243 11.358699 8.134261 17.879206 8.134261 6.064113 0 12.138458-2.344395 16.881482-7.083326l182.425819-181.834348c9.881045-9.844206 10.313903-26.264177 0.9967-36.678364C402.469909 601.485057 386.872676 601.041966 377.025401 610.873892z",
@@ -178,15 +178,18 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
178
178
  "mp4",
179
179
  "flv",
180
180
  "tls"
181
- ], ft = (l) => {
182
- const w = X("loadUrl"), e = g(() => l.loadUrl || l.fileUrl || (w == null ? void 0 : w.value)), d = X("uploadUrl"), k = g(() => l.action || l.uploadUrl || (d == null ? void 0 : d.value)), f = X("token"), $ = g(() => l.token || (f == null ? void 0 : f.value)), L = X("onlyofficeConfig"), p = g(() => l.onlyofficeConfig || (L == null ? void 0 : L.value)), A = X("userInfo"), R = g(() => l.userInfo || (A == null ? void 0 : A.value)), S = [...$e, ...$e.map((c) => c.toLocaleUpperCase())];
181
+ ], ft = (n) => {
182
+ const w = W("loadUrl"), t = h(() => n.loadUrl || n.fileUrl || (w == null ? void 0 : w.value)), r = W("uploadUrl"), g = h(() => n.action || n.uploadUrl || (r == null ? void 0 : r.value)), c = W("token"), $ = h(() => n.token || (c == null ? void 0 : c.value)), S = W("onlyofficeConfig"), v = h(() => n.onlyofficeConfig || (S == null ? void 0 : S.value)), A = W("userInfo"), E = h(() => n.userInfo || (A == null ? void 0 : A.value)), M = [...$e, ...$e.map((f) => f.toLocaleUpperCase())];
183
183
  return {
184
- cLoadUrl: e,
185
- cUploadUrl: k,
184
+ cLoadUrl: t,
185
+ cUploadUrl: g,
186
186
  cToken: $,
187
- cOnlyofficeConfig: p,
188
- cUserInfo: R,
189
- cOnlyofficePreviewType: S
187
+ cOnlyofficeConfig: v,
188
+ cUserInfo: E,
189
+ cOnlyofficePreviewType: M,
190
+ cHeaders: {
191
+ Authorization: $.value
192
+ }
190
193
  };
191
194
  }, mt = {
192
195
  key: 2,
@@ -214,124 +217,124 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
214
217
  hover: { type: Boolean, default: !1 }
215
218
  },
216
219
  emits: ["click"],
217
- setup(l, { emit: w }) {
218
- const e = l, d = w, k = g(() => e.danger ? "danger" : e.error ? "error" : e.type), f = g(() => {
219
- if (!e.name)
220
+ setup(n, { emit: w }) {
221
+ const t = n, r = w, g = h(() => t.danger ? "danger" : t.error ? "error" : t.type), c = h(() => {
222
+ if (!t.name)
220
223
  return;
221
- const c = (u) => /^\.{1,2}\//.test(u) || u.startsWith("/") || u.includes("/");
222
- return /^https?:\/\//.test(e.name) || c(e.name) ? "img" : e.name.startsWith("iksvg_") ? "two-color-svg" : /i-[^:]+:[^:]+/.test(e.name) || e.name.startsWith("ik") ? "unocss" : e.name.includes(":") ? "iconify" : "svg";
224
+ const f = (d) => /^\.{1,2}\//.test(d) || d.startsWith("/") || d.includes("/");
225
+ return /^https?:\/\//.test(t.name) || f(t.name) ? "img" : t.name.startsWith("iksvg_") ? "two-color-svg" : /i-[^:]+:[^:]+/.test(t.name) || t.name.startsWith("ik") ? "unocss" : t.name.includes(":") ? "iconify" : "svg";
223
226
  }), $ = {
224
227
  big: 24,
225
228
  default: 22,
226
229
  small: 20
227
230
  };
228
- function L() {
229
- return e.size ? $[e.size] || e.size : 18;
231
+ function S() {
232
+ return t.size ? $[t.size] || t.size : 18;
230
233
  }
231
- const p = g(() => {
232
- const c = L(), u = typeof c == "number" ? `${c}px` : c;
234
+ const v = h(() => {
235
+ const f = S(), d = typeof f == "number" ? `${f}px` : f;
233
236
  return {
234
- width: u,
235
- height: u,
236
- fontSize: u
237
+ width: d,
238
+ height: d,
239
+ fontSize: d
237
240
  };
238
- }), A = g(() => {
239
- const u = `${Number.parseInt(L()) + 8}px`;
241
+ }), A = h(() => {
242
+ const d = `${Number.parseInt(S()) + 8}px`;
240
243
  return {
241
- width: u,
242
- height: u
244
+ width: d,
245
+ height: d
243
246
  };
244
247
  });
245
- function R(c) {
246
- e.onClick ? e.onClick(c) : d("click", c);
248
+ function E(f) {
249
+ t.onClick ? t.onClick(f) : r("click", f);
247
250
  }
248
- const S = g(() => {
249
- if (f.value !== "two-color-svg")
251
+ const M = h(() => {
252
+ if (c.value !== "two-color-svg")
250
253
  return {};
251
- const c = {};
252
- if (e.disabled)
253
- return c["--ik-icon-deep-color"] = "var(--ik-icon-deep-disabled)", c["--ik-icon-shallow-color"] = "var(--ik-icon-shallow-disabled)", c;
254
- if (e.deepColor && (c["--ik-icon-deep-color"] = e.deepColor), e.shallowColor && (c["--ik-icon-shallow-color"] = e.shallowColor), e.colorMode !== "auto")
255
- switch (e.colorMode) {
254
+ const f = {};
255
+ if (t.disabled)
256
+ return f["--ik-icon-deep-color"] = "var(--ik-icon-deep-disabled)", f["--ik-icon-shallow-color"] = "var(--ik-icon-shallow-disabled)", f;
257
+ if (t.deepColor && (f["--ik-icon-deep-color"] = t.deepColor), t.shallowColor && (f["--ik-icon-shallow-color"] = t.shallowColor), t.colorMode !== "auto")
258
+ switch (t.colorMode) {
256
259
  case "primary":
257
- e.deepColor || (c["--ik-icon-deep-color"] = "var(--ik-color-primary)"), e.shallowColor || (c["--ik-icon-shallow-color"] = "var(--ik-primary-light-1, color-mix(in srgb, var(--ik-color-primary) 30%, white))");
260
+ t.deepColor || (f["--ik-icon-deep-color"] = "var(--ik-color-primary)"), t.shallowColor || (f["--ik-icon-shallow-color"] = "var(--ik-primary-light-1, color-mix(in srgb, var(--ik-color-primary) 30%, white))");
258
261
  break;
259
262
  case "deep":
260
- e.shallowColor || (c["--ik-icon-shallow-color"] = c["--ik-icon-deep-color"] || e.deepColor || "var(--ik-icon-deep-color)");
263
+ t.shallowColor || (f["--ik-icon-shallow-color"] = f["--ik-icon-deep-color"] || t.deepColor || "var(--ik-icon-deep-color)");
261
264
  break;
262
265
  case "shallow":
263
- e.deepColor || (c["--ik-icon-deep-color"] = c["--ik-icon-shallow-color"] || e.shallowColor || "var(--ik-icon-shallow-color)");
266
+ t.deepColor || (f["--ik-icon-deep-color"] = f["--ik-icon-shallow-color"] || t.shallowColor || "var(--ik-icon-shallow-color)");
264
267
  break;
265
268
  }
266
- return e.active && k.value !== "default" && !e.deepColor && !e.shallowColor && e.colorMode === "auto" && (c["--ik-icon-deep-color"] = `var(--ik-icon-${k.value}-deep-active)`, c["--ik-icon-shallow-color"] = `var(--ik-icon-${k.value}-shallow-active)`), c;
269
+ return t.active && g.value !== "default" && !t.deepColor && !t.shallowColor && t.colorMode === "auto" && (f["--ik-icon-deep-color"] = `var(--ik-icon-${g.value}-deep-active)`, f["--ik-icon-shallow-color"] = `var(--ik-icon-${g.value}-shallow-active)`), f;
267
270
  });
268
- return (c, u) => {
269
- var M;
270
- const x = Oe("IkTooltip");
271
- return h(), C(
271
+ return (f, d) => {
272
+ var I;
273
+ const y = Oe("IkTooltip");
274
+ return p(), z(
272
275
  "i",
273
276
  {
274
- class: z(o(Ne)(
277
+ class: C(a(Ne)(
275
278
  "ik-icon relative size-[1em] flex-inline items-center justify-center fill-current leading-[1em]",
276
- e.class,
277
- l.showBg ? "bg" : "",
278
- l.disabled ? "is-disabled" : "",
279
- l.active ? "is-active" : "",
280
- k.value !== "default" ? `is-${k.value}` : "",
281
- l.unMargin ? "un-margin" : "margin",
282
- l.hover ? "is-hover" : ""
279
+ t.class,
280
+ n.showBg ? "bg" : "",
281
+ n.disabled ? "is-disabled" : "",
282
+ n.active ? "is-active" : "",
283
+ g.value !== "default" ? `is-${g.value}` : "",
284
+ n.unMargin ? "un-margin" : "margin",
285
+ n.hover ? "is-hover" : ""
283
286
  )),
284
- style: j(l.showBg ? A.value : p.value),
285
- onClick: R
287
+ style: U(n.showBg ? A.value : v.value),
288
+ onClick: E
286
289
  },
287
290
  [
288
- l.title ? (h(), _(x, {
291
+ n.title ? (p(), j(y, {
289
292
  key: 0,
290
- text: l.title
293
+ text: n.title
291
294
  }, {
292
295
  default: b(() => {
293
- var y;
296
+ var k;
294
297
  return [
295
- f.value === "unocss" ? (h(), C(
298
+ c.value === "unocss" ? (p(), z(
296
299
  "i",
297
300
  {
298
301
  key: 0,
299
- class: z(["iconfont shrink-0 size-inherit", `${l.name} ${(y = l.name) == null ? void 0 : y.split("_")[0]}`]),
300
- style: j({ ...S.value, ...l.showBg ? p.value : {} })
302
+ class: C(["iconfont shrink-0 size-inherit", `${n.name} ${(k = n.name) == null ? void 0 : k.split("_")[0]}`]),
303
+ style: U({ ...M.value, ...n.showBg ? v.value : {} })
301
304
  },
302
305
  null,
303
306
  6
304
307
  /* CLASS, STYLE */
305
- )) : f.value === "iconify" ? (h(), _(o(ze), {
308
+ )) : c.value === "iconify" ? (p(), j(a(Ce), {
306
309
  key: 1,
307
- icon: l.name,
310
+ icon: n.name,
308
311
  class: "shrink-0 size-inherit"
309
- }, null, 8, ["icon"])) : f.value === "svg" ? (h(), C("svg", mt, [
310
- r("use", {
311
- "xlink:href": `#icon-${l.name}`
312
+ }, null, 8, ["icon"])) : c.value === "svg" ? (p(), z("svg", mt, [
313
+ s("use", {
314
+ "xlink:href": `#icon-${n.name}`
312
315
  }, null, 8, vt)
313
- ])) : f.value === "two-color-svg" ? (h(), C(
316
+ ])) : c.value === "two-color-svg" ? (p(), z(
314
317
  "svg",
315
318
  {
316
319
  key: 3,
317
320
  class: "two-color-icon shrink-0 size-inherit",
318
- style: j(S.value),
321
+ style: U(M.value),
319
322
  "aria-hidden": "true"
320
323
  },
321
324
  [
322
- r("use", {
323
- "xlink:href": `#${l.name}`
325
+ s("use", {
326
+ "xlink:href": `#${n.name}`
324
327
  }, null, 8, pt)
325
328
  ],
326
329
  4
327
330
  /* STYLE */
328
- )) : f.value === "img" ? (h(), _(o(Ie), {
331
+ )) : c.value === "img" ? (p(), j(a(Ie), {
329
332
  key: 4,
330
- src: l.name,
333
+ src: n.name,
331
334
  class: "shrink-0"
332
335
  }, {
333
- loading: b(() => [...u[0] || (u[0] = [
334
- r(
336
+ loading: b(() => [...d[0] || (d[0] = [
337
+ s(
335
338
  "i",
336
339
  { class: "i-line-md:loading-loop size-inherit" },
337
340
  null,
@@ -339,8 +342,8 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
339
342
  /* CACHED */
340
343
  )
341
344
  ])]),
342
- error: b(() => [...u[1] || (u[1] = [
343
- r(
345
+ error: b(() => [...d[1] || (d[1] = [
346
+ s(
344
347
  "i",
345
348
  { class: "i-ph:image-broken-duotone size-inherit" },
346
349
  null,
@@ -355,55 +358,55 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
355
358
  }),
356
359
  _: 1
357
360
  /* STABLE */
358
- }, 8, ["text"])) : (h(), C(
359
- Y,
361
+ }, 8, ["text"])) : (p(), z(
362
+ X,
360
363
  { key: 1 },
361
364
  [
362
- f.value === "unocss" ? (h(), C(
365
+ c.value === "unocss" ? (p(), z(
363
366
  "i",
364
367
  {
365
368
  key: 0,
366
- class: z(["iconfont shrink-0 size-inherit", `${l.name} ${(M = l.name) == null ? void 0 : M.split("_")[0]}`]),
367
- style: j({ ...S.value, ...l.showBg ? p.value : {} })
369
+ class: C(["iconfont shrink-0 size-inherit", `${n.name} ${(I = n.name) == null ? void 0 : I.split("_")[0]}`]),
370
+ style: U({ ...M.value, ...n.showBg ? v.value : {} })
368
371
  },
369
372
  null,
370
373
  6
371
374
  /* CLASS, STYLE */
372
- )) : f.value === "iconify" ? (h(), _(o(ze), {
375
+ )) : c.value === "iconify" ? (p(), j(a(Ce), {
373
376
  key: 1,
374
- icon: l.name,
377
+ icon: n.name,
375
378
  class: "shrink-0 size-inherit"
376
- }, null, 8, ["icon"])) : f.value === "svg" ? (h(), C("svg", {
379
+ }, null, 8, ["icon"])) : c.value === "svg" ? (p(), z("svg", {
377
380
  key: 2,
378
381
  class: "shrink-0 size-inherit",
379
- size: l.size,
382
+ size: n.size,
380
383
  "aria-hidden": "true"
381
384
  }, [
382
- r("use", {
383
- "xlink:href": `#icon-${l.name}`
385
+ s("use", {
386
+ "xlink:href": `#icon-${n.name}`
384
387
  }, null, 8, gt)
385
- ], 8, ht)) : f.value === "two-color-svg" ? (h(), C(
388
+ ], 8, ht)) : c.value === "two-color-svg" ? (p(), z(
386
389
  "svg",
387
390
  {
388
391
  key: 3,
389
392
  class: "two-color-icon shrink-0 size-inherit",
390
- style: j(S.value),
393
+ style: U(M.value),
391
394
  "aria-hidden": "true"
392
395
  },
393
396
  [
394
- r("use", {
395
- "xlink:href": `#${l.name}`
397
+ s("use", {
398
+ "xlink:href": `#${n.name}`
396
399
  }, null, 8, kt)
397
400
  ],
398
401
  4
399
402
  /* STYLE */
400
- )) : f.value === "img" ? (h(), _(o(Ie), {
403
+ )) : c.value === "img" ? (p(), j(a(Ie), {
401
404
  key: 4,
402
- src: l.name,
405
+ src: n.name,
403
406
  class: "shrink-0"
404
407
  }, {
405
- loading: b(() => [...u[2] || (u[2] = [
406
- r(
408
+ loading: b(() => [...d[2] || (d[2] = [
409
+ s(
407
410
  "i",
408
411
  { class: "i-line-md:loading-loop size-inherit" },
409
412
  null,
@@ -411,8 +414,8 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
411
414
  /* CACHED */
412
415
  )
413
416
  ])]),
414
- error: b(() => [...u[3] || (u[3] = [
415
- r(
417
+ error: b(() => [...d[3] || (d[3] = [
418
+ s(
416
419
  "i",
417
420
  { class: "i-ph:image-broken-duotone size-inherit" },
418
421
  null,
@@ -505,15 +508,15 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
505
508
  }
506
509
  }, xt = {
507
510
  close: () => !0,
508
- switch: (l) => Ce.isNumber(l),
509
- rotate: (l) => Ce.isNumber(l)
510
- }, Ct = ["src", "crossorigin"], zt = /* @__PURE__ */ pe({
511
+ switch: (n) => ze.isNumber(n),
512
+ rotate: (n) => ze.isNumber(n)
513
+ }, zt = ["src", "crossorigin"], Ct = /* @__PURE__ */ pe({
511
514
  name: "ElImageViewer",
512
515
  __name: "IkImageViewer",
513
516
  props: wt,
514
517
  emits: xt,
515
- setup(l, { expose: w, emit: e }) {
516
- const d = (n) => Object.keys(n), k = {
518
+ setup(n, { expose: w, emit: t }) {
519
+ const r = (e) => Object.keys(e), g = {
517
520
  CONTAIN: {
518
521
  name: "contain",
519
522
  icon: be(qe)
@@ -522,101 +525,101 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
522
525
  name: "original",
523
526
  icon: be(Ke)
524
527
  }
525
- }, f = l, $ = e, { t: L } = Xe(), p = Ye("image-viewer"), { nextZIndex: A } = He(), R = O(), S = O([]), c = Te(), u = O(!0), x = O(f.initialIndex), M = Be(k.CONTAIN), y = O({
528
+ }, c = n, $ = t, { t: S } = Xe(), v = Ye("image-viewer"), { nextZIndex: A } = He(), E = O(), M = O([]), f = Te(), d = O(!0), y = O(c.initialIndex), I = Be(g.CONTAIN), k = O({
526
529
  scale: 1,
527
530
  deg: 0,
528
531
  offsetX: 0,
529
532
  offsetY: 0,
530
533
  enableTransition: !1
531
- }), q = O(f.zIndex ?? A()), Q = g(() => {
532
- const { urlList: n } = f;
533
- return n.length <= 1;
534
- }), H = g(() => x.value === 0), Z = g(() => x.value === f.urlList.length - 1), ee = g(() => f.urlList[x.value]), te = g(() => [
535
- p.e("btn"),
536
- p.e("prev"),
537
- p.is("disabled", !f.infinite && H.value)
538
- ]), le = g(() => [
539
- p.e("btn"),
540
- p.e("next"),
541
- p.is("disabled", !f.infinite && Z.value)
542
- ]), ne = g(() => {
543
- const { scale: n, deg: s, offsetX: v, offsetY: I, enableTransition: B } = y.value;
544
- let E = v / n, U = I / n;
545
- const W = s * Math.PI / 180, ke = Math.cos(W), ye = Math.sin(W);
546
- E = E * ke + U * ye, U = U * ke - v / n * ye;
534
+ }), Y = O(c.zIndex ?? A()), Q = h(() => {
535
+ const { urlList: e } = c;
536
+ return e.length <= 1;
537
+ }), H = h(() => y.value === 0), Z = h(() => y.value === c.urlList.length - 1), ee = h(() => c.urlList[y.value]), te = h(() => [
538
+ v.e("btn"),
539
+ v.e("prev"),
540
+ v.is("disabled", !c.infinite && H.value)
541
+ ]), le = h(() => [
542
+ v.e("btn"),
543
+ v.e("next"),
544
+ v.is("disabled", !c.infinite && Z.value)
545
+ ]), ne = h(() => {
546
+ const { scale: e, deg: i, offsetX: u, offsetY: x, enableTransition: L } = k.value;
547
+ let B = u / e, R = x / e;
548
+ const P = i * Math.PI / 180, ke = Math.cos(P), ye = Math.sin(P);
549
+ B = B * ke + R * ye, R = R * ke - u / e * ye;
547
550
  const ce = {
548
- transform: `scale(${n}) rotate(${s}deg) translate(${E}px, ${U}px)`,
549
- transition: B ? "transform .3s" : ""
551
+ transform: `scale(${e}) rotate(${i}deg) translate(${B}px, ${R}px)`,
552
+ transition: L ? "transform .3s" : ""
550
553
  };
551
- return M.value.name === k.CONTAIN.name && (ce.maxWidth = ce.maxHeight = "100%"), ce;
554
+ return I.value.name === g.CONTAIN.name && (ce.maxWidth = ce.maxHeight = "100%"), ce;
552
555
  });
553
- function V() {
556
+ function F() {
554
557
  ae(), $("close");
555
558
  }
556
559
  function oe() {
557
- const n = K.throttle((v) => {
558
- switch (v.code) {
560
+ const e = q.throttle((u) => {
561
+ switch (u.code) {
559
562
  // ESC
560
- case F.esc:
561
- f.closeOnPressEscape && V();
563
+ case D.esc:
564
+ c.closeOnPressEscape && F();
562
565
  break;
563
566
  // SPACE
564
- case F.space:
565
- G();
567
+ case D.space:
568
+ _();
566
569
  break;
567
570
  // LEFT_ARROW
568
- case F.left:
569
- t();
571
+ case D.left:
572
+ J();
570
573
  break;
571
574
  // UP_ARROW
572
- case F.up:
573
- a("zoomIn");
575
+ case D.up:
576
+ o("zoomIn");
574
577
  break;
575
578
  // RIGHT_ARROW
576
- case F.right:
577
- i();
579
+ case D.right:
580
+ l();
578
581
  break;
579
582
  // DOWN_ARROW
580
- case F.down:
581
- a("zoomOut");
583
+ case D.down:
584
+ o("zoomOut");
582
585
  break;
583
586
  }
584
- }), s = K.throttle((v) => {
585
- const I = v.deltaY || v.deltaX;
586
- a(I < 0 ? "zoomIn" : "zoomOut", {
587
- zoomRate: f.zoomRate,
587
+ }), i = q.throttle((u) => {
588
+ const x = u.deltaY || u.deltaX;
589
+ o(x < 0 ? "zoomIn" : "zoomOut", {
590
+ zoomRate: c.zoomRate,
588
591
  enableTransition: !1
589
592
  });
590
593
  });
591
- c.run(() => {
592
- J(document, "keydown", n), J(document, "wheel", s);
594
+ f.run(() => {
595
+ K(document, "keydown", e), K(document, "wheel", i);
593
596
  });
594
597
  }
595
598
  function ae() {
596
- c.stop();
599
+ f.stop();
597
600
  }
598
601
  function ie() {
599
- u.value = !1;
602
+ d.value = !1;
600
603
  }
601
- function se(n) {
602
- u.value = !1, n.target.alt = L("el.image.error");
604
+ function se(e) {
605
+ d.value = !1, e.target.alt = S("el.image.error");
603
606
  }
604
- function re(n) {
605
- if (u.value || n.button !== 0 || !R.value) return;
606
- y.value.enableTransition = !1;
607
- const { offsetX: s, offsetY: v } = y.value, I = n.pageX, B = n.pageY, E = K.throttle((W) => {
608
- y.value = {
609
- ...y.value,
610
- offsetX: s + W.pageX - I,
611
- offsetY: v + W.pageY - B
607
+ function re(e) {
608
+ if (d.value || e.button !== 0 || !E.value) return;
609
+ k.value.enableTransition = !1;
610
+ const { offsetX: i, offsetY: u } = k.value, x = e.pageX, L = e.pageY, B = q.throttle((P) => {
611
+ k.value = {
612
+ ...k.value,
613
+ offsetX: i + P.pageX - x,
614
+ offsetY: u + P.pageY - L
612
615
  };
613
- }), U = J(document, "mousemove", E);
614
- J(document, "mouseup", () => {
615
- U();
616
- }), n.preventDefault();
616
+ }), R = K(document, "mousemove", B);
617
+ K(document, "mouseup", () => {
618
+ R();
619
+ }), e.preventDefault();
617
620
  }
618
- function D() {
619
- y.value = {
621
+ function G() {
622
+ k.value = {
620
623
  scale: 1,
621
624
  deg: 0,
622
625
  offsetX: 0,
@@ -624,101 +627,101 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
624
627
  enableTransition: !1
625
628
  };
626
629
  }
627
- function G() {
628
- if (u.value) return;
629
- const n = d(k), s = Object.values(k), v = M.value.name, B = ((s == null ? void 0 : s.findIndex((E) => E.name === v)) + 1) % n.length;
630
- M.value = k[n[B]], D();
630
+ function _() {
631
+ if (d.value) return;
632
+ const e = r(g), i = Object.values(g), u = I.value.name, L = ((i == null ? void 0 : i.findIndex((B) => B.name === u)) + 1) % e.length;
633
+ I.value = g[e[L]], G();
631
634
  }
632
- function P(n) {
633
- const s = f.urlList.length;
634
- x.value = (n + s) % s;
635
+ function V(e) {
636
+ const i = c.urlList.length;
637
+ y.value = (e + i) % i;
635
638
  }
636
- function t() {
637
- H.value && !f.infinite || P(x.value - 1);
639
+ function J() {
640
+ H.value && !c.infinite || V(y.value - 1);
638
641
  }
639
- function i() {
640
- Z.value && !f.infinite || P(x.value + 1);
642
+ function l() {
643
+ Z.value && !c.infinite || V(y.value + 1);
641
644
  }
642
- function a(n, s = {}) {
643
- if (u.value) return;
644
- const { minScale: v, maxScale: I } = f, { zoomRate: B, rotateDeg: E, enableTransition: U } = {
645
- zoomRate: f.zoomRate,
645
+ function o(e, i = {}) {
646
+ if (d.value) return;
647
+ const { minScale: u, maxScale: x } = c, { zoomRate: L, rotateDeg: B, enableTransition: R } = {
648
+ zoomRate: c.zoomRate,
646
649
  rotateDeg: 90,
647
650
  enableTransition: !0,
648
- ...s
651
+ ...i
649
652
  };
650
- switch (n) {
653
+ switch (e) {
651
654
  case "zoomOut":
652
- y.value.scale > v && (y.value.scale = Number.parseFloat(
653
- (y.value.scale / B).toFixed(3)
655
+ k.value.scale > u && (k.value.scale = Number.parseFloat(
656
+ (k.value.scale / L).toFixed(3)
654
657
  ));
655
658
  break;
656
659
  case "zoomIn":
657
- y.value.scale < I && (y.value.scale = Number.parseFloat(
658
- (y.value.scale * B).toFixed(3)
660
+ k.value.scale < x && (k.value.scale = Number.parseFloat(
661
+ (k.value.scale * L).toFixed(3)
659
662
  ));
660
663
  break;
661
664
  case "clockwise":
662
- y.value.deg += E, $("rotate", y.value.deg);
665
+ k.value.deg += B, $("rotate", k.value.deg);
663
666
  break;
664
667
  case "anticlockwise":
665
- y.value.deg -= E, $("rotate", y.value.deg);
668
+ k.value.deg -= B, $("rotate", k.value.deg);
666
669
  break;
667
670
  }
668
- y.value.enableTransition = U;
671
+ k.value.enableTransition = R;
669
672
  }
670
673
  return fe(ee, () => {
671
- Ee(() => {
672
- const n = S.value[0];
673
- n != null && n.complete || (u.value = !0);
674
+ Ae(() => {
675
+ const e = M.value[0];
676
+ e != null && e.complete || (d.value = !0);
674
677
  });
675
- }), fe(x, (n) => {
676
- D(), $("switch", n);
677
- }), Ae(() => {
678
- var n, s;
679
- oe(), (s = (n = R.value) == null ? void 0 : n.focus) == null || s.call(n);
678
+ }), fe(y, (e) => {
679
+ G(), $("switch", e);
680
+ }), Ee(() => {
681
+ var e, i;
682
+ oe(), (i = (e = E.value) == null ? void 0 : e.focus) == null || i.call(e);
680
683
  }), w({
681
684
  /**
682
685
  * @description manually switch image
683
686
  */
684
- setActiveItem: P
685
- }), (n, s) => (h(), _(Re, { to: "body" }, [
687
+ setActiveItem: V
688
+ }), (e, i) => (p(), j(Re, { to: "body" }, [
686
689
  m(Ue, {
687
690
  name: "viewer-fade",
688
691
  appear: ""
689
692
  }, {
690
693
  default: b(() => [
691
- r(
694
+ s(
692
695
  "div",
693
696
  {
694
697
  ref_key: "wrapper",
695
- ref: R,
698
+ ref: E,
696
699
  tabindex: -1,
697
- class: z(o(p).e("wrapper")),
698
- style: j({ zIndex: q.value })
700
+ class: C(a(v).e("wrapper")),
701
+ style: U({ zIndex: Y.value })
699
702
  },
700
703
  [
701
- r(
704
+ s(
702
705
  "div",
703
706
  {
704
- class: z(o(p).e("mask")),
705
- onClick: s[0] || (s[0] = je((v) => n.hideOnClickModal && V(), ["self"]))
707
+ class: C(a(v).e("mask")),
708
+ onClick: i[0] || (i[0] = je((u) => e.hideOnClickModal && F(), ["self"]))
706
709
  },
707
710
  null,
708
711
  2
709
712
  /* CLASS */
710
713
  ),
711
714
  T(" CLOSE "),
712
- r(
715
+ s(
713
716
  "span",
714
717
  {
715
- class: z([o(p).e("btn"), o(p).e("close")]),
716
- onClick: V
718
+ class: C([a(v).e("btn"), a(v).e("close")]),
719
+ onClick: F
717
720
  },
718
721
  [
719
- m(o(N), null, {
722
+ m(a(N), null, {
720
723
  default: b(() => [
721
- m(o(Qe))
724
+ m(a(Qe))
722
725
  ]),
723
726
  _: 1
724
727
  /* STABLE */
@@ -728,20 +731,20 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
728
731
  /* CLASS */
729
732
  ),
730
733
  T(" ARROW "),
731
- Q.value ? T("v-if", !0) : (h(), C(
732
- Y,
734
+ Q.value ? T("v-if", !0) : (p(), z(
735
+ X,
733
736
  { key: 0 },
734
737
  [
735
- r(
738
+ s(
736
739
  "span",
737
740
  {
738
- class: z(te.value),
739
- onClick: t
741
+ class: C(te.value),
742
+ onClick: J
740
743
  },
741
744
  [
742
- m(o(N), null, {
745
+ m(a(N), null, {
743
746
  default: b(() => [
744
- m(o(et))
747
+ m(a(et))
745
748
  ]),
746
749
  _: 1
747
750
  /* STABLE */
@@ -750,16 +753,16 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
750
753
  2
751
754
  /* CLASS */
752
755
  ),
753
- r(
756
+ s(
754
757
  "span",
755
758
  {
756
- class: z(le.value),
757
- onClick: i
759
+ class: C(le.value),
760
+ onClick: l
758
761
  },
759
762
  [
760
- m(o(N), null, {
763
+ m(a(N), null, {
761
764
  default: b(() => [
762
- m(o(tt))
765
+ m(a(tt))
763
766
  ]),
764
767
  _: 1
765
768
  /* STABLE */
@@ -773,75 +776,75 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
773
776
  /* STABLE_FRAGMENT */
774
777
  )),
775
778
  T(" ACTIONS "),
776
- r(
779
+ s(
777
780
  "div",
778
781
  {
779
- class: z([o(p).e("btn"), o(p).e("actions")])
782
+ class: C([a(v).e("btn"), a(v).e("actions")])
780
783
  },
781
784
  [
782
- r(
785
+ s(
783
786
  "div",
784
787
  {
785
- class: z(o(p).e("actions__inner"))
788
+ class: C(a(v).e("actions__inner"))
786
789
  },
787
790
  [
788
- m(o(N), {
789
- onClick: s[1] || (s[1] = (v) => a("zoomOut"))
791
+ m(a(N), {
792
+ onClick: i[1] || (i[1] = (u) => o("zoomOut"))
790
793
  }, {
791
794
  default: b(() => [
792
- m(o(lt))
795
+ m(a(lt))
793
796
  ]),
794
797
  _: 1
795
798
  /* STABLE */
796
799
  }),
797
- m(o(N), {
798
- onClick: s[2] || (s[2] = (v) => a("zoomIn"))
800
+ m(a(N), {
801
+ onClick: i[2] || (i[2] = (u) => o("zoomIn"))
799
802
  }, {
800
803
  default: b(() => [
801
- m(o(Me))
804
+ m(a(Me))
802
805
  ]),
803
806
  _: 1
804
807
  /* STABLE */
805
808
  }),
806
- r(
809
+ s(
807
810
  "i",
808
811
  {
809
- class: z(o(p).e("actions__divider"))
812
+ class: C(a(v).e("actions__divider"))
810
813
  },
811
814
  null,
812
815
  2
813
816
  /* CLASS */
814
817
  ),
815
- m(o(N), { onClick: G }, {
818
+ m(a(N), { onClick: _ }, {
816
819
  default: b(() => [
817
- (h(), _(_e(M.value.icon)))
820
+ (p(), j(_e(I.value.icon)))
818
821
  ]),
819
822
  _: 1
820
823
  /* STABLE */
821
824
  }),
822
- r(
825
+ s(
823
826
  "i",
824
827
  {
825
- class: z(o(p).e("actions__divider"))
828
+ class: C(a(v).e("actions__divider"))
826
829
  },
827
830
  null,
828
831
  2
829
832
  /* CLASS */
830
833
  ),
831
- m(o(N), {
832
- onClick: s[3] || (s[3] = (v) => a("anticlockwise"))
834
+ m(a(N), {
835
+ onClick: i[3] || (i[3] = (u) => o("anticlockwise"))
833
836
  }, {
834
837
  default: b(() => [
835
- m(o(nt))
838
+ m(a(nt))
836
839
  ]),
837
840
  _: 1
838
841
  /* STABLE */
839
842
  }),
840
- m(o(N), {
841
- onClick: s[4] || (s[4] = (v) => a("clockwise"))
843
+ m(a(N), {
844
+ onClick: i[4] || (i[4] = (u) => o("clockwise"))
842
845
  }, {
843
846
  default: b(() => [
844
- m(o(ot))
847
+ m(a(ot))
845
848
  ]),
846
849
  _: 1
847
850
  /* STABLE */
@@ -855,28 +858,28 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
855
858
  /* CLASS */
856
859
  ),
857
860
  T(" CANVAS "),
858
- r(
861
+ s(
859
862
  "div",
860
863
  {
861
- class: z(o(p).e("canvas"))
864
+ class: C(a(v).e("canvas"))
862
865
  },
863
866
  [
864
- (h(!0), C(
865
- Y,
867
+ (p(!0), z(
868
+ X,
866
869
  null,
867
- Le(n.urlList, (v, I) => me((h(), C("img", {
870
+ Le(e.urlList, (u, x) => me((p(), z("img", {
868
871
  ref_for: !0,
869
- ref: (B) => S.value[I] = B,
870
- key: v,
871
- src: v,
872
- style: j(ne.value),
873
- class: z(o(p).e("img")),
874
- crossorigin: n.crossorigin,
872
+ ref: (L) => M.value[x] = L,
873
+ key: u,
874
+ src: u,
875
+ style: U(ne.value),
876
+ class: C(a(v).e("img")),
877
+ crossorigin: e.crossorigin,
875
878
  onLoad: ie,
876
879
  onError: se,
877
880
  onMousedown: re
878
- }, null, 46, Ct)), [
879
- [ve, I === x.value]
881
+ }, null, 46, zt)), [
882
+ [ve, x === y.value]
880
883
  ])),
881
884
  128
882
885
  /* KEYED_FRAGMENT */
@@ -885,7 +888,7 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
885
888
  2
886
889
  /* CLASS */
887
890
  ),
888
- Se(n.$slots, "default")
891
+ Se(e.$slots, "default")
889
892
  ],
890
893
  6
891
894
  /* CLASS, STYLE */
@@ -896,10 +899,10 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
896
899
  })
897
900
  ]));
898
901
  }
899
- }), It = he(zt), $t = {
902
+ }), It = he(Ct), $t = {
900
903
  key: 1,
901
904
  class: "upload-btn"
902
- }, Lt = { class: "tip" }, St = { class: "loading-statu" }, Mt = { class: "operate-btn" }, Nt = { key: 0 }, Ot = { class: "el-upload-list el-upload-list--picture-card" }, Tt = ["onClick"], Bt = ["src"], Et = { class: "demo-image__preview" }, At = /* @__PURE__ */ pe({
905
+ }, Lt = { class: "tip" }, St = { class: "loading-statu" }, Mt = { class: "operate-btn" }, Nt = { key: 0 }, Ot = { class: "el-upload-list el-upload-list--picture-card" }, Tt = ["onClick"], Bt = ["src"], At = { class: "demo-image__preview" }, Et = /* @__PURE__ */ pe({
903
906
  __name: "index",
904
907
  props: /* @__PURE__ */ we({
905
908
  // 显示的文字
@@ -993,149 +996,149 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
993
996
  modelModifiers: {}
994
997
  }),
995
998
  emits: /* @__PURE__ */ we(["delete", "success", "change"], ["update:modelValue"]),
996
- setup(l, { emit: w }) {
997
- De((t) => ({
998
- v271aea84: A.value,
999
- bb1927ae: R.value,
1000
- v0caeb74a: P.value,
1001
- v78ba4642: G.value
999
+ setup(n, { emit: w }) {
1000
+ De((l) => ({
1001
+ v591391f3: E.value,
1002
+ a0e09acc: M.value,
1003
+ v5a89de3b: J.value,
1004
+ v4354059e: V.value
1002
1005
  }));
1003
- const e = l, d = Fe(l, "modelValue"), { formItem: k } = Ze(), f = (t) => Array.isArray(t) ? t.map((i) => {
1004
- var s, v;
1005
- const a = ((s = i.url) == null ? void 0 : s.startsWith("http")) || ((v = i.url) == null ? void 0 : v.startsWith("blob")), n = (i == null ? void 0 : i.url) || i;
1006
+ const t = n, r = Fe(n, "modelValue"), { formItem: g } = Ze(), c = (l) => Array.isArray(l) ? l.map((o) => {
1007
+ var u, x;
1008
+ const e = ((u = o.url) == null ? void 0 : u.startsWith("http")) || ((x = o.url) == null ? void 0 : x.startsWith("blob")), i = (o == null ? void 0 : o.url) || o;
1006
1009
  return {
1007
- ...i.url ? i : { url: n },
1008
- __url: a ? n : `${L.value}${n}`
1010
+ ...o.url ? o : { url: i },
1011
+ __url: e ? i : `${S.value}${i}`
1009
1012
  };
1010
- }) : t ? [
1013
+ }) : l ? [
1011
1014
  {
1012
- url: t,
1013
- __url: t != null && t.startsWith("http") || t != null && t.startsWith("blob") ? t : `${L.value}${t}`
1015
+ url: l,
1016
+ __url: l != null && l.startsWith("http") || l != null && l.startsWith("blob") ? l : `${S.value}${l}`
1014
1017
  }
1015
1018
  ] : [];
1016
1019
  fe(
1017
- () => d.value,
1018
- (t) => {
1019
- !t || !t.length ? u.value = [] : u.value = K.cloneDeep(f(t)), k == null || k.validate("change");
1020
+ () => r.value,
1021
+ (l) => {
1022
+ !l || !l.length ? y.value = [] : y.value = q.cloneDeep(c(l)), g == null || g.validate("change");
1020
1023
  },
1021
1024
  { deep: !0 }
1022
1025
  );
1023
- const $ = w, { cLoadUrl: L, cUploadUrl: p } = ft(e), A = g(() => `${e.width}px`), R = g(() => `${e.height}px`), S = g(() => e.size), c = O(null), u = O(f(d.value)), x = O([]), M = O(!1), y = O(0), q = g(
1024
- () => e.tipText || `最多可上传${e.limit}张图片, 每张图片不能超过${e.size}MB`
1025
- ), Q = (t, i) => {
1026
- $("change", t);
1027
- }, H = (t) => {
1028
- if (!t.type.includes("image")) {
1026
+ const $ = w, { cLoadUrl: S, cUploadUrl: v, cHeaders: A } = ft(t), E = h(() => `${t.width}px`), M = h(() => `${t.height}px`), f = h(() => t.size), d = O(null), y = O(c(r.value)), I = O([]), k = O(!1), Y = O(0), Q = h(
1027
+ () => t.tipText || `最多可上传${t.limit}张图片, 每张图片不能超过${t.size}MB`
1028
+ ), H = (l, o) => {
1029
+ $("change", l);
1030
+ }, Z = (l) => {
1031
+ if (!l.type.includes("image")) {
1029
1032
  xe.warning("只允许上传图片!");
1030
1033
  try {
1031
- u.value.pop();
1034
+ y.value.pop();
1032
1035
  } catch {
1033
1036
  }
1034
1037
  return !1;
1035
1038
  }
1036
- if (!(t.size / 1024 / 1024 < S.value)) {
1037
- xe.warning(`图片大小超出系统限制的${e.size}MB!`);
1039
+ if (!(l.size / 1024 / 1024 < f.value)) {
1040
+ xe.warning(`图片大小超出系统限制的${t.size}MB!`);
1038
1041
  try {
1039
- u.value.pop();
1042
+ y.value.pop();
1040
1043
  } catch {
1041
1044
  }
1042
1045
  return !1;
1043
1046
  }
1044
1047
  return !0;
1045
- }, Z = () => !1, ee = (t, i) => {
1046
- var a, n;
1047
- t.status = "ready", i !== void 0 && x.value.splice(i, 1), (a = c.value) == null || a.handleStart(t.raw), (n = c.value) == null || n.submit();
1048
- }, te = (t, i) => {
1049
- var v, I;
1050
- const a = d.value.length, n = e.limit - a;
1051
- let s = 0;
1052
- for (; s < n && s < (t == null ? void 0 : t.length); )
1053
- (v = c.value) == null || v.handleStart(t == null ? void 0 : t[s]), (I = c.value) == null || I.submit(), s++;
1054
- }, le = (t, i, a) => {
1055
- $("success", t, i, a), d.value = u.value, k == null || k.validate("change");
1056
- }, ne = (t, i, a) => {
1057
- x.value.push({
1058
- ...i,
1059
- __url: i.url
1048
+ }, ee = () => !1, te = (l, o) => {
1049
+ var e, i;
1050
+ l.status = "ready", o !== void 0 && I.value.splice(o, 1), (e = d.value) == null || e.handleStart(l.raw), (i = d.value) == null || i.submit();
1051
+ }, le = (l, o) => {
1052
+ var x, L;
1053
+ const e = r.value.length, i = t.limit - e;
1054
+ let u = 0;
1055
+ for (; u < i && u < (l == null ? void 0 : l.length); )
1056
+ (x = d.value) == null || x.handleStart(l == null ? void 0 : l[u]), (L = d.value) == null || L.submit(), u++;
1057
+ }, ne = (l, o, e) => {
1058
+ $("success", l, o, e), r.value = y.value, g == null || g.validate("change");
1059
+ }, F = (l, o, e) => {
1060
+ I.value.push({
1061
+ ...o,
1062
+ __url: o.url
1060
1063
  });
1061
- }, V = (t) => {
1062
- var i;
1063
- M.value = !0, y.value = Array.isArray(d == null ? void 0 : d.value) ? (i = d == null ? void 0 : d.value) == null ? void 0 : i.findIndex((a) => a.url === t.url) : 0;
1064
- }, oe = (t) => {
1065
- st.downloadFile(t.__url || t.url, t.name || t.url);
1066
- }, ae = (t) => {
1067
- var i;
1068
- (i = c.value) == null || i.abort(t);
1069
- }, ie = (t) => {
1070
- var i;
1071
- t.status !== "success" && ae(t), d.value = (i = u.value) == null ? void 0 : i.filter((a) => a.uid !== t.uid), $("delete", t);
1072
- }, se = (t, i) => {
1073
- x.value.splice(i, 1);
1074
- }, re = g(() => u.value.length + x.value.length < e.limit), D = g(
1075
- () => d.value.length >= e.limit || e.disabled
1076
- ), G = g(() => {
1077
- var t;
1078
- return !((t = d.value) != null && t.length) && !x.value.length || e.limit === 1 || typeof d.value == "string" ? "0" : `${e.width + 8}px`;
1079
- }), P = g(() => {
1080
- var t;
1081
- return !((t = d.value) != null && t.length) && !x.value.length && typeof d.value != "string" || e.limit === 1 ? "none" : "absolute";
1064
+ }, oe = (l) => {
1065
+ var o;
1066
+ k.value = !0, Y.value = Array.isArray(r == null ? void 0 : r.value) ? (o = r == null ? void 0 : r.value) == null ? void 0 : o.findIndex((e) => e.url === l.url) : 0;
1067
+ }, ae = (l) => {
1068
+ st.downloadFile(l.__url || l.url, l.name || l.url);
1069
+ }, ie = (l) => {
1070
+ var o;
1071
+ (o = d.value) == null || o.abort(l);
1072
+ }, se = (l) => {
1073
+ var o;
1074
+ l.status !== "success" && ie(l), r.value = (o = y.value) == null ? void 0 : o.filter((e) => e.uid !== l.uid), $("delete", l);
1075
+ }, re = (l, o) => {
1076
+ I.value.splice(o, 1);
1077
+ }, G = h(() => y.value.length + I.value.length < t.limit), _ = h(
1078
+ () => r.value.length >= t.limit || t.disabled
1079
+ ), V = h(() => {
1080
+ var l;
1081
+ return !((l = r.value) != null && l.length) && !I.value.length || t.limit === 1 || typeof r.value == "string" ? "0" : `${t.width + 8}px`;
1082
+ }), J = h(() => {
1083
+ var l;
1084
+ return !((l = r.value) != null && l.length) && !I.value.length && typeof r.value != "string" || t.limit === 1 ? "none" : "absolute";
1082
1085
  });
1083
- return (t, i) => (h(), C(
1084
- Y,
1086
+ return (l, o) => (p(), z(
1087
+ X,
1085
1088
  null,
1086
1089
  [
1087
- m(o(Ge), Ve({
1088
- class: ["ik-image-upload", { preview: l.preview, "hide-upload": !re.value && l.limit === 1, disabled: D.value }],
1090
+ m(a(Ge), Ve({
1091
+ class: ["ik-image-upload", { preview: n.preview, "hide-upload": !G.value && n.limit === 1, disabled: _.value }],
1089
1092
  ref_key: "refUpload",
1090
- ref: c,
1093
+ ref: d,
1091
1094
  "list-type": "picture-card",
1092
- accept: l.accept,
1093
- action: o(p),
1094
- headers: l.headers,
1095
- data: l.data,
1096
- "file-list": u.value,
1097
- "onUpdate:fileList": i[0] || (i[0] = (a) => u.value = a),
1098
- multiple: l.multiple,
1099
- limit: l.limit,
1100
- "on-change": Q,
1101
- "before-upload": H,
1102
- "before-remove": Z,
1103
- "on-exceed": te,
1104
- "on-success": le,
1105
- "on-error": ne,
1095
+ accept: n.accept,
1096
+ action: a(v),
1097
+ headers: n.headers || a(A),
1098
+ data: n.data,
1099
+ "file-list": y.value,
1100
+ "onUpdate:fileList": o[0] || (o[0] = (e) => y.value = e),
1101
+ multiple: n.multiple,
1102
+ limit: n.limit,
1103
+ "on-change": H,
1104
+ "before-upload": Z,
1105
+ "before-remove": ee,
1106
+ "on-exceed": le,
1107
+ "on-success": ne,
1108
+ "on-error": F,
1106
1109
  drag: ""
1107
- }, t.$attrs, { disabled: D.value }), Pe({
1110
+ }, l.$attrs, { disabled: _.value }), Pe({
1108
1111
  trigger: b(() => [
1109
- t.$slots.trigger ? Se(t.$slots, "trigger", { key: 0 }, void 0, !0) : (h(), C("div", $t, [
1110
- m(o(de), {
1112
+ l.$slots.trigger ? Se(l.$slots, "trigger", { key: 0 }, void 0, !0) : (p(), z("div", $t, [
1113
+ m(a(de), {
1111
1114
  size: 20,
1112
1115
  name: "iksvg_guanbibeifen",
1113
- disabled: D.value
1116
+ disabled: _.value
1114
1117
  }, null, 8, ["disabled"]),
1115
- r(
1118
+ s(
1116
1119
  "span",
1117
1120
  null,
1118
- ue(l.title),
1121
+ ue(n.title),
1119
1122
  1
1120
1123
  /* TEXT */
1121
1124
  )
1122
1125
  ]))
1123
1126
  ]),
1124
- file: b(({ file: a, index: n }) => [
1125
- r(
1127
+ file: b(({ file: e, index: i }) => [
1128
+ s(
1126
1129
  "div",
1127
1130
  {
1128
- class: z(["load-list", { loading: a.status === "uploading" }]),
1131
+ class: C(["load-list", { loading: e.status === "uploading" }]),
1129
1132
  "element-loading-background": "var(--ik-upload-bg)"
1130
1133
  },
1131
1134
  [
1132
- me(r(
1135
+ me(s(
1133
1136
  "div",
1134
1137
  St,
1135
1138
  [
1136
1139
  m(dt),
1137
1140
  We(
1138
- " 上传" + ue(a.percentage) + "% ",
1141
+ " 上传" + ue(e.percentage) + "% ",
1139
1142
  1
1140
1143
  /* TEXT */
1141
1144
  )
@@ -1143,46 +1146,46 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
1143
1146
  512
1144
1147
  /* NEED_PATCH */
1145
1148
  ), [
1146
- [ve, a.status === "uploading"]
1149
+ [ve, e.status === "uploading"]
1147
1150
  ]),
1148
1151
  T(` <img :src="file.url" alt="" :style="{ 'object-fit': fit }" /> `),
1149
- m(o(Je), {
1152
+ m(a(Je), {
1150
1153
  style: { width: "100%", height: "100%" },
1151
- src: a.__url || a.url,
1154
+ src: e.__url || e.url,
1152
1155
  "zoom-rate": 1.2,
1153
1156
  "initial-index": 0,
1154
1157
  fit: "contain"
1155
1158
  }, null, 8, ["src"]),
1156
- r("span", Mt, [
1157
- r("span", null, [
1158
- m(o(N), {
1159
- onClick: (s) => V(a)
1159
+ s("span", Mt, [
1160
+ s("span", null, [
1161
+ m(a(N), {
1162
+ onClick: (u) => oe(e)
1160
1163
  }, {
1161
1164
  default: b(() => [
1162
- m(o(Me))
1165
+ m(a(Me))
1163
1166
  ]),
1164
1167
  _: 1
1165
1168
  /* STABLE */
1166
1169
  }, 8, ["onClick"])
1167
1170
  ]),
1168
- r("span", null, [
1169
- m(o(N), {
1170
- onClick: (s) => oe(a)
1171
+ s("span", null, [
1172
+ m(a(N), {
1173
+ onClick: (u) => ae(e)
1171
1174
  }, {
1172
1175
  default: b(() => [
1173
- m(o(at))
1176
+ m(a(at))
1174
1177
  ]),
1175
1178
  _: 1
1176
1179
  /* STABLE */
1177
1180
  }, 8, ["onClick"])
1178
1181
  ]),
1179
- l.preview ? T("v-if", !0) : (h(), C("span", Nt, [
1180
- m(o(N), {
1182
+ n.preview ? T("v-if", !0) : (p(), z("span", Nt, [
1183
+ m(a(N), {
1181
1184
  type: "warning",
1182
- onClick: (s) => ie(a)
1185
+ onClick: (u) => se(e)
1183
1186
  }, {
1184
1187
  default: b(() => [
1185
- m(o(it))
1188
+ m(a(it))
1186
1189
  ]),
1187
1190
  _: 1
1188
1191
  /* STABLE */
@@ -1195,47 +1198,47 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
1195
1198
  )
1196
1199
  ]),
1197
1200
  default: b(() => [
1198
- r("ul", Ot, [
1199
- (h(!0), C(
1200
- Y,
1201
+ s("ul", Ot, [
1202
+ (p(!0), z(
1203
+ X,
1201
1204
  null,
1202
- Le(x.value, (a, n) => (h(), C("li", {
1205
+ Le(I.value, (e, i) => (p(), z("li", {
1203
1206
  class: "el-upload-list__item",
1204
- key: a.uid
1207
+ key: e.uid
1205
1208
  }, [
1206
- r("span", null, [
1207
- m(o(de), {
1209
+ s("span", null, [
1210
+ m(a(de), {
1208
1211
  name: "iksvg_guanbi",
1209
1212
  error: "",
1210
- onClick: (s) => se(a, n)
1213
+ onClick: (u) => re(e, i)
1211
1214
  }, null, 8, ["onClick"])
1212
1215
  ]),
1213
- r(
1216
+ s(
1214
1217
  "div",
1215
1218
  {
1216
- class: z(["load-list", {
1217
- loading: a.status === "uploading",
1218
- fail: a.status === "fail"
1219
+ class: C(["load-list", {
1220
+ loading: e.status === "uploading",
1221
+ fail: e.status === "fail"
1219
1222
  }]),
1220
1223
  "element-loading-background": "var(--ik-upload-bg)"
1221
1224
  },
1222
1225
  [
1223
- me(r("div", {
1226
+ me(s("div", {
1224
1227
  class: "loading-statu",
1225
- onClick: (s) => ee(a, n)
1228
+ onClick: (u) => te(e, i)
1226
1229
  }, [
1227
- m(o(de), {
1230
+ m(a(de), {
1228
1231
  name: "iksvg_shuaxin-daohang",
1229
1232
  size: 24
1230
1233
  }),
1231
- i[2] || (i[2] = r(
1234
+ o[2] || (o[2] = s(
1232
1235
  "span",
1233
1236
  { class: "error" },
1234
1237
  "上传错误",
1235
1238
  -1
1236
1239
  /* CACHED */
1237
1240
  )),
1238
- i[3] || (i[3] = r(
1241
+ o[3] || (o[3] = s(
1239
1242
  "p",
1240
1243
  null,
1241
1244
  "点击重新上传",
@@ -1243,12 +1246,12 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
1243
1246
  /* CACHED */
1244
1247
  ))
1245
1248
  ], 8, Tt), [
1246
- [ve, a.status === "fail"]
1249
+ [ve, e.status === "fail"]
1247
1250
  ]),
1248
- r("img", {
1249
- src: a.__url,
1251
+ s("img", {
1252
+ src: e.__url,
1250
1253
  alt: "",
1251
- style: j({ "object-fit": l.fit })
1254
+ style: U({ "object-fit": n.fit })
1252
1255
  }, null, 12, Bt)
1253
1256
  ],
1254
1257
  2
@@ -1263,13 +1266,13 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
1263
1266
  _: 2
1264
1267
  /* DYNAMIC */
1265
1268
  }, [
1266
- l.tip ? {
1269
+ n.tip ? {
1267
1270
  name: "tip",
1268
1271
  fn: b(() => [
1269
- r(
1272
+ s(
1270
1273
  "span",
1271
1274
  Lt,
1272
- ue(q.value),
1275
+ ue(Q.value),
1273
1276
  1
1274
1277
  /* TEXT */
1275
1278
  )
@@ -1278,16 +1281,16 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
1278
1281
  } : void 0
1279
1282
  ]), 1040, ["class", "accept", "action", "headers", "data", "file-list", "multiple", "limit", "disabled"]),
1280
1283
  T(" 文件预览 "),
1281
- r("div", Et, [
1282
- M.value ? (h(), _(o(It), {
1284
+ s("div", At, [
1285
+ k.value ? (p(), j(a(It), {
1283
1286
  key: 0,
1284
1287
  "lock-scroll": "",
1285
1288
  "hide-on-click-modal": "",
1286
- onClose: i[1] || (i[1] = () => {
1287
- M.value = !1;
1289
+ onClose: o[1] || (o[1] = () => {
1290
+ k.value = !1;
1288
1291
  }),
1289
- "url-list": f(u.value).map((a) => a.__url),
1290
- "initial-index": y.value
1292
+ "url-list": c(y.value).map((e) => e.__url),
1293
+ "initial-index": Y.value
1291
1294
  }, null, 8, ["url-list", "initial-index"])) : T("v-if", !0)
1292
1295
  ])
1293
1296
  ],
@@ -1295,7 +1298,7 @@ const dt = /* @__PURE__ */ ge(rt, [["render", ut]]), $e = [
1295
1298
  /* STABLE_FRAGMENT */
1296
1299
  ));
1297
1300
  }
1298
- }), Rt = /* @__PURE__ */ ge(At, [["__scopeId", "data-v-4d36d1f1"]]), Wt = he(Rt);
1301
+ }), Rt = /* @__PURE__ */ ge(Et, [["__scopeId", "data-v-149ef234"]]), Wt = he(Rt);
1299
1302
  export {
1300
1303
  Wt as IkUploadImage,
1301
1304
  Wt as default