sccoreui 6.1.92 → 6.1.94

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/dist/App.scss CHANGED
@@ -335,6 +335,30 @@ code {
335
335
  }
336
336
  }
337
337
  }
338
+ .table_filters_1 {
339
+ height: auto;
340
+ display: flex;
341
+ justify-content: center;
342
+ align-items: center;
343
+ padding: 10px 0px !important;
344
+
345
+ .p-chips-multiple-container {
346
+ padding: 7px 10px 6px 10px;
347
+ width: 100%;
348
+ max-height: 40px !important;
349
+ border-top-left-radius: 0;
350
+ border-bottom-left-radius: 0;
351
+ overflow: auto;
352
+
353
+ &:not(.p-disabled):hover {
354
+ border-color: var(--gray-300);
355
+ }
356
+
357
+ &:not(.p-disabled).p-focus {
358
+ box-shadow: none;
359
+ }
360
+ }
361
+ }
338
362
 
339
363
  .multi-pl-32 {
340
364
  padding-left: 40px;
@@ -46,5 +46,4 @@ var FilteredConditionTypes;
46
46
  FilteredConditionTypes[FilteredConditionTypes["IS_EQUAL_TO"] = 23] = "IS_EQUAL_TO";
47
47
  FilteredConditionTypes[FilteredConditionTypes["IS_EQUAL_TO_ALL_OF"] = 24] = "IS_EQUAL_TO_ALL_OF";
48
48
  FilteredConditionTypes[FilteredConditionTypes["IS_EQUAL_TO_ANY_OF"] = 25] = "IS_EQUAL_TO_ANY_OF";
49
- FilteredConditionTypes[FilteredConditionTypes["IS_EQUAL_TO_ALL"] = 26] = "IS_EQUAL_TO_ALL";
50
49
  })(FilteredConditionTypes = exports.FilteredConditionTypes || (exports.FilteredConditionTypes = {}));
@@ -10,7 +10,6 @@ const drag_and_drop_icon_png_1 = tslib_1.__importDefault(require("../../../asset
10
10
  const checkbox_1 = require("primereact/checkbox");
11
11
  const button_1 = require("primereact/button");
12
12
  const context_provider_1 = require("../context-provider");
13
- const helper_1 = require("../helper");
14
13
  // import { ColumnDef } from "../Types";
15
14
  const ColumnGroup = (props) => {
16
15
  var _a, _b, _c, _d;
@@ -18,14 +17,11 @@ const ColumnGroup = (props) => {
18
17
  const columnGroupRef = (0, react_1.useRef)(null);
19
18
  const btnRef = (0, react_1.useRef)(null);
20
19
  const [inpVlaue, setInpValue] = (0, react_1.useState)("");
21
- const { gridApi, setGridData, setSelectedGroup, setFeatureDetails, featureDetails, initialCheckBoxData, intialColumns,
22
- // setIntialColumns,
23
- } = (0, react_1.useContext)(context_provider_1.FeatureContext);
20
+ const { gridApi, setGridData, setSelectedGroup, setFeatureDetails, featureDetails, initialCheckBoxData } = (0, react_1.useContext)(context_provider_1.FeatureContext);
24
21
  const [columns, setColumns] = (0, react_1.useState)([]);
25
22
  const [renderColumns, setRenderColumns] = (0, react_1.useState)([]);
26
23
  const [columnsSelectedForGroup, setColumnsSelectedForGroup] = (0, react_1.useState)([]);
27
24
  const [selectedCheckBoxesLength, setSelectedCheckBoxesLength] = (0, react_1.useState)(null);
28
- console.log("intiallllllllll", intialColumns);
29
25
  // const [featureDetails, setFeatureDetails] = useState<Features>({
30
26
  // searchedText: "",
31
27
  // filterQueries: [],
@@ -58,7 +54,8 @@ const ColumnGroup = (props) => {
58
54
  };
59
55
  const onSelectedCheckbox = (item, e) => {
60
56
  const isChecked = e.checked;
61
- const updatedColumns = renderColumns.map((listItem) => listItem.id === item.id ? Object.assign(Object.assign({}, listItem), { rowGroup: isChecked }) : listItem);
57
+ const updatedColumns = renderColumns.map((listItem) => listItem.id === item.id
58
+ ? Object.assign(Object.assign({}, listItem), { rowGroup: isChecked }) : listItem);
62
59
  // Sort columns: checked (true) come before unchecked (false)
63
60
  const sortedColumns = updatedColumns.sort((a, b) => (b.rowGroup ? 1 : 0) - (a.rowGroup ? 1 : 0));
64
61
  // setColumns(sortedColumns);
@@ -66,7 +63,6 @@ const ColumnGroup = (props) => {
66
63
  const lengthOfSelectedCheckBoxes = sortedColumns.filter((col) => col.rowGroup).length;
67
64
  setSelectedCheckBoxesLength(lengthOfSelectedCheckBoxes);
68
65
  };
69
- console.log("columns innnnnnnn", dataFromProps);
70
66
  const searchResults = (e) => {
71
67
  // console.log
72
68
  setRenderColumns(() => columns.filter((column) => {
@@ -75,7 +71,7 @@ const ColumnGroup = (props) => {
75
71
  }));
76
72
  setInpValue(e.target.value);
77
73
  };
78
- // Save Grouping
74
+ // Save Grouping
79
75
  const saveGrouping = (e) => {
80
76
  var _a, _b;
81
77
  setSelectedGroup([]);
@@ -110,28 +106,23 @@ const ColumnGroup = (props) => {
110
106
  };
111
107
  // Remove grouping
112
108
  const clearListItems = (e) => {
109
+ var _a, _b;
113
110
  e.stopPropagation();
114
111
  setSelectedGroup([]);
115
- if (gridApi) {
116
- // Use deep copy of `intialColumns` to ensure no unintended mutation
117
- const clonedInitialColumns = (0, helper_1.deepClone)(intialColumns);
118
- console.log("clonedInitialColumns", clonedInitialColumns);
119
- // Update grid's column definitions
120
- gridApi.current.api.setColumnDefs(clonedInitialColumns);
121
- gridApi.current.columnApi.setRowGroupColumns([]);
122
- // Reflect the new column configuration in the state
123
- setGridData((prev) => (Object.assign(Object.assign({}, prev), { columnData: clonedInitialColumns })));
124
- // Reset states accordingly
125
- setColumnsSelectedForGroup([]);
126
- setRenderColumns(clonedInitialColumns);
127
- setSelectedCheckBoxesLength(0);
128
- setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: initialCheckBoxData }));
129
- if (columnGroupRef === null || columnGroupRef === void 0 ? void 0 : columnGroupRef.current) {
130
- columnGroupRef.current.hide();
131
- }
132
- }
112
+ // Update the grid's column definitions with the modified columns
113
+ gridApi && ((_a = gridApi === null || gridApi === void 0 ? void 0 : gridApi.current) === null || _a === void 0 ? void 0 : _a.api.setGridOption("columnDefs", dataFromProps.columData));
114
+ gridApi && ((_b = gridApi === null || gridApi === void 0 ? void 0 : gridApi.current) === null || _b === void 0 ? void 0 : _b.columnApi.setRowGroupColumns([])); // Clear row group columns
115
+ // Update the grid's data state to reflect the new column configuration
116
+ setGridData((prev) => (Object.assign(Object.assign({}, prev), { columnData: dataFromProps.columnData })));
117
+ // Reset the state
118
+ setColumnsSelectedForGroup([]);
119
+ setRenderColumns(dataFromProps.columnData);
120
+ setSelectedCheckBoxesLength(0);
121
+ // Reset the feature details state
122
+ setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: initialCheckBoxData }));
123
+ // Hide the column grouping UI element
124
+ (columnGroupRef === null || columnGroupRef === void 0 ? void 0 : columnGroupRef.current) && (columnGroupRef === null || columnGroupRef === void 0 ? void 0 : columnGroupRef.current.hide());
133
125
  };
134
- console.log("intialllllll columns", intialColumns);
135
126
  const handleHide = () => {
136
127
  var _a, _b, _c;
137
128
  // Reset the renderColumns when the OverlayPanel is hidden
@@ -143,19 +134,16 @@ const ColumnGroup = (props) => {
143
134
  };
144
135
  (0, react_1.useEffect)(() => {
145
136
  var _a, _b, _c, _d, _e, _f, _g, _h;
146
- // Get columns from grid
137
+ // Get columns from grd
147
138
  if ((_d = (_c = (_b = (_a = gridApi === null || gridApi === void 0 ? void 0 : gridApi.current) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.columnModel) === null || _c === void 0 ? void 0 : _c.columnDefs) === null || _d === void 0 ? void 0 : _d.length) {
148
- // Deep clone columns from the grid to avoid mutation
149
139
  const columnsFromGrid = (_h = (_g = (_f = (_e = gridApi === null || gridApi === void 0 ? void 0 : gridApi.current) === null || _e === void 0 ? void 0 : _e.api) === null || _f === void 0 ? void 0 : _f.columnModel) === null || _g === void 0 ? void 0 : _g.columnDefs) === null || _h === void 0 ? void 0 : _h.map((column) => {
150
- return Object.assign(Object.assign({}, column), { rowGroup: false }); // Create a shallow copy with `rowGroup` set to false
140
+ column.rowGroup = false;
141
+ return column;
151
142
  });
152
- // Update state with the cloned columns
153
143
  setColumns(columnsFromGrid);
154
144
  setRenderColumns(columnsFromGrid);
155
145
  }
156
146
  }, [(_d = (_c = (_b = (_a = gridApi === null || gridApi === void 0 ? void 0 : gridApi.current) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.columnModel) === null || _c === void 0 ? void 0 : _c.columnDefs) === null || _d === void 0 ? void 0 : _d.length]);
157
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `${(columnsSelectedForGroup === null || columnsSelectedForGroup === void 0 ? void 0 : columnsSelectedForGroup.length) > 0 ? "bg-primary-50" : "bg-white"} hover:bg-primary-25 br-8 cursor-pointer pd-9 flex align-items-cente gap-1 zoom_animate`, ref: btnRef, onClick: showColumnOptions }, { children: [(0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "grid-01", size: 18, color: (columnsSelectedForGroup === null || columnsSelectedForGroup === void 0 ? void 0 : columnsSelectedForGroup.length) > 0
158
- ? "text-primary-400"
159
- : "text-gray-500" }), (columnsSelectedForGroup === null || columnsSelectedForGroup === void 0 ? void 0 : columnsSelectedForGroup.length) > 0 && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-center" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-primary-400 font-semibold ml-1" }, { children: columnsSelectedForGroup === null || columnsSelectedForGroup === void 0 ? void 0 : columnsSelectedForGroup.length })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-2 text-primary-400 font-semibold" }, { children: [(0, jsx_runtime_1.jsx)("p", Object.assign({ className: "ml-2" }, { children: "Selected" })), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: (e) => clearListItems(e), className: "h-auto p-0", text: true, icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "x-close", color: "text-primary-400", size: 18 }) })] }))] })))] })), (0, jsx_runtime_1.jsxs)(overlaypanel_1.OverlayPanel, Object.assign({ ref: columnGroupRef, className: "column-group p-1", onHide: handleHide }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "column-header" }, { 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 mb-4" }, { children: "Select one or two columns for sorting" }))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "column-body" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-input-icon-right w-full p-2 bg-gray-50" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-suffix top-0", style: { right: "20px" } }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "search-md" }) })), (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { onChange: (e) => searchResults(e), value: inpVlaue, disabled: false, placeholder: "Enter any column name", className: "text-lg font-normal text-gray-500 hover:text-gray-900 w-full" })] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex flex-column gap-1 mt-1 mr-1 max-h-15rem max-w-30rem overflow-y-auto" }, { children: renderColumns.map((column, index) => ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-2 pl-2" }, { children: [column.rowGroup && ((0, jsx_runtime_1.jsx)("img", { onDragStart: (e) => onDragStart(e, index), onDragOver: onDragOver, onDrop: (e) => onDrop(e, index), src: drag_and_drop_icon_png_1.default, width: 20, height: 20 })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `flex gap-2 ${column.rowGroup && "bg-primary-25"} hover:bg-primary-25 border-round-sm p-3 w-full` }, { children: [(0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { checked: column.rowGroup, onChange: (e) => onSelectedCheckbox(column, e), disabled: selectedCheckBoxesLength === 2 && !column.rowGroup }), (0, jsx_runtime_1.jsx)("label", Object.assign({ className: "max-w-28rem line-clamp line-clamp-1 inline-block", title: column.headerName }, { children: column.headerName }))] }))] }), column.id))) }))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "column-footer gap-2 border-top-1 border-gray-200 flex align-items-center justify-content-between" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { className: "cursor-pointer", text: true, label: "Remove Grouping", onClick: (e) => clearListItems(e) }), (0, jsx_runtime_1.jsx)(button_1.Button, { className: "cursor-pointer", label: "Save Grouping", onClick: (e) => saveGrouping(e) })] }))] }))] }));
147
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `${(columnsSelectedForGroup === null || columnsSelectedForGroup === void 0 ? void 0 : columnsSelectedForGroup.length) > 0 ? "bg-primary-50" : "bg-white"} hover:bg-primary-25 br-8 cursor-pointer pd-9 flex align-items-cente gap-1 zoom_animate`, ref: btnRef, onClick: showColumnOptions }, { children: [(0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "grid-01", size: 18, color: (columnsSelectedForGroup === null || columnsSelectedForGroup === void 0 ? void 0 : columnsSelectedForGroup.length) > 0 ? "text-primary-400" : "text-gray-500" }), (columnsSelectedForGroup === null || columnsSelectedForGroup === void 0 ? void 0 : columnsSelectedForGroup.length) > 0 && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-center" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-primary-400 font-semibold ml-1" }, { children: columnsSelectedForGroup === null || columnsSelectedForGroup === void 0 ? void 0 : columnsSelectedForGroup.length })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-2 text-primary-400 font-semibold" }, { children: [(0, jsx_runtime_1.jsx)("p", Object.assign({ className: "ml-2" }, { children: "Selected" })), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: (e) => clearListItems(e), className: "h-auto p-0", text: true, icon: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "x-close", color: "text-primary-400", size: 18 }) })] }))] })))] })), (0, jsx_runtime_1.jsxs)(overlaypanel_1.OverlayPanel, Object.assign({ ref: columnGroupRef, className: "column-group p-1", onHide: handleHide }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "column-header" }, { 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 mb-4" }, { children: "Select one or two columns for sorting" }))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "column-body" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "p-input-icon-right w-full p-2 bg-gray-50" }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-suffix top-0", style: { right: "20px" } }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "search-md" }) })), (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { onChange: (e) => searchResults(e), value: inpVlaue, disabled: false, placeholder: "Enter any column name", className: "text-lg font-normal text-gray-500 hover:text-gray-900 w-full" })] })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "flex flex-column gap-1 mt-1 mr-1 max-h-15rem max-w-30rem overflow-y-auto" }, { children: renderColumns.map((column, index) => ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-2 pl-2" }, { children: [column.rowGroup && ((0, jsx_runtime_1.jsx)("img", { onDragStart: (e) => onDragStart(e, index), onDragOver: onDragOver, onDrop: (e) => onDrop(e, index), src: drag_and_drop_icon_png_1.default, width: 20, height: 20 })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `flex gap-2 ${column.rowGroup && "bg-primary-25"} hover:bg-primary-25 border-round-sm p-3 w-full` }, { children: [(0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { checked: column.rowGroup, onChange: (e) => onSelectedCheckbox(column, e), disabled: selectedCheckBoxesLength === 2 && !column.rowGroup }), (0, jsx_runtime_1.jsx)("label", Object.assign({ className: "max-w-28rem line-clamp line-clamp-1 inline-block", title: column.headerName }, { children: column.headerName }))] }))] }), column.id))) }))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "column-footer gap-2 border-top-1 border-gray-200 flex align-items-center justify-content-between" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { className: "cursor-pointer", text: true, label: "Remove Grouping", onClick: (e) => clearListItems(e) }), (0, jsx_runtime_1.jsx)(button_1.Button, { className: "cursor-pointer", label: "Save Grouping", onClick: (e) => saveGrouping(e) })] }))] }))] }));
160
148
  };
