amis-editor 5.6.0-beta.0 → 5.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (871) hide show
  1. package/esm/builder/ApiDSBuilder.d.ts +491 -0
  2. package/esm/builder/ApiDSBuilder.js +1212 -0
  3. package/esm/builder/DSBuilder.d.ts +171 -0
  4. package/esm/builder/DSBuilder.js +49 -0
  5. package/esm/builder/DSBuilderManager.d.ts +62 -0
  6. package/esm/builder/DSBuilderManager.js +207 -0
  7. package/esm/builder/constants.d.ts +97 -0
  8. package/esm/builder/constants.js +135 -0
  9. package/esm/builder/index.d.ts +6 -0
  10. package/esm/builder/type.d.ts +96 -0
  11. package/esm/builder/utils.d.ts +10 -0
  12. package/esm/builder/utils.js +93 -0
  13. package/esm/component/BaseControl.js +5 -3
  14. package/esm/component/InputComponentName.js +3 -1
  15. package/esm/component/TableViewEditor.js +3 -1
  16. package/esm/icons/btn/btn-group.svg.js +3 -1
  17. package/esm/icons/btn/btn-select.svg.js +3 -1
  18. package/esm/icons/btn/btn-toolbar.svg.js +3 -1
  19. package/esm/icons/btn/button.svg.js +3 -1
  20. package/esm/icons/btn/dropdown-btn.svg.js +3 -1
  21. package/esm/icons/container/anchor-nav.svg.js +3 -1
  22. package/esm/icons/container/collapse.svg.js +3 -1
  23. package/esm/icons/container/container.svg.js +3 -1
  24. package/esm/icons/container/flex-container.svg.js +3 -1
  25. package/esm/icons/container/form-group.svg.js +3 -1
  26. package/esm/icons/container/grid.svg.js +3 -1
  27. package/esm/icons/container/iframe.svg.js +3 -1
  28. package/esm/icons/container/panel.svg.js +3 -1
  29. package/esm/icons/container/table-view.svg.js +3 -1
  30. package/esm/icons/container/tabs.svg.js +3 -1
  31. package/esm/icons/container/tooltip-wrapper.svg.js +3 -1
  32. package/esm/icons/container/web-component.svg.js +3 -1
  33. package/esm/icons/crud/column-add.svg.js +26 -0
  34. package/esm/icons/crud/column-delete.svg.js +24 -0
  35. package/esm/icons/crud/column-setting.svg.js +24 -0
  36. package/esm/icons/crud/share-link.svg.js +22 -0
  37. package/esm/icons/display/aBaseline.svg.js +3 -1
  38. package/esm/icons/display/aCenter.svg.js +3 -1
  39. package/esm/icons/display/aFlexEnd.svg.js +3 -1
  40. package/esm/icons/display/aFlexStart.svg.js +3 -1
  41. package/esm/icons/display/aStretch.svg.js +3 -1
  42. package/esm/icons/display/block.svg.js +3 -1
  43. package/esm/icons/display/dcolumn.svg.js +3 -1
  44. package/esm/icons/display/dcolumnReverse.svg.js +3 -1
  45. package/esm/icons/display/drow.svg.js +3 -1
  46. package/esm/icons/display/drowReverse.svg.js +3 -1
  47. package/esm/icons/display/flex.svg.js +3 -1
  48. package/esm/icons/display/inline-block.svg.js +3 -1
  49. package/esm/icons/display/inline.svg.js +3 -1
  50. package/esm/icons/display/jCenter.svg.js +3 -1
  51. package/esm/icons/display/jFlexEnd.svg.js +3 -1
  52. package/esm/icons/display/jFlexStart.svg.js +3 -1
  53. package/esm/icons/display/jSpaceAround.svg.js +3 -1
  54. package/esm/icons/display/jSpaceBetween.svg.js +3 -1
  55. package/esm/icons/feat/audio.svg.js +3 -1
  56. package/esm/icons/feat/custom.svg.js +3 -1
  57. package/esm/icons/feat/each.svg.js +3 -1
  58. package/esm/icons/feat/form.svg.js +3 -1
  59. package/esm/icons/feat/nav.svg.js +3 -1
  60. package/esm/icons/feat/qrcode.svg.js +3 -1
  61. package/esm/icons/feat/service.svg.js +3 -1
  62. package/esm/icons/feat/table.svg.js +3 -1
  63. package/esm/icons/feat/tasks.svg.js +3 -1
  64. package/esm/icons/feat/video.svg.js +3 -1
  65. package/esm/icons/feat/wizard.svg.js +3 -1
  66. package/esm/icons/form/chained-select.svg.js +3 -1
  67. package/esm/icons/form/checkbox.svg.js +3 -1
  68. package/esm/icons/form/checkboxes.svg.js +3 -1
  69. package/esm/icons/form/combo.svg.js +3 -1
  70. package/esm/icons/form/condition-builder.svg.js +3 -1
  71. package/esm/icons/form/diff-editor.svg.js +3 -1
  72. package/esm/icons/form/editor.svg.js +3 -1
  73. package/esm/icons/form/formula.svg.js +3 -1
  74. package/esm/icons/form/hidden.svg.js +3 -1
  75. package/esm/icons/form/input-city.svg.js +3 -1
  76. package/esm/icons/form/input-color.svg.js +3 -1
  77. package/esm/icons/form/input-date-range.svg.js +3 -1
  78. package/esm/icons/form/input-date.svg.js +3 -1
  79. package/esm/icons/form/input-datetime.svg.js +3 -1
  80. package/esm/icons/form/input-email.svg.js +3 -1
  81. package/esm/icons/form/input-excel.svg.js +3 -1
  82. package/esm/icons/form/input-file.svg.js +3 -1
  83. package/esm/icons/form/input-group.svg.js +3 -1
  84. package/esm/icons/form/input-image.svg.js +3 -1
  85. package/esm/icons/form/input-kv.svg.js +3 -1
  86. package/esm/icons/form/input-month-range.svg.js +3 -1
  87. package/esm/icons/form/input-number.svg.js +3 -1
  88. package/esm/icons/form/input-password.svg.js +3 -1
  89. package/esm/icons/form/input-quarter-range.svg.js +3 -1
  90. package/esm/icons/form/input-range.svg.js +3 -1
  91. package/esm/icons/form/input-rating.svg.js +3 -1
  92. package/esm/icons/form/input-repeat.svg.js +3 -1
  93. package/esm/icons/form/input-rich-text.svg.js +3 -1
  94. package/esm/icons/form/input-tag.svg.js +3 -1
  95. package/esm/icons/form/input-text.svg.js +3 -1
  96. package/esm/icons/form/input-time-range.svg.js +3 -1
  97. package/esm/icons/form/input-time.svg.js +3 -1
  98. package/esm/icons/form/input-tree.svg.js +3 -1
  99. package/esm/icons/form/input-url.svg.js +3 -1
  100. package/esm/icons/form/input-year.svg.js +3 -1
  101. package/esm/icons/form/inputArray.svg.js +3 -1
  102. package/esm/icons/form/list-select.svg.js +3 -1
  103. package/esm/icons/form/location-picker.svg.js +3 -1
  104. package/esm/icons/form/matrix-checkboxes.svg.js +3 -1
  105. package/esm/icons/form/month.svg.js +3 -1
  106. package/esm/icons/form/nested-select.svg.js +3 -1
  107. package/esm/icons/form/picker.svg.js +3 -1
  108. package/esm/icons/form/quarter.svg.js +3 -1
  109. package/esm/icons/form/radios.svg.js +3 -1
  110. package/esm/icons/form/select.svg.js +3 -1
  111. package/esm/icons/form/static.svg.js +3 -1
  112. package/esm/icons/form/sub-form.svg.js +3 -1
  113. package/esm/icons/form/switch.svg.js +3 -1
  114. package/esm/icons/form/tabs-transfer.svg.js +3 -1
  115. package/esm/icons/form/textarea.svg.js +3 -1
  116. package/esm/icons/form/transfer.svg.js +3 -1
  117. package/esm/icons/form/tree-select.svg.js +3 -1
  118. package/esm/icons/form/uuid.svg.js +3 -1
  119. package/esm/icons/index.js +12 -1
  120. package/esm/icons/layout/layout-1with2.svg.js +3 -1
  121. package/esm/icons/layout/layout-2cols.svg.js +3 -1
  122. package/esm/icons/layout/layout-2row.svg.js +3 -1
  123. package/esm/icons/layout/layout-2with1.svg.js +3 -1
  124. package/esm/icons/layout/layout-3cols.svg.js +3 -1
  125. package/esm/icons/layout/layout-3row.svg.js +3 -1
  126. package/esm/icons/layout/layout-absolute.svg.js +3 -1
  127. package/esm/icons/layout/layout-fixed-top.svg.js +3 -1
  128. package/esm/icons/layout/layout-fixed.svg.js +3 -1
  129. package/esm/icons/layout/layout-free-container.svg.js +3 -1
  130. package/esm/icons/layout/layout-full.svg.js +3 -1
  131. package/esm/icons/layout/layout1-2.svg.js +3 -1
  132. package/esm/icons/layout/layout2-1.svg.js +3 -1
  133. package/esm/icons/layout/layout3-1.svg.js +3 -1
  134. package/esm/icons/layout/layout3-2.svg.js +3 -1
  135. package/esm/icons/other/_fx.svg.js +3 -1
  136. package/esm/icons/other/divider.svg.js +3 -1
  137. package/esm/icons/other/fx.svg.js +3 -1
  138. package/esm/icons/other/property-sheet.svg.js +3 -1
  139. package/esm/icons/other/tooltip.svg.js +3 -1
  140. package/esm/icons/show/URL.svg.js +3 -1
  141. package/esm/icons/show/avatar.svg.js +3 -1
  142. package/esm/icons/show/breadcrumb.svg.js +3 -1
  143. package/esm/icons/show/card.svg.js +3 -1
  144. package/esm/icons/show/cards.svg.js +3 -1
  145. package/esm/icons/show/carousel.svg.js +3 -1
  146. package/esm/icons/show/chart.svg.js +3 -1
  147. package/esm/icons/show/code.svg.js +3 -1
  148. package/esm/icons/show/date.svg.js +3 -1
  149. package/esm/icons/show/datetime.svg.js +3 -1
  150. package/esm/icons/show/image.svg.js +3 -1
  151. package/esm/icons/show/images.svg.js +3 -1
  152. package/esm/icons/show/json-view.svg.js +3 -1
  153. package/esm/icons/show/list.svg.js +3 -1
  154. package/esm/icons/show/log.svg.js +3 -1
  155. package/esm/icons/show/mapping.svg.js +3 -1
  156. package/esm/icons/show/markdown.svg.js +3 -1
  157. package/esm/icons/show/plain.svg.js +3 -1
  158. package/esm/icons/show/progress.svg.js +3 -1
  159. package/esm/icons/show/sparkline.svg.js +3 -1
  160. package/esm/icons/show/status.svg.js +3 -1
  161. package/esm/icons/show/steps.svg.js +3 -1
  162. package/esm/icons/show/time.svg.js +3 -1
  163. package/esm/icons/theme/css.svg.js +3 -1
  164. package/esm/index.d.ts +8 -0
  165. package/esm/index.js +18 -3
  166. package/esm/locale/en-US.js +241 -19
  167. package/esm/locale/zh-CN.js +235 -7
  168. package/esm/plugin/Alert.js +3 -1
  169. package/esm/plugin/AnchorNav.js +3 -1
  170. package/esm/plugin/Audio.js +3 -1
  171. package/esm/plugin/Avatar.js +3 -1
  172. package/esm/plugin/Breadcrumb.js +3 -1
  173. package/esm/plugin/Button.js +5 -3
  174. package/esm/plugin/ButtonGroup.js +3 -1
  175. package/esm/plugin/CRUD.js +3 -1
  176. package/esm/plugin/CRUD2/BaseCRUD.d.ts +233 -0
  177. package/esm/plugin/CRUD2/BaseCRUD.js +1045 -0
  178. package/esm/plugin/CRUD2/CRUDCards.d.ts +53 -0
  179. package/esm/plugin/CRUD2/CRUDList.d.ts +53 -0
  180. package/esm/plugin/CRUD2/CRUDTable.d.ts +21 -0
  181. package/esm/plugin/CRUD2/CRUDTable.js +48 -0
  182. package/esm/plugin/CRUD2/constants.d.ts +32 -0
  183. package/esm/plugin/CRUD2/constants.js +75 -0
  184. package/esm/plugin/CRUD2/utils.d.ts +8 -0
  185. package/esm/plugin/CRUD2/utils.js +91 -0
  186. package/esm/plugin/Card.js +3 -1
  187. package/esm/plugin/Card2.js +3 -1
  188. package/esm/plugin/Cards.d.ts +547 -41
  189. package/esm/plugin/Cards.js +368 -170
  190. package/esm/plugin/Carousel.js +120 -97
  191. package/esm/plugin/Chart.js +17 -5
  192. package/esm/plugin/CodeView.js +3 -1
  193. package/esm/plugin/Collapse.d.ts +2 -1
  194. package/esm/plugin/Collapse.js +50 -1
  195. package/esm/plugin/CollapseGroup.js +3 -1
  196. package/esm/plugin/ColumnToggler.d.ts +11 -6
  197. package/esm/plugin/ColumnToggler.js +69 -10
  198. package/esm/plugin/Container.d.ts +2 -0
  199. package/esm/plugin/Container.js +8 -8
  200. package/esm/plugin/Custom.js +3 -1
  201. package/esm/plugin/CustomRegion.js +5 -2
  202. package/esm/plugin/Date.js +3 -1
  203. package/esm/plugin/Datetime.js +3 -1
  204. package/esm/plugin/Dialog.d.ts +13 -1
  205. package/esm/plugin/Dialog.js +186 -55
  206. package/esm/plugin/Divider.js +72 -6
  207. package/esm/plugin/Drawer.js +126 -77
  208. package/esm/plugin/DropDownButton.js +3 -1
  209. package/esm/plugin/Each.d.ts +226 -11
  210. package/esm/plugin/Each.js +238 -89
  211. package/esm/plugin/Flex.js +3 -1
  212. package/esm/plugin/Form/ButtonGroupSelect.js +25 -23
  213. package/esm/plugin/Form/ButtonToolbar.js +3 -1
  214. package/esm/plugin/Form/ChainedSelect.js +21 -19
  215. package/esm/plugin/Form/Checkbox.js +51 -12
  216. package/esm/plugin/Form/Checkboxes.js +33 -42
  217. package/esm/plugin/Form/CodeEditor.js +3 -1
  218. package/esm/plugin/Form/Combo.d.ts +3 -2
  219. package/esm/plugin/Form/Combo.js +8 -5
  220. package/esm/plugin/Form/ConditionBuilder.js +3 -1
  221. package/esm/plugin/Form/Control.js +3 -1
  222. package/esm/plugin/Form/DiffEditor.js +3 -1
  223. package/esm/plugin/Form/FieldSet.js +3 -1
  224. package/esm/plugin/Form/Form.d.ts +32 -8
  225. package/esm/plugin/Form/Form.js +594 -442
  226. package/esm/plugin/Form/Formula.js +3 -1
  227. package/esm/plugin/Form/Group.js +3 -1
  228. package/esm/plugin/Form/Hidden.js +3 -1
  229. package/esm/plugin/Form/InputArray.js +3 -1
  230. package/esm/plugin/Form/InputCity.js +6 -2
  231. package/esm/plugin/Form/InputColor.js +3 -1
  232. package/esm/plugin/Form/InputDate.js +29 -43
  233. package/esm/plugin/Form/InputDateRange.js +41 -30
  234. package/esm/plugin/Form/InputDateTime.js +3 -1
  235. package/esm/plugin/Form/InputDateTimeRange.js +3 -1
  236. package/esm/plugin/Form/InputEmail.js +3 -1
  237. package/esm/plugin/Form/InputExcel.js +3 -1
  238. package/esm/plugin/Form/InputFile.js +8 -2
  239. package/esm/plugin/Form/InputGroup.d.ts +1 -0
  240. package/esm/plugin/Form/InputGroup.js +3 -1
  241. package/esm/plugin/Form/InputImage.js +12 -6
  242. package/esm/plugin/Form/InputKV.js +3 -1
  243. package/esm/plugin/Form/InputMonth.js +3 -1
  244. package/esm/plugin/Form/InputMonthRange.js +3 -1
  245. package/esm/plugin/Form/InputNumber.js +3 -1
  246. package/esm/plugin/Form/InputPassword.js +3 -1
  247. package/esm/plugin/Form/InputQuarter.js +3 -1
  248. package/esm/plugin/Form/InputQuarterRange.js +3 -1
  249. package/esm/plugin/Form/InputRange.js +23 -35
  250. package/esm/plugin/Form/InputRating.js +3 -1
  251. package/esm/plugin/Form/InputRepeat.js +3 -1
  252. package/esm/plugin/Form/InputRichText.js +3 -1
  253. package/esm/plugin/Form/InputSubForm.js +3 -1
  254. package/esm/plugin/Form/InputTable.d.ts +3 -2
  255. package/esm/plugin/Form/InputTable.js +13 -8
  256. package/esm/plugin/Form/InputTag.d.ts +4 -1
  257. package/esm/plugin/Form/InputTag.js +33 -22
  258. package/esm/plugin/Form/InputText.js +23 -23
  259. package/esm/plugin/Form/InputTime.js +3 -1
  260. package/esm/plugin/Form/InputTimeRange.js +3 -1
  261. package/esm/plugin/Form/InputTree.js +69 -54
  262. package/esm/plugin/Form/InputURL.js +3 -1
  263. package/esm/plugin/Form/InputYear.js +3 -1
  264. package/esm/plugin/Form/InputYearRange.js +3 -1
  265. package/esm/plugin/Form/Item.js +3 -1
  266. package/esm/plugin/Form/ListSelect.js +25 -23
  267. package/esm/plugin/Form/LocationPicker.js +3 -1
  268. package/esm/plugin/Form/MatrixCheckboxes.js +3 -1
  269. package/esm/plugin/Form/NestedSelect.js +25 -23
  270. package/esm/plugin/Form/Picker.js +22 -22
  271. package/esm/plugin/Form/Radios.js +20 -18
  272. package/esm/plugin/Form/Select.d.ts +8 -8
  273. package/esm/plugin/Form/Select.js +41 -72
  274. package/esm/plugin/Form/Static.js +3 -1
  275. package/esm/plugin/Form/Switch.js +3 -1
  276. package/esm/plugin/Form/TabsTransfer.d.ts +2 -3
  277. package/esm/plugin/Form/TabsTransfer.js +59 -45
  278. package/esm/plugin/Form/Textarea.js +3 -1
  279. package/esm/plugin/Form/Transfer.js +25 -23
  280. package/esm/plugin/Form/TreeSelect.js +59 -51
  281. package/esm/plugin/Form/UUID.js +3 -1
  282. package/esm/plugin/Grid.js +3 -1
  283. package/esm/plugin/HBox.js +3 -1
  284. package/esm/plugin/IFrame.js +3 -1
  285. package/esm/plugin/Icon.js +5 -3
  286. package/esm/plugin/Image.js +54 -31
  287. package/esm/plugin/Images.js +22 -10
  288. package/esm/plugin/Json.js +3 -1
  289. package/esm/plugin/Layout/FlexPluginBase.js +14 -15
  290. package/esm/plugin/Layout/Layout_fixed.js +3 -1
  291. package/esm/plugin/Layout/Layout_free_container.js +3 -1
  292. package/esm/plugin/Layout/Layout_sorption_container.js +3 -1
  293. package/esm/plugin/Link.js +17 -5
  294. package/esm/plugin/List.d.ts +5 -0
  295. package/esm/plugin/List.js +55 -19
  296. package/esm/plugin/List2.d.ts +545 -0
  297. package/esm/plugin/List2.js +380 -0
  298. package/esm/plugin/ListItem.js +3 -1
  299. package/esm/plugin/Log.js +3 -1
  300. package/esm/plugin/Mapping.js +3 -1
  301. package/esm/plugin/Markdown.js +3 -1
  302. package/esm/plugin/Nav.js +3 -1
  303. package/esm/plugin/OfficeViewer.js +3 -1
  304. package/esm/plugin/Operation.js +3 -2
  305. package/esm/plugin/Others/Action.js +3 -1
  306. package/esm/plugin/Others/TableCell.js +3 -1
  307. package/esm/plugin/Page.js +27 -2
  308. package/esm/plugin/Pagination.d.ts +0 -1
  309. package/esm/plugin/Pagination.js +35 -19
  310. package/esm/plugin/Panel.js +3 -1
  311. package/esm/plugin/Plain.js +3 -1
  312. package/esm/plugin/Progress.js +3 -1
  313. package/esm/plugin/Property.js +3 -1
  314. package/esm/plugin/QRCode.js +3 -1
  315. package/esm/plugin/Reset.js +3 -1
  316. package/esm/plugin/SearchBox.d.ts +3 -1
  317. package/esm/plugin/SearchBox.js +14 -1
  318. package/esm/plugin/Service.d.ts +19 -13
  319. package/esm/plugin/Service.js +169 -91
  320. package/esm/plugin/Sparkline.js +5 -6
  321. package/esm/plugin/Status.js +3 -1
  322. package/esm/plugin/Steps.js +3 -1
  323. package/esm/plugin/Submit.js +3 -1
  324. package/esm/plugin/Table.d.ts +9 -0
  325. package/esm/plugin/Table.js +53 -4
  326. package/esm/plugin/Table2.d.ts +24 -10
  327. package/esm/plugin/Table2.js +668 -420
  328. package/esm/plugin/TableCell2.d.ts +14 -2
  329. package/esm/plugin/TableCell2.js +510 -365
  330. package/esm/plugin/TableView.js +3 -1
  331. package/esm/plugin/Tabs.js +3 -1
  332. package/esm/plugin/Tag.js +10 -2
  333. package/esm/plugin/Tasks.js +3 -1
  334. package/esm/plugin/Time.js +3 -1
  335. package/esm/plugin/Timeline.js +3 -1
  336. package/esm/plugin/TooltipWrapper.js +12 -9
  337. package/esm/plugin/Tpl.js +21 -3
  338. package/esm/plugin/Video.js +3 -1
  339. package/esm/plugin/WebComponent.js +3 -1
  340. package/esm/plugin/Wizard.js +3 -1
  341. package/esm/plugin/Wrapper.js +3 -1
  342. package/esm/plugin/index.d.ts +2 -1
  343. package/esm/renderer/APIAdaptorControl.d.ts +14 -0
  344. package/esm/renderer/APIAdaptorControl.js +26 -40
  345. package/esm/renderer/APIControl.js +12 -2
  346. package/esm/renderer/ActionApiControl.d.ts +6 -0
  347. package/esm/renderer/BadgeControl.d.ts +6 -6
  348. package/esm/renderer/BadgeControl.js +3 -1
  349. package/esm/renderer/ButtonGroupControl.js +3 -1
  350. package/esm/renderer/DataBindingControl.d.ts +1 -1
  351. package/esm/renderer/DataBindingControl.js +3 -1
  352. package/esm/renderer/DataMappingControl.js +3 -1
  353. package/esm/renderer/DataPickerControl.js +3 -1
  354. package/esm/renderer/DateShortCutControl.d.ts +1 -0
  355. package/esm/renderer/DateShortCutControl.js +9 -5
  356. package/esm/renderer/ExpressionFormulaControl.js +3 -1
  357. package/esm/renderer/FeatureControl.d.ts +17 -4
  358. package/esm/renderer/FeatureControl.js +73 -12
  359. package/esm/renderer/FieldSetting.d.ts +66 -0
  360. package/esm/renderer/FieldSetting.js +492 -0
  361. package/esm/renderer/FlexSettingControl.js +3 -1
  362. package/esm/renderer/FormulaControl.d.ts +6 -1
  363. package/esm/renderer/FormulaControl.js +24 -7
  364. package/esm/renderer/FunctionEditorControl.d.ts +79 -0
  365. package/esm/renderer/FunctionEditorControl.js +107 -0
  366. package/esm/renderer/GoConfigControl.js +3 -1
  367. package/esm/renderer/InputRangeValueControl.d.ts +15 -0
  368. package/esm/renderer/InputRangeValueControl.js +121 -0
  369. package/esm/renderer/MapSourceControl.js +3 -1
  370. package/esm/renderer/NavBadgeControl.d.ts +6 -6
  371. package/esm/renderer/NavBadgeControl.js +3 -1
  372. package/esm/renderer/NavDefaultActive.js +3 -1
  373. package/esm/renderer/NavSourceControl.js +3 -1
  374. package/esm/renderer/OptionControl.d.ts +2 -0
  375. package/esm/renderer/OptionControl.js +35 -23
  376. package/esm/renderer/RangePartsControl.js +3 -1
  377. package/esm/renderer/StatusControl.js +3 -1
  378. package/esm/renderer/SwitchMoreControl.d.ts +6 -0
  379. package/esm/renderer/SwitchMoreControl.js +14 -2
  380. package/esm/renderer/TableColumnWidthControl.d.ts +29 -0
  381. package/esm/renderer/TableColumnWidthControl.js +177 -0
  382. package/esm/renderer/TimelineItemControl.js +3 -1
  383. package/esm/renderer/TplFormulaControl.js +3 -1
  384. package/esm/renderer/TransferTableControl.js +3 -1
  385. package/esm/renderer/TreeOptionControl.d.ts +1 -1
  386. package/esm/renderer/TreeOptionControl.js +8 -6
  387. package/esm/renderer/ValidationControl.js +3 -1
  388. package/esm/renderer/ValidationItem.js +3 -1
  389. package/esm/renderer/crud2-control/AddColumnModal.d.ts +6 -0
  390. package/esm/renderer/crud2-control/AddColumnModal.js +256 -0
  391. package/esm/renderer/crud2-control/CRUDColumnControl.d.ts +68 -0
  392. package/esm/renderer/crud2-control/CRUDColumnControl.js +473 -0
  393. package/esm/renderer/crud2-control/CRUDFiltersControl.d.ts +53 -0
  394. package/esm/renderer/crud2-control/CRUDFiltersControl.js +691 -0
  395. package/esm/renderer/crud2-control/CRUDToolbarControl.d.ts +49 -0
  396. package/esm/renderer/crud2-control/CRUDToolbarControl.js +417 -0
  397. package/esm/renderer/event-control/action-config-dialog.d.ts +1 -1
  398. package/esm/renderer/event-control/action-config-dialog.js +4 -2
  399. package/esm/renderer/event-control/action-config-panel.js +3 -1
  400. package/esm/renderer/event-control/comp-action-select.js +3 -1
  401. package/esm/renderer/event-control/helper.d.ts +2 -1
  402. package/esm/renderer/event-control/helper.js +170 -117
  403. package/esm/renderer/event-control/index.d.ts +26 -17
  404. package/esm/renderer/event-control/index.js +114 -22
  405. package/esm/renderer/style-control/Background.js +3 -1
  406. package/esm/renderer/style-control/Border.js +3 -1
  407. package/esm/renderer/style-control/BoxModel.js +3 -1
  408. package/esm/renderer/style-control/BoxShadow.js +3 -1
  409. package/esm/renderer/style-control/Display.js +3 -1
  410. package/esm/renderer/style-control/Font.js +3 -1
  411. package/esm/renderer/style-control/InsetBoxModel.js +3 -1
  412. package/esm/renderer/style-control/ThemeCssCode.js +132 -281
  413. package/esm/renderer/style-control/font-family.js +3 -1
  414. package/esm/renderer/style-control/helper.js +3 -1
  415. package/esm/renderer/style-control/transformation.js +3 -1
  416. package/esm/renderer/textarea-formula/FormulaPicker.js +3 -1
  417. package/esm/renderer/textarea-formula/TextareaFormulaControl.d.ts +2 -0
  418. package/esm/renderer/textarea-formula/TextareaFormulaControl.js +76 -7
  419. package/esm/renderer/textarea-formula/plugin.js +5 -3
  420. package/esm/tpl/api.js +15 -10
  421. package/esm/tpl/common.js +53 -35
  422. package/esm/tpl/horizontal.js +3 -1
  423. package/esm/tpl/layout.js +9 -6
  424. package/esm/tpl/options.d.ts +10 -1
  425. package/esm/tpl/options.js +249 -10
  426. package/esm/tpl/remark.js +3 -1
  427. package/esm/tpl/style.js +99 -60
  428. package/esm/tpl/validations.js +3 -1
  429. package/esm/util.d.ts +8 -0
  430. package/esm/util.js +21 -3
  431. package/esm/validator.js +3 -1
  432. package/lib/builder/ApiDSBuilder.d.ts +491 -0
  433. package/lib/builder/ApiDSBuilder.js +1226 -0
  434. package/lib/builder/DSBuilder.d.ts +171 -0
  435. package/lib/builder/DSBuilder.js +55 -0
  436. package/lib/builder/DSBuilderManager.d.ts +62 -0
  437. package/lib/builder/DSBuilderManager.js +211 -0
  438. package/lib/builder/constants.d.ts +97 -0
  439. package/lib/builder/constants.js +144 -0
  440. package/lib/builder/index.d.ts +6 -0
  441. package/lib/builder/type.d.ts +96 -0
  442. package/lib/builder/utils.d.ts +10 -0
  443. package/lib/builder/utils.js +104 -0
  444. package/lib/component/BaseControl.js +5 -3
  445. package/lib/component/InputComponentName.js +3 -1
  446. package/lib/component/TableViewEditor.js +3 -1
  447. package/lib/icons/btn/btn-group.svg.js +3 -1
  448. package/lib/icons/btn/btn-select.svg.js +3 -1
  449. package/lib/icons/btn/btn-toolbar.svg.js +3 -1
  450. package/lib/icons/btn/button.svg.js +3 -1
  451. package/lib/icons/btn/dropdown-btn.svg.js +3 -1
  452. package/lib/icons/container/anchor-nav.svg.js +3 -1
  453. package/lib/icons/container/collapse.svg.js +3 -1
  454. package/lib/icons/container/container.svg.js +3 -1
  455. package/lib/icons/container/flex-container.svg.js +3 -1
  456. package/lib/icons/container/form-group.svg.js +3 -1
  457. package/lib/icons/container/grid.svg.js +3 -1
  458. package/lib/icons/container/iframe.svg.js +3 -1
  459. package/lib/icons/container/panel.svg.js +3 -1
  460. package/lib/icons/container/table-view.svg.js +3 -1
  461. package/lib/icons/container/tabs.svg.js +3 -1
  462. package/lib/icons/container/tooltip-wrapper.svg.js +3 -1
  463. package/lib/icons/container/web-component.svg.js +3 -1
  464. package/lib/icons/crud/column-add.svg.js +50 -0
  465. package/lib/icons/crud/column-delete.svg.js +48 -0
  466. package/lib/icons/crud/column-setting.svg.js +48 -0
  467. package/lib/icons/crud/share-link.svg.js +46 -0
  468. package/lib/icons/display/aBaseline.svg.js +3 -1
  469. package/lib/icons/display/aCenter.svg.js +3 -1
  470. package/lib/icons/display/aFlexEnd.svg.js +3 -1
  471. package/lib/icons/display/aFlexStart.svg.js +3 -1
  472. package/lib/icons/display/aStretch.svg.js +3 -1
  473. package/lib/icons/display/block.svg.js +3 -1
  474. package/lib/icons/display/dcolumn.svg.js +3 -1
  475. package/lib/icons/display/dcolumnReverse.svg.js +3 -1
  476. package/lib/icons/display/drow.svg.js +3 -1
  477. package/lib/icons/display/drowReverse.svg.js +3 -1
  478. package/lib/icons/display/flex.svg.js +3 -1
  479. package/lib/icons/display/inline-block.svg.js +3 -1
  480. package/lib/icons/display/inline.svg.js +3 -1
  481. package/lib/icons/display/jCenter.svg.js +3 -1
  482. package/lib/icons/display/jFlexEnd.svg.js +3 -1
  483. package/lib/icons/display/jFlexStart.svg.js +3 -1
  484. package/lib/icons/display/jSpaceAround.svg.js +3 -1
  485. package/lib/icons/display/jSpaceBetween.svg.js +3 -1
  486. package/lib/icons/feat/audio.svg.js +3 -1
  487. package/lib/icons/feat/custom.svg.js +3 -1
  488. package/lib/icons/feat/each.svg.js +3 -1
  489. package/lib/icons/feat/form.svg.js +3 -1
  490. package/lib/icons/feat/nav.svg.js +3 -1
  491. package/lib/icons/feat/qrcode.svg.js +3 -1
  492. package/lib/icons/feat/service.svg.js +3 -1
  493. package/lib/icons/feat/table.svg.js +3 -1
  494. package/lib/icons/feat/tasks.svg.js +3 -1
  495. package/lib/icons/feat/video.svg.js +3 -1
  496. package/lib/icons/feat/wizard.svg.js +3 -1
  497. package/lib/icons/form/chained-select.svg.js +3 -1
  498. package/lib/icons/form/checkbox.svg.js +3 -1
  499. package/lib/icons/form/checkboxes.svg.js +3 -1
  500. package/lib/icons/form/combo.svg.js +3 -1
  501. package/lib/icons/form/condition-builder.svg.js +3 -1
  502. package/lib/icons/form/diff-editor.svg.js +3 -1
  503. package/lib/icons/form/editor.svg.js +3 -1
  504. package/lib/icons/form/formula.svg.js +3 -1
  505. package/lib/icons/form/hidden.svg.js +3 -1
  506. package/lib/icons/form/input-city.svg.js +3 -1
  507. package/lib/icons/form/input-color.svg.js +3 -1
  508. package/lib/icons/form/input-date-range.svg.js +3 -1
  509. package/lib/icons/form/input-date.svg.js +3 -1
  510. package/lib/icons/form/input-datetime.svg.js +3 -1
  511. package/lib/icons/form/input-email.svg.js +3 -1
  512. package/lib/icons/form/input-excel.svg.js +3 -1
  513. package/lib/icons/form/input-file.svg.js +3 -1
  514. package/lib/icons/form/input-group.svg.js +3 -1
  515. package/lib/icons/form/input-image.svg.js +3 -1
  516. package/lib/icons/form/input-kv.svg.js +3 -1
  517. package/lib/icons/form/input-month-range.svg.js +3 -1
  518. package/lib/icons/form/input-number.svg.js +3 -1
  519. package/lib/icons/form/input-password.svg.js +3 -1
  520. package/lib/icons/form/input-quarter-range.svg.js +3 -1
  521. package/lib/icons/form/input-range.svg.js +3 -1
  522. package/lib/icons/form/input-rating.svg.js +3 -1
  523. package/lib/icons/form/input-repeat.svg.js +3 -1
  524. package/lib/icons/form/input-rich-text.svg.js +3 -1
  525. package/lib/icons/form/input-tag.svg.js +3 -1
  526. package/lib/icons/form/input-text.svg.js +3 -1
  527. package/lib/icons/form/input-time-range.svg.js +3 -1
  528. package/lib/icons/form/input-time.svg.js +3 -1
  529. package/lib/icons/form/input-tree.svg.js +3 -1
  530. package/lib/icons/form/input-url.svg.js +3 -1
  531. package/lib/icons/form/input-year.svg.js +3 -1
  532. package/lib/icons/form/inputArray.svg.js +3 -1
  533. package/lib/icons/form/list-select.svg.js +3 -1
  534. package/lib/icons/form/location-picker.svg.js +3 -1
  535. package/lib/icons/form/matrix-checkboxes.svg.js +3 -1
  536. package/lib/icons/form/month.svg.js +3 -1
  537. package/lib/icons/form/nested-select.svg.js +3 -1
  538. package/lib/icons/form/picker.svg.js +3 -1
  539. package/lib/icons/form/quarter.svg.js +3 -1
  540. package/lib/icons/form/radios.svg.js +3 -1
  541. package/lib/icons/form/select.svg.js +3 -1
  542. package/lib/icons/form/static.svg.js +3 -1
  543. package/lib/icons/form/sub-form.svg.js +3 -1
  544. package/lib/icons/form/switch.svg.js +3 -1
  545. package/lib/icons/form/tabs-transfer.svg.js +3 -1
  546. package/lib/icons/form/textarea.svg.js +3 -1
  547. package/lib/icons/form/transfer.svg.js +3 -1
  548. package/lib/icons/form/tree-select.svg.js +3 -1
  549. package/lib/icons/form/uuid.svg.js +3 -1
  550. package/lib/icons/index.js +12 -1
  551. package/lib/icons/layout/layout-1with2.svg.js +3 -1
  552. package/lib/icons/layout/layout-2cols.svg.js +3 -1
  553. package/lib/icons/layout/layout-2row.svg.js +3 -1
  554. package/lib/icons/layout/layout-2with1.svg.js +3 -1
  555. package/lib/icons/layout/layout-3cols.svg.js +3 -1
  556. package/lib/icons/layout/layout-3row.svg.js +3 -1
  557. package/lib/icons/layout/layout-absolute.svg.js +3 -1
  558. package/lib/icons/layout/layout-fixed-top.svg.js +3 -1
  559. package/lib/icons/layout/layout-fixed.svg.js +3 -1
  560. package/lib/icons/layout/layout-free-container.svg.js +3 -1
  561. package/lib/icons/layout/layout-full.svg.js +3 -1
  562. package/lib/icons/layout/layout1-2.svg.js +3 -1
  563. package/lib/icons/layout/layout2-1.svg.js +3 -1
  564. package/lib/icons/layout/layout3-1.svg.js +3 -1
  565. package/lib/icons/layout/layout3-2.svg.js +3 -1
  566. package/lib/icons/other/_fx.svg.js +3 -1
  567. package/lib/icons/other/divider.svg.js +3 -1
  568. package/lib/icons/other/fx.svg.js +3 -1
  569. package/lib/icons/other/property-sheet.svg.js +3 -1
  570. package/lib/icons/other/tooltip.svg.js +3 -1
  571. package/lib/icons/show/URL.svg.js +3 -1
  572. package/lib/icons/show/avatar.svg.js +3 -1
  573. package/lib/icons/show/breadcrumb.svg.js +3 -1
  574. package/lib/icons/show/card.svg.js +3 -1
  575. package/lib/icons/show/cards.svg.js +3 -1
  576. package/lib/icons/show/carousel.svg.js +3 -1
  577. package/lib/icons/show/chart.svg.js +3 -1
  578. package/lib/icons/show/code.svg.js +3 -1
  579. package/lib/icons/show/date.svg.js +3 -1
  580. package/lib/icons/show/datetime.svg.js +3 -1
  581. package/lib/icons/show/image.svg.js +3 -1
  582. package/lib/icons/show/images.svg.js +3 -1
  583. package/lib/icons/show/json-view.svg.js +3 -1
  584. package/lib/icons/show/list.svg.js +3 -1
  585. package/lib/icons/show/log.svg.js +3 -1
  586. package/lib/icons/show/mapping.svg.js +3 -1
  587. package/lib/icons/show/markdown.svg.js +3 -1
  588. package/lib/icons/show/plain.svg.js +3 -1
  589. package/lib/icons/show/progress.svg.js +3 -1
  590. package/lib/icons/show/sparkline.svg.js +3 -1
  591. package/lib/icons/show/status.svg.js +3 -1
  592. package/lib/icons/show/steps.svg.js +3 -1
  593. package/lib/icons/show/time.svg.js +3 -1
  594. package/lib/icons/theme/css.svg.js +3 -1
  595. package/lib/index.d.ts +8 -0
  596. package/lib/index.js +47 -6
  597. package/lib/locale/en-US.js +241 -19
  598. package/lib/locale/zh-CN.js +235 -7
  599. package/lib/plugin/Alert.js +3 -1
  600. package/lib/plugin/AnchorNav.js +3 -1
  601. package/lib/plugin/Audio.js +3 -1
  602. package/lib/plugin/Avatar.js +3 -1
  603. package/lib/plugin/Breadcrumb.js +3 -1
  604. package/lib/plugin/Button.js +5 -3
  605. package/lib/plugin/ButtonGroup.js +3 -1
  606. package/lib/plugin/CRUD.js +3 -1
  607. package/lib/plugin/CRUD2/BaseCRUD.d.ts +233 -0
  608. package/lib/plugin/CRUD2/BaseCRUD.js +1060 -0
  609. package/lib/plugin/CRUD2/CRUDCards.d.ts +53 -0
  610. package/lib/plugin/CRUD2/CRUDList.d.ts +53 -0
  611. package/lib/plugin/CRUD2/CRUDTable.d.ts +21 -0
  612. package/lib/plugin/CRUD2/CRUDTable.js +52 -0
  613. package/lib/plugin/CRUD2/constants.d.ts +32 -0
  614. package/lib/plugin/CRUD2/constants.js +81 -0
  615. package/lib/plugin/CRUD2/utils.d.ts +8 -0
  616. package/lib/plugin/CRUD2/utils.js +103 -0
  617. package/lib/plugin/Card.js +3 -1
  618. package/lib/plugin/Card2.js +3 -1
  619. package/lib/plugin/Cards.d.ts +547 -41
  620. package/lib/plugin/Cards.js +365 -167
  621. package/lib/plugin/Carousel.js +120 -97
  622. package/lib/plugin/Chart.js +17 -5
  623. package/lib/plugin/CodeView.js +3 -1
  624. package/lib/plugin/Collapse.d.ts +2 -1
  625. package/lib/plugin/Collapse.js +50 -1
  626. package/lib/plugin/CollapseGroup.js +3 -1
  627. package/lib/plugin/ColumnToggler.d.ts +11 -6
  628. package/lib/plugin/ColumnToggler.js +72 -9
  629. package/lib/plugin/Container.d.ts +2 -0
  630. package/lib/plugin/Container.js +8 -8
  631. package/lib/plugin/Custom.js +3 -1
  632. package/lib/plugin/CustomRegion.js +5 -2
  633. package/lib/plugin/Date.js +3 -1
  634. package/lib/plugin/Datetime.js +3 -1
  635. package/lib/plugin/Dialog.d.ts +13 -1
  636. package/lib/plugin/Dialog.js +184 -53
  637. package/lib/plugin/Divider.js +72 -6
  638. package/lib/plugin/Drawer.js +125 -76
  639. package/lib/plugin/DropDownButton.js +3 -1
  640. package/lib/plugin/Each.d.ts +226 -11
  641. package/lib/plugin/Each.js +234 -89
  642. package/lib/plugin/Flex.js +3 -1
  643. package/lib/plugin/Form/ButtonGroupSelect.js +25 -23
  644. package/lib/plugin/Form/ButtonToolbar.js +3 -1
  645. package/lib/plugin/Form/ChainedSelect.js +21 -19
  646. package/lib/plugin/Form/Checkbox.js +55 -12
  647. package/lib/plugin/Form/Checkboxes.js +33 -42
  648. package/lib/plugin/Form/CodeEditor.js +3 -1
  649. package/lib/plugin/Form/Combo.d.ts +3 -2
  650. package/lib/plugin/Form/Combo.js +8 -5
  651. package/lib/plugin/Form/ConditionBuilder.js +3 -1
  652. package/lib/plugin/Form/Control.js +3 -1
  653. package/lib/plugin/Form/DiffEditor.js +3 -1
  654. package/lib/plugin/Form/FieldSet.js +3 -1
  655. package/lib/plugin/Form/Form.d.ts +32 -8
  656. package/lib/plugin/Form/Form.js +598 -440
  657. package/lib/plugin/Form/Formula.js +3 -1
  658. package/lib/plugin/Form/Group.js +3 -1
  659. package/lib/plugin/Form/Hidden.js +3 -1
  660. package/lib/plugin/Form/InputArray.js +3 -1
  661. package/lib/plugin/Form/InputCity.js +6 -2
  662. package/lib/plugin/Form/InputColor.js +3 -1
  663. package/lib/plugin/Form/InputDate.js +29 -43
  664. package/lib/plugin/Form/InputDateRange.js +41 -30
  665. package/lib/plugin/Form/InputDateTime.js +3 -1
  666. package/lib/plugin/Form/InputDateTimeRange.js +3 -1
  667. package/lib/plugin/Form/InputEmail.js +3 -1
  668. package/lib/plugin/Form/InputExcel.js +3 -1
  669. package/lib/plugin/Form/InputFile.js +8 -2
  670. package/lib/plugin/Form/InputGroup.d.ts +1 -0
  671. package/lib/plugin/Form/InputGroup.js +3 -1
  672. package/lib/plugin/Form/InputImage.js +12 -6
  673. package/lib/plugin/Form/InputKV.js +3 -1
  674. package/lib/plugin/Form/InputMonth.js +3 -1
  675. package/lib/plugin/Form/InputMonthRange.js +3 -1
  676. package/lib/plugin/Form/InputNumber.js +3 -1
  677. package/lib/plugin/Form/InputPassword.js +3 -1
  678. package/lib/plugin/Form/InputQuarter.js +3 -1
  679. package/lib/plugin/Form/InputQuarterRange.js +3 -1
  680. package/lib/plugin/Form/InputRange.js +23 -35
  681. package/lib/plugin/Form/InputRating.js +3 -1
  682. package/lib/plugin/Form/InputRepeat.js +3 -1
  683. package/lib/plugin/Form/InputRichText.js +3 -1
  684. package/lib/plugin/Form/InputSubForm.js +3 -1
  685. package/lib/plugin/Form/InputTable.d.ts +3 -2
  686. package/lib/plugin/Form/InputTable.js +12 -7
  687. package/lib/plugin/Form/InputTag.d.ts +4 -1
  688. package/lib/plugin/Form/InputTag.js +33 -22
  689. package/lib/plugin/Form/InputText.js +23 -23
  690. package/lib/plugin/Form/InputTime.js +3 -1
  691. package/lib/plugin/Form/InputTimeRange.js +3 -1
  692. package/lib/plugin/Form/InputTree.js +69 -54
  693. package/lib/plugin/Form/InputURL.js +3 -1
  694. package/lib/plugin/Form/InputYear.js +3 -1
  695. package/lib/plugin/Form/InputYearRange.js +3 -1
  696. package/lib/plugin/Form/Item.js +3 -1
  697. package/lib/plugin/Form/ListSelect.js +25 -23
  698. package/lib/plugin/Form/LocationPicker.js +3 -1
  699. package/lib/plugin/Form/MatrixCheckboxes.js +3 -1
  700. package/lib/plugin/Form/NestedSelect.js +25 -23
  701. package/lib/plugin/Form/Picker.js +22 -22
  702. package/lib/plugin/Form/Radios.js +20 -18
  703. package/lib/plugin/Form/Select.d.ts +8 -8
  704. package/lib/plugin/Form/Select.js +41 -72
  705. package/lib/plugin/Form/Static.js +3 -1
  706. package/lib/plugin/Form/Switch.js +3 -1
  707. package/lib/plugin/Form/TabsTransfer.d.ts +2 -3
  708. package/lib/plugin/Form/TabsTransfer.js +58 -44
  709. package/lib/plugin/Form/Textarea.js +3 -1
  710. package/lib/plugin/Form/Transfer.js +25 -23
  711. package/lib/plugin/Form/TreeSelect.js +59 -51
  712. package/lib/plugin/Form/UUID.js +3 -1
  713. package/lib/plugin/Grid.js +3 -1
  714. package/lib/plugin/HBox.js +3 -1
  715. package/lib/plugin/IFrame.js +3 -1
  716. package/lib/plugin/Icon.js +5 -3
  717. package/lib/plugin/Image.js +54 -31
  718. package/lib/plugin/Images.js +22 -10
  719. package/lib/plugin/Json.js +3 -1
  720. package/lib/plugin/Layout/FlexPluginBase.js +14 -15
  721. package/lib/plugin/Layout/Layout_fixed.js +3 -1
  722. package/lib/plugin/Layout/Layout_free_container.js +3 -1
  723. package/lib/plugin/Layout/Layout_sorption_container.js +3 -1
  724. package/lib/plugin/Link.js +17 -5
  725. package/lib/plugin/List.d.ts +5 -0
  726. package/lib/plugin/List.js +54 -17
  727. package/lib/plugin/List2.d.ts +545 -0
  728. package/lib/plugin/List2.js +388 -0
  729. package/lib/plugin/ListItem.js +3 -1
  730. package/lib/plugin/Log.js +3 -1
  731. package/lib/plugin/Mapping.js +3 -1
  732. package/lib/plugin/Markdown.js +3 -1
  733. package/lib/plugin/Nav.js +3 -1
  734. package/lib/plugin/OfficeViewer.js +3 -1
  735. package/lib/plugin/Operation.js +3 -2
  736. package/lib/plugin/Others/Action.js +3 -1
  737. package/lib/plugin/Others/TableCell.js +3 -1
  738. package/lib/plugin/Page.js +27 -2
  739. package/lib/plugin/Pagination.d.ts +0 -1
  740. package/lib/plugin/Pagination.js +38 -18
  741. package/lib/plugin/Panel.js +3 -1
  742. package/lib/plugin/Plain.js +3 -1
  743. package/lib/plugin/Progress.js +3 -1
  744. package/lib/plugin/Property.js +3 -1
  745. package/lib/plugin/QRCode.js +3 -1
  746. package/lib/plugin/Reset.js +3 -1
  747. package/lib/plugin/SearchBox.d.ts +3 -1
  748. package/lib/plugin/SearchBox.js +14 -1
  749. package/lib/plugin/Service.d.ts +19 -13
  750. package/lib/plugin/Service.js +167 -89
  751. package/lib/plugin/Sparkline.js +5 -6
  752. package/lib/plugin/Status.js +3 -1
  753. package/lib/plugin/Steps.js +3 -1
  754. package/lib/plugin/Submit.js +3 -1
  755. package/lib/plugin/Table.d.ts +9 -0
  756. package/lib/plugin/Table.js +53 -4
  757. package/lib/plugin/Table2.d.ts +24 -10
  758. package/lib/plugin/Table2.js +672 -418
  759. package/lib/plugin/TableCell2.d.ts +14 -2
  760. package/lib/plugin/TableCell2.js +509 -363
  761. package/lib/plugin/TableView.js +3 -1
  762. package/lib/plugin/Tabs.js +3 -1
  763. package/lib/plugin/Tag.js +10 -2
  764. package/lib/plugin/Tasks.js +3 -1
  765. package/lib/plugin/Time.js +3 -1
  766. package/lib/plugin/Timeline.js +3 -1
  767. package/lib/plugin/TooltipWrapper.js +12 -9
  768. package/lib/plugin/Tpl.js +21 -3
  769. package/lib/plugin/Video.js +3 -1
  770. package/lib/plugin/WebComponent.js +3 -1
  771. package/lib/plugin/Wizard.js +3 -1
  772. package/lib/plugin/Wrapper.js +3 -1
  773. package/lib/plugin/index.d.ts +2 -1
  774. package/lib/renderer/APIAdaptorControl.d.ts +14 -0
  775. package/lib/renderer/APIAdaptorControl.js +27 -39
  776. package/lib/renderer/APIControl.js +12 -2
  777. package/lib/renderer/ActionApiControl.d.ts +6 -0
  778. package/lib/renderer/BadgeControl.d.ts +6 -6
  779. package/lib/renderer/BadgeControl.js +3 -1
  780. package/lib/renderer/ButtonGroupControl.js +3 -1
  781. package/lib/renderer/DataBindingControl.d.ts +1 -1
  782. package/lib/renderer/DataBindingControl.js +3 -1
  783. package/lib/renderer/DataMappingControl.js +3 -1
  784. package/lib/renderer/DataPickerControl.js +3 -1
  785. package/lib/renderer/DateShortCutControl.d.ts +1 -0
  786. package/lib/renderer/DateShortCutControl.js +9 -5
  787. package/lib/renderer/ExpressionFormulaControl.js +3 -1
  788. package/lib/renderer/FeatureControl.d.ts +17 -4
  789. package/lib/renderer/FeatureControl.js +75 -13
  790. package/lib/renderer/FieldSetting.d.ts +66 -0
  791. package/lib/renderer/FieldSetting.js +503 -0
  792. package/lib/renderer/FlexSettingControl.js +3 -1
  793. package/lib/renderer/FormulaControl.d.ts +6 -1
  794. package/lib/renderer/FormulaControl.js +23 -6
  795. package/lib/renderer/FunctionEditorControl.d.ts +79 -0
  796. package/lib/renderer/FunctionEditorControl.js +115 -0
  797. package/lib/renderer/GoConfigControl.js +3 -1
  798. package/lib/renderer/InputRangeValueControl.d.ts +15 -0
  799. package/lib/renderer/InputRangeValueControl.js +127 -0
  800. package/lib/renderer/MapSourceControl.js +3 -1
  801. package/lib/renderer/NavBadgeControl.d.ts +6 -6
  802. package/lib/renderer/NavBadgeControl.js +3 -1
  803. package/lib/renderer/NavDefaultActive.js +3 -1
  804. package/lib/renderer/NavSourceControl.js +3 -1
  805. package/lib/renderer/OptionControl.d.ts +2 -0
  806. package/lib/renderer/OptionControl.js +35 -23
  807. package/lib/renderer/RangePartsControl.js +3 -1
  808. package/lib/renderer/StatusControl.js +3 -1
  809. package/lib/renderer/SwitchMoreControl.d.ts +6 -0
  810. package/lib/renderer/SwitchMoreControl.js +14 -2
  811. package/lib/renderer/TableColumnWidthControl.d.ts +29 -0
  812. package/lib/renderer/TableColumnWidthControl.js +186 -0
  813. package/lib/renderer/TimelineItemControl.js +3 -1
  814. package/lib/renderer/TplFormulaControl.js +3 -1
  815. package/lib/renderer/TransferTableControl.js +3 -1
  816. package/lib/renderer/TreeOptionControl.d.ts +1 -1
  817. package/lib/renderer/TreeOptionControl.js +8 -6
  818. package/lib/renderer/ValidationControl.js +3 -1
  819. package/lib/renderer/ValidationItem.js +3 -1
  820. package/lib/renderer/crud2-control/AddColumnModal.d.ts +6 -0
  821. package/lib/renderer/crud2-control/AddColumnModal.js +265 -0
  822. package/lib/renderer/crud2-control/CRUDColumnControl.d.ts +68 -0
  823. package/lib/renderer/crud2-control/CRUDColumnControl.js +482 -0
  824. package/lib/renderer/crud2-control/CRUDFiltersControl.d.ts +53 -0
  825. package/lib/renderer/crud2-control/CRUDFiltersControl.js +701 -0
  826. package/lib/renderer/crud2-control/CRUDToolbarControl.d.ts +49 -0
  827. package/lib/renderer/crud2-control/CRUDToolbarControl.js +426 -0
  828. package/lib/renderer/event-control/action-config-dialog.d.ts +1 -1
  829. package/lib/renderer/event-control/action-config-dialog.js +4 -2
  830. package/lib/renderer/event-control/action-config-panel.js +3 -1
  831. package/lib/renderer/event-control/comp-action-select.js +3 -1
  832. package/lib/renderer/event-control/helper.d.ts +2 -1
  833. package/lib/renderer/event-control/helper.js +168 -115
  834. package/lib/renderer/event-control/index.d.ts +26 -17
  835. package/lib/renderer/event-control/index.js +114 -22
  836. package/lib/renderer/style-control/Background.js +3 -1
  837. package/lib/renderer/style-control/Border.js +3 -1
  838. package/lib/renderer/style-control/BoxModel.js +3 -1
  839. package/lib/renderer/style-control/BoxShadow.js +3 -1
  840. package/lib/renderer/style-control/Display.js +3 -1
  841. package/lib/renderer/style-control/Font.js +3 -1
  842. package/lib/renderer/style-control/InsetBoxModel.js +3 -1
  843. package/lib/renderer/style-control/ThemeCssCode.js +131 -280
  844. package/lib/renderer/style-control/font-family.js +3 -1
  845. package/lib/renderer/style-control/helper.js +3 -1
  846. package/lib/renderer/style-control/transformation.js +3 -1
  847. package/lib/renderer/textarea-formula/FormulaPicker.js +3 -1
  848. package/lib/renderer/textarea-formula/TextareaFormulaControl.d.ts +2 -0
  849. package/lib/renderer/textarea-formula/TextareaFormulaControl.js +75 -6
  850. package/lib/renderer/textarea-formula/plugin.js +5 -3
  851. package/lib/tpl/api.js +14 -9
  852. package/lib/tpl/common.js +52 -34
  853. package/lib/tpl/horizontal.js +3 -1
  854. package/lib/tpl/layout.js +10 -6
  855. package/lib/tpl/options.d.ts +10 -1
  856. package/lib/tpl/options.js +249 -9
  857. package/lib/tpl/remark.js +3 -1
  858. package/lib/tpl/style.js +99 -60
  859. package/lib/tpl/validations.js +3 -1
  860. package/lib/util.d.ts +8 -0
  861. package/lib/util.js +20 -1
  862. package/lib/validator.js +3 -1
  863. package/package.json +1 -1
  864. package/esm/plugin/CRUD2.d.ts +0 -78
  865. package/esm/plugin/CRUD2.js +0 -1556
  866. package/esm/renderer/style-control/themeLanguage.d.ts +0 -1
  867. package/esm/renderer/style-control/themeLanguage.js +0 -1894
  868. package/lib/plugin/CRUD2.d.ts +0 -78
  869. package/lib/plugin/CRUD2.js +0 -1572
  870. package/lib/renderer/style-control/themeLanguage.d.ts +0 -1
  871. package/lib/renderer/style-control/themeLanguage.js +0 -1902
