sccoreui 6.1.91 → 6.1.93

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,7 @@ 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");
14
15
  const Conditions = (props) => {
15
16
  const { columnName, condition, value, columnsArray, conditionsArray, index, id, updateconditionsArray, removeConditionFromArray, addEmptyCondition, conditionsLength, conditionType, conditionTypes, handleConditionType, filterModelText } = props;
16
17
  const onAddCondition = (index) => {
@@ -50,7 +51,12 @@ const Conditions = (props) => {
50
51
  var _a, _b, _c, _d, _e, _f;
51
52
  switch (selectedColumn.dataType) {
52
53
  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) }));
54
+ if (condition === Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO || condition === Types_1.FilteredConditionTypes.IS_EQUAL_TO) {
55
+ 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) }));
56
+ }
57
+ else {
58
+ 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: "," }));
59
+ }
54
60
  }
55
61
  case Types_1.FilterDataType.DECIMAL:
56
62
  case Types_1.FilterDataType.PERCENT:
@@ -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]);
@@ -35,31 +35,239 @@ var DEFAULTS;
35
35
  })(DEFAULTS || (DEFAULTS = {}));
36
36
  exports.DEFAULTS = DEFAULTS;
37
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 }
38
+ {
39
+ name: "contains all of",
40
+ datatypes: [Types_1.FilterDataType.BOOLEAN, Types_1.FilterDataType.SELECT, Types_1.FilterDataType.MULTISELECT],
41
+ value: Types_1.FilteredConditionTypes.CONTAINS_ALL_OF
42
+ },
43
+ {
44
+ name: "contains any of",
45
+ datatypes: [Types_1.FilterDataType.STRING],
46
+ value: Types_1.FilteredConditionTypes.CONTAINS_ANY_OF
47
+ },
48
+ {
49
+ name: "doesn’t contain all of",
50
+ datatypes: [Types_1.FilterDataType.BOOLEAN, Types_1.FilterDataType.SELECT, Types_1.FilterDataType.MULTISELECT],
51
+ value: Types_1.FilteredConditionTypes.DOES_NOT_CONTAIN_ALL_OF
52
+ },
53
+ {
54
+ name: "doesn’t contain any of",
55
+ datatypes: [Types_1.FilterDataType.STRING],
56
+ value: Types_1.FilteredConditionTypes.DOES_NOT_CONTAIN_ANY_OF
57
+ },
58
+ {
59
+ name: "ends with any of",
60
+ datatypes: [Types_1.FilterDataType.STRING],
61
+ value: Types_1.FilteredConditionTypes.ENDS_WITH_ANY_OF
62
+ },
63
+ {
64
+ name: "is after",
65
+ datatypes: [Types_1.FilterDataType.DATE, Types_1.FilterDataType.DATEANDTIME],
66
+ value: Types_1.FilteredConditionTypes.IS_AFTER
67
+ },
68
+ {
69
+ name: "is any of",
70
+ datatypes: [Types_1.FilterDataType.BOOLEAN, Types_1.FilterDataType.SELECT, Types_1.FilterDataType.MULTISELECT],
71
+ value: Types_1.FilteredConditionTypes.IS_ANY_OF
72
+ },
73
+ {
74
+ name: "is before",
75
+ datatypes: [Types_1.FilterDataType.DATE, Types_1.FilterDataType.DATEANDTIME],
76
+ value: Types_1.FilteredConditionTypes.IS_BEFORE
77
+ },
78
+ {
79
+ name: "is between",
80
+ datatypes: [
81
+ Types_1.FilterDataType.BIGINTEGER,
82
+ Types_1.FilterDataType.INTEGER,
83
+ Types_1.FilterDataType.DATE,
84
+ Types_1.FilterDataType.PERCENT,
85
+ Types_1.FilterDataType.CURRENCY,
86
+ Types_1.FilterDataType.DECIMAL,
87
+ Types_1.FilterDataType.DATEANDTIME
88
+ ],
89
+ value: Types_1.FilteredConditionTypes.IS_BETWEEN
90
+ },
91
+ {
92
+ name: "is not equal to",
93
+ datatypes: [
94
+ Types_1.FilterDataType.BIGINTEGER,
95
+ Types_1.FilterDataType.INTEGER,
96
+ Types_1.FilterDataType.DATE,
97
+ Types_1.FilterDataType.PERCENT,
98
+ Types_1.FilterDataType.CURRENCY,
99
+ Types_1.FilterDataType.DECIMAL,
100
+ Types_1.FilterDataType.DATEANDTIME
101
+ ],
102
+ value: Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO
103
+ },
104
+ {
105
+ name: "is not equal to all of",
106
+ datatypes: [
107
+ Types_1.FilterDataType.BOOLEAN,
108
+ Types_1.FilterDataType.SELECT,
109
+ Types_1.FilterDataType.MULTISELECT
110
+ ],
111
+ value: Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ALL_OF
112
+ },
113
+ {
114
+ name: "is not equal to any of",
115
+ datatypes: [Types_1.FilterDataType.STRING],
116
+ value: Types_1.FilteredConditionTypes.IS_NOT_EQUAL_TO_ANY_OF
117
+ },
118
+ {
119
+ name: "is greater than",
120
+ datatypes: [
121
+ Types_1.FilterDataType.BIGINTEGER,
122
+ Types_1.FilterDataType.INTEGER,
123
+ Types_1.FilterDataType.PERCENT,
124
+ Types_1.FilterDataType.CURRENCY,
125
+ Types_1.FilterDataType.DECIMAL
126
+ ],
127
+ value: Types_1.FilteredConditionTypes.IS_GREATER_THAN
128
+ },
129
+ {
130
+ name: "is greater than or equal to",
131
+ datatypes: [
132
+ Types_1.FilterDataType.BIGINTEGER,
133
+ Types_1.FilterDataType.INTEGER,
134
+ Types_1.FilterDataType.PERCENT,
135
+ Types_1.FilterDataType.CURRENCY,
136
+ Types_1.FilterDataType.DECIMAL
137
+ ],
138
+ value: Types_1.FilteredConditionTypes.IS_GREATER_THAN_OR_EQUAL_TO
139
+ },
140
+ {
141
+ name: "is known",
142
+ datatypes: [
143
+ Types_1.FilterDataType.BOOLEAN,
144
+ Types_1.FilterDataType.SELECT,
145
+ Types_1.FilterDataType.INTEGER,
146
+ Types_1.FilterDataType.PERCENT,
147
+ Types_1.FilterDataType.CURRENCY,
148
+ Types_1.FilterDataType.DECIMAL,
149
+ Types_1.FilterDataType.DATE,
150
+ Types_1.FilterDataType.DATEANDTIME,
151
+ Types_1.FilterDataType.FILE,
152
+ Types_1.FilterDataType.IMAGE,
153
+ Types_1.FilterDataType.TEXTEDITOR,
154
+ Types_1.FilterDataType.MULTISELECT,
155
+ Types_1.FilterDataType.STRING
156
+ ],
157
+ value: Types_1.FilteredConditionTypes.IS_KNOWN
158
+ },
159
+ {
160
+ name: "is less than",
161
+ datatypes: [
162
+ Types_1.FilterDataType.BIGINTEGER,
163
+ Types_1.FilterDataType.INTEGER,
164
+ Types_1.FilterDataType.PERCENT,
165
+ Types_1.FilterDataType.CURRENCY,
166
+ Types_1.FilterDataType.DECIMAL,
167
+ Types_1.FilterDataType.DATEANDTIME,
168
+ Types_1.FilterDataType.DATE
169
+ ],
170
+ value: Types_1.FilteredConditionTypes.IS_LESS_THAN
171
+ },
172
+ {
173
+ name: "is less than or equal to",
174
+ datatypes: [
175
+ Types_1.FilterDataType.BIGINTEGER,
176
+ Types_1.FilterDataType.INTEGER,
177
+ Types_1.FilterDataType.CURRENCY,
178
+ Types_1.FilterDataType.DECIMAL
179
+ ],
180
+ value: Types_1.FilteredConditionTypes.IS_LESS_THAN_OR_EQUAL_TO
181
+ },
182
+ {
183
+ name: "is more than",
184
+ datatypes: [
185
+ Types_1.FilterDataType.BIGINTEGER,
186
+ Types_1.FilterDataType.INTEGER,
187
+ Types_1.FilterDataType.PERCENT,
188
+ Types_1.FilterDataType.CURRENCY,
189
+ Types_1.FilterDataType.DECIMAL,
190
+ Types_1.FilterDataType.DATEANDTIME,
191
+ Types_1.FilterDataType.DATE
192
+ ],
193
+ value: Types_1.FilteredConditionTypes.IS_MORE_THAN
194
+ },
195
+ {
196
+ name: "is none of",
197
+ datatypes: [
198
+ Types_1.FilterDataType.BOOLEAN,
199
+ Types_1.FilterDataType.SELECT,
200
+ Types_1.FilterDataType.MULTISELECT
201
+ ],
202
+ value: Types_1.FilteredConditionTypes.IS_NONE_OF
203
+ },
204
+ {
205
+ name: "is not between",
206
+ datatypes: [
207
+ Types_1.FilterDataType.BIGINTEGER,
208
+ Types_1.FilterDataType.INTEGER,
209
+ Types_1.FilterDataType.DATE,
210
+ Types_1.FilterDataType.PERCENT,
211
+ Types_1.FilterDataType.CURRENCY,
212
+ Types_1.FilterDataType.DECIMAL,
213
+ Types_1.FilterDataType.DATEANDTIME
214
+ ],
215
+ value: Types_1.FilteredConditionTypes.IS_NOT_BETWEEN
216
+ },
217
+ {
218
+ name: "is unknown",
219
+ datatypes: [
220
+ Types_1.FilterDataType.BOOLEAN,
221
+ Types_1.FilterDataType.INTEGER,
222
+ Types_1.FilterDataType.PERCENT,
223
+ Types_1.FilterDataType.SELECT,
224
+ Types_1.FilterDataType.CURRENCY,
225
+ Types_1.FilterDataType.DECIMAL,
226
+ Types_1.FilterDataType.DATE,
227
+ Types_1.FilterDataType.DATEANDTIME,
228
+ Types_1.FilterDataType.FILE,
229
+ Types_1.FilterDataType.IMAGE,
230
+ Types_1.FilterDataType.TEXTEDITOR,
231
+ Types_1.FilterDataType.MULTISELECT,
232
+ Types_1.FilterDataType.STRING
233
+ ],
234
+ value: Types_1.FilteredConditionTypes.IS_UNKNOWN
235
+ },
236
+ {
237
+ name: "starts with any of",
238
+ datatypes: [Types_1.FilterDataType.STRING],
239
+ value: Types_1.FilteredConditionTypes.STARTS_WITH_ANY_OF
240
+ },
241
+ {
242
+ name: "is equal to",
243
+ datatypes: [
244
+ Types_1.FilterDataType.BIGINTEGER,
245
+ Types_1.FilterDataType.INTEGER,
246
+ Types_1.FilterDataType.DATE,
247
+ Types_1.FilterDataType.PERCENT,
248
+ Types_1.FilterDataType.CURRENCY,
249
+ Types_1.FilterDataType.DECIMAL,
250
+ Types_1.FilterDataType.DATEANDTIME
251
+ ],
252
+ value: Types_1.FilteredConditionTypes.IS_EQUAL_TO
253
+ },
254
+ {
255
+ name: "is equal to all of",
256
+ datatypes: [
257
+ Types_1.FilterDataType.BOOLEAN,
258
+ Types_1.FilterDataType.SELECT,
259
+ Types_1.FilterDataType.MULTISELECT
260
+ ],
261
+ value: Types_1.FilteredConditionTypes.IS_EQUAL_TO_ALL_OF
262
+ },
263
+ {
264
+ name: "is equal to any of",
265
+ datatypes: [
266
+ Types_1.FilterDataType.STRING,
267
+ Types_1.FilterDataType.MULTISELECT
268
+ ],
269
+ value: Types_1.FilteredConditionTypes.IS_EQUAL_TO_ANY_OF
270
+ }
63
271
  ];
