sccoreui 5.8.7 → 5.8.9

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.
Files changed (27) hide show
  1. package/dist/App.scss +30 -0
  2. package/dist/assets/images/drag.svg +8 -0
  3. package/dist/assets/svg/drag.svg +8 -0
  4. package/dist/components/ag-grid/AgGrid.js +1 -1
  5. package/dist/components/ag-grid/MyProvider.js +4 -12
  6. package/dist/components/ag-grid/ParentForGrid.js +59 -29
  7. package/dist/components/ag-grid/advancedFeature/advanced-feature.js +4 -1
  8. package/dist/components/ag-grid/advancedFeature/custom-sort.js +8 -5
  9. package/dist/components/ag-grid/advancedFeature/filter/filter.js +20 -9
  10. package/dist/components/ag-grid/advancedFeature/filter/querty.js +2 -1
  11. package/dist/components/ag-grid/advancedFeature/global-search.js +8 -4
  12. package/dist/components/ag-grid/advancedFeature/grouping.js +36 -0
  13. package/dist/components/ag-grid/advancedFeature/hide-column.js +44 -0
  14. package/dist/components/ag-grid/advancedFeature/refresh-grid.js +4 -1
  15. package/dist/components/ag-grid/advancedFeature/remove-items.js +15 -0
  16. package/dist/components/ag-grid/constants.js +5 -1
  17. package/dist/components/ag-grid/grid-checkbox.js +2 -2
  18. package/dist/directives/svg-icons.js +12 -0
  19. package/dist/types/components/ag-grid/MyProvider.d.ts +1 -0
  20. package/dist/types/components/ag-grid/ParentForGrid.d.ts +1 -0
  21. package/dist/types/components/ag-grid/Types.d.ts +13 -4
  22. package/dist/types/components/ag-grid/advancedFeature/grouping.d.ts +2 -0
  23. package/dist/types/components/ag-grid/advancedFeature/hide-column.d.ts +2 -0
  24. package/dist/types/components/ag-grid/advancedFeature/remove-items.d.ts +2 -0
  25. package/dist/types/components/ag-grid/constants.d.ts +4 -0
  26. package/dist/types/components/ag-grid/grid-checkbox.d.ts +2 -2
  27. package/package.json +1 -1
package/dist/App.scss CHANGED
@@ -48,6 +48,11 @@
48
48
  }
49
49
 
50
50
 
51
+ // height and width utility classes
52
+
53
+ .h-40 {
54
+ height: 40px;
55
+ }
51
56
 
52
57
  // @font-face {
53
58
  // font-family: "Lato";
@@ -197,6 +202,31 @@ code {
197
202
  }
198
203
  }
199
204
 
