@luck-design-biz/luckda 0.0.25-1 → 0.0.25-3

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 (215) hide show
  1. package/es/locales/zh-CN.js +9 -0
  2. package/es/lowcode/constants/api-url.js +184 -100
  3. package/es/lowcode/constants/index.js +2 -1
  4. package/es/lowcode/engine/meta/box.props.default.json +1 -1
  5. package/es/lowcode/engine/meta/box.props.json +1 -1
  6. package/es/lowcode/engine/meta/button.props.json +1 -1
  7. package/es/lowcode/engine/meta/cardlist.props.json +1 -1
  8. package/es/lowcode/engine/meta/components-list.json +1 -1
  9. package/es/lowcode/engine/meta/dialog.props.json +1 -1
  10. package/es/lowcode/engine/meta/drawer.props.json +1 -1
  11. package/es/lowcode/engine/meta/form.props.default.json +4 -5
  12. package/es/lowcode/engine/meta/form.props.json +33 -30
  13. package/es/lowcode/engine/meta/image.props.json +2 -2
  14. package/es/lowcode/engine/meta/imex.props.json +1 -1
  15. package/es/lowcode/engine/meta/link.props.json +1 -1
  16. package/es/lowcode/engine/meta/section.props.default.json +4 -6
  17. package/es/lowcode/engine/meta/section.props.json +52 -49
  18. package/es/lowcode/engine/meta/text.props.json +2 -2
  19. package/es/lowcode/engine/meta/tree.props.json +2 -2
  20. package/es/lowcode/engine/provider/ContextProvider/index.js +10 -2
  21. package/es/lowcode/engine/provider/RemoteSourceProvider.js +28 -15
  22. package/es/lowcode/engine/tools/helper.js +23 -21
  23. package/es/lowcode/engine/tools/useCanvasRender.js +5 -7
  24. package/es/lowcode/engine/tools/usePromiseState.js +23 -14
  25. package/es/lowcode/painter/Design.js +34 -2
  26. package/es/lowcode/painter/DesignOperator.js +6 -8
  27. package/es/lowcode/painter/DesignToolbar.js +258 -21
  28. package/es/lowcode/painter/Panel.js +8 -9
  29. package/es/lowcode/painter/components/AttrsPanel.js +6 -6
  30. package/es/lowcode/painter/components/DragDrop/DragDropWrapper.js +5 -2
  31. package/es/lowcode/painter/components/ListEditor.js +8 -2
  32. package/es/lowcode/painter/components/field-setting/BatchSetting.js +13 -3
  33. package/es/lowcode/painter/components/field-setting/SettingUI.js +26 -7
  34. package/es/lowcode/painter/components/field-setting/index.js +18 -8
  35. package/es/lowcode/painter/index.js +1 -28
  36. package/es/lowcode/painter/panel-section/ActionsColumnWidth.js +25 -0
  37. package/es/lowcode/painter/panel-section/BlockEditor/index.js +7 -4
  38. package/es/lowcode/painter/panel-section/BlocksEditor/BlockEditorItem.js +4 -3
  39. package/es/lowcode/painter/panel-section/BlocksEditor/index.js +48 -15
  40. package/es/lowcode/painter/panel-section/FieldsSetting.js +48 -27
  41. package/es/lowcode/painter/panel-section/I18nInput.js +20 -0
  42. package/es/lowcode/painter/style/design.less +6 -2
  43. package/es/lowcode/painter/style/list-editor.less +36 -0
  44. package/es/lowcode/preview/index.js +17 -4
  45. package/es/lowcode/view/lc-components/Box/FunctionLive.js +1 -0
  46. package/es/lowcode/view/lc-components/Box/FunctionPreview.js +1 -0
  47. package/es/lowcode/view/lc-components/Box/meta.json +1 -1
  48. package/es/lowcode/view/lc-components/Button/meta.json +1 -1
  49. package/es/lowcode/view/lc-components/CardList/FunctionDesign.js +1 -0
  50. package/es/lowcode/view/lc-components/CardList/FunctionLive.js +1 -0
  51. package/es/lowcode/view/lc-components/CardList/FunctionPreview.js +1 -0
  52. package/es/lowcode/view/lc-components/CardList/meta.json +1 -1
  53. package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +2 -4
  54. package/es/lowcode/view/lc-components/Dialog/FunctionLive.js +1 -0
  55. package/es/lowcode/view/lc-components/Dialog/FunctionPreview.js +1 -0
  56. package/es/lowcode/view/lc-components/Dialog/meta.json +1 -1
  57. package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +1 -0
  58. package/es/lowcode/view/lc-components/Drawer/FunctionLive.js +1 -0
  59. package/es/lowcode/view/lc-components/Drawer/FunctionPreview.js +1 -0
  60. package/es/lowcode/view/lc-components/Drawer/meta.json +1 -1
  61. package/es/lowcode/view/lc-components/Form/FunctionDesign.js +66 -4
  62. package/es/lowcode/view/lc-components/Form/FunctionLive.js +1 -0
  63. package/es/lowcode/view/lc-components/Form/FunctionPreview.js +1 -0
  64. package/es/lowcode/view/lc-components/Form/index.js +232 -61
  65. package/es/lowcode/view/lc-components/Form/meta.json +33 -30
  66. package/es/lowcode/view/lc-components/Iframe/FunctionDesign.js +1 -0
  67. package/es/lowcode/view/lc-components/Iframe/FunctionLive.js +1 -0
  68. package/es/lowcode/view/lc-components/Iframe/FunctionPreview.js +1 -0
  69. package/es/lowcode/view/lc-components/ImEx/FunctionDesign.js +1 -0
  70. package/es/lowcode/view/lc-components/ImEx/FunctionLive.js +1 -0
  71. package/es/lowcode/view/lc-components/ImEx/FunctionPreview.js +1 -0
  72. package/es/lowcode/view/lc-components/ImEx/meta.json +1 -1
  73. package/es/lowcode/view/lc-components/Image/FunctionDesign.js +1 -0
  74. package/es/lowcode/view/lc-components/Image/FunctionLive.js +1 -0
  75. package/es/lowcode/view/lc-components/Image/FunctionPreview.js +1 -0
  76. package/es/lowcode/view/lc-components/Image/meta.json +2 -2
  77. package/es/lowcode/view/lc-components/JSX/FunctionDesign.js +1 -0
  78. package/es/lowcode/view/lc-components/JSX/FunctionLive.js +1 -0
  79. package/es/lowcode/view/lc-components/JSX/FunctionPreview.js +1 -0
  80. package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +6 -7
  81. package/es/lowcode/view/lc-components/Layout/FunctionPreview.js +1 -0
  82. package/es/lowcode/view/lc-components/Link/FunctionDesign.js +1 -0
  83. package/es/lowcode/view/lc-components/Link/FunctionLive.js +1 -0
  84. package/es/lowcode/view/lc-components/Link/FunctionPreview.js +1 -0
  85. package/es/lowcode/view/lc-components/Link/meta.json +1 -1
  86. package/es/lowcode/view/lc-components/Section/FunctionDesign.js +31 -2
  87. package/es/lowcode/view/lc-components/Section/FunctionLive.js +1 -0
  88. package/es/lowcode/view/lc-components/Section/FunctionPreview.js +1 -0
  89. package/es/lowcode/view/lc-components/Section/index.js +114 -24
  90. package/es/lowcode/view/lc-components/Section/index.less +7 -0
  91. package/es/lowcode/view/lc-components/Section/meta.json +48 -49
  92. package/es/lowcode/view/lc-components/Split/FunctionDesign.js +4 -6
  93. package/es/lowcode/view/lc-components/Split/FunctionLive.js +1 -0
  94. package/es/lowcode/view/lc-components/Split/FunctionPreview.js +1 -0
  95. package/es/lowcode/view/lc-components/Split/index.js +4 -4
  96. package/es/lowcode/view/lc-components/Table/FunctionLive.js +1 -0
  97. package/es/lowcode/view/lc-components/Table/FunctionPreview.js +1 -0
  98. package/es/lowcode/view/lc-components/Table/index.js +7 -6
  99. package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +2 -4
  100. package/es/lowcode/view/lc-components/Text/FunctionDesign.js +1 -0
  101. package/es/lowcode/view/lc-components/Text/FunctionLive.js +1 -0
  102. package/es/lowcode/view/lc-components/Text/FunctionPreview.js +1 -0
  103. package/es/lowcode/view/lc-components/Text/meta.json +2 -2
  104. package/es/lowcode/view/lc-components/Tree/FunctionLive.js +1 -0
  105. package/es/lowcode/view/lc-components/Tree/meta.json +2 -2
  106. package/es/upload/Form/gridForm.js +7 -3
  107. package/lib/locales/zh-CN.js +9 -0
  108. package/lib/lowcode/constants/api-url.js +183 -100
  109. package/lib/lowcode/constants/index.js +3 -2
  110. package/lib/lowcode/engine/meta/box.props.default.json +1 -1
  111. package/lib/lowcode/engine/meta/box.props.json +1 -1
  112. package/lib/lowcode/engine/meta/button.props.json +1 -1
  113. package/lib/lowcode/engine/meta/cardlist.props.json +1 -1
  114. package/lib/lowcode/engine/meta/components-list.json +1 -1
  115. package/lib/lowcode/engine/meta/dialog.props.json +1 -1
  116. package/lib/lowcode/engine/meta/drawer.props.json +1 -1
  117. package/lib/lowcode/engine/meta/form.props.default.json +4 -5
  118. package/lib/lowcode/engine/meta/form.props.json +33 -30
  119. package/lib/lowcode/engine/meta/image.props.json +2 -2
  120. package/lib/lowcode/engine/meta/imex.props.json +1 -1
  121. package/lib/lowcode/engine/meta/link.props.json +1 -1
  122. package/lib/lowcode/engine/meta/section.props.default.json +4 -6
  123. package/lib/lowcode/engine/meta/section.props.json +52 -49
  124. package/lib/lowcode/engine/meta/text.props.json +2 -2
  125. package/lib/lowcode/engine/meta/tree.props.json +2 -2
  126. package/lib/lowcode/engine/provider/ContextProvider/index.js +10 -2
  127. package/lib/lowcode/engine/provider/RemoteSourceProvider.js +24 -11
  128. package/lib/lowcode/engine/tools/helper.js +23 -21
  129. package/lib/lowcode/engine/tools/useCanvasRender.js +3 -5
  130. package/lib/lowcode/engine/tools/usePromiseState.js +22 -14
  131. package/lib/lowcode/painter/Design.js +32 -0
  132. package/lib/lowcode/painter/DesignOperator.js +5 -7
  133. package/lib/lowcode/painter/DesignToolbar.js +256 -19
  134. package/lib/lowcode/painter/Panel.js +7 -8
  135. package/lib/lowcode/painter/components/AttrsPanel.js +6 -6
  136. package/lib/lowcode/painter/components/DragDrop/DragDropWrapper.js +5 -2
  137. package/lib/lowcode/painter/components/ListEditor.js +8 -2
  138. package/lib/lowcode/painter/components/field-setting/BatchSetting.js +13 -3
  139. package/lib/lowcode/painter/components/field-setting/SettingUI.js +26 -7
  140. package/lib/lowcode/painter/components/field-setting/index.js +18 -8
  141. package/lib/lowcode/painter/index.js +1 -30
  142. package/lib/lowcode/painter/panel-section/ActionsColumnWidth.js +32 -0
  143. package/lib/lowcode/painter/panel-section/BlockEditor/index.js +7 -4
  144. package/lib/lowcode/painter/panel-section/BlocksEditor/BlockEditorItem.js +4 -3
  145. package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +47 -13
  146. package/lib/lowcode/painter/panel-section/FieldsSetting.js +46 -25
  147. package/lib/lowcode/painter/panel-section/I18nInput.js +27 -0
  148. package/lib/lowcode/painter/style/design.less +6 -2
  149. package/lib/lowcode/painter/style/list-editor.less +36 -0
  150. package/lib/lowcode/preview/index.js +18 -4
  151. package/lib/lowcode/view/lc-components/Box/FunctionLive.js +2 -1
  152. package/lib/lowcode/view/lc-components/Box/FunctionPreview.js +2 -1
  153. package/lib/lowcode/view/lc-components/Box/meta.json +1 -1
  154. package/lib/lowcode/view/lc-components/Button/meta.json +1 -1
  155. package/lib/lowcode/view/lc-components/CardList/FunctionDesign.js +2 -1
  156. package/lib/lowcode/view/lc-components/CardList/FunctionLive.js +2 -1
  157. package/lib/lowcode/view/lc-components/CardList/FunctionPreview.js +2 -1
  158. package/lib/lowcode/view/lc-components/CardList/meta.json +1 -1
  159. package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +2 -4
  160. package/lib/lowcode/view/lc-components/Dialog/FunctionLive.js +2 -1
  161. package/lib/lowcode/view/lc-components/Dialog/FunctionPreview.js +2 -1
  162. package/lib/lowcode/view/lc-components/Dialog/meta.json +1 -1
  163. package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +2 -1
  164. package/lib/lowcode/view/lc-components/Drawer/FunctionLive.js +2 -1
  165. package/lib/lowcode/view/lc-components/Drawer/FunctionPreview.js +2 -1
  166. package/lib/lowcode/view/lc-components/Drawer/meta.json +1 -1
  167. package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +64 -2
  168. package/lib/lowcode/view/lc-components/Form/FunctionLive.js +2 -1
  169. package/lib/lowcode/view/lc-components/Form/FunctionPreview.js +2 -1
  170. package/lib/lowcode/view/lc-components/Form/index.js +230 -59
  171. package/lib/lowcode/view/lc-components/Form/meta.json +33 -30
  172. package/lib/lowcode/view/lc-components/Iframe/FunctionDesign.js +2 -1
  173. package/lib/lowcode/view/lc-components/Iframe/FunctionLive.js +2 -1
  174. package/lib/lowcode/view/lc-components/Iframe/FunctionPreview.js +2 -1
  175. package/lib/lowcode/view/lc-components/ImEx/FunctionDesign.js +2 -1
  176. package/lib/lowcode/view/lc-components/ImEx/FunctionLive.js +2 -1
  177. package/lib/lowcode/view/lc-components/ImEx/FunctionPreview.js +2 -1
  178. package/lib/lowcode/view/lc-components/ImEx/meta.json +1 -1
  179. package/lib/lowcode/view/lc-components/Image/FunctionDesign.js +2 -1
  180. package/lib/lowcode/view/lc-components/Image/FunctionLive.js +2 -1
  181. package/lib/lowcode/view/lc-components/Image/FunctionPreview.js +2 -1
  182. package/lib/lowcode/view/lc-components/Image/meta.json +2 -2
  183. package/lib/lowcode/view/lc-components/JSX/FunctionDesign.js +2 -1
  184. package/lib/lowcode/view/lc-components/JSX/FunctionLive.js +2 -1
  185. package/lib/lowcode/view/lc-components/JSX/FunctionPreview.js +2 -1
  186. package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +5 -6
  187. package/lib/lowcode/view/lc-components/Layout/FunctionPreview.js +2 -1
  188. package/lib/lowcode/view/lc-components/Link/FunctionDesign.js +2 -1
  189. package/lib/lowcode/view/lc-components/Link/FunctionLive.js +2 -1
  190. package/lib/lowcode/view/lc-components/Link/FunctionPreview.js +2 -1
  191. package/lib/lowcode/view/lc-components/Link/meta.json +1 -1
  192. package/lib/lowcode/view/lc-components/Section/FunctionDesign.js +31 -2
  193. package/lib/lowcode/view/lc-components/Section/FunctionLive.js +2 -1
  194. package/lib/lowcode/view/lc-components/Section/FunctionPreview.js +2 -1
  195. package/lib/lowcode/view/lc-components/Section/index.js +113 -23
  196. package/lib/lowcode/view/lc-components/Section/index.less +7 -0
  197. package/lib/lowcode/view/lc-components/Section/meta.json +48 -49
  198. package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +5 -7
  199. package/lib/lowcode/view/lc-components/Split/FunctionLive.js +2 -1
  200. package/lib/lowcode/view/lc-components/Split/FunctionPreview.js +2 -1
  201. package/lib/lowcode/view/lc-components/Split/index.js +4 -4
  202. package/lib/lowcode/view/lc-components/Table/FunctionLive.js +2 -1
  203. package/lib/lowcode/view/lc-components/Table/FunctionPreview.js +2 -1
  204. package/lib/lowcode/view/lc-components/Table/index.js +7 -6
  205. package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +4 -6
  206. package/lib/lowcode/view/lc-components/Text/FunctionDesign.js +2 -1
  207. package/lib/lowcode/view/lc-components/Text/FunctionLive.js +2 -1
  208. package/lib/lowcode/view/lc-components/Text/FunctionPreview.js +2 -1
  209. package/lib/lowcode/view/lc-components/Text/meta.json +2 -2
  210. package/lib/lowcode/view/lc-components/Tree/FunctionLive.js +2 -1
  211. package/lib/lowcode/view/lc-components/Tree/meta.json +2 -2
  212. package/lib/upload/Form/gridForm.js +7 -3
  213. package/package.json +1 -1
  214. package/es/lowcode/painter/services/toolbar.js +0 -25
  215. package/lib/lowcode/painter/services/toolbar.js +0 -32
