@luck-design-biz/luckda 1.0.1 → 1.0.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 (227) hide show
  1. package/es/components/LDActions/index.less +3 -1
  2. package/es/components/LdAutoForm/index.js +2 -1
  3. package/es/components/LdCard/index.js +154 -67
  4. package/es/components/LdFormList/index.js +20 -6
  5. package/es/components/LdGridForm/index.js +40 -24
  6. package/es/components/LdTree/index.js +14 -8
  7. package/es/components/LdTree/index.less +4 -2
  8. package/es/helper/ldBuilder.js +1 -1
  9. package/es/locales/zh-CN.js +13 -4
  10. package/es/lowcode/constants/index.js +1 -1
  11. package/es/lowcode/engine/meta/cardlist.props.default.json +27 -6
  12. package/es/lowcode/engine/meta/cardlist.props.json +254 -72
  13. package/es/lowcode/engine/meta/components-list.json +6 -102
  14. package/es/lowcode/engine/meta/dialog.props.default.json +4 -2
  15. package/es/lowcode/engine/meta/dialog.props.json +74 -18
  16. package/es/lowcode/engine/meta/drawer.props.default.json +15 -4
  17. package/es/lowcode/engine/meta/drawer.props.json +144 -24
  18. package/es/lowcode/engine/meta/form.props.default.json +14 -3
  19. package/es/lowcode/engine/meta/form.props.json +49 -9
  20. package/es/lowcode/engine/meta/grouptree.props.default.json +16 -0
  21. package/es/lowcode/engine/meta/grouptree.props.json +83 -0
  22. package/es/lowcode/engine/meta/iframe.props.default.json +1 -1
  23. package/es/lowcode/engine/meta/iframe.props.json +3 -4
  24. package/es/lowcode/engine/meta/image.props.default.json +3 -2
  25. package/es/lowcode/engine/meta/image.props.json +51 -16
  26. package/es/lowcode/engine/meta/imex.props.json +1 -1
  27. package/es/lowcode/engine/meta/js-editor/auto-complete.json +23 -5
  28. package/es/lowcode/engine/meta/link.props.default.json +1 -1
  29. package/es/lowcode/engine/meta/link.props.json +9 -9
  30. package/es/lowcode/engine/meta/table.props.json +1 -1
  31. package/es/lowcode/engine/meta/tabs.props.default.json +1 -1
  32. package/es/lowcode/engine/meta/tabs.props.json +1 -1
  33. package/es/lowcode/engine/meta/tree.props.json +2 -2
  34. package/es/lowcode/engine/provider/ContextProvider/index.js +6 -2
  35. package/es/lowcode/engine/provider/ContextProvider/usePageDataStore.js +82 -2
  36. package/es/lowcode/engine/tools/helper.js +21 -0
  37. package/es/lowcode/engine/tools/useCanvasRender.js +13 -1
  38. package/es/lowcode/painter/Components.js +6 -1
  39. package/es/lowcode/painter/Design.js +1 -0
  40. package/es/lowcode/painter/DesignOperator.js +25 -15
  41. package/es/lowcode/painter/DesignToolbar.js +78 -47
  42. package/es/lowcode/painter/Ribbon.js +14 -1
  43. package/es/lowcode/painter/components/ActionBindModal.js +3 -7
  44. package/es/lowcode/painter/components/DragDrop/DragDropContext.js +144 -37
  45. package/es/lowcode/painter/components/DragDrop/DragDropWrapper.js +29 -6
  46. package/es/lowcode/painter/components/DragDrop/Overlay.js +5 -2
  47. package/es/lowcode/painter/components/DragDrop/TreeDragDropWrapper.js +7 -4
  48. package/es/lowcode/painter/components/NumberInput.js +1 -1
  49. package/es/lowcode/painter/components/code-editor/BaseEditor.js +2 -1
  50. package/es/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
  51. package/es/lowcode/painter/components/field-setting/SettingUI.js +30 -2
  52. package/es/lowcode/painter/components/field-setting/index.js +26 -12
  53. package/es/lowcode/painter/expect.js +27 -0
  54. package/es/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +20 -2
  55. package/es/lowcode/painter/panel-section/ActionsEditor/index.js +18 -3
  56. package/es/lowcode/painter/panel-section/ComplexPop.js +1 -1
  57. package/es/lowcode/painter/panel-section/DataSetSelector.js +14 -3
  58. package/es/lowcode/painter/panel-section/FieldsSetting.js +2 -2
  59. package/es/lowcode/painter/panel-section/GroupClassSelector.js +55 -0
  60. package/es/lowcode/painter/panel-section/PageVars.js +1 -1
  61. package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +1 -0
  62. package/es/lowcode/painter/panel-section/TabItems.js +1 -1
  63. package/es/lowcode/painter/panel-section/TableTopFilter.js +3 -3
  64. package/es/lowcode/painter/style/action-bind-modal.less +5 -3
  65. package/es/lowcode/painter/style/design.less +26 -7
  66. package/es/lowcode/painter/style/dragdrop.less +46 -0
  67. package/es/lowcode/painter/style/list-editor.less +5 -3
  68. package/es/lowcode/painter/style/number-input.less +3 -1
  69. package/es/lowcode/painter/style/outline.less +3 -1
  70. package/es/lowcode/painter/style/panel-attrs.less +7 -3
  71. package/es/lowcode/painter/style/panel.less +9 -7
  72. package/es/lowcode/painter/style/radio.less +1 -1
  73. package/es/lowcode/painter/style/ribbon.less +4 -2
  74. package/es/lowcode/painter/svg/code.svg +3 -0
  75. package/es/lowcode/painter/svg/expect.svg +9 -0
  76. package/es/lowcode/view/lc-components/CardList/index.js +481 -12
  77. package/es/lowcode/view/lc-components/CardList/meta.json +255 -73
  78. package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +14 -6
  79. package/es/lowcode/view/lc-components/Dialog/index.js +15 -5
  80. package/es/lowcode/view/lc-components/Dialog/index.less +4 -0
  81. package/es/lowcode/view/lc-components/Dialog/meta.json +72 -18
  82. package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +51 -8
  83. package/es/lowcode/view/lc-components/Drawer/index.js +139 -24
  84. package/es/lowcode/view/lc-components/Drawer/index.less +11 -8
  85. package/es/lowcode/view/lc-components/Drawer/meta.json +136 -25
  86. package/es/lowcode/view/lc-components/Form/FunctionDesign.js +2 -1
  87. package/es/lowcode/view/lc-components/Form/index.js +45 -28
  88. package/es/lowcode/view/lc-components/Form/meta.json +44 -8
  89. package/es/lowcode/view/lc-components/GroupTree/FunctionDesign.js +10 -0
  90. package/es/lowcode/view/lc-components/GroupTree/FunctionLive.js +10 -0
  91. package/es/lowcode/view/lc-components/GroupTree/FunctionPreview.js +10 -0
  92. package/es/lowcode/view/lc-components/GroupTree/index.js +212 -0
  93. package/es/lowcode/view/lc-components/GroupTree/index.less +12 -0
  94. package/es/lowcode/view/lc-components/GroupTree/meta.json +83 -0
  95. package/es/lowcode/view/lc-components/Iframe/index.js +57 -7
  96. package/es/lowcode/view/lc-components/Iframe/meta.json +3 -4
  97. package/es/lowcode/view/lc-components/ImEx/meta.json +1 -1
  98. package/es/lowcode/view/lc-components/Image/index.js +82 -6
  99. package/es/lowcode/view/lc-components/Image/index.less +27 -0
  100. package/es/lowcode/view/lc-components/Image/meta.json +51 -16
  101. package/es/lowcode/view/lc-components/Link/index.js +53 -5
  102. package/es/lowcode/view/lc-components/Link/index.less +15 -0
  103. package/es/lowcode/view/lc-components/Link/meta.json +9 -9
  104. package/es/lowcode/view/lc-components/Table/index.js +5 -6
  105. package/es/lowcode/view/lc-components/Table/meta.json +1 -1
  106. package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +40 -4
  107. package/es/lowcode/view/lc-components/Tabs/index.js +1 -1
  108. package/es/lowcode/view/lc-components/Tabs/meta.json +1 -1
  109. package/es/lowcode/view/lc-components/Tree/index.js +21 -19
  110. package/es/lowcode/view/lc-components/Tree/meta.json +2 -2
  111. package/es/utils/grid.js +3 -3
  112. package/lib/components/LDActions/index.less +3 -1
  113. package/lib/components/LdAutoForm/index.js +2 -1
  114. package/lib/components/LdCard/index.js +153 -66
  115. package/lib/components/LdFormList/index.js +19 -5
  116. package/lib/components/LdGridForm/index.js +40 -24
  117. package/lib/components/LdTree/index.js +14 -8
  118. package/lib/components/LdTree/index.less +4 -2
  119. package/lib/helper/ldBuilder.js +2 -2
  120. package/lib/locales/zh-CN.js +13 -4
  121. package/lib/lowcode/constants/index.js +1 -1
  122. package/lib/lowcode/engine/meta/cardlist.props.default.json +27 -6
  123. package/lib/lowcode/engine/meta/cardlist.props.json +254 -72
  124. package/lib/lowcode/engine/meta/components-list.json +6 -102
  125. package/lib/lowcode/engine/meta/dialog.props.default.json +4 -2
  126. package/lib/lowcode/engine/meta/dialog.props.json +74 -18
  127. package/lib/lowcode/engine/meta/drawer.props.default.json +15 -4
  128. package/lib/lowcode/engine/meta/drawer.props.json +144 -24
  129. package/lib/lowcode/engine/meta/form.props.default.json +14 -3
  130. package/lib/lowcode/engine/meta/form.props.json +49 -9
  131. package/lib/lowcode/engine/meta/grouptree.props.default.json +16 -0
  132. package/lib/lowcode/engine/meta/grouptree.props.json +83 -0
  133. package/lib/lowcode/engine/meta/iframe.props.default.json +1 -1
  134. package/lib/lowcode/engine/meta/iframe.props.json +3 -4
  135. package/lib/lowcode/engine/meta/image.props.default.json +3 -2
  136. package/lib/lowcode/engine/meta/image.props.json +51 -16
  137. package/lib/lowcode/engine/meta/imex.props.json +1 -1
  138. package/lib/lowcode/engine/meta/js-editor/auto-complete.json +23 -5
  139. package/lib/lowcode/engine/meta/link.props.default.json +1 -1
  140. package/lib/lowcode/engine/meta/link.props.json +9 -9
  141. package/lib/lowcode/engine/meta/table.props.json +1 -1
  142. package/lib/lowcode/engine/meta/tabs.props.default.json +1 -1
  143. package/lib/lowcode/engine/meta/tabs.props.json +1 -1
  144. package/lib/lowcode/engine/meta/tree.props.json +2 -2
  145. package/lib/lowcode/engine/provider/ContextProvider/index.js +6 -2
  146. package/lib/lowcode/engine/provider/ContextProvider/usePageDataStore.js +83 -3
  147. package/lib/lowcode/engine/tools/helper.js +22 -0
  148. package/lib/lowcode/engine/tools/useCanvasRender.js +13 -1
  149. package/lib/lowcode/painter/Components.js +6 -1
  150. package/lib/lowcode/painter/Design.js +1 -0
  151. package/lib/lowcode/painter/DesignOperator.js +25 -15
  152. package/lib/lowcode/painter/DesignToolbar.js +78 -47
  153. package/lib/lowcode/painter/Ribbon.js +14 -1
  154. package/lib/lowcode/painter/components/ActionBindModal.js +3 -7
  155. package/lib/lowcode/painter/components/DragDrop/DragDropContext.js +142 -35
  156. package/lib/lowcode/painter/components/DragDrop/DragDropWrapper.js +27 -4
  157. package/lib/lowcode/painter/components/DragDrop/Overlay.js +5 -2
  158. package/lib/lowcode/painter/components/DragDrop/TreeDragDropWrapper.js +7 -4
  159. package/lib/lowcode/painter/components/NumberInput.js +1 -1
  160. package/lib/lowcode/painter/components/code-editor/BaseEditor.js +2 -1
  161. package/lib/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
  162. package/lib/lowcode/painter/components/field-setting/SettingUI.js +29 -1
  163. package/lib/lowcode/painter/components/field-setting/index.js +26 -12
  164. package/lib/lowcode/painter/expect.js +34 -0
  165. package/lib/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +19 -1
  166. package/lib/lowcode/painter/panel-section/ActionsEditor/index.js +18 -3
  167. package/lib/lowcode/painter/panel-section/ComplexPop.js +1 -1
  168. package/lib/lowcode/painter/panel-section/DataSetSelector.js +14 -3
  169. package/lib/lowcode/painter/panel-section/FieldsSetting.js +2 -2
  170. package/lib/lowcode/painter/panel-section/GroupClassSelector.js +63 -0
  171. package/lib/lowcode/painter/panel-section/PageVars.js +1 -1
  172. package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +1 -0
  173. package/lib/lowcode/painter/panel-section/TabItems.js +1 -1
  174. package/lib/lowcode/painter/panel-section/TableTopFilter.js +3 -3
  175. package/lib/lowcode/painter/style/action-bind-modal.less +5 -3
  176. package/lib/lowcode/painter/style/design.less +26 -7
  177. package/lib/lowcode/painter/style/dragdrop.less +46 -0
  178. package/lib/lowcode/painter/style/list-editor.less +5 -3
  179. package/lib/lowcode/painter/style/number-input.less +3 -1
  180. package/lib/lowcode/painter/style/outline.less +3 -1
  181. package/lib/lowcode/painter/style/panel-attrs.less +7 -3
  182. package/lib/lowcode/painter/style/panel.less +9 -7
  183. package/lib/lowcode/painter/style/radio.less +1 -1
  184. package/lib/lowcode/painter/style/ribbon.less +4 -2
  185. package/lib/lowcode/painter/svg/code.svg +3 -0
  186. package/lib/lowcode/painter/svg/expect.svg +9 -0
  187. package/lib/lowcode/view/lc-components/CardList/index.js +480 -11
  188. package/lib/lowcode/view/lc-components/CardList/meta.json +255 -73
  189. package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +13 -5
  190. package/lib/lowcode/view/lc-components/Dialog/index.js +15 -5
  191. package/lib/lowcode/view/lc-components/Dialog/index.less +4 -0
  192. package/lib/lowcode/view/lc-components/Dialog/meta.json +72 -18
  193. package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +52 -8
  194. package/lib/lowcode/view/lc-components/Drawer/index.js +138 -23
  195. package/lib/lowcode/view/lc-components/Drawer/index.less +11 -8
  196. package/lib/lowcode/view/lc-components/Drawer/meta.json +136 -25
  197. package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +2 -1
  198. package/lib/lowcode/view/lc-components/Form/index.js +44 -27
  199. package/lib/lowcode/view/lc-components/Form/meta.json +44 -8
  200. package/lib/lowcode/view/lc-components/GroupTree/FunctionDesign.js +17 -0
  201. package/lib/lowcode/view/lc-components/GroupTree/FunctionLive.js +17 -0
  202. package/lib/lowcode/view/lc-components/GroupTree/FunctionPreview.js +17 -0
  203. package/lib/lowcode/view/lc-components/GroupTree/index.js +220 -0
  204. package/lib/lowcode/view/lc-components/GroupTree/index.less +12 -0
  205. package/lib/lowcode/view/lc-components/GroupTree/meta.json +83 -0
  206. package/lib/lowcode/view/lc-components/Iframe/index.js +55 -5
  207. package/lib/lowcode/view/lc-components/Iframe/meta.json +3 -4
  208. package/lib/lowcode/view/lc-components/ImEx/meta.json +1 -1
  209. package/lib/lowcode/view/lc-components/Image/index.js +80 -4
  210. package/lib/lowcode/view/lc-components/Image/index.less +27 -0
  211. package/lib/lowcode/view/lc-components/Image/meta.json +51 -16
  212. package/lib/lowcode/view/lc-components/Link/index.js +52 -4
  213. package/lib/lowcode/view/lc-components/Link/index.less +15 -0
  214. package/lib/lowcode/view/lc-components/Link/meta.json +9 -9
  215. package/lib/lowcode/view/lc-components/Table/index.js +5 -6
  216. package/lib/lowcode/view/lc-components/Table/meta.json +1 -1
  217. package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +38 -2
  218. package/lib/lowcode/view/lc-components/Tabs/index.js +1 -1
  219. package/lib/lowcode/view/lc-components/Tabs/meta.json +1 -1
  220. package/lib/lowcode/view/lc-components/Tree/index.js +20 -18
  221. package/lib/lowcode/view/lc-components/Tree/meta.json +2 -2
  222. package/lib/utils/grid.js +2 -2
  223. package/package.json +10 -9
  224. package/es/lowcode/painter/style/treedragdrop.less +0 -19
  225. package/es/lowcode/view/lc-components/Form/index.less +0 -5
  226. package/lib/lowcode/painter/style/treedragdrop.less +0 -19
  227. package/lib/lowcode/view/lc-components/Form/index.less +0 -5
