amis-editor 6.5.0 → 6.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (811) hide show
  1. package/esm/builder/ApiDSBuilder.js +7 -5
  2. package/esm/builder/DSBuilder.js +3 -3
  3. package/esm/builder/DSBuilderManager.js +3 -3
  4. package/esm/builder/constants.js +3 -3
  5. package/esm/builder/utils.js +3 -3
  6. package/esm/component/BaseControl.js +3 -3
  7. package/esm/component/InputComponentName.js +3 -3
  8. package/esm/component/ModalSettingPanel.js +3 -3
  9. package/esm/component/TableViewEditor.js +3 -3
  10. package/esm/icons/btn/btn-group.svg.js +4 -4
  11. package/esm/icons/btn/btn-select.svg.js +4 -4
  12. package/esm/icons/btn/btn-toolbar.svg.js +4 -4
  13. package/esm/icons/btn/button.svg.js +4 -4
  14. package/esm/icons/btn/dropdown-btn.svg.js +4 -4
  15. package/esm/icons/container/anchor-nav.svg.js +4 -4
  16. package/esm/icons/container/collapse.svg.js +4 -4
  17. package/esm/icons/container/container.svg.js +4 -4
  18. package/esm/icons/container/flex-container.svg.js +4 -4
  19. package/esm/icons/container/form-group.svg.js +4 -4
  20. package/esm/icons/container/grid.svg.js +4 -4
  21. package/esm/icons/container/iframe.svg.js +4 -4
  22. package/esm/icons/container/panel.svg.js +4 -4
  23. package/esm/icons/container/switch-container.svg.js +4 -4
  24. package/esm/icons/container/table-view.svg.js +4 -4
  25. package/esm/icons/container/tabs.svg.js +4 -4
  26. package/esm/icons/container/tooltip-wrapper.svg.js +4 -4
  27. package/esm/icons/container/web-component.svg.js +4 -4
  28. package/esm/icons/crud/column-add.svg.js +4 -4
  29. package/esm/icons/crud/column-delete.svg.js +4 -4
  30. package/esm/icons/crud/column-setting.svg.js +4 -4
  31. package/esm/icons/crud/share-link.svg.js +4 -4
  32. package/esm/icons/display/aBaseline.svg.js +4 -4
  33. package/esm/icons/display/aCenter.svg.js +4 -4
  34. package/esm/icons/display/aFlexEnd.svg.js +4 -4
  35. package/esm/icons/display/aFlexStart.svg.js +4 -4
  36. package/esm/icons/display/aStretch.svg.js +4 -4
  37. package/esm/icons/display/block.svg.js +4 -4
  38. package/esm/icons/display/dcolumn.svg.js +4 -4
  39. package/esm/icons/display/dcolumnReverse.svg.js +4 -4
  40. package/esm/icons/display/drow.svg.js +4 -4
  41. package/esm/icons/display/drowReverse.svg.js +4 -4
  42. package/esm/icons/display/flex.svg.js +4 -4
  43. package/esm/icons/display/inline-block.svg.js +4 -4
  44. package/esm/icons/display/inline.svg.js +4 -4
  45. package/esm/icons/display/jCenter.svg.js +4 -4
  46. package/esm/icons/display/jFlexEnd.svg.js +4 -4
  47. package/esm/icons/display/jFlexStart.svg.js +4 -4
  48. package/esm/icons/display/jSpaceAround.svg.js +4 -4
  49. package/esm/icons/display/jSpaceBetween.svg.js +4 -4
  50. package/esm/icons/feat/audio.svg.js +4 -4
  51. package/esm/icons/feat/custom.svg.js +4 -4
  52. package/esm/icons/feat/each.svg.js +4 -4
  53. package/esm/icons/feat/form.svg.js +4 -4
  54. package/esm/icons/feat/nav.svg.js +4 -4
  55. package/esm/icons/feat/qrcode.svg.js +4 -4
  56. package/esm/icons/feat/service.svg.js +4 -4
  57. package/esm/icons/feat/table.svg.js +4 -4
  58. package/esm/icons/feat/tasks.svg.js +4 -4
  59. package/esm/icons/feat/video.svg.js +4 -4
  60. package/esm/icons/feat/wizard.svg.js +4 -4
  61. package/esm/icons/form/chained-select.svg.js +4 -4
  62. package/esm/icons/form/checkbox.svg.js +4 -4
  63. package/esm/icons/form/checkboxes.svg.js +4 -4
  64. package/esm/icons/form/combo.svg.js +4 -4
  65. package/esm/icons/form/condition-builder.svg.js +4 -4
  66. package/esm/icons/form/diff-editor.svg.js +4 -4
  67. package/esm/icons/form/editor.svg.js +4 -4
  68. package/esm/icons/form/formula.svg.js +4 -4
  69. package/esm/icons/form/hidden.svg.js +4 -4
  70. package/esm/icons/form/input-city.svg.js +4 -4
  71. package/esm/icons/form/input-color.svg.js +4 -4
  72. package/esm/icons/form/input-date-range.svg.js +4 -4
  73. package/esm/icons/form/input-date.svg.js +4 -4
  74. package/esm/icons/form/input-datetime.svg.js +4 -4
  75. package/esm/icons/form/input-email.svg.js +4 -4
  76. package/esm/icons/form/input-excel.svg.js +4 -4
  77. package/esm/icons/form/input-file.svg.js +4 -4
  78. package/esm/icons/form/input-group.svg.js +4 -4
  79. package/esm/icons/form/input-image.svg.js +4 -4
  80. package/esm/icons/form/input-kv.svg.js +4 -4
  81. package/esm/icons/form/input-month-range.svg.js +4 -4
  82. package/esm/icons/form/input-number.svg.js +4 -4
  83. package/esm/icons/form/input-password.svg.js +4 -4
  84. package/esm/icons/form/input-quarter-range.svg.js +4 -4
  85. package/esm/icons/form/input-range.svg.js +4 -4
  86. package/esm/icons/form/input-rating.svg.js +4 -4
  87. package/esm/icons/form/input-repeat.svg.js +4 -4
  88. package/esm/icons/form/input-rich-text.svg.js +4 -4
  89. package/esm/icons/form/input-signature.svg.js +4 -4
  90. package/esm/icons/form/input-tag.svg.js +4 -4
  91. package/esm/icons/form/input-text.svg.js +4 -4
  92. package/esm/icons/form/input-time-range.svg.js +4 -4
  93. package/esm/icons/form/input-time.svg.js +4 -4
  94. package/esm/icons/form/input-tree.svg.js +4 -4
  95. package/esm/icons/form/input-url.svg.js +4 -4
  96. package/esm/icons/form/input-year.svg.js +4 -4
  97. package/esm/icons/form/inputArray.svg.js +4 -4
  98. package/esm/icons/form/list-select.svg.js +4 -4
  99. package/esm/icons/form/location-picker.svg.js +4 -4
  100. package/esm/icons/form/matrix-checkboxes.svg.js +4 -4
  101. package/esm/icons/form/month.svg.js +4 -4
  102. package/esm/icons/form/nested-select.svg.js +4 -4
  103. package/esm/icons/form/picker.svg.js +4 -4
  104. package/esm/icons/form/quarter.svg.js +4 -4
  105. package/esm/icons/form/radios.svg.js +4 -4
  106. package/esm/icons/form/select.svg.js +4 -4
  107. package/esm/icons/form/static.svg.js +4 -4
  108. package/esm/icons/form/sub-form.svg.js +4 -4
  109. package/esm/icons/form/switch.svg.js +4 -4
  110. package/esm/icons/form/tabs-transfer.svg.js +4 -4
  111. package/esm/icons/form/textarea.svg.js +4 -4
  112. package/esm/icons/form/transfer.svg.js +4 -4
  113. package/esm/icons/form/tree-select.svg.js +4 -4
  114. package/esm/icons/form/uuid.svg.js +4 -4
  115. package/esm/icons/index.js +3 -3
  116. package/esm/icons/layout/layout-1with2.svg.js +4 -4
  117. package/esm/icons/layout/layout-2cols.svg.js +4 -4
  118. package/esm/icons/layout/layout-2row.svg.js +4 -4
  119. package/esm/icons/layout/layout-2with1.svg.js +4 -4
  120. package/esm/icons/layout/layout-3cols.svg.js +4 -4
  121. package/esm/icons/layout/layout-3row.svg.js +4 -4
  122. package/esm/icons/layout/layout-absolute.svg.js +4 -4
  123. package/esm/icons/layout/layout-fixed-top.svg.js +4 -4
  124. package/esm/icons/layout/layout-fixed.svg.js +4 -4
  125. package/esm/icons/layout/layout-free-container.svg.js +4 -4
  126. package/esm/icons/layout/layout-full.svg.js +4 -4
  127. package/esm/icons/layout/layout1-2.svg.js +4 -4
  128. package/esm/icons/layout/layout2-1.svg.js +4 -4
  129. package/esm/icons/layout/layout3-1.svg.js +4 -4
  130. package/esm/icons/layout/layout3-2.svg.js +4 -4
  131. package/esm/icons/other/_fx.svg.js +4 -4
  132. package/esm/icons/other/divider.svg.js +4 -4
  133. package/esm/icons/other/fx.svg.js +4 -4
  134. package/esm/icons/other/modal-setting.svg.js +4 -4
  135. package/esm/icons/other/property-sheet.svg.js +4 -4
  136. package/esm/icons/other/tooltip.svg.js +4 -4
  137. package/esm/icons/show/URL.svg.js +4 -4
  138. package/esm/icons/show/avatar.svg.js +4 -4
  139. package/esm/icons/show/breadcrumb.svg.js +4 -4
  140. package/esm/icons/show/card.svg.js +4 -4
  141. package/esm/icons/show/cards.svg.js +4 -4
  142. package/esm/icons/show/carousel.svg.js +4 -4
  143. package/esm/icons/show/chart.svg.js +4 -4
  144. package/esm/icons/show/code.svg.js +4 -4
  145. package/esm/icons/show/date.svg.js +4 -4
  146. package/esm/icons/show/datetime.svg.js +4 -4
  147. package/esm/icons/show/image.svg.js +4 -4
  148. package/esm/icons/show/images.svg.js +4 -4
  149. package/esm/icons/show/json-view.svg.js +4 -4
  150. package/esm/icons/show/list.svg.js +4 -4
  151. package/esm/icons/show/log.svg.js +4 -4
  152. package/esm/icons/show/mapping.svg.js +4 -4
  153. package/esm/icons/show/markdown.svg.js +4 -4
  154. package/esm/icons/show/plain.svg.js +4 -4
  155. package/esm/icons/show/progress.svg.js +4 -4
  156. package/esm/icons/show/sparkline.svg.js +4 -4
  157. package/esm/icons/show/status.svg.js +4 -4
  158. package/esm/icons/show/steps.svg.js +4 -4
  159. package/esm/icons/show/time.svg.js +4 -4
  160. package/esm/icons/theme/css.svg.js +4 -4
  161. package/esm/index.d.ts +3 -0
  162. package/esm/index.js +6 -3
  163. package/esm/locale/en-US.js +3 -3
  164. package/esm/locale/zh-CN.js +3 -3
  165. package/esm/plugin/Alert.js +3 -3
  166. package/esm/plugin/AnchorNav.js +3 -3
  167. package/esm/plugin/Audio.js +3 -3
  168. package/esm/plugin/Avatar.js +3 -3
  169. package/esm/plugin/Breadcrumb.js +3 -3
  170. package/esm/plugin/Button.js +18 -9
  171. package/esm/plugin/ButtonGroup.js +3 -3
  172. package/esm/plugin/CRUD.d.ts +2 -1
  173. package/esm/plugin/CRUD.js +12 -11
  174. package/esm/plugin/CRUD2/BaseCRUD.js +10 -4
  175. package/esm/plugin/CRUD2/CRUDTable.js +3 -3
  176. package/esm/plugin/CRUD2/constants.js +3 -3
  177. package/esm/plugin/CRUD2/utils.js +3 -3
  178. package/esm/plugin/Calendar.js +3 -3
  179. package/esm/plugin/Card.js +3 -3
  180. package/esm/plugin/Card2.js +3 -3
  181. package/esm/plugin/Cards.js +3 -3
  182. package/esm/plugin/Carousel.js +3 -3
  183. package/esm/plugin/Chart.js +3 -3
  184. package/esm/plugin/CodeView.js +3 -3
  185. package/esm/plugin/Collapse.js +3 -3
  186. package/esm/plugin/CollapseGroup.js +3 -3
  187. package/esm/plugin/ColumnToggler.js +3 -3
  188. package/esm/plugin/Container.js +3 -3
  189. package/esm/plugin/Custom.js +3 -3
  190. package/esm/plugin/CustomRegion.js +3 -3
  191. package/esm/plugin/Date.js +3 -3
  192. package/esm/plugin/Datetime.js +3 -3
  193. package/esm/plugin/Dialog.js +3 -3
  194. package/esm/plugin/Divider.js +3 -3
  195. package/esm/plugin/Drawer.js +3 -3
  196. package/esm/plugin/DropDownButton.js +3 -3
  197. package/esm/plugin/Each.js +3 -3
  198. package/esm/plugin/Flex.js +3 -3
  199. package/esm/plugin/Form/ButtonGroupSelect.js +3 -3
  200. package/esm/plugin/Form/ButtonToolbar.js +3 -3
  201. package/esm/plugin/Form/ChainedSelect.js +3 -3
  202. package/esm/plugin/Form/Checkbox.js +3 -3
  203. package/esm/plugin/Form/Checkboxes.js +3 -3
  204. package/esm/plugin/Form/CodeEditor.js +3 -3
  205. package/esm/plugin/Form/Combo.js +3 -3
  206. package/esm/plugin/Form/ConditionBuilder.js +3 -3
  207. package/esm/plugin/Form/Control.js +3 -3
  208. package/esm/plugin/Form/DiffEditor.js +3 -3
  209. package/esm/plugin/Form/FieldSet.js +3 -3
  210. package/esm/plugin/Form/Form.js +178 -25
  211. package/esm/plugin/Form/Formula.js +3 -3
  212. package/esm/plugin/Form/Group.js +3 -3
  213. package/esm/plugin/Form/Hidden.js +3 -3
  214. package/esm/plugin/Form/InputArray.js +3 -3
  215. package/esm/plugin/Form/InputCity.js +3 -3
  216. package/esm/plugin/Form/InputColor.js +3 -3
  217. package/esm/plugin/Form/InputDate.js +10 -4
  218. package/esm/plugin/Form/InputDateRange.js +10 -4
  219. package/esm/plugin/Form/InputDateTime.js +3 -3
  220. package/esm/plugin/Form/InputDateTimeRange.js +3 -3
  221. package/esm/plugin/Form/InputEmail.js +3 -3
  222. package/esm/plugin/Form/InputExcel.js +3 -3
  223. package/esm/plugin/Form/InputFile.js +3 -3
  224. package/esm/plugin/Form/InputGroup.js +3 -3
  225. package/esm/plugin/Form/InputImage.js +11 -11
  226. package/esm/plugin/Form/InputKV.js +3 -3
  227. package/esm/plugin/Form/InputMonth.js +3 -3
  228. package/esm/plugin/Form/InputMonthRange.js +3 -3
  229. package/esm/plugin/Form/InputNumber.js +5 -6
  230. package/esm/plugin/Form/InputPassword.js +3 -3
  231. package/esm/plugin/Form/InputQuarter.js +3 -3
  232. package/esm/plugin/Form/InputQuarterRange.js +3 -3
  233. package/esm/plugin/Form/InputRange.js +19 -8
  234. package/esm/plugin/Form/InputRating.js +3 -3
  235. package/esm/plugin/Form/InputRepeat.js +3 -3
  236. package/esm/plugin/Form/InputRichText.js +3 -3
  237. package/esm/plugin/Form/InputSignature.js +3 -3
  238. package/esm/plugin/Form/InputSubForm.js +3 -3
  239. package/esm/plugin/Form/InputTable.js +9 -23
  240. package/esm/plugin/Form/InputTag.js +3 -3
  241. package/esm/plugin/Form/InputText.js +6 -8
  242. package/esm/plugin/Form/InputTime.js +3 -3
  243. package/esm/plugin/Form/InputTimeRange.js +3 -3
  244. package/esm/plugin/Form/InputTree.js +3 -3
  245. package/esm/plugin/Form/InputURL.js +3 -3
  246. package/esm/plugin/Form/InputYear.js +3 -3
  247. package/esm/plugin/Form/InputYearRange.js +3 -3
  248. package/esm/plugin/Form/Item.js +7 -12
  249. package/esm/plugin/Form/ListSelect.js +3 -3
  250. package/esm/plugin/Form/LocationPicker.js +3 -3
  251. package/esm/plugin/Form/MatrixCheckboxes.js +3 -3
  252. package/esm/plugin/Form/NestedSelect.js +3 -3
  253. package/esm/plugin/Form/Picker.js +16 -45
  254. package/esm/plugin/Form/Radios.js +3 -3
  255. package/esm/plugin/Form/Select.js +13 -6
  256. package/esm/plugin/Form/Static.js +3 -3
  257. package/esm/plugin/Form/Switch.js +3 -3
  258. package/esm/plugin/Form/TabsTransfer.js +3 -3
  259. package/esm/plugin/Form/Textarea.js +14 -9
  260. package/esm/plugin/Form/Transfer.js +3 -3
  261. package/esm/plugin/Form/TransferPicker.js +3 -3
  262. package/esm/plugin/Form/TreeSelect.js +3 -3
  263. package/esm/plugin/Form/UUID.js +3 -3
  264. package/esm/plugin/Grid.js +3 -3
  265. package/esm/plugin/HBox.js +3 -3
  266. package/esm/plugin/IFrame.js +3 -3
  267. package/esm/plugin/Icon.js +3 -3
  268. package/esm/plugin/Image.js +9 -7
  269. package/esm/plugin/Images.js +3 -3
  270. package/esm/plugin/Json.js +3 -3
  271. package/esm/plugin/Layout/FlexPluginBase.js +3 -3
  272. package/esm/plugin/Layout/Layout_fixed.js +3 -3
  273. package/esm/plugin/Layout/Layout_free_container.js +3 -3
  274. package/esm/plugin/Layout/Layout_sorption_container.js +3 -3
  275. package/esm/plugin/Link.js +3 -3
  276. package/esm/plugin/List.js +3 -3
  277. package/esm/plugin/List2.js +3 -3
  278. package/esm/plugin/ListItem.js +3 -3
  279. package/esm/plugin/Log.js +3 -3
  280. package/esm/plugin/Mapping.js +3 -3
  281. package/esm/plugin/Markdown.js +3 -3
  282. package/esm/plugin/Nav.js +3 -3
  283. package/esm/plugin/OfficeViewer.js +3 -3
  284. package/esm/plugin/Operation.js +3 -3
  285. package/esm/plugin/Others/Action.js +3 -3
  286. package/esm/plugin/Others/TableCell.js +58 -4
  287. package/esm/plugin/Page.js +3 -3
  288. package/esm/plugin/Pagination.js +3 -3
  289. package/esm/plugin/Panel.js +3 -3
  290. package/esm/plugin/PdfViewer.js +3 -3
  291. package/esm/plugin/Plain.js +3 -3
  292. package/esm/plugin/Progress.js +3 -3
  293. package/esm/plugin/Property.js +3 -3
  294. package/esm/plugin/QRCode.js +3 -3
  295. package/esm/plugin/Reset.js +3 -3
  296. package/esm/plugin/SearchBox.js +3 -3
  297. package/esm/plugin/Service.js +3 -3
  298. package/esm/plugin/Sparkline.js +3 -3
  299. package/esm/plugin/Status.js +3 -3
  300. package/esm/plugin/Steps.js +3 -3
  301. package/esm/plugin/Submit.js +3 -3
  302. package/esm/plugin/SwitchContainer.js +3 -3
  303. package/esm/plugin/Table.js +3 -3
  304. package/esm/plugin/Table2.js +100 -61
  305. package/esm/plugin/TableCell2.js +15 -10
  306. package/esm/plugin/TableView.js +3 -3
  307. package/esm/plugin/Tabs.js +3 -3
  308. package/esm/plugin/Tag.js +3 -3
  309. package/esm/plugin/Tasks.js +3 -3
  310. package/esm/plugin/Time.js +3 -3
  311. package/esm/plugin/Timeline.js +3 -3
  312. package/esm/plugin/TooltipWrapper.js +3 -3
  313. package/esm/plugin/Tpl.js +3 -3
  314. package/esm/plugin/Video.js +3 -3
  315. package/esm/plugin/WebComponent.js +3 -3
  316. package/esm/plugin/Wizard.js +3 -3
  317. package/esm/plugin/Wrapper.js +3 -3
  318. package/esm/renderer/APIAdaptorControl.js +3 -3
  319. package/esm/renderer/APIControl.js +3 -3
  320. package/esm/renderer/BadgeControl.js +11 -9
  321. package/esm/renderer/ButtonGroupControl.js +3 -3
  322. package/esm/renderer/ConditionFormulaControl.js +176 -193
  323. package/esm/renderer/DataBindingControl.js +3 -3
  324. package/esm/renderer/DataMappingControl.js +3 -3
  325. package/esm/renderer/DataPickerControl.js +3 -3
  326. package/esm/renderer/DateShortCutControl.js +3 -3
  327. package/esm/renderer/ExpressionFormulaControl.js +3 -3
  328. package/esm/renderer/FeatureControl.js +3 -3
  329. package/esm/renderer/FieldSetting.js +3 -3
  330. package/esm/renderer/FlexSettingControl.js +3 -3
  331. package/esm/renderer/FormulaControl.d.ts +34 -6
  332. package/esm/renderer/FormulaControl.js +274 -113
  333. package/esm/renderer/FunctionEditorControl.js +3 -3
  334. package/esm/renderer/GoConfigControl.js +3 -3
  335. package/esm/renderer/InputRangeValueControl.js +6 -4
  336. package/esm/renderer/KeyValueMapControl.js +3 -3
  337. package/esm/renderer/ListItemControl.js +3 -3
  338. package/esm/renderer/MapSourceControl.js +3 -3
  339. package/esm/renderer/NavBadgeControl.js +3 -3
  340. package/esm/renderer/NavDefaultActive.js +3 -3
  341. package/esm/renderer/NavSourceControl.js +3 -3
  342. package/esm/renderer/OptionControl.d.ts +22 -104
  343. package/esm/renderer/OptionControl.js +640 -429
  344. package/esm/renderer/RangePartsControl.js +3 -3
  345. package/esm/renderer/StatusControl.js +3 -3
  346. package/esm/renderer/SwitchMoreControl.js +5 -4
  347. package/esm/renderer/TableColumnWidthControl.js +3 -3
  348. package/esm/renderer/TimelineItemControl.js +3 -3
  349. package/esm/renderer/TplFormulaControl.d.ts +24 -1
  350. package/esm/renderer/TplFormulaControl.js +172 -33
  351. package/esm/renderer/TransferTableControl.js +3 -3
  352. package/esm/renderer/TreeOptionControl.js +3 -3
  353. package/esm/renderer/ValidateApiControl.js +3 -3
  354. package/esm/renderer/ValidationControl.d.ts +6 -1
  355. package/esm/renderer/ValidationControl.js +70 -32
  356. package/esm/renderer/ValidationItem.d.ts +2 -1
  357. package/esm/renderer/ValidationItem.js +20 -15
  358. package/esm/renderer/ValueFormatControl.js +3 -3
  359. package/esm/renderer/crud2-control/AddColumnModal.js +3 -3
  360. package/esm/renderer/crud2-control/CRUDColumnControl.js +3 -3
  361. package/esm/renderer/crud2-control/CRUDFiltersControl.js +3 -3
  362. package/esm/renderer/crud2-control/CRUDToolbarControl.js +3 -3
  363. package/esm/renderer/event-control/DialogActionPanel.js +13 -9
  364. package/esm/renderer/event-control/action-config-dialog.js +3 -3
  365. package/esm/renderer/event-control/action-config-panel.js +3 -3
  366. package/esm/renderer/event-control/comp-action-select.js +3 -3
  367. package/esm/renderer/event-control/helper.js +6 -6
  368. package/esm/renderer/event-control/index.js +8 -9
  369. package/esm/renderer/style-control/Background.js +3 -3
  370. package/esm/renderer/style-control/Border.js +3 -3
  371. package/esm/renderer/style-control/BoxModel.js +3 -3
  372. package/esm/renderer/style-control/BoxShadow.js +3 -3
  373. package/esm/renderer/style-control/ColCount.d.ts +5 -0
  374. package/esm/renderer/style-control/ColCount.js +54 -0
  375. package/esm/renderer/style-control/ColSize.d.ts +5 -0
  376. package/esm/renderer/style-control/ColSize.js +147 -0
  377. package/esm/renderer/style-control/Display.js +3 -3
  378. package/esm/renderer/style-control/FlexLayout.js +3 -3
  379. package/esm/renderer/style-control/Font.js +3 -3
  380. package/esm/renderer/style-control/InsetBoxModel.js +3 -3
  381. package/esm/renderer/style-control/LabelAlign.d.ts +5 -0
  382. package/esm/renderer/style-control/LabelAlign.js +70 -0
  383. package/esm/renderer/style-control/ThemeCssCode.js +3 -3
  384. package/esm/renderer/style-control/font-family.js +3 -3
  385. package/esm/renderer/style-control/helper.d.ts +4 -2
  386. package/esm/renderer/style-control/helper.js +34 -18
  387. package/esm/renderer/style-control/transformation.js +3 -3
  388. package/esm/renderer/textarea-formula/FormulaPicker.d.ts +1 -0
  389. package/esm/renderer/textarea-formula/FormulaPicker.js +11 -4
  390. package/esm/renderer/textarea-formula/TextareaFormulaControl.d.ts +20 -1
  391. package/esm/renderer/textarea-formula/TextareaFormulaControl.js +182 -38
  392. package/esm/renderer/textarea-formula/plugin.js +4 -4
  393. package/esm/tpl/api.js +3 -3
  394. package/esm/tpl/common.js +22 -4
  395. package/esm/tpl/horizontal.js +3 -3
  396. package/esm/tpl/layout.js +3 -3
  397. package/esm/tpl/options.js +3 -3
  398. package/esm/tpl/remark.js +17 -13
  399. package/esm/tpl/style.js +115 -32
  400. package/esm/tpl/validations.js +3 -3
  401. package/esm/util.js +3 -3
  402. package/esm/validator.js +3 -3
  403. package/lib/builder/ApiDSBuilder.d.ts +14 -14
  404. package/lib/builder/ApiDSBuilder.js +7 -5
  405. package/lib/builder/DSBuilder.js +3 -3
  406. package/lib/builder/DSBuilderManager.js +3 -3
  407. package/lib/builder/constants.d.ts +1 -1
  408. package/lib/builder/constants.js +3 -3
  409. package/lib/builder/utils.js +3 -3
  410. package/lib/component/BaseControl.d.ts +1 -1
  411. package/lib/component/BaseControl.js +3 -3
  412. package/lib/component/InputComponentName.js +3 -3
  413. package/lib/component/ModalSettingPanel.js +3 -3
  414. package/lib/component/TableViewEditor.js +3 -3
  415. package/lib/icons/btn/btn-group.svg.js +4 -4
  416. package/lib/icons/btn/btn-select.svg.js +4 -4
  417. package/lib/icons/btn/btn-toolbar.svg.js +4 -4
  418. package/lib/icons/btn/button.svg.js +4 -4
  419. package/lib/icons/btn/dropdown-btn.svg.js +4 -4
  420. package/lib/icons/container/anchor-nav.svg.js +4 -4
  421. package/lib/icons/container/collapse.svg.js +4 -4
  422. package/lib/icons/container/container.svg.js +4 -4
  423. package/lib/icons/container/flex-container.svg.js +4 -4
  424. package/lib/icons/container/form-group.svg.js +4 -4
  425. package/lib/icons/container/grid.svg.js +4 -4
  426. package/lib/icons/container/iframe.svg.js +4 -4
  427. package/lib/icons/container/panel.svg.js +4 -4
  428. package/lib/icons/container/switch-container.svg.js +4 -4
  429. package/lib/icons/container/table-view.svg.js +4 -4
  430. package/lib/icons/container/tabs.svg.js +4 -4
  431. package/lib/icons/container/tooltip-wrapper.svg.js +4 -4
  432. package/lib/icons/container/web-component.svg.js +4 -4
  433. package/lib/icons/crud/column-add.svg.js +4 -4
  434. package/lib/icons/crud/column-delete.svg.js +4 -4
  435. package/lib/icons/crud/column-setting.svg.js +4 -4
  436. package/lib/icons/crud/share-link.svg.js +4 -4
  437. package/lib/icons/display/aBaseline.svg.js +4 -4
  438. package/lib/icons/display/aCenter.svg.js +4 -4
  439. package/lib/icons/display/aFlexEnd.svg.js +4 -4
  440. package/lib/icons/display/aFlexStart.svg.js +4 -4
  441. package/lib/icons/display/aStretch.svg.js +4 -4
  442. package/lib/icons/display/block.svg.js +4 -4
  443. package/lib/icons/display/dcolumn.svg.js +4 -4
  444. package/lib/icons/display/dcolumnReverse.svg.js +4 -4
  445. package/lib/icons/display/drow.svg.js +4 -4
  446. package/lib/icons/display/drowReverse.svg.js +4 -4
  447. package/lib/icons/display/flex.svg.js +4 -4
  448. package/lib/icons/display/inline-block.svg.js +4 -4
  449. package/lib/icons/display/inline.svg.js +4 -4
  450. package/lib/icons/display/jCenter.svg.js +4 -4
  451. package/lib/icons/display/jFlexEnd.svg.js +4 -4
  452. package/lib/icons/display/jFlexStart.svg.js +4 -4
  453. package/lib/icons/display/jSpaceAround.svg.js +4 -4
  454. package/lib/icons/display/jSpaceBetween.svg.js +4 -4
  455. package/lib/icons/feat/audio.svg.js +4 -4
  456. package/lib/icons/feat/custom.svg.js +4 -4
  457. package/lib/icons/feat/each.svg.js +4 -4
  458. package/lib/icons/feat/form.svg.js +4 -4
  459. package/lib/icons/feat/nav.svg.js +4 -4
  460. package/lib/icons/feat/qrcode.svg.js +4 -4
  461. package/lib/icons/feat/service.svg.js +4 -4
  462. package/lib/icons/feat/table.svg.js +4 -4
  463. package/lib/icons/feat/tasks.svg.js +4 -4
  464. package/lib/icons/feat/video.svg.js +4 -4
  465. package/lib/icons/feat/wizard.svg.js +4 -4
  466. package/lib/icons/form/chained-select.svg.js +4 -4
  467. package/lib/icons/form/checkbox.svg.js +4 -4
  468. package/lib/icons/form/checkboxes.svg.js +4 -4
  469. package/lib/icons/form/combo.svg.js +4 -4
  470. package/lib/icons/form/condition-builder.svg.js +4 -4
  471. package/lib/icons/form/diff-editor.svg.js +4 -4
  472. package/lib/icons/form/editor.svg.js +4 -4
  473. package/lib/icons/form/formula.svg.js +4 -4
  474. package/lib/icons/form/hidden.svg.js +4 -4
  475. package/lib/icons/form/input-city.svg.js +4 -4
  476. package/lib/icons/form/input-color.svg.js +4 -4
  477. package/lib/icons/form/input-date-range.svg.js +4 -4
  478. package/lib/icons/form/input-date.svg.js +4 -4
  479. package/lib/icons/form/input-datetime.svg.js +4 -4
  480. package/lib/icons/form/input-email.svg.js +4 -4
  481. package/lib/icons/form/input-excel.svg.js +4 -4
  482. package/lib/icons/form/input-file.svg.js +4 -4
  483. package/lib/icons/form/input-group.svg.js +4 -4
  484. package/lib/icons/form/input-image.svg.js +4 -4
  485. package/lib/icons/form/input-kv.svg.js +4 -4
  486. package/lib/icons/form/input-month-range.svg.js +4 -4
  487. package/lib/icons/form/input-number.svg.js +4 -4
  488. package/lib/icons/form/input-password.svg.js +4 -4
  489. package/lib/icons/form/input-quarter-range.svg.js +4 -4
  490. package/lib/icons/form/input-range.svg.js +4 -4
  491. package/lib/icons/form/input-rating.svg.js +4 -4
  492. package/lib/icons/form/input-repeat.svg.js +4 -4
  493. package/lib/icons/form/input-rich-text.svg.js +4 -4
  494. package/lib/icons/form/input-signature.svg.js +4 -4
  495. package/lib/icons/form/input-tag.svg.js +4 -4
  496. package/lib/icons/form/input-text.svg.js +4 -4
  497. package/lib/icons/form/input-time-range.svg.js +4 -4
  498. package/lib/icons/form/input-time.svg.js +4 -4
  499. package/lib/icons/form/input-tree.svg.js +4 -4
  500. package/lib/icons/form/input-url.svg.js +4 -4
  501. package/lib/icons/form/input-year.svg.js +4 -4
  502. package/lib/icons/form/inputArray.svg.js +4 -4
  503. package/lib/icons/form/list-select.svg.js +4 -4
  504. package/lib/icons/form/location-picker.svg.js +4 -4
  505. package/lib/icons/form/matrix-checkboxes.svg.js +4 -4
  506. package/lib/icons/form/month.svg.js +4 -4
  507. package/lib/icons/form/nested-select.svg.js +4 -4
  508. package/lib/icons/form/picker.svg.js +4 -4
  509. package/lib/icons/form/quarter.svg.js +4 -4
  510. package/lib/icons/form/radios.svg.js +4 -4
  511. package/lib/icons/form/select.svg.js +4 -4
  512. package/lib/icons/form/static.svg.js +4 -4
  513. package/lib/icons/form/sub-form.svg.js +4 -4
  514. package/lib/icons/form/switch.svg.js +4 -4
  515. package/lib/icons/form/tabs-transfer.svg.js +4 -4
  516. package/lib/icons/form/textarea.svg.js +4 -4
  517. package/lib/icons/form/transfer.svg.js +4 -4
  518. package/lib/icons/form/tree-select.svg.js +4 -4
  519. package/lib/icons/form/uuid.svg.js +4 -4
  520. package/lib/icons/index.js +3 -3
  521. package/lib/icons/layout/layout-1with2.svg.js +4 -4
  522. package/lib/icons/layout/layout-2cols.svg.js +4 -4
  523. package/lib/icons/layout/layout-2row.svg.js +4 -4
  524. package/lib/icons/layout/layout-2with1.svg.js +4 -4
  525. package/lib/icons/layout/layout-3cols.svg.js +4 -4
  526. package/lib/icons/layout/layout-3row.svg.js +4 -4
  527. package/lib/icons/layout/layout-absolute.svg.js +4 -4
  528. package/lib/icons/layout/layout-fixed-top.svg.js +4 -4
  529. package/lib/icons/layout/layout-fixed.svg.js +4 -4
  530. package/lib/icons/layout/layout-free-container.svg.js +4 -4
  531. package/lib/icons/layout/layout-full.svg.js +4 -4
  532. package/lib/icons/layout/layout1-2.svg.js +4 -4
  533. package/lib/icons/layout/layout2-1.svg.js +4 -4
  534. package/lib/icons/layout/layout3-1.svg.js +4 -4
  535. package/lib/icons/layout/layout3-2.svg.js +4 -4
  536. package/lib/icons/other/_fx.svg.js +4 -4
  537. package/lib/icons/other/divider.svg.js +4 -4
  538. package/lib/icons/other/fx.svg.js +4 -4
  539. package/lib/icons/other/modal-setting.svg.js +4 -4
  540. package/lib/icons/other/property-sheet.svg.js +4 -4
  541. package/lib/icons/other/tooltip.svg.js +4 -4
  542. package/lib/icons/show/URL.svg.js +4 -4
  543. package/lib/icons/show/avatar.svg.js +4 -4
  544. package/lib/icons/show/breadcrumb.svg.js +4 -4
  545. package/lib/icons/show/card.svg.js +4 -4
  546. package/lib/icons/show/cards.svg.js +4 -4
  547. package/lib/icons/show/carousel.svg.js +4 -4
  548. package/lib/icons/show/chart.svg.js +4 -4
  549. package/lib/icons/show/code.svg.js +4 -4
  550. package/lib/icons/show/date.svg.js +4 -4
  551. package/lib/icons/show/datetime.svg.js +4 -4
  552. package/lib/icons/show/image.svg.js +4 -4
  553. package/lib/icons/show/images.svg.js +4 -4
  554. package/lib/icons/show/json-view.svg.js +4 -4
  555. package/lib/icons/show/list.svg.js +4 -4
  556. package/lib/icons/show/log.svg.js +4 -4
  557. package/lib/icons/show/mapping.svg.js +4 -4
  558. package/lib/icons/show/markdown.svg.js +4 -4
  559. package/lib/icons/show/plain.svg.js +4 -4
  560. package/lib/icons/show/progress.svg.js +4 -4
  561. package/lib/icons/show/sparkline.svg.js +4 -4
  562. package/lib/icons/show/status.svg.js +4 -4
  563. package/lib/icons/show/steps.svg.js +4 -4
  564. package/lib/icons/show/time.svg.js +4 -4
  565. package/lib/icons/theme/css.svg.js +4 -4
  566. package/lib/index.d.ts +3 -0
  567. package/lib/index.js +6 -3
  568. package/lib/locale/en-US.js +3 -3
  569. package/lib/locale/zh-CN.js +3 -3
  570. package/lib/plugin/Alert.js +3 -3
  571. package/lib/plugin/AnchorNav.js +3 -3
  572. package/lib/plugin/Audio.js +3 -3
  573. package/lib/plugin/Avatar.js +3 -3
  574. package/lib/plugin/Breadcrumb.js +3 -3
  575. package/lib/plugin/Button.js +18 -9
  576. package/lib/plugin/ButtonGroup.js +3 -3
  577. package/lib/plugin/CRUD.d.ts +2 -1
  578. package/lib/plugin/CRUD.js +12 -11
  579. package/lib/plugin/CRUD2/BaseCRUD.js +10 -4
  580. package/lib/plugin/CRUD2/CRUDTable.js +3 -3
  581. package/lib/plugin/CRUD2/constants.js +3 -3
  582. package/lib/plugin/CRUD2/utils.js +3 -3
  583. package/lib/plugin/Calendar.js +3 -3
  584. package/lib/plugin/Card.js +3 -3
  585. package/lib/plugin/Card2.js +3 -3
  586. package/lib/plugin/Cards.js +3 -3
  587. package/lib/plugin/Carousel.js +3 -3
  588. package/lib/plugin/Chart.js +3 -3
  589. package/lib/plugin/CodeView.js +3 -3
  590. package/lib/plugin/Collapse.js +3 -3
  591. package/lib/plugin/CollapseGroup.js +3 -3
  592. package/lib/plugin/ColumnToggler.js +3 -3
  593. package/lib/plugin/Container.js +3 -3
  594. package/lib/plugin/Custom.js +3 -3
  595. package/lib/plugin/CustomRegion.js +3 -3
  596. package/lib/plugin/Date.js +3 -3
  597. package/lib/plugin/Datetime.js +3 -3
  598. package/lib/plugin/Dialog.js +3 -3
  599. package/lib/plugin/Divider.js +3 -3
  600. package/lib/plugin/Drawer.js +3 -3
  601. package/lib/plugin/DropDownButton.js +3 -3
  602. package/lib/plugin/Each.js +3 -3
  603. package/lib/plugin/Flex.js +3 -3
  604. package/lib/plugin/Form/ButtonGroupSelect.js +3 -3
  605. package/lib/plugin/Form/ButtonToolbar.js +3 -3
  606. package/lib/plugin/Form/ChainedSelect.js +3 -3
  607. package/lib/plugin/Form/Checkbox.js +3 -3
  608. package/lib/plugin/Form/Checkboxes.js +3 -3
  609. package/lib/plugin/Form/CodeEditor.js +3 -3
  610. package/lib/plugin/Form/Combo.js +3 -3
  611. package/lib/plugin/Form/ConditionBuilder.js +3 -3
  612. package/lib/plugin/Form/Control.js +3 -3
  613. package/lib/plugin/Form/DiffEditor.js +3 -3
  614. package/lib/plugin/Form/FieldSet.js +3 -3
  615. package/lib/plugin/Form/Form.js +177 -24
  616. package/lib/plugin/Form/Formula.js +3 -3
  617. package/lib/plugin/Form/Group.js +3 -3
  618. package/lib/plugin/Form/Hidden.js +3 -3
  619. package/lib/plugin/Form/InputArray.js +3 -3
  620. package/lib/plugin/Form/InputCity.js +3 -3
  621. package/lib/plugin/Form/InputColor.js +3 -3
  622. package/lib/plugin/Form/InputDate.js +10 -4
  623. package/lib/plugin/Form/InputDateRange.js +10 -4
  624. package/lib/plugin/Form/InputDateTime.js +3 -3
  625. package/lib/plugin/Form/InputDateTimeRange.js +3 -3
  626. package/lib/plugin/Form/InputEmail.js +3 -3
  627. package/lib/plugin/Form/InputExcel.js +3 -3
  628. package/lib/plugin/Form/InputFile.js +3 -3
  629. package/lib/plugin/Form/InputGroup.js +3 -3
  630. package/lib/plugin/Form/InputImage.js +11 -11
  631. package/lib/plugin/Form/InputKV.js +3 -3
  632. package/lib/plugin/Form/InputMonth.js +3 -3
  633. package/lib/plugin/Form/InputMonthRange.js +3 -3
  634. package/lib/plugin/Form/InputNumber.js +5 -6
  635. package/lib/plugin/Form/InputPassword.js +3 -3
  636. package/lib/plugin/Form/InputQuarter.js +3 -3
  637. package/lib/plugin/Form/InputQuarterRange.js +3 -3
  638. package/lib/plugin/Form/InputRange.js +18 -7
  639. package/lib/plugin/Form/InputRating.js +3 -3
  640. package/lib/plugin/Form/InputRepeat.js +3 -3
  641. package/lib/plugin/Form/InputRichText.js +3 -3
  642. package/lib/plugin/Form/InputSignature.js +3 -3
  643. package/lib/plugin/Form/InputSubForm.js +3 -3
  644. package/lib/plugin/Form/InputTable.js +7 -21
  645. package/lib/plugin/Form/InputTag.js +3 -3
  646. package/lib/plugin/Form/InputText.js +6 -8
  647. package/lib/plugin/Form/InputTime.js +3 -3
  648. package/lib/plugin/Form/InputTimeRange.js +3 -3
  649. package/lib/plugin/Form/InputTree.js +3 -3
  650. package/lib/plugin/Form/InputURL.js +3 -3
  651. package/lib/plugin/Form/InputYear.js +3 -3
  652. package/lib/plugin/Form/InputYearRange.js +3 -3
  653. package/lib/plugin/Form/Item.js +7 -16
  654. package/lib/plugin/Form/ListSelect.js +3 -3
  655. package/lib/plugin/Form/LocationPicker.js +3 -3
  656. package/lib/plugin/Form/MatrixCheckboxes.js +3 -3
  657. package/lib/plugin/Form/NestedSelect.js +3 -3
  658. package/lib/plugin/Form/Picker.js +16 -45
  659. package/lib/plugin/Form/Radios.js +3 -3
  660. package/lib/plugin/Form/Select.js +15 -8
  661. package/lib/plugin/Form/Static.js +3 -3
  662. package/lib/plugin/Form/Switch.js +3 -3
  663. package/lib/plugin/Form/TabsTransfer.js +3 -3
  664. package/lib/plugin/Form/Textarea.js +15 -10
  665. package/lib/plugin/Form/Transfer.js +3 -3
  666. package/lib/plugin/Form/TransferPicker.js +3 -3
  667. package/lib/plugin/Form/TreeSelect.js +3 -3
  668. package/lib/plugin/Form/UUID.js +3 -3
  669. package/lib/plugin/Grid.js +3 -3
  670. package/lib/plugin/HBox.js +3 -3
  671. package/lib/plugin/IFrame.js +3 -3
  672. package/lib/plugin/Icon.js +3 -3
  673. package/lib/plugin/Image.js +9 -7
  674. package/lib/plugin/Images.js +3 -3
  675. package/lib/plugin/Json.js +3 -3
  676. package/lib/plugin/Layout/FlexPluginBase.js +3 -3
  677. package/lib/plugin/Layout/Layout_fixed.js +3 -3
  678. package/lib/plugin/Layout/Layout_free_container.js +3 -3
  679. package/lib/plugin/Layout/Layout_sorption_container.js +3 -3
  680. package/lib/plugin/Link.js +3 -3
  681. package/lib/plugin/List.js +3 -3
  682. package/lib/plugin/List2.js +3 -3
  683. package/lib/plugin/ListItem.js +3 -3
  684. package/lib/plugin/Log.js +3 -3
  685. package/lib/plugin/Mapping.js +3 -3
  686. package/lib/plugin/Markdown.js +3 -3
  687. package/lib/plugin/Nav.js +3 -3
  688. package/lib/plugin/OfficeViewer.js +3 -3
  689. package/lib/plugin/Operation.js +3 -3
  690. package/lib/plugin/Others/Action.js +3 -3
  691. package/lib/plugin/Others/TableCell.js +58 -4
  692. package/lib/plugin/Page.js +3 -3
  693. package/lib/plugin/Pagination.js +3 -3
  694. package/lib/plugin/Panel.js +3 -3
  695. package/lib/plugin/PdfViewer.js +3 -3
  696. package/lib/plugin/Plain.js +3 -3
  697. package/lib/plugin/Progress.js +3 -3
  698. package/lib/plugin/Property.js +3 -3
  699. package/lib/plugin/QRCode.js +3 -3
  700. package/lib/plugin/Reset.js +3 -3
  701. package/lib/plugin/SearchBox.js +3 -3
  702. package/lib/plugin/Service.js +3 -3
  703. package/lib/plugin/Sparkline.js +3 -3
  704. package/lib/plugin/Status.js +3 -3
  705. package/lib/plugin/Steps.js +3 -3
  706. package/lib/plugin/Submit.js +3 -3
  707. package/lib/plugin/SwitchContainer.js +3 -3
  708. package/lib/plugin/Table.js +3 -3
  709. package/lib/plugin/Table2.js +100 -61
  710. package/lib/plugin/TableCell2.js +15 -10
  711. package/lib/plugin/TableView.js +3 -3
  712. package/lib/plugin/Tabs.js +3 -3
  713. package/lib/plugin/Tag.js +3 -3
  714. package/lib/plugin/Tasks.js +3 -3
  715. package/lib/plugin/Time.js +3 -3
  716. package/lib/plugin/Timeline.js +3 -3
  717. package/lib/plugin/TooltipWrapper.js +3 -3
  718. package/lib/plugin/Tpl.js +3 -3
  719. package/lib/plugin/Video.js +3 -3
  720. package/lib/plugin/WebComponent.js +3 -3
  721. package/lib/plugin/Wizard.js +3 -3
  722. package/lib/plugin/Wrapper.js +3 -3
  723. package/lib/renderer/APIAdaptorControl.js +3 -3
  724. package/lib/renderer/APIControl.js +3 -3
  725. package/lib/renderer/BadgeControl.d.ts +10 -10
  726. package/lib/renderer/BadgeControl.js +11 -9
  727. package/lib/renderer/ButtonGroupControl.js +3 -3
  728. package/lib/renderer/ConditionFormulaControl.js +173 -190
  729. package/lib/renderer/DataBindingControl.js +3 -3
  730. package/lib/renderer/DataMappingControl.js +3 -3
  731. package/lib/renderer/DataPickerControl.js +3 -3
  732. package/lib/renderer/DateShortCutControl.js +3 -3
  733. package/lib/renderer/ExpressionFormulaControl.js +3 -3
  734. package/lib/renderer/FeatureControl.js +3 -3
  735. package/lib/renderer/FieldSetting.js +3 -3
  736. package/lib/renderer/FlexSettingControl.js +3 -3
  737. package/lib/renderer/FormulaControl.d.ts +34 -6
  738. package/lib/renderer/FormulaControl.js +271 -114
  739. package/lib/renderer/FunctionEditorControl.js +3 -3
  740. package/lib/renderer/GoConfigControl.js +3 -3
  741. package/lib/renderer/InputRangeValueControl.js +6 -4
  742. package/lib/renderer/KeyValueMapControl.js +3 -3
  743. package/lib/renderer/ListItemControl.js +3 -3
  744. package/lib/renderer/MapSourceControl.js +3 -3
  745. package/lib/renderer/NavBadgeControl.d.ts +8 -8
  746. package/lib/renderer/NavBadgeControl.js +3 -3
  747. package/lib/renderer/NavDefaultActive.js +3 -3
  748. package/lib/renderer/NavSourceControl.d.ts +1 -1
  749. package/lib/renderer/NavSourceControl.js +3 -3
  750. package/lib/renderer/OptionControl.d.ts +22 -104
  751. package/lib/renderer/OptionControl.js +637 -428
  752. package/lib/renderer/RangePartsControl.js +3 -3
  753. package/lib/renderer/StatusControl.js +3 -3
  754. package/lib/renderer/SwitchMoreControl.js +5 -4
  755. package/lib/renderer/TableColumnWidthControl.js +3 -3
  756. package/lib/renderer/TimelineItemControl.js +3 -3
  757. package/lib/renderer/TplFormulaControl.d.ts +24 -1
  758. package/lib/renderer/TplFormulaControl.js +167 -28
  759. package/lib/renderer/TransferTableControl.js +3 -3
  760. package/lib/renderer/TreeOptionControl.js +3 -3
  761. package/lib/renderer/ValidateApiControl.js +3 -3
  762. package/lib/renderer/ValidationControl.d.ts +6 -1
  763. package/lib/renderer/ValidationControl.js +69 -30
  764. package/lib/renderer/ValidationItem.d.ts +2 -1
  765. package/lib/renderer/ValidationItem.js +20 -15
  766. package/lib/renderer/ValueFormatControl.js +3 -3
  767. package/lib/renderer/crud2-control/AddColumnModal.js +3 -3
  768. package/lib/renderer/crud2-control/CRUDColumnControl.js +3 -3
  769. package/lib/renderer/crud2-control/CRUDFiltersControl.js +3 -3
  770. package/lib/renderer/crud2-control/CRUDToolbarControl.js +3 -3
  771. package/lib/renderer/event-control/DialogActionPanel.js +13 -9
  772. package/lib/renderer/event-control/action-config-dialog.js +3 -3
  773. package/lib/renderer/event-control/action-config-panel.js +3 -3
  774. package/lib/renderer/event-control/comp-action-select.js +3 -3
  775. package/lib/renderer/event-control/helper.js +6 -6
  776. package/lib/renderer/event-control/index.js +8 -9
  777. package/lib/renderer/style-control/Background.js +3 -3
  778. package/lib/renderer/style-control/Border.js +3 -3
  779. package/lib/renderer/style-control/BoxModel.js +3 -3
  780. package/lib/renderer/style-control/BoxShadow.js +3 -3
  781. package/lib/renderer/style-control/ColCount.d.ts +5 -0
  782. package/lib/renderer/style-control/ColCount.js +61 -0
  783. package/lib/renderer/style-control/ColSize.d.ts +5 -0
  784. package/lib/renderer/style-control/ColSize.js +154 -0
  785. package/lib/renderer/style-control/Display.js +3 -3
  786. package/lib/renderer/style-control/FlexLayout.js +3 -3
  787. package/lib/renderer/style-control/Font.js +3 -3
  788. package/lib/renderer/style-control/InsetBoxModel.js +3 -3
  789. package/lib/renderer/style-control/LabelAlign.d.ts +5 -0
  790. package/lib/renderer/style-control/LabelAlign.js +76 -0
  791. package/lib/renderer/style-control/ThemeCssCode.js +3 -3
  792. package/lib/renderer/style-control/font-family.js +3 -3
  793. package/lib/renderer/style-control/helper.d.ts +4 -2
  794. package/lib/renderer/style-control/helper.js +34 -18
  795. package/lib/renderer/style-control/transformation.js +3 -3
  796. package/lib/renderer/textarea-formula/FormulaPicker.d.ts +1 -0
  797. package/lib/renderer/textarea-formula/FormulaPicker.js +11 -4
  798. package/lib/renderer/textarea-formula/TextareaFormulaControl.d.ts +20 -1
  799. package/lib/renderer/textarea-formula/TextareaFormulaControl.js +178 -34
  800. package/lib/renderer/textarea-formula/plugin.js +4 -4
  801. package/lib/tpl/api.js +3 -3
  802. package/lib/tpl/common.js +22 -4
  803. package/lib/tpl/horizontal.js +3 -3
  804. package/lib/tpl/layout.js +3 -3
  805. package/lib/tpl/options.js +3 -3
  806. package/lib/tpl/remark.js +17 -13
  807. package/lib/tpl/style.js +115 -32
  808. package/lib/tpl/validations.js +3 -3
  809. package/lib/util.js +3 -3
  810. package/lib/validator.js +3 -3
  811. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-editor v6.5.0