205
+ .bulk-action-feature {
206
+ .p-overlaypanel-content {
207
+ padding: 0 !important;
208
+ border-radius: 6px !important
209
+ }
210
+ }
211
+
212
+ .column_group_overlay {
213
+ overflow: hidden;
214
+ .p-overlaypanel-content {
215
+ padding: 0px !important;
216
+ }
217
+ }
218
+
219
+ .list-items {
220
+ padding: 4px;
221
+ border: 0;
222
+ .p-treenode-content {
223
+ padding: 2px !important;
224
+ }
225
+ .p-treenode-droppoint {
226
+ height: 2px;
227
+ }
228
+ }
229
+
200
230
  .sc_custom_multiselect {
201
231
 
202
232
  width: max-content;
@@ -0,0 +1,8 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7 2.5C7.39782 2.5 7.77936 2.65804 8.06066 2.93934C8.34196 3.22064 8.5 3.60218 8.5 4C8.5 4.39782 8.34196 4.77936 8.06066 5.06066C7.77936 5.34196 7.39782 5.5 7 5.5C6.60218 5.5 6.22064 5.34196 5.93934 5.06066C5.65804 4.77936 5.5 4.39782 5.5 4C5.5 3.60218 5.65804 3.22064 5.93934 2.93934C6.22064 2.65804 6.60218 2.5 7 2.5Z" fill="#667085"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M13 2.5C13.3978 2.5 13.7794 2.65804 14.0607 2.93934C14.342 3.22064 14.5 3.60218 14.5 4C14.5 4.39782 14.342 4.77936 14.0607 5.06066C13.7794 5.34196 13.3978 5.5 13 5.5C12.6022 5.5 12.2206 5.34196 11.9393 5.06066C11.658 4.77936 11.5 4.39782 11.5 4C11.5 3.60218 11.658 3.22064 11.9393 2.93934C12.2206 2.65804 12.6022 2.5 13 2.5Z" fill="#667085"/>
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7 8.5C7.39782 8.5 7.77936 8.65804 8.06066 8.93934C8.34196 9.22064 8.5 9.60218 8.5 10C8.5 10.3978 8.34196 10.7794 8.06066 11.0607C7.77936 11.342 7.39782 11.5 7 11.5C6.60218 11.5 6.22064 11.342 5.93934 11.0607C5.65804 10.7794 5.5 10.3978 5.5 10C5.5 9.60218 5.65804 9.22064 5.93934 8.93934C6.22064 8.65804 6.60218 8.5 7 8.5Z" fill="#667085"/>
5
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M13 8.5C13.3978 8.5 13.7794 8.65804 14.0607 8.93934C14.342 9.22064 14.5 9.60218 14.5 10C14.5 10.3978 14.342 10.7794 14.0607 11.0607C13.7794 11.342 13.3978 11.5 13 11.5C12.6022 11.5 12.2206 11.342 11.9393 11.0607C11.658 10.7794 11.5 10.3978 11.5 10C11.5 9.60218 11.658 9.22064 11.9393 8.93934C12.2206 8.65804 12.6022 8.5 13 8.5Z" fill="#667085"/>
6
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7 14.5C7.39782 14.5 7.77936 14.658 8.06066 14.9393C8.34196 15.2206 8.5 15.6022 8.5 16C8.5 16.3978 8.34196 16.7794 8.06066 17.0607C7.77936 17.342 7.39782 17.5 7 17.5C6.60218 17.5 6.22064 17.342 5.93934 17.0607C5.65804 16.7794 5.5 16.3978 5.5 16C5.5 15.6022 5.65804 15.2206 5.93934 14.9393C6.22064 14.658 6.60218 14.5 7 14.5Z" fill="#667085"/>
7
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M13 14.5C13.3978 14.5 13.7794 14.658 14.0607 14.9393C14.342 15.2206 14.5 15.6022 14.5 16C14.5 16.3978 14.342 16.7794 14.0607 17.0607C13.7794 17.342 13.3978 17.5 13 17.5C12.6022 17.5 12.2206 17.342 11.9393 17.0607C11.658 16.7794 11.5 16.3978 11.5 16C11.5 15.6022 11.658 15.2206 11.9393 14.9393C12.2206 14.658 12.6022 14.5 13 14.5Z" fill="#667085"/>
8
+ </svg>
@@ -0,0 +1,8 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7 2.5C7.39782 2.5 7.77936 2.65804 8.06066 2.93934C8.34196 3.22064 8.5 3.60218 8.5 4C8.5 4.39782 8.34196 4.77936 8.06066 5.06066C7.77936 5.34196 7.39782 5.5 7 5.5C6.60218 5.5 6.22064 5.34196 5.93934 5.06066C5.65804 4.77936 5.5 4.39782 5.5 4C5.5 3.60218 5.65804 3.22064 5.93934 2.93934C6.22064 2.65804 6.60218 2.5 7 2.5Z" fill="#667085"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M13 2.5C13.3978 2.5 13.7794 2.65804 14.0607 2.93934C14.342 3.22064 14.5 3.60218 14.5 4C14.5 4.39782 14.342 4.77936 14.0607 5.06066C13.7794 5.34196 13.3978 5.5 13 5.5C12.6022 5.5 12.2206 5.34196 11.9393 5.06066C11.658 4.77936 11.5 4.39782 11.5 4C11.5 3.60218 11.658 3.22064 11.9393 2.93934C12.2206 2.65804 12.6022 2.5 13 2.5Z" fill="#667085"/>
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7 8.5C7.39782 8.5 7.77936 8.65804 8.06066 8.93934C8.34196 9.22064 8.5 9.60218 8.5 10C8.5 10.3978 8.34196 10.7794 8.06066 11.0607C7.77936 11.342 7.39782 11.5 7 11.5C6.60218 11.5 6.22064 11.342 5.93934 11.0607C5.65804 10.7794 5.5 10.3978 5.5 10C5.5 9.60218 5.65804 9.22064 5.93934 8.93934C6.22064 8.65804 6.60218 8.5 7 8.5Z" fill="#667085"/>
5
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M13 8.5C13.3978 8.5 13.7794 8.65804 14.0607 8.93934C14.342 9.22064 14.5 9.60218 14.5 10C14.5 10.3978 14.342 10.7794 14.0607 11.0607C13.7794 11.342 13.3978 11.5 13 11.5C12.6022 11.5 12.2206 11.342 11.9393 11.0607C11.658 10.7794 11.5 10.3978 11.5 10C11.5 9.60218 11.658 9.22064 11.9393 8.93934C12.2206 8.65804 12.6022 8.5 13 8.5Z" fill="#667085"/>
6
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7 14.5C7.39782 14.5 7.77936 14.658 8.06066 14.9393C8.34196 15.2206 8.5 15.6022 8.5 16C8.5 16.3978 8.34196 16.7794 8.06066 17.0607C7.77936 17.342 7.39782 17.5 7 17.5C6.60218 17.5 6.22064 17.342 5.93934 17.0607C5.65804 16.7794 5.5 16.3978 5.5 16C5.5 15.6022 5.65804 15.2206 5.93934 14.9393C6.22064 14.658 6.60218 14.5 7 14.5Z" fill="#667085"/>
7
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M13 14.5C13.3978 14.5 13.7794 14.658 14.0607 14.9393C14.342 15.2206 14.5 15.6022 14.5 16C14.5 16.3978 14.342 16.7794 14.0607 17.0607C13.7794 17.342 13.3978 17.5 13 17.5C12.6022 17.5 12.2206 17.342 11.9393 17.0607C11.658 16.7794 11.5 16.3978 11.5 16C11.5 15.6022 11.658 15.2206 11.9393 14.9393C12.2206 14.658 12.6022 14.5 13 14.5Z" fill="#667085"/>
8
+ </svg>
@@ -13,6 +13,6 @@ const LicenceKey_1 = require("./LicenceKey");
13
13
  core_1.ModuleRegistry.registerModules([client_side_row_model_1.ClientSideRowModelModule, range_selection_1.RangeSelectionModule, infinite_row_model_1.InfiniteRowModelModule]);
14
14
  core_2.LicenseManager.setLicenseKey(LicenceKey_1.LICENSEKEY);
15
15
  const AgGrid = ({ style, gridOptions, onGridReady }) => {
16
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ag-theme-quartz ", style: { height: style.height, width: style.width } }, { children: (0, jsx_runtime_1.jsx)(react_1.AgGridReact, Object.assign({ onGridReady: onGridReady, reactiveCustomComponents: true }, gridOptions)) })) }) }));
16
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ag-theme-quartz ", style: { height: style.height, width: style.width } }, { children: (0, jsx_runtime_1.jsx)(react_1.AgGridReact, Object.assign({ onGridReady: onGridReady, reactiveCustomComponents: true }, gridOptions)) })) }));
17
17
  };
18
18
  exports.default = AgGrid;
@@ -5,7 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  exports.FeatureContext = (0, react_1.createContext)(null);
7
7
  function MyProvider({ children, value }) {
8
- const { featureDetails, setFeatureDetails, gridData, callGrid, totalRecords } = value;
8
+ const { featureDetails, setFeatureDetails, gridData, callGrid, totalRecords, initialFeature } = value;
9
9
  // States for sort
10
10
  const [columnData] = (0, react_1.useState)(gridData === null || gridData === void 0 ? void 0 : gridData.columnData);
11
11
  const [sortValue, setSortValue] = (0, react_1.useState)({});
@@ -18,17 +18,9 @@ function MyProvider({ children, value }) {
18
18
  // Returns based on length of filterQueries present
19
19
  return length === 0 ? [0] : Array.from({ length }, (_, index) => index);
20
20
  });
21
- // Function call on click to
21
+ // Function call on click to refresh
22
22
  const removeFeaturesAndRefresh = () => {
23
- const emptyFeatures = {
24
- searchedText: "",
25
- filterQueries: [],
26
- sort: {
27
- isSortable: false,
28
- columnToSort: {},
29
- orderToSort: {},
30
- },
31
- };
23
+ const emptyFeatures = initialFeature;
32
24
  // Remove stored features
33
25
  setFeatureDetails(emptyFeatures);
34
26
  // Remove filter
@@ -52,7 +44,7 @@ function MyProvider({ children, value }) {
52
44
  columnData,
53
45
  callGrid,
54
46
  removeFeaturesAndRefresh,
55
- totalRecords
47
+ totalRecords,
56
48
  } }, { children: children })));
57
49
  }
58
50
  exports.default = MyProvider;
@@ -9,6 +9,7 @@ const grid_checkbox_1 = tslib_1.__importDefault(require("./grid-checkbox"));
9
9
  const MyProvider_1 = tslib_1.__importDefault(require("./MyProvider"));
10
10
  const error_ui_1 = tslib_1.__importDefault(require("./error-ui"));
11
11
  const constants_1 = require("./constants");
