mig-schema-table 3.0.16 → 3.0.17
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/SchemaTable/index.js +24 -27
- package/package.json +1 -1
|
@@ -142,35 +142,32 @@ export default function SchemaTable({ Heading = VariableSizeList, checkedIndexes
|
|
|
142
142
|
]);
|
|
143
143
|
const getColumnWidth = React.useCallback((columnIndex) => (columnWidths ? columnWidths[columnIndex] : 1), [columnWidths]);
|
|
144
144
|
const filteredRenderData = React.useMemo(() => {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return result;
|
|
145
|
+
if (!renderData || (!isColumnSearchable && !isSearchable)) {
|
|
146
|
+
return renderData;
|
|
148
147
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
148
|
+
return renderData.filter((item) => {
|
|
149
|
+
const globalSearchFilterResult = searchQuery
|
|
150
|
+
? !!columnNames.find((columnName) =>
|
|
151
|
+
// @ts-ignore
|
|
152
|
+
`${item[columnName]}`
|
|
153
|
+
.toLowerCase()
|
|
154
|
+
.includes(searchQuery.toLowerCase()))
|
|
155
|
+
: true;
|
|
156
|
+
const rowColumnValidation = isColumnSearchable
|
|
157
|
+
? Object.keys(columnSearchObj).reduce((previousValue, propName) => {
|
|
158
|
+
const columnSearchText = columnSearchObj[propName];
|
|
159
|
+
const isBooleanValue = item[propName] === "✓" || item[propName] === "✕";
|
|
160
|
+
const rawValue = isBooleanValue
|
|
161
|
+
? `${item[propName] === "✓"}`
|
|
162
|
+
: `${item[propName]}`;
|
|
163
|
+
previousValue.push(rawValue
|
|
155
164
|
.toLowerCase()
|
|
156
|
-
.includes(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
const rawValue = isBooleanValue
|
|
163
|
-
? `${item[propName] === "✓"}`
|
|
164
|
-
: `${item[propName]}`;
|
|
165
|
-
previousValue.push(rawValue
|
|
166
|
-
.toLowerCase()
|
|
167
|
-
.includes(`${columnSearchText}`.toLowerCase()));
|
|
168
|
-
return previousValue;
|
|
169
|
-
}, [])
|
|
170
|
-
: [true];
|
|
171
|
-
return (globalSearchFilterResult && rowColumnValidation.every((el) => el));
|
|
172
|
-
});
|
|
173
|
-
}
|
|
165
|
+
.includes(`${columnSearchText}`.toLowerCase()));
|
|
166
|
+
return previousValue;
|
|
167
|
+
}, [])
|
|
168
|
+
: [true];
|
|
169
|
+
return globalSearchFilterResult && rowColumnValidation.every((el) => el);
|
|
170
|
+
});
|
|
174
171
|
}, [
|
|
175
172
|
columnNames,
|
|
176
173
|
columnSearchObj,
|