@@ -7,6 +7,7 @@
7
7
  width: 100%;
8
8
  .list-item {
9
9
  height: 28px;
10
+ position: relative;
10
11
  background: #fff;
11
12
  border: 1px solid #e5e6e8;
12
13
  border-radius: 6px;
@@ -37,6 +38,41 @@
37
38
  cursor: pointer;
38
39
  }
39
40
  }
41
+
42
+ .list-item-bottom-line {
43
+ width: 100%;
44
+ height: 8px;
45
+ border-bottom: solid 1px var(--ant-primary-color);
46
+ position: absolute;
47
+ left: 0;
48
+ bottom: -6px;
49
+ padding-top: 4px;
50
+ display: none;
51
+ align-items: center;
52
+ justify-content: center;
53
+ cursor: pointer;
54
+ z-index: 10;
55
+ }
56
+ .list-item-bottom-line::after {
57
+ content: "+";
58
+ height: 12px;
59
+ margin-top: 4px;
60
+ color: var(--ant-primary-color);
61
+ border: solid 1px var(--ant-primary-color);
62
+ border-radius: 10px;
63
+ font-weight: bold;
64
+ font-size: 14px;
65
+ background-color: white;
66
+ padding: 0 8px;
67
+ display: flex;
68
+ align-items: center;
69
+ justify-content: center;
70
+ }
71
+ &:hover {
72
+ .list-item-bottom-line {
73
+ display: flex;
74
+ }
75
+ }
40
76
  }
