@luck-design-biz/luckda 0.0.24-1 → 0.0.24-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 (533) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/es/components/Builder/index.js +6 -4
  4. package/es/components/LdAutoForm/index.js +0 -0
  5. package/es/components/LdCard/index.js +0 -0
  6. package/es/components/LdCard/model.js +0 -0
  7. package/es/components/LdCom/index.js +0 -0
  8. package/es/components/LdFormList/index.js +0 -0
  9. package/es/components/LdFormList/model.js +0 -0
  10. package/es/components/LdGrid/index.js +12 -3
  11. package/es/components/LdGrid/model.js +0 -0
  12. package/es/components/LdGridForm/index.js +0 -0
  13. package/es/components/LdGridForm/index.less +0 -0
  14. package/es/components/LdInfoPanel/index.js +0 -0
  15. package/es/components/LdPop/index.js +0 -0
  16. package/es/components/LdRuntimeCom/index.js +0 -0
  17. package/es/components/LdTree/index.js +0 -0
  18. package/es/components/LdTree/index.less +0 -0
  19. package/es/helper/FromItems.js +0 -0
  20. package/es/helper/action.js +0 -0
  21. package/es/helper/form.js +0 -0
  22. package/es/helper/index.less +0 -0
  23. package/es/helper/ldBuilder.js +0 -0
  24. package/es/helper/ldComBuild.js +0 -0
  25. package/es/index.js +0 -0
  26. package/es/lowcode/constants/api-url.js +291 -1
  27. package/es/lowcode/constants/event-topics.js +4 -4
  28. package/es/lowcode/constants/index.js +0 -0
  29. package/es/lowcode/engine/factory/DataFactory.js +0 -0
  30. package/es/lowcode/engine/factory/panel-item-factory/DynamicStrategy.js +0 -0
  31. package/es/lowcode/engine/factory/panel-item-factory/GroupStrategy.js +0 -0
  32. package/es/lowcode/engine/factory/panel-item-factory/NumberStrategy.js +32 -0
  33. package/es/lowcode/engine/factory/panel-item-factory/SegmentedStrategy.js +0 -0
  34. package/es/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +4 -1
  35. package/es/lowcode/engine/factory/panel-item-factory/Strategy.js +0 -0
  36. package/es/lowcode/engine/factory/panel-item-factory/StringStrategy.js +12 -11
  37. package/es/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +11 -1
  38. package/es/lowcode/engine/factory/panel-item-factory/index.js +2 -0
  39. package/es/lowcode/engine/meta/box.props.default.json +0 -0
  40. package/es/lowcode/engine/meta/box.props.json +0 -0
  41. package/es/lowcode/engine/meta/button.props.default.json +0 -0
  42. package/es/lowcode/engine/meta/button.props.json +7 -2
  43. package/es/lowcode/engine/meta/cardlist.props.default.json +0 -0
  44. package/es/lowcode/engine/meta/cardlist.props.json +0 -0
  45. package/es/lowcode/engine/meta/components-list.json +6 -6
  46. package/es/lowcode/engine/meta/dialog.props.default.json +0 -0
  47. package/es/lowcode/engine/meta/dialog.props.json +0 -0
  48. package/es/lowcode/engine/meta/drawer.props.default.json +0 -0
  49. package/es/lowcode/engine/meta/drawer.props.json +0 -0
  50. package/es/lowcode/engine/meta/form.props.default.json +0 -0
  51. package/es/lowcode/engine/meta/form.props.json +0 -0
  52. package/es/lowcode/engine/meta/iframe.props.default.json +0 -0
  53. package/es/lowcode/engine/meta/iframe.props.json +0 -0
  54. package/es/lowcode/engine/meta/image.props.default.json +0 -0
  55. package/es/lowcode/engine/meta/image.props.json +0 -0
  56. package/es/lowcode/engine/meta/imex.props.default.json +0 -0
  57. package/es/lowcode/engine/meta/imex.props.json +0 -0
  58. package/es/lowcode/engine/meta/js-editor/auto-complete.json +28 -28
  59. package/es/lowcode/engine/meta/jsx.props.default.json +0 -0
  60. package/es/lowcode/engine/meta/jsx.props.json +0 -0
  61. package/es/lowcode/engine/meta/layout.props.default.json +0 -0
  62. package/es/lowcode/engine/meta/layout.props.json +0 -0
  63. package/es/lowcode/engine/meta/link.props.default.json +0 -0
  64. package/es/lowcode/engine/meta/link.props.json +0 -0
  65. package/es/lowcode/engine/meta/section.props.default.json +0 -0
  66. package/es/lowcode/engine/meta/section.props.json +0 -0
  67. package/es/lowcode/engine/meta/split.props.default.json +0 -0
  68. package/es/lowcode/engine/meta/split.props.json +0 -0
  69. package/es/lowcode/engine/meta/table.props.default.json +20 -2
  70. package/es/lowcode/engine/meta/table.props.json +99 -37
  71. package/es/lowcode/engine/meta/tabs.props.default.json +0 -0
  72. package/es/lowcode/engine/meta/tabs.props.json +0 -0
  73. package/es/lowcode/engine/meta/text.props.default.json +0 -0
  74. package/es/lowcode/engine/meta/text.props.json +0 -0
  75. package/es/lowcode/engine/meta/tree.props.default.json +0 -0
  76. package/es/lowcode/engine/meta/tree.props.json +0 -0
  77. package/es/lowcode/engine/provider/ContextProvider.js +40 -28
  78. package/es/lowcode/engine/provider/EventBusProvider.js +0 -0
  79. package/es/lowcode/engine/tools/dataProcess.js +5 -3
  80. package/es/lowcode/engine/tools/helper.js +68 -0
  81. package/es/lowcode/engine/tools/usePromiseState.js +0 -0
  82. package/es/lowcode/index.js +3 -1
  83. package/es/lowcode/painter/Components.js +0 -0
  84. package/es/lowcode/painter/Design.js +27 -304
  85. package/es/lowcode/painter/DesignOperator.js +271 -0
  86. package/es/lowcode/painter/DesignToolbar.js +91 -0
  87. package/es/lowcode/painter/I18n.js +0 -0
  88. package/es/lowcode/painter/Outline.js +31 -27
  89. package/es/lowcode/painter/Panel.js +71 -33
  90. package/es/lowcode/painter/Ribbon.js +0 -0
  91. package/es/lowcode/painter/components/Collapse.js +67 -8
  92. package/es/lowcode/painter/components/ColorInput.js +125 -0
  93. package/es/lowcode/painter/components/{TabEditor.js → ListEditor.js} +17 -16
  94. package/es/lowcode/painter/components/NumberInput.js +72 -17
  95. package/es/lowcode/painter/components/PanelItem.js +40 -11
  96. package/es/lowcode/painter/components/PopConfirm.js +4 -1
  97. package/es/lowcode/painter/components/PopForm.js +0 -0
  98. package/es/lowcode/painter/components/RuleInput.js +5 -3
  99. package/es/lowcode/painter/components/SortBox.js +0 -0
  100. package/es/lowcode/painter/components/actions-editor/ActionEditor.js +147 -0
  101. package/es/lowcode/painter/components/actions-editor/index.js +170 -0
  102. package/es/lowcode/painter/components/code-editor/BaseEditor.js +42 -64
  103. package/es/lowcode/painter/components/code-editor/CssEditor.js +27 -0
  104. package/es/lowcode/painter/components/code-editor/FullScreenEditor.js +37 -14
  105. package/es/lowcode/painter/components/code-editor/JSEditor.js +22 -0
  106. package/es/lowcode/painter/components/code-editor/index.js +0 -0
  107. package/es/lowcode/painter/index.js +6 -2
  108. package/es/lowcode/painter/panel-section/ButtonType.js +0 -0
  109. package/es/lowcode/painter/panel-section/DataSetSelector.js +61 -0
  110. package/es/lowcode/painter/panel-section/Icon.js +0 -0
  111. package/es/lowcode/painter/panel-section/IconSelector.js +0 -0
  112. package/es/lowcode/painter/panel-section/LayoutRatio.js +2 -1
  113. package/es/lowcode/painter/panel-section/StylePanel/BackGround.js +61 -0
  114. package/es/lowcode/painter/panel-section/StylePanel/Border.js +150 -0
  115. package/es/lowcode/painter/panel-section/StylePanel/BorderRadius.js +87 -0
  116. package/es/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +66 -0
  117. package/es/lowcode/painter/panel-section/StylePanel/BorderSelector.js +66 -0
  118. package/es/lowcode/painter/panel-section/StylePanel/Display.js +15 -11
  119. package/es/lowcode/painter/panel-section/StylePanel/DisplaySvg.js +0 -0
  120. package/es/lowcode/painter/panel-section/StylePanel/Font.js +162 -0
  121. package/es/lowcode/painter/panel-section/StylePanel/FontEditor.js +386 -0
  122. package/es/lowcode/painter/panel-section/StylePanel/GapSelector.js +78 -0
  123. package/es/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +23 -0
  124. package/es/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +20 -0
  125. package/es/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +23 -0
  126. package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +42 -10
  127. package/es/lowcode/painter/panel-section/StylePanel/Margin.js +60 -0
  128. package/es/lowcode/painter/panel-section/StylePanel/Opacity.js +50 -0
  129. package/es/lowcode/painter/panel-section/StylePanel/Padding.js +61 -0
  130. package/es/lowcode/painter/panel-section/StylePanel/Pointer.js +41 -0
  131. package/es/lowcode/painter/panel-section/StylePanel/Shadow.js +216 -0
  132. package/es/lowcode/painter/panel-section/StylePanel/Size.js +53 -0
  133. package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +55 -8
  134. package/es/lowcode/painter/panel-section/StylePanel/StyleRow.js +16 -0
  135. package/es/lowcode/painter/panel-section/StylePanel/{Height.js → WidthHeight.js} +23 -20
  136. package/es/lowcode/painter/panel-section/StylePanel/index.js +17 -0
  137. package/es/lowcode/painter/panel-section/TabItems.js +7 -37
  138. package/es/lowcode/painter/panel-section/TableActions.js +19 -0
  139. package/es/lowcode/painter/panel-section/TableZebra.js +14 -0
  140. package/es/lowcode/painter/panel-section/WidthHeight.js +39 -0
  141. package/es/lowcode/painter/services/I18n.js +0 -0
  142. package/es/lowcode/painter/style/actions-editor.less +16 -0
  143. package/es/lowcode/painter/style/border-editor.less +36 -0
  144. package/es/lowcode/painter/style/border-radius-selector.less +43 -0
  145. package/es/lowcode/painter/style/border-selector.less +40 -0
  146. package/es/lowcode/painter/style/button-type.less +0 -0
  147. package/es/lowcode/painter/style/collapse.less +2 -1
  148. package/es/lowcode/painter/style/color-input.less +19 -0
  149. package/es/lowcode/painter/style/components.less +0 -0
  150. package/es/lowcode/painter/style/design.less +7 -0
  151. package/es/lowcode/painter/style/display.less +0 -0
  152. package/es/lowcode/painter/style/font-editor.less +9 -0
  153. package/es/lowcode/painter/style/fullscreen-editor.less +0 -0
  154. package/es/lowcode/painter/style/icon-selector.less +0 -0
  155. package/es/lowcode/painter/style/icon.less +0 -0
  156. package/es/lowcode/painter/style/index.less +0 -0
  157. package/es/lowcode/painter/style/layout-ratio.less +0 -0
  158. package/{lib/lowcode/painter/style/tabeditor.less → es/lowcode/painter/style/list-editor.less} +9 -40
  159. package/es/lowcode/painter/style/number-input.less +0 -0
  160. package/es/lowcode/painter/style/outline.less +0 -0
  161. package/es/lowcode/painter/style/panel-item.less +11 -1
  162. package/es/lowcode/painter/style/panel.less +3 -16
  163. package/es/lowcode/painter/style/pop-confirm.less +0 -0
  164. package/es/lowcode/painter/style/pop-form.less +0 -0
  165. package/es/lowcode/painter/style/radio.less +0 -0
  166. package/es/lowcode/painter/style/ribbon.less +0 -0
  167. package/es/lowcode/painter/style/rule-input.less +0 -0
  168. package/es/lowcode/painter/style/style-panel.less +32 -0
  169. package/es/lowcode/painter/style/tabitems.less +0 -0
  170. package/es/lowcode/view/Canvas.js +16 -15
  171. package/es/lowcode/view/Loading.js +0 -0
  172. package/es/lowcode/view/Page.js +10 -225
  173. package/es/lowcode/view/index.js +5 -6
  174. package/es/lowcode/view/lc-components/Box/FunctionDesign.js +0 -0
  175. package/es/lowcode/view/lc-components/Box/FunctionLive.js +0 -0
  176. package/es/lowcode/view/lc-components/Box/index.js +2 -2
  177. package/es/lowcode/view/lc-components/Box/index.less +0 -0
  178. package/es/lowcode/view/lc-components/Box/meta.json +0 -0
  179. package/es/lowcode/view/lc-components/Button/FunctionDesign.js +0 -0
  180. package/es/lowcode/view/lc-components/Button/FunctionLive.js +0 -0
  181. package/es/lowcode/view/lc-components/Button/index.js +10 -7
  182. package/es/lowcode/view/lc-components/Button/meta.json +7 -2
  183. package/es/lowcode/view/lc-components/Button/style.less +3 -0
  184. package/es/lowcode/view/lc-components/CardList/FunctionDesign.js +0 -0
  185. package/es/lowcode/view/lc-components/CardList/FunctionLive.js +0 -0
  186. package/es/lowcode/view/lc-components/CardList/index.js +0 -0
  187. package/es/lowcode/view/lc-components/CardList/meta.json +0 -0
  188. package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +48 -3
  189. package/es/lowcode/view/lc-components/Dialog/FunctionLive.js +0 -0
  190. package/es/lowcode/view/lc-components/Dialog/index.js +21 -23
  191. package/es/lowcode/view/lc-components/Dialog/index.less +1 -1
  192. package/es/lowcode/view/lc-components/Dialog/meta.json +0 -0
  193. package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +13 -2
  194. package/es/lowcode/view/lc-components/Drawer/FunctionLive.js +0 -0
  195. package/es/lowcode/view/lc-components/Drawer/index.js +19 -22
  196. package/es/lowcode/view/lc-components/Drawer/{style.less → index.less} +1 -1
  197. package/es/lowcode/view/lc-components/Drawer/meta.json +0 -0
  198. package/es/lowcode/view/lc-components/Form/FunctionDesign.js +0 -0
  199. package/es/lowcode/view/lc-components/Form/FunctionLive.js +0 -0
  200. package/es/lowcode/view/lc-components/Form/index.js +0 -0
  201. package/es/lowcode/view/lc-components/Form/meta.json +0 -0
  202. package/es/lowcode/view/lc-components/Iframe/FunctionDesign.js +0 -0
  203. package/es/lowcode/view/lc-components/Iframe/FunctionLive.js +0 -0
  204. package/es/lowcode/view/lc-components/Iframe/index.js +0 -0
  205. package/es/lowcode/view/lc-components/Iframe/meta.json +0 -0
  206. package/es/lowcode/view/lc-components/ImEx/FunctionDesign.js +0 -0
  207. package/es/lowcode/view/lc-components/ImEx/FunctionLive.js +0 -0
  208. package/es/lowcode/view/lc-components/ImEx/index.js +0 -0
  209. package/es/lowcode/view/lc-components/ImEx/meta.json +0 -0
  210. package/es/lowcode/view/lc-components/Image/FunctionDesign.js +0 -0
  211. package/es/lowcode/view/lc-components/Image/FunctionLive.js +0 -0
  212. package/es/lowcode/view/lc-components/Image/index.js +0 -0
  213. package/es/lowcode/view/lc-components/Image/meta.json +0 -0
  214. package/es/lowcode/view/lc-components/JSX/FunctionDesign.js +0 -0
  215. package/es/lowcode/view/lc-components/JSX/FunctionLive.js +0 -0
  216. package/es/lowcode/view/lc-components/JSX/index.js +0 -0
  217. package/es/lowcode/view/lc-components/JSX/meta.json +0 -0
  218. package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +0 -0
  219. package/es/lowcode/view/lc-components/Layout/FunctionLive.js +0 -0
  220. package/es/lowcode/view/lc-components/Layout/index.js +0 -0
  221. package/es/lowcode/view/lc-components/Layout/index.less +0 -0
  222. package/es/lowcode/view/lc-components/Layout/meta.json +0 -0
  223. package/es/lowcode/view/lc-components/Link/FunctionDesign.js +0 -0
  224. package/es/lowcode/view/lc-components/Link/FunctionLive.js +0 -0
  225. package/es/lowcode/view/lc-components/Link/index.js +0 -0
  226. package/es/lowcode/view/lc-components/Link/meta.json +0 -0
  227. package/es/lowcode/view/lc-components/Section/FunctionDesign.js +0 -0
  228. package/es/lowcode/view/lc-components/Section/FunctionLive.js +0 -0
  229. package/es/lowcode/view/lc-components/Section/index.js +0 -0
  230. package/es/lowcode/view/lc-components/Section/meta.json +0 -0
  231. package/es/lowcode/view/lc-components/Split/FunctionDesign.js +0 -0
  232. package/es/lowcode/view/lc-components/Split/FunctionLive.js +0 -0
  233. package/es/lowcode/view/lc-components/Split/index.js +0 -0
  234. package/es/lowcode/view/lc-components/Split/meta.json +0 -0
  235. package/es/lowcode/view/lc-components/Table/FunctionDesign.js +4 -2
  236. package/es/lowcode/view/lc-components/Table/FunctionLive.js +0 -0
  237. package/es/lowcode/view/lc-components/Table/index.js +222 -132
  238. package/es/lowcode/view/lc-components/Table/meta.json +88 -37
  239. package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +0 -0
  240. package/es/lowcode/view/lc-components/Tabs/FunctionLive.js +0 -0
  241. package/es/lowcode/view/lc-components/Tabs/index.js +0 -0
  242. package/es/lowcode/view/lc-components/Tabs/meta.json +0 -0
  243. package/es/lowcode/view/lc-components/Text/FunctionDesign.js +0 -0
  244. package/es/lowcode/view/lc-components/Text/FunctionLive.js +0 -0
  245. package/es/lowcode/view/lc-components/Text/index.js +0 -0
  246. package/es/lowcode/view/lc-components/Text/meta.json +0 -0
  247. package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +0 -0
  248. package/es/lowcode/view/lc-components/Tree/FunctionLive.js +0 -0
  249. package/es/lowcode/view/lc-components/Tree/index.js +0 -0
  250. package/es/lowcode/view/lc-components/Tree/meta.json +0 -0
  251. package/es/lowcode/view/lc-components/Wrapper.js +0 -0
  252. package/es/lowcode/view/style/canvas.less +0 -0
  253. package/es/lowcode/view/style/loading.less +0 -0
  254. package/es/lowcode/view/style/page.less +0 -0
  255. package/es/services.js +0 -0
  256. package/es/upload/Form/gridForm.js +0 -0
  257. package/es/upload/Form/index.js +0 -0
  258. package/es/upload/Form/index.less +0 -0
  259. package/es/upload/FormItem/index.js +0 -0
  260. package/es/upload/GridCell/index.js +0 -0
  261. package/es/upload/index.js +0 -0
  262. package/es/utils/action.js +0 -0
  263. package/es/utils/form.js +0 -0
  264. package/es/utils/grid.js +0 -0
  265. package/es/utils/index.js +0 -0
  266. package/lib/components/Builder/index.js +5 -3
  267. package/lib/components/LdAutoForm/index.js +0 -0
  268. package/lib/components/LdCard/index.js +0 -0
  269. package/lib/components/LdCard/model.js +0 -0
  270. package/lib/components/LdCom/index.js +0 -0
  271. package/lib/components/LdFormList/index.js +0 -0
  272. package/lib/components/LdFormList/model.js +0 -0
  273. package/lib/components/LdGrid/index.js +12 -3
  274. package/lib/components/LdGrid/model.js +0 -0
  275. package/lib/components/LdGridForm/index.js +0 -0
  276. package/lib/components/LdGridForm/index.less +0 -0
  277. package/lib/components/LdInfoPanel/index.js +0 -0
  278. package/lib/components/LdPop/index.js +0 -0
  279. package/lib/components/LdRuntimeCom/index.js +0 -0
  280. package/lib/components/LdTree/index.js +0 -0
  281. package/lib/components/LdTree/index.less +0 -0
  282. package/lib/helper/FromItems.js +0 -0
  283. package/lib/helper/action.js +0 -0
  284. package/lib/helper/form.js +0 -0
  285. package/lib/helper/index.less +0 -0
  286. package/lib/helper/ldBuilder.js +0 -0
  287. package/lib/helper/ldComBuild.js +0 -0
  288. package/lib/index.js +0 -0
  289. package/lib/lowcode/constants/api-url.js +293 -2
  290. package/lib/lowcode/constants/event-topics.js +5 -5
  291. package/lib/lowcode/constants/index.js +0 -0
  292. package/lib/lowcode/engine/factory/DataFactory.js +0 -0
  293. package/lib/lowcode/engine/factory/panel-item-factory/DynamicStrategy.js +0 -0
  294. package/lib/lowcode/engine/factory/panel-item-factory/GroupStrategy.js +0 -0
  295. package/lib/lowcode/engine/factory/panel-item-factory/NumberStrategy.js +38 -0
  296. package/lib/lowcode/engine/factory/panel-item-factory/SegmentedStrategy.js +0 -0
  297. package/lib/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +4 -1
  298. package/lib/lowcode/engine/factory/panel-item-factory/Strategy.js +0 -0
  299. package/lib/lowcode/engine/factory/panel-item-factory/StringStrategy.js +11 -10
  300. package/lib/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +11 -1
  301. package/lib/lowcode/engine/factory/panel-item-factory/index.js +2 -0
  302. package/lib/lowcode/engine/meta/box.props.default.json +0 -0
  303. package/lib/lowcode/engine/meta/box.props.json +0 -0
  304. package/lib/lowcode/engine/meta/button.props.default.json +0 -0
  305. package/lib/lowcode/engine/meta/button.props.json +7 -2
  306. package/lib/lowcode/engine/meta/cardlist.props.default.json +0 -0
  307. package/lib/lowcode/engine/meta/cardlist.props.json +0 -0
  308. package/lib/lowcode/engine/meta/components-list.json +6 -6
  309. package/lib/lowcode/engine/meta/dialog.props.default.json +0 -0
  310. package/lib/lowcode/engine/meta/dialog.props.json +0 -0
  311. package/lib/lowcode/engine/meta/drawer.props.default.json +0 -0
  312. package/lib/lowcode/engine/meta/drawer.props.json +0 -0
  313. package/lib/lowcode/engine/meta/form.props.default.json +0 -0
  314. package/lib/lowcode/engine/meta/form.props.json +0 -0
  315. package/lib/lowcode/engine/meta/iframe.props.default.json +0 -0
  316. package/lib/lowcode/engine/meta/iframe.props.json +0 -0
  317. package/lib/lowcode/engine/meta/image.props.default.json +0 -0
  318. package/lib/lowcode/engine/meta/image.props.json +0 -0
  319. package/lib/lowcode/engine/meta/imex.props.default.json +0 -0
  320. package/lib/lowcode/engine/meta/imex.props.json +0 -0
  321. package/lib/lowcode/engine/meta/js-editor/auto-complete.json +28 -28
  322. package/lib/lowcode/engine/meta/jsx.props.default.json +0 -0
  323. package/lib/lowcode/engine/meta/jsx.props.json +0 -0
  324. package/lib/lowcode/engine/meta/layout.props.default.json +0 -0
  325. package/lib/lowcode/engine/meta/layout.props.json +0 -0
  326. package/lib/lowcode/engine/meta/link.props.default.json +0 -0
  327. package/lib/lowcode/engine/meta/link.props.json +0 -0
  328. package/lib/lowcode/engine/meta/section.props.default.json +0 -0
  329. package/lib/lowcode/engine/meta/section.props.json +0 -0
  330. package/lib/lowcode/engine/meta/split.props.default.json +0 -0
  331. package/lib/lowcode/engine/meta/split.props.json +0 -0
  332. package/lib/lowcode/engine/meta/table.props.default.json +20 -2
  333. package/lib/lowcode/engine/meta/table.props.json +99 -37
  334. package/lib/lowcode/engine/meta/tabs.props.default.json +0 -0
  335. package/lib/lowcode/engine/meta/tabs.props.json +0 -0
  336. package/lib/lowcode/engine/meta/text.props.default.json +0 -0
  337. package/lib/lowcode/engine/meta/text.props.json +0 -0
  338. package/lib/lowcode/engine/meta/tree.props.default.json +0 -0
  339. package/lib/lowcode/engine/meta/tree.props.json +0 -0
  340. package/lib/lowcode/engine/provider/ContextProvider.js +40 -28
  341. package/lib/lowcode/engine/provider/EventBusProvider.js +0 -0
  342. package/lib/lowcode/engine/tools/dataProcess.js +5 -3
  343. package/lib/lowcode/engine/tools/helper.js +70 -0
  344. package/lib/lowcode/engine/tools/usePromiseState.js +0 -0
  345. package/lib/lowcode/index.js +5 -1
  346. package/lib/lowcode/painter/Components.js +0 -0
  347. package/lib/lowcode/painter/Design.js +24 -300
  348. package/lib/lowcode/painter/DesignOperator.js +278 -0
  349. package/lib/lowcode/painter/DesignToolbar.js +99 -0
  350. package/lib/lowcode/painter/I18n.js +0 -0
  351. package/lib/lowcode/painter/Outline.js +31 -27
  352. package/lib/lowcode/painter/Panel.js +71 -33
  353. package/lib/lowcode/painter/Ribbon.js +0 -0
  354. package/lib/lowcode/painter/components/Collapse.js +65 -7
  355. package/lib/lowcode/painter/components/ColorInput.js +132 -0
  356. package/lib/lowcode/painter/components/{TabEditor.js → ListEditor.js} +19 -18
  357. package/lib/lowcode/painter/components/NumberInput.js +70 -16
  358. package/lib/lowcode/painter/components/PanelItem.js +40 -11
  359. package/lib/lowcode/painter/components/PopConfirm.js +4 -1
  360. package/lib/lowcode/painter/components/PopForm.js +0 -0
  361. package/lib/lowcode/painter/components/RuleInput.js +5 -3
  362. package/lib/lowcode/painter/components/SortBox.js +0 -0
  363. package/lib/lowcode/painter/components/actions-editor/ActionEditor.js +155 -0
  364. package/lib/lowcode/painter/components/actions-editor/index.js +178 -0
  365. package/lib/lowcode/painter/components/code-editor/BaseEditor.js +40 -63
  366. package/lib/lowcode/painter/components/code-editor/CssEditor.js +26 -0
  367. package/lib/lowcode/painter/components/code-editor/FullScreenEditor.js +35 -13
  368. package/lib/lowcode/painter/components/code-editor/JSEditor.js +22 -0
  369. package/lib/lowcode/painter/components/code-editor/index.js +0 -0
  370. package/lib/lowcode/painter/index.js +6 -2
  371. package/lib/lowcode/painter/panel-section/ButtonType.js +0 -0
  372. package/lib/lowcode/painter/panel-section/DataSetSelector.js +69 -0
  373. package/lib/lowcode/painter/panel-section/Icon.js +0 -0
  374. package/lib/lowcode/painter/panel-section/IconSelector.js +0 -0
  375. package/lib/lowcode/painter/panel-section/LayoutRatio.js +2 -1
  376. package/lib/lowcode/painter/panel-section/StylePanel/BackGround.js +68 -0
  377. package/lib/lowcode/painter/panel-section/StylePanel/Border.js +158 -0
  378. package/lib/lowcode/painter/panel-section/StylePanel/BorderRadius.js +95 -0
  379. package/lib/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +73 -0
  380. package/lib/lowcode/painter/panel-section/StylePanel/BorderSelector.js +73 -0
  381. package/lib/lowcode/painter/panel-section/StylePanel/Display.js +15 -11
  382. package/lib/lowcode/painter/panel-section/StylePanel/DisplaySvg.js +0 -0
  383. package/lib/lowcode/painter/panel-section/StylePanel/Font.js +170 -0
  384. package/lib/lowcode/painter/panel-section/StylePanel/FontEditor.js +392 -0
  385. package/lib/lowcode/painter/panel-section/StylePanel/GapSelector.js +85 -0
  386. package/lib/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +29 -0
  387. package/lib/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +26 -0
  388. package/lib/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +29 -0
  389. package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +40 -9
  390. package/lib/lowcode/painter/panel-section/StylePanel/Margin.js +67 -0
  391. package/lib/lowcode/painter/panel-section/StylePanel/Opacity.js +57 -0
  392. package/lib/lowcode/painter/panel-section/StylePanel/Padding.js +68 -0
  393. package/lib/lowcode/painter/panel-section/StylePanel/Pointer.js +48 -0
  394. package/lib/lowcode/painter/panel-section/StylePanel/Shadow.js +224 -0
  395. package/lib/lowcode/painter/panel-section/StylePanel/{Width.js → Size.js} +39 -35
  396. package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +55 -8
  397. package/lib/lowcode/painter/panel-section/StylePanel/StyleRow.js +22 -0
  398. package/lib/lowcode/painter/panel-section/StylePanel/{Height.js → WidthHeight.js} +22 -19
  399. package/lib/lowcode/painter/panel-section/StylePanel/index.js +16 -0
  400. package/lib/lowcode/painter/panel-section/TabItems.js +7 -37
  401. package/lib/lowcode/painter/panel-section/TableActions.js +26 -0
  402. package/lib/lowcode/painter/panel-section/TableZebra.js +21 -0
  403. package/lib/lowcode/painter/panel-section/WidthHeight.js +46 -0
  404. package/lib/lowcode/painter/services/I18n.js +0 -0
  405. package/lib/lowcode/painter/style/actions-editor.less +16 -0
  406. package/lib/lowcode/painter/style/border-editor.less +36 -0
  407. package/lib/lowcode/painter/style/border-radius-selector.less +43 -0
  408. package/lib/lowcode/painter/style/border-selector.less +40 -0
  409. package/lib/lowcode/painter/style/button-type.less +0 -0
  410. package/lib/lowcode/painter/style/collapse.less +2 -1
  411. package/lib/lowcode/painter/style/color-input.less +19 -0
  412. package/lib/lowcode/painter/style/components.less +0 -0
  413. package/lib/lowcode/painter/style/design.less +7 -0
  414. package/lib/lowcode/painter/style/display.less +0 -0
  415. package/lib/lowcode/painter/style/font-editor.less +9 -0
  416. package/lib/lowcode/painter/style/fullscreen-editor.less +0 -0
  417. package/lib/lowcode/painter/style/icon-selector.less +0 -0
  418. package/lib/lowcode/painter/style/icon.less +0 -0
  419. package/lib/lowcode/painter/style/index.less +0 -0
  420. package/lib/lowcode/painter/style/layout-ratio.less +0 -0
  421. package/{es/lowcode/painter/style/tabeditor.less → lib/lowcode/painter/style/list-editor.less} +9 -40
  422. package/lib/lowcode/painter/style/number-input.less +0 -0
  423. package/lib/lowcode/painter/style/outline.less +0 -0
  424. package/lib/lowcode/painter/style/panel-item.less +11 -1
  425. package/lib/lowcode/painter/style/panel.less +3 -16
  426. package/lib/lowcode/painter/style/pop-confirm.less +0 -0
  427. package/lib/lowcode/painter/style/pop-form.less +0 -0
  428. package/lib/lowcode/painter/style/radio.less +0 -0
  429. package/lib/lowcode/painter/style/ribbon.less +0 -0
  430. package/lib/lowcode/painter/style/rule-input.less +0 -0
  431. package/lib/lowcode/painter/style/style-panel.less +32 -0
  432. package/lib/lowcode/painter/style/tabitems.less +0 -0
  433. package/lib/lowcode/view/Canvas.js +16 -15
  434. package/lib/lowcode/view/Loading.js +0 -0
  435. package/lib/lowcode/view/Page.js +9 -224
  436. package/lib/lowcode/view/index.js +5 -6
  437. package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +0 -0
  438. package/lib/lowcode/view/lc-components/Box/FunctionLive.js +0 -0
  439. package/lib/lowcode/view/lc-components/Box/index.js +2 -2
  440. package/lib/lowcode/view/lc-components/Box/index.less +0 -0
  441. package/lib/lowcode/view/lc-components/Box/meta.json +0 -0
  442. package/lib/lowcode/view/lc-components/Button/FunctionDesign.js +0 -0
  443. package/lib/lowcode/view/lc-components/Button/FunctionLive.js +0 -0
  444. package/lib/lowcode/view/lc-components/Button/index.js +10 -7
  445. package/lib/lowcode/view/lc-components/Button/meta.json +7 -2
  446. package/lib/lowcode/view/lc-components/Button/style.less +3 -0
  447. package/lib/lowcode/view/lc-components/CardList/FunctionDesign.js +0 -0
  448. package/lib/lowcode/view/lc-components/CardList/FunctionLive.js +0 -0
  449. package/lib/lowcode/view/lc-components/CardList/index.js +0 -0
  450. package/lib/lowcode/view/lc-components/CardList/meta.json +0 -0
  451. package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +49 -3
  452. package/lib/lowcode/view/lc-components/Dialog/FunctionLive.js +0 -0
  453. package/lib/lowcode/view/lc-components/Dialog/index.js +20 -22
  454. package/lib/lowcode/view/lc-components/Dialog/index.less +1 -1
  455. package/lib/lowcode/view/lc-components/Dialog/meta.json +0 -0
  456. package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +13 -2
  457. package/lib/lowcode/view/lc-components/Drawer/FunctionLive.js +0 -0
  458. package/lib/lowcode/view/lc-components/Drawer/index.js +18 -21
  459. package/lib/lowcode/view/lc-components/Drawer/{style.less → index.less} +1 -1
  460. package/lib/lowcode/view/lc-components/Drawer/meta.json +0 -0
  461. package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +0 -0
  462. package/lib/lowcode/view/lc-components/Form/FunctionLive.js +0 -0
  463. package/lib/lowcode/view/lc-components/Form/index.js +0 -0
  464. package/lib/lowcode/view/lc-components/Form/meta.json +0 -0
  465. package/lib/lowcode/view/lc-components/Iframe/FunctionDesign.js +0 -0
  466. package/lib/lowcode/view/lc-components/Iframe/FunctionLive.js +0 -0
  467. package/lib/lowcode/view/lc-components/Iframe/index.js +0 -0
  468. package/lib/lowcode/view/lc-components/Iframe/meta.json +0 -0
  469. package/lib/lowcode/view/lc-components/ImEx/FunctionDesign.js +0 -0
  470. package/lib/lowcode/view/lc-components/ImEx/FunctionLive.js +0 -0
  471. package/lib/lowcode/view/lc-components/ImEx/index.js +0 -0
  472. package/lib/lowcode/view/lc-components/ImEx/meta.json +0 -0
  473. package/lib/lowcode/view/lc-components/Image/FunctionDesign.js +0 -0
  474. package/lib/lowcode/view/lc-components/Image/FunctionLive.js +0 -0
  475. package/lib/lowcode/view/lc-components/Image/index.js +0 -0
  476. package/lib/lowcode/view/lc-components/Image/meta.json +0 -0
  477. package/lib/lowcode/view/lc-components/JSX/FunctionDesign.js +0 -0
  478. package/lib/lowcode/view/lc-components/JSX/FunctionLive.js +0 -0
  479. package/lib/lowcode/view/lc-components/JSX/index.js +0 -0
  480. package/lib/lowcode/view/lc-components/JSX/meta.json +0 -0
  481. package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +0 -0
  482. package/lib/lowcode/view/lc-components/Layout/FunctionLive.js +0 -0
  483. package/lib/lowcode/view/lc-components/Layout/index.js +0 -0
  484. package/lib/lowcode/view/lc-components/Layout/index.less +0 -0
  485. package/lib/lowcode/view/lc-components/Layout/meta.json +0 -0
  486. package/lib/lowcode/view/lc-components/Link/FunctionDesign.js +0 -0
  487. package/lib/lowcode/view/lc-components/Link/FunctionLive.js +0 -0
  488. package/lib/lowcode/view/lc-components/Link/index.js +0 -0
  489. package/lib/lowcode/view/lc-components/Link/meta.json +0 -0
  490. package/lib/lowcode/view/lc-components/Section/FunctionDesign.js +0 -0
  491. package/lib/lowcode/view/lc-components/Section/FunctionLive.js +0 -0
  492. package/lib/lowcode/view/lc-components/Section/index.js +0 -0
  493. package/lib/lowcode/view/lc-components/Section/meta.json +0 -0
  494. package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +0 -0
  495. package/lib/lowcode/view/lc-components/Split/FunctionLive.js +0 -0
  496. package/lib/lowcode/view/lc-components/Split/index.js +0 -0
  497. package/lib/lowcode/view/lc-components/Split/meta.json +0 -0
  498. package/lib/lowcode/view/lc-components/Table/FunctionDesign.js +4 -2
  499. package/lib/lowcode/view/lc-components/Table/FunctionLive.js +0 -0
  500. package/lib/lowcode/view/lc-components/Table/index.js +221 -131
  501. package/lib/lowcode/view/lc-components/Table/meta.json +88 -37
  502. package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +0 -0
  503. package/lib/lowcode/view/lc-components/Tabs/FunctionLive.js +0 -0
  504. package/lib/lowcode/view/lc-components/Tabs/index.js +0 -0
  505. package/lib/lowcode/view/lc-components/Tabs/meta.json +0 -0
  506. package/lib/lowcode/view/lc-components/Text/FunctionDesign.js +0 -0
  507. package/lib/lowcode/view/lc-components/Text/FunctionLive.js +0 -0
  508. package/lib/lowcode/view/lc-components/Text/index.js +0 -0
  509. package/lib/lowcode/view/lc-components/Text/meta.json +0 -0
  510. package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +0 -0
  511. package/lib/lowcode/view/lc-components/Tree/FunctionLive.js +0 -0
  512. package/lib/lowcode/view/lc-components/Tree/index.js +0 -0
  513. package/lib/lowcode/view/lc-components/Tree/meta.json +0 -0
  514. package/lib/lowcode/view/lc-components/Wrapper.js +0 -0
  515. package/lib/lowcode/view/style/canvas.less +0 -0
  516. package/lib/lowcode/view/style/loading.less +0 -0
  517. package/lib/lowcode/view/style/page.less +0 -0
  518. package/lib/services.js +0 -0
  519. package/lib/upload/Form/gridForm.js +0 -0
  520. package/lib/upload/Form/index.js +0 -0
  521. package/lib/upload/Form/index.less +0 -0
  522. package/lib/upload/FormItem/index.js +0 -0
  523. package/lib/upload/GridCell/index.js +0 -0
  524. package/lib/upload/index.js +0 -0
  525. package/lib/utils/action.js +0 -0
  526. package/lib/utils/form.js +0 -0
  527. package/lib/utils/grid.js +0 -0
  528. package/lib/utils/index.js +0 -0
  529. package/lowcode.js +0 -0
  530. package/package.json +7 -5
  531. package/upload.js +0 -0
  532. package/utils.js +0 -0
  533. package/es/lowcode/painter/panel-section/StylePanel/Width.js +0 -48