12
+ require("./ag-grid.scss");
12
13
  function ParentForGrid(props) {
13
14
  const [gridData, setGridData] = (0, react_1.useState)({
14
15
  rowData: [],
@@ -23,12 +24,23 @@ function ParentForGrid(props) {
23
24
  rowData: [],
24
25
  });
25
26
  const [isLoading, setIsLoading] = (0, react_1.useState)(false);
26
- const [checkBoxSelection, setCheckBoxSelection] = (0, react_1.useState)({
27
+ const [initialCheckBoxData] = (0, react_1.useState)({
27
28
  allBoxChecked: false,
28
29
  isInterminate: false,
29
30
  selectedCheckboxData: [],
30
31
  unselectedCheckboxData: [],
31
32
  });
33
+ const initialFeature = {
34
+ searchedText: "",
35
+ filterQueries: [],
36
+ sort: {
37
+ isSortable: false,
38
+ columnToSort: {},
39
+ orderToSort: {},
40
+ },
41
+ checkBoxSelection: initialCheckBoxData,
42
+ isRemoveClicked: false
43
+ };
32
44
  const [featureDetails, setFeatureDetails] = (0, react_1.useState)({
33
45
  searchedText: "",
34
46
  filterQueries: [],
@@ -37,12 +49,14 @@ function ParentForGrid(props) {
37
49
  columnToSort: {},
38
50
  orderToSort: {},
39
51
  },
52
+ checkBoxSelection: initialCheckBoxData,
53
+ isRemoveClicked: false
40
54
  });
41
55
  // Default column specification
42
56
  const defaultColDef = (0, react_1.useMemo)(() => {
43
57
  return {
44
58
  flex: 1,
45
- minWidth: 100,
59
+ minWidth: 40,
46
60
  editable: false,
47
61
  filter: false,
48
62
  sortable: false,
@@ -50,36 +64,41 @@ function ParentForGrid(props) {
50
64
  }, []);
51
65
  // Function to handle checkbox click events
52
66
  const handleCheckboxClick = (rowData) => {
53
- const { unselectedCheckboxData, selectedCheckboxData, allBoxChecked } = checkBoxSelection;
67
+ const { unselectedCheckboxData, selectedCheckboxData, allBoxChecked } = featureDetails.checkBoxSelection;
54
68
  if (allBoxChecked && unselectedCheckboxData.includes(rowData)) {
55
- setCheckBoxSelection(Object.assign(Object.assign({}, checkBoxSelection), { unselectedCheckboxData: unselectedCheckboxData.filter((item) => item !== rowData) }));
69
+ const checkboxData = Object.assign(Object.assign({}, featureDetails.checkBoxSelection), { unselectedCheckboxData: unselectedCheckboxData.filter((item) => item !== rowData) });
70
+ setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
56
71
  return;
57
72
  }
58
73
  else if (allBoxChecked) {
59
- setCheckBoxSelection(Object.assign(Object.assign({}, checkBoxSelection), { unselectedCheckboxData: [...unselectedCheckboxData, rowData], isInterminate: true }));
74
+ const checkboxData = Object.assign(Object.assign({}, featureDetails.checkBoxSelection), { unselectedCheckboxData: [...unselectedCheckboxData, rowData], isInterminate: true });
75
+ setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
60
76
  return;
61
77
  }
62
78
  // Logic to handle checkbox click events
63
79
  if (selectedCheckboxData.includes(rowData)) {
64
- setCheckBoxSelection(Object.assign(Object.assign({}, checkBoxSelection), { selectedCheckboxData: selectedCheckboxData.filter((item) => item !== rowData) }));
80
+ const checkboxData = Object.assign(Object.assign({}, featureDetails.checkBoxSelection), { selectedCheckboxData: selectedCheckboxData.filter((item) => item !== rowData) });
81
+ setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
65
82
  }
66
83
  else {
67
- setCheckBoxSelection(Object.assign(Object.assign({}, checkBoxSelection), { selectedCheckboxData: [...selectedCheckboxData, rowData] }));
84
+ const checkboxData = Object.assign(Object.assign({}, featureDetails.checkBoxSelection), { selectedCheckboxData: [...selectedCheckboxData, rowData] });
85
+ setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
68
86
  }
69
87
  };
70
88
  const handleHeaderCheckbox = () => {
71
- const { allBoxChecked } = checkBoxSelection;
72
- setCheckBoxSelection(Object.assign(Object.assign({}, checkBoxSelection), { allBoxChecked: !allBoxChecked, isInterminate: false, selectedCheckboxData: [], unselectedCheckboxData: [] }));
89
+ const { allBoxChecked } = featureDetails.checkBoxSelection;
90
+ const checkboxData = Object.assign(Object.assign({}, featureDetails.checkBoxSelection), { allBoxChecked: !allBoxChecked, isInterminate: false, selectedCheckboxData: [], unselectedCheckboxData: [] });
91
+ setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: checkboxData }));
73
92
  };
74
93
  // JSX for rendering checkbox in header
75
94
  const headerCheckBoxRenderer = (params) => {
76
95
  const displayName = params === null || params === void 0 ? void 0 : params.displayName;
77
- return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex" }, { children: [(0, jsx_runtime_1.jsx)(grid_checkbox_1.default, { checked: checkBoxSelection.allBoxChecked, onChange: handleHeaderCheckbox, isInterminate: checkBoxSelection.isInterminate }), (0, jsx_runtime_1.jsx)("p", Object.assign({ className: "px-3" }, { children: displayName }))] })));
96
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex" }, { children: [(0, jsx_runtime_1.jsx)(grid_checkbox_1.default, { checked: featureDetails.checkBoxSelection.allBoxChecked, onChange: handleHeaderCheckbox, isInterminate: featureDetails.checkBoxSelection.isInterminate }), (0, jsx_runtime_1.jsx)("p", Object.assign({ className: "px-3" }, { children: displayName }))] })));
78
97
  };
79
98
  // JSX for rendering checkbox in cells
80
99
  const cellCheckBoxRenderer = (params) => {
81
100
  const { data } = params;
82
- const { allBoxChecked, unselectedCheckboxData, selectedCheckboxData } = checkBoxSelection;
101
+ const { allBoxChecked, unselectedCheckboxData, selectedCheckboxData } = featureDetails.checkBoxSelection;
83
102
  return ((0, jsx_runtime_1.jsx)(grid_checkbox_1.default, { checked: allBoxChecked
84
103
  ? !unselectedCheckboxData.includes(data)
85
104
  : selectedCheckboxData.includes(data), onChange: () => handleCheckboxClick(data), isInterminate: false }));
@@ -96,14 +115,20 @@ function ParentForGrid(props) {
96
115
  return emptyResponse; // If callback function to get row data is not provided
97
116
  }
98
117
  const response = yield props.getRowData(startRow, endRow, currentFeatures);
118
+ setGridData(Object.assign(Object.assign({}, gridData), { rowData: [] }));
119
+ setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: initialCheckBoxData }));
99
120
  // To identify when to stop the callBack
100
121
  // const actualEndRow = startRow + (response?.rowData?.length ?? 0);
101
122
  const actualEndRow = response === null || response === void 0 ? void 0 : response.totalRecords;
102
123
  if (response === null || response === void 0 ? void 0 : response.rowData) {
124
+ const result = {
125
+ rowData: response.rowData,
126
+ actualEndRow: actualEndRow,
127
+ totalRecords: response.totalRecords
128
+ };
103
129
  setTotalRecords(response === null || response === void 0 ? void 0 : response.totalRecords);
104
- setGridData((prevState) => (Object.assign(Object.assign({}, prevState), { rowData: [...(prevState.rowData || []), ...response.rowData] })));
105
- response.actualEndRow = actualEndRow;
106
- return response;
130
+ // response.actualEndRow = actualEndRow;
131
+ return result;
107
132
  }
108
133
  return emptyResponse;
109
134
  });
