@farris/ui-vue 1.2.8 → 1.3.0

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 (283) hide show
  1. package/components/accordion/index.esm.js +180 -180
  2. package/components/accordion/index.umd.cjs +1 -0
  3. package/components/avatar/index.esm.js +419 -331
  4. package/components/avatar/index.umd.cjs +1 -0
  5. package/components/border-editor/index.umd.cjs +1 -0
  6. package/components/button/index.umd.cjs +1 -0
  7. package/components/button-edit/index.css +1 -1
  8. package/components/button-edit/index.esm.js +346 -326
  9. package/components/button-edit/index.umd.cjs +1 -0
  10. package/components/button-group/index.umd.cjs +1 -0
  11. package/components/calculator/index.umd.cjs +1 -0
  12. package/components/calendar/index.esm.js +384 -384
  13. package/components/calendar/index.umd.cjs +1 -0
  14. package/components/capsule/index.esm.js +205 -205
  15. package/components/capsule/index.umd.cjs +1 -0
  16. package/components/checkbox/index.esm.js +555 -467
  17. package/components/checkbox/index.umd.cjs +1 -0
  18. package/components/color-picker/index.esm.js +239 -239
  19. package/components/color-picker/index.umd.cjs +3 -0
  20. package/components/combo-list/index.css +1 -0
  21. package/components/combo-list/index.esm.js +1072 -364
  22. package/components/combo-list/index.umd.cjs +1 -0
  23. package/components/combo-tree/index.esm.js +129 -129
  24. package/components/combo-tree/index.umd.cjs +1 -0
  25. package/components/common/index.esm.js +778 -700
  26. package/components/common/index.umd.cjs +1 -0
  27. package/components/component/index.esm.js +582 -327
  28. package/components/component/index.umd.cjs +1 -0
  29. package/components/condition/index.css +1 -0
  30. package/components/condition/index.esm.js +2433 -1134
  31. package/components/condition/index.umd.cjs +1 -0
  32. package/components/content-container/index.esm.js +307 -234
  33. package/components/content-container/index.umd.cjs +1 -0
  34. package/components/data-grid/index.css +1 -1
  35. package/components/data-grid/index.esm.js +6762 -4946
  36. package/components/data-grid/index.umd.cjs +1 -0
  37. package/components/data-view/index.css +1 -0
  38. package/components/data-view/index.esm.js +4977 -3489
  39. package/components/data-view/index.umd.cjs +1 -0
  40. package/components/date-picker/index.css +1 -1
  41. package/components/date-picker/index.esm.js +3525 -2811
  42. package/components/date-picker/index.umd.cjs +1 -0
  43. package/components/designer-canvas/index.css +1 -1
  44. package/components/designer-canvas/index.esm.js +938 -928
  45. package/components/designer-canvas/index.umd.cjs +1 -0
  46. package/components/designer-outline/index.css +1 -1
  47. package/components/designer-outline/index.esm.js +38 -37
  48. package/components/designer-outline/index.umd.cjs +1 -0
  49. package/components/designer-toolbox/index.esm.js +36 -12
  50. package/components/designer-toolbox/index.umd.cjs +1 -0
  51. package/components/discussion-editor/index.umd.cjs +3 -0
  52. package/components/discussion-list/index.umd.cjs +1 -0
  53. package/components/drawer/index.umd.cjs +1 -0
  54. package/components/dropdown/index.esm.js +282 -282
  55. package/components/dropdown/index.umd.cjs +2 -0
  56. package/components/dynamic-form/index.css +1 -0
  57. package/components/dynamic-form/index.esm.js +2684 -1039
  58. package/components/dynamic-form/index.umd.cjs +1 -0
  59. package/components/dynamic-resolver/index.esm.js +149 -101
  60. package/components/dynamic-resolver/index.umd.cjs +1 -0
  61. package/components/dynamic-view/index.esm.js +303 -290
  62. package/components/dynamic-view/index.umd.cjs +1 -0
  63. package/components/enum-editor/index.umd.cjs +1 -0
  64. package/components/events-editor/index.esm.js +573 -518
  65. package/components/events-editor/index.umd.cjs +1 -0
  66. package/components/expression-editor/index.esm.js +99 -99
  67. package/components/expression-editor/index.umd.cjs +1 -0
  68. package/components/external-container/index.css +1 -1
  69. package/components/external-container/index.esm.js +3607 -2799
  70. package/components/external-container/index.umd.cjs +1 -0
  71. package/components/field-selector/index.css +1 -1
  72. package/components/field-selector/index.esm.js +5438 -8236
  73. package/components/field-selector/index.umd.cjs +1 -0
  74. package/components/filter-bar/index.css +1 -1
  75. package/components/filter-bar/index.esm.js +1679 -1759
  76. package/components/filter-bar/index.umd.cjs +1 -0
  77. package/components/flow-canvas/index.css +1 -1
  78. package/components/flow-canvas/index.esm.js +1062 -1052
  79. package/components/flow-canvas/index.umd.cjs +1 -0
  80. package/components/image-cropper/index.esm.js +421 -421
  81. package/components/image-cropper/index.umd.cjs +1 -0
  82. package/components/input-group/index.esm.js +677 -593
  83. package/components/input-group/index.umd.cjs +1 -0
  84. package/components/layout/index.esm.js +326 -326
  85. package/components/layout/index.umd.cjs +1 -0
  86. package/components/list-nav/index.esm.js +272 -199
  87. package/components/list-nav/index.umd.cjs +1 -0
  88. package/components/list-view/index.css +1 -1
  89. package/components/list-view/index.esm.js +3739 -2273
  90. package/components/list-view/index.umd.cjs +1 -0
  91. package/components/loading/index.umd.cjs +8 -0
  92. package/components/locale/index.umd.cjs +1 -0
  93. package/components/lookup/index.css +1 -1
  94. package/components/lookup/index.esm.js +11255 -9004
  95. package/components/lookup/index.umd.cjs +1 -0
  96. package/components/mapping-editor/index.css +1 -1
  97. package/components/mapping-editor/index.esm.js +6046 -5314
  98. package/components/mapping-editor/index.umd.cjs +1 -0
  99. package/components/message-box/index.css +1 -1
  100. package/components/message-box/index.esm.js +511 -471
  101. package/components/message-box/index.umd.cjs +1 -0
  102. package/components/modal/index.css +1 -1
  103. package/components/modal/index.esm.js +438 -398
  104. package/components/modal/index.umd.cjs +1 -0
  105. package/components/nav/index.esm.js +588 -444
  106. package/components/nav/index.umd.cjs +3 -0
  107. package/components/notify/index.esm.js +59 -53
  108. package/components/notify/index.umd.cjs +1 -0
  109. package/components/number-range/index.esm.js +568 -485
  110. package/components/number-range/index.umd.cjs +1 -0
  111. package/components/number-spinner/index.esm.js +542 -454
  112. package/components/number-spinner/index.umd.cjs +1 -0
  113. package/components/order/index.css +1 -1
  114. package/components/order/index.esm.js +1967 -1105
  115. package/components/order/index.umd.cjs +1 -0
  116. package/components/page-footer/index.esm.js +160 -160
  117. package/components/page-footer/index.umd.cjs +1 -0
  118. package/components/page-header/index.esm.js +1282 -1151
  119. package/components/page-header/index.umd.cjs +1 -0
  120. package/components/pagination/index.esm.js +705 -555
  121. package/components/pagination/index.umd.cjs +1 -0
  122. package/components/popover/index.esm.js +71 -70
  123. package/components/popover/index.umd.cjs +1 -0
  124. package/components/progress/index.esm.js +270 -270
  125. package/components/progress/index.umd.cjs +3 -0
  126. package/components/property-editor/index.css +1 -1
  127. package/components/property-editor/index.esm.js +2231 -1517
  128. package/components/property-editor/index.umd.cjs +3 -0
  129. package/components/property-panel/index.esm.js +813 -909
  130. package/components/property-panel/index.umd.cjs +1 -0
  131. package/components/query-solution/index.css +1 -1
  132. package/components/query-solution/index.esm.js +3781 -2566
  133. package/components/query-solution/index.umd.cjs +1 -0
  134. package/components/radio-button/index.esm.js +101 -101
  135. package/components/radio-button/index.umd.cjs +1 -0
  136. package/components/radio-group/index.esm.js +538 -450
  137. package/components/radio-group/index.umd.cjs +1 -0
  138. package/components/rate/index.esm.js +238 -233
  139. package/components/rate/index.umd.cjs +1 -0
  140. package/components/response-layout/index.esm.js +155 -155
  141. package/components/response-layout/index.umd.cjs +1 -0
  142. package/components/response-layout-editor/index.css +1 -1
  143. package/components/response-layout-editor/index.esm.js +1243 -1180
  144. package/components/response-layout-editor/index.umd.cjs +1 -0
  145. package/components/response-toolbar/index.esm.js +988 -877
  146. package/components/response-toolbar/index.umd.cjs +1 -0
  147. package/components/schema-selector/index.css +1 -1
  148. package/components/schema-selector/index.esm.js +5413 -4867
  149. package/components/schema-selector/index.umd.cjs +8 -0
  150. package/components/search-box/index.esm.js +199 -199
  151. package/components/search-box/index.umd.cjs +1 -0
  152. package/components/section/index.esm.js +646 -503
  153. package/components/section/index.umd.cjs +1 -0
  154. package/components/smoke-detector/index.esm.js +144 -144
  155. package/components/smoke-detector/index.umd.cjs +1 -0
  156. package/components/spacing-editor/index.umd.cjs +1 -0
  157. package/components/splitter/index.esm.js +464 -391
  158. package/components/splitter/index.umd.cjs +1 -0
  159. package/components/step/index.esm.js +249 -249
  160. package/components/step/index.umd.cjs +1 -0
  161. package/components/switch/index.esm.js +483 -394
  162. package/components/switch/index.umd.cjs +1 -0
  163. package/components/tabs/index.css +1 -1
  164. package/components/tabs/index.esm.js +2366 -2208
  165. package/components/tabs/index.umd.cjs +1 -0
  166. package/components/tags/index.esm.js +397 -399
  167. package/components/tags/index.umd.cjs +1 -0
  168. package/components/text/index.esm.js +394 -394
  169. package/components/text/index.umd.cjs +1 -0
  170. package/components/textarea/index.esm.js +451 -367
  171. package/components/textarea/index.umd.cjs +1 -0
  172. package/components/time-picker/index.css +1 -1
  173. package/components/time-picker/index.esm.js +1252 -1144
  174. package/components/time-picker/index.umd.cjs +1 -0
  175. package/components/tooltip/index.umd.cjs +1 -0
  176. package/components/transfer/index.css +1 -1
  177. package/components/transfer/index.esm.js +510 -499
  178. package/components/transfer/index.umd.cjs +1 -0
  179. package/components/tree-grid/index.css +1 -1
  180. package/components/tree-grid/index.esm.js +5463 -9330
  181. package/components/tree-grid/index.umd.cjs +1 -0
  182. package/components/tree-view/index.css +1 -0
  183. package/components/tree-view/index.esm.js +4058 -2597
  184. package/components/tree-view/index.umd.cjs +1 -0
  185. package/components/uploader/index.esm.js +510 -504
  186. package/components/uploader/index.umd.cjs +2 -0
  187. package/components/verify-detail/index.esm.js +220 -220
  188. package/components/verify-detail/index.umd.cjs +1 -0
  189. package/components/video/index.esm.js +653 -394
  190. package/components/video/index.umd.cjs +1 -0
  191. package/components/weather/index.esm.js +1028 -1028
  192. package/components/weather/index.umd.cjs +16 -0
  193. package/farris.all.esm.js +20407 -18556
  194. package/farris.all.umd.cjs +8 -8
  195. package/index.css +1 -1
  196. package/package.json +1 -1
  197. package/types/button-edit/src/designer/button-group.design.component.d.ts +7 -0
  198. package/types/capsule/src/capsule.props.d.ts +2 -2
  199. package/types/combo-list/src/components/list-container.props.d.ts +1 -1
  200. package/types/common/entity/entity-schema.d.ts +258 -0
  201. package/types/common/index.d.ts +1 -0
  202. package/types/common/types.d.ts +1 -1
  203. package/types/common/utils/encrypt.d.ts +2 -0
  204. package/types/component/src/component-ref.props.d.ts +4 -0
  205. package/types/component/src/component.props.d.ts +7 -0
  206. package/types/component/src/composition/inner-component-build-info.d.ts +27 -0
  207. package/types/component/src/designer/use-designer-rules.d.ts +2 -2
  208. package/types/component/src/property-config/component.property-config.d.ts +9 -0
  209. package/types/components.d.ts +1 -0
  210. package/types/data-grid/index.d.ts +8 -2
  211. package/types/data-grid/src/composition/data-grid-component-creator.service.d.ts +33 -0
  212. package/types/data-grid/src/data-grid.component.d.ts +3 -1
  213. package/types/data-grid/src/data-grid.props.d.ts +3 -2
  214. package/types/data-grid/src/property-config/data-grid.property-config.d.ts +4 -0
  215. package/types/data-grid/src/schema/schema-resolver.d.ts +2 -1
  216. package/types/data-view/components/column-format/boolean.component.d.ts +4 -0
  217. package/types/data-view/components/column-format/column-format.component.d.ts +4 -0
  218. package/types/data-view/components/column-format/date.component.d.ts +4 -0
  219. package/types/data-view/components/column-format/enum.component.d.ts +4 -0
  220. package/types/data-view/components/column-format/number.component.d.ts +4 -0
  221. package/types/data-view/composition/pagination/use-pagination.d.ts +1 -0
  222. package/types/data-view/composition/types.d.ts +36 -7
  223. package/types/data-view/composition/use-edit.d.ts +2 -1
  224. package/types/data-view/composition/visualization/use-virtual-scroll.d.ts +0 -15
  225. package/types/designer-canvas/src/composition/dg-control.d.ts +5 -0
  226. package/types/designer-canvas/src/composition/function/use-dragula.d.ts +2 -2
  227. package/types/designer-canvas/src/composition/types.d.ts +1 -1
  228. package/types/designer-canvas/src/types.d.ts +2 -2
  229. package/types/dynamic-form/index.d.ts +2 -1
  230. package/types/dynamic-form/src/composition/response-form-component-creator.service.d.ts +31 -0
  231. package/types/dynamic-form/src/composition/use-response-form-layout-setting.d.ts +2 -0
  232. package/types/dynamic-form/src/designer/response-form-layout-setting.component.d.ts +8 -0
  233. package/types/dynamic-form/src/designer/response-form-layout-setting.props.d.ts +4 -0
  234. package/types/dynamic-form/src/designer/use-designer-rules.d.ts +2 -2
  235. package/types/dynamic-form/src/property-config/form.property-config.d.ts +9 -0
  236. package/types/dynamic-form/src/schema/schema-mapper.d.ts +1 -0
  237. package/types/dynamic-form/src/schema/schema-resolver.d.ts +3 -1
  238. package/types/dynamic-form/src/types.d.ts +12 -1
  239. package/types/dynamic-resolver/index.d.ts +1 -0
  240. package/types/dynamic-resolver/src/event-handler-resolver.d.ts +4 -0
  241. package/types/dynamic-resolver/src/schema-resolver.d.ts +2 -1
  242. package/types/dynamic-resolver/src/types.d.ts +12 -2
  243. package/types/dynamic-view/index.d.ts +1 -0
  244. package/types/dynamic-view/src/event-dispatcher.d.ts +1 -1
  245. package/types/index.d.ts +2 -0
  246. package/types/lookup/src/components/favorite/lookup-favorite.component.d.ts +29 -0
  247. package/types/lookup/src/components/favorite/lookup-favorite.props.d.ts +15 -0
  248. package/types/lookup/src/components/modal-container.component.d.ts +25 -0
  249. package/types/lookup/src/components/modal-container.props.d.ts +29 -0
  250. package/types/lookup/src/composition/types.d.ts +8 -0
  251. package/types/lookup/src/composition/use-check-props.d.ts +9 -2
  252. package/types/lookup/src/composition/use-dialog.d.ts +5 -1
  253. package/types/lookup/src/composition/use-favorite.d.ts +12 -0
  254. package/types/lookup/src/composition/use-http.d.ts +9 -5
  255. package/types/lookup/src/composition/use-input-change.d.ts +3 -0
  256. package/types/lookup/src/composition/use-user-data.d.ts +24 -0
  257. package/types/lookup/src/property-config/lookup.property-config.d.ts +6 -4
  258. package/types/mapping-editor/src/mapping-editor.component.d.ts +3 -0
  259. package/types/mapping-editor/src/mapping-editor.props.d.ts +0 -1
  260. package/types/modal/src/composition/use-draggable.d.ts +2 -1
  261. package/types/modal/src/composition/use-shortcut.d.ts +6 -0
  262. package/types/modal/src/modal.component.d.ts +3 -0
  263. package/types/modal/src/modal.props.d.ts +4 -0
  264. package/types/page-header/src/page-header.props.d.ts +1 -0
  265. package/types/property-panel/src/composition/entity/base-property.d.ts +8 -0
  266. package/types/property-panel/src/composition/entity/input-base-property.d.ts +20 -1
  267. package/types/response-layout-editor/src/composition/converter/use-response-layout-editor-setting.d.ts +2 -0
  268. package/types/response-layout-editor/src/type.d.ts +21 -0
  269. package/types/response-toolbar/src/response-toolbar.props.d.ts +2 -2
  270. package/types/response-toolbar/src/schema/schema-mapper.d.ts +4 -0
  271. package/types/section/src/property-config/section.property-config.d.ts +93 -0
  272. package/types/section/src/schema/schema-resolver.d.ts +2 -1
  273. package/types/tabs/src/composition/types.d.ts +2 -2
  274. package/types/tabs/src/designer/tab-header-item.design.component.d.ts +3 -1
  275. package/types/tabs/src/property-config/tab-page.property-config.d.ts +60 -0
  276. package/types/tabs/src/schema/schema-resolver.d.ts +2 -1
  277. package/types/tabs/src/tabs.props.d.ts +1 -0
  278. package/types/tags/index.d.ts +36 -5
  279. package/types/tree-grid/index.d.ts +8 -2
  280. package/types/tree-grid/src/tree-grid.component.d.ts +3 -1
  281. package/types/modal/src/composition/use-esc.d.ts +0 -1
  282. package/types/response-layout-editor/src/composition/converter/response-layout-editor.converter.d.ts +0 -3
  283. package/types/response-layout-editor/src/composition/converter/use-convert-property-value.d.ts +0 -20
