@das-fed/ui 7.0.7-hot.21 → 7.0.7-hot.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/package.json +5 -5
  2. package/packages/business-components/ai-panel/{index-8yffh0Id.js → index-DMJXZM7n.js} +1067 -1056
  3. package/packages/business-components/ai-panel/index-DMJXZM7n.js.gz +0 -0
  4. package/packages/business-components/ai-panel/{index-IzGl26KU.js → index-MqhMkLo9.js} +9 -9
  5. package/packages/business-components/ai-panel/index-MqhMkLo9.js.gz +0 -0
  6. package/packages/business-components/ai-panel/{index-OwRrV6K8.js → index-_q72oKSF.js} +63 -62
  7. package/packages/business-components/ai-panel/index-_q72oKSF.js.gz +0 -0
  8. package/packages/business-components/ai-panel/index.js +1 -1
  9. package/packages/business-components/device-panel/index.js +14908 -14808
  10. package/packages/business-components/device-panel/index.js.gz +0 -0
  11. package/packages/business-components/echarts/index.js +2056 -2049
  12. package/packages/business-components/echarts/index.js.gz +0 -0
  13. package/packages/business-components/process-configuration/index.js +46 -46
  14. package/packages/business-components/process-configuration/index.js.gz +0 -0
  15. package/packages/business-components/process-form/index.js +99 -99
  16. package/packages/business-components/process-form/index.js.gz +0 -0
  17. package/packages/business-components/process-search-form/index.js +77 -77
  18. package/packages/business-components/process-search-form/index.js.gz +0 -0
  19. package/packages/business-components/process-table/index.js +215 -213
  20. package/packages/business-components/process-table/index.js.gz +0 -0
  21. package/packages/business-components/urgent-panel/index.js +1104 -1096
  22. package/packages/business-components/urgent-panel/index.js.gz +0 -0
  23. package/packages/business-components/user-org-dialog/index.js +243 -240
  24. package/packages/business-components/user-org-dialog/index.js.gz +0 -0
  25. package/packages/business-components/video-dialog/index.js +65 -64
  26. package/packages/business-components/video-dialog/index.js.gz +0 -0
  27. package/packages/components/autocomplete/index.js +12 -6
  28. package/packages/components/autocomplete/index.js.gz +0 -0
  29. package/packages/components/calendar/index.js +99 -99
  30. package/packages/components/calendar/index.js.gz +0 -0
  31. package/packages/components/cascader/index.js +2 -2
  32. package/packages/components/cascader/index.js.gz +0 -0
  33. package/packages/components/checkbox/index.js +30 -30
  34. package/packages/components/checkbox/index.js.gz +0 -0
  35. package/packages/components/date-picker/index.js +212 -212
  36. package/packages/components/date-picker/index.js.gz +0 -0
  37. package/packages/components/dimple-layout/index.js +77 -75
  38. package/packages/components/dimple-layout/index.js.gz +0 -0
  39. package/packages/components/dropdown/index.js +25 -24
  40. package/packages/components/dropdown/index.js.gz +0 -0
  41. package/packages/components/edit-table/index.js +398 -397
  42. package/packages/components/edit-table/index.js.gz +0 -0
  43. package/packages/components/error-overlay-model/index.js +47 -45
  44. package/packages/components/error-overlay-model/index.js.gz +0 -0
  45. package/packages/components/form-item/index.js +67 -67
  46. package/packages/components/form-item/index.js.gz +0 -0
  47. package/packages/components/hls-player/index.js +14 -7
  48. package/packages/components/hls-player/index.js.gz +0 -0
  49. package/packages/components/image-upload/index.js +147 -143
  50. package/packages/components/image-upload/index.js.gz +0 -0
  51. package/packages/components/image-viewer/index.js +297 -293
  52. package/packages/components/image-viewer/index.js.gz +0 -0
  53. package/packages/components/input/index.js +52 -52
  54. package/packages/components/input/index.js.gz +0 -0
  55. package/packages/components/input-number/index.js +26 -26
  56. package/packages/components/input-number/index.js.gz +0 -0
  57. package/packages/components/live-player/index.js +251 -248
  58. package/packages/components/live-player/index.js.gz +0 -0
  59. package/packages/components/map/index.js +421 -415
  60. package/packages/components/map/index.js.gz +0 -0
  61. package/packages/components/menu-aside/index.js +1 -1
  62. package/packages/components/menu-aside/index.js.gz +0 -0
  63. package/packages/components/message/index.js +6 -6
  64. package/packages/components/message/index.js.gz +0 -0
  65. package/packages/components/popover/index.js +12 -12
  66. package/packages/components/popover/index.js.gz +0 -0
  67. package/packages/components/radio-tabs/index.js +34 -34
  68. package/packages/components/radio-tabs/index.js.gz +0 -0
  69. package/packages/components/rich-editor/index.js +4613 -4583
  70. package/packages/components/rich-editor/index.js.gz +0 -0
  71. package/packages/components/scrollbar/index.js +135 -135
  72. package/packages/components/scrollbar/index.js.gz +0 -0
  73. package/packages/components/search/index.js +24 -24
  74. package/packages/components/search/index.js.gz +0 -0
  75. package/packages/components/select/index.js +60 -60
  76. package/packages/components/select/index.js.gz +0 -0
  77. package/packages/components/select-list/index.js +9 -5
  78. package/packages/components/select-list/index.js.gz +0 -0
  79. package/packages/components/special-range-picker-month/index.js +16 -14
  80. package/packages/components/special-range-picker-month/index.js.gz +0 -0
  81. package/packages/components/special-range-picker-year/index.js +53 -51
  82. package/packages/components/special-range-picker-year/index.js.gz +0 -0
  83. package/packages/components/spin/index.js +33 -33
  84. package/packages/components/spin/index.js.gz +0 -0
  85. package/packages/components/split-panel/index.js +129 -128
  86. package/packages/components/split-panel/index.js.gz +0 -0
  87. package/packages/components/table/index.js +179 -178
  88. package/packages/components/table/index.js.gz +0 -0
  89. package/packages/components/time-line/index.js +1 -1
  90. package/packages/components/time-line/index.js.gz +0 -0
  91. package/packages/components/tree-select/index.js +1 -1
  92. package/packages/components/tree-select/index.js.gz +0 -0
  93. package/packages/components/tree-table/index.js +2 -2
  94. package/packages/components/tree-table/index.js.gz +0 -0
  95. package/packages/components/tree-v2/index.js +1117 -1093
  96. package/packages/components/tree-v2/index.js.gz +0 -0
  97. package/packages/business-components/ai-panel/index-8yffh0Id.js.gz +0 -0
  98. package/packages/business-components/ai-panel/index-IzGl26KU.js.gz +0 -0
  99. package/packages/business-components/ai-panel/index-OwRrV6K8.js.gz +0 -0
