@farris/ui-vue 1.2.7 → 1.2.9

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