64
272
  const defaultOptionValueColumn = { order: 1, labelName: "", value: "", upload: "", actions: "" };
65
273
  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" }];
@@ -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)) {
@@ -279,13 +277,13 @@ exports.updateRecords = updateRecords;
279
277
  // Based on various flags and states, determines whether to add or remove group IDs
280
278
  const determineConditions = (isChecked, allBoxChecked, isEveryParentGroupInclude, isEveryParentGroupExcluded, isEverySuperParentGroupExcluded) => ({
281
279
  addParent: (!allBoxChecked && isChecked && isEveryParentGroupInclude) ||
282
- (allBoxChecked && isChecked && isEveryParentGroupExcluded),
280
+ (allBoxChecked && isChecked && !isEveryParentGroupExcluded),
283
281
  addSuperParent: (!allBoxChecked && isChecked && isEveryParentGroupInclude) ||
284
- (allBoxChecked && isChecked && isEverySuperParentGroupExcluded),
282
+ (allBoxChecked && isChecked && !isEverySuperParentGroupExcluded),
285
283
  removeParent: (!allBoxChecked && !isChecked && !isEveryParentGroupInclude) ||
286
- (allBoxChecked && !isChecked && !isEveryParentGroupExcluded),
284
+ (allBoxChecked && !isChecked && isEveryParentGroupExcluded),
287
285
  removeSuperParent: (!allBoxChecked && !isChecked && !isEveryParentGroupInclude) ||
288
- (allBoxChecked && !isChecked && !isEverySuperParentGroupExcluded),
286
+ (allBoxChecked && !isChecked && isEverySuperParentGroupExcluded),
289
287
  });
290
288
  exports.determineConditions = determineConditions;
291
289
  // Function to update the selected groups in the state
@@ -313,10 +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
- }
319
- ; // Add parent group ID
314
+ if (addParent)
315
+ updateSelectedGroup(parentId, true, setSelectedGroup); // Add parent group ID
320
316
  if (removeSuperParent)