@@ -9,7 +9,7 @@
9
9
  "props": [
10
10
  {
11
11
  "key": "id",
12
- "desc": "唯一标识",
12
+ "name": "唯一标识",
13
13
  "type": "string",
14
14
  "disabled": true
15
15
  },
@@ -17,7 +17,7 @@
17
17
  "key": "src",
18
18
  "name": "图片地址",
19
19
  "desc": "图片地址",
20
- "type": "_ImageUploder"
20
+ "type": "string"
21
21
  },
22
22
  {
23
23
  "key": "width",
@@ -26,6 +26,13 @@
26
26
  "type": "number",
27
27
  "default": 350
28
28
  },
29
+ {
30
+ "key": "autoWidth",
31
+ "name": "宽度自适应",
32
+ "desc": "是否图片宽度自适应",
33
+ "type": "switch",
34
+ "default": false
35
+ },
29
36
  {
30
37
  "key": "height",
31
38
  "name": "高度",
@@ -34,10 +41,10 @@
34
41
  "default": 200
35
42
  },
36
43
  {
37
- "key": "autoWidth",
38
- "name": "宽度自适应",
39
- "desc": "是否图片宽度自适应",
40
- "type": "boolean",
44
+ "key": "autoHeight",
45
+ "name": "高度自适应",
46
+ "desc": "是否图片高度自适应",
47
+ "type": "switch",
41
48
  "default": false
42
49
  },
