sccoreui 6.4.47 → 6.4.49
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/components/ag-grid/advancedFeature/custom-sort.js +3 -2
- package/dist/components/ag-grid/advancedFeature/global-search.js +3 -5
- package/dist/components/ag-grid/advancedFeature/new-filter/table-filter.js +1 -15
- package/dist/components/ag-grid/constants.js +14 -6
- package/dist/components/ag-grid/context-provider.js +7 -1
- package/dist/components/ag-grid/helper.js +25 -20
- package/dist/components/ag-grid/parent-for-grid.js +9 -5
- package/dist/components/list-box-dropdown/list-box-dropdown.js +23 -22
- 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
|
@@ -12,6 +12,7 @@ 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"));
|
|
15
16
|
function Sort() {
|
|
16
17
|
var _a, _b;
|
|
17
18
|
const { sortValue, setSortValue, sortBy, setSortBy, isOverlayOpened, setIsOverlayOpened, featureDetails, callGrid, columnData, sortModelText, sortOptions, conditionsToDisplay, } = (0, react_1.useContext)(context_provider_1.FeatureContext);
|
|
@@ -57,7 +58,7 @@ function Sort() {
|
|
|
57
58
|
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))) {
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
60
|
-
const currentFeature = Object.assign({}, featureDetails);
|
|
61
|
+
const currentFeature = Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: constants_1.default.initialCheckBoxState });
|
|
61
62
|
currentFeature.sort = sortInfo;
|
|
62
63
|
return currentFeature;
|
|
63
64
|
};
|
|
@@ -78,7 +79,7 @@ function Sort() {
|
|
|
78
79
|
columnToSort: "",
|
|
79
80
|
orderToSort: "",
|
|
80
81
|
};
|
|
81
|
-
const currentFeatureDetails = Object.assign({}, featureDetails);
|
|
82
|
+
const currentFeatureDetails = Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: constants_1.default.initialCheckBoxState });
|
|
82
83
|
currentFeatureDetails.sort = sortDetails;
|
|
83
84
|
callGrid(currentFeatureDetails);
|
|
84
85
|
};
|
|
@@ -6,14 +6,12 @@ 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
|
|
10
|
-
const constants_1 = require("../constants");
|
|
9
|
+
const constants_1 = tslib_1.__importStar(require("../constants"));
|
|
11
10
|
const helper_1 = require("../helper");
|
|
12
11
|
const utilComponents_1 = require("../utilComponents");
|
|
13
12
|
const skeleton_1 = require("primereact/skeleton");
|
|
14
13
|
function Search({ searchPlaceHolder }) {
|
|
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);
|
|
14
|
+
const { featureDetails, setFeatureDetails, rowModelType, gridApi, quickSearch, conditionsToDisplay, setGridViewData, gridView, inputValue, deboucedValue, setInputValue } = (0, react_1.useContext)(context_provider_1.FeatureContext);
|
|
17
15
|
const isDisabled = (0, helper_1.isComponentDisable)(conditionsToDisplay.displaySearch);
|
|
18
16
|
(0, react_1.useEffect)(() => {
|
|
19
17
|
var _a, _b, _c;
|
|
@@ -33,7 +31,7 @@ function Search({ searchPlaceHolder }) {
|
|
|
33
31
|
}
|
|
34
32
|
}
|
|
35
33
|
else {
|
|
36
|
-
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { searchedText: deboucedValue }));
|
|
34
|
+
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: constants_1.default.initialCheckBoxState, searchedText: deboucedValue }));
|
|
37
35
|
}
|
|
38
36
|
}, [deboucedValue]);
|
|
39
37
|
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: () => {
|
|
@@ -57,24 +57,10 @@ const TableFilter = () => {
|
|
|
57
57
|
};
|
|
58
58
|
return queryToAdd;
|
|
59
59
|
});
|
|
60
|
-
const requestFilters = allQueries.map((element) => {
|
|
61
|
-
var _a, _b, _c, _d, _e;
|
|
62
|
-
return ({
|
|
63
|
-
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,
|
|
64
|
-
fieldValue: element === null || element === void 0 ? void 0 : element.value.toString(),
|
|
65
|
-
conditionalOperator: element === null || element === void 0 ? void 0 : element.selectedOperation,
|
|
66
|
-
logicalOperator: element.logicalOperator,
|
|
67
|
-
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)
|
|
68
|
-
? (_e = element === null || element === void 0 ? void 0 : element.selectedColumn) === null || _e === void 0 ? void 0 : _e.code.attributeType
|
|
69
|
-
: 1,
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
60
|
setGlobalFilters(array);
|
|
73
61
|
const currentFeature = Object.assign({}, featureDetails);
|
|
74
62
|
currentFeature.filterQueries = allQueries;
|
|
75
|
-
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { filterQueries: allQueries }));
|
|
76
|
-
console.log("payload", requestFilters);
|
|
77
|
-
// setConditionsArray(requestFilters);
|
|
63
|
+
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { checkBoxSelection: constants_1.default.initialCheckBoxState, filterQueries: allQueries }));
|
|
78
64
|
callGrid(currentFeature);
|
|
79
65
|
return [];
|
|
80
66
|
};
|
|
@@ -415,6 +415,19 @@ 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
|
+
};
|
|
418
431
|
const constants = {
|
|
419
432
|
maxCodeLength,
|
|
420
433
|
maxNameLength,
|
|
@@ -424,12 +437,7 @@ const constants = {
|
|
|
424
437
|
maxSortInputLength,
|
|
425
438
|
accessBasedOnDataType,
|
|
426
439
|
minSortInputLength,
|
|
440
|
+
initialCheckBoxState
|
|
427
441
|
};
|
|
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 = {}));
|
|
434
442
|
exports.EMPTY_RECORD = "--";
|
|
435
443
|
exports.default = constants;
|
|
@@ -4,6 +4,7 @@ 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");
|
|
7
8
|
exports.FeatureContext = (0, react_1.createContext)(null);
|
|
8
9
|
function MyProvider({ children, value }) {
|
|
9
10
|
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;
|
|
@@ -13,6 +14,7 @@ function MyProvider({ children, value }) {
|
|
|
13
14
|
const [sortBy, setSortBy] = (0, react_1.useState)({});
|
|
14
15
|
const [isOverlayOpened, setIsOverlayOpened] = (0, react_1.useState)(false);
|
|
15
16
|
const [viewName, setViewName] = (0, react_1.useState)("");
|
|
17
|
+
const [inputValue, deboucedValue, setInputValue] = (0, hooks_1.useDebounce)("", 500);
|
|
16
18
|
// States for filter
|
|
17
19
|
const [queries, setQueries] = (0, react_1.useState)(() => {
|
|
18
20
|
var _a;
|
|
@@ -42,6 +44,7 @@ function MyProvider({ children, value }) {
|
|
|
42
44
|
setSortBy({});
|
|
43
45
|
setSortValue({});
|
|
44
46
|
callGrid(emptyFeatures);
|
|
47
|
+
setInputValue("");
|
|
45
48
|
};
|
|
46
49
|
(0, react_1.useEffect)(() => {
|
|
47
50
|
if (defaultFilters.length) {
|
|
@@ -112,7 +115,10 @@ function MyProvider({ children, value }) {
|
|
|
112
115
|
gridViewFun,
|
|
113
116
|
gridViewData,
|
|
114
117
|
setGridViewData,
|
|
115
|
-
gridView
|
|
118
|
+
gridView,
|
|
119
|
+
inputValue,
|
|
120
|
+
deboucedValue,
|
|
121
|
+
setInputValue
|
|
116
122
|
} }, { children: children })));
|
|
117
123
|
}
|
|
118
124
|
exports.default = MyProvider;
|
|
@@ -62,21 +62,22 @@ 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) => {
|
|
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);
|
|
67
69
|
if (allBoxChecked) {
|
|
68
|
-
return !
|
|
70
|
+
return !isExcluded;
|
|
69
71
|
}
|
|
70
72
|
else {
|
|
71
73
|
if (headerCheckBoxStatus === GRID_CHECKBOX_STATUS.NEUTRAL &&
|
|
72
74
|
(row === null || row === void 0 ? void 0 : row.isSelected)) {
|
|
73
|
-
if (!
|
|
74
|
-
|
|
75
|
-
setFeatureDetails((prev) => (Object.assign(Object.assign({}, prev), { checkBoxSelection: Object.assign(Object.assign({}, prev.checkBoxSelection), { includedRecords: [...includedRecords] }) })));
|
|
75
|
+
if (!isIncluded) {
|
|
76
|
+
return !isExcluded;
|
|
76
77
|
}
|
|
77
78
|
return true;
|
|
78
79
|
}
|
|
79
|
-
return
|
|
80
|
+
return isExcluded ? false : isIncluded;
|
|
80
81
|
}
|
|
81
82
|
};
|
|
82
83
|
exports.getCheckedStatus = getCheckedStatus;
|
|
@@ -226,14 +227,14 @@ exports.autoGroupColumnDef = autoGroupColumnDef;
|
|
|
226
227
|
// This function determines how to update `includedRecords` and `excludedRecords`
|
|
227
228
|
// depending on whether all checkboxes are checked or not (`allBoxChecked` state)
|
|
228
229
|
const updateRecords = (rowData, featureDetails, gridData) => {
|
|
229
|
-
var _a, _b
|
|
230
|
+
var _a, _b;
|
|
230
231
|
const { excludedRecords, includedRecords, allBoxChecked } = featureDetails.checkBoxSelection;
|
|
231
232
|
let newExcludedRecords = [...excludedRecords];
|
|
232
233
|
let newIncludedRecords = [...includedRecords];
|
|
233
234
|
// When all checkboxes are checked
|
|
234
235
|
if (allBoxChecked) {
|
|
235
236
|
// Update excluded records: add or remove the current rowData
|
|
236
|
-
newExcludedRecords = (excludedRecords === null || excludedRecords === void 0 ? void 0 : excludedRecords.
|
|
237
|
+
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)))
|
|
237
238
|
? 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))
|
|
238
239
|
: [...excludedRecords, rowData];
|
|
239
240
|
// Check if all records are excluded; reset if so
|
|
@@ -248,7 +249,7 @@ const updateRecords = (rowData, featureDetails, gridData) => {
|
|
|
248
249
|
// When not all checkboxes are checked
|
|
249
250
|
else {
|
|
250
251
|
// Update included records: add or remove the current rowData
|
|
251
|
-
newIncludedRecords = (includedRecords === null || includedRecords === void 0 ? void 0 : includedRecords.
|
|
252
|
+
newIncludedRecords = (includedRecords === null || includedRecords === void 0 ? void 0 : includedRecords.some((x) => (x === null || x === void 0 ? void 0 : x.id) === (rowData === null || rowData === void 0 ? void 0 : rowData.id)))
|
|
252
253
|
? includedRecords === null || includedRecords === void 0 ? void 0 : includedRecords.filter((item) => {
|
|
253
254
|
if ((item === null || item === void 0 ? void 0 : item.id) !== (rowData === null || rowData === void 0 ? void 0 : rowData.id)) {
|
|
254
255
|
return item;
|
|
@@ -258,23 +259,27 @@ const updateRecords = (rowData, featureDetails, gridData) => {
|
|
|
258
259
|
return false; // Exclude this item from the new array
|
|
259
260
|
}
|
|
260
261
|
})
|
|
261
|
-
: [...includedRecords, rowData]; // Add rowData if it's not already included
|
|
262
|
+
: (rowData === null || rowData === void 0 ? void 0 : rowData.isSelected) ? [...includedRecords] : [...includedRecords, rowData]; // Add rowData if it's not already included
|
|
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;
|
|
262
266
|
// Check if all records are included; reset if so
|
|
263
|
-
if (
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
}
|
|
267
|
+
// if (newIncludedRecords?.length === gridData?.rowData?.length) {
|
|
268
|
+
// return {
|
|
269
|
+
// ...featureDetails?.checkBoxSelection,
|
|
270
|
+
// excludedRecords: [],
|
|
271
|
+
// includedRecords: [],
|
|
272
|
+
// isIndeterminate: false,
|
|
273
|
+
// allBoxChecked: true,
|
|
274
|
+
// };
|
|
275
|
+
// }
|
|
271
276
|
// Check if all records are excluded; reset if so
|
|
272
|
-
|
|
277
|
+
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)) {
|
|
273
278
|
return exports.initialCheckBoxData;
|
|
274
279
|
}
|
|
275
280
|
// Otherwise, update the included records
|
|
276
281
|
else {
|
|
277
|
-
return Object.assign(Object.assign({}, featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.checkBoxSelection), { includedRecords: newIncludedRecords });
|
|
282
|
+
return Object.assign(Object.assign({}, featureDetails === null || featureDetails === void 0 ? void 0 : featureDetails.checkBoxSelection), { includedRecords: newIncludedRecords, excludedRecords: newExcludedRecords });
|
|
278
283
|
}
|
|
279
284
|
}
|
|
280
285
|
};
|
|
@@ -110,13 +110,17 @@ 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
|
+
};
|
|
113
116
|
// JSX for rendering checkbox in cells
|
|
114
117
|
const cellCheckBoxRenderer = (params) => {
|
|
115
|
-
var _a, _b;
|
|
118
|
+
var _a, _b, _c, _d;
|
|
116
119
|
const { data } = params;
|
|
117
120
|
// const { allBoxChecked, excludedRecords, includedRecords } = featureDetails.checkBoxSelection;
|
|
118
|
-
const isChecked = (0, helper_1.getCheckedStatus)(data, featureDetails, constants_1.GRID_CHECKBOX_STATUS
|
|
119
|
-
|
|
121
|
+
const isChecked = (0, helper_1.getCheckedStatus)(data, featureDetails, constants_1.GRID_CHECKBOX_STATUS);
|
|
122
|
+
console.log(featureDetails, (_a = params === null || params === void 0 ? void 0 : params.data) === null || _a === void 0 ? void 0 : _a.tagged, "check-data");
|
|
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 }));
|
|
120
124
|
};
|
|
121
125
|
// Callback to products for getting data
|
|
122
126
|
const getData = (startRow, endRow, currentFeatures, params) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -348,7 +352,7 @@ function ParentForGrid(props) {
|
|
|
348
352
|
setGridViewData(Object.assign(Object.assign({}, gridViewData), { rowData: allData }));
|
|
349
353
|
};
|
|
350
354
|
// Options that grid should have
|
|
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) => {
|
|
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(Object.assign({ columnDefs: (_f = gridData === null || gridData === void 0 ? void 0 : gridData.columnData) === null || _f === void 0 ? void 0 : _f.map((column) => {
|
|
352
356
|
var _a, _b;
|
|
353
357
|
if ((column === null || column === void 0 ? void 0 : column.enableChildCheckbox) && (column === null || column === void 0 ? void 0 : column.enableHeaderCheckbox)) {
|
|
354
358
|
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: {
|
|
@@ -367,7 +371,7 @@ function ParentForGrid(props) {
|
|
|
367
371
|
dataTypeDefinitions: props === null || props === void 0 ? void 0 : props.dataTypeDefinitions,
|
|
368
372
|
})), { 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) && {
|
|
369
373
|
groupDefaultExpanded: props === null || props === void 0 ? void 0 : props.groupDefaultExpanded, // to enable tree data
|
|
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 } : {})), {
|
|
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.onRowSelection) ? { onRowClicked: onRowClickSelection } : {})), ((props === null || props === void 0 ? void 0 : props.quickSearch) ? { quickSearch: props.quickSearch } : {})), {
|
|
371
375
|
// ...(props?.getDataPath && { getDataPath: props?.getDataPath }), // for clint side tree data enable fetuare
|
|
372
376
|
onGridPreDestroyed: onGridPreDestroyed }), ((props === null || props === void 0 ? void 0 : props.rowDragManaged) ? { rowDragManaged: props === null || props === void 0 ? void 0 : props.rowDragManaged } : {})), gridProps);
|
|
373
377
|
// Fucntion to call the grid
|
|
@@ -14,7 +14,9 @@ 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,
|
|
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,
|
|
18
20
|
// buttonClassName,
|
|
19
21
|
showChips, chipTemplate, chipClassName, chipsParentClassName, showRemoveIcon, removeIconSize, removeIconClassName, onRemoveItem, isDraggable, onDranghandle, onShow, onHide, onFocus, confirmationOption, selectedOptionNone, type, emptyFilterMessage, emptyMessage, dataLabel, onFilterValueChange, virtualScrollerOptions, virtualScroll, fetchData, } = props;
|
|
20
22
|
const [selectedItems, setSelectedItems] = (0, react_1.useState)([]);
|
|
@@ -44,27 +46,26 @@ const ListBoxDropdown = (props) => {
|
|
|
44
46
|
// if (elm) elm.addEventListener("scroll", handleScroll);
|
|
45
47
|
// }
|
|
46
48
|
// }, []);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}, [scrollElementId, optionsMenuRef]);
|
|
49
|
+
// useEffect(() => {
|
|
50
|
+
// const scrollContainer = scrollElementId
|
|
51
|
+
// ? document.getElementById(scrollElementId)
|
|
52
|
+
// : null;
|
|
53
|
+
// const handleScroll = (e: any) => {
|
|
54
|
+
// const target = e.target as HTMLElement;
|
|
55
|
+
// // Check if the scroll came from inside the dropdown menu (list box)
|
|
56
|
+
// const isInternalListboxScroll = target.closest(".p-listbox-list-wrapper");
|
|
57
|
+
// // Only hide if it's not a scroll from the dropdown list itself
|
|
58
|
+
// if (!isInternalListboxScroll && optionsMenuRef?.current?.hide) {
|
|
59
|
+
// optionsMenuRef.current.hide(e);
|
|
60
|
+
// }
|
|
61
|
+
// };
|
|
62
|
+
// scrollContainer?.addEventListener("scroll", handleScroll);
|
|
63
|
+
// window.addEventListener("scroll", handleScroll, true);
|
|
64
|
+
// return () => {
|
|
65
|
+
// scrollContainer?.removeEventListener("scroll", handleScroll);
|
|
66
|
+
// window.removeEventListener("scroll", handleScroll, true);
|
|
67
|
+
// };
|
|
68
|
+
// }, [scrollElementId, optionsMenuRef]);
|
|
68
69
|
const handleDragStart = (e, index) => {
|
|
69
70
|
e.dataTransfer.setData("text/plain", index);
|
|
70
71
|
};
|
|
@@ -18,12 +18,12 @@ declare enum DEFAULTS {
|
|
|
18
18
|
TIMEFORMAT = 7,
|
|
19
19
|
TIMEZONE = 8
|
|
20
20
|
}
|
|
21
|
-
declare const constants: any;
|
|
22
21
|
export declare enum GRID_CHECKBOX_STATUS {
|
|
23
22
|
NEUTRAL = 1,
|
|
24
23
|
CHECKED = 2,
|
|
25
24
|
UNCHECKED = 3
|
|
26
25
|
}
|
|
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
|
|
8
|
+
export declare const getCheckedStatus: (row: any, featureDetails: any, GRID_CHECKBOX_STATUS: 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) => {
|