@gx-design-vue/image 0.2.0-beta.12 → 0.2.0-beta.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.
package/dist/Image.d.ts CHANGED
@@ -77,7 +77,7 @@ declare const GImage: import("vue").DefineComponent<{
77
77
  default: () => undefined;
78
78
  type: import("vue").PropType<number>;
79
79
  };
80
- }, () => import("ant-design-vue/es/_util/type").VueNode, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "error" | "load")[], "click" | "error" | "load", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
80
+ }, () => import("ant-design-vue/es/_util/type").VueNode, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "error" | "load")[], "click" | "error" | "load", import("vue").PublicProps, Readonly<ExtractPropTypes<{
81
81
  previewTeleported: {
82
82
  type: import("vue").PropType<boolean>;
83
83
  default: boolean;
@@ -174,5 +174,5 @@ declare const GImage: import("vue").DefineComponent<{
174
174
  disablePreview: boolean;
175
175
  previewSrcList: string[];
176
176
  imageClassName: string;
177
- }>;
177
+ }, {}>;
178
178
  export default GImage;
@@ -80,7 +80,7 @@ declare const GImageViewer: import("vue").DefineComponent<{
80
80
  }> | undefined;
81
81
  };
82
82
  };
83
- }, () => import("ant-design-vue/es/_util/type").VueNode, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "switch")[], "close" | "switch", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
83
+ }, () => import("ant-design-vue/es/_util/type").VueNode, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "switch")[], "close" | "switch", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
84
84
  urlList: {
85
85
  type: import("vue").PropType<string[]>;
86
86
  default: () => never[];
@@ -189,5 +189,5 @@ declare const GImageViewer: import("vue").DefineComponent<{
189
189
  [key: string]: any;
190
190
  }> | undefined;
191
191
  };
192
- }>;
192
+ }, {}>;
193
193
  export default GImageViewer;
