@luck-design-biz/luckda 1.0.0-alpha → 1.0.1-10

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 (540) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +40 -40
  3. package/es/components/Builder/index.js +15 -3
  4. package/es/components/ComplexItem/index.js +65 -49
  5. package/es/components/LDActions/index.less +68 -68
  6. package/es/components/LdAutoForm/index.js +6 -4
  7. package/es/components/LdFormList/index.js +11 -10
  8. package/es/components/LdGrid/index.js +4 -4
  9. package/es/components/LdGridForm/index.js +40 -23
  10. package/es/components/LdGridForm/index.less +7 -7
  11. package/es/components/LdTree/index.less +40 -40
  12. package/es/helper/action.js +6 -6
  13. package/es/helper/form.js +15 -14
  14. package/es/helper/index.less +7 -7
  15. package/es/helper/ldBuilder.js +8 -3
  16. package/es/locales/zh-CN.js +41 -4
  17. package/es/lowcode/constants/api-url.js +87 -87
  18. package/es/lowcode/constants/event-topics.js +0 -2
  19. package/es/lowcode/engine/launcher.js +3 -1
  20. package/es/lowcode/engine/meta/box.props.json +3 -3
  21. package/es/lowcode/engine/meta/button.props.default.json +1 -1
  22. package/es/lowcode/engine/meta/button.props.json +2 -2
  23. package/es/lowcode/engine/meta/cardlist.props.default.json +1 -0
  24. package/es/lowcode/engine/meta/cardlist.props.json +2 -1
  25. package/es/lowcode/engine/meta/components-list.json +6 -126
  26. package/es/lowcode/engine/meta/dialog.props.default.json +4 -2
  27. package/es/lowcode/engine/meta/dialog.props.json +76 -20
  28. package/es/lowcode/engine/meta/drawer.props.default.json +15 -4
  29. package/es/lowcode/engine/meta/drawer.props.json +144 -24
  30. package/es/lowcode/engine/meta/fieldcomplex.props.default.json +1 -0
  31. package/es/lowcode/engine/meta/fieldcomplex.props.json +7 -0
  32. package/es/lowcode/engine/meta/fielddatadic.props.default.json +16 -0
  33. package/es/lowcode/engine/meta/fielddatadic.props.json +73 -0
  34. package/es/lowcode/engine/meta/fielddate.props.default.json +2 -0
  35. package/es/lowcode/engine/meta/fielddate.props.json +4 -2
  36. package/es/lowcode/engine/meta/fieldnumber.props.default.json +1 -0
  37. package/es/lowcode/engine/meta/fieldnumber.props.json +3 -2
  38. package/es/lowcode/engine/meta/fielduser.props.default.json +1 -1
  39. package/es/lowcode/engine/meta/fielduser.props.json +1 -1
  40. package/es/lowcode/engine/meta/form.props.default.json +14 -4
  41. package/es/lowcode/engine/meta/form.props.json +53 -14
  42. package/es/lowcode/engine/meta/grouptree.props.default.json +16 -0
  43. package/es/lowcode/engine/meta/grouptree.props.json +89 -0
  44. package/es/lowcode/engine/meta/iframe.props.default.json +2 -1
  45. package/es/lowcode/engine/meta/iframe.props.json +3 -2
  46. package/es/lowcode/engine/meta/image.props.default.json +2 -1
  47. package/es/lowcode/engine/meta/image.props.json +3 -2
  48. package/es/lowcode/engine/meta/imex.props.default.json +2 -1
  49. package/es/lowcode/engine/meta/imex.props.json +27 -6
  50. package/es/lowcode/engine/meta/js-editor/auto-complete.json +65 -42
  51. package/es/lowcode/engine/meta/jsx.props.default.json +1 -1
  52. package/es/lowcode/engine/meta/jsx.props.json +1 -1
  53. package/es/lowcode/engine/meta/layout.props.default.json +1 -1
  54. package/es/lowcode/engine/meta/layout.props.json +5 -5
  55. package/es/lowcode/engine/meta/link.props.default.json +2 -1
  56. package/es/lowcode/engine/meta/link.props.json +3 -2
  57. package/es/lowcode/engine/meta/page.props.json +6 -0
  58. package/es/lowcode/engine/meta/pagelayout.props.default.json +1 -1
  59. package/es/lowcode/engine/meta/pagelayout.props.json +1 -1
  60. package/es/lowcode/engine/meta/section.props.json +2 -1
  61. package/es/lowcode/engine/meta/split.props.default.json +1 -1
  62. package/es/lowcode/engine/meta/split.props.json +1 -1
  63. package/es/lowcode/engine/meta/table.props.json +3 -3
  64. package/es/lowcode/engine/meta/text.props.default.json +4 -2
  65. package/es/lowcode/engine/meta/text.props.json +8 -6
  66. package/es/lowcode/engine/meta/tree.props.json +2 -2
  67. package/es/lowcode/engine/provider/ContextProvider/index.js +83 -66
  68. package/es/lowcode/engine/provider/ContextProvider/router.js +43 -0
  69. package/es/lowcode/engine/{tools → provider/ContextProvider}/usePageDataStore.js +9 -7
  70. package/es/lowcode/engine/provider/ContextProvider/usePageVar.js +38 -15
  71. package/es/lowcode/engine/{tools → provider/ContextProvider}/useTodo.js +5 -7
  72. package/es/lowcode/engine/provider/ContextProvider/utils.js +157 -0
  73. package/es/lowcode/engine/provider/RemoteSourceProvider.js +1 -2
  74. package/es/lowcode/engine/tools/dataProcess.js +76 -76
  75. package/es/lowcode/engine/tools/helper.js +28 -2
  76. package/es/lowcode/engine/tools/initDS.js +263 -0
  77. package/es/lowcode/engine/tools/useCanvasRender.js +13 -1
  78. package/es/lowcode/engine/tools/useCombinedRefs.js +3 -2
  79. package/es/lowcode/painter/Components.js +2 -2
  80. package/es/lowcode/painter/Design.js +1 -0
  81. package/es/lowcode/painter/DesignOperator.js +25 -11
  82. package/es/lowcode/painter/Panel.js +2 -2
  83. package/es/lowcode/painter/components/AdvancePanel.js +3 -3
  84. package/es/lowcode/painter/components/Collapse.js +31 -28
  85. package/es/lowcode/painter/components/ColorInput.js +24 -24
  86. package/es/lowcode/painter/components/ListEditor.js +24 -24
  87. package/es/lowcode/painter/components/NumberInput.js +29 -29
  88. package/es/lowcode/painter/components/PanelItem.js +24 -24
  89. package/es/lowcode/painter/components/PopConfirm.js +8 -8
  90. package/es/lowcode/painter/components/PopForm.js +27 -27
  91. package/es/lowcode/painter/components/RuleInput.js +30 -30
  92. package/es/lowcode/painter/components/SortBox.js +22 -22
  93. package/es/lowcode/painter/components/TipIcon.js +16 -0
  94. package/es/lowcode/painter/components/VarEditor.js +456 -0
  95. package/es/lowcode/painter/components/code-editor/BaseEditor.js +32 -32
  96. package/es/lowcode/painter/components/code-editor/CssEditor.js +25 -25
  97. package/es/lowcode/painter/components/code-editor/FullScreenEditor.js +25 -25
  98. package/es/lowcode/painter/components/code-editor/JSEditor.js +23 -21
  99. package/es/lowcode/painter/components/code-editor/JsonEditor.js +25 -25
  100. package/es/lowcode/painter/components/code-editor/VisionEditor.js +81 -0
  101. package/es/lowcode/painter/components/field-setting/SettingUI.js +47 -5
  102. package/es/lowcode/painter/components/field-setting/index.js +27 -13
  103. package/es/lowcode/painter/components/field-setting/meta/frontRules.js +2 -1
  104. package/es/lowcode/painter/index.js +1 -0
  105. package/es/lowcode/painter/panel-section/BlockEditor/index.js +20 -6
  106. package/es/lowcode/painter/panel-section/BlocksEditor/index.js +2 -2
  107. package/es/lowcode/painter/panel-section/ComplexPop.js +242 -0
  108. package/es/lowcode/painter/panel-section/DataSetSelector.js +8 -0
  109. package/es/lowcode/painter/panel-section/FieldsSetting.js +30 -4
  110. package/es/lowcode/painter/panel-section/GroupClassSelector.js +55 -0
  111. package/es/lowcode/painter/panel-section/I18nInput.js +4 -2
  112. package/es/lowcode/painter/panel-section/Icon.js +32 -27
  113. package/es/lowcode/painter/panel-section/IconConditionSelector.js +7 -7
  114. package/es/lowcode/painter/panel-section/IconSelector.js +17 -17
  115. package/es/lowcode/painter/panel-section/ImpExp.js +1 -27
  116. package/es/lowcode/painter/panel-section/ImpExpAlone.js +1 -2
  117. package/es/lowcode/painter/panel-section/LayoutRatio.js +22 -21
  118. package/es/lowcode/painter/panel-section/PageVars.js +300 -0
  119. package/es/lowcode/painter/panel-section/StylePanel/BackGround.js +2 -2
  120. package/es/lowcode/painter/panel-section/StylePanel/Border.js +2 -2
  121. package/es/lowcode/painter/panel-section/StylePanel/BorderRadius.js +2 -2
  122. package/es/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +2 -2
  123. package/es/lowcode/painter/panel-section/StylePanel/BorderSelector.js +2 -2
  124. package/es/lowcode/painter/panel-section/StylePanel/Display.js +2 -2
  125. package/es/lowcode/painter/panel-section/StylePanel/Font.js +2 -2
  126. package/es/lowcode/painter/panel-section/StylePanel/FontEditor.js +2 -2
  127. package/es/lowcode/painter/panel-section/StylePanel/GapSelector.js +2 -2
  128. package/es/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +2 -2
  129. package/es/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +2 -2
  130. package/es/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +2 -2
  131. package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
  132. package/es/lowcode/painter/panel-section/StylePanel/Margin.js +2 -2
  133. package/es/lowcode/painter/panel-section/StylePanel/Opacity.js +2 -2
  134. package/es/lowcode/painter/panel-section/StylePanel/Padding.js +2 -2
  135. package/es/lowcode/painter/panel-section/StylePanel/Pointer.js +2 -2
  136. package/es/lowcode/painter/panel-section/StylePanel/Shadow.js +2 -2
  137. package/es/lowcode/painter/panel-section/StylePanel/Size.js +2 -2
  138. package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +6 -5
  139. package/es/lowcode/painter/panel-section/StylePanel/StyleRow.js +2 -2
  140. package/es/lowcode/painter/panel-section/StylePanel/WidthHeight.js +2 -2
  141. package/es/lowcode/painter/panel-section/StylePanel/index.js +15 -15
  142. package/es/lowcode/painter/panel-section/TabItems.js +6 -42
  143. package/es/lowcode/painter/panel-section/TextContent.js +79 -0
  144. package/es/lowcode/painter/services/complexPop.js +21 -0
  145. package/es/lowcode/painter/style/action-bind-modal.less +102 -102
  146. package/es/lowcode/painter/style/actions-editor.less +15 -15
  147. package/es/lowcode/painter/style/border-editor.less +36 -36
  148. package/es/lowcode/painter/style/border-radius-selector.less +42 -42
  149. package/es/lowcode/painter/style/border-selector.less +39 -39
  150. package/es/lowcode/painter/style/button-type.less +5 -5
  151. package/es/lowcode/painter/style/collapse.less +28 -28
  152. package/es/lowcode/painter/style/color-input.less +19 -19
  153. package/es/lowcode/painter/style/components.less +91 -91
  154. package/es/lowcode/painter/style/design.less +166 -160
  155. package/es/lowcode/painter/style/display.less +17 -17
  156. package/es/lowcode/painter/style/dragdrop.less +10 -10
  157. package/es/lowcode/painter/style/fields-setting.less +25 -25
  158. package/es/lowcode/painter/style/font-editor.less +9 -9
  159. package/es/lowcode/painter/style/fullscreen-editor.less +17 -17
  160. package/es/lowcode/painter/style/icon-selector.less +22 -22
  161. package/es/lowcode/painter/style/icon.less +10 -10
  162. package/es/lowcode/painter/style/impexp.less +7 -7
  163. package/es/lowcode/painter/style/index.less +6 -6
  164. package/es/lowcode/painter/style/layout-ratio.less +51 -51
  165. package/es/lowcode/painter/style/list-editor.less +95 -95
  166. package/es/lowcode/painter/style/number-input.less +17 -17
  167. package/es/lowcode/painter/style/outline.less +28 -28
  168. package/es/lowcode/painter/style/page-layout-display.less +27 -27
  169. package/es/lowcode/painter/style/page-vars.less +25 -0
  170. package/es/lowcode/painter/style/panel-attrs.less +43 -43
  171. package/es/lowcode/painter/style/panel-item.less +54 -54
  172. package/es/lowcode/painter/style/panel.less +98 -98
  173. package/es/lowcode/painter/style/pop-confirm.less +17 -17
  174. package/es/lowcode/painter/style/pop-form.less +19 -19
  175. package/es/lowcode/painter/style/radio.less +24 -24
  176. package/es/lowcode/painter/style/ribbon.less +5 -5
  177. package/es/lowcode/painter/style/rule-input.less +12 -12
  178. package/es/lowcode/painter/style/split-display.less +18 -18
  179. package/es/lowcode/painter/style/style-panel.less +37 -37
  180. package/es/lowcode/painter/style/tabitems.less +90 -90
  181. package/es/lowcode/painter/style/treedragdrop.less +19 -19
  182. package/es/lowcode/preview/index.js +1 -0
  183. package/es/lowcode/view/Canvas.js +24 -22
  184. package/es/lowcode/view/Loading.js +5 -7
  185. package/es/lowcode/view/Page.js +37 -15
  186. package/es/lowcode/view/index.js +1 -0
  187. package/es/lowcode/view/lc-components/Box/index.js +22 -7
  188. package/es/lowcode/view/lc-components/Box/index.less +14 -14
  189. package/es/lowcode/view/lc-components/Box/meta.json +40 -40
  190. package/es/lowcode/view/lc-components/Button/index.js +40 -40
  191. package/es/lowcode/view/lc-components/Button/meta.json +127 -127
  192. package/es/lowcode/view/lc-components/Button/style.less +2 -2
  193. package/es/lowcode/view/lc-components/CardList/meta.json +154 -153
  194. package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +14 -6
  195. package/es/lowcode/view/lc-components/Dialog/index.js +34 -25
  196. package/es/lowcode/view/lc-components/Dialog/index.less +12 -8
  197. package/es/lowcode/view/lc-components/Dialog/meta.json +204 -150
  198. package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +51 -8
  199. package/es/lowcode/view/lc-components/Drawer/index.js +149 -34
  200. package/es/lowcode/view/lc-components/Drawer/index.less +13 -10
  201. package/es/lowcode/view/lc-components/Drawer/meta.json +242 -131
  202. package/es/lowcode/view/lc-components/FieldColor/meta.json +157 -157
  203. package/es/lowcode/view/lc-components/FieldComplex/meta.json +140 -133
  204. package/es/lowcode/view/lc-components/FieldDate/meta.json +141 -139
  205. package/es/lowcode/view/lc-components/FieldDict/meta.json +138 -138
  206. package/es/lowcode/view/lc-components/FieldEditor/meta.json +138 -138
  207. package/es/lowcode/view/lc-components/FieldGroup/meta.json +167 -167
  208. package/es/lowcode/view/lc-components/FieldNumber/meta.json +143 -142
  209. package/es/lowcode/view/lc-components/FieldRadio/meta.json +115 -115
  210. package/es/lowcode/view/lc-components/FieldRegion/meta.json +121 -121
  211. package/es/lowcode/view/lc-components/FieldSelect/meta.json +152 -152
  212. package/es/lowcode/view/lc-components/FieldString/meta.json +152 -152
  213. package/es/lowcode/view/lc-components/FieldSwitch/meta.json +125 -125
  214. package/es/lowcode/view/lc-components/FieldTextarea/meta.json +143 -143
  215. package/es/lowcode/view/lc-components/FieldUpload/meta.json +165 -165
  216. package/es/lowcode/view/lc-components/FieldUser/meta.json +176 -176
  217. package/es/lowcode/view/lc-components/FieldYear/meta.json +129 -129
  218. package/es/lowcode/view/lc-components/Form/FunctionDesign.js +2 -1
  219. package/es/lowcode/view/lc-components/Form/index.js +76 -51
  220. package/es/lowcode/view/lc-components/Form/meta.json +645 -610
  221. package/es/lowcode/view/lc-components/GroupTree/FunctionDesign.js +10 -0
  222. package/es/lowcode/view/lc-components/GroupTree/FunctionLive.js +10 -0
  223. package/es/lowcode/view/lc-components/GroupTree/FunctionPreview.js +10 -0
  224. package/es/lowcode/view/lc-components/GroupTree/index.js +201 -0
  225. package/es/lowcode/view/lc-components/GroupTree/meta.json +89 -0
  226. package/es/lowcode/view/lc-components/Iframe/meta.json +33 -32
  227. package/es/lowcode/view/lc-components/ImEx/index.js +199 -128
  228. package/es/lowcode/view/lc-components/ImEx/index.less +7 -7
  229. package/es/lowcode/view/lc-components/ImEx/meta.json +134 -113
  230. package/es/lowcode/view/lc-components/Image/meta.json +115 -114
  231. package/es/lowcode/view/lc-components/JSX/RuntimeComp.js +4 -4
  232. package/es/lowcode/view/lc-components/JSX/meta.json +28 -28
  233. package/es/lowcode/view/lc-components/Layout/index.js +38 -21
  234. package/es/lowcode/view/lc-components/Layout/index.less +5 -5
  235. package/es/lowcode/view/lc-components/Layout/meta.json +107 -107
  236. package/es/lowcode/view/lc-components/Link/meta.json +113 -112
  237. package/es/lowcode/view/lc-components/Page/meta.json +61 -55
  238. package/es/lowcode/view/lc-components/PageContent/meta.json +9 -9
  239. package/es/lowcode/view/lc-components/PageFooter/meta.json +9 -9
  240. package/es/lowcode/view/lc-components/PageHeader/meta.json +9 -9
  241. package/es/lowcode/view/lc-components/PageLayout/FunctionDesign.js +5 -1
  242. package/es/lowcode/view/lc-components/PageLayout/meta.json +59 -59
  243. package/es/lowcode/view/lc-components/Section/index.js +2 -6
  244. package/es/lowcode/view/lc-components/Section/index.less +7 -7
  245. package/es/lowcode/view/lc-components/Section/meta.json +108 -107
  246. package/es/lowcode/view/lc-components/Split/index.js +19 -4
  247. package/es/lowcode/view/lc-components/Split/meta.json +53 -53
  248. package/es/lowcode/view/lc-components/Table/index.js +175 -148
  249. package/es/lowcode/view/lc-components/Table/meta.json +450 -450
  250. package/es/lowcode/view/lc-components/Tabs/index.js +42 -39
  251. package/es/lowcode/view/lc-components/Tabs/meta.json +113 -113
  252. package/es/lowcode/view/lc-components/Text/index.js +9 -2
  253. package/es/lowcode/view/lc-components/Text/meta.json +56 -56
  254. package/es/lowcode/view/lc-components/Tree/index.js +102 -107
  255. package/es/lowcode/view/lc-components/Tree/index.less +4 -4
  256. package/es/lowcode/view/lc-components/Tree/meta.json +357 -357
  257. package/es/lowcode/view/lc-components/Wrapper.js +17 -2
  258. package/es/lowcode/view/style/canvas.less +5 -5
  259. package/es/lowcode/view/style/loading.less +98 -84
  260. package/es/lowcode/view/style/page.less +7 -7
  261. package/es/services.js +19 -0
  262. package/es/upload/FilesWall/index.js +13 -13
  263. package/es/upload/FilesWall/index.less +74 -74
  264. package/es/upload/Form/gridForm.js +17 -7
  265. package/es/upload/Form/index.less +7 -7
  266. package/es/upload/FormItem/index.js +18 -18
  267. package/es/utils/form.js +25 -25
  268. package/es/utils/grid.js +5 -4
  269. package/lib/components/Builder/index.js +13 -1
  270. package/lib/components/ComplexItem/index.js +62 -47
  271. package/lib/components/LDActions/index.less +68 -68
  272. package/lib/components/LdAutoForm/index.js +5 -3
  273. package/lib/components/LdFormList/index.js +12 -11
  274. package/lib/components/LdGrid/index.js +4 -4
  275. package/lib/components/LdGridForm/index.js +40 -23
  276. package/lib/components/LdGridForm/index.less +7 -7
  277. package/lib/components/LdTree/index.less +40 -40
  278. package/lib/helper/action.js +6 -6
  279. package/lib/helper/form.js +15 -14
  280. package/lib/helper/index.less +7 -7
  281. package/lib/helper/ldBuilder.js +8 -3
  282. package/lib/locales/zh-CN.js +41 -4
  283. package/lib/lowcode/constants/api-url.js +87 -87
  284. package/lib/lowcode/constants/event-topics.js +1 -3
  285. package/lib/lowcode/engine/launcher.js +3 -1
  286. package/lib/lowcode/engine/meta/box.props.json +3 -3
  287. package/lib/lowcode/engine/meta/button.props.default.json +1 -1
  288. package/lib/lowcode/engine/meta/button.props.json +2 -2
  289. package/lib/lowcode/engine/meta/cardlist.props.default.json +1 -0
  290. package/lib/lowcode/engine/meta/cardlist.props.json +2 -1
  291. package/lib/lowcode/engine/meta/components-list.json +6 -126
  292. package/lib/lowcode/engine/meta/dialog.props.default.json +4 -2
  293. package/lib/lowcode/engine/meta/dialog.props.json +76 -20
  294. package/lib/lowcode/engine/meta/drawer.props.default.json +15 -4
  295. package/lib/lowcode/engine/meta/drawer.props.json +144 -24
  296. package/lib/lowcode/engine/meta/fieldcomplex.props.default.json +1 -0
  297. package/lib/lowcode/engine/meta/fieldcomplex.props.json +7 -0
  298. package/lib/lowcode/engine/meta/fielddatadic.props.default.json +16 -0
  299. package/lib/lowcode/engine/meta/fielddatadic.props.json +73 -0
  300. package/lib/lowcode/engine/meta/fielddate.props.default.json +2 -0
  301. package/lib/lowcode/engine/meta/fielddate.props.json +4 -2
  302. package/lib/lowcode/engine/meta/fieldnumber.props.default.json +1 -0
  303. package/lib/lowcode/engine/meta/fieldnumber.props.json +3 -2
  304. package/lib/lowcode/engine/meta/fielduser.props.default.json +1 -1
  305. package/lib/lowcode/engine/meta/fielduser.props.json +1 -1
  306. package/lib/lowcode/engine/meta/form.props.default.json +14 -4
  307. package/lib/lowcode/engine/meta/form.props.json +53 -14
  308. package/lib/lowcode/engine/meta/grouptree.props.default.json +16 -0
  309. package/lib/lowcode/engine/meta/grouptree.props.json +89 -0
  310. package/lib/lowcode/engine/meta/iframe.props.default.json +2 -1
  311. package/lib/lowcode/engine/meta/iframe.props.json +3 -2
  312. package/lib/lowcode/engine/meta/image.props.default.json +2 -1
  313. package/lib/lowcode/engine/meta/image.props.json +3 -2
  314. package/lib/lowcode/engine/meta/imex.props.default.json +2 -1
  315. package/lib/lowcode/engine/meta/imex.props.json +27 -6
  316. package/lib/lowcode/engine/meta/js-editor/auto-complete.json +65 -42
  317. package/lib/lowcode/engine/meta/jsx.props.default.json +1 -1
  318. package/lib/lowcode/engine/meta/jsx.props.json +1 -1
  319. package/lib/lowcode/engine/meta/layout.props.default.json +1 -1
  320. package/lib/lowcode/engine/meta/layout.props.json +5 -5
  321. package/lib/lowcode/engine/meta/link.props.default.json +2 -1
  322. package/lib/lowcode/engine/meta/link.props.json +3 -2
  323. package/lib/lowcode/engine/meta/page.props.json +6 -0
  324. package/lib/lowcode/engine/meta/pagelayout.props.default.json +1 -1
  325. package/lib/lowcode/engine/meta/pagelayout.props.json +1 -1
  326. package/lib/lowcode/engine/meta/section.props.json +2 -1
  327. package/lib/lowcode/engine/meta/split.props.default.json +1 -1
  328. package/lib/lowcode/engine/meta/split.props.json +1 -1
  329. package/lib/lowcode/engine/meta/table.props.json +3 -3
  330. package/lib/lowcode/engine/meta/text.props.default.json +4 -2
  331. package/lib/lowcode/engine/meta/text.props.json +8 -6
  332. package/lib/lowcode/engine/meta/tree.props.json +2 -2
  333. package/lib/lowcode/engine/provider/ContextProvider/index.js +81 -64
  334. package/lib/lowcode/engine/provider/ContextProvider/router.js +57 -0
  335. package/lib/lowcode/engine/{tools → provider/ContextProvider}/usePageDataStore.js +9 -7
  336. package/lib/lowcode/engine/provider/ContextProvider/usePageVar.js +38 -16
  337. package/lib/lowcode/engine/{tools → provider/ContextProvider}/useTodo.js +5 -7
  338. package/lib/lowcode/engine/provider/ContextProvider/utils.js +170 -0
  339. package/lib/lowcode/engine/provider/RemoteSourceProvider.js +2 -3
  340. package/lib/lowcode/engine/tools/dataProcess.js +76 -76
  341. package/lib/lowcode/engine/tools/helper.js +29 -2
  342. package/lib/lowcode/engine/tools/initDS.js +270 -0
  343. package/lib/lowcode/engine/tools/useCanvasRender.js +13 -1
  344. package/lib/lowcode/engine/tools/useCombinedRefs.js +2 -1
  345. package/lib/lowcode/painter/Components.js +2 -2
  346. package/lib/lowcode/painter/Design.js +1 -0
  347. package/lib/lowcode/painter/DesignOperator.js +24 -10
  348. package/lib/lowcode/painter/Panel.js +2 -2
  349. package/lib/lowcode/painter/components/AdvancePanel.js +3 -3
  350. package/lib/lowcode/painter/components/Collapse.js +31 -28
  351. package/lib/lowcode/painter/components/ColorInput.js +24 -24
  352. package/lib/lowcode/painter/components/ListEditor.js +24 -24
  353. package/lib/lowcode/painter/components/NumberInput.js +29 -29
  354. package/lib/lowcode/painter/components/PanelItem.js +24 -24
  355. package/lib/lowcode/painter/components/PopConfirm.js +8 -8
  356. package/lib/lowcode/painter/components/PopForm.js +27 -27
  357. package/lib/lowcode/painter/components/RuleInput.js +30 -30
  358. package/lib/lowcode/painter/components/SortBox.js +22 -22
  359. package/lib/lowcode/painter/components/TipIcon.js +23 -0
  360. package/lib/lowcode/painter/components/VarEditor.js +463 -0
  361. package/lib/lowcode/painter/components/code-editor/BaseEditor.js +32 -32
  362. package/lib/lowcode/painter/components/code-editor/CssEditor.js +25 -25
  363. package/lib/lowcode/painter/components/code-editor/FullScreenEditor.js +25 -25
  364. package/lib/lowcode/painter/components/code-editor/JSEditor.js +23 -21
  365. package/lib/lowcode/painter/components/code-editor/JsonEditor.js +25 -25
  366. package/lib/lowcode/painter/components/code-editor/VisionEditor.js +88 -0
  367. package/lib/lowcode/painter/components/field-setting/SettingUI.js +46 -4
  368. package/lib/lowcode/painter/components/field-setting/index.js +27 -13
  369. package/lib/lowcode/painter/components/field-setting/meta/frontRules.js +2 -1
  370. package/lib/lowcode/painter/index.js +1 -0
  371. package/lib/lowcode/painter/panel-section/BlockEditor/index.js +19 -5
  372. package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +2 -2
  373. package/lib/lowcode/painter/panel-section/ComplexPop.js +250 -0
  374. package/lib/lowcode/painter/panel-section/DataSetSelector.js +8 -0
  375. package/lib/lowcode/painter/panel-section/FieldsSetting.js +30 -4
  376. package/lib/lowcode/painter/panel-section/GroupClassSelector.js +63 -0
  377. package/lib/lowcode/painter/panel-section/I18nInput.js +4 -2
  378. package/lib/lowcode/painter/panel-section/Icon.js +31 -26
  379. package/lib/lowcode/painter/panel-section/IconConditionSelector.js +6 -6
  380. package/lib/lowcode/painter/panel-section/IconSelector.js +17 -17
  381. package/lib/lowcode/painter/panel-section/ImpExp.js +0 -26
  382. package/lib/lowcode/painter/panel-section/ImpExpAlone.js +0 -1
  383. package/lib/lowcode/painter/panel-section/LayoutRatio.js +22 -21
  384. package/lib/lowcode/painter/panel-section/PageVars.js +308 -0
  385. package/lib/lowcode/painter/panel-section/StylePanel/BackGround.js +2 -2
  386. package/lib/lowcode/painter/panel-section/StylePanel/Border.js +2 -2
  387. package/lib/lowcode/painter/panel-section/StylePanel/BorderRadius.js +2 -2
  388. package/lib/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +2 -2
  389. package/lib/lowcode/painter/panel-section/StylePanel/BorderSelector.js +2 -2
  390. package/lib/lowcode/painter/panel-section/StylePanel/Display.js +2 -2
  391. package/lib/lowcode/painter/panel-section/StylePanel/Font.js +2 -2
  392. package/lib/lowcode/painter/panel-section/StylePanel/FontEditor.js +2 -2
  393. package/lib/lowcode/painter/panel-section/StylePanel/GapSelector.js +2 -2
  394. package/lib/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +2 -2
  395. package/lib/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +2 -2
  396. package/lib/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +2 -2
  397. package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
  398. package/lib/lowcode/painter/panel-section/StylePanel/Margin.js +2 -2
  399. package/lib/lowcode/painter/panel-section/StylePanel/Opacity.js +2 -2
  400. package/lib/lowcode/painter/panel-section/StylePanel/Padding.js +2 -2
  401. package/lib/lowcode/painter/panel-section/StylePanel/Pointer.js +2 -2
  402. package/lib/lowcode/painter/panel-section/StylePanel/Shadow.js +2 -2
  403. package/lib/lowcode/painter/panel-section/StylePanel/Size.js +2 -2
  404. package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +6 -5
  405. package/lib/lowcode/painter/panel-section/StylePanel/StyleRow.js +2 -2
  406. package/lib/lowcode/painter/panel-section/StylePanel/WidthHeight.js +2 -2
  407. package/lib/lowcode/painter/panel-section/StylePanel/index.js +15 -15
  408. package/lib/lowcode/painter/panel-section/TabItems.js +6 -42
  409. package/lib/lowcode/painter/panel-section/TextContent.js +87 -0
  410. package/lib/lowcode/painter/services/complexPop.js +28 -0
  411. package/lib/lowcode/painter/style/action-bind-modal.less +102 -102
  412. package/lib/lowcode/painter/style/actions-editor.less +15 -15
  413. package/lib/lowcode/painter/style/border-editor.less +36 -36
  414. package/lib/lowcode/painter/style/border-radius-selector.less +42 -42
  415. package/lib/lowcode/painter/style/border-selector.less +39 -39
  416. package/lib/lowcode/painter/style/button-type.less +5 -5
  417. package/lib/lowcode/painter/style/collapse.less +28 -28
  418. package/lib/lowcode/painter/style/color-input.less +19 -19
  419. package/lib/lowcode/painter/style/components.less +91 -91
  420. package/lib/lowcode/painter/style/design.less +166 -160
  421. package/lib/lowcode/painter/style/display.less +17 -17
  422. package/lib/lowcode/painter/style/dragdrop.less +10 -10
  423. package/lib/lowcode/painter/style/fields-setting.less +25 -25
  424. package/lib/lowcode/painter/style/font-editor.less +9 -9
  425. package/lib/lowcode/painter/style/fullscreen-editor.less +17 -17
  426. package/lib/lowcode/painter/style/icon-selector.less +22 -22
  427. package/lib/lowcode/painter/style/icon.less +10 -10
  428. package/lib/lowcode/painter/style/impexp.less +7 -7
  429. package/lib/lowcode/painter/style/index.less +6 -6
  430. package/lib/lowcode/painter/style/layout-ratio.less +51 -51
  431. package/lib/lowcode/painter/style/list-editor.less +95 -95
  432. package/lib/lowcode/painter/style/number-input.less +17 -17
  433. package/lib/lowcode/painter/style/outline.less +28 -28
  434. package/lib/lowcode/painter/style/page-layout-display.less +27 -27
  435. package/lib/lowcode/painter/style/page-vars.less +25 -0
  436. package/lib/lowcode/painter/style/panel-attrs.less +43 -43
  437. package/lib/lowcode/painter/style/panel-item.less +54 -54
  438. package/lib/lowcode/painter/style/panel.less +98 -98
  439. package/lib/lowcode/painter/style/pop-confirm.less +17 -17
  440. package/lib/lowcode/painter/style/pop-form.less +19 -19
  441. package/lib/lowcode/painter/style/radio.less +24 -24
  442. package/lib/lowcode/painter/style/ribbon.less +5 -5
  443. package/lib/lowcode/painter/style/rule-input.less +12 -12
  444. package/lib/lowcode/painter/style/split-display.less +18 -18
  445. package/lib/lowcode/painter/style/style-panel.less +37 -37
  446. package/lib/lowcode/painter/style/tabitems.less +90 -90
  447. package/lib/lowcode/painter/style/treedragdrop.less +19 -19
  448. package/lib/lowcode/preview/index.js +1 -0
  449. package/lib/lowcode/view/Canvas.js +24 -22
  450. package/lib/lowcode/view/Loading.js +5 -7
  451. package/lib/lowcode/view/Page.js +35 -13
  452. package/lib/lowcode/view/index.js +1 -0
  453. package/lib/lowcode/view/lc-components/Box/index.js +21 -6
  454. package/lib/lowcode/view/lc-components/Box/index.less +14 -14
  455. package/lib/lowcode/view/lc-components/Box/meta.json +40 -40
  456. package/lib/lowcode/view/lc-components/Button/index.js +38 -38
  457. package/lib/lowcode/view/lc-components/Button/meta.json +127 -127
  458. package/lib/lowcode/view/lc-components/Button/style.less +2 -2
  459. package/lib/lowcode/view/lc-components/CardList/meta.json +154 -153
  460. package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +13 -5
  461. package/lib/lowcode/view/lc-components/Dialog/index.js +34 -25
  462. package/lib/lowcode/view/lc-components/Dialog/index.less +12 -8
  463. package/lib/lowcode/view/lc-components/Dialog/meta.json +204 -150
  464. package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +52 -8
  465. package/lib/lowcode/view/lc-components/Drawer/index.js +148 -33
  466. package/lib/lowcode/view/lc-components/Drawer/index.less +13 -10
  467. package/lib/lowcode/view/lc-components/Drawer/meta.json +242 -131
  468. package/lib/lowcode/view/lc-components/FieldColor/meta.json +157 -157
  469. package/lib/lowcode/view/lc-components/FieldComplex/meta.json +140 -133
  470. package/lib/lowcode/view/lc-components/FieldDate/meta.json +141 -139
  471. package/lib/lowcode/view/lc-components/FieldDict/meta.json +138 -138
  472. package/lib/lowcode/view/lc-components/FieldEditor/meta.json +138 -138
  473. package/lib/lowcode/view/lc-components/FieldGroup/meta.json +167 -167
  474. package/lib/lowcode/view/lc-components/FieldNumber/meta.json +143 -142
  475. package/lib/lowcode/view/lc-components/FieldRadio/meta.json +115 -115
  476. package/lib/lowcode/view/lc-components/FieldRegion/meta.json +121 -121
  477. package/lib/lowcode/view/lc-components/FieldSelect/meta.json +152 -152
  478. package/lib/lowcode/view/lc-components/FieldString/meta.json +152 -152
  479. package/lib/lowcode/view/lc-components/FieldSwitch/meta.json +125 -125
  480. package/lib/lowcode/view/lc-components/FieldTextarea/meta.json +143 -143
  481. package/lib/lowcode/view/lc-components/FieldUpload/meta.json +165 -165
  482. package/lib/lowcode/view/lc-components/FieldUser/meta.json +176 -176
  483. package/lib/lowcode/view/lc-components/FieldYear/meta.json +129 -129
  484. package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +2 -1
  485. package/lib/lowcode/view/lc-components/Form/index.js +75 -50
  486. package/lib/lowcode/view/lc-components/Form/meta.json +645 -610
  487. package/lib/lowcode/view/lc-components/GroupTree/FunctionDesign.js +17 -0
  488. package/lib/lowcode/view/lc-components/GroupTree/FunctionLive.js +17 -0
  489. package/lib/lowcode/view/lc-components/GroupTree/FunctionPreview.js +17 -0
  490. package/lib/lowcode/view/lc-components/GroupTree/index.js +209 -0
  491. package/lib/lowcode/view/lc-components/GroupTree/meta.json +89 -0
  492. package/lib/lowcode/view/lc-components/Iframe/meta.json +33 -32
  493. package/lib/lowcode/view/lc-components/ImEx/index.js +197 -126
  494. package/lib/lowcode/view/lc-components/ImEx/index.less +7 -7
  495. package/lib/lowcode/view/lc-components/ImEx/meta.json +134 -113
  496. package/lib/lowcode/view/lc-components/Image/meta.json +115 -114
  497. package/lib/lowcode/view/lc-components/JSX/RuntimeComp.js +4 -4
  498. package/lib/lowcode/view/lc-components/JSX/meta.json +28 -28
  499. package/lib/lowcode/view/lc-components/Layout/index.js +37 -20
  500. package/lib/lowcode/view/lc-components/Layout/index.less +5 -5
  501. package/lib/lowcode/view/lc-components/Layout/meta.json +107 -107
  502. package/lib/lowcode/view/lc-components/Link/meta.json +113 -112
  503. package/lib/lowcode/view/lc-components/Page/meta.json +61 -55
  504. package/lib/lowcode/view/lc-components/PageContent/meta.json +9 -9
  505. package/lib/lowcode/view/lc-components/PageFooter/meta.json +9 -9
  506. package/lib/lowcode/view/lc-components/PageHeader/meta.json +9 -9
  507. package/lib/lowcode/view/lc-components/PageLayout/FunctionDesign.js +5 -1
  508. package/lib/lowcode/view/lc-components/PageLayout/meta.json +59 -59
  509. package/lib/lowcode/view/lc-components/Section/index.js +2 -6
  510. package/lib/lowcode/view/lc-components/Section/index.less +7 -7
  511. package/lib/lowcode/view/lc-components/Section/meta.json +108 -107
  512. package/lib/lowcode/view/lc-components/Split/index.js +18 -3
  513. package/lib/lowcode/view/lc-components/Split/meta.json +53 -53
  514. package/lib/lowcode/view/lc-components/Table/index.js +176 -149
  515. package/lib/lowcode/view/lc-components/Table/meta.json +450 -450
  516. package/lib/lowcode/view/lc-components/Tabs/index.js +40 -37
  517. package/lib/lowcode/view/lc-components/Tabs/meta.json +113 -113
  518. package/lib/lowcode/view/lc-components/Text/index.js +8 -1
  519. package/lib/lowcode/view/lc-components/Text/meta.json +56 -56
  520. package/lib/lowcode/view/lc-components/Tree/index.js +102 -107
  521. package/lib/lowcode/view/lc-components/Tree/index.less +4 -4
  522. package/lib/lowcode/view/lc-components/Tree/meta.json +357 -357
  523. package/lib/lowcode/view/lc-components/Wrapper.js +16 -1
  524. package/lib/lowcode/view/style/canvas.less +5 -5
  525. package/lib/lowcode/view/style/loading.less +98 -84
  526. package/lib/lowcode/view/style/page.less +7 -7
  527. package/lib/services.js +20 -0
  528. package/lib/upload/FilesWall/index.js +13 -13
  529. package/lib/upload/FilesWall/index.less +74 -74
  530. package/lib/upload/Form/gridForm.js +17 -7
  531. package/lib/upload/Form/index.less +7 -7
  532. package/lib/upload/FormItem/index.js +18 -18
  533. package/lib/utils/form.js +24 -24
  534. package/lib/utils/grid.js +4 -3
  535. package/lowcode.js +1 -1
  536. package/package.json +175 -175
  537. package/upload.js +1 -1
  538. package/utils.js +1 -1
  539. package/es/lowcode/view/lc-components/Form/index.less +0 -5
  540. package/lib/lowcode/view/lc-components/Form/index.less +0 -5