41
77
  }
42
78
 
@@ -1,14 +1,27 @@
1
- import React from "react";
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import React, { useState } from 'react';
3
+ import { useUpdateEffect } from 'ahooks';
2
4
  import EventBusProvider from "../engine/provider/EventBusProvider";
3
5
  import ContextProvider from "../engine/provider/ContextProvider";
4
6
  import Page from "../view/Page";
5
7
  import { RUNTIME } from "../constants/index";
6
8
  var Preview = function Preview(_ref) {
7
- var code = _ref.code;
8
- return /*#__PURE__*/React.createElement(EventBusProvider, {
9
+ var code = _ref.code,
10
+ userId = _ref.userId;
11
+ var _useState = useState(userId),
12
+ _useState2 = _slicedToArray(_useState, 2),
13
+ currentKey = _useState2[0],
14
+ setCurrentKey = _useState2[1];
15
+ useUpdateEffect(function () {
16
+ setCurrentKey(void 0);
17
+ setTimeout(function () {
18
+ setCurrentKey(userId);
19
+ });
20
+ }, [userId]);
21
+ return code && currentKey ? /*#__PURE__*/React.createElement(EventBusProvider, {
9
22
  runtime: RUNTIME.PREVIEW
10
23
  }, /*#__PURE__*/React.createElement(ContextProvider, {
11
24
  code: code
12
- }, /*#__PURE__*/React.createElement(Page, null)));
25
+ }, /*#__PURE__*/React.createElement(Page, null))) : null;
13
26
  };