@@ -0,0 +1,170 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import React, { useRef, useReducer } from 'react';
3
+ import { useMemoizedFn } from 'ahooks';
4
+ import { Tooltip, Icon, Segmented, InputNumber } from 'luck-design/antd';
5
+ import { cloneDeep } from 'lodash';
6
+ import ActionEditor from "./ActionEditor";
7
+ import PanelItem from "../PanelItem";
8
+ import { SortBox, SortItem } from "../../components/SortBox";
9
+ import { ListEditor, ListEditorItem } from "../../components/ListEditor";
10
+ import PopConfirm from "../../components/PopConfirm";
11
+ import { formatMessage, suid } from '@luck-design-biz/base/utils';
12
+ import { listReducer } from "../../../engine/tools/helper";
13
+ import styles from "../../style/actions-editor.less";
14
+ var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.actionsEditor';
15
+ var _DISPLAY_OPTIONS_ = [{
16
+ label: formatMessage({
17
+ id: "".concat(_I18N_PREFIX_, ".button"),
18
+ label: '按钮'
19
+ }),
20
+ value: 'button'
21
+ }, {
22
+ label: formatMessage({
23
+ id: "".concat(_I18N_PREFIX_, ".text"),
24
+ label: '文本'
25
+ }),
26
+ value: 'text'
27
+ }];
28
+ var ActionsEditor = function ActionsEditor(_ref) {
29
+ var defaultValue = _ref.defaultValue,
30
+ onChange = _ref.onChange;
31
+ var valueRef = useRef(cloneDeep(defaultValue));
32
+ var _useReducer = useReducer(listReducer, defaultValue.todoList || []),
33
+ _useReducer2 = _slicedToArray(_useReducer, 2),
34
+ todoList = _useReducer2[0],
35
+ dispatch = _useReducer2[1];
36
+ var handleAdd = useMemoizedFn(function () {
37
+ dispatch({
38
+ type: 'add',
39
+ payload: {
40
+ id: suid(),
41
+ name: "\u64CD\u4F5C".concat(todoList.length + 1),
42
+ serial: void 0,
43
+ serialEffect: 'hidden',
44
+ riskLevel: 'default',
45
+ actionPool: [],
46
+ actionCode: void 0
47
+ },
48
+ callback: function callback(newActions) {
49
+ valueRef.current.todoList = newActions;
50
+ onChange(valueRef.current);
51
+ }
52
+ });
53
+ });
54
+ var handleSortChange = useMemoizedFn(function (sortItems) {
55
+ dispatch({
56
+ type: 'sort',
57
+ payload: sortItems,
58
+ callback: function callback(newActions) {
59
+ valueRef.current.todoList = newActions;
60
+ onChange(valueRef.current);
61
+ }
62
+ });
63
+ });
64
+ var handleValueChange = useMemoizedFn(function (field, value) {
65
+ if (field === 'action') {
66
+ dispatch({
67
+ type: 'edit',
68
+ payload: {
69
+ id: value.id,
70
+ data: value
71
+ },
72
+ callback: function callback(newActions) {
73
+ valueRef.current.todoList = newActions;
74
+ }
75
+ });
76
+ } else {
77
+ valueRef.current[field] = value;
78
+ }
79
+ onChange(valueRef.current);
80
+ });
81
+ var renderItemRight = useMemoizedFn(function (action) {
82
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
83
+ title: formatMessage({
84
+ id: 'luckda.lowcode.painter.edit',
85
+ label: '编辑'
86
+ })
87
+ }, /*#__PURE__*/React.createElement(PopConfirm, {
88
+ placement: "left",
89
+ title: /*#__PURE__*/React.createElement(ActionEditor, {
90
+ action: action,
91
+ onChange: function onChange(value) {
92
+ return handleValueChange('action', value);
93
+ }
94
+ })
95
+ }, /*#__PURE__*/React.createElement(Icon, {
96
+ type: "edit",
97
+ style: {
98
+ marginRight: '8px',
99
+ cursor: 'pointer'
100
+ }
101
+ }))), /*#__PURE__*/React.createElement(Tooltip, {
102
+ title: formatMessage({
103
+ id: 'luckda.lowcode.painter.delete',
104
+ label: '删除'
105
+ })
106
+ }, /*#__PURE__*/React.createElement(Icon, {
107
+ type: "delete",
108
+ style: {
109
+ marginRight: '8px',
110
+ cursor: 'pointer'
111
+ }
112
+ })));
113
+ });
114
+ return /*#__PURE__*/React.createElement("div", {
115
+ className: styles['lc-painter-panel-section-components-actionsEditor']
116
+ }, /*#__PURE__*/React.createElement("div", {
117
+ style: {
118
+ width: '100%',
119
+ padding: '0 16px'
120
+ }
121
+ }, /*#__PURE__*/React.createElement(PanelItem, {
122
+ suppressPadding: true,
123
+ label: formatMessage({
124
+ id: "".concat(_I18N_PREFIX_, ".display"),
125
+ label: '展现形式'
126
+ })
127
+ }, /*#__PURE__*/React.createElement(Segmented, {
128
+ size: "small",
129
+ options: _DISPLAY_OPTIONS_,
130
+ defaultValue: defaultValue.display,
131
+ onChange: function onChange(value) {
132
+ return handleValueChange('display', value);
133
+ }
134
+ })), /*#__PURE__*/React.createElement(PanelItem, {
135
+ suppressPadding: true,
136
+ label: formatMessage({
137
+ id: "".concat(_I18N_PREFIX_, ".max"),
138
+ label: '最大显示数'
139
+ })
140
+ }, /*#__PURE__*/React.createElement(InputNumber, {
141
+ size: "small",
142
+ defaultValue: defaultValue.max,
143
+ onChange: function onChange(value) {
144
+ return handleValueChange('max', value);
145
+ }
146
+ })), /*#__PURE__*/React.createElement(SortBox, {
147
+ datas: todoList.map(function (_ref2) {
148
+ var id = _ref2.id;
149
+ return id;
150
+ }),
151
+ onChange: handleSortChange
152
+ }, /*#__PURE__*/React.createElement(ListEditor, {
153
+ addText: formatMessage({
154
+ id: "".concat(_I18N_PREFIX_, ".add"),
155
+ label: '添加操作'
156
+ }),
157
+ handleAdd: handleAdd
158
+ }, todoList.map(function (action) {
159
+ return /*#__PURE__*/React.createElement(SortItem, {
160
+ key: action.id,
161
+ id: action.id
162
+ }, /*#__PURE__*/React.createElement(ListEditorItem, {
163
+ left: /*#__PURE__*/React.createElement("span", null, action.name),
164
+ right: renderItemRight(action),
165
+ item: action,
166
+ dispatch: dispatch
167
+ }));
168
+ })))));
169
+ };
170
+ export default ActionsEditor;
@@ -1,79 +1,65 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- var _excluded = ["onChange"],
6
- _excluded2 = ["children", "language", "options", "onFullscreenChange"];
7
- import React, { useState, useEffect, useRef, useImperativeHandle, forwardRef } from 'react';
4
+ var _excluded = ["onChange", "isFullscreen"],
5
+ _excluded2 = ["children", "language", "options"];
6
+ import React, { useEffect, useRef, useImperativeHandle, forwardRef } from 'react';
8
7
  import * as monaco from 'monaco-editor';
