linkmore-design 1.1.15 → 1.1.16
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/dist/Form/FormWrapper.d.ts +3 -0
- package/dist/Form/WrapperItem.d.ts +4 -0
- package/dist/Form/index.d.ts +2 -0
- package/dist/Form/interface.d.ts +10 -0
- package/dist/LmTable/demos/summuy.d.ts +2 -0
- package/dist/TreeSelect/demos/treedata.d.ts +3 -0
- package/dist/index.umd.js +927 -852
- package/dist/index.umd.min.js +5 -5
- package/dist/variables.css +59 -48
- package/es/Cascader/style/index.css +1 -0
- package/es/Cascader/style/variables.css +1 -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 +23 -0
- package/es/Form/WrapperItem.d.ts +4 -0
- package/es/Form/WrapperItem.js +149 -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 +10 -0
- package/es/Form/style/index.css +13 -48
- package/es/Form/style/variables.css +13 -48
- package/es/InputNumber/style/index.css +4 -0
- package/es/InputNumber/style/variables.css +4 -0
- package/es/LmEditTable/EditTable.js +3 -2
- package/es/LmFilter/components/CheckboxFilter.js +9 -4
- package/es/LmFilter/components/DropdownFIlter.js +10 -4
- package/es/LmFilter/components/SelectFilter.js +4 -3
- 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/Select/style/index.css +1 -0
- package/es/Select/style/variables.css +1 -0
- package/es/styles/variables.css +59 -48
- package/lib/Cascader/style/index.css +1 -0
- package/lib/Cascader/style/variables.css +1 -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 +35 -0
- package/lib/Form/WrapperItem.d.ts +4 -0
- package/lib/Form/WrapperItem.js +168 -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 +10 -0
- package/lib/Form/style/index.css +13 -48
- package/lib/Form/style/variables.css +13 -48
- package/lib/InputNumber/style/index.css +4 -0
- package/lib/InputNumber/style/variables.css +4 -0
- package/lib/LmEditTable/EditTable.js +3 -2
- package/lib/LmFilter/components/CheckboxFilter.js +9 -4
- package/lib/LmFilter/components/DropdownFIlter.js +10 -4
- package/lib/LmFilter/components/SelectFilter.js +4 -3
- 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/Select/style/index.css +1 -0
- package/lib/Select/style/variables.css +1 -0
- package/lib/styles/variables.css +59 -48
- package/package.json +4 -2
package/dist/variables.css
CHANGED
|
@@ -1407,6 +1407,7 @@ p {
|
|
|
1407
1407
|
}
|
|
1408
1408
|
.lm_cascader.ant-select.ant-select {
|
|
1409
1409
|
font-size: 12px;
|
|
1410
|
+
width: 100%;
|
|
1410
1411
|
}
|
|
1411
1412
|
.lm_cascader_dropdown.ant-select-dropdown {
|
|
1412
1413
|
font-size: 12px;
|
|
@@ -8951,57 +8952,22 @@ p {
|
|
|
8951
8952
|
.lm_form.ant-form.ant-form-inline .ant-form-item-label {
|
|
8952
8953
|
text-align: left;
|
|
8953
8954
|
}
|
|
8954
|
-
.
|
|
8955
|
-
|
|
8956
|
-
}
|
|
8957
|
-
.lm_container_wrapper .lm_container.responsive {
|
|
8958
|
-
min-width: 990px;
|
|
8959
|
-
}
|
|
8960
|
-
.lm_container_wrapper .lm_container.responsive .lm_form.ant-form {
|
|
8961
|
-
display: flex;
|
|
8962
|
-
flex-direction: row;
|
|
8963
|
-
flex-wrap: wrap;
|
|
8964
|
-
}
|
|
8965
|
-
.lm_container_wrapper .lm_container.responsive .lm_form.ant-form .ant-form-item-responsive {
|
|
8966
|
-
margin-right: 24px;
|
|
8967
|
-
}
|
|
8968
|
-
.lm_container_wrapper .lm_container.responsive .lm_form.ant-form .ant-form-item-responsive .ant-form-item-control {
|
|
8969
|
-
width: 100%;
|
|
8970
|
-
}
|
|
8971
|
-
.lm_container_wrapper .lm_container.responsive.lm_col_3 .ant-form-item {
|
|
8972
|
-
width: 100%;
|
|
8973
|
-
margin-right: 0;
|
|
8974
|
-
}
|
|
8975
|
-
.lm_container_wrapper .lm_container.responsive.lm_col_3 .ant-form-item-responsive {
|
|
8976
|
-
width: calc(33.3333% - 16px);
|
|
8977
|
-
margin-right: 24px;
|
|
8978
|
-
}
|
|
8979
|
-
.lm_container_wrapper .lm_container.responsive.lm_col_3 .ant-form-item-responsive.nth-three {
|
|
8980
|
-
margin-right: 0;
|
|
8981
|
-
}
|
|
8982
|
-
.lm_container_wrapper .lm_container.responsive.lm_col_4 .ant-form-item {
|
|
8983
|
-
width: 100%;
|
|
8984
|
-
margin-right: 0;
|
|
8985
|
-
}
|
|
8986
|
-
.lm_container_wrapper .lm_container.responsive.lm_col_4 .ant-form-item-responsive {
|
|
8987
|
-
width: calc(25% - 18px);
|
|
8988
|
-
margin-right: 24px;
|
|
8989
|
-
}
|
|
8990
|
-
.lm_container_wrapper .lm_container.responsive.lm_col_4 .ant-form-item-responsive.nth-four {
|
|
8991
|
-
margin-right: 0;
|
|
8992
|
-
}
|
|
8993
|
-
.lm_container_wrapper .lm_container.responsive.lm_col_5 .ant-form-item {
|
|
8994
|
-
width: 100%;
|
|
8995
|
-
margin-right: 0;
|
|
8955
|
+
.lm_form_responsive_box .lm_form {
|
|
8956
|
+
background: #f0f0f0;
|
|
8996
8957
|
}
|
|
8997
|
-
.
|
|
8998
|
-
|
|
8999
|
-
|
|
8958
|
+
.lm_form_responsive_box .lm_form > .lm_container_wrapper {
|
|
8959
|
+
padding: 16px;
|
|
8960
|
+
background: #f0f0f0;
|
|
8961
|
+
margin-bottom: 0;
|
|
8962
|
+
border-radius: 0;
|
|
9000
8963
|
}
|
|
9001
|
-
.lm_container_wrapper
|
|
9002
|
-
|
|
8964
|
+
.lm_container_wrapper {
|
|
8965
|
+
overflow: auto;
|
|
8966
|
+
background: #fff;
|
|
8967
|
+
margin-bottom: 16px;
|
|
8968
|
+
border-radius: 2px;
|
|
9003
8969
|
}
|
|
9004
|
-
.lm_container_wrapper .
|
|
8970
|
+
.lm_container_wrapper .ant-cascader {
|
|
9005
8971
|
width: 100%;
|
|
9006
8972
|
}
|
|
9007
8973
|
.lm_form-item-tip-error .ant-form-item-explain {
|
|
@@ -9510,8 +9476,12 @@ p {
|
|
|
9510
9476
|
.ant-input-search-with-button .ant-input-affix-wrapper:not(.ant-input-affix-wrapper-disabled):hover {
|
|
9511
9477
|
z-index: 2 !important;
|
|
9512
9478
|
}
|
|
9479
|
+
.lm_input-number {
|
|
9480
|
+
width: 100%;
|
|
9481
|
+
}
|
|
9513
9482
|
.lm_input-number.ant-input-number {
|
|
9514
9483
|
border: 1px solid var(--color-15);
|
|
9484
|
+
width: 100%;
|
|
9515
9485
|
}
|
|
9516
9486
|
.lm_input-number .ant-input-number-handler-wrap {
|
|
9517
9487
|
width: 28px;
|
|
@@ -10368,6 +10338,7 @@ p {
|
|
|
10368
10338
|
}
|
|
10369
10339
|
.lm_select.ant-select {
|
|
10370
10340
|
font-size: 12px;
|
|
10341
|
+
width: 100%;
|
|
10371
10342
|
}
|
|
10372
10343
|
.lm_select .ant-select-selection-overflow-item-rest .ant-select-selection-item {
|
|
10373
10344
|
color: var(--primary-color);
|
|
@@ -11285,6 +11256,45 @@ p {
|
|
|
11285
11256
|
#lm_protable_warp .lm_protable .ant-table-empty table .ant-table-cell {
|
|
11286
11257
|
border-bottom: 0;
|
|
11287
11258
|
}
|
|
11259
|
+
#lm_protable_warp .lm_protable .ant-table-summary {
|
|
11260
|
+
height: 48px;
|
|
11261
|
+
}
|
|
11262
|
+
#lm_protable_warp .lm_protable .ant-table-summary > table {
|
|
11263
|
+
height: 100%;
|
|
11264
|
+
}
|
|
11265
|
+
#lm_protable_warp .lm_protable .ant-table-summary td {
|
|
11266
|
+
padding: 0 8px;
|
|
11267
|
+
text-align: right;
|
|
11268
|
+
background-color: var(--table-background-color);
|
|
11269
|
+
}
|
|
11270
|
+
#lm_protable_warp .lm_protable .ant-table-summary td:first-of-type {
|
|
11271
|
+
padding: 0 0 0 8px;
|
|
11272
|
+
text-align: left;
|
|
11273
|
+
}
|
|
11274
|
+
#lm_protable_warp .lm_protable .ant-table-summary td.number {
|
|
11275
|
+
border-right: 1px solid #eee;
|
|
11276
|
+
border-left: 1px solid #eee;
|
|
11277
|
+
}
|
|
11278
|
+
#lm_protable_warp .lm_protable .ant-table-summary td.money {
|
|
11279
|
+
color: var(--error-color);
|
|
11280
|
+
border-right: 1px solid #eee;
|
|
11281
|
+
border-left: 1px solid #eee;
|
|
11282
|
+
}
|
|
11283
|
+
#lm_protable_warp .lm_protable .ant-table-summary td.money-color {
|
|
11284
|
+
color: var(--error-color);
|
|
11285
|
+
}
|
|
11286
|
+
#lm_protable_warp .lm_protable .ant-table-summary td > div {
|
|
11287
|
+
overflow: hidden;
|
|
11288
|
+
white-space: nowrap;
|
|
11289
|
+
text-overflow: ellipsis;
|
|
11290
|
+
}
|
|
11291
|
+
#lm_protable_warp .lm_protable .ant-table-summary td > div:last-of-type {
|
|
11292
|
+
font-weight: bold;
|
|
11293
|
+
}
|
|
11294
|
+
#lm_protable_warp .lm_protable .ant-table-summary .total_title {
|
|
11295
|
+
position: relative;
|
|
11296
|
+
white-space: nowrap;
|
|
11297
|
+
}
|
|
11288
11298
|
#lm_protable_warp .ant-table-expand-icon-col {
|
|
11289
11299
|
width: 32px;
|
|
11290
11300
|
}
|
|
@@ -12330,6 +12340,7 @@ button.ant-table-row-expand-icon::after {
|
|
|
12330
12340
|
}
|
|
12331
12341
|
.lm_select.ant-select {
|
|
12332
12342
|
font-size: 12px;
|
|
12343
|
+
width: 100%;
|
|
12333
12344
|
}
|
|
12334
12345
|
.lm_select.ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector {
|
|
12335
12346
|
box-shadow: none;
|
package/es/Form/Form.js
CHANGED
|
@@ -24,7 +24,7 @@ import DisabledContext, { DisabledContextProvider } from '../ConfigProvider/Disa
|
|
|
24
24
|
import SizeContext, { SizeContextProvider } from '../ConfigProvider/SizeContext';
|
|
25
25
|
import { FormContext } from './context';
|
|
26
26
|
import useForm from './hooks/useForm';
|
|
27
|
-
import
|
|
27
|
+
import WrapperItem from './WrapperItem';
|
|
28
28
|
|
|
29
29
|
var InternalForm = function InternalForm(props, ref) {
|
|
30
30
|
var _classNames;
|
|
@@ -58,8 +58,10 @@ var InternalForm = function InternalForm(props, ref) {
|
|
|
58
58
|
onFinishFailed = props.onFinishFailed,
|
|
59
59
|
name = props.name,
|
|
60
60
|
responsive = props.responsive,
|
|
61
|
-
|
|
61
|
+
customizeChildren = props.children,
|
|
62
|
+
restFormProps = __rest(props, ["prefixCls", "className", "size", "disabled", "form", "colon", "labelAlign", "labelWrap", "labelCol", "wrapperCol", "hideRequiredMark", "layout", "scrollToFirstError", "requiredMark", "onFinishFailed", "name", "responsive", "children"]);
|
|
62
63
|
|
|
64
|
+
var children = customizeChildren;
|
|
63
65
|
var mergedRequiredMark = useMemo(function () {
|
|
64
66
|
if (requiredMark !== undefined) {
|
|
65
67
|
return requiredMark;
|
|
@@ -118,6 +120,12 @@ var InternalForm = function InternalForm(props, ref) {
|
|
|
118
120
|
}
|
|
119
121
|
};
|
|
120
122
|
|
|
123
|
+
if (responsive) {
|
|
124
|
+
children = /*#__PURE__*/React.createElement(WrapperItem, {
|
|
125
|
+
children: children
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
121
129
|
var formNode = /*#__PURE__*/React.createElement(DisabledContextProvider, {
|
|
122
130
|
disabled: disabled
|
|
123
131
|
}, /*#__PURE__*/React.createElement(SizeContextProvider, {
|
|
@@ -127,6 +135,7 @@ var InternalForm = function InternalForm(props, ref) {
|
|
|
127
135
|
}, /*#__PURE__*/React.createElement(FieldForm, Object.assign({
|
|
128
136
|
id: name
|
|
129
137
|
}, restFormProps, {
|
|
138
|
+
children: children,
|
|
130
139
|
name: name,
|
|
131
140
|
onFinishFailed: onInternalFinishFailed,
|
|
132
141
|
form: wrapForm,
|
|
@@ -134,8 +143,8 @@ var InternalForm = function InternalForm(props, ref) {
|
|
|
134
143
|
})))));
|
|
135
144
|
|
|
136
145
|
if (responsive) {
|
|
137
|
-
return /*#__PURE__*/React.createElement(
|
|
138
|
-
|
|
146
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
147
|
+
className: "lm_form_responsive_box"
|
|
139
148
|
}, formNode);
|
|
140
149
|
}
|
|
141
150
|
|
|
@@ -119,17 +119,8 @@ export default function ItemHolder(props) {
|
|
|
119
119
|
}, [mergedValidateStatus, hasFeedback]); // ======================== Render ========================
|
|
120
120
|
|
|
121
121
|
var itemClassName = (_itemClassName = {}, _defineProperty(_itemClassName, itemPrefixCls, true), _defineProperty(_itemClassName, "".concat(itemPrefixCls, "-with-help"), hasHelp || debounceErrors.length || debounceWarnings.length), _defineProperty(_itemClassName, "".concat(className), !!className), _defineProperty(_itemClassName, "".concat(itemPrefixCls, "-has-feedback"), mergedValidateStatus && hasFeedback), _defineProperty(_itemClassName, "".concat(itemPrefixCls, "-has-success"), mergedValidateStatus === 'success'), _defineProperty(_itemClassName, "".concat(itemPrefixCls, "-has-warning"), mergedValidateStatus === 'warning'), _defineProperty(_itemClassName, "".concat(itemPrefixCls, "-has-error"), mergedValidateStatus === 'error'), _defineProperty(_itemClassName, "".concat(itemPrefixCls, "-is-validating"), mergedValidateStatus === 'validating'), _defineProperty(_itemClassName, "".concat(itemPrefixCls, "-hidden"), hidden), _defineProperty(_itemClassName, 'lm_form-item-tip-error lm_form-item-tip-error-top', errorPlacement === 'top'), _defineProperty(_itemClassName, 'lm_form-item-tip-error lm_form-item-tip-error-left', errorPlacement === 'left'), _defineProperty(_itemClassName, 'lm_form-item-tip-error lm_form-item-tip-error-right', errorPlacement === 'right'), _defineProperty(_itemClassName, 'lm_form-item-tip-error lm_form-item-tip-error-bottom', errorPlacement === 'bottom'), _defineProperty(_itemClassName, 'ant-form-item-responsive', responsive), _itemClassName);
|
|
122
|
-
var nthCls = '';
|
|
123
|
-
|
|
124
|
-
if (itemRef.current && itemRef.current.classList) {
|
|
125
|
-
var list = itemRef.current.classList;
|
|
126
|
-
if (list.contains('nth-three')) nthCls = 'nth-three';
|
|
127
|
-
if (list.contains('nth-four')) nthCls = 'nth-four';
|
|
128
|
-
if (list.contains('nth-five')) nthCls = 'nth-five';
|
|
129
|
-
}
|
|
130
|
-
|
|
131
122
|
return /*#__PURE__*/React.createElement("div", {
|
|
132
|
-
className: classNames(itemClassName
|
|
123
|
+
className: classNames(itemClassName),
|
|
133
124
|
style: style,
|
|
134
125
|
ref: itemRef
|
|
135
126
|
}, /*#__PURE__*/React.createElement(Row, Object.assign({
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import WrapperItem from './WrapperItem';
|
|
3
|
+
|
|
4
|
+
function withComponent(WrappedComponent) {
|
|
5
|
+
var WithComponent = function WithComponent(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement(WrappedComponent, Object.assign({}, props, {
|
|
7
|
+
with: true
|
|
8
|
+
}));
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
12
|
+
WithComponent.displayName = "withComponent(".concat(wrappedComponentName, ")");
|
|
13
|
+
return WithComponent;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
var FormWrapper = function FormWrapper(props) {
|
|
17
|
+
var children = props.children;
|
|
18
|
+
return /*#__PURE__*/React.createElement(WrapperItem, {
|
|
19
|
+
children: children
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default withComponent(FormWrapper);
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { throttle } from 'lodash';
|
|
5
|
+
import Row from '../Row';
|
|
6
|
+
import Col from '../Col'; // 行个数 => 在24份中占用的分数
|
|
7
|
+
|
|
8
|
+
var rowMap = new Map([[5, [4, 1]], [4, [5, 1]], [3, [7, 1]]]);
|
|
9
|
+
|
|
10
|
+
function getResult(children, countPerRow) {
|
|
11
|
+
var _a;
|
|
12
|
+
|
|
13
|
+
var _rowMap$get = rowMap.get(countPerRow),
|
|
14
|
+
_rowMap$get2 = _slicedToArray(_rowMap$get, 2),
|
|
15
|
+
colSpan = _rowMap$get2[0],
|
|
16
|
+
colSpace = _rowMap$get2[1]; // 收集(满了就重置)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
var collection = []; // 最终的结果
|
|
20
|
+
|
|
21
|
+
var result = [];
|
|
22
|
+
children = Array.prototype.slice.call(children).flat();
|
|
23
|
+
|
|
24
|
+
function handle() {
|
|
25
|
+
var node = /*#__PURE__*/React.createElement(Row, null, collection.map(function (child, index) {
|
|
26
|
+
if (index !== collection.length - 1) {
|
|
27
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
28
|
+
key: index
|
|
29
|
+
}, /*#__PURE__*/React.createElement(Col, {
|
|
30
|
+
span: colSpan
|
|
31
|
+
}, child), /*#__PURE__*/React.createElement(Col, {
|
|
32
|
+
span: colSpace
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return /*#__PURE__*/React.createElement(Col, {
|
|
37
|
+
span: colSpan,
|
|
38
|
+
key: index
|
|
39
|
+
}, child);
|
|
40
|
+
}));
|
|
41
|
+
result.push(node);
|
|
42
|
+
collection.length = 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
for (var i = 0; i < children.length; i += 1) {
|
|
46
|
+
var child = children[i]; // 过滤掉React.Fragment
|
|
47
|
+
|
|
48
|
+
while (child.type === Symbol.for('react.fragment')) {
|
|
49
|
+
if (Array.isArray(child.props.children)) {
|
|
50
|
+
var _children;
|
|
51
|
+
|
|
52
|
+
(_children = children).splice.apply(_children, [i, 1].concat(_toConsumableArray(child.props.children)));
|
|
53
|
+
|
|
54
|
+
child = children[i];
|
|
55
|
+
} else {
|
|
56
|
+
child = child.props.children;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.responsive) {
|
|
61
|
+
collection.push(child);
|
|
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);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (collection.length) {
|
|
75
|
+
handle();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
var WrapperItem = function WrapperItem(props) {
|
|
82
|
+
var children = props.children;
|
|
83
|
+
var targetRef = useRef(null);
|
|
84
|
+
|
|
85
|
+
var _useState = useState({
|
|
86
|
+
width: '100%',
|
|
87
|
+
height: '100%'
|
|
88
|
+
}),
|
|
89
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
90
|
+
containerSize = _useState2[0],
|
|
91
|
+
setContainerSize = _useState2[1]; // 每行的个数
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
var _useState3 = useState(5),
|
|
95
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
96
|
+
countPerRow = _useState4[0],
|
|
97
|
+
setCountPerRow = _useState4[1];
|
|
98
|
+
|
|
99
|
+
var result = getResult(children, countPerRow);
|
|
100
|
+
|
|
101
|
+
var changeSize = function changeSize() {
|
|
102
|
+
var _a;
|
|
103
|
+
|
|
104
|
+
var maxWidth = 1824;
|
|
105
|
+
|
|
106
|
+
var _ref = ((_a = targetRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) || {},
|
|
107
|
+
_ref$width = _ref.width,
|
|
108
|
+
width = _ref$width === void 0 ? '100%' : _ref$width;
|
|
109
|
+
|
|
110
|
+
if (width < 990) {
|
|
111
|
+
setCountPerRow(3);
|
|
112
|
+
} else if (width < 1390) {
|
|
113
|
+
setCountPerRow(4);
|
|
114
|
+
} else {
|
|
115
|
+
setCountPerRow(5);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (width !== '100%' && width > maxWidth) {
|
|
119
|
+
width = maxWidth;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
setContainerSize({
|
|
123
|
+
width: width - 32
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
var handResize = throttle(changeSize, 600);
|
|
128
|
+
useEffect(function () {
|
|
129
|
+
changeSize();
|
|
130
|
+
window.addEventListener('resize', handResize);
|
|
131
|
+
return function () {
|
|
132
|
+
window.removeEventListener('resize', handResize);
|
|
133
|
+
};
|
|
134
|
+
}, []);
|
|
135
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
136
|
+
className: "lm_container_wrapper",
|
|
137
|
+
ref: targetRef
|
|
138
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
139
|
+
style: Object.assign(Object.assign({}, containerSize), {
|
|
140
|
+
margin: '0 auto'
|
|
141
|
+
})
|
|
142
|
+
}, result.map(function (child, index) {
|
|
143
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
144
|
+
key: index
|
|
145
|
+
}, child);
|
|
146
|
+
}))));
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export default WrapperItem;
|
package/es/Form/container.js
CHANGED
|
@@ -38,19 +38,7 @@ var LMContainer = function LMContainer(props) {
|
|
|
38
38
|
var width = containerSize.width,
|
|
39
39
|
height = containerSize.height;
|
|
40
40
|
var responsiveCls = responsive && width !== '100%' ? 'responsive' : '';
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
if (responsiveCls) {
|
|
44
|
-
if (parseInt(width) < 990) {
|
|
45
|
-
lm_col = 'lm_col_3';
|
|
46
|
-
} else if (parseInt(width) < 1390) {
|
|
47
|
-
lm_col = 'lm_col_4';
|
|
48
|
-
} else {
|
|
49
|
-
lm_col = 'lm_col_5';
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
var classes = classNames(className, prefixCls, responsiveCls, lm_col);
|
|
41
|
+
var classes = classNames(className, prefixCls, responsiveCls);
|
|
54
42
|
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
55
43
|
className: classes
|
|
56
44
|
}, 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/es/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/es/Form/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import InternalForm, { useForm, useWatch } from './Form';
|
|
|
5
5
|
import Item from './FormItem';
|
|
6
6
|
import List from './FormList';
|
|
7
7
|
import useFormInstance from './hooks/useFormInstance';
|
|
8
|
+
import Wrapper from './FormWrapper';
|
|
8
9
|
var Form = InternalForm;
|
|
9
10
|
Form.Item = Item;
|
|
10
11
|
Form.List = List;
|
|
@@ -18,4 +19,5 @@ Form.create = function () {
|
|
|
18
19
|
warning(false, 'Form', 'antd v4 removed `Form.create`. Please remove or use `@ant-design/compatible` instead.');
|
|
19
20
|
};
|
|
20
21
|
|
|
22
|
+
Form.Wrapper = Wrapper;
|
|
21
23
|
export default Form;
|
package/es/Form/interface.d.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
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
|
+
}
|
package/es/Form/style/index.css
CHANGED
|
@@ -6613,57 +6613,22 @@ 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;
|
|
6629
|
-
}
|
|
6630
|
-
.lm_container_wrapper .lm_container.responsive .lm_form.ant-form .ant-form-item-responsive .ant-form-item-control {
|
|
6631
|
-
width: 100%;
|
|
6632
|
-
}
|
|
6633
|
-
.lm_container_wrapper .lm_container.responsive.lm_col_3 .ant-form-item {
|
|
6634
|
-
width: 100%;
|
|
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;
|
|
6640
|
-
}
|
|
6641
|
-
.lm_container_wrapper .lm_container.responsive.lm_col_3 .ant-form-item-responsive.nth-three {
|
|
6642
|
-
margin-right: 0;
|
|
6643
|
-
}
|
|
6644
|
-
.lm_container_wrapper .lm_container.responsive.lm_col_4 .ant-form-item {
|
|
6645
|
-
width: 100%;
|
|
6646
|
-
margin-right: 0;
|
|
6647
|
-
}
|
|
6648
|
-
.lm_container_wrapper .lm_container.responsive.lm_col_4 .ant-form-item-responsive {
|
|
6649
|
-
width: calc(25% - 18px);
|
|
6650
|
-
margin-right: 24px;
|
|
6651
|
-
}
|
|
6652
|
-
.lm_container_wrapper .lm_container.responsive.lm_col_4 .ant-form-item-responsive.nth-four {
|
|
6653
|
-
margin-right: 0;
|
|
6654
|
-
}
|
|
6655
|
-
.lm_container_wrapper .lm_container.responsive.lm_col_5 .ant-form-item {
|
|
6656
|
-
width: 100%;
|
|
6657
|
-
margin-right: 0;
|
|
6616
|
+
.lm_form_responsive_box .lm_form {
|
|
6617
|
+
background: #f0f0f0;
|
|
6658
6618
|
}
|
|
6659
|
-
.
|
|
6660
|
-
|
|
6661
|
-
|
|
6619
|
+
.lm_form_responsive_box .lm_form > .lm_container_wrapper {
|
|
6620
|
+
padding: 16px;
|
|
6621
|
+
background: #f0f0f0;
|
|
6622
|
+
margin-bottom: 0;
|
|
6623
|
+
border-radius: 0;
|
|
6662
6624
|
}
|
|
6663
|
-
.lm_container_wrapper
|
|
6664
|
-
|
|
6625
|
+
.lm_container_wrapper {
|
|
6626
|
+
overflow: auto;
|
|
6627
|
+
background: #fff;
|
|
6628
|
+
margin-bottom: 16px;
|
|
6629
|
+
border-radius: 2px;
|
|
6665
6630
|
}
|
|
6666
|
-
.lm_container_wrapper .
|
|
6631
|
+
.lm_container_wrapper .ant-cascader {
|
|
6667
6632
|
width: 100%;
|
|
6668
6633
|
}
|
|
6669
6634
|
.lm_form-item-tip-error .ant-form-item-explain {
|
|
@@ -6101,57 +6101,22 @@
|
|
|
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;
|
|
6124
|
-
}
|
|
6125
|
-
.lm_container_wrapper .lm_container.responsive.lm_col_3 .ant-form-item-responsive {
|
|
6126
|
-
width: calc(33.3333% - 16px);
|
|
6127
|
-
margin-right: 24px;
|
|
6128
|
-
}
|
|
6129
|
-
.lm_container_wrapper .lm_container.responsive.lm_col_3 .ant-form-item-responsive.nth-three {
|
|
6130
|
-
margin-right: 0;
|
|
6104
|
+
.lm_form_responsive_box .lm_form {
|
|
6105
|
+
background: #f0f0f0;
|
|
6131
6106
|
}
|
|
6132
|
-
.
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
width: calc(25% - 18px);
|
|
6138
|
-
margin-right: 24px;
|
|
6139
|
-
}
|
|
6140
|
-
.lm_container_wrapper .lm_container.responsive.lm_col_4 .ant-form-item-responsive.nth-four {
|
|
6141
|
-
margin-right: 0;
|
|
6142
|
-
}
|
|
6143
|
-
.lm_container_wrapper .lm_container.responsive.lm_col_5 .ant-form-item {
|
|
6144
|
-
width: 100%;
|
|
6145
|
-
margin-right: 0;
|
|
6146
|
-
}
|
|
6147
|
-
.lm_container_wrapper .lm_container.responsive.lm_col_5 .ant-form-item-responsive {
|
|
6148
|
-
width: calc(20% - 96px / 5);
|
|
6149
|
-
margin-right: 24px;
|
|
6107
|
+
.lm_form_responsive_box .lm_form > .lm_container_wrapper {
|
|
6108
|
+
padding: 16px;
|
|
6109
|
+
background: #f0f0f0;
|
|
6110
|
+
margin-bottom: 0;
|
|
6111
|
+
border-radius: 0;
|
|
6150
6112
|
}
|
|
6151
|
-
.lm_container_wrapper
|
|
6152
|
-
|
|
6113
|
+
.lm_container_wrapper {
|
|
6114
|
+
overflow: auto;
|
|
6115
|
+
background: #fff;
|
|
6116
|
+
margin-bottom: 16px;
|
|
6117
|
+
border-radius: 2px;
|
|
6153
6118
|
}
|
|
6154
|
-
.lm_container_wrapper .
|
|
6119
|
+
.lm_container_wrapper .ant-cascader {
|
|
6155
6120
|
width: 100%;
|
|
6156
6121
|
}
|
|
6157
6122
|
.lm_form-item-tip-error .ant-form-item-explain {
|
|
@@ -510,8 +510,12 @@ html {
|
|
|
510
510
|
p {
|
|
511
511
|
margin-bottom: 0;
|
|
512
512
|
}
|
|
513
|
+
.lm_input-number {
|
|
514
|
+
width: 100%;
|
|
515
|
+
}
|
|
513
516
|
.lm_input-number.ant-input-number {
|
|
514
517
|
border: 1px solid var(--color-15);
|
|
518
|
+
width: 100%;
|
|
515
519
|
}
|
|
516
520
|
.lm_input-number .ant-input-number-handler-wrap {
|
|
517
521
|
width: 28px;
|