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 CHANGED
@@ -17724,8 +17724,12 @@ const calculateTableStructure = (columns, settingColumns) => {
17724
17724
  const column = settingColumns.find((y) => y.field === cell.field);
17725
17725
  if (column) {
17726
17726
  cell.visible = column.visible;
17727
- cell.fixedType = column.fixedType;
17728
- cell.width = column.width;
17727
+ if (column.fixedType) {
17728
+ cell.fixedType = column.fixedType;
17729
+ }
17730
+ if (column.width) {
17731
+ cell.width = column.width;
17732
+ }
17729
17733
  }
17730
17734
  else {
17731
17735
  cell.visible = false;
@@ -42848,7 +42852,6 @@ const TableEdit = React$5.forwardRef((props, ref) => {
42848
42852
  const [searchTerm, setSearchTerm] = React$5.useState("");
42849
42853
  const [orderBy, setOrderBy] = React$5.useState([]);
42850
42854
  const [filterBy, setFilterBy] = React$5.useState([]);
42851
- const [refreshColumns, setRefreshColumns] = React$5.useState(false);
42852
42855
  const tableElement = React$5.useRef(null);
42853
42856
  const gridRef = React$5.useRef(null);
42854
42857
  const totalCount = dataSource.length;
@@ -42863,7 +42866,7 @@ const TableEdit = React$5.forwardRef((props, ref) => {
42863
42866
  }, [dataSource]);
42864
42867
  const { levels: headerColumns, flat: contentColumns, flatVisble, objWidthFixLeft, objWidthFixRight, lastObjWidthFixLeft, fisrtObjWidthFixRight, objHeaderWidthFixLeft, objHeaderWidthFixRight, indexFirstEdit: indexFirstEdit, indexLastEdit: indexLastEdit } = React$5.useMemo(() => {
42865
42868
  return calculateTableStructure(columns, settingColumns);
42866
- }, [columns, settingColumns, refreshColumns]);
42869
+ }, [columns, settingColumns]);
42867
42870
  const handleRefeshRow = () => {
42868
42871
  setRefreshRow(true);
42869
42872
  setTimeout(() => {
@@ -43702,15 +43705,9 @@ const TableEdit = React$5.forwardRef((props, ref) => {
43702
43705
  }, changeOrder: (val) => {
43703
43706
  setOrderBy([...val]);
43704
43707
  }, columns: contentColumns, setColumns: (newColumns) => {
43705
- newColumns.forEach((x) => {
43706
- const column = columns.find((y) => y.field === x.field);
43707
- if (column) {
43708
- column.visible = x.visible;
43709
- column.fixedType = x.fixedType;
43710
- column.width = x.width;
43711
- }
43712
- });
43713
- setRefreshColumns(!refreshColumns);
43708
+ if (saveSettingColumn) {
43709
+ saveSettingColumn(newColumns.map((x) => ({ field: x.field, headerText: x.headerText, visible: x.visible, fixedType: x.fixedType, width: x.width })));
43710
+ }
43714
43711
  }, fisrtObjWidthFixRight: fisrtObjWidthFixRight, lastObjWidthFixLeft: lastObjWidthFixLeft, totalCount: totalCount }, `header-${indexParent}-${index}`));
43715
43712
  }) }, `header-${-indexParent}`));
43716
43713
  }) }), jsxRuntime.jsx("tbody", { className: "r-gridcontent", role: "rowgroup", children: dataSource.map((row, indexRow) => {
@@ -43737,18 +43734,8 @@ const TableEdit = React$5.forwardRef((props, ref) => {
43737
43734
  setOpenPopupSetupColumn(!openPopupSetupColumn);
43738
43735
  }, openSidebar: openPopupSetupColumn, column: [...contentColumns], setColumn: (newColumns) => {
43739
43736
  if (saveSettingColumn) {
43740
- console.log(newColumns);
43741
43737
  saveSettingColumn(newColumns.map((x) => ({ field: x.field, headerText: x.headerText, visible: x.visible, fixedType: x.fixedType, width: x.width })));
43742
43738
  }
43743
- newColumns.forEach((x) => {
43744
- const column = columns.find((y) => y.field === x.field);
43745
- if (column) {
43746
- column.visible = x.visible;
43747
- column.fixedType = x.fixedType;
43748
- column.width = x.width;
43749
- }
43750
- });
43751
- setRefreshColumns(!refreshColumns);
43752
43739
  } })] }));
43753
43740
  });
43754
43741