321
317
  updateSelectedGroup(superParentId, false, setSelectedGroup); // Remove super parent group ID
322
318
  if (removeParent)
@@ -360,7 +356,11 @@ 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
  });
@@ -545,53 +545,7 @@ const handleCheckboxClick = (e, params, featureDetails, gridData, setFeatureDeta
545
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)); });
546
546
  // Determine the conditions to update group state
547
547
  const conditions = (0, exports.determineConditions)(isChecked, updatedCheckBoxData.allBoxChecked, isEveryParentGroupInclude, isEveryParentGroupExcluded, isEverySuperParentGroupExcluded);
548
- console.log("conditionsss", conditions);
549
548
  // Update group state based on determined conditions
550
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);
551
550
  };
552
551
  exports.handleCheckboxClick = handleCheckboxClick;
553
- const deepClone = (obj) => {
554
- var _a, _b, _c;
555
- // If the input is not an object or is null, return the value itself (primitive types are returned directly)
556
- if (obj === null || typeof obj !== 'object') {
557
- return obj;
558
- }
559
- // Handle Date objects by creating a new Date instance with the same value
560
- if (obj instanceof Date) {
561
- return new Date(obj);
562
- }
563
- // Handle RegExp objects by creating a new RegExp instance with the same pattern and flags
564
- if (obj instanceof RegExp) {
565
- return new RegExp(obj);
566
- }
567
- // Handle React JSX elements
568
- // If the object is a valid React element, clone it along with its props and children
569
- if (react_1.default.isValidElement(obj)) {
570
- const element = obj; // Explicitly assert type to ReactElement
571
- // Recursively clone all child elements, if any
572
- const clonedChildren = ((_a = element === null || element === void 0 ? void 0 : element.props) === null || _a === void 0 ? void 0 : _a.children)
573
- ? (_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))
574
- : undefined; // Set to undefined if no children exist
575
- // Return a cloned React element with its props and recursively cloned children
576
- return react_1.default.cloneElement(element, Object.assign({}, element === null || element === void 0 ? void 0 : element.props), // Spread the existing props
577
- clonedChildren // Include cloned children
578
- );
579
- }
580
- // Handle Arrays
581
- // Recursively clone each element in the array
582
- if (Array.isArray(obj)) {
583
- return obj === null || obj === void 0 ? void 0 : obj.map(exports.deepClone);
584
- }
585
- // Handle Objects
586
- // Recursively clone each property in the object
587
- const clonedObj = {}; // Create a new empty object to hold cloned properties
588
- for (const key in obj) {
589
- // Use hasOwnProperty to avoid cloning inherited properties
590
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
591
- clonedObj[key] = (0, exports.deepClone)(obj[key]); // Recursively clone each property
592
- }
593
- }
594
- // Return the fully cloned object
595
- return clonedObj;
596
- };
597
- 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
@@ -244,7 +242,7 @@ function ParentForGrid(props) {
244
242
  };
