@luck-design-biz/luckda 0.0.24-2 → 0.0.25-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (480) hide show
  1. package/es/components/Builder/index.js +6 -4
  2. package/es/components/IconFont/index.js +5 -0
  3. package/es/components/LDActions/index.js +133 -0
  4. package/es/components/LDActions/index.less +65 -0
  5. package/es/components/LdAutoForm/index.js +1 -1
  6. package/es/components/LdCom/index.js +2 -1
  7. package/es/components/LdFormList/index.js +15 -10
  8. package/es/components/LdGrid/index.js +14 -8
  9. package/es/components/LdGridForm/index.js +5 -4
  10. package/es/components/LdRuntimeCom/index.js +20 -7
  11. package/es/components/LdTree/index.js +112 -31
  12. package/es/components/LdTree/index.less +6 -1
  13. package/es/helper/ldBuilder.js +28 -12
  14. package/es/helper/ldComBuild.js +29 -14
  15. package/es/index.js +1 -0
  16. package/es/locales/zh-CN.js +230 -0
  17. package/es/lowcode/constants/api-url.js +464 -262
  18. package/es/lowcode/constants/event-topics.js +4 -0
  19. package/es/lowcode/constants/index.js +31 -2
  20. package/es/lowcode/engine/factory/panel-item-factory/CheckboxStrategy.js +32 -0
  21. package/es/lowcode/engine/factory/panel-item-factory/index.js +2 -0
  22. package/es/lowcode/engine/meta/box.props.default.json +4 -3
  23. package/es/lowcode/engine/meta/box.props.json +2 -4
  24. package/es/lowcode/engine/meta/button.props.default.json +5 -2
  25. package/es/lowcode/engine/meta/button.props.json +9 -9
  26. package/es/lowcode/engine/meta/cardlist.props.default.json +4 -2
  27. package/es/lowcode/engine/meta/cardlist.props.json +2 -3
  28. package/es/lowcode/engine/meta/components-list.json +1 -1
  29. package/es/lowcode/engine/meta/dialog.props.default.json +4 -2
  30. package/es/lowcode/engine/meta/dialog.props.json +1 -2
  31. package/es/lowcode/engine/meta/drawer.props.default.json +4 -2
  32. package/es/lowcode/engine/meta/drawer.props.json +1 -2
  33. package/es/lowcode/engine/meta/form.props.default.json +52 -4
  34. package/es/lowcode/engine/meta/form.props.json +596 -64
  35. package/es/lowcode/engine/meta/iframe.props.default.json +1 -1
  36. package/es/lowcode/engine/meta/iframe.props.json +1 -1
  37. package/es/lowcode/engine/meta/image.props.default.json +5 -2
  38. package/es/lowcode/engine/meta/image.props.json +3 -3
  39. package/es/lowcode/engine/meta/imex.props.default.json +5 -2
  40. package/es/lowcode/engine/meta/imex.props.json +2 -2
  41. package/es/lowcode/engine/meta/js-editor/auto-complete.json +152 -26
  42. package/es/lowcode/engine/meta/jsx.props.default.json +2 -1
  43. package/es/lowcode/engine/meta/jsx.props.json +10 -5
  44. package/es/lowcode/engine/meta/layout.props.default.json +5 -2
  45. package/es/lowcode/engine/meta/layout.props.json +1 -2
  46. package/es/lowcode/engine/meta/link.props.default.json +5 -2
  47. package/es/lowcode/engine/meta/link.props.json +3 -3
  48. package/es/lowcode/engine/meta/local/local.zh-cn.js +97 -0
  49. package/es/lowcode/engine/meta/page.props.default.json +12 -0
  50. package/es/lowcode/engine/meta/page.props.json +49 -0
  51. package/es/lowcode/engine/meta/pagecontent.props.default.json +6 -0
  52. package/es/lowcode/engine/meta/pagecontent.props.json +7 -0
  53. package/es/lowcode/engine/meta/pagefooter.props.default.json +6 -0
  54. package/es/lowcode/engine/meta/pagefooter.props.json +7 -0
  55. package/es/lowcode/engine/meta/pageheader.props.default.json +6 -0
  56. package/es/lowcode/engine/meta/pageheader.props.json +7 -0
  57. package/es/lowcode/engine/meta/section.props.default.json +7 -6
  58. package/es/lowcode/engine/meta/section.props.json +52 -49
  59. package/es/lowcode/engine/meta/split.props.default.json +9 -4
  60. package/es/lowcode/engine/meta/split.props.json +14 -29
  61. package/es/lowcode/engine/meta/table.props.default.json +23 -3
  62. package/es/lowcode/engine/meta/table.props.json +257 -55
  63. package/es/lowcode/engine/meta/tabs.props.default.json +16 -9
  64. package/es/lowcode/engine/meta/tabs.props.json +57 -81
  65. package/es/lowcode/engine/meta/text.props.default.json +5 -2
  66. package/es/lowcode/engine/meta/text.props.json +3 -3
  67. package/es/lowcode/engine/meta/tree.props.default.json +20 -7
  68. package/es/lowcode/engine/meta/tree.props.json +225 -79
  69. package/es/lowcode/engine/provider/ContextProvider/index.js +177 -0
  70. package/es/lowcode/engine/provider/RemoteSourceProvider.js +174 -0
  71. package/es/lowcode/engine/tools/dataProcess.js +64 -2
  72. package/es/lowcode/engine/tools/helper.js +97 -18
  73. package/es/lowcode/engine/tools/useCanvasRender.js +73 -0
  74. package/es/lowcode/engine/tools/usePromiseState.js +23 -12
  75. package/es/lowcode/engine/tools/useTodo.js +78 -0
  76. package/es/lowcode/index.js +1 -0
  77. package/es/lowcode/painter/Components.js +47 -21
  78. package/es/lowcode/painter/Design.js +34 -2
  79. package/es/lowcode/painter/DesignOperator.js +48 -31
  80. package/es/lowcode/painter/DesignToolbar.js +324 -16
  81. package/es/lowcode/painter/I18n.js +2 -2
  82. package/es/lowcode/painter/Outline.js +31 -26
  83. package/es/lowcode/painter/Panel.js +99 -142
  84. package/es/lowcode/painter/Ribbon.js +1 -1
  85. package/es/lowcode/painter/components/ActionBindModal.js +293 -0
  86. package/es/lowcode/painter/components/AdvancePanel.js +140 -0
  87. package/es/lowcode/painter/components/AttrsPanel.js +145 -0
  88. package/es/lowcode/painter/components/Collapse.js +20 -9
  89. package/es/lowcode/painter/components/ColorInput.js +5 -3
  90. package/es/lowcode/painter/components/DragDrop/DragDropContext.js +137 -0
  91. package/es/lowcode/painter/components/DragDrop/DragDropWrapper.js +50 -0
  92. package/es/lowcode/painter/components/DragDrop/Overlay.js +8 -0
  93. package/es/lowcode/painter/components/DragDrop/TreeDragDropWrapper.js +67 -0
  94. package/es/lowcode/painter/components/FieldSelector.js +44 -0
  95. package/es/lowcode/painter/components/ListEditor.js +26 -11
  96. package/es/lowcode/painter/components/PanelItem.js +1 -1
  97. package/es/lowcode/painter/components/PopConfirm.js +10 -3
  98. package/es/lowcode/painter/components/SortBox.js +11 -4
  99. package/es/lowcode/painter/components/TreeEditor.js +13 -0
  100. package/es/lowcode/painter/components/code-editor/BaseEditor.js +14 -2
  101. package/es/lowcode/painter/components/code-editor/JSEditor.js +25 -14
  102. package/es/lowcode/painter/components/code-editor/JsonEditor.js +41 -0
  103. package/es/lowcode/painter/components/field-setting/BatchSetting.js +154 -0
  104. package/es/lowcode/painter/components/field-setting/CheckRules.js +126 -0
  105. package/es/lowcode/painter/components/field-setting/FieldAttrs.js +287 -0
  106. package/es/lowcode/painter/components/field-setting/FieldAttrsModal.js +290 -0
  107. package/es/lowcode/painter/components/field-setting/FieldDefaultValue.js +63 -0
  108. package/es/lowcode/painter/components/field-setting/FieldRulesModal.js +116 -0
  109. package/es/lowcode/painter/components/field-setting/SettingUI.js +438 -0
  110. package/es/lowcode/painter/components/field-setting/index.js +373 -0
  111. package/es/lowcode/painter/index.js +3 -28
  112. package/es/lowcode/painter/panel-section/ActionsColumnWidth.js +25 -0
  113. package/es/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +101 -0
  114. package/es/lowcode/painter/{components/actions-editor → panel-section/ActionsEditor}/index.js +74 -13
  115. package/es/lowcode/painter/panel-section/BlockEditor/index.js +27 -0
  116. package/es/lowcode/painter/panel-section/BlocksEditor/BlockEditorItem.js +45 -0
  117. package/es/lowcode/painter/panel-section/BlocksEditor/index.js +235 -0
  118. package/es/lowcode/painter/panel-section/DataSetSelector.js +115 -43
  119. package/es/lowcode/painter/panel-section/FieldsSetting.js +329 -0
  120. package/es/lowcode/painter/panel-section/I18nInput.js +20 -0
  121. package/es/lowcode/painter/panel-section/Icon.js +14 -14
  122. package/es/lowcode/painter/panel-section/IconConditionSelector.js +111 -0
  123. package/es/lowcode/painter/panel-section/IconSelector.js +5 -2
  124. package/es/lowcode/painter/panel-section/ImpExp.js +91 -0
  125. package/es/lowcode/painter/panel-section/JSEditor.js +49 -0
  126. package/es/lowcode/painter/panel-section/LayoutRatio.js +6 -7
  127. package/es/lowcode/painter/panel-section/SerialsSelector.js +44 -0
  128. package/es/lowcode/painter/panel-section/SplitDisplay.js +248 -0
  129. package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
  130. package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +2 -22
  131. package/es/lowcode/painter/panel-section/TabItems.js +46 -30
  132. package/es/lowcode/painter/panel-section/TableTopFilter.js +306 -0
  133. package/es/lowcode/painter/panel-section/TableZebra.js +66 -6
  134. package/es/lowcode/painter/panel-section/TreeRootEditor.js +78 -0
  135. package/es/lowcode/painter/style/action-bind-modal.less +102 -0
  136. package/es/lowcode/painter/style/collapse.less +6 -0
  137. package/es/lowcode/painter/style/components.less +5 -4
  138. package/es/lowcode/painter/style/design.less +7 -4
  139. package/es/lowcode/painter/style/dragdrop.less +10 -0
  140. package/es/lowcode/painter/style/fields-setting.less +25 -0
  141. package/es/lowcode/painter/style/impexp.less +7 -0
  142. package/es/lowcode/painter/style/list-editor.less +36 -0
  143. package/es/lowcode/painter/style/panel-attrs.less +43 -0
  144. package/es/lowcode/painter/style/panel.less +6 -37
  145. package/es/lowcode/painter/style/pop-confirm.less +9 -2
  146. package/es/lowcode/painter/style/split-display.less +28 -0
  147. package/es/lowcode/painter/style/treedragdrop.less +19 -0
  148. package/es/lowcode/preview/index.js +27 -0
  149. package/es/lowcode/view/Canvas.js +34 -139
  150. package/es/lowcode/view/Loading.js +6 -2
  151. package/es/lowcode/view/Page.js +16 -14
  152. package/es/lowcode/view/lc-components/Box/FunctionPreview.js +9 -0
  153. package/es/lowcode/view/lc-components/Box/index.js +11 -2
  154. package/es/lowcode/view/lc-components/Box/index.less +0 -1
  155. package/es/lowcode/view/lc-components/Box/meta.json +2 -4
  156. package/es/lowcode/view/lc-components/Button/FunctionDesign.js +8 -10
  157. package/es/lowcode/view/lc-components/Button/FunctionLive.js +3 -6
  158. package/es/lowcode/view/lc-components/Button/FunctionPreview.js +6 -0
  159. package/es/lowcode/view/lc-components/Button/index.js +43 -20
  160. package/es/lowcode/view/lc-components/Button/meta.json +9 -9
  161. package/es/lowcode/view/lc-components/CardList/FunctionPreview.js +9 -0
  162. package/es/lowcode/view/lc-components/CardList/index.js +1 -0
  163. package/es/lowcode/view/lc-components/CardList/meta.json +2 -3
  164. package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +16 -24
  165. package/es/lowcode/view/lc-components/Dialog/FunctionPreview.js +9 -0
  166. package/es/lowcode/view/lc-components/Dialog/index.js +1 -0
  167. package/es/lowcode/view/lc-components/Dialog/meta.json +1 -2
  168. package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +4 -2
  169. package/es/lowcode/view/lc-components/Drawer/FunctionPreview.js +9 -0
  170. package/es/lowcode/view/lc-components/Drawer/index.js +17 -0
  171. package/es/lowcode/view/lc-components/Drawer/index.less +3 -0
  172. package/es/lowcode/view/lc-components/Drawer/meta.json +1 -2
  173. package/es/lowcode/view/lc-components/Form/FunctionDesign.js +93 -2
  174. package/es/lowcode/view/lc-components/Form/FunctionPreview.js +9 -0
  175. package/es/lowcode/view/lc-components/Form/index.js +290 -13
  176. package/es/lowcode/view/lc-components/Form/index.less +5 -0
  177. package/es/lowcode/view/lc-components/Form/meta.json +546 -64
  178. package/es/lowcode/view/lc-components/Iframe/FunctionPreview.js +9 -0
  179. package/es/lowcode/view/lc-components/Iframe/index.js +1 -0
  180. package/es/lowcode/view/lc-components/Iframe/meta.json +1 -1
  181. package/es/lowcode/view/lc-components/ImEx/FunctionPreview.js +9 -0
  182. package/es/lowcode/view/lc-components/ImEx/index.js +1 -0
  183. package/es/lowcode/view/lc-components/ImEx/meta.json +2 -2
  184. package/es/lowcode/view/lc-components/Image/FunctionPreview.js +9 -0
  185. package/es/lowcode/view/lc-components/Image/index.js +1 -0
  186. package/es/lowcode/view/lc-components/Image/meta.json +3 -3
  187. package/es/lowcode/view/lc-components/JSX/FunctionPreview.js +9 -0
  188. package/es/lowcode/view/lc-components/JSX/index.js +19 -6
  189. package/es/lowcode/view/lc-components/JSX/meta.json +8 -5
  190. package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +23 -22
  191. package/es/lowcode/view/lc-components/Layout/FunctionLive.js +3 -8
  192. package/es/lowcode/view/lc-components/Layout/FunctionPreview.js +9 -0
  193. package/es/lowcode/view/lc-components/Layout/index.js +1 -0
  194. package/es/lowcode/view/lc-components/Layout/meta.json +1 -2
  195. package/es/lowcode/view/lc-components/Link/FunctionPreview.js +9 -0
  196. package/es/lowcode/view/lc-components/Link/index.js +1 -0
  197. package/es/lowcode/view/lc-components/Link/meta.json +3 -3
  198. package/es/lowcode/view/lc-components/Page/meta.json +49 -0
  199. package/es/lowcode/view/lc-components/PageContent/index.js +53 -0
  200. package/es/lowcode/view/lc-components/PageContent/meta.json +9 -0
  201. package/es/lowcode/view/lc-components/PageFooter/index.js +38 -0
  202. package/es/lowcode/view/lc-components/PageFooter/meta.json +9 -0
  203. package/es/lowcode/view/lc-components/PageHeader/index.js +40 -0
  204. package/es/lowcode/view/lc-components/PageHeader/meta.json +9 -0
  205. package/es/lowcode/view/lc-components/PageModal/index.js +23 -0
  206. package/es/lowcode/view/lc-components/Section/FunctionDesign.js +31 -2
  207. package/es/lowcode/view/lc-components/Section/FunctionPreview.js +9 -0
  208. package/es/lowcode/view/lc-components/Section/index.js +115 -24
  209. package/es/lowcode/view/lc-components/Section/index.less +7 -0
  210. package/es/lowcode/view/lc-components/Section/meta.json +48 -49
  211. package/es/lowcode/view/lc-components/Split/FunctionDesign.js +57 -2
  212. package/es/lowcode/view/lc-components/Split/FunctionPreview.js +9 -0
  213. package/es/lowcode/view/lc-components/Split/index.js +46 -7
  214. package/es/lowcode/view/lc-components/Split/meta.json +10 -29
  215. package/es/lowcode/view/lc-components/Table/FunctionDesign.js +41 -4
  216. package/es/lowcode/view/lc-components/Table/FunctionPreview.js +9 -0
  217. package/es/lowcode/view/lc-components/Table/components/TopFilter.js +96 -0
  218. package/es/lowcode/view/lc-components/Table/index.js +365 -48
  219. package/es/lowcode/view/lc-components/Table/meta.json +229 -55
  220. package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +70 -2
  221. package/es/lowcode/view/lc-components/Tabs/FunctionLive.js +1 -0
  222. package/es/lowcode/view/lc-components/Tabs/FunctionPreview.js +10 -0
  223. package/es/lowcode/view/lc-components/Tabs/index.js +113 -10
  224. package/es/lowcode/view/lc-components/Tabs/meta.json +53 -81
  225. package/es/lowcode/view/lc-components/Text/FunctionPreview.js +9 -0
  226. package/es/lowcode/view/lc-components/Text/index.js +1 -0
  227. package/es/lowcode/view/lc-components/Text/meta.json +3 -3
  228. package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +63 -3
  229. package/es/lowcode/view/lc-components/Tree/FunctionPreview.js +26 -0
  230. package/es/lowcode/view/lc-components/Tree/index.js +323 -8
  231. package/es/lowcode/view/lc-components/Tree/index.less +5 -0
  232. package/es/lowcode/view/lc-components/Tree/meta.json +224 -80
  233. package/es/lowcode/view/lc-components/Wrapper.js +44 -27
  234. package/es/lowcode/view/style/page.less +3 -0
  235. package/es/services.js +5 -3
  236. package/es/upload/Form/gridForm.js +7 -3
  237. package/es/utils/grid.js +2 -2
  238. package/lib/components/Builder/index.js +4 -1
  239. package/lib/components/IconFont/index.js +11 -0
  240. package/lib/components/LDActions/index.js +141 -0
  241. package/lib/components/LDActions/index.less +65 -0
  242. package/lib/components/LdAutoForm/index.js +1 -1
  243. package/lib/components/LdCom/index.js +2 -1
  244. package/lib/components/LdFormList/index.js +14 -9
  245. package/lib/components/LdGrid/index.js +13 -7
  246. package/lib/components/LdGridForm/index.js +4 -3
  247. package/lib/components/LdRuntimeCom/index.js +21 -8
  248. package/lib/components/LdTree/index.js +112 -31
  249. package/lib/components/LdTree/index.less +6 -1
  250. package/lib/helper/ldBuilder.js +28 -12
  251. package/lib/helper/ldComBuild.js +27 -12
  252. package/lib/index.js +8 -0
  253. package/lib/locales/zh-CN.js +236 -0
  254. package/lib/lowcode/constants/api-url.js +465 -263
  255. package/lib/lowcode/constants/event-topics.js +5 -1
  256. package/lib/lowcode/constants/index.js +32 -3
  257. package/lib/lowcode/engine/factory/panel-item-factory/CheckboxStrategy.js +38 -0
  258. package/lib/lowcode/engine/factory/panel-item-factory/index.js +2 -0
  259. package/lib/lowcode/engine/meta/box.props.default.json +4 -3
  260. package/lib/lowcode/engine/meta/box.props.json +2 -4
  261. package/lib/lowcode/engine/meta/button.props.default.json +5 -2
  262. package/lib/lowcode/engine/meta/button.props.json +9 -9
  263. package/lib/lowcode/engine/meta/cardlist.props.default.json +4 -2
  264. package/lib/lowcode/engine/meta/cardlist.props.json +2 -3
  265. package/lib/lowcode/engine/meta/components-list.json +1 -1
  266. package/lib/lowcode/engine/meta/dialog.props.default.json +4 -2
  267. package/lib/lowcode/engine/meta/dialog.props.json +1 -2
  268. package/lib/lowcode/engine/meta/drawer.props.default.json +4 -2
  269. package/lib/lowcode/engine/meta/drawer.props.json +1 -2
  270. package/lib/lowcode/engine/meta/form.props.default.json +52 -4
  271. package/lib/lowcode/engine/meta/form.props.json +596 -64
  272. package/lib/lowcode/engine/meta/iframe.props.default.json +1 -1
  273. package/lib/lowcode/engine/meta/iframe.props.json +1 -1
  274. package/lib/lowcode/engine/meta/image.props.default.json +5 -2
  275. package/lib/lowcode/engine/meta/image.props.json +3 -3
  276. package/lib/lowcode/engine/meta/imex.props.default.json +5 -2
  277. package/lib/lowcode/engine/meta/imex.props.json +2 -2
  278. package/lib/lowcode/engine/meta/js-editor/auto-complete.json +152 -26
  279. package/lib/lowcode/engine/meta/jsx.props.default.json +2 -1
  280. package/lib/lowcode/engine/meta/jsx.props.json +10 -5
  281. package/lib/lowcode/engine/meta/layout.props.default.json +5 -2
  282. package/lib/lowcode/engine/meta/layout.props.json +1 -2
  283. package/lib/lowcode/engine/meta/link.props.default.json +5 -2
  284. package/lib/lowcode/engine/meta/link.props.json +3 -3
  285. package/lib/lowcode/engine/meta/local/local.zh-cn.js +103 -0
  286. package/lib/lowcode/engine/meta/page.props.default.json +12 -0
  287. package/lib/lowcode/engine/meta/page.props.json +49 -0
  288. package/lib/lowcode/engine/meta/pagecontent.props.default.json +6 -0
  289. package/lib/lowcode/engine/meta/pagecontent.props.json +7 -0
  290. package/lib/lowcode/engine/meta/pagefooter.props.default.json +6 -0
  291. package/lib/lowcode/engine/meta/pagefooter.props.json +7 -0
  292. package/lib/lowcode/engine/meta/pageheader.props.default.json +6 -0
  293. package/lib/lowcode/engine/meta/pageheader.props.json +7 -0
  294. package/lib/lowcode/engine/meta/section.props.default.json +7 -6
  295. package/lib/lowcode/engine/meta/section.props.json +52 -49
  296. package/lib/lowcode/engine/meta/split.props.default.json +9 -4
  297. package/lib/lowcode/engine/meta/split.props.json +14 -29
  298. package/lib/lowcode/engine/meta/table.props.default.json +23 -3
  299. package/lib/lowcode/engine/meta/table.props.json +257 -55
  300. package/lib/lowcode/engine/meta/tabs.props.default.json +16 -9
  301. package/lib/lowcode/engine/meta/tabs.props.json +57 -81
  302. package/lib/lowcode/engine/meta/text.props.default.json +5 -2
  303. package/lib/lowcode/engine/meta/text.props.json +3 -3
  304. package/lib/lowcode/engine/meta/tree.props.default.json +20 -7
  305. package/lib/lowcode/engine/meta/tree.props.json +225 -79
  306. package/lib/lowcode/engine/provider/ContextProvider/index.js +185 -0
  307. package/lib/lowcode/engine/provider/RemoteSourceProvider.js +182 -0
  308. package/lib/lowcode/engine/tools/dataProcess.js +64 -1
  309. package/lib/lowcode/engine/tools/helper.js +101 -17
  310. package/lib/lowcode/engine/tools/useCanvasRender.js +88 -0
  311. package/lib/lowcode/engine/tools/usePromiseState.js +22 -12
  312. package/lib/lowcode/engine/tools/useTodo.js +85 -0
  313. package/lib/lowcode/index.js +7 -0
  314. package/lib/lowcode/painter/Components.js +46 -20
  315. package/lib/lowcode/painter/Design.js +32 -0
  316. package/lib/lowcode/painter/DesignOperator.js +45 -28
  317. package/lib/lowcode/painter/DesignToolbar.js +321 -13
  318. package/lib/lowcode/painter/I18n.js +1 -1
  319. package/lib/lowcode/painter/Outline.js +29 -24
  320. package/lib/lowcode/painter/Panel.js +96 -139
  321. package/lib/lowcode/painter/Ribbon.js +1 -1
  322. package/lib/lowcode/painter/components/ActionBindModal.js +300 -0
  323. package/lib/lowcode/painter/components/AdvancePanel.js +148 -0
  324. package/lib/lowcode/painter/components/AttrsPanel.js +153 -0
  325. package/lib/lowcode/painter/components/Collapse.js +20 -9
  326. package/lib/lowcode/painter/components/ColorInput.js +5 -3
  327. package/lib/lowcode/painter/components/DragDrop/DragDropContext.js +146 -0
  328. package/lib/lowcode/painter/components/DragDrop/DragDropWrapper.js +57 -0
  329. package/lib/lowcode/painter/components/DragDrop/Overlay.js +15 -0
  330. package/lib/lowcode/painter/components/DragDrop/TreeDragDropWrapper.js +75 -0
  331. package/lib/lowcode/painter/components/FieldSelector.js +52 -0
  332. package/lib/lowcode/painter/components/ListEditor.js +25 -10
  333. package/lib/lowcode/painter/components/PanelItem.js +1 -1
  334. package/lib/lowcode/painter/components/PopConfirm.js +10 -3
  335. package/lib/lowcode/painter/components/SortBox.js +12 -5
  336. package/lib/lowcode/painter/components/TreeEditor.js +20 -0
  337. package/lib/lowcode/painter/components/code-editor/BaseEditor.js +14 -2
  338. package/lib/lowcode/painter/components/code-editor/JSEditor.js +25 -14
  339. package/lib/lowcode/painter/components/code-editor/JsonEditor.js +48 -0
  340. package/lib/lowcode/painter/components/field-setting/BatchSetting.js +161 -0
  341. package/lib/lowcode/painter/components/field-setting/CheckRules.js +133 -0
  342. package/lib/lowcode/painter/components/field-setting/FieldAttrs.js +295 -0
  343. package/lib/lowcode/painter/components/field-setting/FieldAttrsModal.js +298 -0
  344. package/lib/lowcode/painter/components/field-setting/FieldDefaultValue.js +70 -0
  345. package/lib/lowcode/painter/components/field-setting/FieldRulesModal.js +123 -0
  346. package/lib/lowcode/painter/components/field-setting/SettingUI.js +446 -0
  347. package/lib/lowcode/painter/components/field-setting/index.js +380 -0
  348. package/lib/lowcode/painter/index.js +3 -30
  349. package/lib/lowcode/painter/panel-section/ActionsColumnWidth.js +32 -0
  350. package/lib/lowcode/painter/{components/actions-editor → panel-section/ActionsEditor}/ActionEditor.js +20 -66
  351. package/lib/lowcode/painter/{components/actions-editor → panel-section/ActionsEditor}/index.js +71 -10
  352. package/lib/lowcode/painter/panel-section/BlockEditor/index.js +34 -0
  353. package/lib/lowcode/painter/panel-section/BlocksEditor/BlockEditorItem.js +52 -0
  354. package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +242 -0
  355. package/lib/lowcode/painter/panel-section/DataSetSelector.js +112 -40
  356. package/lib/lowcode/painter/panel-section/FieldsSetting.js +337 -0
  357. package/lib/lowcode/painter/panel-section/I18nInput.js +27 -0
  358. package/lib/lowcode/painter/panel-section/Icon.js +16 -14
  359. package/lib/lowcode/painter/panel-section/IconConditionSelector.js +119 -0
  360. package/lib/lowcode/painter/panel-section/IconSelector.js +5 -2
  361. package/lib/lowcode/painter/panel-section/ImpExp.js +98 -0
  362. package/lib/lowcode/painter/panel-section/JSEditor.js +57 -0
  363. package/lib/lowcode/painter/panel-section/LayoutRatio.js +5 -6
  364. package/lib/lowcode/painter/panel-section/SerialsSelector.js +51 -0
  365. package/lib/lowcode/painter/panel-section/SplitDisplay.js +256 -0
  366. package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
  367. package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +3 -23
  368. package/lib/lowcode/painter/panel-section/TabItems.js +45 -29
  369. package/lib/lowcode/painter/panel-section/TableTopFilter.js +314 -0
  370. package/lib/lowcode/painter/panel-section/TableZebra.js +67 -6
  371. package/lib/lowcode/painter/panel-section/TreeRootEditor.js +86 -0
  372. package/lib/lowcode/painter/style/action-bind-modal.less +102 -0
  373. package/lib/lowcode/painter/style/collapse.less +6 -0
  374. package/lib/lowcode/painter/style/components.less +5 -4
  375. package/lib/lowcode/painter/style/design.less +7 -4
  376. package/lib/lowcode/painter/style/dragdrop.less +10 -0
  377. package/lib/lowcode/painter/style/fields-setting.less +25 -0
  378. package/lib/lowcode/painter/style/impexp.less +7 -0
  379. package/lib/lowcode/painter/style/list-editor.less +36 -0
  380. package/lib/lowcode/painter/style/panel-attrs.less +43 -0
  381. package/lib/lowcode/painter/style/panel.less +6 -37
  382. package/lib/lowcode/painter/style/pop-confirm.less +9 -2
  383. package/lib/lowcode/painter/style/split-display.less +28 -0
  384. package/lib/lowcode/painter/style/treedragdrop.less +19 -0
  385. package/lib/lowcode/preview/index.js +35 -0
  386. package/lib/lowcode/view/Canvas.js +32 -145
  387. package/lib/lowcode/view/Loading.js +6 -2
  388. package/lib/lowcode/view/Page.js +12 -10
  389. package/lib/lowcode/view/lc-components/Box/FunctionPreview.js +16 -0
  390. package/lib/lowcode/view/lc-components/Box/index.js +11 -2
  391. package/lib/lowcode/view/lc-components/Box/index.less +0 -1
  392. package/lib/lowcode/view/lc-components/Box/meta.json +2 -4
  393. package/lib/lowcode/view/lc-components/Button/FunctionDesign.js +8 -10
  394. package/lib/lowcode/view/lc-components/Button/FunctionLive.js +3 -6
  395. package/lib/lowcode/view/lc-components/Button/FunctionPreview.js +13 -0
  396. package/lib/lowcode/view/lc-components/Button/index.js +41 -18
  397. package/lib/lowcode/view/lc-components/Button/meta.json +9 -9
  398. package/lib/lowcode/view/lc-components/CardList/FunctionPreview.js +16 -0
  399. package/lib/lowcode/view/lc-components/CardList/index.js +1 -0
  400. package/lib/lowcode/view/lc-components/CardList/meta.json +2 -3
  401. package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +15 -24
  402. package/lib/lowcode/view/lc-components/Dialog/FunctionPreview.js +16 -0
  403. package/lib/lowcode/view/lc-components/Dialog/index.js +1 -0
  404. package/lib/lowcode/view/lc-components/Dialog/meta.json +1 -2
  405. package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +4 -2
  406. package/lib/lowcode/view/lc-components/Drawer/FunctionPreview.js +16 -0
  407. package/lib/lowcode/view/lc-components/Drawer/index.js +17 -0
  408. package/lib/lowcode/view/lc-components/Drawer/index.less +3 -0
  409. package/lib/lowcode/view/lc-components/Drawer/meta.json +1 -2
  410. package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +94 -2
  411. package/lib/lowcode/view/lc-components/Form/FunctionPreview.js +16 -0
  412. package/lib/lowcode/view/lc-components/Form/index.js +289 -12
  413. package/lib/lowcode/view/lc-components/Form/index.less +5 -0
  414. package/lib/lowcode/view/lc-components/Form/meta.json +546 -64
  415. package/lib/lowcode/view/lc-components/Iframe/FunctionPreview.js +16 -0
  416. package/lib/lowcode/view/lc-components/Iframe/index.js +1 -0
  417. package/lib/lowcode/view/lc-components/Iframe/meta.json +1 -1
  418. package/lib/lowcode/view/lc-components/ImEx/FunctionPreview.js +16 -0
  419. package/lib/lowcode/view/lc-components/ImEx/index.js +1 -0
  420. package/lib/lowcode/view/lc-components/ImEx/meta.json +2 -2
  421. package/lib/lowcode/view/lc-components/Image/FunctionPreview.js +16 -0
  422. package/lib/lowcode/view/lc-components/Image/index.js +1 -0
  423. package/lib/lowcode/view/lc-components/Image/meta.json +3 -3
  424. package/lib/lowcode/view/lc-components/JSX/FunctionPreview.js +16 -0
  425. package/lib/lowcode/view/lc-components/JSX/index.js +19 -6
  426. package/lib/lowcode/view/lc-components/JSX/meta.json +8 -5
  427. package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +24 -22
  428. package/lib/lowcode/view/lc-components/Layout/FunctionLive.js +3 -8
  429. package/lib/lowcode/view/lc-components/Layout/FunctionPreview.js +16 -0
  430. package/lib/lowcode/view/lc-components/Layout/index.js +1 -0
  431. package/lib/lowcode/view/lc-components/Layout/meta.json +1 -2
  432. package/lib/lowcode/view/lc-components/Link/FunctionPreview.js +16 -0
  433. package/lib/lowcode/view/lc-components/Link/index.js +1 -0
  434. package/lib/lowcode/view/lc-components/Link/meta.json +3 -3
  435. package/lib/lowcode/view/lc-components/Page/meta.json +49 -0
  436. package/lib/lowcode/view/lc-components/PageContent/index.js +61 -0
  437. package/lib/lowcode/view/lc-components/PageContent/meta.json +9 -0
  438. package/lib/lowcode/view/lc-components/PageFooter/index.js +46 -0
  439. package/lib/lowcode/view/lc-components/PageFooter/meta.json +9 -0
  440. package/lib/lowcode/view/lc-components/PageHeader/index.js +48 -0
  441. package/lib/lowcode/view/lc-components/PageHeader/meta.json +9 -0
  442. package/lib/lowcode/view/lc-components/PageModal/index.js +30 -0
  443. package/lib/lowcode/view/lc-components/Section/FunctionDesign.js +31 -2
  444. package/lib/lowcode/view/lc-components/Section/FunctionPreview.js +16 -0
  445. package/lib/lowcode/view/lc-components/Section/index.js +114 -23
  446. package/lib/lowcode/view/lc-components/Section/index.less +7 -0
  447. package/lib/lowcode/view/lc-components/Section/meta.json +48 -49
  448. package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +58 -2
  449. package/lib/lowcode/view/lc-components/Split/FunctionPreview.js +16 -0
  450. package/lib/lowcode/view/lc-components/Split/index.js +45 -6
  451. package/lib/lowcode/view/lc-components/Split/meta.json +10 -29
  452. package/lib/lowcode/view/lc-components/Table/FunctionDesign.js +43 -5
  453. package/lib/lowcode/view/lc-components/Table/FunctionPreview.js +16 -0
  454. package/lib/lowcode/view/lc-components/Table/components/TopFilter.js +104 -0
  455. package/lib/lowcode/view/lc-components/Table/index.js +364 -47
  456. package/lib/lowcode/view/lc-components/Table/meta.json +229 -55
  457. package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +71 -2
  458. package/lib/lowcode/view/lc-components/Tabs/FunctionLive.js +2 -1
  459. package/lib/lowcode/view/lc-components/Tabs/FunctionPreview.js +17 -0
  460. package/lib/lowcode/view/lc-components/Tabs/index.js +112 -9
  461. package/lib/lowcode/view/lc-components/Tabs/meta.json +53 -81
  462. package/lib/lowcode/view/lc-components/Text/FunctionPreview.js +16 -0
  463. package/lib/lowcode/view/lc-components/Text/index.js +1 -0
  464. package/lib/lowcode/view/lc-components/Text/meta.json +3 -3
  465. package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +64 -3
  466. package/lib/lowcode/view/lc-components/Tree/FunctionPreview.js +33 -0
  467. package/lib/lowcode/view/lc-components/Tree/index.js +321 -6
  468. package/lib/lowcode/view/lc-components/Tree/index.less +5 -0
  469. package/lib/lowcode/view/lc-components/Tree/meta.json +224 -80
  470. package/lib/lowcode/view/lc-components/Wrapper.js +42 -25
  471. package/lib/lowcode/view/style/page.less +3 -0
  472. package/lib/services.js +5 -3
  473. package/lib/upload/Form/gridForm.js +7 -3
  474. package/lib/utils/grid.js +2 -2
  475. package/package.json +12 -7
  476. package/es/lowcode/engine/provider/ContextProvider.js +0 -169
  477. package/es/lowcode/painter/components/actions-editor/ActionEditor.js +0 -147
  478. package/es/lowcode/painter/panel-section/TableActions.js +0 -19
  479. package/lib/lowcode/engine/provider/ContextProvider.js +0 -177
  480. package/lib/lowcode/painter/panel-section/TableActions.js +0 -26
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
@@ -8,18 +9,55 @@ exports.default = void 0;
8
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
11
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
12
+ var _react = _interopRequireWildcard(require("react"));
11
13
  var _index = _interopRequireDefault(require("./index"));
