@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,91 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import React, { useEffect, useState } from 'react';
4
+ import classNames from 'classnames';
5
+ import { Select, Button, Icon, Divider } from 'luck-design/antd';
6
+ import { useLDContext } from "../engine/provider/ContextProvider";
7
+ import { CELL_KEY } from "../constants";
8
+ import styles from "./style/design.less";
9
+ var DesignToolbar = function DesignToolbar(_ref) {
10
+ var locale = _ref.locale,
11
+ onLangChange = _ref.onLangChange;
12
+ var context = useLDContext();
13
+ var _useState = useState(null),
14
+ _useState2 = _slicedToArray(_useState, 2),
15
+ langList = _useState2[0],
16
+ setLangList = _useState2[1];
17
+ var _useState3 = useState('pc'),
18
+ _useState4 = _slicedToArray(_useState3, 2),
19
+ activedTarget = _useState4[0],
20
+ setActivedTarget = _useState4[1];
21
+ useEffect(function () {
22
+ var topicId = context.$subscriber(context.topics.LANG_SETTING_SELECT).on(function (_ref2) {
23
+ var _langList = _ref2.langList;
24
+ return setLangList(_langList);
25
+ }).watch();
26
+ return function () {
27
+ return context.$unsubscriber(context.topics.LANG_SETTING_SELECT, topicId);
28
+ };
29
+ }, []);
30
+ return /*#__PURE__*/React.createElement("div", {
31
+ className: styles['lc-painter-design-toolbar']
32
+ }, /*#__PURE__*/React.createElement(Select, {
33
+ size: "small",
34
+ value: langList ? locale : undefined,
35
+ className: styles['i18n-selecter'],
36
+ style: {
37
+ fontSize: 12
38
+ },
39
+ onSelect: onLangChange
40
+ }, langList === null || langList === void 0 ? void 0 : langList.map(function (item) {
41
+ return /*#__PURE__*/React.createElement(Select.Option, {
42
+ key: item.field,
43
+ value: item.field
44
+ }, item.title);
45
+ })), /*#__PURE__*/React.createElement("span", {
46
+ className: classNames(styles['toolbar-item'], _defineProperty({}, styles.actived, activedTarget === 'pc')),
47
+ onClick: function onClick() {
48
+ return setActivedTarget('pc');
49
+ }
50
+ }, /*#__PURE__*/React.createElement(Icon, {
51
+ type: "laptop"
52
+ })), /*#__PURE__*/React.createElement("span", {
53
+ className: classNames(styles['toolbar-item'], _defineProperty({}, styles.actived, activedTarget === 'mobile')),
54
+ onClick: function onClick() {
55
+ return setActivedTarget('mobile');
56
+ }
57
+ }, /*#__PURE__*/React.createElement(Icon, {
58
+ type: "mobile"
59
+ })), /*#__PURE__*/React.createElement(Divider, {
60
+ type: "vertical"
61
+ }), /*#__PURE__*/React.createElement("span", {
62
+ style: {
63
+ width: 'auto',
64
+ fontSize: 12
65
+ },
66
+ className: styles['toolbar-item'],
67
+ onClick: function onClick() {
68
+ context.$publisher(context.topics.COMPONENT_ACTIVE, {
69
+ id: CELL_KEY.PAGE_ROOT
70
+ });
71
+ }
72
+ }, "\u9875\u9762\u5C5E\u6027"), /*#__PURE__*/React.createElement(Divider, {
73
+ type: "vertical"
74
+ }), /*#__PURE__*/React.createElement(Button, {
75
+ size: "small",
76
+ style: {
77
+ fontSize: 12,
78
+ margin: '0 2px'
79
+ }
80
+ }, "\u9884\u89C8"), /*#__PURE__*/React.createElement(Divider, {
81
+ type: "vertical"
82
+ }), /*#__PURE__*/React.createElement(Button, {
83
+ size: "small",
84
+ type: "primary",
85
+ style: {
86
+ fontSize: 12,
87
+ margin: '0 0 0 2px'
88
+ }
89
+ }, "\u4FDD\u5B58"));
90
+ };
91
+ export default DesignToolbar;
File without changes
@@ -17,7 +17,6 @@ var TreeNode = Tree.TreeNode;
17
17
  var PAGE_CELL = [CELL_KEY.PAGE_HEADER, CELL_KEY.PAGE_CONTENT, CELL_KEY.PAGE_FOOTER];