43
50
  {
@@ -47,16 +54,16 @@
47
54
  "type": "select",
48
55
  "options": [
49
56
  {
50
- "label": "铺满",
51
- "value": "fill"
57
+ "label": "铺满(Cover)",
58
+ "value": "cover"
52
59
  },
53
60
  {
54
- "label": "适合",
55
- "value": "fit"
61
+ "label": "适合(Contain)",
62
+ "value": "contain"
56
63
  },
57
64
  {
58
- "label": "拉伸",
59
- "value": "Stretch"
65
+ "label": "拉伸(Fill)",
66
+ "value": "fill"
60
67
  }
61
68
  ],
62
69
  "default": "fill"
@@ -65,8 +72,36 @@
65
72
  "key": "roundRadios",
66
73
  "name": "圆角",
67
74
  "desc": "图片四周圆角大小,可设置“0 1px 2px 3px",
68
- "type": "string",
69
- "default": "0"
75
+ "type": "select",
76
+ "options": [
77
+ {
78
+ "label": "大(16px)",
79
+ "value": "16px"
80
+ },
81
+ {
82
+ "label": "中(8px)",
83
+ "value": "8px"
84
+ },
85
+ {
86
+ "label": "小(4px)",
87
+ "value": "4px"
88
+ },
89
+ {
90
+ "label": "无(0px)",
91
+ "value": "0px"
92
+ },
93
+ {
94
+ "label": "自定义",
95
+ "value": ""
96
+ }
97
+ ],
98
+ "default": ""
99
+ },
100
+ {
101
+ "key": "borderRadios",
102
+ "name": "圆角大小",
103
+ "desc": "自定义圆角大小",
104
+ "type": "string"
70
105
  },