8
+
9
+ /**
10
+ * BaseEditor 组件是一个封装了 monaco 编辑器的 React 组件,支持前向 ref 引用。
11
+ * 该组件允许用户编辑代码,并在代码发生变更时触发回调函数。
12
+ * 它还支持通过 props 控制编辑器的语言、选项以及是否全屏显示。
13
+ *
14
+ * @component
15
+ * @example
16
+ * const handleEditorChange = (newValue, event) => {
17
+ * console.log('Editor content changed: ', newValue);
18
+ * };
19
+ * <BaseEditor
20
+ * language="javascript"
21
+ * onChange={handleEditorChange}
22
+ * isFullscreen={false}
23
+ * width="600px"
24
+ * height="400px"
25
+ * >
26
+ * {`function sayHello() {\n console.log('Hello, World!');\n}`}
27
+ * </BaseEditor>
28
+ *
29
+ * @param {Object} props - 组件的属性。
30
+ * @param {Function} props.onChange - 当编辑器内容变更时调用的函数。接收最新的编辑器内容和事件对象作为参数。
31
+ * @param {boolean} props.isFullscreen - 控制编辑器是否全屏显示。
32
+ * @param {string} [props.language='javascript'] - 设置编辑器的编程语言,默认为 'javascript'。
33
+ * @param {Object} [props.options={}] - 用于自定义编辑器的选项。
34
+ * @param {React.ReactNode} children - 子组件,通常是编辑器的初始代码。
35
+ * @param {string} [props.width] - 编辑器的宽度,默认为 '100%'。
36
+ * @param {string} [props.height] - 编辑器的高度,默认为 '100%'。
37
+ * @param {Object} rest - 传递给 div 容器的其它属性。
38
+ * @param {React.Ref} ref - React ref 引用,用于外部组件调用编辑器实例的方法。
39
+ *
40
+ * @returns {ReactElement} 返回一个 React 元素,其中包含了一个配置好的 monaco 编辑器实例。
41
+ */
9
42
  var BaseEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
