react-table-edit 1.4.37 → 1.4.38
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/component/table/index.d.ts +7 -2
- package/dist/component/utils.d.ts +7 -1
- package/dist/index.d.ts +14 -3
- package/dist/index.js +15 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -17654,7 +17654,7 @@ const FindNodeByPath = (tree, path) => {
|
|
|
17654
17654
|
* fisrtObjWidthFixRight: number // Chỉ số cột đầu tiên fixed right
|
|
17655
17655
|
* }
|
|
17656
17656
|
*/
|
|
17657
|
-
const calculateTableStructure = (columns) => {
|
|
17657
|
+
const calculateTableStructure = (columns, settingColumns) => {
|
|
17658
17658
|
const levels = [];
|
|
17659
17659
|
const flat = [];
|
|
17660
17660
|
const objWidthFixLeft = {};
|
|
@@ -17692,6 +17692,17 @@ const calculateTableStructure = (columns) => {
|
|
|
17692
17692
|
colspan,
|
|
17693
17693
|
rowspan: hasChildren ? 1 : maxDepth - level
|
|
17694
17694
|
};
|
|
17695
|
+
if (settingColumns && settingColumns.length > 0) {
|
|
17696
|
+
const column = settingColumns.find((y) => y.field === cell.field);
|
|
17697
|
+
if (column) {
|
|
17698
|
+
cell.visible = column.visible;
|
|
17699
|
+
cell.fixedType = column.fixedType;
|
|
17700
|
+
cell.width = column.width;
|
|
17701
|
+
}
|
|
17702
|
+
else {
|
|
17703
|
+
cell.visible = false;
|
|
17704
|
+
}
|
|
17705
|
+
}
|
|
17695
17706
|
levels[level].push(cell);
|
|
17696
17707
|
const headerKey = `${level}-${indexCol}`;
|
|
17697
17708
|
if (col.fixedType === "left" && col.visible !== false) {
|
|
@@ -42796,7 +42807,7 @@ const ToolbarBottom = ({ handleAdd, handleDuplicate, handleInsertBefore, handleI
|
|
|
42796
42807
|
|
|
42797
42808
|
const TableEdit = forwardRef((props, ref) => {
|
|
42798
42809
|
const { t } = useTranslation();
|
|
42799
|
-
const { idTable, dataSource, columns, pagingSetting, setDataSource, height, maxHeight, minHeight, defaultValue, toolbarSetting, searchSetting, selectedItem, selectEnable, editDisable, addDisable, buttonSetting, formatSetting, haveSum, isMulti, disableAutoKey, commandClick, dataSourceChange, rowChange, setSelectedItem, handleSelect, onDuplicate, saveSettingColumn, allowFilter = true, allowOrder, optionsFilter } = props;
|
|
42810
|
+
const { idTable, dataSource, columns, pagingSetting, setDataSource, height, maxHeight, minHeight, defaultValue, toolbarSetting, searchSetting, selectedItem, selectEnable, editDisable, addDisable, buttonSetting, formatSetting, haveSum, isMulti, disableAutoKey, commandClick, dataSourceChange, rowChange, setSelectedItem, handleSelect, onDuplicate, saveSettingColumn, allowFilter = true, allowOrder, settingColumns, optionsFilter } = props;
|
|
42800
42811
|
useImperativeHandle(ref, () => {
|
|
42801
42812
|
return {
|
|
42802
42813
|
refeshFocusRow: handleRefeshRow
|
|
@@ -42823,8 +42834,8 @@ const TableEdit = forwardRef((props, ref) => {
|
|
|
42823
42834
|
}
|
|
42824
42835
|
}, [dataSource]);
|
|
42825
42836
|
const { levels: headerColumns, flat: contentColumns, flatVisble, objWidthFixLeft, objWidthFixRight, lastObjWidthFixLeft, fisrtObjWidthFixRight, objHeaderWidthFixLeft, objHeaderWidthFixRight, indexFirstEdit: indexFirstEdit, indexLastEdit: indexLastEdit } = useMemo(() => {
|
|
42826
|
-
return calculateTableStructure(columns);
|
|
42827
|
-
}, [columns, refreshColumns]);
|
|
42837
|
+
return calculateTableStructure(columns, settingColumns);
|
|
42838
|
+
}, [columns, settingColumns, refreshColumns]);
|
|
42828
42839
|
const handleRefeshRow = () => {
|
|
42829
42840
|
setRefreshRow(true);
|
|
42830
42841
|
setTimeout(() => {
|