gbs-add-block 1.0.22 → 1.0.23

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # GBS Building Blocks 2.0 (v1.0.22)
1
+ # GBS Building Blocks 2.0 (v1.0.23)
2
2
 
3
3
  Latest and upgraded version of GBS building blocks with headless UI and removed dependencies.
4
4
 
@@ -6,7 +6,7 @@ Latest and upgraded version of GBS building blocks with headless UI and removed
6
6
 
7
7
  For detailed documentation on usage and props, Please visit: [Building Block Documentation v2.0](https://blackmax-designs.gitbook.io/building-block-v2.0)
8
8
 
9
- ## What's New 🎉 (Ver 1.0.22)
9
+ ## What's New 🎉 (Ver 1.0.23)
10
10
 
11
11
  - Style Update
12
12
  - General Bug Fix
package/package.json CHANGED
@@ -1,30 +1,30 @@
1
- {
2
- "name": "gbs-add-block",
3
- "version": "1.0.22",
4
- "description": "React Component Library",
5
- "type": "module",
6
- "files": [
7
- "index.cjs",
8
- "source"
9
- ],
10
- "engines": {
11
- "node": ">=17"
12
- },
13
- "bin": {
14
- "gbs-add-block": "index.cjs"
15
- },
16
- "scripts": {
17
- "test": "echo \"Error: no test specified\" && exit 1"
18
- },
19
- "keywords": [],
20
- "author": "Anandhu Remanan",
21
- "license": "ISC",
22
- "dependencies": {
23
- "fs-extra": "^11.0.4",
24
- "path": "^0.12.7",
25
- "yargs": "^17.7.2"
26
- },
27
- "devDependencies": {
28
- "@types/fs-extra": "^11.0.4"
29
- }
30
- }
1
+ {
2
+ "name": "gbs-add-block",
3
+ "version": "1.0.23",
4
+ "description": "React Component Library",
5
+ "type": "module",
6
+ "files": [
7
+ "index.cjs",
8
+ "source"
9
+ ],
10
+ "engines": {
11
+ "node": ">=17"
12
+ },
13
+ "bin": {
14
+ "gbs-add-block": "index.cjs"
15
+ },
16
+ "scripts": {
17
+ "test": "echo \"Error: no test specified\" && exit 1"
18
+ },
19
+ "keywords": [],
20
+ "author": "Anandhu Remanan",
21
+ "license": "ISC",
22
+ "dependencies": {
23
+ "fs-extra": "^11.0.4",
24
+ "path": "^0.12.7",
25
+ "yargs": "^17.7.2"
26
+ },
27
+ "devDependencies": {
28
+ "@types/fs-extra": "^11.0.4"
29
+ }
30
+ }
@@ -37,7 +37,7 @@ export const GridProvider: React.FC<{
37
37
  gridColumnStyle = "p-2 text-xs",
38
38
  rowChange = () => {},
39
39
  pageStatus = () => {},
40
- activeFilterArrayValue = [],
40
+ activeFilterArrayValue,
41
41
  searchParamValue = () => {},
42
42
  showTotalPages = false,
43
43
  onSearch = () => {},
@@ -3,6 +3,7 @@ import {
3
3
  clearFilterHelper,
4
4
  handleApplyFilterHelper,
5
5
  } from "@grampro/headless-helpers";
6
+ import { ActiveFilterArrayValue } from "../type";
6
7
 
7
8
  interface UseFilteringProps {
8
9
  columns: any[];
@@ -15,7 +16,7 @@ interface UseFilteringProps {
15
16
  resetPage: (data: any[], settings: any) => number;
16
17
  setTotalPages: (pages: number) => void;
17
18
  pageSettings: any;
18
- activeFilterArrayValue?: (filters: any[]) => void;
19
+ activeFilterArrayValue?: (filters: ActiveFilterArrayValue[]) => void;
19
20
  }
20
21
 
21
22
  export const useFiltering = ({
@@ -58,7 +59,8 @@ export const useFiltering = ({
58
59
  setWorkingDataSource(updatedFullDataSource);
59
60
  setActiveFilterArray(updatedActiveFilterArray);
60
61
  if (activeFilterArrayValue)
61
- activeFilterArrayValue(updatedActiveFilterArray);
62
+ activeFilterArrayValue?.(updatedActiveFilterArray);
63
+
62
64
  const totalPages = resetPage(updatedFullDataSource, pageSettings);
63
65
  setTotalPages(totalPages);
64
66
  },
@@ -89,7 +91,8 @@ export const useFiltering = ({
89
91
  setWorkingDataSource(updatedDataSource);
90
92
  setActiveFilterArray(updatedActiveFilterArray);
91
93
  if (activeFilterArrayValue)
92
- activeFilterArrayValue(updatedActiveFilterArray);
94
+ activeFilterArrayValue?.(updatedActiveFilterArray);
95
+
93
96
  const totalPages = resetPage(updatedDataSource, pageSettings);
94
97
  setTotalPages(totalPages);
95
98
  },
@@ -29,9 +29,9 @@ export const usePagination = (
29
29
  }, [totalPages, lazy, pageStart]);
30
30
 
31
31
  // This will handle the case when dataSource changes
32
- // and adjust the current page accordingly
32
+ // and adjust the current page accordingly in managed workflow
33
33
  useEffect(() => {
34
- if (dataSource && prevDataLength > 0) {
34
+ if (lazy && dataSource && prevDataLength > 0) {
35
35
  const currentDataLength = dataSource.length;
36
36
 
37
37
  if (currentDataLength > prevDataLength) {
@@ -5,7 +5,7 @@ interface PageSettingsProps {
5
5
  totalCount?: number;
6
6
  }
7
7
 
8
- interface ActiveFilterArrayValue {
8
+ export interface ActiveFilterArrayValue {
9
9
  filterColumn: string;
10
10
  filterCondition: string;
11
11
  filterValue: string;