@azrico/reactgrid 1.3.24 → 1.3.25

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.
@@ -292,13 +292,16 @@ function DataGridSearchWrapper(props) {
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
294
  console.log('s:', lowerSearchText);
295
- if (!lowerSearchText) newData = currentDS.current;else {
295
+ if (!lowerSearchText || columns_to_search.length === 0) newData = currentDS.current;else {
296
296
  newData = currentDS.current.filter(p => {
297
297
  for (let index = 0; index < columns_to_search.length; index++) {
298
298
  const col = columns_to_search[index];
299
299
  const v = (p[col] + '').toLowerCase(); //value of column
300
- console.log('v:', v, v.indexOf(lowerSearchText));
301
- if (v && v.indexOf(lowerSearchText) == -1) return false;
300
+ if (v.indexOf(lowerSearchText) == -1) {
301
+ console.log('v NOT match:', v, v.indexOf(lowerSearchText));
302
+ return false;
303
+ }
304
+ console.log('v is matching', v, v.indexOf(lowerSearchText));
302
305
  }
303
306
  return true;
304
307
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/reactgrid",
3
- "version": "1.3.24",
3
+ "version": "1.3.25",
4
4
  "main": "dist/index.js",
5
5
  "description": "React Datagrid",
6
6
  "author": "Azrideus <MehrdadTavangar@gmail.com>",
@@ -29,7 +29,7 @@
29
29
  "typescript": "^4.8.4"
30
30
  },
31
31
  "dependencies": {
32
- "@azrico/controls": "^1.5.60",
32
+ "@azrico/controls": "^1.5.62",
33
33
  "@azrico/object": "^1.4.67",
34
34
  "@emotion/react": "^11.9.3",
35
35
  "@emotion/styled": "^11.9.3",
@@ -456,15 +456,22 @@ function DataGridSearchWrapper(props: DataGridWrapperProps) {
456
456
  );
457
457
  const lowerSearchText = currentSearch.current.toLowerCase().trim();
458
458
  console.log('s:', lowerSearchText);
459
- if (!lowerSearchText) newData = currentDS.current;
459
+
460
+ if (!lowerSearchText || columns_to_search.length === 0)
461
+ newData = currentDS.current;
460
462
  else {
461
463
  newData = currentDS.current.filter((p) => {
462
464
  for (let index = 0; index < columns_to_search.length; index++) {
463
465
  const col = columns_to_search[index];
464
466
  const v = (p[col] + '').toLowerCase(); //value of column
465
- console.log('v:', v, v.indexOf(lowerSearchText));
466
- if (v && v.indexOf(lowerSearchText) == -1) return false;
467
+
468
+ if (v.indexOf(lowerSearchText) == -1) {
469
+ console.log('v NOT match:', v, v.indexOf(lowerSearchText));
470
+ return false;
471
+ }
472
+ console.log('v is matching', v, v.indexOf(lowerSearchText));
467
473
  }
474
+
468
475
  return true;
469
476
  });
470
477
  }