sccoreui 6.1.5 → 6.1.7

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.
@@ -43,7 +43,7 @@ exports.ROWMODELTYPE = {
43
43
  CLIENT_SIDE: "clientSide",
44
44
  };
45
45
  exports.BLOCK_SIZE = 100;
46
- exports.MAX_RECORDS_TO_LOAD = 300;
46
+ exports.MAX_RECORDS_TO_LOAD = 2500;
47
47
  exports.MAX_BLOCKS = exports.MAX_RECORDS_TO_LOAD / exports.BLOCK_SIZE;
48
48
  exports.DEBOUNCE_INTERVAL = 200;
49
49
  exports.ROW_HEIGHT = 60;
@@ -17,6 +17,7 @@ function ParentForGrid(props) {
17
17
  rowData: [],
18
18
  columnData: (0, helper_1.sortColumns)(props === null || props === void 0 ? void 0 : props.columnData)
19
19
  });
20
+ let maxLength = 0;
20
21
  const [style] = (0, react_1.useState)(props.style);
21
22
  const [api, setApi] = (0, react_1.useState)(null);
22
23
  const [totalRecords, setTotalRecords] = (0, react_1.useState)(0);
@@ -136,6 +137,7 @@ function ParentForGrid(props) {
136
137
  // setFeatureDetails((prev: any) => ({ ...prev, checkBoxSelection: initialCheckBoxData }));
137
138
  // To identify when to stop the callBack
138
139
  const actualEndRow = (response === null || response === void 0 ? void 0 : response.totalRecords) < constants_1.MAX_RECORDS_TO_LOAD ? response === null || response === void 0 ? void 0 : response.totalRecords : constants_1.MAX_RECORDS_TO_LOAD;
140
+ maxLength = actualEndRow;
139
141
  if (response === null || response === void 0 ? void 0 : response.rowData) {
140
142
  const result = {
141
143
  rowData: response.rowData,
@@ -199,18 +201,32 @@ function ParentForGrid(props) {
199
201
  var _g;
200
202
  const startRow = params.request.startRow;
201
203
  const endRow = params.request.endRow;
204
+ // Scroll should not exit MAX_RECORDS_TO_LOAD
205
+ if (endRow > maxLength && maxLength > 0) {
206
+ gridRef.current.api.hideOverlay();
207
+ // supply rows for requested block to grid
208
+ params.success({
209
+ rowData: gridData.rowData,
210
+ rowCount: maxLength,
211
+ });
212
+ return;
213
+ }
202
214
  // get data for request from our fake server
203
215
  const response = yield getData(startRow, endRow, currentFeatures, params === null || params === void 0 ? void 0 : params.request);
204
216
  // simulating real server call with a 500ms delay
205
217
  if (((_g = response.rowData) === null || _g === void 0 ? void 0 : _g.length) > 0) {
218
+ setGridData(Object.assign(Object.assign({}, gridData), { rowData: response.rowData }));
206
219
  gridRef.current.api.hideOverlay();
207
220
  // supply rows for requested block to grid
208
- params.success({ rowData: response.rowData, rowCount: response === null || response === void 0 ? void 0 : response.actualEndRow });
221
+ params.success({ rowData: response.rowData });
222
+ return;
209
223
  }
210
224
  else {
211
225
  // params.fail();
226
+ const gridRows = startRow >= constants_1.BLOCK_SIZE ? gridData.rowData : [];
212
227
  gridRef.current.api.showNoRowsOverlay();
213
- params.success({ rowData: [], rowCount: 0 });
228
+ params.success({ rowData: gridRows });
229
+ return;
214
230
  }
215
231
  }),
216
232
  };
@@ -6,7 +6,7 @@ export declare const ROWMODELTYPE: {
6
6
  CLIENT_SIDE: string;
7
7
  };
8
8
  export declare const BLOCK_SIZE = 100;
9
- export declare const MAX_RECORDS_TO_LOAD = 300;
9
+ export declare const MAX_RECORDS_TO_LOAD = 2500;
10
10
  export declare const MAX_BLOCKS: number;
11
11
  export declare const DEBOUNCE_INTERVAL = 200;
12
12
  export declare const ROW_HEIGHT = 60;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sccoreui",
3
- "version": "6.1.05",
3
+ "version": "6.1.07",
4
4
  "description": "ui-sccore",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",