@luck-design-biz/luckda 1.0.1-12 → 1.0.1-13
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/LdCard/index.js +147 -67
- package/es/components/LdTree/index.less +2 -0
- package/es/locales/zh-CN.js +4 -2
- package/es/lowcode/engine/meta/cardlist.props.default.json +27 -7
- package/es/lowcode/engine/meta/cardlist.props.json +252 -71
- package/es/lowcode/engine/meta/components-list.json +24 -0
- package/es/lowcode/engine/meta/iframe.props.default.json +1 -2
- package/es/lowcode/engine/meta/iframe.props.json +2 -3
- package/es/lowcode/engine/meta/image.props.default.json +3 -3
- package/es/lowcode/engine/meta/image.props.json +49 -15
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +14 -1
- package/es/lowcode/engine/meta/link.props.default.json +1 -2
- package/es/lowcode/engine/meta/link.props.json +8 -9
- package/es/lowcode/painter/Ribbon.js +12 -0
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +2 -1
- 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/GroupClassSelector.js +1 -1
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +1 -0
- package/es/lowcode/painter/panel-section/TableTopFilter.js +3 -3
- package/es/lowcode/view/lc-components/CardList/index.js +476 -12
- package/es/lowcode/view/lc-components/CardList/meta.json +253 -72
- package/es/lowcode/view/lc-components/GroupTree/index.js +1 -1
- package/es/lowcode/view/lc-components/Iframe/index.js +57 -6
- package/es/lowcode/view/lc-components/Iframe/meta.json +2 -3
- package/es/lowcode/view/lc-components/Image/index.js +61 -5
- package/es/lowcode/view/lc-components/Image/index.less +27 -0
- package/es/lowcode/view/lc-components/Image/meta.json +49 -15
- package/es/lowcode/view/lc-components/Link/index.js +34 -4
- package/es/lowcode/view/lc-components/Link/index.less +15 -0
- package/es/lowcode/view/lc-components/Link/meta.json +8 -9
- package/es/lowcode/view/lc-components/Table/index.js +2 -2
- package/lib/components/LdCard/index.js +146 -66
- package/lib/components/LdTree/index.less +2 -0
- package/lib/locales/zh-CN.js +4 -2
- package/lib/lowcode/engine/meta/cardlist.props.default.json +27 -7
- package/lib/lowcode/engine/meta/cardlist.props.json +252 -71
- package/lib/lowcode/engine/meta/components-list.json +24 -0
- package/lib/lowcode/engine/meta/iframe.props.default.json +1 -2
- package/lib/lowcode/engine/meta/iframe.props.json +2 -3
- package/lib/lowcode/engine/meta/image.props.default.json +3 -3
- package/lib/lowcode/engine/meta/image.props.json +49 -15
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +14 -1
- package/lib/lowcode/engine/meta/link.props.default.json +1 -2
- package/lib/lowcode/engine/meta/link.props.json +8 -9
- package/lib/lowcode/painter/Ribbon.js +12 -0
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +2 -1
- 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/GroupClassSelector.js +1 -1
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +1 -0
- package/lib/lowcode/painter/panel-section/TableTopFilter.js +3 -3
- package/lib/lowcode/view/lc-components/CardList/index.js +475 -11
- package/lib/lowcode/view/lc-components/CardList/meta.json +253 -72
- package/lib/lowcode/view/lc-components/GroupTree/index.js +1 -1
- package/lib/lowcode/view/lc-components/Iframe/index.js +56 -5
- package/lib/lowcode/view/lc-components/Iframe/meta.json +2 -3
- package/lib/lowcode/view/lc-components/Image/index.js +60 -4
- package/lib/lowcode/view/lc-components/Image/index.less +27 -0
- package/lib/lowcode/view/lc-components/Image/meta.json +49 -15
- package/lib/lowcode/view/lc-components/Link/index.js +34 -4
- package/lib/lowcode/view/lc-components/Link/index.less +15 -0
- package/lib/lowcode/view/lc-components/Link/meta.json +8 -9
- package/lib/lowcode/view/lc-components/Table/index.js +2 -2
- package/package.json +176 -176
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
"icon": "icon-cardlist",
|
|
6
6
|
"group": "advance",
|
|
7
7
|
"groupName": "高级",
|
|
8
|
-
"hidden": true,
|
|
9
8
|
"order": 1,
|
|
10
9
|
"props": [
|
|
11
10
|
{
|
|
@@ -32,77 +31,265 @@
|
|
|
32
31
|
},
|
|
33
32
|
{
|
|
34
33
|
"key": "autoLoad",
|
|
35
|
-
"name": "
|
|
34
|
+
"name": "自动加载",
|
|
36
35
|
"desc": "首次数据是否自动加载,若存在必须带搜索条件再加载的情况,需要关闭",
|
|
37
|
-
"type": "
|
|
36
|
+
"type": "switch",
|
|
38
37
|
"default": true
|
|
39
38
|
},
|
|
40
39
|
{
|
|
41
40
|
"key": "readOnly",
|
|
42
|
-
"name": "
|
|
43
|
-
"
|
|
44
|
-
"type": "boolean",
|
|
41
|
+
"name": "只读",
|
|
42
|
+
"type": "switch",
|
|
45
43
|
"default": false
|
|
46
44
|
},
|
|
47
45
|
{
|
|
48
|
-
"key": "
|
|
49
|
-
"name": "
|
|
50
|
-
"
|
|
51
|
-
"type": "boolean",
|
|
46
|
+
"key": "draggable",
|
|
47
|
+
"name": "拖拽排序",
|
|
48
|
+
"type": "switch",
|
|
52
49
|
"default": false
|
|
53
50
|
},
|
|
54
51
|
{
|
|
55
|
-
"key": "
|
|
56
|
-
"name": "
|
|
57
|
-
"desc": "isFlow为false时设置,默认单页分页数",
|
|
52
|
+
"key": "col",
|
|
53
|
+
"name": "列数",
|
|
58
54
|
"type": "number",
|
|
59
|
-
"default":
|
|
55
|
+
"default": 4
|
|
60
56
|
},
|
|
61
57
|
{
|
|
62
|
-
"key": "
|
|
63
|
-
"name": "
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
58
|
+
"key": "paginationSetting",
|
|
59
|
+
"name": "分页设置",
|
|
60
|
+
"type": "group",
|
|
61
|
+
"props": [
|
|
62
|
+
{
|
|
63
|
+
"key": "pagination",
|
|
64
|
+
"name": "开启分页",
|
|
65
|
+
"type": "switch",
|
|
66
|
+
"default": true
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"key": "pageSize",
|
|
70
|
+
"name": "每页行数",
|
|
71
|
+
"type": "number",
|
|
72
|
+
"default": 40
|
|
73
|
+
}
|
|
74
|
+
]
|
|
73
75
|
},
|
|
74
76
|
{
|
|
75
|
-
"key": "
|
|
76
|
-
"name": "
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
77
|
+
"key": "styleSetting",
|
|
78
|
+
"name": "视觉设置",
|
|
79
|
+
"type": "group",
|
|
80
|
+
"default": true,
|
|
81
|
+
"next": {
|
|
82
|
+
"name": "视觉设置",
|
|
83
|
+
"props": [
|
|
84
|
+
{
|
|
85
|
+
"key": "nocardBoxborder",
|
|
86
|
+
"name": "无边框风格",
|
|
87
|
+
"type": "switch",
|
|
88
|
+
"default": false
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"key": "showAvatar",
|
|
92
|
+
"name": "显示图标",
|
|
93
|
+
"type": "switch",
|
|
94
|
+
"default": true
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"key": "avatarUrl",
|
|
98
|
+
"name": "图标地址",
|
|
99
|
+
"type": "_JSEditor",
|
|
100
|
+
"defaultCode": "function avatarUrl(record) { \n return null; \n}",
|
|
101
|
+
"mustConfirm": true,
|
|
102
|
+
"wrapper": "collapse",
|
|
103
|
+
"wrapperProps": {
|
|
104
|
+
"suppressIcon": true
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"key": "showTitle",
|
|
109
|
+
"name": "显示标题",
|
|
110
|
+
"type": "switch",
|
|
111
|
+
"default": true
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"key": "renderTitle",
|
|
115
|
+
"name": "标题内容",
|
|
116
|
+
"type": "_JSEditor",
|
|
117
|
+
"defaultCode": "function renderTitle(record) { \n return record.sname; \n}",
|
|
118
|
+
"mustConfirm": true,
|
|
119
|
+
"wrapper": "collapse",
|
|
120
|
+
"wrapperProps": {
|
|
121
|
+
"suppressIcon": true
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"key": "showDesc",
|
|
126
|
+
"name": "显示描述",
|
|
127
|
+
"type": "switch",
|
|
128
|
+
"default": true
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"key": "describeLines",
|
|
132
|
+
"name": "描述最大展示行",
|
|
133
|
+
"type": "number",
|
|
134
|
+
"default": 2
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"key": "renderDescribe",
|
|
138
|
+
"name": "描述内容",
|
|
139
|
+
"type": "_JSEditor",
|
|
140
|
+
"defaultCode": "function renderDescribe(record) { \n return record.describe; \n}",
|
|
141
|
+
"mustConfirm": true,
|
|
142
|
+
"wrapper": "collapse",
|
|
143
|
+
"wrapperProps": {
|
|
144
|
+
"suppressIcon": true
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"key": "renderContent",
|
|
149
|
+
"name": "自定义",
|
|
150
|
+
"type": "_JSEditor",
|
|
151
|
+
"defaultCode": "function renderContent(record) { \n return null; \n}",
|
|
152
|
+
"mustConfirm": true,
|
|
153
|
+
"wrapper": "collapse",
|
|
154
|
+
"wrapperProps": {
|
|
155
|
+
"suppressIcon": true
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
80
160
|
},
|
|
81
161
|
{
|
|
82
|
-
"key": "
|
|
83
|
-
"name": "
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
|
|
162
|
+
"key": "addCard",
|
|
163
|
+
"name": "新增卡片设置",
|
|
164
|
+
"type": "group",
|
|
165
|
+
"props": [
|
|
166
|
+
{
|
|
167
|
+
"key": "showAddCard",
|
|
168
|
+
"name": "展示新增卡片",
|
|
169
|
+
"type": "switch",
|
|
170
|
+
"default": false
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"key": "addCardHeight",
|
|
174
|
+
"name": "新增卡片高度",
|
|
175
|
+
"type": "number",
|
|
176
|
+
"default": 240
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"key": "addCardWords",
|
|
180
|
+
"name": "新增卡片内容",
|
|
181
|
+
"type": "string",
|
|
182
|
+
"default": "新建"
|
|
183
|
+
}
|
|
184
|
+
]
|
|
87
185
|
},
|
|
88
186
|
{
|
|
89
|
-
"key": "
|
|
90
|
-
"name": "
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
187
|
+
"key": "topSetting",
|
|
188
|
+
"name": "顶部操作",
|
|
189
|
+
"type": "group",
|
|
190
|
+
"default": true,
|
|
191
|
+
"next": {
|
|
192
|
+
"name": "顶部操作",
|
|
193
|
+
"props": [
|
|
194
|
+
{
|
|
195
|
+
"key": "topActionGroup",
|
|
196
|
+
"name": "顶部按钮组",
|
|
197
|
+
"type": "_ActionsEditor",
|
|
198
|
+
"default": {
|
|
199
|
+
"display": "button",
|
|
200
|
+
"max": 2,
|
|
201
|
+
"moreText": "操作",
|
|
202
|
+
"todoList": []
|
|
203
|
+
},
|
|
204
|
+
"defaultCode": "function todo() { \n \n}",
|
|
205
|
+
"wrapper": "collapse"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"key": "topFilter",
|
|
209
|
+
"name": "顶部过滤器",
|
|
210
|
+
"type": "_TableTopFilter",
|
|
211
|
+
"wrapper": "collapse"
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
}
|
|
94
215
|
},
|
|
95
216
|
{
|
|
96
|
-
"key": "
|
|
97
|
-
"name": "
|
|
98
|
-
"
|
|
99
|
-
"
|
|
217
|
+
"key": "batchOperations_group",
|
|
218
|
+
"name": "批量操作",
|
|
219
|
+
"type": "group",
|
|
220
|
+
"default": true,
|
|
221
|
+
"next": {
|
|
222
|
+
"name": "批量操作",
|
|
223
|
+
"props": [
|
|
224
|
+
{
|
|
225
|
+
"key": "rowSelection",
|
|
226
|
+
"name": "开启选择器",
|
|
227
|
+
"type": "switch",
|
|
228
|
+
"default": false
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"key": "disabledCheckbox",
|
|
232
|
+
"name": "不可选卡片",
|
|
233
|
+
"type": "_JSEditor",
|
|
234
|
+
"defaultCode": "function disabledCheckbox(record) { \n return false; \n}",
|
|
235
|
+
"mustConfirm": true,
|
|
236
|
+
"wrapper": "collapse",
|
|
237
|
+
"wrapperProps": {
|
|
238
|
+
"suppressIcon": true
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"key": "batchOperations",
|
|
243
|
+
"name": "卡片操作项",
|
|
244
|
+
"type": "_ActionsEditor",
|
|
245
|
+
"default": {
|
|
246
|
+
"todoList": []
|
|
247
|
+
},
|
|
248
|
+
"suppressDisplay": true,
|
|
249
|
+
"suppressMore": true,
|
|
250
|
+
"suppressMax": true,
|
|
251
|
+
"defaultCode": "function onActionClick(data, params) {\n\n}",
|
|
252
|
+
"wrapper": "collapse",
|
|
253
|
+
"wrapperProps": {
|
|
254
|
+
"suppressIcon": true
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
}
|
|
100
259
|
},
|
|
101
260
|
{
|
|
102
|
-
"key": "
|
|
103
|
-
"name": "
|
|
104
|
-
"
|
|
105
|
-
"
|
|
261
|
+
"key": "actionsColumn",
|
|
262
|
+
"name": "操作列",
|
|
263
|
+
"type": "group",
|
|
264
|
+
"default": true,
|
|
265
|
+
"next": {
|
|
266
|
+
"name": "操作列",
|
|
267
|
+
"props": [
|
|
268
|
+
{
|
|
269
|
+
"key": "suppressActions",
|
|
270
|
+
"name": "隐藏操作列",
|
|
271
|
+
"type": "switch",
|
|
272
|
+
"default": false
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"key": "actions",
|
|
276
|
+
"name": "卡片操作项",
|
|
277
|
+
"type": "_ActionsEditor",
|
|
278
|
+
"default": {
|
|
279
|
+
"max": 3,
|
|
280
|
+
"todoList": []
|
|
281
|
+
},
|
|
282
|
+
"suppressDisplay": true,
|
|
283
|
+
"suppressMore": true,
|
|
284
|
+
"suppressIcon": false,
|
|
285
|
+
"defaultCode": "function onActionClick(data, params) {\n\n}",
|
|
286
|
+
"wrapper": "collapse",
|
|
287
|
+
"wrapperProps": {
|
|
288
|
+
"suppressIcon": true
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
]
|
|
292
|
+
}
|
|
106
293
|
}
|
|
107
294
|
],
|
|
108
295
|
"advance": {
|
|
@@ -117,38 +304,32 @@
|
|
|
117
304
|
"key": "onUnmount",
|
|
118
305
|
"name": "组件卸载时",
|
|
119
306
|
"desc": "在组件卸载时,执行方法。",
|
|
120
|
-
"func": "(
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"key": "onBatchOperationsClick",
|
|
124
|
-
"name": "批量操作点击",
|
|
125
|
-
"desc": "点击操作的回调函数",
|
|
126
|
-
"func": "(key, selectedRows)=>{\n\t\n}"
|
|
307
|
+
"func": "()=>{\n\t\n}"
|
|
127
308
|
},
|
|
128
309
|
{
|
|
129
|
-
"key": "
|
|
130
|
-
"name": "
|
|
131
|
-
"desc": "
|
|
132
|
-
"func": "(
|
|
310
|
+
"key": "onAddCardClick",
|
|
311
|
+
"name": "新增卡片点击",
|
|
312
|
+
"desc": "点击新增卡片行时,执行方法",
|
|
313
|
+
"func": "()=>{\n\t\n}"
|
|
133
314
|
},
|
|
134
315
|
{
|
|
135
|
-
"key": "
|
|
136
|
-
"name": "
|
|
137
|
-
"desc": "
|
|
138
|
-
"func": "(
|
|
316
|
+
"key": "onCardClick",
|
|
317
|
+
"name": "卡片单击",
|
|
318
|
+
"desc": "单击卡片行时,执行方法",
|
|
319
|
+
"func": "(data, e)=>{\n\t\n}"
|
|
139
320
|
},
|
|
140
321
|
{
|
|
141
|
-
"key": "
|
|
142
|
-
"name": "
|
|
143
|
-
"desc": "
|
|
144
|
-
"func": "(data,
|
|
322
|
+
"key": "onCardDelete",
|
|
323
|
+
"name": "卡片删除",
|
|
324
|
+
"desc": "单击卡片删除图标,执行方法",
|
|
325
|
+
"func": "(data, e)=>{\n\t\n}"
|
|
145
326
|
},
|
|
146
327
|
{
|
|
147
|
-
"key": "
|
|
148
|
-
"name": "
|
|
149
|
-
"desc": "
|
|
150
|
-
"func": "(
|
|
328
|
+
"key": "onDrop",
|
|
329
|
+
"name": "拖拽事件",
|
|
330
|
+
"desc": "节点拖拽事件",
|
|
331
|
+
"func": "function onDrop(dragNodeProps, targetNodeProps, evt) {\n\t\n}"
|
|
151
332
|
}
|
|
152
333
|
]
|
|
153
334
|
}
|
|
154
|
-
}
|
|
335
|
+
}
|
|
@@ -9,7 +9,7 @@ import { Tree, Empty, Spin } from 'luck-design/antd';
|
|
|
9
9
|
import { isNil } from 'lodash';
|
|
10
10
|
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
11
11
|
import Wrapper from "../Wrapper";
|
|
12
|
-
import { noAuthReadAllBySkey } from '@luck-design-biz/base/sys/services';
|
|
12
|
+
import { noAuthReadAllBySkey } from '@luck-design-biz/base/lib/sys/services';
|
|
13
13
|
import { dataToTree } from '@luck-design-biz/base/utils';
|
|
14
14
|
import { omitBadProps, executeCode, findFirstLeafNode } from "../../../engine/tools/helper";
|
|
15
15
|
import defaultMeta from "../../../engine/meta/tree.props.default.json";
|
|
@@ -1,12 +1,36 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
1
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
var _excluded = ["id"];
|
|
4
|
+
var _excluded = ["id", "path", "css", "supportFullScreen"];
|
|
3
5
|
import React, { useRef } from 'react';
|
|
4
|
-
import { useMemoizedFn } from 'ahooks';
|
|
6
|
+
import { useMemoizedFn, useFullscreen, useHover } from 'ahooks';
|
|
7
|
+
import { Icon, Tooltip } from 'luck-design/antd';
|
|
8
|
+
import styled from 'styled-components';
|
|
5
9
|
import Wrapper from "../Wrapper";
|
|
6
|
-
|
|
10
|
+
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
11
|
+
import { RUNTIME } from "../../../constants";
|
|
12
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
13
|
+
var StyledIframe = styled.iframe.withConfig({
|
|
14
|
+
displayName: "StyledIframe",
|
|
15
|
+
componentId: "luckda-6530__sc-82q9mj-0"
|
|
16
|
+
})(["border:none;", ""], function (props) {
|
|
17
|
+
return props.$css;
|
|
18
|
+
});
|
|
19
|
+
var LCIframe = function LCIframe(_ref) {
|
|
7
20
|
var id = _ref.id,
|
|
21
|
+
path = _ref.path,
|
|
22
|
+
css = _ref.css,
|
|
23
|
+
supportFullScreen = _ref.supportFullScreen,
|
|
8
24
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
9
25
|
var ref = useRef();
|
|
26
|
+
var parentRef = useRef();
|
|
27
|
+
var isHovering = useHover(parentRef);
|
|
28
|
+
var _useFullscreen = useFullscreen(ref, {
|
|
29
|
+
pageFullscreen: true
|
|
30
|
+
}),
|
|
31
|
+
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
32
|
+
isFullscreen = _useFullscreen2[0],
|
|
33
|
+
toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
|
|
10
34
|
var getTargetDom = useMemoizedFn(function () {
|
|
11
35
|
return ref.current;
|
|
12
36
|
});
|
|
@@ -15,7 +39,34 @@ var LCIfram = function LCIfram(_ref) {
|
|
|
15
39
|
displayName: "Iframe",
|
|
16
40
|
getTargetDom: getTargetDom
|
|
17
41
|
}, /*#__PURE__*/React.createElement("div", {
|
|
18
|
-
|
|
19
|
-
|
|
42
|
+
style: {
|
|
43
|
+
position: !isFullscreen ? 'relative' : 'static',
|
|
44
|
+
width: '100%',
|
|
45
|
+
height: '100%'
|
|
46
|
+
},
|
|
47
|
+
ref: parentRef
|
|
48
|
+
}, supportFullScreen && isHovering && /*#__PURE__*/React.createElement(Tooltip, {
|
|
49
|
+
title: isFullscreen ? formatMessage({
|
|
50
|
+
id: 'luckda.lowcode.painter.components.fullscreen-exit.tip',
|
|
51
|
+
label: '退出全屏'
|
|
52
|
+
}) : formatMessage({
|
|
53
|
+
id: 'luckda.lowcode.painter.components.fullscreen.tip',
|
|
54
|
+
label: '全屏'
|
|
55
|
+
})
|
|
56
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
57
|
+
type: isFullscreen ? 'fullscreen-exit' : 'fullscreen',
|
|
58
|
+
style: {
|
|
59
|
+
fontSize: 20,
|
|
60
|
+
position: isFullscreen ? 'fixed' : 'absolute',
|
|
61
|
+
top: 15,
|
|
62
|
+
right: 20,
|
|
63
|
+
zIndex: 9999999
|
|
64
|
+
},
|
|
65
|
+
onClick: toggleFullscreen
|
|
66
|
+
})), /*#__PURE__*/React.createElement(StyledIframe, _extends({}, props, {
|
|
67
|
+
ref: ref,
|
|
68
|
+
src: path,
|
|
69
|
+
$css: css
|
|
70
|
+
}))));
|
|
20
71
|
};
|
|
21
|
-
export default
|
|
72
|
+
export default LCIframe;
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
"icon": "icon-iframe",
|
|
6
6
|
"group": "basic",
|
|
7
7
|
"groupName": "基础",
|
|
8
|
-
"hidden": true,
|
|
9
8
|
"order": 1,
|
|
10
9
|
"props": [
|
|
11
10
|
{
|
|
@@ -24,10 +23,10 @@
|
|
|
24
23
|
"key": "supportFullScreen",
|
|
25
24
|
"name": "支持全屏",
|
|
26
25
|
"desc": "是否支持全屏展示",
|
|
27
|
-
"type": "
|
|
26
|
+
"type": "switch",
|
|
28
27
|
"default": true
|
|
29
28
|
}
|
|
30
29
|
],
|
|
31
|
-
"css": "",
|
|
30
|
+
"css": "background: white; width: 100%; height: 100%",
|
|
32
31
|
"advance": {}
|
|
33
32
|
}
|
|
@@ -1,12 +1,44 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
1
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
var _excluded = ["id"];
|
|
4
|
+
var _excluded = ["id", "src", "css"];
|
|
3
5
|
import React, { useRef } from 'react';
|
|
4
|
-
import { useMemoizedFn } from 'ahooks';
|
|
6
|
+
import { useHover, useMemoizedFn, useSetState } from 'ahooks';
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { ImgPreview } from 'luck-design';
|
|
5
9
|
import Wrapper from "../Wrapper";
|
|
10
|
+
import styles from "./index.less";
|
|
11
|
+
import { Icon } from 'luck-design/antd';
|
|
12
|
+
var StyledImage = styled.img.withConfig({
|
|
13
|
+
displayName: "StyledImage",
|
|
14
|
+
componentId: "luckda-6530__sc-k6wbym-0"
|
|
15
|
+
})(["width:", ";height:", ";object-fit:", ";cursor:", ";border-radius:", ";", ""], function (props) {
|
|
16
|
+
return props.autoWidth ? 'auto' : "".concat(props.width, "px");
|
|
17
|
+
}, function (props) {
|
|
18
|
+
return props.autoHeight ? 'auto' : "".concat(props.height, "px");
|
|
19
|
+
}, function (props) {
|
|
20
|
+
return props.fit;
|
|
21
|
+
}, function (props) {
|
|
22
|
+
return props.preview && 'pointer';
|
|
23
|
+
}, function (props) {
|
|
24
|
+
return props.roundRadios || "".concat(props.borderRadios, "px");
|
|
25
|
+
}, function (props) {
|
|
26
|
+
return props.$css;
|
|
27
|
+
});
|
|
6
28
|
var LCImage = function LCImage(_ref) {
|
|
7
29
|
var id = _ref.id,
|
|
30
|
+
src = _ref.src,
|
|
31
|
+
css = _ref.css,
|
|
8
32
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
9
33
|
var ref = useRef();
|
|
34
|
+
var isHovering = useHover(ref);
|
|
35
|
+
var _useSetState = useSetState({
|
|
36
|
+
visible: false,
|
|
37
|
+
images: []
|
|
38
|
+
}),
|
|
39
|
+
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
40
|
+
state = _useSetState2[0],
|
|
41
|
+
setState = _useSetState2[1];
|
|
10
42
|
var getTargetDom = useMemoizedFn(function () {
|
|
11
43
|
return ref.current;
|
|
12
44
|
});
|
|
@@ -14,8 +46,32 @@ var LCImage = function LCImage(_ref) {
|
|
|
14
46
|
id: id,
|
|
15
47
|
displayName: "Image",
|
|
16
48
|
getTargetDom: getTargetDom
|
|
17
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
18
|
-
|
|
19
|
-
|
|
49
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
className: props.preview && styles['lc-component-image'],
|
|
51
|
+
ref: ref,
|
|
52
|
+
onClick: props.preview ? function () {
|
|
53
|
+
return setState({
|
|
54
|
+
visible: true,
|
|
55
|
+
images: [{
|
|
56
|
+
src: src
|
|
57
|
+
}]
|
|
58
|
+
});
|
|
59
|
+
} : {}
|
|
60
|
+
}, /*#__PURE__*/React.createElement(StyledImage, _extends({
|
|
61
|
+
src: src,
|
|
62
|
+
$css: css
|
|
63
|
+
}, props)), props.preview && isHovering && /*#__PURE__*/React.createElement(Icon, {
|
|
64
|
+
type: "search",
|
|
65
|
+
className: styles.search
|
|
66
|
+
})), /*#__PURE__*/React.createElement(ImgPreview, {
|
|
67
|
+
visible: state.visible,
|
|
68
|
+
images: state.images,
|
|
69
|
+
activeIndex: 0,
|
|
70
|
+
onClose: function onClose() {
|
|
71
|
+
return setState({
|
|
72
|
+
visible: false
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
})));
|
|
20
76
|
};
|
|
21
77
|
export default LCImage;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.lc-component-image {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: fit-content;
|
|
4
|
+
cursor: pointer;
|
|
5
|
+
|
|
6
|
+
.search {
|
|
7
|
+
position: absolute;
|
|
8
|
+
left: 50%;
|
|
9
|
+
top: 50%;
|
|
10
|
+
transform: translate(-50%, -50%);
|
|
11
|
+
color: white;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&:hover {
|
|
15
|
+
&::before {
|
|
16
|
+
content: '';
|
|
17
|
+
position: absolute;
|
|
18
|
+
left: 50%;
|
|
19
|
+
top: 50%;
|
|
20
|
+
margin: -16px 0 0 -16px;
|
|
21
|
+
width: 32px;
|
|
22
|
+
height: 32px;
|
|
23
|
+
background-color: rgba(51, 51, 51, 0.6);
|
|
24
|
+
border-radius: 16px 16px;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|