@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
|
]
|
|
@@ -12,7 +12,20 @@
|
|
|
12
12
|
{
|
|
13
13
|
"name": "CardList",
|
|
14
14
|
"triggerWord": "cardlist",
|
|
15
|
-
"completions": [
|
|
15
|
+
"completions": [
|
|
16
|
+
{
|
|
17
|
+
"label": "getInstance",
|
|
18
|
+
"kind": "method",
|
|
19
|
+
"insertText": "getInstance",
|
|
20
|
+
"documentation": " /**\r\n * 获取表格实例\r\n * @method\r\n */\r"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"label": "refresh",
|
|
24
|
+
"kind": "method",
|
|
25
|
+
"insertText": "refresh",
|
|
26
|
+
"documentation": " /**\r\n * 刷新表格\r\n * @method\r\n */\r"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
16
29
|
},
|
|
17
30
|
{
|
|
18
31
|
"name": "Dialog",
|
|
@@ -52,7 +65,7 @@
|
|
|
52
65
|
"label": "open",
|
|
53
66
|
"kind": "property",
|
|
54
67
|
"insertText": "open",
|
|
55
|
-
"documentation": " /**\r\n *
|
|
68
|
+
"documentation": " /**\r\n * 弹窗打开状态\r\n * @property\r\n */\r"
|
|
56
69
|
},
|
|
57
70
|
{
|
|
58
71
|
"label": "doOpen",
|
|
@@ -67,10 +80,10 @@
|
|
|
67
80
|
"documentation": " /**\r\n * 关闭弹窗\r\n * @method\r\n */\r"
|
|
68
81
|
},
|
|
69
82
|
{
|
|
70
|
-
"label": "
|
|
83
|
+
"label": "setTitle",
|
|
71
84
|
"kind": "method",
|
|
72
|
-
"insertText": "
|
|
73
|
-
"documentation": " /**\r\n * @method\r\n *
|
|
85
|
+
"insertText": "setTitle(title)",
|
|
86
|
+
"documentation": " /**\r\n * 设置弹窗标题\r\n * @method\r\n * @param {stirng} title -标题\r\n */\r"
|
|
74
87
|
}
|
|
75
88
|
]
|
|
76
89
|
},
|
|
@@ -92,6 +105,11 @@
|
|
|
92
105
|
}
|
|
93
106
|
]
|
|
94
107
|
},
|
|
108
|
+
{
|
|
109
|
+
"name": "GroupTree",
|
|
110
|
+
"triggerWord": "grouptree",
|
|
111
|
+
"completions": []
|
|
112
|
+
},
|
|
95
113
|
{
|
|
96
114
|
"name": "Iframe",
|
|
97
115
|
"triggerWord": "iframe",
|
|
@@ -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
|
{
|
|
@@ -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,
|
|
@@ -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
|
},
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
"props": [
|
|
195
195
|
{
|
|
196
196
|
"key": "cancelSelect",
|
|
197
|
-
"name": "
|
|
197
|
+
"name": "允许取消选中",
|
|
198
198
|
"desc": "是否可以取消选中",
|
|
199
199
|
"type": "switch",
|
|
200
200
|
"default": true
|
|
@@ -52,11 +52,15 @@ export default (function (_ref) {
|
|
|
52
52
|
_componentList.current.push([id, component]);
|
|
53
53
|
});
|
|
54
54
|
var _unregister = useMemoizedFn(function (id) {
|
|
55
|
-
|
|
55
|
+
var index = _componentList.current.findIndex(function (_ref2) {
|
|
56
56
|
var _ref3 = _slicedToArray(_ref2, 1),
|
|
57
57
|
_id = _ref3[0];
|
|
58
|
-
return _id
|
|
58
|
+
return _id === id;
|
|
59
59
|
});
|
|
60
|
+
if (index !== -1) {
|
|
61
|
+
_componentList.current.splice(index, 1);
|
|
62
|
+
}
|
|
63
|
+
;
|
|
60
64
|
});
|
|
61
65
|
var _initRemoteApiMap = useMemoizedFn(function (_apiMap) {
|
|
62
66
|
_remoteApiMap.current = _apiMap;
|
|
@@ -257,13 +257,93 @@ export var modifyNode = function modifyNode(id, data) {
|
|
|
257
257
|
});
|
|
258
258
|
});
|
|
259
259
|
};
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* 移动页面中的一个节点到另一个位置。
|
|
263
|
+
*
|
|
264
|
+
* @param {string} sid - 源节点的ID。
|
|
265
|
+
* @param {string} tid - 目标节点的ID。
|
|
266
|
+
* @param {string} action - 移动类型,可以是 'inside', 'left', 'right' 中的一个。
|
|
267
|
+
* @param {string} newid - 新节点的ID,仅在创建新节点时使用。
|
|
268
|
+
* @param {Object} json - 新节点的初始属性,仅在创建新节点时使用。
|
|
269
|
+
*
|
|
270
|
+
* @description
|
|
271
|
+
* 此函数会更新页面数据状态,根据提供的动作类型(`action`),将源节点(`sourceNode`)移动到目标节点(`targetNode`)的相应位置。
|
|
272
|
+
* - 'inside': 将源节点作为目标节点的子节点。
|
|
273
|
+
* - 'left': 将源节点放在目标节点的左边(同一父节点下)。
|
|
274
|
+
* - 'right': 将源节点放在目标节点的右边(同一父节点下)。
|
|
275
|
+
* 如果 `sid` 是空但提供了 `newid`,则函数会创建一个新的节点。
|
|
276
|
+
*
|
|
277
|
+
*/
|
|
278
|
+
export var moveNode = function moveNode(sid, tid, action, newid, json) {
|
|
279
|
+
usePageDataStore.setState(function (state) {
|
|
280
|
+
var sourceNode;
|
|
281
|
+
var sourceParent;
|
|
282
|
+
if (sid) {
|
|
283
|
+
var sourceData = findNode(state.pageData, sid) || {};
|
|
284
|
+
sourceNode = sourceData === null || sourceData === void 0 ? void 0 : sourceData.target;
|
|
285
|
+
sourceParent = sourceData === null || sourceData === void 0 ? void 0 : sourceData.parent;
|
|
286
|
+
} else if (newid) {
|
|
287
|
+
sid = newid;
|
|
288
|
+
sourceNode = {
|
|
289
|
+
props: _objectSpread(_objectSpread({}, json), {}, {
|
|
290
|
+
id: newid
|
|
291
|
+
})
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
var _ref4 = findNode(state.pageData, tid) || {},
|
|
295
|
+
targetNode = _ref4.target,
|
|
296
|
+
targetParent = _ref4.parent;
|
|
297
|
+
if (!sourceNode || !targetNode) {
|
|
298
|
+
console.error('Source or target node does not exist.');
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
if (sourceParent) {
|
|
302
|
+
sourceParent.children.splice(sourceParent.children.indexOf(sid), 1);
|
|
303
|
+
if (sourceParent.children.length === 0) {
|
|
304
|
+
delete sourceParent['children'];
|
|
305
|
+
}
|
|
306
|
+
delete sourceParent[sid];
|
|
307
|
+
}
|
|
308
|
+
switch (action) {
|
|
309
|
+
case 'inside':
|
|
310
|
+
if (!targetNode.hasOwnProperty('children')) {
|
|
311
|
+
targetNode.children = [];
|
|
312
|
+
}
|
|
313
|
+
targetNode.children.push(sid);
|
|
314
|
+
sourceNode.props.parentId = tid;
|
|
315
|
+
targetNode[sid] = sourceNode;
|
|
316
|
+
break;
|
|
317
|
+
case 'left':
|
|
318
|
+
case 'right':
|
|
319
|
+
if (!targetParent) {
|
|
320
|
+
console.error('Target node must have a parent for left or right operations.');
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
var idx = targetParent.children.indexOf(tid);
|
|
324
|
+
if (idx === -1) {
|
|
325
|
+
console.error("Target node is not found in its parent's children list.");
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
if (action === 'right') {
|
|
329
|
+
idx++;
|
|
330
|
+
}
|
|
331
|
+
targetParent.children.splice(idx, 0, sid);
|
|
332
|
+
sourceNode.props.parentId = targetParent.props.id;
|
|
333
|
+
targetParent[sid] = sourceNode;
|
|
334
|
+
break;
|
|
335
|
+
default:
|
|
336
|
+
break;
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
};
|
|
260
340
|
export var clearChildren = function clearChildren(id) {
|
|
261
341
|
usePageDataStore.setState(function (state) {
|
|
262
342
|
if (id === LC_BUILDIN_UNIT_KEY.PAGE_ROOT) {
|
|
263
343
|
return;
|
|
264
344
|
}
|
|
265
|
-
var
|
|
266
|
-
target =
|
|
345
|
+
var _ref5 = findNode(state.pageData, id) || {},
|
|
346
|
+
target = _ref5.target;
|
|
267
347
|
if (!target) return;
|
|
268
348
|
forEach(target.children, function (c) {
|
|
269
349
|
delete target[c];
|
|
@@ -241,4 +241,25 @@ export function loadScript(path) {
|
|
|
241
241
|
ref: script,
|
|
242
242
|
status: script.getAttribute('data-status') || 'ready'
|
|
243
243
|
};
|
|
244
|
+
}
|
|
245
|
+
export function findFirstLeafNode(node) {
|
|
246
|
+
if (!node.children || node.children.length === 0) {
|
|
247
|
+
return node;
|
|
248
|
+
}
|
|
249
|
+
var _iterator2 = _createForOfIteratorHelper(node.children),
|
|
250
|
+
_step2;
|
|
251
|
+
try {
|
|
252
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
253
|
+
var child = _step2.value;
|
|
254
|
+
var leaf = findFirstLeafNode(child);
|
|
255
|
+
if (leaf) {
|
|
256
|
+
return leaf;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
} catch (err) {
|
|
260
|
+
_iterator2.e(err);
|
|
261
|
+
} finally {
|
|
262
|
+
_iterator2.f();
|
|
263
|
+
}
|
|
264
|
+
return null;
|
|
244
265
|
}
|
|
@@ -7,6 +7,7 @@ var _excluded = ["props", "children"],
|
|
|
7
7
|
import React, { useRef } from 'react';
|
|
8
8
|
import { dynamic } from 'umi';
|
|
9
9
|
import { useMemoizedFn, useCreation } from 'ahooks';
|
|
10
|
+
import { Skeleton } from 'luck-design/antd';
|
|
10
11
|
import { upperFirst, isNil } from 'lodash';
|
|
11
12
|
import { useContext } from "../provider/ContextProvider";
|
|
12
13
|
import { LC_BUILDIN_UNIT_KEY_LIST, RUNTIME } from "../../constants";
|
|
@@ -55,7 +56,18 @@ export default function useCanvasRender(data, deps) {
|
|
|
55
56
|
return _loader.apply(this, arguments);
|
|
56
57
|
}
|
|
57
58
|
return loader;
|
|
58
|
-
}()
|
|
59
|
+
}(),
|
|
60
|
+
loading: function loading() {
|
|
61
|
+
return /*#__PURE__*/React.createElement(Skeleton, {
|
|
62
|
+
active: true,
|
|
63
|
+
title: {
|
|
64
|
+
width: '70%'
|
|
65
|
+
},
|
|
66
|
+
paragraph: {
|
|
67
|
+
rows: 7
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
59
71
|
});
|
|
60
72
|
}
|
|
61
73
|
var renderable = true;
|
|
@@ -10,6 +10,7 @@ import { useDraggable } from '@dnd-kit/core';
|
|
|
10
10
|
import styles from "./style/components.less";
|
|
11
11
|
import data from "../engine/meta/components-list.json";
|
|
12
12
|
import { Action } from "./components/DragDrop/DragDropContext";
|
|
13
|
+
import Expect from "./expect.jsx";
|
|
13
14
|
var TabPane = Tabs.TabPane;
|
|
14
15
|
var Search = Input.Search;
|
|
15
16
|
var BaseCom = function BaseCom(_ref) {
|
|
@@ -125,6 +126,10 @@ var Components = function Components(_ref3) {
|
|
|
125
126
|
label: '自定义组件'
|
|
126
127
|
}),
|
|
127
128
|
key: "dataset"
|
|
128
|
-
},
|
|
129
|
+
}, /*#__PURE__*/React.createElement(Expect, {
|
|
130
|
+
style: {
|
|
131
|
+
paddingTop: '80px'
|
|
132
|
+
}
|
|
133
|
+
}))));
|
|
129
134
|
};
|
|
130
135
|
export default Components;
|
|
@@ -68,6 +68,7 @@ var Design = function Design() {
|
|
|
68
68
|
locale: locale,
|
|
69
69
|
onLangChange: handleLangChange
|
|
70
70
|
}), /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
id: "design-workspace",
|
|
71
72
|
className: styles['lc-painter-design-workspace']
|
|
72
73
|
}, /*#__PURE__*/React.createElement(DesignOperator, {
|
|
73
74
|
canvas: simulatorRef
|
|
@@ -4,6 +4,7 @@ import { last, initial } from 'lodash';
|
|
|
4
4
|
import { useEventListener, useSetState, useMemoizedFn, useCreation, useSize, useLatest, useKeyPress } from 'ahooks';
|
|
5
5
|
import { Icon, Dropdown, message } from 'luck-design/antd';
|
|
6
6
|
import { reverse, isString, isNil } from 'lodash';
|
|
7
|
+
import classNames from 'classnames';
|
|
7
8
|
import { suid } from '@luck-design-biz/base/utils';
|
|
8
9
|
import { useContext, addNode, deleteNode } from "../engine/provider/ContextProvider";
|
|
9
10
|
import { LC_BUILDIN_UNIT_KEY, LC_COMPONENT_UNIT_KEY, LC_COMPONENT_UNIT, LC_FORMITEM_UNIT, CONTAINER_UNITS } from "../constants";
|
|
@@ -25,7 +26,7 @@ var getOperatorStyle = function getOperatorStyle(canvas, cellNode) {
|
|
|
25
26
|
};
|
|
26
27
|
};
|
|
27
28
|
var DesignOperator = function DesignOperator(_ref) {
|
|
28
|
-
var
|
|
29
|
+
var _getElement2;
|
|
29
30
|
var canvas = _ref.canvas;
|
|
30
31
|
var context = useContext();
|
|
31
32
|
var size = useSize(canvas);
|
|
@@ -69,7 +70,9 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
69
70
|
context.$publisher(context.topics.COMPONENT_APPEND, {
|
|
70
71
|
id: _id
|
|
71
72
|
});
|
|
72
|
-
|
|
73
|
+
setTimeout(function () {
|
|
74
|
+
handleSelect(_id);
|
|
75
|
+
});
|
|
73
76
|
}
|
|
74
77
|
}).watch();
|
|
75
78
|
var json = require("../engine/meta/".concat(data.component.toLowerCase(), ".props.default.json"));
|
|
@@ -110,6 +113,15 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
110
113
|
}))
|
|
111
114
|
};
|
|
112
115
|
}, [operatorId.selector]);
|
|
116
|
+
var activeDomPosition = useCreation(function () {
|
|
117
|
+
var _getElement;
|
|
118
|
+
if (!operatorId.selector && !operatorId.selectorTarget) return null;
|
|
119
|
+
var targetTop = (_getElement = getElement(isNil(operatorId.selectorTarget) ? operatorId.selector : operatorId.selectorTarget.element)) === null || _getElement === void 0 ? void 0 : _getElement.getBoundingClientRect().top;
|
|
120
|
+
var delat = targetTop - canvas.current.getBoundingClientRect().top;
|
|
121
|
+
return {
|
|
122
|
+
top: delat > 24 ? -24 : 0
|
|
123
|
+
};
|
|
124
|
+
}, [operatorId.selector, operatorId.selectorTarget]);
|
|
113
125
|
var lastDetectorName = useCreation(function () {
|
|
114
126
|
var _last;
|
|
115
127
|
return operatorId.detector && isString(operatorId.detector) ? (_last = last(context.componentMap.get(operatorId.detector).api.getLevelNodes())) === null || _last === void 0 ? void 0 : _last.name : void 0;
|
|
@@ -211,9 +223,11 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
211
223
|
}).watch();
|
|
212
224
|
var hcid = context.$subscriber(context.topics.COMPONENT_HOVER).on(function (payload) {
|
|
213
225
|
if (payload.target) setOperatorId({
|
|
214
|
-
detector: payload.target
|
|
226
|
+
detector: payload.target,
|
|
227
|
+
detectorSide: payload.side
|
|
215
228
|
});else setOperatorId({
|
|
216
|
-
detector: null
|
|
229
|
+
detector: null,
|
|
230
|
+
detectorSide: null
|
|
217
231
|
});
|
|
218
232
|
}).watch();
|
|
219
233
|
var acid = context.$subscriber(context.topics.COMPONENT_ACTIVE).on(function (payload) {
|
|
@@ -224,14 +238,16 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
224
238
|
selector: payload.target,
|
|
225
239
|
selectorTarget: null,
|
|
226
240
|
deletable: !node || node.props.buildIn !== true,
|
|
227
|
-
detector: null
|
|
241
|
+
detector: null,
|
|
242
|
+
detectorSide: null
|
|
228
243
|
});
|
|
229
244
|
} else {
|
|
230
245
|
setOperatorId({
|
|
231
246
|
selector: payload.target.id,
|
|
232
247
|
selectorTarget: payload.target,
|
|
233
248
|
deletable: false,
|
|
234
|
-
detector: null
|
|
249
|
+
detector: null,
|
|
250
|
+
detectorSide: null
|
|
235
251
|
});
|
|
236
252
|
}
|
|
237
253
|
} else {
|
|
@@ -286,12 +302,12 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
286
302
|
}, [operatorId.selector]);
|
|
287
303
|
return /*#__PURE__*/React.createElement(React.Fragment, null, operatorId.detector && /*#__PURE__*/React.createElement("div", {
|
|
288
304
|
id: "lc-detector",
|
|
289
|
-
className: styles['lc-painter-design-detector'],
|
|
305
|
+
className: classNames(styles['lc-painter-design-detector'], styles["sider-".concat(operatorId.detectorSide)]),
|
|
290
306
|
style: getOperatorStyle(canvas.current, getElement(operatorId.detector))
|
|
291
307
|
}, /*#__PURE__*/React.createElement("span", {
|
|
292
308
|
className: styles['lc-painter-design-detector-name'],
|
|
293
309
|
style: {
|
|
294
|
-
top: ((
|
|
310
|
+
top: ((_getElement2 = getElement(operatorId.detector)) === null || _getElement2 === void 0 ? void 0 : _getElement2.offsetTop) < 23 ? 0 : '-23px'
|
|
295
311
|
}
|
|
296
312
|
}, lastDetectorName ? "".concat(lastDetectorName, "(").concat(operatorId.detector, ")") : null)), operatorId.selector && /*#__PURE__*/React.createElement("div", {
|
|
297
313
|
id: "lc-selector",
|
|
@@ -300,13 +316,7 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
300
316
|
style: getOperatorStyle(canvas.current, getElement(isNil(operatorId.selectorTarget) ? operatorId.selector : operatorId.selectorTarget.element))
|
|
301
317
|
}, acticeProps && /*#__PURE__*/React.createElement("div", {
|
|
302
318
|
className: styles['lc-borders-actions'],
|
|
303
|
-
style:
|
|
304
|
-
top: 0
|
|
305
|
-
} : ((_getElement2 = getElement(isNil(operatorId.selectorTarget) ? operatorId.selector : operatorId.selectorTarget.element)) === null || _getElement2 === void 0 ? void 0 : _getElement2.offsetTop) < 23 ? {
|
|
306
|
-
bottom: '-23px'
|
|
307
|
-
} : {
|
|
308
|
-
top: '-23px'
|
|
309
|
-
}
|
|
319
|
+
style: activeDomPosition
|
|
310
320
|
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
311
321
|
overlay: acticeProps.menu,
|
|
312
322
|
placement: "bottomLeft"
|