161
149
  exports.default = ColumnGroup;
@@ -11,6 +11,8 @@ const inputnumber_1 = require("primereact/inputnumber");
11
11
  const inputtext_1 = require("primereact/inputtext");
12
12
  const multi_select_dropdown_1 = tslib_1.__importDefault(require("../../../../multi-select-dropdown/multi-select-dropdown"));
13
13
  const svg_component_1 = tslib_1.__importDefault(require("../../../../../directives/svg-component"));
14
+ const chips_1 = require("primereact/chips");
15
+ const constants_1 = tslib_1.__importDefault(require("../../../constants"));
14
16
  const Conditions = (props) => {
15
17
  const { columnName, condition, value, columnsArray, conditionsArray, index, id, updateconditionsArray, removeConditionFromArray, addEmptyCondition, conditionsLength, conditionType, conditionTypes, handleConditionType, filterModelText } = props;
16
18
  const onAddCondition = (index) => {
@@ -50,7 +52,12 @@ const Conditions = (props) => {
50
52
  var _a, _b, _c, _d, _e, _f;
51
53
  switch (selectedColumn.dataType) {
52
54
  case Types_1.FilterDataType.STRING: {
53
- return ((0, jsx_runtime_1.jsx)(inputtext_1.InputText, { disabled: !condition, className: "border-noround-left col-4 focus:shadow-none lh-44 h-44 flex align-items-center pl-3", value: value, placeholder: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.elementThreePlaceHolder_Input) ? filterModelText.elementThreePlaceHolder_Input : "Enter", onChange: (event) => handleDynamicFieldState(event.target.value) }));
55
+ if (condition === Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO || condition === Types_1.FilteredConditionTypes.IS_EQUAL_TO) {
56
+ return ((0, jsx_runtime_1.jsx)(inputtext_1.InputText, { disabled: !condition, className: "border-noround-left col-4 focus:shadow-none lh-44 h-44 flex align-items-center pl-3", value: value, placeholder: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.elementThreePlaceHolder_Input) ? filterModelText.elementThreePlaceHolder_Input : "Enter", onChange: (event) => handleDynamicFieldState(event.target.value) }));
57
+ }
58
+ else {
59
+ return ((0, jsx_runtime_1.jsx)(chips_1.Chips, { value: value, disabled: !condition, className: "table_filters_1 border-noround-left col-4 focus:shadow-none lh-44 h-44 flex align-items-center", onChange: (e) => handleDynamicFieldState(e.target.value), placeholder: "Enter", separator: "," }));
60
+ }
54
61
  }
55
62
  case Types_1.FilterDataType.DECIMAL:
56
63
  case Types_1.FilterDataType.PERCENT:
@@ -73,7 +80,12 @@ const Conditions = (props) => {
73
80
  }
74
81
  }
75
82
  case Types_1.FilterDataType.SELECT: {
76
- return ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: "border-noround-left col-4 focus:shadow-none lh-44 h-44 flex align-items-center dropdown-focus-none pl-3", value: value, options: selectedColumn.options, optionLabel: "label", placeholder: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.elementThreePlaceHolder_DropDown) ? filterModelText.elementThreePlaceHolder_DropDown : "Select", disabled: !condition, onChange: (event) => handleDynamicFieldState(event.value) }));
83
+ if (condition === Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO || condition === Types_1.FilteredConditionTypes.IS_EQUAL_TO) {
84
+ return ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: "border-noround-left col-4 focus:shadow-none lh-44 h-44 flex align-items-center dropdown-focus-none pl-3", value: value, options: selectedColumn.options, optionLabel: "label", placeholder: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.elementThreePlaceHolder_DropDown) ? filterModelText.elementThreePlaceHolder_DropDown : "Select", disabled: !condition, onChange: (event) => handleDynamicFieldState(event.value) }));
85
+ }
86
+ else {
87
+ return ((0, jsx_runtime_1.jsx)(multi_select_dropdown_1.default, { className: "filter-multi-dropdown border-noround-left p-0 col-4 focus:shadow-none lh-44 h-44", value: value, hidePanelHeader: true, maxSelectedLabels: 1, onChange: (event) => handleDynamicFieldState(event.value), placeholder: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.elementThreePlaceHolder_MultiSelect) ? filterModelText.elementThreePlaceHolder_MultiSelect : "Select", options: selectedColumn.options ? selectedColumn.options.map((x) => { return Object.assign(Object.assign({}, x), { name: x.label }); }) : [], dropdownType: "default", optionLabel: "label" }));
88
+ }
77
89
  }
78
90
  case Types_1.FilterDataType.DATE:
79
91
  case Types_1.FilterDataType.DATEANDTIME: {
@@ -102,6 +114,11 @@ const Conditions = (props) => {
102
114
  }
103
115
  };
104
116
  return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "grid my-1 align-items-center" }, { children: [index !== 0 ?
105
- (0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: "operator-type col-2 w-7rem mx-4 border-1 mb-1 border-gray-300 lh-44 h-44", options: conditionTypes, optionLabel: "label", placeholder: "Select", value: conditionType, disabled: index !== 1, onChange: (event) => handleConditionType(event.target.value) }) : (0, jsx_runtime_1.jsx)("div", { className: "col-2 w-7rem mx-4" }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "col-9 grid filter-dropdowns overflow-y-hidden" }, { children: [(0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: `condition-dropdown dropdown-focus-none border-noround-right col-4 pl-3`, options: columnsArray, optionLabel: "name", placeholder: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.elementOnePlaceHolder) ? filterModelText.elementOnePlaceHolder : "Select", value: columnsArray.find((item) => item.code === columnName.code), onChange: (event) => onUpdateColumnName(event.value), panelClassName: "w-14rem" }), (0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: "condition-type hide-focus border-noround remove-focus border-x-none filter-dropdown-grid col-4", options: conditionsArray.filter((each) => each.datatypes.includes(columnName === null || columnName === void 0 ? void 0 : columnName.dataType)).map((option) => { return Object.assign(Object.assign({}, option), { name: option.name.toLowerCase().split(' ').map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(' ') }); }), value: condition, disabled: columnName === '', optionLabel: "name", placeholder: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.elementTwoPlaceHolder) ? filterModelText.elementTwoPlaceHolder : "Select", onChange: (event) => onUpdateCondition(event.value), panelClassName: "w-14rem" }), renderDynamicField(columnName)] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-start gap-1 col-1" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, Object.assign({ text: true, className: "focus:shadow-none sc_icon_hover mb-2 h-auto p-0", onClick: () => onAddCondition(index), disabled: false }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "plus-circle", size: 20, color: "text-gray-500" }) })), (0, jsx_runtime_1.jsx)(button_1.Button, Object.assign({ text: true, disabled: conditionsLength === 1, className: "focus:shadow-none sc_icon_hover h-auto p-0 mb-2", onClick: () => onRemoveCondition(id) }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "minus-circle", size: 20, color: "text-gray-500" }) }))] }))] })));
117
+ (0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: "operator-type col-2 w-7rem mx-4 border-1 mb-1 border-gray-300 lh-44 h-44", options: conditionTypes, optionLabel: "label", placeholder: "Select", value: conditionType, disabled: index !== 1, onChange: (event) => handleConditionType(event.target.value) }) : (0, jsx_runtime_1.jsx)("div", { className: "col-2 w-7rem mx-4" }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "col-9 grid filter-dropdowns overflow-y-hidden" }, { children: [(0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: `condition-dropdown dropdown-focus-none border-noround-right col-4 pl-3`, options: columnsArray, optionLabel: "name", placeholder: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.elementOnePlaceHolder) ? filterModelText.elementOnePlaceHolder : "Select", value: columnsArray.find((item) => item.code === columnName.code), onChange: (event) => onUpdateColumnName(event.value), panelClassName: "w-14rem" }), (0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { className: "condition-type hide-focus border-noround remove-focus border-x-none filter-dropdown-grid col-4", value: condition, options: conditionsArray
118
+ .filter((each) => {
119
+ var _a;
120
+ return (_a = constants_1.default.accessBasedOnDataType
121
+ .find((access) => access.datatype === (columnName === null || columnName === void 0 ? void 0 : columnName.dataType))) === null || _a === void 0 ? void 0 : _a.conditions.includes(each.value);
122
+ }), disabled: columnName === '', optionLabel: "name", placeholder: (filterModelText === null || filterModelText === void 0 ? void 0 : filterModelText.elementTwoPlaceHolder) ? filterModelText.elementTwoPlaceHolder : "Select", onChange: (event) => onUpdateCondition(event.value), panelClassName: "w-14rem" }), renderDynamicField(columnName)] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-start gap-1 col-1" }, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, Object.assign({ text: true, className: "focus:shadow-none sc_icon_hover mb-2 h-auto p-0", onClick: () => onAddCondition(index), disabled: false }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "plus-circle", size: 20, color: "text-gray-500" }) })), (0, jsx_runtime_1.jsx)(button_1.Button, Object.assign({ text: true, disabled: conditionsLength === 1, className: "focus:shadow-none sc_icon_hover h-auto p-0 mb-2", onClick: () => onRemoveCondition(id) }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { icon: "minus-circle", size: 20, color: "text-gray-500" }) }))] }))] })));
106
123
  };