@@ -2,10 +2,10 @@ import '@das-fed/ui/packages/components/image-upload/style.css';
2
2
  import { withInstall as Ie } from "@das-fed/utils/with-install/index";
3
3
  import { currentLang as ge, i18n as ve, t as G, setI18nRule as Pe } from "@das-fed/web/packages/i18n/index";
4
4
  import { getVar as L, setThemeRule as Se } from "@das-fed/web/packages/theme/index";
5
- import { computed as X, defineComponent as je, createElementBlock as Le, openBlock as _e, createCommentVNode as ye, withDirectives as K, createVNode as O, unref as v, normalizeClass as Ne, withCtx as R, createElementVNode as z, toDisplayString as Y, vShow as q, createTextVNode as We } from "vue";
6
- import { UploadDragger as He, Upload as Ve } from "ant-design-vue";
5
+ import { computed as X, defineComponent as je, createElementBlock as Le, openBlock as _e, createCommentVNode as ye, withDirectives as K, createVNode as M, unref as v, normalizeClass as Ne, withCtx as O, createElementVNode as z, toDisplayString as Y, vShow as q, createTextVNode as We } from "vue";
6
+ import { UploadDragger as He, Upload as $e } from "ant-design-vue";
7
7
  import "ant-design-vue/es/upload/style/css";
8
- import { DasSpin as $e } from "@das-fed/ui/packages/components/spin/index";
8
+ import { DasSpin as Ve } from "@das-fed/ui/packages/components/spin/index";
9
9
  import { DasButton as Ge } from "@das-fed/ui/packages/components/button/index";
10
10
  import { DasIconAddto as Xe } from "@das-fed/ui/packages/icons/addto/index";
11
11
  import { DasIconWarning as Ke } from "@das-fed/ui/packages/icons/warning/index";
@@ -15,12 +15,12 @@ import { useModelValue as we } from "@das-fed/utils/vue";
15
15
  import "@das-fed/ui/packages/global/theme";