71
106
  {
72
107
  "key": "title",
@@ -84,7 +119,7 @@
84
119
  "key": "preview",
85
120
  "name": "开启图片预览",
86
121
  "desc": "是否开启点击打开图片预览",
87
- "type": "boolean",
122
+ "type": "switch",
88
123
  "default": false
89
124
  }
90
125
  ],
@@ -106,7 +141,7 @@
106
141
  {
107
142
  "key": "onClick",
108
143
  "name": "点击事件",
109
- "desc": "点击文本时,执行方法",
144
+ "desc": "点击图片时,执行方法",
110
145
  "func": "(e)=>{\n\t\n}"
111
146
  }
112
147
  ]
@@ -1,14 +1,53 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
1
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
- var _excluded = ["id"];
3
- import React, { useRef } from 'react';
3
+ var _excluded = ["id", "css", "onClick", "advance"];
4
+ import React, { useEffect, useRef } from 'react';
4
5
  import { useMemoizedFn } from 'ahooks';
5
6
  import { omitBadProps } from "../../../engine/tools/helper";
6
7
  import defaultMeta from "../../../engine/meta/link.props.default.json";
7
8
  import Wrapper from "../Wrapper";
9
+ import styled from 'styled-components';
10
+ import { useContext } from "../../../engine/provider/ContextProvider";
11
+ import { RUNTIME } from "../../../constants";
12
+ var StyledLink = styled.a.withConfig({
13
+ displayName: "StyledLink",
14
+ componentId: "luckda-6530__sc-13gzda1-0"
15
+ })(["display:", ";max-width:", ";white-space:", ";overflow:", ";text-overflow:", ";", ";"], function (props) {
16
+ return props.textOverflow && 'inline-block';
17
+ }, function (props) {
18
+ return props.textOverflow && '100%';
19
+ }, function (props) {
20
+ return props.textOverflow && 'nowrap';
21
+ }, function (props) {
22
+ return props.textOverflow && 'hidden';
23
+ }, function (props) {
24
+ return props.textOverflow && 'ellipsis';
25
+ }, function (props) {
26
+ return props.$css;
27
+ });
8
28
  var LCLink = function LCLink(_ref) {
9
29
  var id = _ref.id,
30
+ css = _ref.css,
31
+ onClick = _ref.onClick,
32
+ advance = _ref.advance,
10
33
  props = _objectWithoutProperties(_ref, _excluded);
11
34
  var ref = useRef();
35
+ var ctx = useContext();
36
+ useEffect(function () {
37
+ ctx.doAction(advance.events.onMount);
38
+ return function () {
39
+ return ctx.doAction(advance.events.onUnmount);
40
+ };
41
+ }, []);
42
+ var handleClick = useMemoizedFn(function (e) {
43
+ if (onClick) {
44
+ onClick(e);
45
+ return;
46
+ }
47
+ ctx.doAction(advance.events.onClick, {
48
+ e: e
49
+ });
50
+ });
12
51
  var getTargetDom = useMemoizedFn(function () {
13
52
  return ref.current;
14
53
  });
@@ -16,9 +55,18 @@ var LCLink = function LCLink(_ref) {
16
55
  id: id,
17
56
  displayName: "Link",
18
57
  getTargetDom: getTargetDom
19
- }, /*#__PURE__*/React.createElement("div", {
20
- ref: ref
21
- }, "LCLink"));
58
+ }, /*#__PURE__*/React.createElement(StyledLink, _extends({
59
+ $css: css
60
+ }, props, {
61
+ ref: ref,
62
+ href: "".concat(props.url, "?").concat(props.params),
63
+ target: props.isBlank ? '_blank' : '_self',
64
+ title: props.textOverflow && props.content,
65
+ onClick: function onClick(e) {
66
+ handleClick(e);
67
+ ctx.runtime === RUNTIME.DESIGN && e.preventDefault();
68
+ }
69
+ }), props.content));
22
70
  };
