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
 
@@ -15,12 +15,10 @@ var cx = require('classnames');
15
15
  var DeepDiff = require('deep-diff');
16
16
  var uniqBy = require('lodash/uniqBy');
17
17
  var omit = require('lodash/omit');
18
- var get = require('lodash/get');
19
18
  var Sortable = require('sortablejs');
20
19
  var amis = require('amis');
21
20
  var Select = require('amis-ui/lib/components/Select');
22
21
  var amisEditorCore = require('amis-editor-core');
23
- var debounce = require('lodash/debounce');
24
22
  var i18nRuntime = require('i18n-runtime');
25
23
 
26
24
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -30,158 +28,20 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
30
28
  var DeepDiff__default = /*#__PURE__*/_interopDefaultLegacy(DeepDiff);
31
29
  var uniqBy__default = /*#__PURE__*/_interopDefaultLegacy(uniqBy);
32
30
  var omit__default = /*#__PURE__*/_interopDefaultLegacy(omit);
33
- var get__default = /*#__PURE__*/_interopDefaultLegacy(get);
34
31
  var Sortable__default = /*#__PURE__*/_interopDefaultLegacy(Sortable);
35
- var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
36
32
 
37
33
  /**
38
34
  * @file 组件选项组件的可视化编辑控件
39
35
  */
