sccoreui 6.4.49 → 6.4.52
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 +1 -1
- package/dist/components/ag-grid/advancedFeature/custom-sort.js +2 -3
- package/dist/components/ag-grid/advancedFeature/global-search.js +5 -3
- package/dist/components/ag-grid/advancedFeature/hide-column.js +38 -14
- package/dist/components/ag-grid/advancedFeature/new-filter/table-filter.js +16 -1
- package/dist/components/ag-grid/constants.js +6 -14
- package/dist/components/ag-grid/context-provider.js +1 -7
- package/dist/components/ag-grid/helper.js +20 -25
- package/dist/components/ag-grid/parent-for-grid.js +5 -9
- package/dist/components/list-box-dropdown/list-box-dropdown.js +20 -23
- package/dist/types/components/ag-grid/constants.d.ts +1 -1
- package/dist/types/components/ag-grid/helper.d.ts +1 -1
- package/package.json +2 -2
package/dist/App.scss
CHANGED
|
@@ -12,7 +12,6 @@ const context_provider_1 = require("../context-provider");
|
|
|
12
12
|
const helper_1 = require("../helper");
|
|
13
13
|
const utilComponents_1 = require("../utilComponents");
|
|
14
14
|
const FeatureSkeleton_1 = tslib_1.__importDefault(require("../../skeletons/FeatureSkeleton"));
|
|
15
|
-
const constants_1 = tslib_1.__importDefault(require("../constants"));
|
|
16
15
|
function Sort() {
|
|
17
16
|
var _a, _b;
|
|
18
17
|
const { sortValue, setSortValue, sortBy, setSortBy, isOverlayOpened, setIsOverlayOpened, featureDetails, callGrid, columnData, sortModelText, sortOptions, conditionsToDisplay, } = (0, react_1.useContext)(context_provider_1.FeatureContext);
|
|
@@ -58,7 +57,7 @@ function Sort() {
|
|
|
58
57
|
if (!((sortInfo === null || sortInfo === void 0 ? void 0 : sortInfo.isSortable) && (sortInfo === null || sortInfo === void 0 ? void 0 : sortInfo.columnToSort) && (sortInfo === null || sortInfo === void 0 ? void 0 : sortInfo.orderToSort))) {
|
|
59
58
|
return;
|
|
60
59
|
}
|
|
61
|
-
const currentFeature = Object.assign(
|
|
60
|
+
const currentFeature = Object.assign({}, featureDetails);
|
|
62
61
|
currentFeature.sort = sortInfo;
|
|
63
62
|
return currentFeature;
|
|
64
63
|
};
|
|
@@ -79,7 +78,7 @@ function Sort() {
|
|
|
79
78
|
columnToSort: "",
|
|
80
79
|
orderToSort: "",
|
|
81
80
|
};
|
|
82
|
-
const currentFeatureDetails = Object.assign(
|
|
81
|
+
const currentFeatureDetails = Object.assign({}, featureDetails);
|
|
83
82
|
currentFeatureDetails.sort = sortDetails;
|
|
84
83
|
callGrid(currentFeatureDetails);
|
|
85
84
|
};
|
|
@@ -6,12 +6,14 @@ const inputtext_1 = require("primereact/inputtext");
|
|
|
6
6
|
const svg_component_1 = tslib_1.__importDefault(require("../../../directives/svg-component"));
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const context_provider_1 = require("../context-provider");
|
|
9
|
-
const
|
|
9
|
+
const hooks_1 = require("primereact/hooks");
|
|
10
|
+
const constants_1 = require("../constants");
|
|
10
11
|
const helper_1 = require("../helper");
|
|
11
12
|
const utilComponents_1 = require("../utilComponents");
|
|
12
13
|
const skeleton_1 = require("primereact/skeleton");
|
|
13
14
|
function Search({ searchPlaceHolder }) {
|
|
14
|
-
const { featureDetails, setFeatureDetails, rowModelType, gridApi, quickSearch, conditionsToDisplay, setGridViewData, gridView,
|
|
15
|
+
const { featureDetails, setFeatureDetails, rowModelType, gridApi, quickSearch, conditionsToDisplay, setGridViewData, gridView, } = (0, react_1.useContext)(context_provider_1.FeatureContext);
|
|
16
|
+
const [inputValue, deboucedValue, setInputValue] = (0, hooks_1.useDebounce)("", 500);
|
|
15
17
|
const isDisabled = (0, helper_1.isComponentDisable)(conditionsToDisplay.displaySearch);
|
|
16
18
|
(0, react_1.useEffect)(() => {
|
|
17
19
|
var _a, _b, _c;
|
|
@@ -31,7 +33,7 @@ function Search({ searchPlaceHolder }) {
|
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
else {
|
|
34
|
-
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), {
|
|
36
|
+
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { searchedText: deboucedValue }));
|
|
35
37
|
}
|
|
36
38
|
}, [deboucedValue]);
|
|
37
39
|
return (0, utilComponents_1.skeletonLoding)() ? ((0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { height: "40px", width: "336px" })) : ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `p-input-icon-left ${inputValue.length > 0 ? "p-input-icon-right" : ""}` }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-prefix zoom_animate" }, { children: (0, jsx_runtime_1.jsx)(svg_component_1.default, { color: "#667085", icon: "search-lg", size: 18, disabled: isDisabled }) })), inputValue.length > 0 && ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: "p-input-suffix cursor-pointer zoom_animate", onClick: () => {
|
|
@@ -25,12 +25,15 @@ function HideColumn() {
|
|
|
25
25
|
const addColumns = () => {
|
|
26
26
|
var _a;
|
|
27
27
|
const columns = [];
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
const addedColumnIds = new Set(); // Track already added columns to prevent duplicates
|
|
29
|
+
(_a = gridData.columnData) === null || _a === void 0 ? void 0 : _a.forEach((gColumn) => {
|
|
30
|
+
// Check if this column exists in columnToRender
|
|
31
|
+
const existsInRender = columnToRender === null || columnToRender === void 0 ? void 0 : columnToRender.some((rColumn) => gColumn.id === rColumn.id || gColumn.field === rColumn.field);
|
|
32
|
+
// Add column only if it exists in render and hasn't been added yet
|
|
33
|
+
if (existsInRender && !addedColumnIds.has(gColumn.id)) {
|
|
34
|
+
columns.push(gColumn);
|
|
35
|
+
addedColumnIds.add(gColumn.id);
|
|
36
|
+
}
|
|
34
37
|
});
|
|
35
38
|
setHidePanelNodes(columns);
|
|
36
39
|
assignInitialValues(columns);
|
|
@@ -108,19 +111,40 @@ function HideColumn() {
|
|
|
108
111
|
const hideColumns = (columnsToHide, updatedSeq) => {
|
|
109
112
|
if (!gridApi)
|
|
110
113
|
return;
|
|
111
|
-
|
|
114
|
+
// Create a deep copy of the original state for comparison
|
|
115
|
+
const originalColumns = hidePanelNodes.map((col) => (Object.assign({}, col)));
|
|
116
|
+
const changedColumns = []; // Track only visibility changes
|
|
117
|
+
// Process each column to detect changes and update the grid
|
|
118
|
+
hidePanelNodes.forEach((colDef) => {
|
|
119
|
+
const originalCol = originalColumns.find((orig) => orig.id === colDef.id);
|
|
112
120
|
const colToHide = columnsToHide.find((col) => col.id === colDef.id);
|
|
113
|
-
|
|
121
|
+
const newHideValue = (colDef === null || colDef === void 0 ? void 0 : colDef.visibleInPanel) ? !!colToHide : colDef === null || colDef === void 0 ? void 0 : colDef.hide;
|
|
122
|
+
// Store original values for comparison
|
|
123
|
+
const originalHideValue = originalCol === null || originalCol === void 0 ? void 0 : originalCol.hide;
|
|
124
|
+
const originalSeq = originalCol === null || originalCol === void 0 ? void 0 : originalCol.seq;
|
|
125
|
+
// Update the column definition
|
|
126
|
+
colDef.hide = newHideValue;
|
|
114
127
|
const updatedCol = updatedSeq.find((col) => col.id === colDef.id);
|
|
128
|
+
let newSeq = originalSeq;
|
|
115
129
|
if (updatedCol) {
|
|
116
|
-
|
|
130
|
+
newSeq = updatedCol.seq;
|
|
131
|
+
colDef.seq = newSeq;
|
|
132
|
+
}
|
|
133
|
+
// Only track columns that had their visibility actually changed
|
|
134
|
+
// Ignore sequence changes as they happen automatically for all columns
|
|
135
|
+
const visibilityChanged = originalHideValue !== newHideValue;
|
|
136
|
+
if (visibilityChanged) {
|
|
137
|
+
changedColumns.push(Object.assign(Object.assign({}, colDef), { changeType: "visibility", previousHide: originalHideValue, currentHide: newHideValue }));
|
|
117
138
|
}
|
|
118
|
-
return colDef;
|
|
119
|
-
});
|
|
120
|
-
updateColumnsForGrid({
|
|
121
|
-
columns: updatedColumnDefs,
|
|
122
|
-
enableManageColumnsCallback: enableManageColumnsCallbackAPI,
|
|
123
139
|
});
|
|
140
|
+
console.log(changedColumns, "changedColumns - only visibility changes");
|
|
141
|
+
// Only call updateColumnsForGrid if there are actually changed columns
|
|
142
|
+
if (changedColumns.length > 0) {
|
|
143
|
+
updateColumnsForGrid({
|
|
144
|
+
columns: changedColumns,
|
|
145
|
+
enableManageColumnsCallback: enableManageColumnsCallbackAPI,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
124
148
|
};
|
|
125
149
|
// When drag started
|
|
126
150
|
const handleDragStart = (index) => (event) => {
|
|
@@ -35,6 +35,7 @@ const TableFilter = () => {
|
|
|
35
35
|
dataType: eachColumn.dataType,
|
|
36
36
|
columnType: eachColumn === null || eachColumn === void 0 ? void 0 : eachColumn.columnType,
|
|
37
37
|
options: eachColumn === null || eachColumn === void 0 ? void 0 : eachColumn.options,
|
|
38
|
+
fieldKey: eachColumn === null || eachColumn === void 0 ? void 0 : eachColumn.fieldKey,
|
|
38
39
|
attributeType: eachColumn.attributeType ? eachColumn.attributeType : 1,
|
|
39
40
|
}));
|
|
40
41
|
const defaultCondition = {
|
|
@@ -57,10 +58,24 @@ const TableFilter = () => {
|
|
|
57
58
|
};
|
|
58
59
|
return queryToAdd;
|
|
59
60
|
});
|
|
61
|
+
const requestFilters = allQueries.map((element) => {
|
|
62
|
+
var _a, _b, _c, _d, _e;
|
|
63
|
+
return ({
|
|
64
|
+
fieldName: (_b = (_a = element === null || element === void 0 ? void 0 : element.selectedColumn) === null || _a === void 0 ? void 0 : _a.code) === null || _b === void 0 ? void 0 : _b.code,
|
|
65
|
+
fieldValue: element === null || element === void 0 ? void 0 : element.value.toString(),
|
|
66
|
+
conditionalOperator: element === null || element === void 0 ? void 0 : element.selectedOperation,
|
|
67
|
+
logicalOperator: element.logicalOperator,
|
|
68
|
+
attributeType: ((_d = (_c = element === null || element === void 0 ? void 0 : element.selectedColumn) === null || _c === void 0 ? void 0 : _c.code) === null || _d === void 0 ? void 0 : _d.attributeType)
|
|
69
|
+
? (_e = element === null || element === void 0 ? void 0 : element.selectedColumn) === null || _e === void 0 ? void 0 : _e.code.attributeType
|
|
70
|
+
: 1,
|
|
71
|
+
});
|
|
72
|
+
});
|
|
60
73
|
setGlobalFilters(array);
|
|
61
74
|
const currentFeature = Object.assign({}, featureDetails);
|
|
62
75
|
currentFeature.filterQueries = allQueries;
|
|
63
|
-
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), {
|
|
76
|
+
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { filterQueries: allQueries }));
|
|
77
|
+
console.log("payload", requestFilters);
|
|
78
|
+
// setConditionsArray(requestFilters);
|
|
64
79
|
callGrid(currentFeature);
|
|
65
80
|
return [];
|
|
66
81
|
};
|
|
@@ -415,19 +415,6 @@ const accessBasedOnDataType = [
|
|
|
415
415
|
];
|
|
416
416
|
const defaultOptionValueColumn = { order: 1, labelName: "", value: "", upload: "", actions: "" };
|
|
417
417
|
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" }];
|
|
418
|
-
var GRID_CHECKBOX_STATUS;
|
|
419
|
-
(function (GRID_CHECKBOX_STATUS) {
|
|
420
|
-
GRID_CHECKBOX_STATUS[GRID_CHECKBOX_STATUS["NEUTRAL"] = 1] = "NEUTRAL";
|
|
421
|
-
GRID_CHECKBOX_STATUS[GRID_CHECKBOX_STATUS["CHECKED"] = 2] = "CHECKED";
|
|
422
|
-
GRID_CHECKBOX_STATUS[GRID_CHECKBOX_STATUS["UNCHECKED"] = 3] = "UNCHECKED";
|
|
423
|
-
})(GRID_CHECKBOX_STATUS = exports.GRID_CHECKBOX_STATUS || (exports.GRID_CHECKBOX_STATUS = {}));
|
|
424
|
-
const initialCheckBoxState = {
|
|
425
|
-
allBoxChecked: false,
|
|
426
|
-
isIndeterminate: false,
|
|
427
|
-
includedRecords: [],
|
|
428
|
-
excludedRecords: [],
|
|
429
|
-
headerCheckBoxStatus: GRID_CHECKBOX_STATUS.NEUTRAL,
|
|
430
|
-
};
|
|
431
418
|
const constants = {
|
|
432
419
|
maxCodeLength,
|
|
433
420
|
maxNameLength,
|
|
@@ -437,7 +424,12 @@ const constants = {
|
|
|
437
424
|
maxSortInputLength,
|
|
438
425
|
accessBasedOnDataType,
|
|
439
426
|
minSortInputLength,
|
|
440
|
-
initialCheckBoxState
|
|
441
427
|
};
|
|
428
|
+
var GRID_CHECKBOX_STATUS;
|
|
429
|
+
(function (GRID_CHECKBOX_STATUS) {
|
|
430
|
+
GRID_CHECKBOX_STATUS[GRID_CHECKBOX_STATUS["NEUTRAL"] = 1] = "NEUTRAL";
|
|
431
|
+
GRID_CHECKBOX_STATUS[GRID_CHECKBOX_STATUS["CHECKED"] = 2] = "CHECKED";
|
|
432
|
+
GRID_CHECKBOX_STATUS[GRID_CHECKBOX_STATUS["UNCHECKED"] = 3] = "UNCHECKED";
|
|
433
|
+
})(GRID_CHECKBOX_STATUS = exports.GRID_CHECKBOX_STATUS || (exports.GRID_CHECKBOX_STATUS = {}));
|
|
442
434
|
exports.EMPTY_RECORD = "--";
|
|
443
435
|
exports.default = constants;
|
|
@@ -4,7 +4,6 @@ exports.FeatureContext = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const helper_1 = require("./helper");
|
|
7
|
-
const hooks_1 = require("primereact/hooks");
|
|
8
7
|
exports.FeatureContext = (0, react_1.createContext)(null);
|
|
9
8
|
function MyProvider({ children, value }) {
|
|
10
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, rowModelType, quickSearch, enableAdvancedFilter, conditionsToDisplay, gridViewFun, gridViewData, setGridViewData, gridView } = value;
|
|
@@ -14,7 +13,6 @@ function MyProvider({ children, value }) {
|
|
|
14
13
|
const [sortBy, setSortBy] = (0, react_1.useState)({});
|
|
15
14
|
const [isOverlayOpened, setIsOverlayOpened] = (0, react_1.useState)(false);
|
|
16
15
|
const [viewName, setViewName] = (0, react_1.useState)("");
|
|
17
|
-
const [inputValue, deboucedValue, setInputValue] = (0, hooks_1.useDebounce)("", 500);
|
|
18
16
|
// States for filter
|
|
19
17
|
const [queries, setQueries] = (0, react_1.useState)(() => {
|
|
20
18
|
var _a;
|
|
@@ -44,7 +42,6 @@ function MyProvider({ children, value }) {
|
|
|
44
42
|
setSortBy({});
|
|
45
43
|
setSortValue({});
|
|
46
44
|
callGrid(emptyFeatures);
|
|
47
|
-
setInputValue("");
|
|
48
45
|
};
|
|
49
46
|
(0, react_1.useEffect)(() => {
|
|
50
47
|
if (defaultFilters.length) {
|
|
@@ -115,10 +112,7 @@ function MyProvider({ children, value }) {
|
|
|
115
112
|
gridViewFun,
|
|
116
113
|
gridViewData,
|
|
117
114
|
setGridViewData,
|
|
118
|
-
gridView
|
|
119
|
-
inputValue,
|
|
120
|
-
deboucedValue,
|
|
121
|
-
setInputValue
|
|
115
|
+
gridView
|
|
122
116
|
} }, { children: children })));
|
|
123
117
|
}
|
|
124
118
|
exports.default = MyProvider;
|
|
@@ -62,22 +62,21 @@ const sortColumns = (columns) => {
|
|
|
62
62
|
};
|
|
63
63
|
exports.sortColumns = sortColumns;
|
|
64
64
|
// Give checkbox checked status
|
|
65
|
-
const getCheckedStatus = (row, featureDetails, GRID_CHECKBOX_STATUS) => {
|
|
65
|
+
const getCheckedStatus = (row, featureDetails, GRID_CHECKBOX_STATUS, setFeatureDetails) => {
|
|
66
66
|
const { allBoxChecked, excludedRecords, includedRecords, headerCheckBoxStatus, } = featureDetails.checkBoxSelection;
|
|
67
|
-
const isExcluded = excludedRecords.some(r => r.id === row.id);
|
|
68
|
-
const isIncluded = includedRecords.some(r => r.id === row.id);
|
|
69
67
|
if (allBoxChecked) {
|
|
70
|
-
return !
|
|
68
|
+
return !excludedRecords.includes(row);
|
|
71
69
|
}
|
|
72
70
|
else {
|
|
73
71
|
if (headerCheckBoxStatus === GRID_CHECKBOX_STATUS.NEUTRAL &&
|
|
74
72
|
(row === null || row === void 0 ? void 0 : row.isSelected)) {
|
|
75
|
-
if (!
|
|
76
|
-
|
|
73
|
+
if (!includedRecords.includes(row)) {
|
|
74
|
+
includedRecords.push(row);
|
|
75
|
+
setFeatureDetails((prev) => (Object.assign(Object.assign({}, prev), { checkBoxSelection: Object.assign(Object.assign({}, prev.checkBoxSelection), { includedRecords: [...includedRecords] }) })));
|
|
77
76
|
}
|
|
78
77
|
return true;
|
|
79
78
|
}
|
|
80
|
-
return
|
|
79
|
+
return includedRecords.includes(row);
|
|
81
80
|
}
|
|
82
81
|
};
|
|
83
82
|
exports.getCheckedStatus = getCheckedStatus;
|
|
@@ -227,14 +226,14 @@ exports.autoGroupColumnDef = autoGroupColumnDef;
|
|
|
227
226
|
// This function determines how to update `includedRecords` and `excludedRecords`
|
|
228
227
|
// depending on whether all checkboxes are checked or not (`allBoxChecked` state)
|
|
229
228
|
const updateRecords = (rowData, featureDetails, gridData) => {
|
|
230
|
-
var _a, _b;
|
|
229
|
+
var _a, _b, _c;
|
|
231
230
|
const { excludedRecords, includedRecords, allBoxChecked } = featureDetails.checkBoxSelection;
|
|
232
231
|
let newExcludedRecords = [...excludedRecords];
|
|
233
232
|
let newIncludedRecords = [...includedRecords];
|
|
234
233
|
// When all checkboxes are checked
|
|
235
234
|
if (allBoxChecked) {
|
|
236
235
|
// Update excluded records: add or remove the current rowData
|
|
237
|
-
newExcludedRecords = (excludedRecords === null || excludedRecords === void 0 ? void 0 : excludedRecords.
|
|
236
|
+
newExcludedRecords = (excludedRecords === null || excludedRecords === void 0 ? void 0 : excludedRecords.includes(rowData))
|
|
238
237
|
? 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))
|
|
239
238
|
: [...excludedRecords, rowData];
|
|
240
239
|
// Check if all records are excluded; reset if so
|
|
@@ -249,7 +248,7 @@ const updateRecords = (rowData, featureDetails, gridData) => {
|
|
|
249
248
|
// When not all checkboxes are checked
|
|
250
249
|
else {
|
|
251
250
|
// Update included records: add or remove the current rowData
|
|
252
|
-
newIncludedRecords = (includedRecords === null || includedRecords === void 0 ? void 0 : includedRecords.
|
|
251
|
+
newIncludedRecords = (includedRecords === null || includedRecords === void 0 ? void 0 : includedRecords.includes(rowData))
|
|
253
252
|
? includedRecords === null || includedRecords === void 0 ? void 0 : includedRecords.filter((item) => {
|
|
254
253
|
if ((item === null || item === void 0 ? void 0 : item.id) !== (rowData === null || rowData === void 0 ? void 0 : rowData.id)) {
|
|
255
254
|
return item;
|
|
@@ -259,27 +258,23 @@ const updateRecords = (rowData, featureDetails, gridData) => {
|
|
|
259
258
|
return false; // Exclude this item from the new array
|
|
260
259
|
}
|
|
261
260
|
})
|
|
262
|
-
:
|
|
263
|
-
newExcludedRecords = (excludedRecords === null || excludedRecords === void 0 ? void 0 : excludedRecords.some((x) => (x === null || x === void 0 ? void 0 : x.id) === (rowData === null || rowData === void 0 ? void 0 : rowData.id)))
|
|
264
|
-
? 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))
|
|
265
|
-
: (rowData === null || rowData === void 0 ? void 0 : rowData.isSelected) ? [...excludedRecords, rowData] : excludedRecords;
|
|
261
|
+
: [...includedRecords, rowData]; // Add rowData if it's not already included
|
|
266
262
|
// Check if all records are included; reset if so
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
// }
|
|
263
|
+
if ((newIncludedRecords === null || newIncludedRecords === void 0 ? void 0 : newIncludedRecords.length) === ((_b = gridData === null || gridData === void 0 ? void 0 : gridData.rowData) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
264
|
+
return {
|
|
265
|
+
excludedRecords: [],
|
|
266
|
+
includedRecords: [],
|
|
267
|
+
isIndeterminate: false,
|
|
268
|
+
allBoxChecked: true,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
276
271
|
// Check if all records are excluded; reset if so
|
|
277
|
-
if ((newExcludedRecords === null || newExcludedRecords === void 0 ? void 0 : newExcludedRecords.length) === ((
|
|
272
|
+
else if ((newExcludedRecords === null || newExcludedRecords === void 0 ? void 0 : newExcludedRecords.length) === ((_c = gridData === null || gridData === void 0 ? void 0 : gridData.rowData) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
278
273
|
return exports.initialCheckBoxData;
|
|
279
274
|
}
|
|
280
275
|
// Otherwise, update the included records
|
|
281
276
|
else {
|
|
282
|
-
return Object.assign(Object.assign({}, featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.checkBoxSelection), { includedRecords: newIncludedRecords
|
|
277
|
+
return Object.assign(Object.assign({}, featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.checkBoxSelection), { includedRecords: newIncludedRecords });
|
|
283
278
|
}
|
|
284
279
|
}
|
|
285
280
|
};
|
|
@@ -110,17 +110,13 @@ function ParentForGrid(props) {
|
|
|
110
110
|
? true
|
|
111
111
|
: false), shouldRenderOnRight: (_h = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _h === void 0 ? void 0 : _h.displayCheckboxOnRight }), HeaderComponent ? ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "px-3" }, { children: [" ", (0, jsx_runtime_1.jsx)(HeaderComponent, {}), " "] }))) : ((0, jsx_runtime_1.jsx)("span", { children: headerDisplayName }))] })) })));
|
|
112
112
|
};
|
|
113
|
-
const onRowClickSelection = (data) => {
|
|
114
|
-
(0, helper_1.handleCheckboxClick)({ checked: true }, data, featureDetails, gridData, setFeatureDetails, groupingColumns, setSelectedGroup, selectColumns);
|
|
115
|
-
};
|
|
116
113
|
// JSX for rendering checkbox in cells
|
|
117
114
|
const cellCheckBoxRenderer = (params) => {
|
|
118
|
-
var _a, _b
|
|
115
|
+
var _a, _b;
|
|
119
116
|
const { data } = params;
|
|
120
117
|
// const { allBoxChecked, excludedRecords, includedRecords } = featureDetails.checkBoxSelection;
|
|
121
|
-
const isChecked = (0, helper_1.getCheckedStatus)(data, featureDetails, constants_1.GRID_CHECKBOX_STATUS);
|
|
122
|
-
|
|
123
|
-
return ((0, jsx_runtime_1.jsx)(grid_checkbox_1.default, { checked: ((_b = params === null || params === void 0 ? void 0 : params.data) === null || _b === void 0 ? void 0 : _b.tagged) || isChecked, disabled: ((_c = params === null || params === void 0 ? void 0 : params.data) === null || _c === void 0 ? void 0 : _c.tagged) || false, onChange: (e) => (0, helper_1.handleCheckboxClick)(e, params, featureDetails, gridData, setFeatureDetails, groupingColumns, setSelectedGroup, selectColumns), isIndeterminate: false, shouldRenderOnRight: (_d = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _d === void 0 ? void 0 : _d.displayCheckboxOnRight }));
|
|
118
|
+
const isChecked = (0, helper_1.getCheckedStatus)(data, featureDetails, constants_1.GRID_CHECKBOX_STATUS, setFeatureDetails);
|
|
119
|
+
return ((0, jsx_runtime_1.jsx)(grid_checkbox_1.default, { checked: isChecked, disabled: ((_a = params === null || params === void 0 ? void 0 : params.data) === null || _a === void 0 ? void 0 : _a.tagged) || false, onChange: (e) => (0, helper_1.handleCheckboxClick)(e, params, featureDetails, gridData, setFeatureDetails, groupingColumns, setSelectedGroup, selectColumns), isIndeterminate: false, shouldRenderOnRight: (_b = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _b === void 0 ? void 0 : _b.displayCheckboxOnRight }));
|
|
124
120
|
};
|
|
125
121
|
// Callback to products for getting data
|
|
126
122
|
const getData = (startRow, endRow, currentFeatures, params) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -352,7 +348,7 @@ function ParentForGrid(props) {
|
|
|
352
348
|
setGridViewData(Object.assign(Object.assign({}, gridViewData), { rowData: allData }));
|
|
353
349
|
};
|
|
354
350
|
// Options that grid should have
|
|
355
|
-
const gridOptions = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(
|
|
351
|
+
const gridOptions = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ columnDefs: (_f = gridData === null || gridData === void 0 ? void 0 : gridData.columnData) === null || _f === void 0 ? void 0 : _f.map((column) => {
|
|
356
352
|
var _a, _b;
|
|
357
353
|
if ((column === null || column === void 0 ? void 0 : column.enableChildCheckbox) && (column === null || column === void 0 ? void 0 : column.enableHeaderCheckbox)) {
|
|
358
354
|
return Object.assign(Object.assign({}, column), { headerComponent: (params) => headerCheckBoxRenderer(params === null || params === void 0 ? void 0 : params.displayName, (column === null || column === void 0 ? void 0 : column.headerComponent) && ""), cellRenderer: (params) => (0, utilComponents_1.dataCellRenderer)(params, column, props), cellRendererParams: {
|
|
@@ -371,7 +367,7 @@ function ParentForGrid(props) {
|
|
|
371
367
|
dataTypeDefinitions: props === null || props === void 0 ? void 0 : props.dataTypeDefinitions,
|
|
372
368
|
})), { popupParent: popupParent }), ((props === null || props === void 0 ? void 0 : props.treeData) && { treeData: props === null || props === void 0 ? void 0 : props.treeData })), ((props === null || props === void 0 ? void 0 : props.groupDefaultExpanded) && {
|
|
373
369
|
groupDefaultExpanded: props === null || props === void 0 ? void 0 : props.groupDefaultExpanded, // to enable tree data
|
|
374
|
-
})), ((props === null || props === void 0 ? void 0 : props.onRowClicked) ? { onRowClicked: props === null || props === void 0 ? void 0 : props.onRowClicked } : {})), ((props === null || props === void 0 ? void 0 : props.
|
|
370
|
+
})), ((props === null || props === void 0 ? void 0 : props.onRowClicked) ? { onRowClicked: props === null || props === void 0 ? void 0 : props.onRowClicked } : {})), ((props === null || props === void 0 ? void 0 : props.quickSearch) ? { quickSearch: props.quickSearch } : {})), {
|
|
375
371
|
// ...(props?.getDataPath && { getDataPath: props?.getDataPath }), // for clint side tree data enable fetuare
|
|
376
372
|
onGridPreDestroyed: onGridPreDestroyed }), ((props === null || props === void 0 ? void 0 : props.rowDragManaged) ? { rowDragManaged: props === null || props === void 0 ? void 0 : props.rowDragManaged } : {})), gridProps);
|
|
377
373
|
// Fucntion to call the grid
|
|
@@ -14,9 +14,7 @@ const ListBoxDropdown = (props) => {
|
|
|
14
14
|
const boxRef = (0, react_1.useRef)();
|
|
15
15
|
const { selectAll,
|
|
16
16
|
// onSelectAll,
|
|
17
|
-
onSelectionChange, onChange, footeTemplate, headerTemplate, labelIcon, labelIconPos, label, labelIconSize, listItems, filter, multiple, filterPlaceholder, optionLabel, listClassName, menuClassName, listBoxParentClassName, listBoxclassName, optionTemplate, values, link, className,
|
|
18
|
-
// scrollElementId,
|
|
19
|
-
optionsMenuRef = boxRef,
|
|
17
|
+
onSelectionChange, onChange, footeTemplate, headerTemplate, labelIcon, labelIconPos, label, labelIconSize, listItems, filter, multiple, filterPlaceholder, optionLabel, listClassName, menuClassName, listBoxParentClassName, listBoxclassName, optionTemplate, values, link, className, scrollElementId, optionsMenuRef = boxRef,
|
|
20
18
|
// buttonClassName,
|
|
21
19
|
showChips, chipTemplate, chipClassName, chipsParentClassName, showRemoveIcon, removeIconSize, removeIconClassName, onRemoveItem, isDraggable, onDranghandle, onShow, onHide, onFocus, confirmationOption, selectedOptionNone, type, emptyFilterMessage, emptyMessage, dataLabel, onFilterValueChange, virtualScrollerOptions, virtualScroll, fetchData, } = props;
|
|
22
20
|
const [selectedItems, setSelectedItems] = (0, react_1.useState)([]);
|
|
@@ -46,26 +44,25 @@ const ListBoxDropdown = (props) => {
|
|
|
46
44
|
// if (elm) elm.addEventListener("scroll", handleScroll);
|
|
47
45
|
// }
|
|
48
46
|
// }, []);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
// }, [scrollElementId, optionsMenuRef]);
|
|
47
|
+
(0, react_1.useEffect)(() => {
|
|
48
|
+
const scrollContainer = scrollElementId
|
|
49
|
+
? document.getElementById(scrollElementId)
|
|
50
|
+
: null;
|
|
51
|
+
const handleScroll = (e) => {
|
|
52
|
+
var _a, _b;
|
|
53
|
+
const target = e.target;
|
|
54
|
+
// Prevent hiding if scroll is within dropdown or trigger button
|
|
55
|
+
if (target.closest(".p-menu, .list_box_btn"))
|
|
56
|
+
return;
|
|
57
|
+
(_b = (_a = optionsMenuRef === null || optionsMenuRef === void 0 ? void 0 : optionsMenuRef.current) === null || _a === void 0 ? void 0 : _a.hide) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
58
|
+
};
|
|
59
|
+
scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.addEventListener("scroll", handleScroll);
|
|
60
|
+
window.addEventListener("scroll", handleScroll, true);
|
|
61
|
+
return () => {
|
|
62
|
+
scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.removeEventListener("scroll", handleScroll);
|
|
63
|
+
window.removeEventListener("scroll", handleScroll, true);
|
|
64
|
+
};
|
|
65
|
+
}, [scrollElementId, optionsMenuRef]);
|
|
69
66
|
const handleDragStart = (e, index) => {
|
|
70
67
|
e.dataTransfer.setData("text/plain", index);
|
|
71
68
|
};
|
|
@@ -18,12 +18,12 @@ declare enum DEFAULTS {
|
|
|
18
18
|
TIMEFORMAT = 7,
|
|
19
19
|
TIMEZONE = 8
|
|
20
20
|
}
|
|
21
|
+
declare const constants: any;
|
|
21
22
|
export declare enum GRID_CHECKBOX_STATUS {
|
|
22
23
|
NEUTRAL = 1,
|
|
23
24
|
CHECKED = 2,
|
|
24
25
|
UNCHECKED = 3
|
|
25
26
|
}
|
|
26
|
-
declare const constants: any;
|
|
27
27
|
export declare const EMPTY_RECORD = "--";
|
|
28
28
|
export { DEFAULTS };
|
|
29
29
|
export default constants;
|
|
@@ -5,7 +5,7 @@ export declare const isComponentDisable: (state?: string) => boolean;
|
|
|
5
5
|
export declare const applyDefaultFilters: (defaultFilters: any) => any;
|
|
6
6
|
export declare const parseIfNeeded: (value: any) => any;
|
|
7
7
|
export declare const sortColumns: (columns: any) => any;
|
|
8
|
-
export declare const getCheckedStatus: (row: any, featureDetails: any, GRID_CHECKBOX_STATUS: any) => any;
|
|
8
|
+
export declare const getCheckedStatus: (row: any, featureDetails: any, GRID_CHECKBOX_STATUS: any, setFeatureDetails: any) => any;
|
|
9
9
|
export declare const updateCells: (updatedRowData: any, setUpdateRowData: any, api: any) => void;
|
|
10
10
|
export declare const fillOperation: (params: any, api: any, editedRecords: any, setEditedRecords: any) => Promise<void>;
|
|
11
11
|
export declare const autoGroupColumnDef: (isTreeEnable: boolean, headerName: string, groupField: string, GroupHeaderComponent: React.FC, headerCheckboxRenderer: React.FC, enableCheckboxForGroupHeader: boolean, displayGroupCount: boolean, rowGroupColumnWidth: number, ChildRendererForGroup?: React.FC, HeaderRendererForGroup?: React.FC) => {
|