@farris/ui-vue 1.3.1 → 1.3.3

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