@@ -8,6 +8,7 @@ import { useMemoizedFn, useUpdateEffect, useCreation } from 'ahooks';
8
8
  import { Modal, Button } from 'luck-design/antd';
9
9
  import classNames from 'classnames';
10
10
  import styled from 'styled-components';
11
+ import { isNil } from 'lodash';
11
12
  import { LDActions } from "../../../../index";
12
13
  import { useContext } from "../../../engine/provider/ContextProvider";
13
14
  import { omitBadProps } from "../../../engine/tools/helper";
@@ -29,7 +30,10 @@ var LCDialog = function LCDialog(_ref) {
29
30
  wrapClassName = _ref.wrapClassName,
30
31
  maskStyle = _ref.maskStyle,
31
32
  defaultOpen = _ref.defaultOpen,
33
+ closable = _ref.closable,
32
34
  mask = _ref.mask,
35
+ padding = _ref.padding,
36
+ closeType = _ref.closeType,
33
37
  okText = _ref.okText,
34
38
  cancelText = _ref.cancelText,
35
39
  destroyOnClose = _ref.destroyOnClose,
@@ -75,24 +79,23 @@ var LCDialog = function LCDialog(_ref) {
75
79
  while (1) switch (_context.prev = _context.next) {
76
80
  case 0:
77
81
  setLoading(true);
78
- _context.next = 3;
82
+ _context.prev = 1;
83
+ _context.next = 4;
79
84
  return ctx.doAction(advance.events.onOk);
80
- case 3:
81
- setLoading(false);
82
85
  case 4:
86
+ _context.prev = 4;
87
+ setLoading(false);
88
+ return _context.finish(4);
89
+ case 7:
83
90
  case "end":
84
91
  return _context.stop();
85
92
  }
86
- }, _callee);
93
+ }, _callee, null, [[1,, 4, 7]]);
87
94
  })));