@@ -0,0 +1,1226 @@
1
+ /**
2
+ * amis-editor v5.5.2-beta.2
3
+ * build time: 2023-09-28
4
+ * Copyright 2018-2023 @fex
5
+ */
6
+
7
+ 'use strict';
8
+
9
+ Object.defineProperty(exports, '__esModule', { value: true });
10
+
11
+ var tslib = require('tslib');
12
+ var sortBy = require('lodash/sortBy');
13
+ var pick = require('lodash/pick');
14
+ var get = require('lodash/get');
15
+ var uniq = require('lodash/uniq');
16
+ var omit = require('lodash/omit');
17
+ var intersection = require('lodash/intersection');
18
+ var isFunction = require('lodash/isFunction');
19
+ var amisCore = require('amis-core');
20
+ var amis = require('amis');
21
+ var amisEditorCore = require('amis-editor-core');
22
+ var DSBuilder = require('./DSBuilder.js');
23
+ var constants = require('./constants.js');
24
+ var utils = require('./utils.js');
25
+ var i18nRuntime = require('i18n-runtime');
26
+
27
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
28
+
29
+ var sortBy__default = /*#__PURE__*/_interopDefaultLegacy(sortBy);
30
+ var pick__default = /*#__PURE__*/_interopDefaultLegacy(pick);
31
+ var get__default = /*#__PURE__*/_interopDefaultLegacy(get);
32
+ var uniq__default = /*#__PURE__*/_interopDefaultLegacy(uniq);
33
+ var omit__default = /*#__PURE__*/_interopDefaultLegacy(omit);
34
+ var intersection__default = /*#__PURE__*/_interopDefaultLegacy(intersection);
35
+ var isFunction__default = /*#__PURE__*/_interopDefaultLegacy(isFunction);
36
+
37
+ /**
38
+ * @file ApiDsBuilder
39
+ * @desc 外部 API 接口数据源构造器
40
+ */
41
+ var ApiDSBuilder = /** @class */function (_super) {
42
+ tslib.__extends(ApiDSBuilder, _super);
43
+ function ApiDSBuilder() {
44
+ var _this = _super !== null && _super.apply(this, arguments) || this;
45
+ _this.isDefault = true;
46
+ _this.name = i18nRuntime.i18n("45f3a444853a11667f97e941b53266b0");
47
+ _this.order = 1;
48
+ _this.features = ['List', 'Insert', 'View', 'Edit', 'Delete', 'BulkEdit', 'BulkDelete', 'SimpleQuery'];
49
+ return _this;
50
+ }
51
+ Object.defineProperty(ApiDSBuilder.prototype, "key", {
52
+ /**
53
+ * 获取键值。
54
+ */
55
+ get: function () {
56
+ return this.constructor.key;
57
+ },
58
+ enumerable: false,
59
+ configurable: true
60
+ });
61
+ ApiDSBuilder.prototype.match = function (schema, key) {
62
+ var sourceKey = key && typeof key === 'string' ? key : 'api';
63
+ var apiSchema = schema === null || schema === void 0 ? void 0 : schema[sourceKey];
64
+ if ((schema === null || schema === void 0 ? void 0 : schema.dsType) === this.key || (apiSchema === null || apiSchema === void 0 ? void 0 : apiSchema.sourceType) === this.key) {
65
+ return true;
66
+ }
67
+ /**
68
+ * 携带 jsonql 一定不是 API 接口
69
+ * 携带 strategy 为实体接口通过混合构建策略生成
70
+ * */
71
+ if (amisCore.isObject(apiSchema) && (apiSchema.jsonql != null || apiSchema.strategy != null)) {
72
+ return false;
73
+ }
74
+ var maybeApiUrl = typeof apiSchema === 'string' ? apiSchema : amisCore.isObject(apiSchema) ? (apiSchema === null || apiSchema === void 0 ? void 0 : apiSchema.url) || '' : '';
75
+ if (typeof maybeApiUrl === 'string' && (/^(get|post|put|delete|patch|option|jsonp):/.test(apiSchema) || !~maybeApiUrl.indexOf('api://'))) {
76
+ return true;
77
+ }
78
+ return false;
79
+ };
80
+ ApiDSBuilder.prototype.getContextFields = function (options) {
81
+ return tslib.__awaiter(this, void 0, void 0, function () {
82
+ return tslib.__generator(this, function (_a) {
83
+ return [2 /*return*/, []];
84
+ });
85
+ });
86
+ };
87
+ ApiDSBuilder.prototype.getAvailableContextFields = function (options, target) {
88
+ return tslib.__awaiter(this, void 0, void 0, function () {
89
+ return tslib.__generator(this, function (_a) {
90
+ return [2 /*return*/];
91
+ });
92
+ });
93
+ };
94
+
95
+ ApiDSBuilder.prototype.getCRUDListFields = function (options) {
96
+ var _a;
97
+ return tslib.__awaiter(this, void 0, void 0, function () {
98
+ var _b, schema, controlSettings, fieldMapper, columns, result;
99
+ return tslib.__generator(this, function (_c) {
100
+ _b = options || {}, schema = _b.schema, controlSettings = _b.controlSettings;
101
+ fieldMapper = (controlSettings || {}).fieldMapper;
102
+ columns = (_a = schema === null || schema === void 0 ? void 0 : schema.columns) !== null && _a !== void 0 ? _a : [];
103
+ result = [];
104
+ columns.forEach(function (item) {
105
+ var option = isFunction__default["default"](fieldMapper) ? fieldMapper(item) : false;
106
+ if (option !== false) {
107
+ result.push(option);
108
+ }
109
+ });
110
+ return [2 /*return*/, result];
111
+ });
112
+ });
113
+ };
114
+ ApiDSBuilder.prototype.getCRUDSimpleQueryFields = function (options) {
115
+ var _a, _b;
116
+ return tslib.__awaiter(this, void 0, void 0, function () {
117
+ var _c, schema, controlSettings, fieldMapper, filterSchema, result;
118
+ return tslib.__generator(this, function (_d) {
119
+ _c = options || {}, schema = _c.schema, controlSettings = _c.controlSettings;
120
+ fieldMapper = (controlSettings || {}).fieldMapper;
121
+ filterSchema = (schema === null || schema === void 0 ? void 0 : schema.filter) ? Array.isArray(schema.filter) ? schema.filter.find(function (item) {
122
+ return item.behavior && Array.isArray(item.behavior) && item.type === 'form';
123
+ }) : ((_a = schema.filter) === null || _a === void 0 ? void 0 : _a.type) === 'form' ? schema.filter : undefined : undefined;
124
+ result = [];
125
+ ((_b = filterSchema === null || filterSchema === void 0 ? void 0 : filterSchema.body) !== null && _b !== void 0 ? _b : []).forEach(function (formItem) {
126
+ if (formItem.type === 'condition-builder' || formItem.behavior === constants.DSFeatureEnum.AdvancedQuery) {
127
+ return;
128
+ }
129
+ var option = isFunction__default["default"](fieldMapper) ? fieldMapper(formItem) : false;
130
+ if (option !== false) {
131
+ result.push(option);
132
+ }
133
+ });
134
+ return [2 /*return*/, result];
135
+ });
136
+ });
137
+ };
138
+ ApiDSBuilder.prototype.makeSourceSettingForm = function (options) {
139
+ var _a = options || {},
140
+ feat = _a.feat,
141
+ renderer = _a.renderer,
142
+ inScaffold = _a.inScaffold,
143
+ sourceSettings = _a.sourceSettings,
144
+ sourceKey = _a.sourceKey;
145
+ if (!feat) {
146
+ return [];
147
+ }
148
+ var _b = sourceSettings || {},
149
+ label = _b.label,
150
+ name = _b.name,
151
+ renderLabel = _b.renderLabel,
152
+ labelClassName = _b.labelClassName,
153
+ mode = _b.mode,
154
+ horizontalConfig = _b.horizontalConfig,
155
+ visibleOn = _b.visibleOn;
156
+ var isCRUD = renderer === 'crud';
157
+ /** 处理Label */
158
+ var labelText = label !== null && label !== void 0 ? label : isCRUD && feat !== 'List' ? this.getFeatLabelByKey(feat) + i18nRuntime.i18n("54ea89b497ec3bb319c68844dfa3687f") : i18nRuntime.i18n("54ea89b497ec3bb319c68844dfa3687f");
159
+ var normalizedLabel = labelText;
160
+ if (feat === 'Insert') {
161
+ normalizedLabel = amisEditorCore.tipedLabel(labelText, "\u7528\u6765\u4FDD\u5B58\u6570\u636E, \u8868\u5355\u63D0\u4EA4\u540E\u5C06\u6570\u636E\u4F20\u5165\u6B64\u63A5\u53E3\u3002<br/>\n \u63A5\u53E3\u54CD\u5E94\u4F53\u8981\u6C42(\u5982\u679Cdata\u4E2D\u6709\u6570\u636E\uFF0C\u8BE5\u6570\u636E\u5C06\u88AB\u5408\u5E76\u5230\u8868\u5355\u4E0A\u4E0B\u6587\u4E2D)\uFF1A<br/>\n <pre>".concat(JSON.stringify({
162
+ status: 0,
163
+ msg: '',
164
+ data: {}
165
+ }, null, 2), "</pre>"));
166
+ } else if (feat === 'List') {
167
+ normalizedLabel = amisEditorCore.tipedLabel(labelText, "\u63A5\u53E3\u54CD\u5E94\u4F53\u8981\u6C42\uFF1A<br/>\n <pre>".concat(JSON.stringify({
168
+ status: 0,
169
+ msg: '',
170
+ items: {},
171
+ page: 0,
172
+ total: 0
173
+ }, null, 2), "</pre>"));
174
+ }
175
+ var layoutMode = mode !== null && mode !== void 0 ? mode : 'horizontal';
176
+ var baseApiSchemaConfig = tslib.__assign(tslib.__assign(tslib.__assign({
177
+ renderLabel: renderLabel !== null && renderLabel !== void 0 ? renderLabel : true,
178
+ label: normalizedLabel,
179
+ name: name !== null && name !== void 0 ? name : inScaffold ? this.getFeatValueByKey(feat) + 'Api' : 'api',
180
+ mode: layoutMode,
181
+ labelClassName: labelClassName,
182
+ inputClassName: 'm-b-none'
183
+ }, layoutMode === 'horizontal' ? horizontalConfig !== null && horizontalConfig !== void 0 ? horizontalConfig : {} : {}), visibleOn && typeof visibleOn === 'string' ? {
184
+ visibleOn: visibleOn
185
+ } : {}), {
186
+ onPickerConfirm: function (value) {
187
+ var transformedValue = value;
188
+ var transform = function (apiObj) {
189
+ var _a;
190
+ return "".concat(((_a = apiObj === null || apiObj === void 0 ? void 0 : apiObj.api) === null || _a === void 0 ? void 0 : _a.method) || 'post', ":api://").concat((apiObj === null || apiObj === void 0 ? void 0 : apiObj.key) || '');
191
+ };
192
+ if (value) {
193
+ transformedValue = Array.isArray(value) ? value.map(transform).join(',') : transform(value);
194
+ }
195
+ return transformedValue;
196
+ }
197
+ });
198
+ return tslib.__spreadArray([/** 提交接口 */
199
+ amisEditorCore.getSchemaTpl('apiControl', baseApiSchemaConfig), /** 表单初始化接口 */
200
+ feat === 'Edit' && (renderer === 'form' || sourceKey === 'initApi') ? amisEditorCore.getSchemaTpl('apiControl', tslib.__assign(tslib.__assign({}, baseApiSchemaConfig), {
201
+ name: 'initApi',
202
+ label: amisEditorCore.tipedLabel(i18nRuntime.i18n("b4bc91701b86fe8543d649e97daea602"), "\u63A5\u53E3\u54CD\u5E94\u4F53\u8981\u6C42\uFF1A<br/>\n <pre>".concat(JSON.stringify({
203
+ status: 0,
204
+ msg: '',
205
+ data: {}
206
+ }, null, 2), "</pre>"))
207
+ })) : null], tslib.__read(feat === 'List' && renderer === 'crud' && !inScaffold ? [amisEditorCore.getSchemaTpl('apiControl', tslib.__assign(tslib.__assign({}, baseApiSchemaConfig), {
208
+ name: 'quickSaveApi',
209
+ label: amisEditorCore.tipedLabel(i18nRuntime.i18n("33eaf97ecb3465754855e847f14d129c"), i18nRuntime.i18n("419b0a74c438b81124992616dd0a36f3"))
210
+ })), amisEditorCore.getSchemaTpl('apiControl', tslib.__assign(tslib.__assign({}, baseApiSchemaConfig), {
211
+ name: 'quickSaveItemApi',
212
+ label: amisEditorCore.tipedLabel(i18nRuntime.i18n("ce7d31d64f2315e1d4cede288b9dfc60"), i18nRuntime.i18n("152e8c553fe6fbc51df7c72a45917107"))
213
+ }))] : []), false).filter(Boolean);
214
+ };
215
+ ApiDSBuilder.prototype.makeFieldsSettingForm = function (options) {
216
+ var _this = this;
217
+ var _a = options || {},
218
+ feat = _a.feat,
219
+ inScaffold = _a.inScaffold,
220
+ renderer = _a.renderer,
221
+ fieldSettings = _a.fieldSettings;
222
+ var renderLabel = (fieldSettings || {}).renderLabel;
223
+ if (!feat || !inScaffold || ['Import', 'Export', 'FuzzyQuery', 'Delete', 'BulkDelete'].includes(feat)) {
224
+ return [];
225
+ }
226
+ var result = [{
227
+ type: 'ae-field-setting',
228
+ name: this.getFieldsKey(options),
229
+ label: renderLabel === false ? false : i18nRuntime.i18n("9caecd931b956381e0763d05aa42835c"),
230
+ renderer: renderer,
231
+ feat: feat,
232
+ fieldKeys: this.features.map(function (f) {
233
+ return _this.getFieldsKey({
234
+ feat: f
235
+ });
236
+ }),
237
+ config: {
238
+ showInputType: renderer === 'form' || renderer === 'crud' && ['Edit', 'BulkEdit', 'Insert', 'View', 'SimpleQuery', 'List'].includes(feat),
239
+ showDisplayType: renderer === 'crud' && ['List'].includes(feat)
240
+ },
241
+ onAutoGenerateFields: this.autoGenerateFields.bind(this)
242
+ }];
243
+ return result;
244
+ };
245
+ /** 基于接口生成字段 */
246
+ ApiDSBuilder.prototype.autoGenerateFields = function (_a) {
247
+ var _b, _c, _d, _e, _f;
248
+ var api = _a.api,
249
+ props = _a.props;
250
+ _a.setState;
251
+ return tslib.__awaiter(this, void 0, void 0, function () {
252
+ var manager, env, ctx, feat, schemaFilter, result, fields, sampleRow, items;
253
+ return tslib.__generator(this, function (_g) {
254
+ switch (_g.label) {
255
+ case 0:
256
+ manager = props.manager, env = props.env, ctx = props.data, feat = props.feat;
257
+ schemaFilter = (_b = manager === null || manager === void 0 ? void 0 : manager.store) === null || _b === void 0 ? void 0 : _b.schemaFilter;
258
+ if (schemaFilter) {
259
+ api = schemaFilter({
260
+ api: api
261
+ }).api;
262
+ }
263
+ return [4 /*yield*/, env === null || env === void 0 ? void 0 : env.fetcher(api, ctx)];
264
+ case 1:
265
+ result = _g.sent();
266
+ if (!result.ok) {
267
+ amis.toast.warning((_d = (_c = result.defaultMsg) !== null && _c !== void 0 ? _c : result.msg) !== null && _d !== void 0 ? _d : i18nRuntime.i18n("91aa2166ee4811414381c8d94e6567e6"));
268
+ return [2 /*return*/];
269
+ }
270
+
271
+ fields = [];
272
+ if (feat === 'List') {
273
+ items = ((_e = result.data) === null || _e === void 0 ? void 0 : _e.rows) || ((_f = result.data) === null || _f === void 0 ? void 0 : _f.items) || result.data;
274
+ sampleRow = items === null || items === void 0 ? void 0 : items[0];
275
+ } else {
276
+ sampleRow = result.data;
277
+ }
278
+ if (sampleRow) {
279
+ Object.entries(sampleRow).forEach(function (_a) {
280
+ var _b = tslib.__read(_a, 2),
281
+ key = _b[0],
282
+ value = _b[1];
283
+ var inputType = 'input-text';
284
+ if (Array.isArray(value)) {
285
+ inputType = 'select';
286
+ } else if (amisCore.isObject(value)) {
287
+ inputType = 'combo';
288
+ } else if (typeof value === 'number') {
289
+ inputType = 'input-number';
290
+ }
291
+ fields.push({
292
+ label: key,
293
+ name: key,
294
+ displayType: 'tpl',
295
+ inputType: inputType,
296
+ checked: true
297
+ });
298
+ });
299
+ }
300
+ return [2 /*return*/, fields];
301
+ }
302
+ });
303
+ });
304
+ };
305
+ ApiDSBuilder.prototype.getApiKey = function (options) {
306
+ var feat = (options || {}).feat;
307
+ return feat ? "".concat(this.getFeatValueByKey(feat), "Api") : 'api';
308
+ };
309
+ ApiDSBuilder.prototype.getFieldsKey = function (options) {
310
+ var feat = (options || {}).feat;
311
+ return feat ? "".concat(this.getFeatValueByKey(feat), "Fields") : '';
312
+ };
313
+ ApiDSBuilder.prototype.buildBaseButtonSchema = function (options, schemaPatch) {
314
+ var _a, _b;
315
+ var feat = (options || {}).feat;
316
+ var _c = schemaPatch || {},
317
+ buttonSchema = _c.buttonSchema,
318
+ formSchema = _c.formSchema,
319
+ dialogSchema = _c.dialogSchema,
320
+ componentId = _c.componentId;
321
+ if (!feat) {
322
+ return tslib.__assign({}, buttonSchema);
323
+ }
324
+ var labelMap = {
325
+ Insert: i18nRuntime.i18n("66ab5e9f24c8f46012a25c89919fb191"),
326
+ View: i18nRuntime.i18n("607e7a4f377fa66b0b28ce318aab841f"),
327
+ Edit: i18nRuntime.i18n("95b351c86267f3aedf89520959bce689"),
328
+ BulkEdit: i18nRuntime.i18n("e73cefac9d030927da1618c7b15c98c9"),
329
+ Delete: i18nRuntime.i18n("2f4aaddde33c9b93c36fd2503f3d122b"),
330
+ BulkDelete: i18nRuntime.i18n("7fb62b30119c3797a843a48368463314")
331
+ };
332
+ var titleMap = {
333
+ Insert: i18nRuntime.i18n("50abd0bf31e07dbee84e9e5b9a407840"),
334
+ View: i18nRuntime.i18n("c00a96da01a3cf0445df3b0d05918317"),
335
+ Edit: i18nRuntime.i18n("7695a3b5bfbcfdb3e7b085f8cd6455be"),
336
+ BulkEdit: i18nRuntime.i18n("6f2f7e3794aa8502d02cb20aba881df1"),
337
+ Delete: i18nRuntime.i18n("40f8f022c51542d282edda5b9ed4b512"),
338
+ BulkDelete: i18nRuntime.i18n("c1c29e445748fa076c5fee45274bdd36")
339
+ };
340
+ var schema = tslib.__assign(tslib.__assign({
341
+ type: 'button',
342
+ label: (_a = labelMap[feat]) !== null && _a !== void 0 ? _a : i18nRuntime.i18n("fa966345577ba81af19408f203db968f")
343
+ }, buttonSchema), {
344
+ behavior: feat,
345
+ onEvent: {
346
+ click: {
347
+ actions: [{
348
+ actionType: 'dialog',
349
+ dialog: tslib.__assign({
350
+ body: tslib.__assign(tslib.__assign({}, formSchema), {
351
+ onEvent: {
352
+ submitSucc: {
353
+ actions: [{
354
+ actionType: 'search',
355
+ groupType: 'component',
356
+ componentId: componentId
357
+ }]
358
+ }
359
+ }
360
+ }),
361
+ title: (_b = titleMap[feat]) !== null && _b !== void 0 ? _b : i18nRuntime.i18n("6cff4b6d794cc17f5d24dbe0d21e5732"),
362
+ size: 'md',
363
+ actions: [{
364
+ type: 'button',
365
+ actionType: 'cancel',
366
+ label: i18nRuntime.i18n("b15d91274e9fc68608c609999e0413fa")
367
+ }]
368
+ }, dialogSchema)
369
+ }]
370
+ }
371
+ }
372
+ });
373
+ return schema;
374
+ };
375
+ /** 构建表单按钮操作区 */
376
+ ApiDSBuilder.prototype.buildFormOperators = function (options, componentId) {
377
+ var _a = options || {};
378
+ _a.feat;
379
+ var scaffoldConfig = _a.scaffoldConfig;
380
+ var operators = (scaffoldConfig || {}).operators;
381
+ var schema = sortBy__default["default"](operators !== null && operators !== void 0 ? operators : Object.values(constants.FormOperatorMap), ['order']).map(function (item) {
382
+ return tslib.__assign({
383
+ type: 'button',
384
+ label: item.label,
385
+ onEvent: {
386
+ click: {
387
+ actions: [{
388
+ actionType: item.value,
389
+ componentId: componentId
390
+ }]
391
+ }
392
+ }
393
+ }, item.schema);
394
+ });
395
+ return schema;
396
+ };
397
+ /**
398
+ * 为输入类控件追加的初始化Schema配置,避免某些类型组件渲染报错
399
+ */
400
+ ApiDSBuilder.prototype.appendSchema2InputControl = function (inputType) {
401
+ if (inputType === 'combo') {
402
+ return {
403
+ items: [{
404
+ type: 'input-text',
405
+ name: 'input-text',
406
+ placeholder: i18nRuntime.i18n("97d07614380da93d257f9fbf81aa56fb")
407
+ }]
408
+ };
409
+ } else {
410
+ return {};
411
+ }
412
+ };
413
+ ApiDSBuilder.prototype.buildBaseFormSchema = function (options, schemaPatch, componentId) {
414
+ var _this = this;
415
+ var _a;
416
+ schemaPatch = schemaPatch || {};
417
+ var _b = options || {},
418
+ feat = _b.feat,
419
+ renderer = _b.renderer,
420
+ scaffoldConfig = _b.scaffoldConfig;
421
+ if (!feat) {
422
+ return tslib.__assign(tslib.__assign({}, schemaPatch), componentId ? {
423
+ id: componentId
424
+ } : {});
425
+ }
426
+ var fieldsKey = this.getFieldsKey(options);
427
+ var apiKey = this.getApiKey(options);
428
+ var fields = (_a = scaffoldConfig === null || scaffoldConfig === void 0 ? void 0 : scaffoldConfig[fieldsKey]) !== null && _a !== void 0 ? _a : [];
429
+ var apiSchema = scaffoldConfig === null || scaffoldConfig === void 0 ? void 0 : scaffoldConfig[apiKey];
430
+ var id = componentId !== null && componentId !== void 0 ? componentId : amisEditorCore.generateNodeId();
431
+ var schema = tslib.__assign({
432
+ id: id,
433
+ type: 'form',
434
+ title: i18nRuntime.i18n("eee1e2258d7ea163fec625ee44be9637"),
435
+ mode: 'horizontal',
436
+ dsType: this.key,
437
+ feat: feat,
438
+ body: fields.map(function (f) {
439
+ var _a;
440
+ var type = f.inputType ? (_a = utils.displayType2inputType(f.inputType)) !== null && _a !== void 0 ? _a : 'input-text' : 'input-text';
441
+ return tslib.__assign(tslib.__assign(tslib.__assign({}, pick__default["default"](f, ['name', 'label'])), {
442
+ type: type
443
+ }), _this.appendSchema2InputControl(type));
444
+ }),
445
+ api: apiSchema
446
+ }, renderer === 'form' ? {
447
+ actions: this.buildFormOperators(options, id)
448
+ } : {});
449
+ if (['Insert', 'Edit', 'BulkEdit'].includes(feat)) {
450
+ schema.resetAfterSubmit = true;
451
+ }
452
+ if (feat === 'View') {
453
+ schema.static = true;
454
+ }
455
+ return tslib.__assign(tslib.__assign(tslib.__assign({}, schema), schemaPatch), {
456
+ id: id
457
+ });
458
+ };
459
+ ApiDSBuilder.prototype.buildInsertSchema = function (options, componentId) {
460
+ return tslib.__awaiter(this, void 0, void 0, function () {
461
+ var _a, renderer, scaffoldConfig, insertApi, formId, formActions, title, formSchema;
462
+ return tslib.__generator(this, function (_b) {
463
+ _a = options || {}, renderer = _a.renderer, scaffoldConfig = _a.scaffoldConfig;
464
+ insertApi = (scaffoldConfig || {}).insertApi;
465
+ if (renderer === 'form') {
466
+ return [2 /*return*/, this.buildBaseFormSchema(tslib.__assign({}, options), undefined, componentId)];
467
+ }
468
+ formId = componentId !== null && componentId !== void 0 ? componentId : amisEditorCore.generateNodeId();
469
+ formActions = [{
470
+ type: 'button',
471
+ actionType: 'cancel',
472
+ label: i18nRuntime.i18n("625fb26b4b3340f7872b411f401e754c")
473
+ }, {
474
+ type: 'button',
475
+ actionType: 'submit',
476
+ label: i18nRuntime.i18n("939d5345ad4345dbaabe14798f6ac0f1"),
477
+ level: 'primary'
478
+ }];
479
+ title = i18nRuntime.i18n("50abd0bf31e07dbee84e9e5b9a407840");
480
+ formSchema = this.buildBaseFormSchema(tslib.__assign(tslib.__assign({}, options), {
481
+ feat: constants.DSFeatureEnum.Insert
482
+ }), {
483
+ id: formId,
484
+ title: title,
485
+ api: insertApi,
486
+ actions: formActions
487
+ });
488
+ return [2 /*return*/, tslib.__assign({}, this.buildBaseButtonSchema(tslib.__assign(tslib.__assign({}, options), {
489
+ feat: constants.DSFeatureEnum.Insert
490
+ }), {
491
+ buttonSchema: {
492
+ level: 'primary',
493
+ className: 'm-r-xs'
494
+ },
495
+ dialogSchema: {
496
+ title: title,
497
+ actions: formActions
498
+ },
499
+ formSchema: formSchema,
500
+ componentId: componentId
501
+ }))];
502
+ });
503
+ });
504
+ };
505
+ ApiDSBuilder.prototype.buildViewSchema = function (options, componentId) {
506
+ return tslib.__awaiter(this, void 0, void 0, function () {
507
+ var _a, renderer, scaffoldConfig, viewApi, formActions, title, formSchema, buttonSchema;
508
+ return tslib.__generator(this, function (_b) {
509
+ _a = options || {}, renderer = _a.renderer, scaffoldConfig = _a.scaffoldConfig;
510
+ viewApi = (scaffoldConfig || {}).viewApi;
511
+ formActions = [{
512
+ type: 'button',
513
+ actionType: 'cancel',
514
+ label: i18nRuntime.i18n("b15d91274e9fc68608c609999e0413fa")
515
+ }];
516
+ title = i18nRuntime.i18n("c00a96da01a3cf0445df3b0d05918317");
517
+ formSchema = this.buildBaseFormSchema(tslib.__assign(tslib.__assign({}, options), {
518
+ feat: constants.DSFeatureEnum.View
519
+ }), {
520
+ title: title,
521
+ initApi: viewApi,
522
+ actions: formActions
523
+ });
524
+ if (renderer === 'crud') {
525
+ buttonSchema = tslib.__assign({}, this.buildBaseButtonSchema(tslib.__assign(tslib.__assign({}, options), {
526
+ feat: constants.DSFeatureEnum.View
527
+ }), {
528
+ buttonSchema: {
529
+ level: 'link'
530
+ },
531
+ dialogSchema: {
532
+ title: title,
533
+ actions: formActions
534
+ },
535
+ formSchema: formSchema,
536
+ componentId: componentId
537
+ }));
538
+ return [2 /*return*/, buttonSchema];
539
+ }
540
+ return [2 /*return*/, formSchema];
541
+ });
542
+ });
543
+ };
544
+ ApiDSBuilder.prototype.buildEditSchema = function (options, componentId) {
545
+ return tslib.__awaiter(this, void 0, void 0, function () {
546
+ var _a, renderer, scaffoldConfig, isForm, _b, editApi, initApi, formId, formActions, title, formSchema;
547
+ return tslib.__generator(this, function (_c) {
548
+ _a = options || {}, renderer = _a.renderer, scaffoldConfig = _a.scaffoldConfig;
549
+ isForm = renderer === 'form';
550
+ if (isForm) {
551
+ return [2 /*return*/, this.buildBaseFormSchema(options, undefined, componentId)];
552
+ }
553
+ _b = scaffoldConfig || {}, editApi = _b.editApi, initApi = _b.initApi;
554
+ formId = amisEditorCore.generateNodeId();
555
+ formActions = [{
556
+ type: 'button',
557
+ actionType: 'cancel',
558
+ label: i18nRuntime.i18n("625fb26b4b3340f7872b411f401e754c")
559
+ }, {
560
+ type: 'button',
561
+ actionType: 'submit',
562
+ label: i18nRuntime.i18n("939d5345ad4345dbaabe14798f6ac0f1"),
563
+ level: 'primary'
564
+ }];
565
+ title = i18nRuntime.i18n("7695a3b5bfbcfdb3e7b085f8cd6455be");
566
+ formSchema = this.buildBaseFormSchema(tslib.__assign(tslib.__assign({}, options), {
567
+ feat: constants.DSFeatureEnum.Edit
568
+ }), {
569
+ id: formId,
570
+ title: title,
571
+ initApi: initApi,
572
+ api: editApi,
573
+ actions: formActions
574
+ });
575
+ return [2 /*return*/, tslib.__assign({}, this.buildBaseButtonSchema(tslib.__assign(tslib.__assign({}, options), {
576
+ feat: constants.DSFeatureEnum.Edit
577
+ }), {
578
+ buttonSchema: {
579
+ level: 'link'
580
+ },
581
+ dialogSchema: {
582
+ title: title,
583
+ actions: formActions
584
+ },
585
+ formSchema: formSchema,
586
+ componentId: componentId
587
+ }))];
588
+ });
589
+ });
590
+ };
591
+ ApiDSBuilder.prototype.buildBulkEditSchema = function (options, componentId) {
592
+ return tslib.__awaiter(this, void 0, void 0, function () {
593
+ var renderer, scaffoldConfig, bulkEditApi, isForm, formId, formActions, title, formSchema;
594
+ return tslib.__generator(this, function (_a) {
595
+ renderer = options.renderer, scaffoldConfig = options.scaffoldConfig;
596
+ bulkEditApi = (scaffoldConfig || {}).bulkEditApi;
597
+ isForm = renderer === 'form';
598
+ if (isForm) {
599
+ return [2 /*return*/, this.buildBaseFormSchema(options, undefined, componentId)];
600
+ }
601
+ formId = amisEditorCore.generateNodeId();
602
+ formActions = [{
603
+ type: 'button',
604
+ actionType: 'cancel',
605
+ label: i18nRuntime.i18n("625fb26b4b3340f7872b411f401e754c")
606
+ }, {
607
+ type: 'button',
608
+ actionType: 'submit',
609
+ label: i18nRuntime.i18n("939d5345ad4345dbaabe14798f6ac0f1"),
610
+ level: 'primary'
611
+ }];
612
+ title = i18nRuntime.i18n("e73cefac9d030927da1618c7b15c98c9");
613
+ formSchema = this.buildBaseFormSchema(tslib.__assign(tslib.__assign({}, options), {
614
+ feat: constants.DSFeatureEnum.BulkEdit
615
+ }), {
616
+ id: formId,
617
+ title: title,
618
+ api: bulkEditApi,
619
+ actions: formActions
620
+ });
621
+ return [2 /*return*/, tslib.__assign({}, this.buildBaseButtonSchema(tslib.__assign(tslib.__assign({}, options), {
622
+ feat: constants.DSFeatureEnum.BulkEdit
623
+ }), {
624
+ buttonSchema: {
625
+ className: 'm-r-xs',
626
+ disabledOn: '${selectedItems != null && selectedItems.length < 1}'
627
+ },
628
+ dialogSchema: {
629
+ title: title,
630
+ actions: formActions
631
+ },
632
+ formSchema: formSchema,
633
+ componentId: componentId
634
+ }))];
635
+ });
636
+ });
637
+ };
638
+ ApiDSBuilder.prototype.buildCRUDDeleteSchema = function (options, componentId) {
639
+ return tslib.__awaiter(this, void 0, void 0, function () {
640
+ var scaffoldConfig, deleteApi;
641
+ return tslib.__generator(this, function (_a) {
642
+ scaffoldConfig = (options || {}).scaffoldConfig;
643
+ deleteApi = (scaffoldConfig || {}).deleteApi;
644
+ return [2 /*return*/, {
645
+ type: 'button',
646
+ label: i18nRuntime.i18n("2f4aaddde33c9b93c36fd2503f3d122b"),
647
+ behavior: 'Delete',
648
+ className: 'm-r-xs text-danger',
649
+ level: 'link',
650
+ confirmText: i18nRuntime.i18n("ebf98d77b1a002935ad5c41446f257b3"),
651
+ onEvent: {
652
+ click: {
653
+ actions: [{
654
+ actionType: 'ajax',
655
+ api: deleteApi,
656
+ data: {
657
+ '&': '$$'
658
+ }
659
+ }, {
660
+ actionType: 'search',
661
+ groupType: 'component',
662
+ componentId: componentId
663
+ }]
664
+ }
665
+ }
666
+ }];
667
+ });
668
+ });
669
+ };
670
+ ApiDSBuilder.prototype.buildCRUDBulkDeleteSchema = function (options, componentId) {
671
+ return tslib.__awaiter(this, void 0, void 0, function () {
672
+ var scaffoldConfig, _a, bulkDeleteApi, _b, primaryField;
673
+ return tslib.__generator(this, function (_c) {
674
+ scaffoldConfig = (options || {}).scaffoldConfig;
675
+ _a = scaffoldConfig || {}, bulkDeleteApi = _a.bulkDeleteApi, _b = _a.primaryField, primaryField = _b === void 0 ? 'id' : _b;
676
+ return [2 /*return*/, {
677
+ type: 'button',
678
+ label: i18nRuntime.i18n("7fb62b30119c3797a843a48368463314"),
679
+ behavior: 'BulkDelete',
680
+ level: 'danger',
681
+ className: 'm-r-xs',
682
+ confirmText: i18nRuntime.i18n("d00d3377afe33a0f1b63293f3a3e3a79") + "\u300C${JOIN(ARRAYMAP(selectedItems, item => item.".concat(primaryField, "), ',')}\u300D"),
683
+ disabledOn: '${selectedItems != null && selectedItems.length < 1}',
684
+ onEvent: {
685
+ click: {
686
+ actions: [{
687
+ actionType: 'ajax',
688
+ api: bulkDeleteApi
689
+ }, {
690
+ actionType: 'search',
691
+ groupType: 'component',
692
+ componentId: componentId
693
+ }]
694
+ }
695
+ }
696
+ }];
697
+ });
698
+ });
699
+ };
700
+ ApiDSBuilder.prototype.buildSimpleQueryCollectionSchema = function (options) {
701
+ var _a;
702
+ return tslib.__awaiter(this, void 0, void 0, function () {
703
+ var _b, renderer, schema, simpleQueryFields, filter;
704
+ return tslib.__generator(this, function (_c) {
705
+ switch (_c.label) {
706
+ case 0:
707
+ _b = options || {}, renderer = _b.renderer, schema = _b.schema;
708
+ if (renderer !== 'crud') {
709
+ return [2 /*return*/];
710
+ }
711
+
712
+ simpleQueryFields = ((_a = schema === null || schema === void 0 ? void 0 : schema.columns) !== null && _a !== void 0 ? _a : []).filter(function (item) {
713
+ return item.type !== 'operation';
714
+ }).map(function (item) {
715
+ var _a, _b;
716
+ var inputType = item.type ? (_a = utils.displayType2inputType(item.type)) !== null && _a !== void 0 ? _a : 'input-text' : 'input-text';
717
+ return {
718
+ type: (_b = item.type) !== null && _b !== void 0 ? _b : 'input-text',
719
+ inputType: inputType,
720
+ name: item.name,
721
+ label: item.title,
722
+ size: 'full',
723
+ required: false,
724
+ behavior: 'SimpleQuery'
725
+ };
726
+ });
727
+ return [4 /*yield*/, this.buildCRUDFilterSchema(tslib.__assign(tslib.__assign({}, options), {
728
+ scaffoldConfig: {
729
+ dsType: this.key,
730
+ simpleQueryFields: simpleQueryFields
731
+ }
732
+ }), schema === null || schema === void 0 ? void 0 : schema.id)];
733
+ case 1:
734
+ filter = _c.sent();
735
+ return [2 /*return*/, filter.body];
736
+ }
737
+ });
738
+ });
739
+ };
740
+ ApiDSBuilder.prototype.buildCRUDFilterSchema = function (options, componentId) {
741
+ return tslib.__awaiter(this, void 0, void 0, function () {
742
+ var scaffoldConfig, simpleQueryFields, fields, formSchema;
743
+ var _this = this;
744
+ return tslib.__generator(this, function (_a) {
745
+ scaffoldConfig = (options || {}).scaffoldConfig;
746
+ simpleQueryFields = (scaffoldConfig || {}).simpleQueryFields;
747
+ fields = simpleQueryFields !== null && simpleQueryFields !== void 0 ? simpleQueryFields : [];
748
+ formSchema = {
749
+ type: 'form',
750
+ title: i18nRuntime.i18n("0943d61befec4c6cf2d21d170c9b066e"),
751
+ mode: 'inline',
752
+ columnCount: 3,
753
+ clearValueOnHidden: true,
754
+ behavior: ['SimpleQuery'],
755
+ body: fields.map(function (f) {
756
+ var _a;
757
+ var type = (_a = f.inputType) !== null && _a !== void 0 ? _a : 'input-text';
758
+ return tslib.__assign(tslib.__assign(tslib.__assign({}, pick__default["default"](f, ['name', 'label'])), {
759
+ type: type,
760
+ size: 'full',
761
+ required: false,
762
+ behavior: 'SimpleQuery'
763
+ }), _this.appendSchema2InputControl(type));
764
+ }),
765
+ actions: [{
766
+ type: 'reset',
767
+ label: i18nRuntime.i18n("4b9c3271dc2f299dc3aeffb369187513")
768
+ }, {
769
+ type: 'submit',
770
+ label: i18nRuntime.i18n("bee912d79eefb7335988c4997aa9138d"),
771
+ level: 'primary'
772
+ }]
773
+ };
774
+ return [2 /*return*/, formSchema];
775
+ });
776
+ });
777
+ };
778
+ ApiDSBuilder.prototype.buildCRUDOpColumn = function (options, componentId) {
779
+ return tslib.__awaiter(this, void 0, void 0, function () {
780
+ var feats, buttons, _a, _b, _c, _d, _e, _f;
781
+ return tslib.__generator(this, function (_g) {
782
+ switch (_g.label) {
783
+ case 0:
784
+ feats = (options || {}).feats;
785
+ buttons = [];
786
+ if (!(feats === null || feats === void 0 ? void 0 : feats.includes('View'))) return [3 /*break*/, 2];
787
+ _b = (_a = buttons).push;
788
+ return [4 /*yield*/, this.buildViewSchema(options, componentId)];
789
+ case 1:
790
+ _b.apply(_a, [_g.sent()]);
791
+ _g.label = 2;
792
+ case 2:
793
+ if (!(feats === null || feats === void 0 ? void 0 : feats.includes('Edit'))) return [3 /*break*/, 4];
794
+ _d = (_c = buttons).push;
795
+ return [4 /*yield*/, this.buildEditSchema(options, componentId)];
796
+ case 3:
797
+ _d.apply(_c, [_g.sent()]);
798
+ _g.label = 4;
799
+ case 4:
800
+ if (!(feats === null || feats === void 0 ? void 0 : feats.includes('Delete'))) return [3 /*break*/, 6];
801
+ _f = (_e = buttons).push;
802
+ return [4 /*yield*/, this.buildCRUDDeleteSchema(options, componentId)];
803
+ case 5:
804
+ _f.apply(_e, [_g.sent()]);
805
+ _g.label = 6;
806
+ case 6:
807
+ return [2 /*return*/, {
808
+ type: 'operation',
809
+ title: i18nRuntime.i18n("2b6bc0f293f5ca01b006206c2535ccbc"),
810
+ buttons: buttons
811
+ }];
812
+ }
813
+ });
814
+ });
815
+ };
816
+ ApiDSBuilder.prototype.buildCRUDColumn = function (field, options, componentId) {
817
+ return tslib.__awaiter(this, void 0, void 0, function () {
818
+ return tslib.__generator(this, function (_a) {
819
+ return [2 /*return*/, {
820
+ type: field.displayType,
821
+ title: field.label,
822
+ name: field.name
823
+ /** 绑定列值, 似乎不需要 */
824
+ // [f.typeKey || 'value']: `\${f.key}`
825
+ }];
826
+ });
827
+ });
828
+ };
829
+
830
+ ApiDSBuilder.prototype.buildCRUDColumnsSchema = function (options, componentId) {
831
+ return tslib.__awaiter(this, void 0, void 0, function () {
832
+ var scaffoldConfig, listFields, fields, opColumn, columns;
833
+ var _this = this;
834
+ return tslib.__generator(this, function (_a) {
835
+ switch (_a.label) {
836
+ case 0:
837
+ scaffoldConfig = options.scaffoldConfig;
838
+ listFields = (scaffoldConfig || {}).listFields;
839
+ fields = listFields !== null && listFields !== void 0 ? listFields : [];
840
+ return [4 /*yield*/, this.buildCRUDOpColumn(options, componentId)];
841
+ case 1:
842
+ opColumn = _a.sent();
843
+ return [4 /*yield*/, Promise.all(fields.map(function (f) {
844
+ return tslib.__awaiter(_this, void 0, void 0, function () {
845
+ return tslib.__generator(this, function (_a) {
846
+ return [2 /*return*/, this.buildCRUDColumn(f, options, componentId)];
847
+ });
848
+ });
849
+ }))];
850
+ case 2:
851
+ columns = _a.sent().filter(Boolean);
852
+ return [2 /*return*/, tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(columns), false), tslib.__read(opColumn.buttons.length !== 0 ? [opColumn] : []), false)];
853
+ }
854
+ });
855
+ });
856
+ };
857
+ ApiDSBuilder.prototype.buildToolbarContainer = function (align, body, behaviors) {
858
+ if (body === void 0) {
859
+ body = [];
860
+ }
861
+ body = Array.isArray(body) ? body : [body];
862
+ return tslib.__assign(tslib.__assign({
863
+ type: 'container',
864
+ align: align
865
+ }, behaviors ? {
866
+ behavior: behaviors
867
+ } : {}), {
868
+ body: Array.isArray(body) ? body : [body],
869
+ wrapperBody: false,
870
+ style: tslib.__assign({
871
+ flexGrow: 1,
872
+ flex: '1 1 auto',
873
+ position: 'static',
874
+ display: 'flex',
875
+ flexBasis: 'auto',
876
+ flexDirection: 'row',
877
+ flexWrap: 'nowrap',
878
+ alignItems: 'stretch'
879
+ }, align ? {
880
+ justifyContent: align === 'left' ? 'flex-start' : 'flex-end'
881
+ } : {})
882
+ });
883
+ };
884
+ ApiDSBuilder.prototype.buildToolbarFlex = function (position, left, right) {
885
+ return [{
886
+ type: 'flex',
887
+ direction: 'row',
888
+ justify: 'flex-start',
889
+ alignItems: 'stretch',
890
+ style: {
891
+ position: 'static'
892
+ },
893
+ items: [this.buildToolbarContainer('left', left, position === 'header' ? [constants.DSFeatureEnum.Insert, constants.DSFeatureEnum.BulkEdit, constants.DSFeatureEnum.BulkDelete] : undefined), this.buildToolbarContainer('right', right, position === 'header' ? [constants.DSFeatureEnum.FuzzyQuery] : undefined)].filter(Boolean)
894
+ }];
895
+ };
896
+ ApiDSBuilder.prototype.buildHeaderToolbar = function (options, componentId) {
897
+ return tslib.__awaiter(this, void 0, void 0, function () {
898
+ var feats, collection, _a, _b, _c, _d, _e, _f;
899
+ return tslib.__generator(this, function (_g) {
900
+ switch (_g.label) {
901
+ case 0:
902
+ feats = (options || {}).feats;
903
+ collection = [];
904
+ if (!(feats === null || feats === void 0 ? void 0 : feats.includes('Insert'))) return [3 /*break*/, 2];
905
+ _b = (_a = collection).push;
906
+ return [4 /*yield*/, this.buildInsertSchema(options, componentId)];
907
+ case 1:
908
+ _b.apply(_a, [_g.sent()]);
909
+ _g.label = 2;
910
+ case 2:
911
+ if (!(feats === null || feats === void 0 ? void 0 : feats.includes('BulkEdit'))) return [3 /*break*/, 4];
912
+ _d = (_c = collection).push;
913
+ return [4 /*yield*/, this.buildBulkEditSchema(options, componentId)];
914
+ case 3:
915
+ _d.apply(_c, [_g.sent()]);
916
+ _g.label = 4;
917
+ case 4:
918
+ if (!(feats === null || feats === void 0 ? void 0 : feats.includes('BulkDelete'))) return [3 /*break*/, 6];
919
+ _f = (_e = collection).push;
920
+ return [4 /*yield*/, this.buildCRUDBulkDeleteSchema(options, componentId)];
921
+ case 5:
922
+ _f.apply(_e, [_g.sent()]);
923
+ _g.label = 6;
924
+ case 6:
925
+ return [2 /*return*/, this.buildToolbarFlex('header', collection, [])];
926
+ }
927
+ });
928
+ });
929
+ };
930
+ ApiDSBuilder.prototype.buildFooterToolbar = function (options, componentId) {
931
+ return this.buildToolbarFlex('footer', [], [{
932
+ type: 'pagination',
933
+ behavior: 'Pagination',
934
+ layout: ['total', 'perPage', 'pager'],
935
+ perPage: 10,
936
+ perPageAvailable: [10, 20, 50, 100],
937
+ align: 'right'
938
+ }]);
939
+ };
940
+ ApiDSBuilder.prototype.guessFormScaffoldConfig = function (options) {
941
+ var _a, _b;
942
+ var _c, _d;
943
+ var schema = (options || {}).schema;
944
+ var dsType = this.key;
945
+ if (!schema.dsType || schema.dsType !== dsType) {
946
+ return {
947
+ dsType: dsType
948
+ };
949
+ }
950
+ var feat = (_c = schema === null || schema === void 0 ? void 0 : schema.feat) !== null && _c !== void 0 ? _c : 'Insert';
951
+ /** 表单操作 */
952
+ var operators = ((_d = schema.actions) !== null && _d !== void 0 ? _d : []).map(function (item) {
953
+ var opValue = get__default["default"](item, 'onEvent.click.actions[0].actionType');
954
+ if (typeof opValue === 'string' && opValue && ['submit', 'reset', 'cancel'].includes(opValue)) {
955
+ return constants.FormOperatorMap[opValue];
956
+ }
957
+ return undefined;
958
+ }).filter(Boolean);
959
+ var featValue = this.getFeatValueByKey(feat);
960
+ var fieldKey = featValue ? "".concat(featValue, "Fields") : '';
961
+ var apiKey = featValue ? "".concat(featValue, "Api") : '';
962
+ var fields = (Array.isArray(schema === null || schema === void 0 ? void 0 : schema.body) ? schema.body : [schema.body]).map(function (item) {
963
+ if (!item) {
964
+ return false;
965
+ }
966
+ return {
967
+ name: item.name,
968
+ label: item.label,
969
+ displayType: 'tpl' /** 对于form这个属性没用 */,
970
+ inputType: item.type
971
+ };
972
+ }).filter(function (f) {
973
+ return f != null;
974
+ });
975
+ var config = tslib.__assign(tslib.__assign(tslib.__assign(tslib.__assign({
976
+ feat: feat,
977
+ dsType: dsType
978
+ }, fieldKey ? (_a = {}, _a[fieldKey] = fields, _a) : {}), apiKey ? (_b = {}, _b[apiKey] = amisEditorCore.JSONPipeOut(schema === null || schema === void 0 ? void 0 : schema.api), _b) : {}), feat === 'Edit' || schema.initApi != null ? {
979
+ initApi: amisEditorCore.JSONPipeOut(schema === null || schema === void 0 ? void 0 : schema.initApi)
980
+ } : {}), {
981
+ operators: operators.length < 1 ? [constants.FormOperatorMap['cancel'], constants.FormOperatorMap['submit']] : operators,
982
+ __pristineSchema: omit__default["default"](amisEditorCore.JSONPipeOut(schema), tslib.__spreadArray([], tslib.__read(Object.values(constants.DSFeature).map(function (item) {
983
+ return "".concat(item.value, "Fields");
984
+ })), false))
985
+ });
986
+ return config;
987
+ };
988
+ ApiDSBuilder.prototype.guessCRUDScaffoldConfig = function (options) {
989
+ var _a;
990
+ var schema = (options || {}).schema;
991
+ var dsType = this.key;
992
+ if (!schema.dsType || schema.dsType !== dsType) {
993
+ return {
994
+ dsType: dsType,
995
+ primaryField: 'id'
996
+ };
997
+ }
998
+ var listFields = (Array.isArray(schema === null || schema === void 0 ? void 0 : schema.columns) ? schema.columns : [schema.columns]).filter(function (item) {
999
+ return item.type !== 'operation';
1000
+ }).map(function (item) {
1001
+ if (!item) {
1002
+ return;
1003
+ }
1004
+ return {
1005
+ name: item.name,
1006
+ label: item.title,
1007
+ displayType: item.type,
1008
+ inputType: 'input-text' /** 对于CRUD这个属性没用 */
1009
+ };
1010
+ }).filter(function (f) {
1011
+ return f != null;
1012
+ });
1013
+ var viewFields = [];
1014
+ var viewApi;
1015
+ var insertFields = [];
1016
+ var insertApi;
1017
+ var editFields = [];
1018
+ var editApi;
1019
+ var bulkEditFields = [];
1020
+ var bulkEditApi;
1021
+ var simpleQueryFields = [];
1022
+ var bulkDeleteApi;
1023
+ var deleteApi;
1024
+ /** 已开启特性 */
1025
+ var feats = [];
1026
+ var collectFormFields = function (body) {
1027
+ return body.map(function (item) {
1028
+ var _a;
1029
+ return tslib.__assign(tslib.__assign({}, pick__default["default"](item, ['name', 'label'])), {
1030
+ inputType: (_a = item.type) !== null && _a !== void 0 ? _a : 'input-text',
1031
+ displayType: 'tpl'
1032
+ });
1033
+ });
1034
+ };
1035
+ utils.traverseSchemaDeep(schema, function (key, value, host) {
1036
+ var _a, _b, _c, _d, _e;
1037
+ if (key === 'feat') {
1038
+ if (value === 'Insert') {
1039
+ feats.push('Insert');
1040
+ insertFields = collectFormFields((_a = host === null || host === void 0 ? void 0 : host.body) !== null && _a !== void 0 ? _a : []);
1041
+ insertApi = host === null || host === void 0 ? void 0 : host.api;
1042
+ } else if (value === 'Edit') {
1043
+ feats.push('Edit');
1044
+ editFields = collectFormFields((_b = host === null || host === void 0 ? void 0 : host.body) !== null && _b !== void 0 ? _b : []);
1045
+ editApi = host === null || host === void 0 ? void 0 : host.api;
1046
+ } else if (value === 'BulkEdit') {
1047
+ feats.push('BulkEdit');
1048
+ bulkEditFields = collectFormFields((_c = host === null || host === void 0 ? void 0 : host.body) !== null && _c !== void 0 ? _c : []);
1049
+ bulkEditApi = host === null || host === void 0 ? void 0 : host.api;
1050
+ } else if (value === 'View') {
1051
+ feats.push('View');
1052
+ viewFields = collectFormFields((_d = host === null || host === void 0 ? void 0 : host.body) !== null && _d !== void 0 ? _d : []);
1053
+ viewApi = host === null || host === void 0 ? void 0 : host.initApi;
1054
+ }
1055
+ }
1056
+ if (key === 'behavior') {
1057
+ if (value === 'BulkDelete') {
1058
+ feats.push('BulkDelete');
1059
+ var actions = get__default["default"](host, 'onEvent.click.actions', []);
1060
+ var actionSchema = actions.find(function (action) {
1061
+ var _a;
1062
+ return (action === null || action === void 0 ? void 0 : action.actionType) === 'ajax' && ((action === null || action === void 0 ? void 0 : action.api) != null || ((_a = action === null || action === void 0 ? void 0 : action.args) === null || _a === void 0 ? void 0 : _a.api) != null);
1063
+ });
1064
+ bulkDeleteApi = get__default["default"](actionSchema, 'api', '') || get__default["default"](actionSchema, 'args.api', '');
1065
+ } else if (value === 'Delete') {
1066
+ feats.push('Delete');
1067
+ var actions = get__default["default"](host, 'onEvent.click.actions', []);
1068
+ var actionSchema = actions.find(function (action) {
1069
+ var _a;
1070
+ return (action === null || action === void 0 ? void 0 : action.actionType) === 'ajax' && ((action === null || action === void 0 ? void 0 : action.api) != null || ((_a = action === null || action === void 0 ? void 0 : action.args) === null || _a === void 0 ? void 0 : _a.api) != null);
1071
+ });
1072
+ deleteApi = get__default["default"](actionSchema, 'api', '') || get__default["default"](actionSchema, 'args.api', '');
1073
+ } else if (Array.isArray(value) && value.includes('SimpleQuery')) {
1074
+ feats.push('SimpleQuery');
1075
+ simpleQueryFields = ((_e = host === null || host === void 0 ? void 0 : host.body) !== null && _e !== void 0 ? _e : []).map(function (item) {
1076
+ var _a;
1077
+ return tslib.__assign(tslib.__assign({}, pick__default["default"](item, ['name', 'label'])), {
1078
+ inputType: (_a = item.type) !== null && _a !== void 0 ? _a : 'input-text',
1079
+ isplayType: 'tpl'
1080
+ });
1081
+ });
1082
+ }
1083
+ }
1084
+ return [key, value];
1085
+ });
1086
+ var finalFeats = uniq__default["default"](feats);
1087
+ var config = {
1088
+ dsType: dsType,
1089
+ tools: intersection__default["default"](finalFeats, [constants.DSFeatureEnum.Insert, constants.DSFeatureEnum.BulkDelete, constants.DSFeatureEnum.BulkEdit]),
1090
+ /** 数据操作 */
1091
+ operators: intersection__default["default"](finalFeats, [constants.DSFeatureEnum.View, constants.DSFeatureEnum.Edit, constants.DSFeatureEnum.Delete]),
1092
+ /** 条件查询 */
1093
+ filters: intersection__default["default"](finalFeats, [constants.DSFeatureEnum.FuzzyQuery, constants.DSFeatureEnum.SimpleQuery, constants.DSFeatureEnum.AdvancedQuery]),
1094
+ listFields: listFields,
1095
+ listApi: amisEditorCore.JSONPipeOut(schema === null || schema === void 0 ? void 0 : schema.api),
1096
+ viewFields: viewFields,
1097
+ viewApi: amisEditorCore.JSONPipeOut(viewApi),
1098
+ insertFields: insertFields,
1099
+ insertApi: amisEditorCore.JSONPipeOut(insertApi),
1100
+ editFields: editFields,
1101
+ editApi: amisEditorCore.JSONPipeOut(editApi),
1102
+ bulkEditFields: bulkEditFields,
1103
+ bulkEditApi: amisEditorCore.JSONPipeOut(bulkEditApi),
1104
+ deleteApi: amisEditorCore.JSONPipeOut(deleteApi),
1105
+ bulkDeleteApi: amisEditorCore.JSONPipeOut(bulkDeleteApi),
1106
+ simpleQueryFields: simpleQueryFields,
1107
+ primaryField: (_a = schema === null || schema === void 0 ? void 0 : schema.primaryField) !== null && _a !== void 0 ? _a : 'id',
1108
+ __pristineSchema: omit__default["default"](amisEditorCore.JSONPipeOut(schema), tslib.__spreadArray([], tslib.__read(Object.values(constants.DSFeature).map(function (item) {
1109
+ return "".concat(item.value, "Fields");
1110
+ })), false))
1111
+ };
1112
+ return config;
1113
+ };
1114
+ ApiDSBuilder.prototype.buildCRUDSchema = function (options) {
1115
+ return tslib.__awaiter(this, void 0, void 0, function () {
1116
+ var feats, scaffoldConfig, _a, _b, primaryField, listApi, editApi, bulkEditApi, enableBulkEdit, enableBulkDelete, enableEdit, enableMultiple, id, _c, _d, _e;
1117
+ var _f, _g;
1118
+ return tslib.__generator(this, function (_h) {
1119
+ switch (_h.label) {
1120
+ case 0:
1121
+ feats = options.feats, scaffoldConfig = options.scaffoldConfig;
1122
+ _a = scaffoldConfig || {}, _b = _a.primaryField, primaryField = _b === void 0 ? 'id' : _b, listApi = _a.listApi, editApi = _a.editApi, bulkEditApi = _a.bulkEditApi;
1123
+ enableBulkEdit = feats === null || feats === void 0 ? void 0 : feats.includes('BulkEdit');
1124
+ enableBulkDelete = feats === null || feats === void 0 ? void 0 : feats.includes('BulkDelete');
1125
+ enableEdit = feats === null || feats === void 0 ? void 0 : feats.includes('Edit');
1126
+ enableMultiple = enableBulkEdit || enableBulkDelete;
1127
+ id = amisEditorCore.generateNodeId();
1128
+ _c = [tslib.__assign(tslib.__assign(tslib.__assign(tslib.__assign({
1129
+ id: id,
1130
+ type: 'crud2',
1131
+ mode: 'table2',
1132
+ dsType: this.key,
1133
+ syncLocation: true
1134
+ }, enableMultiple ? {
1135
+ selectable: true,
1136
+ multiple: true
1137
+ } : {}), {
1138
+ primaryField: primaryField,
1139
+ loadType: 'pagination',
1140
+ api: listApi
1141
+ }), enableBulkEdit ? {
1142
+ quickSaveApi: bulkEditApi
1143
+ } : {}), enableEdit ? {
1144
+ quickSaveItemApi: editApi
1145
+ } : {})];
1146
+ if (!(feats === null || feats === void 0 ? void 0 : feats.includes(constants.DSFeatureEnum.SimpleQuery))) return [3 /*break*/, 2];
1147
+ _f = {};
1148
+ return [4 /*yield*/, this.buildCRUDFilterSchema(options, id)];
1149
+ case 1:
1150
+ _d = (_f.filter = _h.sent(), _f);
1151
+ return [3 /*break*/, 3];
1152
+ case 2:
1153
+ _d = {};
1154
+ _h.label = 3;
1155
+ case 3:
1156
+ _e = [tslib.__assign.apply(void 0, _c.concat([_d]))];
1157
+ _g = {};
1158
+ return [4 /*yield*/, this.buildHeaderToolbar(options, id)];
1159
+ case 4:
1160
+ _g.headerToolbar = _h.sent(), _g.footerToolbar = this.buildFooterToolbar(options, id);
1161
+ return [4 /*yield*/, this.buildCRUDColumnsSchema(options, id)];
1162
+ case 5:
1163
+ /** 暂时不考虑 cards 和 list */
1164
+ return [2 /*return*/, tslib.__assign.apply(void 0, _e.concat([(_g.columns = _h.sent(), _g)]))];
1165
+ }
1166
+ });
1167
+ });
1168
+ };
1169
+ ApiDSBuilder.prototype.buildFormSchema = function (options) {
1170
+ var _a;
1171
+ return tslib.__awaiter(this, void 0, void 0, function () {
1172
+ var feat, scaffoldConfig, _b, initApi, __pristineSchema, formSchema, id, baseSchema;
1173
+ return tslib.__generator(this, function (_c) {
1174
+ switch (_c.label) {
1175
+ case 0:
1176
+ feat = options.feat, scaffoldConfig = options.scaffoldConfig;
1177
+ _b = scaffoldConfig || {}, initApi = _b.initApi, __pristineSchema = _b.__pristineSchema;
1178
+ id = (_a = __pristineSchema === null || __pristineSchema === void 0 ? void 0 : __pristineSchema.id) !== null && _a !== void 0 ? _a : amisEditorCore.generateNodeId();
1179
+ if (!(feat === 'Insert')) return [3 /*break*/, 2];
1180
+ return [4 /*yield*/, this.buildInsertSchema(options, id)];
1181
+ case 1:
1182
+ formSchema = _c.sent();
1183
+ return [3 /*break*/, 6];
1184
+ case 2:
1185
+ if (!(feat === 'Edit')) return [3 /*break*/, 4];
1186
+ return [4 /*yield*/, this.buildEditSchema(options, id)];
1187
+ case 3:
1188
+ formSchema = _c.sent();
1189
+ return [3 /*break*/, 6];
1190
+ case 4:
1191
+ return [4 /*yield*/, this.buildBulkEditSchema(options, id)];
1192
+ case 5:
1193
+ formSchema = _c.sent();
1194
+ _c.label = 6;
1195
+ case 6:
1196
+ baseSchema = tslib.__assign(tslib.__assign(tslib.__assign({}, formSchema), feat === 'Edit' ? {
1197
+ initApi: initApi
1198
+ } : {}), {
1199
+ dsType: this.key
1200
+ });
1201
+ if (__pristineSchema && amisCore.isObject(__pristineSchema)) {
1202
+ return [2 /*return*/, tslib.__assign(tslib.__assign(tslib.__assign({}, __pristineSchema), baseSchema), {
1203
+ id: id
1204
+ })];
1205
+ }
1206
+ return [2 /*return*/, baseSchema];
1207
+ }
1208
+ });
1209
+ });
1210
+ };
1211
+ ApiDSBuilder.prototype.buildApiSchema = function (options) {
1212
+ return tslib.__awaiter(this, void 0, void 0, function () {
1213
+ var schema;
1214
+ return tslib.__generator(this, function (_a) {
1215
+ schema = options.schema;
1216
+ return [2 /*return*/, schema];
1217
+ });
1218
+ });
1219
+ };
1220
+ ApiDSBuilder.key = 'api';
1221
+ return ApiDSBuilder;
1222
+ }(DSBuilder.DSBuilder);
1223
+ DSBuilder.registerDSBuilder(ApiDSBuilder);
1224
+
1225
+ exports.ApiDSBuilder = ApiDSBuilder;
1226
+ window.amisEditorVersionInfo={version:'5.5.2-beta.2',buildTime:'2023-09-28'};