@katlux/providers 0.1.1-alpha.117 → 0.1.1-alpha.119

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/index.cjs CHANGED
@@ -4726,15 +4726,19 @@ class CFlatClientDataProvider extends AEncryptedClientProvider {
4726
4726
  this.error = null;
4727
4727
  try {
4728
4728
  this._computeFilteredAndSorted();
4729
- if (this.pageData && this.pageData.length > 0) {
4730
- const { rows, decrypted } = await this.decryptRows(this.pageData);
4729
+ if (this._rowMap && this._rowMap.length > 0) {
4730
+ const { rows, decrypted } = await this.decryptRows(this._rowMap);
4731
4731
  if (decrypted) {
4732
- this.pageData = rows;
4733
- if (this.pageSize <= 0) {
4734
- this._rowMap = rows;
4735
- }
4732
+ this._rowMap = rows;
4736
4733
  }
4737
4734
  }
4735
+ if (this.pageSize <= 0) {
4736
+ this.pageData = this._rowMap;
4737
+ } else {
4738
+ const startIndex = (this.currentPage - 1) * this.pageSize;
4739
+ const endIndex = startIndex + this.pageSize;
4740
+ this.pageData = this._rowMap.slice(startIndex, endIndex);
4741
+ }
4738
4742
  } catch (err) {
4739
4743
  this.error = err;
4740
4744
  console.warn("[Katlux Providers] CFlatClientDataProvider loadPageData error", err);
package/dist/index.d.cts CHANGED
@@ -607,7 +607,7 @@ declare abstract class AEncryptedClientProvider<TRow = TDataRow> extends ADataPr
607
607
  clearEncryption(): void;
608
608
  protected encryptRows(rows: TRow[]): Promise<TRow[]>;
609
609
  protected encryptRowsChunked(rows: TRow[], options?: ISetDataChunkedOptions): Promise<TRow[]>;
610
- protected decryptRows(rows: TRow[]): Promise<{
610
+ decryptRows(rows: TRow[]): Promise<{
611
611
  rows: TRow[];
612
612
  decrypted: boolean;
613
613
  }>;
package/dist/index.d.mts CHANGED
@@ -607,7 +607,7 @@ declare abstract class AEncryptedClientProvider<TRow = TDataRow> extends ADataPr
607
607
  clearEncryption(): void;
608
608
  protected encryptRows(rows: TRow[]): Promise<TRow[]>;
609
609
  protected encryptRowsChunked(rows: TRow[], options?: ISetDataChunkedOptions): Promise<TRow[]>;
610
- protected decryptRows(rows: TRow[]): Promise<{
610
+ decryptRows(rows: TRow[]): Promise<{
611
611
  rows: TRow[];
612
612
  decrypted: boolean;
613
613
  }>;
package/dist/index.d.ts CHANGED
@@ -607,7 +607,7 @@ declare abstract class AEncryptedClientProvider<TRow = TDataRow> extends ADataPr
607
607
  clearEncryption(): void;
608
608
  protected encryptRows(rows: TRow[]): Promise<TRow[]>;
609
609
  protected encryptRowsChunked(rows: TRow[], options?: ISetDataChunkedOptions): Promise<TRow[]>;
610
- protected decryptRows(rows: TRow[]): Promise<{
610
+ decryptRows(rows: TRow[]): Promise<{
611
611
  rows: TRow[];
612
612
  decrypted: boolean;
613
613
  }>;
package/dist/index.mjs CHANGED
@@ -4709,15 +4709,19 @@ class CFlatClientDataProvider extends AEncryptedClientProvider {
4709
4709
  this.error = null;
4710
4710
  try {
4711
4711
  this._computeFilteredAndSorted();
4712
- if (this.pageData && this.pageData.length > 0) {
4713
- const { rows, decrypted } = await this.decryptRows(this.pageData);
4712
+ if (this._rowMap && this._rowMap.length > 0) {
4713
+ const { rows, decrypted } = await this.decryptRows(this._rowMap);
4714
4714
  if (decrypted) {
4715
- this.pageData = rows;
4716
- if (this.pageSize <= 0) {
4717
- this._rowMap = rows;
4718
- }
4715
+ this._rowMap = rows;
4719
4716
  }
4720
4717
  }
4718
+ if (this.pageSize <= 0) {
4719
+ this.pageData = this._rowMap;
4720
+ } else {
4721
+ const startIndex = (this.currentPage - 1) * this.pageSize;
4722
+ const endIndex = startIndex + this.pageSize;
4723
+ this.pageData = this._rowMap.slice(startIndex, endIndex);
4724
+ }
4721
4725
  } catch (err) {
4722
4726
  this.error = err;
4723
4727
  console.warn("[Katlux Providers] CFlatClientDataProvider loadPageData error", err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@katlux/providers",
3
- "version": "0.1.1-alpha.117",
3
+ "version": "0.1.1-alpha.119",
4
4
  "description": "Core data calculation and caching providers for the Katlux ecosystem",
5
5
  "author": "Katlux",
6
6
  "license": "Apache-2.0",