@farris/ui-vue 1.7.3 → 1.7.5

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 (392) hide show
  1. package/components/accordion/index.esm.js +312 -61
  2. package/components/accordion/index.umd.cjs +1 -1
  3. package/components/avatar/index.esm.js +1482 -56
  4. package/components/avatar/index.umd.cjs +1 -1
  5. package/components/binding-selector/index.esm.js +752 -8
  6. package/components/binding-selector/index.umd.cjs +1 -1
  7. package/components/button-group/index.esm.js +266 -110
  8. package/components/button-group/index.umd.cjs +1 -1
  9. package/components/calendar/index.esm.js +129 -128
  10. package/components/calendar/index.umd.cjs +2 -2
  11. package/components/code-editor/index.esm.js +237 -169
  12. package/components/code-editor/index.umd.cjs +3 -3
  13. package/components/collection-property-editor/index.esm.js +134 -133
  14. package/components/collection-property-editor/index.umd.cjs +2 -2
  15. package/components/color-picker/index.esm.js +812 -502
  16. package/components/color-picker/index.umd.cjs +1 -1
  17. package/components/combo-list/index.esm.js +323 -291
  18. package/components/combo-list/index.umd.cjs +1 -1
  19. package/components/combo-tree/index.esm.js +355 -174
  20. package/components/combo-tree/index.umd.cjs +1 -1
  21. package/components/comment/index.esm.js +134 -133
  22. package/components/comment/index.umd.cjs +2 -2
  23. package/components/common/index.esm.js +1 -1
  24. package/components/common/index.umd.cjs +1 -1
  25. package/components/component/index.esm.js +3791 -2760
  26. package/components/component/index.umd.cjs +8 -1
  27. package/components/condition/index.esm.js +2482 -492
  28. package/components/condition/index.umd.cjs +8 -1
  29. package/components/data-view/index.esm.js +1816 -1790
  30. package/components/data-view/index.umd.cjs +1 -1
  31. package/components/date-picker/index.esm.js +1 -1
  32. package/components/date-picker/index.umd.cjs +1 -1
  33. package/components/designer-canvas/index.esm.js +2975 -2615
  34. package/components/designer-canvas/index.umd.cjs +1 -1
  35. package/components/drawer/index.esm.js +397 -387
  36. package/components/drawer/index.umd.cjs +2 -2
  37. package/components/dropdown/index.esm.js +373 -124
  38. package/components/dropdown/index.umd.cjs +2 -2
  39. package/components/dynamic-form/index.esm.js +592 -1894
  40. package/components/dynamic-form/index.umd.cjs +1 -1
  41. package/components/dynamic-resolver/index.esm.js +250 -248
  42. package/components/dynamic-resolver/index.umd.cjs +2 -2
  43. package/components/dynamic-view/index.esm.js +427 -466
  44. package/components/dynamic-view/index.umd.cjs +1 -1
  45. package/components/event-parameter/index.esm.js +1 -1
  46. package/components/event-parameter/index.umd.cjs +1 -1
  47. package/components/events-editor/index.esm.js +1890 -1473
  48. package/components/events-editor/index.umd.cjs +3 -3
  49. package/components/expression-editor/index.css +1 -1
  50. package/components/expression-editor/index.esm.js +7371 -2
  51. package/components/expression-editor/index.umd.cjs +427 -1
  52. package/components/fieldset/index.esm.js +1 -1
  53. package/components/fieldset/index.umd.cjs +1 -1
  54. package/components/filter-bar/index.esm.js +2 -3
  55. package/components/filter-bar/index.umd.cjs +2 -2
  56. package/components/filter-condition-editor/index.css +1 -1
  57. package/components/filter-condition-editor/index.esm.js +9044 -425
  58. package/components/filter-condition-editor/index.umd.cjs +427 -1
  59. package/components/html-template/index.esm.js +33 -36
  60. package/components/html-template/index.umd.cjs +1 -1
  61. package/components/image-cropper/index.esm.js +615 -361
  62. package/components/image-cropper/index.umd.cjs +1 -1
  63. package/components/json-editor/index.esm.js +325 -247
  64. package/components/json-editor/index.umd.cjs +1 -1
  65. package/components/language-textbox/index.esm.js +269 -269
  66. package/components/language-textbox/index.umd.cjs +2 -2
  67. package/components/layout/index.esm.js +549 -163
  68. package/components/layout/index.umd.cjs +1 -1
  69. package/components/list-nav/index.esm.js +837 -39
  70. package/components/list-nav/index.umd.cjs +1 -1
  71. package/components/list-view/index.esm.js +427 -646
  72. package/components/list-view/index.umd.cjs +6 -6
  73. package/components/lookup/index.esm.js +3624 -3625
  74. package/components/lookup/index.umd.cjs +1 -1
  75. package/components/menu-lookup/index.esm.js +577 -536
  76. package/components/menu-lookup/index.umd.cjs +6 -6
  77. package/components/nav/index.esm.js +311 -31
  78. package/components/nav/index.umd.cjs +1 -1
  79. package/components/number-range/index.esm.js +1634 -189
  80. package/components/number-range/index.umd.cjs +1 -1
  81. package/components/number-spinner/index.esm.js +82 -82
  82. package/components/number-spinner/index.umd.cjs +1 -1
  83. package/components/order/index.esm.js +1190 -850
  84. package/components/order/index.umd.cjs +6 -6
  85. package/components/page-footer/index.esm.js +331 -48
  86. package/components/page-footer/index.umd.cjs +1 -1
  87. package/components/page-header/index.esm.js +110 -116
  88. package/components/page-header/index.umd.cjs +1 -1
  89. package/components/pagination/index.esm.js +509 -232
  90. package/components/pagination/index.umd.cjs +1 -1
  91. package/components/progress/index.esm.js +353 -148
  92. package/components/progress/index.umd.cjs +3 -3
  93. package/components/property-editor/index.esm.js +157 -153
  94. package/components/property-editor/index.umd.cjs +1 -1
  95. package/components/property-panel/index.esm.js +1825 -871
  96. package/components/property-panel/index.umd.cjs +12 -5
  97. package/components/query-solution/index.css +1 -1
  98. package/components/query-solution/index.esm.js +6075 -3863
  99. package/components/query-solution/index.umd.cjs +13 -6
  100. package/components/response-layout/index.esm.js +1 -1
  101. package/components/response-layout/index.umd.cjs +1 -1
  102. package/components/schema-selector/index.esm.js +2447 -2221
  103. package/components/schema-selector/index.umd.cjs +7 -7
  104. package/components/search-box/index.esm.js +244 -72
  105. package/components/search-box/index.umd.cjs +1 -1
  106. package/components/section/index.esm.js +134 -133
  107. package/components/section/index.umd.cjs +2 -2
  108. package/components/smoke-detector/index.esm.js +179 -8
  109. package/components/smoke-detector/index.umd.cjs +1 -1
  110. package/components/sort-condition-editor/index.css +1 -0
  111. package/components/sort-condition-editor/index.esm.js +9488 -4
  112. package/components/sort-condition-editor/index.umd.cjs +427 -1
  113. package/components/splitter/index.esm.js +1172 -142
  114. package/components/splitter/index.umd.cjs +1 -1
  115. package/components/step/index.esm.js +47 -48
  116. package/components/step/index.umd.cjs +1 -1
  117. package/components/tabs/index.esm.js +490 -419
  118. package/components/tabs/index.umd.cjs +1 -1
  119. package/components/text/index.esm.js +217 -73
  120. package/components/text/index.umd.cjs +1 -1
  121. package/components/textarea/index.esm.js +29 -27
  122. package/components/textarea/index.umd.cjs +2 -2
  123. package/components/transfer/index.esm.js +760 -543
  124. package/components/transfer/index.umd.cjs +5 -5
  125. package/components/tree-grid/index.esm.js +105 -104
  126. package/components/tree-grid/index.umd.cjs +1 -1
  127. package/components/tree-view/index.esm.js +320 -153
  128. package/components/tree-view/index.umd.cjs +1 -1
  129. package/components/uploader/index.esm.js +1125 -634
  130. package/components/uploader/index.umd.cjs +2 -2
  131. package/components/verify-detail/index.esm.js +359 -106
  132. package/components/verify-detail/index.umd.cjs +1 -1
  133. package/components/video/index.esm.js +222 -89
  134. package/components/video/index.umd.cjs +1 -1
  135. package/components/weather/index.esm.js +290 -199
  136. package/components/weather/index.umd.cjs +1 -1
  137. package/designer/data-grid/index.esm.js +5192 -4408
  138. package/designer/data-grid/index.umd.cjs +17 -10
  139. package/designer/drawer/index.esm.js +576 -567
  140. package/designer/drawer/index.umd.cjs +2 -2
  141. package/designer/dynamic-form/index.esm.js +1418 -1154
  142. package/designer/dynamic-form/index.umd.cjs +8 -1
  143. package/designer/farris-designer.all.esm.js +12665 -12117
  144. package/designer/farris-designer.all.umd.cjs +12 -12
  145. package/designer/list-view/index.esm.js +327 -327
  146. package/designer/list-view/index.umd.cjs +3 -3
  147. package/designer/modal/index.esm.js +29 -137
  148. package/designer/modal/index.umd.cjs +1 -1
  149. package/designer/radio-group/index.esm.js +0 -1
  150. package/designer/radio-group/index.umd.cjs +1 -1
  151. package/designer/response-toolbar/index.esm.js +9 -9
  152. package/designer/response-toolbar/index.umd.cjs +1 -1
  153. package/designer/section/index.esm.js +1 -6
  154. package/designer/section/index.umd.cjs +1 -1
  155. package/designer/tabs/index.esm.js +2829 -2540
  156. package/designer/tabs/index.umd.cjs +2 -2
  157. package/designer/tree-grid/index.esm.js +822 -464
  158. package/designer/tree-grid/index.umd.cjs +1 -1
  159. package/farris.all.esm.js +68724 -67244
  160. package/farris.all.umd.cjs +92 -92
  161. package/index.css +1 -1
  162. package/package.json +1 -1
  163. package/types/accordion/src/accordion.props.d.ts +1 -0
  164. package/types/accordion/src/components/accordion-item.props.d.ts +1 -0
  165. package/types/avatar/src/avatar.props.d.ts +1 -0
  166. package/types/binding-selector/index.d.ts +54 -0
  167. package/types/binding-selector/src/binding-selector.props.d.ts +1 -0
  168. package/types/button-group/index.d.ts +0 -15
  169. package/types/button-group/src/button-group.props.d.ts +1 -0
  170. package/types/code-editor/index.d.ts +1 -0
  171. package/types/code-editor/src/code-textbox.component.d.ts +6 -6
  172. package/types/code-editor/src/code-textbox.props.d.ts +2 -0
  173. package/types/color-picker/index.d.ts +15 -0
  174. package/types/color-picker/src/color-picker.props.d.ts +1 -0
  175. package/types/combo-list/src/composition/use-data-source.d.ts +2 -1
  176. package/types/combo-list/src/property-config/combo-list.property-config.d.ts +14 -2
  177. package/types/combo-tree/src/combo-tree.props.d.ts +1 -0
  178. package/types/component/index.d.ts +2 -0
  179. package/types/component/src/component.props.d.ts +8 -0
  180. package/types/components.d.ts +6 -1
  181. package/types/condition/index.d.ts +55 -0
  182. package/types/designer-toolbox/index.d.ts +3 -0
  183. package/types/designer-toolbox/src/toolbox.component.d.ts +14 -0
  184. package/types/designer-toolbox/src/toolbox.props.d.ts +29 -0
  185. package/types/designer-toolbox/src/types.d.ts +21 -0
  186. package/types/designer.d.ts +13 -0
  187. package/types/dropdown/index.d.ts +6 -27
  188. package/types/dropdown/src/dropdown.item.component.d.ts +1 -1
  189. package/types/dropdown/src/dropdown.props.d.ts +1 -0
  190. package/types/dynamic-form/designer.d.ts +1 -3
  191. package/types/dynamic-form/index.d.ts +3 -9
  192. package/types/dynamic-form/src/component/dynamic-form-label/dynamic-form-label.component.d.ts +3 -3
  193. package/types/dynamic-resolver/index.d.ts +0 -3
  194. package/types/dynamic-resolver/src/resolver/property-config/property-config-resolver-design.d.ts +1 -1
  195. package/types/dynamic-resolver/src/resolver/property-config/property-config-resolver.d.ts +1 -1
  196. package/types/dynamic-resolver/src/resolver/property-config/use-property-config-resolver.d.ts +2 -2
  197. package/types/dynamic-resolver/src/resolver/schema/schema-resolver-design.d.ts +1 -1
  198. package/types/dynamic-resolver/src/resolver/schema/schema-resolver.d.ts +1 -1
  199. package/types/dynamic-view/src/components/maps.d.ts +104 -92
  200. package/types/{binding-selector/designer.d.ts → expression-editor/index.d.ts} +6 -6
  201. package/types/filter-condition-editor/index.d.ts +9 -0
  202. package/types/filter-condition-editor/src/components/filter-condition-grid.component.d.ts +12 -12
  203. package/types/filter-condition-editor/src/components/sort-editor-grid.component.d.ts +12 -12
  204. package/types/filter-condition-editor/src/filter-condition-editor.props.d.ts +1 -0
  205. package/types/flow-canvas/index.d.ts +3 -0
  206. package/types/{dynamic-form/src/component/form-control/form-control.component.d.ts → flow-canvas/src/components/flow-node-item.component.d.ts} +1 -1
  207. package/types/flow-canvas/src/components/flow-node-item.props.d.ts +3 -0
  208. package/types/flow-canvas/src/composition/types.d.ts +42 -0
  209. package/types/flow-canvas/src/composition/use-bezier-curve.d.ts +2 -0
  210. package/types/flow-canvas/src/composition/use-connections.d.ts +2 -0
  211. package/types/flow-canvas/src/composition/use-curve.d.ts +4 -0
  212. package/types/flow-canvas/src/composition/use-drawing-bezier.d.ts +2 -0
  213. package/types/flow-canvas/src/composition/use-drawing.d.ts +4 -0
  214. package/types/flow-canvas/src/flow-canvas.component.d.ts +8 -0
  215. package/types/flow-canvas/src/flow-canvas.props.d.ts +3 -0
  216. package/types/image-cropper/src/image-cropper.props.d.ts +1 -0
  217. package/types/index.d.ts +1 -0
  218. package/types/json-editor/src/json-editor.props.d.ts +1 -0
  219. package/types/layout/index.d.ts +0 -1
  220. package/types/layout/src/components/layout-pane.props.d.ts +1 -0
  221. package/types/layout/src/layout.props.d.ts +1 -0
  222. package/types/list-nav/index.d.ts +5 -24
  223. package/types/list-nav/src/list-nav.props.d.ts +1 -0
  224. package/types/list-view/index.d.ts +0 -1
  225. package/types/list-view/src/composition/use-draggable.d.ts +1 -1
  226. package/types/lookup/index.d.ts +1 -1
  227. package/types/lookup/src/components/popup-container.component.d.ts +3 -3
  228. package/types/menu-lookup/src/menu-lookup.props.d.ts +1 -0
  229. package/types/modal/designer.d.ts +0 -2
  230. package/types/nav/index.d.ts +20 -24
  231. package/types/nav/src/nav.props.d.ts +1 -0
  232. package/types/number-range/src/number-range.props.d.ts +1 -0
  233. package/types/order/index.d.ts +5 -36
  234. package/types/order/src/designer/order.design.component.d.ts +1 -1
  235. package/types/order/src/order.props.d.ts +1 -0
  236. package/types/page-footer/index.d.ts +2 -0
  237. package/types/page-footer/src/page-footer.props.d.ts +1 -0
  238. package/types/pagination/index.d.ts +0 -15
  239. package/types/pagination/src/pagination.props.d.ts +1 -0
  240. package/types/progress/src/progress.props.d.ts +1 -0
  241. package/types/query-solution/index.d.ts +1 -1
  242. package/types/radio-group/designer.d.ts +1 -2
  243. package/types/search-box/index.d.ts +17 -1
  244. package/types/search-box/src/search-box.props.d.ts +1 -0
  245. package/types/section/designer.d.ts +0 -1
  246. package/types/smoke-detector/index.d.ts +2 -0
  247. package/types/smoke-detector/src/smoke-detector.props.d.ts +1 -0
  248. package/types/sort-condition-editor/index.d.ts +7 -2
  249. package/types/sort-condition-editor/src/sort-condition-editor.props.d.ts +1 -0
  250. package/types/splitter/index.d.ts +0 -1
  251. package/types/splitter/src/components/splitter-pane.props.d.ts +1 -0
  252. package/types/splitter/src/splitter.props.d.ts +1 -0
  253. package/types/tabs/designer.d.ts +0 -1
  254. package/types/tabs/index.d.ts +1 -0
  255. package/types/text/index.d.ts +20 -24
  256. package/types/text/src/text.props.d.ts +1 -0
  257. package/types/transfer/src/transfer.props.d.ts +1 -0
  258. package/types/tree-view/src/tree-view.props.d.ts +1 -0
  259. package/types/uploader/src/uploader.props.d.ts +1 -0
  260. package/types/verify-detail/index.d.ts +5 -58
  261. package/types/verify-detail/src/designer/verify-detail.design.component.d.ts +8 -8
  262. package/types/verify-detail/src/verify-detail.props.d.ts +1 -0
  263. package/types/video/index.d.ts +20 -24
  264. package/types/video/src/video.props.d.ts +1 -0
  265. package/components/dynamic-form/index.css +0 -1
  266. package/designer/accordion/index.esm.js +0 -257
  267. package/designer/accordion/index.umd.cjs +0 -1
  268. package/designer/avatar/index.esm.js +0 -1460
  269. package/designer/avatar/index.umd.cjs +0 -1
  270. package/designer/binding-selector/index.esm.js +0 -792
  271. package/designer/binding-selector/index.umd.cjs +0 -1
  272. package/designer/button-group/index.esm.js +0 -282
  273. package/designer/button-group/index.umd.cjs +0 -1
  274. package/designer/code-editor/index.esm.js +0 -75
  275. package/designer/code-editor/index.umd.cjs +0 -1
  276. package/designer/color-picker/index.esm.js +0 -1096
  277. package/designer/color-picker/index.umd.cjs +0 -1
  278. package/designer/combo-list/index.esm.js +0 -1095
  279. package/designer/combo-list/index.umd.cjs +0 -1
  280. package/designer/combo-tree/index.esm.js +0 -186
  281. package/designer/combo-tree/index.umd.cjs +0 -1
  282. package/designer/component/index.css +0 -1
  283. package/designer/component/index.esm.js +0 -5002
  284. package/designer/component/index.umd.cjs +0 -1
  285. package/designer/condition/index.esm.js +0 -1899
  286. package/designer/condition/index.umd.cjs +0 -1
  287. package/designer/dropdown/index.esm.js +0 -261
  288. package/designer/dropdown/index.umd.cjs +0 -1
  289. package/designer/expression-editor/index.css +0 -1
  290. package/designer/expression-editor/index.esm.js +0 -7006
  291. package/designer/expression-editor/index.umd.cjs +0 -427
  292. package/designer/filter-condition-editor/index.css +0 -1
  293. package/designer/filter-condition-editor/index.esm.js +0 -4795
  294. package/designer/filter-condition-editor/index.umd.cjs +0 -1
  295. package/designer/html-template/index.esm.js +0 -718
  296. package/designer/html-template/index.umd.cjs +0 -1
  297. package/designer/image-cropper/index.esm.js +0 -765
  298. package/designer/image-cropper/index.umd.cjs +0 -1
  299. package/designer/json-editor/index.esm.js +0 -83
  300. package/designer/json-editor/index.umd.cjs +0 -1
  301. package/designer/language-textbox/index.esm.js +0 -783
  302. package/designer/language-textbox/index.umd.cjs +0 -8
  303. package/designer/layout/index.esm.js +0 -430
  304. package/designer/layout/index.umd.cjs +0 -1
  305. package/designer/list-nav/index.esm.js +0 -802
  306. package/designer/list-nav/index.umd.cjs +0 -1
  307. package/designer/lookup/index.esm.js +0 -2083
  308. package/designer/lookup/index.umd.cjs +0 -1
  309. package/designer/menu-lookup/index.esm.js +0 -46
  310. package/designer/menu-lookup/index.umd.cjs +0 -1
  311. package/designer/nav/index.esm.js +0 -284
  312. package/designer/nav/index.umd.cjs +0 -1
  313. package/designer/number-range/index.esm.js +0 -1616
  314. package/designer/number-range/index.umd.cjs +0 -1
  315. package/designer/order/index.css +0 -1
  316. package/designer/order/index.esm.js +0 -2196
  317. package/designer/order/index.umd.cjs +0 -18
  318. package/designer/page-footer/index.esm.js +0 -290
  319. package/designer/page-footer/index.umd.cjs +0 -1
  320. package/designer/page-header/index.esm.js +0 -1003
  321. package/designer/page-header/index.umd.cjs +0 -1
  322. package/designer/pagination/index.esm.js +0 -591
  323. package/designer/pagination/index.umd.cjs +0 -1
  324. package/designer/progress/index.esm.js +0 -213
  325. package/designer/progress/index.umd.cjs +0 -1
  326. package/designer/search-box/index.esm.js +0 -245
  327. package/designer/search-box/index.umd.cjs +0 -1
  328. package/designer/smoke-detector/index.css +0 -1
  329. package/designer/smoke-detector/index.esm.js +0 -178
  330. package/designer/smoke-detector/index.umd.cjs +0 -1
  331. package/designer/sort-condition-editor/index.esm.js +0 -138
  332. package/designer/sort-condition-editor/index.umd.cjs +0 -1
  333. package/designer/splitter/index.esm.js +0 -1120
  334. package/designer/splitter/index.umd.cjs +0 -1
  335. package/designer/step/index.esm.js +0 -226
  336. package/designer/step/index.umd.cjs +0 -1
  337. package/designer/text/index.esm.js +0 -147
  338. package/designer/text/index.umd.cjs +0 -1
  339. package/designer/transfer/index.esm.js +0 -254
  340. package/designer/transfer/index.umd.cjs +0 -1
  341. package/designer/tree-view/index.esm.js +0 -313
  342. package/designer/tree-view/index.umd.cjs +0 -1
  343. package/designer/uploader/index.esm.js +0 -1190
  344. package/designer/uploader/index.umd.cjs +0 -2
  345. package/designer/verify-detail/index.esm.js +0 -258
  346. package/designer/verify-detail/index.umd.cjs +0 -1
  347. package/designer/video/index.esm.js +0 -136
  348. package/designer/video/index.umd.cjs +0 -1
  349. package/designer/weather/index.css +0 -1
  350. package/designer/weather/index.esm.js +0 -6244
  351. package/designer/weather/index.umd.cjs +0 -14
  352. package/types/accordion/designer.d.ts +0 -44
  353. package/types/avatar/designer.d.ts +0 -29
  354. package/types/button-group/designer.d.ts +0 -29
  355. package/types/code-editor/designer.d.ts +0 -5
  356. package/types/color-picker/designer.d.ts +0 -29
  357. package/types/combo-list/designer.d.ts +0 -29
  358. package/types/combo-list/src/designer/combo-list.design.props.d.ts +0 -6
  359. package/types/combo-tree/designer.d.ts +0 -5
  360. package/types/component/designer.d.ts +0 -35
  361. package/types/condition/designer.d.ts +0 -56
  362. package/types/dropdown/designer.d.ts +0 -6
  363. package/types/dynamic-form/src/composition/use-input-type-resolver.d.ts +0 -11
  364. package/types/expression-editor/designer.d.ts +0 -9
  365. package/types/filter-condition-editor/designer.d.ts +0 -10
  366. package/types/html-template/designer.d.ts +0 -31
  367. package/types/html-template/src/designer/html-template.design.props.d.ts +0 -9
  368. package/types/image-cropper/designer.d.ts +0 -4
  369. package/types/json-editor/designer.d.ts +0 -5
  370. package/types/layout/designer.d.ts +0 -32
  371. package/types/list-nav/designer.d.ts +0 -6
  372. package/types/menu-lookup/designer.d.ts +0 -5
  373. package/types/nav/designer.d.ts +0 -6
  374. package/types/number-range/designer.d.ts +0 -29
  375. package/types/order/designer.d.ts +0 -6
  376. package/types/page-footer/designer.d.ts +0 -6
  377. package/types/page-header/src/designer/page-header.design.props.d.ts +0 -20
  378. package/types/pagination/designer.d.ts +0 -29
  379. package/types/progress/designer.d.ts +0 -29
  380. package/types/search-box/designer.d.ts +0 -52
  381. package/types/smoke-detector/designer.d.ts +0 -6
  382. package/types/sort-condition-editor/designer.d.ts +0 -9
  383. package/types/splitter/designer.d.ts +0 -32
  384. package/types/step/designer.d.ts +0 -6
  385. package/types/text/designer.d.ts +0 -6
  386. package/types/transfer/designer.d.ts +0 -35
  387. package/types/tree-view/designer.d.ts +0 -29
  388. package/types/uploader/designer.d.ts +0 -141
  389. package/types/verify-detail/designer.d.ts +0 -6
  390. package/types/video/designer.d.ts +0 -6
  391. /package/{designer → components}/condition/index.css +0 -0
  392. /package/{designer → components}/uploader/index.css +0 -0
