sccoreui 6.1.21 → 6.1.23
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 +2 -3
- package/dist/components/ag-grid/constants.js +2 -1
- package/dist/components/ag-grid/helper.js +4 -0
- package/dist/components/ag-grid/parent-for-grid.js +7 -1
- package/dist/types/components/ag-grid/constants.d.ts +1 -0
- package/package.json +1 -1
- package/dist/pages/aggrid/AgGrid.js +0 -441
- package/dist/pages/aggrid/BulkAction.js +0 -7
- package/dist/pages/aggrid/RowGroupTrail.js +0 -113
- package/dist/pages/aggrid/fakeServer.js +0 -95
- package/dist/pages/aggrid/id-cell.js +0 -9
- package/dist/pages/aggrid/interface.js +0 -2
- package/dist/pages/avatar/avatar.js +0 -338
- package/dist/pages/badges/badge.js +0 -73
- package/dist/pages/breadcrumb/breadcrumb.js +0 -14
- package/dist/pages/button/button.js +0 -10
- package/dist/pages/button-group/button-group.js +0 -10
- package/dist/pages/chart/chart.js +0 -257
- package/dist/pages/checkbox/checkbox.js +0 -26
- package/dist/pages/checkbox-group/checkbox-group-component.js +0 -21
- package/dist/pages/color-picker/color-picker.js +0 -13
- package/dist/pages/content-dividers/content-dividers.js +0 -11
- package/dist/pages/custom-color-picker/custom-color-picker.js +0 -12
- package/dist/pages/custom-multiselect/CustomMultiSelect.js +0 -37
- package/dist/pages/date-picker/date-picker.js +0 -20
- package/dist/pages/dropdown/dropdown-component.js +0 -39
- package/dist/pages/file-upload/file-upload.js +0 -34
- package/dist/pages/flex.js +0 -15
- package/dist/pages/formulaTemplate/formulaTemplate.js +0 -154
- package/dist/pages/frolaTextEditor/froala-text-editor.js +0 -12
- package/dist/pages/home.js +0 -49
- package/dist/pages/input/input-text.js +0 -112
- package/dist/pages/list-box-dropdown/listboxdropdown.js +0 -55
- package/dist/pages/loader-indicator/loader-indicator.js +0 -10
- package/dist/pages/mega-mennu/mega-menu.js +0 -84
- package/dist/pages/multi-select-dropdown/multi-select-dropdown.js +0 -51
- package/dist/pages/not-found/not-found.js +0 -10
- package/dist/pages/paginator/pagination.js +0 -122
- package/dist/pages/progress-bar/progress-bar.js +0 -27
- package/dist/pages/progress-steps/progress-steps.js +0 -24
- package/dist/pages/radio-button/radio-button-component.js +0 -11
- package/dist/pages/shadows/shadows.js +0 -7
- package/dist/pages/slideout-menus/slideout-menus.js +0 -104
- package/dist/pages/sliders/slider.js +0 -39
- package/dist/pages/tabels/table-data.js +0 -2193
- package/dist/pages/tabels/table.js +0 -98
- package/dist/pages/tabs/tabs.js +0 -9
- package/dist/pages/tags/tags.js +0 -70
- package/dist/pages/toast/toast.js +0 -47
- package/dist/pages/toggle/toggle.js +0 -10
- package/dist/pages/tooltip/tooltip.js +0 -13
- package/dist/pages/treeDropdownSelect/treedropdowselect.js +0 -34
- package/dist/pages/types/type.js +0 -2
- package/dist/types/pages/aggrid/AgGrid.d.ts +0 -2
- package/dist/types/pages/aggrid/BulkAction.d.ts +0 -2
- package/dist/types/pages/aggrid/RowGroupTrail.d.ts +0 -4
- package/dist/types/pages/aggrid/fakeServer.d.ts +0 -7
- package/dist/types/pages/aggrid/id-cell.d.ts +0 -2
- package/dist/types/pages/aggrid/interface.d.ts +0 -12
- package/dist/types/pages/avatar/avatar.d.ts +0 -2
- package/dist/types/pages/badges/badge.d.ts +0 -3
- package/dist/types/pages/breadcrumb/breadcrumb.d.ts +0 -2
- package/dist/types/pages/button/button.d.ts +0 -2
- package/dist/types/pages/button-group/button-group.d.ts +0 -2
- package/dist/types/pages/chart/chart.d.ts +0 -2
- package/dist/types/pages/checkbox/checkbox.d.ts +0 -2
- package/dist/types/pages/checkbox-group/checkbox-group-component.d.ts +0 -3
- package/dist/types/pages/color-picker/color-picker.d.ts +0 -2
- package/dist/types/pages/content-dividers/content-dividers.d.ts +0 -2
- package/dist/types/pages/custom-color-picker/custom-color-picker.d.ts +0 -2
- package/dist/types/pages/custom-multiselect/CustomMultiSelect.d.ts +0 -2
- package/dist/types/pages/date-picker/date-picker.d.ts +0 -2
- package/dist/types/pages/dropdown/dropdown-component.d.ts +0 -2
- package/dist/types/pages/file-upload/file-upload.d.ts +0 -3
- package/dist/types/pages/flex.d.ts +0 -2
- package/dist/types/pages/formulaTemplate/formulaTemplate.d.ts +0 -2
- package/dist/types/pages/frolaTextEditor/froala-text-editor.d.ts +0 -2
- package/dist/types/pages/home.d.ts +0 -2
- package/dist/types/pages/input/input-text.d.ts +0 -3
- package/dist/types/pages/list-box-dropdown/listboxdropdown.d.ts +0 -2
- package/dist/types/pages/loader-indicator/loader-indicator.d.ts +0 -3
- package/dist/types/pages/mega-mennu/mega-menu.d.ts +0 -2
- package/dist/types/pages/multi-select-dropdown/multi-select-dropdown.d.ts +0 -2
- package/dist/types/pages/not-found/not-found.d.ts +0 -2
- package/dist/types/pages/paginator/pagination.d.ts +0 -2
- package/dist/types/pages/progress-bar/progress-bar.d.ts +0 -3
- package/dist/types/pages/progress-steps/progress-steps.d.ts +0 -2
- package/dist/types/pages/radio-button/radio-button-component.d.ts +0 -2
- package/dist/types/pages/shadows/shadows.d.ts +0 -2
- package/dist/types/pages/slideout-menus/slideout-menus.d.ts +0 -2
- package/dist/types/pages/sliders/slider.d.ts +0 -1
- package/dist/types/pages/tabels/table-data.d.ts +0 -3
- package/dist/types/pages/tabels/table.d.ts +0 -2
- package/dist/types/pages/tabs/tabs.d.ts +0 -3
- package/dist/types/pages/tags/tags.d.ts +0 -3
- package/dist/types/pages/toast/toast.d.ts +0 -2
- package/dist/types/pages/toggle/toggle.d.ts +0 -2
- package/dist/types/pages/tooltip/tooltip.d.ts +0 -2
- package/dist/types/pages/treeDropdownSelect/treedropdowselect.d.ts +0 -2
- package/dist/types/pages/types/type.d.ts +0 -64
package/dist/App.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
4
|
// import Home from './pages/home';
|
|
6
5
|
require("./App.scss");
|
|
7
|
-
|
|
6
|
+
// import Home from "./pages/home";
|
|
8
7
|
const App = () => {
|
|
9
|
-
return ((0, jsx_runtime_1.jsx)("div", {
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)("div", {}));
|
|
10
9
|
};
|
|
11
10
|
exports.default = App;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULTS = exports.FILEEXTENSIONTYPE = exports.IMAGETYPES = exports.STATUSLIST = exports.SETUPPRICEOPTIONS = exports.PRICINGTYPE = exports.BUNDLETYPE = exports.BUNDLEQUANTITYTYPE = exports.DEFAULTGUID = exports.CATEGORYTYPE = exports.PRODUCTDISCOUNTTYPE = exports.GRID_CHECKBOX_STATUS = exports.conditionsList = exports.PRODUCTTYPE = exports.ROW_HEIGHT = exports.DEBOUNCE_INTERVAL = exports.MAX_BLOCKS = exports.MAX_RECORDS_TO_LOAD = exports.BLOCK_SIZE = exports.ROWMODELTYPE = exports.COLUMN_SORT_OPTIONS = void 0;
|
|
3
|
+
exports.DEFAULTS = exports.FILEEXTENSIONTYPE = exports.IMAGETYPES = exports.STATUSLIST = exports.SETUPPRICEOPTIONS = exports.PRICINGTYPE = exports.BUNDLETYPE = exports.BUNDLEQUANTITYTYPE = exports.DEFAULTGUID = exports.CATEGORYTYPE = exports.PRODUCTDISCOUNTTYPE = exports.EMPTY_RECORD = exports.GRID_CHECKBOX_STATUS = exports.conditionsList = exports.PRODUCTTYPE = exports.ROW_HEIGHT = exports.DEBOUNCE_INTERVAL = exports.MAX_BLOCKS = exports.MAX_RECORDS_TO_LOAD = exports.BLOCK_SIZE = exports.ROWMODELTYPE = exports.COLUMN_SORT_OPTIONS = void 0;
|
|
4
4
|
const Types_1 = require("./Types");
|
|
5
5
|
exports.COLUMN_SORT_OPTIONS = [
|
|
6
6
|
{ id: 1, label: "Low - High", sortId: 1, dataType: Types_1.ATTRIBUTEDATATYPES.INTEGER },
|
|
@@ -294,4 +294,5 @@ var GRID_CHECKBOX_STATUS;
|
|
|
294
294
|
GRID_CHECKBOX_STATUS[GRID_CHECKBOX_STATUS["CHECKED"] = 2] = "CHECKED";
|
|
295
295
|
GRID_CHECKBOX_STATUS[GRID_CHECKBOX_STATUS["UNCHECKED"] = 3] = "UNCHECKED";
|
|
296
296
|
})(GRID_CHECKBOX_STATUS = exports.GRID_CHECKBOX_STATUS || (exports.GRID_CHECKBOX_STATUS = {}));
|
|
297
|
+
exports.EMPTY_RECORD = "--";
|
|
297
298
|
exports.default = constants;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fillOperation = exports.updateCells = exports.getCheckedStatus = exports.sortColumns = exports.parseIfNeeded = exports.applyDefaultFilters = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
5
6
|
const applyDefaultFilters = (defaultFilters) => {
|
|
6
7
|
const filters = defaultFilters === null || defaultFilters === void 0 ? void 0 : defaultFilters.map((item) => {
|
|
7
8
|
const obj = {
|
|
@@ -96,6 +97,9 @@ const fillOperation = (params, api, parentRowData, editedRecords, setEditedRecor
|
|
|
96
97
|
const rowData = rowNode === null || rowNode === void 0 ? void 0 : rowNode.data;
|
|
97
98
|
// Check if rowData exists and update the field
|
|
98
99
|
if (rowData && (rowNode.id != parentRowData.id)) {
|
|
100
|
+
if ((rowData === null || rowData === void 0 ? void 0 : rowData[columnDetails === null || columnDetails === void 0 ? void 0 : columnDetails.field]) == constants_1.EMPTY_RECORD || (rowData === null || rowData === void 0 ? void 0 : rowData.type) !== (parentRowData === null || parentRowData === void 0 ? void 0 : parentRowData.type) || !(rowData === null || rowData === void 0 ? void 0 : rowData[columnDetails === null || columnDetails === void 0 ? void 0 : columnDetails.field])) {
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
99
103
|
rowData[columnDetails === null || columnDetails === void 0 ? void 0 : columnDetails.field] = parentRowData[columnDetails === null || columnDetails === void 0 ? void 0 : columnDetails.field];
|
|
100
104
|
const schemaForEdit = {
|
|
101
105
|
row: rowData,
|
|
@@ -203,7 +203,7 @@ function ParentForGrid(props) {
|
|
|
203
203
|
return;
|
|
204
204
|
}
|
|
205
205
|
// get data for request from our fake server
|
|
206
|
-
const response = yield getData(startRow, endRow, currentFeatures, params
|
|
206
|
+
const response = yield getData(startRow, endRow, currentFeatures, params);
|
|
207
207
|
// simulating real server call with a 500ms delay
|
|
208
208
|
if (((_j = response.rowData) === null || _j === void 0 ? void 0 : _j.length) > 0) {
|
|
209
209
|
setGridData(Object.assign(Object.assign({}, gridData), { rowData: response.rowData }));
|
|
@@ -235,6 +235,11 @@ function ParentForGrid(props) {
|
|
|
235
235
|
const wrapperToFillOpertation = (params) => {
|
|
236
236
|
(0, helper_1.fillOperation)(params, api, initalDragRowData, props === null || props === void 0 ? void 0 : props.editedRecords, props === null || props === void 0 ? void 0 : props.setEditedRecords);
|
|
237
237
|
};
|
|
238
|
+
const myOpertaion = (fillOperationParams) => {
|
|
239
|
+
return fillOperationParams.rowNode.data[fillOperationParams.column.colId];
|
|
240
|
+
};
|
|
241
|
+
// const returnRenderColumn = useCallback(() => {
|
|
242
|
+
// let columnToReturn: ColumnDef[] = [];
|
|
238
243
|
// const returnRenderColumn = useCallback(() => {
|
|
239
244
|
// let columnToReturn: ColumnDef[] = [];
|
|
240
245
|
// gridData.columnData.filter((column) => {
|
|
@@ -280,6 +285,7 @@ function ParentForGrid(props) {
|
|
|
280
285
|
enableRangeSelection: (_a = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _a === void 0 ? void 0 : _a.enableFillHandle,
|
|
281
286
|
enableFillHandle: (_b = props === null || props === void 0 ? void 0 : props.conditionsToDisplay) === null || _b === void 0 ? void 0 : _b.enableFillHandle,
|
|
282
287
|
onFillEnd: wrapperToFillOpertation,
|
|
288
|
+
fillOperation: myOpertaion,
|
|
283
289
|
onCellMouseDown: onCellMouseDown,
|
|
284
290
|
getRowId: getRowId,
|
|
285
291
|
fillHandleDirection: 'y'
|
|
@@ -94,5 +94,6 @@ export declare enum GRID_CHECKBOX_STATUS {
|
|
|
94
94
|
CHECKED = 2,
|
|
95
95
|
UNCHECKED = 3
|
|
96
96
|
}
|
|
97
|
+
export declare const EMPTY_RECORD = "--";
|
|
97
98
|
export { PRODUCTDISCOUNTTYPE, CATEGORYTYPE, DEFAULTGUID, BUNDLEQUANTITYTYPE, BUNDLETYPE, PRICINGTYPE, SETUPPRICEOPTIONS, STATUSLIST, IMAGETYPES, FILEEXTENSIONTYPE, DEFAULTS };
|
|
98
99
|
export default constants;
|
package/package.json
CHANGED
|
@@ -1,441 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const parent_for_grid_1 = tslib_1.__importDefault(require("../../components/ag-grid/parent-for-grid"));
|
|
7
|
-
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
8
|
-
const Types_1 = require("../../components/ag-grid/Types");
|
|
9
|
-
// import IdCell from "./id-cell";
|
|
10
|
-
const constants_1 = require("../../components/ag-grid/constants");
|
|
11
|
-
// import { Dropdown } from "primereact/dropdown";
|
|
12
|
-
const custom_dropdown_1 = tslib_1.__importDefault(require("../../components/ag-grid/custom-dropdown"));
|
|
13
|
-
const BulkAction_1 = tslib_1.__importDefault(require("./BulkAction"));
|
|
14
|
-
const fakeServer_1 = require("./fakeServer");
|
|
15
|
-
const dropdown_1 = require("primereact/dropdown");
|
|
16
|
-
// import { ATTRIBUTEDATATYPES } from "../../components/ag-grid/constants";
|
|
17
|
-
const AgGridPage = () => {
|
|
18
|
-
const [rowData, setRowData] = (0, react_1.useState)([]);
|
|
19
|
-
const [shouldRefetch, setShouldRefetch] = (0, react_1.useState)(false);
|
|
20
|
-
const [defaultFilters, setDefaultFilters] = (0, react_1.useState)([]);
|
|
21
|
-
const [storeResult, setStoreResult] = (0, react_1.useState)();
|
|
22
|
-
const [updateRowData, setUpdateRowData] = (0, react_1.useState)({ rowData: [], shouldUpdate: false });
|
|
23
|
-
const [editMode, setEditMode] = (0, react_1.useState)(false);
|
|
24
|
-
const [editedRecords, setEditedRecords] = (0, react_1.useState)([]);
|
|
25
|
-
const [emptyCheckboxStatus, setEmptyCheckboxStatus] = (0, react_1.useState)(false);
|
|
26
|
-
const deleteComponent = () => {
|
|
27
|
-
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("button", Object.assign({ className: "bg-white", onClick: () => setShouldRefetch(true) }, { children: "Delete" })) }));
|
|
28
|
-
};
|
|
29
|
-
const initialCondtions = {
|
|
30
|
-
displayFilter: true,
|
|
31
|
-
displaySort: true,
|
|
32
|
-
displaySearch: true,
|
|
33
|
-
displayRefresh: true,
|
|
34
|
-
displayRemoveItems: true,
|
|
35
|
-
displayBulkAction: true,
|
|
36
|
-
enableViewCreate: true,
|
|
37
|
-
displaySidePanel: true,
|
|
38
|
-
enableFillHandle: true,
|
|
39
|
-
displayBulkEdit: true,
|
|
40
|
-
displayDiscardEdit: false,
|
|
41
|
-
displaySaveEditButton: false,
|
|
42
|
-
displayRecords: false,
|
|
43
|
-
displayEditHeading: false
|
|
44
|
-
};
|
|
45
|
-
const [conditionsToDisplay, setConditionsToDisplay] = (0, react_1.useState)(initialCondtions);
|
|
46
|
-
const updateRows = (row) => {
|
|
47
|
-
setUpdateRowData({ rowData: row, shouldUpdate: true });
|
|
48
|
-
};
|
|
49
|
-
const statusDropDwon = (params) => {
|
|
50
|
-
return (0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { onChange: (e) => { params.data.status = e.value, console.log(e.value, 'value updating on change'), updateRows(params.data); }, value: params.data.status, options: [{ id: constants_1.STATUSLIST.DRAFT, label: "Draft", value: constants_1.STATUSLIST.DRAFT },
|
|
51
|
-
{ id: constants_1.STATUSLIST.ACTIVE, label: "Active", value: constants_1.STATUSLIST.ACTIVE },
|
|
52
|
-
{
|
|
53
|
-
id: constants_1.STATUSLIST.INACTIVE,
|
|
54
|
-
label: "Inactive",
|
|
55
|
-
value: constants_1.STATUSLIST.INACTIVE,
|
|
56
|
-
}] });
|
|
57
|
-
};
|
|
58
|
-
const [shouldClearFilters, setShouldClearFilters] = (0, react_1.useState)(false);
|
|
59
|
-
const [columnDefs] = (0, react_1.useState)([
|
|
60
|
-
{
|
|
61
|
-
seq: 1,
|
|
62
|
-
// pinned: "left",
|
|
63
|
-
// lockPosition: "left",
|
|
64
|
-
// cellClass: "lock-pinned",
|
|
65
|
-
// suppressMovable: true,
|
|
66
|
-
enableHeaderCheckbox: true,
|
|
67
|
-
hide: false,
|
|
68
|
-
enableChildCheckbox: true,
|
|
69
|
-
id: "101",
|
|
70
|
-
headerName: "ID",
|
|
71
|
-
field: "id",
|
|
72
|
-
isSortable: false,
|
|
73
|
-
code: 1,
|
|
74
|
-
dataType: Types_1.ATTRIBUTEDATATYPES.STRING,
|
|
75
|
-
editable: true,
|
|
76
|
-
isFilterable: false,
|
|
77
|
-
cellStyle: { borderRight: "1px solid #ccc" },
|
|
78
|
-
visibleInPanel: true,
|
|
79
|
-
cellRendererSelector: (params) => {
|
|
80
|
-
if (params.node.rowPinned) {
|
|
81
|
-
return {
|
|
82
|
-
component: custom_dropdown_1.default,
|
|
83
|
-
params: {
|
|
84
|
-
style: { color: "#5577CC" },
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
return undefined;
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
suppressFillHandle: true,
|
|
93
|
-
isEditable: false
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
id: "111",
|
|
97
|
-
seq: 3,
|
|
98
|
-
headerName: "Email",
|
|
99
|
-
dataType: Types_1.ATTRIBUTEDATATYPES.STRING,
|
|
100
|
-
editable: false,
|
|
101
|
-
visibleInPanel: true,
|
|
102
|
-
isFilterable: false,
|
|
103
|
-
field: "email",
|
|
104
|
-
suppressFillHandle: false,
|
|
105
|
-
isEditable: true
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
seq: 3,
|
|
109
|
-
// lockPinned: true,
|
|
110
|
-
hide: false,
|
|
111
|
-
id: "102",
|
|
112
|
-
headerName: "Title",
|
|
113
|
-
cellRendererSelector: (params) => {
|
|
114
|
-
if (params.node.rowPinned) {
|
|
115
|
-
return {
|
|
116
|
-
component: custom_dropdown_1.default,
|
|
117
|
-
params: {
|
|
118
|
-
style: { color: "#5577CC" },
|
|
119
|
-
},
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
return undefined;
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
field: "name",
|
|
127
|
-
isSortable: true,
|
|
128
|
-
code: 1,
|
|
129
|
-
dataType: Types_1.ATTRIBUTEDATATYPES.STRING,
|
|
130
|
-
editable: false,
|
|
131
|
-
visibleInPanel: true,
|
|
132
|
-
isFilterable: false,
|
|
133
|
-
suppressFillHandle: false,
|
|
134
|
-
isEditable: true
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
seq: 2,
|
|
138
|
-
hide: true,
|
|
139
|
-
// lockPinned: true,
|
|
140
|
-
id: "103",
|
|
141
|
-
headerName: "Body",
|
|
142
|
-
field: "body",
|
|
143
|
-
isSortable: true,
|
|
144
|
-
code: 1,
|
|
145
|
-
dataType: Types_1.ATTRIBUTEDATATYPES.STRING,
|
|
146
|
-
editable: false,
|
|
147
|
-
visibleInPanel: true,
|
|
148
|
-
isFilterable: true,
|
|
149
|
-
suppressFillHandle: false,
|
|
150
|
-
isEditable: true
|
|
151
|
-
},
|
|
152
|
-
{ seq: 4,
|
|
153
|
-
hide: false,
|
|
154
|
-
// lockPinned: true,
|
|
155
|
-
id: "104",
|
|
156
|
-
headerName: "Status",
|
|
157
|
-
field: "status",
|
|
158
|
-
isSortable: true,
|
|
159
|
-
visibleInPanel: true,
|
|
160
|
-
columnType: "single",
|
|
161
|
-
options: [
|
|
162
|
-
{ id: constants_1.STATUSLIST.DRAFT, label: "Draft", value: constants_1.STATUSLIST.DRAFT },
|
|
163
|
-
{ id: constants_1.STATUSLIST.ACTIVE, label: "Active", value: constants_1.STATUSLIST.ACTIVE },
|
|
164
|
-
{
|
|
165
|
-
id: constants_1.STATUSLIST.INACTIVE,
|
|
166
|
-
label: "Inactive",
|
|
167
|
-
value: constants_1.STATUSLIST.INACTIVE,
|
|
168
|
-
},
|
|
169
|
-
],
|
|
170
|
-
code: 1,
|
|
171
|
-
dataType: Types_1.ATTRIBUTEDATATYPES.BOOLEAN,
|
|
172
|
-
editable: false,
|
|
173
|
-
isFilterable: true,
|
|
174
|
-
cellRenderer: statusDropDwon,
|
|
175
|
-
suppressFillHandle: false,
|
|
176
|
-
isEditable: true
|
|
177
|
-
// rowGroup: true,
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
seq: 5,
|
|
181
|
-
id: "105",
|
|
182
|
-
hide: false,
|
|
183
|
-
isEditable: false,
|
|
184
|
-
// pinned: "right",
|
|
185
|
-
// lockPosition: "rigth",
|
|
186
|
-
// cellClass: "lock-pinned",
|
|
187
|
-
visibleInPanel: false,
|
|
188
|
-
suppressFillHandle: true,
|
|
189
|
-
cellRendererSelector: (params) => {
|
|
190
|
-
if (params.node.rowPinned) {
|
|
191
|
-
return () => null;
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
return { component: deleteComponent };
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
]);
|
|
199
|
-
const [columnsToDisplay, setColumnsToDisplay] = (0, react_1.useState)(columnDefs);
|
|
200
|
-
const noRowsOverlayComponent = () => {
|
|
201
|
-
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("p", { children: "No Rows, message from products" }) }));
|
|
202
|
-
};
|
|
203
|
-
const updateCell = (selectedRowsToUpdate) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
204
|
-
console.log(selectedRowsToUpdate, 'selected rows to update');
|
|
205
|
-
setRowData(rowData);
|
|
206
|
-
setStoreResult(rowData);
|
|
207
|
-
const output = {
|
|
208
|
-
isSuccess: true,
|
|
209
|
-
};
|
|
210
|
-
return output;
|
|
211
|
-
});
|
|
212
|
-
// const [selectedCity, setSelectedCity] = useState(null);
|
|
213
|
-
const pinnedTopRowData = (0, react_1.useMemo)(() => {
|
|
214
|
-
return [{ id: "1", name: "nitesh", body: "working out" }];
|
|
215
|
-
}, []);
|
|
216
|
-
// Update columns based on hide panel
|
|
217
|
-
const updateColumns = (updatedColumns) => {
|
|
218
|
-
console.log(updatedColumns, 'updated columns in products');
|
|
219
|
-
setColumnsToDisplay(updatedColumns);
|
|
220
|
-
};
|
|
221
|
-
console.log(setColumnsToDisplay);
|
|
222
|
-
// Remove items from - button
|
|
223
|
-
const removeItem = (checkboxSelectionDetails) => {
|
|
224
|
-
const unSelectedData = checkboxSelectionDetails === null || checkboxSelectionDetails === void 0 ? void 0 : checkboxSelectionDetails.excludedRecords;
|
|
225
|
-
const selectedData = checkboxSelectionDetails === null || checkboxSelectionDetails === void 0 ? void 0 : checkboxSelectionDetails.includedRecords;
|
|
226
|
-
const isIternminite = checkboxSelectionDetails === null || checkboxSelectionDetails === void 0 ? void 0 : checkboxSelectionDetails.isIndeterminate;
|
|
227
|
-
console.log(checkboxSelectionDetails, "coming in remove item products");
|
|
228
|
-
let updatedRowData = [];
|
|
229
|
-
if (isIternminite) {
|
|
230
|
-
updatedRowData = unSelectedData;
|
|
231
|
-
}
|
|
232
|
-
else if ((selectedData === null || selectedData === void 0 ? void 0 : selectedData.length) && !isIternminite) {
|
|
233
|
-
const childIds = new Set(selectedData === null || selectedData === void 0 ? void 0 : selectedData.map((child) => child.id));
|
|
234
|
-
updatedRowData = rowData.filter((parent) => !childIds.has(parent.id));
|
|
235
|
-
}
|
|
236
|
-
console.log(updatedRowData, "result data from remove items in products");
|
|
237
|
-
return updatedRowData;
|
|
238
|
-
};
|
|
239
|
-
const getCheckedRows = (checkedRows) => {
|
|
240
|
-
console.log(checkedRows, "checked rows in products");
|
|
241
|
-
};
|
|
242
|
-
// const updateForFillOperation =(fillSelected)=>{
|
|
243
|
-
// console.log('store row data in update fill',storeResult,fillSelected)
|
|
244
|
-
// const updatedResult = JSON.parse(JSON.stringify(storeResult.rowData))?.map((item)=>{
|
|
245
|
-
// fillSelected.childRows?.filter((fillItem)=>{
|
|
246
|
-
// console.log(item.id ,fillItem.id)
|
|
247
|
-
// if(item.id===fillItem.id){
|
|
248
|
-
// console.log('coming in satisfied item')
|
|
249
|
-
// console.log(item[fillSelected.column.field],fillItem[fillSelected.column.field],'field in item and fill item')
|
|
250
|
-
// item[fillSelected.column.field] = fillSelected.parentRow[fillSelected.column.field]
|
|
251
|
-
// }
|
|
252
|
-
// })
|
|
253
|
-
// return item
|
|
254
|
-
// })
|
|
255
|
-
// const newOutput = {
|
|
256
|
-
// rowData : updatedResult,
|
|
257
|
-
// totalRecords:storeResult.totalRecords
|
|
258
|
-
// }
|
|
259
|
-
// console.log(updatedResult,'updated result on fill')
|
|
260
|
-
// return newOutput
|
|
261
|
-
// // const updatedRowData = storeResult.rowData.map
|
|
262
|
-
// }
|
|
263
|
-
const SaveEdit = (params) => {
|
|
264
|
-
console.log(params, 'params in save edit');
|
|
265
|
-
console.log(editedRecords, 'edited records in page');
|
|
266
|
-
const saveChanges = () => {
|
|
267
|
-
setEmptyCheckboxStatus(true);
|
|
268
|
-
console.log('changes saved', editedRecords);
|
|
269
|
-
setColumnsToDisplay(columnDefs);
|
|
270
|
-
setShouldRefetch(true);
|
|
271
|
-
setEditMode(false);
|
|
272
|
-
setConditionsToDisplay(initialCondtions);
|
|
273
|
-
};
|
|
274
|
-
return (0, jsx_runtime_1.jsx)("button", Object.assign({ disabled: !editedRecords.length, onClick: saveChanges, className: "bg-white" }, { children: "Save Changes" }));
|
|
275
|
-
};
|
|
276
|
-
// Discard component for bulk edit
|
|
277
|
-
const DiscardEdit = () => {
|
|
278
|
-
const discard = () => {
|
|
279
|
-
setColumnsToDisplay(columnDefs);
|
|
280
|
-
setShouldRefetch(true);
|
|
281
|
-
setEditMode(false);
|
|
282
|
-
setConditionsToDisplay(initialCondtions);
|
|
283
|
-
};
|
|
284
|
-
return (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("p", Object.assign({ onClick: discard }, { children: "Discard" })) });
|
|
285
|
-
};
|
|
286
|
-
// Edit headeing details
|
|
287
|
-
const EditHeadingDetails = () => {
|
|
288
|
-
return (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("p", { children: "Bulk Edit 4 products 4 variants" }) });
|
|
289
|
-
};
|
|
290
|
-
// Bulk edit component
|
|
291
|
-
const BulkEdit = () => {
|
|
292
|
-
const updateColumns = () => {
|
|
293
|
-
const tempColumns = [...columnsToDisplay].filter((column) => column.isEditable);
|
|
294
|
-
console.log(tempColumns, 'temp columsn');
|
|
295
|
-
setColumnsToDisplay(tempColumns);
|
|
296
|
-
setShouldRefetch(true);
|
|
297
|
-
setEditMode(true);
|
|
298
|
-
const tempConditions = conditionsToDisplay;
|
|
299
|
-
tempConditions.displayFilter = false;
|
|
300
|
-
tempConditions.displaySort = false;
|
|
301
|
-
tempConditions.displayBulkAction = false;
|
|
302
|
-
tempConditions.enableFillHandle = true;
|
|
303
|
-
tempConditions.displayDiscardEdit = true;
|
|
304
|
-
tempConditions.displayRefresh = false;
|
|
305
|
-
tempConditions.displayRemoveItems = false;
|
|
306
|
-
tempConditions.displayBulkEdit = false;
|
|
307
|
-
tempConditions.displaySaveEditButton = true;
|
|
308
|
-
tempConditions.displayEditHeading = true;
|
|
309
|
-
setConditionsToDisplay(tempConditions);
|
|
310
|
-
};
|
|
311
|
-
return (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("p", Object.assign({ onClick: updateColumns }, { children: "Bulk Edit" })) });
|
|
312
|
-
};
|
|
313
|
-
const getRowData = (startRow, endRow, featureDetails, params) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
314
|
-
var _a;
|
|
315
|
-
console.log(params, "params in page");
|
|
316
|
-
console.log(featureDetails, "feature details in page for filter queries");
|
|
317
|
-
// if(featureDetails?.fillSelected?.childRows?.length){
|
|
318
|
-
// return updateForFillOperation(featureDetails.fillSelected)
|
|
319
|
-
// }
|
|
320
|
-
const features = featureDetails;
|
|
321
|
-
// const conditionToRemoveItem = features.checkBoxSelection.allBoxChecked || features.checkBoxSelection.isIndeterminate || features.checkBoxSelection.includedRecords.length || features.checkBoxSelection.excludedRecords.length
|
|
322
|
-
if (featureDetails.isRemoveClicked) {
|
|
323
|
-
const result = removeItem(features.checkBoxSelection);
|
|
324
|
-
const output = {
|
|
325
|
-
totalRecords: result.length,
|
|
326
|
-
rowData: result,
|
|
327
|
-
};
|
|
328
|
-
return yield output;
|
|
329
|
-
}
|
|
330
|
-
let totalRecords = 500;
|
|
331
|
-
const serverSideUrl = `https://jsonplaceholder.typicode.com/comments?_start=${startRow}&_end=${endRow}`;
|
|
332
|
-
const clientSideUrl = "https://jsonplaceholder.typicode.com/comments?_limit=20";
|
|
333
|
-
console.log(serverSideUrl, clientSideUrl);
|
|
334
|
-
const result = yield axios_1.default.get(serverSideUrl);
|
|
335
|
-
// Enable row group local server
|
|
336
|
-
const grouping = false;
|
|
337
|
-
if (result.data[2].id === 3)
|
|
338
|
-
result.data[2].isSelected = true;
|
|
339
|
-
const outputData = result === null || result === void 0 ? void 0 : result.data.map((item) => {
|
|
340
|
-
item.status = constants_1.STATUSLIST.INACTIVE;
|
|
341
|
-
delete item.postId;
|
|
342
|
-
return item;
|
|
343
|
-
});
|
|
344
|
-
let output = {
|
|
345
|
-
totalRecords: totalRecords,
|
|
346
|
-
rowData: outputData,
|
|
347
|
-
};
|
|
348
|
-
// Performs when grouping is present
|
|
349
|
-
if (grouping) {
|
|
350
|
-
const result = yield axios_1.default.get(serverSideUrl);
|
|
351
|
-
result === null || result === void 0 ? void 0 : result.data.map((item) => {
|
|
352
|
-
item.status = "Active";
|
|
353
|
-
return item;
|
|
354
|
-
});
|
|
355
|
-
let fakeServer = (0, fakeServer_1.FakeServer)(result.data, ["status"]);
|
|
356
|
-
const groupingResponse = fakeServer.getData(params);
|
|
357
|
-
console.log(groupingResponse, 'grouping response');
|
|
358
|
-
const lastRow = ((_a = params.groupKeys) === null || _a === void 0 ? void 0 : _a.length) == 0
|
|
359
|
-
? groupingResponse === null || groupingResponse === void 0 ? void 0 : groupingResponse.lastRow
|
|
360
|
-
: totalRecords;
|
|
361
|
-
output.rowData = groupingResponse.rows;
|
|
362
|
-
output.totalRecords = lastRow;
|
|
363
|
-
}
|
|
364
|
-
setStoreResult(output);
|
|
365
|
-
setRowData(result.data);
|
|
366
|
-
setShouldRefetch(false);
|
|
367
|
-
setShouldClearFilters(false);
|
|
368
|
-
return output;
|
|
369
|
-
});
|
|
370
|
-
const style = {
|
|
371
|
-
height: "400px",
|
|
372
|
-
width: "100%",
|
|
373
|
-
};
|
|
374
|
-
console.log(pinnedTopRowData, defaultFilters);
|
|
375
|
-
const createView = (viewDetails) => {
|
|
376
|
-
console.log(viewDetails, "parsed value for create view");
|
|
377
|
-
};
|
|
378
|
-
console.log(storeResult, "sotred result");
|
|
379
|
-
const selectFilter = () => {
|
|
380
|
-
const defaultFilters = [
|
|
381
|
-
{
|
|
382
|
-
columnName: {
|
|
383
|
-
name: "Body",
|
|
384
|
-
code: "body",
|
|
385
|
-
dataType: "string",
|
|
386
|
-
},
|
|
387
|
-
condition: 5,
|
|
388
|
-
value: "data",
|
|
389
|
-
id: "0.028544677566825438",
|
|
390
|
-
isActive: true,
|
|
391
|
-
logicalOperator: 1, // number
|
|
392
|
-
},
|
|
393
|
-
];
|
|
394
|
-
setShouldRefetch(true);
|
|
395
|
-
setDefaultFilters(defaultFilters);
|
|
396
|
-
};
|
|
397
|
-
const dynamicText = {
|
|
398
|
-
filterModelText: {
|
|
399
|
-
header: "Filter",
|
|
400
|
-
subHeader: "Streamline Your Search With Filters",
|
|
401
|
-
resetFilterAction: "Reset Filter",
|
|
402
|
-
createViewInputPlaceHolder: "Enter",
|
|
403
|
-
createViewAction: "Create View",
|
|
404
|
-
applyAction: "Apply",
|
|
405
|
-
elementOnePlaceHolder: "Select",
|
|
406
|
-
elementTwoPlaceHolder: "Select",
|
|
407
|
-
elementThreePlaceHolder_Input: "Enter Text",
|
|
408
|
-
elementThreePlaceHolder_Input_Number: "Enter Number",
|
|
409
|
-
elementThreePlaceHolder_DropDown: "Select",
|
|
410
|
-
elementThreePlaceHolder_MultiSelect: "Select",
|
|
411
|
-
elementThreePlaceHolder_Calender: "Select Date",
|
|
412
|
-
onSelectedFilter: "Selected",
|
|
413
|
-
},
|
|
414
|
-
sortModelText: {
|
|
415
|
-
header: "Column Sorting",
|
|
416
|
-
clearAction: "Clear",
|
|
417
|
-
applyAction: "Apply",
|
|
418
|
-
onSelectedSort: "Selected",
|
|
419
|
-
},
|
|
420
|
-
recordDetailModelText: {
|
|
421
|
-
totalRecordHeader: "Total Records",
|
|
422
|
-
},
|
|
423
|
-
sidePanelText: {
|
|
424
|
-
header: "Configure Columns",
|
|
425
|
-
disacrd_button: "Discard",
|
|
426
|
-
update_button: "Update",
|
|
427
|
-
apply_to_all_views: "Apply to all views",
|
|
428
|
-
apply_subHeading: "Apply the chosen column selection to all available views",
|
|
429
|
-
search_placeHolder: "Search by column name",
|
|
430
|
-
selected_attributes: "Selected Attributes",
|
|
431
|
-
unselected_attributes: "Unselected Attributes"
|
|
432
|
-
}
|
|
433
|
-
};
|
|
434
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("button", Object.assign({ onClick: selectFilter }, { children: "Select Filter" })), (0, jsx_runtime_1.jsx)("button", Object.assign({ onClick: () => setShouldClearFilters(true) }, { children: "clear filter" })), (0, jsx_runtime_1.jsx)(parent_for_grid_1.default, { columnData: columnsToDisplay, style: style, getRowData: getRowData, conditionsToDisplay: conditionsToDisplay, rowModelType: constants_1.ROWMODELTYPE.SERVER_SIDE,
|
|
435
|
-
// pinnedTopRowData={pinnedTopRowData}
|
|
436
|
-
bulkActionComponent: BulkAction_1.default, getCheckedRows: getCheckedRows, shouldRefetch: shouldRefetch, noRowsOverlayComponent: noRowsOverlayComponent, defaultFilters: defaultFilters, createView: createView, dynamicText: dynamicText, sortOptions: constants_1.COLUMN_SORT_OPTIONS, filterConditions: [
|
|
437
|
-
{ id: 1, label: "AND" },
|
|
438
|
-
{ id: 2, label: "OR" },
|
|
439
|
-
], clearFilters: shouldClearFilters, updateColumnsForGrid: updateColumns, updateCell: updateCell, BulkEditComponent: BulkEdit, updateRowData: updateRowData, setUpdateRowData: setUpdateRowData, editMode: editMode, discardEditComponent: DiscardEdit, SaveEdit: SaveEdit, setEditedRecords: setEditedRecords, editedRecords: editedRecords, emptyCheckboxStatus: emptyCheckboxStatus, EditHeadingDetails: EditHeadingDetails })] }));
|
|
440
|
-
};
|
|
441
|
-
exports.default = AgGridPage;
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const react_2 = require("@ag-grid-community/react");
|
|
6
|
-
require("@ag-grid-community/styles/ag-grid.css");
|
|
7
|
-
require("@ag-grid-community/styles/ag-theme-quartz.css");
|
|
8
|
-
const core_1 = require("@ag-grid-community/core");
|
|
9
|
-
const row_grouping_1 = require("@ag-grid-enterprise/row-grouping");
|
|
10
|
-
const server_side_row_model_1 = require("@ag-grid-enterprise/server-side-row-model");
|
|
11
|
-
const range_selection_1 = require("@ag-grid-enterprise/range-selection");
|
|
12
|
-
const fakeServer_1 = require("./fakeServer");
|
|
13
|
-
core_1.ModuleRegistry.registerModules([row_grouping_1.RowGroupingModule, server_side_row_model_1.ServerSideRowModelModule, range_selection_1.RangeSelectionModule]);
|
|
14
|
-
const getServerSideDatasource = (server) => {
|
|
15
|
-
return {
|
|
16
|
-
getRows: (params) => {
|
|
17
|
-
console.log("[Datasource] - rows requested by grid: ", params.request, params);
|
|
18
|
-
var response = server.getData(params.request);
|
|
19
|
-
console.log(response, 'request to server');
|
|
20
|
-
// adding delay to simulate real server call
|
|
21
|
-
setTimeout(() => {
|
|
22
|
-
if (response.success) {
|
|
23
|
-
// call the success callback
|
|
24
|
-
params.success({
|
|
25
|
-
rowData: response.rows,
|
|
26
|
-
rowCount: response.lastRow,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
// inform the grid request failed
|
|
31
|
-
params.fail();
|
|
32
|
-
}
|
|
33
|
-
}, 1000);
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
console.log(getServerSideDatasource);
|
|
38
|
-
const GridComponent = () => {
|
|
39
|
-
const containerStyle = (0, react_1.useMemo)(() => ({ width: "1500px", height: "900px" }), []);
|
|
40
|
-
const gridStyle = (0, react_1.useMemo)(() => ({ height: "900px", width: "1500px" }), []);
|
|
41
|
-
const [columnDefs] = (0, react_1.useState)([
|
|
42
|
-
{ field: "country", rowGroup: true, hide: true, editable: true },
|
|
43
|
-
{ field: "athlete", editable: true },
|
|
44
|
-
{ field: "age", editable: true },
|
|
45
|
-
{ field: "sport", rowGroup: true, hide: true, editable: true },
|
|
46
|
-
{ field: "year", rowGroup: true, hide: true, editable: true },
|
|
47
|
-
{ field: "date", editable: true },
|
|
48
|
-
{ field: "gold", editable: true },
|
|
49
|
-
{ field: "silver" },
|
|
50
|
-
{ field: "bronze" },
|
|
51
|
-
{ field: "total" },
|
|
52
|
-
]);
|
|
53
|
-
const defaultColDef = (0, react_1.useMemo)(() => {
|
|
54
|
-
return {
|
|
55
|
-
flex: 1,
|
|
56
|
-
minWidth: 120,
|
|
57
|
-
};
|
|
58
|
-
}, []);
|
|
59
|
-
const autoGroupColumnDef = (0, react_1.useMemo)(() => {
|
|
60
|
-
return {
|
|
61
|
-
headerName: "Group",
|
|
62
|
-
field: "group",
|
|
63
|
-
cellRenderer: "agGroupCellRenderer",
|
|
64
|
-
cellRendererParams: {
|
|
65
|
-
suppressCount: true,
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
}, []);
|
|
69
|
-
const onGridReady = (0, react_1.useCallback)((params) => {
|
|
70
|
-
fetch("https://www.ag-grid.com/example-assets/olympic-winners.json")
|
|
71
|
-
.then((resp) => resp.json())
|
|
72
|
-
.then((data) => {
|
|
73
|
-
// setup the fake server with entire dataset
|
|
74
|
-
var fakeServer = (0, fakeServer_1.FakeServer)(data, ['country', 'sport']);
|
|
75
|
-
// create datasource with a reference to the fake server
|
|
76
|
-
// var datasource = getServerSideDatasource(fakeServer);
|
|
77
|
-
const dataSource = {
|
|
78
|
-
getRows: (params) => {
|
|
79
|
-
console.log("[Datasource] - rows requested by grid: ", params.request, params);
|
|
80
|
-
var response = fakeServer.getData(params.request);
|
|
81
|
-
console.log(response, 'request to server');
|
|
82
|
-
// adding delay to simulate real server call
|
|
83
|
-
setTimeout(() => {
|
|
84
|
-
if (response.success) {
|
|
85
|
-
console.log(response, 'response from fake server');
|
|
86
|
-
// call the success callback
|
|
87
|
-
params.success({
|
|
88
|
-
rowData: response.rows,
|
|
89
|
-
rowCount: response.lastRow,
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
// inform the grid request failed
|
|
94
|
-
params.fail();
|
|
95
|
-
}
|
|
96
|
-
}, 1000);
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
// console.log(datasource, 'data source passing');
|
|
100
|
-
// register the datasource with the grid
|
|
101
|
-
params.api.setGridOption("serverSideDatasource", dataSource);
|
|
102
|
-
});
|
|
103
|
-
}, []);
|
|
104
|
-
const fillOperation = (0, react_1.useCallback)((params) => {
|
|
105
|
-
console.log(params.column, 'params columns', params);
|
|
106
|
-
if (params.column.getColId() === "country") {
|
|
107
|
-
return params.currentCellValue;
|
|
108
|
-
}
|
|
109
|
-
return params.values[params.values.length - 1];
|
|
110
|
-
}, []);
|
|
111
|
-
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ style: containerStyle }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ style: gridStyle, className: "ag-theme-quartz" }, { children: (0, jsx_runtime_1.jsx)(react_2.AgGridReact, { columnDefs: columnDefs, defaultColDef: defaultColDef, autoGroupColumnDef: autoGroupColumnDef, rowModelType: "serverSide", cacheBlockSize: 10, onGridReady: onGridReady, suppressServerSideFullWidthLoadingRow: true, enableRangeSelection: true, enableFillHandle: true, fillOperation: fillOperation }) })) })));
|
|
112
|
-
};
|
|
113
|
-
exports.default = GridComponent;
|