40
- var OptionControl = /** @class */function (_super) {
41
- tslib.__extends(OptionControl, _super);
42
- function OptionControl(props) {
43
- var _this = _super.call(this, props) || this;
44
- _this.internalProps = ['checked', 'editing'];
45
- var source = 'custom';
46
- if (props.data.hasOwnProperty('source') && props.data.source) {
47
- var api = props.data.source;
48
- var url = typeof api === 'string' ? api : typeof api === 'object' ? api.url || '' : '';
49
- source = /\$\{(.*?)\}/g.test(props.data.source) ? 'variable' : !url.indexOf('api://') ? 'apicenter' : 'api';
50
- }
51
- _this.state = {
52
- options: _this.transformOptions(props) || [],
53
- api: props.data.source,
54
- labelField: props.data.labelField,
55
- valueField: props.data.valueField,
56
- source: source
57
- };
58
- return _this;
36
+ var CustomOptionControl = /** @class */function (_super) {
37
+ tslib.__extends(CustomOptionControl, _super);
38
+ function CustomOptionControl() {
39
+ return _super !== null && _super.apply(this, arguments) || this;
59
40
  }
60
- /**
61
- * 数据更新
62
- */
63
- OptionControl.prototype.componentWillReceiveProps = function (nextProps) {
64
- var options = get__default["default"](nextProps, 'data.options');
65
- // 左侧code手动更新时,同步配置面板
66
- if (DeepDiff__default["default"].diff(options, this.lastOptions)) {
67
- this.setState({
68
- options: this.transformOptions(nextProps)
69
- });
70
- }
71
- };
72
- OptionControl.prototype.transformOptions = function (props) {
73
- var ctx = props.data,
74
- options = props.value;
75
- var defaultValue = ctx.value;
76
- var valueArray = Select.value2array(defaultValue, ctx).map(function (item) {
77
- var _a;
78
- return item[(_a = ctx === null || ctx === void 0 ? void 0 : ctx.valueField) !== null && _a !== void 0 ? _a : 'value'];
79
- });
80
- return Array.isArray(options) ? options.map(function (item) {
81
- var _a;
82
- return tslib.__assign(tslib.__assign(tslib.__assign({
83
- label: item.label,
84
- // 为了使用户编写label时同时生效到value
85
- value: item.label === item.value ? null : item.value,
86
- checked: !!~valueArray.indexOf(item[(_a = ctx === null || ctx === void 0 ? void 0 : ctx.valueField) !== null && _a !== void 0 ? _a : 'value'])
87
- }, (item === null || item === void 0 ? void 0 : item.badge) ? {
88
- badge: item.badge
89
- } : {}), item.hidden !== undefined ? {
90
- hidden: item.hidden
91
- } : {}), item.hiddenOn !== undefined ? {
92
- hiddenOn: item.hiddenOn
93
- } : {});
94
- }) : [];
95
- };
96
- /**
97
- * 处理当前组件的默认值
98
- */
99
- OptionControl.prototype.normalizeValue = function () {
100
- var _this = this;
101
- var _a = this.props,
102
- _b = _a.data,
103
- ctx = _b === void 0 ? {} : _b,
104
- multipleProps = _a.multiple;
105
- var _c = ctx.joinValues,
106
- joinValues = _c === void 0 ? true : _c,
107
- extractValue = ctx.extractValue,
108
- multiple = ctx.multiple,
109
- delimiter = ctx.delimiter,
110
- valueField = ctx.valueField;
111
- var checkedOptions = this.state.options.filter(function (item) {
112
- return item.checked && (item === null || item === void 0 ? void 0 : item.hidden) !== true;
113
- }).map(function (item) {
114
- return omit__default["default"](item, _this.internalProps);
115
- });
116
- var value;
117
- if (!checkedOptions.length) {
118
- return undefined;
119
- }
120
- if (multiple || multipleProps) {
121
- value = checkedOptions;
122
- if (joinValues) {
123
- value = checkedOptions.map(function (item) {
124
- return item[valueField || 'value'] || item[valueField || 'label'];
125
- }).join(delimiter || ',');
126
- } else if (extractValue) {
127
- value = checkedOptions.map(function (item) {
128
- return item[valueField || 'value'] || item[valueField || 'label'];
129
- });
130
- }
131
- } else {
132
- value = checkedOptions[0];
133
- if (joinValues || extractValue) {
134
- value = value[valueField || 'value'] || value[valueField || 'label'];
135
- }
136
- }
137
- return value;
138
- };
139
- /**
140
- * 更新options字段的统一出口
141
- */
142
- OptionControl.prototype.onChange = function () {
143
- var _a = this.state,
144
- source = _a.source,
145
- options = _a.options;
146
- var onBulkChange = this.props.onBulkChange;
147
- var defaultValue = this.normalizeValue();
148
- var data = {
149
- source: undefined,
150
- options: undefined,
151
- labelField: undefined,
152
- valueField: undefined
153
- };
154
- if (source === 'custom') {
155
- data.options = options.map(function (item) {
156
- return tslib.__assign(tslib.__assign(tslib.__assign({}, (item === null || item === void 0 ? void 0 : item.badge) ? {
157
- badge: item.badge
158
- } : {}), {
159
- label: item.label,
160
- value: item.value == null || item.value === '' ? item.label : item.value
161
- }), item.hiddenOn !== undefined ? {
162
- hiddenOn: item.hiddenOn
163
- } : {});
164
- });
165
- data.value = defaultValue;
166
- this.lastOptions = data.options;
167
- }
168
- if (source === 'api' || source === 'apicenter' || source === 'variable') {
169
- var _b = this.state,
170
- api = _b.api,
171
- labelField = _b.labelField,
172
- valueField = _b.valueField;
173
- data.source = api;
174
- data.labelField = labelField || undefined;
175
- data.valueField = valueField || undefined;
176
- this.lastOptions = data.source;
177
- }
178
- onBulkChange && onBulkChange(data);
179
- return;
180
- };
181
- OptionControl.prototype.targetRef = function (ref) {
41
+ CustomOptionControl.prototype.targetRef = function (ref) {
182
42
  this.target = ref ? reactDom.findDOMNode(ref) : null;
183
43
  };
184
- OptionControl.prototype.dragRef = function (ref) {
44
+ CustomOptionControl.prototype.dragRef = function (ref) {
185
45
  if (!this.drag && ref) {
186
46
  this.initDragging();
187
47
  } else if (this.drag && !ref) {
@@ -189,8 +49,9 @@ var OptionControl = /** @class */function (_super) {
189
49
  }
190
50
  this.drag = ref;
191
51
  };
192
- OptionControl.prototype.initDragging = function () {
52
+ CustomOptionControl.prototype.initDragging = function () {
193
53
  var _this = this;
54
+ var onChange = this.props.onChange;
194
55
  var dom = reactDom.findDOMNode(this);
195
56
  this.sortable = new Sortable__default["default"](dom.querySelector('.ae-OptionControl-content'), {
196
57
  group: 'OptionControlGroup',
@@ -209,56 +70,39 @@ var OptionControl = /** @class */function (_super) {
209
70
  } else {
210
71
  parent.appendChild(e.item);
211
72
  }
212
- var options = _this.state.options.concat();
73
+ var options = _this.props.options.concat();
213
74
  options.splice(e.newIndex, 0, options.splice(e.oldIndex, 1)[0]);
214
- _this.setState({
75
+ onChange({
215
76
  options: options
216
- }, function () {
217
- return _this.onChange();
218
77
  });
219
78
  }
220
79
  });
221
80
  };
222
- OptionControl.prototype.destroyDragging = function () {
81
+ CustomOptionControl.prototype.destroyDragging = function () {
223
82
  this.sortable && this.sortable.destroy();
224
83
  };
225
- OptionControl.prototype.scroll2Bottom = function () {
226
- var _a, _b;
227
- this.drag && ((_b = (_a = this.drag) === null || _a === void 0 ? void 0 : _a.lastElementChild) === null || _b === void 0 ? void 0 : _b.scrollIntoView({
228
- behavior: 'smooth',
229
- block: 'nearest',
230
- inline: 'start'
231
- }));
232
- };
233
- /**
234
- * 切换选项类型
235
- */
236
- OptionControl.prototype.handleSourceChange = function (source) {
237
- this.setState({
238
- api: '',
239
- source: source
240
- }, this.onChange);
241
- };
242
84
  /**
243
85
  * 删除选项
244
86
  */
245
- OptionControl.prototype.handleDelete = function (index) {
246
- var _this = this;
247
- var options = this.state.options.concat();
87
+ CustomOptionControl.prototype.handleDelete = function (index) {
88
+ var _a = this.props,
89
+ onChange = _a.onChange,
90
+ originOptions = _a.options;
91
+ var options = originOptions.concat();
248
92
  options.splice(index, 1);
249
- this.setState({
93
+ onChange({
250
94
  options: options
251
- }, function () {
252
- return _this.onChange();
253
95
  });
254
96
  };
255
97
  /**
256
98
  * 设置默认选项
257
99
  */
258
- OptionControl.prototype.handleToggleDefaultValue = function (index, checked, shift) {
259
- var _this = this;
100
+ CustomOptionControl.prototype.handleToggleDefaultValue = function (index, checked, shift) {
260
101
  var _a, _b, _c;
261
- var options = this.state.options.concat();
102
+ var _d = this.props,
103
+ onChange = _d.onChange,
104
+ originOptions = _d.options;
105
+ var options = originOptions.concat();
262
106
  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);
263
107
  if (isMultiple) {
264
108
  options.splice(index, 1, tslib.__assign(tslib.__assign({}, options[index]), {
@@ -271,92 +115,104 @@ var OptionControl = /** @class */function (_super) {
271
115
  });
272
116
  });
273
117
  }
274
- this.setState({
118
+ onChange({
275
119
  options: options
276
- }, function () {
277
- return _this.onChange();
278
120
  });
279
121
  };
280
122
  /**
281
123
  * 编辑选项
282
124
  */
283
- OptionControl.prototype.toggleEdit = function (index) {
284
- var options = this.state.options;
285
- options[index].editing = !options[index].editing;
286
- this.setState({
125
+ CustomOptionControl.prototype.toggleEdit = function (index) {
126
+ var _a = this.props,
127
+ onChange = _a.onChange,
128
+ originOptions = _a.options;
129
+ var options = originOptions.concat();
130
+ options.splice(index, 1, tslib.__assign(tslib.__assign({}, options[index]), {
131
+ editing: !options[index].editing
132
+ }));
133
+ onChange({
287
134
  options: options
288
135
  });
289
136
  };
290
137
  /**
291
138
  * 编辑角标
292
139
  */
293
- OptionControl.prototype.toggleBadge = function (index, value) {
294
- var _this = this;
295
- var options = this.state.options;
296
- options[index].badge = value;
297
- this.setState({
140
+ CustomOptionControl.prototype.toggleBadge = function (index, value) {
141
+ var _a = this.props,
142
+ onChange = _a.onChange,
143
+ originOptions = _a.options;
144
+ var options = originOptions.concat();
145
+ options.splice(index, 1, tslib.__assign(tslib.__assign({}, options[index]), {
146
+ badge: value
147
+ }));
148
+ onChange({
298
149
  options: options
299
- }, function () {
300
- return _this.onChange();
301
150
  });
302
151
  };
303
- OptionControl.prototype.handleEditLabel = function (index, value) {
304
- var _this = this;
305
- var options = this.state.options.concat();
152
+ CustomOptionControl.prototype.handleEditLabel = function (index, value) {
153
+ var _a = this.props,
154
+ onChange = _a.onChange,
155
+ originOptions = _a.options;
156
+ var options = originOptions.concat();
306
157
  options.splice(index, 1, tslib.__assign(tslib.__assign({}, options[index]), {
307
158
  label: value
308
159
  }));
309
- this.setState({
160
+ onChange({
310
161
  options: options
311
- }, function () {
312
- return _this.onChange();
313
162
  });
314
163
  };
315
- OptionControl.prototype.handleHiddenValueChange = function (index, value) {
316
- var _this = this;
317
- var options = this.state.options.concat();
318
- var _a = options[index];
319
- _a.hiddenOn;
320
- var option = tslib.__rest(_a, ["hiddenOn"]);
321
- options.splice(index, 1, tslib.__assign(tslib.__assign({}, option), !value ? {} : {
322
- hiddenOn: value
323
- }));
324
- this.setState({
164
+ CustomOptionControl.prototype.handleHiddenValueChange = function (index, value) {
165
+ var _a = this.props,
166
+ onChange = _a.onChange,
167
+ originOptions = _a.options;
168
+ var options = originOptions.concat();
169
+ var _b = options[index];
170
+ _b.hiddenOn;
171
+ var option = tslib.__rest(_b, ["hiddenOn"]);
172
+ var newOption = tslib.__assign({}, option);
173
+ if (value) {
174
+ newOption.hiddenOn = value;
175
+ } else {
176
+ delete newOption.hiddenOn;
177
+ }
178
+ options.splice(index, 1, newOption);
179
+ onChange({
325
180
  options: options
326
- }, function () {
327
- return _this.onChange();
328
181
  });
329
182
  };
330
- OptionControl.prototype.handleAdd = function () {
331
- var _this = this;
332
- var options = this.state.options;
183
+ CustomOptionControl.prototype.handleAdd = function () {
184
+ var _a = this.props,
185
+ onChange = _a.onChange,
186
+ originOptions = _a.options;
187
+ var options = originOptions.concat();
333
188
  options.push({
334
189
  label: '',
335
190
  value: null,
336
191
  checked: false
337
192
  });
338
- this.setState({
193
+ onChange({
339
194
  options: options
340
- }, function () {
341
- _this.onChange();
342
195
  });
343
196
  };
344
- OptionControl.prototype.handleValueChange = function (index, value) {
345
- var _this = this;
346
- var options = this.state.options.concat();
197
+ CustomOptionControl.prototype.handleValueChange = function (index, value) {
198
+ var _a = this.props,
199
+ onChange = _a.onChange,
200
+ originOptions = _a.options;
201
+ var options = originOptions.concat();
347
202
  options[index].value = value;
348
- this.setState({
203
+ onChange({
349
204
  options: options
350
- }, function () {
351
- return _this.onChange();
352
205
  });
353
206
  };
354
- OptionControl.prototype.handleBatchAdd = function (values, action) {
355
- var _this = this;
356
- var options = this.state.options.concat();
207
+ CustomOptionControl.prototype.handleBatchAdd = function (values, action) {
208
+ var _a = this.props,
209
+ onChange = _a.onChange,
210
+ _b = _a.customEdit,
211
+ customEdit = _b === void 0 ? true : _b;
212
+ var options = this.props.data.options || [];
357
213
  var addedOptions = values[0].batchOption.split('\n').map(function (option) {
358
214
  var item = option.trim();
359
- if (~item.indexOf(' ')) {
215
+ if (~item.indexOf(' ') && customEdit) {
360
216
  var _a = tslib.__read(item.split(' '), 2),
361
217
  label = _a[0],
362
218
  value = _a[1];
@@ -373,90 +229,24 @@ var OptionControl = /** @class */function (_super) {
373
229
  };
374
230
  });
375
231
  var newOptions = uniqBy__default["default"](tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(options), false), tslib.__read(addedOptions), false), 'value');
376
- this.setState({
232
+ onChange({
377
233
  options: newOptions
378
- }, function () {
379
- return _this.onChange();
380
234
  });
381
235
  };
382
- OptionControl.prototype.renderHeader = function () {
383
- var _this = this;
384
- var _a;
385
- var _b = this.props,
386
- render = _b.render,
387
- label = _b.label,
388
- labelRemark = _b.labelRemark,
389
- useMobileUI = _b.useMobileUI,
390
- env = _b.env,
391
- popOverContainer = _b.popOverContainer,
392
- hasApiCenter = _b.hasApiCenter;
393
- var classPrefix = (_a = env === null || env === void 0 ? void 0 : env.theme) === null || _a === void 0 ? void 0 : _a.classPrefix;
394
- var source = this.state.source;
395
- var optionSourceList = tslib.__spreadArray(tslib.__spreadArray([{
396
- label: i18nRuntime.i18n("01820262aa9ad5b130f8f5b86bfd2968"),
397
- value: 'custom'
398
- }, {
399
- label: i18nRuntime.i18n("f99603414a616bdee85de0e6e3938b65"),
400
- value: 'api'
401
- }], tslib.__read(hasApiCenter ? [{
402
- label: i18nRuntime.i18n("e6ff6a97bf600c02942db3126a7077b8"),
403
- value: 'apicenter'
404
- }] : []), false), [{
405
- label: i18nRuntime.i18n("50334fc77fc5a2c2636f14f158d3c417"),
406
- value: 'variable'
407
- }
408
- // {
409
- // label: '表单实体',
410
- // value: 'form'
411
- // }
412
- ], false).map(function (item) {
413
- return tslib.__assign(tslib.__assign({}, item), {
414
- onClick: function () {
415
- return _this.handleSourceChange(item.value);
416
- }
417
- });
418
- });
419
- return React__default["default"].createElement("header", {
420
- className: "ae-OptionControl-header"
421
- }, React__default["default"].createElement("label", {
422
- className: cx__default["default"]("".concat(classPrefix, "Form-label"))
423
- }, label || '', labelRemark ? render('label-remark', {
424
- type: 'remark',
425
- icon: labelRemark.icon || 'warning-mark',
426
- tooltip: labelRemark,
427
- className: cx__default["default"]("Form-lableRemark", labelRemark === null || labelRemark === void 0 ? void 0 : labelRemark.className),
428
- useMobileUI: useMobileUI,
429
- container: popOverContainer || env.getModalContainer
430
- }) : null), React__default["default"].createElement("div", null, render('validation-control-addBtn', {
431
- type: 'dropdown-button',
432
- level: 'link',
433
- size: 'sm',
434
- label: '${selected}',
435
- align: 'right',
436
- closeOnClick: true,
437
- closeOnOutside: true,
438
- buttons: optionSourceList
439
- }, {
440
- popOverContainer: null,
441
- data: {
442
- selected: optionSourceList.find(function (item) {
443
- return item.value === source;
444
- }).label
445
- }
446
- })));
447
- };
448
- OptionControl.prototype.renderOption = function (props) {
236
+ CustomOptionControl.prototype.renderOption = function (props) {
449
237
  var _this = this;
450
238
  var checked = props.checked,
451
239
  index = props.index,
452
240
  editing = props.editing,
453
241
  multipleProps = props.multipleProps,
454
242
  closeDefaultCheck = props.closeDefaultCheck,
455
- hiddenOn = props.hiddenOn;
456
- var _a = this.props,
457
- render = _a.render,
458
- ctx = _a.data,
459
- node = _a.node;
243
+ hiddenOn = props.hiddenOn,
244
+ _a = props.customEdit,
245
+ customEdit = _a === void 0 ? true : _a;
246
+ var _b = this.props,
247
+ render = _b.render,
248
+ ctx = _b.data,
249
+ node = _b.node;
460
250
  var isMultiple = (ctx === null || ctx === void 0 ? void 0 : ctx.multiple) === true || multipleProps;
461
251
  var i18nEnabled = amisEditorCore.getI18nEnabled();
462
252
  var showBadge = node.type === 'button-group-select';
@@ -475,47 +265,86 @@ var OptionControl = /** @class */function (_super) {
475
265
  return _this.toggleEdit(index);
476
266
  }
477
267
  }, {
478
- type: i18nEnabled ? 'input-text-i18n' : 'input-text',
479
- placeholder: i18nRuntime.i18n("b4fdf79b8f54856b072ec3874b830d1f"),
480
- label: i18nRuntime.i18n("97d07614380da93d257f9fbf81aa56fb"),
481
- mode: 'horizontal',
482
- value: props === null || props === void 0 ? void 0 : props.label,
483
- labelClassName: 'ae-OptionControlItem-EditLabel',
484
- valueClassName: 'ae-OptionControlItem-EditValue',
485
- onChange: function (v) {
486
- return _this.handleEditLabel(index, v);
268
+ children: function (_a) {
269
+ var render = _a.render,
270
+ innerValue = _a.innerValue;
271
+ return render('innerLabel', {
272
+ name: 'label',
273
+ type: i18nEnabled ? 'input-text-i18n' : 'input-text',
274
+ placeholder: i18nRuntime.i18n("b4fdf79b8f54856b072ec3874b830d1f"),
275
+ label: i18nRuntime.i18n("97d07614380da93d257f9fbf81aa56fb"),
276
+ mode: 'horizontal',
277
+ labelClassName: 'ae-OptionControlItem-EditLabel',
278
+ valueClassName: 'ae-OptionControlItem-EditValue'
279
+ }, {
280
+ value: innerValue.label || '',
281
+ onChange: function (v) {
282
+ return _this.handleEditLabel(index, v);
283
+ }
284
+ });
487
285
  }
488
286
  }, {
489
- type: 'ae-valueFormat',
490
- placeholder: i18nRuntime.i18n("f4ab507e2fa2d2bd66bcdeafd9fef797"),
491
- labelClassName: 'ae-OptionControlItem-EditLabel',
492
- valueClassName: 'ae-OptionControlItem-EditValue',
493
- label: i18nRuntime.i18n("fe7509e0ed085b86f07e3e9975cc5b3d"),
494
- value: props === null || props === void 0 ? void 0 : props.value,
495
- onChange: function (v) {
496
- return _this.handleValueChange(index, v);
287
+ children: function (_a) {
288
+ var render = _a.render,
289
+ innerValue = _a.innerValue;
290
+ return render('innerValue', {
291
+ name: 'value',
292
+ type: 'ae-valueFormat',
293
+ placeholder: i18nRuntime.i18n("f4ab507e2fa2d2bd66bcdeafd9fef797"),
294
+ labelClassName: 'ae-OptionControlItem-EditLabel',
295
+ valueClassName: 'ae-OptionControlItem-EditValue',
296
+ label: i18nRuntime.i18n("fe7509e0ed085b86f07e3e9975cc5b3d")
297
+ }, {
298
+ value: (innerValue === null || innerValue === void 0 ? void 0 : innerValue.value) || '',
299
+ onChange: function (v) {
300
+ return _this.handleValueChange(index, v);
301
+ }
302
+ });
497
303
  }
498
- }, amisEditorCore.getSchemaTpl('expressionFormulaControl', {
499
- label: i18nRuntime.i18n("dce5379cb978a8259ecfca8f08f00817"),
500
- value: hiddenOn,
501
- labelClassName: 'ae-OptionControlItem-EditLabel',
502
- valueClassName: 'ae-OptionControlItem-EditValue',
503
- onChange: function (v) {
504
- return _this.handleHiddenValueChange(index, v);
304
+ }, {
305
+ children: function (_a) {
306
+ var render = _a.render,
307
+ innerValue = _a.innerValue;
308
+ return render('innerHiddenOn', amisEditorCore.getSchemaTpl('expressionFormulaControl', {
309
+ label: i18nRuntime.i18n("dce5379cb978a8259ecfca8f08f00817"),
310
+ name: 'hiddenOn',
311
+ labelClassName: 'ae-OptionControlItem-EditLabel',
312
+ valueClassName: 'ae-OptionControlItem-EditValue'
313
+ }), {
314
+ value: innerValue.hiddenOn || '',
315
+ onChange: function (v) {
316
+ return _this.handleHiddenValueChange(index, v);
317
+ }
318
+ });
505
319
  }
506
- }), {
507
- type: i18nEnabled ? 'input-text-i18n' : 'input-text',
508
- placeholder: i18nRuntime.i18n("7f05bea37729325a6cc84eb26bb9f8c8"),
509
- label: i18nRuntime.i18n("b8c467fce096a649583c0bc9d9281a5c"),
510
- mode: 'horizontal',
511
- visible: showBadge,
512
- value: props === null || props === void 0 ? void 0 : props.badge,
513
- labelClassName: 'ae-OptionControlItem-EditLabel',
514
- valueClassName: 'ae-OptionControlItem-EditValue',
515
- onChange: function (v) {
516
- return _this.toggleBadge(index, v);
320
+ }, {
321
+ children: function (_a) {
322
+ var render = _a.render,
323
+ innerValue = _a.innerValue;
324
+ return render('innerBadge', {
325
+ type: i18nEnabled ? 'input-text-i18n' : 'input-text',
326
+ placeholder: i18nRuntime.i18n("7f05bea37729325a6cc84eb26bb9f8c8"),
327
+ label: i18nRuntime.i18n("b8c467fce096a649583c0bc9d9281a5c"),
328
+ mode: 'horizontal',
329
+ name: 'badge',
330
+ visible: showBadge,
331
+ labelClassName: 'ae-OptionControlItem-EditLabel',
332
+ valueClassName: 'ae-OptionControlItem-EditValue'
333
+ }, {
334
+ value: innerValue.badge || '',
335
+ onChange: function (v) {
336
+ return _this.toggleBadge(index, v);
337
+ }
338
+ });
517
339
  }
518
340
  }]
341
+ }, {
342
+ innerValue: {
343
+ label: props.label,
344
+ value: props.value,
345
+ badge: props.badge,
346
+ hiddenOn: hiddenOn
347
+ }
519
348
  })) : null;
520
349
  var operationBtn = [{
521
350
  type: 'button',
@@ -566,16 +395,20 @@ var OptionControl = /** @class */function (_super) {
566
395
  onChange: function (newChecked, shift) {
567
396
  return _this.handleToggleDefaultValue(index, newChecked, shift);
568
397
  }
569
- })), amis.render({
398
+ })), render('label', {
399
+ name: 'label',
570
400
  type: i18nEnabled ? 'input-text-i18n' : 'input-text',
401
+ label: false,
571
402
  className: 'ae-OptionControlItem-input',
572
- value: props === null || props === void 0 ? void 0 : props.label,
573
403
  placeholder: i18nRuntime.i18n("5d26b8a41e805204c9dcd5ea7e23b150"),
574
- clearable: false,
404
+ clearable: false
405
+ }, {
406
+ value: (props === null || props === void 0 ? void 0 : props.label) || '',
407
+ disabled: editing,
575
408
  onChange: function (value) {
576
409
  _this.handleEditLabel(index, value);
577
410
  }
578
- }), render('dropdown', {
411
+ }), customEdit ? render('dropdown', {
579
412
  type: 'dropdown-button',
580
413
  className: 'ae-OptionControlItem-dropdown',
581
414
  btnClassName: 'px-2',
@@ -587,9 +420,19 @@ var OptionControl = /** @class */function (_super) {
587
420
  buttons: operationBtn
588
421
  }, {
589
422
  popOverContainer: null // amis 渲染挂载节点会使用 this.target
423
+ }) : render('delete', {
424
+ type: 'button',
425
+ className: 'ae-OptionControlItem-action-delete',
426
+ icon: 'fa fa-trash',
427
+ level: 'link',
428
+ onClick: function () {
429
+ return _this.handleDelete(index);
430
+ }
590
431
  })), editDom);
591
432
  };
592
- OptionControl.prototype.buildBatchAddSchema = function () {
433
+ CustomOptionControl.prototype.buildBatchAddSchema = function () {
434
+ var _a = this.props.customEdit,
435
+ customEdit = _a === void 0 ? true : _a;
593
436
  return {
594
437
  type: 'action',
595
438
  actionType: 'dialog',
@@ -606,7 +449,7 @@ var OptionControl = /** @class */function (_super) {
606
449
  level: 'warning',
607
450
  body: [{
608
451
  type: 'tpl',
609
- tpl: i18nRuntime.i18n("c130bd5b55edefdaf8923269e9a52439")
452
+ tpl: '每个选项单列一行,将所有值不重复的项加为新的选项;' + (customEdit ? '<br/>每行可通过空格来分别设置label和value,例:"张三 zhangsan"' : '')
610
453
  }],
611
454
  showIcon: true,
612
455
  className: 'mb-2.5'
@@ -636,79 +479,19 @@ var OptionControl = /** @class */function (_super) {
636
479
  }
637
480
  };
638
481
  };
639
- OptionControl.prototype.handleAPIChange = function (source) {
640
- this.setState({
641
- api: source
642
- }, this.onChange);
643
- };
644
- OptionControl.prototype.handleLableFieldChange = function (labelField) {
645
- this.setState({
646
- labelField: labelField
647
- }, this.onChange);
648
- };
649
- OptionControl.prototype.handleValueFieldChange = function (valueField) {
650
- this.setState({
651
- valueField: valueField
652
- }, this.onChange);
653
- };
654
- /** 获取功能性字段控件 schema */
655
- OptionControl.prototype.getFuncFieldSchema = function () {
656
- var _a = this.state,
657
- labelField = _a.labelField,
658
- valueField = _a.valueField;
659
- return [{
660
- label: amisEditorCore.tipedLabel(i18nRuntime.i18n("7e9c83e86beb612377a94e6e8d1fc644"), i18nRuntime.i18n("26ff46d82166741297ce666b2792af85")),
661
- type: 'input-text',
662
- name: 'labelField',
663
- clearable: true,
664
- value: labelField,
665
- placeholder: i18nRuntime.i18n("6d4ce0631f37676a887c9599691fabec"),
666
- onChange: this.handleLableFieldChange
667
- }, {
668
- label: i18nRuntime.i18n("2e01f5f5889e33d003bec7857cd38445"),
669
- type: 'input-text',
670
- name: 'valueField',
671
- clearable: true,
672
- value: valueField,
673
- placeholder: i18nRuntime.i18n("959c27193eb0a41d01f4b53dcc4b9245"),
674
- onChange: this.handleValueFieldChange
675
- }];
676
- };
677
- OptionControl.prototype.renderApiPanel = function () {
678
- var render = this.props.render;
679
- var _a = this.state,
680
- source = _a.source,
681
- api = _a.api;
682
- return render('api', amisEditorCore.getSchemaTpl('apiControl', {
683
- label: i18nRuntime.i18n("54ea89b497ec3bb319c68844dfa3687f"),
684
- name: 'source',
685
- mode: 'normal',
686
- className: 'ae-ExtendMore',
687
- visibleOn: 'this.autoComplete !== false',
688
- value: api,
689
- onChange: this.handleAPIChange,
690
- sourceType: source,
691
- footer: this.getFuncFieldSchema()
692
- }));
693
- };
694
- OptionControl.prototype.render = function () {
482
+ CustomOptionControl.prototype.render = function () {
695
483
  var _this = this;
696
- var _a = this.state,
484
+ var _a = this.props,
697
485
  options = _a.options,
698
- source = _a.source;
699
- var _b = this.props,
700
- render = _b.render,
701
- className = _b.className,
702
- multipleProps = _b.multiple;
486
+ multipleProps = _a.multiple,
487
+ render = _a.render;
703
488
  return React__default["default"].createElement("div", {
704
- className: cx__default["default"]('ae-OptionControl', className)
705
- }, this.renderHeader(), source === 'custom' ? React__default["default"].createElement("div", {
706
489
  className: "ae-OptionControl-wrapper"
707
490
  }, Array.isArray(options) && options.length ? React__default["default"].createElement("ul", {
708
491
  className: "ae-OptionControl-content",
709
492
  ref: this.dragRef
710
493
  }, options.map(function (option, index) {
711
- return _this.renderOption(tslib.__assign(tslib.__assign({}, option), {
494
+ return _this.renderOption(tslib.__assign(tslib.__assign(tslib.__assign({}, _this.props), option), {
712
495
  index: index,
713
496
  multipleProps: multipleProps
714
497
  }));
@@ -720,26 +503,453 @@ var OptionControl = /** @class */function (_super) {
720
503
  level: "enhance",
721
504
  onClick: this.handleAdd,
722
505
  ref: this.targetRef
723
- }, i18nRuntime.i18n("e8755fb1e985a5d26df0fce1f0b7b0f8")), render('inner', this.buildBatchAddSchema()))) : null, source === 'api' || source === 'apicenter' ? this.renderApiPanel() : null, source === 'variable' ? render('variable', {
506
+ }, i18nRuntime.i18n("e8755fb1e985a5d26df0fce1f0b7b0f8")), render('inner', this.buildBatchAddSchema())));
507
+ };
508
+ tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Object]), tslib.__metadata("design:returntype", void 0)], CustomOptionControl.prototype, "targetRef", null);
509
+ tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Object]), tslib.__metadata("design:returntype", void 0)], CustomOptionControl.prototype, "dragRef", null);
510
+ tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Number, String]), tslib.__metadata("design:returntype", void 0)], CustomOptionControl.prototype, "handleEditLabel", null);
511
+ tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Number, String]), tslib.__metadata("design:returntype", void 0)], CustomOptionControl.prototype, "handleHiddenValueChange", null);
512
+ tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", []), tslib.__metadata("design:returntype", void 0)], CustomOptionControl.prototype, "handleAdd", null);
513
+ tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Array, Object]), tslib.__metadata("design:returntype", void 0)], CustomOptionControl.prototype, "handleBatchAdd", null);
514
+ return CustomOptionControl;
515
+ }(React__default["default"].Component);
516
+ // 负责 api 和 apicenter 的配置
517
+ function APIOptionControl(_a) {
518
+ var render = _a.render,
519
+ source = _a.source,
520
+ api = _a.api,
521
+ onChange = _a.onChange,
522
+ labelField = _a.labelField,
523
+ valueField = _a.valueField;
524
+ var handleAPIChange = React__default["default"].useCallback(function (source) {
525
+ onChange({
526
+ api: source
527
+ });
528
+ }, []);
529
+ var handleLabelFieldChange = React__default["default"].useCallback(function (value) {
530
+ onChange({
531
+ labelField: value
532
+ });
533
+ }, []);
534
+ var handleValueFieldChange = React__default["default"].useCallback(function (value) {
535
+ onChange({
536
+ valueField: value
537
+ });
538
+ }, []);
539
+ var footer = React__default["default"].useMemo(function () {
540
+ return [{
541
+ children: function (_a) {
542
+ var render = _a.render,
543
+ labelField = _a.labelField;
544
+ return render('inner', {
545
+ label: amisEditorCore.tipedLabel(i18nRuntime.i18n("7e9c83e86beb612377a94e6e8d1fc644"), i18nRuntime.i18n("26ff46d82166741297ce666b2792af85")),
546
+ type: 'input-text',
547
+ name: 'labelField',
548
+ clearable: true,
549
+ placeholder: i18nRuntime.i18n("6d4ce0631f37676a887c9599691fabec")
550
+ }, {
551
+ value: labelField,
552
+ onChange: handleLabelFieldChange
553
+ });
554
+ }
555
+ }, {
556
+ children: function (_a) {
557
+ var render = _a.render,
558
+ valueField = _a.valueField;
559
+ return render('inner', {
560
+ label: i18nRuntime.i18n("2e01f5f5889e33d003bec7857cd38445"),
561
+ type: 'input-text',
562
+ name: 'valueField',
563
+ clearable: true,
564
+ placeholder: i18nRuntime.i18n("959c27193eb0a41d01f4b53dcc4b9245")
565
+ }, {
566
+ value: valueField,
567
+ onChange: handleValueFieldChange
568
+ });
569
+ }
570
+ }];
571
+ }, []);
572
+ var schema = React__default["default"].useMemo(function () {
573
+ return amisEditorCore.getSchemaTpl('apiControl', {
574
+ label: i18nRuntime.i18n("54ea89b497ec3bb319c68844dfa3687f"),
575
+ name: 'source',
576
+ mode: 'normal',
577
+ className: 'ae-ExtendMore',
578
+ visibleOn: 'this.autoComplete !== false',
579
+ footer: footer
580
+ });
581
+ }, [footer]);
582
+ return render('api', schema, {
583
+ value: api,
584
+ onChange: handleAPIChange,
585
+ sourceType: source,
586
+ labelField: labelField,
587
+ valueField: valueField
588
+ });
589
+ }
590
+ // 负责上下文变量绑定的配置
591
+ function variableOptionControl(_a) {
592
+ var render = _a.render,
593
+ api = _a.api,
594
+ onChange = _a.onChange,
595
+ labelField = _a.labelField,
596
+ valueField = _a.valueField;
597
+ var handleAPIChange = React__default["default"].useCallback(function (source) {
598
+ onChange({
599
+ api: source
600
+ });
601
+ }, []);
602
+ var handleLabelFieldChange = React__default["default"].useCallback(function (value) {
603
+ onChange({
604
+ labelField: value
605
+ });
606
+ }, []);
607
+ var handleValueFieldChange = React__default["default"].useCallback(function (value) {
608
+ onChange({
609
+ valueField: value
610
+ });
611
+ }, []);
612
+ var footer = React__default["default"].useMemo(function () {
613
+ return [{
614
+ children: function (_a) {
615
+ var render = _a.render,
616
+ controlledValue = _a.controlledValue;
617
+ return render('inner', {
618
+ label: amisEditorCore.tipedLabel(i18nRuntime.i18n("7e9c83e86beb612377a94e6e8d1fc644"), i18nRuntime.i18n("26ff46d82166741297ce666b2792af85")),
619
+ type: 'input-text',
620
+ name: 'labelField',
621
+ clearable: true,
622
+ placeholder: i18nRuntime.i18n("6d4ce0631f37676a887c9599691fabec")
623
+ }, {
624
+ value: controlledValue.labelField,
625
+ onChange: handleLabelFieldChange
626
+ });
627
+ }
628
+ }, {
629
+ children: function (_a) {
630
+ var render = _a.render,
631
+ controlledValue = _a.controlledValue;
632
+ return render('inner', {
633
+ label: i18nRuntime.i18n("2e01f5f5889e33d003bec7857cd38445"),
634
+ type: 'input-text',
635
+ name: 'valueField',
636
+ clearable: true,
637
+ placeholder: i18nRuntime.i18n("959c27193eb0a41d01f4b53dcc4b9245")
638
+ }, {
639
+ value: controlledValue.valueField,
640
+ onChange: handleValueFieldChange
641
+ });
642
+ }
643
+ }];
644
+ }, []);
645
+ var schema = React__default["default"].useMemo(function () {
646
+ return {
724
647
  type: 'control',
725
648
  label: false,
726
649
  className: 'ae-ExtendMore',
727
- body: [amisEditorCore.getSchemaTpl('sourceBindControl', {
728
- label: false,
729
- onChange: debounce__default["default"](this.handleAPIChange, 1000)
730
- })].concat(this.getFuncFieldSchema())
731
- }) : null);
650
+ body: [{
651
+ children: function (_a) {
652
+ var render = _a.render,
653
+ controlledValue = _a.controlledValue;
654
+ return render('inner', amisEditorCore.getSchemaTpl('sourceBindControl', {
655
+ label: false
656
+ }), {
657
+ value: controlledValue.api,
658
+ onChange: handleAPIChange
659
+ });
660
+ }
661
+ }].concat(footer)
662
+ };
663
+ }, [footer]);
664
+ return render('api', schema, {
665
+ controlledValue: {
666
+ api: api,
667
+ labelField: labelField,
668
+ valueField: valueField
669
+ }
670
+ });
671
+ }
672
+ var builtinOptionSource = [{
673
+ label: i18nRuntime.i18n("01820262aa9ad5b130f8f5b86bfd2968"),
674
+ value: 'custom',
675
+ component: CustomOptionControl
676
+ }, {
677
+ label: i18nRuntime.i18n("f99603414a616bdee85de0e6e3938b65"),
678
+ value: 'api',
679
+ component: APIOptionControl,
680
+ test: function (_a) {
681
+ var api = _a.api;
682
+ var url = amis.normalizeApi(api).url;
683
+ return !!(typeof url === 'string' && url && !(typeof api === 'string' && /\$\{(.*?)\}/g.test(api)));
684
+ }
685
+ }, {
686
+ label: i18nRuntime.i18n("e6ff6a97bf600c02942db3126a7077b8"),
687
+ value: 'apicenter',
688
+ component: APIOptionControl,
689
+ test: function (_a) {
690
+ var api = _a.api;
691
+ var url = amis.normalizeApi(api).url;
692
+ return typeof url === 'string' && url.startsWith('api://');
693
+ }
694
+ }, {
695
+ label: i18nRuntime.i18n("50334fc77fc5a2c2636f14f158d3c417"),
696
+ value: 'variable',
697
+ component: variableOptionControl,
698
+ test: function (_a) {
699
+ var api = _a.api;
700
+ return typeof api === 'string' && /\$\{(.*?)\}/g.test(api);
701
+ }
702
+ }];
703
+ var OptionControl = /** @class */function (_super) {
704
+ tslib.__extends(OptionControl, _super);
705
+ function OptionControl(props) {
706
+ var _this = _super.call(this, props) || this;
707
+ _this.internalProps = ['checked', 'editing'];
708
+ _this.optionSources = [];
709
+ _this.optionSources = builtinOptionSource.concat(Array.isArray(props.extraOptionSources) ? props.extraOptionSources : []);
710
+ var state = {
711
+ options: _this.transformOptions(props) || [],
712
+ api: props.data.source,
713
+ labelField: props.data.labelField,
714
+ valueField: props.data.valueField
715
+ };
716
+ var source = _this.enabledOptionSources.reduce(function (type, source) {
717
+ var _a;
718
+ return type !== null && type !== void 0 ? type : ((_a = source.test) === null || _a === void 0 ? void 0 : _a.call(source, state)) === true ? source.value : type;
719
+ }, undefined) || 'custom';
720
+ _this.state = tslib.__assign(tslib.__assign({}, state), {
721
+ source: source
722
+ });
723
+ return _this;
724
+ }
725
+ /**
726
+ * 数据更新
727
+ */
728
+ OptionControl.prototype.componentWillReceiveProps = function (nextProps) {
729
+ var options = nextProps.data.options;
730
+ // 左侧code手动更新时,同步配置面板
731
+ if (DeepDiff__default["default"].diff(options, this.lastOptions)) {
732
+ this.setState({
733
+ options: this.transformOptions(nextProps)
734
+ });
735
+ }
736
+ };
737
+ Object.defineProperty(OptionControl.prototype, "enabledOptionSources", {
738
+ get: function () {
739
+ var _a = this.props,
740
+ hasApiCenter = _a.hasApiCenter,
741
+ enabledOptionSourceType = _a.enabledOptionSourceType;
742
+ var options = this.optionSources;
743
+ if (!hasApiCenter) {
744
+ options = options.filter(function (item) {
745
+ return item.value !== 'apicenter';
746
+ });
747
+ }
748
+ if (Array.isArray(enabledOptionSourceType)) {
749
+ options = enabledOptionSourceType.map(function (type) {
750
+ return options.find(function (a) {
751
+ return a.value === type;
752
+ });
753
+ }).filter(function (item) {
754
+ return item;
755
+ });
756
+ }
757
+ return options;
758
+ },
759
+ enumerable: false,
760
+ configurable: true
761
+ });
762
+ OptionControl.prototype.transformOptions = function (props) {
763
+ var ctx = props.data;
764
+ var options = ctx.options;
765
+ var defaultValue = ctx.value;
766
+ var valueArray = Select.value2array(defaultValue, ctx).map(function (item) {
767
+ var _a;
768
+ return item[(_a = ctx === null || ctx === void 0 ? void 0 : ctx.valueField) !== null && _a !== void 0 ? _a : 'value'];
769
+ });
770
+ return Array.isArray(options) ? options.map(function (item) {
771
+ var _a;
772
+ return tslib.__assign(tslib.__assign(tslib.__assign({
773
+ label: item.label,
774
+ // 为了使用户编写label时同时生效到value
775
+ value: item.label === item.value ? null : item.value,
776
+ checked: !!~valueArray.indexOf(item[(_a = ctx === null || ctx === void 0 ? void 0 : ctx.valueField) !== null && _a !== void 0 ? _a : 'value'])
777
+ }, (item === null || item === void 0 ? void 0 : item.badge) ? {
778
+ badge: item.badge
779
+ } : {}), item.hidden !== undefined ? {
780
+ hidden: item.hidden
781
+ } : {}), item.hiddenOn !== undefined ? {
782
+ hiddenOn: item.hiddenOn
783
+ } : {});
784
+ }) : [];
785
+ };
786
+ /**
787
+ * 处理当前组件的默认值
788
+ */
789
+ OptionControl.prototype.normalizeValue = function () {
790
+ var _this = this;
791
+ var _a = this.props,
792
+ _b = _a.data,
793
+ ctx = _b === void 0 ? {} : _b,
794
+ multipleProps = _a.multiple;
795
+ var _c = ctx.joinValues,
796
+ joinValues = _c === void 0 ? true : _c,
797
+ extractValue = ctx.extractValue,
798
+ multiple = ctx.multiple,
799
+ delimiter = ctx.delimiter,
800
+ valueField = ctx.valueField;
801
+ var checkedOptions = this.state.options.filter(function (item) {
802
+ return item.checked && (item === null || item === void 0 ? void 0 : item.hidden) !== true;
803
+ }).map(function (item) {
804
+ return omit__default["default"](item, _this.internalProps);
805
+ });
806
+ var value;
807
+ if (!checkedOptions.length) {
808
+ return undefined;
809
+ }
810
+ if (multiple || multipleProps) {
811
+ value = checkedOptions;
812
+ if (joinValues) {
813
+ value = checkedOptions.map(function (item) {
814
+ return item[valueField || 'value'] || item[valueField || 'label'];
815
+ }).join(delimiter || ',');
816
+ } else if (extractValue) {
817
+ value = checkedOptions.map(function (item) {
818
+ return item[valueField || 'value'] || item[valueField || 'label'];
819
+ });
820
+ }
821
+ } else {
822
+ value = checkedOptions[0];
823
+ if (joinValues || extractValue) {
824
+ value = value[valueField || 'value'] || value[valueField || 'label'];
825
+ }
826
+ }
827
+ return value;
828
+ };
829
+ /**
830
+ * 更新options字段的统一出口
831
+ */
832
+ OptionControl.prototype.emitChange = function () {
833
+ var _a = this.state,
834
+ source = _a.source,
835
+ options = _a.options;
836
+ var onBulkChange = this.props.onBulkChange;
837
+ var defaultValue = this.normalizeValue();
838
+ var data = {
839
+ source: undefined,
840
+ options: undefined,
841
+ labelField: undefined,
842
+ valueField: undefined
843
+ };
844
+ if (source === 'custom') {
845
+ data.options = options.map(function (item) {
846
+ return tslib.__assign(tslib.__assign(tslib.__assign({}, (item === null || item === void 0 ? void 0 : item.badge) ? {
847
+ badge: item.badge
848
+ } : {}), {
849
+ label: item.label,
850
+ value: item.value == null || item.value === '' ? item.label : item.value
851
+ }), item.hiddenOn !== undefined ? {
852
+ hiddenOn: item.hiddenOn
853
+ } : {});
854
+ });
855
+ data.value = defaultValue;
856
+ this.lastOptions = data.options;
857
+ }
858
+ if (source === 'api' || source === 'apicenter' || source === 'variable') {
859
+ var _b = this.state,
860
+ api = _b.api,
861
+ labelField = _b.labelField,
862
+ valueField = _b.valueField;
863
+ data.source = api;
864
+ data.labelField = labelField || undefined;
865
+ data.valueField = valueField || undefined;
866
+ this.lastOptions = data.source;
867
+ }
868
+ onBulkChange && onBulkChange(data);
869
+ };
870
+ /**
871
+ * 切换选项类型
872
+ */
873
+ OptionControl.prototype.handleSourceChange = function (source) {
874
+ if (this.state.source === source) {
875
+ return;
876
+ }
877
+ this.setState({
878
+ api: '',
879
+ source: source
880
+ }, this.emitChange);
881
+ };
882
+ OptionControl.prototype.handleSourceControlChange = function (value) {
883
+ this.setState(value, this.emitChange);
884
+ };
885
+ OptionControl.prototype.renderHeader = function () {
886
+ var _this = this;
887
+ var _a, _b;
888
+ var _c = this.props,
889
+ render = _c.render,
890
+ label = _c.label,
891
+ labelRemark = _c.labelRemark,
892
+ useMobileUI = _c.useMobileUI,
893
+ env = _c.env,
894
+ popOverContainer = _c.popOverContainer;
895
+ var classPrefix = (_a = env === null || env === void 0 ? void 0 : env.theme) === null || _a === void 0 ? void 0 : _a.classPrefix;
896
+ var source = this.state.source;
897
+ var optionSourceList = this.enabledOptionSources.map(function (item) {
898
+ return {
899
+ label: item.label,
900
+ value: item.value,
901
+ onClick: function () {
902
+ return _this.handleSourceChange(item.value);
903
+ }
904
+ };
905
+ });
906
+ return React__default["default"].createElement("header", {
907
+ className: "ae-OptionControl-header"
908
+ }, React__default["default"].createElement("label", {
909
+ className: cx__default["default"]("".concat(classPrefix, "Form-label"))
910
+ }, label || '', labelRemark ? render('label-remark', {
911
+ type: 'remark',
912
+ icon: labelRemark.icon || 'warning-mark',
913
+ tooltip: labelRemark,
914
+ className: cx__default["default"]("Form-lableRemark", labelRemark === null || labelRemark === void 0 ? void 0 : labelRemark.className),
915
+ useMobileUI: useMobileUI,
916
+ container: popOverContainer || env.getModalContainer
917
+ }) : null), React__default["default"].createElement("div", null, render('validation-control-addBtn', {
918
+ type: 'dropdown-button',
919
+ level: 'link',
920
+ size: 'sm',
921
+ label: '${selected}',
922
+ align: 'right',
923
+ closeOnClick: true,
924
+ closeOnOutside: true,
925
+ buttons: optionSourceList
926
+ }, {
927
+ popOverContainer: null,
928
+ data: {
929
+ selected: (_b = optionSourceList.find(function (item) {
930
+ return item.value === source;
931
+ })) === null || _b === void 0 ? void 0 : _b.label
932
+ }
933
+ })));
934
+ };
935
+ OptionControl.prototype.render = function () {
936
+ var source = this.state.source;
937
+ var className = this.props.className;
938
+ var sourceControl = this.optionSources.find(function (item) {
939
+ return item.value === source;
940
+ });
941
+ var sourceControlProps = tslib.__assign(tslib.__assign(tslib.__assign({}, this.props), this.state), {
942
+ onChange: this.handleSourceControlChange
943
+ });
944
+ return React__default["default"].createElement("div", {
945
+ className: cx__default["default"]('ae-OptionControl', className)
946
+ }, this.renderHeader(), sourceControl ? sourceControl.component ? React__default["default"].createElement(sourceControl.component, tslib.__assign({}, sourceControlProps, {
947
+ key: source
948
+ })) : sourceControl.render(sourceControlProps) : null);
732
949
  };
733
- tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Object]), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "targetRef", null);
734
- tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Object]), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "dragRef", null);
950
+ tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", []), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "emitChange", null);
735
951
  tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [String]), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "handleSourceChange", null);
736
- tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Number, String]), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "handleEditLabel", null);
737
- tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Number, String]), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "handleHiddenValueChange", null);
738
- tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", []), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "handleAdd", null);
739
- tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Array, Object]), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "handleBatchAdd", null);
740
- tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Object]), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "handleAPIChange", null);
741
- tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [String]), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "handleLableFieldChange", null);
742
- tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [String]), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "handleValueFieldChange", null);
952
+ tslib.__decorate([amisEditorCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", [Object]), tslib.__metadata("design:returntype", void 0)], OptionControl.prototype, "handleSourceControlChange", null);
743
953
  return OptionControl;
744
954
  }(React__default["default"].Component);
745
955
  /** @class */(function (_super) {
@@ -747,12 +957,11 @@ var OptionControl = /** @class */function (_super) {
747
957
  function OptionControlRenderer() {
748
958
  return _super !== null && _super.apply(this, arguments) || this;
749
959
  }
750
- OptionControlRenderer = tslib.__decorate([amis.FormItem({
751
- type: 'ae-optionControl',
752
- renderLabel: false
960
+ OptionControlRenderer = tslib.__decorate([amis.Renderer({
961
+ type: 'ae-optionControl'
753
962
  })], OptionControlRenderer);
754
963
  return OptionControlRenderer;
755
964
  })(OptionControl);
756
965
 
757
966
  exports["default"] = OptionControl;
758
- window.amisEditorVersionInfo={version:'6.5.0',buildTime:'2024-05-31'};
967
+ window.amisEditorVersionInfo={version:'6.7.0',buildTime:'2024-08-06'};