react-table-edit 1.4.38 → 1.4.39
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.js +10 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -17696,8 +17696,12 @@ const calculateTableStructure = (columns, settingColumns) => {
|
|
|
17696
17696
|
const column = settingColumns.find((y) => y.field === cell.field);
|
|
17697
17697
|
if (column) {
|
|
17698
17698
|
cell.visible = column.visible;
|
|
17699
|
-
|
|
17700
|
-
|
|
17699
|
+
if (column.fixedType) {
|
|
17700
|
+
cell.fixedType = column.fixedType;
|
|
17701
|
+
}
|
|
17702
|
+
if (column.width) {
|
|
17703
|
+
cell.width = column.width;
|
|
17704
|
+
}
|
|
17701
17705
|
}
|
|
17702
17706
|
else {
|
|
17703
17707
|
cell.visible = false;
|
|
@@ -42820,7 +42824,6 @@ const TableEdit = forwardRef((props, ref) => {
|
|
|
42820
42824
|
const [searchTerm, setSearchTerm] = useState("");
|
|
42821
42825
|
const [orderBy, setOrderBy] = useState([]);
|
|
42822
42826
|
const [filterBy, setFilterBy] = useState([]);
|
|
42823
|
-
const [refreshColumns, setRefreshColumns] = useState(false);
|
|
42824
42827
|
const tableElement = useRef(null);
|
|
42825
42828
|
const gridRef = useRef(null);
|
|
42826
42829
|
const totalCount = dataSource.length;
|
|
@@ -42835,7 +42838,7 @@ const TableEdit = forwardRef((props, ref) => {
|
|
|
42835
42838
|
}, [dataSource]);
|
|
42836
42839
|
const { levels: headerColumns, flat: contentColumns, flatVisble, objWidthFixLeft, objWidthFixRight, lastObjWidthFixLeft, fisrtObjWidthFixRight, objHeaderWidthFixLeft, objHeaderWidthFixRight, indexFirstEdit: indexFirstEdit, indexLastEdit: indexLastEdit } = useMemo(() => {
|
|
42837
42840
|
return calculateTableStructure(columns, settingColumns);
|
|
42838
|
-
}, [columns, settingColumns
|
|
42841
|
+
}, [columns, settingColumns]);
|
|
42839
42842
|
const handleRefeshRow = () => {
|
|
42840
42843
|
setRefreshRow(true);
|
|
42841
42844
|
setTimeout(() => {
|
|
@@ -43674,15 +43677,9 @@ const TableEdit = forwardRef((props, ref) => {
|
|
|
43674
43677
|
}, changeOrder: (val) => {
|
|
43675
43678
|
setOrderBy([...val]);
|
|
43676
43679
|
}, columns: contentColumns, setColumns: (newColumns) => {
|
|
43677
|
-
|
|
43678
|
-
|
|
43679
|
-
|
|
43680
|
-
column.visible = x.visible;
|
|
43681
|
-
column.fixedType = x.fixedType;
|
|
43682
|
-
column.width = x.width;
|
|
43683
|
-
}
|
|
43684
|
-
});
|
|
43685
|
-
setRefreshColumns(!refreshColumns);
|
|
43680
|
+
if (saveSettingColumn) {
|
|
43681
|
+
saveSettingColumn(newColumns.map((x) => ({ field: x.field, headerText: x.headerText, visible: x.visible, fixedType: x.fixedType, width: x.width })));
|
|
43682
|
+
}
|
|
43686
43683
|
}, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, totalCount: totalCount }, `header-${indexParent}-${index}`));
|
|
43687
43684
|
}) }, `header-${-indexParent}`));
|
|
43688
43685
|
}) }), jsx("tbody", { className: "r-gridcontent", role: "rowgroup", children: dataSource.map((row, indexRow) => {
|
|
@@ -43709,18 +43706,8 @@ const TableEdit = forwardRef((props, ref) => {
|
|
|
43709
43706
|
setOpenPopupSetupColumn(!openPopupSetupColumn);
|
|
43710
43707
|
}, openSidebar: openPopupSetupColumn, column: [...contentColumns], setColumn: (newColumns) => {
|
|
43711
43708
|
if (saveSettingColumn) {
|
|
43712
|
-
console.log(newColumns);
|
|
43713
43709
|
saveSettingColumn(newColumns.map((x) => ({ field: x.field, headerText: x.headerText, visible: x.visible, fixedType: x.fixedType, width: x.width })));
|
|
43714
43710
|
}
|
|
43715
|
-
newColumns.forEach((x) => {
|
|
43716
|
-
const column = columns.find((y) => y.field === x.field);
|
|
43717
|
-
if (column) {
|
|
43718
|
-
column.visible = x.visible;
|
|
43719
|
-
column.fixedType = x.fixedType;
|
|
43720
|
-
column.width = x.width;
|
|
43721
|
-
}
|
|
43722
|
-
});
|
|
43723
|
-
setRefreshColumns(!refreshColumns);
|
|
43724
43711
|
} })] }));
|
|
43725
43712
|
});
|
|
43726
43713
|
|