3
- * build time: 2024-05-31
2
+ * amis-editor v6.7.0
3
+ * build time: 2024-08-06
4
4
  * Copyright 2018-2024 @fex
5
5
  */
6
6
 
@@ -11,162 +11,24 @@ import cx from 'classnames';
11
11
  import DeepDiff from 'deep-diff';
12
12
  import uniqBy from 'lodash/uniqBy';
13
13
  import omit from 'lodash/omit';
14
- import get from 'lodash/get';
15
14
  import Sortable from 'sortablejs';
16
- import { Icon, Checkbox, render, Button, FormItem } from 'amis';
15
+ import { Icon, Checkbox, Button, normalizeApi, Renderer } from 'amis';
17
16
  import { value2array } from 'amis-ui/lib/components/Select';
18
- import { getI18nEnabled, getSchemaTpl, tipedLabel, autobind } from 'amis-editor-core';
19
- import debounce from 'lodash/debounce';
17
+ import { getI18nEnabled, getSchemaTpl, autobind, tipedLabel } from 'amis-editor-core';
20
18
  import { i18n } from 'i18n-runtime';
21
19
 
22
20
  /**
23
21
  * @file 组件选项组件的可视化编辑控件
24
22
  */
25
- var OptionControl = /** @class */function (_super) {
26
- __extends(OptionControl, _super);
27
- function OptionControl(props) {
28
- var _this = _super.call(this, props) || this;
29
- _this.internalProps = ['checked', 'editing'];
30
- var source = 'custom';
31
- if (props.data.hasOwnProperty('source') && props.data.source) {
32
- var api = props.data.source;
33
- var url = typeof api === 'string' ? api : typeof api === 'object' ? api.url || '' : '';
34
- source = /\$\{(.*?)\}/g.test(props.data.source) ? 'variable' : !url.indexOf('api://') ? 'apicenter' : 'api';
35
- }
36
- _this.state = {
37
- options: _this.transformOptions(props) || [],
38
- api: props.data.source,
39
- labelField: props.data.labelField,
40
- valueField: props.data.valueField,
41
- source: source
42
- };
43
- return _this;
23
+ var CustomOptionControl = /** @class */function (_super) {
24
+ __extends(CustomOptionControl, _super);
25
+ function CustomOptionControl() {
26
+ return _super !== null && _super.apply(this, arguments) || this;
44
27
  }
45
- /**
46
- * 数据更新
47
- */
48
- OptionControl.prototype.componentWillReceiveProps = function (nextProps) {
49
- var options = get(nextProps, 'data.options');
50
- // 左侧code手动更新时,同步配置面板
51
- if (DeepDiff.diff(options, this.lastOptions)) {
52
- this.setState({
53
- options: this.transformOptions(nextProps)
54
- });
55
- }
56
- };
57
- OptionControl.prototype.transformOptions = function (props) {
58
- var ctx = props.data,
59
- options = props.value;
60
- var defaultValue = ctx.value;
61
- var valueArray = value2array(defaultValue, ctx).map(function (item) {
62
- var _a;
63
- return item[(_a = ctx === null || ctx === void 0 ? void 0 : ctx.valueField) !== null && _a !== void 0 ? _a : 'value'];
64
- });
65
- return Array.isArray(options) ? options.map(function (item) {
66
- var _a;
67
- return __assign(__assign(__assign({
68
- label: item.label,
69
- // 为了使用户编写label时同时生效到value
70
- value: item.label === item.value ? null : item.value,
71
- checked: !!~valueArray.indexOf(item[(_a = ctx === null || ctx === void 0 ? void 0 : ctx.valueField) !== null && _a !== void 0 ? _a : 'value'])
72
- }, (item === null || item === void 0 ? void 0 : item.badge) ? {
73
- badge: item.badge
74
- } : {}), item.hidden !== undefined ? {
75
- hidden: item.hidden
76
- } : {}), item.hiddenOn !== undefined ? {
77
- hiddenOn: item.hiddenOn
78
- } : {});
79
- }) : [];
80
- };
81
- /**
82
- * 处理当前组件的默认值
83
- */
84
- OptionControl.prototype.normalizeValue = function () {
85
- var _this = this;
86
- var _a = this.props,
87
- _b = _a.data,
88
- ctx = _b === void 0 ? {} : _b,
89
- multipleProps = _a.multiple;
90
- var _c = ctx.joinValues,
91
- joinValues = _c === void 0 ? true : _c,
92
- extractValue = ctx.extractValue,
93
- multiple = ctx.multiple,
94
- delimiter = ctx.delimiter,
95
- valueField = ctx.valueField;
96
- var checkedOptions = this.state.options.filter(function (item) {
97
- return item.checked && (item === null || item === void 0 ? void 0 : item.hidden) !== true;
98
- }).map(function (item) {
99
- return omit(item, _this.internalProps);
100
- });
101
- var value;
102
- if (!checkedOptions.length) {
103
- return undefined;
104
- }
105
- if (multiple || multipleProps) {
106
- value = checkedOptions;
107
- if (joinValues) {
108
- value = checkedOptions.map(function (item) {
109
- return item[valueField || 'value'] || item[valueField || 'label'];
110
- }).join(delimiter || ',');
111
- } else if (extractValue) {
112
- value = checkedOptions.map(function (item) {
113
- return item[valueField || 'value'] || item[valueField || 'label'];
114
- });
115
- }
116
- } else {
117
- value = checkedOptions[0];
118
- if (joinValues || extractValue) {
119
- value = value[valueField || 'value'] || value[valueField || 'label'];
120
- }
121
- }
122
- return value;
123
- };
124
- /**
125
- * 更新options字段的统一出口
126
- */
127
- OptionControl.prototype.onChange = function () {
128
- var _a = this.state,
129
- source = _a.source,
130
- options = _a.options;
131
- var onBulkChange = this.props.onBulkChange;
132
- var defaultValue = this.normalizeValue();
133
- var data = {
134
- source: undefined,
135
- options: undefined,
136
- labelField: undefined,
137
- valueField: undefined
138
- };
139
- if (source === 'custom') {
140
- data.options = options.map(function (item) {
141
- return __assign(__assign(__assign({}, (item === null || item === void 0 ? void 0 : item.badge) ? {
142
- badge: item.badge
143
- } : {}), {
144
- label: item.label,
145
- value: item.value == null || item.value === '' ? item.label : item.value
146
- }), item.hiddenOn !== undefined ? {
147
- hiddenOn: item.hiddenOn
148
- } : {});
149
- });
150
- data.value = defaultValue;
151
- this.lastOptions = data.options;
152
- }
153
- if (source === 'api' || source === 'apicenter' || source === 'variable') {
154
- var _b = this.state,
155
- api = _b.api,
156
- labelField = _b.labelField,
157
- valueField = _b.valueField;
158
- data.source = api;
159
- data.labelField = labelField || undefined;
160
- data.valueField = valueField || undefined;
161
- this.lastOptions = data.source;
162
- }
163
- onBulkChange && onBulkChange(data);
164
- return;
165
- };
166
- OptionControl.prototype.targetRef = function (ref) {
28
+ CustomOptionControl.prototype.targetRef = function (ref) {
167
29
  this.target = ref ? findDOMNode(ref) : null;
168
30
  };
169
- OptionControl.prototype.dragRef = function (ref) {
31
+ CustomOptionControl.prototype.dragRef = function (ref) {
170
32
  if (!this.drag && ref) {
171
33
  this.initDragging();
172
34
  } else if (this.drag && !ref) {
@@ -174,8 +36,9 @@ var OptionControl = /** @class */function (_super) {
174
36
  }
175
37
  this.drag = ref;
176
38
  };
177
- OptionControl.prototype.initDragging = function () {
39
+ CustomOptionControl.prototype.initDragging = function () {
178
40
  var _this = this;
41
+ var onChange = this.props.onChange;
179
42
  var dom = findDOMNode(this);
180
43
  this.sortable = new Sortable(dom.querySelector('.ae-OptionControl-content'), {
181
44
  group: 'OptionControlGroup',
@@ -194,56 +57,39 @@ var OptionControl = /** @class */function (_super) {
194
57
  } else {
195
58
  parent.appendChild(e.item);
196
59
  }
197
- var options = _this.state.options.concat();
60
+ var options = _this.props.options.concat();
198
61
  options.splice(e.newIndex, 0, options.splice(e.oldIndex, 1)[0]);
199
- _this.setState({
62
+ onChange({
200
63
  options: options
201
- }, function () {
202
- return _this.onChange();
203
64
  });
204
65
  }
205
66
  });
206
67
  };
207
- OptionControl.prototype.destroyDragging = function () {
68
+ CustomOptionControl.prototype.destroyDragging = function () {
208
69
  this.sortable && this.sortable.destroy();
209
70
  };
210
- OptionControl.prototype.scroll2Bottom = function () {
211
- var _a, _b;
212
- this.drag && ((_b = (_a = this.drag) === null || _a === void 0 ? void 0 : _a.lastElementChild) === null || _b === void 0 ? void 0 : _b.scrollIntoView({
213
- behavior: 'smooth',
214
- block: 'nearest',
215
- inline: 'start'
216
- }));
217
- };
218
- /**
219
- * 切换选项类型
220
- */
221
- OptionControl.prototype.handleSourceChange = function (source) {
222
- this.setState({
223
- api: '',
224
- source: source
225
- }, this.onChange);
226
- };
227
71
  /**
228
72
  * 删除选项
229
73
  */
230
- OptionControl.prototype.handleDelete = function (index) {
231
- var _this = this;
232
- var options = this.state.options.concat();
74
+ CustomOptionControl.prototype.handleDelete = function (index) {
75
+ var _a = this.props,
76
+ onChange = _a.onChange,
77
+ originOptions = _a.options;
78
+ var options = originOptions.concat();
233
79
  options.splice(index, 1);
234
- this.setState({
80
+ onChange({
235
81
  options: options
236
- }, function () {
237
- return _this.onChange();
238
82
  });
239
83
  };
240
84
  /**
241
85
  * 设置默认选项
242
86
  */
243
- OptionControl.prototype.handleToggleDefaultValue = function (index, checked, shift) {
244
- var _this = this;
87
+ CustomOptionControl.prototype.handleToggleDefaultValue = function (index, checked, shift) {
245
88
  var _a, _b, _c;
246
- var options = this.state.options.concat();
89
+ var _d = this.props,
90
+ onChange = _d.onChange,
91
+ originOptions = _d.options;
92
+ var options = originOptions.concat();
247
93
  var isMultiple = ((_b = (_a = this.props) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.multiple) || ((_c = this.props) === null || _c === void 0 ? void 0 : _c.multiple);
248
94
  if (isMultiple) {
249
95
  options.splice(index, 1, __assign(__assign({}, options[index]), {
@@ -256,92 +102,104 @@ var OptionControl = /** @class */function (_super) {
256
102
  });
257
103
  });
258
104
  }
259
- this.setState({
105
+ onChange({
260
106
  options: options
261
- }, function () {
262
- return _this.onChange();
263
107
  });
264
108
  };
265
109
  /**
266
110
  * 编辑选项
267
111
  */
268
- OptionControl.prototype.toggleEdit = function (index) {
269
- var options = this.state.options;
270
- options[index].editing = !options[index].editing;
271
- this.setState({
112
+ CustomOptionControl.prototype.toggleEdit = function (index) {
113
+ var _a = this.props,
114
+ onChange = _a.onChange,
115
+ originOptions = _a.options;
116
+ var options = originOptions.concat();
117
+ options.splice(index, 1, __assign(__assign({}, options[index]), {
118
+ editing: !options[index].editing
119
+ }));
120
+ onChange({
272
121
  options: options
273
122
  });
274
123
  };
275
124
  /**
276
125
  * 编辑角标
277
126
  */
278
- OptionControl.prototype.toggleBadge = function (index, value) {
279
- var _this = this;
280
- var options = this.state.options;
281
- options[index].badge = value;
282
- this.setState({
127
+ CustomOptionControl.prototype.toggleBadge = function (index, value) {
128
+ var _a = this.props,
129
+ onChange = _a.onChange,
130
+ originOptions = _a.options;
131
+ var options = originOptions.concat();
132
+ options.splice(index, 1, __assign(__assign({}, options[index]), {
133
+ badge: value
134
+ }));
135
+ onChange({
283
136
  options: options
284
- }, function () {
285
- return _this.onChange();
286
137
  });
287
138
  };
288
- OptionControl.prototype.handleEditLabel = function (index, value) {
289
- var _this = this;
290
- var options = this.state.options.concat();
139
+ CustomOptionControl.prototype.handleEditLabel = function (index, value) {
140
+ var _a = this.props,
141
+ onChange = _a.onChange,
142
+ originOptions = _a.options;
143
+ var options = originOptions.concat();
291
144
  options.splice(index, 1, __assign(__assign({}, options[index]), {
292
145
  label: value
293
146
  }));
294
- this.setState({
147
+ onChange({
295
148
  options: options
296
- }, function () {
297
- return _this.onChange();
298
149
  });
299
150
  };
300
- OptionControl.prototype.handleHiddenValueChange = function (index, value) {
301
- var _this = this;
302
- var options = this.state.options.concat();
303
- var _a = options[index];
304
- _a.hiddenOn;
305
- var option = __rest(_a, ["hiddenOn"]);
306
- options.splice(index, 1, __assign(__assign({}, option), !value ? {} : {
307
- hiddenOn: value
308
- }));
309
- this.setState({
151
+ CustomOptionControl.prototype.handleHiddenValueChange = function (index, value) {
152
+ var _a = this.props,
153
+ onChange = _a.onChange,
154
+ originOptions = _a.options;
155
+ var options = originOptions.concat();
156
+ var _b = options[index];
157
+ _b.hiddenOn;
158
+ var option = __rest(_b, ["hiddenOn"]);
159
+ var newOption = __assign({}, option);
160
+ if (value) {
161
+ newOption.hiddenOn = value;
162
+ } else {
163
+ delete newOption.hiddenOn;
164
+ }
165
+ options.splice(index, 1, newOption);
166
+ onChange({
310
167
  options: options
311
- }, function () {
312
- return _this.onChange();
313
168
  });
314
169
  };
315
- OptionControl.prototype.handleAdd = function () {
316
- var _this = this;
317
- var options = this.state.options;
170
+ CustomOptionControl.prototype.handleAdd = function () {
171
+ var _a = this.props,
172
+ onChange = _a.onChange,
173
+ originOptions = _a.options;
174
+ var options = originOptions.concat();
318
175
  options.push({
319
176
  label: '',
320
177
  value: null,
321
178
  checked: false
322
179
  });
323
- this.setState({
180
+ onChange({
324
181
  options: options
325
- }, function () {
326
- _this.onChange();
327
182
  });
328
183
  };
329
- OptionControl.prototype.handleValueChange = function (index, value) {
330
- var _this = this;
331
- var options = this.state.options.concat();
184
+ CustomOptionControl.prototype.handleValueChange = function (index, value) {
185
+ var _a = this.props,
186
+ onChange = _a.onChange,
187
+ originOptions = _a.options;
188
+ var options = originOptions.concat();
332
189
  options[index].value = value;
333
- this.setState({
190
+ onChange({
334
191
  options: options
335
- }, function () {
336
- return _this.onChange();
337
192
  });
338
193
  };
339
- OptionControl.prototype.handleBatchAdd = function (values, action) {
340
- var _this = this;
341
- var options = this.state.options.concat();
194
+ CustomOptionControl.prototype.handleBatchAdd = function (values, action) {
195
+ var _a = this.props,
196
+ onChange = _a.onChange,
197
+ _b = _a.customEdit,
198
+ customEdit = _b === void 0 ? true : _b;
199
+ var options = this.props.data.options || [];
342
200
  var addedOptions = values[0].batchOption.split('\n').map(function (option) {
343
201
  var item = option.trim();
344
- if (~item.indexOf(' ')) {
202
+ if (~item.indexOf(' ') && customEdit) {
345
203
  var _a = __read(item.split(' '), 2),
346
204
  label = _a[0],
347
205
  value = _a[1];
@@ -358,96 +216,30 @@ var OptionControl = /** @class */function (_super) {
358
216
  };
359
217
  });
360
218
  var newOptions = uniqBy(__spreadArray(__spreadArray([], __read(options), false), __read(addedOptions), false), 'value');
361
- this.setState({
219
+ onChange({
362
220
  options: newOptions
363
- }, function () {
364
- return _this.onChange();
365
221
  });
366
222
  };
367
- OptionControl.prototype.renderHeader = function () {
368
- var _this = this;
369
- var _a;
370
- var _b = this.props,
371
- render = _b.render,
372
- label = _b.label,
373
- labelRemark = _b.labelRemark,
374
- useMobileUI = _b.useMobileUI,
375
- env = _b.env,
376
- popOverContainer = _b.popOverContainer,
377
- hasApiCenter = _b.hasApiCenter;
378
- var classPrefix = (_a = env === null || env === void 0 ? void 0 : env.theme) === null || _a === void 0 ? void 0 : _a.classPrefix;
379
- var source = this.state.source;
380
- var optionSourceList = __spreadArray(__spreadArray([{
381
- label: i18n("01820262aa9ad5b130f8f5b86bfd2968"),
382
- value: 'custom'
383
- }, {
384
- label: i18n("f99603414a616bdee85de0e6e3938b65"),
385
- value: 'api'
386
- }], __read(hasApiCenter ? [{
387
- label: i18n("e6ff6a97bf600c02942db3126a7077b8"),
388
- value: 'apicenter'
389
- }] : []), false), [{
390
- label: i18n("50334fc77fc5a2c2636f14f158d3c417"),
391
- value: 'variable'
392
- }
393
- // {
394
- // label: '表单实体',
395
- // value: 'form'
396
- // }
397
- ], false).map(function (item) {
398
- return __assign(__assign({}, item), {
399
- onClick: function () {
400
- return _this.handleSourceChange(item.value);
401
- }
402
- });
403
- });
404
- return React__default.createElement("header", {
405
- className: "ae-OptionControl-header"
406
- }, React__default.createElement("label", {
407
- className: cx("".concat(classPrefix, "Form-label"))
408
- }, label || '', labelRemark ? render('label-remark', {
409
- type: 'remark',
410
- icon: labelRemark.icon || 'warning-mark',
411
- tooltip: labelRemark,
412
- className: cx("Form-lableRemark", labelRemark === null || labelRemark === void 0 ? void 0 : labelRemark.className),
413
- useMobileUI: useMobileUI,
414
- container: popOverContainer || env.getModalContainer
415
- }) : null), React__default.createElement("div", null, render('validation-control-addBtn', {
416
- type: 'dropdown-button',
417
- level: 'link',
418
- size: 'sm',
419
- label: '${selected}',
420
- align: 'right',
421
- closeOnClick: true,
422
- closeOnOutside: true,
423
- buttons: optionSourceList
424
- }, {
425
- popOverContainer: null,
426
- data: {
427
- selected: optionSourceList.find(function (item) {
428
- return item.value === source;
429
- }).label
430
- }
431
- })));
432
- };
433
- OptionControl.prototype.renderOption = function (props) {
223
+ CustomOptionControl.prototype.renderOption = function (props) {
434
224
  var _this = this;
435
225
  var checked = props.checked,
436
226
  index = props.index,
437
227
  editing = props.editing,
438
228
  multipleProps = props.multipleProps,
439
229
  closeDefaultCheck = props.closeDefaultCheck,
440
- hiddenOn = props.hiddenOn;
441
- var _a = this.props,
442
- render$1 = _a.render,
443
- ctx = _a.data,
444
- node = _a.node;
230
+ hiddenOn = props.hiddenOn,
231
+ _a = props.customEdit,
232
+ customEdit = _a === void 0 ? true : _a;
233
+ var _b = this.props,
234
+ render = _b.render,
235
+ ctx = _b.data,
236
+ node = _b.node;
445
237
  var isMultiple = (ctx === null || ctx === void 0 ? void 0 : ctx.multiple) === true || multipleProps;
446
238
  var i18nEnabled = getI18nEnabled();
447
239
  var showBadge = node.type === 'button-group-select';
448
240
  var editDom = editing ? React__default.createElement("div", {
449
241
  className: "ae-OptionControlItem-extendMore"
450
- }, render$1('option', {
242
+ }, render('option', {
451
243
  type: 'container',
452
244
  className: 'ae-ExtendMore right mb-2',
453
245
  body: [{
@@ -460,47 +252,86 @@ var OptionControl = /** @class */function (_super) {
460
252
  return _this.toggleEdit(index);
461
253
  }
462
254
  }, {
463
- type: i18nEnabled ? 'input-text-i18n' : 'input-text',
464
- placeholder: i18n("b4fdf79b8f54856b072ec3874b830d1f"),
465
- label: i18n("97d07614380da93d257f9fbf81aa56fb"),
466
- mode: 'horizontal',
467
- value: props === null || props === void 0 ? void 0 : props.label,
468
- labelClassName: 'ae-OptionControlItem-EditLabel',
469
- valueClassName: 'ae-OptionControlItem-EditValue',
470
- onChange: function (v) {
471
- return _this.handleEditLabel(index, v);
255
+ children: function (_a) {
256
+ var render = _a.render,
257
+ innerValue = _a.innerValue;
258
+ return render('innerLabel', {
259
+ name: 'label',
260
+ type: i18nEnabled ? 'input-text-i18n' : 'input-text',
261
+ placeholder: i18n("b4fdf79b8f54856b072ec3874b830d1f"),
262
+ label: i18n("97d07614380da93d257f9fbf81aa56fb"),
263
+ mode: 'horizontal',
264
+ labelClassName: 'ae-OptionControlItem-EditLabel',
265
+ valueClassName: 'ae-OptionControlItem-EditValue'
266
+ }, {
267
+ value: innerValue.label || '',
268
+ onChange: function (v) {
269
+ return _this.handleEditLabel(index, v);
270
+ }
271
+ });
472
272
  }
473
273
  }, {
474
- type: 'ae-valueFormat',
475
- placeholder: i18n("f4ab507e2fa2d2bd66bcdeafd9fef797"),
476
- labelClassName: 'ae-OptionControlItem-EditLabel',
477
- valueClassName: 'ae-OptionControlItem-EditValue',
478
- label: i18n("fe7509e0ed085b86f07e3e9975cc5b3d"),
479
- value: props === null || props === void 0 ? void 0 : props.value,
480
- onChange: function (v) {
481
- return _this.handleValueChange(index, v);
274
+ children: function (_a) {
275
+ var render = _a.render,
276
+ innerValue = _a.innerValue;
277
+ return render('innerValue', {
278
+ name: 'value',
279
+ type: 'ae-valueFormat',
280
+ placeholder: i18n("f4ab507e2fa2d2bd66bcdeafd9fef797"),
281
+ labelClassName: 'ae-OptionControlItem-EditLabel',
282
+ valueClassName: 'ae-OptionControlItem-EditValue',
283
+ label: i18n("fe7509e0ed085b86f07e3e9975cc5b3d")
284
+ }, {
285
+ value: (innerValue === null || innerValue === void 0 ? void 0 : innerValue.value) || '',
286
+ onChange: function (v) {
287
+ return _this.handleValueChange(index, v);
288
+ }
289
+ });
482
290
  }
483
- }, getSchemaTpl('expressionFormulaControl', {
484
- label: i18n("dce5379cb978a8259ecfca8f08f00817"),
485
- value: hiddenOn,
486
- labelClassName: 'ae-OptionControlItem-EditLabel',
487
- valueClassName: 'ae-OptionControlItem-EditValue',
488
- onChange: function (v) {
489
- return _this.handleHiddenValueChange(index, v);
291
+ }, {
292
+ children: function (_a) {
293
+ var render = _a.render,
294
+ innerValue = _a.innerValue;
295
+ return render('innerHiddenOn', getSchemaTpl('expressionFormulaControl', {
296
+ label: i18n("dce5379cb978a8259ecfca8f08f00817"),
297
+ name: 'hiddenOn',
298
+ labelClassName: 'ae-OptionControlItem-EditLabel',
299
+ valueClassName: 'ae-OptionControlItem-EditValue'
300
+ }), {
301
+ value: innerValue.hiddenOn || '',
302
+ onChange: function (v) {
303
+ return _this.handleHiddenValueChange(index, v);
304
+ }
305
+ });
490
306
  }
491
- }), {
492
- type: i18nEnabled ? 'input-text-i18n' : 'input-text',
493
- placeholder: i18n("7f05bea37729325a6cc84eb26bb9f8c8"),
494
- label: i18n("b8c467fce096a649583c0bc9d9281a5c"),
495
- mode: 'horizontal',
496
- visible: showBadge,
497
- value: props === null || props === void 0 ? void 0 : props.badge,
498
- labelClassName: 'ae-OptionControlItem-EditLabel',
499
- valueClassName: 'ae-OptionControlItem-EditValue',
500
- onChange: function (v) {
501
- return _this.toggleBadge(index, v);
307
+ }, {
308
+ children: function (_a) {
309
+ var render = _a.render,
310
+ innerValue = _a.innerValue;
311
+ return render('innerBadge', {
312
+ type: i18nEnabled ? 'input-text-i18n' : 'input-text',
313
+ placeholder: i18n("7f05bea37729325a6cc84eb26bb9f8c8"),
314
+ label: i18n("b8c467fce096a649583c0bc9d9281a5c"),
315
+ mode: 'horizontal',
316
+ name: 'badge',
317
+ visible: showBadge,
318
+ labelClassName: 'ae-OptionControlItem-EditLabel',
319
+ valueClassName: 'ae-OptionControlItem-EditValue'
320
+ }, {
321
+ value: innerValue.badge || '',
322
+ onChange: function (v) {
323
+ return _this.toggleBadge(index, v);
324
+ }
325
+ });
502
326
  }
503
327
  }]
328
+ }, {
329
+ innerValue: {
330
+ label: props.label,
331
+ value: props.value,
332
+ badge: props.badge,
333
+ hiddenOn: hiddenOn
334
+ }
504
335
  })) : null;
505
336
  var operationBtn = [{
506
337
  type: 'button',
@@ -551,16 +382,20 @@ var OptionControl = /** @class */function (_super) {
551
382
  onChange: function (newChecked, shift) {
552
383
  return _this.handleToggleDefaultValue(index, newChecked, shift);
553
384
  }
554
- })), render({
385
+ })), render('label', {
386
+ name: 'label',
555
387
  type: i18nEnabled ? 'input-text-i18n' : 'input-text',
388
+ label: false,
556
389
  className: 'ae-OptionControlItem-input',
557
- value: props === null || props === void 0 ? void 0 : props.label,
558
390
  placeholder: i18n("5d26b8a41e805204c9dcd5ea7e23b150"),
559
- clearable: false,
391
+ clearable: false
392
+ }, {
393
+ value: (props === null || props === void 0 ? void 0 : props.label) || '',
394
+ disabled: editing,
560
395
  onChange: function (value) {
561
396
  _this.handleEditLabel(index, value);
562
397
  }
563
- }), render$1('dropdown', {
398
+ }), customEdit ? render('dropdown', {
564
399
  type: 'dropdown-button',
565
400
  className: 'ae-OptionControlItem-dropdown',
566
401
  btnClassName: 'px-2',
@@ -572,9 +407,19 @@ var OptionControl = /** @class */function (_super) {
572
407
  buttons: operationBtn
573
408
  }, {
574
409
  popOverContainer: null // amis 渲染挂载节点会使用 this.target
410
+ }) : render('delete', {
411
+ type: 'button',
412
+ className: 'ae-OptionControlItem-action-delete',
413
+ icon: 'fa fa-trash',
414
+ level: 'link',
415
+ onClick: function () {
416
+ return _this.handleDelete(index);
417
+ }
575
418
  })), editDom);
576
419
  };
577
- OptionControl.prototype.buildBatchAddSchema = function () {
420
+ CustomOptionControl.prototype.buildBatchAddSchema = function () {
421
+ var _a = this.props.customEdit,
422
+ customEdit = _a === void 0 ? true : _a;
578
423
  return {
579
424
  type: 'action',
580
425
  actionType: 'dialog',
@@ -591,7 +436,7 @@ var OptionControl = /** @class */function (_super) {
591
436
  level: 'warning',
592
437
  body: [{
593
438
  type: 'tpl',
594
- tpl: i18n("c130bd5b55edefdaf8923269e9a52439")
439
+ tpl: '每个选项单列一行,将所有值不重复的项加为新的选项;' + (customEdit ? '<br/>每行可通过空格来分别设置label和value,例:"张三 zhangsan"' : '')
595
440
  }],
596
441
  showIcon: true,
597
442
  className: 'mb-2.5'
@@ -621,79 +466,19 @@ var OptionControl = /** @class */function (_super) {
621
466
  }
622
467
  };
623
468
  };
624
- OptionControl.prototype.handleAPIChange = function (source) {
625
- this.setState({
626
- api: source
627
- }, this.onChange);
628
- };
629
- OptionControl.prototype.handleLableFieldChange = function (labelField) {
630
- this.setState({
631
- labelField: labelField
632
- }, this.onChange);
633
- };
634
- OptionControl.prototype.handleValueFieldChange = function (valueField) {
635
- this.setState({
636
- valueField: valueField
637
- }, this.onChange);
638
- };
639
- /** 获取功能性字段控件 schema */
640
- OptionControl.prototype.getFuncFieldSchema = function () {
641
- var _a = this.state,
642
- labelField = _a.labelField,
643
- valueField = _a.valueField;
644
- return [{
645
- label: tipedLabel(i18n("7e9c83e86beb612377a94e6e8d1fc644"), i18n("26ff46d82166741297ce666b2792af85")),
646
- type: 'input-text',
647
- name: 'labelField',
648
- clearable: true,
649
- value: labelField,
650
- placeholder: i18n("6d4ce0631f37676a887c9599691fabec"),
651
- onChange: this.handleLableFieldChange
652
- }, {
653
- label: i18n("2e01f5f5889e33d003bec7857cd38445"),
654
- type: 'input-text',
655
- name: 'valueField',
656
- clearable: true,
657
- value: valueField,
658
- placeholder: i18n("959c27193eb0a41d01f4b53dcc4b9245"),
659
- onChange: this.handleValueFieldChange
660
- }];
661
- };
662
- OptionControl.prototype.renderApiPanel = function () {
663
- var render = this.props.render;
664
- var _a = this.state,
665
- source = _a.source,
666
- api = _a.api;
667
- return render('api', getSchemaTpl('apiControl', {
668
- label: i18n("54ea89b497ec3bb319c68844dfa3687f"),
669
- name: 'source',
670
- mode: 'normal',
671
- className: 'ae-ExtendMore',
672
- visibleOn: 'this.autoComplete !== false',
673
- value: api,
674
- onChange: this.handleAPIChange,
675
- sourceType: source,
676
- footer: this.getFuncFieldSchema()
677
- }));
678
- };
679
- OptionControl.prototype.render = function () {
469
+ CustomOptionControl.prototype.render = function () {
680
470
  var _this = this;
681
- var _a = this.state,
471
+ var _a = this.props,
682
472
  options = _a.options,
683
- source = _a.source;
684
- var _b = this.props,
685
- render = _b.render,
686
- className = _b.className,
687
- multipleProps = _b.multiple;
473
+ multipleProps = _a.multiple,
474
+ render = _a.render;
688
475
  return React__default.createElement("div", {
689
- className: cx('ae-OptionControl', className)
690
- }, this.renderHeader(), source === 'custom' ? React__default.createElement("div", {
691
476
  className: "ae-OptionControl-wrapper"
692
477
  }, Array.isArray(options) && options.length ? React__default.createElement("ul", {
693
478
  className: "ae-OptionControl-content",
694
479
  ref: this.dragRef
695
480
  }, options.map(function (option, index) {
696
- return _this.renderOption(__assign(__assign({}, option), {
481
+ return _this.renderOption(__assign(__assign(__assign({}, _this.props), option), {
697
482
  index: index,
698
483
  multipleProps: multipleProps
699
484
  }));
@@ -705,26 +490,453 @@ var OptionControl = /** @class */function (_super) {
705
490
  level: "enhance",
706
491
  onClick: this.handleAdd,
707
492
  ref: this.targetRef
708
- }, i18n("e8755fb1e985a5d26df0fce1f0b7b0f8")), render('inner', this.buildBatchAddSchema()))) : null, source === 'api' || source === 'apicenter' ? this.renderApiPanel() : null, source === 'variable' ? render('variable', {
493
+ }, i18n("e8755fb1e985a5d26df0fce1f0b7b0f8")), render('inner', this.buildBatchAddSchema())));
494
+ };
495
+ __decorate([autobind, __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", void 0)], CustomOptionControl.prototype, "targetRef", null);
496
+ __decorate([autobind, __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", void 0)], CustomOptionControl.prototype, "dragRef", null);
497
+ __decorate([autobind, __metadata("design:type", Function), __metadata("design:paramtypes", [Number, String]), __metadata("design:returntype", void 0)], CustomOptionControl.prototype, "handleEditLabel", null);
498
+ __decorate([autobind, __metadata("design:type", Function), __metadata("design:paramtypes", [Number, String]), __metadata("design:returntype", void 0)], CustomOptionControl.prototype, "handleHiddenValueChange", null);
499
+ __decorate([autobind, __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0)], CustomOptionControl.prototype, "handleAdd", null);
500
+ __decorate([autobind, __metadata("design:type", Function), __metadata("design:paramtypes", [Array, Object]), __metadata("design:returntype", void 0)], CustomOptionControl.prototype, "handleBatchAdd", null);
501
+ return CustomOptionControl;
502
+ }(React__default.Component);
503
+ // 负责 api 和 apicenter 的配置
504
+ function APIOptionControl(_a) {
505
+ var render = _a.render,
506
+ source = _a.source,
507
+ api = _a.api,
508
+ onChange = _a.onChange,
509
+ labelField = _a.labelField,
510
+ valueField = _a.valueField;
511
+ var handleAPIChange = React__default.useCallback(function (source) {
512
+ onChange({
513
+ api: source
514
+ });
515
+ }, []);
516
+ var handleLabelFieldChange = React__default.useCallback(function (value) {
517
+ onChange({
518
+ labelField: value
519
+ });
520
+ }, []);
521
+ var handleValueFieldChange = React__default.useCallback(function (value) {
522
+ onChange({
523
+ valueField: value
524
+ });
525
+ }, []);
526
+ var footer = React__default.useMemo(function () {
527
+ return [{
528
+ children: function (_a) {
529
+ var render = _a.render,
530
+ labelField = _a.labelField;
531
+ return render('inner', {
532
+ label: tipedLabel(i18n("7e9c83e86beb612377a94e6e8d1fc644"), i18n("26ff46d82166741297ce666b2792af85")),
533
+ type: 'input-text',
534
+ name: 'labelField',
535
+ clearable: true,
536
+ placeholder: i18n("6d4ce0631f37676a887c9599691fabec")
537
+ }, {
538
+ value: labelField,
539
+ onChange: handleLabelFieldChange
540
+ });
541
+ }
542
+ }, {
543
+ children: function (_a) {
544
+ var render = _a.render,
545
+ valueField = _a.valueField;
546
+ return render('inner', {
547
+ label: i18n("2e01f5f5889e33d003bec7857cd38445"),
548
+ type: 'input-text',
549
+ name: 'valueField',
550
+ clearable: true,
551
+ placeholder: i18n("959c27193eb0a41d01f4b53dcc4b9245")
552
+ }, {
553
+ value: valueField,
554
+ onChange: handleValueFieldChange
555
+ });
556
+ }
557
+ }];
558
+ }, []);
559
+ var schema = React__default.useMemo(function () {
560
+ return getSchemaTpl('apiControl', {
561
+ label: i18n("54ea89b497ec3bb319c68844dfa3687f"),
562
+ name: 'source',
563
+ mode: 'normal',
564
+ className: 'ae-ExtendMore',
565
+ visibleOn: 'this.autoComplete !== false',
566
+ footer: footer
567
+ });
568
+ }, [footer]);
569
+ return render('api', schema, {
570
+ value: api,
571
+ onChange: handleAPIChange,
572
+ sourceType: source,
573
+ labelField: labelField,
574
+ valueField: valueField
575
+ });
576
+ }
577
+ // 负责上下文变量绑定的配置
578
+ function variableOptionControl(_a) {
579
+ var render = _a.render,
580
+ api = _a.api,
581
+ onChange = _a.onChange,
582
+ labelField = _a.labelField,
583
+ valueField = _a.valueField;
584
+ var handleAPIChange = React__default.useCallback(function (source) {
585
+ onChange({
586
+ api: source
587
+ });
588
+ }, []);
589
+ var handleLabelFieldChange = React__default.useCallback(function (value) {
590
+ onChange({
591
+ labelField: value
592
+ });
593
+ }, []);
594
+ var handleValueFieldChange = React__default.useCallback(function (value) {
595
+ onChange({
596
+ valueField: value
597
+ });
598
+ }, []);
599
+ var footer = React__default.useMemo(function () {
600
+ return [{
601
+ children: function (_a) {
602
+ var render = _a.render,
603
+ controlledValue = _a.controlledValue;
604
+ return render('inner', {
605
+ label: tipedLabel(i18n("7e9c83e86beb612377a94e6e8d1fc644"), i18n("26ff46d82166741297ce666b2792af85")),
606
+ type: 'input-text',
607
+ name: 'labelField',
608
+ clearable: true,
609
+ placeholder: i18n("6d4ce0631f37676a887c9599691fabec")
610
+ }, {
611
+ value: controlledValue.labelField,
612
+ onChange: handleLabelFieldChange
613
+ });
614
+ }
615
+ }, {
616
+ children: function (_a) {
617
+ var render = _a.render,
618
+ controlledValue = _a.controlledValue;
619
+ return render('inner', {
620
+ label: i18n("2e01f5f5889e33d003bec7857cd38445"),
621
+ type: 'input-text',
622
+ name: 'valueField',
623
+ clearable: true,
624
+ placeholder: i18n("959c27193eb0a41d01f4b53dcc4b9245")
625
+ }, {
626
+ value: controlledValue.valueField,
627
+ onChange: handleValueFieldChange
628
+ });
629
+ }
630
+ }];
631
+ }, []);
632
+ var schema = React__default.useMemo(function () {
633
+ return {
709
634
  type: 'control',
710
635
  label: false,
711
636
  className: 'ae-ExtendMore',
712
- body: [getSchemaTpl('sourceBindControl', {
713
- label: false,
714
- onChange: debounce(this.handleAPIChange, 1000)
715
- })].concat(this.getFuncFieldSchema())
716
- }) : null);
637
+ body: [{
638
+ children: function (_a) {
639
+ var render = _a.render,
640
+ controlledValue = _a.controlledValue;
641
+ return render('inner', getSchemaTpl('sourceBindControl', {
642
+ label: false
643
+ }), {
644
+ value: controlledValue.api,
645
+ onChange: handleAPIChange
646
+ });
647
+ }
648
+ }].concat(footer)
649
+ };
650
+ }, [footer]);
651
+ return render('api', schema, {
652
+ controlledValue: {
653
+ api: api,
654
+ labelField: labelField,
655
+ valueField: valueField
656
+ }
657
+ });
658
+ }
659
+ var builtinOptionSource = [{
660
+ label: i18n("01820262aa9ad5b130f8f5b86bfd2968"),
661
+ value: 'custom',
662
+ component: CustomOptionControl
663
+ }, {
664
+ label: i18n("f99603414a616bdee85de0e6e3938b65"),
665
+ value: 'api',
666
+ component: APIOptionControl,
667
+ test: function (_a) {
668
+ var api = _a.api;
669
+ var url = normalizeApi(api).url;
670
+ return !!(typeof url === 'string' && url && !(typeof api === 'string' && /\$\{(.*?)\}/g.test(api)));
671
+ }
672
+ }, {
673
+ label: i18n("e6ff6a97bf600c02942db3126a7077b8"),
674
+ value: 'apicenter',
675
+ component: APIOptionControl,
676
+ test: function (_a) {
677
+ var api = _a.api;
678
+ var url = normalizeApi(api).url;
679
+ return typeof url === 'string' && url.startsWith('api://');
680
+ }
681
+ }, {
682
+ label: i18n("50334fc77fc5a2c2636f14f158d3c417"),
683
+ value: 'variable',
684
+ component: variableOptionControl,
685
+ test: function (_a) {
686
+ var api = _a.api;
687
+ return typeof api === 'string' && /\$\{(.*?)\}/g.test(api);
688
+ }
689
+ }];
690
+ var OptionControl = /** @class */function (_super) {
691
+ __extends(OptionControl, _super);
692
+ function OptionControl(props) {
693
+ var _this = _super.call(this, props) || this;
694
+ _this.internalProps = ['checked', 'editing'];
695
+ _this.optionSources = [];
696
+ _this.optionSources = builtinOptionSource.concat(Array.isArray(props.extraOptionSources) ? props.extraOptionSources : []);
697
+ var state = {
698
+ options: _this.transformOptions(props) || [],
699
+ api: props.data.source,
700
+ labelField: props.data.labelField,
701
+ valueField: props.data.valueField
702
+ };
703
+ var source = _this.enabledOptionSources.reduce(function (type, source) {
704
+ var _a;
705
+ return type !== null && type !== void 0 ? type : ((_a = source.test) === null || _a === void 0 ? void 0 : _a.call(source, state)) === true ? source.value : type;
706
+ }, undefined) || 'custom';
707
+ _this.state = __assign(__assign({}, state), {
708
+ source: source
709
+ });
710
+ return _this;
711
+ }
712
+ /**
713
+ * 数据更新
714
+ */
715
+ OptionControl.prototype.componentWillReceiveProps = function (nextProps) {
716
+ var options = nextProps.data.options;
717
+ // 左侧code手动更新时,同步配置面板
718
+ if (DeepDiff.diff(options, this.lastOptions)) {
719
+ this.setState({
720
+ options: this.transformOptions(nextProps)
721
+ });
722
+ }
723
+ };
724
+ Object.defineProperty(OptionControl.prototype, "enabledOptionSources", {
725
+ get: function () {
726
+ var _a = this.props,
727
+ hasApiCenter = _a.hasApiCenter,
728
+ enabledOptionSourceType = _a.enabledOptionSourceType;
729
+ var options = this.optionSources;
730
+ if (!hasApiCenter) {
731
+ options = options.filter(function (item) {
732
+ return item.value !== 'apicenter';
733
+ });
734
+ }
735
+ if (Array.isArray(enabledOptionSourceType)) {
736
+ options = enabledOptionSourceType.map(function (type) {
737
+ return options.find(function (a) {
738
+ return a.value === type;
739
+ });
740
+ }).filter(function (item) {
741
+ return item;
742
+ });
743
+ }
744
+ return options;
745
+ },
746
+ enumerable: false,
747
+ configurable: true
748
+ });
749
+ OptionControl.prototype.transformOptions = function (props) {
750
+ var ctx = props.data;
751
+ var options = ctx.options;
752
+ var defaultValue = ctx.value;
753
+ var valueArray = value2array(defaultValue, ctx).map(function (item) {
754
+ var _a;
755
+ return item[(_a = ctx === null || ctx === void 0 ? void 0 : ctx.valueField) !== null && _a !== void 0 ? _a : 'value'];
756
+ });
757
+ return Array.isArray(options) ? options.map(function (item) {
758
+ var _a;
759
+ return __assign(__assign(__assign({
760
+ label: item.label,
761
+ // 为了使用户编写label时同时生效到value
762
+ value: item.label === item.value ? null : item.value,
763
+ checked: !!~valueArray.indexOf(item[(_a = ctx === null || ctx === void 0 ? void 0 : ctx.valueField) !== null && _a !== void 0 ? _a : 'value'])
764
+ }, (item === null || item === void 0 ? void 0 : item.badge) ? {
765
+ badge: item.badge
766
+ } : {}), item.hidden !== undefined ? {
767
+ hidden: item.hidden
768
+ } : {}), item.hiddenOn !== undefined ? {
769
+ hiddenOn: item.hiddenOn
770
+ } : {});
771
+ }) : [];
772
+ };
773
+ /**
774
+ * 处理当前组件的默认值
775
+ */
776
+ OptionControl.prototype.normalizeValue = function () {
777
+ var _this = this;
778
+ var _a = this.props,
779
+ _b = _a.data,
780
+ ctx = _b === void 0 ? {} : _b,
781
+ multipleProps = _a.multiple;
782
+ var _c = ctx.joinValues,
783
+ joinValues = _c === void 0 ? true : _c,
784
+ extractValue = ctx.extractValue,
785
+ multiple = ctx.multiple,
786
+ delimiter = ctx.delimiter,
787
+ valueField = ctx.valueField;
788
+ var checkedOptions = this.state.options.filter(function (item) {
789
+ return item.checked && (item === null || item === void 0 ? void 0 : item.hidden) !== true;
790
+ }).map(function (item) {
791
+ return omit(item, _this.internalProps);
792
+ });
793
+ var value;
794
+ if (!checkedOptions.length) {
795
+ return undefined;
796
+ }
797
+ if (multiple || multipleProps) {
798
+ value = checkedOptions;
799
+ if (joinValues) {
800
+ value = checkedOptions.map(function (item) {
801
+ return item[valueField || 'value'] || item[valueField || 'label'];
802
+ }).join(delimiter || ',');
803
+ } else if (extractValue) {
804
+ value = checkedOptions.map(function (item) {
805
+ return item[valueField || 'value'] || item[valueField || 'label'];
806
+ });
807
+ }
808
+ } else {
809
+ value = checkedOptions[0];
810
+ if (joinValues || extractValue) {
811
+ value = value[valueField || 'value'] || value[valueField || 'label'];
812
+ }
813
+ }
814
+ return value;
815
+ };
816
+ /**
817
+ * 更新options字段的统一出口
818
+ */
819
+ OptionControl.prototype.emitChange = function () {
820
+ var _a = this.state,
821
+ source = _a.source,
822
+ options = _a.options;
823
+ var onBulkChange = this.props.onBulkChange;
824
+ var defaultValue = this.normalizeValue();
825
+ var data = {
826
+ source: undefined,
827
+ options: undefined,
828
+ labelField: undefined,
829
+ valueField: undefined
830
+ };
831
+ if (source === 'custom') {
832
+ data.options = options.map(function (item) {
833
+ return __assign(__assign(__assign({}, (item === null || item === void 0 ? void 0 : item.badge) ? {
834
+ badge: item.badge
835
+ } : {}), {
836
+ label: item.label,
837
+ value: item.value == null || item.value === '' ? item.label : item.value
838
+ }), item.hiddenOn !== undefined ? {
839
+ hiddenOn: item.hiddenOn
840
+ } : {});
841
+ });
842
+ data.value = defaultValue;
843
+ this.lastOptions = data.options;
844
+ }
845
+ if (source === 'api' || source === 'apicenter' || source === 'variable') {
846
+ var _b = this.state,
847
+ api = _b.api,
848
+ labelField = _b.labelField,
849
+ valueField = _b.valueField;
850
+ data.source = api;
851
+ data.labelField = labelField || undefined;
852
+ data.valueField = valueField || undefined;
853
+ this.lastOptions = data.source;
854
+ }
855
+ onBulkChange && onBulkChange(data);
856
+ };
857
+ /**
858
+ * 切换选项类型
859
+ */
860
+ OptionControl.prototype.handleSourceChange = function (source) {
861
+ if (this.state.source === source) {
862
+ return;
863
+ }
864
+ this.setState({
865
+ api: '',
866
+ source: source
867
+ }, this.emitChange);
868
+ };
869
+ OptionControl.prototype.handleSourceControlChange = function (value) {
870
+ this.setState(value, this.emitChange);
871
+ };
872
+ OptionControl.prototype.renderHeader = function () {
873
+ var _this = this;
874
+ var _a, _b;
875
+ var _c = this.props,
876
+ render = _c.render,
877
+ label = _c.label,
878
+ labelRemark = _c.labelRemark,
879
+ useMobileUI = _c.useMobileUI,
880
+ env = _c.env,
881
+ popOverContainer = _c.popOverContainer;
882
+ var classPrefix = (_a = env === null || env === void 0 ? void 0 : env.theme) === null || _a === void 0 ? void 0 : _a.classPrefix;
883
+ var source = this.state.source;
884
+ var optionSourceList = this.enabledOptionSources.map(function (item) {
885
+ return {
886
+ label: item.label,
887
+ value: item.value,
888
+ onClick: function () {
889
+ return _this.handleSourceChange(item.value);
890
+ }
891
+ };
892
+ });
893
+ return React__default.createElement("header", {
894
+ className: "ae-OptionControl-header"
895
+ }, React__default.createElement("label", {
896
+ className: cx("".concat(classPrefix, "Form-label"))
897
+ }, label || '', labelRemark ? render('label-remark', {
898
+ type: 'remark',
899
+ icon: labelRemark.icon || 'warning-mark',
900
+ tooltip: labelRemark,
901
+ className: cx("Form-lableRemark", labelRemark === null || labelRemark === void 0 ? void 0 : labelRemark.className),
902
+ useMobileUI: useMobileUI,
903
+ container: popOverContainer || env.getModalContainer
904
+ }) : null), React__default.createElement("div", null, render('validation-control-addBtn', {
905
+ type: 'dropdown-button',
906
+ level: 'link',
907
+ size: 'sm',
908
+ label: '${selected}',
909
+ align: 'right',
910
+ closeOnClick: true,
911
+ closeOnOutside: true,
912
+ buttons: optionSourceList
913
+ }, {
914
+ popOverContainer: null,
915
+ data: {
916
+ selected: (_b = optionSourceList.find(function (item) {
917
+ return item.value === source;
918
+ })) === null || _b === void 0 ? void 0 : _b.label
919
+ }
920
+ })));
921
+ };
922
+ OptionControl.prototype.render = function () {
923
+ var source = this.state.source;
924
+ var className = this.props.className;
925
+ var sourceControl = this.optionSources.find(function (item) {
926
+ return item.value === source;
927
+ });
928
+ var sourceControlProps = __assign(__assign(__assign({}, this.props), this.state), {
929
+ onChange: this.handleSourceControlChange
930
+ });
931
+ return React__default.createElement("div", {
932
+ className: cx('ae-OptionControl', className)
933
+ }, this.renderHeader(), sourceControl ? sourceControl.component ? React__default.createElement(sourceControl.component, __assign({}, sourceControlProps, {
934
+ key: source
935
+ })) : sourceControl.render(sourceControlProps) : null);
717
936
  };
718
- __decorate([autobind, __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", void 0)], OptionControl.prototype, "targetRef", null);
719
- __decorate([autobind, __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", void 0)], OptionControl.prototype, "dragRef", null);
937
+ __decorate([autobind, __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0)], OptionControl.prototype, "emitChange", null);
720
938
  __decorate([autobind, __metadata("design:type", Function), __metadata("design:paramtypes", [String]), __metadata("design:returntype", void 0)], OptionControl.prototype, "handleSourceChange", null);
721
- __decorate([autobind, __metadata("design:type", Function), __metadata("design:paramtypes", [Number, String]), __metadata("design:returntype", void 0)], OptionControl.prototype, "handleEditLabel", null);
722
- __decorate([autobind, __metadata("design:type", Function), __metadata("design:paramtypes", [Number, String]), __metadata("design:returntype", void 0)], OptionControl.prototype, "handleHiddenValueChange", null);
723
- __decorate([autobind, __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0)], OptionControl.prototype, "handleAdd", null);
724
- __decorate([autobind, __metadata("design:type", Function), __metadata("design:paramtypes", [Array, Object]), __metadata("design:returntype", void 0)], OptionControl.prototype, "handleBatchAdd", null);
725
- __decorate([autobind, __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", void 0)], OptionControl.prototype, "handleAPIChange", null);
726
- __decorate([autobind, __metadata("design:type", Function), __metadata("design:paramtypes", [String]), __metadata("design:returntype", void 0)], OptionControl.prototype, "handleLableFieldChange", null);
727
- __decorate([autobind, __metadata("design:type", Function), __metadata("design:paramtypes", [String]), __metadata("design:returntype", void 0)], OptionControl.prototype, "handleValueFieldChange", null);
939
+ __decorate([autobind, __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", void 0)], OptionControl.prototype, "handleSourceControlChange", null);
728
940
  return OptionControl;
729
941
  }(React__default.Component);
730
942
  /** @class */(function (_super) {
@@ -732,12 +944,11 @@ var OptionControl = /** @class */function (_super) {
732
944
  function OptionControlRenderer() {
733
945
  return _super !== null && _super.apply(this, arguments) || this;
734
946
  }
735
- OptionControlRenderer = __decorate([FormItem({
736
- type: 'ae-optionControl',
737
- renderLabel: false
947
+ OptionControlRenderer = __decorate([Renderer({
948
+ type: 'ae-optionControl'
738
949
  })], OptionControlRenderer);
739
950
  return OptionControlRenderer;
740
951
  })(OptionControl);
741
952
 
742
953
  export { OptionControl as default };
743
- window.amisEditorVersionInfo={version:'6.5.0',buildTime:'2024-05-31'};
954
+ window.amisEditorVersionInfo={version:'6.7.0',buildTime:'2024-08-06'};