23
71
  LCLink.defaultProps = omitBadProps(defaultMeta);
24
72
  export default LCLink;
@@ -0,0 +1,15 @@
1
+ .alink {
2
+ display: inline-block;
3
+ max-width: 100%;
4
+ white-space: nowrap;
5
+ overflow: hidden;
6
+ text-overflow: ellipsis;
7
+
8
+ a {
9
+ display: inline-block;
10
+ max-width: 100%;
11
+ white-space: nowrap;
12
+ overflow: hidden;
13
+ text-overflow: ellipsis;
14
+ }
15
+ }
@@ -9,7 +9,7 @@
9
9
  "props": [
10
10
  {
11
11
  "key": "id",
12
- "desc": "唯一标识",
12
+ "name": "唯一标识",
13
13
  "type": "string",
14
14
  "disabled": true
15
15
  },
@@ -22,8 +22,8 @@
22
22
  {
23
23
  "key": "textOverflow",
24
24
  "name": "单行截断",
25
- "desc": "文字超过一行,使甲...显示;开后此项后,同时会显示html标签的title",
26
- "type": "boolean",
25
+ "desc": "文字超过一行,使用...显示;开后此项后,同时会显示html标签的title",
26
+ "type": "switch",
27
27
  "default": false
28
28
  },
29
29
  {
@@ -50,16 +50,16 @@
50
50
  "type": "string"
51
51
  },
52
52
  {
53
- "key": "isLayer",
54
- "name": "弹窗打开",
55
- "desc": "是否以弹窗形式打开",
56
- "type": "boolean",
57
- "default": false
53
+ "key": "isBlank",
54
+ "name": "新开页面",
55
+ "desc": "是否新开页面",
56
+ "type": "switch",
57
+ "default": true
58
58
  },
59
59
  {
60
60
  "key": "params",
61
61
  "name": "携带参数",
62
- "desc": "超链的携带参数",
62
+ "desc": "超链的携带参数,key=value形式,多个参数中间用&拼接,例如:pageNo=1&pageSize=20",
63
63
  "type": "string"
64
64
  },
65
65
  {
@@ -338,12 +338,13 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
338
338
  resource: action.serial
339
339
  };
340
340
  }),