107
124
  exports.default = Conditions;
@@ -90,6 +90,7 @@ const TableFilter = () => {
90
90
  setConditionsArray(arr);
91
91
  showFilter.current.toggle(false);
92
92
  };
93
+ console.log(conditionsArray);
93
94
  const onresetFilter = () => {
94
95
  applyAdvancedFilter([]);
95
96
  setConditionsArray([defaultCondition]);
@@ -133,7 +134,10 @@ const TableFilter = () => {
133
134
  }, [isOverlayOpened]);
134
135
  (0, react_1.useEffect)(() => {
135
136
  const isAllFieldsFilled = conditionsArray.every((condition) => {
136
- return condition.columnName && condition.condition && condition.value;
137
+ if (condition.columnName && condition.condition) {
138
+ return Array.isArray(condition.value) ? condition.value.length > 0 : Boolean(condition.value);
139
+ }
140
+ return false;
137
141
  });
138
142
  setAllFieldsFilled(isAllFieldsFilled && enbleApply);
139
143
  }, [conditionsArray, enbleApply]);
@@ -34,32 +34,351 @@ var DEFAULTS;
34
34
  DEFAULTS[DEFAULTS["TIMEZONE"] = 8] = "TIMEZONE";
35
35
  })(DEFAULTS || (DEFAULTS = {}));
36
36
  exports.DEFAULTS = DEFAULTS;