16
16
  const qe = () => ({ size2B: (e) => {
17
17
  isNaN(Number(e)) ? e = e.toString() : e = e + "M";
18
- const a = Number(e.slice(0, -1)), r = e[e.length - 1].toUpperCase(), i = 1024, o = {
19
- M: i * i,
20
- K: i,
18
+ const a = Number(e.slice(0, -1)), i = e[e.length - 1].toUpperCase(), r = 1024, o = {
19
+ M: r * r,
20
+ K: r,
21
21
  B: 1
22
22
  };
23
- return { finalSize: a * o[r], sizeText: e };
23
+ return { finalSize: a * o[i], sizeText: e };
24
24
  } });
25
25
  /*!
26
26
  * Compressor.js v1.2.1
@@ -34,20 +34,20 @@ const qe = () => ({ size2B: (e) => {
34
34
  function xe(t, e) {
35
35
  var a = Object.keys(t);
36
36
  if (Object.getOwnPropertySymbols) {
37
- var r = Object.getOwnPropertySymbols(t);
38
- e && (r = r.filter(function(i) {
39
- return Object.getOwnPropertyDescriptor(t, i).enumerable;
40
- })), a.push.apply(a, r);
37
+ var i = Object.getOwnPropertySymbols(t);
38
+ e && (i = i.filter(function(r) {
39
+ return Object.getOwnPropertyDescriptor(t, r).enumerable;
40
+ })), a.push.apply(a, i);
41
41
  }
42
42
  return a;
43
43
  }
44
44
  function j(t) {
45
45
  for (var e = 1; e < arguments.length; e++) {
46
46
  var a = arguments[e] != null ? arguments[e] : {};
47
- e % 2 ? xe(Object(a), !0).forEach(function(r) {
48
- Ze(t, r, a[r]);
49
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(a)) : xe(Object(a)).forEach(function(r) {
50
- Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(a, r));
47
+ e % 2 ? xe(Object(a), !0).forEach(function(i) {
48
+ Ze(t, i, a[i]);
49
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(a)) : xe(Object(a)).forEach(function(i) {
50
+ Object.defineProperty(t, i, Object.getOwnPropertyDescriptor(a, i));
51
51
  });
52
52
  }
53
53
  return t;
@@ -58,8 +58,8 @@ function Je(t, e) {
58
58
  }
59
59
  function Ce(t, e) {
60
60
  for (var a = 0; a < e.length; a++) {
61
- var r = e[a];
62
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, De(r.key), r);
61
+ var i = e[a];
62
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, De(i.key), i);
63
63
  }
64
64
  }
65
65
  function Qe(t, e, a) {
@@ -79,8 +79,8 @@ function _() {
79
79
  return _ = Object.assign ? Object.assign.bind() : function(t) {
80
80
  for (var e = 1; e < arguments.length; e++) {
81
81
  var a = arguments[e];
82
- for (var r in a)
83
- Object.prototype.hasOwnProperty.call(a, r) && (t[r] = a[r]);
82
+ for (var i in a)
83
+ Object.prototype.hasOwnProperty.call(a, i) && (t[i] = a[i]);
84
84
  }
85
85
  return t;
86
86
  }, _.apply(this, arguments);
@@ -89,8 +89,8 @@ function et(t, e) {
89
89
  if (typeof t != "object" || t === null) return t;
90
90
  var a = t[Symbol.toPrimitive];
91
91
  if (a !== void 0) {
92
- var r = a.call(t, e);
93
- if (typeof r != "object") return r;
92
+ var i = a.call(t, e);
93
+ if (typeof i != "object") return i;
94
94
  throw new TypeError("@@toPrimitive must return a primitive value.");
95
95
  }
96
96
  return String(t);
@@ -102,25 +102,25 @@ function De(t) {
102
102
  var Te = { exports: {} };
103
103
  (function(t) {
104
104
  typeof window > "u" || function(e) {
105
- var a = e.HTMLCanvasElement && e.HTMLCanvasElement.prototype, r = e.Blob && function() {
105
+ var a = e.HTMLCanvasElement && e.HTMLCanvasElement.prototype, i = e.Blob && function() {
106
106
  try {
107
107
  return !!new Blob();
108
108
  } catch {
109
109
  return !1;
110
110
  }
111
- }(), i = r && e.Uint8Array && function() {
111
+ }(), r = i && e.Uint8Array && function() {
112
112
  try {
113
113
  return new Blob([new Uint8Array(100)]).size === 100;
114
114
  } catch {
115
115
  return !1;
116
116
  }
117
- }(), o = e.BlobBuilder || e.WebKitBlobBuilder || e.MozBlobBuilder || e.MSBlobBuilder, m = /^data:((.*?)(;charset=.*?)?)(;base64)?,/, n = (r || o) && e.atob && e.ArrayBuffer && e.Uint8Array && function(c) {
117
+ }(), o = e.BlobBuilder || e.WebKitBlobBuilder || e.MozBlobBuilder || e.MSBlobBuilder, m = /^data:((.*?)(;charset=.*?)?)(;base64)?,/, n = (i || o) && e.atob && e.ArrayBuffer && e.Uint8Array && function(c) {
118
118
  var u, f, s, h, p, l, w, g, y;
119
119
  if (u = c.match(m), !u)
120
120
  throw new Error("invalid data URI");
121
121
  for (f = u[2] ? u[1] : "text/plain" + (u[3] || ";charset=US-ASCII"), s = !!u[4], h = c.slice(u[0].length), s ? p = atob(h) : p = decodeURIComponent(h), l = new ArrayBuffer(p.length), w = new Uint8Array(l), g = 0; g < p.length; g += 1)
122
122
  w[g] = p.charCodeAt(g);
123
- return r ? new Blob([i ? w : l], {
123
+ return i ? new Blob([r ? w : l], {
124
124
  type: f
125
125
  }) : (y = new o(), y.append(l), y.getBlob(f));
126
126
  };
@@ -270,58 +270,58 @@ var Be = Te.exports, tt = function(e) {
270
270
  error: null
271
271
  }, at = typeof window < "u" && typeof window.document < "u", U = at ? window : {}, N = function(e) {
272
272
  return e > 0 && e < 1 / 0;
273
- }, rt = Array.prototype.slice;
273
+ }, it = Array.prototype.slice;
274
274
  function Z(t) {
275
- return Array.from ? Array.from(t) : rt.call(t);
275
+ return Array.from ? Array.from(t) : it.call(t);
276
276
  }
277
- var it = /^image\/.+$/;
277
+ var rt = /^image\/.+$/;
278
278
  function Q(t) {
279
- return it.test(t);
279
+ return rt.test(t);
280
280
  }
281
281
  function ot(t) {
282
282
  var e = Q(t) ? t.substr(6) : "";
283
283
  return e === "jpeg" && (e = "jpg"), ".".concat(e);
284
284
  }
285
- var Oe = String.fromCharCode;
285
+ var Me = String.fromCharCode;
286
286
  function nt(t, e, a) {
287
- var r = "", i;
288
- for (a += e, i = e; i < a; i += 1)
289
- r += Oe(t.getUint8(i));
290
- return r;
287
+ var i = "", r;
288
+ for (a += e, r = e; r < a; r += 1)
289
+ i += Me(t.getUint8(r));
290
+ return i;
291
291
  }
292
292
  var st = U.btoa;
293
293
  function ke(t, e) {
294
- for (var a = [], r = 8192, i = new Uint8Array(t); i.length > 0; )
295
- a.push(Oe.apply(null, Z(i.subarray(0, r)))), i = i.subarray(r);
294
+ for (var a = [], i = 8192, r = new Uint8Array(t); r.length > 0; )
295
+ a.push(Me.apply(null, Z(r.subarray(0, i)))), r = r.subarray(i);
296
296
  return "data:".concat(e, ";base64,").concat(st(a.join("")));
297
297
  }
298
298
  function lt(t) {
299
299
  var e = new DataView(t), a;
300
300
  try {
301
- var r, i, o;
301
+ var i, r, o;
302
302
  if (e.getUint8(0) === 255 && e.getUint8(1) === 216)
303
303
  for (var m = e.byteLength, n = 2; n + 1 < m; ) {
304
304
  if (e.getUint8(n) === 255 && e.getUint8(n + 1) === 225) {
305
- i = n;
305
+ r = n;
306
306
  break;
307
307
  }
308
308
  n += 1;
309
309
  }
310
- if (i) {
311
- var c = i + 4, u = i + 10;
310
+ if (r) {
311
+ var c = r + 4, u = r + 10;
312
312
  if (nt(e, c, 4) === "Exif") {
313
313
  var f = e.getUint16(u);
314
- if (r = f === 18761, (r || f === 19789) && e.getUint16(u + 2, r) === 42) {
315
- var s = e.getUint32(u + 4, r);
314
+ if (i = f === 18761, (i || f === 19789) && e.getUint16(u + 2, i) === 42) {
315
+ var s = e.getUint32(u + 4, i);
316
316
  s >= 8 && (o = u + s);
317
317
  }
318
318
  }
319
319
  }
320
320
  if (o) {
321
- var h = e.getUint16(o, r), p, l;
321
+ var h = e.getUint16(o, i), p, l;
322
322
  for (l = 0; l < h; l += 1)
323
- if (p = o + l * 12 + 2, e.getUint16(p, r) === 274) {
324
- p += 8, a = e.getUint16(p, r), e.setUint16(p, 1, r);
323
+ if (p = o + l * 12 + 2, e.getUint16(p, i) === 274) {
324
+ p += 8, a = e.getUint16(p, i), e.setUint16(p, 1, i);
325
325
  break;
326
326
  }
327
327
  }
@@ -331,7 +331,7 @@ function lt(t) {
331
331
  return a;
332
332
  }
333
333
  function ct(t) {
334
- var e = 0, a = 1, r = 1;
334
+ var e = 0, a = 1, i = 1;
335
335
  switch (t) {
336
336
  case 2:
337
337
  a = -1;
@@ -340,10 +340,10 @@ function ct(t) {
340
340
  e = -180;
341
341
  break;
342
342
  case 4:
343
- r = -1;
343
+ i = -1;
344
344
  break;
345
345
  case 5:
346
- e = 90, r = -1;
346
+ e = 90, i = -1;
347
347
  break;
348
348
  case 6:
349
349
  e = 90;
@@ -358,7 +358,7 @@ function ct(t) {
358
358
  return {
359
359
  rotate: e,
360
360
  scaleX: a,
361
- scaleY: r
361
+ scaleY: i
362
362
  };
363
363
  }
364
364
  var ut = /\.\d*(?:0|9){12}\d*$/;
@@ -367,29 +367,29 @@ function Ee(t) {
367
367
  return ut.test(t) ? Math.round(t * e) / e : t;
368
368
  }
369
369
  function I(t) {
370
- var e = t.aspectRatio, a = t.height, r = t.width, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "none", o = N(r), m = N(a);
370
+ var e = t.aspectRatio, a = t.height, i = t.width, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "none", o = N(i), m = N(a);
371
371
  if (o && m) {
372
372
  var n = a * e;
373
- (i === "contain" || i === "none") && n > r || i === "cover" && n < r ? a = r / e : r = a * e;
374
- } else o ? a = r / e : m && (r = a * e);
373
+ (r === "contain" || r === "none") && n > i || r === "cover" && n < i ? a = i / e : i = a * e;
374
+ } else o ? a = i / e : m && (i = a * e);
375
375
  return {
376
- width: r,
376
+ width: i,
377
377
  height: a
378
378
  };
379
379
  }
380
380
  function mt(t) {
381
- for (var e = Z(new Uint8Array(t)), a = e.length, r = [], i = 0; i + 3 < a; ) {
382
- var o = e[i], m = e[i + 1];
381
+ for (var e = Z(new Uint8Array(t)), a = e.length, i = [], r = 0; r + 3 < a; ) {
382
+ var o = e[r], m = e[r + 1];
383
383
  if (o === 255 && m === 218)
384
384
  break;
385
385
  if (o === 255 && m === 216)
386
- i += 2;
386
+ r += 2;
387
387
  else {
388
- var n = e[i + 2] * 256 + e[i + 3], c = i + n + 2, u = e.slice(i, c);
389
- r.push(u), i = c;
388
+ var n = e[r + 2] * 256 + e[r + 3], c = r + n + 2, u = e.slice(r, c);
389
+ i.push(u), r = c;
390
390
  }
391
391
  }
392
- return r.reduce(function(f, s) {
392
+ return i.reduce(function(f, s) {
393
393
  return s[0] === 255 && s[1] === 225 ? f.concat(s) : f;
394
394
  }, []);
395
395
  }
@@ -397,8 +397,8 @@ function ft(t, e) {
397
397
  var a = Z(new Uint8Array(t));
398
398
  if (a[2] !== 255 || a[3] !== 224)
399
399
  return t;
400
- var r = a[4] * 256 + a[5], i = [255, 216].concat(e, a.slice(4 + r));
401
- return new Uint8Array(i);
400
+ var i = a[4] * 256 + a[5], r = [255, 216].concat(e, a.slice(4 + i));
401
+ return new Uint8Array(r);
402
402
  }
403
403
  var dt = U.ArrayBuffer, J = U.FileReader, D = U.URL || U.webkitURL, pt = /\.\w+$/, ht = U.Compressor, gt = /* @__PURE__ */ function() {
404
404
  function t(e, a) {
@@ -407,12 +407,12 @@ var dt = U.ArrayBuffer, J = U.FileReader, D = U.URL || U.webkitURL, pt = /\.\w+$
407
407
  return Qe(t, [{
408
408
  key: "init",
409
409
  value: function() {
410
- var a = this, r = this.file, i = this.options;
411
- if (!tt(r)) {
410
+ var a = this, i = this.file, r = this.options;
411
+ if (!tt(i)) {
412
412
  this.fail(new Error("The first argument must be a File or Blob object."));
413
413
  return;
414
414
  }
415
- var o = r.type;
415
+ var o = i.type;
416
416
  if (!Q(o)) {
417
417
  this.fail(new Error("The first argument must be an image File or Blob object."));
418
418
  return;
@@ -421,45 +421,45 @@ var dt = U.ArrayBuffer, J = U.FileReader, D = U.URL || U.webkitURL, pt = /\.\w+$
421
421
  this.fail(new Error("The current browser does not support image compression."));
422
422
  return;
423
423
  }
424
- dt || (i.checkOrientation = !1, i.retainExif = !1);
425
- var m = o === "image/jpeg", n = m && i.checkOrientation, c = m && i.retainExif;
424
+ dt || (r.checkOrientation = !1, r.retainExif = !1);
425
+ var m = o === "image/jpeg", n = m && r.checkOrientation, c = m && r.retainExif;
426
426
  if (D && !n && !c)
427
427
  this.load({
428
- url: D.createObjectURL(r)
428
+ url: D.createObjectURL(i)
429
429
  });
430
430
  else {
431
431
  var u = new J();
432
432
  this.reader = u, u.onload = function(f) {
433
433
  var s = f.target, h = s.result, p = {}, l = 1;
434
- n && (l = lt(h), l > 1 && _(p, ct(l))), c && (a.exif = mt(h)), n || c ? !D || l > 1 ? p.url = ke(h, o) : p.url = D.createObjectURL(r) : p.url = h, a.load(p);
434
+ n && (l = lt(h), l > 1 && _(p, ct(l))), c && (a.exif = mt(h)), n || c ? !D || l > 1 ? p.url = ke(h, o) : p.url = D.createObjectURL(i) : p.url = h, a.load(p);
435
435
  }, u.onabort = function() {
436
436
  a.fail(new Error("Aborted to read the image with FileReader."));
437
437
  }, u.onerror = function() {
438
438
  a.fail(new Error("Failed to read the image with FileReader."));
439
439
  }, u.onloadend = function() {
440
440
  a.reader = null;
441
- }, n || c ? u.readAsArrayBuffer(r) : u.readAsDataURL(r);
441
+ }, n || c ? u.readAsArrayBuffer(i) : u.readAsDataURL(i);
442
442
  }
443
443
  }
444
444
  }, {
445
445
  key: "load",
446
446
  value: function(a) {
447
- var r = this, i = this.file, o = this.image;
447
+ var i = this, r = this.file, o = this.image;
448
448
  o.onload = function() {
449
- r.draw(j(j({}, a), {}, {
449
+ i.draw(j(j({}, a), {}, {
450
450
  naturalWidth: o.naturalWidth,
451
451
  naturalHeight: o.naturalHeight
452
452
  }));
453
453
  }, o.onabort = function() {
454
- r.fail(new Error("Aborted to load the image."));
454
+ i.fail(new Error("Aborted to load the image."));
455
455
  }, o.onerror = function() {
456
- r.fail(new Error("Failed to load the image."));
457
- }, U.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(U.navigator.userAgent) && (o.crossOrigin = "anonymous"), o.alt = i.name, o.src = a.url;
456
+ i.fail(new Error("Failed to load the image."));
457
+ }, U.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(U.navigator.userAgent) && (o.crossOrigin = "anonymous"), o.alt = r.name, o.src = a.url;
458
458
  }
459
459
  }, {
460
460
  key: "draw",
461
461
  value: function(a) {
462
- var r = this, i = a.naturalWidth, o = a.naturalHeight, m = a.rotate, n = m === void 0 ? 0 : m, c = a.scaleX, u = c === void 0 ? 1 : c, f = a.scaleY, s = f === void 0 ? 1 : f, h = this.file, p = this.image, l = this.options, w = document.createElement("canvas"), g = w.getContext("2d"), y = Math.abs(n) % 180 === 90, C = (l.resize === "contain" || l.resize === "cover") && N(l.width) && N(l.height), x = Math.max(l.maxWidth, 0) || 1 / 0, B = Math.max(l.maxHeight, 0) || 1 / 0, A = Math.max(l.minWidth, 0) || 0, k = Math.max(l.minHeight, 0) || 0, E = i / o, b = l.width, d = l.height;
462
+ var i = this, r = a.naturalWidth, o = a.naturalHeight, m = a.rotate, n = m === void 0 ? 0 : m, c = a.scaleX, u = c === void 0 ? 1 : c, f = a.scaleY, s = f === void 0 ? 1 : f, h = this.file, p = this.image, l = this.options, w = document.createElement("canvas"), g = w.getContext("2d"), y = Math.abs(n) % 180 === 90, C = (l.resize === "contain" || l.resize === "cover") && N(l.width) && N(l.height), x = Math.max(l.maxWidth, 0) || 1 / 0, B = Math.max(l.maxHeight, 0) || 1 / 0, A = Math.max(l.minWidth, 0) || 0, k = Math.max(l.minHeight, 0) || 0, E = r / o, b = l.width, d = l.height;
463
463
  if (y) {
464
464
  var P = [B, x];
465
465
  x = P[0], B = P[1];
@@ -481,36 +481,36 @@ var dt = U.ArrayBuffer, J = U.FileReader, D = U.URL || U.webkitURL, pt = /\.\w+$
481
481
  height: k
482
482
  }, "cover");
483
483
  if (A = ae.width, k = ae.height, C) {
484
- var re = I({
484
+ var ie = I({
485
485
  aspectRatio: E,
486
486
  width: b,
487
487
  height: d
488
488
  }, l.resize);
489
- b = re.width, d = re.height;
489
+ b = ie.width, d = ie.height;
490
490
  } else {
491
- var ie = I({
491
+ var re = I({
492
492
  aspectRatio: E,
493
493
  width: b,
494
494
  height: d
495
- }), oe = ie.width;
496
- b = oe === void 0 ? i : oe;
497
- var ne = ie.height;
495
+ }), oe = re.width;
496
+ b = oe === void 0 ? r : oe;
497
+ var ne = re.height;
498
498
  d = ne === void 0 ? o : ne;
499
499
  }
500
500
  b = Math.floor(Ee(Math.min(Math.max(b, A), x))), d = Math.floor(Ee(Math.min(Math.max(d, k), B)));
501
- var Re = -b / 2, Me = -d / 2, Fe = b, ze = d, W = [];
501
+ var Oe = -b / 2, Re = -d / 2, Fe = b, ze = d, W = [];
502
502
  if (C) {
503
- var se = 0, le = 0, H = i, V = o, ce = I({
503
+ var se = 0, le = 0, H = r, $ = o, ce = I({
504
504
  aspectRatio: E,
505
- width: i,
505
+ width: r,
506
506
  height: o
507
507
  }, {
508
508
  contain: "cover",
509
509
  cover: "contain"
510
510
  }[l.resize]);
511
- H = ce.width, V = ce.height, se = (i - H) / 2, le = (o - V) / 2, W.push(se, le, H, V);
511
+ H = ce.width, $ = ce.height, se = (r - H) / 2, le = (o - $) / 2, W.push(se, le, H, $);
512
512
  }
513
- if (W.push(Re, Me, Fe, ze), y) {
513
+ if (W.push(Oe, Re, Fe, ze), y) {
514
514
  var ue = [d, b];
515
515
  b = ue[0], d = ue[1];
516
516
  }
@@ -519,38 +519,38 @@ var dt = U.ArrayBuffer, J = U.FileReader, D = U.URL || U.webkitURL, pt = /\.\w+$
519
519
  h.size > l.convertSize && l.convertTypes.indexOf(l.mimeType) >= 0 && (l.mimeType = "image/jpeg");
520
520
  var fe = l.mimeType === "image/jpeg";
521
521
  if (fe && (me = "#fff"), g.fillStyle = me, g.fillRect(0, 0, b, d), l.beforeDraw && l.beforeDraw.call(this, g, w), !this.aborted && (g.save(), g.translate(b / 2, d / 2), g.rotate(n * Math.PI / 180), g.scale(u, s), g.drawImage.apply(g, [p].concat(W)), g.restore(), l.drew && l.drew.call(this, g, w), !this.aborted)) {
522
- var de = function(M) {
523
- if (!r.aborted) {
522
+ var de = function(R) {
523
+ if (!i.aborted) {
524
524
  var pe = function(F) {
525
- return r.done({
526
- naturalWidth: i,
525
+ return i.done({
526
+ naturalWidth: r,
527
527
  naturalHeight: o,
528
528
  result: F
529
529
  });
530
530
  };
531
- if (M && fe && l.retainExif && r.exif && r.exif.length > 0) {
531
+ if (R && fe && l.retainExif && i.exif && i.exif.length > 0) {
532
532
  var he = function(F) {
533
- return pe(Be(ke(ft(F, r.exif), l.mimeType)));
533
+ return pe(Be(ke(ft(F, i.exif), l.mimeType)));
534
534
  };
535
- if (M.arrayBuffer)
536
- M.arrayBuffer().then(he).catch(function() {
537
- r.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."));
535
+ if (R.arrayBuffer)
536
+ R.arrayBuffer().then(he).catch(function() {
537
+ i.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."));
538
538
  });
539
539
  else {
540
540
  var T = new J();
541
- r.reader = T, T.onload = function($) {
542
- var F = $.target;
541
+ i.reader = T, T.onload = function(V) {
542
+ var F = V.target;
543
543
  he(F.result);
544
544
  }, T.onabort = function() {
545
- r.fail(new Error("Aborted to read the compressed image with FileReader."));
545
+ i.fail(new Error("Aborted to read the compressed image with FileReader."));
546
546
  }, T.onerror = function() {
547
- r.fail(new Error("Failed to read the compressed image with FileReader."));
547
+ i.fail(new Error("Failed to read the compressed image with FileReader."));
548
548
  }, T.onloadend = function() {
549
- r.reader = null;
550
- }, T.readAsArrayBuffer(M);
549
+ i.reader = null;
550
+ }, T.readAsArrayBuffer(R);
551
551
  }
552
552
  } else
553
- pe(M);
553
+ pe(R);
554
554
  }
555
555
  };
556
556
  w.toBlob ? w.toBlob(de, l.mimeType, l.quality) : de(Be(w.toDataURL(l.mimeType, l.quality)));
@@ -559,9 +559,9 @@ var dt = U.ArrayBuffer, J = U.FileReader, D = U.URL || U.webkitURL, pt = /\.\w+$
559
559
  }, {
560
560
  key: "done",
561
561
  value: function(a) {
562
- var r = a.naturalWidth, i = a.naturalHeight, o = a.result, m = this.file, n = this.image, c = this.options;
562
+ var i = a.naturalWidth, r = a.naturalHeight, o = a.result, m = this.file, n = this.image, c = this.options;
563
563
  if (D && n.src.indexOf("blob:") === 0 && D.revokeObjectURL(n.src), o)
564
- if (c.strict && !c.retainExif && o.size > m.size && c.mimeType === m.type && !(c.width > r || c.height > i || c.minWidth > r || c.minHeight > i || c.maxWidth < r || c.maxHeight < i))
564
+ if (c.strict && !c.retainExif && o.size > m.size && c.mimeType === m.type && !(c.width > i || c.height > r || c.minWidth > i || c.minHeight > r || c.maxWidth < i || c.maxHeight < r))
565
565
  o = m;
566
566
  else {
567
567
  var u = /* @__PURE__ */ new Date();
@@ -574,9 +574,9 @@ var dt = U.ArrayBuffer, J = U.FileReader, D = U.URL || U.webkitURL, pt = /\.\w+$
574
574
  }, {
575
575
  key: "fail",
576
576
  value: function(a) {
577
- var r = this.options;
578
- if (r.error)
579
- r.error.call(this, a);
577
+ var i = this.options;
578
+ if (i.error)
579
+ i.error.call(this, a);
580
580
  else
581
581
  throw a;
582
582
  }
@@ -605,12 +605,12 @@ var dt = U.ArrayBuffer, J = U.FileReader, D = U.URL || U.webkitURL, pt = /\.\w+$
605
605
  }
606
606
  }]), t;
607
607
  }();
608
- const vt = (t, e) => new Promise((a, r) => {
608
+ const vt = (t, e) => new Promise((a, i) => {
609
609
  if (t.size <= e)
610
610
  return t;
611
- const i = e / t.size, o = Math.max(0.5, Math.min(0.9, 0.8 * i)), m = Math.max(800, Math.min(1920, 1920 * Math.sqrt(i)));
611
+ const r = e / t.size, o = Math.max(0.5, Math.min(0.9, 0.8 * r)), m = Math.max(800, Math.min(1920, 1920 * Math.sqrt(r)));
612
612
  Ue(t, o, m, m, (n) => {
613
- n.size <= e ? a(n) : Ue(
613
+ n.size <= e ? a(n) : (console.log("第一次压缩后仍大于5MB,进行二次压缩"), Ue(
614
614
  n,
615
615
  Math.max(0.4, o - 0.2),
616
616
  // 降低质量
@@ -618,16 +618,16 @@ const vt = (t, e) => new Promise((a, r) => {
618
618
  // 缩小尺寸
619
619
  Math.max(640, m * 0.8),
620
620
  a,
621
- r,
621
+ i,
622
622
  t
623
623
  // 传递原始文件用于错误处理
624
- );
625
- }, r, t);
626
- }), Ue = (t, e, a, r, i, o, m) => {
624
+ ));
625
+ }, i, t);
626
+ }), Ue = (t, e, a, i, r, o, m) => {
627
627
  new gt(t, {
628
628
  quality: e,
629
629
  maxWidth: a,
630
- maxHeight: r,
630
+ maxHeight: i,
631
631
  convertSize: 1 / 0,
632
632
  success(n) {
633
633
  try {
@@ -635,7 +635,7 @@ const vt = (t, e) => new Promise((a, r) => {
635
635
  type: n.type || t.type,
636
636
  lastModified: Date.now()
637
637
  });
638
- i(c);
638
+ r(c);
639
639
  } catch (c) {
640
640
  o({
641
641
  message: "文件转换失败",
@@ -653,7 +653,7 @@ const vt = (t, e) => new Promise((a, r) => {
653
653
  }
654
654
  });
655
655
  }, yt = (t, e) => {
656
- const a = we(t, "status"), { size2B: r } = qe(), i = we(t, "isOverMaxLimitCompressImg"), o = [".mp4", ".avi", ".mkv", ".mov", ".wmv", ".flv", ".mpeg", ".webm"], m = [".mp3", ".wav", ".aac", ".flac", ".ogg", ".alff", ".wma", ".m4a"], n = X(() => {
656
+ const a = we(t, "status"), { size2B: i } = qe(), r = we(t, "isOverMaxLimitCompressImg"), o = [".mp4", ".avi", ".mkv", ".mov", ".wmv", ".flv", ".mpeg", ".webm"], m = [".mp3", ".wav", ".aac", ".flac", ".ogg", ".alff", ".wma", ".m4a"], n = X(() => {
657
657
  var h;
658
658
  let s = t.accept ? (h = t.accept) == null ? void 0 : h.split(",") : [];
659
659
  return s.includes("image/jpg") && !s.includes("image/jpeg") && s.push("image/jpeg"), s.includes(".jpg") && !s.includes(".jpeg") && s.push(".jpeg"), t.acceptVideo && (s = [...s, ...o]), t.acceptAudio && (s = [...s, ...m]), s.join(",");
@@ -661,8 +661,8 @@ const vt = (t, e) => new Promise((a, r) => {
661
661
  return { isAccept: n, uploadStatus: a, loading: c, errored: u, beforeupload: (s) => {
662
662
  var l, w, g;
663
663
  if (t.maxSize) {
664
- const { finalSize: y, sizeText: C } = r(t.maxSize);
665
- if (s.size > y && !i.value) {
664
+ const { finalSize: y, sizeText: C } = i(t.maxSize);
665
+ if (s.size > y && !r.value) {
666
666
  const x = t.acceptAudio || t.acceptVideo ? "das-ui-import-upload-key4" : "das-ui-import-upload-key3", B = ge.value === "zh-CN" ? "、" : ", ", A = ve(
667
667
  x,
668
668
  C,
@@ -683,12 +683,16 @@ const vt = (t, e) => new Promise((a, r) => {
683
683
  a.value = "uploading";
684
684
  let y = s;
685
685
  if (t.maxSize) {
686
- const { finalSize: C } = r(t.maxSize);
687
- if (s.size > C && i.value && h.includes(s.type))
686
+ const { finalSize: C } = i(t.maxSize);
687
+ if (s.size > C && r.value && h.includes(s.type))
688
688
  try {
689
- y = await vt(s, C);
689
+ y = await vt(s, C), console.log(
690
+ "压缩成功:",
691
+ `原始大小: ${(s.size / 1024 / 1024).toFixed(2)}MB →`,
692
+ `压缩后: ${(y.size / 1024 / 1024).toFixed(2)}MB`
693
+ );
690
694
  } catch (x) {
691
- y = (x == null ? void 0 : x.original) || s;
695
+ console.log("压缩失败,使用原始文件"), y = (x == null ? void 0 : x.original) || s;
692
696
  }
693
697
  }
694
698
  return e("update:status", "uploading"), e("image-upload", y), !1;
@@ -735,29 +739,29 @@ const vt = (t, e) => new Promise((a, r) => {
735
739
  },
736
740
  emits: ["update:status", "image-upload"],
737
741
  setup(t, { emit: e }) {
738
- const a = t, r = e, { isAccept: i, uploadStatus: o, loading: m, errored: n, beforeupload: c } = yt(a, r);
742
+ const a = t, i = e, { isAccept: r, uploadStatus: o, loading: m, errored: n, beforeupload: c } = yt(a, i);
739
743
  return (u, f) => (_e(), Le("div", bt, [
740
744
  ye(" 图片上传组件 "),
741
- K(O(v($e), {
745
+ K(M(v(Ve), {
742
746
  class: Ne([{ "loading-border": v(m) }]),
743
747
  type: "component",
744
748
  spinning: v(m)
745
749
  }, {
746
- default: R(() => [
747
- O(v(He), {
750
+ default: O(() => [
751
+ M(v(He), {
748
752
  class: "das-ui-image-upload-dragger",
749
- accept: v(i),
753
+ accept: v(r),
750
754
  "max-count": u.maxCount,
751
755
  "before-upload": v(c),
752
756
  openFileDialogOnClick: u.openFileDialogOnClick
753
757
  }, {
754
- itemRender: R(({ file: s, actions: h }) => f[0] || (f[0] = [])),
755
- default: R(() => [
758
+ itemRender: O(({ file: s, actions: h }) => f[0] || (f[0] = [])),
759
+ default: O(() => [
756
760
  K(z(
757
761
  "div",
758
762
  wt,
759
763
  [
760
- O(v(Xe), {
764
+ M(v(Xe), {
761
765
  iconColor: v(L)("--das-ui-color-secondary")
762
766
  }, null, 8, ["iconColor"]),
763
767
  z(
@@ -789,7 +793,7 @@ const vt = (t, e) => new Promise((a, r) => {
789
793
  Ct,
790
794
  [
791
795
  z("div", Bt, [
792
- O(v(Ke), {
796
+ M(v(Ke), {
793
797
  iconColor: v(L)("--das-ui-color-danger"),
794
798
  size: "small"
795
799
  }, null, 8, ["iconColor"]),
@@ -801,19 +805,19 @@ const vt = (t, e) => new Promise((a, r) => {
801
805
  /* TEXT */
802
806
  )
803
807
  ]),
804
- O(v(Ve), {
805
- accept: v(i),
808
+ M(v($e), {
809
+ accept: v(r),
806
810
  "before-upload": v(c),
807
811
  "max-count": u.maxCount,
808
812
  openFileDialogOnClick: u.openFileDialogOnClick
809
813
  }, {
810
- itemRender: R(({ file: s, actions: h }) => f[1] || (f[1] = [])),
811
- default: R(() => [
812
- O(v(Ge), {
814
+ itemRender: O(({ file: s, actions: h }) => f[1] || (f[1] = [])),
815
+ default: O(() => [
816
+ M(v(Ge), {
813
817
  "btn-type": "primary-text",
814
818
  block: ""
815
819
  }, {
816
- default: R(() => [
820
+ default: O(() => [
817
821
  We(
818
822
  Y(v(G)("das-image-upload-reupload")),
819
823
  1
@@ -837,8 +841,8 @@ const vt = (t, e) => new Promise((a, r) => {
837
841
  }
838
842
  }), Et = (t, e) => {
839
843
  const a = t.__vccOpts || t;
840
- for (const [r, i] of e)
841
- a[r] = i;
844
+ for (const [i, r] of e)
845
+ a[i] = r;
842
846
  return a;
843
847
  }, Ut = /* @__PURE__ */ Et(kt, [["__scopeId", "data-v-29473013"]]), Dt = {
844
848
  "das-ui-import-upload-key1": {
@@ -870,10 +874,10 @@ const vt = (t, e) => new Promise((a, r) => {
870
874
  "--das-ui-image-upload-bgcolor-hover": { light: L("--das-ui-color-primary-level1") },
871
875
  "--das-ui-image-upload-border-color-hover": { light: "#5582F3" },
872
876
  "--das-ui-image-upload-border-color-error": { light: L("--das-ui-color-danger-level2") }
873
- }, $t = Ie(Ut);
877
+ }, Vt = Ie(Ut);
874
878
  Pe(Dt);
875
879
  Se(Tt);
876
880
  export {
877
- $t as DasImageUpload,
878
- $t as default
881
+ Vt as DasImageUpload,
882
+ Vt as default
879
883
  };