sccoreui 6.1.13 → 6.1.16
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 +11 -1
- package/dist/components/ag-grid/advancedFeature/advanced-feature.js +3 -3
- package/dist/components/ag-grid/advancedFeature/hide-column.js +20 -7
- package/dist/components/ag-grid/context-provider.js +3 -2
- package/dist/components/ag-grid/helper.js +67 -29
- package/dist/components/ag-grid/parent-for-grid.js +21 -24
- package/dist/components/list-box-dropdown/list-box-dropdown.js +2 -5
- package/dist/types/components/ag-grid/Types.d.ts +3 -0
- package/dist/types/components/ag-grid/context-provider.d.ts +1 -0
- package/dist/types/components/ag-grid/helper.d.ts +1 -1
- package/dist/types/components/list-box-dropdown/list-box-dropdown.d.ts +1 -1
- package/dist/types/components/types/type.d.ts +1 -0
- package/package.json +1 -1
package/dist/App.scss
CHANGED
|
@@ -962,7 +962,7 @@ button[aria-expanded="true"] {
|
|
|
962
962
|
justify-content: center;
|
|
963
963
|
|
|
964
964
|
}
|
|
965
|
-
|
|
965
|
+
|
|
966
966
|
|
|
967
967
|
.formulaSpanElm {
|
|
968
968
|
font-size: 16px;
|
|
@@ -972,6 +972,7 @@ button[aria-expanded="true"] {
|
|
|
972
972
|
height: 32px;
|
|
973
973
|
position: relative;
|
|
974
974
|
top: -4px;
|
|
975
|
+
|
|
975
976
|
&:first-child {
|
|
976
977
|
display: none;
|
|
977
978
|
}
|
|
@@ -1808,8 +1809,17 @@ button[aria-expanded="true"] {
|
|
|
1808
1809
|
}
|
|
1809
1810
|
}
|
|
1810
1811
|
}
|
|
1812
|
+
|
|
1813
|
+
.selected-none {
|
|
1814
|
+
ul {
|
|
1815
|
+
li.p-highlight {
|
|
1816
|
+
display: none !important;
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1811
1820
|
}
|
|
1812
1821
|
|
|
1822
|
+
|
|
1813
1823
|
.list_box_chips {
|
|
1814
1824
|
display: inline-block;
|
|
1815
1825
|
align-items: center;
|
|
@@ -14,8 +14,8 @@ const hide_column_1 = tslib_1.__importDefault(require("./hide-column"));
|
|
|
14
14
|
function AdvancedFeatures({ props }) {
|
|
15
15
|
const { featureDetails } = (0, react_1.useContext)(context_provider_1.FeatureContext);
|
|
16
16
|
const conditionsToDisplay = props === null || props === void 0 ? void 0 : props.conditionsToDisplay;
|
|
17
|
-
const { bulkActionComponent: BulkAction, BulkEditComponent: BulkEdit } = props;
|
|
18
|
-
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-between py-3 px-4" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: [(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySearch) && ((0, jsx_runtime_1.jsx)(global_search_1.default, { searchPlaceHolder: props === null || props === void 0 ? void 0 : props.placeholder })), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayFilter) && (0, jsx_runtime_1.jsx)(table_filter_1.default, {})] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: [(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySidePanel) && (0, jsx_runtime_1.jsx)(hide_column_1.default, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayRemoveItems) && (0, jsx_runtime_1.jsx)(remove_items_1.default, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayBulkEdit) && (props === null || props === void 0 ? void 0 : props.BulkEditComponent) && (0, jsx_runtime_1.jsx)(BulkEdit, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayBulkAction) &&
|
|
19
|
-
(props === null || props === void 0 ? void 0 : props.bulkActionComponent) && ((0, jsx_runtime_1.jsx)(BulkAction, { checkBoxSelection: featureDetails.checkBoxSelection })), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayRefresh) && (0, jsx_runtime_1.jsx)(refresh_grid_1.default, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySort) && (0, jsx_runtime_1.jsx)(custom_sort_1.default, {}), (0, jsx_runtime_1.jsx)(record_detail_1.default, {})] }))] })));
|
|
17
|
+
const { bulkActionComponent: BulkAction, BulkEditComponent: BulkEdit, discardEditComponent: DiscardEdit, SaveEdit: SaveChanges } = props;
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center justify-content-between py-3 px-4" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: [(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySearch) && ((0, jsx_runtime_1.jsx)(global_search_1.default, { searchPlaceHolder: props === null || props === void 0 ? void 0 : props.placeholder })), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayFilter) && (0, jsx_runtime_1.jsx)(table_filter_1.default, {})] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center gap-3" }, { children: [(conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySidePanel) && (0, jsx_runtime_1.jsx)(hide_column_1.default, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayRemoveItems) && (0, jsx_runtime_1.jsx)(remove_items_1.default, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayBulkEdit) && (props === null || props === void 0 ? void 0 : props.BulkEditComponent) && (0, jsx_runtime_1.jsx)(BulkEdit, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayDiscardEdit) && (props === null || props === void 0 ? void 0 : props.discardEditComponent) && (0, jsx_runtime_1.jsx)(DiscardEdit, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayBulkAction) &&
|
|
19
|
+
(props === null || props === void 0 ? void 0 : props.bulkActionComponent) && ((0, jsx_runtime_1.jsx)(BulkAction, { checkBoxSelection: featureDetails.checkBoxSelection })), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySaveEditButton) && (props === null || props === void 0 ? void 0 : props.SaveEdit) && (0, jsx_runtime_1.jsx)(SaveChanges, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displayRefresh) && (0, jsx_runtime_1.jsx)(refresh_grid_1.default, {}), (conditionsToDisplay === null || conditionsToDisplay === void 0 ? void 0 : conditionsToDisplay.displaySort) && (0, jsx_runtime_1.jsx)(custom_sort_1.default, {}), (0, jsx_runtime_1.jsx)(record_detail_1.default, {})] }))] })));
|
|
20
20
|
}
|
|
21
21
|
exports.default = AdvancedFeatures;
|
|
@@ -11,16 +11,30 @@ const inputtext_1 = require("primereact/inputtext");
|
|
|
11
11
|
const context_provider_1 = require("../context-provider");
|
|
12
12
|
const drag_and_drop_icon_png_1 = tslib_1.__importDefault(require("../../../assets/images/drag-and-drop-icon.png"));
|
|
13
13
|
function HideColumn() {
|
|
14
|
-
const { gridData, gridApi, updateColumnsForGrid, sidePanelText } = (0, react_1.useContext)(context_provider_1.FeatureContext);
|
|
14
|
+
const { columnToRender, gridData, gridApi, updateColumnsForGrid, sidePanelText } = (0, react_1.useContext)(context_provider_1.FeatureContext);
|
|
15
15
|
const [visibleRight, setVisibleRight] = (0, react_1.useState)(false);
|
|
16
16
|
const [checked, setChecked] = (0, react_1.useState)(false);
|
|
17
17
|
const [inpValue, setInpValue] = (0, react_1.useState)("");
|
|
18
18
|
const [storeNodes, setStoreNodes] = (0, react_1.useState)();
|
|
19
19
|
const [nodes, setNodes] = (0, react_1.useState)();
|
|
20
|
-
const
|
|
20
|
+
const [hidePanelNodes, setHidePanelNodes] = (0, react_1.useState)([]);
|
|
21
|
+
const addColumns = () => {
|
|
22
|
+
var _a;
|
|
23
|
+
const columns = [];
|
|
24
|
+
(_a = gridData.columnData) === null || _a === void 0 ? void 0 : _a.filter((gColumn) => {
|
|
25
|
+
columnToRender === null || columnToRender === void 0 ? void 0 : columnToRender.filter((rColumn) => {
|
|
26
|
+
if (gColumn.id === rColumn.id || gColumn.field === rColumn.field) {
|
|
27
|
+
columns.push(gColumn);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
setHidePanelNodes(columns);
|
|
32
|
+
assignInitialValues(columns);
|
|
33
|
+
};
|
|
34
|
+
const assignInitialValues = (panelColumns) => {
|
|
21
35
|
var _a;
|
|
22
36
|
const columnsInBar = [];
|
|
23
|
-
(_a = JSON.parse(JSON.stringify(
|
|
37
|
+
(_a = JSON.parse(JSON.stringify(panelColumns))) === null || _a === void 0 ? void 0 : _a.map((column) => {
|
|
24
38
|
if (column === null || column === void 0 ? void 0 : column.visibleInPanel) {
|
|
25
39
|
column.checked = !(column === null || column === void 0 ? void 0 : column.hide);
|
|
26
40
|
if (column.hide) {
|
|
@@ -90,8 +104,7 @@ function HideColumn() {
|
|
|
90
104
|
const hideColumns = (columnsToHide, updatedSeq) => {
|
|
91
105
|
if (!gridApi)
|
|
92
106
|
return;
|
|
93
|
-
const
|
|
94
|
-
const updatedColumnDefs = columnDefs.map((colDef) => {
|
|
107
|
+
const updatedColumnDefs = hidePanelNodes.map((colDef) => {
|
|
95
108
|
const colToHide = columnsToHide.find((col) => col.id === colDef.id);
|
|
96
109
|
colDef.hide = (colDef === null || colDef === void 0 ? void 0 : colDef.visibleInPanel) ? !!colToHide : colDef === null || colDef === void 0 ? void 0 : colDef.hide;
|
|
97
110
|
const updatedCol = updatedSeq.find((col) => col.id === colDef.id);
|
|
@@ -129,8 +142,8 @@ function HideColumn() {
|
|
|
129
142
|
event.preventDefault();
|
|
130
143
|
};
|
|
131
144
|
(0, react_1.useEffect)(() => {
|
|
132
|
-
|
|
133
|
-
}, []);
|
|
145
|
+
addColumns();
|
|
146
|
+
}, [gridData.columData, columnToRender]);
|
|
134
147
|
(0, react_1.useEffect)(() => {
|
|
135
148
|
if (!visibleRight && (storeNodes === null || storeNodes === void 0 ? void 0 : storeNodes.length)) {
|
|
136
149
|
const fixNodes = [...storeNodes].map((node) => {
|
|
@@ -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 } = value;
|
|
9
|
+
const { featureDetails, setFeatureDetails, gridData, callGrid, totalRecords, initialFeature, defaultFilters, createView, enableViewCreate, filterModelText, sortModelText, recordDetailModelText, sidePanelText, sortOptions, filterConditions, clearFilters, setGridData, gridApi, updateColumnsForGrid, columnToRender } = 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)({});
|
|
@@ -90,7 +90,8 @@ function MyProvider({ children, value }) {
|
|
|
90
90
|
setGridData,
|
|
91
91
|
gridData,
|
|
92
92
|
gridApi,
|
|
93
|
-
updateColumnsForGrid
|
|
93
|
+
updateColumnsForGrid,
|
|
94
|
+
columnToRender
|
|
94
95
|
} }, { children: children })));
|
|
95
96
|
}
|
|
96
97
|
exports.default = MyProvider;
|
|
@@ -79,27 +79,31 @@ const updateCells = (updatedRowData, setUpdateRowData, api) => {
|
|
|
79
79
|
};
|
|
80
80
|
exports.updateCells = updateCells;
|
|
81
81
|
// Fill data in grid through drag
|
|
82
|
-
const fillOperation = (params, api, callBack, parentRowData) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
82
|
+
const fillOperation = (params, api, callBack, parentRowData, editedRecords, setEditedRecords) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
83
83
|
const { finalRange } = params;
|
|
84
|
-
const { startRow, endRow, columns,
|
|
84
|
+
const { startRow, endRow, columns,
|
|
85
|
+
// startColumn
|
|
86
|
+
} = finalRange;
|
|
85
87
|
const columnDetails = columns[0].colDef;
|
|
86
|
-
const selectedColumn =
|
|
88
|
+
// const selectedColumn: ColumnDef = startColumn?.userProvidedColDef || columnDetails;
|
|
89
|
+
// console.log(selectedColumn)
|
|
87
90
|
const handleError = () => {
|
|
88
91
|
alert("Sorry, cannot update for now");
|
|
89
92
|
};
|
|
90
|
-
const rangeDetails = {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
};
|
|
93
|
+
// const rangeDetails: RangeDetails = {
|
|
94
|
+
// parentRowData: parentRowData,
|
|
95
|
+
// selectedColumn: selectedColumn,
|
|
96
|
+
// childIds:getChildRowIds(startRow.rowIndex,endRow.rowIndex,api,parentRowData.id)
|
|
97
|
+
// };
|
|
95
98
|
if (!callBack) {
|
|
96
99
|
return handleError();
|
|
97
100
|
}
|
|
98
101
|
// Get updated rows
|
|
99
|
-
const getResponse =
|
|
100
|
-
// Throw error if not success
|
|
101
|
-
if (!getResponse.isSuccess)
|
|
102
|
-
|
|
102
|
+
// const getResponse = await callBack(rangeDetails);
|
|
103
|
+
// // Throw error if not success
|
|
104
|
+
// if (!getResponse.isSuccess) return handleError();
|
|
105
|
+
// Get current updated rows
|
|
106
|
+
const currentUpdatedRows = [];
|
|
103
107
|
// Collect all selected rows
|
|
104
108
|
for (let i = startRow.rowIndex; i <= endRow.rowIndex; i++) {
|
|
105
109
|
// Get the row node
|
|
@@ -108,31 +112,65 @@ const fillOperation = (params, api, callBack, parentRowData) => tslib_1.__awaite
|
|
|
108
112
|
continue; // Skip if rowNode is undefined
|
|
109
113
|
const rowData = rowNode === null || rowNode === void 0 ? void 0 : rowNode.data;
|
|
110
114
|
// Check if rowData exists and update the field
|
|
111
|
-
if (rowData && rowNode.id
|
|
115
|
+
if (rowData && (rowNode.id != parentRowData.id)) {
|
|
112
116
|
rowData[columnDetails === null || columnDetails === void 0 ? void 0 : columnDetails.field] = parentRowData[columnDetails === null || columnDetails === void 0 ? void 0 : columnDetails.field];
|
|
117
|
+
const schemaForEdit = {
|
|
118
|
+
row: rowData,
|
|
119
|
+
field: []
|
|
120
|
+
};
|
|
121
|
+
if (!schemaForEdit.field.includes(columnDetails === null || columnDetails === void 0 ? void 0 : columnDetails.field)) {
|
|
122
|
+
schemaForEdit.field.push(columnDetails === null || columnDetails === void 0 ? void 0 : columnDetails.field);
|
|
123
|
+
}
|
|
124
|
+
currentUpdatedRows.push(schemaForEdit);
|
|
113
125
|
// Update the row
|
|
114
126
|
rowNode.setData(rowData);
|
|
115
127
|
}
|
|
116
128
|
}
|
|
129
|
+
const mergeArraysData = mergeArrays(currentUpdatedRows, editedRecords);
|
|
130
|
+
if (setEditedRecords) {
|
|
131
|
+
setEditedRecords(mergeArraysData);
|
|
132
|
+
}
|
|
117
133
|
// Refresh the cells to show the updated data
|
|
118
134
|
api.refreshCells({ force: true });
|
|
119
135
|
});
|
|
120
136
|
exports.fillOperation = fillOperation;
|
|
121
|
-
//
|
|
122
|
-
const
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
137
|
+
// Merge previous updated arrays and current updated arrays
|
|
138
|
+
const mergeArrays = (currentUpdatedRows, updatedRecords) => {
|
|
139
|
+
const mergedMap = new Map();
|
|
140
|
+
// Add all entries from arr1 to the map
|
|
141
|
+
currentUpdatedRows === null || currentUpdatedRows === void 0 ? void 0 : currentUpdatedRows.forEach((item) => {
|
|
142
|
+
mergedMap.set(item.row.id, Object.assign({}, item));
|
|
143
|
+
});
|
|
144
|
+
// Merge entries from arr2 to the map
|
|
145
|
+
updatedRecords === null || updatedRecords === void 0 ? void 0 : updatedRecords.forEach((item) => {
|
|
146
|
+
const existing = mergedMap.get(item.row.id);
|
|
147
|
+
if (existing) {
|
|
148
|
+
// Merge row fields
|
|
149
|
+
Object.assign(existing.row, item.row);
|
|
150
|
+
// Merge field arrays, avoiding duplicates
|
|
151
|
+
existing.field = Array.from(new Set([...existing.field, ...item.field]));
|
|
135
152
|
}
|
|
136
|
-
|
|
137
|
-
|
|
153
|
+
else {
|
|
154
|
+
mergedMap.set(item.row.id, Object.assign({}, item));
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
// Convert map back to array
|
|
158
|
+
return Array.from(mergedMap.values());
|
|
138
159
|
};
|
|
160
|
+
// // Give child ids for fill update
|
|
161
|
+
// const getChildRowIds = (startIndex,endIndex,api,parentId) => {
|
|
162
|
+
// const ids = [];
|
|
163
|
+
// if (!(startIndex >= 0) || !(endIndex > 0)) {
|
|
164
|
+
// return [];
|
|
165
|
+
// }
|
|
166
|
+
// for (let i = startIndex; i <= endIndex; i++) {
|
|
167
|
+
// // Get the row node
|
|
168
|
+
// const rowNode = api.getDisplayedRowAtIndex(i);
|
|
169
|
+
// if (!rowNode) continue; // Skip if rowNode is undefined
|
|
170
|
+
// const rowData = rowNode?.data;
|
|
171
|
+
// if (rowData.id && rowData.id !== parentId) {
|
|
172
|
+
// ids.push(rowData.id);
|
|
173
|
+
// }
|
|
174
|
+
// }
|
|
175
|
+
// return ids;
|
|
176
|
+
// };
|
|
@@ -57,6 +57,7 @@ function ParentForGrid(props) {
|
|
|
57
57
|
checkBoxSelection: initialCheckBoxData,
|
|
58
58
|
isRemoveClicked: false,
|
|
59
59
|
});
|
|
60
|
+
const [columnToRender, setColumnToRender] = (0, react_1.useState)([]);
|
|
60
61
|
const gridRef = (0, react_1.useRef)(null);
|
|
61
62
|
// Default column specification
|
|
62
63
|
const defaultColDef = (0, react_1.useMemo)(() => {
|
|
@@ -232,11 +233,24 @@ function ParentForGrid(props) {
|
|
|
232
233
|
};
|
|
233
234
|
// Update cell from front end and give a call back to products
|
|
234
235
|
const wrapperToFillOpertation = (params) => {
|
|
235
|
-
(0, helper_1.fillOperation)(params, api, props === null || props === void 0 ? void 0 : props.updateCell, initalDragRowData);
|
|
236
|
+
(0, helper_1.fillOperation)(params, api, props === null || props === void 0 ? void 0 : props.updateCell, initalDragRowData, props === null || props === void 0 ? void 0 : props.editedRecords, props === null || props === void 0 ? void 0 : props.setEditedRecords);
|
|
236
237
|
};
|
|
238
|
+
const returnRenderColumn = (0, react_1.useCallback)(() => {
|
|
239
|
+
let columnToReturn = [];
|
|
240
|
+
gridData.columnData.filter((column) => {
|
|
241
|
+
props.columnData.filter((pColumn) => {
|
|
242
|
+
if (column.id === pColumn.id || column.field === pColumn.field) {
|
|
243
|
+
columnToReturn.push(column);
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
// setGridData({...gridData,columnData:columnToReturn})
|
|
248
|
+
setColumnToRender(columnToReturn);
|
|
249
|
+
// return columnToReturn
|
|
250
|
+
}, [props === null || props === void 0 ? void 0 : props.columnData]);
|
|
237
251
|
// Options that grid should have
|
|
238
252
|
const gridOptions = {
|
|
239
|
-
columnDefs:
|
|
253
|
+
columnDefs: columnToRender.map((column) => {
|
|
240
254
|
var _a, _b;
|
|
241
255
|
if (column.enableChildCheckbox && column.enableHeaderCheckbox) {
|
|
242
256
|
return Object.assign(Object.assign({}, column), { headerComponent: (params) => headerCheckBoxRenderer(params), cellRenderer: (params) => dataCellRenderer(params, column), headerName: (_a = column === null || column === void 0 ? void 0 : column.headerName) === null || _a === void 0 ? void 0 : _a.toUpperCase(), cellRendererParams: {
|
|
@@ -273,6 +287,9 @@ function ParentForGrid(props) {
|
|
|
273
287
|
const callGrid = (featureDetails) => {
|
|
274
288
|
onGridReady(gridReadyEvent, featureDetails);
|
|
275
289
|
};
|
|
290
|
+
(0, react_1.useEffect)(() => {
|
|
291
|
+
returnRenderColumn();
|
|
292
|
+
}, [props === null || props === void 0 ? void 0 : props.columnData]);
|
|
276
293
|
// Call Grid if something is searched
|
|
277
294
|
(0, react_1.useEffect)(() => {
|
|
278
295
|
if (api && gridReadyEvent) {
|
|
@@ -303,27 +320,6 @@ function ParentForGrid(props) {
|
|
|
303
320
|
(0, helper_1.updateCells)((_b = props === null || props === void 0 ? void 0 : props.updateRowData) === null || _b === void 0 ? void 0 : _b.rowData, props === null || props === void 0 ? void 0 : props.setUpdateRowData, api);
|
|
304
321
|
}
|
|
305
322
|
}, [props.updateRowData]);
|
|
306
|
-
// Update gridData.columnData whenever props.columnData changes
|
|
307
|
-
// useEffect(() => {
|
|
308
|
-
// setGridData((prevGridData) => {
|
|
309
|
-
// const updatedColumns = sortColumns(props?.columnData)
|
|
310
|
-
// .filter(newCol => newCol.id) // Ensure only columns with an `id` are processed
|
|
311
|
-
// .map((newCol) => {
|
|
312
|
-
// const existingCol = prevGridData.columnData.find((col) => col.id === newCol.id);
|
|
313
|
-
// if (existingCol) {
|
|
314
|
-
// return {
|
|
315
|
-
// ...existingCol,
|
|
316
|
-
// ...newCol,
|
|
317
|
-
// };
|
|
318
|
-
// }
|
|
319
|
-
// return newCol;
|
|
320
|
-
// });
|
|
321
|
-
// return {
|
|
322
|
-
// ...prevGridData,
|
|
323
|
-
// columnData: updatedColumns,
|
|
324
|
-
// };
|
|
325
|
-
// });
|
|
326
|
-
// }, [props?.columnData]);
|
|
327
323
|
(0, react_1.useEffect)(() => {
|
|
328
324
|
var _a;
|
|
329
325
|
const existingColumns = (_a = gridRef === null || gridRef === void 0 ? void 0 : gridRef.current.api) === null || _a === void 0 ? void 0 : _a.getColumnDefs();
|
|
@@ -361,7 +357,8 @@ function ParentForGrid(props) {
|
|
|
361
357
|
clearFilters: props === null || props === void 0 ? void 0 : props.clearFilters,
|
|
362
358
|
setGridData,
|
|
363
359
|
gridApi: gridRef,
|
|
364
|
-
updateColumnsForGrid: props === null || props === void 0 ? void 0 : props.updateColumnsForGrid
|
|
360
|
+
updateColumnsForGrid: props === null || props === void 0 ? void 0 : props.updateColumnsForGrid,
|
|
361
|
+
columnToRender: columnToRender,
|
|
365
362
|
} }, { children: (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 })] }) })) }) }));
|
|
366
363
|
}
|
|
367
364
|
exports.default = ParentForGrid;
|
|
@@ -11,15 +11,12 @@ const svg_component_1 = tslib_1.__importDefault(require("../../directives/svg-co
|
|
|
11
11
|
// import { Checkbox } from "primereact/checkbox";
|
|
12
12
|
const ListBoxDropdown = ({ selectAll,
|
|
13
13
|
// onSelectAll,
|
|
14
|
-
onChange, footeTemplate, headerTemplate, labelIcon, labelIconPos, label, labelIconSize, listItems, filter, multiple, filterPlaceholder, optionLabel, listClassName, menuClassName, listBoxParentClassName, listBoxclassName, optionTemplate, values, link, className, scrollElementId, buttonClassName, showChips, chipTemplate, chipClassName, chipsParentClassName, showRemoveIcon, removeIconSize, removeIconClassName, onRemoveItem, isDraggable, onDranghandle, onShow, onHide, onFocus, confirmationOption, }) => {
|
|
14
|
+
onChange, footeTemplate, headerTemplate, labelIcon, labelIconPos, label, labelIconSize, listItems, filter, multiple, filterPlaceholder, optionLabel, listClassName, menuClassName, listBoxParentClassName, listBoxclassName, optionTemplate, values, link, className, scrollElementId, buttonClassName, showChips, chipTemplate, chipClassName, chipsParentClassName, showRemoveIcon, removeIconSize, removeIconClassName, onRemoveItem, isDraggable, onDranghandle, onShow, onHide, onFocus, confirmationOption, selectedOptionNone }) => {
|
|
15
15
|
const [selectedItems, setSelectedItems] = (0, react_1.useState)([]);
|
|
16
16
|
// const [inpValue, setInpValue] = useState<any>();
|
|
17
17
|
const optionsMenuRef = (0, react_1.useRef)();
|
|
18
18
|
// const [checked, setChecked] = useState<boolean>(false);
|
|
19
19
|
const onSelectOption = (e) => {
|
|
20
|
-
// setChecked(e.value.length===listItems.length)
|
|
21
|
-
console.log(e.value.length);
|
|
22
|
-
console.log(listItems.length);
|
|
23
20
|
if (confirmationOption === true)
|
|
24
21
|
onChange(e);
|
|
25
22
|
else {
|
|
@@ -79,7 +76,7 @@ onChange, footeTemplate, headerTemplate, labelIcon, labelIconPos, label, labelIc
|
|
|
79
76
|
template: () => ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: listBoxParentClassName
|
|
80
77
|
? listBoxParentClassName +
|
|
81
78
|
" list_box_dropdown border-round-lg border-1 overflow-hidden border-gray-200"
|
|
82
|
-
: "list_box_dropdown" }, { children: [headerTemplate && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: headerTemplate() }), (0, jsx_runtime_1.jsx)(listbox_1.ListBox, { itemTemplate: (option) => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: optionTemplate ? (optionTemplate(option)) : ((0, jsx_runtime_1.jsx)("span", { children: option[`${optionLabel}`] })) })), listClassName: `${listClassName ? listClassName : " h-18rem overflow-auto "} ${selectAll && ""}`, filter: filter ? true : false, multiple: multiple ? true : false, value: selectedItems, onChange: (e) => onSelectOption(e), options: listItems, optionLabel: optionLabel, className: `${listBoxclassName
|
|
79
|
+
: "list_box_dropdown" }, { children: [headerTemplate && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: headerTemplate() }), (0, jsx_runtime_1.jsx)(listbox_1.ListBox, { itemTemplate: (option) => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: optionTemplate ? (optionTemplate(option)) : ((0, jsx_runtime_1.jsx)("span", { children: option[`${optionLabel}`] })) })), listClassName: `${selectedOptionNone ? 'selected-none' : ''} ${listClassName ? listClassName : " h-18rem overflow-auto "} ${selectAll && ""}`, filter: filter ? true : false, multiple: multiple ? true : false, value: selectedItems, onChange: (e) => onSelectOption(e), options: selectedOptionNone ? listItems.length === selectedItems.length ? [] : listItems : listItems, optionLabel: optionLabel, className: `${listBoxclassName
|
|
83
80
|
? listBoxclassName
|
|
84
81
|
: "w-16rem border-none "} `, filterPlaceholder: filterPlaceholder ? filterPlaceholder : "" }), footeTemplate && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: footeTemplate() })] }))),
|
|
85
82
|
},
|
|
@@ -14,6 +14,7 @@ export interface ColumnDef extends ColDef {
|
|
|
14
14
|
columnType?: string;
|
|
15
15
|
visibleInPanel?: boolean;
|
|
16
16
|
seq?: number;
|
|
17
|
+
isEditable?: boolean;
|
|
17
18
|
}
|
|
18
19
|
export interface ColHideShow extends ColumnDef {
|
|
19
20
|
checked?: boolean;
|
|
@@ -95,6 +96,8 @@ export interface ConditionsToDisplay {
|
|
|
95
96
|
displaySidePanel?: boolean;
|
|
96
97
|
enableFillHandle?: boolean;
|
|
97
98
|
displayBulkEdit?: boolean;
|
|
99
|
+
displayDiscardEdit?: boolean;
|
|
100
|
+
displaySaveEditButton?: boolean;
|
|
98
101
|
}
|
|
99
102
|
export interface PropsFromProduct {
|
|
100
103
|
columnData: ColumnDef[];
|
|
@@ -22,6 +22,7 @@ interface MyProviderProps {
|
|
|
22
22
|
setGridData: (GridData: any) => void;
|
|
23
23
|
gridApi: any;
|
|
24
24
|
updateColumnsForGrid: (columns: ColumnDef) => void;
|
|
25
|
+
columnToRender: ColumnDef[];
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
28
|
declare function MyProvider({ children, value }: MyProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,4 +3,4 @@ export declare const parseIfNeeded: (value: any) => any;
|
|
|
3
3
|
export declare const sortColumns: (columns: any) => any;
|
|
4
4
|
export declare const getCheckedStatus: (row: any, featureDetails: any, GRID_CHECKBOX_STATUS: any, setFeatureDetails: any) => any;
|
|
5
5
|
export declare const updateCells: (updatedRowData: any, setUpdateRowData: any, api: any) => void;
|
|
6
|
-
export declare const fillOperation: (params: any, api: any, callBack: any, parentRowData: any) => Promise<void>;
|
|
6
|
+
export declare const fillOperation: (params: any, api: any, callBack: any, parentRowData: any, editedRecords: any, setEditedRecords: any) => Promise<void>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ListBoxDropdownTypes } from "../types/type";
|
|
2
|
-
declare const ListBoxDropdown: ({ selectAll, onChange, footeTemplate, headerTemplate, labelIcon, labelIconPos, label, labelIconSize, listItems, filter, multiple, filterPlaceholder, optionLabel, listClassName, menuClassName, listBoxParentClassName, listBoxclassName, optionTemplate, values, link, className, scrollElementId, buttonClassName, showChips, chipTemplate, chipClassName, chipsParentClassName, showRemoveIcon, removeIconSize, removeIconClassName, onRemoveItem, isDraggable, onDranghandle, onShow, onHide, onFocus, confirmationOption, }: ListBoxDropdownTypes) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const ListBoxDropdown: ({ selectAll, onChange, footeTemplate, headerTemplate, labelIcon, labelIconPos, label, labelIconSize, listItems, filter, multiple, filterPlaceholder, optionLabel, listClassName, menuClassName, listBoxParentClassName, listBoxclassName, optionTemplate, values, link, className, scrollElementId, buttonClassName, showChips, chipTemplate, chipClassName, chipsParentClassName, showRemoveIcon, removeIconSize, removeIconClassName, onRemoveItem, isDraggable, onDranghandle, onShow, onHide, onFocus, confirmationOption, selectedOptionNone }: ListBoxDropdownTypes) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default ListBoxDropdown;
|