14
+ var _ahooks = require("ahooks");
12
15
  var _classnames = _interopRequireDefault(require("classnames"));
13
- var _index2 = require("../../../constants/index");
14
- var _excluded = ["children", "className", "suppressPreset"];
16
+ var _excluded = ["children", "className", "suppressPreset", "renderIndex", "zebra", "actions"];
15
17
  var FunctionDesign = function FunctionDesign(_ref) {
16
18
  var children = _ref.children,
17
19
  className = _ref.className,
18
20
  suppressPreset = _ref.suppressPreset,
21
+ renderIndex = _ref.renderIndex,
22
+ zebra = _ref.zebra,
23
+ actions = _ref.actions,
19
24
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
20
- return /*#__PURE__*/React.createElement(_index.default, (0, _extends2.default)({
21
- className: (0, _classnames.default)(_index2.CELL_CLASS_NAME, (0, _defineProperty2.default)({}, className, !!className)),
22
- suppressPreset: true
25
+ var ref = (0, _react.useRef)(null);
26
+ var gridRef = (0, _react.useRef)(null);
27
+ var latestZebra = (0, _ahooks.useLatest)(zebra);
28
+ var latestActions = (0, _ahooks.useLatest)(actions);
29
+ var handleGridReady = (0, _ahooks.useMemoizedFn)(function (grid) {
30
+ gridRef.current = grid;
31
+ });
32
+ (0, _ahooks.useUpdateEffect)(function () {
33
+ if (!gridRef.current) return;
34
+ var itemsToUpdate = [];
35
+ gridRef.current.api.forEachNode(function (rowNode) {
36
+ itemsToUpdate.push(rowNode.data);
37
+ });
38
+ gridRef.current.api.updateRowData({
39
+ update: itemsToUpdate
40
+ });
41
+ }, [zebra]);
42
+ (0, _ahooks.useUpdateEffect)(function () {
43
+ if (!gridRef.current) return;
44
+ gridRef.current.api.refreshCells({
45
+ columns: ['luck-actions'],
46
+ force: true
47
+ });
48
+ }, [actions]);
49
+ (0, _ahooks.useUpdateEffect)(function () {
50
+ if (!gridRef.current) return;
51
+ gridRef.current.columnApi.setColumnVisible('luck-index', renderIndex);
52
+ }, [renderIndex]);
53
+ return /*#__PURE__*/_react.default.createElement(_index.default, (0, _extends2.default)({
54
+ ref: ref,
55
+ className: (0, _classnames.default)((0, _defineProperty2.default)({}, className, !!className)),
56
+ suppressPreset: true,
57
+ renderIndex: renderIndex,
58
+ zebra: latestZebra,
59
+ actions: latestActions,
60
+ onGridReady: handleGridReady
23
61
  }, props), children);
24
62
  };
25
63
  var _default = exports.default = FunctionDesign;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
+ var _index = _interopRequireDefault(require("./index"));
10
+ var _excluded = ["children"];
11
+ var FunctionPreview = function FunctionPreview(_ref) {
12
+ var children = _ref.children,
13
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
14
+ return /*#__PURE__*/React.createElement(_index.default, props, children);
15
+ };
16
+ var _default = exports.default = FunctionPreview;
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
10
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
12
+ var _react = _interopRequireWildcard(require("react"));
13
+ var _ahooks = require("ahooks");
14
+ var _antd = require("luck-design/antd");
15
+ var _lodash = require("lodash");
16
+ function mockDict() {
17
+ return new Promise(function (resolve) {
18
+ setTimeout(function () {
19
+ resolve([{
20
+ value: '1',
21
+ label: '启用'
22
+ }, {
23
+ value: '2',
24
+ label: '未启用'
25
+ }, {
26
+ value: '0',
27
+ label: '未知'
28
+ }]);
29
+ }, 600);
30
+ });
31
+ }
32
+ function mockDApi() {
33
+ return new Promise(function (resolve) {
34
+ setTimeout(function () {
35
+ resolve({
36
+ options: [{
37
+ value: '2023',
38
+ label: '2023年'
39
+ }, {
40
+ value: '2024',
41
+ label: '2024年'
42
+ }, {
43
+ value: '2024',
44
+ label: '2025年'
45
+ }],
46
+ field: 'planYear'
47
+ });
48
+ }, 600);
49
+ });
50
+ }
51
+ var TopFilter = function TopFilter(_ref) {
52
+ var filter = _ref.filter;
53
+ var _useState = (0, _react.useState)((0, _lodash.isArray)(filter) ? filter : []),
54
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
55
+ optons = _useState2[0],
56
+ setOptions = _useState2[1];
57
+ (0, _ahooks.useAsyncEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
58
+ var _yield$mockDApi, options, field;
59
+ return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
60
+ while (1) switch (_context.prev = _context.next) {
61
+ case 0:
62
+ if (!(0, _lodash.isString)(filter)) {
63
+ _context.next = 9;
64
+ break;
65
+ }
66
+ _context.next = 3;
67
+ return mockDApi();
68
+ case 3:
69
+ _yield$mockDApi = _context.sent;
70
+ options = _yield$mockDApi.options;
71
+ field = _yield$mockDApi.field;
72
+ setOptions(options);
73
+ _context.next = 19;
74
+ break;
75
+ case 9:
76
+ if (!(0, _lodash.isArray)(filter)) {
77
+ _context.next = 13;
78
+ break;
79
+ }
80
+ setOptions(filter);
81
+ _context.next = 19;
82
+ break;
83
+ case 13:
84
+ if (!(filter.key && filter.field)) {
85
+ _context.next = 19;
86
+ break;
87
+ }
88
+ _context.t0 = setOptions;
89
+ _context.next = 17;
90
+ return mockDict();
91
+ case 17:
92
+ _context.t1 = _context.sent;
93
+ (0, _context.t0)(_context.t1);
94
+ case 19:
95
+ case "end":
96
+ return _context.stop();
97
+ }
98
+ }, _callee);
99
+ })), [filter]);
100
+ return /*#__PURE__*/_react.default.createElement(_antd.Segmented, {
101
+ options: optons
102
+ });
103
+ };
104
+ var _default = exports.default = TopFilter;
@@ -1,34 +1,39 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
12
12
  var _react = _interopRequireWildcard(require("react"));
