@farris/ui-vue 1.3.4 → 1.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/components/accordion/index.esm.js +16 -16
  2. package/components/accordion/index.umd.cjs +1 -1
  3. package/components/avatar/index.esm.js +65 -65
  4. package/components/avatar/index.umd.cjs +1 -1
  5. package/components/button-edit/index.esm.js +13 -13
  6. package/components/button-edit/index.umd.cjs +1 -1
  7. package/components/calendar/index.esm.js +504 -490
  8. package/components/calendar/index.umd.cjs +1 -1
  9. package/components/capsule/index.esm.js +247 -233
  10. package/components/capsule/index.umd.cjs +1 -1
  11. package/components/checkbox/index.esm.js +356 -344
  12. package/components/checkbox/index.umd.cjs +1 -1
  13. package/components/color-picker/index.esm.js +159 -145
  14. package/components/color-picker/index.umd.cjs +2 -2
  15. package/components/combo-list/index.esm.js +127 -128
  16. package/components/combo-list/index.umd.cjs +1 -1
  17. package/components/combo-tree/index.esm.js +15 -15
  18. package/components/combo-tree/index.umd.cjs +1 -1
  19. package/components/component/index.esm.js +101 -87
  20. package/components/component/index.umd.cjs +1 -1
  21. package/components/condition/index.esm.js +9 -7
  22. package/components/condition/index.umd.cjs +1 -1
  23. package/components/content-container/index.esm.js +181 -167
  24. package/components/content-container/index.umd.cjs +1 -1
  25. package/components/data-grid/index.esm.js +746 -730
  26. package/components/data-grid/index.umd.cjs +1 -1
  27. package/components/data-view/index.esm.js +9 -7
  28. package/components/data-view/index.umd.cjs +1 -1
  29. package/components/date-picker/index.esm.js +789 -777
  30. package/components/date-picker/index.umd.cjs +1 -1
  31. package/components/designer-canvas/index.esm.js +3096 -3069
  32. package/components/designer-canvas/index.umd.cjs +1 -1
  33. package/components/dropdown/index.esm.js +257 -243
  34. package/components/dropdown/index.umd.cjs +2 -2
  35. package/components/dynamic-form/index.esm.js +322 -306
  36. package/components/dynamic-form/index.umd.cjs +1 -1
  37. package/components/dynamic-resolver/index.esm.js +177 -163
  38. package/components/dynamic-resolver/index.umd.cjs +1 -1
  39. package/components/event-parameter/index.esm.js +78 -82
  40. package/components/event-parameter/index.umd.cjs +1 -1
  41. package/components/events-editor/index.esm.js +501 -487
  42. package/components/events-editor/index.umd.cjs +1 -1
  43. package/components/expression-editor/index.esm.js +37 -37
  44. package/components/expression-editor/index.umd.cjs +1 -1
  45. package/components/external-container/index.esm.js +487 -472
  46. package/components/external-container/index.umd.cjs +1 -1
  47. package/components/field-selector/index.esm.js +440 -433
  48. package/components/field-selector/index.umd.cjs +1 -1
  49. package/components/filter-bar/index.esm.js +594 -587
  50. package/components/filter-bar/index.umd.cjs +1 -1
  51. package/components/flow-canvas/index.esm.js +2766 -2739
  52. package/components/flow-canvas/index.umd.cjs +1 -1
  53. package/components/image-cropper/index.esm.js +402 -388
  54. package/components/image-cropper/index.umd.cjs +1 -1
  55. package/components/input-group/index.esm.js +201 -202
  56. package/components/input-group/index.umd.cjs +1 -1
  57. package/components/layout/index.esm.js +264 -245
  58. package/components/layout/index.umd.cjs +1 -1
  59. package/components/list-nav/index.esm.js +157 -143
  60. package/components/list-nav/index.umd.cjs +1 -1
  61. package/components/list-view/index.esm.js +314 -298
  62. package/components/list-view/index.umd.cjs +1 -1
  63. package/components/lookup/index.esm.js +862 -843
  64. package/components/lookup/index.umd.cjs +1 -1
  65. package/components/mapping-editor/index.esm.js +1031 -1015
  66. package/components/mapping-editor/index.umd.cjs +1 -1
  67. package/components/nav/index.esm.js +169 -155
  68. package/components/nav/index.umd.cjs +2 -2
  69. package/components/number-range/index.esm.js +150 -137
  70. package/components/number-range/index.umd.cjs +1 -1
  71. package/components/number-spinner/index.esm.js +207 -194
  72. package/components/number-spinner/index.umd.cjs +1 -1
  73. package/components/order/index.esm.js +427 -414
  74. package/components/order/index.umd.cjs +1 -1
  75. package/components/page-footer/index.esm.js +22 -22
  76. package/components/page-footer/index.umd.cjs +1 -1
  77. package/components/page-header/index.esm.js +510 -492
  78. package/components/page-header/index.umd.cjs +1 -1
  79. package/components/pagination/index.esm.js +192 -178
  80. package/components/pagination/index.umd.cjs +1 -1
  81. package/components/progress/index.esm.js +234 -220
  82. package/components/progress/index.umd.cjs +3 -3
  83. package/components/property-editor/index.esm.js +288 -277
  84. package/components/property-editor/index.umd.cjs +2 -2
  85. package/components/property-panel/index.esm.js +62 -61
  86. package/components/property-panel/index.umd.cjs +1 -1
  87. package/components/query-solution/index.esm.js +776 -770
  88. package/components/query-solution/index.umd.cjs +6 -6
  89. package/components/radio-button/index.esm.js +64 -64
  90. package/components/radio-button/index.umd.cjs +1 -1
  91. package/components/radio-group/index.esm.js +296 -283
  92. package/components/radio-group/index.umd.cjs +1 -1
  93. package/components/rate/index.esm.js +222 -208
  94. package/components/rate/index.umd.cjs +1 -1
  95. package/components/response-layout/index.esm.js +187 -173
  96. package/components/response-layout/index.umd.cjs +1 -1
  97. package/components/response-layout-editor/index.esm.js +554 -542
  98. package/components/response-layout-editor/index.umd.cjs +1 -1
  99. package/components/response-toolbar/index.esm.js +483 -469
  100. package/components/response-toolbar/index.umd.cjs +1 -1
  101. package/components/schema-selector/index.esm.js +634 -619
  102. package/components/schema-selector/index.umd.cjs +2 -2
  103. package/components/search-box/index.esm.js +228 -214
  104. package/components/search-box/index.umd.cjs +1 -1
  105. package/components/section/index.esm.js +419 -406
  106. package/components/section/index.umd.cjs +1 -1
  107. package/components/smoke-detector/index.esm.js +162 -148
  108. package/components/smoke-detector/index.umd.cjs +1 -1
  109. package/components/splitter/index.esm.js +308 -284
  110. package/components/splitter/index.umd.cjs +1 -1
  111. package/components/step/index.esm.js +279 -265
  112. package/components/step/index.umd.cjs +1 -1
  113. package/components/switch/index.esm.js +183 -170
  114. package/components/switch/index.umd.cjs +1 -1
  115. package/components/tabs/index.esm.js +307 -294
  116. package/components/tabs/index.umd.cjs +1 -1
  117. package/components/tags/index.esm.js +320 -306
  118. package/components/tags/index.umd.cjs +1 -1
  119. package/components/text/index.esm.js +245 -231
  120. package/components/text/index.umd.cjs +1 -1
  121. package/components/textarea/index.esm.js +260 -247
  122. package/components/textarea/index.umd.cjs +1 -1
  123. package/components/time-picker/index.esm.js +409 -396
  124. package/components/time-picker/index.umd.cjs +1 -1
  125. package/components/transfer/index.esm.js +424 -410
  126. package/components/transfer/index.umd.cjs +1 -1
  127. package/components/tree-grid/index.esm.js +383 -376
  128. package/components/tree-grid/index.umd.cjs +1 -1
  129. package/components/tree-view/index.esm.js +595 -575
  130. package/components/tree-view/index.umd.cjs +1 -1
  131. package/components/uploader/index.esm.js +325 -311
  132. package/components/uploader/index.umd.cjs +2 -2
  133. package/components/verify-detail/index.esm.js +304 -290
  134. package/components/verify-detail/index.umd.cjs +1 -1
  135. package/components/video/index.esm.js +99 -85
  136. package/components/video/index.umd.cjs +1 -1
  137. package/components/weather/index.esm.js +947 -933
  138. package/components/weather/index.umd.cjs +4 -4
  139. package/farris.all.esm.js +5492 -5470
  140. package/farris.all.umd.cjs +13 -13
  141. package/index.css +1 -1
  142. package/package.json +1 -1
  143. package/types/condition/src/composition/condition-value/input-group-value.d.ts +1 -1
  144. package/types/entity-binding-selector/composition/use-entity-tree.d.ts +3 -0
  145. package/types/entity-binding-selector/composition/use-field-tree.d.ts +1 -0