88
95
  var _footer = useCreation(function () {
89
- var _btnGroup$todoList;
90
96
  if (!footer) return {
91
97
  footer: null
92
98
  };
93
- if (!(btnGroup !== null && btnGroup !== void 0 && (_btnGroup$todoList = btnGroup.todoList) !== null && _btnGroup$todoList !== void 0 && _btnGroup$todoList.length)) return {
94
- confirmLoading: loading
95
- };
96
99
  return {
97
100
  footer: /*#__PURE__*/React.createElement(Footer, null, /*#__PURE__*/React.createElement(LDActions, _extends({}, btnGroup, {
98
101
  doAction: function doAction(action) {
@@ -111,36 +114,36 @@ var LCDialog = function LCDialog(_ref) {
111
114
  onClick: handleOk
112
115
  }, okText))
113
116
  };
114
- }, [footer, btnGroup, loading]);
117
+ }, [footer, btnGroup, loading, cancelText, okText]);
115
118
  var getTargetDom = useMemoizedFn(function () {
116
119
  var _domRef$current;
117
120
  return (_domRef$current = domRef.current) === null || _domRef$current === void 0 ? void 0 : _domRef$current.closest('.ant-modal-content');
118
121
  });
119
122
  useImperativeHandle(apiRef, function () {
120
123
  return {
121
- /**
122
- * 弹窗打开状态
123
- * @property
124
+ /**
125
+ * 弹窗打开状态
126
+ * @property
124
127
  */
125
128
  open: open,
126
- /**
127
- * 打开弹窗
128
- * @method
129
+ /**
130
+ * 打开弹窗
131
+ * @method
129
132
  */
130
133
  doOpen: function doOpen() {
131
134
  return setOpen(true);
132
135
  },
133
- /**
134
- * 关闭弹窗
135
- * @method
136
+ /**
137
+ * 关闭弹窗
138
+ * @method
136
139
  */
137
140
  doClose: function doClose() {
138
141
  return setOpen(false);
139
142
  },
140
- /**
141
- * 设置弹窗标题
142
- * @method
143
- * @param {stirng} title -标题
143
+ /**
144
+ * 设置弹窗标题
145
+ * @method
146
+ * @param {stirng} title -标题
144
147
  */
145
148
  setTitle: function setTitle(_title) {
146
149
  return _setTitle(_title);
@@ -155,16 +158,22 @@ var LCDialog = function LCDialog(_ref) {
155
158
  }, /*#__PURE__*/React.createElement(Modal, _extends({
156
159
  title: _title,
157
160
  visible: open,
158
- getContainer: getContainer,
159
161
  width: width,
160
162
  mask: mask,
163
+ closable: closable,
161
164
  maskStyle: maskStyle,
162
165
  bodyStyle: {
163
166
  height: height,
164
167
  overflowY: 'auto',
165
- marginTop: 0
168
+ marginTop: 0,
169
+ padding: padding
166
170
  },
167
- wrapClassName: classNames(styles['lc-component-dialog-wrapper'], _defineProperty({}, wrapClassName, !!wrapClassName))
171
+ wrapClassName: classNames(styles['lc-component-dialog-wrapper'], _defineProperty({}, wrapClassName, !!wrapClassName)),
172
+ maskClosable: !!(closeType !== null && closeType !== void 0 && closeType.includes('maskClosable')),
173
+ keyboard: !!(closeType !== null && closeType !== void 0 && closeType.includes('keyboard')),
174
+ getContainer: isNil(getContainer) ? function () {
175
+ return document.getElementById('root') || document.getElementById('react-content') || document.body;
176
+ } : getContainer
168
177
  }, _footer, {
169
178
  onOk: handleOk,
170
179
  onCancel: function onCancel() {
@@ -1,8 +1,12 @@
1
- :global {
2
- .runtime-design {
3
- position: absolute !important;
4
- }
5
- div.ant-modal-root:has(> .runtime-design) {
6
- display: none;
7
- }
8
- }
1
+ :global {
2
+ .runtime-design {
3
+ position: absolute !important;
4
+ .ant-modal {
5
+ transition: none !important;
6
+ transform: none !important;
7
+ }
8
+ }
9
+ div.ant-modal-root:has(> .runtime-design) {
10
+ display: none;
11
+ }
12
+ }
@@ -1,150 +1,204 @@
1
- {
2
- "component": "Dialog",
3
- "name": "对话框",
4
- "desc": "需要用户处理事务,又不希望跳转页面以致打断工作流程时,可以使用 Modal 在当前页面正中打开一个浮层,承载相应的操作。",
5
- "icon": "icon-dialog",
6
- "group": "basic",
7
- "groupName": "基础",
8
- "order": 1,
9
- "props": [
10
- {
11
- "key": "id",
12
- "name": "唯一标识",
13
- "type": "string",
14
- "disabled": true
15
- },
16
- {
17
- "key": "title",
18
- "name": "标题",
19
- "desc": "对话框左上角的标题",
20
- "type": "_I18nInput",
21
- "default": "对话框"
22
- },
23
- {
24
- "key": "width",
25
- "name": "对话框宽度",
26
- "type": "_WidthHeight",
27
- "options": [
28
- {
29
- "label": "px",
30
- "value": "px"
31
- },
32
- {
33
- "label": "%",
34
- "value": "%"
35
- },
36
- {
37
- "label": "vw",
38
- "value": "vw"
39
- },
40
- {
41
- "label": "A",
42
- "value": "auto"
43
- }
44
- ],
45
- "default": "700px"
46
- },
47
- {
48
- "key": "height",
49
- "name": "内容区高度",
50
- "type": "_WidthHeight",
51
- "options": [
52
- {
53
- "label": "px",
54
- "value": "px"
55
- },
56
- {
57
- "label": "vh",
58
- "value": "vh"
59
- },
60
- {
61
- "label": "A",
62
- "value": "auto"
63
- }
64
- ],
65
- "default": "50vh"
66
- },
67
- {
68
- "key": "defaultOpen",
69
- "name": "默认显示",
70
- "desc": "默认是否显示",
71
- "type": "switch",
72
- "default": false
73
- },
74
- {
75
- "key": "destroyOnClose",
76
- "name": "关闭销毁",
77
- "desc": "关闭时销毁对话框里的子元素",
78
- "type": "switch",
79
- "default": true
80
- },
81
- {
82
- "key": "mask",
83
- "name": "显示遮罩",
84
- "type": "switch",
85
- "default": true
86
- },
87
- {
88
- "key": "okText",
89
- "name": "确认文字",
90
- "type": "_I18nInput",
91
- "default": "确定"
92
- },
93
- {
94
- "key": "cancelText",
95
- "name": "取消文字",
96
- "type": "_I18nInput",
97
- "default": "取消"
98
- },
99
- {
100
- "key": "footer",
101
- "name": "显示footer",
102
- "desc": "是否显示底部按钮区域",
103
- "type": "switch",
104
- "default": true
105
- },
106
- {
107
- "key": "btnGroup",
108
- "name": "按钮组",
109
- "desc": "底部按钮区域的按钮组(参考按钮配置)",
110
- "type": "_ActionsEditor",
111
- "default": { "display": "button", "max": 2, "moreText": "操作", "todoList": [] },
112
- "wrapper": "collapse",
113
- "wrapperProps": { "suppressIcon": true }
114
- }
115
- ],
116
- "advance": {
117
- "events": [
118
- {
119
- "key": "onMount",
120
- "name": "组件首次渲染时",
121
- "desc": "在组件首次渲染时,执行方法",
122
- "func": "function onMount() {\n\t\n}"
123
- },
124
- {
125
- "key": "onUnmount",
126
- "name": "组件卸载时",
127
- "desc": "在组件卸载时,执行方法。",
128
- "func": "function onUnmount() {\n\t\n}"
129
- },
130
- {
131
- "key": "onOpen",
132
- "name": "对话框打开时",
133
- "desc": "在对话框打开时,执行方法",
134
- "func": "function onOpen() {\n\t\n}"
135
- },
136
- {
137
- "key": "onClose",
138
- "name": "对话框关闭时",
139
- "desc": "在对话框打开时,执行方法,promise反馈false无法截断关闭",
140
- "func": "function onClose() {\n\t\n}"
141
- },
142
- {
143
- "key": "onOk",
144
- "name": "确定按钮点击",
145
- "desc": "点击确定按钮时,执行方法,return为Promose对象时会自动追加loading状态",
146
- "func": "function onOk() {\n\t\n}"
147
- }
148
- ]
149
- }
150
- }
1
+ {
2
+ "component": "Dialog",
3
+ "name": "对话框",
4
+ "desc": "需要用户处理事务,又不希望跳转页面以致打断工作流程时,可以使用 Modal 在当前页面正中打开一个浮层,承载相应的操作。",
5
+ "icon": "icon-dialog",
6
+ "group": "basic",
7
+ "groupName": "基础",
8
+ "order": 1,
9
+ "props": [
10
+ {
11
+ "key": "id",
12
+ "name": "唯一标识",
13
+ "type": "string",
14
+ "disabled": true
15
+ },
16
+ {
17
+ "key": "title",
18
+ "name": "标题",
19
+ "desc": "对话框左上角的标题",
20
+ "type": "_I18nInput",
21
+ "default": "对话框"
22
+ },
23
+ {
24
+ "key": "width",
25
+ "name": "对话框宽度",
26
+ "type": "_WidthHeight",
27
+ "options": [
28
+ {
29
+ "label": "px",
30
+ "value": "px"
31
+ },
32
+ {
33
+ "label": "%",
34
+ "value": "%"
35
+ },
36
+ {
37
+ "label": "vw",
38
+ "value": "vw"
39
+ },
40
+ {
41
+ "label": "A",
42
+ "value": "auto"
43
+ }
44
+ ],
45
+ "default": "700px"
46
+ },
47
+ {
48
+ "key": "height",
49
+ "name": "内容区高度",
50
+ "type": "_WidthHeight",
51
+ "options": [
52
+ {
53
+ "label": "px",
54
+ "value": "px"
55
+ },
56
+ {
57
+ "label": "vh",
58
+ "value": "vh"
59
+ },
60
+ {
61
+ "label": "A",
62
+ "value": "auto"
63
+ }
64
+ ],
65
+ "default": "50vh"
66
+ },
67
+ {
68
+ "key": "padding",
69
+ "name": "内边距",
70
+ "type": "select",
71
+ "options": [
72
+ {
73
+ "label": "大(24px)",
74
+ "value": 24
75
+ },
76
+ {
77
+ "label": "中(16px)",
78
+ "value": 16
79
+ },
80
+ {
81
+ "label": "小(8px)",
82
+ "value": 8
83
+ },
84
+ {
85
+ "label": "无(0px)",
86
+ "value": 0
87
+ }
88
+ ],
89
+ "default": 16
90
+ },
91
+ {
92
+ "key": "defaultOpen",
93
+ "name": "默认显示",
94
+ "desc": "默认是否显示",
95
+ "type": "switch",
96
+ "default": false
97
+ },
98
+ {
99
+ "key": "mask",
100
+ "name": "显示遮罩",
101
+ "type": "switch",
102
+ "default": true
103
+ },
104
+ {
105
+ "key": "closable",
106
+ "name": "关闭按钮",
107
+ "desc": "是否显示右上角的关闭按钮",
108
+ "type": "switch",
109
+ "default": true
110
+ },
111
+ {
112
+ "key": "destroyOnClose",
113
+ "name": "关闭销毁",
114
+ "desc": "关闭时销毁对话框里的子元素",
115
+ "type": "switch",
116
+ "default": true
117
+ },
118
+ {
119
+ "key": "closeType",
120
+ "name": "关闭方式",
121
+ "type": "checkbox",
122
+ "options": [
123
+ {
124
+ "label": "点击遮罩",
125
+ "value": "maskClosable"
126
+ },
127
+ {
128
+ "label": "ESC",
129
+ "value": "keyboard"
130
+ }
131
+ ],
132
+ "defaultValue": ["maskClosable"]
133
+ },
134
+ {
135
+ "key": "footerSetting",
136
+ "name": "底部按钮配置",
137
+ "type": "group",
138
+ "props": [
139
+ {
140
+ "key": "footer",
141
+ "name": "显示footer",
142
+ "desc": "是否显示底部按钮区域",
143
+ "type": "switch",
144
+ "default": true
145
+ },
146
+ {
147
+ "key": "okText",
148
+ "name": "确认文字",
149
+ "type": "_I18nInput",
150
+ "default": "确定"
151
+ },
152
+ {
153
+ "key": "cancelText",
154
+ "name": "取消文字",
155
+ "type": "_I18nInput",
156
+ "default": "取消"
157
+ }
158
+ ]
159
+ },
160
+ {
161
+ "key": "btnGroup",
162
+ "name": "按钮组",
163
+ "desc": "底部按钮区域的按钮组",
164
+ "type": "_ActionsEditor",
165
+ "default": { "display": "button", "max": 2, "moreText": "操作", "todoList": [] },
166
+ "wrapper": "collapse",
167
+ "wrapperProps": { "suppressIcon": true }
168
+ }
169
+ ],
170
+ "advance": {
171
+ "events": [
172
+ {
173
+ "key": "onMount",
174
+ "name": "组件首次渲染时",
175
+ "desc": "在组件首次渲染时,执行方法",
176
+ "func": "function onMount() {\n\t\n}"
177
+ },
178
+ {
179
+ "key": "onUnmount",
180
+ "name": "组件卸载时",
181
+ "desc": "在组件卸载时,执行方法。",
182
+ "func": "function onUnmount() {\n\t\n}"
183
+ },
184
+ {
185
+ "key": "onOpen",
186
+ "name": "对话框打开时",
187
+ "desc": "在对话框打开时,执行方法",
188
+ "func": "function onOpen() {\n\t\n}"
189
+ },
190
+ {
191
+ "key": "onClose",
192
+ "name": "对话框关闭时",
193
+ "desc": "在对话框关闭时,执行方法",
194
+ "func": "function onClose() {\n\t\n}"
195
+ },
196
+ {
197
+ "key": "onOk",
198
+ "name": "确定按钮点击",
199
+ "desc": "点击确定按钮时,执行方法,return为Promose对象时会自动追加loading状态",
200
+ "func": "function onOk() {\n\t\n}"
201
+ }
202
+ ]
203
+ }
204
+ }
@@ -1,23 +1,66 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- var _excluded = ["children", "className", "show"];
5
- import React from 'react';
5
+ var _excluded = ["id", "children", "className", "defaultOpen"];
6
+ import React, { useRef, useEffect, useImperativeHandle } from 'react';
7
+ import { useCreation } from 'ahooks';
6
8
  import Index from "./index";
7
9
  import classNames from 'classnames';
8
- import styles from "./index.less";
10
+ import { suid } from '@luck-design-biz/base/utils';
11
+ import { useContext, addNode } from "../../../engine/provider/ContextProvider";
12
+ import "./index.less";
13
+ import boxDefaultMeta from "../../../engine/meta/box.props.default.json";
9
14
  var FunctionDesign = function FunctionDesign(_ref) {
10
- var children = _ref.children,
15
+ var id = _ref.id,
16
+ children = _ref.children,
11
17
  className = _ref.className,
12
- show = _ref.show,
18
+ defaultOpen = _ref.defaultOpen,
13
19
  props = _objectWithoutProperties(_ref, _excluded);
20
+ var apiRef = useRef();
21
+ var ctx = useContext();
22
+ useImperativeHandle(apiRef, function () {
23
+ return {
24
+ doOpen: function doOpen() {
25
+ var _self = ctx.componentMap.get(id).api.getSelfDom();
26
+ _self.closest('#design-workspace').style.overflow = 'hidden';
27
+ _self.closest('.ant-drawer').style.display = 'block';
28
+ },
29
+ doClose: function doClose() {
30
+ var _self = ctx.componentMap.get(id).api.getSelfDom();
31
+ _self.closest('#design-workspace').style.overflow = '';
32
+ _self.closest('.ant-drawer').style.display = 'none';
33
+ }
34
+ };
35
+ }, []);
36
+ useEffect(function () {
37
+ if (defaultOpen) {
38
+ ctx.componentMap.get(id).api.getSelfDom().closest('#design-workspace').style.overflow = 'hidden';
39
+ }
40
+ }, [defaultOpen]);
41
+ useCreation(function () {
42
+ if (children !== null && children !== void 0 && children.length) return;
43
+ ctx.$subscriber(ctx.topics.COMPONENT_APPEND).once(function (_ref2) {
44
+ var compId = _ref2.id;
45
+ if (compId !== id) return;
46
+ addNode(id, "box_".concat(suid()), _objectSpread(_objectSpread({}, boxDefaultMeta), {}, {
47
+ buildIn: true
48
+ }));
49
+ }).watch();
50
+ }, []);
14
51
  return /*#__PURE__*/React.createElement(Index, _extends({
15
- className: classNames(styles['runtime-design'], _defineProperty(_defineProperty({}, className, !!className), "hidden", !show)),
52
+ id: id,
53
+ className: classNames('runtime-design', _defineProperty({}, className, !!className)),
16
54
  getContainer: false,
17
- show: show,
18
55
  style: {
19
56
  position: 'absolute'
20
57
  }
21
- }, props), children);
58
+ }, props, {
59
+ $apiRef: apiRef,
60
+ $designProps: {
61
+ visible: true,
62
+ zIndex: 10
63
+ }
64
+ }), children);
22
65
  };
23
66
  export default FunctionDesign;