@@ -1,1899 +0,0 @@
1
- var we = Object.defineProperty;
2
- var xe = (t, e, n) => e in t ? we(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var u = (t, e, n) => xe(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { defineComponent as J, ref as E, inject as W, computed as U, onMounted as ae, createVNode as x, mergeProps as ue, watch as Q, onBeforeUnmount as de, withDirectives as ce, resolveDirective as pe } from "vue";
5
- import { useDesignerComponent as me, DgControl as a } from "../../components/designer-canvas/index.esm.js";
6
- import { dynamicFormGroupProps as Ie, FDynamicFormLabel as Ee } from "../../components/dynamic-form/index.esm.js";
7
- import "../accordion/index.esm.js";
8
- import "../avatar/index.esm.js";
9
- import "../button-edit/index.esm.js";
10
- import "../button-group/index.esm.js";
11
- import "../../components/calendar/index.esm.js";
12
- import "../capsule/index.esm.js";
13
- import "../checkbox/index.esm.js";
14
- import "../checkbox-group/index.esm.js";
15
- import "../color-picker/index.esm.js";
16
- import "../combo-list/index.esm.js";
17
- import "../../components/content-container/index.esm.js";
18
- import "../data-grid/index.esm.js";
19
- import "../date-picker/index.esm.js";
20
- import "../dropdown/index.esm.js";
21
- import { FDynamicFormGroup as he } from "../dynamic-form/index.esm.js";
22
- import "../../components/external-container/index.esm.js";
23
- import "../../components/filter-bar/index.esm.js";
24
- import "../image-cropper/index.esm.js";
25
- import "../input-group/index.esm.js";
26
- import "../layout/index.esm.js";
27
- import "../list-nav/index.esm.js";
28
- import "../list-view/index.esm.js";
29
- import "../../components/lookup/index.esm.js";
30
- import "../../components/language-textbox/index.esm.js";
31
- import "../../components/nav/index.esm.js";
32
- import "../number-spinner/index.esm.js";
33
- import "../number-range/index.esm.js";
34
- import "../order/index.esm.js";
35
- import "../../components/page-header/index.esm.js";
36
- import "../page-footer/index.esm.js";
37
- import "../pagination/index.esm.js";
38
- import "../progress/index.esm.js";
39
- import "../../components/query-solution/index.esm.js";
40
- import "../radio-group/index.esm.js";
41
- import "../rate/index.esm.js";
42
- import "../response-toolbar/index.esm.js";
43
- import "../../components/response-layout/index.esm.js";
44
- import "../response-layout-editor/index.esm.js";
45
- import "../search-box/index.esm.js";
46
- import "../section/index.esm.js";
47
- import "../smoke-detector/index.esm.js";
48
- import "../splitter/index.esm.js";
49
- import "../../components/step/index.esm.js";
50
- import "../switch/index.esm.js";
51
- import "../tabs/index.esm.js";
52
- import "../tags/index.esm.js";
53
- import "../text/index.esm.js";
54
- import "../time-picker/index.esm.js";
55
- import "../transfer/index.esm.js";
56
- import "../tree-view/index.esm.js";
57
- import "../uploader/index.esm.js";
58
- import "../verify-detail/index.esm.js";
59
- import "../component/index.esm.js";
60
- import "../video/index.esm.js";
61
- import "../textarea/index.esm.js";
62
- import "../tree-grid/index.esm.js";
63
- import "../../components/fieldset/index.esm.js";
64
- import "../drawer/index.esm.js";
65
- import "../../components/html-template/index.esm.js";
66
- import "../../components/image/index.esm.js";
67
- import "../../components/comment/index.esm.js";
68
- import { useThirdComponent as Le, useTextBoxDesign as Se, useDateFormat as fe, resolveField as Be, useNumberFormat as Oe, areaResponseDirective as Pe } from "../../components/common/index.esm.js";
69
- import { propertyConfigSchemaMapForDesigner as Me } from "../../components/dynamic-resolver/index.esm.js";
70
- import { InputBaseProperty as Ge } from "../../components/property-panel/index.esm.js";
71
- import { cloneDeep as X } from "lodash-es";
72
- import { LocaleService as Y } from "../../components/locale/index.esm.js";
73
- import re from "../../components/combo-list/index.esm.js";
74
- const D = {
75
- conditions: { type: Array, default: [] },
76
- fields: { type: Array, default: [] },
77
- key: { type: String, default: "" },
78
- /**
79
- * 控件标签同行展示
80
- */
81
- isControlInline: {
82
- type: [Boolean, String],
83
- default: "auto",
84
- validator: (t) => [!0, !1, "auto"].includes(t)
85
- },
86
- /**
87
- * 条件项统一的样式
88
- */
89
- itemClass: { type: Boolean, default: "col-12 col-md-6 col-xl-3 col-el-2" }
90
- }, Ne = {
91
- id: { type: String, default: "" },
92
- customClass: { type: String, default: "" },
93
- customStyle: { type: String, default: "" },
94
- /** 筛选组件配置器,具体配置项可查看各组件文档 */
95
- editor: { type: Object, default: {} },
96
- label: { type: String, default: "" },
97
- /** value is uncertain because type is uncertain, default value should not be set */
98
- modelValue: { type: [String, Boolean, Array, Number] },
99
- // readonly: { type: Boolean, default: false },
100
- visible: { type: Boolean, default: !0 },
101
- required: { type: Boolean, default: !1 },
102
- showLabel: { type: Boolean, default: !0 },
103
- /**
104
- * visible相当于showLabel为true,none相当于showLabel为false
105
- */
106
- showLabelType: { type: String, default: "visible" },
107
- type: { type: String, default: "input-group" },
108
- componentId: { type: String, default: "" },
109
- errors: { type: Object, default: null },
110
- fill: { type: Boolean, default: !1 }
111
- }, Ae = {}, qe = {}, { globalStorageKey: Gn } = Le(), je = {
112
- id: { Type: String, default: "" },
113
- /** 是否自动完成 */
114
- autocomplete: { Type: String, default: "off" },
115
- /** 自定义CLASS */
116
- customClass: { Type: String, default: "" },
117
- /** 禁用 */
118
- disabled: { Type: Boolean, default: !1 },
119
- /** 允许编辑 */
120
- editable: { Type: Boolean, default: !0 },
121
- /** 启用清除按钮 */
122
- enableClear: { Type: Boolean, default: !0 },
123
- /** 启用提示文本 */
124
- enableTitle: { Type: Boolean, default: !0 },
125
- /** 能否查看密码 */
126
- enableViewPassword: { Type: Boolean, default: !0 },
127
- /** 始终显示占位符文本 */
128
- forcePlaceholder: { Type: Boolean, default: !1 },
129
- /** 扩展按钮 */
130
- groupText: { Type: String, default: "" },
131
- /** 密码模式 */
132
- showType: { Type: String, default: "text" },
133
- /** 密码模式 --废弃*/
134
- type: { Type: String, default: "text" },
135
- /** 最大值 */
136
- max: { type: [Number, String] },
137
- /** 最小值 */
138
- min: { type: [Number, String] },
139
- /** 最大长度 */
140
- maxLength: { Type: Number || void 0, default: void 0 },
141
- /** 最小长度 */
142
- minLength: { Type: Number || void 0, default: void 0 },
143
- /** 组件值 */
144
- modelValue: { Type: String || Boolean, default: "" },
145
- /** 隐藏边线 */
146
- showBorder: { Type: Boolean, default: !0 },
147
- /** 步长 */
148
- step: { Type: Number, default: 1 },
149
- /** 启用提示信息 */
150
- placeholder: { Type: String, default: "" },
151
- precision: { Type: Number, default: 0 },
152
- /** 只读 */
153
- readonly: { Type: Boolean, default: !1 },
154
- /** 当组件禁用或只读时显示后边的按钮 */
155
- showButtonWhenDisabled: { Type: Boolean, default: !1 },
156
- /** tab索引 */
157
- tabIndex: { Type: Number, default: 0 },
158
- /** 文本在输入框中的对齐方式 */
159
- textAlign: { Type: String, default: "left" },
160
- /** 是否启用前置扩展信息;在输入框前面 显示 ① 图标鼠标滑过后显示 */
161
- useExtendInfo: { Type: Boolean, default: !1 },
162
- /** 前置扩展信息 */
163
- extendInfo: { Type: String, default: "" },
164
- /** 输入值 */
165
- value: { Type: String, default: "" },
166
- /** 是否撑开高度 */
167
- autoHeight: { type: Boolean, default: !1 },
168
- /** 自动聚焦 */
169
- autofocus: { type: Boolean, default: !1 },
170
- /** 文本区域可见的行数 */
171
- rows: { type: Number, default: 2 },
172
- /** 展示输入文本数量 */
173
- showCount: { type: Boolean, default: !1 },
174
- showZero: { type: Boolean, default: !1 },
175
- /**
176
- * 作为内嵌编辑器被创建后默认获得焦点
177
- */
178
- focusOnCreated: { type: Boolean, default: !1 },
179
- /**
180
- * 作为内嵌编辑器被创建后默认选中文本
181
- */
182
- selectOnCreated: { type: Boolean, default: !1 },
183
- /**
184
- * modelValue 更新时机, 默认 blur; 可选值:blur | input
185
- * - blur: 离开焦点时更新
186
- * - change: 输入时更新
187
- */
188
- updateOn: { type: String, default: "blur" },
189
- formatValidation: { type: Object, default: {} },
190
- /**
191
- * 是否启用快捷键
192
- */
193
- keyboard: { type: Boolean, default: !0 }
194
- }, ge = [
195
- { key: "none", value: "无" },
196
- { key: "cellNumber", value: "手机号" },
197
- { key: "tel", value: "座机号/传真号" },
198
- { key: "telOrCell", value: "手机号/座机号/传真号" },
199
- { key: "postCode", value: "邮编" },
200
- { key: "email", value: "电子邮箱" },
201
- { key: "idCode", value: "身份证号" },
202
- { key: "carCode", value: "车牌号" },
203
- { key: "subjectCode", value: "10位数字会计科目代码" },
204
- { key: "custom", value: "自定义" }
205
- ];
206
- function Ze(t) {
207
- switch (t) {
208
- case "none":
209
- return "";
210
- case "cellNumber":
211
- return "^1[0-9]{10}$";
212
- case "tel":
213
- return "^(0[0-9]{2,3}\\-)?([2-9][0-9]{6,7})+(\\-[0-9]{1,4})?$";
214
- case "telOrCell":
215
- return "^(0[0-9]{2,3}\\-)?([2-9][0-9]{6,7})+(\\-[0-9]{1,4})?$|^1[0-9]{10}$";
216
- case "postCode":
217
- return "^[1-9]\\d{5}(?!\\d)$";
218
- case "workCode":
219
- return "^\\d{8}$";
220
- case "email":
221
- return "^[A-Za-z\\d]+([-_.][A-Za-z\\d]+)*@([A-Za-z\\d]+[-.])+[A-Za-z]{2,5}$";
222
- case "idCode":
223
- return "^[1-9]\\d{5}[1-9]\\d{3}((0[1-9])|(1[0-2]))(0[1-9]|([1|2][0-9])|3[0-1])((\\d{4})|\\d{3}X)$";
224
- case "carCode":
225
- return "^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][·\\s]?[A-HJ-NP-Z0-9]{4,5}[挂学警港澳]?|粤[Z港澳][·\\s]?[港澳][0-9A-HJ-NP-Z]{4}|[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼][A-Z][·\\s]?([DF][0-9A-HJ-NP-Z][0-9]{4}|[0-9]{5}[DF])[挂港澳]?|[使领][0-9]{3}[·\\s]?[0-9]{3}|临[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼][A-Z][·\\s]?[0-9A-Z]{4,5}|[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼][A-Z]?[·\\s]?警[0-9A-Z]{4}|[军海空][A-Z][·\\s]?[0-9]{4,5}|WJ(?:[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼]|\\d{2})[·\\s]?[0-9A-Z]{4,5})$";
226
- case "carCodeNew":
227
- return "^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF])|([DF][A-HJ-NP-Z0-9][0-9]{4}))$";
228
- case "subjectCode":
229
- return "^\\d{10}$";
230
- }
231
- return "";
232
- }
233
- function Ue(t) {
234
- var e;
235
- return "请输入正确的" + ((e = ge.find((n) => n.key === t)) == null ? void 0 : e.value);
236
- }
237
- const We = {
238
- convertTo: (t, e, n, o) => {
239
- t.editor.formatValidation || (t.editor.formatValidation = { type: "none" }), t.editor.formatValidation.type = n, t.editor.formatValidation.expression = Ze(n), t.editor.formatValidation.message = Ue(n);
240
- },
241
- convertFrom: (t, e, n) => t.editor.formatValidation ? e === "type" ? t.editor.formatValidation[e] || "none" : t.editor.formatValidation[e] : "none"
242
- }, le = {
243
- convertTo: (t, e, n, o) => {
244
- t.editor.formatValidation || (t.editor.formatValidation = { type: "none" }), t.editor.formatValidation[e] = n;
245
- },
246
- convertFrom: (t, e, n) => t.editor.formatValidation ? t.editor.formatValidation[e] : t.editor[e]
247
- };
248
- class ze extends Ge {
249
- constructor(e, n) {
250
- super(e, n);
251
- }
252
- getPropertyConfig(e, n) {
253
- return super.getPropertyConfig(e, n), this.propertyConfig.categories.formatValidation = this.getFormatValidation(e), this.propertyConfig;
254
- }
255
- getEditorProperties(e) {
256
- var o, l;
257
- let n;
258
- if (((o = e == null ? void 0 : e.binding) == null ? void 0 : o.type) === "Form") {
259
- const p = this.schemaService.getFieldByIDAndVMID(e.binding.field, this.viewModelId);
260
- (l = p == null ? void 0 : p.schemaField) != null && l.type && (n = p.schemaField.type.length);
261
- }
262
- return this.getComponentConfig(e, {}, {
263
- maxLength: {
264
- description: "文本字数最大长度",
265
- title: "最大长度",
266
- type: "number",
267
- editor: {
268
- nullable: !0,
269
- min: 0,
270
- useThousands: !1,
271
- max: n,
272
- needValid: !0
273
- }
274
- },
275
- showType: {
276
- description: "指定是文本框还是密码框",
277
- title: "展示类型",
278
- type: "enum",
279
- editor: {
280
- type: "combo-list",
281
- data: [
282
- { id: "text", name: "文本框" },
283
- { id: "password", name: "密码框" }
284
- ]
285
- },
286
- refreshPanelAfterChanged: !0,
287
- defaultValue: "text"
288
- },
289
- enableViewPassword: {
290
- description: "",
291
- title: "能否查看密码",
292
- visible: e.editor.showType === "password",
293
- type: "boolean"
294
- }
295
- });
296
- }
297
- getGridFieldEdtiorProperties(e) {
298
- var o, l;
299
- let n;
300
- if (((o = e == null ? void 0 : e.binding) == null ? void 0 : o.type) === "Form") {
301
- const p = this.schemaService.getFieldByIDAndVMID(e.binding.field, this.viewModelId);
302
- (l = p == null ? void 0 : p.schemaField) != null && l.type && (n = p.schemaField.type.length);
303
- }
304
- return this.getComponentConfig(e, {}, {
305
- maxLength: {
306
- description: "文本字数最大长度",
307
- title: "最大长度",
308
- type: "number",
309
- editor: {
310
- nullable: !0,
311
- min: 0,
312
- useThousands: !1,
313
- max: n
314
- }
315
- },
316
- showType: {
317
- description: "指定是文本框还是密码框",
318
- title: "展示类型",
319
- type: "enum",
320
- editor: {
321
- type: "combo-list",
322
- data: [
323
- { id: "text", name: "文本框" },
324
- { id: "password", name: "密码框" }
325
- ]
326
- },
327
- refreshPanelAfterChanged: !0,
328
- defaultValue: "text"
329
- },
330
- enableViewPassword: {
331
- description: "",
332
- title: "能否查看密码",
333
- visible: e.editor.showType === "password",
334
- type: "boolean"
335
- }
336
- });
337
- }
338
- getFormatValidation(e) {
339
- var o, l, p, r;
340
- const n = {
341
- title: "输入格式校验",
342
- description: "输入校验",
343
- hide: !((o = e.binding) != null && o.field),
344
- properties: {
345
- type: {
346
- title: "格式类型",
347
- type: "enum",
348
- description: "格式类型",
349
- defaultValue: "",
350
- editor: {
351
- type: "combo-list",
352
- textField: "value",
353
- valueField: "key",
354
- idField: "key",
355
- editable: !1,
356
- data: ge
357
- },
358
- refreshPanelAfterChanged: !0,
359
- $converter: We,
360
- parentPropertyID: "formatValidation"
361
- }
362
- }
363
- };
364
- return (l = e.editor.formatValidation) != null && l.type && ((p = e.editor.formatValidation) == null ? void 0 : p.type) !== "none" && (n.properties.message = {
365
- title: "输入错误提示",
366
- type: "string",
367
- description: "输入错误提示",
368
- $converter: le,
369
- parentPropertyID: "formatValidation"
370
- }), ((r = e.editor.formatValidation) == null ? void 0 : r.type) === "custom" && (n.properties.expression = {
371
- title: "匹配正则",
372
- type: "string",
373
- description: "匹配正则",
374
- $converter: le,
375
- parentPropertyID: "formatValidation"
376
- }), n;
377
- }
378
- }
379
- function $e(t, e) {
380
- const n = t.schema;
381
- function o(l, p) {
382
- return new ze(l, e).getPropertyConfig(n, p);
383
- }
384
- return { getPropsConfig: o };
385
- }
386
- const Re = /* @__PURE__ */ J({
387
- name: "FInputGroupDesign",
388
- props: je,
389
- emits: ["updateExtendInfo", "clear", "valueChange", "clickHandle", "blurHandle", "focusHandle", "enterHandle", "iconMouseEnter", "iconMouseLeave", "keyupHandle", "keydownHandle", "inputClick"],
390
- setup(t, e) {
391
- const n = E(t.modelValue), o = E(t.modelValue), l = Se(t, e, n, o), {
392
- inputGroupClass: p,
393
- inputType: r,
394
- inputGroupStyle: i
395
- } = l, v = E(), k = W("designer-host-service"), b = W("design-item-context"), m = $e(b, k), h = me(v, b, m), T = U(() => t.showType === "password" ? "password" : "");
396
- return ae(() => {
397
- v.value.componentInstance = h;
398
- }), e.expose(h.value), () => x("div", {
399
- id: "inputGroup",
400
- ref: v,
401
- class: p.value,
402
- style: i.value
403
- }, [x("input", {
404
- class: "form-control",
405
- type: t.showType,
406
- placeholder: t.placeholder,
407
- value: T.value
408
- }, null), t.showType === "password" && t.enableViewPassword && x("span", {
409
- class: "input-group-append"
410
- }, [x("span", {
411
- class: "input-group-text"
412
- }, [x("span", {
413
- class: "f-icon f-icon-eye"
414
- }, null)])])]);
415
- }
416
- });
417
- function Je() {
418
- function t(r, i) {
419
- const v = qe[r];
420
- return v ? v(i) : {};
421
- }
422
- function e(r) {
423
- return Ae[r] || Re;
424
- }
425
- function n(r) {
426
- }
427
- function o(r) {
428
- }
429
- function l(r) {
430
- }
431
- function p(r) {
432
- }
433
- return { getChangeFunctionName: n, getClearFunctionName: o, resolveEditorProps: t, resolveEditorType: e, getMousedownFunctionName: l, getMouseupFunctionName: p };
434
- }
435
- const R = class R {
436
- /**
437
- * 根据绑定字段类型获取可用的输入类控件
438
- */
439
- static getEditorTypesByMDataType(e, n = !1, o = "") {
440
- if (n)
441
- return [{ key: a["language-textbox"].type, value: a["language-textbox"].name }];
442
- let l = R.fieldControlTypeMapping[e];
443
- if (o === "data-grid-column" && (l != null && l.length)) {
444
- const p = [a["check-group"].type, a["radio-group"].type, a.image.type, a["rich-text-editor"].type];
445
- l = l.filter((r) => !p.includes(r.key));
446
- }
447
- return l;
448
- }
449
- /**
450
- * 获取所有输入类控件
451
- */
452
- static getAllInputTypes() {
453
- const e = [];
454
- for (const n in R.fieldControlTypeMapping)
455
- R.fieldControlTypeMapping[n].forEach((o) => {
456
- e.find((l) => l.key === o.key && l.value === o.value) || e.push({ key: o.key, value: o.value });
457
- });
458
- return e;
459
- }
460
- /**
461
- * 提供schema字段基础属性和DOM控件属性的映射
462
- * @param control 控件元数据
463
- */
464
- static mappingDomPropAndSchemaProp(e, n) {
465
- var p;
466
- const o = (p = e.editor) == null ? void 0 : p.type, l = [];
467
- return (e.type === a["data-grid-column"].type || e.type === a["tree-grid-column"].type) && n && n.categoryId && n.categoryId.indexOf("gridFieldEditor") < 0 && l.push({ domField: "title", schemaField: "name" }), l.push({ domField: "label", schemaField: "name" }), l.push({ domField: "editor.required", schemaField: "require" }), l.push({ domField: "editor.readonly", schemaField: "readonly" }), (o === a["input-group"].type || o === a.textarea.type || o === a["number-spinner"].type) && l.push({ domField: "editor.maxLength", schemaField: "type.length" }), o === a["number-spinner"].type && l.push({ domField: "editor.precision", schemaField: "type.precision" }), (e.type === a["data-grid-column"].type || e.type === a["tree-grid-column"].type) && l.push({ domField: "formatter.precision", schemaField: "type.precision" }), (o === a["combo-list"].type || o === a["radio-group"].type) && l.push({ domField: "editor.data", schemaField: "type.enumValues" }), (e.type === a["data-grid-column"].type || e.type === a["tree-grid-column"].type) && l.push({ domField: "formatter.data", schemaField: "type.enumValues" }), o === a["date-picker"].type && (l.push({ domField: "editor.displayFormat", schemaField: "editor.format" }), l.push({ domField: "editor.fieldType", schemaField: "type.name" })), o === a["number-spinner"].type && (l.push({ domField: "editor.max", schemaField: "editor.maxValue" }), l.push({ domField: "editor.min", schemaField: "editor.minValue" })), o === a.lookup.type && (l.push({ domField: "editor.dataSource", schemaField: "editor.dataSource" }), l.push({ domField: "editor.valueField", schemaField: "editor.valueField" }), l.push({ domField: "editor.textField", schemaField: "editor.textField" }), l.push({ domField: "editor.displayType", schemaField: "editor.displayType" }), l.push({ domField: "editor.mapFields", schemaField: "editor.mapFields" }), l.push({ domField: "editor.helpId", schemaField: "editor.helpId" })), l.push({ domField: "path", schemaField: "bindingPath" }), l.push({ domField: "binding.path", schemaField: "bindingField" }), l.push({ domField: "binding.fullPath", schemaField: "path" }), (e.type === a["data-grid-column"].type || e.type === a["tree-grid-column"].type) && l.push({ domField: "field", schemaField: "bindingPath" }), l;
468
- }
469
- };
470
- /**
471
- * <字段类型,可配置的控件类型列表>的映射
472
- */
473
- u(R, "fieldControlTypeMapping", {
474
- String: [
475
- { key: a["input-group"].type, value: a["input-group"].name },
476
- { key: a.lookup.type, value: a.lookup.name },
477
- { key: a.image.type, value: a.image.name },
478
- { key: a["date-picker"].type, value: a["date-picker"].name },
479
- { key: a.switch.type, value: a.switch.name },
480
- { key: a["check-box"].type, value: a["check-box"].name },
481
- { key: a["check-group"].type, value: a["check-group"].name },
482
- { key: a["radio-group"].type, value: a["radio-group"].name },
483
- { key: a["combo-list"].type, value: a["combo-list"].name },
484
- { key: a.textarea.type, value: a.textarea.name },
485
- { key: a["time-picker"].type, value: a["time-picker"].name }
486
- ],
487
- Text: [
488
- { key: a.textarea.type, value: a.textarea.name },
489
- { key: a.lookup.type, value: a.lookup.name },
490
- { key: a.image.type, value: a.image.name },
491
- { key: a["rich-text-editor"].type, value: a["rich-text-editor"].name }
492
- ],
493
- Decimal: [
494
- { key: a["number-spinner"].type, value: a["number-spinner"].name }
495
- ],
496
- Integer: [
497
- { key: a["number-spinner"].type, value: a["number-spinner"].name }
498
- ],
499
- Number: [
500
- { key: a["number-spinner"].type, value: a["number-spinner"].name },
501
- { key: a.switch.type, value: a.switch.name },
502
- { key: a["check-box"].type, value: a["check-box"].name }
503
- ],
504
- BigNumber: [
505
- { key: a["number-spinner"].type, value: a["number-spinner"].name }
506
- ],
507
- Date: [
508
- { key: a["date-picker"].type, value: a["date-picker"].name }
509
- ],
510
- DateTime: [
511
- { key: a["date-picker"].type, value: a["date-picker"].name }
512
- ],
513
- Boolean: [
514
- { key: a.switch.type, value: a.switch.name },
515
- { key: a["check-box"].type, value: a["check-box"].name }
516
- ],
517
- Enum: [
518
- { key: a["combo-list"].type, value: a["combo-list"].name },
519
- { key: a["radio-group"].type, value: a["radio-group"].name }
520
- ],
521
- Object: [
522
- { key: a.lookup.type, value: a.lookup.name },
523
- { key: a["combo-list"].type, value: a["combo-list"].name },
524
- { key: a["radio-group"].type, value: a["radio-group"].name }
525
- ]
526
- });
527
- let se = R;
528
- var H = /* @__PURE__ */ ((t) => (t.Form = "Form", t.Variable = "Variable", t))(H || {}), ve = /* @__PURE__ */ ((t) => (t.SimpleField = "SimpleField", t.ComplexField = "ComplexField", t))(ve || {});
529
- function Qe(t, e, n) {
530
- function o() {
531
- const r = n.componentId;
532
- if (!r)
533
- return !1;
534
- const i = t.formSchemaUtils.getViewModelIdByComponentId(r);
535
- if (!i)
536
- return !1;
537
- const { schema: v } = e, { designViewModelUtils: k } = t, b = k.getDgViewModel(i), m = b == null ? void 0 : b.fields.find((h) => h.id === v.binding.field);
538
- return !(!m || m.$type !== ve.SimpleField);
539
- }
540
- function l() {
541
- const { schema: r } = e;
542
- return !!t.formSchemaUtils.getVariableById(r.binding.field);
543
- }
544
- function p() {
545
- var v;
546
- const { schema: r } = e;
547
- let i = !0;
548
- if (!t || !((v = r.binding) != null && v.field))
549
- return i;
550
- switch (r.binding.type) {
551
- case H.Form: {
552
- i = o();
553
- break;
554
- }
555
- case H.Variable:
556
- i = l();
557
- }
558
- return i;
559
- }
560
- return { checkBindingFieldValidation: p };
561
- }
562
- const Xe = /* @__PURE__ */ J({
563
- name: "FDynamicFormGroupDesign",
564
- props: Ie,
565
- emits: ["change", "update:modelValue"],
566
- setup(t, e) {
567
- var q;
568
- const n = E(t.id), o = E(t.customClass), l = E(t.editor), p = E(t.label), r = E(t.modelValue), i = E(!0), v = E(((q = t.editor) == null ? void 0 : q.required) === !0), k = E(t.showLabel);
569
- E(t.type);
570
- const b = E(), m = W("designer-host-service"), h = W("design-item-context"), T = U(() => k.value ? t.showLabelType : "none"), {
571
- resolveEditorProps: B,
572
- resolveEditorType: O
573
- } = Je(), S = U(() => ({
574
- "form-group": !0,
575
- "farris-form-group": !0,
576
- "common-group": !0,
577
- "q-state-readonly": i.value,
578
- "form-group-in-canvas": !0
579
- })), d = U(() => {
580
- const G = l.value.type || "input-group", s = O(G), f = B(G, l.value);
581
- return () => x(s, ue({
582
- ref: b
583
- }, f, {
584
- modelValue: r.value,
585
- "onUpdate:modelValue": (c) => r.value = c
586
- }), null);
587
- });
588
- Q([() => t.id, () => t.customClass, () => t.editor, () => t.label, () => t.modelValue, () => t.readonly, () => t.showLabel], ([G, s, f, c, C, F, V]) => {
589
- var w;
590
- n.value = G, o.value = s, l.value = {
591
- ...f
592
- }, p.value = c, r.value = C, i.value = F, v.value = ((w = l.value) == null ? void 0 : w.required) === !0, k.value = V;
593
- }, {
594
- deep: !0
595
- });
596
- const g = !W("external-container-id"), {
597
- checkBindingFieldValidation: L
598
- } = Qe(m, h, t);
599
- function A() {
600
- const G = g ? L() : !0;
601
- return x(Ee, {
602
- id: `${n.value}-lable`,
603
- showType: T.value,
604
- required: v.value,
605
- text: p.value,
606
- title: p.value,
607
- valid: G,
608
- inValidTip: "绑定信息已失效,请切换绑定或移除控件"
609
- }, null);
610
- }
611
- const Z = U(() => {
612
- if (t.fill)
613
- return {
614
- maxWidth: "none"
615
- };
616
- });
617
- return e.expose({
618
- editorRef: b
619
- }), () => x("div", {
620
- id: `${n.value}-input-group`,
621
- class: o.value
622
- }, [x("div", {
623
- class: "farris-group-wrap",
624
- style: Z.value
625
- }, [x("div", {
626
- class: S.value
627
- }, [A(), x("div", {
628
- class: "farris-input-wrap"
629
- }, [d.value()])])])]);
630
- }
631
- });
632
- function Ye(t, e) {
633
- function n() {
634
- return !0;
635
- }
636
- function o() {
637
- return !0;
638
- }
639
- function l() {
640
- return !1;
641
- }
642
- function p() {
643
- return !0;
644
- }
645
- function r(m) {
646
- var d;
647
- const h = e == null ? void 0 : e.designViewModelUtils, T = e == null ? void 0 : e.formSchemaUtils, B = (d = t == null ? void 0 : t.componentInstance.value) == null ? void 0 : d.belongedComponentId;
648
- if (!B || !h || !T)
649
- return;
650
- const O = T.getViewModelIdByComponentId(B), S = h.getDgViewModel(O);
651
- S && S.removeField([m]);
652
- }
653
- function i(m, h) {
654
- const T = e == null ? void 0 : e.formSchemaUtils, { schema: B } = t;
655
- if (T.getComponents().find((S) => {
656
- let d = T.getControlsInCmpWidthBinding(S.viewModel, m);
657
- if (d = d.filter((y) => {
658
- var L;
659
- if (y.id === B.id)
660
- return !1;
661
- const g = h.type === "visible" ? y[h.type] : (L = y.editor) == null ? void 0 : L[h.type];
662
- if (g && g.type === "Expression" && g.expressionId === h.id)
663
- return !0;
664
- }), d.length)
665
- return !0;
666
- }))
667
- return !0;
668
- }
669
- function v(m) {
670
- var B;
671
- const h = e == null ? void 0 : e.formSchemaUtils, { schema: T } = t;
672
- if (h.getExpressions().length) {
673
- const O = h.getExpressions(), S = O.findIndex((d) => d.target === m);
674
- S > -1 && ((B = O[S].rules) == null || B.map((d) => {
675
- var y;
676
- switch (d.type) {
677
- case "visible":
678
- case "readonly":
679
- case "required": {
680
- const g = d.type === "visible" ? T[d.type] : (y = T.editor) == null ? void 0 : y[d.type];
681
- g && g.type === "Expression" && g.expressionId === d.id && (i(m, d) || (d.needDelete = !0));
682
- break;
683
- }
684
- default:
685
- i(m, d) || (d.needDelete = !0);
686
- }
687
- }), O[S].rules = O[S].rules.filter((d) => !d.needDelete));
688
- }
689
- }
690
- function k() {
691
- var h, T;
692
- const m = (h = t == null ? void 0 : t.parent) == null ? void 0 : h.componentInstance.value;
693
- ((T = m == null ? void 0 : m.schema) == null ? void 0 : T.type) === a["response-layout-item"].type && (m != null && m.schema.appearance.class) && (m.schema.appearance.class = m.schema.appearance.class.replace("f-form-layout", ""), m.schema.appearance.class = m.schema.appearance.class.replace("farris-form", ""), m.schema.appearance.class = m.schema.appearance.class.replace("farris-form-controls-inline", ""), m.schema.appearance.class = m.schema.appearance.class.replace("farris-form-auto", ""), m.schema.appearance.class = m.schema.appearance.class.trim().replace(" ", " "));
694
- }
695
- function b() {
696
- const { schema: m } = t, h = m.binding && m.binding.field;
697
- h && (r(h), v(h)), k();
698
- }
699
- return {
700
- canAccepts: l,
701
- checkCanDeleteComponent: o,
702
- checkCanMoveComponent: n,
703
- hideNestedPaddingInDesginerView: p,
704
- onRemoveComponent: b
705
- };
706
- }
707
- const Ke = /* @__PURE__ */ J({
708
- name: "FFormGroupDesign",
709
- props: Ne,
710
- emits: [],
711
- setup(t, e) {
712
- const n = E(), o = W("design-item-context"), l = W("designer-host-service"), p = Ye(o, l), r = me(n, o, p);
713
- return ae(() => {
714
- n.value.componentInstance = r, r.value.getPropConfig = (...i) => {
715
- var k, b, m;
716
- let v = Me[t.editor.type];
717
- return v && Object.keys(v).length === 0 && ((k = n.value) != null && k.editorRef) && ((m = (b = n.value) == null ? void 0 : b.editorRef) != null && m.getPropConfig) && (v = n.value.editorRef.getPropConfig(...i, r.value)), v;
718
- };
719
- }), e.expose(r.value), () => x(Xe, ue(t, {
720
- ref: n
721
- }), null);
722
- }
723
- });
724
- class _e {
725
- constructor(e = { value: [] }, n) {
726
- u(this, "editorType", "check-box");
727
- u(this, "value");
728
- u(this, "valueType", "boolean");
729
- // 编辑器配置
730
- u(this, "editiorConfig");
731
- const l = (Array.isArray(e.value) ? e.value : typeof e.value == "string" ? e.value.split(",") : []).map((p) => JSON.parse(p));
732
- this.value = l, this.editiorConfig = Object.assign({}, n);
733
- }
734
- clear() {
735
- this.value = [];
736
- }
737
- setValue(e) {
738
- this.value = e;
739
- }
740
- getValue() {
741
- return this.value;
742
- }
743
- getDisplayText() {
744
- return this.value.map((e) => e ? "是" : "否").join(",");
745
- }
746
- isEmpty() {
747
- return this.value.length === 0;
748
- }
749
- }
750
- class He {
751
- constructor(e = { textValue: "", value: "", valueField: "" }, n) {
752
- u(this, "editorType", "combo-lookup");
753
- u(this, "textValue");
754
- u(this, "value");
755
- u(this, "valueField");
756
- u(this, "valueType", "text");
757
- // 编辑器配置
758
- u(this, "editiorConfig");
759
- this.textValue = e == null ? void 0 : e.textValue, this.value = e == null ? void 0 : e.value, this.editiorConfig = Object.assign({}, n), this.valueField = e == null ? void 0 : e.valueField;
760
- }
761
- clear() {
762
- this.value = "", this.valueField = "", this.textValue = "";
763
- }
764
- getPropValue(e, n) {
765
- if (n.length > 1) {
766
- const o = n.shift();
767
- return e[o] ? this.getPropValue(e[o], n) : null;
768
- }
769
- return e[n[0]];
770
- }
771
- getTextValue(e) {
772
- const n = e.split("."), o = this.value.split(",").map((l) => this.getPropValue(l, X(n)));
773
- return o && o.length ? o.join(",") : "";
774
- }
775
- getValue() {
776
- const e = this.valueField.split("."), n = this.value.split(",").map((o) => this.getPropValue(o, X(e)));
777
- return n && n.length ? n.join(",") : "";
778
- }
779
- getDisplayText() {
780
- return this.getValue();
781
- }
782
- setValue(e) {
783
- throw new Error("Method not implemented.");
784
- }
785
- isEmpty() {
786
- return !this.valueField;
787
- }
788
- }
789
- class K {
790
- constructor(e = { value: "", displayFormat: "", valueFormat: "" }, n) {
791
- u(this, "editorType", "date-picker");
792
- u(this, "value");
793
- u(this, "valueType", "datetime");
794
- u(this, "displayFormat", "");
795
- u(this, "valueFormat", "");
796
- // 编辑器配置
797
- u(this, "editiorConfig");
798
- this.value = e == null ? void 0 : e.value, this.editiorConfig = Object.assign({}, n), this.displayFormat = (e == null ? void 0 : e.displayFormat) || (n == null ? void 0 : n.displayFormat) || "", this.valueFormat = (e == null ? void 0 : e.valueFormat) || (n == null ? void 0 : n.valueFormat) || "";
799
- }
800
- formatValue() {
801
- const { formatTo: e, parseToDate: n } = fe();
802
- if (!this.value)
803
- return "";
804
- const o = n(this.value, this.valueFormat);
805
- return e(o, this.displayFormat);
806
- }
807
- setValue(e) {
808
- this.value = e;
809
- }
810
- getValue() {
811
- return this.value;
812
- }
813
- getDisplayText() {
814
- return this.formatValue();
815
- }
816
- isEmpty() {
817
- return !this.value;
818
- }
819
- clear() {
820
- this.value = void 0;
821
- }
822
- }
823
- class ee {
824
- constructor(e = { begin: "", end: "", displayFormat: "", valueFormat: "" }, n = {}) {
825
- u(this, "editorType", "date-range");
826
- u(this, "begin", "");
827
- u(this, "end", "");
828
- u(this, "valueType", "datetime");
829
- u(this, "value", "");
830
- // 编辑器配置
831
- u(this, "editiorConfig");
832
- u(this, "displayFormat", "");
833
- u(this, "valueFormat", "");
834
- this.begin = (e == null ? void 0 : e.begin) || "", this.end = (e == null ? void 0 : e.end) || "", this.editiorConfig = Object.assign({}, n, { delimiter: "~" }), this.displayFormat = (e == null ? void 0 : e.displayFormat) || (n == null ? void 0 : n.displayFormat) || "", this.valueFormat = (e == null ? void 0 : e.valueFormat) || (n == null ? void 0 : n.valueFormat) || "", this.value = (this.begin === null ? "" : this.begin) + "~" + (this.end === null ? "" : this.end);
835
- }
836
- clear() {
837
- this.begin = "", this.end = "", this.value = "";
838
- }
839
- formatValue(e) {
840
- const { formatTo: n, parseToDate: o } = fe();
841
- if (!e)
842
- return "";
843
- const l = o(e, this.valueFormat);
844
- return n(l, this.displayFormat);
845
- }
846
- getValue() {
847
- return {
848
- begin: this.begin,
849
- end: this.end
850
- };
851
- }
852
- // TODO
853
- getDisplayText() {
854
- return !this.begin && !this.end ? "" : (this.begin === null ? "" : this.formatValue(this.begin)) + "~" + (this.end === null ? "" : this.formatValue(this.end));
855
- }
856
- setValue(e) {
857
- if (e) {
858
- const n = e.split(this.editiorConfig.delimiter);
859
- this.begin = n[0] || "", this.end = n[1] || "", this.value = e;
860
- } else
861
- this.clear();
862
- }
863
- isEmpty() {
864
- return !this.begin && !this.end;
865
- }
866
- }
867
- class ye {
868
- constructor(e = { value: "", valueList: [] }, n) {
869
- u(this, "editorType", "combo-list");
870
- u(this, "value");
871
- u(this, "valueType", "enum");
872
- u(this, "valueList", []);
873
- // 编辑器配置
874
- u(this, "editiorConfig");
875
- this.value = e == null ? void 0 : e.value, this.editiorConfig = Object.assign({}, n), this.editiorConfig.data && this.editiorConfig.data.length ? this.valueList = this.editiorConfig.data : this.valueList = (e == null ? void 0 : e.valueList) || [];
876
- }
877
- clear() {
878
- const e = typeof this.value;
879
- this.value = e === "string" ? "" : void 0;
880
- }
881
- getValue() {
882
- return this.value;
883
- }
884
- getDisplayText() {
885
- var l, p;
886
- const e = typeof this.value;
887
- let n = "", o = [];
888
- switch (e) {
889
- case "string":
890
- o = this.value.split(",") || [], n = this.valueList.filter((r) => o.indexOf(r.value + "") > -1).map((r) => r.name).join(",");
891
- break;
892
- case "boolean":
893
- n = ((l = this.valueList.find((r) => r.value === this.value)) == null ? void 0 : l.name) || "";
894
- break;
895
- case "number":
896
- n = ((p = this.valueList.find((r) => r.value === this.value)) == null ? void 0 : p.name) || "";
897
- break;
898
- }
899
- return n;
900
- }
901
- // setValue(data: { value: string; displayText: string }) {
902
- // // this.displayText = data.dispalyText;
903
- // const enumValues = getEnumValues(data);
904
- // this.value = enumValues;
905
- // return this.displayText;
906
- // }
907
- setValue(e) {
908
- this.value = e.value;
909
- }
910
- isEmpty() {
911
- return !this.value && this.value !== !1 && this.value !== 0;
912
- }
913
- }
914
- class De {
915
- constructor(e = { value: "", displayText: "", displayField: "", isInputText: !1 }, n) {
916
- u(this, "editorType", "input-group");
917
- // 通过弹窗返回的若干个值对象构成的数组
918
- u(this, "value");
919
- u(this, "valueType", "text");
920
- // 控件内显示的值
921
- u(this, "displayText");
922
- // 弹窗模式下,取列表中哪个字段的值映射到当前字段
923
- u(this, "valueField");
924
- // 是否是手动输入的值
925
- u(this, "isInputText");
926
- // 编辑器配置
927
- u(this, "editiorConfig");
928
- this.value = e == null ? void 0 : e.value, this.displayText = e == null ? void 0 : e.displayText, this.valueField = e == null ? void 0 : e.displayField, this.isInputText = e == null ? void 0 : e.isInputText, this.editiorConfig = Object.assign({}, n);
929
- }
930
- clear() {
931
- this.value = "", this.displayText = "", this.valueField = "";
932
- }
933
- getPropValue(e, n) {
934
- if (n.length > 1) {
935
- const o = n.shift();
936
- return e[o] ? this.getPropValue(e[o], n) : "";
937
- }
938
- return e[n[0]];
939
- }
940
- getTextValue(e) {
941
- const n = e.split("."), o = this.value.map((l) => this.getPropValue(l, X(n)));
942
- return o && o.length ? o.join(",") : "";
943
- }
944
- getValue() {
945
- return this.value;
946
- }
947
- getDisplayText() {
948
- return this.getValue();
949
- }
950
- setValue(e) {
951
- throw new Error("Method not implemented.");
952
- }
953
- isEmpty() {
954
- var e;
955
- return !this.displayText && (this.value == null || !((e = this.value) != null && e.length));
956
- }
957
- }
958
- class et {
959
- constructor(e = { mapFields: [], value: "", valueField: "", isInputText: !1, helpId: "" }, n) {
960
- u(this, "editorType", "lookup");
961
- u(this, "helpId");
962
- u(this, "mapFields");
963
- u(this, "value");
964
- u(this, "valueField");
965
- u(this, "valueType", "text");
966
- // 帮助的值是否为手动输入的任意值,对应帮助的任意输入属性nosearch
967
- u(this, "isInputText");
968
- // 编辑器配置
969
- u(this, "editiorConfig");
970
- this.editiorConfig = Object.assign({}, n), this.value = (e == null ? void 0 : e.value) || "", this.valueField = (e == null ? void 0 : e.valueField) || (n == null ? void 0 : n.valueField), this.mapFields = e.mapFields, this.isInputText = (e == null ? void 0 : e.isInputText) || (n == null ? void 0 : n.isInputText), this.helpId = (e == null ? void 0 : e.helpId) || (n == null ? void 0 : n.helpId);
971
- }
972
- clear() {
973
- this.value = "", this.mapFields = [];
974
- }
975
- getValue() {
976
- return this.mapFields.map((e) => Be(e, this.valueField || "id")).join(",");
977
- }
978
- getDisplayText() {
979
- return this.value;
980
- }
981
- setValue(e) {
982
- throw new Error("Method not implemented.");
983
- }
984
- isEmpty() {
985
- return !this.mapFields.length;
986
- }
987
- }
988
- class tt extends K {
989
- constructor(n = { value: "", displayFormat: "", valueFormat: "" }, o) {
990
- super(n, o);
991
- u(this, "editorType", "month-picker");
992
- }
993
- }
994
- class nt extends ee {
995
- constructor(n = { begin: "", end: "", displayFormat: "", valueFormat: "" }, o) {
996
- super(n, o);
997
- u(this, "editorType", "month-range");
998
- }
999
- }
1000
- class ot {
1001
- constructor(e = { begin: null, end: null }, n) {
1002
- u(this, "editorType", "number-range");
1003
- u(this, "begin");
1004
- u(this, "end");
1005
- u(this, "valueType", "number");
1006
- // 编辑器配置
1007
- u(this, "editiorConfig");
1008
- this.editiorConfig = Object.assign({}, n), this.begin = (e == null ? void 0 : e.begin) == null ? null : parseFloat(e.begin), this.end = (e == null ? void 0 : e.end) == null ? null : parseFloat(e.end);
1009
- }
1010
- clear() {
1011
- this.begin = null, this.end = null;
1012
- }
1013
- getValue() {
1014
- return {
1015
- begin: this.begin,
1016
- end: this.end
1017
- };
1018
- }
1019
- getDisplayText() {
1020
- return this.begin === null && this.end === null ? "" : (this.begin === null ? "" : this.begin) + "~" + (this.end === null ? "" : this.end);
1021
- }
1022
- setValue(e) {
1023
- this.begin = e.begin == null ? null : parseFloat(e.begin), this.end = e.end == null ? null : parseFloat(e.end);
1024
- }
1025
- isEmpty() {
1026
- return this.begin == null && this.end == null;
1027
- }
1028
- }
1029
- class rt {
1030
- constructor(e = { value: "" }, n) {
1031
- u(this, "editorType", "number-spinner");
1032
- u(this, "value");
1033
- u(this, "valueType", "number");
1034
- // 编辑器配置
1035
- u(this, "editiorConfig");
1036
- this.editiorConfig = Object.assign({}, n);
1037
- const o = parseFloat(e.value);
1038
- this.value = isNaN(o) ? null : o;
1039
- }
1040
- clear() {
1041
- this.value = null;
1042
- }
1043
- getValue() {
1044
- return this.value;
1045
- }
1046
- getDisplayText() {
1047
- if (this.isEmpty())
1048
- return "";
1049
- const { formatTo: e } = Oe();
1050
- return e(this.value, this.editiorConfig);
1051
- }
1052
- setValue(e) {
1053
- this.value = isNaN(parseFloat(e)) ? null : e;
1054
- }
1055
- isEmpty() {
1056
- return this.value == null || isNaN(this.value);
1057
- }
1058
- }
1059
- class lt {
1060
- constructor(e = { value: null, valueList: [] }, n) {
1061
- u(this, "editorType", "radio-group");
1062
- u(this, "value");
1063
- u(this, "valueType", "enum");
1064
- u(this, "valueList", []);
1065
- // 编辑器配置
1066
- u(this, "editiorConfig");
1067
- this.editiorConfig = Object.assign({}, n), this.value = e == null ? void 0 : e.value, this.editiorConfig.data && this.editiorConfig.data.length ? this.valueList = this.editiorConfig.data : this.valueList = (e == null ? void 0 : e.valueList) || [];
1068
- }
1069
- clear() {
1070
- this.value = void 0, this.valueList = [];
1071
- }
1072
- getValue() {
1073
- return this.value;
1074
- }
1075
- getDisplayText() {
1076
- var e;
1077
- return ((e = this.valueList.find((n) => n.value === this.value)) == null ? void 0 : e.name) || "";
1078
- }
1079
- setValue(e) {
1080
- this.value = e;
1081
- }
1082
- isEmpty() {
1083
- return !this.value && this.value !== 0 && this.value !== !1;
1084
- }
1085
- }
1086
- class st extends K {
1087
- constructor(n = { value: "", displayFormat: "", valueFormat: "" }, o) {
1088
- super(n, o);
1089
- u(this, "editorType", "year-picker");
1090
- }
1091
- }
1092
- class be {
1093
- constructor(e = { value: "" }, n) {
1094
- u(this, "editorType", "text");
1095
- u(this, "value");
1096
- u(this, "valueType", "text");
1097
- // 编辑器配置
1098
- u(this, "editiorConfig");
1099
- this.value = e.value;
1100
- }
1101
- clear() {
1102
- this.value = void 0;
1103
- }
1104
- getValue() {
1105
- return this.value;
1106
- }
1107
- getDisplayText() {
1108
- return this.getValue();
1109
- }
1110
- setValue(e) {
1111
- this.value = e;
1112
- }
1113
- isEmpty() {
1114
- return !this.value;
1115
- }
1116
- }
1117
- class it extends K {
1118
- constructor(n = { value: "", displayFormat: "", valueFormat: "" }, o) {
1119
- super(n, o);
1120
- u(this, "editorType", "datetime-picker");
1121
- }
1122
- }
1123
- class at extends ee {
1124
- constructor(n = { begin: "", end: "", displayFormat: "", valueFormat: "" }, o = {}) {
1125
- super(n, o);
1126
- // 这个属性会在后面进行比对
1127
- u(this, "editorType", "datetime-range");
1128
- u(this, "valueType", "datetime");
1129
- }
1130
- }
1131
- class ut extends ye {
1132
- constructor(n = { value: "", valueList: [] }, o) {
1133
- super(n, o);
1134
- u(this, "editorType", "check-group");
1135
- }
1136
- }
1137
- function Ce() {
1138
- function t(e, n, o) {
1139
- switch (e) {
1140
- case "check-box":
1141
- return new _e(n, o);
1142
- case "combo-list":
1143
- return new ye(n, o);
1144
- case "combo-lookup":
1145
- return new He(n, o);
1146
- case "input-group":
1147
- return new De(n, o);
1148
- case "year-picker":
1149
- return new st(n, o);
1150
- case "date-picker":
1151
- return new K(n, o);
1152
- case "datetime-range":
1153
- return new at(n, o);
1154
- case "date-range":
1155
- return new ee(n, o);
1156
- case "datetime-picker":
1157
- return new it(n, o);
1158
- case "lookup":
1159
- return new et(n, o);
1160
- case "month-picker":
1161
- return new tt(n, o);
1162
- case "month-range":
1163
- return new nt(n, o);
1164
- case "number-range":
1165
- return new ot(n, o);
1166
- case "number-spinner":
1167
- return new rt(n, o);
1168
- case "radio-group":
1169
- return new lt(n, o);
1170
- case "check-group":
1171
- return new ut(n, o);
1172
- default:
1173
- return new be(n, o);
1174
- }
1175
- }
1176
- return { createConditionValue: t };
1177
- }
1178
- function Fe(t = "query-solution") {
1179
- function e(r) {
1180
- let i = "input-group";
1181
- switch (r) {
1182
- case "year-picker":
1183
- case "month-picker":
1184
- case "month-range":
1185
- case "date-range":
1186
- case "datetime-range":
1187
- case "datetime-picker":
1188
- i = "date-picker";
1189
- break;
1190
- default:
1191
- i = r;
1192
- }
1193
- return i;
1194
- }
1195
- function n(r) {
1196
- const i = r.editor ? r.editor.type : "input-group";
1197
- return r.editor.type = e(i), r.editor.type === "date-picker" ? (i.indexOf("range") > -1 && (r.editor.enablePeriod = !0), i.indexOf("datetime") > -1 && (r.editor.showTime = !0), i.indexOf("year") > -1 && (r.editor.selectMode = "year"), i.indexOf("month") > -1 && (r.editor.selectMode = "month"), r.editor.weekSelect && (r.editor.selectMode = "week")) : r.editor.type === "number-spinner" || r.editor.type === "number-range" ? (r.editor.showZero = !0, r.editor.nullable = !0, r.editor.needValid = !0) : r.editor.type === "check-group" && t === "filter-bar" ? r.editor.direction = "vertical" : (r.editor.type === "lookup" || r.editor.type === "combo-list") && (r.editor.enableClear = Object.prototype.hasOwnProperty.call(r.editor, "enableClear") ? r.editor.enableClear : !0), i === "input-group" && !r.editor.placeholder && (r.editor.placeholder = Y.getLocaleValue("input-group.placeholder")), r.editor;
1198
- }
1199
- function o(r) {
1200
- return r.map((v) => Object.assign({}, v)).map((v) => (v.visible = Object.prototype.hasOwnProperty.call(v, "visible") ? v.visible : !0, v.editor = n(v), v));
1201
- }
1202
- function l(r, i, v, k) {
1203
- switch (r.value.editorType) {
1204
- case "combo-list":
1205
- k.newValue && (r.value.valueList = k.newValue.map((b) => ({ name: b.name, value: b.value })));
1206
- break;
1207
- case "radio-group":
1208
- r.value.valueList = [v.data.find((b) => b.value === i)];
1209
- break;
1210
- case "year-range":
1211
- case "month-range":
1212
- case "date-range":
1213
- case "datetime-range":
1214
- r.value.setValue(i);
1215
- break;
1216
- }
1217
- }
1218
- function p(r, i, v) {
1219
- var T, B, O, S, d, y;
1220
- const k = X((T = r.get(i.fieldCode)) == null ? void 0 : T.editor), b = (B = r.get(i.fieldCode)) == null ? void 0 : B.id, m = Object.prototype.hasOwnProperty.call(i, "visible") ? i.visible : (O = r.get(i.fieldCode)) == null ? void 0 : O.visible;
1221
- let h = !0;
1222
- if (((S = i.value) == null ? void 0 : S.editorType) === "lookup" && k) {
1223
- k.idValue = (d = i.value.mapFields) == null ? void 0 : d.map((L) => L.id).join(",");
1224
- const { onClear: g } = k;
1225
- k.onClear = (L) => {
1226
- i.value.mapFields = [], v(i, ""), g && g(L);
1227
- }, k["onUpdate:dataMapping"] = (L) => {
1228
- i.value.mapFields = L.items || [], v(i, i.value.getValue());
1229
- }, h = !1;
1230
- } else ((y = i.value) == null ? void 0 : y.editorType) === "number-range" && k ? (k.beginValue = i.value.begin, k.onBeginValueChange = (g) => {
1231
- i.value.begin = g, v(i, g);
1232
- }, k.endValue = i.value.end, k.onEndValueChange = (g) => {
1233
- i.value.end = g, v(i, g);
1234
- }, h = !1) : k && ["year-range", "month-range", "date-range", "datetime-range"].find((g) => {
1235
- var L;
1236
- return g === ((L = i.value) == null ? void 0 : L.editorType);
1237
- }) && (k.beginValue = i.value.begin, k.endValue = i.value.end);
1238
- return Object.prototype.hasOwnProperty.call(i, "disabled") && (k.disabled = i.disabled), { id: b, editor: k, visible: m, needEmitChange: h };
1239
- }
1240
- return { getSingleControlType: n, convertToControls: o, conditionChangeHandler: l, renderFieldConditionEditor: p };
1241
- }
1242
- function te(t, e, n = "query-solution") {
1243
- const { convertToControls: o } = Fe(n), l = E(t.fields), p = E([]), r = /* @__PURE__ */ new Map(), { createConditionValue: i } = Ce();
1244
- function v(b = !0) {
1245
- b && (l.value = o(l.value)), l.value.reduce((m, h) => (m.set(h.labelCode, h), m), r);
1246
- }
1247
- function k(b) {
1248
- return b.forEach((m) => {
1249
- if (m) {
1250
- const h = r.get(m.fieldCode);
1251
- h.controlType && (m.value = i(h.controlType, m.value, h.editor));
1252
- }
1253
- }), b;
1254
- }
1255
- return { convertToControls: o, fields: l, fieldMap: r, fieldConditions: p, loadFieldConfigs: v, initialConditionValue: k };
1256
- }
1257
- function ke(t, e, n) {
1258
- const o = E(null), l = E(n), p = E(0);
1259
- function r(b, m) {
1260
- let h = null;
1261
- return function() {
1262
- const T = arguments;
1263
- h ? (clearTimeout(h), h = setTimeout(() => {
1264
- h = null, b(...T);
1265
- }, 200)) : (b(...T), h = setTimeout(() => {
1266
- h = null;
1267
- }, 200));
1268
- };
1269
- }
1270
- function i() {
1271
- l.value && (o.value = new ResizeObserver(r((b) => {
1272
- const m = b[0];
1273
- p.value = m.contentRect.width;
1274
- })), o.value.observe(l.value));
1275
- }
1276
- function v(b) {
1277
- let h = "col-12";
1278
- return b > 250 * 6 ? h = "col-2" : b > 250 * 4 ? h = "col-3" : b > 250 * 3 ? h = "col-4" : b > 250 * 2 && (h = "col-6"), h;
1279
- }
1280
- const k = U(() => v(p.value));
1281
- return Q([n], ([b]) => {
1282
- l.value = b, i();
1283
- }), {
1284
- conditionClass: k,
1285
- resizeObserver: o
1286
- };
1287
- }
1288
- const Nn = /* @__PURE__ */ J({
1289
- name: "FConditionFieldsDesign",
1290
- directives: {
1291
- "area-response": Pe
1292
- },
1293
- props: D,
1294
- emits: ["valueChange", "blur", "focus", "click", "input"],
1295
- setup(t, e) {
1296
- const n = E(), o = E(t.key), l = E(t.conditions), p = te(t), {
1297
- fieldMap: r,
1298
- loadFieldConfigs: i
1299
- } = p, v = ke(t, e, n), {
1300
- resizeObserver: k
1301
- } = v;
1302
- i(!0), de(() => {
1303
- var h;
1304
- (h = k.value) == null || h.unobserve(n.value);
1305
- }), Q(() => t.conditions, () => {
1306
- l.value = t.conditions;
1307
- });
1308
- const b = U(() => ({
1309
- // row: true,
1310
- "f-utils-flex-row-wrap": !0,
1311
- "farris-form": !0,
1312
- "condition-div": !0
1313
- }));
1314
- function m() {
1315
- return l.value.map((h) => {
1316
- var O, S;
1317
- const T = (O = r.get(h.fieldCode)) == null ? void 0 : O.editor;
1318
- T && (T.disabled = !0);
1319
- let B = ((S = T == null ? void 0 : T.appearance) == null ? void 0 : S.class) || t.itemClass;
1320
- return T != null && T.multiLineLabel && (B = B + " farris-group-multi-label"), x(Ke, {
1321
- customClass: B,
1322
- label: (T == null ? void 0 : T.showLabel) === !1 ? " " : h.fieldName,
1323
- required: T == null ? void 0 : T.required,
1324
- editor: T,
1325
- type: "form-group"
1326
- }, null);
1327
- });
1328
- }
1329
- return () => ce(x("div", {
1330
- class: b.value,
1331
- key: o.value,
1332
- ref: n
1333
- }, [m()]), [[pe("area-response")]]);
1334
- }
1335
- }), ie = /* @__PURE__ */ J({
1336
- name: "FConditionFields",
1337
- props: D,
1338
- emits: ["valueChange", "blur", "focus", "click", "input"],
1339
- setup(t, e) {
1340
- const n = E(), o = Y.getLocale(), l = E(t.key), p = E(t.conditions), {
1341
- renderFieldConditionEditor: r,
1342
- conditionChangeHandler: i
1343
- } = Fe(), v = te(t), {
1344
- initialConditionValue: k,
1345
- fieldMap: b,
1346
- loadFieldConfigs: m
1347
- } = v, h = ke(t, e, n), {
1348
- resizeObserver: T
1349
- } = h;
1350
- m(!0), k(p.value), de(() => {
1351
- var d;
1352
- (d = T.value) == null || d.unobserve(n.value);
1353
- }), Q(() => t.fields, () => {
1354
- m(!0);
1355
- }), Q(() => t.conditions, () => {
1356
- p.value = t.conditions, k(p.value);
1357
- });
1358
- const B = U(() => ({
1359
- // row: true,
1360
- "f-utils-flex-row-wrap": !0,
1361
- "farris-form": !0,
1362
- "condition-div": !0,
1363
- "farris-form-controls-inline": !o || t.isControlInline === !0 || t.isControlInline === "auto" && o !== "en"
1364
- }));
1365
- function O(d, y, g, L) {
1366
- i(d, y, g, L), e.emit("valueChange", y, d);
1367
- }
1368
- function S() {
1369
- return p.value.map((d) => {
1370
- var q;
1371
- const {
1372
- id: y,
1373
- editor: g,
1374
- needEmitChange: L,
1375
- visible: A
1376
- } = r(b, d, O);
1377
- let Z = ((q = g == null ? void 0 : g.appearance) == null ? void 0 : q.class) || t.itemClass;
1378
- return g != null && g.multiLineLabel && (Z = Z + " farris-group-multi-label"), x(he, {
1379
- id: y,
1380
- key: y,
1381
- visible: A,
1382
- customClass: Z,
1383
- label: (g == null ? void 0 : g.showLabel) === !1 ? " " : d.fieldName,
1384
- editor: g,
1385
- required: g == null ? void 0 : g.required,
1386
- modelValue: d.value.value,
1387
- "onUpdate:modelValue": (G) => d.value.value = G,
1388
- onChange: (G, s) => {
1389
- L && O(d, G, g, s);
1390
- }
1391
- }, null);
1392
- });
1393
- }
1394
- return () => ce(x("div", {
1395
- class: B.value,
1396
- key: l.value,
1397
- ref: n
1398
- }, [S()]), [[pe("area-response")]]);
1399
- }
1400
- });
1401
- var Te = /* @__PURE__ */ ((t) => (t[t.Value = 0] = "Value", t[t.SmartHelp = 1] = "SmartHelp", t[t.Enum = 2] = "Enum", t[t.Express = 3] = "Express", t))(Te || {});
1402
- function dt() {
1403
- const { getLocaleValue: t } = Y;
1404
- return { conditionListLocale: {
1405
- // 添加条件
1406
- add: t("condition.add"),
1407
- // 生成条件组
1408
- create: t("condition.create"),
1409
- // 重置
1410
- reset: t("condition.reset"),
1411
- and: t("condition.and"),
1412
- or: t("condition.or")
1413
- } };
1414
- }
1415
- function ct() {
1416
- const { getLocaleValue: t } = Y;
1417
- return { operatorsLocale: {
1418
- equal: t("operators.equal"),
1419
- notEqual: t("operators.notEqual"),
1420
- greater: t("operators.greater"),
1421
- greaterOrEqual: t("operators.greaterOrEqual"),
1422
- lessOrEqual: t("operators.lessOrEqual"),
1423
- less: t("operators.less"),
1424
- contains: t("operators.contains"),
1425
- startWith: t("operators.startWith"),
1426
- endWith: t("operators.endWith")
1427
- } };
1428
- }
1429
- var Ve = /* @__PURE__ */ ((t) => (t.Equal = "0", t.NotEqual = "1", t.Greater = "2", t.GreaterOrEqual = "3", t.Less = "4", t.LessOrEqual = "5", t.Like = "6", t.LikeStartWith = "7", t.LikeEndWith = "8", t.In = "9", t.NotIn = "10", t))(Ve || {});
1430
- function pt() {
1431
- const { operatorsLocale: t } = ct();
1432
- return [
1433
- {
1434
- value: "0",
1435
- name: t.equal
1436
- // 等于
1437
- },
1438
- {
1439
- value: "1",
1440
- name: t.equal
1441
- // 不等于
1442
- },
1443
- {
1444
- value: "2",
1445
- name: t.equal
1446
- // 大于
1447
- },
1448
- {
1449
- value: "3",
1450
- name: t.equal
1451
- // 大于等于
1452
- },
1453
- {
1454
- value: "4",
1455
- name: t.less
1456
- // 小于
1457
- },
1458
- {
1459
- value: "5",
1460
- name: t.lessOrEqual
1461
- // 小于等于
1462
- },
1463
- {
1464
- value: "6",
1465
- name: t.contains
1466
- // 包含
1467
- },
1468
- {
1469
- value: "7",
1470
- name: t.startWith
1471
- // 开始是
1472
- },
1473
- {
1474
- value: "8",
1475
- name: t.endWith
1476
- // 结束是
1477
- }
1478
- ];
1479
- }
1480
- const mt = {
1481
- "button-edit": ["0", "1", " 6", "7", "8"],
1482
- "check-box": ["0"],
1483
- "combo-list": ["0", "1"],
1484
- "combo-lookup": ["0", "1", " 6", "7", "8"],
1485
- "date-picker": ["0", "1", "2", "3", "4", "5"],
1486
- "date-range": [],
1487
- "datetime-picker": ["0", "1", "2", "3", "4", "5"],
1488
- "datetime-range": [],
1489
- "month-picker": ["0", "1", "2", "3", "4", "5"],
1490
- "month-range": [],
1491
- "year-picker": ["0", "1", "2", "3", "4", "5"],
1492
- "year-range": [],
1493
- "input-group": ["0", "1", "6", "7", "8"],
1494
- lookup: ["0", "1"],
1495
- "number-range": [],
1496
- "number-spinner": ["0", " 1", "2", "3", "4", "5"],
1497
- "radio-group": ["0"],
1498
- text: ["0", "1", " 6", "7", "8"]
1499
- };
1500
- function ht(t, e, n) {
1501
- const { fieldMap: o } = n;
1502
- function l(p) {
1503
- const r = o.get(p.fieldCode);
1504
- if (!r)
1505
- return [];
1506
- const i = r.editor.type, v = new Set(mt[i]);
1507
- return pt().filter((b) => v.has(b.value));
1508
- }
1509
- return { getCompareOperators: l };
1510
- }
1511
- function ft() {
1512
- const t = E({ relation: 0, items: [], children: [], path: [], groupId: 0, level: 0 }), e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
1513
- let o = 0;
1514
- function l() {
1515
- return {
1516
- id: "",
1517
- fieldCode: "",
1518
- fieldName: "",
1519
- compareType: Ve.Equal,
1520
- valueType: Te.Value,
1521
- value: new be(),
1522
- relation: 0,
1523
- conditionId: Date.now()
1524
- };
1525
- }
1526
- function p(s, f) {
1527
- return { relation: s, items: [], children: [], path: [], groupId: ++o, level: f };
1528
- }
1529
- function r() {
1530
- const s = Object.assign({}, t.value);
1531
- n.forEach((f, c) => {
1532
- f.groupId === s.groupId && n.set(c, s);
1533
- }), e.forEach((f, c) => {
1534
- f.groupId === s.groupId && e.set(c, s);
1535
- }), t.value = s;
1536
- }
1537
- function i(s) {
1538
- const f = /* @__PURE__ */ new Map();
1539
- let c = 0;
1540
- return s.forEach((C, F) => {
1541
- var V, w;
1542
- if (c += ((V = C.lBracket) == null ? void 0 : V.length) || 0, f.set(F, c), c -= ((w = C.rBracket) == null ? void 0 : w.length) || 0, c < 0)
1543
- throw new Error("The right bracket is out of range.");
1544
- }), f;
1545
- }
1546
- function v(s, f, c, C, F) {
1547
- for (let V = 0; V < f; V++) {
1548
- const w = s + (V + 1), N = p(F, w);
1549
- c.children.push(N), n.set(N.groupId, c), c = c.children[c.children.length - 1], C.push(c);
1550
- }
1551
- return c;
1552
- }
1553
- function k(s, f, c, C, F) {
1554
- for (let M = f; M <= 0; M++)
1555
- C.pop();
1556
- const V = C[C.length - 1];
1557
- if (!V)
1558
- throw new Error("The group path is out of range");
1559
- const w = s + f, N = p(F, w);
1560
- return V.children.push(N), n.set(N.groupId, V), c = V.children[V.children.length - 1], C.push(c), c;
1561
- }
1562
- function b(s, f, c, C) {
1563
- c.pop();
1564
- const F = c[c.length - 1], V = p(C, s);
1565
- return F.children.push(V), n.set(V.groupId, F), f = F.children[F.children.length - 1], c.push(f), f;
1566
- }
1567
- function m(s, f, c, C, F, V) {
1568
- let w = s[s.length - 1];
1569
- if (!w)
1570
- throw new Error("The group path is out of range");
1571
- const N = f.get(C) || 0, M = f.get(c) || 0;
1572
- if (c < 0 || c === C)
1573
- return s[s.length - 1];
1574
- const j = N - M, z = F && F.relation !== void 0 ? F.relation : 1;
1575
- return w = j > 0 ? v(M, j, w, s, z) : w, w = j < 0 ? k(M, j, w, s, z) : w, w = j === 0 && M > 0 && N > 0 && F && V && !!F.rBracket && !!V.lBracket ? b(M, w, s, z) : w, w;
1576
- }
1577
- function h(s) {
1578
- const c = { relation: s.length && s[0].relation !== void 0 ? s[0].relation : 1, items: [], children: [], path: [], groupId: 0, level: 0 }, C = [c], F = i(s);
1579
- return s.forEach((V, w) => {
1580
- const N = w - 1, M = s[N], j = m(C, F, N, w, M, V);
1581
- j.items.push(V), e.set(V.conditionId, j);
1582
- }), t.value = c, c;
1583
- }
1584
- function T() {
1585
- const s = l();
1586
- e.set(s.conditionId, t.value), t.value.items.push(s);
1587
- }
1588
- function B(s) {
1589
- if (!s)
1590
- return;
1591
- const f = e.get(s.conditionId);
1592
- if (f) {
1593
- const c = f.items.findIndex((F) => F.conditionId === s.conditionId) + 1, C = l();
1594
- e.set(C.conditionId, f), f.items.splice(c, 0, C), r();
1595
- }
1596
- }
1597
- function O(s, f, c, C) {
1598
- s.reduce((F, V) => {
1599
- const w = V.conditionId !== void 0, N = V.groupId !== void 0;
1600
- if (w) {
1601
- const M = V;
1602
- c.push(M), F.items.set(M.conditionId, M);
1603
- }
1604
- if (N) {
1605
- const M = V;
1606
- C.push(M), F.groups.set(M.groupId, M);
1607
- }
1608
- return F;
1609
- }, f);
1610
- }
1611
- function S(s, f, c, C, F) {
1612
- s && (s.items = f.length ? s.items.filter((V) => !c.has(V.conditionId)) : s.items, s.children = C.length ? s.children.filter((V) => !F.has(V.groupId)) : s.children);
1613
- }
1614
- function d(s, f, c) {
1615
- f.forEach((C) => {
1616
- s.items.push(C), e.set(C.conditionId, s);
1617
- }), c.forEach((C) => {
1618
- s.children.push(C), n.set(C.groupId, s);
1619
- });
1620
- }
1621
- function y(s) {
1622
- const f = s[0], c = f.conditionId !== void 0 ? e.get(f.conditionId) : n.get(f.groupId), C = { items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Map() }, F = [], V = [];
1623
- if (c) {
1624
- O(s, C, F, V), S(c, F, C.items, V, C.groups);
1625
- const w = p(c.relation, c.level + 1);
1626
- d(w, F, V), c.children.push(w), n.set(w.groupId, c), r();
1627
- }
1628
- }
1629
- function g(s) {
1630
- const f = [...s.items], c = [...s.children], C = n.get(s.groupId);
1631
- C && (C.children = C.children.filter((F) => F.groupId !== s.groupId), n.delete(s.groupId), f.forEach((F) => {
1632
- C.items.push(F), e.set(F.conditionId, C);
1633
- }), c.forEach((F) => {
1634
- C.children.push(F), n.set(F.groupId, C);
1635
- }), r());
1636
- }
1637
- function L(s) {
1638
- s.relation = s.relation === 1 ? 2 : 1, r();
1639
- }
1640
- let A;
1641
- function Z(s) {
1642
- const { relation: f } = s;
1643
- return (s.children && s.children.length ? s.children.map((C, F, V) => {
1644
- const w = A(C);
1645
- return w[0].lBracket = (w[0].lBracket || "") + "(", w[w.length - 1].rBracket = (w[w.length - 1].rBracket || "") + ")", w[w.length - 1].relation = F < V.length - 1 ? f : 0, w;
1646
- }) : []).flat();
1647
- }
1648
- A = (s = t.value) => {
1649
- const { relation: f } = s, c = s.items.map((F, V, w) => (F.lBracket = V === 0 ? "(" : "", F.rBracket = V === w.length - 1 ? ")" : "", F.relation = V < w.length - 1 ? f || 1 : 0, F)), C = Z(s);
1650
- return [...c, ...C];
1651
- };
1652
- function q(s) {
1653
- const f = s || t.value;
1654
- if (f.children.length && f.children.forEach((c) => {
1655
- q(c);
1656
- }), f.level === 0 && !f.items.length && f.children.length === 1) {
1657
- const c = f.children[0];
1658
- t.value.relation = c.relation, g(c);
1659
- } else f.items.length === 0 && f.children.length <= 1 && g(f);
1660
- }
1661
- function G(s) {
1662
- const f = e.get(s.conditionId);
1663
- f && (f.items = f.items.filter((c) => c.conditionId !== s.conditionId), e.delete(s.conditionId), q(), r());
1664
- }
1665
- return {
1666
- addCondition: T,
1667
- changeGroupRelation: L,
1668
- conditionGroupMap: e,
1669
- getConditions: A,
1670
- group: y,
1671
- groupParentMap: n,
1672
- insertConditionTo: B,
1673
- loadConditionGroup: h,
1674
- refresh: r,
1675
- removeCondition: G,
1676
- rootGroup: t,
1677
- unGroup: g
1678
- };
1679
- }
1680
- function gt(t, e, n) {
1681
- const o = E(/* @__PURE__ */ new Set()), l = E(/* @__PURE__ */ new Set()), { conditionGroupMap: p, groupParentMap: r } = n;
1682
- let i, v;
1683
- function k(d) {
1684
- let y = i.level <= d.level ? i : d, g = i.level > d.level ? i : d;
1685
- const L = [];
1686
- for (; g && y && g !== y; )
1687
- g.level > y.level ? (L.push(g), g = r.get(g.groupId)) : g.level === y.level && (y = r.get(y.groupId), y && L.unshift(y));
1688
- return L;
1689
- }
1690
- function b(d) {
1691
- l.value.add(d.groupId), d.items.forEach((y) => o.value.add(y.conditionId)), d.children.forEach((y) => b(y));
1692
- }
1693
- function m(d) {
1694
- const { conditionId: y } = d;
1695
- o.value.add(y), i = o.value.size === 0 ? p.get(y) : i;
1696
- const g = p.get(d.conditionId);
1697
- k(g).forEach((A) => b(A));
1698
- }
1699
- const h = U(() => o.value.size === 0 && l.value.size === 1), T = function(d) {
1700
- l.value.delete(d.groupId), d.items.forEach((g) => v(g)), d.children.forEach((g) => !h.value && T(g));
1701
- const y = r.get(d.groupId);
1702
- y && l.value.has(y.groupId) && T(y);
1703
- };
1704
- v = function(d) {
1705
- const { conditionId: y } = d;
1706
- if (o.value.has(y) && o.value.delete(y), l.value.size > 0) {
1707
- const g = p.get(y);
1708
- g && l.value.has(g.groupId) && T(g);
1709
- }
1710
- };
1711
- function B(d) {
1712
- const { conditionId: y } = d;
1713
- o.value.size === 0 && (i = p.get(y)), o.value.has(y) ? v(d) : m(d);
1714
- }
1715
- function O() {
1716
- const d = [];
1717
- return i && (i.items.filter((y) => o.value.has(y.conditionId)).forEach((y) => d.push(y)), i.children.filter((y) => l.value.has(y.groupId)).forEach((y) => d.push(y))), d;
1718
- }
1719
- function S() {
1720
- o.value.clear(), l.value.clear();
1721
- }
1722
- return { clear: S, getSelectedGroupItem: O, selectedItems: o, toggleSelect: B };
1723
- }
1724
- const _ = /* @__PURE__ */ J({
1725
- name: "FConditionList",
1726
- props: D,
1727
- emits: ["valueChange", "labelCodeChange", "compareTypeChange"],
1728
- setup(t, e) {
1729
- const n = E(t.key), o = E(t.conditions), l = te(t, e, "filter-bar"), {
1730
- convertToControls: p,
1731
- fields: r,
1732
- fieldMap: i,
1733
- loadFieldConfigs: v
1734
- } = l, k = ft(), {
1735
- addCondition: b,
1736
- changeGroupRelation: m,
1737
- getConditions: h,
1738
- group: T,
1739
- insertConditionTo: B,
1740
- loadConditionGroup: O,
1741
- removeCondition: S,
1742
- rootGroup: d,
1743
- unGroup: y
1744
- } = k, {
1745
- createConditionValue: g
1746
- } = Ce(), L = gt(t, e, k), {
1747
- selectedItems: A,
1748
- toggleSelect: Z
1749
- } = L, {
1750
- getCompareOperators: q
1751
- } = ht(t, e, l), {
1752
- conditionListLocale: G
1753
- } = dt();
1754
- v(!1), r.value = p(r.value), O(o.value);
1755
- function s(I) {
1756
- var $;
1757
- const P = (($ = i.get(I.fieldCode)) == null ? void 0 : $.editor) || {
1758
- type: "text"
1759
- };
1760
- I.value = g(P.type, void 0), e.emit("labelCodeChange", I);
1761
- }
1762
- function f(I, P) {
1763
- e.emit("compareTypeChange", P);
1764
- }
1765
- function c() {
1766
- }
1767
- e.expose({
1768
- getConditions: h
1769
- });
1770
- function C(I, P) {
1771
- e.emit("valueChange", I, P);
1772
- }
1773
- function F(I) {
1774
- return x("div", {
1775
- class: "condition-list-item-type mr-3"
1776
- }, [x(re, {
1777
- "value-field": "labelCode",
1778
- "text-field": "name",
1779
- "id-field": "id",
1780
- data: r.value,
1781
- modelValue: I.fieldCode,
1782
- "onUpdate:modelValue": (P) => I.fieldCode = P,
1783
- onChange: (P) => s(I)
1784
- }, null)]);
1785
- }
1786
- function V(I) {
1787
- return x("div", {
1788
- class: "condition-list-item-compare mr-3"
1789
- }, [x(re, {
1790
- "value-field": "value",
1791
- "text-field": "name",
1792
- "id-field": "id",
1793
- data: q(I),
1794
- modelValue: I.compareType,
1795
- "onUpdate:modelValue": (P) => I.compareType = P,
1796
- onChange: (P) => f(P, I)
1797
- }, null)]);
1798
- }
1799
- function w(I) {
1800
- var P;
1801
- return x("div", {
1802
- class: "condition-list-item-control mr-3"
1803
- }, [x(he, {
1804
- editor: (P = i.get(I.fieldCode)) == null ? void 0 : P.editor,
1805
- showLabel: !1,
1806
- modelValue: I.value.value,
1807
- "onUpdate:modelValue": ($) => I.value.value = $,
1808
- onChange: ($) => {
1809
- C($, I);
1810
- }
1811
- }, null)]);
1812
- }
1813
- function N(I) {
1814
- return [x("div", {
1815
- class: "condition-list-item-extend"
1816
- }, [x("span", {
1817
- class: "f-icon f-icon-plus-sm mr-2",
1818
- onClick: () => B(I)
1819
- }, null), x("span", {
1820
- class: "f-icon f-icon-minus-sm",
1821
- onClick: () => S(I)
1822
- }, null)]), x("div", {
1823
- class: "custom-control custom-checkbox"
1824
- }, [x("input", {
1825
- title: "selection",
1826
- class: "custom-control-input",
1827
- type: "checkbox",
1828
- checked: A.value.has(I.conditionId)
1829
- }, null), x("label", {
1830
- class: "custom-control-label",
1831
- onClick: () => Z(I)
1832
- }, null)])];
1833
- }
1834
- function M(I) {
1835
- return I.items.map((P) => x("div", {
1836
- class: "condition-list-item",
1837
- key: P.conditionId
1838
- }, [F(P), V(P), w(P), N(P)]));
1839
- }
1840
- function j(I) {
1841
- return x("div", {
1842
- class: "condition-list-relation"
1843
- }, [x("span", {
1844
- class: "condition-list-relation-close f-icon-filter-cancel btn-link",
1845
- onClick: () => y(I)
1846
- }, null), x("span", {
1847
- class: "condition-list-relation-text btn-link",
1848
- onClick: () => m(I)
1849
- }, [I.relation === 1 ? G.and : G.or])]);
1850
- }
1851
- function z(I) {
1852
- return x("div", {
1853
- class: "condition-list-content"
1854
- }, [x("div", {
1855
- class: "condition-list-content-group"
1856
- }, [M(I), I.children && I.children.map((P) => z(P))]), j(I)]);
1857
- }
1858
- function ne() {
1859
- T(L.getSelectedGroupItem()), L.clear();
1860
- }
1861
- function oe() {
1862
- return x("div", {
1863
- class: "condition-list-bottom"
1864
- }, [x("div", {
1865
- class: "add-condition-btn mb-1 mr-3",
1866
- onClick: b
1867
- }, [x("span", {
1868
- class: "f-icon f-icon-filter-add"
1869
- }, null), x("span", {
1870
- class: "ml-1"
1871
- }, [G.add])]), x("div", {
1872
- class: "add-condition-btn mb-1",
1873
- onClick: ne
1874
- }, [x("span", {
1875
- class: "f-icon f-icon-filter-grouping"
1876
- }, null), x("span", {
1877
- class: "ml-1"
1878
- }, [G.create])]), x("div", {
1879
- class: "condition-list-reset add-condition-btn",
1880
- onClick: c
1881
- }, [G.reset])]);
1882
- }
1883
- return () => x("div", {
1884
- class: "condition-list",
1885
- key: n.value
1886
- }, [x("div", {
1887
- class: "condition-list-body"
1888
- }, [z(d.value)]), oe()]);
1889
- }
1890
- });
1891
- _.install = (t) => {
1892
- t.component(ie.name, ie).component(_.name, _);
1893
- };
1894
- export {
1895
- ie as FConditionFields,
1896
- Nn as FConditionFieldsDesign,
1897
- _ as FConditionList,
1898
- _ as default
1899
- };