@@ -1,117 +1,131 @@
1
- import { inject as Te, ref as v, onMounted as Ae, onUnmounted as nt, watch as K, defineComponent as Se, createVNode as S, withModifiers as O } from "vue";
2
- import { isPlainObject as Me, cloneDeep as ut } from "lodash-es";
3
- const ze = {}, Ee = {};
1
+ import { inject as Te, ref as h, onMounted as Ae, onUnmounted as ut, watch as K, defineComponent as Se, createVNode as S, withModifiers as I } from "vue";
2
+ import { isPlainObject as Me, cloneDeep as ze } from "lodash-es";
3
+ const Ee = {}, ke = {};
4
4
  function ve(e) {
5
- const { properties: i, title: r, ignore: p } = e, o = p && Array.isArray(p), t = Object.keys(i).reduce((h, g) => ((!o || !p.find((w) => w === g)) && (h[g] = i[g].type === "object" && i[g].properties ? ve(i[g]) : ut(i[g].default)), h), {});
6
- if (r && (!o || !p.find((h) => h === "id"))) {
7
- const h = r.toLowerCase().replace(/-/g, "_");
8
- t.id = `${h}_${Math.random().toString().slice(2, 6)}`;
5
+ const { properties: i, title: n, ignore: d } = e, o = d && Array.isArray(d), t = Object.keys(i).reduce((c, g) => ((!o || !d.find((w) => w === g)) && (c[g] = i[g].type === "object" && i[g].properties ? ve(i[g]) : ze(i[g].default)), c), {});
6
+ if (n && (!o || !d.find((c) => c === "id"))) {
7
+ const c = n.toLowerCase().replace(/-/g, "_");
8
+ t.id = `${c}_${Math.random().toString().slice(2, 6)}`;
9
9
  }
10
10
  return t;
11
11
  }
12
- function ke(e, i = {}, r) {
13
- const p = ze[e];
14
- if (p) {
15
- let o = ve(p);
16
- const t = Ee[e];
17
- return o = t ? t({ getSchemaByType: ke }, o, i, r) : o, o;
12
+ function rt(e) {
13
+ const { properties: i, title: n, required: d } = e;
14
+ if (d && Array.isArray(d)) {
15
+ const o = d.reduce((t, c) => (t[c] = i[c].type === "object" && i[c].properties ? ve(i[c]) : ze(i[c].default), t), {});
16
+ if (n && d.find((t) => t === "id")) {
17
+ const t = n.toLowerCase().replace(/-/g, "_");
18
+ o.id = `${t}_${Math.random().toString().slice(2, 6)}`;
19
+ }
20
+ return o;
18
21
  }
19
- return null;
22
+ return {
23
+ type: n
24
+ };
20
25
  }
21
- function rt(e, i) {
22
- const r = ve(i);
23
- return Object.keys(r).reduce((p, o) => (p[o] && Me(p[o]) && Me(e[o] || !e[o]) ? Object.assign(p[o], e[o] || {}) : p[o] = e[o], p), r), r;
26
+ function De(e, i = {}, n) {
27
+ const d = Ee[e];
28
+ if (d) {
29
+ let o = rt(d);
30
+ const t = ke[e];
31
+ return o = t ? t({ getSchemaByType: De }, o, i, n) : o, o;
32
+ }
33
+ return null;
24
34
  }
25
35
  function st(e, i) {
26
- return Object.keys(e).filter((p) => e[p] != null).reduce((p, o) => {
36
+ const n = ve(i);
37
+ return Object.keys(n).reduce((d, o) => (Object.prototype.hasOwnProperty.call(e, o) && (d[o] && Me(d[o]) && Me(e[o] || !e[o]) ? Object.assign(d[o], e[o] || {}) : d[o] = e[o]), d), n), n;
38
+ }
39
+ function ot(e, i) {
40
+ return Object.keys(e).filter((d) => e[d] != null).reduce((d, o) => {
27
41
  if (i.has(o)) {
28
42
  const t = i.get(o);
29
43
  if (typeof t == "string")
30
- p[t] = e[o];
44
+ d[t] = e[o];
31
45
  else {
32
- const h = t(o, e[o], e);
33
- Object.assign(p, h);
46
+ const c = t(o, e[o], e);
47
+ Object.assign(d, c);
34
48
  }
35
49
  } else
36
- p[o] = e[o];
37
- return p;
50
+ d[o] = e[o];
51
+ return d;
38
52
  }, {});
39
53
  }
40
- function ot(e, i, r = /* @__PURE__ */ new Map()) {
41
- const p = rt(e, i);
42
- return st(p, r);
54
+ function ct(e, i, n = /* @__PURE__ */ new Map()) {
55
+ const d = st(e, i);
56
+ return ot(d, n);
43
57
  }
44
- function ct(e = {}) {
45
- function i(s, y, m, l) {
46
- if (typeof m == "number")
47
- return l[s].length === m;
48
- if (typeof m == "object") {
49
- const u = Object.keys(m)[0], T = m[u];
50
- if (u === "not")
58
+ function ft(e = {}) {
59
+ function i(s, y, p, l) {
60
+ if (typeof p == "number")
61
+ return l[s].length === p;
62
+ if (typeof p == "object") {
63
+ const r = Object.keys(p)[0], T = p[r];
64
+ if (r === "not")
51
65
  return Number(l[s].length) !== Number(T);
52
- if (u === "moreThan")
66
+ if (r === "moreThan")
53
67
  return Number(l[s].length) >= Number(T);
54
- if (u === "lessThan")
68
+ if (r === "lessThan")
55
69
  return Number(l[s].length) <= Number(T);
56
70
  }
57
71
  return !1;
58
72
  }
59
- function r(s, y, m, l) {
60
- return l[s] && l[s].propertyValue && String(l[s].propertyValue.value) === String(m);
73
+ function n(s, y, p, l) {
74
+ return l[s] && l[s].propertyValue && String(l[s].propertyValue.value) === String(p);
61
75
  }
62
- const p = /* @__PURE__ */ new Map([
76
+ const d = /* @__PURE__ */ new Map([
63
77
  ["length", i],
64
- ["getProperty", r]
78
+ ["getProperty", n]
65
79
  ]);
66
- Object.keys(e).reduce((s, y) => (s.set(y, e[y]), s), p);
80
+ Object.keys(e).reduce((s, y) => (s.set(y, e[y]), s), d);
67
81
  function o(s, y) {
68
- const m = s;
69
- return typeof y == "number" ? [{ target: m, operator: "length", param: null, value: Number(y) }] : typeof y == "boolean" ? [{ target: m, operator: "getProperty", param: s, value: !!y }] : typeof y == "object" ? Object.keys(y).map((l) => {
82
+ const p = s;
83
+ return typeof y == "number" ? [{ target: p, operator: "length", param: null, value: Number(y) }] : typeof y == "boolean" ? [{ target: p, operator: "getProperty", param: s, value: !!y }] : typeof y == "object" ? Object.keys(y).map((l) => {
70
84
  if (l === "length")
71
- return { target: m, operator: "length", param: null, value: y[l] };
72
- const u = l, T = y[l];
73
- return { target: m, operator: "getProperty", param: u, value: T };
85
+ return { target: p, operator: "length", param: null, value: y[l] };
86
+ const r = l, T = y[l];
87
+ return { target: p, operator: "getProperty", param: r, value: T };
74
88
  }) : [];
75
89
  }
76
90
  function t(s) {
77
- return Object.keys(s).reduce((m, l) => {
78
- const u = o(l, s[l]);
79
- return m.push(...u), m;
91
+ return Object.keys(s).reduce((p, l) => {
92
+ const r = o(l, s[l]);
93
+ return p.push(...r), p;
80
94
  }, []);
81
95
  }
82
- function h(s, y) {
83
- if (p.has(s.operator)) {
84
- const m = p.get(s.operator);
85
- return m && m(s.target, s.param, s.value, y) || !1;
96
+ function c(s, y) {
97
+ if (d.has(s.operator)) {
98
+ const p = d.get(s.operator);
99
+ return p && p(s.target, s.param, s.value, y) || !1;
86
100
  }
87
101
  return !1;
88
102
  }
89
103
  function g(s, y) {
90
- return t(s).reduce((u, T) => u && h(T, y), !0);
104
+ return t(s).reduce((r, T) => r && c(T, y), !0);
91
105
  }
92
106
  function w(s, y) {
93
- const m = Object.keys(s), l = m.includes("allOf"), u = m.includes("anyOf"), T = l || u, W = (T ? s[T ? l ? "allOf" : "anyOf" : "allOf"] : [s]).map((B) => g(B, y));
94
- return l ? !W.includes(!1) : W.includes(!0);
107
+ const p = Object.keys(s), l = p.includes("allOf"), r = p.includes("anyOf"), T = l || r, L = (T ? s[T ? l ? "allOf" : "anyOf" : "allOf"] : [s]).map((B) => g(B, y));
108
+ return l ? !L.includes(!1) : L.includes(!0);
95
109
  }
96
110
  return { parseValueSchema: w };
97
111
  }
98
- const ft = {}, vt = {};
99
- ct();
100
- function ht(e, i, r = /* @__PURE__ */ new Map(), p = (h, g, w, s) => g, o = {}, t = (h) => h) {
101
- return ze[i.title] = i, Ee[i.title] = p, ft[i.title] = o, vt[i.title] = t, (h = {}) => {
102
- const g = ot(h, i, r), w = Object.keys(e).reduce((s, y) => (s[y] = e[y].default, s), {});
112
+ const vt = {}, ht = {};
113
+ ft();
114
+ function dt(e, i, n = /* @__PURE__ */ new Map(), d = (c, g, w, s) => g, o = {}, t = (c) => c) {
115
+ return Ee[i.title] = i, ke[i.title] = d, vt[i.title] = o, ht[i.title] = t, (c = {}) => {
116
+ const g = ct(c, i, n), w = Object.keys(e).reduce((s, y) => (s[y] = e[y].default, s), {});
103
117
  return Object.assign(w, g);
104
118
  };
105
119
  }
106
120
  function gt(e, i) {
107
121
  return { customClass: i.class, customStyle: i.style };
108
122
  }
109
- function dt(e, i, r) {
123
+ function mt(e, i, n) {
110
124
  return i;
111
125
  }
112
- const mt = /* @__PURE__ */ new Map([
126
+ const pt = /* @__PURE__ */ new Map([
113
127
  ["appearance", gt]
114
- ]), pt = "https://json-schema.org/draft/2020-12/schema", yt = "https://farris-design.gitee.io/image-cropper.schema.json", xt = "image-cropper", bt = "A Farris Component", Mt = "object", wt = {
128
+ ]), yt = "https://json-schema.org/draft/2020-12/schema", xt = "https://farris-design.gitee.io/image-cropper.schema.json", bt = "image-cropper", Mt = "A Farris Component", wt = "object", Tt = {
115
129
  id: {
116
130
  description: "The unique identifier for image-cropper",
117
131
  type: "string"
@@ -173,18 +187,18 @@ const mt = /* @__PURE__ */ new Map([
173
187
  type: "boolean",
174
188
  default: !0
175
189
  }
176
- }, Tt = [
190
+ }, At = [
177
191
  "id",
178
192
  "type"
179
- ], At = {
180
- $schema: pt,
181
- $id: yt,
182
- title: xt,
183
- description: bt,
184
- type: Mt,
185
- properties: wt,
186
- required: Tt
187
- }, St = "image-cropper", zt = "A Farris Component", Et = "object", kt = {
193
+ ], St = {
194
+ $schema: yt,
195
+ $id: xt,
196
+ title: bt,
197
+ description: Mt,
198
+ type: wt,
199
+ properties: Tt,
200
+ required: At
201
+ }, zt = "image-cropper", Et = "A Farris Component", kt = "object", Dt = {
188
202
  basic: {
189
203
  description: "Basic Infomation",
190
204
  title: "基本信息",
@@ -237,11 +251,11 @@ const mt = /* @__PURE__ */ new Map([
237
251
  }
238
252
  }
239
253
  }
240
- }, Dt = {
241
- title: St,
242
- description: zt,
243
- type: Et,
244
- categories: kt
254
+ }, Bt = {
255
+ title: zt,
256
+ description: Et,
257
+ type: kt,
258
+ categories: Dt
245
259
  }, he = {
246
260
  /** 输出图片格式 */
247
261
  format: { type: String, default: "png" },
@@ -299,9 +313,9 @@ const mt = /* @__PURE__ */ new Map([
299
313
  y2: 1e4
300
314
  }
301
315
  }
302
- }, we = ht(he, At, mt, dt, Dt);
316
+ }, we = dt(he, St, pt, mt, Bt);
303
317
  var ae = /* @__PURE__ */ ((e) => (e.Move = "move", e.Resize = "resize", e))(ae || {});
304
- function Bt() {
318
+ function Ct() {
305
319
  function e(o) {
306
320
  switch (typeof o == "string" && (o = i(o)), o) {
307
321
  case 2:
@@ -323,12 +337,12 @@ function Bt() {
323
337
  }
324
338
  }
325
339
  function i(o) {
326
- const t = new DataView(r(o));
340
+ const t = new DataView(n(o));
327
341
  if (t.getUint16(0, !1) !== 65496)
328
342
  return -2;
329
- const h = t.byteLength;
343
+ const c = t.byteLength;
330
344
  let g = 2;
331
- for (; g < h; ) {
345
+ for (; g < c; ) {
332
346
  if (t.getUint16(g + 2, !1) <= 8)
333
347
  return -1;
334
348
  const w = t.getUint16(g, !1);
@@ -339,9 +353,9 @@ function Bt() {
339
353
  g += t.getUint32(g + 4, s);
340
354
  const y = t.getUint16(g, s);
341
355
  g += 2;
342
- for (let m = 0; m < y; m++)
343
- if (t.getUint16(g + m * 12, s) === 274)
344
- return t.getUint16(g + m * 12 + 8, s);
356
+ for (let p = 0; p < y; p++)
357
+ if (t.getUint16(g + p * 12, s) === 274)
358
+ return t.getUint16(g + p * 12 + 8, s);
345
359
  } else {
346
360
  if ((w & 65280) !== 65280)
347
361
  break;
@@ -350,74 +364,74 @@ function Bt() {
350
364
  }
351
365
  return -1;
352
366
  }
353
- function r(o) {
367
+ function n(o) {
354
368
  o = o.replace(/^data:([^;]+);base64,/gmi, "");
355
- const t = atob(o), h = t.length, g = new Uint8Array(h);
356
- for (let w = 0; w < h; w++)
369
+ const t = atob(o), c = t.length, g = new Uint8Array(c);
370
+ for (let w = 0; w < c; w++)
357
371
  g[w] = t.charCodeAt(w);
358
372
  return g.buffer;
359
373
  }
360
- function p(o, t, h) {
374
+ function d(o, t, c) {
361
375
  const g = o.width, w = o.height;
362
- t = Math.round(t), h = Math.round(h);
363
- const s = g / t, y = w / h, m = Math.ceil(s / 2), l = Math.ceil(y / 2), u = o.getContext("2d");
364
- if (u) {
365
- const T = u.getImageData(0, 0, g, w), M = u.createImageData(t, h), { data: P } = T, W = M.data;
366
- for (let R = 0; R < h; R++)
376
+ t = Math.round(t), c = Math.round(c);
377
+ const s = g / t, y = w / c, p = Math.ceil(s / 2), l = Math.ceil(y / 2), r = o.getContext("2d");
378
+ if (r) {
379
+ const T = r.getImageData(0, 0, g, w), M = r.createImageData(t, c), { data: W } = T, L = M.data;
380
+ for (let R = 0; R < c; R++)
367
381
  for (let B = 0; B < t; B++) {
368
- const j = (B + R * t) * 4, d = R * y;
369
- let A = 0, c = 0, b = 0, V = 0, Q = 0, D = 0, E = 0;
370
- const $ = Math.floor(B * s), C = Math.floor(R * y);
382
+ const j = (B + R * t) * 4, m = R * y;
383
+ let A = 0, f = 0, b = 0, V = 0, Q = 0, D = 0, E = 0;
384
+ const H = Math.floor(B * s), C = Math.floor(R * y);
371
385
  let q = Math.ceil((B + 1) * s), J = Math.ceil((R + 1) * y);
372
386
  q = Math.min(q, g), J = Math.min(J, w);
373
- for (let L = C; L < J; L++) {
374
- const z = Math.abs(d - L) / l, ie = B * s, ee = z * z;
375
- for (let U = $; U < q; U++) {
376
- const N = Math.abs(ie - U) / m, H = Math.sqrt(ee + N * N);
377
- if (H >= 1)
387
+ for (let P = C; P < J; P++) {
388
+ const z = Math.abs(m - P) / l, ie = B * s, ee = z * z;
389
+ for (let U = H; U < q; U++) {
390
+ const N = Math.abs(ie - U) / p, _ = Math.sqrt(ee + N * N);
391
+ if (_ >= 1)
378
392
  continue;
379
- A = 2 * H * H * H - 3 * H * H + 1;
380
- const I = 4 * (U + L * g);
381
- E += A * P[I + 3], b += A, P[I + 3] < 255 && (A = A * P[I + 3] / 250), V += A * P[I], Q += A * P[I + 1], D += A * P[I + 2], c += A;
393
+ A = 2 * _ * _ * _ - 3 * _ * _ + 1;
394
+ const O = 4 * (U + P * g);
395
+ E += A * W[O + 3], b += A, W[O + 3] < 255 && (A = A * W[O + 3] / 250), V += A * W[O], Q += A * W[O + 1], D += A * W[O + 2], f += A;
382
396
  }
383
397
  }
384
- W[j] = V / c, W[j + 1] = Q / c, W[j + 2] = D / c, W[j + 3] = E / b;
398
+ L[j] = V / f, L[j + 1] = Q / f, L[j + 2] = D / f, L[j + 3] = E / b;
385
399
  }
386
- o.width = t, o.height = h, u.putImageData(M, 0, 0);
400
+ o.width = t, o.height = c, r.putImageData(M, 0, 0);
387
401
  }
388
402
  }
389
403
  return {
390
- resizeCanvas: p,
404
+ resizeCanvas: d,
391
405
  getTransformationsFromExifData: e
392
406
  };
393
407
  }
394
- function Ct(e, i, r, p) {
395
- function o(l, u) {
396
- e.value.x2 = e.value.x1 + (e.value.y2 - e.value.y1) * r.value, l = Math.max(e.value.x2 - i.value.width, 0), u = Math.max(0 - e.value.y1, 0), (l > 0 || u > 0) && (e.value.x2 -= u * r.value > l ? u * r.value : l, e.value.y1 += u * r.value > l ? u : l / r.value);
408
+ function Lt(e, i, n, d) {
409
+ function o(l, r) {
410
+ e.value.x2 = e.value.x1 + (e.value.y2 - e.value.y1) * n.value, l = Math.max(e.value.x2 - i.value.width, 0), r = Math.max(0 - e.value.y1, 0), (l > 0 || r > 0) && (e.value.x2 -= r * n.value > l ? r * n.value : l, e.value.y1 += r * n.value > l ? r : l / n.value);
397
411
  }
398
- function t(l, u) {
399
- e.value.x2 = e.value.x1 + (e.value.y2 - e.value.y1) * r.value, l = Math.max(e.value.x2 - i.value.width, 0), u = Math.max(e.value.y2 - i.value.height, 0), (l > 0 || u > 0) && (e.value.x2 -= u * r.value > l ? u * r.value : l, e.value.y2 -= u * r.value > l ? u : l / r.value);
412
+ function t(l, r) {
413
+ e.value.x2 = e.value.x1 + (e.value.y2 - e.value.y1) * n.value, l = Math.max(e.value.x2 - i.value.width, 0), r = Math.max(e.value.y2 - i.value.height, 0), (l > 0 || r > 0) && (e.value.x2 -= r * n.value > l ? r * n.value : l, e.value.y2 -= r * n.value > l ? r : l / n.value);
400
414
  }
401
- function h(l, u) {
402
- e.value.y1 = e.value.y2 - (e.value.x2 - e.value.x1) / r.value, l = Math.max(0 - e.value.x1, 0), u = Math.max(0 - e.value.y1, 0), (l > 0 || u > 0) && (e.value.x1 += u * r.value > l ? u * r.value : l, e.value.y1 += u * r.value > l ? u : l / r.value);
415
+ function c(l, r) {
416
+ e.value.y1 = e.value.y2 - (e.value.x2 - e.value.x1) / n.value, l = Math.max(0 - e.value.x1, 0), r = Math.max(0 - e.value.y1, 0), (l > 0 || r > 0) && (e.value.x1 += r * n.value > l ? r * n.value : l, e.value.y1 += r * n.value > l ? r : l / n.value);
403
417
  }
404
- function g(l, u) {
405
- e.value.y1 = e.value.y2 - (e.value.x2 - e.value.x1) / r.value, l = Math.max(e.value.x2 - i.value.width, 0), u = Math.max(0 - e.value.y1, 0), (l > 0 || u > 0) && (e.value.x2 -= u * r.value > l ? u * r.value : l, e.value.y1 += u * r.value > l ? u : l / r.value);
418
+ function g(l, r) {
419
+ e.value.y1 = e.value.y2 - (e.value.x2 - e.value.x1) / n.value, l = Math.max(e.value.x2 - i.value.width, 0), r = Math.max(0 - e.value.y1, 0), (l > 0 || r > 0) && (e.value.x2 -= r * n.value > l ? r * n.value : l, e.value.y1 += r * n.value > l ? r : l / n.value);
406
420
  }
407
- function w(l, u) {
408
- e.value.y2 = e.value.y1 + (e.value.x2 - e.value.x1) / r.value, l = Math.max(e.value.x2 - i.value.width, 0), u = Math.max(e.value.y2 - i.value.height, 0), (l > 0 || u > 0) && (e.value.x2 -= u * r.value > l ? u * r.value : l, e.value.y2 -= u * r.value > l ? u : l / r.value);
421
+ function w(l, r) {
422
+ e.value.y2 = e.value.y1 + (e.value.x2 - e.value.x1) / n.value, l = Math.max(e.value.x2 - i.value.width, 0), r = Math.max(e.value.y2 - i.value.height, 0), (l > 0 || r > 0) && (e.value.x2 -= r * n.value > l ? r * n.value : l, e.value.y2 -= r * n.value > l ? r : l / n.value);
409
423
  }
410
- function s(l, u) {
411
- e.value.y2 = e.value.y1 + (e.value.x2 - e.value.x1) / r.value, l = Math.max(0 - e.value.x1, 0), u = Math.max(e.value.y2 - i.value.height, 0), (l > 0 || u > 0) && (e.value.x1 += u * r.value > l ? u * r.value : l, e.value.y2 -= u * r.value > l ? u : l / r.value);
424
+ function s(l, r) {
425
+ e.value.y2 = e.value.y1 + (e.value.x2 - e.value.x1) / n.value, l = Math.max(0 - e.value.x1, 0), r = Math.max(e.value.y2 - i.value.height, 0), (l > 0 || r > 0) && (e.value.x1 += r * n.value > l ? r * n.value : l, e.value.y2 -= r * n.value > l ? r : l / n.value);
412
426
  }
413
427
  function y() {
414
- e.value.x2 = e.value.x1 + (e.value.y2 - e.value.y1) * r.value, e.value.y2 = e.value.y1 + (e.value.x2 - e.value.x1) / r.value;
415
- const l = Math.max(0 - e.value.x1, 0), u = Math.max(e.value.x2 - i.value.width, 0), T = Math.max(e.value.y2 - i.value.height, 0), M = Math.max(0 - e.value.y1, 0);
416
- (l > 0 || u > 0 || T > 0 || M > 0) && (e.value.x1 += T * r.value > l ? T * r.value : l, e.value.x2 -= M * r.value > u ? M * r.value : u, e.value.y1 += M * r.value > u ? M : u / r.value, e.value.y2 -= T * r.value > l ? T : l / r.value);
428
+ e.value.x2 = e.value.x1 + (e.value.y2 - e.value.y1) * n.value, e.value.y2 = e.value.y1 + (e.value.x2 - e.value.x1) / n.value;
429
+ const l = Math.max(0 - e.value.x1, 0), r = Math.max(e.value.x2 - i.value.width, 0), T = Math.max(e.value.y2 - i.value.height, 0), M = Math.max(0 - e.value.y1, 0);
430
+ (l > 0 || r > 0 || T > 0 || M > 0) && (e.value.x1 += T * n.value > l ? T * n.value : l, e.value.x2 -= M * n.value > r ? M * n.value : r, e.value.y1 += M * n.value > r ? M : r / n.value, e.value.y2 -= T * n.value > l ? T : l / n.value);
417
431
  }
418
- function m() {
432
+ function p() {
419
433
  if (i.value.width && i.value.height)
420
- switch (p.position) {
434
+ switch (d.position) {
421
435
  case "top":
422
436
  o(0, 0);
423
437
  break;
@@ -425,7 +439,7 @@ function Ct(e, i, r, p) {
425
439
  t(0, 0);
426
440
  break;
427
441
  case "topleft":
428
- h(0, 0);
442
+ c(0, 0);
429
443
  break;
430
444
  case "topright":
431
445
  g(0, 0);
@@ -443,19 +457,19 @@ function Ct(e, i, r, p) {
443
457
  break;
444
458
  }
445
459
  }
446
- return { checkAspectRatio: m };
460
+ return { checkAspectRatio: p };
447
461
  }
448
- function De(e, i) {
449
- const { resizeCanvas: r, getTransformationsFromExifData: p } = Bt(), o = Te("NotifyService"), t = v(e.cropper), h = v(e.transform), g = v(e.cropperMinWidth), w = v(e.maintainAspectRatio), s = v(e.aspectRatio), y = v(e.autoCrop), m = v(e.backgroundColor), l = v(e.resizeToWidth), u = v(e.onlyScaleDown), T = v(e.containWithinAspectRatio), M = v(e.canvasRotation), P = v(e.format), W = v(e.imageQuality), R = v(e.resizeToHeight), B = v(e.cropperMinHeight), j = v(""), d = v(!0), A = v(!0);
450
- let c, b, V = 0, Q, D, E;
451
- const $ = v(null), C = v(""), q = v(""), J = v("0px"), L = v(), z = v({ width: 100, height: 100 }), ie = ae;
452
- let ee, U = 20, N = 20, H = !1, I = { rotate: 0, flip: !1 }, x = { active: !1, type: null, position: null, x1: 0, y1: 0, x2: 0, y2: 0, clientX: 0, clientY: 0 };
453
- const ge = v(e.imageChangedEvent), le = v(e.imageURL), Be = v(e.imageBase64), Ce = v(e.imageFile);
454
- function We() {
455
- q.value = "scaleX(" + (h.value.scale || 1) * (h.value.flipH ? -1 : 1) + ")scaleY(" + (h.value.scale || 1) * (h.value.flipV ? -1 : 1) + ")rotate(" + (h.value.rotate || 0) + "deg)";
462
+ function Be(e, i) {
463
+ const { resizeCanvas: n, getTransformationsFromExifData: d } = Ct(), o = Te("NotifyService"), t = h(e.cropper), c = h(e.transform), g = h(e.cropperMinWidth), w = h(e.maintainAspectRatio), s = h(e.aspectRatio), y = h(e.autoCrop), p = h(e.backgroundColor), l = h(e.resizeToWidth), r = h(e.onlyScaleDown), T = h(e.containWithinAspectRatio), M = h(e.canvasRotation), W = h(e.format), L = h(e.imageQuality), R = h(e.resizeToHeight), B = h(e.cropperMinHeight), j = h(""), m = h(!0), A = h(!0);
464
+ let f, b, V = 0, Q, D, E;
465
+ const H = h(null), C = h(""), q = h(""), J = h("0px"), P = h(), z = h({ width: 100, height: 100 }), ie = ae;
466
+ let ee, U = 20, N = 20, _ = !1, O = { rotate: 0, flip: !1 }, x = { active: !1, type: null, position: null, x1: 0, y1: 0, x2: 0, y2: 0, clientX: 0, clientY: 0 };
467
+ const de = h(e.imageChangedEvent), le = h(e.imageURL), Ce = h(e.imageBase64), Le = h(e.imageFile);
468
+ function Pe() {
469
+ q.value = "scaleX(" + (c.value.scale || 1) * (c.value.flipH ? -1 : 1) + ")scaleY(" + (c.value.scale || 1) * (c.value.flipV ? -1 : 1) + ")rotate(" + (c.value.rotate || 0) + "deg)";
456
470
  }
457
471
  function Y() {
458
- A.value = !1, L.value = null, j.value = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=", x = {
472
+ A.value = !1, P.value = null, j.value = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=", x = {
459
473
  active: !1,
460
474
  type: null,
461
475
  position: null,
@@ -468,7 +482,7 @@ function De(e, i) {
468
482
  }, z.value = {
469
483
  width: 0,
470
484
  height: 0
471
- }, c = {
485
+ }, f = {
472
486
  width: 0,
473
487
  height: 0
474
488
  }, b = {
@@ -476,193 +490,193 @@ function De(e, i) {
476
490
  height: 0
477
491
  }, t.value.x1 = -100, t.value.y1 = -100, t.value.x2 = 1e4, t.value.y2 = 1e4;
478
492
  }
479
- function Le(a) {
493
+ function We(a) {
480
494
  return /image\/(png|jpg|jpeg|bmp|gif|tiff|webp)/.test(a);
481
495
  }
482
- function Pe() {
483
- if (M.value += I.rotate, T.value && c.width && c.height) {
496
+ function Re() {
497
+ if (M.value += O.rotate, T.value && f.width && f.height) {
484
498
  if (M.value % 2) {
485
- const f = c.width * s.value, k = c.height / s.value;
499
+ const v = f.width * s.value, k = f.height / s.value;
486
500
  return {
487
- width: Math.max(c.height, f),
488
- height: Math.max(c.width, k)
501
+ width: Math.max(f.height, v),
502
+ height: Math.max(f.width, k)
489
503
  };
490
504
  }
491
- const a = c.height * s.value, n = c.width / s.value;
505
+ const a = f.height * s.value, u = f.width / s.value;
492
506
  return {
493
- width: Math.max(c.width, a),
494
- height: Math.max(c.height, n)
507
+ width: Math.max(f.width, a),
508
+ height: Math.max(f.height, u)
495
509
  };
496
510
  }
497
511
  return M.value % 2 ? {
498
- height: c.width,
499
- width: c.height
512
+ height: f.width,
513
+ width: f.height
500
514
  } : {
501
- width: c.width,
502
- height: c.height
515
+ width: f.width,
516
+ height: f.height
503
517
  };
504
518
  }
505
- function Re() {
506
- M.value += I.rotate;
507
- const a = Pe(), n = document.createElement("canvas");
508
- a.width && a.height && (n.width = a.width, n.height = a.height);
509
- const f = n.getContext("2d");
510
- return c.width && c.height && E && (f == null || f.setTransform(I.flip ? -1 : 1, 0, 0, 1, n.width / 2, n.height / 2), f == null || f.rotate(Math.PI * (M.value / 2)), f == null || f.drawImage(E, -c.width / 2, -c.height / 2)), n.toDataURL();
511
- }
512
- function He(a) {
513
- return new Promise((n) => {
514
- ee = a, j.value = a, L.value = new Image(), L.value.onload = () => {
515
- var f, k;
516
- b.width = (f = L.value) == null ? void 0 : f.naturalWidth, b.height = (k = L.value) == null ? void 0 : k.naturalHeight, n();
517
- }, L.value.src = ee;
519
+ function _e() {
520
+ M.value += O.rotate;
521
+ const a = Re(), u = document.createElement("canvas");
522
+ a.width && a.height && (u.width = a.width, u.height = a.height);
523
+ const v = u.getContext("2d");
524
+ return f.width && f.height && E && (v == null || v.setTransform(O.flip ? -1 : 1, 0, 0, 1, u.width / 2, u.height / 2), v == null || v.rotate(Math.PI * (M.value / 2)), v == null || v.drawImage(E, -f.width / 2, -f.height / 2)), u.toDataURL();
525
+ }
526
+ function $e(a) {
527
+ return new Promise((u) => {
528
+ ee = a, j.value = a, P.value = new Image(), P.value.onload = () => {
529
+ var v, k;
530
+ b.width = (v = P.value) == null ? void 0 : v.naturalWidth, b.height = (k = P.value) == null ? void 0 : k.naturalHeight, u();
531
+ }, P.value.src = ee;
518
532
  });
519
533
  }
520
- function de() {
521
- if (!E || !E.complete || !I)
534
+ function ge() {
535
+ if (!E || !E.complete || !O)
522
536
  return Promise.reject(new Error("No image loaded"));
523
- const a = Re();
524
- return He(a);
537
+ const a = _e();
538
+ return $e(a);
525
539
  }
526
540
  function ne(a) {
527
- const n = (f) => {
541
+ const u = (v) => {
528
542
  o.show({
529
543
  showCloseButton: !1,
530
544
  timeout: 3e3,
531
545
  animate: "fadeIn",
532
546
  toasts: [{ type: "string", title: "提示", msg: "图片上传错误,请重试" }]
533
- }), d.value = !1, H = !0, i.emit("loadImageFailed"), E = null, C.value = "";
547
+ }), m.value = !1, _ = !0, i.emit("loadImageFailed"), E = null, C.value = "";
534
548
  };
535
549
  E = new Image(), E.onload = () => {
536
- C.value = a, I = p(a), c.width = E == null ? void 0 : E.naturalWidth, c.height = E == null ? void 0 : E.naturalHeight, de().then(() => {
537
- H = !1;
538
- }).catch(n);
539
- }, E.onerror = n, E.src = a;
550
+ C.value = a, O = d(a), f.width = E == null ? void 0 : E.naturalWidth, f.height = E == null ? void 0 : E.naturalHeight, ge().then(() => {
551
+ _ = !1;
552
+ }).catch(u);
553
+ }, E.onerror = u, E.src = a;
540
554
  }
541
- function _e(a, n) {
542
- Le(n) ? (H = !1, ne(a)) : (o.show({
555
+ function He(a, u) {
556
+ We(u) ? (_ = !1, ne(a)) : (o.show({
543
557
  showCloseButton: !1,
544
558
  timeout: 3e3,
545
559
  animate: "fadeIn",
546
560
  toasts: [{ type: "string", title: "提示", msg: "图片类型不正确,请重试" }]
547
- }), d.value = !1, H = !0, i.emit("loadImageFailed"));
561
+ }), m.value = !1, _ = !0, i.emit("loadImageFailed"));
548
562
  }
549
563
  function me(a) {
550
- const n = new FileReader();
551
- n.onload = (f) => _e(f.target.result, a.type), n.readAsDataURL(a);
564
+ const u = new FileReader();
565
+ u.onload = (v) => He(v.target.result, a.type), u.readAsDataURL(a);
552
566
  }
553
567
  function pe(a) {
554
- const n = new Image();
555
- n.onerror = () => {
568
+ const u = new Image();
569
+ u.onerror = () => {
556
570
  o.show({
557
571
  showCloseButton: !1,
558
572
  timeout: 3e3,
559
573
  animate: "fadeIn",
560
574
  toasts: [{ type: "string", title: "提示", msg: "图片加载错误,请重试" }]
561
- }), d.value = !1, H = !0, i.emit("loadImageFailed");
562
- }, n.onload = () => {
563
- H = !1;
564
- const f = document.createElement("canvas"), k = f.getContext("2d");
565
- f.width = n.width, f.height = n.height, k == null || k.drawImage(n, 0, 0), ne(f.toDataURL());
566
- }, n.crossOrigin = "anonymous", n.src = a;
575
+ }), m.value = !1, _ = !0, i.emit("loadImageFailed");
576
+ }, u.onload = () => {
577
+ _ = !1;
578
+ const v = document.createElement("canvas"), k = v.getContext("2d");
579
+ v.width = u.width, v.height = u.height, k == null || k.drawImage(u, 0, 0), ne(v.toDataURL());
580
+ }, u.crossOrigin = "anonymous", u.src = a;
567
581
  }
568
- function $e() {
569
- return $.value && $.value && $.value.offsetWidth > 0;
582
+ function Ue() {
583
+ return H.value && H.value && H.value.offsetWidth > 0;
570
584
  }
571
585
  function ue() {
572
- if ($.value) {
573
- const a = $.value;
586
+ if (H.value) {
587
+ const a = H.value;
574
588
  z.value.width = a.offsetWidth, z.value.height = a.offsetHeight, J.value = "calc(50% - " + z.value.width / 2 + "px)";
575
589
  }
576
590
  }
577
- function Ue() {
578
- L.value && z.value.width && (U = g.value > 0 ? Math.max(20, g.value / L.value.width * z.value.width) : 20);
579
- }
580
591
  function je() {
581
- w.value ? N = Math.max(20, U / s.value) : B.value > 0 && L.value && z.value.height ? N = Math.max(20, B.value / L.value.height * z.value.height) : N = 20;
592
+ P.value && z.value.width && (U = g.value > 0 ? Math.max(20, g.value / P.value.width * z.value.width) : 20);
593
+ }
594
+ function Ne() {
595
+ w.value ? N = Math.max(20, U / s.value) : B.value > 0 && P.value && z.value.height ? N = Math.max(20, B.value / P.value.height * z.value.height) : N = 20;
582
596
  }
583
597
  function re() {
584
- L.value ? (Ue(), je()) : (U = 20, N = 20);
598
+ P.value ? (je(), Ne()) : (U = 20, N = 20);
585
599
  }
586
- function Ne() {
587
- const a = $.value, n = v({ x1: 0, x2: 0, y1: 0, y2: 0 });
600
+ function Oe() {
601
+ const a = H.value, u = h({ x1: 0, x2: 0, y1: 0, y2: 0 });
588
602
  if (a && b.width && b.height) {
589
- const f = b.width / a.offsetWidth;
590
- n.value = {
591
- x1: Math.round(t.value.x1 * f),
592
- y1: Math.round(t.value.y1 * f),
593
- x2: Math.round(t.value.x2 * f),
594
- y2: Math.round(t.value.y2 * f)
595
- }, T.value || (n.value.x1 = Math.max(n.value.x1, 0), n.value.y1 = Math.max(n.value.y1, 0), n.value.x2 = Math.min(n.value.x2, b.width), n.value.y2 = Math.min(n.value.y2, b.height));
603
+ const v = b.width / a.offsetWidth;
604
+ u.value = {
605
+ x1: Math.round(t.value.x1 * v),
606
+ y1: Math.round(t.value.y1 * v),
607
+ x2: Math.round(t.value.x2 * v),
608
+ y2: Math.round(t.value.y2 * v)
609
+ }, T.value || (u.value.x1 = Math.max(u.value.x1, 0), u.value.y1 = Math.max(u.value.y1, 0), u.value.x2 = Math.min(u.value.x2, b.width), u.value.y2 = Math.min(u.value.y2, b.height));
596
610
  }
597
- return n.value;
611
+ return u.value;
598
612
  }
599
613
  function Ie() {
600
- M.value += I.rotate;
601
- const a = $.value, n = v({ x1: 0, x2: 0, y1: 0, y2: 0 });
602
- if (a && b.height && b.width && c.height && c.width) {
603
- const f = b.width / a.offsetWidth;
604
- let k, _;
605
- M.value % 2 ? (k = (b.width - c.height) / 2, _ = (b.height - c.width) / 2) : (k = (b.width - c.width) / 2, _ = (b.height - c.height) / 2), n.value = {
606
- x1: Math.round(t.value.x1 * f) - k,
607
- y1: Math.round(t.value.y1 * f) - _,
608
- x2: Math.round(t.value.x2 * f) - k,
609
- y2: Math.round(t.value.y2 * f) - _
610
- }, T.value || (n.value.x1 = Math.max(n.value.x1, 0), n.value.y1 = Math.max(n.value.y1, 0), n.value.x2 = Math.min(n.value.x2, b.width), n.value.y2 = Math.min(n.value.y2, b.height));
614
+ M.value += O.rotate;
615
+ const a = H.value, u = h({ x1: 0, x2: 0, y1: 0, y2: 0 });
616
+ if (a && b.height && b.width && f.height && f.width) {
617
+ const v = b.width / a.offsetWidth;
618
+ let k, $;
619
+ M.value % 2 ? (k = (b.width - f.height) / 2, $ = (b.height - f.width) / 2) : (k = (b.width - f.width) / 2, $ = (b.height - f.height) / 2), u.value = {
620
+ x1: Math.round(t.value.x1 * v) - k,
621
+ y1: Math.round(t.value.y1 * v) - $,
622
+ x2: Math.round(t.value.x2 * v) - k,
623
+ y2: Math.round(t.value.y2 * v) - $
624
+ }, T.value || (u.value.x1 = Math.max(u.value.x1, 0), u.value.y1 = Math.max(u.value.y1, 0), u.value.x2 = Math.min(u.value.x2, b.width), u.value.y2 = Math.min(u.value.y2, b.height));
611
625
  }
612
- return n.value;
626
+ return u.value;
613
627
  }
614
- function Oe(a, n) {
628
+ function Ve(a, u) {
615
629
  if (l.value > 0) {
616
- if (!u.value || a > l.value)
630
+ if (!r.value || a > l.value)
617
631
  return l.value / a;
618
- } else if (R.value > 0 && (!u.value || n > R.value))
619
- return R.value / n;
632
+ } else if (R.value > 0 && (!r.value || u > R.value))
633
+ return R.value / u;
620
634
  return 1;
621
635
  }
622
- function Ve() {
623
- return Math.min(1, Math.max(0, W.value / 100));
624
- }
625
- function Fe(a) {
626
- return a.toDataURL("image/" + P.value, Ve());
627
- }
628
- function qe() {
629
- if ($.value && $.value && L.value != null) {
630
- const a = Ne(), n = a.x2 - a.x1, f = a.y2 - a.y1, k = document.createElement("canvas");
631
- k.width = n, k.height = f;
632
- const _ = k.getContext("2d");
633
- if (_) {
634
- m.value != null && (_.fillStyle = m.value, _.fillRect(0, 0, n, f));
635
- const G = (h.value.scale || 1) * (h.value.flipH ? -1 : 1), Z = (h.value.scale || 1) * (h.value.flipV ? -1 : 1);
636
- b.width && b.height && (_.setTransform(G, 0, 0, Z, b.width / 2, b.height / 2), _.translate(-a.x1 / G, -a.y1 / Z), _.rotate((h.value.rotate || 0) * Math.PI / 180), _.drawImage(L.value, -b.width / 2, -b.height / 2));
636
+ function Fe() {
637
+ return Math.min(1, Math.max(0, L.value / 100));
638
+ }
639
+ function qe(a) {
640
+ return a.toDataURL("image/" + W.value, Fe());
641
+ }
642
+ function Qe() {
643
+ if (H.value && H.value && P.value != null) {
644
+ const a = Oe(), u = a.x2 - a.x1, v = a.y2 - a.y1, k = document.createElement("canvas");
645
+ k.width = u, k.height = v;
646
+ const $ = k.getContext("2d");
647
+ if ($) {
648
+ p.value != null && ($.fillStyle = p.value, $.fillRect(0, 0, u, v));
649
+ const G = (c.value.scale || 1) * (c.value.flipH ? -1 : 1), Z = (c.value.scale || 1) * (c.value.flipV ? -1 : 1);
650
+ b.width && b.height && ($.setTransform(G, 0, 0, Z, b.width / 2, b.height / 2), $.translate(-a.x1 / G, -a.y1 / Z), $.rotate((c.value.rotate || 0) * Math.PI / 180), $.drawImage(P.value, -b.width / 2, -b.height / 2));
637
651
  const F = {
638
- width: n,
639
- height: f,
652
+ width: u,
653
+ height: v,
640
654
  imagePosition: a,
641
655
  cropperPosition: { ...t.value }
642
656
  };
643
657
  T.value && (F.offsetImagePosition = Ie());
644
- const X = Oe(n, f);
645
- return X !== 1 && (F.width = Math.round(n * X), F.height = w.value ? Math.round(F.width / s.value) : Math.round(f * X), r(k, F.width, F.height)), F.base64 = Fe(k), i.emit("imageCropped", F), F;
658
+ const X = Ve(u, v);
659
+ return X !== 1 && (F.width = Math.round(u * X), F.height = w.value ? Math.round(F.width / s.value) : Math.round(v * X), n(k, F.width, F.height)), F.base64 = qe(k), i.emit("imageCropped", F), F;
646
660
  }
647
661
  }
648
662
  return null;
649
663
  }
650
664
  function te() {
651
- y.value && qe();
665
+ y.value && Qe();
652
666
  }
653
667
  function ye() {
654
- const a = $.value;
668
+ const a = H.value;
655
669
  if (a) {
656
670
  if (!w.value)
657
671
  t.value.x1 = 0, t.value.x2 = a.offsetWidth, t.value.y1 = 0, t.value.y2 = a.offsetHeight;
658
672
  else if (a.offsetWidth / s.value < a.offsetHeight) {
659
673
  t.value.x1 = 0, t.value.x2 = a.offsetWidth;
660
- const n = a.offsetWidth / s.value;
661
- t.value.y1 = (a.offsetHeight - n) / 2, t.value.y2 = t.value.y1 + n;
674
+ const u = a.offsetWidth / s.value;
675
+ t.value.y1 = (a.offsetHeight - u) / 2, t.value.y2 = t.value.y1 + u;
662
676
  } else {
663
677
  t.value.y1 = 0, t.value.y2 = a.offsetHeight;
664
- const n = a.offsetHeight * s.value;
665
- t.value.x1 = (a.offsetWidth - n) / 2, t.value.x2 = t.value.x1 + n;
678
+ const u = a.offsetHeight * s.value;
679
+ t.value.x1 = (a.offsetWidth - u) / 2, t.value.x2 = t.value.x1 + u;
666
680
  }
667
681
  te(), A.value = !0;
668
682
  }
@@ -673,26 +687,26 @@ function De(e, i) {
673
687
  timeout: 3e3,
674
688
  animate: "fadeIn",
675
689
  toasts: [{ type: "string", title: "提示", msg: "图片加载超时,请重试" }]
676
- }), H = !0, d.value = !1, i.emit("loadImageFailed")) : $e() ? (H = !1, ue(), re(), ye(), i.emit("cropperReady", { ...z.value })) : (V++, setTimeout(() => xe(), 50));
677
- }
678
- function Qe() {
679
- L.value != null && (d.value = !1, i.emit("imageLoaded"), V = 0, setTimeout(() => xe()));
690
+ }), _ = !0, m.value = !1, i.emit("loadImageFailed")) : Ue() ? (_ = !1, ue(), re(), ye(), i.emit("cropperReady", { ...z.value })) : (V++, setTimeout(() => xe(), 50));
680
691
  }
681
692
  function Ge() {
682
- const a = $.value;
693
+ P.value != null && (m.value = !1, i.emit("imageLoaded"), V = 0, setTimeout(() => xe()));
694
+ }
695
+ function Je() {
696
+ const a = H.value;
683
697
  (z.value.width !== (a == null ? void 0 : a.offsetWidth) || z.value.height !== (a == null ? void 0 : a.offsetHeight)) && z.value.width && z.value.height && a && (t.value.x1 = t.value.x1 * a.offsetWidth / z.value.width, t.value.x2 = t.value.x2 * a.offsetWidth / z.value.width, t.value.y1 = t.value.y1 * a.offsetHeight / z.value.height, t.value.y2 = t.value.y2 * a.offsetHeight / z.value.height);
684
698
  }
685
- const Je = () => {
686
- Ge(), ue(), re();
699
+ const Ze = () => {
700
+ Je(), ue(), re();
687
701
  }, be = () => {
688
- clearTimeout(D), D = setTimeout(Je, 300);
702
+ clearTimeout(D), D = setTimeout(Ze, 300);
689
703
  };
690
704
  Ae(() => {
691
- window.addEventListener("resize", be), le.value && (Y(), d.value = !0, pe(le.value));
692
- }), nt(() => {
705
+ window.addEventListener("resize", be), le.value && (Y(), m.value = !0, pe(le.value));
706
+ }), ut(() => {
693
707
  window.removeEventListener("resize", be);
694
708
  });
695
- function Ze() {
709
+ function Ye() {
696
710
  x.active && (x.active = !1, te());
697
711
  }
698
712
  function se(a) {
@@ -701,11 +715,11 @@ function De(e, i) {
701
715
  function oe(a) {
702
716
  return (a.touches && a.touches[0] ? a.touches[0].clientY : a.clientY) || 0;
703
717
  }
704
- function Ye(a, n, f = null) {
718
+ function Xe(a, u, v = null) {
705
719
  x && x.active || (a.preventDefault && a.preventDefault(), x = {
706
720
  active: !0,
707
- type: n,
708
- position: f,
721
+ type: u,
722
+ position: v,
709
723
  clientX: se(a),
710
724
  clientY: oe(a),
711
725
  ...t.value
@@ -714,63 +728,63 @@ function De(e, i) {
714
728
  function ce(a = !1) {
715
729
  t.value.x1 < 0 && (t.value.x2 -= a ? t.value.x1 : 0, t.value.x1 = 0), t.value.y1 < 0 && (t.value.y2 -= a ? t.value.y1 : 0, t.value.y1 = 0), t.value.x2 > z.value.width && (t.value.x1 -= a ? t.value.x2 - z.value.width : 0, t.value.x2 = z.value.width), t.value.y2 > z.value.height && (t.value.y1 -= a ? t.value.y2 - z.value.height : 0, t.value.y2 = z.value.height);
716
730
  }
717
- function Xe(a) {
718
- const n = se(a) - x.clientX, f = oe(a) - x.clientY;
719
- t.value.x1 = x.x1 + n, t.value.y1 = x.y1 + f, t.value.x2 = x.x2 + n, t.value.y2 = x.y2 + f;
731
+ function Ke(a) {
732
+ const u = se(a) - x.clientX, v = oe(a) - x.clientY;
733
+ t.value.x1 = x.x1 + u, t.value.y1 = x.y1 + v, t.value.x2 = x.x2 + u, t.value.y2 = x.y2 + v;
720
734
  }
721
- const { checkAspectRatio: Ke } = Ct(t, z, s, x);
722
- function et(a) {
723
- const n = se(a) - x.clientX, f = oe(a) - x.clientY;
735
+ const { checkAspectRatio: et } = Lt(t, z, s, x);
736
+ function tt(a) {
737
+ const u = se(a) - x.clientX, v = oe(a) - x.clientY;
724
738
  switch (x.position) {
725
739
  case "left":
726
- t.value.x1 = Math.min(x.x1 + n, t.value.x2 - U);
740
+ t.value.x1 = Math.min(x.x1 + u, t.value.x2 - U);
727
741
  break;
728
742
  case "topleft":
729
- t.value.x1 = Math.min(x.x1 + n, t.value.x2 - U), t.value.y1 = Math.min(x.y1 + f, t.value.y2 - N);
743
+ t.value.x1 = Math.min(x.x1 + u, t.value.x2 - U), t.value.y1 = Math.min(x.y1 + v, t.value.y2 - N);
730
744
  break;
731
745
  case "top":
732
- t.value.y1 = Math.min(x.y1 + f, t.value.y2 - N);
746
+ t.value.y1 = Math.min(x.y1 + v, t.value.y2 - N);
733
747
  break;
734
748
  case "topright":
735
- t.value.x2 = Math.max(x.x2 + n, t.value.x1 + U), t.value.y1 = Math.min(x.y1 + f, t.value.y2 - N);
749
+ t.value.x2 = Math.max(x.x2 + u, t.value.x1 + U), t.value.y1 = Math.min(x.y1 + v, t.value.y2 - N);
736
750
  break;
737
751
  case "right":
738
- t.value.x2 = Math.max(x.x2 + n, t.value.x1 + U);
752
+ t.value.x2 = Math.max(x.x2 + u, t.value.x1 + U);
739
753
  break;
740
754
  case "bottomright":
741
- t.value.x2 = Math.max(x.x2 + n, t.value.x1 + U), t.value.y2 = Math.max(x.y2 + f, t.value.y1 + N);
755
+ t.value.x2 = Math.max(x.x2 + u, t.value.x1 + U), t.value.y2 = Math.max(x.y2 + v, t.value.y1 + N);
742
756
  break;
743
757
  case "bottom":
744
- t.value.y2 = Math.max(x.y2 + f, t.value.y1 + N);
758
+ t.value.y2 = Math.max(x.y2 + v, t.value.y1 + N);
745
759
  break;
746
760
  case "bottomleft":
747
- t.value.x1 = Math.min(x.x1 + n, t.value.x2 - U), t.value.y2 = Math.max(x.y2 + f, t.value.y1 + N);
761
+ t.value.x1 = Math.min(x.x1 + u, t.value.x2 - U), t.value.y2 = Math.max(x.y2 + v, t.value.y1 + N);
748
762
  break;
749
763
  case "center":
750
- const { scale: k } = a, _ = Math.abs(x.x2 - x.x1) * k, G = Math.abs(x.y2 - x.y1) * k, { x1: Z } = t.value, { y1: F } = t.value;
751
- t.value.x1 = Math.min(x.clientX - _ / 2, t.value.x2 - U), t.value.y1 = Math.min(x.clientY - G / 2, t.value.y2 - N), t.value.x2 = Math.max(x.clientX + _ / 2, Z + U), t.value.y2 = Math.max(x.clientY + G / 2, F + N);
764
+ const { scale: k } = a, $ = Math.abs(x.x2 - x.x1) * k, G = Math.abs(x.y2 - x.y1) * k, { x1: Z } = t.value, { y1: F } = t.value;
765
+ t.value.x1 = Math.min(x.clientX - $ / 2, t.value.x2 - U), t.value.y1 = Math.min(x.clientY - G / 2, t.value.y2 - N), t.value.x2 = Math.max(x.clientX + $ / 2, Z + U), t.value.y2 = Math.max(x.clientY + G / 2, F + N);
752
766
  break;
753
767
  }
754
- w.value && Ke();
768
+ w.value && et();
755
769
  }
756
- function tt(a) {
770
+ function at(a) {
757
771
  x && x.active && (a.stopPropagation && a.stopPropagation(), a.preventDefault && a.preventDefault(), clearTimeout(Q), Q = setTimeout(() => {
758
- x.type === ae.Move ? (Xe(a), ce(!0)) : x.type === ae.Resize && (et(a), ce(!1));
772
+ x.type === ae.Move ? (Ke(a), ce(!0)) : x.type === ae.Resize && (tt(a), ce(!1));
759
773
  }, 300));
760
774
  }
761
- return K(ge, (a) => {
762
- Y(), a && a.target && a.target.files && a.target.files.length > 0 && (d.value = !0, me(a.target.files[0]));
775
+ return K(de, (a) => {
776
+ Y(), a && a.target && a.target.files && a.target.files.length > 0 && (m.value = !0, me(a.target.files[0]));
763
777
  }), K(le, (a) => {
764
- a ? (Y(), d.value = !0, pe(a)) : (o.show({
778
+ a ? (Y(), m.value = !0, pe(a)) : (o.show({
765
779
  showCloseButton: !1,
766
780
  timeout: 3e3,
767
781
  animate: "fadeIn",
768
782
  toasts: [{ type: "string", title: "提示", msg: "图片路径为空" }]
769
- }), d.value = !1, H = !0);
770
- }), K(Be, (a) => {
771
- Y(), d.value = !0, ne(a);
783
+ }), m.value = !1, _ = !0);
772
784
  }), K(Ce, (a) => {
773
- Y(), a && (d.value = !0, me(a));
785
+ Y(), m.value = !0, ne(a);
786
+ }), K(Le, (a) => {
787
+ Y(), a && (m.value = !0, me(a));
774
788
  }), K(
775
789
  () => [
776
790
  e.containWithinAspectRatio,
@@ -780,25 +794,25 @@ function De(e, i) {
780
794
  e.transform,
781
795
  e.imageChangedEvent
782
796
  ],
783
- ([a, n, f, k, _, G], [Z, F, X, at, it, lt]) => {
784
- E && E.complete && I && (a !== Z || n !== F) && de(), f !== X && (ue(), re(), ce(!1), te()), k !== at && A.value && ye(), _ !== it && (We(), te()), G !== lt && (ge.value = G);
797
+ ([a, u, v, k, $, G], [Z, F, X, it, lt, nt]) => {
798
+ E && E.complete && O && (a !== Z || u !== F) && ge(), v !== X && (ue(), re(), ce(!1), te()), k !== it && A.value && ye(), $ !== lt && (Pe(), te()), G !== nt && (de.value = G);
785
799
  }
786
800
  ), {
787
- uploadError: H,
801
+ uploadError: _,
788
802
  imageVisible: A,
789
- backgroundColor: m,
790
- sourceImage: $,
803
+ backgroundColor: p,
804
+ sourceImage: H,
791
805
  safeImgDataUrl: j,
792
806
  safeTransformStyle: q,
793
807
  maxSize: z,
794
808
  cropper: t,
795
809
  marginLeft: J,
796
810
  moveTypes: ie,
797
- isLoading: d,
798
- startMove: Ye,
799
- imageLoadedInView: Qe,
800
- moveStop: Ze,
801
- moveImg: tt
811
+ isLoading: m,
812
+ startMove: Xe,
813
+ imageLoadedInView: Ge,
814
+ moveStop: Ye,
815
+ moveImg: at
802
816
  };
803
817
  }
804
818
  const fe = /* @__PURE__ */ Se({
@@ -806,33 +820,33 @@ const fe = /* @__PURE__ */ Se({
806
820
  props: he,
807
821
  emits: ["imageCropped", "imageLoaded", "cropperReady", "loadImageFailed"],
808
822
  setup(e, i) {
809
- const r = v(e.alignImage), p = v(e.roundCropper), o = v(e.hideResizeSquares), t = v(e.loadImageErrorText), h = v(e.disabled), g = v(null), {
823
+ const n = h(e.alignImage), d = h(e.roundCropper), o = h(e.hideResizeSquares), t = h(e.loadImageErrorText), c = h(e.disabled), g = h(null), {
810
824
  uploadError: w,
811
825
  imageVisible: s,
812
826
  backgroundColor: y,
813
- sourceImage: m,
827
+ sourceImage: p,
814
828
  safeImgDataUrl: l,
815
- safeTransformStyle: u,
829
+ safeTransformStyle: r,
816
830
  maxSize: T,
817
831
  cropper: M,
818
- marginLeft: P,
819
- moveTypes: W,
832
+ marginLeft: W,
833
+ moveTypes: L,
820
834
  isLoading: R,
821
835
  startMove: B,
822
836
  imageLoadedInView: j,
823
- moveStop: d,
837
+ moveStop: m,
824
838
  moveImg: A
825
- } = De(e, i);
826
- function c(D) {
839
+ } = Be(e, i);
840
+ function f(D) {
827
841
  return S("span", {
828
842
  class: `farris-image-cropper-resize-bar ${D}`,
829
- onMousedown: O((E) => B(E, W.Resize, D), ["prevent"])
843
+ onMousedown: I((E) => B(E, L.Resize, D), ["prevent"])
830
844
  }, null);
831
845
  }
832
846
  function b(D) {
833
847
  return S("div", null, [S("span", {
834
848
  class: `farris-image-cropper-resize-bar ${D}`,
835
- onMousedown: O((E) => B(E, W.Resize, D), ["prevent"])
849
+ onMousedown: I((E) => B(E, L.Resize, D), ["prevent"])
836
850
  }, [S("span", {
837
851
  class: "farris-image-cropper-square"
838
852
  }, null)]), S("span", {
@@ -841,18 +855,18 @@ const fe = /* @__PURE__ */ Se({
841
855
  class: "farris-image-cropper-square"
842
856
  }, null)])]);
843
857
  }
844
- const V = ["top", "right", "bottom", "left"].map((D) => c(D)), Q = ["topleft", "topright", "bottomright", "bottomleft"].map((D) => b(D));
858
+ const V = ["top", "right", "bottom", "left"].map((D) => f(D)), Q = ["topleft", "topright", "bottomright", "bottomleft"].map((D) => b(D));
845
859
  return () => S("div", {
846
860
  class: ["farris-image-cropper-frame", {
847
- "farris-image-cropper-disabled": h.value
861
+ "farris-image-cropper-disabled": c.value
848
862
  }],
849
863
  style: {
850
- "text-align": r.value
864
+ "text-align": n.value
851
865
  },
852
- onMousemove: O((D) => A(D), ["prevent"]),
853
- onTouchmove: O((D) => A(D), ["prevent"]),
854
- onMouseup: O(() => d(), ["prevent"]),
855
- onTouchend: O(() => d(), ["prevent"])
866
+ onMousemove: I((D) => A(D), ["prevent"]),
867
+ onTouchmove: I((D) => A(D), ["prevent"]),
868
+ onMouseup: I(() => m(), ["prevent"]),
869
+ onTouchend: I(() => m(), ["prevent"])
856
870
  }, [!w && S("div", {
857
871
  ref: g,
858
872
  class: "farris-image-cropper",
@@ -861,12 +875,12 @@ const fe = /* @__PURE__ */ Se({
861
875
  }]
862
876
  }, [l.value && S("img", {
863
877
  title: "farris-source-image",
864
- ref: m,
878
+ ref: p,
865
879
  class: "farris-source-image",
866
880
  style: [{
867
881
  visibility: s.value ? "visible" : "hidden"
868
882
  }, {
869
- transform: u.value
883
+ transform: r.value
870
884
  }],
871
885
  src: l.value,
872
886
  onLoad: () => j()
@@ -877,11 +891,11 @@ const fe = /* @__PURE__ */ Se({
877
891
  }, {
878
892
  height: `${T.value.height || 0}px`
879
893
  }, {
880
- "margin-left": r.value === "center" ? P.value : ""
894
+ "margin-left": n.value === "center" ? W.value : ""
881
895
  }]
882
896
  }, null), s.value && S("div", {
883
897
  class: ["farris-image-cropper-wrapper", {
884
- "farris-image-cropper-rounded": p.value
898
+ "farris-image-cropper-rounded": d.value
885
899
  }],
886
900
  style: [{
887
901
  top: `${M.value.y1}px`
@@ -894,12 +908,12 @@ const fe = /* @__PURE__ */ Se({
894
908
  }, {
895
909
  visibility: s.value ? "visible" : "hidden"
896
910
  }, {
897
- "margin-left": r.value === "center" ? P.value : ""
911
+ "margin-left": n.value === "center" ? W.value : ""
898
912
  }],
899
913
  tabindex: "0"
900
914
  }, [S("div", {
901
915
  class: "farris-image-cropper-move",
902
- onMousedown: O((D) => B(D, W.Move, "topleft"), ["prevent"])
916
+ onMousedown: I((D) => B(D, L.Move, "topleft"), ["prevent"])
903
917
  }, null), !o.value && S("div", null, [Q, V])])]), R.value && S("div", {
904
918
  class: "farris-image-cropper-loading"
905
919
  }, [S("div", {
@@ -909,10 +923,10 @@ const fe = /* @__PURE__ */ Se({
909
923
  }, [t.value])]);
910
924
  }
911
925
  });
912
- function Wt(e, i, r) {
926
+ function Pt(e, i, n) {
913
927
  var j;
914
- const p = "", o = "", t = v();
915
- function h() {
928
+ const d = "", o = "", t = h();
929
+ function c() {
916
930
  return (i == null ? void 0 : i.schema.componentType) !== "frame";
917
931
  }
918
932
  function g() {
@@ -924,49 +938,49 @@ function Wt(e, i, r) {
924
938
  function s() {
925
939
  return (i == null ? void 0 : i.schema.componentType) === "frame";
926
940
  }
927
- function y(d) {
928
- if (!d || !d.value)
941
+ function y(m) {
942
+ if (!m || !m.value)
929
943
  return null;
930
- if (d.value.schema && d.value.schema.type === "component")
931
- return d.value;
932
- const A = v(d == null ? void 0 : d.value.parent), c = y(A);
933
- return c || null;
944
+ if (m.value.schema && m.value.schema.type === "component")
945
+ return m.value;
946
+ const A = h(m == null ? void 0 : m.value.parent), f = y(A);
947
+ return f || null;
934
948
  }
935
- function m(d = i) {
936
- const { componentInstance: A, designerItemElementRef: c } = d;
937
- return !A || !A.value ? null : A.value.canMove ? c : m(d.parent);
949
+ function p(m = i) {
950
+ const { componentInstance: A, designerItemElementRef: f } = m;
951
+ return !A || !A.value ? null : A.value.canMove ? f : p(m.parent);
938
952
  }
939
- function l(d) {
940
- return !!r;
953
+ function l(m) {
954
+ return !!n;
941
955
  }
942
- function u() {
956
+ function r() {
943
957
  return (i == null ? void 0 : i.schema.label) || (i == null ? void 0 : i.schema.title) || (i == null ? void 0 : i.schema.name);
944
958
  }
945
959
  function T() {
946
960
  }
947
- function M(d, A) {
961
+ function M(m, A) {
948
962
  }
949
- function P(d, A) {
950
- const { componentType: c } = d;
951
- let b = ke(c, d, A);
952
- const V = c.toLowerCase().replace(/-/g, "_");
953
- return b && !b.id && b.type === c && (b.id = `${V}_${Math.random().toString().slice(2, 6)}`), b;
963
+ function W(m, A) {
964
+ const { componentType: f } = m;
965
+ let b = De(f, m, A);
966
+ const V = f.toLowerCase().replace(/-/g, "_");
967
+ return b && !b.id && b.type === f && (b.id = `${V}_${Math.random().toString().slice(2, 6)}`), b;
954
968
  }
955
- function W(d) {
969
+ function L(m) {
956
970
  }
957
- function R(...d) {
971
+ function R(...m) {
958
972
  }
959
973
  function B() {
960
- i != null && i.schema.contents && i.schema.contents.map((d) => {
974
+ i != null && i.schema.contents && i.schema.contents.map((m) => {
961
975
  var b;
962
- let A = d.id;
963
- d.type === "component-ref" && (A = d.component);
964
- const c = e.value.querySelector(`#${A}-design-item`);
965
- (b = c == null ? void 0 : c.componentInstance) != null && b.value.onRemoveComponent && c.componentInstance.value.onRemoveComponent();
976
+ let A = m.id;
977
+ m.type === "component-ref" && (A = m.component);
978
+ const f = e.value.querySelector(`#${A}-design-item`);
979
+ (b = f == null ? void 0 : f.componentInstance) != null && b.value.onRemoveComponent && f.componentInstance.value.onRemoveComponent();
966
980
  });
967
981
  }
968
982
  return t.value = {
969
- canMove: h(),
983
+ canMove: c(),
970
984
  canSelectParent: g(),
971
985
  canDelete: w(),
972
986
  canNested: !s(),
@@ -974,57 +988,57 @@ function Wt(e, i, r) {
974
988
  elementRef: e,
975
989
  parent: (j = i == null ? void 0 : i.parent) == null ? void 0 : j.componentInstance,
976
990
  schema: i == null ? void 0 : i.schema,
977
- styles: p,
991
+ styles: d,
978
992
  designerClass: o,
979
993
  canAccepts: l,
980
994
  getBelongedComponentInstance: y,
981
- getDraggableDesignItemElement: m,
982
- getDraggingDisplayText: u,
995
+ getDraggableDesignItemElement: p,
996
+ getDraggingDisplayText: r,
983
997
  getPropConfig: R,
984
998
  getDragScopeElement: T,
985
999
  onAcceptMovedChildElement: M,
986
- onChildElementMovedOut: W,
987
- addNewChildComponentSchema: P,
988
- triggerBelongedComponentToMoveWhenMoved: v(!1),
989
- triggerBelongedComponentToDeleteWhenDeleted: v(!1),
1000
+ onChildElementMovedOut: L,
1001
+ addNewChildComponentSchema: W,
1002
+ triggerBelongedComponentToMoveWhenMoved: h(!1),
1003
+ triggerBelongedComponentToDeleteWhenDeleted: h(!1),
990
1004
  onRemoveComponent: B
991
1005
  }, t;
992
1006
  }
993
- const Lt = /* @__PURE__ */ Se({
1007
+ const Wt = /* @__PURE__ */ Se({
994
1008
  name: "FImageCropperDesign",
995
1009
  props: he,
996
1010
  emits: ["imageCropped", "imageLoaded", "cropperReady", "loadImageFailed"],
997
1011
  setup(e, i) {
998
- const r = v(e.alignImage), p = v(e.roundCropper), o = v(e.hideResizeSquares), t = v(e.loadImageErrorText), h = v(e.disabled), g = v(null), {
1012
+ const n = h(e.alignImage), d = h(e.roundCropper), o = h(e.hideResizeSquares), t = h(e.loadImageErrorText), c = h(e.disabled), g = h(null), {
999
1013
  uploadError: w,
1000
1014
  imageVisible: s,
1001
1015
  backgroundColor: y,
1002
- sourceImage: m,
1016
+ sourceImage: p,
1003
1017
  safeImgDataUrl: l,
1004
- safeTransformStyle: u,
1018
+ safeTransformStyle: r,
1005
1019
  maxSize: T,
1006
1020
  cropper: M,
1007
- marginLeft: P,
1008
- moveTypes: W,
1021
+ marginLeft: W,
1022
+ moveTypes: L,
1009
1023
  isLoading: R,
1010
1024
  startMove: B,
1011
1025
  imageLoadedInView: j,
1012
- moveStop: d,
1026
+ moveStop: m,
1013
1027
  moveImg: A
1014
- } = De(e, i), c = v(), b = Te("design-item-context"), V = Wt(c, b);
1028
+ } = Be(e, i), f = h(), b = Te("design-item-context"), V = Pt(f, b);
1015
1029
  Ae(() => {
1016
- c.value.componentInstance = V;
1030
+ f.value.componentInstance = V;
1017
1031
  }), i.expose(V.value);
1018
1032
  function Q(C) {
1019
1033
  return S("span", {
1020
1034
  class: `farris-image-cropper-resize-bar ${C}`,
1021
- onMousedown: O((q) => B(q, W.Resize, C), ["prevent"])
1035
+ onMousedown: I((q) => B(q, L.Resize, C), ["prevent"])
1022
1036
  }, null);
1023
1037
  }
1024
1038
  function D(C) {
1025
1039
  return S("div", null, [S("span", {
1026
1040
  class: `farris-image-cropper-resize-bar ${C}`,
1027
- onMousedown: O((q) => B(q, W.Resize, C), ["prevent"])
1041
+ onMousedown: I((q) => B(q, L.Resize, C), ["prevent"])
1028
1042
  }, [S("span", {
1029
1043
  class: "farris-image-cropper-square"
1030
1044
  }, null)]), S("span", {
@@ -1033,19 +1047,19 @@ const Lt = /* @__PURE__ */ Se({
1033
1047
  class: "farris-image-cropper-square"
1034
1048
  }, null)])]);
1035
1049
  }
1036
- const E = ["top", "right", "bottom", "left"].map((C) => Q(C)), $ = ["topleft", "topright", "bottomright", "bottomleft"].map((C) => D(C));
1050
+ const E = ["top", "right", "bottom", "left"].map((C) => Q(C)), H = ["topleft", "topright", "bottomright", "bottomleft"].map((C) => D(C));
1037
1051
  return () => S("div", {
1038
- ref: c,
1052
+ ref: f,
1039
1053
  class: ["farris-image-cropper-frame", {
1040
- "farris-image-cropper-disabled": h.value
1054
+ "farris-image-cropper-disabled": c.value
1041
1055
  }],
1042
1056
  style: {
1043
- "text-align": r.value
1057
+ "text-align": n.value
1044
1058
  },
1045
- onMousemove: O((C) => A(C), ["prevent"]),
1046
- onTouchmove: O((C) => A(C), ["prevent"]),
1047
- onMouseup: O(() => d(), ["prevent"]),
1048
- onTouchend: O(() => d(), ["prevent"])
1059
+ onMousemove: I((C) => A(C), ["prevent"]),
1060
+ onTouchmove: I((C) => A(C), ["prevent"]),
1061
+ onMouseup: I(() => m(), ["prevent"]),
1062
+ onTouchend: I(() => m(), ["prevent"])
1049
1063
  }, [!w && S("div", {
1050
1064
  ref: g,
1051
1065
  class: "farris-image-cropper",
@@ -1054,12 +1068,12 @@ const Lt = /* @__PURE__ */ Se({
1054
1068
  }]
1055
1069
  }, [l.value && S("img", {
1056
1070
  title: "farris-source-image",
1057
- ref: m,
1071
+ ref: p,
1058
1072
  class: "farris-source-image",
1059
1073
  style: [{
1060
1074
  visibility: s.value ? "visible" : "hidden"
1061
1075
  }, {
1062
- transform: u.value
1076
+ transform: r.value
1063
1077
  }],
1064
1078
  src: l.value,
1065
1079
  onLoad: () => j()
@@ -1070,11 +1084,11 @@ const Lt = /* @__PURE__ */ Se({
1070
1084
  }, {
1071
1085
  height: `${T.value.height || 0}px`
1072
1086
  }, {
1073
- "margin-left": r.value === "center" ? P.value : ""
1087
+ "margin-left": n.value === "center" ? W.value : ""
1074
1088
  }]
1075
1089
  }, null), s.value && S("div", {
1076
1090
  class: ["farris-image-cropper-wrapper", {
1077
- "farris-image-cropper-rounded": p.value
1091
+ "farris-image-cropper-rounded": d.value
1078
1092
  }],
1079
1093
  style: [{
1080
1094
  top: `${M.value.y1}px`
@@ -1087,13 +1101,13 @@ const Lt = /* @__PURE__ */ Se({
1087
1101
  }, {
1088
1102
  visibility: s.value ? "visible" : "hidden"
1089
1103
  }, {
1090
- "margin-left": r.value === "center" ? P.value : ""
1104
+ "margin-left": n.value === "center" ? W.value : ""
1091
1105
  }],
1092
1106
  tabindex: "0"
1093
1107
  }, [S("div", {
1094
1108
  class: "farris-image-cropper-move",
1095
- onMousedown: O((C) => B(C, W.Move, "topleft"), ["prevent"])
1096
- }, null), !o.value && S("div", null, [$, E])])]), R.value && S("div", {
1109
+ onMousedown: I((C) => B(C, L.Move, "topleft"), ["prevent"])
1110
+ }, null), !o.value && S("div", null, [H, E])])]), R.value && S("div", {
1097
1111
  class: "farris-image-cropper-loading"
1098
1112
  }, [S("div", {
1099
1113
  class: "farris-image-cropper-loading-spinner"
@@ -1101,20 +1115,20 @@ const Lt = /* @__PURE__ */ Se({
1101
1115
  class: "farris-image-cropper-error"
1102
1116
  }, [t.value])]);
1103
1117
  }
1104
- }), Ht = {
1118
+ }), $t = {
1105
1119
  install(e) {
1106
1120
  e.component(fe.name, fe);
1107
1121
  },
1108
- register(e, i, r, p) {
1122
+ register(e, i, n, d) {
1109
1123
  e["image-cropper"] = fe, i["image-cropper"] = we;
1110
1124
  },
1111
- registerDesigner(e, i, r) {
1112
- e["image-cropper"] = Lt, i["image-cropper"] = we;
1125
+ registerDesigner(e, i, n) {
1126
+ e["image-cropper"] = Wt, i["image-cropper"] = we;
1113
1127
  }
1114
1128
  };
1115
1129
  export {
1116
1130
  fe as ImageCropper,
1117
- Ht as default,
1131
+ $t as default,
1118
1132
  he as imageCropperProps,
1119
1133
  we as propsResolver
1120
1134
  };