@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.
Files changed (65) hide show
  1. package/es/components/LdCard/index.js +147 -67
  2. package/es/components/LdTree/index.less +2 -0
  3. package/es/locales/zh-CN.js +4 -2
  4. package/es/lowcode/engine/meta/cardlist.props.default.json +27 -7
  5. package/es/lowcode/engine/meta/cardlist.props.json +252 -71
  6. package/es/lowcode/engine/meta/components-list.json +24 -0
  7. package/es/lowcode/engine/meta/iframe.props.default.json +1 -2
  8. package/es/lowcode/engine/meta/iframe.props.json +2 -3
  9. package/es/lowcode/engine/meta/image.props.default.json +3 -3
  10. package/es/lowcode/engine/meta/image.props.json +49 -15
  11. package/es/lowcode/engine/meta/js-editor/auto-complete.json +14 -1
  12. package/es/lowcode/engine/meta/link.props.default.json +1 -2
  13. package/es/lowcode/engine/meta/link.props.json +8 -9
  14. package/es/lowcode/painter/Ribbon.js +12 -0
  15. package/es/lowcode/painter/components/code-editor/BaseEditor.js +2 -1
  16. package/es/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +20 -2
  17. package/es/lowcode/painter/panel-section/ActionsEditor/index.js +18 -3
  18. package/es/lowcode/painter/panel-section/GroupClassSelector.js +1 -1
  19. package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +1 -0
  20. package/es/lowcode/painter/panel-section/TableTopFilter.js +3 -3
  21. package/es/lowcode/view/lc-components/CardList/index.js +476 -12
  22. package/es/lowcode/view/lc-components/CardList/meta.json +253 -72
  23. package/es/lowcode/view/lc-components/GroupTree/index.js +1 -1
  24. package/es/lowcode/view/lc-components/Iframe/index.js +57 -6
  25. package/es/lowcode/view/lc-components/Iframe/meta.json +2 -3
  26. package/es/lowcode/view/lc-components/Image/index.js +61 -5
  27. package/es/lowcode/view/lc-components/Image/index.less +27 -0
  28. package/es/lowcode/view/lc-components/Image/meta.json +49 -15
  29. package/es/lowcode/view/lc-components/Link/index.js +34 -4
  30. package/es/lowcode/view/lc-components/Link/index.less +15 -0
  31. package/es/lowcode/view/lc-components/Link/meta.json +8 -9
  32. package/es/lowcode/view/lc-components/Table/index.js +2 -2
  33. package/lib/components/LdCard/index.js +146 -66
  34. package/lib/components/LdTree/index.less +2 -0
  35. package/lib/locales/zh-CN.js +4 -2
  36. package/lib/lowcode/engine/meta/cardlist.props.default.json +27 -7
  37. package/lib/lowcode/engine/meta/cardlist.props.json +252 -71
  38. package/lib/lowcode/engine/meta/components-list.json +24 -0
  39. package/lib/lowcode/engine/meta/iframe.props.default.json +1 -2
  40. package/lib/lowcode/engine/meta/iframe.props.json +2 -3
  41. package/lib/lowcode/engine/meta/image.props.default.json +3 -3
  42. package/lib/lowcode/engine/meta/image.props.json +49 -15
  43. package/lib/lowcode/engine/meta/js-editor/auto-complete.json +14 -1
  44. package/lib/lowcode/engine/meta/link.props.default.json +1 -2
  45. package/lib/lowcode/engine/meta/link.props.json +8 -9
  46. package/lib/lowcode/painter/Ribbon.js +12 -0
  47. package/lib/lowcode/painter/components/code-editor/BaseEditor.js +2 -1
  48. package/lib/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +19 -1
  49. package/lib/lowcode/painter/panel-section/ActionsEditor/index.js +18 -3
  50. package/lib/lowcode/painter/panel-section/GroupClassSelector.js +1 -1
  51. package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +1 -0
  52. package/lib/lowcode/painter/panel-section/TableTopFilter.js +3 -3
  53. package/lib/lowcode/view/lc-components/CardList/index.js +475 -11
  54. package/lib/lowcode/view/lc-components/CardList/meta.json +253 -72
  55. package/lib/lowcode/view/lc-components/GroupTree/index.js +1 -1
  56. package/lib/lowcode/view/lc-components/Iframe/index.js +56 -5
  57. package/lib/lowcode/view/lc-components/Iframe/meta.json +2 -3
  58. package/lib/lowcode/view/lc-components/Image/index.js +60 -4
  59. package/lib/lowcode/view/lc-components/Image/index.less +27 -0
  60. package/lib/lowcode/view/lc-components/Image/meta.json +49 -15
  61. package/lib/lowcode/view/lc-components/Link/index.js +34 -4
  62. package/lib/lowcode/view/lc-components/Link/index.less +15 -0
  63. package/lib/lowcode/view/lc-components/Link/meta.json +8 -9
  64. package/lib/lowcode/view/lc-components/Table/index.js +2 -2
  65. 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": "boolean",