10
43
  var onChange = _ref.onChange,
44
+ isFullscreen = _ref.isFullscreen,
11
45
  props = _objectWithoutProperties(_ref, _excluded);
12
46
  var children = props.children,
13
47
  _props$language = props.language,
14
48
  language = _props$language === void 0 ? 'javascript' : _props$language,
15
49
  _props$options = props.options,
16
50
  options = _props$options === void 0 ? {} : _props$options,
17
- onFullscreenChange = props.onFullscreenChange,
18
51
  rest = _objectWithoutProperties(props, _excluded2);
19
- var _useState = useState(false),
20
- _useState2 = _slicedToArray(_useState, 2),
21
- isFullScreen = _useState2[0],
22
- setIsFullScreen = _useState2[1];
23
52
  var editorRef = useRef(null);
24
53
  var editorInstance = useRef(null);
25
54
 
26
- // 全屏切换方法
27
- var toggleFullScreen = function toggleFullScreen() {
28
- var element = editorRef.current;
29
- if (!document.fullscreenElement) {
30
- if (element.requestFullscreen) {
31
- element.requestFullscreen();
32
- } else if (element.mozRequestFullScreen) {
33
- element.mozRequestFullScreen();
34
- } else if (element.webkitRequestFullscreen) {
35
- element.webkitRequestFullscreen();
36
- } else if (element.msRequestFullscreen) {
37
- element.msRequestFullscreen();
38
- }
39
- } else {
40
- if (document.exitFullscreen) {
41
- document.exitFullscreen();
42
- } else if (document.mozCancelFullScreen) {
43
- document.mozCancelFullScreen();
44
- } else if (document.webkitExitFullscreen) {
45
- document.webkitExitFullscreen();
46
- } else if (document.msExitFullscreen) {
47
- document.msExitFullscreen();
48
- }
49
- }
50
- };
51
-
52
- // 监听全屏状态的改变,并调用 layout
53
- useEffect(function () {
54
- var handleFullScreenChange = function handleFullScreenChange() {
55
- var isFullScreenNow = !!document.fullscreenElement;
56
- setIsFullScreen(isFullScreenNow);
57
- if (editorInstance.current) {
58
- editorInstance.current.layout();
59
- }
60
- if (onFullscreenChange) onFullscreenChange(isFullScreenNow);
61
- };
62
- document.addEventListener('fullscreenchange', handleFullScreenChange);
63
-
64
- // 组件卸载时移除事件监听器
65
- return function () {
66
- document.removeEventListener('fullscreenchange', handleFullScreenChange);
67
- };
68
- }, []);
69
-
70
55
  // 初始化编辑器实例