14
27
  export default Preview;
@@ -1,5 +1,6 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  var _excluded = ["children"];
3
+ import React from 'react';
3
4
  import Index from "./index";
4
5
  var FunctionLive = function FunctionLive(_ref) {
5
6
  var children = _ref.children,
@@ -1,5 +1,6 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  var _excluded = ["children"];
3
+ import React from 'react';
3
4
  import Index from "./index";
4
5
  var FunctionPreview = function FunctionPreview(_ref) {
5
6
  var children = _ref.children,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "component": "Box",
3
- "name": "容器",
3
+ "name": "盒子",
4
4
  "desc": "盒子是一个用于包裹其他组件的包装器,是一个单纯的容器组件,可以对其设置样式达到想要的效果。",
5
5
  "icon": "icon-box",
6
6
  "group": "container",
@@ -16,7 +16,7 @@
16
16
  {
17
17
  "key": "title",
18
18
  "name": "标题",
19
- "type": "string",
19
+ "type": "_I18nInput",
20
20
  "repositioning": true,
21
21
  "default": "按钮"
22
22
  },
@@ -1,5 +1,6 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  var _excluded = ["children"];
3
+ import React from 'react';
3
4
  import Index from "./index";
4
5
  var FunctionDesign = function FunctionDesign(_ref) {
5
6
  var children = _ref.children,
@@ -1,5 +1,6 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  var _excluded = ["children"];
3
+ import React from 'react';
3
4
  import Index from "./index";
4
5
  var FunctionLive = function FunctionLive(_ref) {
5
6
  var children = _ref.children,
@@ -1,5 +1,6 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  var _excluded = ["children"];
3
+ import React from 'react';
3
4
  import Index from "./index";
4
5
  var FunctionPreview = function FunctionPreview(_ref) {
5
6
  var children = _ref.children,
@@ -57,7 +57,7 @@
57
57
  "key": "actionTitle",
58
58
  "name": "操作列标题",
59
59
  "desc": "操作列的标题",
60
- "type": "string",
60
+ "type": "_I18nInput",
61
61
  "default": "操作列"
62
62
  },
63
63
  {
@@ -6,7 +6,6 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
6
6
  var _excluded = ["id", "children", "className"];
7
7
  import React from 'react';
8
8
  import { useCreation } from 'ahooks';
9
- import { cloneDeep } from 'lodash';
10
9
  import Index from "./index";
11
10
  import { suid } from '@luck-design-biz/base/utils';
12
11
  import { useContext, usePageData } from "../../../engine/provider/ContextProvider";
@@ -29,11 +28,10 @@ var FunctionDesign = function FunctionDesign(_ref) {
29
28
  var compId = _ref2.id,
30
29
  pageData = _ref2.pageData;
31
30
  if (compId !== id) return;
32
- var cloneData = cloneDeep(pageData);
33
- add(cloneData, id, "box_".concat(suid()), _objectSpread(_objectSpread({}, boxDefaultMeta), {}, {
31
+ add(pageData, id, "box_".concat(suid()), _objectSpread(_objectSpread({}, boxDefaultMeta), {}, {
34
32
  buildIn: true
35
33
  }));
36
- setPageData(cloneData);
34
+ setPageData(pageData);
37
35
  }).watch();
38
36
  }, []);
39
37
  return /*#__PURE__*/React.createElement(Index, _extends({
@@ -1,5 +1,6 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  var _excluded = ["children"];
3
+ import React from 'react';
3
4
  import Index from "./index";
4
5
  var FunctionLive = function FunctionLive(_ref) {
5
6
  var children = _ref.children,
@@ -1,5 +1,6 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  var _excluded = ["children"];
3
+ import React from 'react';
3
4
  import Index from "./index";
4
5
  var FunctionPreview = function FunctionPreview(_ref) {
5
6
  var children = _ref.children,
@@ -17,7 +17,7 @@
17
17
  "key": "title",
18
18
  "name": "标题",
19
19
  "desc": "对话框左上角的标题",
20
- "type": "string",
20
+ "type": "_I18nInput",
21
21
  "default": "对话框"
22
22
  },
23
23
  {
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
4
  var _excluded = ["children", "className", "show"];
5
+ import React from 'react';
5
6
  import Index from "./index";
6
7
  import classNames from 'classnames';
7
8
  import styles from "./index.less";
@@ -1,5 +1,6 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  var _excluded = ["children"];
3
+ import React from 'react';
3
4
  import Index from "./index";
4
5
  var FunctionLive = function FunctionLive(_ref) {
5
6
  var children = _ref.children,
@@ -1,5 +1,6 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  var _excluded = ["children"];
3
+ import React from 'react';
3
4
  import Index from "./index";
4
5
  var FunctionPreview = function FunctionPreview(_ref) {
5
6
  var children = _ref.children,
@@ -17,7 +17,7 @@
17
17
  "key": "title",
18
18
  "name": "标题",
19
19
  "desc": "抽屉左上角的标题",
20
- "type": "string",
20
+ "type": "_I18nInput",
21
21
  "default": "抽屉"
22
22
  },
23
23
  {
@@ -1,10 +1,16 @@
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";
4
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
5
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
6
  var _excluded = ["children", "blocks", "id"];
5
- import React, { useRef, useState } from 'react';
7
+ import React, { useRef, useEffect } from 'react';
6
8
  import { usePrevious, useUpdateLayoutEffect } from 'ahooks';
7
- import { isEqual, differenceWith, cloneDeep } from 'lodash';
9
+ import { isEqual, differenceWith, cloneDeep, differenceBy } from 'lodash';
10
+ import { suid } from '@luck-design-biz/base/utils';
11
+ import { useContext, usePageData } from "../../../engine/provider/ContextProvider";
12
+ import { add, findNodeAndParent } from "../../../engine/tools/dataProcess";
13
+ import boxDefaultMeta from "../../../engine/meta/box.props.default.json";
8
14
  import Index from "./index";
9
15
  var FunctionDesign = function FunctionDesign(_ref) {
10
16
  var children = _ref.children,
@@ -12,19 +18,75 @@ var FunctionDesign = function FunctionDesign(_ref) {
12
18
  id = _ref.id,
13
19
  props = _objectWithoutProperties(_ref, _excluded);
14
20
  var ref = useRef(null);
21
+ var ctx = useContext();
22
+ var _usePageData = usePageData(),
23
+ _usePageData2 = _slicedToArray(_usePageData, 2),
24
+ setPageData = _usePageData2[1].setPageData;
15
25
  var previousBlocks = usePrevious(cloneDeep(blocks), function (prev, next) {
16
26
  return !isEqual(prev, next);
17
27
  });
18
28
  useUpdateLayoutEffect(function () {
19
- var difference = differenceWith(blocks, previousBlocks, function (arrVal, othVal) {
29
+ var diffDataset = differenceWith(blocks, previousBlocks, function (arrVal, othVal) {
20
30
  var _arrVal$dataset, _othVal$dataset;
21
31
  return arrVal.id === othVal.id && ((_arrVal$dataset = arrVal.dataset) === null || _arrVal$dataset === void 0 ? void 0 : _arrVal$dataset.code) === ((_othVal$dataset = othVal.dataset) === null || _othVal$dataset === void 0 ? void 0 : _othVal$dataset.code);
22
32
  });
23
- difference.forEach(function (df) {
33
+ diffDataset.forEach(function (df) {
24
34
  var _df$dataset;
25
35
  ((_df$dataset = df.dataset) === null || _df$dataset === void 0 ? void 0 : _df$dataset.code) && ref.current.doQueryOne(df.id);
26
36
  });
37
+ var diffColReset = differenceWith(blocks, previousBlocks, function (arrVal, othVal) {
38
+ return arrVal.id === othVal.id && arrVal.actionsColumnReset === othVal.actionsColumnReset;
39
+ });
40
+ diffColReset.forEach(function (df) {
41
+ var _ctx$componentMap$get2;
42
+ var _ctx$componentMap$get = (_ctx$componentMap$get2 = ctx.componentMap.get(id)) === null || _ctx$componentMap$get2 === void 0 ? void 0 : _ctx$componentMap$get2.api.getForm().getFormRef(df.id).formRef.current,
43
+ gridApi = _ctx$componentMap$get.gridApi;
44
+ gridApi.api.refreshCells({
45
+ columns: ['luck-actions'],
46
+ force: true
47
+ });
48
+ });
27
49
  }, [JSON.stringify(blocks)]);
50
+ useEffect(function () {
51
+ var cmid = ctx.$subscriber(ctx.topics.COMPONENT_MODIFY).on(function (_ref2) {
52
+ var compId = _ref2.id,
53
+ pageData = _ref2.pageData,
54
+ newValue = _ref2.newValue,
55
+ oldValue = _ref2.oldValue;
56
+ if (compId !== id || !newValue.hasOwnProperty('blocks')) return;
57
+ if (newValue.blocks.length > oldValue.blocks.length) {
58
+ var _differenceBy = differenceBy(newValue.blocks, oldValue.blocks, 'id'),
59
+ _differenceBy2 = _slicedToArray(_differenceBy, 1),
60
+ newItem = _differenceBy2[0];
61
+ if (newItem.type === 'blank') {
62
+ var boxId = "box_".concat(suid());
63
+ add(pageData, id, boxId, _objectSpread(_objectSpread({}, boxDefaultMeta), {}, {
64
+ buildIn: true,
65
+ formBoxId: newItem.id
66
+ }));
67
+ setPageData(pageData);
68
+ }
69
+ } else if (newValue.blocks.length < oldValue.blocks.length) {
70
+ var _differenceBy3 = differenceBy(oldValue.blocks, newValue.blocks, 'id'),
71
+ _differenceBy4 = _slicedToArray(_differenceBy3, 1),
72
+ removeItem = _differenceBy4[0];
73
+ if (removeItem.type === 'blank') {
74
+ var _findNodeAndParent = findNodeAndParent(id, pageData),
75
+ current = _findNodeAndParent.node;
76
+ var _boxId = current.children.find(function (childId) {
77
+ return current[childId].props.tabId === removeItem.id;
78
+ });
79
+ ctx.$publisher(ctx.topics.COMPONENT_DELETE, {
80
+ id: _boxId,
81
+ pageData: pageData
82
+ });
83
+ }
84
+ }
85
+ }).watch();
86
+ return function () {
87
+ return ctx.$unsubscriber(ctx.topics.COMPONENT_MODIFY, cmid);
88
+ };
89
+ }, []);
28
90
  return /*#__PURE__*/React.createElement(Index, _extends({}, props, {
29
91
  id: id,
30
92
  blocks: blocks,
@@ -1,5 +1,6 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  var _excluded = ["children"];
3
+ import React from 'react';
3
4
  import Index from "./index";
4
5
  var FunctionLive = function FunctionLive(_ref) {
5
6
  var children = _ref.children,
@@ -1,5 +1,6 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  var _excluded = ["children"];
3
+ import React from 'react';
3
4
  import Index from "./index";
4
5
  var FunctionPreview = function FunctionPreview(_ref) {
5
6
  var children = _ref.children,