@azrico/reactgrid 1.3.25 → 1.3.26

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.
@@ -291,23 +291,20 @@ function DataGridSearchWrapper(props) {
291
291
  const visibleColumns = props.gridRef.current.visibleColumns;
292
292
  const columns_to_search = (0, _object.array_intersection)(props.advancedFilterFields || [], visibleColumns.map(r => r.id));
293
293
  const lowerSearchText = currentSearch.current.toLowerCase().trim();
294
- console.log('s:', lowerSearchText);
295
294
  if (!lowerSearchText || columns_to_search.length === 0) newData = currentDS.current;else {
296
295
  newData = currentDS.current.filter(p => {
297
296
  for (let index = 0; index < columns_to_search.length; index++) {
298
297
  const col = columns_to_search[index];
299
298
  const v = (p[col] + '').toLowerCase(); //value of column
300
- if (v.indexOf(lowerSearchText) == -1) {
301
- console.log('v NOT match:', v, v.indexOf(lowerSearchText));
302
- return false;
299
+ if (v && v.indexOf(lowerSearchText) != -1) {
300
+ //if one column is matching then the row is a match
301
+ return true;
303
302
  }
304
- console.log('v is matching', v, v.indexOf(lowerSearchText));
305
303
  }
306
- return true;
304
+ return false;
307
305
  });
308
306
  }
309
307
  } else newData = currentDS.current;
310
- console.log('newData:', newData.length);
311
308
  set_filteredData(newData);
312
309
  }, 1000), []);
313
310
  _react.default.useEffect(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/reactgrid",
3
- "version": "1.3.25",
3
+ "version": "1.3.26",
4
4
  "main": "dist/index.js",
5
5
  "description": "React Datagrid",
6
6
  "author": "Azrideus <MehrdadTavangar@gmail.com>",
@@ -455,8 +455,6 @@ function DataGridSearchWrapper(props: DataGridWrapperProps) {
455
455
  visibleColumns.map((r) => r.id)
456
456
  );
457
457
  const lowerSearchText = currentSearch.current.toLowerCase().trim();
458
- console.log('s:', lowerSearchText);
459
-
460
458
  if (!lowerSearchText || columns_to_search.length === 0)
461
459
  newData = currentDS.current;
462
460
  else {
@@ -464,20 +462,15 @@ function DataGridSearchWrapper(props: DataGridWrapperProps) {
464
462
  for (let index = 0; index < columns_to_search.length; index++) {
465
463
  const col = columns_to_search[index];
466
464
  const v = (p[col] + '').toLowerCase(); //value of column
467
-
468
- if (v.indexOf(lowerSearchText) == -1) {
469
- console.log('v NOT match:', v, v.indexOf(lowerSearchText));
470
- return false;
465
+ if (v && v.indexOf(lowerSearchText) != -1) {
466
+ //if one column is matching then the row is a match
467
+ return true;
471
468
  }
472
- console.log('v is matching', v, v.indexOf(lowerSearchText));
473
469
  }
474
-
475
- return true;
470
+ return false;
476
471
  });
477
472
  }
478
473
  } else newData = currentDS.current;
479
- console.log('newData:', newData.length);
480
-
481
474
  set_filteredData(newData);
482
475
  }, 1000),
483
476
  []