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.
@@ -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
- let result = renderData;
146
- if (!result) {
147
- return result;
145
+ if (!renderData || (!isColumnSearchable && !isSearchable)) {
146
+ return renderData;
148
147
  }
149
- if (isColumnSearchable || isSearchable) {
150
- return result.filter((item) => {
151
- const globalSearchFilterResult = searchQuery
152
- ? !!columnNames.find((columnName) =>
153
- // @ts-ignore
154
- `${item[columnName]}`
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(searchQuery.toLowerCase()))
157
- : true;
158
- const rowColumnValidation = isColumnSearchable
159
- ? Object.keys(columnSearchObj).reduce((previousValue, propName) => {
160
- const columnSearchText = columnSearchObj[propName];
161
- const isBooleanValue = item[propName] === "✓" || item[propName] === "✕";
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mig-schema-table",
3
- "version": "3.0.16",
3
+ "version": "3.0.17",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/"