18
18
  var Outline = function Outline(_ref) {
19
19
  var open = _ref.open;
20
- var openModal = useRef(void 0);
21
20
  var clickBySelf = useRef(false);
22
21
  var context = useLDContext();
23
22
  var _useState = useState(null),
@@ -45,7 +44,10 @@ var Outline = function Outline(_ref) {
45
44
  clickBySelf.current = false;
46
45
  return;
47
46
  }
48
- if (openModal.current) {
47
+ var _split = split(getPathById(context.pageData, payload.id), '/'),
48
+ _split2 = _slicedToArray(_split, 1),
49
+ _root = _split2[0];
50
+ if (!PAGE_CELL.includes(_root)) {
49
51
  setModalExpandedKeys(uniq([].concat(_toConsumableArray(latestModalExpandedKeysRef.current), _toConsumableArray(split(getPathById(context.pageData, payload.id), '/')))));
50
52
  } else {
51
53
  setPageExpandedKeys(uniq([].concat(_toConsumableArray(lastPageExpandedKeysRef.current), _toConsumableArray(split(getPathById(context.pageData, payload.id), '/')))));
@@ -55,18 +57,11 @@ var Outline = function Outline(_ref) {
55
57
  context.$unsubscriber(context.topics.COMPONENT_ACTIVE, _id);
56
58
  };
57
59
  }, [context.pageData]);
58
- var handleSelect = function handleSelect(_key) {
60
+ var handleSelect = useMemoizedFn(function (_key) {
59
61
  clickBySelf.current = true;
60
62
  context.$publisher(context.topics.COMPONENT_ACTIVE, _key ? {
61
63
  id: _key
62
64
  } : null);
63
- };
64
- var handleOpenModal = useMemoizedFn(function (_key) {
65
- var _comp = context.componentMap.get(_key);
66
- var _prevComp = openModal.current ? context.componentMap.get(openModal.current) : null;
67
- _prevComp === null || _prevComp === void 0 || _prevComp.api.doClose();
68
- _comp.api.doOpen();
69
- openModal.current = _key;
70
65
  });
71
66
  var render = useMemoizedFn(function (_ref2) {
72
67
  var props = _ref2.props,
@@ -131,7 +126,7 @@ var Outline = function Outline(_ref) {
131
126
  type: "inner",
132
127
  hoverable: true,
133
128
  title: formatMessage({
134
- id: 'luckda.lowcode.model',
129
+ id: 'luckda.lowcode.modal',
135
130
  label: '模态视图层'
136
131
  }),
137
132
  style: {
@@ -154,21 +149,29 @@ var Outline = function Outline(_ref) {
154
149
  var selected = _ref4.selected,
155
150
  node = _ref4.node;
156
151
  if (selected && node.props.pos.split('-').length === 2) {
157
- handleOpenModal(_key);
152
+ // 选中节点是模态视图,则打开模态视图组件
153
+ context.$publisher(context.topics.COMPONENT_MODAL_TOGGLE, {
154
+ toggle: true,
155
+ id: _key
156
+ });
158
157
  handleSelect(_key);
159
158
  } else if (!selected && node.props.pos.split('-').length === 2) {
160
- var _comp = context.componentMap.get(openModal.current);
161
- _comp.api.doClose();
162
- openModal.current = void 0;
159
+ // 取消选中节点是模态视图,则关闭模态视图
160
+ context.$publisher(context.topics.COMPONENT_MODAL_TOGGLE, {
161
+ toggle: false,
162
+ id: _key
163
+ });
163
164
  handleSelect(null);
164
165
  } else {
166
+ // 选中节点是模态视图下的子组件,则打开该组件的模态视图组件
165
167
  handleSelect(node.props.eventKey);
166
- var _split = split(getPathById(context.pageData, node.props.eventKey), '/'),
167
- _split2 = _slicedToArray(_split, 1),
168
- parentModal = _split2[0];
169
- if (!openModal.current || openModal.current !== parentModal) {
170
- handleOpenModal(parentModal);
171
- }
168
+ var _split3 = split(getPathById(context.pageData, node.props.eventKey), '/'),
169
+ _split4 = _slicedToArray(_split3, 1),
170
+ parentModal = _split4[0];
171
+ context.$publisher(context.topics.COMPONENT_MODAL_TOGGLE, {
172
+ toggle: true,
173
+ id: parentModal
174
+ });
172
175
  }
173
176
  },
174
177
  expandedKeys: modalExpandedKeys,
@@ -177,7 +180,10 @@ var Outline = function Outline(_ref) {
177
180
  node = _ref6.node;
178
181
  if (expanded && node.props.pos.split('-').length === 2) {
179
182
  handleSelect(null);
180
- handleOpenModal(node.props.eventKey);
183
+ context.$publisher(context.topics.COMPONENT_MODAL_TOGGLE, {
184
+ toggle: true,
185
+ id: node.props.eventKey
186
+ });
181
187
  }
182
188
  setModalExpandedKeys(_keys);
183
189
  }
@@ -193,11 +199,9 @@ var Outline = function Outline(_ref) {
193
199
  var _ref9 = _slicedToArray(_ref7, 1),
194
200
  _key = _ref9[0];
195
201
  var node = _ref8.node;
196
- if (openModal.current) {
197
- var _prevComp = context.componentMap.get(openModal.current);
198
- _prevComp.api.doClose();
199
- openModal.current = void 0;
200
- }
202
+ context.$publisher(context.topics.COMPONENT_MODAL_TOGGLE, {
203
+ toggle: false
204
+ });
201
205
  handleSelect(node.props.eventKey);
202
206
  },
203
207
  expandedKeys: pageExpandedKeys,
@@ -1,16 +1,20 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
1
3
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
4
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
5
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
6
+ var _excluded = ["type", "key", "name", "desc", "default", "props", "panelItem", "next", "repositioning"];
4
7
  import React, { useRef, useState, useEffect, useLayoutEffect } from 'react';
5
8
  import { useBoolean, useCreation, useMemoizedFn } from 'ahooks';
6
9
  import { Breadcrumb, Drawer, Icon } from 'luck-design/antd';
7
10
  import classNames from 'classnames';
8
- import { startsWith, takeRight, cloneDeep } from 'lodash';
11
+ import { startsWith, takeRight, cloneDeep, isNil } from 'lodash';
9
12
  import { useLDContext } from "../engine/provider/ContextProvider";
10
13
  import PanelItem from "./components/PanelItem";
11
14
  import PanelItemFactory from "../engine/factory/panel-item-factory";
12
15
  import { modifyById } from "../engine/tools/dataProcess";
13
16
  import styles from "./style/panel.less";
17
+ import StylePanel from "./panel-section/StylePanel";
14
18
  var _TAB_LIST_ = [{
15
19
  title: '属性',
16
20
  key: 'attrs'
@@ -42,7 +46,7 @@ var Panel = function Panel() {
42
46
  setTrue = _useBoolean2$.setTrue,
43
47
  setFalse = _useBoolean2$.setFalse;
44
48
  var context = useLDContext();
45
- var handleChange = useMemoizedFn(function (field, value) {
49
+ var handleChange = useMemoizedFn(function (field, value, repositioning) {
46
50
  var component = context.componentMap.get(activeNode.node.id);
47
51
  var _component$api$getSel = component.api.getSelfAndParentLCData(),
48
52
  node = _component$api$getSel.node;
@@ -53,43 +57,73 @@ var Panel = function Panel() {
53
57
  id: activeNode.node.id,
54
58
  pageData: cloneDeep(newData)
55
59
  });
60
+ if (repositioning) context.$publisher(context.topics.COMPONENT_REPOSITIONING, {
61
+ id: activeNode.node.id
62
+ });
56
63
  });
57
- setFalse();
64
+ if (nextRef.current.autoClose) {
65
+ setFalse();
66
+ }
67
+ });
68
+ var handleStyleChange = useMemoizedFn(function (newStyle, newCss) {
69
+ console.log('style', newStyle, newCss);
70
+ // setCss(newCss);
71
+ });
72
+ var goNext = useMemoizedFn(function (_next) {
73
+ if (!_next) return;
74
+ nextRef.current = {
75
+ name: _next.name,
76
+ autoClose: _next.autoClose,
77
+ NextComp: renderPanelItems(_next.props)
78
+ };
79
+ setTrue();
58
80
  });
59
81
  var renderPanelItems = useMemoizedFn(function (items) {
60
- return items.map(function (item) {
61
- var Comp = factory.current.getPanelItemFor(startsWith(item.type, '_') ? 'dynamic' : item.type, item.type);
62
- if (item.type === 'group') {
82
+ return items.map(function (_ref) {
83
+ var type = _ref.type,
84
+ key = _ref.key,
85
+ name = _ref.name,
86
+ desc = _ref.desc,
87
+ defaultValue = _ref.default,
88
+ props = _ref.props,
89
+ panelItem = _ref.panelItem,
90
+ _next2 = _ref.next,
91
+ repositioning = _ref.repositioning,
92
+ rest = _objectWithoutProperties(_ref, _excluded);
93
+ var Comp = factory.current.getPanelItemFor(startsWith(type, '_') ? 'dynamic' : type, type);
94
+ if (type === 'group') {
63
95
  return /*#__PURE__*/React.createElement(Comp, {
64
- key: item.key,
65
- label: item.name,
66
- defaultCollapsed: true
67
- }, renderPanelItems(item.props));
96
+ key: key,
97
+ field: key,
98
+ label: name,
99
+ next: _next2 ? function () {
100
+ return goNext(_next2);
101
+ } : null,
102
+ defaultCollapsed: defaultValue,
103
+ desc: desc
104
+ }, renderPanelItems(props || []));
68
105
  }
69
- console.log(11111, item.key, activeNode.node);
70
- return /*#__PURE__*/React.createElement(PanelItem, {
71
- key: item.key,
72
- label: item.name
73
- }, Comp && /*#__PURE__*/React.createElement(Comp, {
74
- defaultValue: activeNode.node[item.key],
106
+ var _context$componentMap = context.componentMap.get(activeNode.node.id).api.getSelfAndParentLCData(),
107
+ node = _context$componentMap.node;
108
+ return /*#__PURE__*/React.createElement(PanelItem, _extends({
109
+ key: key,
110
+ field: key,
111
+ label: name,
112
+ desc: desc
113
+ }, panelItem), Comp && /*#__PURE__*/React.createElement(Comp, _extends({
114
+ defaultValue: isNil(node.props[key]) ? defaultValue : node.props[key],
75
115
  next: function next() {
76
- if (!item.next) return;
77
- nextRef.current = {
78
- name: item.next.name,
79
- NextComp: renderPanelItems(item.next.props)
80
- };
81
- setTrue();
116
+ return goNext(_next2);
82
117
  },
83
- options: item.options,
84
- disabled: item.disabled,
85
118
  onChange: function onChange(value) {
86
- return handleChange(item.key, value);
119
+ return handleChange(key, value, repositioning);
87
120
  },
88
121
  size: "small"
89
- }));
122
+ }, rest)));
90
123
  });
91
124
  });
92
125
  var PropsComps = useCreation(function () {
126
+ setActiveTabKey('attrs');
93
127
  var _meta;
94
128
  try {
95
129
  _meta = require("../engine/meta/".concat(activeNode.node.component.toLowerCase(), ".props.json"));
@@ -105,6 +139,7 @@ var Panel = function Panel() {
105
139
  }, [open]);
106
140
  useEffect(function () {
107
141
  var _id = context.$subscriber(context.topics.COMPONENT_ACTIVE).on(function (payload) {
142
+ setFalse();
108
143
  if (!payload.id) {
109
144
  setActiveNode(null);
110
145
  return;
@@ -121,7 +156,7 @@ var Panel = function Panel() {
121
156
  return function () {
122
157
  context.$unsubscriber(context.topics.COMPONENT_ACTIVE, _id);
123
158
  };
124
- }, [context.pageData]);
159
+ }, []);
125
160
  useLayoutEffect(function () {
126
161
  underLineRef.current.style.left = "".concat(activeTabRef.current.offsetLeft + activeTabRef.current.offsetWidth / 2 - 10, "px");
127
162
  }, [activeTabKey, !!activeNode]);
@@ -134,9 +169,9 @@ var Panel = function Panel() {
134
169
  style: {
135
170
  fontSize: 12
136
171
  }
137
- }, activeNode === null || activeNode === void 0 ? void 0 : activeNode.level.map(function (_ref) {
138
- var id = _ref.id,
139
- name = _ref.name;
172
+ }, activeNode === null || activeNode === void 0 ? void 0 : activeNode.level.map(function (_ref2) {
173
+ var id = _ref2.id,
174
+ name = _ref2.name;
140
175
  return /*#__PURE__*/React.createElement(Breadcrumb.Item, {
141
176
  key: id,
142
177
  className: classNames(_defineProperty({}, styles['active-node-level'], id !== activeNode.node.id)),
@@ -161,7 +196,7 @@ var Panel = function Panel() {
161
196
  className: classNames(styles['lc-painter-panel-tabbar'], _defineProperty({}, styles.hidden, !activeNode))
162
197
  }, /*#__PURE__*/React.createElement("ul", {
163
198
  className: styles.headerList
164
- }, _TAB_LIST_.map(function (_item) {
199
+ }, (activeNode !== null && activeNode !== void 0 && activeNode.node.style ? _TAB_LIST_ : [_TAB_LIST_[0], _TAB_LIST_[2]]).map(function (_item) {
165
200
  return /*#__PURE__*/React.createElement("li", {
166
201
  key: _item.key,
167
202
  ref: activeTabKey === _item.key ? activeTabRef : null,
@@ -174,7 +209,7 @@ var Panel = function Panel() {
174
209
  ref: underLineRef,
175
210
  className: styles.underline
176
211
  })), activeTabKey === _TAB_LIST_[0].key && /*#__PURE__*/React.createElement("div", {
177
- className: classNames(styles['lc-painter-panel-content'], _defineProperty({}, styles.hidden, !activeNode))
212
+ className: classNames(styles['lc-painter-panel-content'], _defineProperty(_defineProperty({}, styles.hidden, !activeNode), styles.showNext, open))
178
213
  }, PropsComps, /*#__PURE__*/React.createElement(Drawer, {
179
214
  visible: open,
180
215
  width: 320,
@@ -200,7 +235,10 @@ var Panel = function Panel() {
200
235
  type: "close"
201
236
  })), /*#__PURE__*/React.createElement("div", {
202
237
  className: styles['next-content-body']
203
- }, (_nextRef$current2 = nextRef.current) === null || _nextRef$current2 === void 0 ? void 0 : _nextRef$current2.NextComp)))), activeTabKey === _TAB_LIST_[1].key && /*#__PURE__*/React.createElement("div", null, "\u6837\u5F0F\u9762\u677F"), activeTabKey === _TAB_LIST_[2].key && /*#__PURE__*/React.createElement("div", null, "\u9AD8\u7EA7\u9762\u677F"), /*#__PURE__*/React.createElement("div", {
238
+ }, (_nextRef$current2 = nextRef.current) === null || _nextRef$current2 === void 0 ? void 0 : _nextRef$current2.NextComp)))), activeTabKey === _TAB_LIST_[1].key && /*#__PURE__*/React.createElement(StylePanel, {
239
+ onChange: handleStyleChange,
240
+ value: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.style
241
+ }), activeTabKey === _TAB_LIST_[2].key && /*#__PURE__*/React.createElement("div", null, "\u9AD8\u7EA7\u9762\u677F"), /*#__PURE__*/React.createElement("div", {
204
242
  className: classNames(styles['lc-painter-panel-empty'], _defineProperty({}, styles.hidden, !!activeNode))
205
243
  }, "\u8BF7\u5728\u5DE6\u4FA7\u753B\u5E03\u9009\u4E2D\u8282\u70B9"));
206
244
  };
File without changes
@@ -1,29 +1,88 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
2
  import React, { useState } from 'react';
3
+ import { useMemoizedFn, useCreation } from 'ahooks';
3
4
  import styles from "../style/collapse.less";
4
- import { Icon } from 'luck-design/antd';
5
+ import { Icon, Tooltip } from 'luck-design/antd';
6
+
7
+ /**
8
+ * Collapse 组件是一个可折叠区域的实现,用于显示或隐藏内容。它支持自定义标签、描述以及默认的折叠状态。
9
+ * 该组件还可以通过 `next` 函数来自定义点击操作,而不是简单地切换折叠状态。
10
+ * 提供的工具提示可以显示额外信息,如字段名和描述,以帮助用户更好地理解折叠内容的作用。
11
+ *
12
+ * @component
13
+ * @example
14
+ * <Collapse
15
+ * field="exampleField"
16
+ * label="示例标签"
17
+ * desc="这是一个用于演示的折叠组件"
18
+ * defaultCollapsed={true}
19
+ * next={() => console.log('Custom next function executed')}
20
+ * >
21
+ * <p>这里是可折叠的内容</p>
22
+ * </Collapse>
23
+ *
24
+ * @param {Object} props - 组件的属性。
25
+ * @param {React.ReactNode} children - 折叠区域展开时显示的内容。
26
+ * @param {string} [props.field] - 与折叠内容相关联的字段名。
27
+ * @param {string} props.label - 折叠区域的标签名称。
28
+ * @param {string} [props.desc] - 关于折叠内容的描述信息。
29
+ * @param {boolean} [props.defaultCollapsed=false] - 折叠区域的默认状态。如果为 true,则默认为折叠状态。
30
+ * @param {Function} [props.next] - 点击操作的自定义函数。如果提供,点击时将执行此函数,而不是切换折叠状态。
31
+ *
32
+ * @returns {ReactElement} 返回一个 React 元素,表示一个具有可折叠功能的容器。
33
+ */
5
34
  export default function (_ref) {
6
35
  var children = _ref.children,
36
+ field = _ref.field,
7
37
  label = _ref.label,
38
+ desc = _ref.desc,
8
39
  _ref$defaultCollapsed = _ref.defaultCollapsed,
9
- defaultCollapsed = _ref$defaultCollapsed === void 0 ? false : _ref$defaultCollapsed;
40
+ defaultCollapsed = _ref$defaultCollapsed === void 0 ? false : _ref$defaultCollapsed,
41
+ next = _ref.next;
10
42
  var _useState = useState(defaultCollapsed),
11
43
  _useState2 = _slicedToArray(_useState, 2),
12
44
  collapsed = _useState2[0],
13
45
  setCollapsed = _useState2[1];
14
- var handleClick = function handleClick() {
15
- setCollapsed(!collapsed);
16
- };
46
+ var handleClick = useMemoizedFn(function () {
47
+ if (next) {
48
+ next();
49
+ } else {
50
+ setCollapsed(!collapsed);
51
+ }
52
+ });
53
+ var tip = useCreation(function () {
54
+ var str = void 0;
55
+ if (field) {
56
+ str = "\u5C5E\u6027\uFF1A".concat(field);
57
+ }
58
+ if (desc) {
59
+ str += "".concat(str ? ' | ' : '', "\u8BF4\u660E\uFF1A").concat(desc);
60
+ }
61
+ return str;
62
+ }, [field, desc]);
17
63
  return /*#__PURE__*/React.createElement("div", {
18
64
  className: styles['lc-painter-components-collapse']
19
65
  }, /*#__PURE__*/React.createElement("div", {
20
66
  className: styles['head'],
21
67
  onClick: handleClick
68
+ }, /*#__PURE__*/React.createElement(Tooltip, {
69
+ overlayStyle: {
70
+ fontSize: '12px'
71
+ },
72
+ title: tip,
73
+ getPopupContainer: function getPopupContainer() {
74
+ return document.getElementById('lc-design-workspace');
75
+ }
22
76
  }, /*#__PURE__*/React.createElement("span", {
23
- className: styles['label']
24
- }, label), /*#__PURE__*/React.createElement("span", {
77
+ className: styles['label'],
78
+ style: {
79
+ cursor: desc ? 'help' : 'default'
80
+ }
81
+ }, label)), /*#__PURE__*/React.createElement("span", {
25
82
  className: styles['action']
26
- }, /*#__PURE__*/React.createElement(Icon, {
83
+ }, next ? /*#__PURE__*/React.createElement(Icon, {
84
+ type: "right"
85
+ }) : /*#__PURE__*/React.createElement(Icon, {
27
86
  type: collapsed ? 'down' : 'up'
28
87
  }))), !collapsed && /*#__PURE__*/React.createElement("div", {
29
88
  className: styles['body']
@@ -0,0 +1,125 @@
1
+ import _typeof from "@babel/runtime/helpers/esm/typeof";
2
+ import _extends from "@babel/runtime/helpers/esm/extends";
3
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
+ var _excluded = ["value", "onChange", "wrapperStyle"];
6
+ import React, { useState } from 'react';
7
+ import { useUpdateEffect } from 'ahooks';
8
+ import PopConfirm from "./PopConfirm";
9
+ import { Input } from 'luck-design/antd';
10
+ import styles from "../style/color-input.less";
11
+ import { SketchPicker } from 'react-color';
12
+
13
+ /**
14
+ * ColorInput 组件是一个集成颜色选择器的输入框组件,允许用户以 RGBA 或十六进制格式输入颜色值。
15
+ * 组件内部通过 PopConfirm 弹出一个 SketchPicker 颜色选择器,以提供一个直观的颜色选择界面。
16
+ * 用户输入的颜色值在内部转换为适当的格式,并通过 onChange 回调暴露给外部使用。
17
+ * 此组件还支持通过传入的 value 属性初始化颜色值,并响应其后续更改。
18
+ *
19
+ * @component
20
+ * @example
21
+ * const handleColorChange = (newColor) => {
22
+ * console.log('Selected color:', newColor);
23
+ * };
24
+ * <ColorInput
25
+ * value="rgba(255, 0, 0, 0.5)"
26
+ * onChange={handleColorChange}
27
+ * wrapperStyle={{ margin: '20px' }}
28
+ * />
29
+ *
30
+ * @param {Object} props - 组件的属性。
31
+ * @param {string} props.value - 初始化颜色值,支持 RGBA 字符串或十六进制格式。
32
+ * @param {Function} props.onChange - 当颜色值变更时触发的回调函数。传递新的颜色值作为参数。
33
+ * @param {Object} [props.wrapperStyle] - 自定义包装器 div 的样式对象。
34
+ * @param {Object} rest - 传递给 Input 组件的其他属性。
35
+ *
36
+ * @returns {ReactElement} 返回一个 React 元素,表示一个带有颜色选择器的输入框组件。
37
+ */
38
+ export default function (_ref) {
39
+ var value = _ref.value,
40
+ onChange = _ref.onChange,
41
+ wrapperStyle = _ref.wrapperStyle,
42
+ rest = _objectWithoutProperties(_ref, _excluded);
43
+ var _useState = useState(fromRGBA(value)),
44
+ _useState2 = _slicedToArray(_useState, 2),
45
+ color = _useState2[0],
46
+ setColor = _useState2[1];
47
+ var handleChange = function handleChange(color) {
48
+ changeColor(color.rgb);
49
+ };
50
+ var handleInputChange = function handleInputChange(e) {
51
+ changeColor(e.target.value);
52
+ };
53
+ var changeColor = function changeColor(value) {
54
+ if (onChange) onChange(toRGBA(value));
55
+ setColor(value);
56
+ };
57
+ useUpdateEffect(function () {
58
+ setColor(fromRGBA(value));
59
+ }, [value]);
60
+ var rgbaColor = toRGBA(color);
61
+ return /*#__PURE__*/React.createElement("div", {
62
+ className: styles['lc-painter-components-color-input'],
63
+ style: wrapperStyle
64
+ }, /*#__PURE__*/React.createElement(PopConfirm, {
65
+ placement: "top",
66
+ title: /*#__PURE__*/React.createElement(SketchPicker, {
67
+ color: color !== null && color !== void 0 ? color : '#ffffff',
68
+ onChange: handleChange
69
+ })
70
+ }, /*#__PURE__*/React.createElement("div", {
71
+ className: styles['color-input-wrap']
72
+ }, /*#__PURE__*/React.createElement(Input, _extends({
73
+ onChange: handleInputChange,
74
+ className: styles['color-input'],
75
+ value: rgbaColor,
76
+ size: "small",
77
+ placeholder: "rgba(0,0,0,0)"
78
+ }, rest)), /*#__PURE__*/React.createElement("div", {
79
+ className: "color-display",
80
+ style: {
81
+ backgroundColor: rgbaColor
82
+ }
83
+ }))));
84
+ }
85
+ function toRGBA(colorObj) {
86
+ // 首先检查 colorObj 是否为 null 或 undefined
87
+ if (colorObj === null || typeof colorObj === 'undefined') {
88
+ return null;
89
+ }
90
+
91
+ // 检查是否为对象且包含 r, g, b, a 属性
92
+ if (_typeof(colorObj) === 'object' && 'r' in colorObj && 'g' in colorObj && 'b' in colorObj && 'a' in colorObj) {
93
+ return "rgba(".concat(colorObj.r, ", ").concat(colorObj.g, ", ").concat(colorObj.b, ", ").concat(colorObj.a, ")");
94
+ } else if (typeof colorObj === 'string' && colorObj.startsWith('#')) {
95
+ // 如果是以#号开头的字符串,则直接返回该字符串
96
+ return colorObj;
97
+ }
98
+
99
+ // 如果不符合上述任何一种情况,返回一个空字符串
100
+ return null;
101
+ }
102
+ function fromRGBA(rgbaString) {
103
+ if (rgbaString === null || typeof rgbaString === 'undefined') {
104
+ return null;
105
+ }
106
+
107
+ // 检查输入是否是有效的 rgba 字符串
108
+ var rgbaPattern = /rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d*\.?\d+)\)/;
109
+ var match = rgbaString.match(rgbaPattern);
110
+ if (match) {
111
+ // 如果匹配成功,则提取 rgba 值
112
+ return {
113
+ r: parseInt(match[1], 10),
114
+ g: parseInt(match[2], 10),
115
+ b: parseInt(match[3], 10),
116
+ a: parseFloat(match[4])
117
+ };
118
+ } else if (typeof rgbaString === 'string' && rgbaString.startsWith('#')) {
119
+ // 对于十六进制颜色字符串,直接返回原始字符串
120
+ return rgbaString;
121
+ }
122
+
123
+ // 如果不符合上述任何一种情况,返回 null
124
+ return null;
125
+ }