sccoreui 5.9.97 → 5.9.99

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.
@@ -10,10 +10,23 @@ const core_2 = require("@ag-grid-enterprise/core");
10
10
  const range_selection_1 = require("@ag-grid-enterprise/range-selection");
11
11
  const infinite_row_model_1 = require("@ag-grid-community/infinite-row-model");
12
12
  const server_side_row_model_1 = require("@ag-grid-enterprise/server-side-row-model");
13
+ const row_grouping_1 = require("@ag-grid-enterprise/row-grouping");
13
14
  const LicenceKey_1 = require("./LicenceKey");
14
- core_1.ModuleRegistry.registerModules([client_side_row_model_1.ClientSideRowModelModule, range_selection_1.RangeSelectionModule, infinite_row_model_1.InfiniteRowModelModule, server_side_row_model_1.ServerSideRowModelModule]);
15
+ const react_2 = require("react");
16
+ core_1.ModuleRegistry.registerModules([client_side_row_model_1.ClientSideRowModelModule, range_selection_1.RangeSelectionModule, infinite_row_model_1.InfiniteRowModelModule, server_side_row_model_1.ServerSideRowModelModule, row_grouping_1.RowGroupingModule]);
15
17
  core_2.LicenseManager.setLicenseKey(LicenceKey_1.LICENSEKEY);
16
18
  const AgGrid = ({ style, gridOptions, onGridReady, gridRef }) => {
17
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ag-theme-quartz ", style: { height: style.height, width: style.width } }, { children: (0, jsx_runtime_1.jsx)(react_1.AgGridReact, Object.assign({ ref: gridRef, onGridReady: onGridReady, reactiveCustomComponents: true }, gridOptions)) })) }));
19
+ // Group info
20
+ const autoGroupColumnDef = (0, react_2.useMemo)(() => {
21
+ return {
22
+ headerName: "Group",
23
+ field: "group",
24
+ cellRenderer: "agGroupCellRenderer",
25
+ cellRendererParams: {
26
+ suppressCount: true,
27
+ },
28
+ };
29
+ }, []);
30
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "ag-theme-quartz ", style: { height: style.height, width: style.width } }, { children: (0, jsx_runtime_1.jsx)(react_1.AgGridReact, Object.assign({ ref: gridRef, onGridReady: onGridReady, reactiveCustomComponents: true, autoGroupColumnDef: autoGroupColumnDef }, gridOptions)) })) }));
18
31
  };
19
32
  exports.default = AgGrid;
@@ -122,14 +122,14 @@ function ParentForGrid(props) {
122
122
  return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "flex align-items-center" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "pr-3 flex align-items-center" }, { children: cellCheckBoxRenderer(cellRendererParams) })), typeof initialRenderer === "function" ? (initialRenderer(cellRendererParams)) : ((0, jsx_runtime_1.jsx)("div", { children: (_a = cellRendererParams === null || cellRendererParams === void 0 ? void 0 : cellRendererParams.data) === null || _a === void 0 ? void 0 : _a[column === null || column === void 0 ? void 0 : column.field] }))] })));
123
123
  };
124
124
  // Callback to products for getting data
125
- const getData = (startRow, endRow, currentFeatures) => tslib_1.__awaiter(this, void 0, void 0, function* () {
125
+ const getData = (startRow, endRow, currentFeatures, params) => tslib_1.__awaiter(this, void 0, void 0, function* () {
126
126
  if (!(props === null || props === void 0 ? void 0 : props.getRowData)) {
127
127
  return emptyResponse; // If callback function to get row data is not provided
128
128
  }
129
129
  if (props.rowModelType !== constants_1.ROWMODELTYPE.SERVER_SIDE) {
130
130
  gridRef.current.api.showLoadingOverlay();
131
131
  }
132
- const response = yield (props === null || props === void 0 ? void 0 : props.getRowData(startRow, endRow, currentFeatures));
132
+ const response = yield (props === null || props === void 0 ? void 0 : props.getRowData(startRow, endRow, currentFeatures, params));
133
133
  setGridData(Object.assign(Object.assign({}, gridData), { rowData: [] }));
134
134
  // Clear selected checkbox
135
135
  // setFeatureDetails((prev: any) => ({ ...prev, checkBoxSelection: initialCheckBoxData }));
@@ -195,22 +195,21 @@ function ParentForGrid(props) {
195
195
  else if (props.rowModelType === constants_1.ROWMODELTYPE.SERVER_SIDE) {
196
196
  const dataSource = {
197
197
  getRows: (params) => tslib_1.__awaiter(this, void 0, void 0, function* () {
198
+ var _g;
198
199
  const startRow = params.request.startRow;
199
200
  const endRow = params.request.endRow;
200
- console.log("[Datasource] - rows requested by grid: ", params.request);
201
201
  // get data for request from our fake server
202
- const response = yield getData(startRow, endRow, currentFeatures);
202
+ const response = yield getData(startRow, endRow, currentFeatures, params === null || params === void 0 ? void 0 : params.request);
203
203
  // simulating real server call with a 500ms delay
204
- setTimeout(() => {
205
- var _a;
206
- if (((_a = response.rowData) === null || _a === void 0 ? void 0 : _a.length) > 0) {
207
- // supply rows for requested block to grid
208
- params.success({ rowData: response.rowData, rowCount: response === null || response === void 0 ? void 0 : response.actualEndRow });
209
- }
210
- else {
211
- params.fail();
212
- }
213
- }, 500);
204
+ if (((_g = response.rowData) === null || _g === void 0 ? void 0 : _g.length) > 0) {
205
+ // supply rows for requested block to grid
206
+ params.success({ rowData: response.rowData, rowCount: response === null || response === void 0 ? void 0 : response.actualEndRow });
207
+ }
208
+ else {
209
+ // params.fail();
210
+ gridRef.current.api.showNoRowsOverlay();
211
+ params.success({ rowData: [], rowCount: 0 });
212
+ }
214
213
  }),
215
214
  };
216
215
  params.api.setGridOption("serverSideDatasource", dataSource);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sccoreui",
3
- "version": "5.9.97",
3
+ "version": "5.9.99",
4
4
  "description": "ui-sccore",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",