@@ -1,11 +1,11 @@
1
- import { createTypes as Xe } from "vue-types";
2
- import { createVNode as c, defineComponent as Ve, shallowRef as Te, ref as A, reactive as _e, computed as N, watch as q, nextTick as Ye, Teleport as qe, Transition as ke, withDirectives as ze, vShow as Oe, mergeProps as We, cloneVNode as Qe, watchEffect as Je, Fragment as Ke, createTextVNode as et } from "vue";
3
- import { ExpandOutlined as tt, OneToOneOutlined as nt, CloseOutlined as at, ZoomInOutlined as it, ZoomOutOutlined as rt, RotateRightOutlined as ot, RotateLeftOutlined as st, LeftOutlined as lt, RightOutlined as ut } from "@ant-design/icons-vue";
4
- import { isServer as Q, getPrefixCls as Ge, getSlotVNode as Le, isInContainer as ct, isString as ft, getScrollContainer as dt, isNumber as ht } from "@gx-design-vue/pro-utils";
5
- import { useState as Ne, onMountedOrActivated as gt } from "@gx-design-vue/pro-hooks";
6
- import { Keyframe as ce, useStyle as vt, mergeToken as mt, getTransitionProps as $e, useProStyle as pt } from "@gx-design-vue/pro-provider";
7
- import { useThrottleFn as bt, useEventListener as Ee } from "@vueuse/core";
8
- const Ue = Xe({
1
+ import { createTypes as Ze } from "vue-types";
2
+ import { createVNode as c, defineComponent as Ve, shallowRef as Te, ref as A, reactive as Xe, computed as N, watch as q, nextTick as Ye, Teleport as _e, Transition as ke, withDirectives as ze, vShow as Oe, mergeProps as We, cloneVNode as qe, watchEffect as Qe, Fragment as Je, createTextVNode as Ke } from "vue";
3
+ import { ExpandOutlined as et, OneToOneOutlined as tt, CloseOutlined as nt, ZoomInOutlined as at, ZoomOutOutlined as it, RotateRightOutlined as rt, RotateLeftOutlined as ot, LeftOutlined as st, RightOutlined as lt } from "@ant-design/icons-vue";
4
+ import { isServer as Q, getPrefixCls as Ge, getSlotVNode as Le, isInContainer as ut, isString as ct, getScrollContainer as ft, isNumber as dt } from "@gx-design-vue/pro-utils";
5
+ import { useState as Ne, onMountedOrActivated as ht } from "@gx-design-vue/pro-hooks";
6
+ import { Keyframe as ce, useStyle as gt, mergeToken as vt, getTransitionProps as $e, useProStyle as mt } from "@gx-design-vue/pro-provider";
7
+ import { useThrottleFn as pt, useEventListener as Ee } from "@vueuse/core";
8
+ const H = Ze({
9
9
  func: void 0,
10
10
  bool: void 0,
11
11
  string: void 0,
@@ -14,7 +14,7 @@ const Ue = Xe({
14
14
  object: void 0,
15
15
  integer: void 0
16
16
  });
17
- Ue.extend([{
17
+ H.extend([{
18
18
  name: "looseBool",
19
19
  getter: !0,
20
20
  type: Boolean,
@@ -29,7 +29,7 @@ Ue.extend([{
29
29
  getter: !0,
30
30
  type: null
31
31
  }]);
32
- const V = Ue, H = {
32
+ const P = {
33
33
  infinite: {
34
34
  type: Boolean,
35
35
  default: !0
@@ -66,7 +66,7 @@ const V = Ue, H = {
66
66
  type: String,
67
67
  default: "contain"
68
68
  },
69
- lazy: V.bool,
69
+ lazy: H.bool,
70
70
  scrollContainer: {
71
71
  type: [String, Object]
72
72
  },
@@ -89,32 +89,32 @@ const V = Ue, H = {
89
89
  onClick: {
90
90
  type: Function
91
91
  },
92
- disablePreview: V.bool,
92
+ disablePreview: H.bool,
93
93
  previewSrcList: {
94
94
  type: Array,
95
95
  default: () => []
96
96
  },
97
- imageClassName: V.string,
98
- imageStyle: V.style,
99
- width: V.number,
100
- height: V.number,
101
- zIndex: H.zIndex,
102
- infinite: H.infinite,
103
- getContainer: H.getContainer,
97
+ imageClassName: H.string,
98
+ imageStyle: H.style,
99
+ width: H.number,
100
+ height: H.number,
101
+ zIndex: P.zIndex,
102
+ infinite: P.infinite,
103
+ getContainer: P.getContainer,
104
104
  initialIndex: {
105
- ...H.initialIndex,
105
+ ...P.initialIndex,
106
106
  default: () => {
107
107
  }
108
108
  }
109
- }, yt = {
109
+ }, bt = {
110
110
  urlList: {
111
111
  type: Array,
112
112
  default: () => []
113
113
  },
114
114
  teleported: le.previewTeleported,
115
- zIndex: H.zIndex,
116
- initialIndex: H.initialIndex,
117
- infinite: H.infinite,
115
+ zIndex: P.zIndex,
116
+ initialIndex: P.initialIndex,
117
+ infinite: P.infinite,
118
118
  getContainer: le.getContainer,
119
119
  onHideOnClickModal: le.hideOnClickModal,
120
120
  icons: {
@@ -124,7 +124,7 @@ const V = Ue, H = {
124
124
  };
125
125
  function v(e, t) {
126
126
  wt(e) && (e = "100%");
127
- var n = St(e);
127
+ var n = yt(e);
128
128
  return e = t === 360 ? e : Math.min(t, Math.max(0, parseFloat(e))), n && (e = parseInt(String(e * t), 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : (t === 360 ? e = (e < 0 ? e % t + t : e % t) / parseFloat(String(t)) : e = e % t / parseFloat(String(t)), e);
129
129
  }
130
130
  function re(e) {
@@ -133,19 +133,19 @@ function re(e) {
133
133
  function wt(e) {
134
134
  return typeof e == "string" && e.indexOf(".") !== -1 && parseFloat(e) === 1;
135
135
  }
136
- function St(e) {
136
+ function yt(e) {
137
137
  return typeof e == "string" && e.indexOf("%") !== -1;
138
138
  }
139
- function Ze(e) {
139
+ function Ue(e) {
140
140
  return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
141
141
  }
142
142
  function oe(e) {
143
143
  return e <= 1 ? "".concat(Number(e) * 100, "%") : e;
144
144
  }
145
- function P(e) {
145
+ function F(e) {
146
146
  return e.length === 1 ? "0" + e : String(e);
147
147
  }
148
- function xt(e, t, n) {
148
+ function St(e, t, n) {
149
149
  return {
150
150
  r: v(e, 255) * 255,
151
151
  g: v(t, 255) * 255,
@@ -177,7 +177,7 @@ function Re(e, t, n) {
177
177
  function be(e, t, n) {
178
178
  return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * (6 * n) : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
179
179
  }
180
- function Mt(e, t, n) {
180
+ function xt(e, t, n) {
181
181
  var a, i, r;
182
182
  if (e = v(e, 360), t = v(t, 100), n = v(n, 100), t === 0)
183
183
  i = n, r = n, a = n;
@@ -208,38 +208,38 @@ function De(e, t, n) {
208
208
  }
209
209
  return { h: r, s: f, v: o };
210
210
  }
211
- function It(e, t, n) {
211
+ function Mt(e, t, n) {
212
212
  e = v(e, 360) * 6, t = v(t, 100), n = v(n, 100);
213
213
  var a = Math.floor(e), i = e - a, r = n * (1 - t), o = n * (1 - i * t), l = n * (1 - (1 - i) * t), f = a % 6, S = [n, o, r, r, l, n][f], m = [l, n, n, o, r, r][f], E = [r, r, l, n, n, o][f];
214
214
  return { r: S * 255, g: m * 255, b: E * 255 };
215
215
  }
216
216
  function He(e, t, n, a) {
217
217
  var i = [
218
- P(Math.round(e).toString(16)),
219
- P(Math.round(t).toString(16)),
220
- P(Math.round(n).toString(16))
218
+ F(Math.round(e).toString(16)),
219
+ F(Math.round(t).toString(16)),
220
+ F(Math.round(n).toString(16))
221
221
  ];
222
222
  return a && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) : i.join("");
223
223
  }
224
- function At(e, t, n, a, i) {
224
+ function It(e, t, n, a, i) {
225
225
  var r = [
226
- P(Math.round(e).toString(16)),
227
- P(Math.round(t).toString(16)),
228
- P(Math.round(n).toString(16)),
229
- P(Ct(a))
226
+ F(Math.round(e).toString(16)),
227
+ F(Math.round(t).toString(16)),
228
+ F(Math.round(n).toString(16)),
229
+ F(At(a))
230
230
  ];
231
231
  return i && r[0].startsWith(r[0].charAt(1)) && r[1].startsWith(r[1].charAt(1)) && r[2].startsWith(r[2].charAt(1)) && r[3].startsWith(r[3].charAt(1)) ? r[0].charAt(0) + r[1].charAt(0) + r[2].charAt(0) + r[3].charAt(0) : r.join("");
232
232
  }
233
- function Ct(e) {
233
+ function At(e) {
234
234
  return Math.round(parseFloat(e) * 255).toString(16);
235
235
  }
236
236
  function Pe(e) {
237
- return w(e) / 255;
237
+ return y(e) / 255;
238
238
  }
239
- function w(e) {
239
+ function y(e) {
240
240
  return parseInt(e, 16);
241
241
  }
242
- function Tt(e) {
242
+ function Ct(e) {
243
243
  return {
244
244
  r: e >> 16,
245
245
  g: (e & 65280) >> 8,
@@ -396,9 +396,9 @@ var Ae = {
396
396
  yellow: "#ffff00",
397
397
  yellowgreen: "#9acd32"
398
398
  };
399
- function kt(e) {
399
+ function Tt(e) {
400
400
  var t = { r: 0, g: 0, b: 0 }, n = 1, a = null, i = null, r = null, o = !1, l = !1;
401
- return typeof e == "string" && (e = Lt(e)), typeof e == "object" && (L(e.r) && L(e.g) && L(e.b) ? (t = xt(e.r, e.g, e.b), o = !0, l = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : L(e.h) && L(e.s) && L(e.v) ? (a = oe(e.s), i = oe(e.v), t = It(e.h, a, i), o = !0, l = "hsv") : L(e.h) && L(e.s) && L(e.l) && (a = oe(e.s), r = oe(e.l), t = Mt(e.h, a, r), o = !0, l = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a)), n = Ze(n), {
401
+ return typeof e == "string" && (e = Ot(e)), typeof e == "object" && (L(e.r) && L(e.g) && L(e.b) ? (t = St(e.r, e.g, e.b), o = !0, l = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : L(e.h) && L(e.s) && L(e.v) ? (a = oe(e.s), i = oe(e.v), t = Mt(e.h, a, i), o = !0, l = "hsv") : L(e.h) && L(e.s) && L(e.l) && (a = oe(e.s), r = oe(e.l), t = xt(e.h, a, r), o = !0, l = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a)), n = Ue(n), {
402
402
  ok: o,
403
403
  format: e.format || l,
404
404
  r: Math.min(255, Math.max(t.r, 0)),
@@ -407,20 +407,20 @@ function kt(e) {
407
407
  a: n
408
408
  };
409
409
  }
410
- var zt = "[-\\+]?\\d+%?", Ot = "[-\\+]?\\d*\\.\\d+%?", $ = "(?:".concat(Ot, ")|(?:").concat(zt, ")"), ye = "[\\s|\\(]+(".concat($, ")[,|\\s]+(").concat($, ")[,|\\s]+(").concat($, ")\\s*\\)?"), we = "[\\s|\\(]+(".concat($, ")[,|\\s]+(").concat($, ")[,|\\s]+(").concat($, ")[,|\\s]+(").concat($, ")\\s*\\)?"), C = {
410
+ var kt = "[-\\+]?\\d+%?", zt = "[-\\+]?\\d*\\.\\d+%?", $ = "(?:".concat(zt, ")|(?:").concat(kt, ")"), we = "[\\s|\\(]+(".concat($, ")[,|\\s]+(").concat($, ")[,|\\s]+(").concat($, ")\\s*\\)?"), ye = "[\\s|\\(]+(".concat($, ")[,|\\s]+(").concat($, ")[,|\\s]+(").concat($, ")[,|\\s]+(").concat($, ")\\s*\\)?"), C = {
411
411
  CSS_UNIT: new RegExp($),
412
- rgb: new RegExp("rgb" + ye),
413
- rgba: new RegExp("rgba" + we),
414
- hsl: new RegExp("hsl" + ye),
415
- hsla: new RegExp("hsla" + we),
416
- hsv: new RegExp("hsv" + ye),
417
- hsva: new RegExp("hsva" + we),
412
+ rgb: new RegExp("rgb" + we),
413
+ rgba: new RegExp("rgba" + ye),
414
+ hsl: new RegExp("hsl" + we),
415
+ hsla: new RegExp("hsla" + ye),
416
+ hsv: new RegExp("hsv" + we),
417
+ hsva: new RegExp("hsva" + ye),
418
418
  hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
419
419
  hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
420
420
  hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
421
421
  hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
422
422
  };
423
- function Lt(e) {
423
+ function Ot(e) {
424
424
  if (e = e.trim().toLowerCase(), e.length === 0)
425
425
  return !1;
426
426
  var t = !1;
@@ -430,26 +430,26 @@ function Lt(e) {
430
430
  return { r: 0, g: 0, b: 0, a: 0, format: "name" };
431
431
  var n = C.rgb.exec(e);
432
432
  return n ? { r: n[1], g: n[2], b: n[3] } : (n = C.rgba.exec(e), n ? { r: n[1], g: n[2], b: n[3], a: n[4] } : (n = C.hsl.exec(e), n ? { h: n[1], s: n[2], l: n[3] } : (n = C.hsla.exec(e), n ? { h: n[1], s: n[2], l: n[3], a: n[4] } : (n = C.hsv.exec(e), n ? { h: n[1], s: n[2], v: n[3] } : (n = C.hsva.exec(e), n ? { h: n[1], s: n[2], v: n[3], a: n[4] } : (n = C.hex8.exec(e), n ? {
433
- r: w(n[1]),
434
- g: w(n[2]),
435
- b: w(n[3]),
433
+ r: y(n[1]),
434
+ g: y(n[2]),
435
+ b: y(n[3]),
436
436
  a: Pe(n[4]),
437
437
  format: t ? "name" : "hex8"
438
438
  } : (n = C.hex6.exec(e), n ? {
439
- r: w(n[1]),
440
- g: w(n[2]),
441
- b: w(n[3]),
439
+ r: y(n[1]),
440
+ g: y(n[2]),
441
+ b: y(n[3]),
442
442
  format: t ? "name" : "hex"
443
443
  } : (n = C.hex4.exec(e), n ? {
444
- r: w(n[1] + n[1]),
445
- g: w(n[2] + n[2]),
446
- b: w(n[3] + n[3]),
444
+ r: y(n[1] + n[1]),
445
+ g: y(n[2] + n[2]),
446
+ b: y(n[3] + n[3]),
447
447
  a: Pe(n[4] + n[4]),
448
448
  format: t ? "name" : "hex8"
449
449
  } : (n = C.hex3.exec(e), n ? {
450
- r: w(n[1] + n[1]),
451
- g: w(n[2] + n[2]),
452
- b: w(n[3] + n[3]),
450
+ r: y(n[1] + n[1]),
451
+ g: y(n[2] + n[2]),
452
+ b: y(n[3] + n[3]),
453
453
  format: t ? "name" : "hex"
454
454
  } : !1)))))))));
455
455
  }
@@ -464,8 +464,8 @@ var J = (
464
464
  var a;
465
465
  if (t instanceof e)
466
466
  return t;
467
- typeof t == "number" && (t = Tt(t)), this.originalInput = t;
468
- var i = kt(t);
467
+ typeof t == "number" && (t = Ct(t)), this.originalInput = t;
468
+ var i = Tt(t);
469
469
  this.originalInput = t, this.r = i.r, this.g = i.g, this.b = i.b, this.a = i.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (a = n.format) !== null && a !== void 0 ? a : i.format, this.gradientType = n.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = i.ok;
470
470
  }
471
471
  return e.prototype.isDark = function() {
@@ -481,7 +481,7 @@ var J = (
481
481
  }, e.prototype.getAlpha = function() {
482
482
  return this.a;
483
483
  }, e.prototype.setAlpha = function(t) {
484
- return this.a = Ze(t), this.roundA = Math.round(100 * this.a) / 100, this;
484
+ return this.a = Ue(t), this.roundA = Math.round(100 * this.a) / 100, this;
485
485
  }, e.prototype.isMonochrome = function() {
486
486
  var t = this.toHsl().s;
487
487
  return t === 0;
@@ -502,7 +502,7 @@ var J = (
502
502
  }, e.prototype.toHexString = function(t) {
503
503
  return t === void 0 && (t = !1), "#" + this.toHex(t);
504
504
  }, e.prototype.toHex8 = function(t) {
505
- return t === void 0 && (t = !1), At(this.r, this.g, this.b, this.a, t);
505
+ return t === void 0 && (t = !1), It(this.r, this.g, this.b, this.a, t);
506
506
  }, e.prototype.toHex8String = function(t) {
507
507
  return t === void 0 && (t = !1), "#" + this.toHex8(t);
508
508
  }, e.prototype.toRgb = function() {
@@ -629,21 +629,21 @@ var J = (
629
629
  }, e;
630
630
  }()
631
631
  );
632
- const Nt = new ce("viewFadeIn", {
632
+ const Lt = new ce("viewFadeIn", {
633
633
  "0%": {
634
634
  opacity: 0
635
635
  },
636
636
  "100%": {
637
637
  opacity: 1
638
638
  }
639
- }), $t = new ce("viewFadeOut", {
639
+ }), Nt = new ce("viewFadeOut", {
640
640
  "0%": {
641
641
  opacity: 1
642
642
  },
643
643
  "100%": {
644
644
  opacity: 0
645
645
  }
646
- }), Et = new ce("viewZoomBadgeIn", {
646
+ }), $t = new ce("viewZoomBadgeIn", {
647
647
  "0%": {
648
648
  transform: "scale(0.2)",
649
649
  opacity: 0
@@ -652,7 +652,7 @@ const Nt = new ce("viewFadeIn", {
652
652
  transform: "scale(1)",
653
653
  opacity: 1
654
654
  }
655
- }), Rt = new ce("viewZoomBadgeOut", {
655
+ }), Et = new ce("viewZoomBadgeOut", {
656
656
  "0%": {
657
657
  transform: "scale(1)"
658
658
  },
@@ -673,7 +673,7 @@ function Se(e) {
673
673
  insetInlineStart: 0
674
674
  };
675
675
  }
676
- const Dt = (e) => ({
676
+ const Rt = (e) => ({
677
677
  boxSizing: "border-box",
678
678
  margin: 0,
679
679
  padding: 0,
@@ -682,11 +682,11 @@ const Dt = (e) => ({
682
682
  lineHeight: e.lineHeight,
683
683
  listStyle: "none",
684
684
  fontFamily: e.fontFamily
685
- }), Ht = (e) => {
685
+ }), Dt = (e) => {
686
686
  const { componentCls: t, modalMaskBg: n, paddingSM: a, previewOperationColorDisabled: i, motionDurationSlow: r } = e, o = new J(n).setAlpha(0.1), l = o.clone().setAlpha(0.2);
687
687
  return {
688
688
  [`${t}-operations`]: {
689
- ...Dt(e),
689
+ ...Rt(e),
690
690
  display: "flex",
691
691
  flexDirection: "row-reverse",
692
692
  alignItems: "center",
@@ -721,7 +721,7 @@ const Dt = (e) => ({
721
721
  }
722
722
  }
723
723
  };
724
- }, Pt = (e) => {
724
+ }, Ht = (e) => {
725
725
  const { modalMaskBg: t, previewOperationColorDisabled: n, zIndexPopup: a, motionDurationSlow: i } = e, r = new J(t).setAlpha(0.1), o = r.clone().setAlpha(0.2);
726
726
  return {
727
727
  [`${e.componentCls}-switch-left, ${e.componentCls}-switch-right`]: {
@@ -745,7 +745,7 @@ const Dt = (e) => ({
745
745
  "&:hover": {
746
746
  background: o.toRgbString()
747
747
  },
748
- ["&-disabled"]: {
748
+ "&-disabled": {
749
749
  "&, &:hover": {
750
750
  color: n,
751
751
  background: "transparent",
@@ -766,38 +766,38 @@ const Dt = (e) => ({
766
766
  insetInlineEnd: e.marginSM
767
767
  }
768
768
  };
769
- }, Ft = (e) => ({
769
+ }, Pt = (e) => ({
770
770
  [e.componentCls]: {
771
- ["&-root"]: {
771
+ "&-root": {
772
772
  ...Se("fixed"),
773
773
  zIndex: e.zIndexPopup,
774
774
  overflow: "auto",
775
775
  outline: 0,
776
776
  WebkitOverflowScrolling: "touch"
777
777
  },
778
- ["&-wrapper"]: {
778
+ "&-wrapper": {
779
779
  ...Se("fixed"),
780
780
  zIndex: e.zIndexPopup,
781
781
  overflow: "auto",
782
782
  outline: 0,
783
783
  WebkitOverflowScrolling: "touch"
784
784
  },
785
- ["&-mask"]: {
785
+ "&-mask": {
786
786
  ...Se("fixed"),
787
787
  zIndex: e.zIndexPopupBase,
788
788
  height: "100%",
789
789
  backgroundColor: e.colorBgMask
790
790
  },
791
- ["&-block"]: {
791
+ "&-block": {
792
792
  height: "100%",
793
793
  textAlign: "center",
794
794
  pointerEvents: "none"
795
795
  },
796
- ["&-body"]: {
796
+ "&-body": {
797
797
  ...Fe(),
798
798
  overflow: "hidden"
799
799
  },
800
- ["&-canvas"]: {
800
+ "&-canvas": {
801
801
  ...Fe(),
802
802
  display: "flex",
803
803
  justifyContent: "center",
@@ -810,7 +810,7 @@ const Dt = (e) => ({
810
810
  content: '""'
811
811
  }
812
812
  },
813
- ["&-img"]: {
813
+ "&-img": {
814
814
  maxWidth: "100%",
815
815
  maxHeight: "100%",
816
816
  verticalAlign: "middle",
@@ -820,18 +820,18 @@ const Dt = (e) => ({
820
820
  userSelect: "none",
821
821
  pointerEvents: "auto"
822
822
  },
823
- ["&-fade-appear, &-fade-enter"]: {
824
- animationName: Nt,
823
+ "&-fade-appear, &-fade-enter": {
824
+ animationName: Lt,
825
825
  animationDuration: e.motionDurationSlow,
826
826
  animationTimingFunction: "linear"
827
827
  },
828
- ["&-fade-leave"]: {
829
- animationName: $t,
828
+ "&-fade-leave": {
829
+ animationName: Nt,
830
830
  animationDuration: e.motionDurationSlow,
831
831
  animationTimingFunction: "linear"
832
832
  },
833
- ["&-zoom-appear, &-zoom-enter"]: {
834
- animationName: Et,
833
+ "&-zoom-appear, &-zoom-enter": {
834
+ animationName: $t,
835
835
  opacity: 0,
836
836
  animationTimingFunction: e.motionEaseOutCirc,
837
837
  animationFillMode: "both",
@@ -839,11 +839,11 @@ const Dt = (e) => ({
839
839
  animationDuration: e.motionDurationSlow,
840
840
  userSelect: "none"
841
841
  },
842
- ["&-zoom-enter-active"]: {
842
+ "&-zoom-enter-active": {
843
843
  animationPlayState: "running"
844
844
  },
845
- ["&-zoom-leave"]: {
846
- animationName: Rt,
845
+ "&-zoom-leave": {
846
+ animationName: Et,
847
847
  animationDuration: e.motionDurationSlow,
848
848
  animationTimingFunction: e.motionEaseOutBack,
849
849
  animationFillMode: "both"
@@ -861,20 +861,22 @@ const Dt = (e) => ({
861
861
  zIndex: e.zIndexPopup + 1,
862
862
  width: "100%"
863
863
  },
864
- "&": [Ht(e), Pt(e)]
864
+ "&": [Dt(e), Ht(e)]
865
865
  });
866
- function jt(e) {
867
- return vt("ImageView", (t) => {
868
- const n = mt(t, {
866
+ function Ft(e) {
867
+ return gt("ImageView", (t) => {
868
+ const n = vt(t, {
869
869
  zIndexPopup: t.zIndexPopupBase + 80,
870
870
  previewOperationColorDisabled: new J(t.colorTextLightSolid).setAlpha(0.25).toRgbString(),
871
871
  modalMaskBg: new J("#000").setAlpha(0.45).toRgbString(),
872
+ // FIXME: Shared Token
872
873
  previewOperationColor: new J(t.colorTextLightSolid).toRgbString(),
873
874
  previewOperationSize: t.fontSizeIcon * 1.5,
875
+ // FIXME: fontSizeIconLG
874
876
  imagePreviewSwitchSize: t.controlHeightLG,
875
877
  iconCls: "anticon"
876
878
  });
877
- return [Ft(n)];
879
+ return [Pt(n)];
878
880
  }, e);
879
881
  }
880
882
  const Y = {
@@ -882,9 +884,13 @@ const Y = {
882
884
  enter: "Enter",
883
885
  space: "Space",
884
886
  left: "ArrowLeft",
887
+ // 37
885
888
  up: "ArrowUp",
889
+ // 38
886
890
  right: "ArrowRight",
891
+ // 39
887
892
  down: "ArrowDown",
893
+ // 40
888
894
  esc: "Escape",
889
895
  delete: "Delete",
890
896
  backspace: "Backspace"
@@ -895,15 +901,15 @@ const Y = {
895
901
  }, _ = {
896
902
  CONTAIN: {
897
903
  name: "contain",
898
- icon: c(tt, null, null)
904
+ icon: c(et, null, null)
899
905
  },
900
906
  ORIGINAL: {
901
907
  name: "original",
902
- icon: c(nt, null, null)
908
+ icon: c(tt, null, null)
903
909
  }
904
- }, Bt = function() {
910
+ }, jt = function() {
905
911
  return !Q && !!window.navigator.userAgent.match(/firefox/i);
906
- }, je = Bt() ? "DOMMouseScroll" : "mousewheel";
912
+ }, je = jt() ? "DOMMouseScroll" : "mousewheel";
907
913
  function Me(e) {
908
914
  let t = !1;
909
915
  return function(...n) {
@@ -912,8 +918,8 @@ function Me(e) {
912
918
  }));
913
919
  };
914
920
  }
915
- const Vt = /* @__PURE__ */ Ve({
916
- props: yt,
921
+ const Bt = /* @__PURE__ */ Ve({
922
+ props: bt,
917
923
  emits: ["close", "switch"],
918
924
  setup: function(e, {
919
925
  emit: t,
@@ -926,7 +932,7 @@ const Vt = /* @__PURE__ */ Ve({
926
932
  }), {
927
933
  wrapSSR: l,
928
934
  hashId: f
929
- } = jt(o), S = Te(!1), [m, E] = Ne(!1), [z, x] = Ne(!1), O = A(!0), g = A(e.initialIndex), F = A(null), j = A(null), W = A(_.CONTAIN), d = _e({
935
+ } = Ft(o), S = Te(!1), [m, E] = Ne(!1), [z, x] = Ne(!1), O = A(!0), g = A(e.initialIndex), j = A(null), B = A(null), W = A(_.CONTAIN), d = Xe({
930
936
  transform: {
931
937
  scale: 1,
932
938
  deg: 0,
@@ -939,13 +945,13 @@ const Vt = /* @__PURE__ */ Ve({
939
945
  scale: s,
940
946
  deg: M,
941
947
  offsetX: h,
942
- offsetY: y,
948
+ offsetY: w,
943
949
  enableTransition: p
944
950
  } = d.transform, I = {
945
951
  transform: `scale(${s}) rotate(${M}deg)`,
946
952
  transition: p ? "transform .3s" : "",
947
953
  marginLeft: `${h}px`,
948
- marginTop: `${y}px`
954
+ marginTop: `${w}px`
949
955
  };
950
956
  return W.value.name === _.CONTAIN.name && (I.maxWidth = I.maxHeight = "100%"), I;
951
957
  }), de = () => {
@@ -957,7 +963,7 @@ const Vt = /* @__PURE__ */ Ve({
957
963
  enableTransition: !1
958
964
  };
959
965
  }, he = (s) => {
960
- S.value ? S.value = !1 : F.value === (s == null ? void 0 : s.target) && (x(!1), g.value = e.initialIndex);
966
+ S.value ? S.value = !1 : j.value === (s == null ? void 0 : s.target) && (x(!1), g.value = e.initialIndex);
961
967
  }, ge = () => {
962
968
  a = Me((s) => {
963
969
  switch (s.code) {
@@ -965,7 +971,7 @@ const Vt = /* @__PURE__ */ Ve({
965
971
  x(!1);
966
972
  break;
967
973
  case Y.space:
968
- B();
974
+ V();
969
975
  break;
970
976
  case Y.left:
971
977
  ne();
@@ -1002,11 +1008,11 @@ const Vt = /* @__PURE__ */ Ve({
1002
1008
  const {
1003
1009
  offsetX: M,
1004
1010
  offsetY: h
1005
- } = d.transform, y = s.pageX, p = s.pageY;
1011
+ } = d.transform, w = s.pageX, p = s.pageY;
1006
1012
  r = Me((I) => {
1007
1013
  d.transform = {
1008
1014
  ...d.transform,
1009
- offsetX: M + I.pageX - y,
1015
+ offsetX: M + I.pageX - w,
1010
1016
  offsetY: h + I.pageY - p
1011
1017
  };
1012
1018
  }), se(document, "mousemove", r), se(document, "mouseup", () => {
@@ -1022,7 +1028,7 @@ const Vt = /* @__PURE__ */ Ve({
1022
1028
  offsetY: 0,
1023
1029
  enableTransition: !1
1024
1030
  };
1025
- }, B = () => {
1031
+ }, V = () => {
1026
1032
  if (O.value)
1027
1033
  return;
1028
1034
  const s = Object.keys(_), M = Object.values(_), h = W.value.name, p = (M.findIndex((I) => I.name === h) + 1) % s.length;
@@ -1042,7 +1048,7 @@ const Vt = /* @__PURE__ */ Ve({
1042
1048
  return;
1043
1049
  const {
1044
1050
  zoomRate: h,
1045
- rotateDeg: y,
1051
+ rotateDeg: w,
1046
1052
  enableTransition: p
1047
1053
  } = {
1048
1054
  zoomRate: 0.2,
@@ -1058,39 +1064,39 @@ const Vt = /* @__PURE__ */ Ve({
1058
1064
  d.transform.scale = parseFloat((d.transform.scale + h).toFixed(3));
1059
1065
  break;
1060
1066
  case "clocelise":
1061
- d.transform.deg += y;
1067
+ d.transform.deg += w;
1062
1068
  break;
1063
1069
  case "anticlocelise":
1064
- d.transform.deg -= y;
1070
+ d.transform.deg -= w;
1065
1071
  break;
1066
1072
  }
1067
1073
  d.transform.enableTransition = p;
1068
1074
  }, me = [{
1069
- icon: ((ae = e.icons) == null ? void 0 : ae.close) || c(at, null, null),
1075
+ icon: ((ae = e.icons) == null ? void 0 : ae.close) || c(nt, null, null),
1070
1076
  onClick: (s) => {
1071
1077
  s.stopPropagation(), x(!1);
1072
1078
  },
1073
1079
  type: "close"
1074
1080
  }, {
1075
- icon: ((ie = e.icons) == null ? void 0 : ie.zoomIn) || c(it, null, null),
1081
+ icon: ((ie = e.icons) == null ? void 0 : ie.zoomIn) || c(at, null, null),
1076
1082
  onClick: (s) => {
1077
1083
  s.stopPropagation(), k("zoomIn");
1078
1084
  },
1079
1085
  type: "zoomIn"
1080
1086
  }, {
1081
- icon: ((D = e.icons) == null ? void 0 : D.zoomOut) || c(rt, null, null),
1087
+ icon: ((D = e.icons) == null ? void 0 : D.zoomOut) || c(it, null, null),
1082
1088
  onClick: (s) => {
1083
1089
  s.stopPropagation(), k("zoomOut");
1084
1090
  },
1085
1091
  type: "zoomOut"
1086
1092
  }, {
1087
- icon: ((X = e.icons) == null ? void 0 : X.rotateRight) || c(ot, null, null),
1093
+ icon: ((X = e.icons) == null ? void 0 : X.rotateRight) || c(rt, null, null),
1088
1094
  onClick: (s) => {
1089
1095
  s.stopPropagation(), k("anticlocelise");
1090
1096
  },
1091
1097
  type: "rotateRight"
1092
1098
  }, {
1093
- icon: ((Ce = e.icons) == null ? void 0 : Ce.rotateLeft) || c(st, null, null),
1099
+ icon: ((Ce = e.icons) == null ? void 0 : Ce.rotateLeft) || c(ot, null, null),
1094
1100
  onClick: (s) => {
1095
1101
  s.stopPropagation(), k("clocelise");
1096
1102
  },
@@ -1098,20 +1104,20 @@ const Vt = /* @__PURE__ */ Ve({
1098
1104
  }];
1099
1105
  return q(te, () => {
1100
1106
  Ye(() => {
1101
- j.value.complete || (O.value = !0);
1107
+ B.value.complete || (O.value = !0);
1102
1108
  });
1103
1109
  }), q(g, (s) => {
1104
1110
  R(), t("switch", s);
1105
1111
  }), q(m, (s) => {
1106
1112
  s && (z.value = s);
1107
- }), q([() => m.value, () => F.value], ([s, M]) => {
1108
- var h, y;
1109
- s && M && (ge(), (y = (h = F.value) == null ? void 0 : h.focus) == null || y.call(h));
1113
+ }), q([() => m.value, () => j.value], ([s, M]) => {
1114
+ var h, w;
1115
+ s && M && (ge(), (w = (h = j.value) == null ? void 0 : h.focus) == null || w.call(h));
1110
1116
  }), n({
1111
1117
  setOpen: E
1112
1118
  }), () => {
1113
1119
  const s = $e(`${o}-fade`), M = $e(`${o}-zoom`);
1114
- return l(c(qe, {
1120
+ return l(c(_e, {
1115
1121
  to: e.getContainer || "body",
1116
1122
  disabled: !e.teleported
1117
1123
  }, {
@@ -1122,7 +1128,7 @@ const Vt = /* @__PURE__ */ Ve({
1122
1128
  class: `${o}-mask ${f.value}`
1123
1129
  }, null), [[Oe, m.value && z.value]])]
1124
1130
  }), c("div", {
1125
- ref: F,
1131
+ ref: j,
1126
1132
  tabindex: -1,
1127
1133
  class: [`${o}-wrapper`, `${f.value}`],
1128
1134
  onClick: (h) => e.onHideOnClickModal && he(h)
@@ -1130,7 +1136,7 @@ const Vt = /* @__PURE__ */ Ve({
1130
1136
  onAfterLeave: () => de()
1131
1137
  }), {
1132
1138
  default: () => {
1133
- var h, y;
1139
+ var h, w;
1134
1140
  return [ze(c("div", {
1135
1141
  class: `${o}-block ${f.value}`
1136
1142
  }, [c("div", {
@@ -1150,12 +1156,12 @@ const Vt = /* @__PURE__ */ Ve({
1150
1156
  class: `${o}-operations-operation ${f.value}`,
1151
1157
  onClick: I,
1152
1158
  key: pe
1153
- }, [Qe(p, {
1159
+ }, [qe(p, {
1154
1160
  class: `${o}-operations-icon ${f.value}`
1155
1161
  })]))])]), c("div", {
1156
1162
  class: `${o}-canvas ${f.value}`
1157
1163
  }, [e.urlList.map((p, I) => c("img", {
1158
- ref: j,
1164
+ ref: B,
1159
1165
  class: `${o}-img ${f.value}`,
1160
1166
  style: {
1161
1167
  ...fe.value,
@@ -1169,10 +1175,10 @@ const Vt = /* @__PURE__ */ Ve({
1169
1175
  }, null))]), G.value && c("div", {
1170
1176
  class: [`${o}-switch-left`, g.value === 0 && !e.infinite ? `${o}-switch-left-disabled` : "", `${f.value}`],
1171
1177
  onClick: ne
1172
- }, [((h = e.icons) == null ? void 0 : h.left) || c(lt, null, null)]), G.value && c("div", {
1178
+ }, [((h = e.icons) == null ? void 0 : h.left) || c(st, null, null)]), G.value && c("div", {
1173
1179
  class: [`${o}-switch-right`, g.value === e.urlList.length - 1 && !e.infinite ? `${o}-switch-right-disabled` : "", `${f.value}`],
1174
1180
  onClick: Z
1175
- }, [((y = e.icons) == null ? void 0 : y.right) || c(ut, null, null)])])])]), [[Oe, m.value && z.value]])];
1181
+ }, [((w = e.icons) == null ? void 0 : w.right) || c(lt, null, null)])])])]), [[Oe, m.value && z.value]])];
1176
1182
  }
1177
1183
  })])])]
1178
1184
  }));
@@ -1181,17 +1187,17 @@ const Vt = /* @__PURE__ */ Ve({
1181
1187
  }), Ie = {
1182
1188
  width: "100%",
1183
1189
  height: "100%"
1184
- }, Yt = (e) => ({
1190
+ }, Vt = (e) => ({
1185
1191
  [e.componentCls]: {
1186
1192
  display: "inline-block",
1187
1193
  position: "relative",
1188
1194
  overflow: "hidden",
1189
- ["&-inner"]: {
1195
+ "&-inner": {
1190
1196
  ...Ie,
1191
1197
  verticalAlign: "top",
1192
1198
  opacity: 1
1193
1199
  },
1194
- ["&-placeholder"]: {
1200
+ "&-placeholder": {
1195
1201
  ...Ie,
1196
1202
  backgroundColor: e.colorBgContainerDisabled,
1197
1203
  backgroundImage: "url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",
@@ -1199,7 +1205,7 @@ const Vt = /* @__PURE__ */ Ve({
1199
1205
  backgroundPosition: "center center",
1200
1206
  backgroundSize: "30%"
1201
1207
  },
1202
- ["&-error"]: {
1208
+ "&-error": {
1203
1209
  ...Ie,
1204
1210
  display: "flex",
1205
1211
  alignItems: "center",
@@ -1207,11 +1213,11 @@ const Vt = /* @__PURE__ */ Ve({
1207
1213
  color: e.colorText,
1208
1214
  backgroundColor: e.colorBgContainerDisabled
1209
1215
  },
1210
- ["&-preview"]: {
1216
+ "&-preview": {
1211
1217
  cursor: "pointer"
1212
1218
  }
1213
1219
  }
1214
- }), Wt = (e) => e && e.nodeType === Node.ELEMENT_NODE;
1220
+ }), Yt = (e) => e && e.nodeType === Node.ELEMENT_NODE;
1215
1221
  let Be = "";
1216
1222
  const ue = /* @__PURE__ */ Ve({
1217
1223
  props: le,
@@ -1227,11 +1233,11 @@ const ue = /* @__PURE__ */ Ve({
1227
1233
  }), {
1228
1234
  wrapSSR: r,
1229
1235
  hashId: o
1230
- } = pt("Image", [Yt], i), l = A(), f = A(""), S = A(!1), m = A(!0), E = A(!1), z = A(null), x = A();
1236
+ } = mt("Image", [Vt], i), l = A(), f = A(""), S = A(!1), m = A(!0), E = A(!1), z = A(null), x = A();
1231
1237
  let O, g;
1232
- const F = N(() => !Q && e.fit ? {
1238
+ const j = N(() => !Q && e.fit ? {
1233
1239
  "object-fit": e.fit
1234
- } : {}), j = N(() => {
1240
+ } : {}), B = N(() => {
1235
1241
  const {
1236
1242
  previewSrcList: u
1237
1243
  } = e;
@@ -1245,8 +1251,8 @@ const ue = /* @__PURE__ */ Ve({
1245
1251
  if (T || T === 0)
1246
1252
  return b.length >= T ? T : 0;
1247
1253
  let R = 0;
1248
- const B = b.indexOf(u);
1249
- return B >= 0 && (R = B), R;
1254
+ const V = b.indexOf(u);
1255
+ return V >= 0 && (R = V), R;
1250
1256
  }), d = () => {
1251
1257
  if (Q)
1252
1258
  return;
@@ -1260,16 +1266,16 @@ const ue = /* @__PURE__ */ Ve({
1260
1266
  }), u.src = e.src;
1261
1267
  };
1262
1268
  function G() {
1263
- ct(z.value, x.value) && (d(), te());
1269
+ ut(z.value, x.value) && (d(), te());
1264
1270
  }
1265
- const K = bt(G, 200), ee = async () => {
1271
+ const K = pt(G, 200), ee = async () => {
1266
1272
  if (Q)
1267
1273
  return;
1268
1274
  await Ye();
1269
1275
  const {
1270
1276
  scrollContainer: u
1271
1277
  } = e;
1272
- Wt(u) ? x.value = u : ft(u) && u !== "" ? x.value = document.querySelector(u) ?? void 0 : z.value && (x.value = dt(z.value)), x.value && (O = Ee(x, "scroll", K), setTimeout(() => G(), 200));
1278
+ Yt(u) ? x.value = u : ct(u) && u !== "" ? x.value = document.querySelector(u) ?? void 0 : z.value && (x.value = ft(z.value)), x.value && (O = Ee(x, "scroll", K), setTimeout(() => G(), 200));
1273
1279
  }, te = () => {
1274
1280
  Q || !x.value || !K || (O(), x.value = void 0);
1275
1281
  }, fe = (u) => {
@@ -1284,7 +1290,7 @@ const ue = /* @__PURE__ */ Ve({
1284
1290
  return u.preventDefault(), !1;
1285
1291
  }
1286
1292
  }, ge = () => {
1287
- !j.value || e.disablePreview || (g = Ee("wheel", he, {
1293
+ !B.value || e.disablePreview || (g = Ee("wheel", he, {
1288
1294
  passive: !1
1289
1295
  }), Be = document.body.style.overflow, document.body.style.overflow = "hidden", E.value = !0);
1290
1296
  }, ve = () => {
@@ -1293,8 +1299,8 @@ const ue = /* @__PURE__ */ Ve({
1293
1299
  q(() => e.src, () => {
1294
1300
  e.lazy ? (m.value = !0, S.value = !1, te(), ee()) : d();
1295
1301
  });
1296
- const U = (u) => ht(u) ? u + "px" : u;
1297
- return gt(() => {
1302
+ const U = (u) => dt(u) ? u + "px" : u;
1303
+ return ht(() => {
1298
1304
  e.lazy ? ee() : d();
1299
1305
  }), () => {
1300
1306
  const {
@@ -1302,7 +1308,7 @@ const ue = /* @__PURE__ */ Ve({
1302
1308
  decoding: b,
1303
1309
  alt: T,
1304
1310
  sizes: R,
1305
- srcset: B,
1311
+ srcset: V,
1306
1312
  usemap: ne,
1307
1313
  class: Z,
1308
1314
  style: k = {}
@@ -1311,17 +1317,17 @@ const ue = /* @__PURE__ */ Ve({
1311
1317
  decoding: b,
1312
1318
  alt: T,
1313
1319
  sizes: R,
1314
- srcset: B,
1320
+ srcset: V,
1315
1321
  usemap: ne,
1316
1322
  style: {
1317
- ...F.value,
1323
+ ...j.value,
1318
1324
  height: e.height ? U(e.height) : void 0
1319
1325
  }
1320
1326
  }, ae = Le(t, e, "fallback"), ie = Le(t, e, "placeholder");
1321
- return Je(() => {
1327
+ return Qe(() => {
1322
1328
  var D, X;
1323
- j.value && E.value ? (D = l.value) == null || D.setOpen(!0) : (X = l.value) == null || X.setOpen(!1);
1324
- }), r(c(Ke, null, [c("div", {
1329
+ B.value && E.value ? (D = l.value) == null || D.setOpen(!0) : (X = l.value) == null || X.setOpen(!1);
1330
+ }), r(c(Je, null, [c("div", {
1325
1331
  class: {
1326
1332
  [`${o.value}`]: !0,
1327
1333
  [`${i}`]: !0,
@@ -1341,17 +1347,17 @@ const ue = /* @__PURE__ */ Ve({
1341
1347
  class: `${i}-placeholder ${o.value}`
1342
1348
  }, null) : S.value ? ae || c("div", {
1343
1349
  class: `${i}-error ${o.value}`
1344
- }, [et("加载失败")]) : f.value && c("img", We(me, {
1350
+ }, [Ke("加载失败")]) : f.value && c("img", We(me, {
1345
1351
  class: {
1346
1352
  [`${o.value}`]: !0,
1347
1353
  [`${e.imageClassName}`]: !!e.imageClassName,
1348
1354
  [`${i}-inner`]: !0,
1349
- [`${i}-preview`]: j.value
1355
+ [`${i}-preview`]: B.value
1350
1356
  },
1351
1357
  alt: e.alt,
1352
1358
  src: f.value,
1353
1359
  onClick: () => ge()
1354
- }), null), c(Vt, {
1360
+ }), null), c(Bt, {
1355
1361
  ref: l,
1356
1362
  zIndex: e.zIndex,
1357
1363
  infinite: e.infinite,
@@ -1368,8 +1374,8 @@ ue.isWImage = !0;
1368
1374
  ue.install = (e) => (e.component(ue.name, ue), e);
1369
1375
  export {
1370
1376
  ue as GImage,
1371
- Vt as ImageViewer,
1377
+ Bt as ImageViewer,
1372
1378
  ue as default,
1373
1379
  le as gImagePorps,
1374
- yt as gImageViewProps
1380
+ bt as gImageViewProps
1375
1381
  };
@@ -0,0 +1 @@
1
+ (function(g,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("vue-types"),require("vue"),require("@ant-design/icons-vue"),require("@gx-design-vue/pro-utils"),require("@gx-design-vue/pro-hooks"),require("@gx-design-vue/pro-provider"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue-types","vue","@ant-design/icons-vue","@gx-design-vue/pro-utils","@gx-design-vue/pro-hooks","@gx-design-vue/pro-provider","@vueuse/core"],_):(g=typeof globalThis<"u"?globalThis:g||self,_(g.GImage={},g.vueTypes,g.vue,g.iconsVue,g.proUtils,g.proHooks,g.proProvider,g.core))})(this,function(g,_,i,z,w,ue,O,de){"use strict";const D=_.createTypes({func:void 0,bool:void 0,string:void 0,number:void 0,array:void 0,object:void 0,integer:void 0});D.extend([{name:"looseBool",getter:!0,type:Boolean,default:void 0},{name:"style",getter:!0,type:[String,Object],default:void 0},{name:"VueNode",getter:!0,type:null}]);const H={infinite:{type:Boolean,default:!0},zIndex:{type:Number,default:2e3},initialIndex:{type:Number,default:0},getContainer:{type:String}},Z={previewTeleported:{type:Boolean,default:!0},hideOnClickModal:{type:Boolean,default:!0},src:{type:String,default:""},alt:{type:String,default:""},fit:{type:String,default:"contain"},lazy:D.bool,scrollContainer:{type:[String,Object]},placeholder:{type:[Function,Object],default:()=>{}},fallback:{type:[Function,Object],default:()=>{}},onLoad:{type:Function},onError:{type:Function},onClick:{type:Function},disablePreview:D.bool,previewSrcList:{type:Array,default:()=>[]},imageClassName:D.string,imageStyle:D.style,width:D.number,height:D.number,zIndex:H.zIndex,infinite:H.infinite,getContainer:H.getContainer,initialIndex:{...H.initialIndex,default:()=>{}}},Te={urlList:{type:Array,default:()=>[]},teleported:Z.previewTeleported,zIndex:H.zIndex,initialIndex:H.initialIndex,infinite:H.infinite,getContainer:Z.getContainer,onHideOnClickModal:Z.hideOnClickModal,icons:{type:Object,default:()=>({})}};function m(e,t){Pe(e)&&(e="100%");var n=je(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function ne(e){return Math.min(1,Math.max(0,e))}function Pe(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function je(e){return typeof e=="string"&&e.indexOf("%")!==-1}function ke(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ae(e){return e<=1?"".concat(Number(e)*100,"%"):e}function F(e){return e.length===1?"0"+e:String(e)}function Ve(e,t,n){return{r:m(e,255)*255,g:m(t,255)*255,b:m(n,255)*255}}function ze(e,t,n){e=m(e,255),t=m(t,255),n=m(n,255);var a=Math.max(e,t,n),r=Math.min(e,t,n),o=0,s=0,c=(a+r)/2;if(a===r)s=0,o=0;else{var u=a-r;switch(s=c>.5?u/(2-a-r):u/(a+r),a){case e:o=(t-n)/u+(t<n?6:0);break;case t:o=(n-e)/u+2;break;case n:o=(e-t)/u+4;break}o/=6}return{h:o,s,l:c}}function he(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Be(e,t,n){var a,r,o;if(e=m(e,360),t=m(t,100),n=m(n,100),t===0)r=n,o=n,a=n;else{var s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;a=he(c,s,e+1/3),r=he(c,s,e),o=he(c,s,e-1/3)}return{r:a*255,g:r*255,b:o*255}}function Oe(e,t,n){e=m(e,255),t=m(t,255),n=m(n,255);var a=Math.max(e,t,n),r=Math.min(e,t,n),o=0,s=a,c=a-r,u=a===0?0:c/a;if(a===r)o=0;else{switch(a){case e:o=(t-n)/c+(t<n?6:0);break;case t:o=(n-e)/c+2;break;case n:o=(e-t)/c+4;break}o/=6}return{h:o,s:u,v:s}}function Ye(e,t,n){e=m(e,360)*6,t=m(t,100),n=m(n,100);var a=Math.floor(e),r=e-a,o=n*(1-t),s=n*(1-r*t),c=n*(1-(1-r)*t),u=a%6,I=[n,s,o,o,c,n][u],v=[c,n,n,s,o,o][u],P=[o,o,c,n,n,s][u];return{r:I*255,g:v*255,b:P*255}}function Le(e,t,n,a){var r=[F(Math.round(e).toString(16)),F(Math.round(t).toString(16)),F(Math.round(n).toString(16))];return a&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function We(e,t,n,a,r){var o=[F(Math.round(e).toString(16)),F(Math.round(t).toString(16)),F(Math.round(n).toString(16)),F(Ge(a))];return r&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function Ge(e){return Math.round(parseFloat(e)*255).toString(16)}function Ee(e){return y(e)/255}function y(e){return parseInt(e,16)}function qe(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var ge={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function _e(e){var t={r:0,g:0,b:0},n=1,a=null,r=null,o=null,s=!1,c=!1;return typeof e=="string"&&(e=Qe(e)),typeof e=="object"&&(L(e.r)&&L(e.g)&&L(e.b)?(t=Ve(e.r,e.g,e.b),s=!0,c=String(e.r).substr(-1)==="%"?"prgb":"rgb"):L(e.h)&&L(e.s)&&L(e.v)?(a=ae(e.s),r=ae(e.v),t=Ye(e.h,a,r),s=!0,c="hsv"):L(e.h)&&L(e.s)&&L(e.l)&&(a=ae(e.s),o=ae(e.l),t=Be(e.h,a,o),s=!0,c="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=ke(n),{ok:s,format:e.format||c,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var Ze="[-\\+]?\\d+%?",Xe="[-\\+]?\\d*\\.\\d+%?",$="(?:".concat(Xe,")|(?:").concat(Ze,")"),me="[\\s|\\(]+(".concat($,")[,|\\s]+(").concat($,")[,|\\s]+(").concat($,")\\s*\\)?"),pe="[\\s|\\(]+(".concat($,")[,|\\s]+(").concat($,")[,|\\s]+(").concat($,")[,|\\s]+(").concat($,")\\s*\\)?"),N={CSS_UNIT:new RegExp($),rgb:new RegExp("rgb"+me),rgba:new RegExp("rgba"+pe),hsl:new RegExp("hsl"+me),hsla:new RegExp("hsla"+pe),hsv:new RegExp("hsv"+me),hsva:new RegExp("hsva"+pe),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Qe(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(ge[e])e=ge[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=N.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=N.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=N.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=N.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=N.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=N.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=N.hex8.exec(e),n?{r:y(n[1]),g:y(n[2]),b:y(n[3]),a:Ee(n[4]),format:t?"name":"hex8"}:(n=N.hex6.exec(e),n?{r:y(n[1]),g:y(n[2]),b:y(n[3]),format:t?"name":"hex"}:(n=N.hex4.exec(e),n?{r:y(n[1]+n[1]),g:y(n[2]+n[2]),b:y(n[3]+n[3]),a:Ee(n[4]+n[4]),format:t?"name":"hex8"}:(n=N.hex3.exec(e),n?{r:y(n[1]+n[1]),g:y(n[2]+n[2]),b:y(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function L(e){return!!N.CSS_UNIT.exec(String(e))}var X=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var a;if(t instanceof e)return t;typeof t=="number"&&(t=qe(t)),this.originalInput=t;var r=_e(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(a=n.format)!==null&&a!==void 0?a:r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,a,r,o=t.r/255,s=t.g/255,c=t.b/255;return o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),s<=.03928?a=s/12.92:a=Math.pow((s+.055)/1.055,2.4),c<=.03928?r=c/12.92:r=Math.pow((c+.055)/1.055,2.4),.2126*n+.7152*a+.0722*r},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=ke(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=Oe(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=Oe(this.r,this.g,this.b),n=Math.round(t.h*360),a=Math.round(t.s*100),r=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(a,"%, ").concat(r,"%)"):"hsva(".concat(n,", ").concat(a,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=ze(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=ze(this.r,this.g,this.b),n=Math.round(t.h*360),a=Math.round(t.s*100),r=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(a,"%, ").concat(r,"%)"):"hsla(".concat(n,", ").concat(a,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),Le(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),We(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),a=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(a,")"):"rgba(".concat(t,", ").concat(n,", ").concat(a,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(m(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(m(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+Le(this.r,this.g,this.b,!1),n=0,a=Object.entries(ge);n<a.length;n++){var r=a[n],o=r[0],s=r[1];if(t===s)return o}return!1},e.prototype.toString=function(t){var n=!!t;t=t??this.format;var a=!1,r=this.a<1&&this.a>=0,o=!n&&r&&(t.startsWith("hex")||t==="name");return o?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(a=this.toRgbString()),t==="prgb"&&(a=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(a=this.toHexString()),t==="hex3"&&(a=this.toHexString(!0)),t==="hex4"&&(a=this.toHex8String(!0)),t==="hex8"&&(a=this.toHex8String()),t==="name"&&(a=this.toName()),t==="hsl"&&(a=this.toHslString()),t==="hsv"&&(a=this.toHsvString()),a||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=ne(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=ne(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=ne(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=ne(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),a=(n.h+t)%360;return n.h=a<0?360+a:a,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var a=this.toRgb(),r=new e(t).toRgb(),o=n/100,s={r:(r.r-a.r)*o+a.r,g:(r.g-a.g)*o+a.g,b:(r.b-a.b)*o+a.b,a:(r.a-a.a)*o+a.a};return new e(s)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var a=this.toHsl(),r=360/n,o=[this];for(a.h=(a.h-(r*t>>1)+720)%360;--t;)a.h=(a.h+r)%360,o.push(new e(a));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),a=n.h,r=n.s,o=n.v,s=[],c=1/t;t--;)s.push(new e({h:a,s:r,v:o})),o=(o+c)%1;return s},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),a=new e(t).toRgb();return new e({r:a.r+(n.r-a.r)*n.a,g:a.g+(n.g-a.g)*n.a,b:a.b+(n.b-a.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),a=n.h,r=[this],o=360/t,s=1;s<t;s++)r.push(new e({h:(a+s*o)%360,s:n.s,l:n.l}));return r},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();const Ke=new O.Keyframe("viewFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),Je=new O.Keyframe("viewFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),Ue=new O.Keyframe("viewZoomBadgeIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),et=new O.Keyframe("viewZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),Re=e=>({position:e||"absolute",inset:0});function ve(e){return{position:e,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0}}const tt=e=>({boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none",fontFamily:e.fontFamily}),nt=e=>{const{componentCls:t,modalMaskBg:n,paddingSM:a,previewOperationColorDisabled:r,motionDurationSlow:o}=e,s=new X(n).setAlpha(.1),c=s.clone().setAlpha(.2);return{[`${t}-operations`]:{...tt(e),display:"flex",flexDirection:"row-reverse",alignItems:"center",color:e.previewOperationColor,listStyle:"none",background:s.toRgbString(),pointerEvents:"auto","&-operation":{marginInlineStart:a,padding:a,cursor:"pointer",transition:`all ${o}`,userSelect:"none","&:hover":{background:c.toRgbString()},"&-disabled":{color:r,pointerEvents:"none"},"&:last-of-type":{marginInlineStart:0}},"&-progress":{position:"absolute",left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%)"},"&-icon":{fontSize:e.previewOperationSize}}}},at=e=>{const{modalMaskBg:t,previewOperationColorDisabled:n,zIndexPopup:a,motionDurationSlow:r}=e,o=new X(t).setAlpha(.1),s=o.clone().setAlpha(.2);return{[`${e.componentCls}-switch-left, ${e.componentCls}-switch-right`]:{position:"fixed",insetBlockStart:"50%",zIndex:a+1,display:"flex",alignItems:"center",justifyContent:"center",width:e.imagePreviewSwitchSize,height:e.imagePreviewSwitchSize,marginTop:-e.imagePreviewSwitchSize/2,color:e.previewOperationColor,background:o.toRgbString(),borderRadius:"50%",transform:"translateY(-50%)",cursor:"pointer",transition:`all ${r}`,pointerEvents:"auto",userSelect:"none","&:hover":{background:s.toRgbString()},"&-disabled":{"&, &:hover":{color:n,background:"transparent",cursor:"not-allowed",[`> ${e.iconCls}`]:{cursor:"not-allowed"}}},[`> ${e.iconCls}`]:{fontSize:e.previewOperationSize}},[`${e.componentCls}-switch-left`]:{insetInlineStart:e.marginSM},[`${e.componentCls}-switch-right`]:{insetInlineEnd:e.marginSM}}},rt=e=>({[e.componentCls]:{"&-root":{...ve("fixed"),zIndex:e.zIndexPopup,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"},"&-wrapper":{...ve("fixed"),zIndex:e.zIndexPopup,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"},"&-mask":{...ve("fixed"),zIndex:e.zIndexPopupBase,height:"100%",backgroundColor:e.colorBgMask},"&-block":{height:"100%",textAlign:"center",pointerEvents:"none"},"&-body":{...Re(),overflow:"hidden"},"&-canvas":{...Re(),display:"flex",justifyContent:"center",alignItems:"center","&::before":{display:"inline-block",width:1,height:"50%",marginInlineEnd:-1,content:'""'}},"&-img":{maxWidth:"100%",maxHeight:"100%",verticalAlign:"middle",transform:"scale3d(1, 1, 1)",cursor:"grab",transition:`transform ${e.motionDurationSlow} ${e.motionEaseOut} 0s`,userSelect:"none",pointerEvents:"auto"},"&-fade-appear, &-fade-enter":{animationName:Ke,animationDuration:e.motionDurationSlow,animationTimingFunction:"linear"},"&-fade-leave":{animationName:Je,animationDuration:e.motionDurationSlow,animationTimingFunction:"linear"},"&-zoom-appear, &-zoom-enter":{animationName:Ue,opacity:0,animationTimingFunction:e.motionEaseOutCirc,animationFillMode:"both",transform:"none",animationDuration:e.motionDurationSlow,userSelect:"none"},"&-zoom-enter-active":{animationPlayState:"running"},"&-zoom-leave":{animationName:et,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"}},[`${e.componentCls}-root`]:{[`${e.componentCls}-wrapper`]:{zIndex:e.zIndexPopup}},[`${e.componentCls}-operations-wrapper`]:{position:"fixed",insetBlockStart:0,insetInlineEnd:0,zIndex:e.zIndexPopup+1,width:"100%"},"&":[nt(e),at(e)]});function it(e){return O.useStyle("ImageView",t=>{const n=O.mergeToken(t,{zIndexPopup:t.zIndexPopupBase+80,previewOperationColorDisabled:new X(t.colorTextLightSolid).setAlpha(.25).toRgbString(),modalMaskBg:new X("#000").setAlpha(.45).toRgbString(),previewOperationColor:new X(t.colorTextLightSolid).toRgbString(),previewOperationSize:t.fontSizeIcon*1.5,imagePreviewSwitchSize:t.controlHeightLG,iconCls:"anticon"});return[rt(n)]},e)}const B={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace"},re=function(e,t,n,a=!1){e&&t&&n&&e.addEventListener(t,n,a)},be=function(e,t,n,a=!1){e&&t&&n&&e.removeEventListener(t,n,a)},Q={CONTAIN:{name:"contain",icon:i.createVNode(z.ExpandOutlined,null,null)},ORIGINAL:{name:"original",icon:i.createVNode(z.OneToOneOutlined,null,null)}},$e=function(){return!w.isServer&&!!window.navigator.userAgent.match(/firefox/i)}()?"DOMMouseScroll":"mousewheel";function we(e){let t=!1;return function(...n){t||(t=!0,window.requestAnimationFrame(()=>{e.apply(this,n),t=!1}))}}const De=i.defineComponent({props:Te,emits:["close","switch"],setup:function(e,{emit:t,expose:n}){var ce,fe,V,te,Fe;let a=null,r=null,o=null;const s=w.getPrefixCls({suffixCls:"image-viewer"}),{wrapSSR:c,hashId:u}=it(s),I=i.shallowRef(!1),[v,P]=ue.useState(!1),[E,M]=ue.useState(!1),R=i.ref(!0),p=i.ref(e.initialIndex),W=i.ref(null),G=i.ref(null),K=i.ref(Q.CONTAIN),d=i.reactive({transform:{scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}}),J=i.computed(()=>e.urlList.length>1),ie=i.computed(()=>p.value===0),oe=i.computed(()=>p.value===e.urlList.length-1),se=i.computed(()=>e.urlList[p.value]),Se=i.computed(()=>{const{scale:l,deg:A,offsetX:h,offsetY:x,enableTransition:b}=d.transform,C={transform:`scale(${l}) rotate(${A}deg)`,transition:b?"transform .3s":"",marginLeft:`${h}px`,marginTop:`${x}px`};return K.value.name===Q.CONTAIN.name&&(C.maxWidth=C.maxHeight="100%"),C}),xe=()=>{Ae(),t("close"),d.transform={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},Ie=l=>{I.value?I.value=!1:W.value===(l==null?void 0:l.target)&&(M(!1),p.value=e.initialIndex)},Me=()=>{a=we(l=>{switch(l.code){case B.esc:M(!1);break;case B.space:q();break;case B.left:le();break;case B.up:k("zoomIn");break;case B.right:ee();break;case B.down:k("zoomOut");break}}),r=we(l=>{(l.wheelDelta?l.wheelDelta:-l.detail)>0?k("zoomIn",{zoomRate:.015,enableTransition:!1}):k("zoomOut",{zoomRate:.015,enableTransition:!1})}),re(document,"keydown",a),re(document,$e,r)},Ae=()=>{be(document,"keydown",a),be(document,$e,r),a=null,r=null},U=()=>{R.value=!1},f=l=>{R.value=!1,l.target.alt="加载失败"},S=i.shallowRef(),T=l=>{if(R.value||l.button!==0)return;l.preventDefault(),l.stopPropagation(),clearTimeout(S.value),I.value=!0;const{offsetX:A,offsetY:h}=d.transform,x=l.pageX,b=l.pageY;o=we(C=>{d.transform={...d.transform,offsetX:A+C.pageX-x,offsetY:h+C.pageY-b}}),re(document,"mousemove",o),re(document,"mouseup",()=>{be(document,"mousemove",o),v.value&&E.value&&(S.value=setTimeout(()=>{I.value=!1}))})},j=()=>{d.transform={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},q=()=>{if(R.value)return;const l=Object.keys(Q),A=Object.values(Q),h=K.value.name,b=(A.findIndex(C=>C.name===h)+1)%l.length;K.value=Q[l[b]],j()},le=()=>{if(ie.value&&!e.infinite)return;const l=e.urlList.length;p.value=(p.value-1+l)%l},ee=()=>{if(oe.value&&!e.infinite)return;const l=e.urlList.length;p.value=(p.value+1)%l},k=(l,A={})=>{if(R.value)return;const{zoomRate:h,rotateDeg:x,enableTransition:b}={zoomRate:.2,rotateDeg:90,enableTransition:!0,...A};switch(l){case"zoomOut":d.transform.scale>.2&&(d.transform.scale=parseFloat((d.transform.scale-h).toFixed(3)));break;case"zoomIn":d.transform.scale=parseFloat((d.transform.scale+h).toFixed(3));break;case"clocelise":d.transform.deg+=x;break;case"anticlocelise":d.transform.deg-=x;break}d.transform.enableTransition=b},Ce=[{icon:((ce=e.icons)==null?void 0:ce.close)||i.createVNode(z.CloseOutlined,null,null),onClick:l=>{l.stopPropagation(),M(!1)},type:"close"},{icon:((fe=e.icons)==null?void 0:fe.zoomIn)||i.createVNode(z.ZoomInOutlined,null,null),onClick:l=>{l.stopPropagation(),k("zoomIn")},type:"zoomIn"},{icon:((V=e.icons)==null?void 0:V.zoomOut)||i.createVNode(z.ZoomOutOutlined,null,null),onClick:l=>{l.stopPropagation(),k("zoomOut")},type:"zoomOut"},{icon:((te=e.icons)==null?void 0:te.rotateRight)||i.createVNode(z.RotateRightOutlined,null,null),onClick:l=>{l.stopPropagation(),k("anticlocelise")},type:"rotateRight"},{icon:((Fe=e.icons)==null?void 0:Fe.rotateLeft)||i.createVNode(z.RotateLeftOutlined,null,null),onClick:l=>{l.stopPropagation(),k("clocelise")},type:"rotateLeft"}];return i.watch(se,()=>{i.nextTick(()=>{G.value.complete||(R.value=!0)})}),i.watch(p,l=>{j(),t("switch",l)}),i.watch(v,l=>{l&&(E.value=l)}),i.watch([()=>v.value,()=>W.value],([l,A])=>{var h,x;l&&A&&(Me(),(x=(h=W.value)==null?void 0:h.focus)==null||x.call(h))}),n({setOpen:P}),()=>{const l=O.getTransitionProps(`${s}-fade`),A=O.getTransitionProps(`${s}-zoom`);return c(i.createVNode(i.Teleport,{to:e.getContainer||"body",disabled:!e.teleported},{default:()=>[v.value&&i.createVNode("div",{class:`${s}-root ${u.value}`},[i.createVNode(i.Transition,l,{default:()=>[i.withDirectives(i.createVNode("div",{class:`${s}-mask ${u.value}`},null),[[i.vShow,v.value&&E.value]])]}),i.createVNode("div",{ref:W,tabindex:-1,class:[`${s}-wrapper`,`${u.value}`],onClick:h=>e.onHideOnClickModal&&Ie(h)},[i.createVNode(i.Transition,i.mergeProps(A,{onAfterLeave:()=>xe()}),{default:()=>{var h,x;return[i.withDirectives(i.createVNode("div",{class:`${s}-block ${u.value}`},[i.createVNode("div",{class:`${s}-content ${u.value}`},[i.createVNode("div",{class:`${s}-body ${u.value}`},[i.createVNode("div",{class:`${s}-operations-wrapper ${u.value}`,onClick:b=>b.stopPropagation()},[i.createVNode("ul",{class:`${s}-operations ${u.value}`},[Ce.map(({icon:b,onClick:C,type:Ne})=>i.createVNode("li",{class:`${s}-operations-operation ${u.value}`,onClick:C,key:Ne},[i.cloneVNode(b,{class:`${s}-operations-icon ${u.value}`})]))])]),i.createVNode("div",{class:`${s}-canvas ${u.value}`},[e.urlList.map((b,C)=>i.createVNode("img",{ref:G,class:`${s}-img ${u.value}`,style:{...Se.value,display:C===p.value?"block":"none"},key:b,src:b,onLoad:()=>U(),onError:Ne=>f(Ne),onMousedown:T},null))]),J.value&&i.createVNode("div",{class:[`${s}-switch-left`,p.value===0&&!e.infinite?`${s}-switch-left-disabled`:"",`${u.value}`],onClick:le},[((h=e.icons)==null?void 0:h.left)||i.createVNode(z.LeftOutlined,null,null)]),J.value&&i.createVNode("div",{class:[`${s}-switch-right`,p.value===e.urlList.length-1&&!e.infinite?`${s}-switch-right-disabled`:"",`${u.value}`],onClick:ee},[((x=e.icons)==null?void 0:x.right)||i.createVNode(z.RightOutlined,null,null)])])])]),[[i.vShow,v.value&&E.value]])]}})])])]}))}}}),ye={width:"100%",height:"100%"},ot=e=>({[e.componentCls]:{display:"inline-block",position:"relative",overflow:"hidden","&-inner":{...ye,verticalAlign:"top",opacity:1},"&-placeholder":{...ye,backgroundColor:e.colorBgContainerDisabled,backgroundImage:"url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundSize:"30%"},"&-error":{...ye,display:"flex",alignItems:"center",justifyContent:"center",color:e.colorText,backgroundColor:e.colorBgContainerDisabled},"&-preview":{cursor:"pointer"}}}),st=e=>e&&e.nodeType===Node.ELEMENT_NODE;let He="";const Y=i.defineComponent({props:Z,name:"GImage",emits:["error","click","load"],setup(e,{slots:t,emit:n,attrs:a}){const r=w.getPrefixCls({suffixCls:"image"}),{wrapSSR:o,hashId:s}=O.useProStyle("Image",[ot],r),c=i.ref(),u=i.ref(""),I=i.ref(!1),v=i.ref(!0),P=i.ref(!1),E=i.ref(null),M=i.ref();let R,p;const W=i.computed(()=>!w.isServer&&e.fit?{"object-fit":e.fit}:{}),G=i.computed(()=>{const{previewSrcList:f}=e;return Array.isArray(f)&&f.length>0}),K=i.computed(()=>{const{src:f,previewSrcList:S,initialIndex:T}=e;if(T||T===0)return S.length>=T?T:0;let j=0;const q=S.indexOf(f);return q>=0&&(j=q),j}),d=()=>{if(w.isServer)return;v.value=!0,I.value=!1;const f=new Image;f.onload=S=>Se(S),f.onerror=xe,Object.keys(a||{}).forEach(S=>{if(S.toLowerCase()==="onload")return;const T=(a||{})[S];f.setAttribute(S,T)}),f.src=e.src};function J(){w.isInContainer(E.value,M.value)&&(d(),se())}const ie=de.useThrottleFn(J,200),oe=async()=>{if(w.isServer)return;await i.nextTick();const{scrollContainer:f}=e;st(f)?M.value=f:w.isString(f)&&f!==""?M.value=document.querySelector(f)??void 0:E.value&&(M.value=w.getScrollContainer(E.value)),M.value&&(R=de.useEventListener(M,"scroll",ie),setTimeout(()=>J(),200))},se=()=>{w.isServer||!M.value||!ie||(R(),M.value=void 0)},Se=f=>{u.value=e.src,v.value=!1,I.value=!1,n("load",f)},xe=f=>{v.value=!1,I.value=!0,n("error",f)},Ie=f=>{if(f.ctrlKey){if(f.deltaY<0)return f.preventDefault(),!1;if(f.deltaY>0)return f.preventDefault(),!1}},Me=()=>{!G.value||e.disablePreview||(p=de.useEventListener("wheel",Ie,{passive:!1}),He=document.body.style.overflow,document.body.style.overflow="hidden",P.value=!0)},Ae=()=>{p==null||p(),document.body.style.overflow=He,P.value=!1};i.watch(()=>e.src,()=>{e.lazy?(v.value=!0,I.value=!1,se(),oe()):d()});const U=f=>w.isNumber(f)?f+"px":f;return ue.onMountedOrActivated(()=>{e.lazy?oe():d()}),()=>{const{crossorigin:f,decoding:S,alt:T,sizes:j,srcset:q,usemap:le,class:ee,style:k={}}=a,Ce={crossorigin:f,decoding:S,alt:T,sizes:j,srcset:q,usemap:le,style:{...W.value,height:e.height?U(e.height):void 0}},ce=w.getSlotVNode(t,e,"fallback"),fe=w.getSlotVNode(t,e,"placeholder");return i.watchEffect(()=>{var V,te;G.value&&P.value?(V=c.value)==null||V.setOpen(!0):(te=c.value)==null||te.setOpen(!1)}),o(i.createVNode(i.Fragment,null,[i.createVNode("div",{class:{[`${s.value}`]:!0,[`${r}`]:!0,[`${ee}`]:!!ee},ref:V=>E.value=V,style:{width:e.width?U(e.width):void 0,height:e.height?U(e.height):void 0,display:e.lazy?"block":void 0,...k},onClick:()=>{n("click")}},[v.value?fe||i.createVNode("div",{class:`${r}-placeholder ${s.value}`},null):I.value?ce||i.createVNode("div",{class:`${r}-error ${s.value}`},[i.createTextVNode("加载失败")]):u.value&&i.createVNode("img",i.mergeProps(Ce,{class:{[`${s.value}`]:!0,[`${e.imageClassName}`]:!!e.imageClassName,[`${r}-inner`]:!0,[`${r}-preview`]:G.value},alt:e.alt,src:u.value,onClick:()=>Me()}),null),i.createVNode(De,{ref:c,zIndex:e.zIndex,infinite:e.infinite,initialIndex:K.value,urlList:e.previewSrcList,getContainer:e.getContainer,onHideOnClickModal:e.hideOnClickModal,onClose:()=>Ae()},null)])]))}}});Y.isWImage=!0,Y.install=e=>(e.component(Y.name,Y),e),g.GImage=Y,g.ImageViewer=De,g.default=Y,g.gImagePorps=Z,g.gImageViewProps=Te,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gx-design-vue/image",
3
- "version": "0.2.0-beta.12",
3
+ "version": "0.2.0-beta.14",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "vite build",
@@ -13,22 +13,23 @@
13
13
  "files": [
14
14
  "dist"
15
15
  ],
16
+ "type": "module",
16
17
  "types": "./dist",
17
- "main": "./dist/image.umd.js",
18
- "module": "./dist/image.mjs",
18
+ "main": "./dist/image.umd.cjs",
19
+ "module": "./dist/image.js",
19
20
  "exports": {
20
21
  ".": {
21
- "import": "./dist/image.mjs",
22
- "require": "./dist/image.umd.js"
22
+ "import": "./dist/image.js",
23
+ "require": "./dist/image.umd.cjs"
23
24
  }
24
25
  },
25
26
  "dependencies": {
26
27
  "@vueuse/core": "^9.10.0",
27
- "@gx-design-vue/pro-utils": "^0.2.0-beta.19",
28
- "@gx-design-vue/pro-hooks": "^0.2.0-beta.14",
29
- "@gx-design-vue/pro-provider": "^0.1.0-beta.46",
30
- "ant-design-vue": "^4.0.0",
31
- "vue": "^3.2.45",
28
+ "@gx-design-vue/pro-utils": "^0.2.0-beta.25",
29
+ "@gx-design-vue/pro-hooks": "^0.2.0-beta.18",
30
+ "@gx-design-vue/pro-provider": "^0.1.0-beta.49",
31
+ "ant-design-vue": "^4.1.2",
32
+ "vue": "^3.3.7",
32
33
  "vue-types": "^4.1.1"
33
34
  },
34
35
  "devDependencies": {
@@ -36,32 +37,34 @@
36
37
  "@rushstack/eslint-patch": "^1.1.0",
37
38
  "@types/lodash-es": "^4.17.6",
38
39
  "@types/jsdom": "^16.2.14",
39
- "@types/node": "^16.11.26",
40
- "@vitejs/plugin-vue": "^4.2.3",
41
- "@vitejs/plugin-vue-jsx": "^3.0.1",
42
- "@vue/eslint-config-prettier": "^7.0.0",
43
- "@vue/eslint-config-typescript": "^10.0.0",
44
- "@vue/tsconfig": "^0.1.3",
45
- "eslint": "^8.13.0",
46
- "eslint-plugin-prettier": "^4.0.0",
47
- "eslint-plugin-vue": "^8.6.0",
40
+ "@types/node": "^20.11.19",
41
+ "@typescript-eslint/eslint-plugin": "^7.0.1",
42
+ "@typescript-eslint/parser": "^7.0.1",
43
+ "@vitejs/plugin-vue": "^5.0.4",
44
+ "@vitejs/plugin-vue-jsx": "^3.1.0",
45
+ "eslint": "^8.56.0",
46
+ "eslint-config-prettier": "^9.1.0",
47
+ "eslint-plugin-import": "^2.29.1",
48
+ "eslint-plugin-prettier": "^5.1.3",
49
+ "eslint-plugin-simple-import-sort": "^12.0.0",
50
+ "eslint-plugin-vue": "^9.21.1",
48
51
  "jsdom": "^19.0.0",
49
52
  "less": "^4.1.2",
50
- "postcss": "^8.4.12",
51
- "postcss-html": "^1.4.1",
52
- "postcss-less": "^6.0.0",
53
- "prettier": "^2.6.2",
54
53
  "rollup": "^2.70.2",
55
- "stylelint": "^14.7.1",
56
- "stylelint-config-prettier": "^9.0.3",
57
- "stylelint-config-recommended": "^7.0.0",
58
- "stylelint-config-recommended-vue": "^1.4.0",
54
+ "postcss": "^8.4.35",
55
+ "postcss-html": "^1.6.0",
56
+ "postcss-less": "^6.0.0",
57
+ "prettier": "^3.2.5",
58
+ "stylelint": "^16.2.1",
59
+ "stylelint-config-recommended": "^14.0.0",
60
+ "stylelint-config-recommended-vue": "^1.5.0",
59
61
  "stylelint-config-standard": "^25.0.0",
60
- "stylelint-order": "^5.0.0",
61
- "typescript": "^4.6.4",
62
- "vite": "^4.3.8",
63
- "vue-eslint-parser": "^9.0.3",
64
- "vue-tsc": "^1.0.24"
62
+ "stylelint-order": "^6.0.4",
63
+ "stylelint-prettier": "^5.0.0",
64
+ "typescript": "^5.3.3",
65
+ "vite": "^5.1.4",
66
+ "vue-eslint-parser": "^9.4.2",
67
+ "vue-tsc": "^1.8.27"
65
68
  },
66
69
  "description": "Gx Design"
67
70
  }
package/dist/image.umd.js DELETED
@@ -1 +0,0 @@
1
- (function(g,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("vue-types"),require("vue"),require("@ant-design/icons-vue"),require("@gx-design-vue/pro-utils"),require("@gx-design-vue/pro-hooks"),require("@gx-design-vue/pro-provider"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue-types","vue","@ant-design/icons-vue","@gx-design-vue/pro-utils","@gx-design-vue/pro-hooks","@gx-design-vue/pro-provider","@vueuse/core"],_):(g=typeof globalThis<"u"?globalThis:g||self,_(g.GImage={},g.vueTypes,g.vue,g.iconsVue,g.proUtils,g.proHooks,g.proProvider,g.core))})(this,function(g,_,i,z,y,ue,O,de){"use strict";const Te=_.createTypes({func:void 0,bool:void 0,string:void 0,number:void 0,array:void 0,object:void 0,integer:void 0});Te.extend([{name:"looseBool",getter:!0,type:Boolean,default:void 0},{name:"style",getter:!0,type:[String,Object],default:void 0},{name:"VueNode",getter:!0,type:null}]);const V=Te,D={infinite:{type:Boolean,default:!0},zIndex:{type:Number,default:2e3},initialIndex:{type:Number,default:0},getContainer:{type:String}},Z={previewTeleported:{type:Boolean,default:!0},hideOnClickModal:{type:Boolean,default:!0},src:{type:String,default:""},alt:{type:String,default:""},fit:{type:String,default:"contain"},lazy:V.bool,scrollContainer:{type:[String,Object]},placeholder:{type:[Function,Object],default:()=>{}},fallback:{type:[Function,Object],default:()=>{}},onLoad:{type:Function},onError:{type:Function},onClick:{type:Function},disablePreview:V.bool,previewSrcList:{type:Array,default:()=>[]},imageClassName:V.string,imageStyle:V.style,width:V.number,height:V.number,zIndex:D.zIndex,infinite:D.infinite,getContainer:D.getContainer,initialIndex:{...D.initialIndex,default:()=>{}}},ke={urlList:{type:Array,default:()=>[]},teleported:Z.previewTeleported,zIndex:D.zIndex,initialIndex:D.initialIndex,infinite:D.infinite,getContainer:Z.getContainer,onHideOnClickModal:Z.hideOnClickModal,icons:{type:Object,default:()=>({})}};function m(e,t){je(e)&&(e="100%");var n=Ve(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function ne(e){return Math.min(1,Math.max(0,e))}function je(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Ve(e){return typeof e=="string"&&e.indexOf("%")!==-1}function ze(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ae(e){return e<=1?"".concat(Number(e)*100,"%"):e}function H(e){return e.length===1?"0"+e:String(e)}function Be(e,t,n){return{r:m(e,255)*255,g:m(t,255)*255,b:m(n,255)*255}}function Oe(e,t,n){e=m(e,255),t=m(t,255),n=m(n,255);var a=Math.max(e,t,n),r=Math.min(e,t,n),o=0,s=0,c=(a+r)/2;if(a===r)s=0,o=0;else{var u=a-r;switch(s=c>.5?u/(2-a-r):u/(a+r),a){case e:o=(t-n)/u+(t<n?6:0);break;case t:o=(n-e)/u+2;break;case n:o=(e-t)/u+4;break}o/=6}return{h:o,s,l:c}}function he(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ye(e,t,n){var a,r,o;if(e=m(e,360),t=m(t,100),n=m(n,100),t===0)r=n,o=n,a=n;else{var s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;a=he(c,s,e+1/3),r=he(c,s,e),o=he(c,s,e-1/3)}return{r:a*255,g:r*255,b:o*255}}function Le(e,t,n){e=m(e,255),t=m(t,255),n=m(n,255);var a=Math.max(e,t,n),r=Math.min(e,t,n),o=0,s=a,c=a-r,u=a===0?0:c/a;if(a===r)o=0;else{switch(a){case e:o=(t-n)/c+(t<n?6:0);break;case t:o=(n-e)/c+2;break;case n:o=(e-t)/c+4;break}o/=6}return{h:o,s:u,v:s}}function We(e,t,n){e=m(e,360)*6,t=m(t,100),n=m(n,100);var a=Math.floor(e),r=e-a,o=n*(1-t),s=n*(1-r*t),c=n*(1-(1-r)*t),u=a%6,I=[n,s,o,o,c,n][u],v=[c,n,n,s,o,o][u],F=[o,o,c,n,n,s][u];return{r:I*255,g:v*255,b:F*255}}function Ee(e,t,n,a){var r=[H(Math.round(e).toString(16)),H(Math.round(t).toString(16)),H(Math.round(n).toString(16))];return a&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function Ge(e,t,n,a,r){var o=[H(Math.round(e).toString(16)),H(Math.round(t).toString(16)),H(Math.round(n).toString(16)),H(qe(a))];return r&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function qe(e){return Math.round(parseFloat(e)*255).toString(16)}function $e(e){return w(e)/255}function w(e){return parseInt(e,16)}function _e(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var ge={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Ze(e){var t={r:0,g:0,b:0},n=1,a=null,r=null,o=null,s=!1,c=!1;return typeof e=="string"&&(e=Ke(e)),typeof e=="object"&&(L(e.r)&&L(e.g)&&L(e.b)?(t=Be(e.r,e.g,e.b),s=!0,c=String(e.r).substr(-1)==="%"?"prgb":"rgb"):L(e.h)&&L(e.s)&&L(e.v)?(a=ae(e.s),r=ae(e.v),t=We(e.h,a,r),s=!0,c="hsv"):L(e.h)&&L(e.s)&&L(e.l)&&(a=ae(e.s),o=ae(e.l),t=Ye(e.h,a,o),s=!0,c="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=ze(n),{ok:s,format:e.format||c,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var Xe="[-\\+]?\\d+%?",Qe="[-\\+]?\\d*\\.\\d+%?",R="(?:".concat(Qe,")|(?:").concat(Xe,")"),me="[\\s|\\(]+(".concat(R,")[,|\\s]+(").concat(R,")[,|\\s]+(").concat(R,")\\s*\\)?"),pe="[\\s|\\(]+(".concat(R,")[,|\\s]+(").concat(R,")[,|\\s]+(").concat(R,")[,|\\s]+(").concat(R,")\\s*\\)?"),N={CSS_UNIT:new RegExp(R),rgb:new RegExp("rgb"+me),rgba:new RegExp("rgba"+pe),hsl:new RegExp("hsl"+me),hsla:new RegExp("hsla"+pe),hsv:new RegExp("hsv"+me),hsva:new RegExp("hsva"+pe),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Ke(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(ge[e])e=ge[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=N.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=N.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=N.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=N.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=N.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=N.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=N.hex8.exec(e),n?{r:w(n[1]),g:w(n[2]),b:w(n[3]),a:$e(n[4]),format:t?"name":"hex8"}:(n=N.hex6.exec(e),n?{r:w(n[1]),g:w(n[2]),b:w(n[3]),format:t?"name":"hex"}:(n=N.hex4.exec(e),n?{r:w(n[1]+n[1]),g:w(n[2]+n[2]),b:w(n[3]+n[3]),a:$e(n[4]+n[4]),format:t?"name":"hex8"}:(n=N.hex3.exec(e),n?{r:w(n[1]+n[1]),g:w(n[2]+n[2]),b:w(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function L(e){return!!N.CSS_UNIT.exec(String(e))}var X=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var a;if(t instanceof e)return t;typeof t=="number"&&(t=_e(t)),this.originalInput=t;var r=Ze(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(a=n.format)!==null&&a!==void 0?a:r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,a,r,o=t.r/255,s=t.g/255,c=t.b/255;return o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),s<=.03928?a=s/12.92:a=Math.pow((s+.055)/1.055,2.4),c<=.03928?r=c/12.92:r=Math.pow((c+.055)/1.055,2.4),.2126*n+.7152*a+.0722*r},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=ze(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=Le(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=Le(this.r,this.g,this.b),n=Math.round(t.h*360),a=Math.round(t.s*100),r=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(a,"%, ").concat(r,"%)"):"hsva(".concat(n,", ").concat(a,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=Oe(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=Oe(this.r,this.g,this.b),n=Math.round(t.h*360),a=Math.round(t.s*100),r=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(a,"%, ").concat(r,"%)"):"hsla(".concat(n,", ").concat(a,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),Ee(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),Ge(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),a=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(a,")"):"rgba(".concat(t,", ").concat(n,", ").concat(a,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(m(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(m(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+Ee(this.r,this.g,this.b,!1),n=0,a=Object.entries(ge);n<a.length;n++){var r=a[n],o=r[0],s=r[1];if(t===s)return o}return!1},e.prototype.toString=function(t){var n=!!t;t=t??this.format;var a=!1,r=this.a<1&&this.a>=0,o=!n&&r&&(t.startsWith("hex")||t==="name");return o?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(a=this.toRgbString()),t==="prgb"&&(a=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(a=this.toHexString()),t==="hex3"&&(a=this.toHexString(!0)),t==="hex4"&&(a=this.toHex8String(!0)),t==="hex8"&&(a=this.toHex8String()),t==="name"&&(a=this.toName()),t==="hsl"&&(a=this.toHslString()),t==="hsv"&&(a=this.toHsvString()),a||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=ne(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=ne(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=ne(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=ne(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),a=(n.h+t)%360;return n.h=a<0?360+a:a,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var a=this.toRgb(),r=new e(t).toRgb(),o=n/100,s={r:(r.r-a.r)*o+a.r,g:(r.g-a.g)*o+a.g,b:(r.b-a.b)*o+a.b,a:(r.a-a.a)*o+a.a};return new e(s)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var a=this.toHsl(),r=360/n,o=[this];for(a.h=(a.h-(r*t>>1)+720)%360;--t;)a.h=(a.h+r)%360,o.push(new e(a));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),a=n.h,r=n.s,o=n.v,s=[],c=1/t;t--;)s.push(new e({h:a,s:r,v:o})),o=(o+c)%1;return s},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),a=new e(t).toRgb();return new e({r:a.r+(n.r-a.r)*n.a,g:a.g+(n.g-a.g)*n.a,b:a.b+(n.b-a.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),a=n.h,r=[this],o=360/t,s=1;s<t;s++)r.push(new e({h:(a+s*o)%360,s:n.s,l:n.l}));return r},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();const Je=new O.Keyframe("viewFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),Ue=new O.Keyframe("viewFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),et=new O.Keyframe("viewZoomBadgeIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),tt=new O.Keyframe("viewZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),Re=e=>({position:e||"absolute",inset:0});function ve(e){return{position:e,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0}}const nt=e=>({boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none",fontFamily:e.fontFamily}),at=e=>{const{componentCls:t,modalMaskBg:n,paddingSM:a,previewOperationColorDisabled:r,motionDurationSlow:o}=e,s=new X(n).setAlpha(.1),c=s.clone().setAlpha(.2);return{[`${t}-operations`]:{...nt(e),display:"flex",flexDirection:"row-reverse",alignItems:"center",color:e.previewOperationColor,listStyle:"none",background:s.toRgbString(),pointerEvents:"auto","&-operation":{marginInlineStart:a,padding:a,cursor:"pointer",transition:`all ${o}`,userSelect:"none","&:hover":{background:c.toRgbString()},"&-disabled":{color:r,pointerEvents:"none"},"&:last-of-type":{marginInlineStart:0}},"&-progress":{position:"absolute",left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%)"},"&-icon":{fontSize:e.previewOperationSize}}}},rt=e=>{const{modalMaskBg:t,previewOperationColorDisabled:n,zIndexPopup:a,motionDurationSlow:r}=e,o=new X(t).setAlpha(.1),s=o.clone().setAlpha(.2);return{[`${e.componentCls}-switch-left, ${e.componentCls}-switch-right`]:{position:"fixed",insetBlockStart:"50%",zIndex:a+1,display:"flex",alignItems:"center",justifyContent:"center",width:e.imagePreviewSwitchSize,height:e.imagePreviewSwitchSize,marginTop:-e.imagePreviewSwitchSize/2,color:e.previewOperationColor,background:o.toRgbString(),borderRadius:"50%",transform:"translateY(-50%)",cursor:"pointer",transition:`all ${r}`,pointerEvents:"auto",userSelect:"none","&:hover":{background:s.toRgbString()},["&-disabled"]:{"&, &:hover":{color:n,background:"transparent",cursor:"not-allowed",[`> ${e.iconCls}`]:{cursor:"not-allowed"}}},[`> ${e.iconCls}`]:{fontSize:e.previewOperationSize}},[`${e.componentCls}-switch-left`]:{insetInlineStart:e.marginSM},[`${e.componentCls}-switch-right`]:{insetInlineEnd:e.marginSM}}},it=e=>({[e.componentCls]:{["&-root"]:{...ve("fixed"),zIndex:e.zIndexPopup,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"},["&-wrapper"]:{...ve("fixed"),zIndex:e.zIndexPopup,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"},["&-mask"]:{...ve("fixed"),zIndex:e.zIndexPopupBase,height:"100%",backgroundColor:e.colorBgMask},["&-block"]:{height:"100%",textAlign:"center",pointerEvents:"none"},["&-body"]:{...Re(),overflow:"hidden"},["&-canvas"]:{...Re(),display:"flex",justifyContent:"center",alignItems:"center","&::before":{display:"inline-block",width:1,height:"50%",marginInlineEnd:-1,content:'""'}},["&-img"]:{maxWidth:"100%",maxHeight:"100%",verticalAlign:"middle",transform:"scale3d(1, 1, 1)",cursor:"grab",transition:`transform ${e.motionDurationSlow} ${e.motionEaseOut} 0s`,userSelect:"none",pointerEvents:"auto"},["&-fade-appear, &-fade-enter"]:{animationName:Je,animationDuration:e.motionDurationSlow,animationTimingFunction:"linear"},["&-fade-leave"]:{animationName:Ue,animationDuration:e.motionDurationSlow,animationTimingFunction:"linear"},["&-zoom-appear, &-zoom-enter"]:{animationName:et,opacity:0,animationTimingFunction:e.motionEaseOutCirc,animationFillMode:"both",transform:"none",animationDuration:e.motionDurationSlow,userSelect:"none"},["&-zoom-enter-active"]:{animationPlayState:"running"},["&-zoom-leave"]:{animationName:tt,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"}},[`${e.componentCls}-root`]:{[`${e.componentCls}-wrapper`]:{zIndex:e.zIndexPopup}},[`${e.componentCls}-operations-wrapper`]:{position:"fixed",insetBlockStart:0,insetInlineEnd:0,zIndex:e.zIndexPopup+1,width:"100%"},"&":[at(e),rt(e)]});function ot(e){return O.useStyle("ImageView",t=>{const n=O.mergeToken(t,{zIndexPopup:t.zIndexPopupBase+80,previewOperationColorDisabled:new X(t.colorTextLightSolid).setAlpha(.25).toRgbString(),modalMaskBg:new X("#000").setAlpha(.45).toRgbString(),previewOperationColor:new X(t.colorTextLightSolid).toRgbString(),previewOperationSize:t.fontSizeIcon*1.5,imagePreviewSwitchSize:t.controlHeightLG,iconCls:"anticon"});return[it(n)]},e)}const B={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace"},re=function(e,t,n,a=!1){e&&t&&n&&e.addEventListener(t,n,a)},be=function(e,t,n,a=!1){e&&t&&n&&e.removeEventListener(t,n,a)},Q={CONTAIN:{name:"contain",icon:i.createVNode(z.ExpandOutlined,null,null)},ORIGINAL:{name:"original",icon:i.createVNode(z.OneToOneOutlined,null,null)}},De=function(){return!y.isServer&&!!window.navigator.userAgent.match(/firefox/i)}()?"DOMMouseScroll":"mousewheel";function ye(e){let t=!1;return function(...n){t||(t=!0,window.requestAnimationFrame(()=>{e.apply(this,n),t=!1}))}}const He=i.defineComponent({props:ke,emits:["close","switch"],setup:function(e,{emit:t,expose:n}){var ce,fe,j,te,Pe;let a=null,r=null,o=null;const s=y.getPrefixCls({suffixCls:"image-viewer"}),{wrapSSR:c,hashId:u}=ot(s),I=i.shallowRef(!1),[v,F]=ue.useState(!1),[E,M]=ue.useState(!1),$=i.ref(!0),p=i.ref(e.initialIndex),W=i.ref(null),G=i.ref(null),K=i.ref(Q.CONTAIN),d=i.reactive({transform:{scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}}),J=i.computed(()=>e.urlList.length>1),ie=i.computed(()=>p.value===0),oe=i.computed(()=>p.value===e.urlList.length-1),se=i.computed(()=>e.urlList[p.value]),Se=i.computed(()=>{const{scale:l,deg:A,offsetX:h,offsetY:x,enableTransition:b}=d.transform,C={transform:`scale(${l}) rotate(${A}deg)`,transition:b?"transform .3s":"",marginLeft:`${h}px`,marginTop:`${x}px`};return K.value.name===Q.CONTAIN.name&&(C.maxWidth=C.maxHeight="100%"),C}),xe=()=>{Ae(),t("close"),d.transform={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},Ie=l=>{I.value?I.value=!1:W.value===(l==null?void 0:l.target)&&(M(!1),p.value=e.initialIndex)},Me=()=>{a=ye(l=>{switch(l.code){case B.esc:M(!1);break;case B.space:q();break;case B.left:le();break;case B.up:k("zoomIn");break;case B.right:ee();break;case B.down:k("zoomOut");break}}),r=ye(l=>{(l.wheelDelta?l.wheelDelta:-l.detail)>0?k("zoomIn",{zoomRate:.015,enableTransition:!1}):k("zoomOut",{zoomRate:.015,enableTransition:!1})}),re(document,"keydown",a),re(document,De,r)},Ae=()=>{be(document,"keydown",a),be(document,De,r),a=null,r=null},U=()=>{$.value=!1},f=l=>{$.value=!1,l.target.alt="加载失败"},S=i.shallowRef(),T=l=>{if($.value||l.button!==0)return;l.preventDefault(),l.stopPropagation(),clearTimeout(S.value),I.value=!0;const{offsetX:A,offsetY:h}=d.transform,x=l.pageX,b=l.pageY;o=ye(C=>{d.transform={...d.transform,offsetX:A+C.pageX-x,offsetY:h+C.pageY-b}}),re(document,"mousemove",o),re(document,"mouseup",()=>{be(document,"mousemove",o),v.value&&E.value&&(S.value=setTimeout(()=>{I.value=!1}))})},P=()=>{d.transform={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},q=()=>{if($.value)return;const l=Object.keys(Q),A=Object.values(Q),h=K.value.name,b=(A.findIndex(C=>C.name===h)+1)%l.length;K.value=Q[l[b]],P()},le=()=>{if(ie.value&&!e.infinite)return;const l=e.urlList.length;p.value=(p.value-1+l)%l},ee=()=>{if(oe.value&&!e.infinite)return;const l=e.urlList.length;p.value=(p.value+1)%l},k=(l,A={})=>{if($.value)return;const{zoomRate:h,rotateDeg:x,enableTransition:b}={zoomRate:.2,rotateDeg:90,enableTransition:!0,...A};switch(l){case"zoomOut":d.transform.scale>.2&&(d.transform.scale=parseFloat((d.transform.scale-h).toFixed(3)));break;case"zoomIn":d.transform.scale=parseFloat((d.transform.scale+h).toFixed(3));break;case"clocelise":d.transform.deg+=x;break;case"anticlocelise":d.transform.deg-=x;break}d.transform.enableTransition=b},Ce=[{icon:((ce=e.icons)==null?void 0:ce.close)||i.createVNode(z.CloseOutlined,null,null),onClick:l=>{l.stopPropagation(),M(!1)},type:"close"},{icon:((fe=e.icons)==null?void 0:fe.zoomIn)||i.createVNode(z.ZoomInOutlined,null,null),onClick:l=>{l.stopPropagation(),k("zoomIn")},type:"zoomIn"},{icon:((j=e.icons)==null?void 0:j.zoomOut)||i.createVNode(z.ZoomOutOutlined,null,null),onClick:l=>{l.stopPropagation(),k("zoomOut")},type:"zoomOut"},{icon:((te=e.icons)==null?void 0:te.rotateRight)||i.createVNode(z.RotateRightOutlined,null,null),onClick:l=>{l.stopPropagation(),k("anticlocelise")},type:"rotateRight"},{icon:((Pe=e.icons)==null?void 0:Pe.rotateLeft)||i.createVNode(z.RotateLeftOutlined,null,null),onClick:l=>{l.stopPropagation(),k("clocelise")},type:"rotateLeft"}];return i.watch(se,()=>{i.nextTick(()=>{G.value.complete||($.value=!0)})}),i.watch(p,l=>{P(),t("switch",l)}),i.watch(v,l=>{l&&(E.value=l)}),i.watch([()=>v.value,()=>W.value],([l,A])=>{var h,x;l&&A&&(Me(),(x=(h=W.value)==null?void 0:h.focus)==null||x.call(h))}),n({setOpen:F}),()=>{const l=O.getTransitionProps(`${s}-fade`),A=O.getTransitionProps(`${s}-zoom`);return c(i.createVNode(i.Teleport,{to:e.getContainer||"body",disabled:!e.teleported},{default:()=>[v.value&&i.createVNode("div",{class:`${s}-root ${u.value}`},[i.createVNode(i.Transition,l,{default:()=>[i.withDirectives(i.createVNode("div",{class:`${s}-mask ${u.value}`},null),[[i.vShow,v.value&&E.value]])]}),i.createVNode("div",{ref:W,tabindex:-1,class:[`${s}-wrapper`,`${u.value}`],onClick:h=>e.onHideOnClickModal&&Ie(h)},[i.createVNode(i.Transition,i.mergeProps(A,{onAfterLeave:()=>xe()}),{default:()=>{var h,x;return[i.withDirectives(i.createVNode("div",{class:`${s}-block ${u.value}`},[i.createVNode("div",{class:`${s}-content ${u.value}`},[i.createVNode("div",{class:`${s}-body ${u.value}`},[i.createVNode("div",{class:`${s}-operations-wrapper ${u.value}`,onClick:b=>b.stopPropagation()},[i.createVNode("ul",{class:`${s}-operations ${u.value}`},[Ce.map(({icon:b,onClick:C,type:Ne})=>i.createVNode("li",{class:`${s}-operations-operation ${u.value}`,onClick:C,key:Ne},[i.cloneVNode(b,{class:`${s}-operations-icon ${u.value}`})]))])]),i.createVNode("div",{class:`${s}-canvas ${u.value}`},[e.urlList.map((b,C)=>i.createVNode("img",{ref:G,class:`${s}-img ${u.value}`,style:{...Se.value,display:C===p.value?"block":"none"},key:b,src:b,onLoad:()=>U(),onError:Ne=>f(Ne),onMousedown:T},null))]),J.value&&i.createVNode("div",{class:[`${s}-switch-left`,p.value===0&&!e.infinite?`${s}-switch-left-disabled`:"",`${u.value}`],onClick:le},[((h=e.icons)==null?void 0:h.left)||i.createVNode(z.LeftOutlined,null,null)]),J.value&&i.createVNode("div",{class:[`${s}-switch-right`,p.value===e.urlList.length-1&&!e.infinite?`${s}-switch-right-disabled`:"",`${u.value}`],onClick:ee},[((x=e.icons)==null?void 0:x.right)||i.createVNode(z.RightOutlined,null,null)])])])]),[[i.vShow,v.value&&E.value]])]}})])])]}))}}}),we={width:"100%",height:"100%"},st=e=>({[e.componentCls]:{display:"inline-block",position:"relative",overflow:"hidden",["&-inner"]:{...we,verticalAlign:"top",opacity:1},["&-placeholder"]:{...we,backgroundColor:e.colorBgContainerDisabled,backgroundImage:"url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundSize:"30%"},["&-error"]:{...we,display:"flex",alignItems:"center",justifyContent:"center",color:e.colorText,backgroundColor:e.colorBgContainerDisabled},["&-preview"]:{cursor:"pointer"}}}),lt=e=>e&&e.nodeType===Node.ELEMENT_NODE;let Fe="";const Y=i.defineComponent({props:Z,name:"GImage",emits:["error","click","load"],setup(e,{slots:t,emit:n,attrs:a}){const r=y.getPrefixCls({suffixCls:"image"}),{wrapSSR:o,hashId:s}=O.useProStyle("Image",[st],r),c=i.ref(),u=i.ref(""),I=i.ref(!1),v=i.ref(!0),F=i.ref(!1),E=i.ref(null),M=i.ref();let $,p;const W=i.computed(()=>!y.isServer&&e.fit?{"object-fit":e.fit}:{}),G=i.computed(()=>{const{previewSrcList:f}=e;return Array.isArray(f)&&f.length>0}),K=i.computed(()=>{const{src:f,previewSrcList:S,initialIndex:T}=e;if(T||T===0)return S.length>=T?T:0;let P=0;const q=S.indexOf(f);return q>=0&&(P=q),P}),d=()=>{if(y.isServer)return;v.value=!0,I.value=!1;const f=new Image;f.onload=S=>Se(S),f.onerror=xe,Object.keys(a||{}).forEach(S=>{if(S.toLowerCase()==="onload")return;const T=(a||{})[S];f.setAttribute(S,T)}),f.src=e.src};function J(){y.isInContainer(E.value,M.value)&&(d(),se())}const ie=de.useThrottleFn(J,200),oe=async()=>{if(y.isServer)return;await i.nextTick();const{scrollContainer:f}=e;lt(f)?M.value=f:y.isString(f)&&f!==""?M.value=document.querySelector(f)??void 0:E.value&&(M.value=y.getScrollContainer(E.value)),M.value&&($=de.useEventListener(M,"scroll",ie),setTimeout(()=>J(),200))},se=()=>{y.isServer||!M.value||!ie||($(),M.value=void 0)},Se=f=>{u.value=e.src,v.value=!1,I.value=!1,n("load",f)},xe=f=>{v.value=!1,I.value=!0,n("error",f)},Ie=f=>{if(f.ctrlKey){if(f.deltaY<0)return f.preventDefault(),!1;if(f.deltaY>0)return f.preventDefault(),!1}},Me=()=>{!G.value||e.disablePreview||(p=de.useEventListener("wheel",Ie,{passive:!1}),Fe=document.body.style.overflow,document.body.style.overflow="hidden",F.value=!0)},Ae=()=>{p==null||p(),document.body.style.overflow=Fe,F.value=!1};i.watch(()=>e.src,()=>{e.lazy?(v.value=!0,I.value=!1,se(),oe()):d()});const U=f=>y.isNumber(f)?f+"px":f;return ue.onMountedOrActivated(()=>{e.lazy?oe():d()}),()=>{const{crossorigin:f,decoding:S,alt:T,sizes:P,srcset:q,usemap:le,class:ee,style:k={}}=a,Ce={crossorigin:f,decoding:S,alt:T,sizes:P,srcset:q,usemap:le,style:{...W.value,height:e.height?U(e.height):void 0}},ce=y.getSlotVNode(t,e,"fallback"),fe=y.getSlotVNode(t,e,"placeholder");return i.watchEffect(()=>{var j,te;G.value&&F.value?(j=c.value)==null||j.setOpen(!0):(te=c.value)==null||te.setOpen(!1)}),o(i.createVNode(i.Fragment,null,[i.createVNode("div",{class:{[`${s.value}`]:!0,[`${r}`]:!0,[`${ee}`]:!!ee},ref:j=>E.value=j,style:{width:e.width?U(e.width):void 0,height:e.height?U(e.height):void 0,display:e.lazy?"block":void 0,...k},onClick:()=>{n("click")}},[v.value?fe||i.createVNode("div",{class:`${r}-placeholder ${s.value}`},null):I.value?ce||i.createVNode("div",{class:`${r}-error ${s.value}`},[i.createTextVNode("加载失败")]):u.value&&i.createVNode("img",i.mergeProps(Ce,{class:{[`${s.value}`]:!0,[`${e.imageClassName}`]:!!e.imageClassName,[`${r}-inner`]:!0,[`${r}-preview`]:G.value},alt:e.alt,src:u.value,onClick:()=>Me()}),null),i.createVNode(He,{ref:c,zIndex:e.zIndex,infinite:e.infinite,initialIndex:K.value,urlList:e.previewSrcList,getContainer:e.getContainer,onHideOnClickModal:e.hideOnClickModal,onClose:()=>Ae()},null)])]))}}});Y.isWImage=!0,Y.install=e=>(e.component(Y.name,Y),e),g.GImage=Y,g.ImageViewer=He,g.default=Y,g.gImagePorps=Z,g.gImageViewProps=ke,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});