linkmore-design 1.1.16 → 1.1.17
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/CHANGELOG.md +44 -10
- package/dist/ConfigProvider/context.d.ts +1 -0
- package/dist/Form/demos/responsive.d.ts +0 -1
- package/dist/Form/interface.d.ts +2 -0
- package/dist/IconFont/demos/ConfigProvider.d.ts +2 -0
- package/dist/IconFont/index.d.ts +1 -2
- package/dist/index.umd.js +355 -232
- package/dist/index.umd.min.js +17 -17
- package/dist/variables.css +99 -55
- package/es/ConfigProvider/context.d.ts +1 -0
- package/es/ConfigProvider/index.js +5 -3
- package/es/Form/FormWrapper.js +3 -4
- package/es/Form/WrapperItem.js +138 -70
- package/es/Form/interface.d.ts +2 -0
- package/es/Form/style/index.css +26 -1
- package/es/Form/style/variables.css +26 -1
- package/es/IconFont/index.d.ts +1 -2
- package/es/IconFont/index.js +18 -4
- package/es/ImageViewer/components/Operate.js +4 -7
- package/es/LmFilter/components/DropdownFIlter.js +164 -119
- package/es/LmFilter/filterFns/index.js +4 -6
- package/es/LmFilter/style/index.css +73 -54
- package/es/LmFilter/style/variables.css +73 -54
- package/es/LmFilter/utils.js +6 -6
- package/es/LmUpload/UploadList/ItemText.js +5 -1
- package/es/styles/variables.css +99 -55
- package/lib/ConfigProvider/context.d.ts +1 -0
- package/lib/ConfigProvider/index.js +5 -3
- package/lib/Form/FormWrapper.js +3 -4
- package/lib/Form/WrapperItem.js +136 -69
- package/lib/Form/interface.d.ts +2 -0
- package/lib/Form/style/index.css +26 -1
- package/lib/Form/style/variables.css +26 -1
- package/lib/IconFont/index.d.ts +1 -2
- package/lib/IconFont/index.js +25 -4
- package/lib/ImageViewer/components/Operate.js +4 -8
- package/lib/LmFilter/components/DropdownFIlter.js +164 -119
- package/lib/LmFilter/filterFns/index.js +4 -6
- package/lib/LmFilter/style/index.css +73 -54
- package/lib/LmFilter/style/variables.css +73 -54
- package/lib/LmFilter/utils.js +6 -6
- package/lib/LmUpload/UploadList/ItemText.js +5 -1
- package/lib/styles/variables.css +99 -55
- package/package.json +1 -1
package/es/Form/WrapperItem.js
CHANGED
|
@@ -1,102 +1,166 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import React, { useEffect, useRef, useState, useMemo } from 'react';
|
|
4
4
|
import { throttle } from 'lodash';
|
|
5
5
|
import Row from '../Row';
|
|
6
|
-
import Col from '../Col';
|
|
6
|
+
import Col from '../Col';
|
|
7
|
+
|
|
8
|
+
var icon = require('./images/icon_collapse.svg'); // 行个数 => 在24份中占用的分数
|
|
9
|
+
|
|
7
10
|
|
|
8
11
|
var rowMap = new Map([[5, [4, 1]], [4, [5, 1]], [3, [7, 1]]]);
|
|
9
12
|
|
|
10
|
-
function
|
|
11
|
-
var
|
|
13
|
+
var Title = function Title(props) {
|
|
14
|
+
var title = props.title,
|
|
15
|
+
onToggle = props.onToggle;
|
|
16
|
+
|
|
17
|
+
var _useState = useState(true),
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
+
visible = _useState2[0],
|
|
20
|
+
setVisible = _useState2[1];
|
|
21
|
+
|
|
22
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
className: "form_responsive_group_title",
|
|
24
|
+
onClick: function onClick() {
|
|
25
|
+
setVisible(!visible);
|
|
26
|
+
onToggle && onToggle(!visible);
|
|
27
|
+
}
|
|
28
|
+
}, /*#__PURE__*/React.createElement("h3", null, title), /*#__PURE__*/React.createElement("img", {
|
|
29
|
+
src: icon,
|
|
30
|
+
className: !visible ? 'open' : '',
|
|
31
|
+
alt: ""
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
var List = function List(props) {
|
|
36
|
+
var customizeChildren = props.children,
|
|
37
|
+
countPerRow = props.countPerRow,
|
|
38
|
+
title = props.title,
|
|
39
|
+
user = props.user;
|
|
12
40
|
|
|
13
41
|
var _rowMap$get = rowMap.get(countPerRow),
|
|
14
42
|
_rowMap$get2 = _slicedToArray(_rowMap$get, 2),
|
|
15
43
|
colSpan = _rowMap$get2[0],
|
|
16
|
-
colSpace = _rowMap$get2[1];
|
|
44
|
+
colSpace = _rowMap$get2[1];
|
|
17
45
|
|
|
46
|
+
var _useState3 = useState(true),
|
|
47
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
48
|
+
visible = _useState4[0],
|
|
49
|
+
setVisible = _useState4[1]; // 最终的结果
|
|
18
50
|
|
|
19
|
-
var collection = []; // 最终的结果
|
|
20
51
|
|
|
21
|
-
var
|
|
22
|
-
|
|
52
|
+
var rowlist = useMemo(function () {
|
|
53
|
+
var _a;
|
|
23
54
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
55
|
+
var children = []; // 收集(满了就重置)
|
|
56
|
+
|
|
57
|
+
var collection = [];
|
|
58
|
+
var result = [];
|
|
59
|
+
|
|
60
|
+
if (!Array.isArray(customizeChildren)) {
|
|
61
|
+
children = [customizeChildren];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
children = Array.prototype.slice.call(customizeChildren).flat();
|
|
65
|
+
|
|
66
|
+
if (user) {
|
|
67
|
+
result.push( /*#__PURE__*/React.createElement(Title, {
|
|
68
|
+
title: title,
|
|
69
|
+
onToggle: function onToggle(value) {
|
|
70
|
+
setVisible(value);
|
|
71
|
+
}
|
|
72
|
+
}));
|
|
73
|
+
} // 一行
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
function generatorRow() {
|
|
77
|
+
var node = /*#__PURE__*/React.createElement(Row, null, collection.map(function (child, index) {
|
|
78
|
+
if (index !== collection.length - 1) {
|
|
79
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
80
|
+
key: index
|
|
81
|
+
}, /*#__PURE__*/React.createElement(Col, {
|
|
82
|
+
span: colSpan
|
|
83
|
+
}, child), /*#__PURE__*/React.createElement(Col, {
|
|
84
|
+
span: colSpace
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return /*#__PURE__*/React.createElement(Col, {
|
|
89
|
+
span: colSpan,
|
|
28
90
|
key: index
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
91
|
+
}, child);
|
|
92
|
+
}));
|
|
93
|
+
result.push(node);
|
|
94
|
+
collection.length = 0;
|
|
95
|
+
}
|
|
35
96
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
key: index
|
|
39
|
-
}, child);
|
|
40
|
-
}));
|
|
41
|
-
result.push(node);
|
|
42
|
-
collection.length = 0;
|
|
43
|
-
}
|
|
97
|
+
for (var i = 0; i < children.length; i += 1) {
|
|
98
|
+
var child = children[i]; // 过滤掉React.Fragment
|
|
44
99
|
|
|
45
|
-
|
|
46
|
-
|
|
100
|
+
while (child.type === Symbol.for('react.fragment')) {
|
|
101
|
+
if (Array.isArray(child.props.children)) {
|
|
102
|
+
var _children;
|
|
47
103
|
|
|
48
|
-
|
|
49
|
-
if (Array.isArray(child.props.children)) {
|
|
50
|
-
var _children;
|
|
104
|
+
(_children = children).splice.apply(_children, [i, 1].concat(_toConsumableArray(child.props.children)));
|
|
51
105
|
|
|
52
|
-
|
|
106
|
+
child = children[i];
|
|
107
|
+
} else {
|
|
108
|
+
child = child.props.children;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
53
111
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
112
|
+
if (child) {
|
|
113
|
+
if ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.responsive) {
|
|
114
|
+
collection.push(child);
|
|
115
|
+
|
|
116
|
+
if (collection.length && collection.length === countPerRow) {
|
|
117
|
+
generatorRow();
|
|
118
|
+
}
|
|
119
|
+
} else if (collection.length) {
|
|
120
|
+
generatorRow();
|
|
121
|
+
result.push(child);
|
|
122
|
+
} else {
|
|
123
|
+
result.push(child);
|
|
124
|
+
}
|
|
57
125
|
}
|
|
58
126
|
}
|
|
59
127
|
|
|
60
|
-
if (
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (collection.length && collection.length === countPerRow) {
|
|
64
|
-
handle();
|
|
65
|
-
}
|
|
66
|
-
} else if (collection.length) {
|
|
67
|
-
handle();
|
|
68
|
-
result.push(child);
|
|
69
|
-
} else {
|
|
70
|
-
result.push(child);
|
|
128
|
+
if (collection.length) {
|
|
129
|
+
generatorRow();
|
|
71
130
|
}
|
|
72
|
-
}
|
|
73
131
|
|
|
74
|
-
|
|
75
|
-
|
|
132
|
+
return result;
|
|
133
|
+
}, [customizeChildren, countPerRow, user, title]);
|
|
134
|
+
var needRenderList = rowlist;
|
|
135
|
+
|
|
136
|
+
if (!visible && needRenderList.length) {
|
|
137
|
+
needRenderList = [needRenderList[0]];
|
|
76
138
|
}
|
|
77
139
|
|
|
78
|
-
return
|
|
79
|
-
|
|
140
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, needRenderList.map(function (child, index) {
|
|
141
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
142
|
+
key: index
|
|
143
|
+
}, child);
|
|
144
|
+
}));
|
|
145
|
+
};
|
|
80
146
|
|
|
81
147
|
var WrapperItem = function WrapperItem(props) {
|
|
82
|
-
var
|
|
148
|
+
var user = props.user;
|
|
83
149
|
var targetRef = useRef(null);
|
|
84
150
|
|
|
85
|
-
var
|
|
151
|
+
var _useState5 = useState({
|
|
86
152
|
width: '100%',
|
|
87
153
|
height: '100%'
|
|
88
154
|
}),
|
|
89
|
-
|
|
90
|
-
containerSize =
|
|
91
|
-
setContainerSize =
|
|
92
|
-
|
|
155
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
156
|
+
containerSize = _useState6[0],
|
|
157
|
+
setContainerSize = _useState6[1]; // 每行的个数
|
|
93
158
|
|
|
94
|
-
var _useState3 = useState(5),
|
|
95
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
96
|
-
countPerRow = _useState4[0],
|
|
97
|
-
setCountPerRow = _useState4[1];
|
|
98
159
|
|
|
99
|
-
var
|
|
160
|
+
var _useState7 = useState(5),
|
|
161
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
162
|
+
countPerRow = _useState8[0],
|
|
163
|
+
setCountPerRow = _useState8[1];
|
|
100
164
|
|
|
101
165
|
var changeSize = function changeSize() {
|
|
102
166
|
var _a;
|
|
@@ -115,12 +179,18 @@ var WrapperItem = function WrapperItem(props) {
|
|
|
115
179
|
setCountPerRow(5);
|
|
116
180
|
}
|
|
117
181
|
|
|
118
|
-
if (width !== '100%'
|
|
119
|
-
width
|
|
182
|
+
if (width !== '100%') {
|
|
183
|
+
width -= 32;
|
|
184
|
+
|
|
185
|
+
if (width > maxWidth) {
|
|
186
|
+
if (user) {
|
|
187
|
+
width = maxWidth - 64;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
120
190
|
}
|
|
121
191
|
|
|
122
192
|
setContainerSize({
|
|
123
|
-
width: width
|
|
193
|
+
width: width
|
|
124
194
|
});
|
|
125
195
|
};
|
|
126
196
|
|
|
@@ -139,11 +209,9 @@ var WrapperItem = function WrapperItem(props) {
|
|
|
139
209
|
style: Object.assign(Object.assign({}, containerSize), {
|
|
140
210
|
margin: '0 auto'
|
|
141
211
|
})
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}, child);
|
|
146
|
-
}))));
|
|
212
|
+
}, /*#__PURE__*/React.createElement(List, Object.assign({}, props, {
|
|
213
|
+
countPerRow: countPerRow
|
|
214
|
+
})))));
|
|
147
215
|
};
|
|
148
216
|
|
|
149
217
|
export default WrapperItem;
|
package/es/Form/interface.d.ts
CHANGED
package/es/Form/style/index.css
CHANGED
|
@@ -6617,20 +6617,45 @@ p {
|
|
|
6617
6617
|
background: #f0f0f0;
|
|
6618
6618
|
}
|
|
6619
6619
|
.lm_form_responsive_box .lm_form > .lm_container_wrapper {
|
|
6620
|
-
padding: 16px;
|
|
6621
6620
|
background: #f0f0f0;
|
|
6622
6621
|
margin-bottom: 0;
|
|
6623
6622
|
border-radius: 0;
|
|
6623
|
+
padding: 16px;
|
|
6624
6624
|
}
|
|
6625
6625
|
.lm_container_wrapper {
|
|
6626
6626
|
overflow: auto;
|
|
6627
6627
|
background: #fff;
|
|
6628
6628
|
margin-bottom: 16px;
|
|
6629
6629
|
border-radius: 2px;
|
|
6630
|
+
padding: 0;
|
|
6630
6631
|
}
|
|
6631
6632
|
.lm_container_wrapper .ant-cascader {
|
|
6632
6633
|
width: 100%;
|
|
6633
6634
|
}
|
|
6635
|
+
.form_responsive_group_title {
|
|
6636
|
+
display: flex;
|
|
6637
|
+
font-size: 14px;
|
|
6638
|
+
line-height: 22px;
|
|
6639
|
+
margin: 0;
|
|
6640
|
+
padding-top: 16px;
|
|
6641
|
+
color: var(--color-85);
|
|
6642
|
+
flex-basis: 100%;
|
|
6643
|
+
align-items: center;
|
|
6644
|
+
}
|
|
6645
|
+
.form_responsive_group_title h3 {
|
|
6646
|
+
flex: 1;
|
|
6647
|
+
font-weight: medium;
|
|
6648
|
+
font-size: 14px;
|
|
6649
|
+
}
|
|
6650
|
+
.form_responsive_group_title img {
|
|
6651
|
+
cursor: pointer;
|
|
6652
|
+
width: 16px;
|
|
6653
|
+
height: 16px;
|
|
6654
|
+
transition: transform 0.24s;
|
|
6655
|
+
}
|
|
6656
|
+
.form_responsive_group_title img.open {
|
|
6657
|
+
transform: rotate(180deg);
|
|
6658
|
+
}
|
|
6634
6659
|
.lm_form-item-tip-error .ant-form-item-explain {
|
|
6635
6660
|
width: 100%;
|
|
6636
6661
|
position: absolute;
|
|
@@ -6105,20 +6105,45 @@
|
|
|
6105
6105
|
background: #f0f0f0;
|
|
6106
6106
|
}
|
|
6107
6107
|
.lm_form_responsive_box .lm_form > .lm_container_wrapper {
|
|
6108
|
-
padding: 16px;
|
|
6109
6108
|
background: #f0f0f0;
|
|
6110
6109
|
margin-bottom: 0;
|
|
6111
6110
|
border-radius: 0;
|
|
6111
|
+
padding: 16px;
|
|
6112
6112
|
}
|
|
6113
6113
|
.lm_container_wrapper {
|
|
6114
6114
|
overflow: auto;
|
|
6115
6115
|
background: #fff;
|
|
6116
6116
|
margin-bottom: 16px;
|
|
6117
6117
|
border-radius: 2px;
|
|
6118
|
+
padding: 0;
|
|
6118
6119
|
}
|
|
6119
6120
|
.lm_container_wrapper .ant-cascader {
|
|
6120
6121
|
width: 100%;
|
|
6121
6122
|
}
|
|
6123
|
+
.form_responsive_group_title {
|
|
6124
|
+
display: flex;
|
|
6125
|
+
font-size: 14px;
|
|
6126
|
+
line-height: 22px;
|
|
6127
|
+
margin: 0;
|
|
6128
|
+
padding-top: 16px;
|
|
6129
|
+
color: var(--color-85);
|
|
6130
|
+
flex-basis: 100%;
|
|
6131
|
+
align-items: center;
|
|
6132
|
+
}
|
|
6133
|
+
.form_responsive_group_title h3 {
|
|
6134
|
+
flex: 1;
|
|
6135
|
+
font-weight: medium;
|
|
6136
|
+
font-size: 14px;
|
|
6137
|
+
}
|
|
6138
|
+
.form_responsive_group_title img {
|
|
6139
|
+
cursor: pointer;
|
|
6140
|
+
width: 16px;
|
|
6141
|
+
height: 16px;
|
|
6142
|
+
transition: transform 0.24s;
|
|
6143
|
+
}
|
|
6144
|
+
.form_responsive_group_title img.open {
|
|
6145
|
+
transform: rotate(180deg);
|
|
6146
|
+
}
|
|
6122
6147
|
.lm_form-item-tip-error .ant-form-item-explain {
|
|
6123
6148
|
width: 100%;
|
|
6124
6149
|
position: absolute;
|
package/es/IconFont/index.d.ts
CHANGED
package/es/IconFont/index.js
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
1
3
|
import { createFromIconfontCN } from '@ant-design/icons';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
import ConfigProvider from '../ConfigProvider';
|
|
5
|
+
var ConfigContext = ConfigProvider.ConfigContext;
|
|
6
|
+
|
|
7
|
+
var IconFont = function IconFont(props) {
|
|
8
|
+
var _React$useContext = React.useContext(ConfigContext),
|
|
9
|
+
iconUrl = _React$useContext.iconUrl;
|
|
10
|
+
|
|
11
|
+
var resetUrl = useMemo(function () {
|
|
12
|
+
if (!iconUrl) return [];
|
|
13
|
+
return Array.isArray(iconUrl) ? iconUrl : [iconUrl];
|
|
14
|
+
}, [iconUrl]);
|
|
15
|
+
var Component = createFromIconfontCN({
|
|
16
|
+
scriptUrl: ['//at.alicdn.com/t/c/font_2966019_ac9pzkeuo0e.js'].concat(_toConsumableArray(resetUrl))
|
|
17
|
+
});
|
|
18
|
+
return /*#__PURE__*/React.createElement(Component, Object.assign({}, props));
|
|
19
|
+
};
|
|
5
20
|
|
|
6
|
-
});
|
|
7
21
|
export default IconFont;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IconFont } from 'linkmore-design';
|
|
3
|
-
import { ZoomOutOutlined } from '@ant-design/icons';
|
|
4
3
|
|
|
5
4
|
var Operate = function Operate(_ref) {
|
|
6
5
|
var instance = _ref.instance;
|
|
@@ -20,20 +19,18 @@ var Operate = function Operate(_ref) {
|
|
|
20
19
|
onClick: function onClick(e) {
|
|
21
20
|
return handleTranform(e, 'zoomIn');
|
|
22
21
|
}
|
|
23
|
-
}), /*#__PURE__*/React.createElement(
|
|
22
|
+
}), /*#__PURE__*/React.createElement(IconFont, {
|
|
23
|
+
type: "lmweb-icon_m_narrow",
|
|
24
24
|
onClick: function onClick(e) {
|
|
25
25
|
return handleTranform(e, 'zoomOut');
|
|
26
|
-
},
|
|
27
|
-
style: {
|
|
28
|
-
fontSize: 22
|
|
29
26
|
}
|
|
30
27
|
}), /*#__PURE__*/React.createElement(IconFont, {
|
|
31
|
-
type: "lmweb-
|
|
28
|
+
type: "lmweb-icon_m_turnleft-01",
|
|
32
29
|
onClick: function onClick(e) {
|
|
33
30
|
return handleTranform(e, 'rotateLeft');
|
|
34
31
|
}
|
|
35
32
|
}), /*#__PURE__*/React.createElement(IconFont, {
|
|
36
|
-
type: "lmweb-
|
|
33
|
+
type: "lmweb-reload",
|
|
37
34
|
onClick: function onClick(e) {
|
|
38
35
|
return handleTranform(e, 'rotateRight');
|
|
39
36
|
}
|