71
56
  useEffect(function () {
72
57
  if (editorRef.current) {
73
58
  var code = React.Children.toArray(children).join('').trim();
74
59
  editorInstance.current = monaco.editor.create(editorRef.current, _objectSpread({
75
60
  value: code,
76
- language: language
61
+ language: language,
62
+ automaticLayout: true
77
63
  }, options));
78
64
  editorInstance.current.onDidChangeModelContent(function (event) {
79
65
  if (onChange) onChange(editorInstance.current.getValue(), event);
@@ -90,20 +76,12 @@ var BaseEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
90
76
  return {
91
77
  get editor() {
92
78
  return editorInstance.current;
93
- },
94
- toggleFullScreen: toggleFullScreen
79
+ }
95
80
  };
96
81
  });
97
82
 
98
- // 更新编辑器布局当全屏状态改变
99
- useEffect(function () {
100
- if (editorInstance.current) {
101
- editorInstance.current.layout();
102
- }
103
- }, [isFullScreen]);
104
-
105
83
  // 根据是否全屏来设置编辑器的样式
106
- var editorStyle = isFullScreen ? {
84
+ var editorStyle = isFullscreen ? {
107
85
  width: '100vw',
108
86
  height: '100vh'
109
87
  } : {
@@ -3,6 +3,33 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
3
3
  var _excluded = ["children"];
4
4
  import React, { forwardRef } from 'react';
5
5
  import BaseEditor from "./BaseEditor";
6
+
7
+ /**
8
+ * CssEditor 组件是一个专门用于编辑 CSS 代码的 React 组件,它基于 BaseEditor 组件构建。
9
+ * 该组件通过将 language 属性固定设置为 "css",确保编辑器环境专门用于 CSS 代码编辑。
10
+ * 用户可以传入 CSS 代码作为 children,并通过其他 props 控制 BaseEditor 提供的额外功能。
11
+ *
12
+ * @component
13
+ * @example
14
+ * const handleCssChange = (newCss, event) => {
15
+ * console.log('CSS changed: ', newCss);
16
+ * };
17
+ * <CssEditor
18
+ * onChange={handleCssChange}
19
+ * isFullscreen={false}
20
+ * width="600px"
21
+ * height="400px"
22
+ * >
23
+ * {`body { margin: 0; font-family: Arial, sans-serif; }`}
24
+ * </CssEditor>
25
+ *
26
+ * @param {Object} props - 组件的属性。
27
+ * @param {React.ReactNode} children - 子组件,通常是编辑器的初始 CSS 代码。
28
+ * @param {Object} rest - 传递给 BaseEditor 组件的其他属性。
29
+ * @param {React.Ref} ref - React ref 引用,用于外部组件调用编辑器实例的方法。
30
+ *
31
+ * @returns {ReactElement} 返回一个 React 元素,该元素内部是一个专门用于 CSS 编辑的 BaseEditor 组件实例。
32
+ */
6
33
  var CssEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
7
34
  var children = _ref.children,
8
35
  rest = _objectWithoutProperties(_ref, _excluded);
@@ -2,26 +2,48 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
4
  var _excluded = ["EditorComponent", "onLoad", "children"];
5
- import React, { useState, useEffect, forwardRef } from 'react';
5
+ import React, { useEffect, forwardRef, useRef } from 'react';
6
6
  import { Tooltip, Icon } from 'luck-design/antd';
7
7
  import { formatMessage } from '@luck-design-biz/base/utils';
8
8
  import styles from "../../style/fullscreen-editor.less";
9
+ import { useFullscreen } from 'ahooks';
10
+
11
+ /**
12
+ * FullScreenEditor 组件是一个支持全屏编辑模式的 React 组件,它利用提供的 EditorComponent 来实现代码编辑功能。
13
+ * 该组件使用 ahooks 的 useFullscreen 钩子来实现全屏切换,并在全屏模式下调整编辑器布局。
14
+ * 全屏/非全屏模式下编辑器的某些选项可能会有所不同,以适应不同的布局需求。
15
+ *
16
+ * @component
17
+ * @example
18
+ * const MyEditor = React.forwardRef((props, ref) => <BaseEditor {...props} ref={ref} />);
19
+ * <FullScreenEditor
20
+ * EditorComponent={MyEditor}
21
+ * onLoad={() => console.log('Editor loaded')}
22
+ * >
23
+ * {`function sayHello() {\n console.log('Hello, World!');\n}`}
24
+ * </FullScreenEditor>
25
+ *
26
+ * @param {Object} props - 组件的属性。
27
+ * @param {Function} props.EditorComponent - 用于编辑的组件,该组件需要支持 ref 引用以调用编辑器的方法。
28
+ * @param {Function} [props.onLoad] - 编辑器加载完成时的回调函数。
29
+ * @param {React.ReactNode} children - 传递给 EditorComponent 的 children,通常是初始代码或内容。
30
+ * @param {Object} rest - 传递给 EditorComponent 的其他属性。
31
+ * @param {React.Ref} ref - React ref 引用,用于在外部组件中访问 EditorComponent 实例的方法。
32
+ *
33
+ * @returns {ReactElement} 返回一个 React 元素,其中包含了一个具有全屏切换功能的编辑器界面。
34
+ */
9
35
  var FullScreenEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
10
36
  var EditorComponent = _ref.EditorComponent,
11
37
  onLoad = _ref.onLoad,
12
38
  children = _ref.children,
13
39
  props = _objectWithoutProperties(_ref, _excluded);
14
- var _useState = useState(false),
15
- _useState2 = _slicedToArray(_useState, 2),
16
- isFullScreen = _useState2[0],
17
- setIsFullScreen = _useState2[1];
40
+ var fullscreenRef = useRef(null);
41
+ var _useFullscreen = useFullscreen(fullscreenRef),
42
+ _useFullscreen2 = _slicedToArray(_useFullscreen, 2),
43
+ isFullscreen = _useFullscreen2[0],
44
+ toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
18
45
  var handleFullscreen = function handleFullscreen() {
19
- if (ref.current && ref.current.toggleFullScreen) {
20
- ref.current.toggleFullScreen();
21
- }
22
- };
23
- var HandleFullscreenChange = function HandleFullscreenChange(fullscrean) {
24
- setIsFullScreen(fullscrean);
46
+ toggleFullscreen();
25
47
  };
26
48
  useEffect(function () {
27
49
  if (onLoad) onLoad();
@@ -39,11 +61,12 @@ var FullScreenEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
39
61
  type: "fullscreen",
40
62
  onClick: handleFullscreen
41
63
  }))), /*#__PURE__*/React.createElement("div", {
42
- className: isFullScreen ? styles['fullscreen'] : ''
64
+ className: isFullscreen ? styles['fullscreen'] : '',
65
+ ref: fullscreenRef
43
66
  }, /*#__PURE__*/React.createElement(EditorComponent, _extends({
44
67
  ref: ref,
45
- onFullscreenChange: HandleFullscreenChange,
46
- options: isFullScreen ? {} : {
68
+ isFullscreen: isFullscreen,
69
+ options: isFullscreen ? {} : {
47
70
  lineNumbers: 'off',
48
71
  glyphMargin: false,
49
72
  folding: false,
@@ -71,6 +71,28 @@ var setupAutocomplete = /*#__PURE__*/function () {
71
71
  return _ref.apply(this, arguments);
72
72
  };
73
73
  }();
74
+
75
+ /**
76
+ * JSEditor 组件是一个专为 JavaScript 编辑设计的 React 组件,它基于 BaseEditor 组件构建,并集成了自动完成功能。
77
+ * 该组件利用 monaco-editor 提供的 API,通过 setupAutocomplete 函数设置自动完成项,从而增强代码编辑体验。
78
+ * 自动完成逻辑包括从预定义的自动完成模块中加载补全项,以及在编辑器中键入特定字符(如".")时触发补全建议。
79
+ *
80
+ * @component
81
+ * @example
82
+ * <JSEditor
83
+ * language="javascript"
84
+ * options={{ fontSize: 14 }}
85
+ * >
86
+ * {`function sayHello() {\n console.log('Hello, World!');\n}`}
87
+ * </JSEditor>
88
+ *
89
+ * @param {Object} props - 组件的属性。
90
+ * @param {React.ReactNode} children - 传递给 BaseEditor 的 children,通常是初始代码或内容。
91
+ * @param {Object} rest - 传递给 BaseEditor 组件的其他属性。
92
+ * @param {React.Ref} ref - React ref 引用,用于在外部组件中访问 BaseEditor 实例的方法。
93
+ *
94
+ * @returns {ReactElement} 返回一个 React 元素,其中包含了一个具有自动完成功能的 JavaScript 编辑器实例。
95
+ */
74
96
  var JSEditor = /*#__PURE__*/forwardRef(function (_ref2, ref) {
75
97
  var children = _ref2.children,
76
98
  rest = _objectWithoutProperties(_ref2, _excluded);
@@ -11,7 +11,8 @@ import Panel from "./Panel";
11
11
  import { RUNTIME } from "../constants/index";
12
12
  import styles from "./style/index.less";
13
13
  var Painter = function Painter(_ref) {
14
- var className = _ref.className;
14
+ var className = _ref.className,
15
+ code = _ref.code;
15
16
  // 修改后刷新提示功能,暂时关掉,等待提供数据对比进行判断
16
17
  // useEffect(() => {
17
18
  // const handleBeforeUnload = (event) => {
@@ -38,7 +39,10 @@ var Painter = function Painter(_ref) {
38
39
 
39
40
  return /*#__PURE__*/React.createElement(EventBusProvider, {
40
41
  runtime: RUNTIME.DESIGN
41
- }, /*#__PURE__*/React.createElement(ContextProvider, null, /*#__PURE__*/React.createElement("div", {
42
+ }, /*#__PURE__*/React.createElement(ContextProvider, {
43
+ code: code
44
+ }, /*#__PURE__*/React.createElement("div", {
45
+ id: "lc-design-workspace",
42
46
  className: classNames(styles['lc-painter'], _defineProperty({}, className, !!className))
43
47
  }, /*#__PURE__*/React.createElement(Ribbon, null), /*#__PURE__*/React.createElement(Design, null), /*#__PURE__*/React.createElement(Panel, null))));
44
48
  };
File without changes
@@ -0,0 +1,61 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import React, { useEffect, useState } from 'react';
3
+ import { useMemoizedFn } from 'ahooks';
4
+ import { Select } from 'luck-design/antd';
5
+ import { request } from '@luck-design-biz/base/utils';
6
+ import { SERVICE_READ_DATASET } from "../../constants/api-url";
7
+ var DataSetSelector = function DataSetSelector(_ref) {
8
+ var defaultValue = _ref.defaultValue,
9
+ size = _ref.size,
10
+ onChange = _ref.onChange;
11
+ var _useState = useState([]),
12
+ _useState2 = _slicedToArray(_useState, 2),
13
+ options = _useState2[0],
14
+ setOptions = _useState2[1];
15
+ useEffect(function () {
16
+ setOptions([{
17
+ value: 'dsWmsOutboundOrder',
18
+ label: '出库单'
19
+ }, {
20
+ value: 'dsWmsMaterialsData',
21
+ label: '物料主数据'
22
+ }, {
23
+ value: 'dsStockInboundOrder',
24
+ label: '库存台账'
25
+ }]);
26
+ // request(
27
+ // `${SERVICE_READ_DATASET}`,
28
+ // {
29
+ // method: 'GET',
30
+ // body: { dataModelKey: '' },
31
+ // }.then((res) => {
32
+ // console.log('res', res);
33
+ // setOptions([
34
+ // { value: 'dsWmsOutboundOrder', label: '出库单' },
35
+ // { value: 'dsWmsMaterialsData', label: '物料主数据' },
36
+ // { value: 'dsStockInboundOrder', label: '库存台账' },
37
+ // ]);
38
+ // }),
39
+ // );
40
+ }, []);
41
+ var handleChange = useMemoizedFn(function (value) {
42
+ console.log('value', value);
43
+ onChange(value);
44
+ });
45
+ return /*#__PURE__*/React.createElement(Select, {
46
+ defaultValue: defaultValue,
47
+ size: size,
48
+ onChange: handleChange,
49
+ getPopupContainer: function getPopupContainer() {
50
+ return document.getElementById('lc-design-workspace');
51
+ }
52
+ }, options.map(function (_ref2) {
53
+ var value = _ref2.value,
54
+ label = _ref2.label;
55
+ return /*#__PURE__*/React.createElement(Select.Option, {
56
+ key: value,
57
+ value: value
58
+ }, label);
59
+ }));
60
+ };
61
+ export default DataSetSelector;
File without changes
File without changes
@@ -116,7 +116,8 @@ var LayoutRatio = function LayoutRatio(_ref) {
116
116
  label: formatMessage({
117
117
  id: 'luckda.lowcode.painter.panel-section.Layoutratio.label',
118
118
  label: '列比例'
119
- })
119
+ }),
120
+ suppressPadding: true
120
121
  }, /*#__PURE__*/React.createElement(RuleInput, {
121
122
  placeholder: formatMessage({
122
123
  id: 'luckda.lowcode.painter.panel-section.Layoutratio.placeholder',
@@ -0,0 +1,61 @@
1
+ import React from 'react';
2
+ import { formatMessage } from '@luck-design-biz/base/utils';
3
+ import { useStyle, useStyleDispatch } from "./StyleContext";
4
+ import panelStyles from "../../style/style-panel.less";
5
+ import StyleRow from "./StyleRow";
6
+ import { Tooltip } from 'luck-design/antd';
7
+ import ColorInput from "../../components/ColorInput";
8
+ import HighLightPanel from "./HighLightPanel";
9
+ import HightLightSvg from "./HightLightSvg";
10
+ var textRelatedStyles = ['background-color'];
11
+
12
+ /**
13
+ * 背景设置控件
14
+ */
15
+ export default function () {
16
+ return /*#__PURE__*/React.createElement(HighLightPanel, {
17
+ highLightFields: textRelatedStyles,
18
+ addon: /*#__PURE__*/React.createElement(BackGroundEditor, null),
19
+ label: formatMessage({
20
+ id: 'luckda.lowcode.painter.panel-section.style-panel.background',
21
+ label: '背景'
22
+ })
23
+ });
24
+ }
25
+ var BackGroundEditor = function BackGroundEditor() {
26
+ var style = useStyle();
27
+ var dispatch = useStyleDispatch();
28
+ var handleChange = function handleChange(field, value) {
29
+ dispatch({
30
+ type: 'edit',
31
+ payload: {
32
+ id: field,
33
+ value: value
34
+ }
35
+ });
36
+ };
37
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyleRow, null, /*#__PURE__*/React.createElement(Tooltip, {
38
+ placement: "top",
39
+ title: formatMessage({
40
+ id: 'luckda.lowcode.painter.panel-section.style-panel.font.weight',
41
+ label: '字重'
42
+ })
43
+ }, /*#__PURE__*/React.createElement("div", {
44
+ className: panelStyles['svg-label']
45
+ }, /*#__PURE__*/React.createElement(HightLightSvg, {
46
+ field: "background-color",
47
+ width: "20",
48
+ height: "20",
49
+ viewBox: "0 0 1024 1024"
50
+ }, /*#__PURE__*/React.createElement("path", {
51
+ d: "M881.2544 1004.3392c-50.9952 0-92.3648-41.3696-92.3648-92.3648 0-50.9952 92.3648-215.6544 92.3648-215.6544s92.3648 164.6592 92.3648 215.6544S932.4544 1004.3392 881.2544 1004.3392L881.2544 1004.3392zM50.3808 546.6112 449.9456 151.552l399.7696 395.264-399.7696 395.264L50.3808 546.6112 50.3808 546.6112zM449.9456 239.2064l-277.0944 272.384 554.3936 0L449.9456 239.2064 449.9456 239.2064zM272.384 63.488l44.4416-43.8272L449.9456 151.552 405.504 195.3792 272.384 63.488 272.384 63.488zM272.384 63.488"
52
+ })))), /*#__PURE__*/React.createElement(ColorInput, {
53
+ wrapperStyle: {
54
+ flex: 1
55
+ },
56
+ value: style['background-color'],
57
+ onChange: function onChange(value) {
58
+ return handleChange('background-color', value);
59
+ }
60
+ })));
61
+ };