341
- onBatchOperationsClick: function onBatchOperationsClick(key, selectedRows) {
341
+ onBatchOperationsClick: function onBatchOperationsClick(key, selectedRows, cb) {
342
342
  var todoListById = keyBy(bantchActions.todoList, 'id');
343
343
  var doAction = function doAction() {
344
344
  ctx.doAction(todoListById[key].actionPool, {
345
345
  key: key,
346
346
  selectedRows: selectedRows,
347
+ cb: cb,
347
348
  datasetCode: dataset.code
348
349
  });
349
350
  };
@@ -447,12 +448,12 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
447
448
  }
448
449
  return resultComp;
449
450
  }, [topActionGroup, impexp]);
450
- var renderFilterArea = useMemoizedFn(function () {
451
+ var renderFilterArea = useCallback(function () {
451
452
  return topFilter ? /*#__PURE__*/React.createElement(TopFilter, {
452
453
  filter: topFilter,
453
454
  instance: instanceRef
454
455
  }) : null;
455
- });
456
+ }, [topFilter]);
456
457
  var _wrapperProps = useCreation(function () {
457
458
  return _defineProperty({
458
459
  id: id
@@ -463,9 +464,7 @@ var LCTable = /*#__PURE__*/forwardRef(function (_ref, ref) {
463
464
  var condition = _zebra !== null && _zebra !== void 0 && _zebra.condition ? executeCode(ctx, _zebra.condition, ['params'], params) : _zebra && params.node.rowIndex % 2 === 0;
464
465
  return condition ? {
465
466
  'background-color': _zebra.color || _zebra
466
- } : {
467
- 'background-color': '#fff'
468
- };
467
+ } : {};
469
468
  });
470
469
  var _readFilter = useMemoizedFn(function (params, filters) {
471
470
  ctx.doAction(advance.events.onFilterChanged, {
@@ -168,7 +168,7 @@
168
168
  "default": {
169
169
  "todoList": []
170
170
  },
171
- "defaultCode": "function onBatchOperationsClick(key, selectedRows) {\n\n}",
171
+ "defaultCode": "function onBatchOperationsClick(key, selectedRows, cb) {\n\n}",
172
172
  "suppressDisplay": true,
173
173
  "suppressMax": true,
174
174
  "suppressMore": true,
@@ -6,9 +6,10 @@ var _excluded = ["children", "id", "items"];
6
6
  import React, { useEffect } from 'react';
7
7
  import Index from "./index";
8
8
  import { useCreation } from 'ahooks';
9
- import { differenceBy } from 'lodash';
9
+ import { differenceBy, cloneDeep } from 'lodash';
10
10
  import { suid } from '@luck-design-biz/base/utils';
11
- import { useContext, useGet, addNode } from "../../../engine/provider/ContextProvider";
11
+ import { useContext, useGet, addNode, modifyNode } from "../../../engine/provider/ContextProvider";
12
+ import { Action, ActionSide } from "../../../painter/components/DragDrop/DragDropContext";
12
13
  import boxDefaultMeta from "../../../engine/meta/box.props.default.json";
13
14
  var FunctionDesign = function FunctionDesign(_ref) {
14
15
  var children = _ref.children,
@@ -58,13 +59,48 @@ var FunctionDesign = function FunctionDesign(_ref) {
58
59
  });
59
60
  }
60
61
  }).watch();
62
+ var cdeid = ctx.$subscriber(ctx.topics.COMPONENT_DRAG_END).on(function (_ref4) {
63
+ var toId = _ref4.id,
64
+ fromId = _ref4.fromId,
65
+ action = _ref4.action,
66
+ actionSide = _ref4.actionSide,
67
+ vaild = _ref4.vaild;
68
+ if (!vaild || action === Action.ADD) return;
69
+ var fromTabId = current[fromId].props.tabId;
70
+ var toTabId = current[toId].props.tabId;
71
+ var fromIndex = items.findIndex(function (_ref5) {
72
+ var _tabId = _ref5.id;
73
+ return _tabId === fromTabId;
74
+ });
75
+ var _items = cloneDeep(items);
76
+ var _items$splice = _items.splice(fromIndex, 1),
77
+ _items$splice2 = _slicedToArray(_items$splice, 1),
78
+ _tab = _items$splice2[0];
79
+ var toIndex = _items.findIndex(function (_ref6) {
80
+ var _tabId = _ref6.id;
81
+ return _tabId === toTabId;
82
+ });
83
+ if (actionSide === ActionSide.LEFT) {
84
+ _items.splice(toIndex, 0, _tab);
85
+ } else if (actionSide === ActionSide.RIGHT) {
86
+ _items.splice(toIndex + 1, 0, _tab);
87
+ }
88
+ modifyNode(id, {
89
+ items: _items
90
+ });
91
+ }).watch();
61
92
  return function () {
62
- return ctx.$unsubscriber(ctx.topics.COMPONENT_MODIFY, cmid);
93
+ ctx.$unsubscriber(ctx.topics.COMPONENT_DRAG_END, cdeid);
94
+ ctx.$unsubscriber(ctx.topics.COMPONENT_MODIFY, cmid);
63
95
  };
64
96
  }, [current.children]);
65
97
  return /*#__PURE__*/React.createElement(Index, _extends({
66
98
  id: id,
67
- items: items
99
+ items: items.map(function (_item) {
100
+ return _objectSpread(_objectSpread({}, _item), {}, {
101
+ destory: false
102
+ });
103
+ })
68
104
  }, props), children);
69
105
  };
70
106
  export default FunctionDesign;
@@ -88,7 +88,7 @@ var LCTabs = function LCTabs(_ref) {
88
88
  return /*#__PURE__*/React.createElement(Tabs.TabPane, {
89
89
  tab: item.name,
90
90
  key: item.id,
91
- forceRender: item.destory
91
+ forceRender: !item.destory
92
92
  }, children === null || children === void 0 ? void 0 : children.find(function (child) {
93
93
  return child.props.tabId === item.id;
94
94
  }));
@@ -23,7 +23,7 @@
23
23
  "id": "tab_lvwdncx1",
24
24
  "name": "标签项",
25
25
  "active": true,
26
- "destory": false,
26
+ "destory": true,
27
27
  "serial": null,
28
28
  "serialEffect": "hidden"
29
29
  }
@@ -2,8 +2,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
3
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- var _excluded = ["id", "wrapperRef", "className", "dataset", "width", "height", "showLine", "defaultExpandDeep", "actions", "editable", "showRootAdd", "onlyRoot", "rootAddSetting", "doubleClickExpand", "onDoubleClick", "treeNodeCheckable", "treeNodeDisableCheckbox", "treeNodeDisable", "onTreeNodeRender", "treeNodeIcon", "advance", "cancelSelect", "defaultSelect"];
6
- import React, { useRef, useImperativeHandle, useState, useEffect } from 'react';
5
+ var _excluded = ["id", "className", "dataset", "width", "height", "showLine", "defaultExpandDeep", "actions", "editable", "showRootAdd", "onlyRoot", "rootAddSetting", "doubleClickExpand", "onDoubleClick", "treeNodeCheckable", "treeNodeDisableCheckbox", "treeNodeDisable", "onTreeNodeRender", "treeNodeIcon", "advance", "cancelSelect", "defaultSelect"];
6
+ import React, { useRef, useImperativeHandle, useState, forwardRef } from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import { useMemoizedFn, useCreation } from 'ahooks';
9
9
  import classNames from 'classnames';
@@ -13,13 +13,14 @@ import { suid } from '@luck-design-biz/base/utils';
13
13
  import { useContext } from "../../../engine/provider/ContextProvider";
14
14
  import Wrapper from "../Wrapper";
15
15
  import { LdTree } from "../../../../index";
16
+ import useCombinedRefs from "../../../engine/tools/useCombinedRefs";
16
17
  import { omitBadProps, executeCode } from "../../../engine/tools/helper";
17
18
  import defaultMeta from "../../../engine/meta/tree.props.default.json";
19
+ import { LC_COMPONENT_UNIT_KEY, LC_COMPONENT_UNIT } from "../../../constants";
18
20
  import styles from "./index.less";
19
21
  var PRIMARY = window.appConfig.constraintKeys.PRIMARY;
20
- var LCTree = function LCTree(_ref) {
22
+ var LCTree = /*#__PURE__*/forwardRef(function (_ref, ref) {
21
23
  var id = _ref.id,
22
- wrapperRef = _ref.wrapperRef,
23
24
  className = _ref.className,
24
25
  dataset = _ref.dataset,
25
26
  width = _ref.width,
@@ -43,20 +44,20 @@ var LCTree = function LCTree(_ref) {
43
44
  defaultSelect = _ref.defaultSelect,
44
45
  props = _objectWithoutProperties(_ref, _excluded);
45
46
  var ctx = useContext();
46
- var boxRef = useRef();
47
47
  var apiRef = useRef();
48
- var treeRef = useRef();
48
+ var wrapperRef = useRef();
49
+ var instanceRef = useCombinedRefs(ref);
49
50
  var _useState = useState([]),
50
51
  _useState2 = _slicedToArray(_useState, 2),
51
52
  selectedKeys = _useState2[0],
52
53
  setSelectedKeys = _useState2[1];
53
54
  var getTargetDom = useMemoizedFn(function () {
54
- return boxRef.current;
55
+ return wrapperRef.current;
55
56
  });
56
57
  useImperativeHandle(apiRef, function () {
57
58
  return {
58
59
  getInstance: function getInstance() {
59
- return treeRef.current;
60
+ return instanceRef.current;
60
61
  }
61
62
  };
62
63
  });
@@ -141,23 +142,24 @@ var LCTree = function LCTree(_ref) {
141
142
  doAction();
142
143
  }
143
144
  };
145
+ var _wrapperProps = useCreation(function () {
146
+ return _defineProperty({
147
+ id: id
148
+ }, LC_COMPONENT_UNIT_KEY, LC_COMPONENT_UNIT);
149
+ }, []);
144
150
  return /*#__PURE__*/React.createElement(Wrapper, {
145
151
  id: id,
146
152
  displayName: "Tree",
147
153
  getTargetDom: getTargetDom,
148
154
  api: apiRef
149
- }, /*#__PURE__*/React.createElement("div", {
150
- ref: boxRef,
151
- style: {
152
- width: width,
153
- height: height
154
- }
155
155
  }, /*#__PURE__*/React.createElement(LdTree, _extends({
156
- width: "100%",
157
- height: "100%",
156
+ width: width,
157
+ height: height,
158
158
  id: id,
159
159
  ldId: id,
160
- ref: treeRef,
160
+ ref: instanceRef,
161
+ wrapper: wrapperRef,
162
+ wrapperProps: _wrapperProps,
161
163
  className: classNames(styles['lc-component-tree'], _defineProperty({}, className, !!className)),
162
164
  dataSetKey: dataset === null || dataset === void 0 ? void 0 : dataset.code,
163
165
  showLine: showLine,
@@ -222,8 +224,8 @@ var LCTree = function LCTree(_ref) {
222
224
  selectedKeys: selectedKeys,
223
225
  onSelect: handleSelect,
224
226
  afterInit: afterInit
225
- }, events, props))));
226
- };
227
+ }, events, props)));
228
+ });
227
229
  LCTree.propTypes = {
228
230
  /**
229
231
  * @name 唯一标识
@@ -9,7 +9,7 @@
9
9
  "props": [
10
10
  {
11
11
  "key": "id",
12
- "desc": "唯一标识",
12
+ "name": "唯一标识",
13
13
  "type": "string",
14
14
  "disabled": true
15
15
  },
@@ -193,7 +193,7 @@
193
193
  "props": [
194
194
  {
195
195
  "key": "cancelSelect",
196
- "name": "取消选中",
196
+ "name": "允许取消选中",
197
197
  "desc": "是否可以取消选中",
198
198
  "type": "switch",
199
199
  "default": true
package/es/utils/grid.js CHANGED
@@ -6,7 +6,7 @@ var _excluded = ["comName", "property"],
6
6
  _excluded3 = ["filter", "filterParams"];
7
7
  import React from 'react';
8
8
  import { getDvaApp } from 'umi';
9
- import { merge, isNil, isArray, includes, capitalize, isString } from 'lodash';
9
+ import { merge, isNil, isArray, includes, capitalize, isString, isObject } from 'lodash';
10
10
  import { Switch, Tag } from 'luck-design/antd';
11
11
  import moment from 'moment';
12
12
  import UploadGridCell from "../upload/GridCell";
@@ -47,11 +47,11 @@ export function getColumnRender(name, type) {
47
47
  case 'complex':
48
48
  case 'dict':
49
49
  render = function render(text, record) {
50
- if (record["".concat(name, "_virtual")]) return record["".concat(name, "_virtual")];
51
50
  if (isArray(text)) return text.map(function (i) {
52
51
  return i.label;
53
52
  }).join(',');
54
- if (!isNil(text)) return text.label;
53
+ if (isObject(text)) return text.label;
54
+ if (record["".concat(name, "_virtual")]) return record["".concat(name, "_virtual")];
55
55
  };
56
56
  break;
57
57
  case 'switch':
@@ -1,3 +1,5 @@
1
+ @import '~@luck-helper/ui-design/es/style/themes/default.less';
2
+
1
3
  @spanDefault: #262626;
2
4
  @spanPrimary: var(--ant-primary-color);
3
5
  @spanDanger: #ff4d4f;
@@ -16,7 +18,7 @@
16
18
  }
17
19
 
18
20
  button.default {
19
- background-color: white;
21
+ background-color: @component-background;
20
22
  }
21
23
  span.default {
22
24
  color: @spanDefault;
@@ -80,7 +80,8 @@ var buildLdAutoForm = function buildLdAutoForm(_ref) {
80
80
  var col = columnsObj[key];
81
81
  if ((setting === null || setting === void 0 ? void 0 : setting._type) === 'divider') {
82
82
  result.push( /*#__PURE__*/_react.default.createElement(_luckDesign.BasicDivider, {
83
- title: setting === null || setting === void 0 ? void 0 : setting.fieldAliasName
83
+ title: setting === null || setting === void 0 ? void 0 : setting.fieldAliasName,
84
+ key: key
84
85
  }));
85
86
  } else if (col !== null && col !== void 0 && col.isShowInForm && ((0, _lodash.isNil)(setting) || setting !== null && setting !== void 0 && setting.isShow)) {
86
87
  var customFiled = filedsRewrite.find(function (_field) {