@singularsystems/neo-core 1.3.4 → 1.3.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Neo core changelog
2
2
 
3
+ ## Version 1.3.5 (30 Oct 2025)
4
+
5
+ - PageManager
6
+ - Fixed an issue with the total number of records that would affect the page controls display.
7
+
3
8
  ## Version 1.3.4 (15 Oct 2025)
4
9
 
5
10
  - JsonSchema
@@ -98,7 +98,8 @@ export declare class PageManager<TCriteria extends ValueObject, TModel extends I
98
98
  taskRunner: ITaskRunner;
99
99
  private hasInitialised;
100
100
  private pageRequest;
101
- private _totalExternalRecords;
101
+ private _loadedPageRecords;
102
+ private _totalRecords;
102
103
  private currentData;
103
104
  private initialFetchState;
104
105
  private isInvalidated;
@@ -13,7 +13,8 @@ var PageManager = /** @class */ (function (_super) {
13
13
  _this.modelType = modelType;
14
14
  _this.dataSource = dataSource;
15
15
  _this.hasInitialised = false;
16
- _this._totalExternalRecords = -1;
16
+ _this._loadedPageRecords = 0;
17
+ _this._totalRecords = 0;
17
18
  _this.currentData = new List(_this.modelType);
18
19
  _this.initialFetchState = "none";
19
20
  _this.isInvalidated = false;
@@ -104,7 +105,7 @@ var PageManager = /** @class */ (function (_super) {
104
105
  });
105
106
  Object.defineProperty(PageManager.prototype, "totalRecords", {
106
107
  get: function () {
107
- return this._totalExternalRecords + this.data.length;
108
+ return this._totalRecords - this._loadedPageRecords + this.data.length;
108
109
  },
109
110
  enumerable: false,
110
111
  configurable: true
@@ -238,8 +239,9 @@ var PageManager = /** @class */ (function (_super) {
238
239
  return __generator(this, function (_a) {
239
240
  switch (_a.label) {
240
241
  case 0:
242
+ this._loadedPageRecords = pageRecords.length;
241
243
  if (totalRecords >= 0) {
242
- this._totalExternalRecords = totalRecords - pageRecords.length;
244
+ this._totalRecords = totalRecords;
243
245
  }
244
246
  newData = List.fromJSArray(this.modelType, pageRecords, this.options.deserialiseOptions);
245
247
  if (!this.options.afterFetch) return [3 /*break*/, 2];
@@ -274,7 +276,8 @@ var PageManager = /** @class */ (function (_super) {
274
276
  PageManager.prototype.reset = function () {
275
277
  this.initialFetchState = "none";
276
278
  this.data.set([]);
277
- this._totalExternalRecords = 0;
279
+ this._totalRecords = 0;
280
+ this._loadedPageRecords = 0;
278
281
  };
279
282
  /**
280
283
  * Resets the sort properties. A new sort property can be provided.
@@ -350,7 +353,11 @@ var PageManager = /** @class */ (function (_super) {
350
353
  __decorate([
351
354
  Observable(),
352
355
  __metadata("design:type", Number)
353
- ], PageManager.prototype, "_totalExternalRecords", void 0);
356
+ ], PageManager.prototype, "_loadedPageRecords", void 0);
357
+ __decorate([
358
+ Observable(),
359
+ __metadata("design:type", Number)
360
+ ], PageManager.prototype, "_totalRecords", void 0);
354
361
  __decorate([
355
362
  Observable(),
356
363
  __metadata("design:type", Object)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@singularsystems/neo-core",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "description": "Core functionality for the Neo client library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",