linkmore-design 1.1.13-alpha.2 → 1.1.13-alpha.4
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/Descriptions/index.d.ts +1 -1
- package/dist/Form/FormWrapper.d.ts +3 -0
- package/dist/Form/WrapperItem.d.ts +4 -0
- package/dist/Form/demos/responsive.d.ts +0 -1
- package/dist/Form/index.d.ts +2 -0
- package/dist/Form/interface.d.ts +12 -0
- package/dist/IconFont/demos/ConfigProvider.d.ts +2 -0
- package/dist/IconFont/index.d.ts +1 -2
- package/dist/LmTable/demos/summuy.d.ts +2 -0
- package/dist/QuickMenu/demos/useInDraw.d.ts +2 -0
- package/dist/QuickMenu/index.d.ts +1 -0
- package/dist/TreeSelect/demos/treedata.d.ts +3 -0
- package/dist/index.umd.js +1271 -1039
- package/dist/index.umd.min.js +17 -17
- package/dist/variables.css +162 -98
- package/es/Cascader/index.js +16 -2
- package/es/Cascader/style/index.css +1 -0
- package/es/Cascader/style/variables.css +1 -0
- package/es/ConfigProvider/context.d.ts +1 -0
- package/es/ConfigProvider/index.js +5 -3
- package/es/Descriptions/index.d.ts +1 -1
- package/es/Descriptions/index.js +3 -3
- package/es/Descriptions/style/index.css +3 -0
- package/es/Descriptions/style/variables.css +3 -0
- package/es/Form/Form.js +13 -4
- package/es/Form/FormItem/ItemHolder.js +1 -10
- package/es/Form/FormWrapper.d.ts +3 -0
- package/es/Form/FormWrapper.js +22 -0
- package/es/Form/WrapperItem.d.ts +4 -0
- package/es/Form/WrapperItem.js +217 -0
- package/es/Form/container.js +1 -13
- package/es/Form/images/icon_collapse.svg +1 -0
- package/es/Form/index.d.ts +2 -0
- package/es/Form/index.js +2 -0
- package/es/Form/interface.d.ts +12 -0
- package/es/Form/style/index.css +34 -44
- package/es/Form/style/variables.css +34 -44
- 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/InputNumber/index.js +11 -4
- package/es/InputNumber/style/index.css +7 -0
- package/es/InputNumber/style/variables.css +7 -0
- package/es/LmEditTable/EditTable.js +3 -3
- package/es/LmEditTable/sortableItemCol.js +8 -5
- package/es/LmEditTable/util.js +1 -1
- package/es/LmFilter/components/CheckboxFilter.js +9 -4
- package/es/LmFilter/components/DropdownFIlter.js +166 -115
- package/es/LmFilter/components/SelectFilter.js +4 -3
- 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/LmSelect/style/index.css +1 -0
- package/es/LmSelect/style/variables.css +1 -0
- package/es/LmTable/style/index.css +39 -0
- package/es/LmTable/style/variables.css +39 -0
- package/es/LmUpload/UploadList/ItemText.js +5 -1
- package/es/QuickMenu/index.d.ts +1 -0
- package/es/QuickMenu/index.js +12 -8
- package/es/Select/style/index.css +1 -0
- package/es/Select/style/variables.css +1 -0
- package/es/TreeSelect/index.js +16 -2
- package/es/TreeSelect/style/index.css +3 -0
- package/es/TreeSelect/style/variables.css +3 -0
- package/es/styles/variables.css +162 -98
- package/lib/Cascader/index.js +20 -2
- package/lib/Cascader/style/index.css +1 -0
- package/lib/Cascader/style/variables.css +1 -0
- package/lib/ConfigProvider/context.d.ts +1 -0
- package/lib/ConfigProvider/index.js +5 -3
- package/lib/Descriptions/index.d.ts +1 -1
- package/lib/Descriptions/index.js +3 -3
- package/lib/Descriptions/style/index.css +3 -0
- package/lib/Descriptions/style/variables.css +3 -0
- package/lib/Form/Form.js +13 -4
- package/lib/Form/FormItem/ItemHolder.js +1 -10
- package/lib/Form/FormWrapper.d.ts +3 -0
- package/lib/Form/FormWrapper.js +34 -0
- package/lib/Form/WrapperItem.d.ts +4 -0
- package/lib/Form/WrapperItem.js +235 -0
- package/lib/Form/container.js +1 -13
- package/lib/Form/images/icon_collapse.svg +1 -0
- package/lib/Form/index.d.ts +2 -0
- package/lib/Form/index.js +3 -0
- package/lib/Form/interface.d.ts +12 -0
- package/lib/Form/style/index.css +34 -44
- package/lib/Form/style/variables.css +34 -44
- 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/InputNumber/index.js +13 -4
- package/lib/InputNumber/style/index.css +7 -0
- package/lib/InputNumber/style/variables.css +7 -0
- package/lib/LmEditTable/EditTable.js +3 -3
- package/lib/LmEditTable/sortableItemCol.js +8 -5
- package/lib/LmEditTable/util.js +1 -1
- package/lib/LmFilter/components/CheckboxFilter.js +9 -4
- package/lib/LmFilter/components/DropdownFIlter.js +166 -115
- package/lib/LmFilter/components/SelectFilter.js +4 -3
- 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/LmSelect/style/index.css +1 -0
- package/lib/LmSelect/style/variables.css +1 -0
- package/lib/LmTable/style/index.css +39 -0
- package/lib/LmTable/style/variables.css +39 -0
- package/lib/LmUpload/UploadList/ItemText.js +5 -1
- package/lib/QuickMenu/index.d.ts +1 -0
- package/lib/QuickMenu/index.js +11 -7
- package/lib/Select/style/index.css +1 -0
- package/lib/Select/style/variables.css +1 -0
- package/lib/TreeSelect/index.js +20 -2
- package/lib/TreeSelect/style/index.css +3 -0
- package/lib/TreeSelect/style/variables.css +3 -0
- package/lib/styles/variables.css +162 -98
- package/package.json +1 -1
|
@@ -665,6 +665,9 @@ p {
|
|
|
665
665
|
padding-right: 24px;
|
|
666
666
|
padding-bottom: 8px;
|
|
667
667
|
}
|
|
668
|
+
.lm_descriptions .ant-descriptions-item:last-child {
|
|
669
|
+
padding-right: 0;
|
|
670
|
+
}
|
|
668
671
|
.lm_descriptions .ant-descriptions-item .ant-descriptions-item-container {
|
|
669
672
|
color: var(--color-85);
|
|
670
673
|
font-size: 12px;
|
|
@@ -153,6 +153,9 @@
|
|
|
153
153
|
padding-right: 24px;
|
|
154
154
|
padding-bottom: 8px;
|
|
155
155
|
}
|
|
156
|
+
.lm_descriptions .ant-descriptions-item:last-child {
|
|
157
|
+
padding-right: 0;
|
|
158
|
+
}
|
|
156
159
|
.lm_descriptions .ant-descriptions-item .ant-descriptions-item-container {
|
|
157
160
|
color: var(--color-85);
|
|
158
161
|
font-size: 12px;
|
package/lib/Form/Form.js
CHANGED
|
@@ -49,7 +49,7 @@ var _context = require("./context");
|
|
|
49
49
|
|
|
50
50
|
var _useForm3 = _interopRequireDefault(require("./hooks/useForm"));
|
|
51
51
|
|
|
52
|
-
var
|
|
52
|
+
var _WrapperItem = _interopRequireDefault(require("./WrapperItem"));
|
|
53
53
|
|
|
54
54
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
55
55
|
var t = {};
|
|
@@ -96,8 +96,10 @@ var InternalForm = function InternalForm(props, ref) {
|
|
|
96
96
|
onFinishFailed = props.onFinishFailed,
|
|
97
97
|
name = props.name,
|
|
98
98
|
responsive = props.responsive,
|
|
99
|
-
|
|
99
|
+
customizeChildren = props.children,
|
|
100
|
+
restFormProps = __rest(props, ["prefixCls", "className", "size", "disabled", "form", "colon", "labelAlign", "labelWrap", "labelCol", "wrapperCol", "hideRequiredMark", "layout", "scrollToFirstError", "requiredMark", "onFinishFailed", "name", "responsive", "children"]);
|
|
100
101
|
|
|
102
|
+
var children = customizeChildren;
|
|
101
103
|
var mergedRequiredMark = (0, React.useMemo)(function () {
|
|
102
104
|
if (requiredMark !== undefined) {
|
|
103
105
|
return requiredMark;
|
|
@@ -156,6 +158,12 @@ var InternalForm = function InternalForm(props, ref) {
|
|
|
156
158
|
}
|
|
157
159
|
};
|
|
158
160
|
|
|
161
|
+
if (responsive) {
|
|
162
|
+
children = /*#__PURE__*/React.createElement(_WrapperItem.default, {
|
|
163
|
+
children: children
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
|
|
159
167
|
var formNode = /*#__PURE__*/React.createElement(_DisabledContext.DisabledContextProvider, {
|
|
160
168
|
disabled: disabled
|
|
161
169
|
}, /*#__PURE__*/React.createElement(_SizeContext.SizeContextProvider, {
|
|
@@ -165,6 +173,7 @@ var InternalForm = function InternalForm(props, ref) {
|
|
|
165
173
|
}, /*#__PURE__*/React.createElement(_rcFieldForm.default, Object.assign({
|
|
166
174
|
id: name
|
|
167
175
|
}, restFormProps, {
|
|
176
|
+
children: children,
|
|
168
177
|
name: name,
|
|
169
178
|
onFinishFailed: onInternalFinishFailed,
|
|
170
179
|
form: wrapForm,
|
|
@@ -172,8 +181,8 @@ var InternalForm = function InternalForm(props, ref) {
|
|
|
172
181
|
})))));
|
|
173
182
|
|
|
174
183
|
if (responsive) {
|
|
175
|
-
return /*#__PURE__*/React.createElement(
|
|
176
|
-
|
|
184
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
185
|
+
className: "lm_form_responsive_box"
|
|
177
186
|
}, formNode);
|
|
178
187
|
}
|
|
179
188
|
|
|
@@ -145,17 +145,8 @@ function ItemHolder(props) {
|
|
|
145
145
|
}, [mergedValidateStatus, hasFeedback]); // ======================== Render ========================
|
|
146
146
|
|
|
147
147
|
var itemClassName = (_itemClassName = {}, (0, _defineProperty2.default)(_itemClassName, itemPrefixCls, true), (0, _defineProperty2.default)(_itemClassName, "".concat(itemPrefixCls, "-with-help"), hasHelp || debounceErrors.length || debounceWarnings.length), (0, _defineProperty2.default)(_itemClassName, "".concat(className), !!className), (0, _defineProperty2.default)(_itemClassName, "".concat(itemPrefixCls, "-has-feedback"), mergedValidateStatus && hasFeedback), (0, _defineProperty2.default)(_itemClassName, "".concat(itemPrefixCls, "-has-success"), mergedValidateStatus === 'success'), (0, _defineProperty2.default)(_itemClassName, "".concat(itemPrefixCls, "-has-warning"), mergedValidateStatus === 'warning'), (0, _defineProperty2.default)(_itemClassName, "".concat(itemPrefixCls, "-has-error"), mergedValidateStatus === 'error'), (0, _defineProperty2.default)(_itemClassName, "".concat(itemPrefixCls, "-is-validating"), mergedValidateStatus === 'validating'), (0, _defineProperty2.default)(_itemClassName, "".concat(itemPrefixCls, "-hidden"), hidden), (0, _defineProperty2.default)(_itemClassName, 'lm_form-item-tip-error lm_form-item-tip-error-top', errorPlacement === 'top'), (0, _defineProperty2.default)(_itemClassName, 'lm_form-item-tip-error lm_form-item-tip-error-left', errorPlacement === 'left'), (0, _defineProperty2.default)(_itemClassName, 'lm_form-item-tip-error lm_form-item-tip-error-right', errorPlacement === 'right'), (0, _defineProperty2.default)(_itemClassName, 'lm_form-item-tip-error lm_form-item-tip-error-bottom', errorPlacement === 'bottom'), (0, _defineProperty2.default)(_itemClassName, 'ant-form-item-responsive', responsive), _itemClassName);
|
|
148
|
-
var nthCls = '';
|
|
149
|
-
|
|
150
|
-
if (itemRef.current && itemRef.current.classList) {
|
|
151
|
-
var list = itemRef.current.classList;
|
|
152
|
-
if (list.contains('nth-three')) nthCls = 'nth-three';
|
|
153
|
-
if (list.contains('nth-four')) nthCls = 'nth-four';
|
|
154
|
-
if (list.contains('nth-five')) nthCls = 'nth-five';
|
|
155
|
-
}
|
|
156
|
-
|
|
157
148
|
return /*#__PURE__*/React.createElement("div", {
|
|
158
|
-
className: (0, _classnames.default)(itemClassName
|
|
149
|
+
className: (0, _classnames.default)(itemClassName),
|
|
159
150
|
style: style,
|
|
160
151
|
ref: itemRef
|
|
161
152
|
}, /*#__PURE__*/React.createElement(_Grid.Row, Object.assign({
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _WrapperItem = _interopRequireDefault(require("./WrapperItem"));
|
|
13
|
+
|
|
14
|
+
function withComponent(WrappedComponent) {
|
|
15
|
+
var WithComponent = function WithComponent(props) {
|
|
16
|
+
return /*#__PURE__*/_react.default.createElement(WrappedComponent, Object.assign({}, props, {
|
|
17
|
+
with: true
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
22
|
+
WithComponent.displayName = "withComponent(".concat(wrappedComponentName, ")");
|
|
23
|
+
return WithComponent;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var FormWrapper = function FormWrapper(props) {
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement(_WrapperItem.default, Object.assign({}, props, {
|
|
28
|
+
user: true
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var _default = withComponent(FormWrapper);
|
|
33
|
+
|
|
34
|
+
exports.default = _default;
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
+
|
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
|
|
18
|
+
var _lodash = require("lodash");
|
|
19
|
+
|
|
20
|
+
var _Row = _interopRequireDefault(require("../Row"));
|
|
21
|
+
|
|
22
|
+
var _Col = _interopRequireDefault(require("../Col"));
|
|
23
|
+
|
|
24
|
+
var icon = require('./images/icon_collapse.svg'); // 行个数 => 在24份中占用的分数
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
var rowMap = new Map([[5, [4, 1]], [4, [5, 1]], [3, [7, 1]]]);
|
|
28
|
+
|
|
29
|
+
var Title = function Title(props) {
|
|
30
|
+
var title = props.title,
|
|
31
|
+
onToggle = props.onToggle;
|
|
32
|
+
|
|
33
|
+
var _useState = (0, _react.useState)(true),
|
|
34
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
35
|
+
visible = _useState2[0],
|
|
36
|
+
setVisible = _useState2[1];
|
|
37
|
+
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
39
|
+
className: "form_responsive_group_title",
|
|
40
|
+
onClick: function onClick() {
|
|
41
|
+
setVisible(!visible);
|
|
42
|
+
onToggle && onToggle(!visible);
|
|
43
|
+
}
|
|
44
|
+
}, /*#__PURE__*/_react.default.createElement("h3", null, title), /*#__PURE__*/_react.default.createElement("img", {
|
|
45
|
+
src: icon,
|
|
46
|
+
className: !visible ? 'open' : '',
|
|
47
|
+
alt: ""
|
|
48
|
+
}));
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var List = function List(props) {
|
|
52
|
+
var customizeChildren = props.children,
|
|
53
|
+
countPerRow = props.countPerRow,
|
|
54
|
+
title = props.title,
|
|
55
|
+
user = props.user;
|
|
56
|
+
|
|
57
|
+
var _rowMap$get = rowMap.get(countPerRow),
|
|
58
|
+
_rowMap$get2 = (0, _slicedToArray2.default)(_rowMap$get, 2),
|
|
59
|
+
colSpan = _rowMap$get2[0],
|
|
60
|
+
colSpace = _rowMap$get2[1];
|
|
61
|
+
|
|
62
|
+
var _useState3 = (0, _react.useState)(true),
|
|
63
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
64
|
+
visible = _useState4[0],
|
|
65
|
+
setVisible = _useState4[1]; // 最终的结果
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
var rowlist = (0, _react.useMemo)(function () {
|
|
69
|
+
var _a;
|
|
70
|
+
|
|
71
|
+
var children = []; // 收集(满了就重置)
|
|
72
|
+
|
|
73
|
+
var collection = [];
|
|
74
|
+
var result = [];
|
|
75
|
+
|
|
76
|
+
if (!Array.isArray(customizeChildren)) {
|
|
77
|
+
children = [customizeChildren];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
children = Array.prototype.slice.call(customizeChildren).flat();
|
|
81
|
+
|
|
82
|
+
if (user) {
|
|
83
|
+
result.push( /*#__PURE__*/_react.default.createElement(Title, {
|
|
84
|
+
title: title,
|
|
85
|
+
onToggle: function onToggle(value) {
|
|
86
|
+
setVisible(value);
|
|
87
|
+
}
|
|
88
|
+
}));
|
|
89
|
+
} // 一行
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
function generatorRow() {
|
|
93
|
+
var node = /*#__PURE__*/_react.default.createElement(_Row.default, null, collection.map(function (child, index) {
|
|
94
|
+
if (index !== collection.length - 1) {
|
|
95
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
96
|
+
key: index
|
|
97
|
+
}, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
98
|
+
span: colSpan
|
|
99
|
+
}, child), /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
100
|
+
span: colSpace
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
105
|
+
span: colSpan,
|
|
106
|
+
key: index
|
|
107
|
+
}, child);
|
|
108
|
+
}));
|
|
109
|
+
|
|
110
|
+
result.push(node);
|
|
111
|
+
collection.length = 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
for (var i = 0; i < children.length; i += 1) {
|
|
115
|
+
var child = children[i]; // 过滤掉React.Fragment
|
|
116
|
+
|
|
117
|
+
while (child.type === Symbol.for('react.fragment')) {
|
|
118
|
+
if (Array.isArray(child.props.children)) {
|
|
119
|
+
var _children;
|
|
120
|
+
|
|
121
|
+
(_children = children).splice.apply(_children, [i, 1].concat((0, _toConsumableArray2.default)(child.props.children)));
|
|
122
|
+
|
|
123
|
+
child = children[i];
|
|
124
|
+
} else {
|
|
125
|
+
child = child.props.children;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (child) {
|
|
130
|
+
if ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.responsive) {
|
|
131
|
+
collection.push(child);
|
|
132
|
+
|
|
133
|
+
if (collection.length && collection.length === countPerRow) {
|
|
134
|
+
generatorRow();
|
|
135
|
+
}
|
|
136
|
+
} else if (collection.length) {
|
|
137
|
+
generatorRow();
|
|
138
|
+
result.push(child);
|
|
139
|
+
} else {
|
|
140
|
+
result.push(child);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (collection.length) {
|
|
146
|
+
generatorRow();
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return result;
|
|
150
|
+
}, [customizeChildren, countPerRow, user, title]);
|
|
151
|
+
var needRenderList = rowlist;
|
|
152
|
+
|
|
153
|
+
if (!visible && needRenderList.length) {
|
|
154
|
+
needRenderList = [needRenderList[0]];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, needRenderList.map(function (child, index) {
|
|
158
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
159
|
+
key: index
|
|
160
|
+
}, child);
|
|
161
|
+
}));
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
var WrapperItem = function WrapperItem(props) {
|
|
165
|
+
var user = props.user;
|
|
166
|
+
var targetRef = (0, _react.useRef)(null);
|
|
167
|
+
|
|
168
|
+
var _useState5 = (0, _react.useState)({
|
|
169
|
+
width: '100%',
|
|
170
|
+
height: '100%'
|
|
171
|
+
}),
|
|
172
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
173
|
+
containerSize = _useState6[0],
|
|
174
|
+
setContainerSize = _useState6[1]; // 每行的个数
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
var _useState7 = (0, _react.useState)(5),
|
|
178
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
179
|
+
countPerRow = _useState8[0],
|
|
180
|
+
setCountPerRow = _useState8[1];
|
|
181
|
+
|
|
182
|
+
var changeSize = function changeSize() {
|
|
183
|
+
var _a;
|
|
184
|
+
|
|
185
|
+
var maxWidth = 1824;
|
|
186
|
+
|
|
187
|
+
var _ref = ((_a = targetRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) || {},
|
|
188
|
+
_ref$width = _ref.width,
|
|
189
|
+
width = _ref$width === void 0 ? '100%' : _ref$width;
|
|
190
|
+
|
|
191
|
+
if (width < 990) {
|
|
192
|
+
setCountPerRow(3);
|
|
193
|
+
} else if (width < 1390) {
|
|
194
|
+
setCountPerRow(4);
|
|
195
|
+
} else {
|
|
196
|
+
setCountPerRow(5);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (width !== '100%') {
|
|
200
|
+
width -= 32;
|
|
201
|
+
|
|
202
|
+
if (width > maxWidth) {
|
|
203
|
+
if (user) {
|
|
204
|
+
width = maxWidth - 64;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
setContainerSize({
|
|
210
|
+
width: width
|
|
211
|
+
});
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
var handResize = (0, _lodash.throttle)(changeSize, 600);
|
|
215
|
+
(0, _react.useEffect)(function () {
|
|
216
|
+
changeSize();
|
|
217
|
+
window.addEventListener('resize', handResize);
|
|
218
|
+
return function () {
|
|
219
|
+
window.removeEventListener('resize', handResize);
|
|
220
|
+
};
|
|
221
|
+
}, []);
|
|
222
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
223
|
+
className: "lm_container_wrapper",
|
|
224
|
+
ref: targetRef
|
|
225
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
226
|
+
style: Object.assign(Object.assign({}, containerSize), {
|
|
227
|
+
margin: '0 auto'
|
|
228
|
+
})
|
|
229
|
+
}, /*#__PURE__*/_react.default.createElement(List, Object.assign({}, props, {
|
|
230
|
+
countPerRow: countPerRow
|
|
231
|
+
})))));
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
var _default = WrapperItem;
|
|
235
|
+
exports.default = _default;
|
package/lib/Form/container.js
CHANGED
|
@@ -53,19 +53,7 @@ var LMContainer = function LMContainer(props) {
|
|
|
53
53
|
var width = containerSize.width,
|
|
54
54
|
height = containerSize.height;
|
|
55
55
|
var responsiveCls = responsive && width !== '100%' ? 'responsive' : '';
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
if (responsiveCls) {
|
|
59
|
-
if (parseInt(width) < 990) {
|
|
60
|
-
lm_col = 'lm_col_3';
|
|
61
|
-
} else if (parseInt(width) < 1390) {
|
|
62
|
-
lm_col = 'lm_col_4';
|
|
63
|
-
} else {
|
|
64
|
-
lm_col = 'lm_col_5';
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
var classes = (0, _classnames.default)(className, prefixCls, responsiveCls, lm_col);
|
|
56
|
+
var classes = (0, _classnames.default)(className, prefixCls, responsiveCls);
|
|
69
57
|
return /*#__PURE__*/_react.default.createElement("div", Object.assign({
|
|
70
58
|
className: classes
|
|
71
59
|
}, others, {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill='none' version='1.1' width='16' height='16' viewBox='0 0 16 16'><defs><clipPath id='master_svg0_sa1497_9860'><rect x='0' y='0' width='16' height='16' rx='0'/></clipPath></defs><g clipPath='url(#master_svg0_sa1497_9860)'><g style='mix-blend-mode:passthrough'><path d='M13.4609,5.384111L9.22915,10.462240000000001Q8.7494,11.03795,8,11.03795Q7.2506,11.03795,6.770849999999999,10.462240000000001L2.539067,5.384111L3.460933,4.615889L7.69271,9.69402Q7.81265,9.83795,8,9.83795Q8.18735,9.83795,8.30729,9.69402L12.53907,4.615889L13.4609,5.384111ZM13.6,5Q13.6,5.0590948000000004,13.5885,5.117054Q13.5769,5.175014,13.5543,5.22961Q13.5317,5.284207,13.4989,5.333342Q13.4661,5.382478,13.4243,5.424264Q13.3825,5.46605,13.3333,5.498882Q13.2842,5.531713,13.2296,5.554328Q13.175,5.576942,13.1171,5.588471Q13.0591,5.6,13,5.6Q12.94091,5.6,12.88295,5.588471Q12.82499,5.576942,12.77039,5.554328Q12.71579,5.531713,12.66666,5.498882Q12.61752,5.46605,12.57573,5.424264Q12.53395,5.382478,12.50112,5.333342Q12.46828,5.284207,12.44567,5.22961Q12.42306,5.175014,12.41153,5.117054Q12.4,5.0590948000000004,12.4,5Q12.4,4.9409051999999996,12.41153,4.882946Q12.42306,4.824986,12.44567,4.77039Q12.46828,4.715793,12.50112,4.666658Q12.53395,4.617522,12.57574,4.575736Q12.61752,4.53395,12.66666,4.501118Q12.71579,4.468287,12.77039,4.445672Q12.82499,4.423058,12.88295,4.411529Q12.94091,4.4,13,4.4Q13.0591,4.4,13.1171,4.411529Q13.175,4.423058,13.2296,4.445672Q13.2842,4.468287,13.3333,4.501118Q13.3825,4.53395,13.4243,4.575736Q13.4661,4.617522,13.4989,4.666658Q13.5317,4.715793,13.5543,4.77039Q13.5769,4.824986,13.5885,4.882946Q13.6,4.9409051999999996,13.6,5ZM3.6,5Q3.6,5.0590948000000004,3.588471,5.117054Q3.576942,5.175014,3.554328,5.22961Q3.531713,5.284207,3.498882,5.333342Q3.46605,5.382478,3.424264,5.424264Q3.382478,5.46605,3.333342,5.498882Q3.284207,5.531713,3.22961,5.554328Q3.175014,5.576942,3.117054,5.588471Q3.0590948,5.6,3,5.6Q2.9409052,5.6,2.882946,5.588471Q2.824986,5.576942,2.77039,5.554328Q2.715793,5.531713,2.666658,5.498882Q2.617522,5.46605,2.575736,5.424264Q2.53395,5.382478,2.501118,5.333342Q2.468287,5.284207,2.445672,5.22961Q2.423058,5.175014,2.411529,5.117054Q2.4,5.0590948000000004,2.4,5Q2.4,4.9409051999999996,2.411529,4.882946Q2.423058,4.824986,2.445672,4.77039Q2.468287,4.715793,2.501118,4.666658Q2.53395,4.617522,2.575736,4.575736Q2.617522,4.53395,2.666658,4.501118Q2.715793,4.468287,2.77039,4.445672Q2.824986,4.423058,2.882946,4.411529Q2.9409052,4.4,3,4.4Q3.0590948,4.4,3.117054,4.411529Q3.175014,4.423058,3.22961,4.445672Q3.284207,4.468287,3.333342,4.501118Q3.382478,4.53395,3.424264,4.575736Q3.46605,4.617522,3.498882,4.666658Q3.531713,4.715793,3.554328,4.77039Q3.576942,4.824986,3.588471,4.882946Q3.6,4.9409051999999996,3.6,5Z' fill='#262626' fillOpacity='1'/></g></g></svg>
|
package/lib/Form/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import type { FormItemProps } from './FormItem';
|
|
|
9
9
|
import List from './FormList';
|
|
10
10
|
import type { FormListFieldData, FormListOperation, FormListProps } from './FormList';
|
|
11
11
|
import useFormInstance from './hooks/useFormInstance';
|
|
12
|
+
import Wrapper from './FormWrapper';
|
|
12
13
|
declare type InternalFormType = typeof InternalForm;
|
|
13
14
|
interface FormInterface extends InternalFormType {
|
|
14
15
|
useForm: typeof useForm;
|
|
@@ -18,6 +19,7 @@ interface FormInterface extends InternalFormType {
|
|
|
18
19
|
List: typeof List;
|
|
19
20
|
ErrorList: typeof ErrorList;
|
|
20
21
|
Provider: typeof FormProvider;
|
|
22
|
+
Wrapper: typeof Wrapper;
|
|
21
23
|
/** @deprecated Only for warning usage. Do not use. */
|
|
22
24
|
create: () => void;
|
|
23
25
|
}
|
package/lib/Form/index.js
CHANGED
|
@@ -23,6 +23,8 @@ var _FormList = _interopRequireDefault(require("./FormList"));
|
|
|
23
23
|
|
|
24
24
|
var _useFormInstance = _interopRequireDefault(require("./hooks/useFormInstance"));
|
|
25
25
|
|
|
26
|
+
var _FormWrapper = _interopRequireDefault(require("./FormWrapper"));
|
|
27
|
+
|
|
26
28
|
var Form = _Form.default;
|
|
27
29
|
Form.Item = _FormItem.default;
|
|
28
30
|
Form.List = _FormList.default;
|
|
@@ -36,5 +38,6 @@ Form.create = function () {
|
|
|
36
38
|
(0, _warning.default)(false, 'Form', 'antd v4 removed `Form.create`. Please remove or use `@ant-design/compatible` instead.');
|
|
37
39
|
};
|
|
38
40
|
|
|
41
|
+
Form.Wrapper = _FormWrapper.default;
|
|
39
42
|
var _default = Form;
|
|
40
43
|
exports.default = _default;
|
package/lib/Form/interface.d.ts
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
import { FormInstance, Store } from 'rc-field-form/lib/interface';
|
|
2
|
+
import React from 'react';
|
|
1
3
|
export { InternalNamePath, NamePath, Store, StoreValue } from 'rc-field-form/lib/interface';
|
|
2
4
|
export { Options as ScrollOptions } from 'scroll-into-view-if-needed';
|
|
3
5
|
export declare type FormLabelAlign = 'left' | 'right';
|
|
6
|
+
export declare type RenderProps = (values: Store, form: FormInstance) => JSX.Element | React.ReactNode;
|
|
7
|
+
export interface ISize {
|
|
8
|
+
width?: number;
|
|
9
|
+
height?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface IWrapper {
|
|
12
|
+
children: React.ReactNode | RenderProps;
|
|
13
|
+
title?: string;
|
|
14
|
+
user?: boolean;
|
|
15
|
+
}
|
package/lib/Form/style/index.css
CHANGED
|
@@ -6613,58 +6613,48 @@ p {
|
|
|
6613
6613
|
.lm_form.ant-form.ant-form-inline .ant-form-item-label {
|
|
6614
6614
|
text-align: left;
|
|
6615
6615
|
}
|
|
6616
|
-
.
|
|
6617
|
-
|
|
6618
|
-
}
|
|
6619
|
-
.lm_container_wrapper .lm_container.responsive {
|
|
6620
|
-
min-width: 990px;
|
|
6621
|
-
}
|
|
6622
|
-
.lm_container_wrapper .lm_container.responsive .lm_form.ant-form {
|
|
6623
|
-
display: flex;
|
|
6624
|
-
flex-direction: row;
|
|
6625
|
-
flex-wrap: wrap;
|
|
6626
|
-
}
|
|
6627
|
-
.lm_container_wrapper .lm_container.responsive .lm_form.ant-form .ant-form-item-responsive {
|
|
6628
|
-
margin-right: 24px;
|
|
6616
|
+
.lm_form_responsive_box .lm_form {
|
|
6617
|
+
background: #f0f0f0;
|
|
6629
6618
|
}
|
|
6630
|
-
.
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
margin-right: 0;
|
|
6636
|
-
}
|
|
6637
|
-
.lm_container_wrapper .lm_container.responsive.lm_col_3 .ant-form-item-responsive {
|
|
6638
|
-
width: calc(33.3333% - 16px);
|
|
6639
|
-
margin-right: 24px;
|
|
6619
|
+
.lm_form_responsive_box .lm_form > .lm_container_wrapper {
|
|
6620
|
+
background: #f0f0f0;
|
|
6621
|
+
margin-bottom: 0;
|
|
6622
|
+
border-radius: 0;
|
|
6623
|
+
padding: 16px;
|
|
6640
6624
|
}
|
|
6641
|
-
.lm_container_wrapper
|
|
6642
|
-
|
|
6625
|
+
.lm_container_wrapper {
|
|
6626
|
+
overflow: auto;
|
|
6627
|
+
background: #fff;
|
|
6628
|
+
margin-bottom: 16px;
|
|
6629
|
+
border-radius: 2px;
|
|
6630
|
+
padding: 0;
|
|
6643
6631
|
}
|
|
6644
|
-
.lm_container_wrapper .
|
|
6632
|
+
.lm_container_wrapper .ant-cascader {
|
|
6645
6633
|
width: 100%;
|
|
6646
|
-
margin-right: 0;
|
|
6647
6634
|
}
|
|
6648
|
-
.
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
margin-right: 0;
|
|
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;
|
|
6658
6644
|
}
|
|
6659
|
-
.
|
|
6660
|
-
|
|
6661
|
-
|
|
6645
|
+
.form_responsive_group_title h3 {
|
|
6646
|
+
flex: 1;
|
|
6647
|
+
font-weight: medium;
|
|
6648
|
+
font-size: 14px;
|
|
6662
6649
|
}
|
|
6663
|
-
.
|
|
6664
|
-
|
|
6650
|
+
.form_responsive_group_title img {
|
|
6651
|
+
cursor: pointer;
|
|
6652
|
+
width: 16px;
|
|
6653
|
+
height: 16px;
|
|
6654
|
+
transition: transform 0.24s;
|
|
6665
6655
|
}
|
|
6666
|
-
.
|
|
6667
|
-
|
|
6656
|
+
.form_responsive_group_title img.open {
|
|
6657
|
+
transform: rotate(180deg);
|
|
6668
6658
|
}
|
|
6669
6659
|
.lm_form-item-tip-error .ant-form-item-explain {
|
|
6670
6660
|
width: 100%;
|
|
@@ -6101,58 +6101,48 @@
|
|
|
6101
6101
|
.lm_form.ant-form.ant-form-inline .ant-form-item-label {
|
|
6102
6102
|
text-align: left;
|
|
6103
6103
|
}
|
|
6104
|
-
.
|
|
6105
|
-
|
|
6106
|
-
}
|
|
6107
|
-
.lm_container_wrapper .lm_container.responsive {
|
|
6108
|
-
min-width: 990px;
|
|
6109
|
-
}
|
|
6110
|
-
.lm_container_wrapper .lm_container.responsive .lm_form.ant-form {
|
|
6111
|
-
display: flex;
|
|
6112
|
-
flex-direction: row;
|
|
6113
|
-
flex-wrap: wrap;
|
|
6114
|
-
}
|
|
6115
|
-
.lm_container_wrapper .lm_container.responsive .lm_form.ant-form .ant-form-item-responsive {
|
|
6116
|
-
margin-right: 24px;
|
|
6117
|
-
}
|
|
6118
|
-
.lm_container_wrapper .lm_container.responsive .lm_form.ant-form .ant-form-item-responsive .ant-form-item-control {
|
|
6119
|
-
width: 100%;
|
|
6120
|
-
}
|
|
6121
|
-
.lm_container_wrapper .lm_container.responsive.lm_col_3 .ant-form-item {
|
|
6122
|
-
width: 100%;
|
|
6123
|
-
margin-right: 0;
|
|
6104
|
+
.lm_form_responsive_box .lm_form {
|
|
6105
|
+
background: #f0f0f0;
|
|
6124
6106
|
}
|
|
6125
|
-
.
|
|
6126
|
-
|
|
6127
|
-
margin-
|
|
6107
|
+
.lm_form_responsive_box .lm_form > .lm_container_wrapper {
|
|
6108
|
+
background: #f0f0f0;
|
|
6109
|
+
margin-bottom: 0;
|
|
6110
|
+
border-radius: 0;
|
|
6111
|
+
padding: 16px;
|
|
6128
6112
|
}
|
|
6129
|
-
.lm_container_wrapper
|
|
6130
|
-
|
|
6113
|
+
.lm_container_wrapper {
|
|
6114
|
+
overflow: auto;
|
|
6115
|
+
background: #fff;
|
|
6116
|
+
margin-bottom: 16px;
|
|
6117
|
+
border-radius: 2px;
|
|
6118
|
+
padding: 0;
|
|
6131
6119
|
}
|
|
6132
|
-
.lm_container_wrapper .
|
|
6120
|
+
.lm_container_wrapper .ant-cascader {
|
|
6133
6121
|
width: 100%;
|
|
6134
|
-
margin-right: 0;
|
|
6135
6122
|
}
|
|
6136
|
-
.
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
margin-right: 0;
|
|
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;
|
|
6146
6132
|
}
|
|
6147
|
-
.
|
|
6148
|
-
|
|
6149
|
-
|
|
6133
|
+
.form_responsive_group_title h3 {
|
|
6134
|
+
flex: 1;
|
|
6135
|
+
font-weight: medium;
|
|
6136
|
+
font-size: 14px;
|
|
6150
6137
|
}
|
|
6151
|
-
.
|
|
6152
|
-
|
|
6138
|
+
.form_responsive_group_title img {
|
|
6139
|
+
cursor: pointer;
|
|
6140
|
+
width: 16px;
|
|
6141
|
+
height: 16px;
|
|
6142
|
+
transition: transform 0.24s;
|
|
6153
6143
|
}
|
|
6154
|
-
.
|
|
6155
|
-
|
|
6144
|
+
.form_responsive_group_title img.open {
|
|
6145
|
+
transform: rotate(180deg);
|
|
6156
6146
|
}
|
|
6157
6147
|
.lm_form-item-tip-error .ant-form-item-explain {
|
|
6158
6148
|
width: 100%;
|
package/lib/IconFont/index.d.ts
CHANGED