@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,11 +1,16 @@
1
- var H = Object.defineProperty;
2
- var x = (i, t, e) => t in i ? H(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var g = (i, t, e) => x(i, typeof t != "symbol" ? t + "" : t, e);
4
- import { defineComponent as N, inject as L, onMounted as j, createVNode as M, Fragment as R, computed as V, ref as F, provide as K } from "vue";
5
- import { useCheck as ee } from "../common/index.esm.js";
6
- import { isPlainObject as $, cloneDeep as q } from "lodash-es";
7
- import { DgControl as W } from "../designer-canvas/index.esm.js";
8
- const te = {
1
+ var ue = Object.defineProperty;
2
+ var ce = (e, t, n) => t in e ? ue(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var T = (e, t, n) => ce(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { defineComponent as V, inject as N, onMounted as L, createVNode as g, Fragment as Q, computed as I, ref as w, provide as de, Teleport as pe, createApp as fe, onUnmounted as me, watch as j, nextTick as z, withDirectives as G, vShow as ye, mergeProps as ge, createTextVNode as A, vModelText as X } from "vue";
5
+ import { useCheck as he, useGuid as J } from "../common/index.esm.js";
6
+ import { isPlainObject as H, cloneDeep as U } from "lodash-es";
7
+ import { DgControl as _ } from "../designer-canvas/index.esm.js";
8
+ import { resolveAppearance as ve, createPropsResolver as be } from "../dynamic-resolver/index.esm.js";
9
+ import Ce from "../tags/index.esm.js";
10
+ import ke from "../popover/index.esm.js";
11
+ import Fe from "../data-grid/index.esm.js";
12
+ import { FNotifyService as Be } from "../notify/index.esm.js";
13
+ const Me = {
9
14
  value: { type: String, default: "" },
10
15
  /** 值 */
11
16
  modelValue: { type: String, default: "" },
@@ -15,150 +20,157 @@ const te = {
15
20
  label: { type: String, default: "" },
16
21
  /** 标识 */
17
22
  id: { type: String, default: "" }
18
- }, z = Symbol("radioGroupContext"), O = /* @__PURE__ */ N({
23
+ }, Y = Symbol("radioGroupContext"), K = /* @__PURE__ */ V({
19
24
  name: "FRadio",
20
- props: te,
25
+ props: Me,
21
26
  emits: ["update:value"],
22
- setup(i, t) {
23
- const e = L(z, null), {
24
- buttonClass: o,
25
- checked: r,
27
+ setup(e, t) {
28
+ const n = N(Y, null), {
29
+ buttonClass: a,
30
+ checked: o,
26
31
  disabled: l,
27
- name: d,
28
- tagClass: f,
32
+ name: u,
33
+ tagClass: c,
29
34
  shouldRenderButton: p,
30
- shouldRenderNative: a,
31
- shouldRenderTag: s,
32
- onClickRadio: n
33
- } = ee(i, t, e == null ? void 0 : e.parentProps, e == null ? void 0 : e.parentContext);
34
- return j(() => {
35
+ shouldRenderNative: r,
36
+ shouldRenderTag: d,
37
+ onClickRadio: i
38
+ } = he(e, t, n == null ? void 0 : n.parentProps, n == null ? void 0 : n.parentContext);
39
+ return L(() => {
35
40
  }), () => {
36
- var c, y, u, h, b, C;
37
- return M(R, null, [p.value && M("div", {
38
- class: o.value,
41
+ var s, f, m, y, F, k;
42
+ return g(Q, null, [p.value && g("div", {
43
+ class: a.value,
39
44
  style: "border-radius:0;border: 1px solid #E8EBF2;",
40
- onClick: n
41
- }, [(y = (c = t.slots).default) == null ? void 0 : y.call(c)]), s.value && M("div", {
42
- class: f.value,
43
- onClick: n
44
- }, [M("div", {
45
+ onClick: i
46
+ }, [(f = (s = t.slots).default) == null ? void 0 : f.call(s)]), d.value && g("div", {
47
+ class: c.value,
48
+ onClick: i
49
+ }, [g("div", {
45
50
  class: "title"
46
- }, [(h = (u = t.slots).default) == null ? void 0 : h.call(u)]), M("div", {
51
+ }, [(y = (m = t.slots).default) == null ? void 0 : y.call(m)]), g("div", {
47
52
  class: "tip"
48
- }, null), M("span", {
53
+ }, null), g("span", {
49
54
  class: "f-icon f-icon-check f-radio-icon"
50
- }, null)]), a.value && M("div", {
55
+ }, null)]), r.value && g("div", {
51
56
  class: "custom-control custom-radio",
52
- onClick: n
53
- }, [M("input", {
57
+ onClick: i
58
+ }, [g("input", {
54
59
  type: "radio",
55
60
  class: "custom-control-input",
56
- name: d.value,
57
- id: i.id,
58
- value: i.value,
59
- checked: r.value,
61
+ name: u.value,
62
+ id: e.id,
63
+ value: e.value,
64
+ checked: o.value,
60
65
  disabled: l.value
61
- }, null), M("div", {
66
+ }, null), g("div", {
62
67
  class: "custom-control-label"
63
- }, [(C = (b = t.slots).default) == null ? void 0 : C.call(b)])])]);
68
+ }, [(k = (F = t.slots).default) == null ? void 0 : k.call(F)])])]);
64
69
  };
65
70
  }
66
71
  });
67
- function ne(i, t, e) {
72
+ function we(e, t, n) {
68
73
  return t;
69
74
  }
70
- const X = {}, _ = {};
71
- function U(i) {
72
- const { properties: t, title: e, ignore: o } = i, r = o && Array.isArray(o), l = Object.keys(t).reduce((d, f) => ((!r || !o.find((p) => p == f)) && (d[f] = t[f].type === "object" && t[f].properties ? U(t[f]) : q(t[f].default)), d), {});
73
- return e && (!r || !o.find((d) => d == "id")) && (l.id = `${e}-${Date.now()}`), l;
75
+ function Se(e, t, n) {
76
+ return t;
77
+ }
78
+ const Z = {}, ee = {};
79
+ function W(e) {
80
+ const { properties: t, title: n, ignore: a } = e, o = a && Array.isArray(a), l = Object.keys(t).reduce((u, c) => ((!o || !a.find((p) => p === c)) && (u[c] = t[c].type === "object" && t[c].properties ? W(t[c]) : U(t[c].default)), u), {});
81
+ if (n && (!o || !a.find((u) => u === "id"))) {
82
+ const u = n.toLowerCase().replace(/-/g, "_");
83
+ l.id = `${u}_${Math.random().toString().slice(2, 6)}`;
84
+ }
85
+ return l;
74
86
  }
75
- function J(i, t = {}, e) {
76
- const o = X[i];
77
- if (o) {
78
- let r = U(o);
79
- const l = _[i];
80
- return r = l ? l({ getSchemaByType: J }, r, t, e) : r, r;
87
+ function te(e, t = {}, n) {
88
+ const a = Z[e];
89
+ if (a) {
90
+ let o = W(a);
91
+ const l = ee[e];
92
+ return o = l ? l({ getSchemaByType: te }, o, t, n) : o, o;
81
93
  }
82
94
  return null;
83
95
  }
84
- function oe(i, t) {
85
- const e = U(t);
86
- return Object.keys(i).reduce((o, r) => (o[r] && $(o[r]) && $(i[r]) ? Object.assign(o[r], i[r]) : o[r] = i[r], o), e), e;
96
+ function Te(e, t) {
97
+ const n = W(t);
98
+ return Object.keys(n).reduce((a, o) => (a[o] && H(a[o]) && H(e[o] || !e[o]) ? Object.assign(a[o], e[o] || {}) : a[o] = e[o], a), n), n;
87
99
  }
88
- function re(i, t) {
89
- return Object.keys(i).filter((o) => i[o] != null).reduce((o, r) => {
90
- if (t.has(r)) {
91
- const l = t.get(r);
100
+ function Ee(e, t) {
101
+ return Object.keys(e).filter((a) => e[a] != null).reduce((a, o) => {
102
+ if (t.has(o)) {
103
+ const l = t.get(o);
92
104
  if (typeof l == "string")
93
- o[l] = i[r];
105
+ a[l] = e[o];
94
106
  else {
95
- const d = l(r, i[r], i);
96
- Object.assign(o, d);
107
+ const u = l(o, e[o], e);
108
+ Object.assign(a, u);
97
109
  }
98
110
  } else
99
- o[r] = i[r];
100
- return o;
111
+ a[o] = e[o];
112
+ return a;
101
113
  }, {});
102
114
  }
103
- function ie(i, t, e = /* @__PURE__ */ new Map()) {
104
- const o = oe(i, t);
105
- return re(o, e);
115
+ function Ie(e, t, n = /* @__PURE__ */ new Map()) {
116
+ const a = Te(e, t);
117
+ return Ee(a, n);
106
118
  }
107
- function ae(i = {}) {
108
- function t(a, s, n, c) {
109
- if (typeof n == "number")
110
- return c[a].length === n;
111
- if (typeof n == "object") {
112
- const y = Object.keys(n)[0], u = n[y];
113
- if (y === "not")
114
- return Number(c[a].length) !== Number(u);
115
- if (y === "moreThan")
116
- return Number(c[a].length) >= Number(u);
117
- if (y === "lessThan")
118
- return Number(c[a].length) <= Number(u);
119
+ function Pe(e = {}) {
120
+ function t(r, d, i, s) {
121
+ if (typeof i == "number")
122
+ return s[r].length === i;
123
+ if (typeof i == "object") {
124
+ const f = Object.keys(i)[0], m = i[f];
125
+ if (f === "not")
126
+ return Number(s[r].length) !== Number(m);
127
+ if (f === "moreThan")
128
+ return Number(s[r].length) >= Number(m);
129
+ if (f === "lessThan")
130
+ return Number(s[r].length) <= Number(m);
119
131
  }
120
132
  return !1;
121
133
  }
122
- function e(a, s, n, c) {
123
- return c[a] && c[a].propertyValue && String(c[a].propertyValue.value) === String(n);
134
+ function n(r, d, i, s) {
135
+ return s[r] && s[r].propertyValue && String(s[r].propertyValue.value) === String(i);
124
136
  }
125
- const o = /* @__PURE__ */ new Map([
137
+ const a = /* @__PURE__ */ new Map([
126
138
  ["length", t],
127
- ["getProperty", e]
139
+ ["getProperty", n]
128
140
  ]);
129
- Object.keys(i).reduce((a, s) => (a.set(s, i[s]), a), o);
130
- function r(a, s) {
131
- const n = a;
132
- return typeof s == "number" ? [{ target: n, operator: "length", param: null, value: Number(s) }] : typeof s == "boolean" ? [{ target: n, operator: "getProperty", param: a, value: !!s }] : typeof s == "object" ? Object.keys(s).map((c) => {
133
- if (c === "length")
134
- return { target: n, operator: "length", param: null, value: s[c] };
135
- const y = c, u = s[c];
136
- return { target: n, operator: "getProperty", param: y, value: u };
141
+ Object.keys(e).reduce((r, d) => (r.set(d, e[d]), r), a);
142
+ function o(r, d) {
143
+ const i = r;
144
+ return typeof d == "number" ? [{ target: i, operator: "length", param: null, value: Number(d) }] : typeof d == "boolean" ? [{ target: i, operator: "getProperty", param: r, value: !!d }] : typeof d == "object" ? Object.keys(d).map((s) => {
145
+ if (s === "length")
146
+ return { target: i, operator: "length", param: null, value: d[s] };
147
+ const f = s, m = d[s];
148
+ return { target: i, operator: "getProperty", param: f, value: m };
137
149
  }) : [];
138
150
  }
139
- function l(a) {
140
- return Object.keys(a).reduce((n, c) => {
141
- const y = r(c, a[c]);
142
- return n.push(...y), n;
151
+ function l(r) {
152
+ return Object.keys(r).reduce((i, s) => {
153
+ const f = o(s, r[s]);
154
+ return i.push(...f), i;
143
155
  }, []);
144
156
  }
145
- function d(a, s) {
146
- if (o.has(a.operator)) {
147
- const n = o.get(a.operator);
148
- return n && n(a.target, a.param, a.value, s) || !1;
157
+ function u(r, d) {
158
+ if (a.has(r.operator)) {
159
+ const i = a.get(r.operator);
160
+ return i && i(r.target, r.param, r.value, d) || !1;
149
161
  }
150
162
  return !1;
151
163
  }
152
- function f(a, s) {
153
- return l(a).reduce((y, u) => y && d(u, s), !0);
164
+ function c(r, d) {
165
+ return l(r).reduce((f, m) => f && u(m, d), !0);
154
166
  }
155
- function p(a, s) {
156
- const n = Object.keys(a), c = n.includes("allOf"), y = n.includes("anyOf"), u = c || y, C = (u ? a[u ? c ? "allOf" : "anyOf" : "allOf"] : [a]).map((E) => f(E, s));
157
- return c ? !C.includes(!1) : C.includes(!0);
167
+ function p(r, d) {
168
+ const i = Object.keys(r), s = i.includes("allOf"), f = i.includes("anyOf"), m = s || f, k = (m ? r[m ? s ? "allOf" : "anyOf" : "allOf"] : [r]).map((B) => c(B, d));
169
+ return s ? !k.includes(!1) : k.includes(!0);
158
170
  }
159
171
  return { parseValueSchema: p };
160
172
  }
161
- const m = {
173
+ const b = {
162
174
  button: { type: "button", name: "按钮", icon: "Button" },
163
175
  "response-toolbar": { type: "response-toolbar", name: "工具栏", icon: "ButtonGroup" },
164
176
  "response-toolbar-item": { type: "response-toolbar-item", name: "按钮", icon: "Button" },
@@ -196,21 +208,22 @@ const m = {
196
208
  "page-header": { type: "page-header", name: "页头", icon: "Header" },
197
209
  "page-footer": { type: "page-footer", name: "页脚", icon: "ModalFooter" },
198
210
  "tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏", icon: "TabToolbar" },
199
- fieldset: { type: "fieldset", name: "分组", icon: "fieldset" }
200
- }, le = {}, se = {};
201
- ae();
202
- function ce(i, t, e = /* @__PURE__ */ new Map(), o = (d, f, p) => f, r = {}, l = (d) => d) {
203
- return X[t.title] = t, _[t.title] = o, le[t.title] = r, se[t.title] = l, (d = {}) => {
204
- const f = ie(d, t, e), p = Object.keys(i).reduce((a, s) => (a[s] = i[s].default, a), {});
205
- return Object.assign(p, f);
211
+ fieldset: { type: "fieldset", name: "分组", icon: "fieldset" },
212
+ "query-solution": { type: "query-solution", name: "筛选方案", icon: "QueryScheme" }
213
+ }, xe = {}, Ve = {};
214
+ Pe();
215
+ function ne(e, t, n = /* @__PURE__ */ new Map(), a = (u, c, p, r) => c, o = {}, l = (u) => u) {
216
+ return Z[t.title] = t, ee[t.title] = a, xe[t.title] = o, Ve[t.title] = l, (u = {}) => {
217
+ const c = Ie(u, t, n), p = Object.keys(e).reduce((r, d) => (r[d] = e[d].default, r), {});
218
+ return Object.assign(p, c);
206
219
  };
207
220
  }
208
- function pe(i, t) {
221
+ function Ae(e, t) {
209
222
  return { customClass: t.class, customStyle: t.style };
210
223
  }
211
- const de = /* @__PURE__ */ new Map([
212
- ["appearance", pe]
213
- ]), ue = "https://json-schema.org/draft/2020-12/schema", me = "https://farris-design.gitee.io/radio-group.schema.json", fe = "radio-group", ye = "A Farris Input Component", he = "object", ge = {
224
+ const Oe = /* @__PURE__ */ new Map([
225
+ ["appearance", Ae]
226
+ ]), De = /* @__PURE__ */ new Map([]), Le = "https://json-schema.org/draft/2020-12/schema", $e = "https://farris-design.gitee.io/radio-group.schema.json", Ne = "radio-group", qe = "A Farris Input Component", Ge = "object", je = {
214
227
  id: {
215
228
  description: "The unique identifier for a radio-group",
216
229
  type: "string"
@@ -242,16 +255,6 @@ const de = /* @__PURE__ */ new Map([
242
255
  type: "boolean",
243
256
  default: !1
244
257
  },
245
- editable: {
246
- description: "",
247
- type: "boolean",
248
- default: !0
249
- },
250
- placeholder: {
251
- description: "",
252
- type: "string",
253
- default: ""
254
- },
255
258
  readonly: {
256
259
  description: "",
257
260
  type: "boolean",
@@ -287,27 +290,28 @@ const de = /* @__PURE__ */ new Map([
287
290
  type: "string",
288
291
  default: "value"
289
292
  },
290
- enumData: {
293
+ data: {
291
294
  description: "",
292
295
  type: "array"
293
296
  }
294
- }, ve = [
297
+ }, Ue = [
295
298
  "id",
296
299
  "type"
297
- ], be = [
300
+ ], We = [
298
301
  "id",
299
302
  "appearance",
300
- "binding"
301
- ], Ce = {
302
- $schema: ue,
303
- $id: me,
304
- title: fe,
305
- description: ye,
306
- type: he,
307
- properties: ge,
308
- required: ve,
309
- ignore: be
310
- }, ke = {
303
+ "binding",
304
+ "visible"
305
+ ], Re = {
306
+ $schema: Le,
307
+ $id: $e,
308
+ title: Ne,
309
+ description: qe,
310
+ type: Ge,
311
+ properties: je,
312
+ required: Ue,
313
+ ignore: We
314
+ }, ze = {
311
315
  /**
312
316
  * 是否被选中
313
317
  */
@@ -324,8 +328,8 @@ const de = /* @__PURE__ */ new Map([
324
328
  * type为button或者tag时的尺寸
325
329
  */
326
330
  size: { type: String, default: "middle" }
327
- }, G = {
328
- ...ke,
331
+ }, R = {
332
+ ...ze,
329
333
  /**
330
334
  * 组件标识
331
335
  */
@@ -335,9 +339,29 @@ const de = /* @__PURE__ */ new Map([
335
339
  */
336
340
  disabled: { type: Boolean, default: !1 },
337
341
  /**
338
- * 单选组枚举数组
342
+ * 功能同disabled
339
343
  */
340
- enumData: { type: Array, default: [{ value: "example", name: "example1" }] },
344
+ readonly: { type: Boolean, default: !1 },
345
+ /**
346
+ * 单选组枚举数组----废弃
347
+ */
348
+ enumData: {
349
+ type: Array,
350
+ default: [
351
+ { value: "example1", name: "示例一" },
352
+ { value: "example2", name: "示例二" }
353
+ ]
354
+ },
355
+ /**
356
+ * 单选组枚举数组
357
+ */
358
+ data: {
359
+ type: Array,
360
+ default: [
361
+ { value: "example1", name: "示例一" },
362
+ { value: "example2", name: "示例二" }
363
+ ]
364
+ },
341
365
  /**
342
366
  * 组件是否水平排列
343
367
  */
@@ -355,7 +379,7 @@ const de = /* @__PURE__ */ new Map([
355
379
  /**
356
380
  * 输入框Tab键索引
357
381
  */
358
- tabIndex: Number,
382
+ tabIndex: { type: Number, default: -1 },
359
383
  /**
360
384
  * 枚举数组中展示文本的key值。
361
385
  */
@@ -364,184 +388,190 @@ const de = /* @__PURE__ */ new Map([
364
388
  * 枚举数组中枚举值的key值。
365
389
  */
366
390
  valueField: { type: String, default: "value" }
367
- }, Q = ce(G, Ce, de, ne);
368
- function Y(i, t, e) {
369
- const o = V(() => !i.disabled), r = V(() => i.enumData || []);
391
+ }, oe = ne(R, Re, Oe, we);
392
+ function ae(e, t, n) {
393
+ const a = I(() => !e.disabled), o = I(() => e.data || e.enumData || []);
370
394
  function l(p) {
371
- return p[i.valueField];
395
+ return p[e.valueField];
372
396
  }
373
- function d(p) {
374
- return p[i.textField];
397
+ function u(p) {
398
+ return p[e.textField];
375
399
  }
376
- function f(p, a) {
377
- if (o.value) {
378
- const s = l(p);
379
- e.value !== s && (e.value = s, t.emit("changeValue", s), t.emit("update:modelValue", s));
400
+ function c(p, r) {
401
+ if (a.value) {
402
+ const d = l(p);
403
+ n.value !== d && (n.value = d, t.emit("changeValue", d), t.emit("update:modelValue", d));
380
404
  }
381
- a.stopPropagation();
405
+ r.stopPropagation();
382
406
  }
383
407
  return {
384
- enumData: r,
408
+ enumData: o,
385
409
  getValue: l,
386
- getText: d,
387
- onClickRadio: f
410
+ getText: u,
411
+ onClickRadio: c
388
412
  };
389
413
  }
390
- const I = /* @__PURE__ */ N({
414
+ const D = /* @__PURE__ */ V({
391
415
  name: "FRadioGroup",
392
- props: G,
416
+ props: R,
393
417
  emits: ["changeValue", "update:modelValue"],
394
- setup(i, t) {
395
- const e = F(i.modelValue), {
396
- enumData: o,
397
- onClickRadio: r,
418
+ setup(e, t) {
419
+ const n = w(e.modelValue), {
420
+ enumData: a,
421
+ onClickRadio: o,
398
422
  getValue: l,
399
- getText: d
400
- } = Y(i, t, e), f = V(() => ({
401
- "farris-checkradio-hor": i.direction === "horizontal"
402
- })), p = F([]);
403
- return K(z, {
423
+ getText: u
424
+ } = ae(e, t, n), c = I(() => ({
425
+ "farris-checkradio-hor": e.direction === "horizontal"
426
+ })), p = w([]);
427
+ return de(Y, {
404
428
  radios: p,
405
- parentProps: i,
429
+ parentProps: e,
406
430
  parentContext: t
407
- }), () => M("div", {
408
- class: ["farris-input-wrap", f.value]
409
- }, [t.slots.default ? t.slots.default() : o.value.map((a, s) => {
410
- const n = "radio_" + i.id + i.name + a[i.valueField];
411
- return M("div", {
431
+ }), () => g("div", {
432
+ class: ["farris-input-wrap", c.value]
433
+ }, [t.slots.default ? t.slots.default() : a.value.map((r, d) => {
434
+ const i = "radio_" + e.id + e.name + r[e.valueField];
435
+ return g("div", {
412
436
  class: "custom-control custom-radio"
413
- }, [M("input", {
437
+ }, [g("input", {
414
438
  type: "radio",
415
439
  class: "custom-control-input",
416
- name: n,
417
- id: n,
418
- value: l(a),
419
- checked: l(a) === e.value,
420
- disabled: i.disabled,
421
- tabindex: i.tabIndex,
422
- onClick: (c) => r(a, c)
423
- }, null), M("label", {
440
+ name: i,
441
+ id: i,
442
+ value: l(r),
443
+ checked: l(r) === n.value,
444
+ disabled: e.readonly || e.disabled,
445
+ tabindex: e.tabIndex,
446
+ onClick: (s) => o(r, s)
447
+ }, null), g("label", {
424
448
  class: "custom-control-label",
425
- for: n
426
- }, [d(a)])]);
449
+ for: i
450
+ }, [u(r)])]);
427
451
  })]);
428
452
  }
429
453
  });
430
- function Me(i, t, e) {
431
- var D;
432
- function o() {
433
- e != null && e.resolveComponentContext && e.resolveComponentContext();
434
- }
435
- o();
436
- const r = e && e.getStyles && e.getStyles() || "", l = e && e.getDesignerClass && e.getDesignerClass() || "", d = F();
437
- function f() {
438
- return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : e && e.checkCanMoveComponent ? e.checkCanMoveComponent() : !0;
454
+ function Xe(e, t, n) {
455
+ var P;
456
+ const a = n && n.getStyles && n.getStyles() || "", o = n && n.getDesignerClass && n.getDesignerClass() || "", l = w();
457
+ function u() {
458
+ return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : n && n.checkCanMoveComponent ? n.checkCanMoveComponent() : !0;
439
459
  }
440
- function p() {
460
+ function c() {
441
461
  return !1;
442
462
  }
443
- function a() {
444
- return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : e && e.checkCanDeleteComponent ? e.checkCanDeleteComponent() : !0;
463
+ function p() {
464
+ return (t == null ? void 0 : t.schema.componentType) === "frame" ? !1 : n && n.checkCanDeleteComponent ? n.checkCanDeleteComponent() : !0;
445
465
  }
446
- function s() {
447
- return (t == null ? void 0 : t.schema.componentType) === "frame" ? !0 : e && e.hideNestedPaddingInDesginerView ? e.hideNestedPaddingInDesginerView() : !1;
466
+ function r() {
467
+ return (t == null ? void 0 : t.schema.componentType) === "frame" ? !0 : n && n.hideNestedPaddingInDesginerView ? n.hideNestedPaddingInDesginerView() : !1;
448
468
  }
449
- function n(v) {
450
- if (!v || !v.value)
469
+ function d(C) {
470
+ if (!C || !C.value)
451
471
  return null;
452
- if (v.value.schema && v.value.schema.type === "component")
453
- return v.value;
454
- const S = F(v == null ? void 0 : v.value.parent), w = n(S);
455
- return w || null;
472
+ if (C.value.schema && C.value.schema.type === "component")
473
+ return C.value;
474
+ const E = w(C == null ? void 0 : C.value.parent), S = d(E);
475
+ return S || null;
456
476
  }
457
- function c(v = t) {
458
- const { componentInstance: S, designerItemElementRef: w } = v;
459
- return !S || !S.value ? null : S.value.canMove ? w : c(v.parent);
477
+ function i(C = t) {
478
+ const { componentInstance: E, designerItemElementRef: S } = C;
479
+ return !E || !E.value ? null : E.value.canMove ? S : i(C.parent);
460
480
  }
461
- function y(v) {
462
- return !!e && e.canAccepts(v);
481
+ function s(C) {
482
+ return !!n && n.canAccepts(C);
463
483
  }
464
- function u() {
484
+ function f() {
465
485
  return (t == null ? void 0 : t.schema.label) || (t == null ? void 0 : t.schema.title) || (t == null ? void 0 : t.schema.name);
466
486
  }
467
- function h() {
487
+ function m() {
468
488
  }
469
- function b(v, S) {
470
- S && e != null && e.onAcceptMovedChildElement && e.onAcceptMovedChildElement(S);
489
+ function y(C, E) {
490
+ E && n != null && n.onAcceptMovedChildElement && n.onAcceptMovedChildElement(E);
471
491
  }
472
- function C(v, S) {
473
- const { componentType: w } = v;
474
- let T = J(w, v, S);
475
- e && e.onResolveNewComponentSchema && (T = e.onResolveNewComponentSchema(v, T));
476
- const A = w.toLowerCase().replace("-", "_");
477
- return T && !T.id && T.type === w && (T.id = `${A}_${Math.random().toString().slice(2, 6)}`), T;
492
+ function F(C, E) {
493
+ const { componentType: S } = C;
494
+ let M = te(S, C, E);
495
+ n && n.onResolveNewComponentSchema && (M = n.onResolveNewComponentSchema(C, M));
496
+ const v = S.toLowerCase().replace(/-/g, "_");
497
+ return M && !M.id && M.type === S && (M.id = `${v}_${Math.random().toString().slice(2, 6)}`), M;
478
498
  }
479
- function k(v) {
499
+ function k(C) {
480
500
  }
481
- function E(...v) {
482
- if (e && e.getPropsConfig)
483
- return e.getPropsConfig(...v);
501
+ function h(...C) {
502
+ if (n && n.getPropsConfig)
503
+ return n.getPropsConfig(...C);
504
+ }
505
+ function B() {
506
+ n && n.onRemoveComponent && n.onRemoveComponent(), t != null && t.schema.contents && t.schema.contents.map((C) => {
507
+ var M;
508
+ let E = C.id;
509
+ C.type === "component-ref" && (E = C.component);
510
+ const S = e.value.querySelector(`#${E}-design-item`);
511
+ (M = S == null ? void 0 : S.componentInstance) != null && M.value.onRemoveComponent && S.componentInstance.value.onRemoveComponent();
512
+ });
484
513
  }
485
- return d.value = {
486
- canMove: f(),
487
- canSelectParent: p(),
488
- canDelete: a(),
489
- canNested: !s(),
514
+ return l.value = {
515
+ canMove: u(),
516
+ canSelectParent: c(),
517
+ canDelete: p(),
518
+ canNested: !r(),
490
519
  contents: t == null ? void 0 : t.schema.contents,
491
- elementRef: i,
492
- parent: (D = t == null ? void 0 : t.parent) == null ? void 0 : D.componentInstance,
520
+ elementRef: e,
521
+ parent: (P = t == null ? void 0 : t.parent) == null ? void 0 : P.componentInstance,
493
522
  schema: t == null ? void 0 : t.schema,
494
- styles: r,
495
- designerClass: l,
496
- canAccepts: y,
497
- getBelongedComponentInstance: n,
498
- getDraggableDesignItemElement: c,
499
- getDraggingDisplayText: u,
500
- getPropConfig: E,
501
- getDragScopeElement: h,
502
- onAcceptMovedChildElement: b,
523
+ styles: a,
524
+ designerClass: o,
525
+ canAccepts: s,
526
+ getBelongedComponentInstance: d,
527
+ getDraggableDesignItemElement: i,
528
+ getDraggingDisplayText: f,
529
+ getPropConfig: h,
530
+ getDragScopeElement: m,
531
+ onAcceptMovedChildElement: y,
503
532
  onChildElementMovedOut: k,
504
- addNewChildComponentSchema: C,
505
- updateDragAndDropRules: o,
506
- triggerBelongedComponentToMoveWhenMoved: !!e && e.triggerBelongedComponentToMoveWhenMoved || F(!1),
507
- triggerBelongedComponentToDeleteWhenDeleted: !!e && e.triggerBelongedComponentToDeleteWhenDeleted || F(!1)
508
- }, d;
533
+ addNewChildComponentSchema: F,
534
+ triggerBelongedComponentToMoveWhenMoved: !!n && n.triggerBelongedComponentToMoveWhenMoved || w(!1),
535
+ triggerBelongedComponentToDeleteWhenDeleted: !!n && n.triggerBelongedComponentToDeleteWhenDeleted || w(!1),
536
+ onRemoveComponent: B
537
+ }, l;
509
538
  }
510
- class Se {
511
- constructor(t, e) {
512
- g(this, "componentId");
513
- g(this, "viewModelId");
514
- g(this, "eventsEditorUtils");
515
- g(this, "formSchemaUtils");
516
- g(this, "formMetadataConverter");
517
- g(this, "designViewModelUtils");
518
- g(this, "designViewModelField");
519
- g(this, "controlCreatorUtils");
520
- g(this, "designerHostService");
521
- g(this, "schemaService", null);
522
- g(this, "metadataService", null);
523
- g(this, "propertyConfig", {
539
+ class He {
540
+ constructor(t, n) {
541
+ T(this, "componentId");
542
+ T(this, "viewModelId");
543
+ T(this, "eventsEditorUtils");
544
+ T(this, "formSchemaUtils");
545
+ T(this, "formMetadataConverter");
546
+ T(this, "designViewModelUtils");
547
+ T(this, "designViewModelField");
548
+ T(this, "controlCreatorUtils");
549
+ T(this, "designerHostService");
550
+ T(this, "schemaService", null);
551
+ T(this, "metadataService", null);
552
+ T(this, "propertyConfig", {
524
553
  type: "object",
525
554
  categories: {}
526
555
  });
527
- var o;
528
- 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;
556
+ var a;
557
+ this.componentId = t, this.designerHostService = n, this.eventsEditorUtils = n.eventsEditorUtils, this.formSchemaUtils = n.formSchemaUtils, this.formMetadataConverter = n.formMetadataConverter, this.viewModelId = ((a = this.formSchemaUtils) == null ? void 0 : a.getViewModelIdByComponentId(t)) || "", this.designViewModelUtils = n.designViewModelUtils, this.controlCreatorUtils = n.controlCreatorUtils, this.metadataService = n.metadataService, this.schemaService = n.schemaService;
529
558
  }
530
559
  getTableInfo() {
531
560
  var t;
532
561
  return (t = this.schemaService) == null ? void 0 : t.getTableInfoByViewModelId(this.viewModelId);
533
562
  }
534
563
  setDesignViewModelField(t) {
535
- const e = t.binding && t.binding.type === "Form" && t.binding.field;
536
- if (e) {
564
+ var a;
565
+ const n = t.binding && t.binding.type === "Form" && t.binding.field;
566
+ if (n) {
537
567
  if (!this.designViewModelField) {
538
568
  const o = this.designViewModelUtils.getDgViewModel(this.viewModelId);
539
- this.designViewModelField = o.fields.find((r) => r.id === e);
569
+ this.designViewModelField = o.fields.find((l) => l.id === n);
540
570
  }
541
- t.updateOn = this.designViewModelField.updateOn;
571
+ t.updateOn = (a = this.designViewModelField) == null ? void 0 : a.updateOn;
542
572
  }
543
573
  }
544
- changeFieldEditorType(t, e) {
574
+ changeFieldEditorType(t, n) {
545
575
  }
546
576
  getBasicPropConfig(t) {
547
577
  return {
@@ -562,7 +592,7 @@ class Se {
562
592
  type: "combo-list",
563
593
  textField: "name",
564
594
  valueField: "value",
565
- data: [{ value: t.type, name: m[t.type].name }]
595
+ data: [{ value: t.type, name: b[t.type].name }]
566
596
  }
567
597
  }
568
598
  }
@@ -594,30 +624,30 @@ class Se {
594
624
  * @param componentInstance
595
625
  * @returns
596
626
  */
597
- updateElementByParentContainer(t, e) {
598
- const o = e && e.parent && e.parent.schema;
599
- if (!o)
627
+ updateElementByParentContainer(t, n) {
628
+ const a = n && n.parent && n.parent.schema;
629
+ if (!a)
600
630
  return;
601
- const r = o.contents.findIndex((d) => d.id === t), l = q(o.contents[r]);
602
- o.contents.splice(r, 1), o.contents.splice(r, 0, l);
631
+ const o = a.contents.findIndex((u) => u.id === t), l = U(a.contents[o]);
632
+ a.contents.splice(o, 1), a.contents.splice(o, 0, l);
603
633
  }
604
634
  }
605
- const P = class P {
635
+ const O = class O {
606
636
  /**
607
637
  * 根据绑定字段类型获取可用的输入类控件
608
638
  */
609
639
  static getEditorTypesByMDataType(t) {
610
- const e = P.fieldControlTypeMapping[t];
611
- return e || [{ key: "", value: "" }];
640
+ const n = O.fieldControlTypeMapping[t];
641
+ return n || [{ key: "", value: "" }];
612
642
  }
613
643
  /**
614
644
  * 获取所有输入类控件
615
645
  */
616
646
  static getAllInputTypes() {
617
647
  const t = [];
618
- for (let e in P.fieldControlTypeMapping)
619
- P.fieldControlTypeMapping[e].forEach((o) => {
620
- t.find((r) => r.key === o.key && r.value === o.value) || t.push({ key: o.key, value: o.value });
648
+ for (const n in O.fieldControlTypeMapping)
649
+ O.fieldControlTypeMapping[n].forEach((a) => {
650
+ t.find((o) => o.key === a.key && o.value === a.value) || t.push({ key: a.key, value: a.value });
621
651
  });
622
652
  return t;
623
653
  }
@@ -625,176 +655,174 @@ const P = class P {
625
655
  /**
626
656
  * <字段类型,可配置的控件类型列表>的映射
627
657
  */
628
- g(P, "fieldControlTypeMapping", {
658
+ T(O, "fieldControlTypeMapping", {
629
659
  String: [
630
- { key: m["input-group"].type, value: m["input-group"].name },
631
- { key: m.lookup.type, value: m.lookup.name },
632
- { key: m["date-picker"].type, value: m["date-picker"].name },
633
- { key: m["check-box"].type, value: m["check-box"].name },
634
- { key: m["check-group"].type, value: m["check-group"].name },
635
- { key: m["radio-group"].type, value: m["radio-group"].name },
636
- { key: m["combo-list"].type, value: m["combo-list"].name },
637
- { key: m.textarea.type, value: m.textarea.name }
660
+ { key: b["input-group"].type, value: b["input-group"].name },
661
+ { key: b.lookup.type, value: b.lookup.name },
662
+ { key: b["date-picker"].type, value: b["date-picker"].name },
663
+ { key: b["check-box"].type, value: b["check-box"].name },
664
+ { key: b["check-group"].type, value: b["check-group"].name },
665
+ { key: b["radio-group"].type, value: b["radio-group"].name },
666
+ { key: b["combo-list"].type, value: b["combo-list"].name },
667
+ { key: b.textarea.type, value: b.textarea.name }
638
668
  ],
639
669
  Text: [
640
- { key: m.textarea.type, value: m.textarea.name },
641
- { key: m.lookup.type, value: m.lookup.name }
670
+ { key: b.textarea.type, value: b.textarea.name },
671
+ { key: b.lookup.type, value: b.lookup.name }
642
672
  ],
643
673
  Decimal: [
644
- { key: m["number-spinner"].type, value: m["number-spinner"].name }
674
+ { key: b["number-spinner"].type, value: b["number-spinner"].name }
645
675
  ],
646
676
  Integer: [
647
- { key: m["number-spinner"].type, value: m["number-spinner"].name }
677
+ { key: b["number-spinner"].type, value: b["number-spinner"].name }
648
678
  ],
649
679
  Number: [
650
- { key: m["number-spinner"].type, value: m["number-spinner"].name }
680
+ { key: b["number-spinner"].type, value: b["number-spinner"].name }
651
681
  ],
652
682
  BigNumber: [
653
- { key: m["number-spinner"].type, value: m["number-spinner"].name }
683
+ { key: b["number-spinner"].type, value: b["number-spinner"].name }
654
684
  ],
655
685
  Date: [
656
- { key: m["date-picker"].type, value: m["date-picker"].name }
686
+ { key: b["date-picker"].type, value: b["date-picker"].name }
657
687
  ],
658
688
  DateTime: [
659
- { key: m["date-picker"].type, value: m["date-picker"].name }
689
+ { key: b["date-picker"].type, value: b["date-picker"].name }
660
690
  ],
661
691
  Boolean: [
662
- { key: m.switch.type, value: m.switch.name },
663
- { key: m["check-box"].type, value: m["check-box"].name }
692
+ { key: b.switch.type, value: b.switch.name },
693
+ { key: b["check-box"].type, value: b["check-box"].name }
664
694
  ],
665
695
  Enum: [
666
- { key: m["combo-list"].type, value: m["combo-list"].name },
667
- { key: m["radio-group"].type, value: m["radio-group"].name }
696
+ { key: b["combo-list"].type, value: b["combo-list"].name },
697
+ { key: b["radio-group"].type, value: b["radio-group"].name }
668
698
  ],
669
699
  Object: [
670
- { key: m.lookup.type, value: m.lookup.name },
671
- { key: m["combo-list"].type, value: m["combo-list"].name },
672
- { key: m["radio-group"].type, value: m["radio-group"].name }
700
+ { key: b.lookup.type, value: b.lookup.name },
701
+ { key: b["combo-list"].type, value: b["combo-list"].name },
702
+ { key: b["radio-group"].type, value: b["radio-group"].name }
673
703
  ]
674
704
  });
675
- let B = P;
676
- const Fe = F(0);
677
- class we {
705
+ let q = O;
706
+ const _e = w(0);
707
+ class Ke {
678
708
  constructor() {
679
709
  /** 控件标题 */
680
- g(this, "label", "");
710
+ T(this, "label", "");
681
711
  /** 控件id */
682
- g(this, "id", "");
712
+ T(this, "id", "");
683
713
  /** 每个控件占用的栅格数 */
684
- g(this, "columnInSM", 12);
685
- g(this, "columnInMD", 6);
686
- g(this, "columnInLG", 3);
687
- g(this, "columnInEL", 2);
714
+ T(this, "columnInSM", 12);
715
+ T(this, "columnInMD", 6);
716
+ T(this, "columnInLG", 3);
717
+ T(this, "columnInEL", 2);
688
718
  /** 每个控件占用的列数 */
689
- g(this, "displayWidthInSM", 1);
690
- g(this, "displayWidthInMD", 1);
691
- g(this, "displayWidthInLG", 1);
692
- g(this, "displayWidthInEL", 1);
719
+ T(this, "displayWidthInSM", 1);
720
+ T(this, "displayWidthInMD", 1);
721
+ T(this, "displayWidthInLG", 1);
722
+ T(this, "displayWidthInEL", 1);
693
723
  /** 编辑器内部默认显示的屏幕大小-----可以去掉 */
694
- g(this, "displayColumnCountAtBreakPoint", "md");
724
+ T(this, "displayColumnCountAtBreakPoint", "md");
695
725
  /** 控件所在行,传0即可-----编辑器内部使用 */
696
- g(this, "tagRow", 0);
726
+ T(this, "tagRow", 0);
697
727
  /** 控件是否显示上方空白:传0即可-----编辑器内部使用 */
698
- g(this, "showTopBorder", 0);
728
+ T(this, "showTopBorder", 0);
699
729
  /** 区域,从1开始。卡片内的控件从上往下,从左往右划分区域,遇到分组fieldSet时group+1,分组结束后group+1 */
700
- g(this, "group", 1);
730
+ T(this, "group", 1);
701
731
  /** 控件是否符合标准的class配置(设计器用的) */
702
- g(this, "isSupportedClass", !0);
732
+ T(this, "isSupportedClass", !0);
703
733
  /** 控件所在分组id(设计器用的) */
704
- g(this, "fieldSetId", "");
734
+ T(this, "fieldSetId", "");
705
735
  }
706
736
  }
707
- function Te(i) {
708
- let t, e;
709
- const o = /* @__PURE__ */ new Map();
710
- let r = [];
711
- function l(s, n) {
712
- const y = s.split(" ").filter((k) => k.startsWith("col-"));
713
- if (y.length === 0) {
714
- n.isSupportedClass = !1;
737
+ function Qe(e) {
738
+ let t, n;
739
+ const a = /* @__PURE__ */ new Map();
740
+ let o = [];
741
+ function l(d, i) {
742
+ const f = d.split(" ").filter((h) => h.startsWith("col-"));
743
+ if (f.length === 0) {
744
+ i.isSupportedClass = !1;
715
745
  return;
716
746
  }
717
- let u = y.find((k) => /^col-([1-9]|10|11|12)$/.test(k)), h = y.find((k) => /^col-md-([1-9]|10|11|12)$/.test(k)), b = y.find((k) => /^col-xl-([1-9]|10|11|12)$/.test(k)), C = y.find((k) => /^col-el-([1-9]|10|11|12)$/.test(k));
718
- u = u || "col-12", n.columnInSM = parseInt(u.replace("col-", ""), 10), n.displayWidthInSM = n.columnInSM / 12, n.displayWidthInSM !== 1 && (n.isSupportedClass = !1), h = h || "col-md-" + n.columnInSM, n.columnInMD = parseInt(h.replace("col-md-", ""), 10), n.displayWidthInMD = n.columnInMD / 6, [1, 2].includes(n.displayWidthInMD) || (n.isSupportedClass = !1), b = b || "col-xl-" + n.columnInMD, n.columnInLG = parseInt(b.replace("col-xl-", ""), 10), n.displayWidthInLG = n.columnInLG / 3, [1, 2, 3, 4].includes(n.displayWidthInLG) || (n.isSupportedClass = !1), C = C || "col-el-" + n.columnInLG, n.columnInEL = parseInt(C.replace("col-el-", ""), 10), n.displayWidthInEL = n.columnInEL / 2, [1, 2, 3, 4, 5, 6].includes(n.displayWidthInEL) || (n.isSupportedClass = !1);
719
- }
720
- function d(s, n, c, y = !1) {
721
- let u = !1;
722
- s.contents.forEach((h) => {
723
- if (h.type === "fieldset") {
724
- c += 1, d(h, n, c, !0), u = !0;
747
+ let m = f.find((h) => /^col-([1-9]|10|11|12)$/.test(h)), y = f.find((h) => /^col-md-([1-9]|10|11|12)$/.test(h)), F = f.find((h) => /^col-xl-([1-9]|10|11|12)$/.test(h)), k = f.find((h) => /^col-el-([1-9]|10|11|12)$/.test(h));
748
+ m = m || "col-12", i.columnInSM = parseInt(m.replace("col-", ""), 10), i.displayWidthInSM = i.columnInSM / 12, i.displayWidthInSM !== 1 && (i.isSupportedClass = !1), y = y || "col-md-" + i.columnInSM, i.columnInMD = parseInt(y.replace("col-md-", ""), 10), i.displayWidthInMD = i.columnInMD / 6, [1, 2].includes(i.displayWidthInMD) || (i.isSupportedClass = !1), F = F || "col-xl-" + i.columnInMD, i.columnInLG = parseInt(F.replace("col-xl-", ""), 10), i.displayWidthInLG = i.columnInLG / 3, [1, 2, 3, 4].includes(i.displayWidthInLG) || (i.isSupportedClass = !1), k = k || "col-el-" + i.columnInLG, i.columnInEL = parseInt(k.replace("col-el-", ""), 10), i.displayWidthInEL = i.columnInEL / 2, [1, 2, 3, 4, 5, 6].includes(i.displayWidthInEL) || (i.isSupportedClass = !1);
749
+ }
750
+ function u(d, i, s, f = !1) {
751
+ let m = !1;
752
+ d.contents.forEach((y) => {
753
+ if (y.type === "fieldset") {
754
+ s += 1, u(y, i, s, !0), m = !0;
725
755
  return;
726
756
  }
727
- u && (c += 1, u = !1);
728
- const b = h.appearance && h.appearance.class, C = new we();
729
- b ? l(b, C) : C.isSupportedClass = !1, C.label = h.label || h.id, C.id = h.id, C.group = c, y && (C.fieldSetId = s.id), e === h.id && (t = c), o.set(h.id, h), n.push(C);
757
+ m && (s += 1, m = !1);
758
+ const F = y.appearance && y.appearance.class, k = new Ke();
759
+ F ? l(F, k) : k.isSupportedClass = !1, k.label = y.label || y.id, k.id = y.id, k.group = s, f && (k.fieldSetId = d.id), n === y.id && (t = s), a.set(y.id, y), i.push(k);
730
760
  });
731
761
  }
732
- function f(s) {
733
- const n = i.getComponentById(s);
734
- if (!n || !n.componentType || !n.componentType.startsWith("form"))
762
+ function c(d) {
763
+ const i = e.getComponentById(d);
764
+ if (!i || !i.componentType || !i.componentType.startsWith("form"))
735
765
  return { result: !1, message: "只可以在响应式表单组件中调整响应式布局配置" };
736
- const c = i.selectNode(n, (y) => y.type === W["response-form"].type);
737
- return !c || !c.contents || c.contents.length === 0 ? { result: !1, message: "Form区域内没有控件,请先添加控件" } : { result: !0, message: "", formNode: c };
738
- }
739
- function p(s, n) {
740
- n = n || s.id;
741
- const { result: c, message: y, formNode: u } = f(n);
742
- if (!c)
743
- return { result: c, message: y };
744
- e = s.id, r = [], o.clear();
745
- const h = u.contents[0].type === W.fieldset.type ? 0 : 1;
746
- d(u, r, h);
747
- const b = r.find((k) => !k.isSupportedClass);
766
+ const s = e.selectNode(i, (f) => f.type === _["response-form"].type);
767
+ return !s || !s.contents || s.contents.length === 0 ? { result: !1, message: "Form区域内没有控件,请先添加控件" } : { result: !0, message: "", formNode: s };
768
+ }
769
+ function p(d, i) {
770
+ i = i || d.id;
771
+ const { result: s, message: f, formNode: m } = c(i);
772
+ if (!s)
773
+ return { result: s, message: f };
774
+ n = d.id, o = [], a.clear();
775
+ const y = m.contents[0].type === _.fieldset.type ? 0 : 1;
776
+ u(m, o, y);
777
+ const F = o.find((h) => !h.isSupportedClass);
748
778
  return {
749
779
  defaultState: {
750
780
  defaultGroupNumber: t || 1,
751
- model: b ? "customize" : "standard"
781
+ model: F ? "customize" : "standard"
752
782
  },
753
- importData: r
783
+ importData: o
754
784
  };
755
785
  }
756
- function a(s, n) {
757
- n = n;
758
- const { result: c, formNode: y } = f(n);
759
- if (!c)
786
+ function r(d, i) {
787
+ i = i;
788
+ const { result: s, formNode: f } = c(i);
789
+ if (!s)
760
790
  return "";
761
- const u = [];
762
- return s.forEach((h) => {
763
- var k;
764
- const b = o.get(h.id), C = b.appearance && b.appearance.class;
765
- if (C) {
766
- const D = C.split(" ").filter((Z) => !Z.startsWith("col-")), v = "col-" + h.columnInSM, S = "col-md-" + h.columnInMD, w = "col-xl-" + h.columnInLG, T = "col-el-" + h.columnInEL, A = [v, S, w, T].concat(D);
767
- b.appearance.class = A.join(" ");
791
+ const m = [];
792
+ return d.forEach((y) => {
793
+ var h;
794
+ const F = a.get(y.id), k = F.appearance && F.appearance.class;
795
+ if (k) {
796
+ const P = k.split(" ").filter((x) => !x.startsWith("col-")), C = "col-" + y.columnInSM, E = "col-md-" + y.columnInMD, S = "col-xl-" + y.columnInLG, M = "col-el-" + y.columnInEL, v = [C, E, S, M].concat(P);
797
+ F.appearance.class = v.join(" ");
768
798
  }
769
- if (h.fieldSetId) {
770
- const E = y.contents.find((v) => v.id === h.fieldSetId), D = u.find((v) => v.id === h.fieldSetId);
771
- D ? (k = D.contents) == null || k.push(b) : (u.push(E), E.contents = [b]);
799
+ if (y.fieldSetId) {
800
+ const B = f.contents.find((C) => C.id === y.fieldSetId), P = m.find((C) => C.id === y.fieldSetId);
801
+ P ? (h = P.contents) == null || h.push(F) : (m.push(B), B.contents = [F]);
772
802
  } else
773
- u.push(b);
774
- }), y.contents = u, y.id;
803
+ m.push(F);
804
+ }), f.contents = m, f.id;
775
805
  }
776
806
  return {
777
- checkCanFindFormNode: f,
807
+ checkCanFindFormNode: c,
778
808
  checkCanOpenLayoutEditor: p,
779
- changeFormControlsByResponseLayoutConfig: a,
780
- getResonseFormLayoutConfig: d
809
+ changeFormControlsByResponseLayoutConfig: r,
810
+ getResonseFormLayoutConfig: u
781
811
  };
782
812
  }
783
- class Ee extends Se {
784
- constructor(e, o) {
785
- super(e, o);
786
- g(this, "responseLayoutEditorFunction");
787
- this.responseLayoutEditorFunction = Te(this.formSchemaUtils);
788
- }
789
- getPropertyConfig(e, o) {
790
- 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;
791
- }
792
- getBasicProperties(e, o) {
793
- var f;
794
- var r = this;
795
- this.setDesignViewModelField(e);
796
- const l = this.formSchemaUtils.getFormMetadataBasicInfo(), d = this.designViewModelUtils.getAllFields2TreeByVMId(this.viewModelId);
797
- return {
813
+ class Je extends He {
814
+ constructor(n, a) {
815
+ super(n, a);
816
+ T(this, "responseLayoutEditorFunction");
817
+ this.responseLayoutEditorFunction = Qe(this.formSchemaUtils);
818
+ }
819
+ getPropertyConfig(n, a) {
820
+ return this.propertyConfig.categories.basic = this.getBasicProperties(n, a), this.propertyConfig.categories.appearance = this.getAppearanceProperties(n, a), this.propertyConfig.categories.editor = this.getEditorProperties(n), this.propertyConfig;
821
+ }
822
+ getBasicProperties(n, a) {
823
+ var l;
824
+ const o = this;
825
+ return this.setDesignViewModelField(n), this.formSchemaUtils.getFormMetadataBasicInfo(), {
798
826
  description: "Basic Information",
799
827
  title: "基本信息",
800
828
  properties: {
@@ -815,7 +843,7 @@ class Ee extends Se {
815
843
  textField: "value",
816
844
  valueField: "key",
817
845
  editable: !1,
818
- data: r.designViewModelField ? B.getEditorTypesByMDataType((f = r.designViewModelField.type) == null ? void 0 : f.name) : B.getAllInputTypes()
846
+ data: o.designViewModelField ? q.getEditorTypesByMDataType((l = o.designViewModelField.type) == null ? void 0 : l.name) : q.getAllInputTypes()
819
847
  }
820
848
  },
821
849
  label: {
@@ -826,41 +854,37 @@ class Ee extends Se {
826
854
  binding: {
827
855
  description: "绑定的表单字段",
828
856
  title: "绑定",
829
- $converter: "/converter/field-selector.converter",
830
857
  editor: {
831
- type: "field-selector",
858
+ type: "binding-selector",
832
859
  bindingType: { enable: !1 },
833
860
  editorParams: {
834
- propertyData: e,
835
- formBasicInfo: l
861
+ componentSchema: n,
862
+ needSyncToViewModel: !0,
863
+ viewModelId: this.viewModelId,
864
+ designerHostService: this.designerHostService,
865
+ disableOccupiedFields: !0
836
866
  },
837
- columns: [
838
- { field: "name", title: "字段名称" },
839
- { field: "bindingField", title: "绑定字段" },
840
- { field: "fieldType", title: "字段类型" }
841
- ],
842
- textField: "bindingField",
843
- data: d
867
+ textField: "bindingField"
844
868
  }
845
869
  }
846
870
  },
847
- setPropertyRelates(p, a) {
848
- if (p)
849
- switch (p && p.propertyID) {
871
+ setPropertyRelates(u, c) {
872
+ if (u)
873
+ switch (u && u.propertyID) {
850
874
  case "type": {
851
- r.changeControlType(e, p, o);
875
+ o.changeControlType(n, u, a);
852
876
  break;
853
877
  }
854
878
  case "label": {
855
- p.needRefreshControlTree = !0;
879
+ u.needRefreshControlTree = !0;
856
880
  break;
857
881
  }
858
882
  }
859
883
  }
860
884
  };
861
885
  }
862
- getAppearanceProperties(e, o) {
863
- var r = this;
886
+ getAppearanceProperties(n, a) {
887
+ const o = this;
864
888
  return {
865
889
  title: "样式",
866
890
  description: "Appearance",
@@ -886,38 +910,38 @@ class Ee extends Se {
886
910
  refreshPanelAfterChanged: !0,
887
911
  editor: {
888
912
  type: "response-layout-editor-setting",
889
- initialState: r.responseLayoutEditorFunction.checkCanOpenLayoutEditor(e, r.componentId)
913
+ initialState: o.responseLayoutEditorFunction.checkCanOpenLayoutEditor(n, o.componentId)
890
914
  }
891
915
  }
892
916
  },
893
- setPropertyRelates(l, d) {
917
+ setPropertyRelates(l, u) {
894
918
  if (l)
895
919
  switch (l && l.propertyID) {
896
920
  case "responseLayout":
897
- r.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(l.propertyValue, r.componentId || e.id), r.updateUnifiedLayoutAfterResponseLayoutChanged(r.componentId), r.updateElementByParentContainer(e.id, o), delete e.responseLayout;
921
+ o.responseLayoutEditorFunction.changeFormControlsByResponseLayoutConfig(l.propertyValue, o.componentId || n.id), o.updateUnifiedLayoutAfterResponseLayoutChanged(o.componentId), o.updateElementByParentContainer(n.id, a), delete n.responseLayout;
898
922
  break;
899
923
  case "class":
900
- r.updateUnifiedLayoutAfterControlChanged(l.propertyValue, e.id, this.componentId), r.updateElementByParentContainer(e.id, o);
924
+ o.updateUnifiedLayoutAfterControlChanged(l.propertyValue, n.id, this.componentId), o.updateElementByParentContainer(n.id, a);
901
925
  break;
902
926
  }
903
927
  }
904
928
  };
905
929
  }
906
- getEditorProperties(e) {
907
- return this.getComponentConfig(e);
930
+ getEditorProperties(n) {
931
+ return this.getComponentConfig(n);
908
932
  }
909
933
  /**
910
934
  * 卡片控件:切换控件类型后事件
911
935
  * @param propertyData 控件DOM属性
912
936
  * @param newControlType 新控件类型
913
937
  */
914
- changeControlType(e, o, r) {
915
- var s, n, c, y;
916
- const l = o.propertyValue, d = r && r.parent && r.parent.schema;
917
- if (!d)
938
+ changeControlType(n, a, o) {
939
+ var d, i, s, f;
940
+ const l = a.propertyValue, u = o && o.parent && o.parent.schema;
941
+ if (!u)
918
942
  return;
919
- const f = d.contents.findIndex((u) => u.id === e.id), p = d.contents[f];
920
- let a;
943
+ const c = u.contents.findIndex((m) => m.id === n.id), p = u.contents[c];
944
+ let r;
921
945
  this.designViewModelField && (this.designViewModelUtils.getDgViewModel(this.viewModelId).changeField(this.designViewModelField.id, {
922
946
  editor: {
923
947
  $type: l
@@ -925,30 +949,30 @@ class Ee extends Se {
925
949
  name: this.designViewModelField.name,
926
950
  require: this.designViewModelField.require,
927
951
  readonly: this.designViewModelField.readonly
928
- }, !1), a = this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField, l)), a || (a = this.controlCreatorUtils.createFormGroupWithoutField(l)), Object.assign(a, {
952
+ }, !1), r = this.controlCreatorUtils.setFormFieldProperty(this.designViewModelField, l)), r || (r = this.controlCreatorUtils.createFormGroupWithoutField(l)), Object.assign(r, {
929
953
  id: p.id,
930
954
  appearance: p.appearance,
931
955
  size: p.size,
932
956
  label: p.label,
933
957
  binding: p.binding,
934
958
  visible: p.visible
935
- }), Object.assign(a.editor, {
936
- isTextArea: a.isTextArea && p.isTextArea,
937
- placeholder: (s = p.editor) == null ? void 0 : s.placeholder,
938
- holdPlace: (n = p.editor) == null ? void 0 : n.holdPlace,
939
- readonly: (c = p.editor) == null ? void 0 : c.readonly,
940
- require: (y = p.editor) == null ? void 0 : y.require
941
- }), d.contents.splice(f, 1), d.contents.splice(f, 0, a), r.schema = Object.assign(p, a), Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(
942
- (u) => u.classList.remove("dgComponentSelected")
943
- ), Fe.value++;
944
- }
945
- getComponentConfig(e, o = {}, r = {}) {
959
+ }), Object.assign(r.editor, {
960
+ isTextArea: r.isTextArea && p.isTextArea,
961
+ placeholder: (d = p.editor) == null ? void 0 : d.placeholder,
962
+ holdPlace: (i = p.editor) == null ? void 0 : i.holdPlace,
963
+ readonly: (s = p.editor) == null ? void 0 : s.readonly,
964
+ require: (f = p.editor) == null ? void 0 : f.require
965
+ }), u.contents.splice(c, 1), u.contents.splice(c, 0, r), o.schema = Object.assign(p, r), Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(
966
+ (m) => m.classList.remove("dgComponentSelected")
967
+ ), _e.value++;
968
+ }
969
+ getComponentConfig(n, a = {}, o = {}) {
946
970
  const l = Object.assign({
947
971
  description: "编辑器",
948
972
  title: "编辑器",
949
973
  type: "input-group",
950
974
  $converter: "/converter/property-editor.converter"
951
- }, o), d = Object.assign({
975
+ }, a), u = Object.assign({
952
976
  readonly: {
953
977
  description: "",
954
978
  title: "只读",
@@ -969,8 +993,8 @@ class Ee extends Se {
969
993
  title: "提示文本",
970
994
  type: "string"
971
995
  }
972
- }, r);
973
- return { ...l, properties: { ...d } };
996
+ }, o);
997
+ return { ...l, properties: { ...u } };
974
998
  }
975
999
  /**
976
1000
  * 修改某一输入控件的样式后更新Form的统一布局配置
@@ -978,56 +1002,56 @@ class Ee extends Se {
978
1002
  * @param controlId 控件Id
979
1003
  * @param componentId 控件所在组件id
980
1004
  */
981
- updateUnifiedLayoutAfterControlChanged(e, o, r) {
982
- const l = e.split(" ");
983
- let d = l.find((n) => /^col-([1-9]|10|11|12)$/.test(n)), f = l.find((n) => /^col-md-([1-9]|10|11|12)$/.test(n)), p = l.find((n) => /^col-xl-([1-9]|10|11|12)$/.test(n)), a = l.find((n) => /^col-el-([1-9]|10|11|12)$/.test(n));
984
- d = d || "col-12", f = f || "col-md-" + d.replace("col-", ""), p = p || "col-xl-" + f.replace("col-md-", ""), a = a || "col-el-" + p.replace("col-xl-", "");
985
- const s = {
986
- id: o,
987
- columnInSM: parseInt(d.replace("col-", ""), 10),
988
- columnInMD: parseInt(f.replace("col-md-", ""), 10),
1005
+ updateUnifiedLayoutAfterControlChanged(n, a, o) {
1006
+ const l = n.split(" ");
1007
+ let u = l.find((i) => /^col-([1-9]|10|11|12)$/.test(i)), c = l.find((i) => /^col-md-([1-9]|10|11|12)$/.test(i)), p = l.find((i) => /^col-xl-([1-9]|10|11|12)$/.test(i)), r = l.find((i) => /^col-el-([1-9]|10|11|12)$/.test(i));
1008
+ u = u || "col-12", c = c || "col-md-" + u.replace("col-", ""), p = p || "col-xl-" + c.replace("col-md-", ""), r = r || "col-el-" + p.replace("col-xl-", "");
1009
+ const d = {
1010
+ id: a,
1011
+ columnInSM: parseInt(u.replace("col-", ""), 10),
1012
+ columnInMD: parseInt(c.replace("col-md-", ""), 10),
989
1013
  columnInLG: parseInt(p.replace("col-xl-", ""), 10),
990
- columnInEL: parseInt(a.replace("col-el-", ""), 10)
1014
+ columnInEL: parseInt(r.replace("col-el-", ""), 10)
991
1015
  };
992
- this.updateUnifiedLayoutAfterResponseLayoutChanged(r, s);
1016
+ this.updateUnifiedLayoutAfterResponseLayoutChanged(o, d);
993
1017
  }
994
1018
  /**
995
1019
  * 修改控件布局配置后更新Form统一布局配置
996
1020
  * @param componentId 组件Id
997
1021
  * @param controlLayoutConfig 某单独变动的控件配置项,FormResponseLayoutContext类型
998
1022
  */
999
- updateUnifiedLayoutAfterResponseLayoutChanged(e, o) {
1000
- const { formNode: r } = this.responseLayoutEditorFunction.checkCanFindFormNode(e);
1001
- if (!r || !r.unifiedLayout)
1023
+ updateUnifiedLayoutAfterResponseLayoutChanged(n, a) {
1024
+ const { formNode: o } = this.responseLayoutEditorFunction.checkCanFindFormNode(n);
1025
+ if (!o || !o.unifiedLayout)
1002
1026
  return;
1003
1027
  const l = [];
1004
- if (this.responseLayoutEditorFunction.getResonseFormLayoutConfig(r, l, 1), o) {
1005
- const u = l.find((h) => h.id === o.id);
1006
- Object.assign(u || {}, o);
1028
+ if (this.responseLayoutEditorFunction.getResonseFormLayoutConfig(o, l, 1), a) {
1029
+ const m = l.find((y) => y.id === a.id);
1030
+ Object.assign(m || {}, a);
1007
1031
  }
1008
- const d = l.map((u) => u.columnInSM), f = l.map((u) => u.columnInMD), p = l.map((u) => u.columnInLG), a = l.map((u) => u.columnInEL), s = this.checkIsUniqueColumn(d) ? d[0] : null, n = this.checkIsUniqueColumn(f) ? f[0] : null, c = this.checkIsUniqueColumn(p) ? p[0] : null, y = this.checkIsUniqueColumn(a) ? a[0] : null;
1009
- Object.assign(r.unifiedLayout, {
1010
- uniqueColClassInSM: s,
1011
- uniqueColClassInMD: n,
1012
- uniqueColClassInLG: c,
1013
- uniqueColClassInEL: y
1032
+ const u = l.map((m) => m.columnInSM), c = l.map((m) => m.columnInMD), p = l.map((m) => m.columnInLG), r = l.map((m) => m.columnInEL), d = this.checkIsUniqueColumn(u) ? u[0] : null, i = this.checkIsUniqueColumn(c) ? c[0] : null, s = this.checkIsUniqueColumn(p) ? p[0] : null, f = this.checkIsUniqueColumn(r) ? r[0] : null;
1033
+ Object.assign(o.unifiedLayout, {
1034
+ uniqueColClassInSM: d,
1035
+ uniqueColClassInMD: i,
1036
+ uniqueColClassInLG: s,
1037
+ uniqueColClassInEL: f
1014
1038
  });
1015
1039
  }
1016
1040
  /**
1017
1041
  * 校验宽度样式值是否一致
1018
1042
  */
1019
- checkIsUniqueColumn(e) {
1020
- const o = new Set(e);
1021
- return Array.from(o).length === 1;
1043
+ checkIsUniqueColumn(n) {
1044
+ const a = new Set(n);
1045
+ return Array.from(a).length === 1;
1022
1046
  }
1023
1047
  }
1024
- class De extends Ee {
1025
- constructor(t, e) {
1026
- super(t, e);
1048
+ class Ye extends Je {
1049
+ constructor(t, n) {
1050
+ super(t, n);
1027
1051
  }
1028
1052
  getEditorProperties(t) {
1029
- return this.getComponentConfig(t, { type: "number-spinner" }, {
1030
- readonly: {
1053
+ const n = this.getComponentConfig(t, { type: "radio-group" }, {
1054
+ disabled: {
1031
1055
  visible: !1
1032
1056
  },
1033
1057
  placeholder: {
@@ -1039,136 +1063,1368 @@ class De extends Ee {
1039
1063
  type: "boolean"
1040
1064
  },
1041
1065
  textField: {
1066
+ visible: !1,
1042
1067
  description: "",
1043
1068
  title: "显示文本字段",
1044
1069
  type: "string"
1045
1070
  },
1046
1071
  valueField: {
1072
+ visible: !1,
1047
1073
  description: "",
1048
1074
  title: "值字段",
1049
1075
  type: "string"
1050
1076
  },
1051
- enumData: {
1052
- visible: !1,
1077
+ data: {
1053
1078
  description: "",
1054
1079
  title: "数据",
1055
- type: "array"
1080
+ type: "array",
1081
+ editor: {
1082
+ columns: [
1083
+ { field: t.editor.valueField, title: "值", dataType: "string" },
1084
+ { field: t.editor.textField, title: "名称", dataType: "string" },
1085
+ { field: "disabled", title: "禁用", visible: !1, dataType: "boolean", editor: { type: "switch" } }
1086
+ ],
1087
+ type: "item-collection-editor",
1088
+ valueField: t.editor.valueField,
1089
+ nameField: t.editor.textField,
1090
+ requiredFields: [t.editor.valueField, t.editor.textField],
1091
+ uniqueFields: [t.editor.valueField, t.editor.textField]
1092
+ },
1093
+ // 这个属性,标记当属性变更得时候触发重新更新属性
1094
+ refreshPanelAfterChanged: !0
1056
1095
  }
1057
1096
  });
1097
+ return n.setPropertyRelates = function(a) {
1098
+ if (a)
1099
+ switch (a.propertyID) {
1100
+ case "data": {
1101
+ a.propertyValue.parameters && (t.editor.valueField = a.propertyValue.parameters.valueField, t.editor.textField = a.propertyValue.parameters.nameField), t.editor.data = a.propertyValue.value;
1102
+ break;
1103
+ }
1104
+ }
1105
+ }, n;
1058
1106
  }
1059
1107
  }
1060
- function Pe(i, t) {
1061
- i.schema;
1062
- const e = F(!0), o = F(!0);
1063
- function r(n) {
1064
- return !1;
1108
+ function Ze(e, t) {
1109
+ const n = e.schema;
1110
+ function a(o, l) {
1111
+ return new Ye(o, t).getPropertyConfig(n, l);
1065
1112
  }
1066
- function l() {
1067
- return !1;
1113
+ return { getPropsConfig: a };
1114
+ }
1115
+ const et = /* @__PURE__ */ V({
1116
+ name: "FRadioGroupDesign",
1117
+ props: R,
1118
+ emits: ["changeValue", "update:modelValue"],
1119
+ setup(e, t) {
1120
+ const n = w(e.modelValue), {
1121
+ enumData: a,
1122
+ onClickRadio: o,
1123
+ getValue: l,
1124
+ getText: u
1125
+ } = ae(e, t, n), c = I(() => ({
1126
+ "farris-checkradio-hor": e.horizontal
1127
+ })), p = w(), r = N("designer-host-service"), d = N("design-item-context"), i = Ze(d, r), s = Xe(p, d, i);
1128
+ return L(() => {
1129
+ p.value.componentInstance = s;
1130
+ }), t.expose(s.value), () => g("div", {
1131
+ class: ["farris-input-wrap", c.value],
1132
+ ref: p
1133
+ }, [a.value.map((f, m) => {
1134
+ const y = "radio_" + e.name + m;
1135
+ return g("div", {
1136
+ class: "custom-control custom-radio"
1137
+ }, [g("input", {
1138
+ type: "radio",
1139
+ class: "custom-control-input",
1140
+ name: e.name,
1141
+ id: y,
1142
+ value: l(f),
1143
+ checked: l(f) === n.value,
1144
+ disabled: e.disabled,
1145
+ tabindex: e.tabIndex,
1146
+ onClick: (F) => o(f, F)
1147
+ }, null), g("label", {
1148
+ class: "custom-control-label",
1149
+ for: y
1150
+ }, [u(f)])]);
1151
+ })]);
1068
1152
  }
1069
- function d() {
1070
- return !1;
1153
+ }), tt = /* @__PURE__ */ new Map([
1154
+ ["appearance", ve]
1155
+ ]);
1156
+ function nt(e, t, n) {
1157
+ return t;
1158
+ }
1159
+ const ot = "https://json-schema.org/draft/2020-12/schema", at = "https://farris-design.gitee.io/button-edit.schema.json", it = "button-edit", lt = "A Farris Input Component", rt = "object", st = {
1160
+ id: {
1161
+ description: "The unique identifier for a Input Group",
1162
+ type: "string"
1163
+ },
1164
+ type: {
1165
+ description: "The type string of Input Group component",
1166
+ type: "string",
1167
+ default: "button-edit"
1168
+ },
1169
+ appearance: {
1170
+ description: "",
1171
+ type: "object",
1172
+ properties: {
1173
+ class: {
1174
+ type: "string"
1175
+ },
1176
+ style: {
1177
+ type: "string"
1178
+ }
1179
+ },
1180
+ default: {}
1181
+ },
1182
+ binding: {
1183
+ description: "",
1184
+ type: "object",
1185
+ default: {}
1186
+ },
1187
+ disable: {
1188
+ type: "string",
1189
+ default: !1
1190
+ },
1191
+ editable: {
1192
+ description: "",
1193
+ type: "boolean",
1194
+ default: !0
1195
+ },
1196
+ enableLinkLabel: {
1197
+ description: "",
1198
+ type: "boolean",
1199
+ default: !1
1200
+ },
1201
+ label: {
1202
+ description: "",
1203
+ type: "string",
1204
+ default: ""
1205
+ },
1206
+ lableWidth: {
1207
+ description: "",
1208
+ type: "number"
1209
+ },
1210
+ placeholder: {
1211
+ description: "",
1212
+ type: "string",
1213
+ default: ""
1214
+ },
1215
+ readonly: {
1216
+ description: "",
1217
+ type: "boolean",
1218
+ default: !1
1219
+ },
1220
+ require: {
1221
+ description: "",
1222
+ type: "boolean",
1223
+ default: !1
1224
+ },
1225
+ tabindex: {
1226
+ description: "",
1227
+ type: "number",
1228
+ default: -1
1229
+ },
1230
+ textAlign: {
1231
+ description: "",
1232
+ type: "string",
1233
+ enum: [
1234
+ "left",
1235
+ "middle",
1236
+ "right"
1237
+ ],
1238
+ default: "left"
1239
+ },
1240
+ visible: {
1241
+ description: "",
1242
+ type: "boolean",
1243
+ default: !0
1244
+ },
1245
+ onBlur: {
1246
+ description: "",
1247
+ type: "string",
1248
+ default: ""
1249
+ },
1250
+ onClickLinkLabel: {
1251
+ description: "",
1252
+ type: "sting",
1253
+ default: ""
1254
+ },
1255
+ autoComplete: {
1256
+ description: "",
1257
+ type: "boolean",
1258
+ default: !1
1259
+ },
1260
+ buttonContent: {
1261
+ description: "",
1262
+ type: "string",
1263
+ default: ""
1264
+ },
1265
+ enableClear: {
1266
+ description: "",
1267
+ type: "boolean",
1268
+ default: !0
1269
+ },
1270
+ inputType: {
1271
+ description: "",
1272
+ type: "string",
1273
+ enum: [
1274
+ "text",
1275
+ "tag"
1276
+ ],
1277
+ default: "text"
1278
+ },
1279
+ multiSelect: {
1280
+ description: "",
1281
+ type: "boolean",
1282
+ default: !1
1283
+ },
1284
+ popup: {
1285
+ description: "",
1286
+ type: "object",
1287
+ properties: {
1288
+ footerButtons: {
1289
+ type: "array",
1290
+ default: []
1291
+ },
1292
+ height: {
1293
+ type: "number",
1294
+ default: 600
1295
+ },
1296
+ dataMapping: {
1297
+ type: "object"
1298
+ },
1299
+ contents: {
1300
+ type: "array",
1301
+ default: []
1302
+ },
1303
+ showMaxButton: {
1304
+ type: "boolean",
1305
+ default: !0
1306
+ },
1307
+ showCloseButton: {
1308
+ type: "boolean",
1309
+ default: !0
1310
+ },
1311
+ showFooter: {
1312
+ type: "boolean",
1313
+ default: !0
1314
+ },
1315
+ title: {
1316
+ type: "string",
1317
+ default: ""
1318
+ },
1319
+ width: {
1320
+ type: "number",
1321
+ default: 800
1322
+ }
1323
+ }
1324
+ },
1325
+ separator: {
1326
+ type: "string",
1327
+ default: ","
1328
+ },
1329
+ showButtonWhenDisabled: {
1330
+ description: "",
1331
+ type: "boolean",
1332
+ default: !1
1333
+ },
1334
+ wrapText: {
1335
+ type: "boolean",
1336
+ default: !1
1337
+ },
1338
+ onClear: {
1339
+ description: "",
1340
+ type: "string",
1341
+ default: ""
1071
1342
  }
1072
- function f() {
1073
- return !0;
1343
+ }, ut = [
1344
+ "id",
1345
+ "type"
1346
+ ], ct = {
1347
+ $schema: ot,
1348
+ $id: at,
1349
+ title: it,
1350
+ description: lt,
1351
+ type: rt,
1352
+ properties: st,
1353
+ required: ut
1354
+ }, dt = "buttonEdit", pt = "A Farris Component", ft = "object", mt = {
1355
+ basic: {
1356
+ description: "Basic Infomation",
1357
+ title: "基本信息",
1358
+ properties: {
1359
+ id: {
1360
+ description: "组件标识",
1361
+ title: "标识",
1362
+ type: "string",
1363
+ readonly: !0
1364
+ },
1365
+ type: {
1366
+ description: "组件类型",
1367
+ title: "控件类型",
1368
+ type: "select",
1369
+ editor: {
1370
+ type: "waiting for modification",
1371
+ enum: []
1372
+ }
1373
+ }
1374
+ }
1375
+ },
1376
+ behavior: {
1377
+ description: "Basic Infomation",
1378
+ title: "行为",
1379
+ properties: {
1380
+ editable: {
1381
+ description: "",
1382
+ title: "允许编辑",
1383
+ type: "boolean"
1384
+ },
1385
+ readonly: {
1386
+ description: "",
1387
+ title: "只读",
1388
+ type: "string"
1389
+ },
1390
+ required: {
1391
+ description: "",
1392
+ title: "必填",
1393
+ type: "boolean"
1394
+ },
1395
+ visible: {
1396
+ description: "",
1397
+ title: "可见",
1398
+ type: "boolean"
1399
+ },
1400
+ placeholder: {
1401
+ description: "",
1402
+ title: "提示文本",
1403
+ type: "string"
1404
+ },
1405
+ tabindex: {
1406
+ description: "",
1407
+ title: "tab索引",
1408
+ type: "number"
1409
+ },
1410
+ textAlign: {
1411
+ description: "",
1412
+ title: "对齐方式",
1413
+ type: "enum",
1414
+ editor: {
1415
+ type: "combo-list",
1416
+ textField: "name",
1417
+ valueField: "value",
1418
+ data: [
1419
+ {
1420
+ value: "left",
1421
+ name: "左对齐"
1422
+ },
1423
+ {
1424
+ value: "center",
1425
+ name: "居中"
1426
+ },
1427
+ {
1428
+ value: "right",
1429
+ name: "右对齐"
1430
+ }
1431
+ ]
1432
+ }
1433
+ }
1434
+ }
1074
1435
  }
1075
- function p(n) {
1436
+ }, yt = {
1437
+ title: dt,
1438
+ description: pt,
1439
+ type: ft,
1440
+ categories: mt
1441
+ }, ie = {
1442
+ /**
1443
+ * 组件标识
1444
+ */
1445
+ id: String,
1446
+ /**
1447
+ * 扩展按钮显示内容,这是一段现在扩展按钮中的html标签
1448
+ */
1449
+ buttonContent: { type: String, default: '<i class="f-icon f-icon-lookup"></i>' },
1450
+ buttonBehavior: { type: String, default: "Popup" },
1451
+ /**
1452
+ * 启用输入框自动完成功能
1453
+ */
1454
+ autoComplete: { type: Boolean, default: !1 },
1455
+ /**
1456
+ * 组件自定义样式
1457
+ */
1458
+ customClass: { type: String, default: "" },
1459
+ /**
1460
+ * 禁用组件,既不允许在输入框中录入,也不允许点击扩展按钮。
1461
+ */
1462
+ disable: { type: Boolean, default: !1 },
1463
+ /**
1464
+ * 允许在输入框中录入文本。
1465
+ */
1466
+ editable: { type: Boolean, default: !0 },
1467
+ /**
1468
+ * 显示清空文本按钮
1469
+ */
1470
+ enableClear: { type: Boolean, default: !1 },
1471
+ /**
1472
+ * 组件值
1473
+ */
1474
+ modelValue: { type: String, default: "" },
1475
+ /**
1476
+ * 将组件设置为只读,既不允许在输入框中录入,也不允许点击扩展按钮,但是允许复制输入框中的内容。
1477
+ */
1478
+ readonly: { type: Boolean, default: !1 },
1479
+ /**
1480
+ * 禁用组件时,是否显示扩展按钮
1481
+ */
1482
+ showButtonWhenDisabled: { type: Boolean, default: !1 },
1483
+ /**
1484
+ * 显示输入框的标签
1485
+ */
1486
+ enableTitle: { type: Boolean, default: !1 },
1487
+ /**
1488
+ * 输入框类型
1489
+ */
1490
+ inputType: { type: String, default: "text" },
1491
+ /**
1492
+ * 显示输入框提示信息
1493
+ */
1494
+ forcePlaceholder: { type: Boolean, default: !1 },
1495
+ /**
1496
+ * 输入框提示文本
1497
+ */
1498
+ placeholder: { type: String, default: "" },
1499
+ /**
1500
+ * 输入框最小长度
1501
+ */
1502
+ minLength: Number,
1503
+ /**
1504
+ * 输入框最大长度
1505
+ */
1506
+ maxLength: Number,
1507
+ /**
1508
+ * 输入框Tab键索引
1509
+ */
1510
+ tabIndex: Number,
1511
+ popupHost: { type: Object },
1512
+ popupRightBoundary: { type: Object },
1513
+ popupOffsetX: { type: Object },
1514
+ popupOnInput: { type: Boolean, default: !1 },
1515
+ popupOnFocus: { type: Boolean, default: !1 },
1516
+ popupMinWidth: { type: Number, default: 160 },
1517
+ modalOptions: { type: Object, default: {} },
1518
+ wrapText: { type: Boolean, default: !1 },
1519
+ /**
1520
+ * 可选,是否支持多选
1521
+ * 默认`false`
1522
+ */
1523
+ multiSelect: { type: Boolean, default: !1 },
1524
+ /**
1525
+ * 可选,分隔符
1526
+ * 默认`,`
1527
+ */
1528
+ separator: { type: String, default: "," },
1529
+ /** 对齐方式 */
1530
+ textAlign: { type: String, default: "left" },
1531
+ /**
1532
+ * 废弃
1533
+ */
1534
+ beforeClickButton: { type: Function, default: null },
1535
+ /**
1536
+ * 作为内嵌编辑器被创建后默认获得焦点
1537
+ */
1538
+ focusOnCreated: { type: Boolean, default: !1 },
1539
+ /**
1540
+ * 作为内嵌编辑器被创建后默认选中文本
1541
+ */
1542
+ selectOnCreated: { type: Boolean, default: !1 },
1543
+ /**
1544
+ * 打开前
1545
+ */
1546
+ beforeOpen: { type: Function, default: null },
1547
+ /** 更新方式 blur | change */
1548
+ updateOn: { type: String, default: "change" }
1549
+ };
1550
+ ne(ie, ct, tt, nt, yt);
1551
+ const gt = {
1552
+ popupContentPosition: { type: Object, default: { left: 0, top: 0 } },
1553
+ host: { type: Object },
1554
+ backgroundColor: { type: String, default: "" }
1555
+ }, ht = /* @__PURE__ */ V({
1556
+ name: "FOverlay",
1557
+ props: gt,
1558
+ emits: ["click"],
1559
+ setup(e, t) {
1560
+ const n = w(e.popupContentPosition), a = w(e.host), o = I(() => ({
1561
+ backgroundColor: e.backgroundColor || "",
1562
+ pointerEvents: "auto"
1563
+ }));
1564
+ function l(c) {
1565
+ t.emit("click"), c.preventDefault(), c.stopPropagation();
1566
+ }
1567
+ I(() => {
1568
+ const c = a.value;
1569
+ if (c) {
1570
+ const p = c.getBoundingClientRect(), {
1571
+ left: r,
1572
+ top: d,
1573
+ height: i
1574
+ } = p;
1575
+ return {
1576
+ left: r,
1577
+ top: d + i
1578
+ };
1579
+ }
1580
+ return n.value;
1581
+ });
1582
+ const u = I(() => ({
1583
+ // position: 'relative',
1584
+ // left: `${position.value.left}px`,
1585
+ // top: `${position.value.top}px`
1586
+ }));
1587
+ return () => g(pe, {
1588
+ to: "body"
1589
+ }, {
1590
+ default: () => {
1591
+ var c, p;
1592
+ return [g("div", {
1593
+ class: "overlay-container",
1594
+ onClick: (r) => l(r),
1595
+ style: o.value
1596
+ }, [g("div", {
1597
+ style: u.value
1598
+ }, [(p = (c = t.slots).default) == null ? void 0 : p.call(c)])])];
1599
+ }
1600
+ });
1076
1601
  }
1077
- function a() {
1602
+ });
1603
+ function vt(e) {
1604
+ if (e.content && e.content.render)
1605
+ return e.content.render;
1606
+ if (e.render && typeof e.render == "function")
1607
+ return e.render;
1608
+ }
1609
+ function bt(e) {
1610
+ const t = document.createElement("div");
1611
+ t.style.display = "contents";
1612
+ let n;
1613
+ const a = e.onClickCallback || (() => {
1614
+ }), o = () => {
1615
+ a(), n && n.unmount();
1616
+ };
1617
+ return n = fe({
1618
+ setup() {
1619
+ me(() => {
1620
+ document.body.removeChild(t);
1621
+ });
1622
+ const l = vt(e);
1623
+ return () => g(ht, {
1624
+ "popup-content-position": e.popupPosition,
1625
+ host: e.host,
1626
+ onClick: o,
1627
+ backgroundColor: e.backgroundColor
1628
+ }, {
1629
+ default: () => [l && l()]
1630
+ });
1631
+ }
1632
+ }), document.body.appendChild(t), n.mount(t), n;
1633
+ }
1634
+ class Ct {
1635
+ static show(t) {
1636
+ return bt(t);
1637
+ }
1638
+ }
1639
+ const kt = Symbol("FModalService");
1640
+ function le(e, t) {
1641
+ function n() {
1642
+ const a = e.beforeOpen || e.beforeClickButton || null;
1643
+ let o = Promise.resolve(!0);
1644
+ if (a) {
1645
+ const l = a(t.value);
1646
+ if (typeof l > "u")
1647
+ return o;
1648
+ typeof l == "boolean" ? o = Promise.resolve(l) : o = l;
1649
+ }
1650
+ return o;
1078
1651
  }
1079
- function s(n) {
1080
- return null;
1652
+ return { judgeCanOpen: n };
1653
+ }
1654
+ function Ft(e, t, n, a, o) {
1655
+ const l = w(e.buttonBehavior), u = w(e.popupOnInput), c = I(() => ({
1656
+ "input-group-append": !0,
1657
+ "append-force-show": e.showButtonWhenDisabled && (e.readonly || e.disable)
1658
+ })), { judgeCanOpen: p } = le(e, o), r = I(() => e.showButtonWhenDisabled || (!e.editable || !e.readonly) && !e.disable), d = N(kt, null), i = w();
1659
+ async function s(y) {
1660
+ if (await p() && r.value) {
1661
+ const F = !!t.slots.default;
1662
+ if (l.value === "Modal") {
1663
+ const k = e.modalOptions, h = d == null ? void 0 : d.open({
1664
+ ...k,
1665
+ render: () => t.slots.default && t.slots.default()
1666
+ });
1667
+ i.value = h == null ? void 0 : h.modalRef;
1668
+ }
1669
+ l.value === "Overlay" && Ct.show({
1670
+ // host: buttonEditRef.value,
1671
+ host: document.body,
1672
+ backgroundColor: "rgba(0,0,0,.15)",
1673
+ render: () => t.slots.default && t.slots.default()
1674
+ }), F && l.value === "Popup" && a.togglePopup(!0), F && u.value && a.hidePopup(), t.emit("clickButton", { origin: y, value: e.modelValue });
1675
+ }
1676
+ }
1677
+ function f(y) {
1678
+ t.emit("mouseEnterIcon", y);
1679
+ }
1680
+ function m(y) {
1681
+ t.emit("mouseLeaveIcon", y);
1081
1682
  }
1082
1683
  return {
1083
- canAccepts: r,
1084
- checkCanDeleteComponent: l,
1085
- checkCanMoveComponent: d,
1086
- hideNestedPaddingInDesginerView: f,
1087
- onAcceptMovedChildElement: p,
1088
- resolveComponentContext: a,
1089
- triggerBelongedComponentToMoveWhenMoved: e,
1090
- triggerBelongedComponentToDeleteWhenDeleted: o,
1091
- getPropsConfig: s
1684
+ buttonGroupClass: c,
1685
+ onClickButton: s,
1686
+ onMouseEnterButton: f,
1687
+ onMouseLeaveButton: m,
1688
+ modalRef: i
1092
1689
  };
1093
1690
  }
1094
- function Ie(i, t) {
1095
- const {
1096
- canAccepts: e,
1097
- checkCanDeleteComponent: o,
1098
- checkCanMoveComponent: r,
1099
- hideNestedPaddingInDesginerView: l,
1100
- onAcceptMovedChildElement: d,
1101
- resolveComponentContext: f,
1102
- triggerBelongedComponentToMoveWhenMoved: p,
1103
- triggerBelongedComponentToDeleteWhenDeleted: a
1104
- } = Pe(i), s = i.schema;
1105
- function n(c, y) {
1106
- return new De(c, t).getPropertyConfig(s, y);
1691
+ function Bt(e, t, n, a, o, l) {
1692
+ const u = w(!1), c = I(() => e.enableClear && !e.readonly && !e.disable), { changeTextBoxValue: p } = l;
1693
+ function r(f) {
1694
+ u.value = f;
1695
+ }
1696
+ j(o, () => {
1697
+ r(!!o.value);
1698
+ });
1699
+ function d(f) {
1700
+ const m = !e.readonly && !e.disable && e.editable, y = !e.editable;
1701
+ f.stopPropagation(), (m || y) && (p("", !1), r(!u.value), t.emit("clear"));
1702
+ }
1703
+ function i(f) {
1704
+ if (c.value) {
1705
+ if (!n.value) {
1706
+ r(!1);
1707
+ return;
1708
+ }
1709
+ !e.disable && !e.readonly && r(!0);
1710
+ }
1711
+ }
1712
+ function s(f) {
1713
+ c.value && r(!1);
1107
1714
  }
1108
1715
  return {
1109
- canAccepts: e,
1110
- checkCanDeleteComponent: o,
1111
- checkCanMoveComponent: r,
1112
- hideNestedPaddingInDesginerView: l,
1113
- onAcceptMovedChildElement: d,
1114
- resolveComponentContext: f,
1115
- triggerBelongedComponentToMoveWhenMoved: p,
1116
- triggerBelongedComponentToDeleteWhenDeleted: a,
1117
- getPropsConfig: n
1716
+ enableClearButton: c,
1717
+ showClearButton: u,
1718
+ onClearValue: d,
1719
+ onMouseEnterTextBox: i,
1720
+ onMouseLeaveTextBox: s
1118
1721
  };
1119
1722
  }
1120
- const Ve = /* @__PURE__ */ N({
1121
- name: "FRadioGroupDesign",
1122
- props: G,
1123
- emits: ["changeValue", "update:modelValue"],
1124
- setup(i, t) {
1125
- const e = F(i.modelValue), {
1126
- enumData: o,
1127
- onClickRadio: r,
1128
- getValue: l,
1129
- getText: d
1130
- } = Y(i, t, e), f = V(() => ({
1131
- "farris-checkradio-hor": i.horizontal
1132
- })), p = F(), a = L("designer-host-service"), s = L("design-item-context"), n = Ie(s, a), c = Me(p, s, n);
1133
- return j(() => {
1134
- p.value.componentInstance = c;
1135
- }), t.expose(c.value), () => M("div", {
1136
- class: ["farris-input-wrap", f.value],
1137
- ref: p
1138
- }, [o.value.map((y, u) => {
1139
- const h = "radio_" + i.name + u;
1140
- return M("div", {
1141
- class: "custom-control custom-radio"
1142
- }, [M("input", {
1143
- type: "radio",
1144
- class: "custom-control-input",
1145
- name: i.name,
1146
- id: h,
1147
- value: l(y),
1148
- checked: l(y) === e.value,
1149
- disabled: i.disabled,
1150
- tabindex: i.tabIndex,
1151
- onClick: (b) => r(y, b)
1152
- }, null), M("label", {
1153
- class: "custom-control-label",
1154
- for: h
1155
- }, [d(y)])]);
1156
- })]);
1723
+ function Mt(e, t, n, a, o) {
1724
+ const l = I(() => e.popupOnInput), u = I(() => e.popupOnFocus), { shouldPopupContent: c } = o, p = I(() => e.enableTitle ? n.value : ""), r = I(() => (e.disable || e.readonly) && !e.forcePlaceholder ? "" : e.placeholder), d = I(() => e.readonly || !e.editable), i = w(!1), s = I(() => !e.disable && i.value), f = I(() => ({
1725
+ "text-left": e.textAlign === "left",
1726
+ "text-center": e.textAlign === "center",
1727
+ "text-right": e.textAlign === "right",
1728
+ "form-control": !0,
1729
+ "f-utils-fill": !0
1730
+ })), m = I(() => ({
1731
+ "input-group": !0,
1732
+ "f-state-disable": e.disable,
1733
+ "f-state-editable": e.editable && !e.disable && !e.readonly,
1734
+ "f-state-readonly": e.readonly && !e.disable,
1735
+ "f-state-focus": s.value
1736
+ }));
1737
+ function y(v, x = !0) {
1738
+ n.value !== v && (n.value = v, x && (t.emit("change", v), t.emit("update:modelValue", v)));
1739
+ }
1740
+ function F(v) {
1741
+ c.value = !1, y(v, !0);
1742
+ }
1743
+ j(
1744
+ () => e.modelValue,
1745
+ (v) => {
1746
+ n.value = v;
1747
+ }
1748
+ );
1749
+ function k(v) {
1750
+ i.value = !1, t.emit("blur", v), v.stopPropagation();
1751
+ }
1752
+ function h(v) {
1753
+ t.emit("click", v);
1754
+ }
1755
+ function B(v) {
1756
+ e.disable || (i.value = !0, d.value || (t.emit("focus", v), u.value && !c.value && o.popup()));
1757
+ }
1758
+ function P(v) {
1759
+ t.emit("input", v.target.value);
1760
+ const x = v.target.value;
1761
+ a.value = x, n.value !== x && y(x, e.updateOn === "change"), l.value && !c.value && o.popup();
1762
+ }
1763
+ function C(v) {
1764
+ v.target.tagName !== "INPUT" && v.preventDefault(), v.stopPropagation();
1765
+ }
1766
+ function E(v) {
1767
+ t.emit("keydown", v);
1768
+ }
1769
+ function S(v) {
1770
+ v.key === "Enter" && (l.value || u.value) && o.hidePopup(), t.emit("keyup", v);
1771
+ }
1772
+ function M(v) {
1773
+ const x = v.target.value;
1774
+ v.stopPropagation(), y(x);
1775
+ }
1776
+ return {
1777
+ hasFocusedTextBox: s,
1778
+ isTextBoxReadonly: d,
1779
+ textBoxClass: f,
1780
+ textBoxPlaceholder: r,
1781
+ textBoxTitle: p,
1782
+ inputGroupClass: m,
1783
+ changeTextBoxValue: y,
1784
+ commitValue: F,
1785
+ onBlurTextBox: k,
1786
+ onClickTextBox: h,
1787
+ onFocusTextBox: B,
1788
+ onInput: P,
1789
+ onKeyDownTextBox: E,
1790
+ onKeyUpTextBox: S,
1791
+ onMouseDownTextBox: C,
1792
+ onTextBoxValueChange: M
1793
+ };
1794
+ }
1795
+ function wt(e, t, n, a) {
1796
+ const o = w(), l = w(!1), { judgeCanOpen: u } = le(e, a);
1797
+ function c() {
1798
+ const i = o.value;
1799
+ i && i.show(n.value);
1800
+ }
1801
+ async function p(i = !1) {
1802
+ if (!!t.slots.default) {
1803
+ if (!i && !l.value && !await u())
1804
+ return;
1805
+ l.value = !l.value, await z(), c();
1806
+ }
1807
+ }
1808
+ async function r(i = !1) {
1809
+ if (!!t.slots.default) {
1810
+ if (!i && !await u())
1811
+ return;
1812
+ l.value = !0, await z(), c();
1813
+ }
1814
+ }
1815
+ function d() {
1816
+ l.value = !1;
1817
+ }
1818
+ return { hidePopup: d, popup: r, shouldPopupContent: l, togglePopup: p, popoverRef: o };
1819
+ }
1820
+ function St(e, t, n) {
1821
+ const a = w(), {
1822
+ isTextBoxReadonly: o,
1823
+ textBoxClass: l,
1824
+ textBoxPlaceholder: u,
1825
+ textBoxTitle: c,
1826
+ onBlurTextBox: p,
1827
+ onClickTextBox: r,
1828
+ onFocusTextBox: d,
1829
+ onInput: i,
1830
+ onKeyDownTextBox: s,
1831
+ onKeyUpTextBox: f,
1832
+ onMouseDownTextBox: m,
1833
+ onTextBoxValueChange: y
1834
+ } = n;
1835
+ return L(() => {
1836
+ var F, k;
1837
+ e.selectOnCreated && ((F = a.value) == null || F.select()), e.focusOnCreated && ((k = a.value) == null || k.focus());
1838
+ }), () => g("input", {
1839
+ ref: a,
1840
+ name: "input-group-value",
1841
+ autocomplete: e.autoComplete ? "on" : "off",
1842
+ class: l.value,
1843
+ disabled: e.disable,
1844
+ maxlength: e.maxLength,
1845
+ minlength: e.minLength,
1846
+ placeholder: u.value,
1847
+ readonly: o.value,
1848
+ tabindex: e.tabIndex,
1849
+ title: c.value,
1850
+ type: e.inputType,
1851
+ value: t.value,
1852
+ onBlur: p,
1853
+ onChange: y,
1854
+ onClick: r,
1855
+ onFocus: d,
1856
+ onInput: i,
1857
+ onKeydown: s,
1858
+ onKeyup: f,
1859
+ onMousedown: m
1860
+ }, null);
1861
+ }
1862
+ function Tt(e, t, n) {
1863
+ const a = w(e.separator), {
1864
+ changeTextBoxValue: o
1865
+ } = n, l = I(() => t.value ? t.value.split(a.value).map((c) => ({
1866
+ name: c,
1867
+ selectable: !0
1868
+ })) : []);
1869
+ function u(c) {
1870
+ o(c.map((p) => p.name).join(a.value), !0);
1871
+ }
1872
+ return () => g(Ce, {
1873
+ id: `${e.id}-tag-editor`,
1874
+ class: "form-control",
1875
+ data: l.value,
1876
+ showClose: !0,
1877
+ showInput: !0,
1878
+ onChange: u
1879
+ }, null);
1880
+ }
1881
+ function Et(e, t, n, a) {
1882
+ const {
1883
+ buttonGroupClass: o,
1884
+ onClickButton: l,
1885
+ onMouseEnterButton: u,
1886
+ onMouseLeaveButton: c
1887
+ } = n, {
1888
+ enableClearButton: p,
1889
+ showClearButton: r,
1890
+ onClearValue: d
1891
+ } = a, i = w();
1892
+ return {
1893
+ renderButtonGroup: () => g("div", {
1894
+ id: `${e.id}-button-group`,
1895
+ class: o.value
1896
+ }, [p.value && G(g("span", {
1897
+ class: "input-group-text input-group-clear",
1898
+ onClick: d
1899
+ }, [g("i", {
1900
+ class: "f-icon modal_close"
1901
+ }, null)]), [[ye, r.value]]), t.slots.buttonContent ? g("span", {
1902
+ class: "input-group-text input-group-append-button",
1903
+ onClick: l,
1904
+ onMouseenter: u,
1905
+ onMouseleave: c
1906
+ }, [t.slots.buttonContent()]) : e.buttonContent ? g("span", {
1907
+ class: "input-group-text input-group-append-button",
1908
+ innerHTML: e.buttonContent,
1909
+ ref: i,
1910
+ onClick: l,
1911
+ onMouseenter: u,
1912
+ onMouseleave: c
1913
+ }, null) : null]),
1914
+ buttonHandleElement: i
1915
+ };
1916
+ }
1917
+ function It(e, t, n) {
1918
+ const a = w(e.popupMinWidth), {
1919
+ hidePopup: o,
1920
+ popoverRef: l
1921
+ } = n;
1922
+ return () => g(ke, {
1923
+ id: `${e.id}-popover`,
1924
+ ref: l,
1925
+ visible: !0,
1926
+ placement: "bottom-left",
1927
+ host: e.popupHost,
1928
+ "keep-width-with-reference": !0,
1929
+ fitContent: !0,
1930
+ "right-boundary": e.popupRightBoundary,
1931
+ minWidth: a.value,
1932
+ offsetX: e.popupOffsetX,
1933
+ onHidden: o
1934
+ }, {
1935
+ default: () => {
1936
+ var u, c;
1937
+ return [(c = (u = t.slots).default) == null ? void 0 : c.call(u)];
1938
+ }
1939
+ });
1940
+ }
1941
+ const Pt = /* @__PURE__ */ V({
1942
+ name: "FButtonEdit",
1943
+ props: ie,
1944
+ emits: ["updateExtendInfo", "clear", "change", "click", "clickButton", "blur", "focus", "mouseEnterIcon", "mouseLeaveIcon", "keyup", "keydown", "inputClick", "input", "update:modelValue"],
1945
+ setup(e, t) {
1946
+ const n = w(), a = w(e.customClass), o = w(e.modelValue), l = wt(e, t, n, o), {
1947
+ shouldPopupContent: u,
1948
+ hidePopup: c,
1949
+ togglePopup: p
1950
+ } = l, r = Ft(e, t, n, l, o), d = w(""), i = Mt(e, t, o, d, l), {
1951
+ hasFocusedTextBox: s,
1952
+ commitValue: f,
1953
+ inputGroupClass: m
1954
+ } = i, y = Bt(e, t, o, s, d, i), {
1955
+ onMouseEnterTextBox: F,
1956
+ onMouseLeaveTextBox: k
1957
+ } = y, h = I(() => {
1958
+ const v = {
1959
+ "f-button-edit": !0,
1960
+ "f-cmp-inputgroup": !0,
1961
+ "f-button-edit-nowrap": !e.wrapText
1962
+ };
1963
+ return a.value && a.value.split(" ").reduce((x, $) => (x[$] = !0, x), v), v;
1964
+ });
1965
+ function B() {
1966
+ return e.multiSelect && e.inputType === "tag" ? Tt(e, o, i) : St(e, o, i);
1967
+ }
1968
+ let P = B();
1969
+ j([() => e.multiSelect, () => e.inputType], () => {
1970
+ P = B();
1971
+ });
1972
+ const {
1973
+ renderButtonGroup: C,
1974
+ buttonHandleElement: E
1975
+ } = Et(e, t, r, y), S = It(e, t, l), M = {
1976
+ commitValue: f,
1977
+ elementRef: n,
1978
+ hidePopup: c,
1979
+ shouldPopupContent: u,
1980
+ togglePopup: p,
1981
+ openDialog: () => {
1982
+ E.value && e.buttonBehavior === "Modal" && E.value.click();
1983
+ },
1984
+ getModal: () => {
1985
+ var v;
1986
+ return e.buttonBehavior === "Modal" ? (v = r.modalRef.value) == null ? void 0 : v.value : null;
1987
+ }
1988
+ };
1989
+ return L(() => {
1990
+ n.value.componentInstance = M, window.onresize = () => {
1991
+ document.body.click();
1992
+ };
1993
+ }), t.expose(M), () => g(Q, null, [g("div", ge(t.attrs, {
1994
+ ref: n,
1995
+ class: h.value,
1996
+ id: e.id
1997
+ }), [g("div", {
1998
+ id: `${e.id}-input-group`,
1999
+ class: m.value,
2000
+ onMouseenter: F,
2001
+ onMouseleave: k
2002
+ }, [P(), C()])]), u.value && S()]);
2003
+ }
2004
+ }), xt = "https://json-schema.org/draft/2020-12/schema", Vt = "https://farris-design.gitee.io/radio-group.schema.json", At = "item-collection-editor", Ot = "A Farris Input Component", Dt = "object", Lt = {
2005
+ id: {
2006
+ description: "The unique identifier for a item-collection-editor",
2007
+ type: "string"
2008
+ },
2009
+ type: {
2010
+ description: "The type string of item-collection-editor component",
2011
+ type: "string",
2012
+ default: "item-collection-editor"
2013
+ },
2014
+ requiredFields: {
2015
+ description: "",
2016
+ type: "array",
2017
+ default: []
2018
+ },
2019
+ uniqueFields: {
2020
+ description: "",
2021
+ type: "array",
2022
+ default: []
2023
+ },
2024
+ dynamicMappingKeys: {
2025
+ type: "boolean",
2026
+ default: !1
2027
+ },
2028
+ columns: {
2029
+ description: "",
2030
+ type: "array",
2031
+ default: []
2032
+ },
2033
+ modalTitle: {
2034
+ description: "",
2035
+ type: "string",
2036
+ default: ""
2037
+ },
2038
+ canEmpty: {
2039
+ description: "",
2040
+ type: "boolean",
2041
+ default: !0
2042
+ },
2043
+ valueField: {
2044
+ description: "",
2045
+ type: "string",
2046
+ default: "id"
2047
+ },
2048
+ nameField: {
2049
+ description: "",
2050
+ type: "string",
2051
+ default: "name"
2052
+ },
2053
+ idField: {
2054
+ description: "",
2055
+ type: "string",
2056
+ default: "id"
2057
+ },
2058
+ readonly: {
2059
+ description: "",
2060
+ type: "boolean",
2061
+ default: !1
2062
+ },
2063
+ modelValue: {
2064
+ description: "",
2065
+ type: "string",
2066
+ default: ""
2067
+ }
2068
+ }, $t = [
2069
+ "id",
2070
+ "type"
2071
+ ], Nt = [], qt = {
2072
+ $schema: xt,
2073
+ $id: Vt,
2074
+ title: At,
2075
+ description: Ot,
2076
+ type: Dt,
2077
+ properties: Lt,
2078
+ required: $t,
2079
+ ignore: Nt
2080
+ }, re = {
2081
+ /**
2082
+ * 必填的列
2083
+ */
2084
+ requiredFields: { type: Array, default: [] },
2085
+ /**
2086
+ * 值唯一的列
2087
+ */
2088
+ uniqueFields: { type: Array, default: [] },
2089
+ dynamicMappingKeys: { type: Boolean, default: !1 },
2090
+ /**
2091
+ * 列配置
2092
+ */
2093
+ columns: { type: Array, default: [] },
2094
+ /**
2095
+ * 模态框标题
2096
+ */
2097
+ modalTitle: { type: String, default: "项编辑器" },
2098
+ /**
2099
+ * 数据是否可以置空
2100
+ */
2101
+ canEmpty: { type: Boolean, default: !0 },
2102
+ /**
2103
+ * 动态映射键值时,枚举值的key
2104
+ */
2105
+ valueField: { type: String, default: "id" },
2106
+ /**
2107
+ * 动态映射键值时,枚举名称的key
2108
+ */
2109
+ nameField: { type: String, default: "name" },
2110
+ /**
2111
+ * 目前假定idField和valueField一致
2112
+ */
2113
+ idField: { type: String, default: "id" },
2114
+ /**
2115
+ * 是否进入只读状态
2116
+ */
2117
+ readonly: { type: Boolean, default: !1 },
2118
+ /**
2119
+ * 组件值
2120
+ */
2121
+ modelValue: { type: Array, default: [] }
2122
+ /**
2123
+ * 列表只有一列时,将结果集转化为字符串数组
2124
+ */
2125
+ // isSimpleArray: { type: Boolean, default: false }
2126
+ }, Gt = be(re, qt, De, Se), jt = {
2127
+ /**
2128
+ * 必填的列
2129
+ */
2130
+ requiredFields: { type: Array, default: [] },
2131
+ /**
2132
+ * 值唯一的列
2133
+ */
2134
+ uniqueFields: { type: Array, default: [] },
2135
+ dynamicMappingKeys: { type: Boolean, default: !1 },
2136
+ /**
2137
+ * 列配置
2138
+ */
2139
+ columns: { type: Array, default: [] },
2140
+ /**
2141
+ * 数据是否可以置空
2142
+ */
2143
+ canEmpty: { type: Boolean, default: !0 },
2144
+ /**
2145
+ * 动态映射键值时,枚举值的key
2146
+ */
2147
+ valueField: { type: String, default: "id" },
2148
+ /**
2149
+ * 动态映射键值时,枚举名称的key
2150
+ */
2151
+ nameField: { type: String, default: "name" },
2152
+ /**
2153
+ * 组件值
2154
+ */
2155
+ datas: { type: Array, default: [] }
2156
+ }, Ut = /* @__PURE__ */ V({
2157
+ name: "FItemCollectionEditorInner",
2158
+ props: jt,
2159
+ emits: ["change"],
2160
+ setup(e, t) {
2161
+ const {
2162
+ guid: n
2163
+ } = J(), a = new Be(), o = w(e.valueField), l = w(e.nameField), u = {
2164
+ editMode: "cell"
2165
+ }, c = w(), p = e.columns;
2166
+ let r = e.datas;
2167
+ function d() {
2168
+ const h = {};
2169
+ return p.forEach((B) => {
2170
+ B.editor && (B.editor.type === "checkbox" || B.editor.type === "switch") ? h[B.field] = !1 : h[B.field] = "";
2171
+ }), h;
2172
+ }
2173
+ function i() {
2174
+ if (e.dynamicMappingKeys) {
2175
+ const h = "请先填写XXX", B = o.value.trim() ? l.value.trim() ? "" : "枚举名称字段" : "枚举值字段";
2176
+ return a.warning({
2177
+ position: "top-center",
2178
+ message: h.replace("XXX", B)
2179
+ }), !1;
2180
+ }
2181
+ return !0;
2182
+ }
2183
+ function s(h) {
2184
+ const B = "不允许重复。";
2185
+ if (!i())
2186
+ return !1;
2187
+ if (!h || h.length === 0)
2188
+ return e.canEmpty ? !0 : (a.warning({
2189
+ position: "top-center",
2190
+ message: "请添加值"
2191
+ }), !1);
2192
+ const P = e.requiredFields || [], C = "不允许为空";
2193
+ for (const S of h)
2194
+ for (const M of Object.keys(S)) {
2195
+ const v = p.find((x) => x.field === M);
2196
+ if (v && v.editor && (v.editor.type === "checkbox" || v.editor.type === "switch")) {
2197
+ if (P.includes(M) && (S[M] === null || S[M] === void 0))
2198
+ return a.warning({
2199
+ position: "top-center",
2200
+ message: v.title + C
2201
+ }), !1;
2202
+ } else if (P.includes(M) && (S[M] === void 0 || S[M] === "" || S[M] === null))
2203
+ return a.warning({
2204
+ position: "top-center",
2205
+ message: v.title + C
2206
+ }), !1;
2207
+ }
2208
+ const E = e.uniqueFields || [];
2209
+ for (const S of E) {
2210
+ const M = h.map(($) => $[S]), v = new Set(M), x = Array.from(v);
2211
+ if (M.length !== x.length) {
2212
+ const $ = p.find((se) => se.field === S);
2213
+ return a.warning({
2214
+ position: "top-center",
2215
+ message: $.title + B
2216
+ }), !1;
2217
+ }
2218
+ }
2219
+ return !0;
2220
+ }
2221
+ function f() {
2222
+ if (e.readonly || !i())
2223
+ return;
2224
+ const h = d(), B = n();
2225
+ r.push({
2226
+ hId: B,
2227
+ ...h
2228
+ }), c.value.updateDataSource(r), c.value.selectItemById(B);
2229
+ }
2230
+ function m() {
2231
+ r && r.length > 0 && c.value.selectItemById(r[0].hId);
2232
+ }
2233
+ function y() {
2234
+ r = [...c.value.getVisibleData().filter((B) => !B.checked).map((B) => B.raw)], c.value.updateDataSource(r), m();
2235
+ }
2236
+ function F(h) {
2237
+ if (!h || h.length === 0)
2238
+ return h;
2239
+ const B = [];
2240
+ return h.forEach((P) => {
2241
+ const {
2242
+ value: C,
2243
+ name: E,
2244
+ ...S
2245
+ } = P, M = Object.assign({}, S);
2246
+ M[o.value.trim()] = C, M[l.value.trim()] = E, B.push(M);
2247
+ }), B;
2248
+ }
2249
+ function k() {
2250
+ let h = [];
2251
+ return c.value.getVisibleData().forEach((B) => {
2252
+ const {
2253
+ hId: P,
2254
+ ...C
2255
+ } = B.raw;
2256
+ h.push(C);
2257
+ }), s(h) ? (e.dynamicMappingKeys ? (h = F(h), t.emit("change", {
2258
+ value: h,
2259
+ parameters: {
2260
+ valueField: o.value.trim(),
2261
+ nameField: l.value.trim()
2262
+ }
2263
+ })) : t.emit("change", {
2264
+ value: h
2265
+ }), !0) : !1;
2266
+ }
2267
+ return t.expose({
2268
+ clickConfirm: k
2269
+ }), L(() => {
2270
+ m();
2271
+ }), () => g("div", {
2272
+ class: "f-utils-fill-flex-column"
2273
+ }, [!e.readonly && g("div", {
2274
+ class: "mb-1 py-1 ml-1"
2275
+ }, [g("button", {
2276
+ class: "btn f-rt-btn f-btn-ml btn-primary",
2277
+ onClick: () => f()
2278
+ }, [A("新增")]), g("button", {
2279
+ class: "btn f-rt-btn f-btn-ml btn-secondary",
2280
+ onClick: () => y()
2281
+ }, [A("删除")])]), g("div", {
2282
+ class: "f-utils-fill border",
2283
+ style: "margin:0 8px;border-radius:12px;"
2284
+ }, [g(Fe, {
2285
+ ref: c,
2286
+ showBorder: !0,
2287
+ idField: "hId",
2288
+ columns: p,
2289
+ data: r,
2290
+ editable: !0,
2291
+ "edit-option": u,
2292
+ fit: "true"
2293
+ }, null)])]);
2294
+ }
2295
+ }), Wt = /* @__PURE__ */ V({
2296
+ name: "FItemCollectionEditor",
2297
+ props: re,
2298
+ components: {},
2299
+ emits: ["change"],
2300
+ setup(e, t) {
2301
+ const {
2302
+ guid: n
2303
+ } = J(), a = w(`共 ${(e.modelValue || []).length} 项`), o = w(e.valueField), l = w(e.nameField), u = w();
2304
+ function c() {
2305
+ let s = [];
2306
+ return e.dynamicMappingKeys ? (s = [], o.value = o.value.trim(), l.value = l.value.trim(), (e.modelValue || []).forEach((f) => {
2307
+ if (o.value && l.value) {
2308
+ const {
2309
+ [o.value]: m,
2310
+ [l.value]: y,
2311
+ ...F
2312
+ } = f, k = F || {};
2313
+ k.value = m, k.name = y, k.hId = n(), s.push(k);
2314
+ }
2315
+ })) : (s = U(e.modelValue || []), s.forEach((f) => {
2316
+ f.hId = n();
2317
+ })), s;
2318
+ }
2319
+ function p() {
2320
+ let s = [];
2321
+ return e.columns && e.columns.length > 0 ? s = e.columns : s = [{
2322
+ field: e.valueField,
2323
+ title: "值",
2324
+ dataType: "string"
2325
+ }, {
2326
+ field: e.nameField,
2327
+ title: "名称",
2328
+ dataType: "string"
2329
+ }], s;
2330
+ }
2331
+ function r() {
2332
+ }
2333
+ const d = {
2334
+ fitContent: !1,
2335
+ width: 900,
2336
+ height: 600,
2337
+ title: "项编辑器",
2338
+ buttons: [{
2339
+ name: "cancel",
2340
+ text: "取消",
2341
+ class: "btn btn-secondary",
2342
+ handle: (s) => !0
2343
+ }, {
2344
+ name: "accept",
2345
+ text: "确定",
2346
+ class: "btn btn-primary",
2347
+ handle: (s) => !!u.value.clickConfirm()
2348
+ }]
2349
+ };
2350
+ function i(s) {
2351
+ a.value = `共 ${s.value.length} 项`, t.emit("change", s);
2352
+ }
2353
+ return L(() => {
2354
+ }), () => g(Pt, {
2355
+ "button-behavior": "Modal",
2356
+ "modal-options": d,
2357
+ modelValue: a.value,
2358
+ "onUpdate:modelValue": (s) => a.value = s,
2359
+ editable: !1,
2360
+ beforeOpen: r
2361
+ }, {
2362
+ default: () => [g("div", {
2363
+ class: "f-utils-absolute-all f-utils-flex-column"
2364
+ }, [e.dynamicMappingKeys && g("div", {
2365
+ class: "farris-form-controls-inline p-2 f-form-layout farris-form f-form-lable-auto"
2366
+ }, [g("div", {
2367
+ class: "farris-group-wrap mr-3"
2368
+ }, [g("div", {
2369
+ class: "form-group farris-form-group"
2370
+ }, [g("label", {
2371
+ class: "col-form-label"
2372
+ }, [g("span", {
2373
+ class: "farris-label-info text-danger"
2374
+ }, [A("*")]), g("span", {
2375
+ class: "farris-label-text"
2376
+ }, [A("枚举值字段")])]), g("div", {
2377
+ class: "farris-input-wrap"
2378
+ }, [G(g("input", {
2379
+ type: "input",
2380
+ class: "form-control",
2381
+ "onUpdate:modelValue": (s) => o = s,
2382
+ readonly: e.readonly
2383
+ }, null), [[X, o]])])])]), g("div", {
2384
+ class: "farris-group-wrap"
2385
+ }, [g("div", {
2386
+ class: "form-group farris-form-group"
2387
+ }, [g("label", {
2388
+ class: "col-form-label"
2389
+ }, [g("span", {
2390
+ class: "farris-label-info text-danger"
2391
+ }, [A("*")]), g("span", {
2392
+ class: "farris-label-text"
2393
+ }, [A("枚举名称字段")])]), g("div", {
2394
+ class: "farris-input-wrap"
2395
+ }, [G(g("input", {
2396
+ type: "input",
2397
+ class: "form-control",
2398
+ "onUpdate:modelValue": (s) => l = s,
2399
+ readonly: e.readonly
2400
+ }, null), [[X, l]])])])])]), g(Ut, {
2401
+ ref: u,
2402
+ valueField: o,
2403
+ nameField: l,
2404
+ requiredFields: e.requiredFields,
2405
+ uniqueFields: e.uniqueFields,
2406
+ dynamicMappingKeys: e.dynamicMappingKeys,
2407
+ canEmpty: e.canEmpty,
2408
+ datas: c(),
2409
+ columns: p(),
2410
+ onChange: (s) => i(s)
2411
+ }, null)])]
2412
+ });
1157
2413
  }
1158
2414
  });
1159
- I.install = (i) => {
1160
- i.component(I.name, I), i.component(O.name, O);
2415
+ D.install = (e) => {
2416
+ e.component(D.name, D), e.component(K.name, K);
1161
2417
  };
1162
- I.register = (i, t, e, o) => {
1163
- i["radio-group"] = I, t["radio-group"] = Q;
2418
+ D.register = (e, t, n, a) => {
2419
+ e["radio-group"] = D, t["radio-group"] = oe, e["item-collection-editor"] = Wt, t["item-collection-editor"] = Gt;
1164
2420
  };
1165
- I.registerDesigner = (i, t, e) => {
1166
- i["radio-group"] = Ve, t["radio-group"] = Q;
2421
+ D.registerDesigner = (e, t, n) => {
2422
+ e["radio-group"] = et, t["radio-group"] = oe;
1167
2423
  };
1168
2424
  export {
1169
- I as RadioGroup,
1170
- I as default,
1171
- Q as propsResolver,
1172
- G as radioGroupProps,
1173
- te as radioProps
2425
+ D as RadioGroup,
2426
+ D as default,
2427
+ oe as propsResolver,
2428
+ R as radioGroupProps,
2429
+ Me as radioProps
1174
2430
  };