sccoreui 6.4.45 → 6.4.47
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.js +1 -0
- 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/new-filter/table-filter.js +15 -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 -19
- package/dist/components/list-box-dropdown/list-box-dropdown.js +22 -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.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
4
|
require("./App.scss");
|
|
5
|
+
// import FroalaTextEditor from "./components/froala-editor/FroalaEditor";
|
|
5
6
|
// import Home from "./pages/home";
|
|
6
7
|
const App = () => {
|
|
7
8
|
return (0, jsx_runtime_1.jsx)("div", { className: "m-6" });
|
|
@@ -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: () => {
|
|
@@ -57,10 +57,24 @@ 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
|
+
});
|
|
60
72
|
setGlobalFilters(array);
|
|
61
73
|
const currentFeature = Object.assign({}, featureDetails);
|
|
62
74
|
currentFeature.filterQueries = allQueries;
|
|
63
|
-
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), {
|
|
75
|
+
setFeatureDetails(Object.assign(Object.assign({}, featureDetails), { filterQueries: allQueries }));
|
|
76
|
+
console.log("payload", requestFilters);
|
|
77
|
+
// setConditionsArray(requestFilters);
|
|
64
78
|
callGrid(currentFeature);
|
|
65
79
|
return [];
|
|
66
80
|
};
|
|
@@ -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,27 +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
|
-
console.log(data, "data-check");
|
|
115
|
-
// handleCheckboxClick(
|
|
116
|
-
// { checked: true },
|
|
117
|
-
// data,
|
|
118
|
-
// featureDetails,
|
|
119
|
-
// gridData,
|
|
120
|
-
// setFeatureDetails,
|
|
121
|
-
// groupingColumns,
|
|
122
|
-
// setSelectedGroup,
|
|
123
|
-
// selectColumns
|
|
124
|
-
// )
|
|
125
|
-
};
|
|
126
113
|
// JSX for rendering checkbox in cells
|
|
127
114
|
const cellCheckBoxRenderer = (params) => {
|
|
128
|
-
var _a, _b
|
|
115
|
+
var _a, _b;
|
|
129
116
|
const { data } = params;
|
|
130
117
|
// const { allBoxChecked, excludedRecords, includedRecords } = featureDetails.checkBoxSelection;
|
|
131
|
-
const isChecked = (0, helper_1.getCheckedStatus)(data, featureDetails, constants_1.GRID_CHECKBOX_STATUS);
|
|
132
|
-
|
|
133
|
-
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 }));
|
|
134
120
|
};
|
|
135
121
|
// Callback to products for getting data
|
|
136
122
|
const getData = (startRow, endRow, currentFeatures, params) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -362,7 +348,7 @@ function ParentForGrid(props) {
|
|
|
362
348
|
setGridViewData(Object.assign(Object.assign({}, gridViewData), { rowData: allData }));
|
|
363
349
|
};
|
|
364
350
|
// Options that grid should have
|
|
365
|
-
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) => {
|
|
366
352
|
var _a, _b;
|
|
367
353
|
if ((column === null || column === void 0 ? void 0 : column.enableChildCheckbox) && (column === null || column === void 0 ? void 0 : column.enableHeaderCheckbox)) {
|
|
368
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: {
|
|
@@ -381,7 +367,7 @@ function ParentForGrid(props) {
|
|
|
381
367
|
dataTypeDefinitions: props === null || props === void 0 ? void 0 : props.dataTypeDefinitions,
|
|
382
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) && {
|
|
383
369
|
groupDefaultExpanded: props === null || props === void 0 ? void 0 : props.groupDefaultExpanded, // to enable tree data
|
|
384
|
-
})), ((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 } : {})), {
|
|
385
371
|
// ...(props?.getDataPath && { getDataPath: props?.getDataPath }), // for clint side tree data enable fetuare
|
|
386
372
|
onGridPreDestroyed: onGridPreDestroyed }), ((props === null || props === void 0 ? void 0 : props.rowDragManaged) ? { rowDragManaged: props === null || props === void 0 ? void 0 : props.rowDragManaged } : {})), gridProps);
|
|
387
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,27 @@ 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
|
-
|
|
47
|
+
(0, react_1.useEffect)(() => {
|
|
48
|
+
const scrollContainer = scrollElementId
|
|
49
|
+
? document.getElementById(scrollElementId)
|
|
50
|
+
: null;
|
|
51
|
+
const handleScroll = (e) => {
|
|
52
|
+
var _a;
|
|
53
|
+
const target = e.target;
|
|
54
|
+
// Check if the scroll came from inside the dropdown menu (list box)
|
|
55
|
+
const isInternalListboxScroll = target.closest(".p-listbox-list-wrapper, .p-listbox-list, .p-virtualscroller");
|
|
56
|
+
// Only hide if it's not a scroll from the dropdown list itself
|
|
57
|
+
if (!isInternalListboxScroll && ((_a = optionsMenuRef === null || optionsMenuRef === void 0 ? void 0 : optionsMenuRef.current) === null || _a === void 0 ? void 0 : _a.hide)) {
|
|
58
|
+
optionsMenuRef.current.hide(e);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.addEventListener("scroll", handleScroll);
|
|
62
|
+
window.addEventListener("scroll", handleScroll, true);
|
|
63
|
+
return () => {
|
|
64
|
+
scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.removeEventListener("scroll", handleScroll);
|
|
65
|
+
window.removeEventListener("scroll", handleScroll, true);
|
|
66
|
+
};
|
|
67
|
+
}, [scrollElementId, optionsMenuRef]);
|
|
69
68
|
const handleDragStart = (e, index) => {
|
|
70
69
|
e.dataTransfer.setData("text/plain", index);
|
|
71
70
|
};
|
|
@@ -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) => {
|