37
- const conditionsList = [
38
- { name: "contains all of", datatypes: [Types_1.FilterDataType.BOOLEAN, Types_1.FilterDataType.SELECT, Types_1.FilterDataType.MULTISELECT], value: Types_1.FilteredConditionTypes.CONTAINS_ALL_OF },
39
- { name: "contains any of", datatypes: [Types_1.FilterDataType.STRING], value: Types_1.FilteredConditionTypes.CONTAINS_ANY_OF },
40
- { name: "doesn’t contain all of", datatypes: [Types_1.FilterDataType.BOOLEAN, Types_1.FilterDataType.SELECT, Types_1.FilterDataType.MULTISELECT], value: Types_1.FilteredConditionTypes.DOES_NOT_CONTAIN_ALL_OF },
41
- { name: "doesn’t contain any of", datatypes: [Types_1.FilterDataType.STRING], value: Types_1.FilteredConditionTypes.DOES_NOT_CONTAIN_ANY_OF },
42
- { name: "ends with any of", datatypes: [Types_1.FilterDataType.STRING], value: Types_1.FilteredConditionTypes.ENDS_WITH_ANY_OF },
43
- { name: "is after", datatypes: [Types_1.FilterDataType.DATE, Types_1.FilterDataType.DATEANDTIME], value: Types_1.FilteredConditionTypes.IS_AFTER },
44
- { name: "is any of", datatypes: [Types_1.FilterDataType.BOOLEAN, Types_1.FilterDataType.SELECT, Types_1.FilterDataType.MULTISELECT], value: Types_1.FilteredConditionTypes.IS_ANY_OF },
45
- { name: "is before", datatypes: [Types_1.FilterDataType.DATE, Types_1.FilterDataType.DATEANDTIME], value: Types_1.FilteredConditionTypes.IS_BEFORE },
46
- { name: "is between", datatypes: [Types_1.FilterDataType.BIGINTEGER, Types_1.FilterDataType.INTEGER, Types_1.FilterDataType.DATE, Types_1.FilterDataType.PERCENT, Types_1.FilterDataType.CURRENCY, Types_1.FilterDataType.DECIMAL, Types_1.FilterDataType.DATEANDTIME], value: Types_1.FilteredConditionTypes.IS_BETWEEN },
47
- { name: "is not equal to", datatypes: [Types_1.FilterDataType.BIGINTEGER, Types_1.FilterDataType.INTEGER, Types_1.FilterDataType.DATE, Types_1.FilterDataType.PERCENT, Types_1.FilterDataType.CURRENCY, Types_1.FilterDataType.DECIMAL, Types_1.FilterDataType.DATEANDTIME], value: Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO },
48
- { name: "is not equal to all of", datatypes: [Types_1.FilterDataType.BOOLEAN, Types_1.FilterDataType.SELECT, Types_1.FilterDataType.MULTISELECT], value: Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ALL_OF },
49
- { name: "is not equal to any of", datatypes: [Types_1.FilterDataType.STRING], value: Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ANY_OF },
50
- { name: "is greater than", datatypes: [Types_1.FilterDataType.BIGINTEGER, Types_1.FilterDataType.INTEGER, Types_1.FilterDataType.PERCENT, Types_1.FilterDataType.CURRENCY, Types_1.FilterDataType.DECIMAL], value: Types_1.FilteredConditionTypes.IS_GREATER_THAN },
51
- { name: "is greater than or equal to", datatypes: [Types_1.FilterDataType.BIGINTEGER, Types_1.FilterDataType.BIGINTEGER, Types_1.FilterDataType.INTEGER, Types_1.FilterDataType.PERCENT, Types_1.FilterDataType.CURRENCY, Types_1.FilterDataType.DECIMAL], value: Types_1.FilteredConditionTypes.IS_GREATER_THAN_OR_EQUAL_TO },
52
- { name: "is known", datatypes: [Types_1.FilterDataType.BOOLEAN, Types_1.FilterDataType.SELECT, Types_1.FilterDataType.INTEGER, Types_1.FilterDataType.PERCENT, Types_1.FilterDataType.CURRENCY, Types_1.FilterDataType.DECIMAL, Types_1.FilterDataType.DATE, Types_1.FilterDataType.DATEANDTIME, Types_1.FilterDataType.FILE, Types_1.FilterDataType.IMAGE, Types_1.FilterDataType.TEXTEDITOR, Types_1.FilterDataType.MULTISELECT, Types_1.FilterDataType.STRING], value: Types_1.FilteredConditionTypes.IS_KNOWN },
53
- { name: "is less than", datatypes: [Types_1.FilterDataType.BIGINTEGER, Types_1.FilterDataType.INTEGER, Types_1.FilterDataType.PERCENT, Types_1.FilterDataType.CURRENCY, Types_1.FilterDataType.DECIMAL, Types_1.FilterDataType.DATEANDTIME, Types_1.FilterDataType.DATE], value: Types_1.FilteredConditionTypes.IS_LESS_THAN },
54
- { name: "is less than or equal to", datatypes: [Types_1.FilterDataType.BIGINTEGER, Types_1.FilterDataType.INTEGER, Types_1.FilterDataType.CURRENCY, Types_1.FilterDataType.DECIMAL], value: Types_1.FilteredConditionTypes.IS_LESS_THAN_OR_EQUAL_TO },
55
- { name: "is more than", datatypes: [Types_1.FilterDataType.BIGINTEGER, Types_1.FilterDataType.INTEGER, Types_1.FilterDataType.PERCENT, Types_1.FilterDataType.CURRENCY, Types_1.FilterDataType.DECIMAL, Types_1.FilterDataType.DATEANDTIME, Types_1.FilterDataType.DATE], value: Types_1.FilteredConditionTypes.IS_MORE_THAN },
56
- { name: "is none of", datatypes: [Types_1.FilterDataType.BOOLEAN, Types_1.FilterDataType.SELECT, Types_1.FilterDataType.MULTISELECT], value: Types_1.FilteredConditionTypes.IS_NONE_OF },
57
- { name: "is not between", datatypes: [Types_1.FilterDataType.BIGINTEGER, Types_1.FilterDataType.INTEGER, Types_1.FilterDataType.DATE, Types_1.FilterDataType.PERCENT, Types_1.FilterDataType.CURRENCY, Types_1.FilterDataType.DECIMAL, Types_1.FilterDataType.DATE, Types_1.FilterDataType.DATEANDTIME], value: Types_1.FilteredConditionTypes.IS_NOT_BETWEEN },
58
- { name: "is unknown", datatypes: [Types_1.FilterDataType.BOOLEAN, Types_1.FilterDataType.INTEGER, Types_1.FilterDataType.PERCENT, Types_1.FilterDataType.SELECT, Types_1.FilterDataType.CURRENCY, Types_1.FilterDataType.DECIMAL, Types_1.FilterDataType.DATE, Types_1.FilterDataType.DATEANDTIME, Types_1.FilterDataType.FILE, Types_1.FilterDataType.IMAGE, Types_1.FilterDataType.TEXTEDITOR, Types_1.FilterDataType.MULTISELECT, Types_1.FilterDataType.STRING], value: Types_1.FilteredConditionTypes.IS_UNKNOWN },
59
- { name: "starts with any of", datatypes: [Types_1.FilterDataType.STRING], value: Types_1.FilteredConditionTypes.STARTS_WITH_ANY_OF },
60
- { name: "is equal to", datatypes: [Types_1.FilterDataType.BIGINTEGER, Types_1.FilterDataType.INTEGER, Types_1.FilterDataType.DATE, Types_1.FilterDataType.PERCENT, Types_1.FilterDataType.CURRENCY, Types_1.FilterDataType.DECIMAL, Types_1.FilterDataType.DATEANDTIME], value: Types_1.FilteredConditionTypes.IS_EQUAL_TO },
61
- { name: "is equal to all of", datatypes: [Types_1.FilterDataType.BOOLEAN, Types_1.FilterDataType.SELECT, Types_1.FilterDataType.MULTISELECT], value: Types_1.FilteredConditionTypes.IS_EQUAL_TO_ALL_OF },
62
- { name: "is equal to any of", datatypes: [Types_1.FilterDataType.STRING], value: Types_1.FilteredConditionTypes.IS_EQUAL_TO_ANY_OF }
37
+ const capitalizedConditionsList = [
38
+ {
39
+ name: "Contains all of",
40
+ value: Types_1.FilteredConditionTypes.CONTAINS_ALL_OF
41
+ },
42
+ {
43
+ name: "contains any of",
44
+ value: Types_1.FilteredConditionTypes.CONTAINS_ANY_OF
45
+ },
46
+ {
47
+ name: "doesn’t contain all of",
48
+ value: Types_1.FilteredConditionTypes.DOES_NOT_CONTAIN_ALL_OF
49
+ },
50
+ {
51
+ name: "doesn’t contain any of",
52
+ value: Types_1.FilteredConditionTypes.DOES_NOT_CONTAIN_ANY_OF
53
+ },
54
+ {
55
+ name: "ends with any of",
56
+ value: Types_1.FilteredConditionTypes.ENDS_WITH_ANY_OF
57
+ },
58
+ {
59
+ name: "is after",
60
+ value: Types_1.FilteredConditionTypes.IS_AFTER
61
+ },
62
+ {
63
+ name: "is any of",
64
+ value: Types_1.FilteredConditionTypes.IS_ANY_OF
65
+ },
66
+ {
67
+ name: "is before",
68
+ value: Types_1.FilteredConditionTypes.IS_BEFORE
69
+ },
70
+ {
71
+ name: "is between",
72
+ value: Types_1.FilteredConditionTypes.IS_BETWEEN
73
+ },
74
+ {
75
+ name: "is not equal to",
76
+ value: Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO
77
+ },
78
+ {
79
+ name: "is not equal to all of",
80
+ value: Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ALL_OF
81
+ },
82
+ {
83
+ name: "is not equal to any of",
84
+ datatypes: [Types_1.FilterDataType.STRING],
85
+ value: Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ANY_OF
86
+ },
87
+ {
88
+ name: "is greater than",
89
+ value: Types_1.FilteredConditionTypes.IS_GREATER_THAN
90
+ },
91
+ {
92
+ name: "is greater than or equal to",
93
+ value: Types_1.FilteredConditionTypes.IS_GREATER_THAN_OR_EQUAL_TO
94
+ },
95
+ {
96
+ name: "is known",
97
+ value: Types_1.FilteredConditionTypes.IS_KNOWN
98
+ },
99
+ {
100
+ name: "is less than",
101
+ value: Types_1.FilteredConditionTypes.IS_LESS_THAN
102
+ },
103
+ {
104
+ name: "is less than or equal to",
105
+ value: Types_1.FilteredConditionTypes.IS_LESS_THAN_OR_EQUAL_TO
106
+ },
107
+ {
108
+ name: "is more than",
109
+ value: Types_1.FilteredConditionTypes.IS_MORE_THAN
110
+ },
111
+ {
112
+ name: "is none of",
113
+ value: Types_1.FilteredConditionTypes.IS_NONE_OF
114
+ },
115
+ {
116
+ name: "is not between",
117
+ value: Types_1.FilteredConditionTypes.IS_NOT_BETWEEN
118
+ },
119
+ {
120
+ name: "is unknown",
121
+ value: Types_1.FilteredConditionTypes.IS_UNKNOWN
122
+ },
123
+ {
124
+ name: "starts with any of",
125
+ value: Types_1.FilteredConditionTypes.STARTS_WITH_ANY_OF
126
+ },
127
+ {
128
+ name: "is equal to",
129
+ value: Types_1.FilteredConditionTypes.IS_EQUAL_TO
130
+ },
131
+ {
132
+ name: "is equal to all of",
133
+ value: Types_1.FilteredConditionTypes.IS_EQUAL_TO_ALL_OF
134
+ },
135
+ {
136
+ name: "is equal to any of",
137
+ value: Types_1.FilteredConditionTypes.IS_EQUAL_TO_ANY_OF
138
+ }
139
+ ];
140
+ const conditionsList = capitalizedConditionsList.map((condition) => {
141
+ return Object.assign(Object.assign({}, condition), { name: condition.name
142
+ .split(' ')
143
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
144
+ .join(' ') });
145
+ });
146
+ const accessBasedOnDataType = [
147
+ {
148
+ datatype: Types_1.FilterDataType.STRING,
149
+ conditions: [
150
+ Types_1.FilteredConditionTypes.CONTAINS_ALL_OF,
151
+ Types_1.FilteredConditionTypes.CONTAINS_ANY_OF,
152
+ Types_1.FilteredConditionTypes.DOES_NOT_CONTAIN_ALL_OF,
153
+ Types_1.FilteredConditionTypes.DOES_NOT_CONTAIN_ANY_OF,
154
+ Types_1.FilteredConditionTypes.ENDS_WITH_ANY_OF,
155
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO,
156
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ALL_OF,
157
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ANY_OF,
158
+ Types_1.FilteredConditionTypes.IS_KNOWN,
159
+ Types_1.FilteredConditionTypes.IS_UNKNOWN,
160
+ Types_1.FilteredConditionTypes.STARTS_WITH_ANY_OF,
161
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO,
162
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ALL_OF,
163
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ANY_OF
164
+ ]
165
+ },
166
+ {
167
+ datatype: Types_1.FilterDataType.DATE,
168
+ conditions: [
169
+ Types_1.FilteredConditionTypes.IS_AFTER,
170
+ Types_1.FilteredConditionTypes.IS_BEFORE,
171
+ Types_1.FilteredConditionTypes.IS_BETWEEN,
172
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO,
173
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ALL_OF,
174
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ANY_OF,
175
+ Types_1.FilteredConditionTypes.IS_GREATER_THAN,
176
+ Types_1.FilteredConditionTypes.IS_GREATER_THAN_OR_EQUAL_TO,
177
+ Types_1.FilteredConditionTypes.IS_KNOWN,
178
+ Types_1.FilteredConditionTypes.IS_LESS_THAN,
179
+ Types_1.FilteredConditionTypes.IS_LESS_THAN_OR_EQUAL_TO,
180
+ Types_1.FilteredConditionTypes.IS_MORE_THAN,
181
+ Types_1.FilteredConditionTypes.IS_NOT_BETWEEN,
182
+ Types_1.FilteredConditionTypes.IS_UNKNOWN,
183
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO,
184
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ALL_OF,
185
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ANY_OF
186
+ ]
187
+ },
188
+ {
189
+ datatype: Types_1.FilterDataType.INTEGER,
190
+ conditions: [
191
+ Types_1.FilteredConditionTypes.IS_BETWEEN,
192
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO,
193
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ALL_OF,
194
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ANY_OF,
195
+ Types_1.FilteredConditionTypes.IS_GREATER_THAN,
196
+ Types_1.FilteredConditionTypes.IS_GREATER_THAN_OR_EQUAL_TO,
197
+ Types_1.FilteredConditionTypes.IS_KNOWN,
198
+ Types_1.FilteredConditionTypes.IS_LESS_THAN,
199
+ Types_1.FilteredConditionTypes.IS_LESS_THAN_OR_EQUAL_TO,
200
+ Types_1.FilteredConditionTypes.IS_MORE_THAN,
201
+ Types_1.FilteredConditionTypes.IS_NOT_BETWEEN,
202
+ Types_1.FilteredConditionTypes.IS_UNKNOWN,
203
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO,
204
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ALL_OF,
205
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ANY_OF
206
+ ]
207
+ },
208
+ {
209
+ datatype: Types_1.FilterDataType.FILE,
210
+ conditions: [
211
+ Types_1.FilteredConditionTypes.IS_KNOWN,
212
+ Types_1.FilteredConditionTypes.IS_UNKNOWN
213
+ ]
214
+ },
215
+ {
216
+ datatype: Types_1.FilterDataType.IMAGE,
217
+ conditions: [
218
+ Types_1.FilteredConditionTypes.IS_KNOWN,
219
+ Types_1.FilteredConditionTypes.IS_UNKNOWN
220
+ ]
221
+ },
222
+ {
223
+ datatype: Types_1.FilterDataType.COLORPICKER,
224
+ conditions: []
225
+ },
226
+ {
227
+ datatype: Types_1.FilterDataType.CURRENCY,
228
+ conditions: [
229
+ Types_1.FilteredConditionTypes.IS_BETWEEN,
230
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO,
231
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ALL_OF,
232
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ANY_OF,
233
+ Types_1.FilteredConditionTypes.IS_GREATER_THAN,
234
+ Types_1.FilteredConditionTypes.IS_GREATER_THAN_OR_EQUAL_TO,
235
+ Types_1.FilteredConditionTypes.IS_KNOWN,
236
+ Types_1.FilteredConditionTypes.IS_LESS_THAN,
237
+ Types_1.FilteredConditionTypes.IS_LESS_THAN_OR_EQUAL_TO,
238
+ Types_1.FilteredConditionTypes.IS_MORE_THAN,
239
+ Types_1.FilteredConditionTypes.IS_NOT_BETWEEN,
240
+ Types_1.FilteredConditionTypes.IS_UNKNOWN,
241
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO,
242
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ALL_OF,
243
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ANY_OF
244
+ ]
245
+ },
246
+ {
247
+ datatype: Types_1.FilterDataType.BOOLEAN,
248
+ conditions: [
249
+ Types_1.FilteredConditionTypes.IS_ANY_OF,
250
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ALL_OF,
251
+ Types_1.FilteredConditionTypes.IS_KNOWN,
252
+ Types_1.FilteredConditionTypes.IS_NONE_OF,
253
+ Types_1.FilteredConditionTypes.IS_UNKNOWN,
254
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ALL_OF
255
+ ]
256
+ },
257
+ {
258
+ datatype: Types_1.FilterDataType.BIGINTEGER,
259
+ conditions: [
260
+ Types_1.FilteredConditionTypes.IS_BETWEEN,
261
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO,
262
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ALL_OF,
263
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ANY_OF,
264
+ Types_1.FilteredConditionTypes.IS_GREATER_THAN,
265
+ Types_1.FilteredConditionTypes.IS_GREATER_THAN_OR_EQUAL_TO,
266
+ Types_1.FilteredConditionTypes.IS_KNOWN,
267
+ Types_1.FilteredConditionTypes.IS_LESS_THAN,
268
+ Types_1.FilteredConditionTypes.IS_LESS_THAN_OR_EQUAL_TO,
269
+ Types_1.FilteredConditionTypes.IS_MORE_THAN,
270
+ Types_1.FilteredConditionTypes.IS_NOT_BETWEEN,
271
+ Types_1.FilteredConditionTypes.IS_UNKNOWN,
272
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO,
273
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ALL_OF,
274
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ANY_OF
275
+ ]
276
+ },
277
+ {
278
+ datatype: Types_1.FilterDataType.DATEANDTIME,
279
+ conditions: [
280
+ Types_1.FilteredConditionTypes.IS_AFTER,
281
+ Types_1.FilteredConditionTypes.IS_BEFORE,
282
+ Types_1.FilteredConditionTypes.IS_BETWEEN,
283
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO,
284
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ALL_OF,
285
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ANY_OF,
286
+ Types_1.FilteredConditionTypes.IS_GREATER_THAN,
287
+ Types_1.FilteredConditionTypes.IS_GREATER_THAN_OR_EQUAL_TO,
288
+ Types_1.FilteredConditionTypes.IS_KNOWN,
289
+ Types_1.FilteredConditionTypes.IS_LESS_THAN,
290
+ Types_1.FilteredConditionTypes.IS_LESS_THAN_OR_EQUAL_TO,
291
+ Types_1.FilteredConditionTypes.IS_MORE_THAN,
292
+ Types_1.FilteredConditionTypes.IS_NOT_BETWEEN,
293
+ Types_1.FilteredConditionTypes.IS_UNKNOWN,
294
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO,
295
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ALL_OF,
296
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ANY_OF
297
+ ]
298
+ },
299
+ {
300
+ datatype: Types_1.FilterDataType.DECIMAL,
301
+ conditions: [
302
+ Types_1.FilteredConditionTypes.IS_BETWEEN,
303
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO,
304
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ALL_OF,
305
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ANY_OF,
306
+ Types_1.FilteredConditionTypes.IS_GREATER_THAN,
307
+ Types_1.FilteredConditionTypes.IS_GREATER_THAN_OR_EQUAL_TO,
308
+ Types_1.FilteredConditionTypes.IS_KNOWN,
309
+ Types_1.FilteredConditionTypes.IS_LESS_THAN,
310
+ Types_1.FilteredConditionTypes.IS_LESS_THAN_OR_EQUAL_TO,
311
+ Types_1.FilteredConditionTypes.IS_MORE_THAN,
312
+ Types_1.FilteredConditionTypes.IS_NOT_BETWEEN,
313
+ Types_1.FilteredConditionTypes.IS_UNKNOWN,
314
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO,
315
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ALL_OF,
316
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ANY_OF
317
+ ]
318
+ },
319
+ {
320
+ datatype: Types_1.FilterDataType.MULTISELECT,
321
+ conditions: [
322
+ Types_1.FilteredConditionTypes.CONTAINS_ALL_OF,
323
+ Types_1.FilteredConditionTypes.CONTAINS_ANY_OF,
324
+ Types_1.FilteredConditionTypes.DOES_NOT_CONTAIN_ALL_OF,
325
+ Types_1.FilteredConditionTypes.DOES_NOT_CONTAIN_ANY_OF,
326
+ Types_1.FilteredConditionTypes.ENDS_WITH_ANY_OF,
327
+ Types_1.FilteredConditionTypes.IS_ANY_OF,
328
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO,
329
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ALL_OF,
330
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ANY_OF,
331
+ Types_1.FilteredConditionTypes.IS_KNOWN,
332
+ Types_1.FilteredConditionTypes.IS_NONE_OF,
333
+ Types_1.FilteredConditionTypes.IS_UNKNOWN,
334
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO,
335
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ALL_OF,
336
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ANY_OF
337
+ ]
338
+ },
339
+ {
340
+ datatype: Types_1.FilterDataType.PERCENT,
341
+ conditions: [
342
+ Types_1.FilteredConditionTypes.IS_BETWEEN,
343
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO,
344
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ALL_OF,
345
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ANY_OF,
346
+ Types_1.FilteredConditionTypes.IS_GREATER_THAN,
347
+ Types_1.FilteredConditionTypes.IS_GREATER_THAN_OR_EQUAL_TO,
348
+ Types_1.FilteredConditionTypes.IS_KNOWN,
349
+ Types_1.FilteredConditionTypes.IS_LESS_THAN,
350
+ Types_1.FilteredConditionTypes.IS_LESS_THAN_OR_EQUAL_TO,
351
+ Types_1.FilteredConditionTypes.IS_MORE_THAN,
352
+ Types_1.FilteredConditionTypes.IS_NOT_BETWEEN,
353
+ Types_1.FilteredConditionTypes.IS_UNKNOWN,
354
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO,
355
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ALL_OF,
356
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ANY_OF
357
+ ]
358
+ },
359
+ {
360
+ datatype: Types_1.FilterDataType.SELECT,
361
+ conditions: [
362
+ Types_1.FilteredConditionTypes.IS_ANY_OF,
363
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO,
364
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ALL_OF,
365
+ Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ANY_OF,
366
+ Types_1.FilteredConditionTypes.IS_KNOWN,
367
+ Types_1.FilteredConditionTypes.IS_NONE_OF,
368
+ Types_1.FilteredConditionTypes.IS_UNKNOWN,
369
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO,
370
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ALL_OF,
371
+ Types_1.FilteredConditionTypes.IS_EQUAL_TO_ANY_OF
372
+ ]
373
+ },
374
+ {
375
+ datatype: Types_1.FilterDataType.TEXTEDITOR,
376
+ conditions: [
377
+ Types_1.FilteredConditionTypes.CONTAINS_ALL_OF,
378
+ Types_1.FilteredConditionTypes.IS_KNOWN,
379
+ Types_1.FilteredConditionTypes.IS_UNKNOWN
380
+ ]
381
+ }
63
382
  ];
64
383
  const defaultOptionValueColumn = { order: 1, labelName: "", value: "", upload: "", actions: "" };
65
384
  const columnSortTypes = [{ id: 1, label: "Low - High", sortId: 1, dataType: "integer" }, { id: 2, label: "High - Low", sortId: 2, dataType: "integer" }, { id: 3, label: "A - Z", sortId: 1, dataType: "string" }, { id: 4, label: "Z - A", sortId: 2, dataType: "string" }, { id: 5, sortId: 1, label: "Min -Max", dataType: "date" }, { id: 6, sortId: 2, label: "Max - Min", dataType: "date" }];
@@ -70,6 +389,7 @@ const constants = {
70
389
  defaultOptionValueColumn,
71
390
  conditionsList,
72
391
  maxSortInputLength,
392
+ accessBasedOnDataType,
73
393
  minSortInputLength,
74
394
  };
75
395
  var GRID_CHECKBOX_STATUS;
@@ -6,7 +6,7 @@ const react_1 = require("react");
6
6
  const helper_1 = require("./helper");
7
7
  exports.FeatureContext = (0, react_1.createContext)(null);
8
8
  function MyProvider({ children, value }) {
9
- const { featureDetails, setFeatureDetails, gridData, callGrid, totalRecords, initialFeature, defaultFilters, createView, enableViewCreate, filterModelText, sortModelText, recordDetailModelText, sidePanelText, sortOptions, filterConditions, clearFilters, setGridData, gridApi, updateColumnsForGrid, enableManageColumnsCallback, columnToRender, selectedGroup, setSelectedGroup, initialCheckBoxData, intialColumns, setIntialColumns } = value;
9
+ const { featureDetails, setFeatureDetails, gridData, callGrid, totalRecords, initialFeature, defaultFilters, createView, enableViewCreate, filterModelText, sortModelText, recordDetailModelText, sidePanelText, sortOptions, filterConditions, clearFilters, setGridData, gridApi, updateColumnsForGrid, enableManageColumnsCallback, columnToRender, selectedGroup, setSelectedGroup, initialCheckBoxData } = value;
10
10
  // States for sort
11
11
  const [columnData] = (0, react_1.useState)(gridData === null || gridData === void 0 ? void 0 : gridData.columnData);
12
12
  const [sortValue, setSortValue] = (0, react_1.useState)({});
@@ -95,9 +95,7 @@ function MyProvider({ children, value }) {
95
95
  columnToRender,
96
96
  selectedGroup,
97
97
  setSelectedGroup,
98
- initialCheckBoxData,
99
- intialColumns,
100
- setIntialColumns
98
+ initialCheckBoxData
101
99
  } }, { children: children })));