@@ -119,6 +144,8 @@ function ParentForGrid(props) {
119
144
  if (props.rowModelType === constants_1.ROWMODELTYPE.CLIENT_SIDE) {
120
145
  const result = yield getData(0, 0, currentFeatures);
121
146
  if (result.rowData) {
147
+ setGridData(Object.assign(Object.assign({}, gridData), { rowData: result.rowData }));
148
+ params.api.setGridOption("rowData", []);
122
149
  params.api.applyTransaction({ add: result.rowData });
123
150
  }
124
151
  }
@@ -144,10 +171,9 @@ function ParentForGrid(props) {
144
171
  // Get values when cell edited
145
172
  const getEditedColumn = (params) => {
146
173
  var _a;
147
- console.log(params, 'edited column');
148
174
  const editedColumn = (_a = params === null || params === void 0 ? void 0 : params.colDef) === null || _a === void 0 ? void 0 : _a.field;
149
175
  const editedRow = params === null || params === void 0 ? void 0 : params.data;
150
- console.log(editedRow, editedColumn, 'edited row ');
176
+ console.log(editedRow, editedColumn, "edited row ");
151
177
  };
152
178
  // Options that grid should have
153
179
  const gridOptions = {
@@ -169,9 +195,12 @@ function ParentForGrid(props) {
169
195
  onCellValueChanged: getEditedColumn,
170
196
  rowSelection: "multiple",
171
197
  suppressRowClickSelection: true,
172
- rowHeight: 60,
198
+ rowHeight: constants_1.ROW_HEIGHT,
173
199
  rowModelType: props.rowModelType,
174
- pinnedTopRowData: props === null || props === void 0 ? void 0 : props.pinnedTopRowData
200
+ pinnedTopRowData: props === null || props === void 0 ? void 0 : props.pinnedTopRowData,
201
+ cacheBlockSize: constants_1.BLOCK_SIZE,
202
+ maxBlocksInCache: constants_1.MAX_BLOCKS,
203
+ blockLoadDebounceMillis: constants_1.DEBOUNCE_INTERVAL, // Debounce for scroll
175
204
  };
176
205
  // Fucntion to call the grid
177
206
  const callGrid = (featureDetails) => {
@@ -184,21 +213,22 @@ function ParentForGrid(props) {
184
213
  }
185
214
  }, [featureDetails.searchedText]);
186
215
  // Remove all checkbox selection if any feature added
187
- (0, react_1.useEffect)(() => {
188
- setCheckBoxSelection({
189
- allBoxChecked: false,
190
- isInterminate: false,
191
- selectedCheckboxData: [],
192
- unselectedCheckboxData: [],
193
- });
194
- }, [featureDetails]);
195
- console.log(isLoading, gridOptions, props === null || props === void 0 ? void 0 : props.pinnedTopRowData, 'is loading state');
196
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(error_ui_1.default, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ style: { height: style.height, width: style.width } }, { children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(MyProvider_1.default, Object.assign({ value: {
216
+ // useEffect(() => {
217
+ // setCheckBoxSelection({
218
+ // allBoxChecked: false,
219
+ // isInterminate: false,
220
+ // selectedCheckboxData: [],
221
+ // unselectedCheckboxData: [],
222
+ // });
223
+ // }, [featureDetails]);
224
+ console.log(isLoading, gridOptions, props === null || props === void 0 ? void 0 : props.pinnedTopRowData, "is loading state");
225
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(error_ui_1.default, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ style: { height: "100%", width: style.width }, className: "ag-grid-container border-1 border-gray-200 border-round" }, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(MyProvider_1.default, Object.assign({ value: {
197
226
  featureDetails,
198
227
  setFeatureDetails,
199
228
  gridData,
200
229
  callGrid,
201
- totalRecords
230
+ totalRecords,
231
+ initialFeature
202
232
  } }, { children: (0, jsx_runtime_1.jsx)(advanced_feature_1.default, { props: props }) })), (0, jsx_runtime_1.jsx)(AgGrid_1.default, { style: style, gridOptions: gridOptions, onGridReady: onGridReady })] }) })) }) }));
203
233
  }
204
234
  exports.default = ParentForGrid;
@@ -7,10 +7,13 @@ const custom_sort_1 = tslib_1.__importDefault(require("./custom-sort"));
7
7
  const record_detail_1 = tslib_1.__importDefault(require("./record-detail"));
8
8
  const filter_1 = tslib_1.__importDefault(require("./filter/filter"));
9
9
  const refresh_grid_1 = tslib_1.__importDefault(require("./refresh-grid"));
10
+ const remove_items_1 = tslib_1.__importDefault(require("./remove-items"));
11
+ // import HideColumn from "./hide-column"
12
+ // import Grouping from "./grouping"
10
13
  // import { ConditionsToDisplay } from "../Types"
11
14
  function AdvancedFeatures({ props }) {
12
15
  const conditionsToDisplay = props === null || props === void 0 ? void 0 : props.conditionsToDisplay;
13
16
  // const {displayFilter,displaySearch,displayRefresh,displaySort} = conditionsToDisplay
14
- return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex justify-content-between" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex" }, { children: [(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySearch) && (0, jsx_runtime_1.jsx)(global_search_1.default, { searchPlaceHolder: props === null || props === void 0 ? void 0 : props.placeholder }), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayFilter) && (0, jsx_runtime_1.jsx)(filter_1.default, { callBackForSelect: props === null || props === void 0 ? void 0 : props.myInputData })] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex " }, { children: [(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayRefresh) && (0, jsx_runtime_1.jsx)(refresh_grid_1.default, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySort) && (0, jsx_runtime_1.jsx)(custom_sort_1.default, {}), (0, jsx_runtime_1.jsx)(record_detail_1.default, {})] }))] })));
17
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-between py-3 px-4" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center" }, { children: [(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySearch) && (0, jsx_runtime_1.jsx)(global_search_1.default, { searchPlaceHolder: props === null || props === void 0 ? void 0 : props.placeholder }), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayFilter) && (0, jsx_runtime_1.jsx)(filter_1.default, { callBackForSelect: props === null || props === void 0 ? void 0 : props.myInputData })] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center" }, { children: [(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayRemoveItems) && (0, jsx_runtime_1.jsx)(remove_items_1.default, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayRefresh) && (0, jsx_runtime_1.jsx)(refresh_grid_1.default, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySort) && (0, jsx_runtime_1.jsx)(custom_sort_1.default, {}), (0, jsx_runtime_1.jsx)(record_detail_1.default, {})] }))] })));
15
18
  }
16
19
  exports.default = AdvancedFeatures;
@@ -64,20 +64,23 @@ function Sort() {
64
64
  // Trigger action to clear
65
65
  const clearSort = (e) => {
66
66
  onClickSort(e);
67
- setSortBy(null);
68
- setSortValue(null);
67
+ setSortBy({});
68
+ setSortValue({});
69
69
  const sortDetails = {
70
70
  isSortable: false,
71
71
  columnToSort: "",
72
72
  orderToSort: "",
73
73
  };
74
- setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { sort: sortDetails }));
74
+ const currentFeatureDetails = Object.assign({}, featureDetails);
75
+ currentFeatureDetails.sort = sortDetails;
76
+ setFeatureDetails(currentFeatureDetails);
77
+ callGrid(currentFeatureDetails);
75
78
  };
