linkmore-design 1.1.28-alpha.6 → 1.1.28-alpha.7
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/index.umd.js +128 -101
- package/dist/index.umd.min.js +1 -1
- package/dist/variables.css +1 -6
- package/es/CustomTableOption/columnsSort.js +2 -3
- package/es/LmEditTable/EditTable.js +120 -92
- package/es/LmEditTable/style/index.css +1 -6
- package/es/LmEditTable/style/variables.css +1 -6
- package/es/styles/variables.css +1 -6
- package/lib/CustomTableOption/columnsSort.js +2 -3
- package/lib/LmEditTable/EditTable.js +120 -92
- package/lib/LmEditTable/style/index.css +1 -6
- package/lib/LmEditTable/style/variables.css +1 -6
- package/lib/styles/variables.css +1 -6
- package/package.json +1 -1
package/dist/variables.css
CHANGED
|
@@ -9734,7 +9734,7 @@ p {
|
|
|
9734
9734
|
content: '-';
|
|
9735
9735
|
}
|
|
9736
9736
|
.lm_editTable_warpper .ant-table-thead .ant-table-cell {
|
|
9737
|
-
height: 40px;
|
|
9737
|
+
min-height: 40px;
|
|
9738
9738
|
padding: 10px 8px;
|
|
9739
9739
|
font-family: PingFangSC-Medium;
|
|
9740
9740
|
font-size: 12px;
|
|
@@ -9763,11 +9763,6 @@ p {
|
|
|
9763
9763
|
.lm_editTable_warpper .lm_custom_cell_td {
|
|
9764
9764
|
position: relative;
|
|
9765
9765
|
}
|
|
9766
|
-
.lm_editTable_warpper .lm_custom_cell_td.ant-table-cell-with-append {
|
|
9767
|
-
display: flex;
|
|
9768
|
-
flex-direction: row;
|
|
9769
|
-
flex-wrap: nowrap;
|
|
9770
|
-
}
|
|
9771
9766
|
.lm_editTable_warpper .lm_custom_cell_td.ant-table-cell-with-append .ant-table-row-expand-icon {
|
|
9772
9767
|
margin-right: 8px;
|
|
9773
9768
|
flex: none;
|
|
@@ -117,9 +117,9 @@ var ColumnsSort = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
117
117
|
var _a;
|
|
118
118
|
|
|
119
119
|
var cloneCol = (_a = cloneDeep(localColumns)) === null || _a === void 0 ? void 0 : _a.filter(function (item) {
|
|
120
|
-
var _a;
|
|
120
|
+
var _a, _b;
|
|
121
121
|
|
|
122
|
-
return isFunction(item.title) ?
|
|
122
|
+
return isFunction(item.title) || ((_a = item.title) === null || _a === void 0 ? void 0 : _a.$$typeof) ? true : ((_b = item.title) === null || _b === void 0 ? void 0 : _b.indexOf(searchValue)) > -1;
|
|
123
123
|
});
|
|
124
124
|
cloneCol.forEach(function (item, index) {
|
|
125
125
|
var _a, _b, _c;
|
|
@@ -283,7 +283,6 @@ var ColumnsSort = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
283
283
|
}
|
|
284
284
|
};
|
|
285
285
|
});
|
|
286
|
-
console.log(sortMenu, 'sortMenu');
|
|
287
286
|
return /*#__PURE__*/React.createElement("div", {
|
|
288
287
|
className: "lm_custom_option_columns"
|
|
289
288
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -557,7 +557,13 @@ var EditableCell = function EditableCell(props) {
|
|
|
557
557
|
onClick: toggleEdit
|
|
558
558
|
}, childNode);
|
|
559
559
|
} else if (isEdit && editable) {
|
|
560
|
-
childNode = /*#__PURE__*/React.createElement(
|
|
560
|
+
childNode = /*#__PURE__*/React.createElement("div", {
|
|
561
|
+
style: {
|
|
562
|
+
display: 'flex',
|
|
563
|
+
flexDirection: 'row',
|
|
564
|
+
flexWrap: 'nowrap'
|
|
565
|
+
}
|
|
566
|
+
}, isExpandRow(childNode) && childNode[0], /*#__PURE__*/React.createElement(Form.Item, Object.assign({
|
|
561
567
|
errorPlacement: "right",
|
|
562
568
|
valuePropName: editable === 'switch' ? 'checked' : 'value',
|
|
563
569
|
style: {
|
|
@@ -569,7 +575,13 @@ var EditableCell = function EditableCell(props) {
|
|
|
569
575
|
}), Control(editable)));
|
|
570
576
|
|
|
571
577
|
if (editable === 'input' && ((resultComponentProps === null || resultComponentProps === void 0 ? void 0 : resultComponentProps.addonBefore) || (resultComponentProps === null || resultComponentProps === void 0 ? void 0 : resultComponentProps.addonAfter))) {
|
|
572
|
-
childNode = /*#__PURE__*/React.createElement(
|
|
578
|
+
childNode = /*#__PURE__*/React.createElement("div", {
|
|
579
|
+
style: {
|
|
580
|
+
display: 'flex',
|
|
581
|
+
flexDirection: 'row',
|
|
582
|
+
flexWrap: 'nowrap'
|
|
583
|
+
}
|
|
584
|
+
}, isExpandRow(childNode) && childNode[0], /*#__PURE__*/React.createElement(Form.Item, Object.assign({
|
|
573
585
|
errorPlacement: "right",
|
|
574
586
|
style: {
|
|
575
587
|
margin: 0
|
|
@@ -774,80 +786,7 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
774
786
|
draft.push(Object.assign(_defineProperty({}, _rowKey, "".concat(Date.now())), addDataInfo || {}));
|
|
775
787
|
});
|
|
776
788
|
setDataSource(res);
|
|
777
|
-
}, 40);
|
|
778
|
-
|
|
779
|
-
var handleSave = function handleSave(row, options) {
|
|
780
|
-
var _a, _b;
|
|
781
|
-
|
|
782
|
-
var preKeys = (_b = (_a = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : deepDataSourceRef.current) === null || _a === void 0 ? void 0 : _a[row[_rowKey]]) === null || _b === void 0 ? void 0 : _b.preKeys;
|
|
783
|
-
var res = produce(dataSourceRef.current, function (draft) {
|
|
784
|
-
if (options === null || options === void 0 ? void 0 : options.only) {
|
|
785
|
-
var _ref = options === null || options === void 0 ? void 0 : options.only,
|
|
786
|
-
key = _ref.key,
|
|
787
|
-
value = _ref.value;
|
|
788
|
-
|
|
789
|
-
if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
|
|
790
|
-
var deeps = function deeps(children) {
|
|
791
|
-
children === null || children === void 0 ? void 0 : children.forEach(function (item) {
|
|
792
|
-
var _a;
|
|
793
|
-
|
|
794
|
-
if (preKeys.includes(item[_rowKey])) {
|
|
795
|
-
if (item[_rowKey] === row[_rowKey]) {
|
|
796
|
-
children === null || children === void 0 ? void 0 : children.forEach(function (c) {
|
|
797
|
-
c[key] = value;
|
|
798
|
-
});
|
|
799
|
-
(_a = Object.keys(item)) === null || _a === void 0 ? void 0 : _a.forEach(function (v) {
|
|
800
|
-
item[v] = row[v] || item[v];
|
|
801
|
-
});
|
|
802
|
-
} else if (item.children) {
|
|
803
|
-
deeps(item.children);
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
});
|
|
807
|
-
};
|
|
808
|
-
|
|
809
|
-
deeps(draft);
|
|
810
|
-
} else {
|
|
811
|
-
draft === null || draft === void 0 ? void 0 : draft.forEach(function (item, index) {
|
|
812
|
-
if (row[_rowKey] === item[_rowKey]) {
|
|
813
|
-
draft[index] = row;
|
|
814
|
-
} else {
|
|
815
|
-
draft[index][key] = value;
|
|
816
|
-
}
|
|
817
|
-
});
|
|
818
|
-
}
|
|
819
|
-
} else {
|
|
820
|
-
if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
|
|
821
|
-
var _deeps = function _deeps(children) {
|
|
822
|
-
children === null || children === void 0 ? void 0 : children.forEach(function (item) {
|
|
823
|
-
var _a;
|
|
824
|
-
|
|
825
|
-
if (preKeys.includes(item[_rowKey])) {
|
|
826
|
-
if (item[_rowKey] === row[_rowKey]) {
|
|
827
|
-
(_a = Object.keys(row)) === null || _a === void 0 ? void 0 : _a.forEach(function (v) {
|
|
828
|
-
item[v] = row[v] || item[v];
|
|
829
|
-
});
|
|
830
|
-
} else if (item.children) {
|
|
831
|
-
_deeps(item.children);
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
});
|
|
835
|
-
};
|
|
836
|
-
|
|
837
|
-
_deeps(draft);
|
|
838
|
-
} else {
|
|
839
|
-
var index = draft.findIndex(function (item) {
|
|
840
|
-
return row[_rowKey] === item[_rowKey];
|
|
841
|
-
});
|
|
842
|
-
|
|
843
|
-
if (index !== -1) {
|
|
844
|
-
draft[index] = row;
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
});
|
|
849
|
-
setDataSource(res);
|
|
850
|
-
}; // const reWriteOriginSource = (rowKey: string, rowValue, dataIndex: number, nextValue) => {
|
|
789
|
+
}, 40); // const reWriteOriginSource = (rowKey: string, rowValue, dataIndex: number, nextValue) => {
|
|
851
790
|
// setDataSource((prevDataSource) => {
|
|
852
791
|
// return prevDataSource?.map((item) => {
|
|
853
792
|
// if (get(item, rowKey) === rowValue) {
|
|
@@ -861,7 +800,6 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
861
800
|
|
|
862
801
|
/** 删除当前行 */
|
|
863
802
|
|
|
864
|
-
|
|
865
803
|
var handleTableRowDelete = debounce(function (key) {
|
|
866
804
|
var _a, _b, _c;
|
|
867
805
|
|
|
@@ -934,7 +872,7 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
934
872
|
|
|
935
873
|
var res = deep(dataSourceRef.current);
|
|
936
874
|
setDataSource(res);
|
|
937
|
-
},
|
|
875
|
+
}, 20);
|
|
938
876
|
/** 快捷添加 */
|
|
939
877
|
|
|
940
878
|
var handleTableRowAdd = debounce(function (record, isAppendInChindren, defaultRecord) {
|
|
@@ -1017,8 +955,87 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1017
955
|
});
|
|
1018
956
|
setDataSource(res);
|
|
1019
957
|
}, 50);
|
|
958
|
+
|
|
959
|
+
var handleSave = function handleSave(row, options) {
|
|
960
|
+
var _a, _b;
|
|
961
|
+
|
|
962
|
+
var preKeys = (_b = (_a = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : deepDataSourceRef.current) === null || _a === void 0 ? void 0 : _a[row[_rowKey]]) === null || _b === void 0 ? void 0 : _b.preKeys;
|
|
963
|
+
|
|
964
|
+
if (options === null || options === void 0 ? void 0 : options.only) {
|
|
965
|
+
var res = produce(dataSourceRef.current, function (draft) {
|
|
966
|
+
if (options === null || options === void 0 ? void 0 : options.only) {
|
|
967
|
+
var _ref7 = options === null || options === void 0 ? void 0 : options.only,
|
|
968
|
+
key = _ref7.key,
|
|
969
|
+
value = _ref7.value;
|
|
970
|
+
|
|
971
|
+
if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
|
|
972
|
+
var deeps = function deeps(children) {
|
|
973
|
+
children === null || children === void 0 ? void 0 : children.forEach(function (item) {
|
|
974
|
+
var _a;
|
|
975
|
+
|
|
976
|
+
if (preKeys.includes(item[_rowKey])) {
|
|
977
|
+
if (item[_rowKey] === row[_rowKey]) {
|
|
978
|
+
children === null || children === void 0 ? void 0 : children.forEach(function (c) {
|
|
979
|
+
c[key] = value;
|
|
980
|
+
});
|
|
981
|
+
(_a = Object.keys(item)) === null || _a === void 0 ? void 0 : _a.forEach(function (v) {
|
|
982
|
+
item[v] = row[v] || item[v];
|
|
983
|
+
});
|
|
984
|
+
} else if (item.children) {
|
|
985
|
+
deeps(item.children);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
});
|
|
989
|
+
};
|
|
990
|
+
|
|
991
|
+
deeps(draft);
|
|
992
|
+
} else {
|
|
993
|
+
draft === null || draft === void 0 ? void 0 : draft.forEach(function (item, index) {
|
|
994
|
+
if (row[_rowKey] === item[_rowKey]) {
|
|
995
|
+
draft[index] = row;
|
|
996
|
+
} else {
|
|
997
|
+
draft[index][key] = value;
|
|
998
|
+
}
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
} else {
|
|
1002
|
+
if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
|
|
1003
|
+
var _deeps = function _deeps(children) {
|
|
1004
|
+
children === null || children === void 0 ? void 0 : children.forEach(function (item) {
|
|
1005
|
+
var _a;
|
|
1006
|
+
|
|
1007
|
+
if (preKeys.includes(item[_rowKey])) {
|
|
1008
|
+
if (item[_rowKey] === row[_rowKey]) {
|
|
1009
|
+
(_a = Object.keys(row)) === null || _a === void 0 ? void 0 : _a.forEach(function (v) {
|
|
1010
|
+
item[v] = row[v] || item[v];
|
|
1011
|
+
});
|
|
1012
|
+
} else if (item.children) {
|
|
1013
|
+
_deeps(item.children);
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
});
|
|
1017
|
+
};
|
|
1018
|
+
|
|
1019
|
+
_deeps(draft);
|
|
1020
|
+
} else {
|
|
1021
|
+
var index = draft.findIndex(function (item) {
|
|
1022
|
+
return row[_rowKey] === item[_rowKey];
|
|
1023
|
+
});
|
|
1024
|
+
|
|
1025
|
+
if (index !== -1) {
|
|
1026
|
+
draft[index] = row;
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
});
|
|
1031
|
+
setDataSource(res);
|
|
1032
|
+
} else {
|
|
1033
|
+
handleTableRowReplace(row[_rowKey], row);
|
|
1034
|
+
}
|
|
1035
|
+
};
|
|
1020
1036
|
/** 快捷刷子功能 */
|
|
1021
1037
|
|
|
1038
|
+
|
|
1022
1039
|
var handleCopy = function handleCopy(key, value, type, rowIndex) {
|
|
1023
1040
|
var res = produce(dataSourceRef.current, function (draft) {
|
|
1024
1041
|
draft === null || draft === void 0 ? void 0 : draft.forEach(function (item, index) {
|
|
@@ -1614,6 +1631,29 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1614
1631
|
};
|
|
1615
1632
|
}
|
|
1616
1633
|
}, []);
|
|
1634
|
+
var checkFormItem = useMemo(function () {
|
|
1635
|
+
var arr = [];
|
|
1636
|
+
columns.forEach(function (item) {
|
|
1637
|
+
var _a;
|
|
1638
|
+
|
|
1639
|
+
if (item.children) {
|
|
1640
|
+
(_a = item.children) === null || _a === void 0 ? void 0 : _a.forEach(function (c) {
|
|
1641
|
+
arr.push( /*#__PURE__*/React.createElement(Form.Item, Object.assign({
|
|
1642
|
+
noStyle: true,
|
|
1643
|
+
key: c.dataIndex,
|
|
1644
|
+
name: c.dataIndex
|
|
1645
|
+
}, (c === null || c === void 0 ? void 0 : c['formProps']) || {}), c.dataIndex || 'text'));
|
|
1646
|
+
});
|
|
1647
|
+
} else {
|
|
1648
|
+
arr.push( /*#__PURE__*/React.createElement(Form.Item, Object.assign({
|
|
1649
|
+
noStyle: true,
|
|
1650
|
+
key: item.dataIndex,
|
|
1651
|
+
name: item.dataIndex
|
|
1652
|
+
}, (item === null || item === void 0 ? void 0 : item['formProps']) || {}), item.dataIndex || 'text'));
|
|
1653
|
+
}
|
|
1654
|
+
});
|
|
1655
|
+
return arr;
|
|
1656
|
+
}, [columns]);
|
|
1617
1657
|
|
|
1618
1658
|
if (colSortOpen) {
|
|
1619
1659
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -1663,13 +1703,7 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1663
1703
|
}, /*#__PURE__*/React.createElement(Form, {
|
|
1664
1704
|
form: checkForm,
|
|
1665
1705
|
component: false
|
|
1666
|
-
},
|
|
1667
|
-
return /*#__PURE__*/React.createElement(Form.Item, Object.assign({
|
|
1668
|
-
noStyle: true,
|
|
1669
|
-
key: item.dataIndex,
|
|
1670
|
-
name: item.dataIndex
|
|
1671
|
-
}, (item === null || item === void 0 ? void 0 : item['formProps']) || {}), item.dataIndex || 'text');
|
|
1672
|
-
}))));
|
|
1706
|
+
}, checkFormItem)));
|
|
1673
1707
|
} // @ts-ignore
|
|
1674
1708
|
|
|
1675
1709
|
|
|
@@ -1729,12 +1763,6 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
1729
1763
|
}, /*#__PURE__*/React.createElement(Form, {
|
|
1730
1764
|
form: checkForm,
|
|
1731
1765
|
component: false
|
|
1732
|
-
},
|
|
1733
|
-
return /*#__PURE__*/React.createElement(Form.Item, Object.assign({
|
|
1734
|
-
noStyle: true,
|
|
1735
|
-
key: item.dataIndex,
|
|
1736
|
-
name: item.dataIndex
|
|
1737
|
-
}, (item === null || item === void 0 ? void 0 : item['formProps']) || {}), item.dataIndex || 'text');
|
|
1738
|
-
}))));
|
|
1766
|
+
}, checkFormItem)));
|
|
1739
1767
|
});
|
|
1740
1768
|
export default /*#__PURE__*/memo(EditTable);
|
|
@@ -530,7 +530,7 @@ p {
|
|
|
530
530
|
content: '-';
|
|
531
531
|
}
|
|
532
532
|
.lm_editTable_warpper .ant-table-thead .ant-table-cell {
|
|
533
|
-
height: 40px;
|
|
533
|
+
min-height: 40px;
|
|
534
534
|
padding: 10px 8px;
|
|
535
535
|
font-family: PingFangSC-Medium;
|
|
536
536
|
font-size: 12px;
|
|
@@ -559,11 +559,6 @@ p {
|
|
|
559
559
|
.lm_editTable_warpper .lm_custom_cell_td {
|
|
560
560
|
position: relative;
|
|
561
561
|
}
|
|
562
|
-
.lm_editTable_warpper .lm_custom_cell_td.ant-table-cell-with-append {
|
|
563
|
-
display: flex;
|
|
564
|
-
flex-direction: row;
|
|
565
|
-
flex-wrap: nowrap;
|
|
566
|
-
}
|
|
567
562
|
.lm_editTable_warpper .lm_custom_cell_td.ant-table-cell-with-append .ant-table-row-expand-icon {
|
|
568
563
|
margin-right: 8px;
|
|
569
564
|
flex: none;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
content: '-';
|
|
19
19
|
}
|
|
20
20
|
.lm_editTable_warpper .ant-table-thead .ant-table-cell {
|
|
21
|
-
height: 40px;
|
|
21
|
+
min-height: 40px;
|
|
22
22
|
padding: 10px 8px;
|
|
23
23
|
font-family: PingFangSC-Medium;
|
|
24
24
|
font-size: 12px;
|
|
@@ -47,11 +47,6 @@
|
|
|
47
47
|
.lm_editTable_warpper .lm_custom_cell_td {
|
|
48
48
|
position: relative;
|
|
49
49
|
}
|
|
50
|
-
.lm_editTable_warpper .lm_custom_cell_td.ant-table-cell-with-append {
|
|
51
|
-
display: flex;
|
|
52
|
-
flex-direction: row;
|
|
53
|
-
flex-wrap: nowrap;
|
|
54
|
-
}
|
|
55
50
|
.lm_editTable_warpper .lm_custom_cell_td.ant-table-cell-with-append .ant-table-row-expand-icon {
|
|
56
51
|
margin-right: 8px;
|
|
57
52
|
flex: none;
|
package/es/styles/variables.css
CHANGED
|
@@ -9734,7 +9734,7 @@ p {
|
|
|
9734
9734
|
content: '-';
|
|
9735
9735
|
}
|
|
9736
9736
|
.lm_editTable_warpper .ant-table-thead .ant-table-cell {
|
|
9737
|
-
height: 40px;
|
|
9737
|
+
min-height: 40px;
|
|
9738
9738
|
padding: 10px 8px;
|
|
9739
9739
|
font-family: PingFangSC-Medium;
|
|
9740
9740
|
font-size: 12px;
|
|
@@ -9763,11 +9763,6 @@ p {
|
|
|
9763
9763
|
.lm_editTable_warpper .lm_custom_cell_td {
|
|
9764
9764
|
position: relative;
|
|
9765
9765
|
}
|
|
9766
|
-
.lm_editTable_warpper .lm_custom_cell_td.ant-table-cell-with-append {
|
|
9767
|
-
display: flex;
|
|
9768
|
-
flex-direction: row;
|
|
9769
|
-
flex-wrap: nowrap;
|
|
9770
|
-
}
|
|
9771
9766
|
.lm_editTable_warpper .lm_custom_cell_td.ant-table-cell-with-append .ant-table-row-expand-icon {
|
|
9772
9767
|
margin-right: 8px;
|
|
9773
9768
|
flex: none;
|
|
@@ -139,9 +139,9 @@ var ColumnsSort = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
139
139
|
var _a;
|
|
140
140
|
|
|
141
141
|
var cloneCol = (_a = (0, _lodash.cloneDeep)(localColumns)) === null || _a === void 0 ? void 0 : _a.filter(function (item) {
|
|
142
|
-
var _a;
|
|
142
|
+
var _a, _b;
|
|
143
143
|
|
|
144
|
-
return (0, _lodash.isFunction)(item.title) ?
|
|
144
|
+
return (0, _lodash.isFunction)(item.title) || ((_a = item.title) === null || _a === void 0 ? void 0 : _a.$$typeof) ? true : ((_b = item.title) === null || _b === void 0 ? void 0 : _b.indexOf(searchValue)) > -1;
|
|
145
145
|
});
|
|
146
146
|
cloneCol.forEach(function (item, index) {
|
|
147
147
|
var _a, _b, _c;
|
|
@@ -305,7 +305,6 @@ var ColumnsSort = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
305
305
|
}
|
|
306
306
|
};
|
|
307
307
|
});
|
|
308
|
-
console.log(sortMenu, 'sortMenu');
|
|
309
308
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
310
309
|
className: "lm_custom_option_columns"
|
|
311
310
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -591,7 +591,13 @@ var EditableCell = function EditableCell(props) {
|
|
|
591
591
|
onClick: toggleEdit
|
|
592
592
|
}, childNode);
|
|
593
593
|
} else if (isEdit && editable) {
|
|
594
|
-
childNode = /*#__PURE__*/_react.default.createElement(
|
|
594
|
+
childNode = /*#__PURE__*/_react.default.createElement("div", {
|
|
595
|
+
style: {
|
|
596
|
+
display: 'flex',
|
|
597
|
+
flexDirection: 'row',
|
|
598
|
+
flexWrap: 'nowrap'
|
|
599
|
+
}
|
|
600
|
+
}, (0, _util.isExpandRow)(childNode) && childNode[0], /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Form.Item, Object.assign({
|
|
595
601
|
errorPlacement: "right",
|
|
596
602
|
valuePropName: editable === 'switch' ? 'checked' : 'value',
|
|
597
603
|
style: {
|
|
@@ -603,7 +609,13 @@ var EditableCell = function EditableCell(props) {
|
|
|
603
609
|
}), Control(editable)));
|
|
604
610
|
|
|
605
611
|
if (editable === 'input' && ((resultComponentProps === null || resultComponentProps === void 0 ? void 0 : resultComponentProps.addonBefore) || (resultComponentProps === null || resultComponentProps === void 0 ? void 0 : resultComponentProps.addonAfter))) {
|
|
606
|
-
childNode = /*#__PURE__*/_react.default.createElement(
|
|
612
|
+
childNode = /*#__PURE__*/_react.default.createElement("div", {
|
|
613
|
+
style: {
|
|
614
|
+
display: 'flex',
|
|
615
|
+
flexDirection: 'row',
|
|
616
|
+
flexWrap: 'nowrap'
|
|
617
|
+
}
|
|
618
|
+
}, (0, _util.isExpandRow)(childNode) && childNode[0], /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Form.Item, Object.assign({
|
|
607
619
|
errorPlacement: "right",
|
|
608
620
|
style: {
|
|
609
621
|
margin: 0
|
|
@@ -808,80 +820,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
808
820
|
draft.push(Object.assign((0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now())), addDataInfo || {}));
|
|
809
821
|
});
|
|
810
822
|
setDataSource(res);
|
|
811
|
-
}, 40);
|
|
812
|
-
|
|
813
|
-
var handleSave = function handleSave(row, options) {
|
|
814
|
-
var _a, _b;
|
|
815
|
-
|
|
816
|
-
var preKeys = (_b = (_a = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : deepDataSourceRef.current) === null || _a === void 0 ? void 0 : _a[row[_rowKey]]) === null || _b === void 0 ? void 0 : _b.preKeys;
|
|
817
|
-
var res = (0, _immer.produce)(dataSourceRef.current, function (draft) {
|
|
818
|
-
if (options === null || options === void 0 ? void 0 : options.only) {
|
|
819
|
-
var _ref = options === null || options === void 0 ? void 0 : options.only,
|
|
820
|
-
key = _ref.key,
|
|
821
|
-
value = _ref.value;
|
|
822
|
-
|
|
823
|
-
if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
|
|
824
|
-
var deeps = function deeps(children) {
|
|
825
|
-
children === null || children === void 0 ? void 0 : children.forEach(function (item) {
|
|
826
|
-
var _a;
|
|
827
|
-
|
|
828
|
-
if (preKeys.includes(item[_rowKey])) {
|
|
829
|
-
if (item[_rowKey] === row[_rowKey]) {
|
|
830
|
-
children === null || children === void 0 ? void 0 : children.forEach(function (c) {
|
|
831
|
-
c[key] = value;
|
|
832
|
-
});
|
|
833
|
-
(_a = Object.keys(item)) === null || _a === void 0 ? void 0 : _a.forEach(function (v) {
|
|
834
|
-
item[v] = row[v] || item[v];
|
|
835
|
-
});
|
|
836
|
-
} else if (item.children) {
|
|
837
|
-
deeps(item.children);
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
});
|
|
841
|
-
};
|
|
842
|
-
|
|
843
|
-
deeps(draft);
|
|
844
|
-
} else {
|
|
845
|
-
draft === null || draft === void 0 ? void 0 : draft.forEach(function (item, index) {
|
|
846
|
-
if (row[_rowKey] === item[_rowKey]) {
|
|
847
|
-
draft[index] = row;
|
|
848
|
-
} else {
|
|
849
|
-
draft[index][key] = value;
|
|
850
|
-
}
|
|
851
|
-
});
|
|
852
|
-
}
|
|
853
|
-
} else {
|
|
854
|
-
if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
|
|
855
|
-
var _deeps = function _deeps(children) {
|
|
856
|
-
children === null || children === void 0 ? void 0 : children.forEach(function (item) {
|
|
857
|
-
var _a;
|
|
858
|
-
|
|
859
|
-
if (preKeys.includes(item[_rowKey])) {
|
|
860
|
-
if (item[_rowKey] === row[_rowKey]) {
|
|
861
|
-
(_a = Object.keys(row)) === null || _a === void 0 ? void 0 : _a.forEach(function (v) {
|
|
862
|
-
item[v] = row[v] || item[v];
|
|
863
|
-
});
|
|
864
|
-
} else if (item.children) {
|
|
865
|
-
_deeps(item.children);
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
});
|
|
869
|
-
};
|
|
870
|
-
|
|
871
|
-
_deeps(draft);
|
|
872
|
-
} else {
|
|
873
|
-
var index = draft.findIndex(function (item) {
|
|
874
|
-
return row[_rowKey] === item[_rowKey];
|
|
875
|
-
});
|
|
876
|
-
|
|
877
|
-
if (index !== -1) {
|
|
878
|
-
draft[index] = row;
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
});
|
|
883
|
-
setDataSource(res);
|
|
884
|
-
}; // const reWriteOriginSource = (rowKey: string, rowValue, dataIndex: number, nextValue) => {
|
|
823
|
+
}, 40); // const reWriteOriginSource = (rowKey: string, rowValue, dataIndex: number, nextValue) => {
|
|
885
824
|
// setDataSource((prevDataSource) => {
|
|
886
825
|
// return prevDataSource?.map((item) => {
|
|
887
826
|
// if (get(item, rowKey) === rowValue) {
|
|
@@ -895,7 +834,6 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
895
834
|
|
|
896
835
|
/** 删除当前行 */
|
|
897
836
|
|
|
898
|
-
|
|
899
837
|
var handleTableRowDelete = (0, _lodash.debounce)(function (key) {
|
|
900
838
|
var _a, _b, _c;
|
|
901
839
|
|
|
@@ -968,7 +906,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
968
906
|
|
|
969
907
|
var res = deep(dataSourceRef.current);
|
|
970
908
|
setDataSource(res);
|
|
971
|
-
},
|
|
909
|
+
}, 20);
|
|
972
910
|
/** 快捷添加 */
|
|
973
911
|
|
|
974
912
|
var handleTableRowAdd = (0, _lodash.debounce)(function (record, isAppendInChindren, defaultRecord) {
|
|
@@ -1051,8 +989,87 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1051
989
|
});
|
|
1052
990
|
setDataSource(res);
|
|
1053
991
|
}, 50);
|
|
992
|
+
|
|
993
|
+
var handleSave = function handleSave(row, options) {
|
|
994
|
+
var _a, _b;
|
|
995
|
+
|
|
996
|
+
var preKeys = (_b = (_a = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : deepDataSourceRef.current) === null || _a === void 0 ? void 0 : _a[row[_rowKey]]) === null || _b === void 0 ? void 0 : _b.preKeys;
|
|
997
|
+
|
|
998
|
+
if (options === null || options === void 0 ? void 0 : options.only) {
|
|
999
|
+
var res = (0, _immer.produce)(dataSourceRef.current, function (draft) {
|
|
1000
|
+
if (options === null || options === void 0 ? void 0 : options.only) {
|
|
1001
|
+
var _ref7 = options === null || options === void 0 ? void 0 : options.only,
|
|
1002
|
+
key = _ref7.key,
|
|
1003
|
+
value = _ref7.value;
|
|
1004
|
+
|
|
1005
|
+
if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
|
|
1006
|
+
var deeps = function deeps(children) {
|
|
1007
|
+
children === null || children === void 0 ? void 0 : children.forEach(function (item) {
|
|
1008
|
+
var _a;
|
|
1009
|
+
|
|
1010
|
+
if (preKeys.includes(item[_rowKey])) {
|
|
1011
|
+
if (item[_rowKey] === row[_rowKey]) {
|
|
1012
|
+
children === null || children === void 0 ? void 0 : children.forEach(function (c) {
|
|
1013
|
+
c[key] = value;
|
|
1014
|
+
});
|
|
1015
|
+
(_a = Object.keys(item)) === null || _a === void 0 ? void 0 : _a.forEach(function (v) {
|
|
1016
|
+
item[v] = row[v] || item[v];
|
|
1017
|
+
});
|
|
1018
|
+
} else if (item.children) {
|
|
1019
|
+
deeps(item.children);
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
});
|
|
1023
|
+
};
|
|
1024
|
+
|
|
1025
|
+
deeps(draft);
|
|
1026
|
+
} else {
|
|
1027
|
+
draft === null || draft === void 0 ? void 0 : draft.forEach(function (item, index) {
|
|
1028
|
+
if (row[_rowKey] === item[_rowKey]) {
|
|
1029
|
+
draft[index] = row;
|
|
1030
|
+
} else {
|
|
1031
|
+
draft[index][key] = value;
|
|
1032
|
+
}
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
1035
|
+
} else {
|
|
1036
|
+
if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
|
|
1037
|
+
var _deeps = function _deeps(children) {
|
|
1038
|
+
children === null || children === void 0 ? void 0 : children.forEach(function (item) {
|
|
1039
|
+
var _a;
|
|
1040
|
+
|
|
1041
|
+
if (preKeys.includes(item[_rowKey])) {
|
|
1042
|
+
if (item[_rowKey] === row[_rowKey]) {
|
|
1043
|
+
(_a = Object.keys(row)) === null || _a === void 0 ? void 0 : _a.forEach(function (v) {
|
|
1044
|
+
item[v] = row[v] || item[v];
|
|
1045
|
+
});
|
|
1046
|
+
} else if (item.children) {
|
|
1047
|
+
_deeps(item.children);
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
});
|
|
1051
|
+
};
|
|
1052
|
+
|
|
1053
|
+
_deeps(draft);
|
|
1054
|
+
} else {
|
|
1055
|
+
var index = draft.findIndex(function (item) {
|
|
1056
|
+
return row[_rowKey] === item[_rowKey];
|
|
1057
|
+
});
|
|
1058
|
+
|
|
1059
|
+
if (index !== -1) {
|
|
1060
|
+
draft[index] = row;
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
});
|
|
1065
|
+
setDataSource(res);
|
|
1066
|
+
} else {
|
|
1067
|
+
handleTableRowReplace(row[_rowKey], row);
|
|
1068
|
+
}
|
|
1069
|
+
};
|
|
1054
1070
|
/** 快捷刷子功能 */
|
|
1055
1071
|
|
|
1072
|
+
|
|
1056
1073
|
var handleCopy = function handleCopy(key, value, type, rowIndex) {
|
|
1057
1074
|
var res = (0, _immer.produce)(dataSourceRef.current, function (draft) {
|
|
1058
1075
|
draft === null || draft === void 0 ? void 0 : draft.forEach(function (item, index) {
|
|
@@ -1647,6 +1664,29 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1647
1664
|
};
|
|
1648
1665
|
}
|
|
1649
1666
|
}, []);
|
|
1667
|
+
var checkFormItem = (0, _react.useMemo)(function () {
|
|
1668
|
+
var arr = [];
|
|
1669
|
+
columns.forEach(function (item) {
|
|
1670
|
+
var _a;
|
|
1671
|
+
|
|
1672
|
+
if (item.children) {
|
|
1673
|
+
(_a = item.children) === null || _a === void 0 ? void 0 : _a.forEach(function (c) {
|
|
1674
|
+
arr.push( /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Form.Item, Object.assign({
|
|
1675
|
+
noStyle: true,
|
|
1676
|
+
key: c.dataIndex,
|
|
1677
|
+
name: c.dataIndex
|
|
1678
|
+
}, (c === null || c === void 0 ? void 0 : c['formProps']) || {}), c.dataIndex || 'text'));
|
|
1679
|
+
});
|
|
1680
|
+
} else {
|
|
1681
|
+
arr.push( /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Form.Item, Object.assign({
|
|
1682
|
+
noStyle: true,
|
|
1683
|
+
key: item.dataIndex,
|
|
1684
|
+
name: item.dataIndex
|
|
1685
|
+
}, (item === null || item === void 0 ? void 0 : item['formProps']) || {}), item.dataIndex || 'text'));
|
|
1686
|
+
}
|
|
1687
|
+
});
|
|
1688
|
+
return arr;
|
|
1689
|
+
}, [columns]);
|
|
1650
1690
|
|
|
1651
1691
|
if (colSortOpen) {
|
|
1652
1692
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -1696,13 +1736,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1696
1736
|
}, /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Form, {
|
|
1697
1737
|
form: checkForm,
|
|
1698
1738
|
component: false
|
|
1699
|
-
},
|
|
1700
|
-
return /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Form.Item, Object.assign({
|
|
1701
|
-
noStyle: true,
|
|
1702
|
-
key: item.dataIndex,
|
|
1703
|
-
name: item.dataIndex
|
|
1704
|
-
}, (item === null || item === void 0 ? void 0 : item['formProps']) || {}), item.dataIndex || 'text');
|
|
1705
|
-
}))));
|
|
1739
|
+
}, checkFormItem)));
|
|
1706
1740
|
} // @ts-ignore
|
|
1707
1741
|
|
|
1708
1742
|
|
|
@@ -1762,13 +1796,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
1762
1796
|
}, /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Form, {
|
|
1763
1797
|
form: checkForm,
|
|
1764
1798
|
component: false
|
|
1765
|
-
},
|
|
1766
|
-
return /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Form.Item, Object.assign({
|
|
1767
|
-
noStyle: true,
|
|
1768
|
-
key: item.dataIndex,
|
|
1769
|
-
name: item.dataIndex
|
|
1770
|
-
}, (item === null || item === void 0 ? void 0 : item['formProps']) || {}), item.dataIndex || 'text');
|
|
1771
|
-
}))));
|
|
1799
|
+
}, checkFormItem)));
|
|
1772
1800
|
});
|
|
1773
1801
|
|
|
1774
1802
|
var _default = /*#__PURE__*/(0, _react.memo)(EditTable);
|