102
100
  }
103
101
  exports.default = MyProvider;
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deepClone = exports.handleCheckboxClick = exports.getGroupIds = exports.handleUncheckedState = exports.handleCheckedState = exports.updateGroupState = exports.determineConditions = exports.updateRecords = exports.autoGroupColumnDef = exports.fillOperation = exports.updateCells = exports.getCheckedStatus = exports.sortColumns = exports.parseIfNeeded = exports.applyDefaultFilters = exports.initialCheckBoxData = void 0;
3
+ exports.handleCheckboxClick = exports.getGroupIds = exports.handleUncheckedState = exports.handleCheckedState = exports.updateGroupState = exports.determineConditions = exports.updateRecords = exports.autoGroupColumnDef = exports.fillOperation = exports.updateCells = exports.getCheckedStatus = exports.sortColumns = exports.parseIfNeeded = exports.applyDefaultFilters = exports.initialCheckBoxData = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const react_1 = tslib_1.__importDefault(require("react"));
6
5
  const constants_1 = require("./constants");
7
6
  // initial checkbox data
8
7
  exports.initialCheckBoxData = {
@@ -190,7 +189,6 @@ const autoGroupColumnDef = (isTreeEnable, headerName, groupField, GroupHeaderCom
190
189
  ? () => headerCheckboxRenderer("", GroupHeaderComponent)
191
190
  : GroupHeaderComponent,
192
191
  cellRenderer: "agGroupCellRenderer",
193
- minWidth: 200,
194
192
  cellRendererParams: (params) => {
195
193
  var _a;
196
194
  // Render custom component for all group childs
@@ -229,7 +227,7 @@ const updateRecords = (rowData, featureDetails, gridData) => {
229
227
  if (allBoxChecked) {
230
228
  // Update excluded records: add or remove the current rowData
231
229
  newExcludedRecords = (excludedRecords === null || excludedRecords === void 0 ? void 0 : excludedRecords.includes(rowData))
232
- ? excludedRecords === null || excludedRecords === void 0 ? void 0 : excludedRecords.filter((item) => (item === null || item === void 0 ? void 0 : item.id) !== (rowData === null || rowData === void 0 ? void 0 : rowData.id))
230
+ ? excludedRecords === null || excludedRecords === void 0 ? void 0 : excludedRecords.filter((item) => item !== rowData)
233
231
  : [...excludedRecords, rowData];
234
232
  // Check if all records are included; reset if so
235
233
  if ((newIncludedRecords === null || newIncludedRecords === void 0 ? void 0 : newIncludedRecords.length) === ((_a = gridData === null || gridData === void 0 ? void 0 : gridData.rowData) === null || _a === void 0 ? void 0 : _a.length)) {
@@ -277,15 +275,15 @@ const updateRecords = (rowData, featureDetails, gridData) => {
277
275
  exports.updateRecords = updateRecords;
278
276
  // Utility function to determine conditions for updating group states
279
277
  // Based on various flags and states, determines whether to add or remove group IDs
280
- const determineConditions = (isChecked, allBoxChecked, isEveryParentGroupInclude, isEveryParentGroupExcluded, isEverySuperParentGroupExcluded, isEverySuperParentGroupInclude) => ({
278
+ const determineConditions = (isChecked, allBoxChecked, isEveryParentGroupInclude, isEveryParentGroupExcluded, isEverySuperParentGroupExcluded) => ({
281
279
  addParent: (!allBoxChecked && isChecked && isEveryParentGroupInclude) ||
282
- (allBoxChecked && isChecked && isEveryParentGroupExcluded),
283
- addSuperParent: (!allBoxChecked && isChecked && isEverySuperParentGroupInclude) ||
284
- (allBoxChecked && isChecked && isEverySuperParentGroupExcluded),
280
+ (allBoxChecked && isChecked && !isEveryParentGroupExcluded),
281
+ addSuperParent: (!allBoxChecked && isChecked && isEveryParentGroupInclude) ||
282
+ (allBoxChecked && isChecked && !isEverySuperParentGroupExcluded),
285
283
  removeParent: (!allBoxChecked && !isChecked && !isEveryParentGroupInclude) ||
286
- (allBoxChecked && !isChecked && !isEveryParentGroupExcluded),
287
- removeSuperParent: (!allBoxChecked && !isChecked && !isEverySuperParentGroupInclude) ||
288
- (allBoxChecked && !isChecked && !isEverySuperParentGroupExcluded),
284
+ (allBoxChecked && !isChecked && isEveryParentGroupExcluded),
285
+ removeSuperParent: (!allBoxChecked && !isChecked && !isEveryParentGroupInclude) ||
286
+ (allBoxChecked && !isChecked && isEverySuperParentGroupExcluded),
289
287
  });
290
288
  exports.determineConditions = determineConditions;
291
289
  // Function to update the selected groups in the state
@@ -313,9 +311,8 @@ const updateGroupState = (groupingColumns, parentId, superParentId, conditions,
313
311
  if (groupingColumns === 2) {
314
312
  if (addSuperParent)
315
313
  updateSelectedGroup(superParentId, true, setSelectedGroup); // Add super parent group ID
316
- if (addParent) {
317
- updateSelectedGroup(parentId, true, setSelectedGroup);
318
- } // Add parent group ID
314
+ if (addParent)
315
+ updateSelectedGroup(parentId, true, setSelectedGroup); // Add parent group ID
319
316
  if (removeSuperParent)
320
317
  updateSelectedGroup(superParentId, false, setSelectedGroup); // Remove super parent group ID
321
318
  if (removeParent)
@@ -344,14 +341,13 @@ const handleCheckedState = (params, featureDetails, gridData, setFeatureDetails,
344
341
  const { groupData, parentGroupData } = gatherGroupData(params);
345
342
  let newExcludedRecords = [...excludedRecords];
346
343
  let newIncludedRecords = [...includedRecords];
347
- // newExcludedRecords.filter((item) => item?.id !== group.id)
348
344
  // Update records based on the checkbox state
349
345
  groupData.forEach((group) => {
350
346
  var _a, _b;
351
347
  if (allBoxChecked) {
352
348
  newExcludedRecords = (newExcludedRecords === null || newExcludedRecords === void 0 ? void 0 : newExcludedRecords.includes(group))
353
- ? newExcludedRecords.filter((item) => (item === null || item === void 0 ? void 0 : item.id) !== group.id)
354
- : newExcludedRecords;
349
+ ? newExcludedRecords.filter((item) => item !== group)
350
+ : [...newExcludedRecords, group];
355
351
  }
356
352
  else if (!((_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.leafGroup) && ((_b = params === null || params === void 0 ? void 0 : params.node) === null || _b === void 0 ? void 0 : _b.level) === 0) {
357
353
  newIncludedRecords = newIncludedRecords.includes(group)
@@ -360,13 +356,17 @@ const handleCheckedState = (params, featureDetails, gridData, setFeatureDetails,
360
356
  }
361
357
  else {
362
358
  newIncludedRecords = newIncludedRecords.includes(group)
363
- ? newIncludedRecords
359
+ ? newIncludedRecords.filter((item) => {
360
+ if (item.id !== group.id)
361
+ group.isSelected = false;
362
+ return item.id !== group.id;
363
+ })
364
364
  : [...newIncludedRecords, group];
365
365
  }
366
366
  });
367
367
  updateCheckboxData(newIncludedRecords, newExcludedRecords, gridData, featureDetails, setFeatureDetails);
368
- // const isParent = determineParentGroupState(parentGroupData, newIncludedRecords, newExcludedRecords, allBoxChecked, groupData);
369
- handleGroupSelection(params, setSelectedGroup, groupingColumns, newIncludedRecords, newExcludedRecords, parentGroupData, allBoxChecked);
368
+ const isParent = determineParentGroupState(parentGroupData, newIncludedRecords, newExcludedRecords, allBoxChecked);
369
+ handleGroupSelection(params, setSelectedGroup, groupingColumns, isParent);
370
370
  };
371
371
  exports.handleCheckedState = handleCheckedState;
372
372
  // Utility function to handle unchecked state updates
@@ -401,16 +401,14 @@ exports.handleUncheckedState = handleUncheckedState;
401
401
  // Utility function to update checkbox data in the state
402
402
  const updateCheckboxData = (newIncludedRecords, newExcludedRecords, gridData, featureDetails, setFeatureDetails) => {
403
403
  var _a, _b;
404
- if ((newIncludedRecords === null || newIncludedRecords === void 0 ? void 0 : newIncludedRecords.length) === ((_a = gridData === null || gridData === void 0 ? void 0 : gridData.rowData) === null || _a === void 0 ? void 0 : _a.length) || ((newIncludedRecords === null || newIncludedRecords === void 0 ? void 0 : newIncludedRecords.length) === 0 && (newExcludedRecords === null || newExcludedRecords === void 0 ? void 0 : newExcludedRecords.length) === 0)) {
404
+ if ((newIncludedRecords === null || newIncludedRecords === void 0 ? void 0 : newIncludedRecords.length) === ((_a = gridData === null || gridData === void 0 ? void 0 : gridData.rowData) === null || _a === void 0 ? void 0 : _a.length)) {
405
405
  setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: Object.assign(Object.assign({}, featureDetails.checkBoxSelection), { excludedRecords: [], includedRecords: [], isIndeterminate: false, allBoxChecked: true }) }));
406
406
  }
407
407
  else if ((newExcludedRecords === null || newExcludedRecords === void 0 ? void 0 : newExcludedRecords.length) === ((_b = gridData === null || gridData === void 0 ? void 0 : gridData.rowData) === null || _b === void 0 ? void 0 : _b.length)) {
408
408
  setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: exports.initialCheckBoxData }));
409
409
  }
410
410
  else {
411
- setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: Object.assign(Object.assign({}, featureDetails.checkBoxSelection), { excludedRecords: newExcludedRecords, includedRecords: newIncludedRecords, isIndeterminate: featureDetails.checkBoxSelection.allBoxChecked
412
- ? true
413
- : featureDetails.checkBoxSelection.isIndeterminate }) }));
411
+ setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: Object.assign(Object.assign({}, featureDetails.checkBoxSelection), { excludedRecords: newExcludedRecords, includedRecords: newIncludedRecords, isIndeterminate: featureDetails.checkBoxSelection.allBoxChecked ? true : featureDetails.checkBoxSelection.isIndeterminate }) }));
414
412
  }
415
413
  };
416
414
  // Utility function to determine parent group inclusion or exclusion states
@@ -420,57 +418,45 @@ const determineParentGroupState = (parentGroupData, newIncludedRecords, newExclu
420
418
  return allBoxChecked ? isAnyParentGroupExcluded : isAnyParentGroupInclude;
421
419
  };
422
420
  // Utility function to handle group selection logic for checked state
423
- const handleGroupSelection = (params, setSelectedGroup, groupingColumns, newIncludedRecords, newExcludedRecords, parentGroupData, allBoxChecked) => {
421
+ const handleGroupSelection = (params, setSelectedGroup, groupingColumns, isParent) => {
424
422
  var _a, _b, _c, _d, _e, _f, _g, _h;
425
- const isEverySuperParentGroupInclude = parentGroupData === null || parentGroupData === void 0 ? void 0 : parentGroupData.every((parent) => newIncludedRecords.some((included) => (included === null || included === void 0 ? void 0 : included.id) === (parent === null || parent === void 0 ? void 0 : parent.id)));
426
- // const isAnyParentGroupInclude = groupData?.some((parent) =>
427
- // newIncludedRecords.some((included) => included?.id === parent?.id)
428
- // );
429
- const isEverySuperParentGroupExcluded = parentGroupData === null || parentGroupData === void 0 ? void 0 : parentGroupData.every((parent) => newExcludedRecords.some((excluded) => (excluded === null || excluded === void 0 ? void 0 : excluded.id) === (parent === null || parent === void 0 ? void 0 : parent.id)));
430
- if (groupingColumns === 2 &&
431
- !((_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.leafGroup) &&
432
- ((_b = params === null || params === void 0 ? void 0 : params.node) === null || _b === void 0 ? void 0 : _b.level) === 0) {
423
+ if (groupingColumns === 2 && !((_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.leafGroup) && ((_b = params === null || params === void 0 ? void 0 : params.node) === null || _b === void 0 ? void 0 : _b.level) === 0) {
433
424
  (_d = (_c = params === null || params === void 0 ? void 0 : params.node) === null || _c === void 0 ? void 0 : _c.childrenAfterGroup) === null || _d === void 0 ? void 0 : _d.forEach((childNode) => {
434
425
  setSelectedGroup((prev) => prev.includes(childNode.id) ? prev : [...prev, childNode.id]);
435
426
  });
436
427
  setSelectedGroup((prev) => prev.includes(params.node.id) ? prev : [...prev, params.node.id]);
437
428
  }
438
- else if (((_e = params === null || params === void 0 ? void 0 : params.node) === null || _e === void 0 ? void 0 : _e.leafGroup) &&
439
- ((_f = params === null || params === void 0 ? void 0 : params.node) === null || _f === void 0 ? void 0 : _f.level) === 1 &&
440
- !allBoxChecked) {
429
+ else if (((_e = params === null || params === void 0 ? void 0 : params.node) === null || _e === void 0 ? void 0 : _e.leafGroup) && ((_f = params === null || params === void 0 ? void 0 : params.node) === null || _f === void 0 ? void 0 : _f.level) === 1 && isParent) {
441
430
  setSelectedGroup((prev) => prev.includes(params.node.id) ? prev : [...prev, params.node.id]);
442
- if (isEverySuperParentGroupInclude) {
443
- setSelectedGroup((prev) => {
444
- var _a, _b, _c, _d;
445
- return prev.includes((_b = (_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.id)
446
- ? prev
447
- : [...prev, (_d = (_c = params === null || params === void 0 ? void 0 : params.node) === null || _c === void 0 ? void 0 : _c.parent) === null || _d === void 0 ? void 0 : _d.id];
448
- });
449
- }
431
+ setSelectedGroup((prev) => {
432
+ var _a, _b, _c, _d;
433
+ return prev.includes((_b = (_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.id)
434
+ ? prev
435
+ : [...prev, (_d = (_c = params === null || params === void 0 ? void 0 : params.node) === null || _c === void 0 ? void 0 : _c.parent) === null || _d === void 0 ? void 0 : _d.id];
436
+ });
450
437
  }
451
- else if (((_g = params === null || params === void 0 ? void 0 : params.node) === null || _g === void 0 ? void 0 : _g.leafGroup) &&
452
- ((_h = params === null || params === void 0 ? void 0 : params.node) === null || _h === void 0 ? void 0 : _h.level) === 1 &&
453
- allBoxChecked) {
454
- setSelectedGroup((prev) => prev.includes(params.node.id) ? prev : [...prev, params.node.id]);
455
- if (isEverySuperParentGroupExcluded || (newExcludedRecords === null || newExcludedRecords === void 0 ? void 0 : newExcludedRecords.length) === 0) {
456
- setSelectedGroup((prev) => {
457
- var _a, _b, _c, _d;
458
- return prev.includes((_b = (_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.id)
459
- ? prev
460
- : [...prev, (_d = (_c = params === null || params === void 0 ? void 0 : params.node) === null || _c === void 0 ? void 0 : _c.parent) === null || _d === void 0 ? void 0 : _d.id];
461
- });
462
- }
438
+ else if (((_g = params === null || params === void 0 ? void 0 : params.node) === null || _g === void 0 ? void 0 : _g.leafGroup) && ((_h = params === null || params === void 0 ? void 0 : params.node) === null || _h === void 0 ? void 0 : _h.level) === 1 && !isParent) {
439
+ setSelectedGroup((prev) => {
440
+ var _a, _b, _c, _d;
441
+ return prev.includes((_b = (_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.id)
442
+ ? prev
443
+ : [...prev, (_d = (_c = params === null || params === void 0 ? void 0 : params.node) === null || _c === void 0 ? void 0 : _c.parent) === null || _d === void 0 ? void 0 : _d.id];
444
+ });
445
+ setSelectedGroup((prev) => {
446
+ var _a, _b;
447
+ return prev.includes((_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.id)
448
+ ? prev
449
+ : [...prev, (_b = params === null || params === void 0 ? void 0 : params.node) === null || _b === void 0 ? void 0 : _b.id];
450
+ });
463
451
  }
464
452
  else {
465
- setSelectedGroup((prev) => { var _a, _b; return prev.includes((_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.id) ? prev : [...prev, (_b = params === null || params === void 0 ? void 0 : params.node) === null || _b === void 0 ? void 0 : _b.id]; });
453
+ setSelectedGroup((prev) => { var _a; return prev.includes(params.node.id) ? prev : [...prev, (_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.id]; });
466
454
  }
467
455
  };
468
456
  // Utility function to handle group deselection logic for unchecked state
469
457
  const handleGroupDeselection = (params, setSelectedGroup, groupingColumns, isParent, isEveryParentGroupInclude) => {
470
458
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
471
- if (groupingColumns === 2 &&
472
- !((_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.leafGroup) &&
473
- ((_b = params === null || params === void 0 ? void 0 : params.node) === null || _b === void 0 ? void 0 : _b.level) === 0) {
459
+ if (groupingColumns === 2 && !((_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.leafGroup) && ((_b = params === null || params === void 0 ? void 0 : params.node) === null || _b === void 0 ? void 0 : _b.level) === 0) {
474
460
  (_d = (_c = params === null || params === void 0 ? void 0 : params.node) === null || _c === void 0 ? void 0 : _c.childrenAfterGroup) === null || _d === void 0 ? void 0 : _d.forEach((childNode) => {
475
461
  setSelectedGroup((prev) => prev === null || prev === void 0 ? void 0 : prev.filter((id) => id !== (childNode === null || childNode === void 0 ? void 0 : childNode.id)));
476
462
  });
@@ -494,9 +480,7 @@ const handleGroupDeselection = (params, setSelectedGroup, groupingColumns, isPar
494
480
  return prev;
495
481
  });
496
482
  }
497
- else if (((_g = params === null || params === void 0 ? void 0 : params.node) === null || _g === void 0 ? void 0 : _g.leafGroup) &&
498
- ((_h = params === null || params === void 0 ? void 0 : params.node) === null || _h === void 0 ? void 0 : _h.level) === 1 &&
499
- !isParent) {
483
+ else if (((_g = params === null || params === void 0 ? void 0 : params.node) === null || _g === void 0 ? void 0 : _g.leafGroup) && ((_h = params === null || params === void 0 ? void 0 : params.node) === null || _h === void 0 ? void 0 : _h.level) === 1 && !isParent) {
500
484
  setSelectedGroup((prev) => {
501
485
  if (prev === null || prev === void 0 ? void 0 : prev.includes(params.node.id)) {
502
486
  return prev === null || prev === void 0 ? void 0 : prev.filter((id) => { var _a; return id !== ((_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.id); });
@@ -556,71 +540,12 @@ const handleCheckboxClick = (e, params, featureDetails, gridData, setFeatureDeta
556
540
  const parentGroupData = (_c = (_b = (_a = params === null || params === void 0 ? void 0 : params.node) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.childrenAfterGroup) === null || _c === void 0 ? void 0 : _c.map((childNode) => childNode === null || childNode === void 0 ? void 0 : childNode.data);
557
541
  const superParentData = (_g = (_f = (_e = (_d = params === null || params === void 0 ? void 0 : params.node) === null || _d === void 0 ? void 0 : _d.parent) === null || _e === void 0 ? void 0 : _e.parent) === null || _f === void 0 ? void 0 : _f.allLeafChildren) === null || _g === void 0 ? void 0 : _g.map((children) => children === null || children === void 0 ? void 0 : children.data);
558
542
  // Determine if all or any parent groups are included/excluded
559
- const isEveryParentGroupInclude = parentGroupData === null || parentGroupData === void 0 ? void 0 : parentGroupData.every((parent) => {
560
- var _a;
561
- return (_a = updatedCheckBoxData === null || updatedCheckBoxData === void 0 ? void 0 : updatedCheckBoxData.includedRecords) === null || _a === void 0 ? void 0 : _a.some((included) => (included === null || included === void 0 ? void 0 : included.id) === (parent === null || parent === void 0 ? void 0 : parent.id));
562
- });
563
- const isEveryParentGroupExcluded = parentGroupData === null || parentGroupData === void 0 ? void 0 : parentGroupData.every((parent) => {
564
- var _a;
565
- return (_a = updatedCheckBoxData === null || updatedCheckBoxData === void 0 ? void 0 : updatedCheckBoxData.excludedRecords) === null || _a === void 0 ? void 0 : _a.some((excluded) => (excluded === null || excluded === void 0 ? void 0 : excluded.id) === (parent === null || parent === void 0 ? void 0 : parent.id));
566
- });
567
- const isEverySuperParentGroupExcluded = superParentData === null || superParentData === void 0 ? void 0 : superParentData.every((parent) => {
568
- var _a;
569
- return (_a = updatedCheckBoxData === null || updatedCheckBoxData === void 0 ? void 0 : updatedCheckBoxData.excludedRecords) === null || _a === void 0 ? void 0 : _a.some((excluded) => (excluded === null || excluded === void 0 ? void 0 : excluded.id) === (parent === null || parent === void 0 ? void 0 : parent.id));
570
- });
571
- const isEverySuperParentGroupInclude = superParentData === null || superParentData === void 0 ? void 0 : superParentData.every((parent) => {
572
- var _a;
573
- return (_a = updatedCheckBoxData === null || updatedCheckBoxData === void 0 ? void 0 : updatedCheckBoxData.includedRecords) === null || _a === void 0 ? void 0 : _a.some((included) => (included === null || included === void 0 ? void 0 : included.id) === (parent === null || parent === void 0 ? void 0 : parent.id));
574
- });
543
+ const isEveryParentGroupInclude = parentGroupData === null || parentGroupData === void 0 ? void 0 : parentGroupData.every((parent) => { var _a; return (_a = updatedCheckBoxData === null || updatedCheckBoxData === void 0 ? void 0 : updatedCheckBoxData.includedRecords) === null || _a === void 0 ? void 0 : _a.some((included) => (included === null || included === void 0 ? void 0 : included.id) === (parent === null || parent === void 0 ? void 0 : parent.id)); });
544
+ const isEveryParentGroupExcluded = parentGroupData === null || parentGroupData === void 0 ? void 0 : parentGroupData.every((parent) => { var _a; return (_a = updatedCheckBoxData === null || updatedCheckBoxData === void 0 ? void 0 : updatedCheckBoxData.excludedRecords) === null || _a === void 0 ? void 0 : _a.some((excluded) => (excluded === null || excluded === void 0 ? void 0 : excluded.id) === (parent === null || parent === void 0 ? void 0 : parent.id)); });
545
+ const isEverySuperParentGroupExcluded = superParentData === null || superParentData === void 0 ? void 0 : superParentData.every((parent) => { var _a; return (_a = updatedCheckBoxData === null || updatedCheckBoxData === void 0 ? void 0 : updatedCheckBoxData.excludedRecords) === null || _a === void 0 ? void 0 : _a.some((excluded) => (excluded === null || excluded === void 0 ? void 0 : excluded.id) === (parent === null || parent === void 0 ? void 0 : parent.id)); });
575
546
  // Determine the conditions to update group state
576
- const conditions = (0, exports.determineConditions)(isChecked, updatedCheckBoxData.allBoxChecked, isEveryParentGroupInclude, isEveryParentGroupExcluded, isEverySuperParentGroupExcluded, isEverySuperParentGroupInclude);
577
- console.log("conditionsss", conditions);
547
+ const conditions = (0, exports.determineConditions)(isChecked, updatedCheckBoxData.allBoxChecked, isEveryParentGroupInclude, isEveryParentGroupExcluded, isEverySuperParentGroupExcluded);
578
548
  // Update group state based on determined conditions
579
549
  (0, exports.updateGroupState)(groupingColumns, (_j = (_h = params === null || params === void 0 ? void 0 : params.node) === null || _h === void 0 ? void 0 : _h.parent) === null || _j === void 0 ? void 0 : _j.id, (_m = (_l = (_k = params === null || params === void 0 ? void 0 : params.node) === null || _k === void 0 ? void 0 : _k.parent) === null || _l === void 0 ? void 0 : _l.parent) === null || _m === void 0 ? void 0 : _m.id, conditions, setSelectedGroup);
580
550
  };
581
551
  exports.handleCheckboxClick = handleCheckboxClick;
582
- const deepClone = (obj) => {
583
- var _a, _b, _c;
584
- // If the input is not an object or is null, return the value itself (primitive types are returned directly)
585
- if (obj === null || typeof obj !== "object") {
586
- return obj;
587
- }
588
- // Handle Date objects by creating a new Date instance with the same value
589
- if (obj instanceof Date) {
590
- return new Date(obj);
591
- }
592
- // Handle RegExp objects by creating a new RegExp instance with the same pattern and flags
593
- if (obj instanceof RegExp) {
594
- return new RegExp(obj);
595
- }
596
- // Handle React JSX elements
597
- // If the object is a valid React element, clone it along with its props and children
598
- if (react_1.default.isValidElement(obj)) {
599
- const element = obj; // Explicitly assert type to ReactElement
600
- // Recursively clone all child elements, if any
601
- const clonedChildren = ((_a = element === null || element === void 0 ? void 0 : element.props) === null || _a === void 0 ? void 0 : _a.children)
602
- ? (_b = react_1.default.Children) === null || _b === void 0 ? void 0 : _b.map((_c = element === null || element === void 0 ? void 0 : element.props) === null || _c === void 0 ? void 0 : _c.children, (child) => (0, exports.deepClone)(child))
603
- : undefined; // Set to undefined if no children exist
604
- // Return a cloned React element with its props and recursively cloned children
605
- return react_1.default.cloneElement(element, Object.assign({}, element === null || element === void 0 ? void 0 : element.props), // Spread the existing props
606
- clonedChildren // Include cloned children
607
- );
608
- }
609
- // Handle Arrays
610
- // Recursively clone each element in the array
611
- if (Array.isArray(obj)) {
612
- return obj === null || obj === void 0 ? void 0 : obj.map(exports.deepClone);
613
- }
614
- // Handle Objects
615
- // Recursively clone each property in the object
616
- const clonedObj = {}; // Create a new empty object to hold cloned properties
617
- for (const key in obj) {
618
- // Use hasOwnProperty to avoid cloning inherited properties
619
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
620
- clonedObj[key] = (0, exports.deepClone)(obj[key]); // Recursively clone each property
621
- }
622
- }
623
- // Return the fully cloned object
624
- return clonedObj;
625
- };
626
- exports.deepClone = deepClone;
@@ -24,7 +24,6 @@ function ParentForGrid(props) {
24
24
  const [api, setApi] = (0, react_1.useState)(null);
25
25
  const [totalRecords, setTotalRecords] = (0, react_1.useState)(0);
26
26
  const [gridReadyEvent, setGridReadyEvent] = (0, react_1.useState)();
27
- const [intialColumns, setIntialColumns] = (0, react_1.useState)(null);
28
27
  const [defaultFilters, setDefaultFilters] = (0, react_1.useState)((props === null || props === void 0 ? void 0 : props.defaultFilters) || []);
29
28
  const [selectedGroup, setSelectedGroup] = (0, react_1.useState)([]);
30
29
  const [emptyResponse] = (0, react_1.useState)({
@@ -75,7 +74,6 @@ function ParentForGrid(props) {
75
74
  sortable: false,
76
75
  };
77
76
  }, []);
78
- // console.log("propsssssssss", props)
79
77
  // Function to handle header checkbox click event
80
78
  const handleHeaderCheckbox = (props) => {
81
79
  // get the group and subgroupids
@@ -219,7 +217,7 @@ function ParentForGrid(props) {
219
217
  var _a;
220
218
  // Custom component for specific group header/parent
221
219
  const GroupHeaderRenderer = (params) => {
222
- var _a, _b, _c, _d;
220
+ var _a, _b, _c, _d, _e;
223
221
  const Wrapper = () => {
224
222
  return (0, jsx_runtime_1.jsx)(utilComponents_1.GroupHeader, { params: params });
225
223
  };
@@ -233,25 +231,18 @@ function ParentForGrid(props) {
233
231
  (0, helper_1.handleUncheckedState)(params, featureDetails, gridData, setFeatureDetails, setSelectedGroup, groupingColumns);
234
232
  }
235
233
  };
236
- const HeaderComponent = props === null || props === void 0 ? void 0 : props.rowGroupHeaderComponent;
237
234
  // To display checkbox
238
235
  if ((_a = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _a === void 0 ? void 0 : _a.displayCheckboxForGroups) {
239
236
  // To display checkbox on right
240
237
  return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-between" }, { children: [(0, jsx_runtime_1.jsx)(group_checkbox_1.default, { checked: (selectedGroup === null || selectedGroup === void 0 ? void 0 : selectedGroup.includes((_b = params === null || params === void 0 ? void 0 : params.node) === null || _b === void 0 ? void 0 : _b.id)) ||
241
238
  (((_c = featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.checkBoxSelection) === null || _c === void 0 ? void 0 : _c.allBoxChecked) &&
242
- !((_d = featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.checkBoxSelection) === null || _d === void 0 ? void 0 : _d.isIndeterminate)), onChange: (e) => onChange(e, params), isIndeterminate: false, shouldRenderOnRight: false }), props.rowGroupHeaderComponent ?
243
- (0, jsx_runtime_1.jsx)(HeaderComponent, { params: params }) : params.node.field] })));
239
+ !((_d = featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.checkBoxSelection) === null || _d === void 0 ? void 0 : _d.isIndeterminate)), onChange: (e) => onChange(e, params), isIndeterminate: false, shouldRenderOnRight: false }), (0, jsx_runtime_1.jsx)("span", { children: (_e = params === null || params === void 0 ? void 0 : params.node) === null || _e === void 0 ? void 0 : _e.id })] })));
244
240
  }
245
241
  return (0, jsx_runtime_1.jsx)(Wrapper, {});
246
242
  };
247
- const GridHeaderComponent = (props) => {
248
- if (props === null || props === void 0 ? void 0 : props.GroupHeaderComponent)
249
- return props === null || props === void 0 ? void 0 : props.GroupHeaderComponent;
250
- return (0, jsx_runtime_1.jsx)("span", { children: "Group Grid" });
251
- };
252
243
  // Cell renderer with checkbox
253
244
  const cellRendererConditionally = (params) => {
254
- var _a, _b, _c;
245
+ var _a, _b;
255
246
  if ((_a = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _a === void 0 ? void 0 : _a.displayCheckboxForGroupChild) {
256
247
  if (!(props === null || props === void 0 ? void 0 : props.ChildComponentForGroup)) {
257
248
  return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-between" }, { children: [cellCheckBoxRenderer(params), (0, jsx_runtime_1.jsx)("p", { children: params === null || params === void 0 ? void 0 : params.data[props === null || props === void 0 ? void 0 : props.groupField] })] })));
@@ -259,7 +250,7 @@ function ParentForGrid(props) {
259
250
  return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: ((_b = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _b === void 0 ? void 0 : _b.displayCheckboxOnRight) ? ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-between" }, { children: [props === null || props === void 0 ? void 0 : props.ChildComponentForGroup(params), cellCheckBoxRenderer(params)] }))) : ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-between" }, { children: [cellCheckBoxRenderer(params), props === null || props === void 0 ? void 0 : props.ChildComponentForGroup(params)] }))) }));
260
251
  }
261
252
  else {
262
- return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(props === null || props === void 0 ? void 0 : props.ChildComponentForGroup) ? props === null || props === void 0 ? void 0 : props.ChildComponentForGroup(params) : (0, jsx_runtime_1.jsx)("span", { children: params === null || params === void 0 ? void 0 : params.data[(_c = params === null || params === void 0 ? void 0 : params.colDef) === null || _c === void 0 ? void 0 : _c.field] }), " "] });
253
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: props === null || props === void 0 ? void 0 : props.ChildComponentForGroup(params) });
263
254
  }
264
255
  };
265
256
  // Group default values
@@ -268,7 +259,7 @@ function ParentForGrid(props) {
268
259
  return (0, helper_1.autoGroupColumnDef)((props === null || props === void 0 ? void 0 : props.enableTree) ? true : false, // If tree enable
269
260
  props === null || props === void 0 ? void 0 : props.treeHeaderName, // Tree header name
270
261
  props === null || props === void 0 ? void 0 : props.groupField, // Group field
271
- GridHeaderComponent, // Header component
262
+ props === null || props === void 0 ? void 0 : props.GroupHeaderComponent, // Header component
272
263
  headerCheckBoxRenderer, //
273
264
  props === null || props === void 0 ? void 0 : props.enableCheckboxForGroupHeader, props.conditionsToDisplay.displayGroupCount, cellRendererConditionally, GroupHeaderRenderer // Custom component for group header
274
265
  );
@@ -277,20 +268,12 @@ function ParentForGrid(props) {
277
268
  return (0, helper_1.autoGroupColumnDef)((props === null || props === void 0 ? void 0 : props.enableTree) ? true : false, // If tree enable
278
269
  props === null || props === void 0 ? void 0 : props.treeHeaderName, // Tree header name
279
270
  props === null || props === void 0 ? void 0 : props.groupField, // Group field
280
- GridHeaderComponent, // Header component
271
+ props === null || props === void 0 ? void 0 : props.GroupHeaderComponent, // Header component
281
272
  headerCheckBoxRenderer, //
282
273
  props === null || props === void 0 ? void 0 : props.enableCheckboxForGroupHeader, props.conditionsToDisplay.displayGroupCount, GroupHeaderRenderer // Custom component for group header
283
274
  );
284
275
  }
285
276
  };
286
- (0, react_1.useEffect)(() => {
287
- // Initialize `intialColumns` only if it hasn't been set yet
288
- if (!intialColumns) {
289
- // Perform a deep copy of the columns array using `JSON.parse(JSON.stringify())`
290
- const deepCopyOfColumns = (0, helper_1.deepClone)(gridData === null || gridData === void 0 ? void 0 : gridData.columnData);
291
- setIntialColumns(deepCopyOfColumns);
292
- }
293
- }, [intialColumns]);
294
277
  // Options that grid should have
295
278
  const gridOptions = {
296
279
  columnDefs: (_c = gridData === null || gridData === void 0 ? void 0 : gridData.columnData) === null || _c === void 0 ? void 0 : _c.map((column) => {
@@ -415,8 +398,6 @@ function ParentForGrid(props) {
415
398
  selectedGroup: selectedGroup,
416
399
  setSelectedGroup: setSelectedGroup,
417
400
  initialCheckBoxData: initialCheckBoxData,
418
- intialColumns,
419
- setIntialColumns
420
401
  } }, { children: ((_l = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _l === void 0 ? void 0 : _l.displayFeaturesHeader) && ((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, gridRef: gridRef })] }) })) }) }));
421
402
  }
