@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.
- package/es/components/LDActions/index.less +3 -1
- package/es/components/LdAutoForm/index.js +2 -1
- package/es/components/LdCard/index.js +154 -67
- package/es/components/LdFormList/index.js +20 -6
- package/es/components/LdGridForm/index.js +40 -24
- package/es/components/LdTree/index.js +14 -8
- package/es/components/LdTree/index.less +4 -2
- package/es/helper/ldBuilder.js +1 -1
- package/es/locales/zh-CN.js +13 -4
- package/es/lowcode/constants/index.js +1 -1
- package/es/lowcode/engine/meta/cardlist.props.default.json +27 -6
- package/es/lowcode/engine/meta/cardlist.props.json +254 -72
- package/es/lowcode/engine/meta/components-list.json +6 -102
- package/es/lowcode/engine/meta/dialog.props.default.json +4 -2
- package/es/lowcode/engine/meta/dialog.props.json +74 -18
- package/es/lowcode/engine/meta/drawer.props.default.json +15 -4
- package/es/lowcode/engine/meta/drawer.props.json +144 -24
- package/es/lowcode/engine/meta/form.props.default.json +14 -3
- package/es/lowcode/engine/meta/form.props.json +49 -9
- package/es/lowcode/engine/meta/grouptree.props.default.json +16 -0
- package/es/lowcode/engine/meta/grouptree.props.json +83 -0
- package/es/lowcode/engine/meta/iframe.props.default.json +1 -1
- package/es/lowcode/engine/meta/iframe.props.json +3 -4
- package/es/lowcode/engine/meta/image.props.default.json +3 -2
- package/es/lowcode/engine/meta/image.props.json +51 -16
- package/es/lowcode/engine/meta/imex.props.json +1 -1
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +23 -5
- package/es/lowcode/engine/meta/link.props.default.json +1 -1
- package/es/lowcode/engine/meta/link.props.json +9 -9
- package/es/lowcode/engine/meta/table.props.json +1 -1
- package/es/lowcode/engine/meta/tabs.props.default.json +1 -1
- package/es/lowcode/engine/meta/tabs.props.json +1 -1
- package/es/lowcode/engine/meta/tree.props.json +2 -2
- package/es/lowcode/engine/provider/ContextProvider/index.js +6 -2
- package/es/lowcode/engine/provider/ContextProvider/usePageDataStore.js +82 -2
- package/es/lowcode/engine/tools/helper.js +21 -0
- package/es/lowcode/engine/tools/useCanvasRender.js +13 -1
- package/es/lowcode/painter/Components.js +6 -1
- package/es/lowcode/painter/Design.js +1 -0
- package/es/lowcode/painter/DesignOperator.js +25 -15
- package/es/lowcode/painter/DesignToolbar.js +78 -47
- package/es/lowcode/painter/Ribbon.js +14 -1
- package/es/lowcode/painter/components/ActionBindModal.js +3 -7
- package/es/lowcode/painter/components/DragDrop/DragDropContext.js +144 -37
- package/es/lowcode/painter/components/DragDrop/DragDropWrapper.js +29 -6
- package/es/lowcode/painter/components/DragDrop/Overlay.js +5 -2
- package/es/lowcode/painter/components/DragDrop/TreeDragDropWrapper.js +7 -4
- package/es/lowcode/painter/components/NumberInput.js +1 -1
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +2 -1
- package/es/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
- package/es/lowcode/painter/components/field-setting/SettingUI.js +30 -2
- package/es/lowcode/painter/components/field-setting/index.js +26 -12
- package/es/lowcode/painter/expect.js +27 -0
- package/es/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +20 -2
- package/es/lowcode/painter/panel-section/ActionsEditor/index.js +18 -3
- package/es/lowcode/painter/panel-section/ComplexPop.js +1 -1
- package/es/lowcode/painter/panel-section/DataSetSelector.js +14 -3
- package/es/lowcode/painter/panel-section/FieldsSetting.js +2 -2
- package/es/lowcode/painter/panel-section/GroupClassSelector.js +55 -0
- package/es/lowcode/painter/panel-section/PageVars.js +1 -1
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +1 -0
- package/es/lowcode/painter/panel-section/TabItems.js +1 -1
- package/es/lowcode/painter/panel-section/TableTopFilter.js +3 -3
- package/es/lowcode/painter/style/action-bind-modal.less +5 -3
- package/es/lowcode/painter/style/design.less +26 -7
- package/es/lowcode/painter/style/dragdrop.less +46 -0
- package/es/lowcode/painter/style/list-editor.less +5 -3
- package/es/lowcode/painter/style/number-input.less +3 -1
- package/es/lowcode/painter/style/outline.less +3 -1
- package/es/lowcode/painter/style/panel-attrs.less +7 -3
- package/es/lowcode/painter/style/panel.less +9 -7
- package/es/lowcode/painter/style/radio.less +1 -1
- package/es/lowcode/painter/style/ribbon.less +4 -2
- package/es/lowcode/painter/svg/code.svg +3 -0
- package/es/lowcode/painter/svg/expect.svg +9 -0
- package/es/lowcode/view/lc-components/CardList/index.js +481 -12
- package/es/lowcode/view/lc-components/CardList/meta.json +255 -73
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +14 -6
- package/es/lowcode/view/lc-components/Dialog/index.js +15 -5
- package/es/lowcode/view/lc-components/Dialog/index.less +4 -0
- package/es/lowcode/view/lc-components/Dialog/meta.json +72 -18
- package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +51 -8
- package/es/lowcode/view/lc-components/Drawer/index.js +139 -24
- package/es/lowcode/view/lc-components/Drawer/index.less +11 -8
- package/es/lowcode/view/lc-components/Drawer/meta.json +136 -25
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +2 -1
- package/es/lowcode/view/lc-components/Form/index.js +45 -28
- package/es/lowcode/view/lc-components/Form/meta.json +44 -8
- package/es/lowcode/view/lc-components/GroupTree/FunctionDesign.js +10 -0
- package/es/lowcode/view/lc-components/GroupTree/FunctionLive.js +10 -0
- package/es/lowcode/view/lc-components/GroupTree/FunctionPreview.js +10 -0
- package/es/lowcode/view/lc-components/GroupTree/index.js +212 -0
- package/es/lowcode/view/lc-components/GroupTree/index.less +12 -0
- package/es/lowcode/view/lc-components/GroupTree/meta.json +83 -0
- package/es/lowcode/view/lc-components/Iframe/index.js +57 -7
- package/es/lowcode/view/lc-components/Iframe/meta.json +3 -4
- package/es/lowcode/view/lc-components/ImEx/meta.json +1 -1
- package/es/lowcode/view/lc-components/Image/index.js +82 -6
- package/es/lowcode/view/lc-components/Image/index.less +27 -0
- package/es/lowcode/view/lc-components/Image/meta.json +51 -16
- package/es/lowcode/view/lc-components/Link/index.js +53 -5
- package/es/lowcode/view/lc-components/Link/index.less +15 -0
- package/es/lowcode/view/lc-components/Link/meta.json +9 -9
- package/es/lowcode/view/lc-components/Table/index.js +5 -6
- package/es/lowcode/view/lc-components/Table/meta.json +1 -1
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +40 -4
- package/es/lowcode/view/lc-components/Tabs/index.js +1 -1
- package/es/lowcode/view/lc-components/Tabs/meta.json +1 -1
- package/es/lowcode/view/lc-components/Tree/index.js +21 -19
- package/es/lowcode/view/lc-components/Tree/meta.json +2 -2
- package/es/utils/grid.js +3 -3
- package/lib/components/LDActions/index.less +3 -1
- package/lib/components/LdAutoForm/index.js +2 -1
- package/lib/components/LdCard/index.js +153 -66
- package/lib/components/LdFormList/index.js +19 -5
- package/lib/components/LdGridForm/index.js +40 -24
- package/lib/components/LdTree/index.js +14 -8
- package/lib/components/LdTree/index.less +4 -2
- package/lib/helper/ldBuilder.js +2 -2
- package/lib/locales/zh-CN.js +13 -4
- package/lib/lowcode/constants/index.js +1 -1
- package/lib/lowcode/engine/meta/cardlist.props.default.json +27 -6
- package/lib/lowcode/engine/meta/cardlist.props.json +254 -72
- package/lib/lowcode/engine/meta/components-list.json +6 -102
- package/lib/lowcode/engine/meta/dialog.props.default.json +4 -2
- package/lib/lowcode/engine/meta/dialog.props.json +74 -18
- package/lib/lowcode/engine/meta/drawer.props.default.json +15 -4
- package/lib/lowcode/engine/meta/drawer.props.json +144 -24
- package/lib/lowcode/engine/meta/form.props.default.json +14 -3
- package/lib/lowcode/engine/meta/form.props.json +49 -9
- package/lib/lowcode/engine/meta/grouptree.props.default.json +16 -0
- package/lib/lowcode/engine/meta/grouptree.props.json +83 -0
- package/lib/lowcode/engine/meta/iframe.props.default.json +1 -1
- package/lib/lowcode/engine/meta/iframe.props.json +3 -4
- package/lib/lowcode/engine/meta/image.props.default.json +3 -2
- package/lib/lowcode/engine/meta/image.props.json +51 -16
- package/lib/lowcode/engine/meta/imex.props.json +1 -1
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +23 -5
- package/lib/lowcode/engine/meta/link.props.default.json +1 -1
- package/lib/lowcode/engine/meta/link.props.json +9 -9
- package/lib/lowcode/engine/meta/table.props.json +1 -1
- package/lib/lowcode/engine/meta/tabs.props.default.json +1 -1
- package/lib/lowcode/engine/meta/tabs.props.json +1 -1
- package/lib/lowcode/engine/meta/tree.props.json +2 -2
- package/lib/lowcode/engine/provider/ContextProvider/index.js +6 -2
- package/lib/lowcode/engine/provider/ContextProvider/usePageDataStore.js +83 -3
- package/lib/lowcode/engine/tools/helper.js +22 -0
- package/lib/lowcode/engine/tools/useCanvasRender.js +13 -1
- package/lib/lowcode/painter/Components.js +6 -1
- package/lib/lowcode/painter/Design.js +1 -0
- package/lib/lowcode/painter/DesignOperator.js +25 -15
- package/lib/lowcode/painter/DesignToolbar.js +78 -47
- package/lib/lowcode/painter/Ribbon.js +14 -1
- package/lib/lowcode/painter/components/ActionBindModal.js +3 -7
- package/lib/lowcode/painter/components/DragDrop/DragDropContext.js +142 -35
- package/lib/lowcode/painter/components/DragDrop/DragDropWrapper.js +27 -4
- package/lib/lowcode/painter/components/DragDrop/Overlay.js +5 -2
- package/lib/lowcode/painter/components/DragDrop/TreeDragDropWrapper.js +7 -4
- package/lib/lowcode/painter/components/NumberInput.js +1 -1
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +2 -1
- package/lib/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +29 -1
- package/lib/lowcode/painter/components/field-setting/index.js +26 -12
- package/lib/lowcode/painter/expect.js +34 -0
- package/lib/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +19 -1
- package/lib/lowcode/painter/panel-section/ActionsEditor/index.js +18 -3
- package/lib/lowcode/painter/panel-section/ComplexPop.js +1 -1
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +14 -3
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +2 -2
- package/lib/lowcode/painter/panel-section/GroupClassSelector.js +63 -0
- package/lib/lowcode/painter/panel-section/PageVars.js +1 -1
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +1 -0
- package/lib/lowcode/painter/panel-section/TabItems.js +1 -1
- package/lib/lowcode/painter/panel-section/TableTopFilter.js +3 -3
- package/lib/lowcode/painter/style/action-bind-modal.less +5 -3
- package/lib/lowcode/painter/style/design.less +26 -7
- package/lib/lowcode/painter/style/dragdrop.less +46 -0
- package/lib/lowcode/painter/style/list-editor.less +5 -3
- package/lib/lowcode/painter/style/number-input.less +3 -1
- package/lib/lowcode/painter/style/outline.less +3 -1
- package/lib/lowcode/painter/style/panel-attrs.less +7 -3
- package/lib/lowcode/painter/style/panel.less +9 -7
- package/lib/lowcode/painter/style/radio.less +1 -1
- package/lib/lowcode/painter/style/ribbon.less +4 -2
- package/lib/lowcode/painter/svg/code.svg +3 -0
- package/lib/lowcode/painter/svg/expect.svg +9 -0
- package/lib/lowcode/view/lc-components/CardList/index.js +480 -11
- package/lib/lowcode/view/lc-components/CardList/meta.json +255 -73
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +13 -5
- package/lib/lowcode/view/lc-components/Dialog/index.js +15 -5
- package/lib/lowcode/view/lc-components/Dialog/index.less +4 -0
- package/lib/lowcode/view/lc-components/Dialog/meta.json +72 -18
- package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +52 -8
- package/lib/lowcode/view/lc-components/Drawer/index.js +138 -23
- package/lib/lowcode/view/lc-components/Drawer/index.less +11 -8
- package/lib/lowcode/view/lc-components/Drawer/meta.json +136 -25
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Form/index.js +44 -27
- package/lib/lowcode/view/lc-components/Form/meta.json +44 -8
- package/lib/lowcode/view/lc-components/GroupTree/FunctionDesign.js +17 -0
- package/lib/lowcode/view/lc-components/GroupTree/FunctionLive.js +17 -0
- package/lib/lowcode/view/lc-components/GroupTree/FunctionPreview.js +17 -0
- package/lib/lowcode/view/lc-components/GroupTree/index.js +220 -0
- package/lib/lowcode/view/lc-components/GroupTree/index.less +12 -0
- package/lib/lowcode/view/lc-components/GroupTree/meta.json +83 -0
- package/lib/lowcode/view/lc-components/Iframe/index.js +55 -5
- package/lib/lowcode/view/lc-components/Iframe/meta.json +3 -4
- package/lib/lowcode/view/lc-components/ImEx/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Image/index.js +80 -4
- package/lib/lowcode/view/lc-components/Image/index.less +27 -0
- package/lib/lowcode/view/lc-components/Image/meta.json +51 -16
- package/lib/lowcode/view/lc-components/Link/index.js +52 -4
- package/lib/lowcode/view/lc-components/Link/index.less +15 -0
- package/lib/lowcode/view/lc-components/Link/meta.json +9 -9
- package/lib/lowcode/view/lc-components/Table/index.js +5 -6
- package/lib/lowcode/view/lc-components/Table/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +38 -2
- package/lib/lowcode/view/lc-components/Tabs/index.js +1 -1
- package/lib/lowcode/view/lc-components/Tabs/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Tree/index.js +20 -18
- package/lib/lowcode/view/lc-components/Tree/meta.json +2 -2
- package/lib/utils/grid.js +2 -2
- package/package.json +10 -9
- package/es/lowcode/painter/style/treedragdrop.less +0 -19
- package/es/lowcode/view/lc-components/Form/index.less +0 -5
- package/lib/lowcode/painter/style/treedragdrop.less +0 -19
- 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
|
-
"
|
|
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": "
|
|
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": "
|
|
38
|
-
"name": "
|
|
39
|
-
"desc": "
|
|
40
|
-
"type": "
|
|
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": "
|
|
57
|
+
"label": "铺满(Cover)",
|
|
58
|
+
"value": "cover"
|
|
52
59
|
},
|
|
53
60
|
{
|
|
54
|
-
"label": "
|
|
55
|
-
"value": "
|
|
61
|
+
"label": "适合(Contain)",
|
|
62
|
+
"value": "contain"
|
|
56
63
|
},
|
|
57
64
|
{
|
|
58
|
-
"label": "
|
|
59
|
-
"value": "
|
|
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": "
|
|
69
|
-
"
|
|
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": "
|
|
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(
|
|
20
|
-
|
|
21
|
-
},
|
|
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
|
-
"
|
|
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": "
|
|
26
|
-
"type": "
|
|
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": "
|
|
54
|
-
"name": "
|
|
55
|
-
"desc": "
|
|
56
|
-
"type": "
|
|
57
|
-
"default":
|
|
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 =
|
|
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
|
-
|
|
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
|
}));
|
|
@@ -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", "
|
|
6
|
-
import React, { useRef, useImperativeHandle, useState,
|
|
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
|
|
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
|
|
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
|
|
55
|
+
return wrapperRef.current;
|
|
55
56
|
});
|
|
56
57
|
useImperativeHandle(apiRef, function () {
|
|
57
58
|
return {
|
|
58
59
|
getInstance: function getInstance() {
|
|
59
|
-
return
|
|
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:
|
|
157
|
-
height:
|
|
156
|
+
width: width,
|
|
157
|
+
height: height,
|
|
158
158
|
id: id,
|
|
159
159
|
ldId: id,
|
|
160
|
-
ref:
|
|
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
|
-
"
|
|
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 (
|
|
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:
|
|
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) {
|