13
13
  var _propTypes = _interopRequireDefault(require("prop-types"));
14
14
  var _ahooks = require("ahooks");
15
- var _LdGrid = _interopRequireDefault(require("../../../../components/LdGrid"));
15
+ var _lodash = require("lodash");
16
16
  var _classnames = _interopRequireDefault(require("classnames"));
17
+ var _ContextProvider = require("../../../engine/provider/ContextProvider");
17
18
  var _Wrapper = _interopRequireDefault(require("../Wrapper"));
19
+ var _index = require("../../../../index");
20
+ var _TopFilter = _interopRequireDefault(require("./components/TopFilter"));
18
21
  var _helper = require("../../../engine/tools/helper");
19
22
  var _tablePropsDefault = _interopRequireDefault(require("../../../engine/meta/table.props.default.json"));
20
- var _excluded = ["context", "id", "className", "dataset", "width", "height", "bordered", "zebra", "autoLoad", "readOnly", "suppressActions", "actionsColumnWidth", "actions", "pagination", "pageSize", "showSizeChanger", "showQuickJumper", "hideOnSinglePage", "paginationSimple", "suppressPreset"];
21
- var LCTable = function LCTable(_ref) {
22
- var context = _ref.context,
23
- id = _ref.id,
23
+ var _constants = require("../../../constants");
24
+ var LCTable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
25
+ var id = _ref.id,
24
26
  className = _ref.className,
25
27
  dataset = _ref.dataset,
26
28
  width = _ref.width,
27
29
  height = _ref.height,
30
+ fields = _ref.fields,
31
+ draggable = _ref.draggable,
28
32
  bordered = _ref.bordered,
29
33
  zebra = _ref.zebra,
30
34
  autoLoad = _ref.autoLoad,
31
35
  readOnly = _ref.readOnly,
36
+ renderIndex = _ref.renderIndex,
32
37
  suppressActions = _ref.suppressActions,
33
38
  actionsColumnWidth = _ref.actionsColumnWidth,
34
39
  actions = _ref.actions,
@@ -39,9 +44,27 @@ var LCTable = function LCTable(_ref) {
39
44
  hideOnSinglePage = _ref.hideOnSinglePage,
40
45
  paginationSimple = _ref.paginationSimple,
41
46
  suppressPreset = _ref.suppressPreset,
42
- props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
43
- var ref = (0, _react.useRef)();
44
- var latestZebra = (0, _ahooks.useLatest)(zebra);
47
+ impexp = _ref.impexp,
48
+ topActionGroup = _ref.topActionGroup,
49
+ topFilter = _ref.topFilter,
50
+ rowSelection = _ref.rowSelection,
51
+ suppressRowSelectionPagination = _ref.suppressRowSelectionPagination,
52
+ rowSelectionMode = _ref.rowSelectionMode,
53
+ defaultRowSelectedCode = _ref.defaultRowSelectedCode,
54
+ rowSelectableCode = _ref.rowSelectableCode,
55
+ bantchActions = _ref.bantchActions,
56
+ formatDataSource = _ref.formatDataSource,
57
+ getDataPath = _ref.getDataPath,
58
+ columnsRewrite = _ref.columnsRewrite,
59
+ columnsReset = _ref.columnsReset,
60
+ modelParams = _ref.modelParams,
61
+ onGridReady = _ref.onGridReady,
62
+ advance = _ref.advance;
63
+ var ctx = (0, _ContextProvider.useContext)();
64
+ var _useRemoteSource = (0, _ContextProvider.useRemoteSource)(),
65
+ module = _useRemoteSource.module;
66
+ var wrapperRef = (0, _react.useRef)();
67
+ var instanceRef = (0, _react.useRef)();
45
68
  var _pagination = (0, _ahooks.useCreation)(function () {
46
69
  return {
47
70
  isFlow: !pagination,
@@ -59,65 +82,258 @@ var LCTable = function LCTable(_ref) {
59
82
  return {
60
83
  actionsColumn: suppressActions ? null : {
61
84
  width: actionsColumnWidth,
62
- maxCount: actions.max,
63
- type: actions.type,
85
+ maxCount: (actions.current || actions).max,
86
+ type: (actions.current || actions).type,
64
87
  getActions: function getActions() {
65
- return actions.todoList.map(function (_action) {
88
+ return (actions.current || actions).todoList.map(function (action) {
66
89
  return {
67
- title: _action.name,
68
- action: function action(d) {
69
- console.log('doAction', d, _action);
70
- },
71
- resource: _action.serial,
72
- style: _action.riskLevel === 'default' ? null : {
90
+ title: action.name,
91
+ action: function (_action) {
92
+ function action(_x, _x2, _x3) {
93
+ return _action.apply(this, arguments);
94
+ }
95
+ action.toString = function () {
96
+ return _action.toString();
97
+ };
98
+ return action;
99
+ }(function (data, rowIndex, params) {
100
+ ctx.doAction(action.actionPool, {
101
+ data: data,
102
+ rowIndex: rowIndex,
103
+ params: params
104
+ });
105
+ }),
106
+ resource: action.serial,
107
+ style: action.riskLevel === 'default' ? null : {
73
108
  color: {
74
109
  danger: '#ff7875',
75
- destroy: '#820014'
76
- }[_action.riskLevel]
110
+ destroy: '#ff4d4f'
111
+ }[action.riskLevel]
77
112
  }
78
113
  };
79
114
  });
80
115
  }
81
116
  }
82
117
  };
83
- }, [suppressActions, actionsColumnWidth, actions]);
84
- (0, _ahooks.useUpdateEffect)(function () {
85
- var itemsToUpdate = [];
86
- ref.current.gridApi.api.forEachNode(function (rowNode) {
87
- if (rowNode.rowIndex % 2 === 0) itemsToUpdate.push(rowNode.data);
118
+ }, [suppressActions, actionsColumnWidth, actions.current || actions]);
119
+ var _rowSelection = (0, _ahooks.useCreation)(function () {
120
+ return rowSelection ? {
121
+ rowSelection: {
122
+ mode: rowSelectionMode,
123
+ suppressPagination: suppressRowSelectionPagination,
124
+ isDefaultSelected: function isDefaultSelected(d, n) {
125
+ if ((0, _lodash.isNil)(defaultRowSelectedCode)) return false;
126
+ return (0, _helper.executeCode)(ctx, defaultRowSelectedCode, ['data', 'node'], d, n);
127
+ },
128
+ isRowSelectable: function isRowSelectable(d, n) {
129
+ if ((0, _lodash.isNil)(rowSelectableCode)) return true;
130
+ return (0, _helper.executeCode)(ctx, rowSelectableCode, ['data', 'node'], d, n);
131
+ },
132
+ onSelect: function onSelect(data, isSelected, SelectedRows, params) {
133
+ ctx.doAction(advance.events.onRowSelected, {
134
+ data: data,
135
+ isSelected: isSelected,
136
+ SelectedRows: SelectedRows,
137
+ params: params
138
+ });
139
+ },
140
+ onChange: function onChange(rows, nodes, params) {
141
+ ctx.doAction(advance.events.onRowSelected, {
142
+ rows: rows,
143
+ nodes: nodes,
144
+ params: params
145
+ });
146
+ }
147
+ }
148
+ } : false;
149
+ }, [rowSelection, suppressRowSelectionPagination, rowSelectionMode, defaultRowSelectedCode, rowSelectableCode]);
150
+ var _export = (0, _ahooks.useCreation)(function () {
151
+ return {
152
+ enableExportAll: !!impexp.export,
153
+ apiUrl: (0, _lodash.isString)(impexp.export) ? impexp.export : void 0
154
+ };
155
+ }, [impexp.export]);
156
+ var _batchActions = (0, _ahooks.useCreation)(function () {
157
+ return {
158
+ batchOperations: bantchActions.todoList.map(function (action) {
159
+ return {
160
+ key: action.id,
161
+ title: action.name,
162
+ resource: action.serial
163
+ };
164
+ }),
165
+ onBatchOperationsClick: function onBatchOperationsClick(key, selectedRows) {
166
+ ctx.doAction(action.actionPool, {
167
+ key: key,
168
+ selectedRows: selectedRows
169
+ });
170
+ }
171
+ };
172
+ }, [bantchActions.todoList]);
173
+ var _others = (0, _ahooks.useCreation)(function () {
174
+ var temp = {
175
+ defaultColDef: {
176
+ draggable: draggable
177
+ }
178
+ };
179
+ if (!(0, _lodash.isNil)(formatDataSource)) {
180
+ temp.formatDataSource = function (list, detail) {
181
+ return (0, _helper.executeCode)(ctx, formatDataSource, ['list', 'detail'], list, detail);
182
+ };
183
+ }
184
+ if (!(0, _lodash.isNil)(getDataPath)) {
185
+ temp.getDataPath = function (data) {
186
+ return (0, _helper.executeCode)(ctx, getDataPath, ['data'], data);
187
+ };
188
+ }
189
+ if (!(0, _lodash.isNil)(columnsRewrite) || !(0, _lodash.isNil)(fields)) {
190
+ temp.columnsRewrite = function (cols) {
191
+ var colsMap = (0, _lodash.keyBy)(cols, 'field');
192
+ var _cols = (0, _lodash.isNil)(fields) ? cols : fields.map(function (_field) {
193
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, colsMap[_field.field]), _field);
194
+ });
195
+ return (0, _lodash.isNil)(columnsRewrite) ? _cols : (0, _helper.executeCode)(ctx, columnsRewrite, ['columns'], _cols);
196
+ };
197
+ }
198
+ if (!(0, _lodash.isNil)(columnsReset)) {
199
+ temp.columnsReset = function (cols) {
200
+ return (0, _helper.executeCode)(ctx, columnsReset, ['columns'], cols);
201
+ };
202
+ }
203
+ if (!(0, _lodash.isNil)(modelParams)) {
204
+ temp.overModel = (0, _helper.executeCode)(ctx, modelParams);
205
+ }
206
+ return temp;
207
+ }, [fields, formatDataSource, getDataPath, columnsRewrite, columnsReset, modelParams, draggable]);
208
+ var renderFunctionArea = (0, _ahooks.useMemoizedFn)(function () {
209
+ var _topActionGroup$todoL;
210
+ return !!(topActionGroup !== null && topActionGroup !== void 0 && (_topActionGroup$todoL = topActionGroup.todoList) !== null && _topActionGroup$todoL !== void 0 && _topActionGroup$todoL.length) ? /*#__PURE__*/_react.default.createElement(_index.LDActions, (0, _extends2.default)({}, topActionGroup, {
211
+ doAction: function doAction(action) {
212
+ return ctx.doAction(action, {
213
+ indtance: instanceRef.current
214
+ });
215
+ }
216
+ })) : null;
217
+ });
218
+ var renderFilterArea = (0, _ahooks.useMemoizedFn)(function () {
219
+ return topFilter ? /*#__PURE__*/_react.default.createElement(_TopFilter.default, {
220
+ filter: topFilter
221
+ }) : null;
222
+ });
223
+ var _wrapperProps = (0, _ahooks.useCreation)(function () {
224
+ return (0, _defineProperty2.default)({
225
+ id: id
226
+ }, _constants.LC_COMPONENT_UNIT_KEY, _constants.LC_COMPONENT_UNIT);
227
+ }, []);
228
+ var _getRowStyle = (0, _ahooks.useMemoizedFn)(function (params) {
229
+ var _zebra = (0, _lodash.isNil)(zebra.current) ? zebra : zebra.current;
230
+ var condition = _zebra !== null && _zebra !== void 0 && _zebra.condition ? (0, _helper.executeCode)(ctx, _zebra.condition, ['params'], params) : _zebra && params.node.rowIndex % 2 === 0;
231
+ return condition ? {
232
+ 'background-color': _zebra.color || _zebra
233
+ } : {
234
+ 'background-color': '#fff'
235
+ };
236
+ });
237
+ var _readFilter = (0, _ahooks.useMemoizedFn)(function (params, filters) {
238
+ return ctx._setPagePublicResource({
239
+ params: params,
240
+ filters: filters
241
+ });
242
+ });
243
+ var _handleGridReady = (0, _ahooks.useMemoizedFn)(function (params, instance) {
244
+ instanceRef.current = instance;
245
+ onGridReady === null || onGridReady === void 0 || onGridReady(params, instance);
246
+ ctx.doAction(advance.events.onMount, {
247
+ params: params,
248
+ instance: instance
249
+ });
250
+ });
251
+ var _handleRowClick = (0, _ahooks.useMemoizedFn)(function (data, rowIndex, params) {
252
+ ctx.doAction(advance.events.onRowClick, {
253
+ data: data,
254
+ rowIndex: rowIndex,
255
+ params: params
256
+ });
257
+ });
258
+ var _handleRowDoubleClick = (0, _ahooks.useMemoizedFn)(function (data, rowIndex, params) {
259
+ ctx.doAction(advance.events.onRowDoubleClick, {
260
+ data: data,
261
+ rowIndex: rowIndex,
262
+ params: params
88
263
  });
89
- ref.current.gridApi.api.updateRowData({
90
- update: itemsToUpdate
264
+ });
265
+ var _handleRowDragged = (0, _ahooks.useMemoizedFn)(function (toId, fromId, params) {
266
+ if (advance.events.onRowDragged) {
267
+ ctx.doAction(advance.events.onRowDragged, {
268
+ toId: toId,
269
+ fromId: fromId,
270
+ params: params
271
+ });
272
+ } else {
273
+ ctx.doAction([['drag', {
274
+ category: 'page-action',
275
+ code: JSON.stringify({
276
+ moduleCode: module.moduleCode,
277
+ datasetCode: dataset.code,
278
+ data: {
279
+ toId: toId,
280
+ fromId: fromId
281
+ }
282
+ })
283
+ }]]);
284
+ }
285
+ });
286
+ var _afterInit = (0, _ahooks.useMemoizedFn)(function (res, dispatch, props) {
287
+ ctx.doAction(advance.events.afterInit, {
288
+ res: res,
289
+ dispatch: dispatch,
290
+ props: props
291
+ });
292
+ });
293
+ var _afterQuery = (0, _ahooks.useMemoizedFn)(function (res) {
294
+ ctx.doAction(advance.events.afterQuery, {
295
+ res: res
296
+ });
297
+ });
298
+ (0, _ahooks.useUnmount)(function () {
299
+ ctx.doAction(advance.events.onUnmount, {
300
+ instance: instanceRef.current
91
301
  });
92
- }, [zebra]);
302
+ });
93
303
  var getTargetDom = (0, _ahooks.useMemoizedFn)(function () {
94
- return ref.current.wrapperRef.current;
304
+ return wrapperRef.current;
95
305
  });
96
306
  return /*#__PURE__*/_react.default.createElement(_Wrapper.default, {
97
307
  id: id,
308
+ displayName: "Table",
98
309
  getTargetDom: getTargetDom
99
- }, /*#__PURE__*/_react.default.createElement(_LdGrid.default, (0, _extends2.default)({
310
+ }, /*#__PURE__*/_react.default.createElement(_index.LdGrid, (0, _extends2.default)({
100
311
  ref: ref,
312
+ wrapper: wrapperRef,
313
+ wrapperProps: _wrapperProps,
101
314
  width: width,
102
315
  height: height,
103
316
  bordered: bordered,
104
- id: id,
105
317
  className: (0, _classnames.default)((0, _defineProperty2.default)({}, className, !!className)),
106
318
  ldId: id,
107
- dataSetKey: dataset,
319
+ dataSetKey: dataset === null || dataset === void 0 ? void 0 : dataset.code,
108
320
  readOnly: readOnly,
321
+ renderIndex: renderIndex,
109
322
  suppressInit: !autoLoad,
110
- getRowStyle: function getRowStyle(params) {
111
- return latestZebra.current && params.node.rowIndex % 2 === 0 ? {
112
- 'background-color': latestZebra.current
113
- } : {
114
- 'background-color': '#fff'
115
- };
116
- },
323
+ getRowStyle: _getRowStyle,
117
324
  suppressPreset: suppressPreset
118
- // operates={resources}
119
- }, _pagination, _actionsColumn)));
120
- };
325
+ }, _pagination, _actionsColumn, _rowSelection, _export, _batchActions, _others, {
326
+ readFilter: _readFilter,
327
+ renderFunctionArea: renderFunctionArea,
328
+ renderFilterArea: renderFilterArea,
329
+ onGridReady: _handleGridReady,
330
+ onRowClick: _handleRowClick,
331
+ onRowDoubleClick: _handleRowDoubleClick,
332
+ onRowDragged: _handleRowDragged,
333
+ afterInit: _afterInit,
334
+ afterQuery: _afterQuery
335
+ })));
336
+ });
121
337
  LCTable.propTypes = {
122
338
  /**
123
339
  * @name 唯一标识
@@ -129,7 +345,10 @@ LCTable.propTypes = {
129
345
  * @name 数据集
130
346
  * @type _DataSetSelector
131
347
  */
132
- dataset: _propTypes.default.string,
348
+ dataset: _propTypes.default.shape({
349
+ code: _propTypes.default.string.isRequired,
350
+ uid: _propTypes.default.string.isRequired
351
+ }),
133
352
  /**
134
353
  * @name 自动加载
135
354
  * @desc 首次数据是否自动加载,若存在必须带搜索条件再加载的情况,需要关闭
@@ -244,8 +463,106 @@ LCTable.propTypes = {
244
463
  * @name 操作项
245
464
  * @type _TableActions
246
465
  * @groupNext actionsColumn
466
+ * @default {"display": "text", "max": 2, "moreText": "更多行为", "todoList": []}
467
+ */
468
+ actions: _propTypes.default.shape({
469
+ display: _propTypes.default.oneOf(['text', 'button']),
470
+ max: _propTypes.default.number,
471
+ moreText: _propTypes.default.string,
472
+ todoList: _propTypes.default.array
473
+ }),
474
+ /**
475
+ * @name 顶部操作
476
+ * @type _ActionGroup
477
+ * @default {"display": "button", "max": 2, "moreText": "操作", "todoList": []}
478
+ */
479
+ topActionGroup: _propTypes.default.shape({
480
+ display: _propTypes.default.oneOf(['text', 'button']),
481
+ max: _propTypes.default.number,
482
+ moreText: _propTypes.default.string,
483
+ todoList: _propTypes.default.array
484
+ }),
485
+ /**
486
+ * @name 顶部过滤器
487
+ * @type _TableTopFilter
488
+ */
489
+ topFilter: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.array, _propTypes.default.shape({
490
+ options: _propTypes.default.array.isRequired,
491
+ field: _propTypes.default.string.isRequired
492
+ })]),
493
+ /**
494
+ * @name 开启行选择器
495
+ * @type boolean
496
+ * @default false
497
+ */
498
+ rowSelection: _propTypes.default.bool,
499
+ /**
500
+ * @name 停用分页多选
501
+ * @type boolean
502
+ * @default false
503
+ */
504
+ suppressRowSelectionPagination: _propTypes.default.bool,
505
+ /**
506
+ * @name 选择器模式
507
+ * @type segmented
508
+ * @options [{label: '复选', value: 'multiple'}, {label: '单选', value: 'single'}]
509
+ * @default 'multiple'
510
+ */
511
+ rowSelectionMode: _propTypes.default.oneOf(['single', 'multiple']),
512
+ /**
513
+ * @name 默认选中
514
+ * @type _JSEditor
515
+ * @default "function getDefaultRowSelected(data, node, ctx) { \n return false; \n}"
516
+ */
517
+ defaultRowSelectedCode: _propTypes.default.string,
518
+ /**
519
+ * @name 行是否可选
520
+ * @type _JSEditor
521
+ * @default "function getRowSelectable(data, node, ctx) { \n return true; \n}"
522
+ */
523
+ rowSelectableCode: _propTypes.default.string,
524
+ /**
525
+ * @name 导入导出
526
+ * @type _ImpExp
527
+ * @default { "export": true }
528
+ */
529
+ impexp: _propTypes.default.shape({
530
+ import: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string]),
531
+ export: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string])
532
+ }),
533
+ /**
534
+ * @name 批量操作
535
+ * @type _BatchActions
536
+ * @default { "todoList": [] }
537
+ */
538
+ bantchActions: _propTypes.default.shape({
539
+ todoList: _propTypes.default.array
540
+ }),
541
+ /**
542
+ * @name 格式化数据
543
+ * @type _JSEditor
544
+ */
545
+ formatDataSource: _propTypes.default.string,
546
+ /**
547
+ * @name 构建树层级
548
+ * @type _JSEditor
549
+ */
550
+ getDataPath: _propTypes.default.string,
551
+ /**
552
+ * @name 重写表格列
553
+ * @type _JSEditor
554
+ */
555
+ columnsRewrite: _propTypes.default.string,
556
+ /**
557
+ * @name 重置表格列
558
+ * @type _JSEditor
559
+ */
560
+ columnsReset: _propTypes.default.string,
561
+ /**
562
+ * @name model参数
563
+ * @type _JSEditor
247
564
  */
248
- actions: _propTypes.default.array
565
+ modelParams: _propTypes.default.string
249
566
  };
250
- LCTable.defaultProps = (0, _helper.omitBadProps)(_tablePropsDefault.default, ['actionsColumn']);
567
+ LCTable.defaultProps = (0, _helper.omitBadProps)(_tablePropsDefault.default);
251
568
  var _default = exports.default = LCTable;