422
403
  exports.default = ParentForGrid;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GridHeaderComponent = exports.GroupHeader = exports.dataCellRenderer = void 0;
3
+ exports.GroupHeader = exports.dataCellRenderer = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  // import Checkbox from "./grid-checkbox";
6
6
  // Render checkbox as well as initial component/data from props
@@ -16,9 +16,3 @@ const GroupHeader = (params) => {
16
16
  return (0, jsx_runtime_1.jsx)("p", { children: "My Custom Group" });
17
17
  };
18
18
  exports.GroupHeader = GroupHeader;
19
- const GridHeaderComponent = (props) => {
20
- if (props === null || props === void 0 ? void 0 : props.GroupHeaderComponent)
21
- return props === null || props === void 0 ? void 0 : props.GroupHeaderComponent;
22
- return (0, jsx_runtime_1.jsx)("span", { children: "Group" });
23
- };
24
- exports.GridHeaderComponent = GridHeaderComponent;
@@ -142,7 +142,6 @@ export interface PropsFromProduct {
142
142
  columnHeaderHeight?: number;
143
143
  AdvancedFilter?: React.FC;
144
144
  removeCallBack?: (featureDetails: Features) => void;
145
- rowGroupHeaderComponent: React.FC;
146
145
  }
147
146
  export interface ResoponseFromCallback {
148
147
  totalRecords: number;
@@ -258,7 +257,6 @@ export declare enum FilteredConditionTypes {
258
257
  STARTS_WITH_ANY_OF = 22,
259
258
  IS_EQUAL_TO = 23,
260
259
  IS_EQUAL_TO_ALL_OF = 24,
261
- IS_EQUAL_TO_ANY_OF = 25,
262
- IS_EQUAL_TO_ALL = 26
260
+ IS_EQUAL_TO_ANY_OF = 25
263
261
  }
264
262
  export {};
@@ -27,8 +27,6 @@ interface MyProviderProps {
27
27
  setSelectedGroup: (group: string[]) => void;
28
28
  selectedGroup: string[];
29
29
  initialCheckBoxData: CheckBoxSelection;
30
- intialColumns: ColumnDef[];
31
- setIntialColumns: React.Dispatch<React.SetStateAction<any>>;
32
30
  };
33
31
  }