245
243
  // Cell renderer with checkbox
246
244
  const cellRendererConditionally = (params) => {
247
- var _a, _b, _c;
245
+ var _a, _b;
248
246
  if ((_a = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _a === void 0 ? void 0 : _a.displayCheckboxForGroupChild) {
249
247
  if (!(props === null || props === void 0 ? void 0 : props.ChildComponentForGroup)) {
250
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] })] })));
@@ -252,7 +250,7 @@ function ParentForGrid(props) {
252
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)] }))) }));
253
251
  }
254
252
  else {
255
- 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) });
256
254
  }
257
255
  };
258
256
  // Group default values
@@ -261,7 +259,7 @@ function ParentForGrid(props) {
261
259
  return (0, helper_1.autoGroupColumnDef)((props === null || props === void 0 ? void 0 : props.enableTree) ? true : false, // If tree enable
262
260
  props === null || props === void 0 ? void 0 : props.treeHeaderName, // Tree header name
263
261
  props === null || props === void 0 ? void 0 : props.groupField, // Group field
264
- (0, utilComponents_1.GridHeaderComponent)(props), // Header component
262
+ props === null || props === void 0 ? void 0 : props.GroupHeaderComponent, // Header component
265
263
  headerCheckBoxRenderer, //
266
264
  props === null || props === void 0 ? void 0 : props.enableCheckboxForGroupHeader, props.conditionsToDisplay.displayGroupCount, cellRendererConditionally, GroupHeaderRenderer // Custom component for group header
267
265
  );
@@ -270,20 +268,12 @@ function ParentForGrid(props) {
270
268
  return (0, helper_1.autoGroupColumnDef)((props === null || props === void 0 ? void 0 : props.enableTree) ? true : false, // If tree enable
271
269
  props === null || props === void 0 ? void 0 : props.treeHeaderName, // Tree header name
272
270
  props === null || props === void 0 ? void 0 : props.groupField, // Group field
273
- (0, utilComponents_1.GridHeaderComponent)(props), // Header component
271
+ props === null || props === void 0 ? void 0 : props.GroupHeaderComponent, // Header component
274
272
  headerCheckBoxRenderer, //
275
273
  props === null || props === void 0 ? void 0 : props.enableCheckboxForGroupHeader, props.conditionsToDisplay.displayGroupCount, GroupHeaderRenderer // Custom component for group header
276
274
  );
277
275
  }
278
276
  };