@@ -1,101 +1,102 @@
1
1
  var _ = Object.defineProperty;
2
- var H = (r, e, t) => e in r ? _(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var b = (r, e, t) => H(r, typeof e != "symbol" ? e + "" : e, t);
4
- import { defineComponent as G, toRefs as L, ref as C, computed as S, watch as W, createVNode as w, inject as q, onMounted as x } from "vue";
5
- import { cloneDeep as I } from "lodash-es";
6
- import { getSchemaByType as z } from "../dynamic-resolver/index.esm.js";
7
- const J = {}, Q = {};
8
- function N(r) {
9
- const { properties: e, title: t } = r, n = Object.keys(e).reduce((o, s) => (o[s] = e[s].type === "object" && e[s].properties ? N(e[s]) : I(e[s].default), o), {});
10
- return n.id = `${t}-${Date.now()}`, n;
2
+ var H = (a, t, e) => t in a ? _(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
+ var g = (a, t, e) => H(a, typeof t != "symbol" ? t + "" : t, e);
4
+ import { defineComponent as W, toRefs as z, ref as w, computed as E, watch as j, createVNode as k, inject as q, onMounted as R } from "vue";
5
+ import { isPlainObject as I, cloneDeep as x } from "lodash-es";
6
+ import { getSchemaByType as G } from "../dynamic-resolver/index.esm.js";
7
+ import { useResponseLayoutEditorSetting as K } from "../response-layout-editor/index.esm.js/src/composition/converter/use-response-layout-editor-setting";
8
+ const J = {}, X = {};
9
+ function U(a) {
10
+ const { properties: t, title: e, ignore: o } = a, n = o && Array.isArray(o), i = Object.keys(t).reduce((c, d) => ((!n || !o.find((u) => u == d)) && (c[d] = t[d].type === "object" && t[d].properties ? U(t[d]) : x(t[d].default)), c), {});
11
+ return (!n || !o.find((c) => c == "id")) && (i.id = `${e}-${Date.now()}`), i;
11
12
  }
12
- function A(r, e = {}) {
13
- const t = J[r];
14
- if (t) {
15
- let n = N(t);
16
- const o = Q[r];
17
- return n = o ? o({ getSchemaByType: A }, n, e) : n, n;
13
+ function L(a, t = {}, e) {
14
+ const o = J[a];
15
+ if (o) {
16
+ let n = U(o);
17
+ const i = X[a];
18
+ return n = i ? i({ getSchemaByType: L }, n, t, e) : n, n;
18
19
  }
19
20
  return null;
20
21
  }
21
- function K(r, e) {
22
- const t = N(e);
23
- return Object.keys(r).reduce((n, o) => (n[o] && typeof n[o] == "object" ? Object.assign(n[o], r[o]) : n[o] = r[o], n), t), t;
22
+ function ee(a, t) {
23
+ const e = U(t);
24
+ return Object.keys(a).reduce((o, n) => (o[n] && I(o[n]) && I(a[n]) ? Object.assign(o[n], a[n]) : o[n] = a[n], o), e), e;
24
25
  }
25
- function R(r, e) {
26
- return Object.keys(r).filter((n) => r[n] != null).reduce((n, o) => {
27
- if (e.has(o)) {
28
- const s = e.get(o);
29
- if (typeof s == "string")
30
- n[s] = r[o];
26
+ function te(a, t) {
27
+ return Object.keys(a).filter((o) => a[o] != null).reduce((o, n) => {
28
+ if (t.has(n)) {
29
+ const i = t.get(n);
30
+ if (typeof i == "string")
31
+ o[i] = a[n];
31
32
  else {
32
- const m = s(o, r[o], r);
33
- Object.assign(n, m);
33
+ const c = i(n, a[n], a);
34
+ Object.assign(o, c);
34
35
  }
35
36
  } else
36
- n[o] = r[o];
37
- return n;
37
+ o[n] = a[n];
38
+ return o;
38
39
  }, {});
39
40
  }
40
- function ee(r, e, t = /* @__PURE__ */ new Map()) {
41
- const n = K(r, e);
42
- return R(n, t);
41
+ function ne(a, t, e = /* @__PURE__ */ new Map()) {
42
+ const o = ee(a, t);
43
+ return te(o, e);
43
44
  }
44
- function te(r = {}) {
45
- function e(i, l, c, u) {
46
- if (typeof c == "number")
47
- return u[i].length === c;
48
- if (typeof c == "object") {
49
- const f = Object.keys(c)[0], g = c[f];
50
- if (f === "not")
51
- return Number(u[i].length) !== Number(g);
52
- if (f === "moreThan")
53
- return Number(u[i].length) >= Number(g);
54
- if (f === "lessThan")
55
- return Number(u[i].length) <= Number(g);
45
+ function oe(a = {}) {
46
+ function t(r, s, l, m) {
47
+ if (typeof l == "number")
48
+ return m[r].length === l;
49
+ if (typeof l == "object") {
50
+ const h = Object.keys(l)[0], f = l[h];
51
+ if (h === "not")
52
+ return Number(m[r].length) !== Number(f);
53
+ if (h === "moreThan")
54
+ return Number(m[r].length) >= Number(f);
55
+ if (h === "lessThan")
56
+ return Number(m[r].length) <= Number(f);
56
57
  }
57
58
  return !1;
58
59
  }
59
- function t(i, l, c, u) {
60
- return u[i] && u[i].propertyValue && String(u[i].propertyValue.value) === String(c);
60
+ function e(r, s, l, m) {
61
+ return m[r] && m[r].propertyValue && String(m[r].propertyValue.value) === String(l);
61
62
  }
62
- const n = /* @__PURE__ */ new Map([
63
- ["length", e],
64
- ["getProperty", t]
63
+ const o = /* @__PURE__ */ new Map([
64
+ ["length", t],
65
+ ["getProperty", e]
65
66
  ]);
66
- Object.keys(r).reduce((i, l) => (i.set(l, r[l]), i), n);
67
- function o(i, l) {
68
- const c = i;
69
- return typeof l == "number" ? [{ target: c, operator: "length", param: null, value: Number(l) }] : typeof l == "boolean" ? [{ target: c, operator: "getProperty", param: i, value: !!l }] : typeof l == "object" ? Object.keys(l).map((u) => {
70
- if (u === "length")
71
- return { target: c, operator: "length", param: null, value: l[u] };
72
- const f = u, g = l[u];
73
- return { target: c, operator: "getProperty", param: f, value: g };
67
+ Object.keys(a).reduce((r, s) => (r.set(s, a[s]), r), o);
68
+ function n(r, s) {
69
+ const l = r;
70
+ return typeof s == "number" ? [{ target: l, operator: "length", param: null, value: Number(s) }] : typeof s == "boolean" ? [{ target: l, operator: "getProperty", param: r, value: !!s }] : typeof s == "object" ? Object.keys(s).map((m) => {
71
+ if (m === "length")
72
+ return { target: l, operator: "length", param: null, value: s[m] };
73
+ const h = m, f = s[m];
74
+ return { target: l, operator: "getProperty", param: h, value: f };
74
75
  }) : [];
75
76
  }
76
- function s(i) {
77
- return Object.keys(i).reduce((c, u) => {
78
- const f = o(u, i[u]);
79
- return c.push(...f), c;
77
+ function i(r) {
78
+ return Object.keys(r).reduce((l, m) => {
79
+ const h = n(m, r[m]);
80
+ return l.push(...h), l;
80
81
  }, []);
81
82
  }
82
- function m(i, l) {
83
- if (n.has(i.operator)) {
84
- const c = n.get(i.operator);
85
- return c && c(i.target, i.param, i.value, l) || !1;
83
+ function c(r, s) {
84
+ if (o.has(r.operator)) {
85
+ const l = o.get(r.operator);
86
+ return l && l(r.target, r.param, r.value, s) || !1;
86
87
  }
87
88
  return !1;
88
89
  }
89
- function p(i, l) {
90
- return s(i).reduce((f, g) => f && m(g, l), !0);
90
+ function d(r, s) {
91
+ return i(r).reduce((h, f) => h && c(f, s), !0);
91
92
  }
92
- function d(i, l) {
93
- const c = Object.keys(i), u = c.includes("allOf"), f = c.includes("anyOf"), g = u || f, M = (g ? i[g ? u ? "allOf" : "anyOf" : "allOf"] : [i]).map((E) => p(E, l));
94
- return u ? !M.includes(!1) : M.includes(!0);
93
+ function u(r, s) {
94
+ const l = Object.keys(r), m = l.includes("allOf"), h = l.includes("anyOf"), f = m || h, S = (f ? r[f ? m ? "allOf" : "anyOf" : "allOf"] : [r]).map((D) => d(D, s));
95
+ return m ? !S.includes(!1) : S.includes(!0);
95
96
  }
96
- return { parseValueSchema: d };
97
+ return { parseValueSchema: u };
97
98
  }
98
- const a = {
99
+ const p = {
99
100
  button: { type: "button", name: "按钮", icon: "Button" },
100
101
  "response-toolbar": { type: "response-toolbar", name: "工具栏", icon: "ButtonGroup" },
101
102
  "response-toolbar-item": { type: "response-toolbar-item", name: "按钮", icon: "Button" },
@@ -132,21 +133,22 @@ const a = {
132
133
  uploader: { type: "uploader", name: "附件上传", icon: "FileUpload" },
133
134
  "page-header": { type: "page-header", name: "页头", icon: "Header" },
134
135
  "page-footer": { type: "page-footer", name: "页脚", icon: "ModalFooter" },
135
- "tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" }
136
- }, ne = {}, oe = {};
137
- te();
138
- function re(r, e, t = /* @__PURE__ */ new Map(), n = (m, p, d) => p, o = {}, s = (m) => m) {
139
- return J[e.title] = e, Q[e.title] = n, ne[e.title] = o, oe[e.title] = s, (m = {}) => {
140
- const p = ee(m, e, t), d = Object.keys(r).reduce((i, l) => (i[l] = r[l].default, i), {});
141
- return Object.assign(d, p);
136
+ "tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" },
137
+ fieldset: { type: "fieldset", name: "分组", icon: "fieldset" }
138
+ }, re = {}, ie = {};
139
+ oe();
140
+ function ae(a, t, e = /* @__PURE__ */ new Map(), o = (c, d, u) => d, n = {}, i = (c) => c) {
141
+ return J[t.title] = t, X[t.title] = o, re[t.title] = n, ie[t.title] = i, (c = {}) => {
142
+ const d = ne(c, t, e), u = Object.keys(a).reduce((r, s) => (r[s] = a[s].default, r), {});
143
+ return Object.assign(u, d);
142
144
  };
143
145
  }
144
- function ie(r, e) {
145
- return { customClass: e.class, customStyle: e.style };
146
+ function se(a, t) {
147
+ return { customClass: t.class, customStyle: t.style };
146
148
  }
147
- const ae = /* @__PURE__ */ new Map([
148
- ["appearance", ie]
149
- ]), le = "https://json-schema.org/draft/2020-12/schema", se = "https://farris-design.gitee.io/switch.schema.json", ce = "switch", pe = "A Farris Component", ue = "object", de = {
149
+ const le = /* @__PURE__ */ new Map([
150
+ ["appearance", se]
151
+ ]), ce = "https://json-schema.org/draft/2020-12/schema", pe = "https://farris-design.gitee.io/switch.schema.json", ue = "switch", de = "A Farris Component", me = "object", fe = {
150
152
  id: {
151
153
  description: "The unique identifier for a switch",
152
154
  type: "string"
@@ -216,24 +218,29 @@ const ae = /* @__PURE__ */ new Map([
216
218
  size: {
217
219
  description: "",
218
220
  type: "enum",
219
- default: "medium"
221
+ default: "middle"
220
222
  }
221
- }, me = [
223
+ }, ye = [
222
224
  "id",
223
225
  "type"
224
- ], ye = {
225
- $schema: le,
226
- $id: se,
227
- title: ce,
228
- description: pe,
229
- type: ue,
230
- properties: de,
231
- required: me
226
+ ], he = [
227
+ "id",
228
+ "appearance",
229
+ "binding"
230
+ ], ge = {
231
+ $schema: ce,
232
+ $id: pe,
233
+ title: ue,
234
+ description: de,
235
+ type: me,
236
+ properties: fe,
237
+ required: ye,
238
+ ignore: he
232
239
  };
233
- function fe(r, e, t) {
234
- return e;
240
+ function ve(a, t, e) {
241
+ return t;
235
242
  }
236
- const $ = {
243
+ const N = {
237
244
  /** 组件值*/
238
245
  modelValue: { type: Boolean, default: !1 },
239
246
  /** 禁用 */
@@ -249,189 +256,189 @@ const $ = {
249
256
  /** 开关值变化事件 */
250
257
  onModelValueChanged: { type: Function, default: () => {
251
258
  } }
252
- }, X = re($, ye, ae, fe), D = /* @__PURE__ */ G({
259
+ }, Q = ae(N, ge, le, ve), V = /* @__PURE__ */ W({
253
260
  name: "FSwitch",
254
- props: $,
261
+ props: N,
255
262
  emits: ["update:modelValue", "modelValueChanged"],
256
- setup(r, e) {
263
+ setup(a, t) {
257
264
  const {
258
- disabled: t,
259
- size: n,
260
- onLabel: o,
261
- offLabel: s,
262
- onBackground: m,
263
- offBackground: p,
264
- onColor: d,
265
- offColor: i
266
- } = L(r), l = C(r.modelValue), c = S(() => ({
265
+ disabled: e,
266
+ size: o,
267
+ onLabel: n,
268
+ offLabel: i,
269
+ onBackground: c,
270
+ offBackground: d,
271
+ onColor: u,
272
+ offColor: r
273
+ } = z(a), s = w(a.modelValue), l = E(() => ({
267
274
  switch: !0,
268
275
  "f-cmp-switch": !0,
269
- checked: l.value,
270
- disabled: t.value,
271
- "switch-large": n.value === "large",
272
- "switch-medium": n.value === "medium",
273
- "switch-small": n.value === "small"
274
- })), u = S(() => l.value ? {
276
+ checked: s.value,
277
+ disabled: e.value,
278
+ "switch-large": o.value === "large",
279
+ "switch-medium": o.value === "medium",
280
+ "switch-small": o.value === "small"
281
+ })), m = E(() => s.value ? {
275
282
  outline: "none",
276
- background: m.value
283
+ background: c.value
277
284
  } : {
278
285
  outline: "none",
279
- backgroundColor: p.value
280
- }), f = S(() => l.value ? {
281
- background: d.value
286
+ backgroundColor: d.value
287
+ }), h = E(() => s.value ? {
288
+ background: u.value
282
289
  } : {
283
- backgroundColor: i.value
284
- }), g = S(() => (o == null ? void 0 : o.value) || (s == null ? void 0 : s.value));
285
- function V() {
286
- t.value || (l.value = !l.value, e.emit("update:modelValue", l.value));
290
+ backgroundColor: r.value
291
+ }), f = E(() => (n == null ? void 0 : n.value) || (i == null ? void 0 : i.value));
292
+ function T() {
293
+ e.value || (s.value = !s.value, t.emit("update:modelValue", s.value));
287
294
  }
288
- return W(l, (k, M) => {
289
- k !== M && e.emit("modelValueChanged", k);
290
- }), W(() => r.modelValue, (k, M) => {
291
- k !== M && (l.value = k);
292
- }), () => w("span", {
295
+ return j(s, (M, S) => {
296
+ M !== S && t.emit("modelValueChanged", M);
297
+ }), j(() => a.modelValue, (M, S) => {
298
+ M !== S && (s.value = M);
299
+ }), () => k("span", {
293
300
  tabindex: "0",
294
301
  role: "button",
295
- class: c.value,
296
- style: u.value,
297
- onClick: V
298
- }, [g.value && w("span", {
302
+ class: l.value,
303
+ style: m.value,
304
+ onClick: T
305
+ }, [f.value && k("span", {
299
306
  class: "switch-pane"
300
- }, [w("span", {
307
+ }, [k("span", {
301
308
  class: "switch-label-checked"
302
- }, [o == null ? void 0 : o.value]), w("span", {
309
+ }, [n == null ? void 0 : n.value]), k("span", {
303
310
  class: "switch-label-unchecked"
304
- }, [s == null ? void 0 : s.value])]), w("small", {
305
- style: f.value
306
- }, [e.slots.default && e.slots.default()])]);
311
+ }, [i == null ? void 0 : i.value])]), k("small", {
312
+ style: h.value
313
+ }, [t.slots.default && t.slots.default()])]);
307
314
  }
308
315
  });
309
- function he(r, e, t) {
316
+ function Ce(a, t, e) {
310
317
  var O;
311
- function n() {
312
- t != null && t.resolveComponentContext && t.resolveComponentContext();
313
- }
314
- n();
315
- const o = t && t.getStyles && t.getStyles() || "", s = t && t.getDesignerClass && t.getDesignerClass() || "", m = C();
316
- function p() {
317
- return (e == null ? void 0 : e.schema.componentType) === "frame" ? !1 : t && t.checkCanMoveComponent ? t.checkCanMoveComponent() : !0;
318
+ function o() {
319
+ e != null && e.resolveComponentContext && e.resolveComponentContext();
318
320
  }
321
+ o();
322
+ const n = e && e.getStyles && e.getStyles() || "", i = e && e.getDesignerClass && e.getDesignerClass() || "", c = w();
319
323
  function d() {
324
+ return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : e && e.checkCanMoveComponent ? e.checkCanMoveComponent() : !0;
325
+ }
326
+ function u() {
320
327
  return !1;
321
328
  }
322
- function i() {
323
- return (e == null ? void 0 : e.schema.componentType) === "frame" ? !1 : t && t.checkCanDeleteComponent ? t.checkCanDeleteComponent() : !0;
329
+ function r() {
330
+ return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : e && e.checkCanDeleteComponent ? e.checkCanDeleteComponent() : !0;
324
331
  }
325
- function l() {
326
- return (e == null ? void 0 : e.schema.componentType) === "frame" ? !0 : t && t.hideNestedPaddingInDesginerView ? t.hideNestedPaddingInDesginerView() : !1;
332
+ function s() {
333
+ return (t == null ? void 0 : t.schema.componentType) === "frame" ? !0 : e && e.hideNestedPaddingInDesginerView ? e.hideNestedPaddingInDesginerView() : !1;
327
334
  }
328
- function c(y) {
335
+ function l(y) {
329
336
  if (!y || !y.value)
330
337
  return null;
331
338
  if (y.value.schema && y.value.schema.type === "component")
332
339
  return y.value;
333
- const v = C(y == null ? void 0 : y.value.parent), h = c(v);
334
- return h || null;
340
+ const v = w(y == null ? void 0 : y.value.parent), C = l(v);
341
+ return C || null;
335
342
  }
336
- function u(y = e) {
337
- const { componentInstance: v, designerItemElementRef: h } = y;
338
- return !v || !v.value ? null : v.value.canMove ? h : u(y.parent);
343
+ function m(y = t) {
344
+ const { componentInstance: v, designerItemElementRef: C } = y;
345
+ return !v || !v.value ? null : v.value.canMove ? C : m(y.parent);
339
346
  }
340
- function f(y) {
341
- return !!t && t.canAccepts(y);
347
+ function h(y) {
348
+ return !!e && e.canAccepts(y);
342
349
  }
343
- function g() {
344
- return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
350
+ function f() {
351
+ return (t == null ? void 0 : t.schema.label) || (t == null ? void 0 : t.schema.title) || (t == null ? void 0 : t.schema.name);
345
352
  }
346
- function V() {
353
+ function T() {
347
354
  }
348
- function k(y, v) {
349
- v && t != null && t.onAcceptMovedChildElement && t.onAcceptMovedChildElement(v);
355
+ function M(y, v) {
356
+ v && e != null && e.onAcceptMovedChildElement && e.onAcceptMovedChildElement(v);
350
357
  }
351
- function M(y) {
352
- const { componentType: v } = y;
353
- let h = A(v, y);
354
- t && t.onResolveNewComponentSchema && (h = t.onResolveNewComponentSchema(y, h));
355
- const P = v.toLowerCase().replace("-", "_");
356
- return h && !h.id && h.type === v && (h.id = `${P}_${Math.random().toString().slice(2, 6)}`), h;
358
+ function S(y, v) {
359
+ const { componentType: C } = y;
360
+ let b = L(C, y, v);
361
+ e && e.onResolveNewComponentSchema && (b = e.onResolveNewComponentSchema(y, b));
362
+ const F = C.toLowerCase().replace("-", "_");
363
+ return b && !b.id && b.type === C && (b.id = `${F}_${Math.random().toString().slice(2, 6)}`), b;
357
364
  }
358
- function j(y, v) {
359
- const h = String(y.getAttribute("data-controltype")), P = y.getAttribute("data-feature"), U = P ? JSON.parse(P) : {};
360
- U.parentComponentInstance = m.value;
361
- let T = A(h, U);
362
- t && t.onAcceptNewChildElement && (T = t.onAcceptNewChildElement(y, v, T));
363
- const Z = h.toLowerCase().replace("-", "_");
364
- return T && !T.id && T.type === h && (T.id = `${Z}_${Math.random().toString().slice(2, 6)}`), T;
365
+ function $(y, v) {
366
+ const C = String(y.getAttribute("data-controltype")), b = y.getAttribute("data-feature"), F = b ? JSON.parse(b) : {};
367
+ F.parentComponentInstance = c.value;
368
+ let B = L(C, F);
369
+ e && e.onAcceptNewChildElement && (B = e.onAcceptNewChildElement(y, v, B));
370
+ const Z = C.toLowerCase().replace("-", "_");
371
+ return B && !B.id && B.type === C && (B.id = `${Z}_${Math.random().toString().slice(2, 6)}`), B;
365
372
  }
366
- function E(y) {
373
+ function D(y) {
367
374
  }
368
375
  function Y(...y) {
369
- if (t && t.getPropsConfig)
370
- return t.getPropsConfig(...y);
371
- }
372
- return m.value = {
373
- canMove: p(),
374
- canSelectParent: d(),
375
- canDelete: i(),
376
- canNested: !l(),
377
- contents: e == null ? void 0 : e.schema.contents,
378
- elementRef: r,
379
- parent: (O = e == null ? void 0 : e.parent) == null ? void 0 : O.componentInstance,
380
- schema: e == null ? void 0 : e.schema,
381
- styles: o,
382
- designerClass: s,
383
- canAccepts: f,
384
- getBelongedComponentInstance: c,
385
- getDraggableDesignItemElement: u,
386
- getDraggingDisplayText: g,
376
+ if (e && e.getPropsConfig)
377
+ return e.getPropsConfig(...y);
378
+ }
379
+ return c.value = {
380
+ canMove: d(),
381
+ canSelectParent: u(),
382
+ canDelete: r(),
383
+ canNested: !s(),
384
+ contents: t == null ? void 0 : t.schema.contents,
385
+ elementRef: a,
386
+ parent: (O = t == null ? void 0 : t.parent) == null ? void 0 : O.componentInstance,
387
+ schema: t == null ? void 0 : t.schema,
388
+ styles: n,
389
+ designerClass: i,
390
+ canAccepts: h,
391
+ getBelongedComponentInstance: l,
392
+ getDraggableDesignItemElement: m,
393
+ getDraggingDisplayText: f,
387
394
  getPropConfig: Y,
388
- getDragScopeElement: V,
389
- onAcceptMovedChildElement: k,
390
- onAcceptNewChildElement: j,
391
- onChildElementMovedOut: E,
392
- addNewChildComponentSchema: M,
393
- updateDragAndDropRules: n,
394
- triggerBelongedComponentToMoveWhenMoved: !!t && t.triggerBelongedComponentToMoveWhenMoved || C(!1),
395
- triggerBelongedComponentToDeleteWhenDeleted: !!t && t.triggerBelongedComponentToDeleteWhenDeleted || C(!1)
396
- }, m;
395
+ getDragScopeElement: T,
396
+ onAcceptMovedChildElement: M,
397
+ onAcceptNewChildElement: $,
398
+ onChildElementMovedOut: D,
399
+ addNewChildComponentSchema: S,
400
+ updateDragAndDropRules: o,
401
+ triggerBelongedComponentToMoveWhenMoved: !!e && e.triggerBelongedComponentToMoveWhenMoved || w(!1),
402
+ triggerBelongedComponentToDeleteWhenDeleted: !!e && e.triggerBelongedComponentToDeleteWhenDeleted || w(!1)
403
+ }, c;
397
404
  }
398
- class ge {
399
- constructor(e, t) {
400
- b(this, "componentId");
401
- b(this, "viewModelId");
402
- b(this, "eventsEditorUtils");
403
- b(this, "formSchemaUtils");
404
- b(this, "formMetadataConverter");
405
- b(this, "designViewModelUtils");
406
- b(this, "designViewModelField");
407
- b(this, "controlCreatorUtils");
408
- b(this, "designerHostService");
409
- b(this, "schemaService", null);
410
- b(this, "metadataService", null);
411
- b(this, "propertyConfig", {
405
+ class be {
406
+ constructor(t, e) {
407
+ g(this, "componentId");
408
+ g(this, "viewModelId");
409
+ g(this, "eventsEditorUtils");
410
+ g(this, "formSchemaUtils");
411
+ g(this, "formMetadataConverter");
412
+ g(this, "designViewModelUtils");
413
+ g(this, "designViewModelField");
414
+ g(this, "controlCreatorUtils");
415
+ g(this, "designerHostService");
416
+ g(this, "schemaService", null);
417
+ g(this, "metadataService", null);
418
+ g(this, "propertyConfig", {
412
419
  type: "object",
413
420
  categories: {}
414
421
  });
415
- var n;
416
- this.componentId = e, this.designerHostService = t, this.eventsEditorUtils = t.eventsEditorUtils, this.formSchemaUtils = t.formSchemaUtils, this.formMetadataConverter = t.formMetadataConverter, this.viewModelId = ((n = this.formSchemaUtils) == null ? void 0 : n.getViewModelIdByComponentId(e)) || "", this.designViewModelUtils = t.designViewModelUtils, this.controlCreatorUtils = t.controlCreatorUtils, this.metadataService = t.metadataService, this.schemaService = t.schemaService;
422
+ var o;
423
+ this.componentId = t, this.designerHostService = e, this.eventsEditorUtils = e.eventsEditorUtils, this.formSchemaUtils = e.formSchemaUtils, this.formMetadataConverter = e.formMetadataConverter, this.viewModelId = ((o = this.formSchemaUtils) == null ? void 0 : o.getViewModelIdByComponentId(t)) || "", this.designViewModelUtils = e.designViewModelUtils, this.controlCreatorUtils = e.controlCreatorUtils, this.metadataService = e.metadataService, this.schemaService = e.schemaService;
417
424
  }
418
425
  getTableInfo() {
419
- var e;
420
- return (e = this.schemaService) == null ? void 0 : e.getTableInfoByViewModelId(this.viewModelId);
426
+ var t;
427
+ return (t = this.schemaService) == null ? void 0 : t.getTableInfoByViewModelId(this.viewModelId);
421
428
  }
422
- setDesignViewModelField(e) {
423
- const t = e.binding && e.binding.type === "Form" && e.binding.field;
424
- if (t) {
429
+ setDesignViewModelField(t) {
430
+ const e = t.binding && t.binding.type === "Form" && t.binding.field;
431
+ if (e) {
425
432
  if (!this.designViewModelField) {
426
- const n = this.designViewModelUtils.getDgViewModel(this.viewModelId);
427
- this.designViewModelField = n.fields.find((o) => o.id === t);
433
+ const o = this.designViewModelUtils.getDgViewModel(this.viewModelId);
434
+ this.designViewModelField = o.fields.find((n) => n.id === e);
428
435
  }
429
- e.updateOn = this.designViewModelField.updateOn;
436
+ t.updateOn = this.designViewModelField.updateOn;
430
437
  }
431
438
  }
432
- changeFieldEditorType(e, t) {
439
+ changeFieldEditorType(t, e) {
433
440
  }
434
- getBasicPropConfig(e) {
441
+ getBasicPropConfig(t) {
435
442
  return {
436
443
  description: "Basic Information",
437
444
  title: "基本信息",
@@ -450,13 +457,13 @@ class ge {
450
457
  type: "combo-list",
451
458
  textField: "name",
452
459
  valueField: "value",
453
- data: [{ value: e.type, name: a[e.type].name }]
460
+ data: [{ value: t.type, name: p[t.type].name }]
454
461
  }
455
462
  }
456
463
  }
457
464
  };
458
465
  }
459
- getAppearanceConfig(e = null) {
466
+ getAppearanceConfig(t = null) {
460
467
  return {
461
468
  title: "样式",
462
469
  description: "Appearance",
@@ -476,90 +483,105 @@ class ge {
476
483
  }
477
484
  };
478
485
  }
486
+ /**
487
+ *
488
+ * @param propertyId
489
+ * @param componentInstance
490
+ * @returns
491
+ */
492
+ updateElementByParentContainer(t, e) {
493
+ const o = e && e.parent && e.parent.schema;
494
+ if (!o)
495
+ return;
496
+ const n = o.contents.findIndex((c) => c.id === t), i = x(o.contents[n]);
497
+ o.contents.splice(n, 1), o.contents.splice(n, 0, i);
498
+ }
479
499
  }
480
- const B = class B {
500
+ const P = class P {
481
501
  /**
482
502
  * 根据绑定字段类型获取可用的输入类控件
483
503
  */
484
- static getEditorTypesByMDataType(e) {
485
- const t = B.fieldControlTypeMapping[e];
486
- return t || [{ key: "", value: "" }];
504
+ static getEditorTypesByMDataType(t) {
505
+ const e = P.fieldControlTypeMapping[t];
506
+ return e || [{ key: "", value: "" }];
487
507
  }
488
508
  /**
489
509
  * 获取所有输入类控件
490
510
  */
491
511
  static getAllInputTypes() {
492
- const e = [];
493
- for (let t in B.fieldControlTypeMapping)
494
- B.fieldControlTypeMapping[t].forEach((n) => {
495
- e.find((o) => o.key === n.key && o.value === n.value) || e.push({ key: n.key, value: n.value });
512
+ const t = [];
513
+ for (let e in P.fieldControlTypeMapping)
514
+ P.fieldControlTypeMapping[e].forEach((o) => {
515
+ t.find((n) => n.key === o.key && n.value === o.value) || t.push({ key: o.key, value: o.value });
496
516
  });
497
- return e;
517
+ return t;
498
518
  }
499
519
  };
500
520
  /**
501
521
  * <字段类型,可配置的控件类型列表>的映射
502
522
  */
503
- b(B, "fieldControlTypeMapping", {
523
+ g(P, "fieldControlTypeMapping", {
504
524
  String: [
505
- { key: a["input-group"].type, value: a["input-group"].name },
506
- { key: a.lookup.type, value: a.lookup.name },
507
- { key: a["date-picker"].type, value: a["date-picker"].name },
508
- { key: a["check-box"].type, value: a["check-box"].name },
509
- { key: a["radio-group"].type, value: a["radio-group"].name },
510
- { key: a["combo-list"].type, value: a["combo-list"].name },
511
- { key: a.textarea.type, value: a.textarea.name }
525
+ { key: p["input-group"].type, value: p["input-group"].name },
526
+ { key: p.lookup.type, value: p.lookup.name },
527
+ { key: p["date-picker"].type, value: p["date-picker"].name },
528
+ { key: p["check-box"].type, value: p["check-box"].name },
529
+ { key: p["radio-group"].type, value: p["radio-group"].name },
530
+ { key: p["combo-list"].type, value: p["combo-list"].name },
531
+ { key: p.textarea.type, value: p.textarea.name }
512
532
  ],
513
533
  Text: [
514
- { key: a.textarea.type, value: a.textarea.name },
515
- { key: a.lookup.type, value: a.lookup.name }
534
+ { key: p.textarea.type, value: p.textarea.name },
535
+ { key: p.lookup.type, value: p.lookup.name }
516
536
  ],
517
537
  Decimal: [
518
- { key: a["number-spinner"].type, value: a["number-spinner"].name }
538
+ { key: p["number-spinner"].type, value: p["number-spinner"].name }
519
539
  ],
520
540
  Integer: [
521
- { key: a["number-spinner"].type, value: a["number-spinner"].name }
541
+ { key: p["number-spinner"].type, value: p["number-spinner"].name }
522
542
  ],
523
543
  Number: [
524
- { key: a["number-spinner"].type, value: a["number-spinner"].name }
544
+ { key: p["number-spinner"].type, value: p["number-spinner"].name }
525
545
  ],
526
546
  BigNumber: [
527
- { key: a["number-spinner"].type, value: a["number-spinner"].name }
547
+ { key: p["number-spinner"].type, value: p["number-spinner"].name }
528
548
  ],
529
549
  Date: [
530
- { key: a["date-picker"].type, value: a["date-picker"].name }
550
+ { key: p["date-picker"].type, value: p["date-picker"].name }
531
551
  ],
532
552
  DateTime: [
533
- { key: a["date-picker"].type, value: a["date-picker"].name }
553
+ { key: p["date-picker"].type, value: p["date-picker"].name }
534
554
  ],
535
555
  Boolean: [
536
- { key: a.switch.type, value: a.switch.name },
537
- { key: a["check-box"].type, value: a["check-box"].name }
556
+ { key: p.switch.type, value: p.switch.name },
557
+ { key: p["check-box"].type, value: p["check-box"].name }
538
558
  ],
539
559
  Enum: [
540
- { key: a["combo-list"].type, value: a["combo-list"].name },
541
- { key: a["radio-group"].type, value: a["radio-group"].name }
560
+ { key: p["combo-list"].type, value: p["combo-list"].name },
561
+ { key: p["radio-group"].type, value: p["radio-group"].name }
542
562
  ],
543
563
  Object: [
544
- { key: a.lookup.type, value: a.lookup.name },
545
- { key: a["combo-list"].type, value: a["combo-list"].name },
546
- { key: a["radio-group"].type, value: a["radio-group"].name }
564
+ { key: p.lookup.type, value: p.lookup.name },
565
+ { key: p["combo-list"].type, value: p["combo-list"].name },
566
+ { key: p["radio-group"].type, value: p["radio-group"].name }
547
567
  ]
548
568
  });
549
- let F = B;
550
- const ve = C(0);
551
- class be extends ge {
552
- constructor(e, t) {
553
- super(e, t);
569
+ let A = P;
570
+ const ke = w(0);
571
+ class we extends be {
572
+ constructor(e, o) {
573
+ super(e, o);
574
+ g(this, "responseLayoutEditorFunction");
575
+ this.responseLayoutEditorFunction = K(this.formSchemaUtils);
554
576
  }
555
- getPropertyConfig(e, t) {
556
- return this.propertyConfig.categories.basic = this.getBasicProperties(e, t), this.propertyConfig.categories.appearance = this.getAppearanceProperties(e), this.propertyConfig.categories.editor = this.getEditorProperties(e), this.propertyConfig;
577
+ getPropertyConfig(e, o) {
578
+ return this.propertyConfig.categories.basic = this.getBasicProperties(e, o), this.propertyConfig.categories.appearance = this.getAppearanceProperties(e, o), this.propertyConfig.categories.editor = this.getEditorProperties(e), this.propertyConfig;
557
579
  }
558
- getBasicProperties(e, t) {
559
- var m;
580
+ getBasicProperties(e, o) {
581
+ var d;
560
582
  var n = this;
561
583
  this.setDesignViewModelField(e);
562
- const o = this.formSchemaUtils.getFormMetadataBasicInfo(), s = this.designViewModelUtils.getAllFields2TreeByVMId(this.viewModelId);
584
+ const i = this.formSchemaUtils.getFormMetadataBasicInfo(), c = this.designViewModelUtils.getAllFields2TreeByVMId(this.viewModelId);
563
585
  return {
564
586
  description: "Basic Information",
565
587
  title: "基本信息",
@@ -571,8 +593,8 @@ class be extends ge {
571
593
  readonly: !0
572
594
  },
573
595
  type: {
574
- description: "组件类型",
575
- title: "控件类型",
596
+ description: "编辑器类型",
597
+ title: "编辑器类型",
576
598
  type: "string",
577
599
  refreshPanelAfterChanged: !0,
578
600
  $converter: "/converter/change-editor.converter",
@@ -581,7 +603,7 @@ class be extends ge {
581
603
  textField: "value",
582
604
  valueField: "key",
583
605
  editable: !1,
584
- data: n.designViewModelField ? F.getEditorTypesByMDataType((m = n.designViewModelField.type) == null ? void 0 : m.name) : F.getAllInputTypes()
606
+ data: n.designViewModelField ? A.getEditorTypesByMDataType((d = n.designViewModelField.type) == null ? void 0 : d.name) : A.getAllInputTypes()
585
607
  }
586
608
  },
587
609
  label: {
@@ -598,7 +620,7 @@ class be extends ge {
598
620
  bindingType: { enable: !1 },
599
621
  editorParams: {
600
622
  propertyData: e,
601
- formBasicInfo: o
623
+ formBasicInfo: i
602
624
  },
603
625
  columns: [
604
626
  { field: "name", title: "字段名称" },
@@ -606,22 +628,27 @@ class be extends ge {
606
628
  { field: "fieldType", title: "字段类型" }
607
629
  ],
608
630
  textField: "bindingField",
609
- data: s
631
+ data: c
610
632
  }
611
633
  }
612
634
  },
613
- setPropertyRelates(p, d) {
614
- if (p)
615
- switch (p && p.propertyID) {
635
+ setPropertyRelates(u, r) {
636
+ if (u)
637
+ switch (u && u.propertyID) {
616
638
  case "type": {
617
- n.changeControlType(e, p, t);
639
+ n.changeControlType(e, u, o);
640
+ break;
641
+ }
642
+ case "label": {
643
+ u.needRefreshControlTree = !0;
618
644
  break;
619
645
  }
620
646
  }
621
647
  }
622
648
  };
623
649
  }
624
- getAppearanceProperties(e) {
650
+ getAppearanceProperties(e, o) {
651
+ var n = this;
625
652
  return {
626
653
  title: "样式",
627
654
  description: "Appearance",
@@ -642,12 +669,25 @@ class be extends ge {
642
669
  description: "响应式列宽",
643
670
  title: "响应式列宽",
644
671
  type: "boolean",
645
- visible: !1,
672
+ visible: !0,
673
+ // 这个属性,标记当属性变更得时候触发重新更新属性
674
+ refreshPanelAfterChanged: !0,
646
675
  editor: {
647
- type: "response-layout-editor-setting"
648
- },
649
- $converter: "/converter/response-form-layout.converter"
676
+ type: "response-layout-editor-setting",
677
+ initialState: n.responseLayoutEditorFunction.checkCanOpenLayoutEditor(e, n.componentId)
678
+ }
650
679
  }
680
+ },
681
+ setPropertyRelates(i, c) {
682
+ if (i)
683
+ switch (i && i.propertyID) {
684
+ case "responseLayout":
685
+ n.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(i.propertyValue, n.componentId || e.id), n.updateUnifiedLayoutAfterResponseLayoutChanged(n.componentId), n.updateElementByParentContainer(e.id, o), delete e.responseLayout;
686
+ break;
687
+ case "class":
688
+ n.updateUnifiedLayoutAfterControlChanged(i.propertyValue, e.id, this.componentId), n.updateElementByParentContainer(e.id, o);
689
+ break;
690
+ }
651
691
  }
652
692
  };
653
693
  }
@@ -659,44 +699,44 @@ class be extends ge {
659
699
  * @param propertyData 控件DOM属性
660
700
  * @param newControlType 新控件类型
661
701
  */
662
- changeControlType(e, t, n) {
663
- var i, l, c, u;
664
- const o = t.propertyValue, s = n && n.parent && n.parent.schema;
665
- if (!s)
702
+ changeControlType(e, o, n) {
703
+ var s, l, m, h;
704
+ const i = o.propertyValue, c = n && n.parent && n.parent.schema;
705
+ if (!c)
666
706
  return;
667
- const m = s.contents.findIndex((f) => f.id === e.id), p = s.contents[m];
668
- let d;
707
+ const d = c.contents.findIndex((f) => f.id === e.id), u = c.contents[d];
708
+ let r;
669
709
  this.designViewModelField && (this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id, {
670
710
  editor: {
671
- $type: o
711
+ $type: i
672
712
  },
673
713
  name: this.designViewModelField.name,
674
714
  require: this.designViewModelField.require,
675
715
  readonly: this.designViewModelField.readonly
676
- }, !1), d = this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField, o)), d || (d = z("form-group") || {}, d.editor = z(o) || {}, delete d.editor.id, delete d.editor.binding, delete d.editor.appearance), Object.assign(d, {
677
- id: p.id,
678
- appearance: p.appearance,
679
- size: p.size,
680
- label: p.label,
681
- binding: p.binding,
682
- visible: p.visible
683
- }), Object.assign(d.editor, {
684
- isTextArea: d.isTextArea && p.isTextArea,
685
- placeholder: (i = p.editor) == null ? void 0 : i.placeholder,
686
- holdPlace: (l = p.editor) == null ? void 0 : l.holdPlace,
687
- readonly: (c = p.editor) == null ? void 0 : c.readonly,
688
- require: (u = p.editor) == null ? void 0 : u.require
689
- }), s.contents.splice(m, 1), s.contents.splice(m, 0, d), n.schema = Object.assign(p, d), Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(
716
+ }, !1), r = this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField, i)), r || (r = G("form-group") || {}, r.editor = G(i) || {}, delete r.editor.id, delete r.editor.binding, delete r.editor.appearance), Object.assign(r, {
717
+ id: u.id,
718
+ appearance: u.appearance,
719
+ size: u.size,
720
+ label: u.label,
721
+ binding: u.binding,
722
+ visible: u.visible
723
+ }), Object.assign(r.editor, {
724
+ isTextArea: r.isTextArea && u.isTextArea,
725
+ placeholder: (s = u.editor) == null ? void 0 : s.placeholder,
726
+ holdPlace: (l = u.editor) == null ? void 0 : l.holdPlace,
727
+ readonly: (m = u.editor) == null ? void 0 : m.readonly,
728
+ require: (h = u.editor) == null ? void 0 : h.require
729
+ }), c.contents.splice(d, 1), c.contents.splice(d, 0, r), n.schema = Object.assign(u, r), Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(
690
730
  (f) => f.classList.remove("dgComponentSelected")
691
- ), ve.value++;
731
+ ), ke.value++;
692
732
  }
693
- getComponentConfig(e, t = {}, n = {}) {
694
- const o = Object.assign({
695
- description: "组件信息",
696
- title: "组件信息",
733
+ getComponentConfig(e, o = {}, n = {}) {
734
+ const i = Object.assign({
735
+ description: "编辑器",
736
+ title: "编辑器",
697
737
  type: "input-group",
698
738
  $converter: "/converter/property-editor.converter"
699
- }, t), s = Object.assign({
739
+ }, o), c = Object.assign({
700
740
  readonly: {
701
741
  description: "",
702
742
  title: "只读",
@@ -718,15 +758,63 @@ class be extends ge {
718
758
  type: "string"
719
759
  }
720
760
  }, n);
721
- return { ...o, properties: { ...s } };
761
+ return { ...i, properties: { ...c } };
762
+ }
763
+ /**
764
+ * 修改某一输入控件的样式后更新Form的统一布局配置
765
+ * @param controlClass 控件样式
766
+ * @param controlId 控件Id
767
+ * @param componentId 控件所在组件id
768
+ */
769
+ updateUnifiedLayoutAfterControlChanged(e, o, n) {
770
+ const i = e.split(" ");
771
+ let c = i.find((l) => /^col-([1-9]|10|11|12)$/.test(l)), d = i.find((l) => /^col-md-([1-9]|10|11|12)$/.test(l)), u = i.find((l) => /^col-xl-([1-9]|10|11|12)$/.test(l)), r = i.find((l) => /^col-el-([1-9]|10|11|12)$/.test(l));
772
+ c = c || "col-12", d = d || "col-md-" + c.replace("col-", ""), u = u || "col-xl-" + d.replace("col-md-", ""), r = r || "col-el-" + u.replace("col-xl-", "");
773
+ const s = {
774
+ id: o,
775
+ columnInSM: parseInt(c.replace("col-", ""), 10),
776
+ columnInMD: parseInt(d.replace("col-md-", ""), 10),
777
+ columnInLG: parseInt(u.replace("col-xl-", ""), 10),
778
+ columnInEL: parseInt(r.replace("col-el-", ""), 10)
779
+ };
780
+ this.updateUnifiedLayoutAfterResponseLayoutChanged(n, s);
781
+ }
782
+ /**
783
+ * 修改控件布局配置后更新Form统一布局配置
784
+ * @param componentId 组件Id
785
+ * @param controlLayoutConfig 某单独变动的控件配置项,FormResponseLayoutContext类型
786
+ */
787
+ updateUnifiedLayoutAfterResponseLayoutChanged(e, o) {
788
+ const { formNode: n } = this.responseLayoutEditorFunction.checkCanFindFormNode(e);
789
+ if (!n || !n.unifiedLayout)
790
+ return;
791
+ const i = [];
792
+ if (this.responseLayoutEditorFunction.getResonseFormLayoutConfig(n, i, 1), o) {
793
+ const f = i.find((T) => T.id === o.id);
794
+ Object.assign(f || {}, o);
795
+ }
796
+ const c = i.map((f) => f.columnInSM), d = i.map((f) => f.columnInMD), u = i.map((f) => f.columnInLG), r = i.map((f) => f.columnInEL), s = this.checkIsUniqueColumn(c) ? c[0] : null, l = this.checkIsUniqueColumn(d) ? d[0] : null, m = this.checkIsUniqueColumn(u) ? u[0] : null, h = this.checkIsUniqueColumn(r) ? r[0] : null;
797
+ Object.assign(n.unifiedLayout, {
798
+ uniqueColClassInSM: s,
799
+ uniqueColClassInMD: l,
800
+ uniqueColClassInLG: m,
801
+ uniqueColClassInEL: h
802
+ });
803
+ }
804
+ /**
805
+ * 校验宽度样式值是否一致
806
+ */
807
+ checkIsUniqueColumn(e) {
808
+ const o = new Set(e);
809
+ return Array.from(o).length === 1;
722
810
  }
723
811
  }
724
- class we extends be {
725
- constructor(e, t) {
726
- super(e, t);
812
+ class Me extends we {
813
+ constructor(t, e) {
814
+ super(t, e);
727
815
  }
728
- getEditorProperties(e) {
729
- return this.getComponentConfig(e, { type: "switch" }, {
816
+ getEditorProperties(t) {
817
+ return this.getComponentConfig(t, { type: "switch" }, {
730
818
  readonly: {
731
819
  visible: !1
732
820
  },
@@ -756,6 +844,7 @@ class we extends be {
756
844
  size: {
757
845
  description: "",
758
846
  title: "尺寸",
847
+ type: "enum",
759
848
  editor: {
760
849
  data: [
761
850
  {
@@ -776,114 +865,114 @@ class we extends be {
776
865
  });
777
866
  }
778
867
  }
779
- function Ce(r, e) {
780
- r.schema;
781
- const t = C(!0), n = C(!0);
782
- function o(c) {
868
+ function Se(a, t) {
869
+ a.schema;
870
+ const e = w(!0), o = w(!0);
871
+ function n(l) {
783
872
  return !1;
784
873
  }
785
- function s() {
874
+ function i() {
786
875
  return !1;
787
876
  }
788
- function m() {
877
+ function c() {
789
878
  return !1;
790
879
  }
791
- function p() {
880
+ function d() {
792
881
  return !0;
793
882
  }
794
- function d(c) {
883
+ function u(l) {
795
884
  }
796
- function i() {
885
+ function r() {
797
886
  }
798
- function l(c) {
887
+ function s(l) {
799
888
  return null;
800
889
  }
801
890
  return {
802
- canAccepts: o,
803
- checkCanDeleteComponent: s,
804
- checkCanMoveComponent: m,
805
- hideNestedPaddingInDesginerView: p,
806
- onAcceptMovedChildElement: d,
807
- resolveComponentContext: i,
808
- triggerBelongedComponentToMoveWhenMoved: t,
809
- triggerBelongedComponentToDeleteWhenDeleted: n,
810
- getPropsConfig: l
891
+ canAccepts: n,
892
+ checkCanDeleteComponent: i,
893
+ checkCanMoveComponent: c,
894
+ hideNestedPaddingInDesginerView: d,
895
+ onAcceptMovedChildElement: u,
896
+ resolveComponentContext: r,
897
+ triggerBelongedComponentToMoveWhenMoved: e,
898
+ triggerBelongedComponentToDeleteWhenDeleted: o,
899
+ getPropsConfig: s
811
900
  };
812
901
  }
813
- function ke(r, e) {
902
+ function Te(a, t) {
814
903
  const {
815
- canAccepts: t,
816
- checkCanDeleteComponent: n,
817
- checkCanMoveComponent: o,
818
- hideNestedPaddingInDesginerView: s,
819
- onAcceptMovedChildElement: m,
820
- resolveComponentContext: p,
821
- triggerBelongedComponentToMoveWhenMoved: d,
822
- triggerBelongedComponentToDeleteWhenDeleted: i
823
- } = Ce(r), l = r.schema;
824
- function c(u, f) {
825
- return new we(u, e).getPropertyConfig(l, f);
904
+ canAccepts: e,
905
+ checkCanDeleteComponent: o,
906
+ checkCanMoveComponent: n,
907
+ hideNestedPaddingInDesginerView: i,
908
+ onAcceptMovedChildElement: c,
909
+ resolveComponentContext: d,
910
+ triggerBelongedComponentToMoveWhenMoved: u,
911
+ triggerBelongedComponentToDeleteWhenDeleted: r
912
+ } = Se(a), s = a.schema;
913
+ function l(m, h) {
914
+ return new Me(m, t).getPropertyConfig(s, h);
826
915
  }
827
916
  return {
828
- canAccepts: t,
829
- checkCanDeleteComponent: n,
830
- checkCanMoveComponent: o,
831
- hideNestedPaddingInDesginerView: s,
832
- onAcceptMovedChildElement: m,
833
- resolveComponentContext: p,
834
- triggerBelongedComponentToMoveWhenMoved: d,
835
- triggerBelongedComponentToDeleteWhenDeleted: i,
836
- getPropsConfig: c
917
+ canAccepts: e,
918
+ checkCanDeleteComponent: o,
919
+ checkCanMoveComponent: n,
920
+ hideNestedPaddingInDesginerView: i,
921
+ onAcceptMovedChildElement: c,
922
+ resolveComponentContext: d,
923
+ triggerBelongedComponentToMoveWhenMoved: u,
924
+ triggerBelongedComponentToDeleteWhenDeleted: r,
925
+ getPropsConfig: l
837
926
  };
838
927
  }
839
- const Me = /* @__PURE__ */ G({
928
+ const Be = /* @__PURE__ */ W({
840
929
  name: "FSwitchDesign",
841
- props: $,
930
+ props: N,
842
931
  emits: ["update:modelValue"],
843
- setup(r, e) {
932
+ setup(a, t) {
844
933
  const {
845
- size: t,
846
- onLabel: n,
847
- offLabel: o
848
- } = L(r), s = C(), m = q("designer-host-service"), p = q("design-item-context"), d = ke(p, m), i = he(s, p, d);
849
- x(() => {
850
- s.value.componentInstance = i;
851
- }), e.expose(i.value);
852
- const l = S(() => ({
934
+ size: e,
935
+ onLabel: o,
936
+ offLabel: n
937
+ } = z(a), i = w(), c = q("designer-host-service"), d = q("design-item-context"), u = Te(d, c), r = Ce(i, d, u);
938
+ R(() => {
939
+ i.value.componentInstance = r;
940
+ }), t.expose(r.value);
941
+ const s = E(() => ({
853
942
  switch: !0,
854
943
  "f-cmp-switch": !0,
855
944
  checked: !1,
856
- "switch-large": t.value === "large",
857
- "switch-medium": t.value === "medium",
858
- "switch-small": t.value === "small"
859
- })), c = S(() => (n == null ? void 0 : n.value) || (o == null ? void 0 : o.value));
860
- return () => w("span", {
861
- ref: s,
945
+ "switch-large": e.value === "large",
946
+ "switch-medium": e.value === "medium",
947
+ "switch-small": e.value === "small"
948
+ })), l = E(() => (o == null ? void 0 : o.value) || (n == null ? void 0 : n.value));
949
+ return () => k("span", {
950
+ ref: i,
862
951
  tabindex: "0",
863
952
  role: "button",
864
- class: l.value
865
- }, [c.value && w("span", {
953
+ class: s.value
954
+ }, [l.value && k("span", {
866
955
  class: "switch-pane"
867
- }, [w("span", {
956
+ }, [k("span", {
868
957
  class: "switch-label-unchecked"
869
- }, [o == null ? void 0 : o.value])]), w("small", null, [e.slots.default && e.slots.default()])]);
958
+ }, [n == null ? void 0 : n.value])]), k("small", null, [t.slots.default && t.slots.default()])]);
870
959
  }
871
- }), Te = (r) => {
872
- const e = r;
873
- return e.install = function(t) {
874
- t.component(e.name, r);
875
- }, r;
960
+ }), Ee = (a) => {
961
+ const t = a;
962
+ return t.install = function(e) {
963
+ e.component(t.name, a);
964
+ }, a;
876
965
  };
877
- D.register = (r, e, t, n) => {
878
- r.switch = D, e.switch = X;
966
+ V.register = (a, t, e, o) => {
967
+ a.switch = V, t.switch = Q;
879
968
  };
880
- D.registerDesigner = (r, e, t) => {
881
- r.switch = Me, e.switch = X;
969
+ V.registerDesigner = (a, t, e) => {
970
+ a.switch = Be, t.switch = Q;
882
971
  };
883
- const De = Te(D);
972
+ const Le = Ee(V);
884
973
  export {
885
- D as FSwitch,
886
- De as default,
887
- X as propsResolver,
888
- $ as switchProps
974
+ V as FSwitch,
975
+ Le as default,
976
+ Q as propsResolver,
977
+ N as switchProps
889
978
  };