react-table-edit 1.5.20 → 1.5.21
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 +7 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -38804,9 +38804,6 @@ const FilterComponent = ({ optionsFilter, formatSetting, filterBy, setOpenFilter
|
|
|
38804
38804
|
else if (column.type === 'date' || column.type === 'datetime') {
|
|
38805
38805
|
typeFilter = 'date';
|
|
38806
38806
|
}
|
|
38807
|
-
else if (column.type === 'select') {
|
|
38808
|
-
typeFilter = 'select';
|
|
38809
|
-
}
|
|
38810
38807
|
else {
|
|
38811
38808
|
typeFilter = 'text';
|
|
38812
38809
|
}
|
|
@@ -39021,10 +39018,13 @@ const HeaderTableCol = (props) => {
|
|
|
39021
39018
|
};
|
|
39022
39019
|
|
|
39023
39020
|
const TableComponent = ({ idTable, dataSource, contentColumns, headerColumns, visibleColumns, selectedRows, setSelectedRows, selectedCell, startCell, editCell, gridRef, objHeaderWidthFixLeft, objHeaderWidthFixRight, objWidthFixLeft, objWidthFixRight, lastObjWidthFixLeft, fisrtObjWidthFixRight, totalCount, isMulti, selectEnable, editDisable, addDisable, defaultValue, fieldKey, fieldUniKey, formatSetting, toolbarSetting, buttonSetting, containerRef, handleDataChange, changeDataSource, handleCommandClick, handleDuplicate, handleKeyDown, onDuplicate, setSelectedCell, setStartCell, focusEditElementCell, setContentColumns, handeCopyCell, isCopying, typeDragging, rowChange, visibleContentColumns, filterBy, setFilterBy, orderBy, setOrderBy, optionsFilter, allowFiltering, allowSorting, searchSetting, searchTerm, searchClient, height, rowHeight, haveSum }) => {
|
|
39024
|
-
|
|
39025
|
-
|
|
39026
|
-
|
|
39027
|
-
|
|
39021
|
+
const filteredData = useMemo(() => {
|
|
39022
|
+
const arr = dataSource.map((row, index) => ({ data: row, indexRow: index }));
|
|
39023
|
+
if (((filterBy && filterBy.length > 0) || (searchSetting?.searchTerm !== undefined ? searchSetting?.searchTerm : searchTerm)) && searchClient) {
|
|
39024
|
+
return arr.filter(({ data }) => CheckRowMatch(data, filterBy, searchSetting?.searchTerm !== undefined ? searchSetting?.searchTerm : searchTerm, searchSetting?.keyField ?? []));
|
|
39025
|
+
}
|
|
39026
|
+
return arr;
|
|
39027
|
+
}, [filterBy, searchTerm, dataSource]);
|
|
39028
39028
|
const [scrollTop, setScrollTop] = useState(0);
|
|
39029
39029
|
const totalHeight = filteredData.length * rowHeight;
|
|
39030
39030
|
const visibleCount = Math.ceil(height / rowHeight) + 5; // buffer
|