279
- (0, react_1.useEffect)(() => {
280
- // Initialize `intialColumns` only if it hasn't been set yet
281
- if (!intialColumns) {
282
- // Perform a deep copy of the columns array using `JSON.parse(JSON.stringify())`
283
- const deepCopyOfColumns = (0, helper_1.deepClone)(gridData === null || gridData === void 0 ? void 0 : gridData.columnData);
284
- setIntialColumns(deepCopyOfColumns);
285
- }
286
- }, [intialColumns]);
287
277
  // Options that grid should have
288
278
  const gridOptions = {
289
279
  columnDefs: (_c = gridData === null || gridData === void 0 ? void 0 : gridData.columnData) === null || _c === void 0 ? void 0 : _c.map((column) => {
@@ -408,8 +398,6 @@ function ParentForGrid(props) {
408
398
  selectedGroup: selectedGroup,
409
399
  setSelectedGroup: setSelectedGroup,
410
400
  initialCheckBoxData: initialCheckBoxData,
411
- intialColumns,
412
- setIntialColumns
413
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 })] }) })) }) }));
414
402
  }
415
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;
@@ -257,7 +257,6 @@ export declare enum FilteredConditionTypes {
257
257
  STARTS_WITH_ANY_OF = 22,
258
258
  IS_EQUAL_TO = 23,
259
259
  IS_EQUAL_TO_ALL_OF = 24,
260
- IS_EQUAL_TO_ANY_OF = 25,
261
- IS_EQUAL_TO_ALL = 26
260
+ IS_EQUAL_TO_ANY_OF = 25
262
261
  }
263
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
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.91",
3
+ "version": "6.1.93",
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": [