76
79
  return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `cursor-pointer p-1 sc_icon_hover flex align-items-center border-round-lg ${isOverlayOpened || featureDetails.sort.isSortable
77
80
  ? "bg-primary-50"
78
- : ""}` }, { children: [featureDetails.sort.isSortable && ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: "flex align-items-center text-primary-400 px-1" }, { children: ` Selected` }))), (0, jsx_runtime_1.jsx)("span", Object.assign({ onClick: (event) => onClickSort(event) }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "switch-vertical-02", size: 20, color: isOverlayOpened || featureDetails.sort.isSortable
81
+ : ""}` }, { children: [featureDetails.sort.isSortable && ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: "flex align-items-center text-primary-400 px-1" }, { children: ` Selected` }))), (0, jsx_runtime_1.jsx)(button_1.Button, { text: true, onClick: (event) => onClickSort(event), icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "switch-vertical-02", size: 20, color: isOverlayOpened || featureDetails.sort.isSortable
79
82
  ? "#243DC6"
80
- : "#667085" }) }))] })), (0, jsx_runtime_1.jsxs)(overlaypanel_1.OverlayPanel, Object.assign({ ref: showShort, onShow: () => setIsOverlayOpened(true), onHide: () => setIsOverlayOpened(false), className: "w-18rem mt-2" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "p-4 text-lg font-semibold line-height-3 text-gray-900" }, { children: "Column Sorting" })), (0, jsx_runtime_1.jsx)(divider_1.Divider, { className: "m-0" }), (0, jsx_runtime_1.jsx)("ul", Object.assign({ className: "pl-0 m-1 h-10rem overflow-auto" }, { children: columnData === null || columnData === void 0 ? void 0 : columnData.map((eachColumn, index) => {
83
+ : "#667085" }) })] })), (0, jsx_runtime_1.jsxs)(overlaypanel_1.OverlayPanel, Object.assign({ ref: showShort, onShow: () => setIsOverlayOpened(true), onHide: () => setIsOverlayOpened(false), className: "w-18rem mt-2" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "p-4 text-lg font-semibold line-height-3 text-gray-900" }, { children: "Column Sorting" })), (0, jsx_runtime_1.jsx)(divider_1.Divider, { className: "m-0" }), (0, jsx_runtime_1.jsx)("ul", Object.assign({ className: "pl-0 m-1 h-10rem overflow-auto" }, { children: columnData === null || columnData === void 0 ? void 0 : columnData.map((eachColumn, index) => {
81
84
  if (eachColumn === null || eachColumn === void 0 ? void 0 : eachColumn.isSortable) {
82
85
  const isSelected = eachColumn.field === (sortValue === null || sortValue === void 0 ? void 0 : sortValue.field);
83
86
  return ((0, jsx_runtime_1.jsxs)("li", Object.assign({ className: `${isSelected && "bg-primary-25"} cursor-pointer border-round-md flex align-items-center gap-2 px-3 py-2 text-base line-height-2 text-gray-700`, style: { listStyleType: "none" }, onClick: () => onSelectSortValue(eachColumn) }, { children: [(0, jsx_runtime_1.jsx)(radiobutton_1.RadioButton, { id: "tableSort", checked: isSelected, type: "circle", value: sortValue }), (0, jsx_runtime_1.jsx)("label", Object.assign({ className: `${isSelected && "text-primary-400 font-semibold"}` }, { children: eachColumn === null || eachColumn === void 0 ? void 0 : eachColumn.headerName }))] }), index));
@@ -8,10 +8,20 @@ const react_1 = require("react");
8
8
  const overlaypanel_1 = require("primereact/overlaypanel");
9
9
  const querty_1 = tslib_1.__importDefault(require("./querty"));
10
10
  const MyProvider_1 = require("../../MyProvider");
11
+ const columns = [{ hederName: "title" }, { hederName: "gender" }];
12
+ const data2 = columns.map((col, idx) => {
13
+ let object = {
14
+ key: idx,
15
+ label: col.hederName,
16
+ };
17
+ return object;
18
+ });
19
+ console.log(data2, "data for tree");
11
20
  function FilterParent({ callBackForSelect }) {
12
- var _a;
21
+ var _a, _b;
13
22
  const filterRef = (0, react_1.useRef)(null);
14
- const { columnData, featureDetails, setFeatureDetails, callGrid, queries, setQueries } = (0, react_1.useContext)(MyProvider_1.FeatureContext);
23
+ const { columnData, featureDetails, setFeatureDetails, callGrid, queries, setQueries, } = (0, react_1.useContext)(MyProvider_1.FeatureContext);
24
+ console.log(data2, "data in reee");
15
25
  // Filter header
16
26
  const BulkActionHeader = (props) => {
17
27
  const { header: { label, description }, } = props;
@@ -27,7 +37,10 @@ function FilterParent({ callBackForSelect }) {
27
37
  filterRef.current.toggle(false);
28
38
  // setQueryCount(1)
29
39
  setQueries([0]);
30
- emptyFilterQuries();
40
+ const currentFeatureDetails = Object.assign({}, featureDetails);
41
+ currentFeatureDetails.filterQueries = [];
42
+ setFeatureDetails(currentFeatureDetails);
43
+ callGrid(currentFeatureDetails);
31
44
  };
32
45
  // Toggle the pop display
33
46
  const togglePopup = (e) => {
@@ -35,10 +48,6 @@ function FilterParent({ callBackForSelect }) {
35
48
  (_a = filterRef.current) === null || _a === void 0 ? void 0 : _a.toggle(e);
36
49
  // setQueryCount(1)
37
50
  };
38
- // Empty filterQuries
39
- const emptyFilterQuries = () => {
40
- setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { filterQueries: [] }));
41
- };
42
51
  // OnClick to +
43
52
  const actionOnPlus = () => {
44
53
  // setQueryCount((prevCount) => prevCount + 1);
@@ -47,7 +56,7 @@ function FilterParent({ callBackForSelect }) {
47
56
  updatedQureis.push(addLength);
48
57
  setQueries(updatedQureis);
49
58
  };
50
- // OnClick to -
59
+ // OnClick to -
51
60
  const actionOnMinus = (index) => {
52
61
  var _a;
53
62
  const filterQuries = (_a = featureDetails.filterQueries) === null || _a === void 0 ? void 0 : _a.filter((query) => query.idx !== index);
@@ -82,7 +91,9 @@ function FilterParent({ callBackForSelect }) {
82
91
  callGrid(featureDetails);
83
92
  filterRef.current.toggle(false);
84
93
  };
85
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, Object.assign({ text: true, className: "hover:bg-primary-25 ml-2", onClick: (e) => { togglePopup(e); } }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "filter-lines" }) })), (0, jsx_runtime_1.jsxs)("button", Object.assign({ className: "bg-white", onClick: resettingFilters }, { children: ["Selected ", (_a = featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.filterQueries) === null || _a === void 0 ? void 0 : _a.length] })), (0, jsx_runtime_1.jsxs)(overlaypanel_1.OverlayPanel, Object.assign({ ref: filterRef, className: "w-45rem bulk-action-feature" }, { children: [(0, jsx_runtime_1.jsx)(BulkActionHeader, { header: {
94
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [((_a = featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.filterQueries) === null || _a === void 0 ? void 0 : _a.length) > 0 ? ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "bg-primary-50 border-round flex align-items-center mx-2" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, Object.assign({ text: true, className: `${true && "font-semibold"} bg-transparent pr-0`, icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "filter-lines" }) }, { children: ((_b = featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.filterQueries) === null || _b === void 0 ? void 0 : _b.length) + " Selected" })), (0, jsx_runtime_1.jsx)(button_1.Button, { text: true, onClick: resettingFilters, className: "h-40 text-primary-400 bg-transparent", icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "x-close" }) })] }))) : ((0, jsx_runtime_1.jsx)(button_1.Button, { text: true, className: "hover:bg-primary-25 ml-2", onClick: (e) => {
95
+ togglePopup(e);
96
+ }, icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "filter-lines" }) })), (0, jsx_runtime_1.jsxs)(overlaypanel_1.OverlayPanel, Object.assign({ ref: filterRef, className: "w-45rem bulk-action-feature" }, { children: [(0, jsx_runtime_1.jsx)(BulkActionHeader, { header: {
86
97
  label: "Filters",
87
98
  description: "Streamline your search with filter",
88
99
  } }), RenderQuery(), (0, jsx_runtime_1.jsx)(BulkActionFooter, { footer: {
@@ -11,6 +11,7 @@ const Types_1 = require("../../Types");
11
11
  const inputnumber_1 = require("primereact/inputnumber");
12
12
  const calendar_1 = require("primereact/calendar");
13
13
  const multiselect_1 = require("primereact/multiselect");
14
+ const inputtext_1 = require("primereact/inputtext");
14
15
  function Querty({ currentIndex, queryIndex, columnData, featureDetails, setFeatureDetails, callBackForSelect, actionOnMinus, actionOnPlus, defaultFilterValue, }) {
15
16
  var _a, _b, _c;
16
17
  const [filterOperations, setFilterOperations] = (0, react_1.useState)([]);
@@ -55,7 +56,7 @@ function Querty({ currentIndex, queryIndex, columnData, featureDetails, setFeatu
55
56
  const renderUIElement = (type, value, onChange, options) => {
56
57
  switch (type) {
57
58
  case Types_1.ATTRIBUTEDATATYPES.STRING:
58
- return ((0, jsx_runtime_1.jsx)("input", { type: "text", value: value, onChange: (e) => onChange(e.target.value) }));
59
+ return ((0, jsx_runtime_1.jsx)(inputtext_1.InputText, { value: value, className: "border-noround", onChange: (e) => onChange(e.target.value) }));
59
60
  case Types_1.ATTRIBUTEDATATYPES.DATE:
60
61
  return ((0, jsx_runtime_1.jsx)(calendar_1.Calendar, { value: value, onChange: (e) => onChange(e.value), showIcon: true }));
61
62
  case Types_1.ATTRIBUTEDATATYPES.INTEGER:
@@ -6,14 +6,18 @@ const inputtext_1 = require("primereact/inputtext");
6
6
  const svg_component_1 = tslib_1.__importDefault(require("../../../directives/svg-component"));
7
7
  const react_1 = require("react");
8
8
  const MyProvider_1 = require("../MyProvider");
9
+ const hooks_1 = require("primereact/hooks");
9
10
  // import { useState } from "react";
10
11
  function Search({ searchPlaceHolder }) {
11
12
  const { featureDetails, setFeatureDetails } = (0, react_1.useContext)(MyProvider_1.FeatureContext);
13
+ const [inputValue, deboucedValue, setInputValue] = (0, hooks_1.useDebounce)("", 500);
14
+ (0, react_1.useEffect)(() => {
15
+ setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { searchedText: deboucedValue }));
16
+ }, [deboucedValue]);
12
17
  return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("span", Object.assign({ className: `p-input-icon-left ${featureDetails.searchedText.length > 0 && "p-input-icon-right"}` }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-prefix" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { color: "#667085", icon: "search-lg", size: 18 }) })), featureDetails.searchedText.length > 0 && ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-suffix cursor-pointer", onClick: () => {
13
18
  setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { searchedText: "" }));
14
- // setInputValue("");
15
- }, title: "Clear" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "x-close", size: 18 }) }))), (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { value: featureDetails.searchedText, onChange: (e) => {
16
- setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { searchedText: e.target.value }));
17
- }, className: "w-21rem", placeholder: searchPlaceHolder || "search by name or code" })] })) }));
19
+ }, title: "Clear" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "x-close", size: 18 }) }))), (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { value: inputValue, onChange: (e) => setInputValue(e.target.value),
20
+ // onChange={(e) => updateSearchText(e.target.value)}
21
+ className: "w-21rem", placeholder: searchPlaceHolder || "search by name or code" })] })) }));
18
22
  }
19
23
  exports.default = Search;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const inputtext_1 = require("primereact/inputtext");
6
+ const tree_1 = require("primereact/tree");
7
+ const button_1 = require("primereact/button");
8
+ const svg_component_1 = tslib_1.__importDefault(require("../../../directives/svg-component"));
9
+ const react_1 = require("react");
10
+ const overlaypanel_1 = require("primereact/overlaypanel");
11
+ const checkbox_1 = require("primereact/checkbox");
12
+ function Grouping() {
13
+ const columns = [{ hederName: "title" }, { hederName: "gender" }];
14
+ const data2 = columns.map((col, idx) => {
15
+ let object = {
16
+ key: idx,
17
+ label: col.hederName,
18
+ };
19
+ return object;
20
+ });
21
+ const columnGroupRef = (0, react_1.useRef)(null);
22
+ const [nodes, setNodes] = (0, react_1.useState)(data2 || []);
23
+ const [checked, setChecked] = (0, react_1.useState)(false);
24
+ const togglerTemplate = (node) => {
25
+ if (!node) {
26
+ return false;
27
+ }
28
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex align-items-center mr-3" }, { children: (0, jsx_runtime_1.jsx)(button_1.Button, { text: true, icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "drag-and-drop" }) }) })));
29
+ };
30
+ // column group functions
31
+ const nodeTemplate = (node) => {
32
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `flex align-items-center w-full border-round block w-full p-3 text-primary-400 font-semibold ${checked && "bg-primary-25"}` }, { children: [(0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { onChange: (e) => setChecked(e.checked), checked: checked }), (0, jsx_runtime_1.jsx)("span", { children: node.label })] })));
33
+ };
34
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { text: true, className: "h-40 text-primary-400", icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "grid-01" }), onClick: (e) => columnGroupRef.current.toggle(e) }), (0, jsx_runtime_1.jsxs)(overlaypanel_1.OverlayPanel, Object.assign({ ref: columnGroupRef, className: "column_group_overlay w-20rem" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-4" }, { children: [(0, jsx_runtime_1.jsx)("h3", Object.assign({ className: "my-0" }, { children: "Grouping" })), (0, jsx_runtime_1.jsx)("p", Object.assign({ className: "my-0" }, { children: "Select any 2 grouping options only" }))] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "p-4 border-bottom-1 border-top-1 border-gray-200 bg-gray-50" }, { children: (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { placeholder: "Search by column or attribute name", className: "w-full" }) })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "w-full" }, { children: (0, jsx_runtime_1.jsx)(tree_1.Tree, { value: nodes, nodeTemplate: nodeTemplate, dragdropScope: "demo", onDragDrop: (e) => setNodes(e.value), togglerTemplate: togglerTemplate, className: "list-items" }) })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-4 border-top-1 border-gray-200 flex justify-content-between" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { text: true, label: "Remove Grouping" }), (0, jsx_runtime_1.jsx)(button_1.Button, { label: "Save Grouping", disabled: true })] }))] }))] }));
35
+ }
36
+ exports.default = Grouping;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const button_1 = require("primereact/button");
6
+ const svg_component_1 = tslib_1.__importDefault(require("../../../directives/svg-component"));
7
+ const react_1 = require("react");
8
+ const sidebar_1 = require("primereact/sidebar");
9
+ const inputswitch_1 = require("primereact/inputswitch");
10
+ const inputtext_1 = require("primereact/inputtext");
11
+ const tree_1 = require("primereact/tree");
12
+ const columns = [{ hederName: "Media" }, { hederName: "Product Name" }, { hederName: "Product Code" }, { hederName: "Product Description" }, { hederName: "Price" }, { hederName: "Brand" }];
13
+ const data2 = columns.map((col, idx) => {
14
+ let object = {
15
+ key: idx,
16
+ label: col.hederName,
17
+ };
18
+ return object;
19
+ });
20
+ function HideColumn() {
21
+ const [visibleRight, setVisibleRight] = (0, react_1.useState)(false);
22
+ const [checked, setChecked] = (0, react_1.useState)(false);
23
+ const [inpValue, setInpValue] = (0, react_1.useState)("");
24
+ const [checkedStates, setCheckedStates] = (0, react_1.useState)({});
25
+ const [nodes, setNodes] = (0, react_1.useState)(data2 || []);
26
+ const handleSwitchChange = (id, value) => {
27
+ setCheckedStates((prevState) => (Object.assign(Object.assign({}, prevState), { [id]: value })));
28
+ };
29
+ // column group functions
30
+ const nodeTemplate = (node) => {
31
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center w-full border-round block w-full p-3 pr-0 text-primary-400 font-semibold justify-content-between" }, { children: [(0, jsx_runtime_1.jsx)("span", { children: node.label }), (0, jsx_runtime_1.jsx)(inputswitch_1.InputSwitch, { checked: checkedStates[node.id] || false, onChange: (e) => handleSwitchChange(node.id, e.value) })] })));
32
+ };
33
+ const togglerTemplate = (node) => {
34
+ if (!node) {
35
+ return false;
36
+ }
37
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex align-items-center" }, { children: (0, jsx_runtime_1.jsx)(button_1.Button, { text: true, icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "drag-and-drop" }) }) })));
38
+ };
39
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => setVisibleRight(true), className: "mr-3", text: true, icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "columns-02" }) }), (0, jsx_runtime_1.jsxs)(sidebar_1.Sidebar, Object.assign({ className: "md:w-6 lg:w-3", visible: visibleRight, position: "right", onHide: () => setVisibleRight(false) }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-between px-4 py-2 border-bottom-1 border-gray-200" }, { children: [(0, jsx_runtime_1.jsx)("h3", { children: "Configure Columns" }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { text: true, label: "Discard" }), (0, jsx_runtime_1.jsx)(button_1.Button, { label: "Update", disabled: true })] }))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-4" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "px-3 py-2" }, { children: [(0, jsx_runtime_1.jsxs)("h3", Object.assign({ className: "flex align-items-center justify-content-between my-0" }, { children: ["Apply to all views", (0, jsx_runtime_1.jsx)(inputswitch_1.InputSwitch, { checked: checked, onChange: (e) => setChecked(e.value) })] })), (0, jsx_runtime_1.jsx)("p", Object.assign({ className: "my-0 text-sm" }, { children: "Apply the chosen column selection to all available views" }))] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "py-2" }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-input-icon-left p-input-icon-right w-full" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-prefix" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "search-md" }) })), (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { id: "email", value: inpValue, onChange: (e) => {
40
+ setInpValue(e.target.value);
41
+ }, disabled: false, placeholder: "Search by column name", className: "text-lg font-normal text-gray-500 hover:text-gray-900 w-full" })] })) })), (0, jsx_runtime_1.jsxs)("p", Object.assign({ className: "py-2 my-0 text-gray-900 text-lg font-medium border-bottom-1 border-gray-200" }, { children: ["Selected Attributes", " ", (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-gray-500 text-sm" }, { children: "(10/15)" }))] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "w-full" }, { children: (0, jsx_runtime_1.jsx)(tree_1.Tree, { value: nodes, nodeTemplate: nodeTemplate, dragdropScope: "demo", onDragDrop: (e) => setNodes(e.value), togglerTemplate: togglerTemplate, className: "list-items" }) })), (0, jsx_runtime_1.jsx)("h3", Object.assign({ className: "mt-6 mb-0 pb-2 border-bottom-1 border-gray-200" }, { children: "Unselected Attributes" })), (0, jsx_runtime_1.jsx)("ul", Object.assign({ className: "list-none p-0 px-3" }, { children: (nodes === null || nodes === void 0 ? void 0 : nodes.length) > 0 &&
42
+ nodes.map((listItem) => ((0, jsx_runtime_1.jsxs)("li", Object.assign({ className: "flex align-items-center justify-content-between py-3" }, { children: [(0, jsx_runtime_1.jsx)("span", { children: listItem.label }), (0, jsx_runtime_1.jsx)(inputswitch_1.InputSwitch, { checked: checkedStates[listItem.id] || false, onChange: (e) => handleSwitchChange(listItem.id, e.value) })] }), listItem.id))) }))] }))] }))] }));
43
+ }
44
+ exports.default = HideColumn;
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
3
4
  const jsx_runtime_1 = require("react/jsx-runtime");
4
5
  const react_1 = require("react");
5
6
  const MyProvider_1 = require("../MyProvider");
7
+ const svg_component_1 = tslib_1.__importDefault(require("../../../directives/svg-component"));
8
+ const button_1 = require("primereact/button");
6
9
  function RefreshGrid() {
7
10
  const { removeFeaturesAndRefresh } = (0, react_1.useContext)(MyProvider_1.FeatureContext);
8
- return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("button", Object.assign({ onClick: removeFeaturesAndRefresh, className: "bg-white" }, { children: "Refresh" })) }));
11
+ return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(button_1.Button, { text: true, onClick: removeFeaturesAndRefresh, icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "refresh-ccw-01" }) }) }));
9
12
  }
10
13
  exports.default = RefreshGrid;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const react_1 = require("react");
5
+ const MyProvider_1 = require("../MyProvider");
6
+ function RemoveItems() {
7
+ const { featureDetails, callGrid } = (0, react_1.useContext)(MyProvider_1.FeatureContext);
8
+ const removeItemsCallBack = () => {
9
+ const currentFeature = Object.assign({}, featureDetails);
10
+ currentFeature.isRemoveClicked = true;
11
+ callGrid(currentFeature);
12
+ };
13
+ return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("button", Object.assign({ onClick: removeItemsCallBack }, { children: "-" })) }));
14
+ }
15
+ exports.default = RemoveItems;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ROWMODELTYPE = exports.conditionsList = exports.COLUMN_SORT_OPTIONS = void 0;
3
+ exports.ROW_HEIGHT = exports.DEBOUNCE_INTERVAL = exports.MAX_BLOCKS = exports.BLOCK_SIZE = exports.ROWMODELTYPE = exports.conditionsList = exports.COLUMN_SORT_OPTIONS = void 0;
4
4
  const Types_1 = require("./Types");
5
5
  exports.COLUMN_SORT_OPTIONS = [
6
6
  { id: 1, label: "Low - High", sortId: 1, dataType: Types_1.ATTRIBUTEDATATYPES.INTEGER },
@@ -42,3 +42,7 @@ exports.ROWMODELTYPE = {
42
42
  SERVER_SIDE: "serverSide",
43
43
  CLIENT_SIDE: "clientSide",
44
44
  };
45
+ exports.BLOCK_SIZE = 100;
46
+ exports.MAX_BLOCKS = 2;
47
+ exports.DEBOUNCE_INTERVAL = 200;
48
+ exports.ROW_HEIGHT = 60;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const jsx_runtime_1 = require("react/jsx-runtime");
4
- const Checkbox = ({ checked, onChange, isInterminate }) => {
4
+ const GridCheckBOx = ({ checked, onChange, isInterminate }) => {
5
5
  console.log(isInterminate, 'is interminat status in checkbox');
6
6
  return ((0, jsx_runtime_1.jsx)("input", { type: "checkbox", checked: checked, onChange: onChange }));
7
7
  };
8
- exports.default = Checkbox;
8
+ exports.default = GridCheckBOx;
@@ -9074,6 +9074,18 @@ exports.iconList = [
9074
9074
  svg: `<svg xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
9075
9075
  <path d="M11.1654 3.375L5.4362 9.10417L2.83203 6.5" stroke="white" stroke-width="2.08333" stroke-linecap="round" stroke-linejoin="round"/>
9076
9076
  </svg>`,
9077
+ },
9078
+ {
9079
+ name: "drag-and-drop",
9080
+ svg: `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
9081
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7 2.5C7.39782 2.5 7.77936 2.65804 8.06066 2.93934C8.34196 3.22064 8.5 3.60218 8.5 4C8.5 4.39782 8.34196 4.77936 8.06066 5.06066C7.77936 5.34196 7.39782 5.5 7 5.5C6.60218 5.5 6.22064 5.34196 5.93934 5.06066C5.65804 4.77936 5.5 4.39782 5.5 4C5.5 3.60218 5.65804 3.22064 5.93934 2.93934C6.22064 2.65804 6.60218 2.5 7 2.5Z" fill="#667085"/>
9082
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M13 2.5C13.3978 2.5 13.7794 2.65804 14.0607 2.93934C14.342 3.22064 14.5 3.60218 14.5 4C14.5 4.39782 14.342 4.77936 14.0607 5.06066C13.7794 5.34196 13.3978 5.5 13 5.5C12.6022 5.5 12.2206 5.34196 11.9393 5.06066C11.658 4.77936 11.5 4.39782 11.5 4C11.5 3.60218 11.658 3.22064 11.9393 2.93934C12.2206 2.65804 12.6022 2.5 13 2.5Z" fill="#667085"/>
9083
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7 8.5C7.39782 8.5 7.77936 8.65804 8.06066 8.93934C8.34196 9.22064 8.5 9.60218 8.5 10C8.5 10.3978 8.34196 10.7794 8.06066 11.0607C7.77936 11.342 7.39782 11.5 7 11.5C6.60218 11.5 6.22064 11.342 5.93934 11.0607C5.65804 10.7794 5.5 10.3978 5.5 10C5.5 9.60218 5.65804 9.22064 5.93934 8.93934C6.22064 8.65804 6.60218 8.5 7 8.5Z" fill="#667085"/>
9084
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M13 8.5C13.3978 8.5 13.7794 8.65804 14.0607 8.93934C14.342 9.22064 14.5 9.60218 14.5 10C14.5 10.3978 14.342 10.7794 14.0607 11.0607C13.7794 11.342 13.3978 11.5 13 11.5C12.6022 11.5 12.2206 11.342 11.9393 11.0607C11.658 10.7794 11.5 10.3978 11.5 10C11.5 9.60218 11.658 9.22064 11.9393 8.93934C12.2206 8.65804 12.6022 8.5 13 8.5Z" fill="#667085"/>
9085
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7 14.5C7.39782 14.5 7.77936 14.658 8.06066 14.9393C8.34196 15.2206 8.5 15.6022 8.5 16C8.5 16.3978 8.34196 16.7794 8.06066 17.0607C7.77936 17.342 7.39782 17.5 7 17.5C6.60218 17.5 6.22064 17.342 5.93934 17.0607C5.65804 16.7794 5.5 16.3978 5.5 16C5.5 15.6022 5.65804 15.2206 5.93934 14.9393C6.22064 14.658 6.60218 14.5 7 14.5Z" fill="#667085"/>
9086
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M13 14.5C13.3978 14.5 13.7794 14.658 14.0607 14.9393C14.342 15.2206 14.5 15.6022 14.5 16C14.5 16.3978 14.342 16.7794 14.0607 17.0607C13.7794 17.342 13.3978 17.5 13 17.5C12.6022 17.5 12.2206 17.342 11.9393 17.0607C11.658 16.7794 11.5 16.3978 11.5 16C11.5 15.6022 11.658 15.2206 11.9393 14.9393C12.2206 14.658 12.6022 14.5 13 14.5Z" fill="#667085"/>
9087
+ </svg>
9088
+ `,
9077
9089
  },
9078
9090
  {
9079
9091
  name: "check-circle-remove",
@@ -8,6 +8,7 @@ interface MyProviderProps {
8
8
  gridData: GridData;
9
9
  callGrid: (featureDetails: Features) => void;
10
10
  totalRecords: number;
11
+ initialFeature: Features;
11
12
  };
12
13
  }
13
14
  declare function MyProvider({ children, value }: MyProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,3 @@
1
+ import "./ag-grid.scss";
1
2
  declare function ParentForGrid(props: any): import("react/jsx-runtime").JSX.Element;
2
3
  export default ParentForGrid;
@@ -57,6 +57,8 @@ export interface Features {
57
57
  searchedText: string;
58
58
  filterQueries: Filter[] | [];
59
59
  sort: Sort;
60
+ checkBoxSelection: CheckBoxSelection;
61
+ isRemoveClicked: boolean;
60
62
  }
61
63
  export interface ParentProp {
62
64
  }
@@ -84,10 +86,13 @@ export interface GridData {
84
86
  columnData: ColumnDef[];
85
87
  }
86
88
  export interface ConditionsToDisplay {
87
- displayFilter: boolean;
88
- displaySort: boolean;
89
- displaySearch: boolean;
90
- displayRefresh: boolean;
89
+ displayFilter?: boolean;
90
+ displaySort?: boolean;
91
+ displaySearch?: boolean;
92
+ displayRefresh?: boolean;
93
+ displayRemoveItems?: boolean;
94
+ displayGrouping?: boolean;
95
+ displayColumnHide?: boolean;
91
96
  }
92
97
  export interface PropsFromProduct {
93
98
  columnData: ColumnDef[];
@@ -99,5 +104,9 @@ export interface PropsFromProduct {
99
104
  export interface ResoponseFromCallback {
100
105
  totalRecords: number;
101
106
  rowData: any[];
107
+ }
108
+ export interface ResponseFromApi {
109
+ totalRecords: number;
110
+ rowData: any[];
102
111
  actualEndRow?: number;
103
112
  }
@@ -0,0 +1,2 @@
1
+ declare function Grouping(): import("react/jsx-runtime").JSX.Element;
2
+ export default Grouping;
@@ -0,0 +1,2 @@
1
+ declare function HideColumn(): import("react/jsx-runtime").JSX.Element;
2
+ export default HideColumn;
@@ -0,0 +1,2 @@
1
+ declare function RemoveItems(): import("react/jsx-runtime").JSX.Element;
2
+ export default RemoveItems;
@@ -6,3 +6,7 @@ export declare const ROWMODELTYPE: {
6
6
  SERVER_SIDE: string;
7
7
  CLIENT_SIDE: string;
8
8
  };
9
+ export declare const BLOCK_SIZE = 100;
10
+ export declare const MAX_BLOCKS = 2;
11
+ export declare const DEBOUNCE_INTERVAL = 200;
12
+ export declare const ROW_HEIGHT = 60;
@@ -4,5 +4,5 @@ interface CheckboxProps {
4
4
  onChange: () => void;
5
5
  isInterminate: boolean;
6
6
  }
7
- declare const Checkbox: React.FC<CheckboxProps>;
8
- export default Checkbox;
7
+ declare const GridCheckBOx: React.FC<CheckboxProps>;
8
+ export default GridCheckBOx;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sccoreui",
3
- "version": "5.8.7",
3
+ "version": "5.8.9",
4
4
  "description": "ui-sccore",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",