sccoreui 6.1.4 → 6.1.6

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.
@@ -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.GridCheckBoxStatus = exports.conditionsList = exports.PRODUCTTYPE = exports.ROW_HEIGHT = exports.DEBOUNCE_INTERVAL = exports.MAX_BLOCKS = 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.GridCheckBoxStatus = 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 },
@@ -43,7 +43,8 @@ exports.ROWMODELTYPE = {
43
43
  CLIENT_SIDE: "clientSide",
44
44
  };
45
45
  exports.BLOCK_SIZE = 100;
46
- exports.MAX_BLOCKS = 2;
46
+ exports.MAX_RECORDS_TO_LOAD = 2500;
47
+ exports.MAX_BLOCKS = exports.MAX_RECORDS_TO_LOAD / exports.BLOCK_SIZE;
47
48
  exports.DEBOUNCE_INTERVAL = 200;
48
49
  exports.ROW_HEIGHT = 60;
49
50
  const DEFAULTGUID = "000000000000000000000000";
@@ -135,7 +135,7 @@ function ParentForGrid(props) {
135
135
  // Clear selected checkbox
136
136
  // setFeatureDetails((prev: any) => ({ ...prev, checkBoxSelection: initialCheckBoxData }));
137
137
  // To identify when to stop the callBack
138
- const actualEndRow = response === null || response === void 0 ? void 0 : response.totalRecords;
138
+ 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;
139
139
  if (response === null || response === void 0 ? void 0 : response.rowData) {
140
140
  const result = {
141
141
  rowData: response.rowData,
@@ -199,13 +199,24 @@ function ParentForGrid(props) {
199
199
  var _g;
200
200
  const startRow = params.request.startRow;
201
201
  const endRow = params.request.endRow;
202
+ // Scroll should not exit MAX_RECORDS_TO_LOAD count
203
+ if (endRow > constants_1.MAX_RECORDS_TO_LOAD) {
204
+ gridRef.current.api.hideOverlay();
205
+ // supply rows for requested block to grid
206
+ params.success({
207
+ rowData: gridData.rowData,
208
+ rowCount: constants_1.MAX_RECORDS_TO_LOAD,
209
+ });
210
+ return;
211
+ }
202
212
  // get data for request from our fake server
203
213
  const response = yield getData(startRow, endRow, currentFeatures, params === null || params === void 0 ? void 0 : params.request);
204
214
  // simulating real server call with a 500ms delay
205
215
  if (((_g = response.rowData) === null || _g === void 0 ? void 0 : _g.length) > 0) {
216
+ setGridData(Object.assign(Object.assign({}, gridData), { rowData: response.rowData }));
206
217
  gridRef.current.api.hideOverlay();
207
218
  // supply rows for requested block to grid
208
- params.success({ rowData: response.rowData, rowCount: response === null || response === void 0 ? void 0 : response.actualEndRow });
219
+ params.success({ rowData: response.rowData });
209
220
  }
210
221
  else {
211
222
  // params.fail();
@@ -6,7 +6,8 @@ export declare const ROWMODELTYPE: {
6
6
  CLIENT_SIDE: string;
7
7
  };
8
8
  export declare const BLOCK_SIZE = 100;
9
- export declare const MAX_BLOCKS = 2;
9
+ export declare const MAX_RECORDS_TO_LOAD = 2500;
10
+ export declare const MAX_BLOCKS: number;
10
11
  export declare const DEBOUNCE_INTERVAL = 200;
11
12
  export declare const ROW_HEIGHT = 60;
12
13
  declare const DEFAULTGUID = "000000000000000000000000";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sccoreui",
3
- "version": "6.1.04",
3
+ "version": "6.1.06",
4
4
  "description": "ui-sccore",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",