36
+ "type": "switch",
38
37
  "default": true
39
38
  },
40
39
  {
41
40
  "key": "readOnly",
42
- "name": "是否只读",
43
- "desc": "卡片列表是否只读",
44
- "type": "boolean",
41
+ "name": "只读",
42
+ "type": "switch",
45
43
  "default": false
46
44
  },
47
45
  {
48
- "key": "isFlow",
49
- "name": "是否流式",
50
- "desc": "是否流式(不分页)",
51
- "type": "boolean",
46
+ "key": "draggable",
47
+ "name": "拖拽排序",
48
+ "type": "switch",
52
49
  "default": false
53
50
  },
54
51
  {
55
- "key": "defaultPageSize",
56
- "name": "默认分页数",
57
- "desc": "isFlow为false时设置,默认单页分页数",
52
+ "key": "col",
53
+ "name": "列数",
58
54
  "type": "number",
59
- "default": 30
55
+ "default": 4
60
56
  },
61
57
  {
62
- "key": "batchOperations",
63
- "name": "批量操作",
64
- "desc": "批量操作配置",
65
- "type": "_CardListActionSelector"
66
- },
67
- {
68
- "key": "actionTitle",
69
- "name": "操作列标题",
70
- "desc": "操作列的标题",
71
- "type": "_I18nInput",
72
- "default": "操作列"
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": "actionWidth",
76
- "name": "操作列宽度",
77
- "desc": "操作列宽度设置",
78
- "type": "number",
79
- "default": 100
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": "actionHidden",
83
- "name": "操作列是否隐藏",
84
- "desc": "操作列是否隐藏",
85
- "type": "boolean",
86
- "default": false
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": "maxWebShownActionCount",
90
- "name": "操作列最大展示数",
91
- "desc": "操作列最大展示数,超出最大数变为最大展示数-1+更多",
92
- "type": "number",
93
- "default": 2
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": "actions",
97
- "name": "操作项",
98
- "desc": "单行操作项",
99
- "type": "_ActionSelector"
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": "batchActions",
103
- "name": "批量操作项",
104
- "desc": "批量操作项",
105
- "type": "_ActionSelector"
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": "(params)=>{\n\t\n}"
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": "onActionClick",
130
- "name": "操作列点击",
131
- "desc": "点击操作的回调函数",
132
- "func": "(itemData)=>{\n\t\n}"
310
+ "key": "onAddCardClick",
311
+ "name": "新增卡片点击",
312
+ "desc": "点击新增卡片行时,执行方法",
313
+ "func": "()=>{\n\t\n}"
133
314
  },
134
315
  {
135
- "key": "actionRender",
136
- "name": "操作列定制渲染",
137
- "desc": "返回为false时,该操作不可见",
138
- "func": "(title, rowData)=>{\n\t\n}"
316
+ "key": "onCardClick",
317
+ "name": "卡片单击",
318
+ "desc": "单击卡片行时,执行方法",
319
+ "func": "(data, e)=>{\n\t\n}"
139
320
  },
140
321
  {
141
- "key": "onRowClick",
142
- "name": "行单击",
143
- "desc": "单击表格行时,执行方法",
144
- "func": "(data, rowIndex, params)=>{\n\t\n}"
322
+ "key": "onCardDelete",
323
+ "name": "卡片删除",
324
+ "desc": "单击卡片删除图标,执行方法",
325
+ "func": "(data, e)=>{\n\t\n}"
145
326
  },
146
327
  {
147
- "key": "onCardRender",
148
- "name": "操作列点击",
149
- "desc": "点击操作的回调函数",
150
- "func": "(itemData)=>{\n\t\n}"
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
- var LCIfram = function LCIfram(_ref) {
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
- ref: ref
19
- }, "LCIfram"));
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 LCIfram;
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": "boolean",
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
- ref: ref
19
- }, "LCImage"));
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
+ }