34
32
  declare function MyProvider({ children, value }: MyProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -20,7 +20,6 @@ export declare const autoGroupColumnDef: (isTreeEnable: boolean, headerName: str
20
20
  field: string;
21
21
  headerComponent: React.FC<{}> | (() => React.ReactElement<any, any>);
22
22
  cellRenderer: string;
23
- minWidth: number;
24
23
  cellRendererParams: (params: any) => {
25
24
  suppressCount: boolean;
26
25
  innerRenderer: React.FC<{}>;
@@ -35,13 +34,14 @@ export declare const autoGroupColumnDef: (isTreeEnable: boolean, headerName: str
35
34
  checkbox?: undefined;
36
35
  };
37
36
  headerName?: undefined;
37
+ minWidth?: undefined;
38
38
  };
39
39
  export declare const updateRecords: (rowData: any, featureDetails: any, gridData: any) => any;
40
- export declare const determineConditions: (isChecked: any, allBoxChecked: any, isEveryParentGroupInclude: any, isEveryParentGroupExcluded: any, isEverySuperParentGroupExcluded: any, isEverySuperParentGroupInclude: any) => {
40
+ export declare const determineConditions: (isChecked: any, allBoxChecked: any, isEveryParentGroupInclude: any, isEveryParentGroupExcluded: any, isEverySuperParentGroupExcluded: any) => {
41
41
  addParent: any;
42
42
  addSuperParent: any;
43
- removeParent: boolean;
44
- removeSuperParent: boolean;
43
+ removeParent: any;
44
+ removeSuperParent: any;
45
45
  };
46
46
  export declare const updateGroupState: (groupingColumns: any, parentId: any, superParentId: any, conditions: any, setSelectedGroup: any) => void;
47
47
  export declare const handleCheckedState: (params: any, featureDetails: any, gridData: any, setFeatureDetails: any, setSelectedGroup: any, groupingColumns: any) => void;
@@ -51,4 +51,3 @@ export declare const getGroupIds: (gridRef: any) => {
51
51
  secondGroupIds: string[];
52
52
  };
53
53
  export declare const handleCheckboxClick: (e: any, params: any, featureDetails: any, gridData: any, setFeatureDetails: any, groupingColumns: any, setSelectedGroup: any) => void;
54
- export declare const deepClone: (obj: any) => any;
@@ -1,3 +1,2 @@
1
1
  export declare const dataCellRenderer: (cellRendererParams: any, column: any, props: any) => import("react/jsx-runtime").JSX.Element;
2
2
  export declare const GroupHeader: (params: any) => import("react/jsx-runtime").JSX.Element;
3
- export declare const GridHeaderComponent: (props: any) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sccoreui",
3
- "version": "6.1.92",
3
+ "version": "6.1.94",
4
4
  "description": "ui-sccore",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -26,10 +26,38 @@
26
26
  "devDependencies": {
27
27
  "@types/react": "^18.2.8",
28
28
  "@types/react-dom": "^18.2.4",
29
+ "cross-env": "^7.0.3",
29
30
  "sass": "^1.62.1"
30
31
  },
31
32
  "dependencies": {
33
+ "@ag-grid-community/client-side-row-model": "^31.3.2",
34
+ "@ag-grid-community/core": "^31.3.2",
35
+ "@ag-grid-community/csv-export": "^31.3.2",
36
+ "@ag-grid-community/infinite-row-model": "^31.3.2",
37
+ "@ag-grid-community/react": "^31.3.2",
38
+ "@ag-grid-community/styles": "^31.3.2",
39
+ "@ag-grid-enterprise/advanced-filter": "^31.3.2",
40
+ "@ag-grid-enterprise/charts-enterprise": "^31.3.2",
41
+ "@ag-grid-enterprise/clipboard": "^31.3.2",
42
+ "@ag-grid-enterprise/column-tool-panel": "^31.3.2",
43
+ "@ag-grid-enterprise/core": "^31.3.2",
44
+ "@ag-grid-enterprise/excel-export": "^31.3.2",
45
+ "@ag-grid-enterprise/filter-tool-panel": "^31.3.2",
46
+ "@ag-grid-enterprise/master-detail": "^31.3.2",
47
+ "@ag-grid-enterprise/menu": "^31.3.2",
48
+ "@ag-grid-enterprise/multi-filter": "^31.3.2",
49
+ "@ag-grid-enterprise/range-selection": "^31.3.2",
50
+ "@ag-grid-enterprise/rich-select": "^31.3.2",
51
+ "@ag-grid-enterprise/row-grouping": "^31.3.2",
52
+ "@ag-grid-enterprise/server-side-row-model": "^31.3.2",
53
+ "@ag-grid-enterprise/set-filter": "^31.3.2",
54
+ "@ag-grid-enterprise/side-bar": "^31.3.2",
55
+ "@ag-grid-enterprise/sparklines": "^31.3.2",
56
+ "@ag-grid-enterprise/status-bar": "^31.3.2",
57
+ "@ag-grid-enterprise/viewport-row-model": "^31.3.2",
32
58
  "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
59
+ "@types/react": "18",
60
+ "@types/react-dom": "18",
33
61
  "ag-grid-react": "^31.2.1",
34
62
  "axios": "^1.6.8",
35
63
  "chart.js": "^4.3.0",
@@ -40,42 +68,15 @@
40
68
  "primeicons": "^6.0.1",
41
69
  "primereact": "^9.5.0",
42
70
  "quill": "^1.3.7",
71
+ "react": "18",
43
72
  "react-color": "^2.19.3",
73
+ "react-dom": "18",
44
74
  "react-froala-wysiwyg": "^4.1.2",
45
75
  "react-phone-number-input": "^3.3.6",
46
76
  "react-router-dom": "^6.12.0",
47
77
  "react-scripts": "^5.0.1",
48
78
  "typescript": "^4.9.5",
49
- "yup": "^1.3.2",
50
- "react": "18",
51
- "react-dom": "18",
52
- "@types/react": "18",
53
- "@types/react-dom": "18",
54
- "@ag-grid-community/react": "^31.3.2",
55
- "@ag-grid-community/core": "^31.3.2",
56
- "@ag-grid-community/styles": "^31.3.2",
57
- "@ag-grid-community/client-side-row-model": "^31.3.2",
58
- "@ag-grid-community/infinite-row-model": "^31.3.2",
59
- "@ag-grid-community/csv-export": "^31.3.2",
60
- "@ag-grid-enterprise/core": "^31.3.2",
61
- "@ag-grid-enterprise/charts-enterprise": "^31.3.2",
62
- "@ag-grid-enterprise/sparklines": "^31.3.2",
63
- "@ag-grid-enterprise/clipboard": "^31.3.2",
64
- "@ag-grid-enterprise/column-tool-panel": "^31.3.2",
65
- "@ag-grid-enterprise/excel-export": "^31.3.2",
66
- "@ag-grid-enterprise/filter-tool-panel": "^31.3.2",
67
- "@ag-grid-enterprise/master-detail": "^31.3.2",
68
- "@ag-grid-enterprise/menu": "^31.3.2",
69
- "@ag-grid-enterprise/range-selection": "^31.3.2",
70
- "@ag-grid-enterprise/rich-select": "^31.3.2",
71
- "@ag-grid-enterprise/row-grouping": "^31.3.2",
72
- "@ag-grid-enterprise/server-side-row-model": "^31.3.2",
73
- "@ag-grid-enterprise/set-filter": "^31.3.2",
74
- "@ag-grid-enterprise/multi-filter": "^31.3.2",
75
- "@ag-grid-enterprise/advanced-filter": "^31.3.2",
76
- "@ag-grid-enterprise/side-bar": "^31.3.2",
77
- "@ag-grid-enterprise/status-bar": "^31.3.2",
78
- "@ag-grid-enterprise/viewport-row-model": "^31.3.2"
79
+ "yup": "^1.3.2"
79
80
  },
80
81
  "browserslist": {
81
82
  "production": [