@katlux/providers 0.1.1-alpha.119 → 0.1.1-alpha.120
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 +72 -24
- package/dist/index.d.cts +2 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +72 -24
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4296,7 +4296,8 @@ class AEncryptedClientProvider extends ADataProvider {
|
|
|
4296
4296
|
if (!this.isEncryptionEnabled || !rows || rows.length === 0) {
|
|
4297
4297
|
return { rows, decrypted: false };
|
|
4298
4298
|
}
|
|
4299
|
-
|
|
4299
|
+
const url = this.apiUrl || void 0;
|
|
4300
|
+
return await decryptPageRows(rows, this.encryption, url, this.idKey);
|
|
4300
4301
|
}
|
|
4301
4302
|
async setDataChunked(data, options) {
|
|
4302
4303
|
const ret = this.setData(data);
|
|
@@ -4645,6 +4646,11 @@ class CFlatClientDataProvider extends AEncryptedClientProvider {
|
|
|
4645
4646
|
this._sortDirty = true;
|
|
4646
4647
|
super.setSortList(sortList, immediate);
|
|
4647
4648
|
}
|
|
4649
|
+
clearEncryption() {
|
|
4650
|
+
super.clearEncryption();
|
|
4651
|
+
this._filterDirty = true;
|
|
4652
|
+
this._sortDirty = true;
|
|
4653
|
+
}
|
|
4648
4654
|
/**
|
|
4649
4655
|
* Explicitly rebuilds the reference map array if row properties inside allData were mutated in-place.
|
|
4650
4656
|
*/
|
|
@@ -4675,7 +4681,7 @@ class CFlatClientDataProvider extends AEncryptedClientProvider {
|
|
|
4675
4681
|
if (this.sortList.length > 0) {
|
|
4676
4682
|
this._sortDirty = true;
|
|
4677
4683
|
} else {
|
|
4678
|
-
this._rowMap = this.filteredData;
|
|
4684
|
+
this._rowMap = this.isEncryptionEnabled ? [...this.filteredData] : this.filteredData;
|
|
4679
4685
|
this._sortDirty = false;
|
|
4680
4686
|
}
|
|
4681
4687
|
}
|
|
@@ -4683,7 +4689,7 @@ class CFlatClientDataProvider extends AEncryptedClientProvider {
|
|
|
4683
4689
|
if (this.sortList.length > 0) {
|
|
4684
4690
|
this._rowMap = sortData(this.sortList, this.filteredData);
|
|
4685
4691
|
} else {
|
|
4686
|
-
this._rowMap = this.filteredData;
|
|
4692
|
+
this._rowMap = this.isEncryptionEnabled ? [...this.filteredData] : this.filteredData;
|
|
4687
4693
|
}
|
|
4688
4694
|
this._sortDirty = false;
|
|
4689
4695
|
}
|
|
@@ -4726,19 +4732,16 @@ class CFlatClientDataProvider extends AEncryptedClientProvider {
|
|
|
4726
4732
|
this.error = null;
|
|
4727
4733
|
try {
|
|
4728
4734
|
this._computeFilteredAndSorted();
|
|
4729
|
-
if (this.
|
|
4730
|
-
const { rows, decrypted } = await this.decryptRows(this.
|
|
4735
|
+
if (this.pageData && this.pageData.length > 0) {
|
|
4736
|
+
const { rows, decrypted } = await this.decryptRows(this.pageData);
|
|
4731
4737
|
if (decrypted) {
|
|
4732
|
-
this.
|
|
4738
|
+
this.pageData = rows;
|
|
4739
|
+
const startIndex = this.pageSize <= 0 ? 0 : (this.currentPage - 1) * this.pageSize;
|
|
4740
|
+
for (let i = 0; i < rows.length; i++) {
|
|
4741
|
+
this._rowMap[startIndex + i] = rows[i];
|
|
4742
|
+
}
|
|
4733
4743
|
}
|
|
4734
4744
|
}
|
|
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
|
-
}
|
|
4742
4745
|
} catch (err) {
|
|
4743
4746
|
this.error = err;
|
|
4744
4747
|
console.warn("[Katlux Providers] CFlatClientDataProvider loadPageData error", err);
|
|
@@ -7102,8 +7105,13 @@ class CFlatServerDataProvider extends ADataProvider {
|
|
|
7102
7105
|
const normalized = normalizeDataResult(result);
|
|
7103
7106
|
if (normalized) {
|
|
7104
7107
|
if (requestId !== this.latestRequestId) return;
|
|
7108
|
+
let rows = normalized.rows;
|
|
7109
|
+
if (this.encryption?.enabled && rows && rows.length > 0) {
|
|
7110
|
+
const { rows: decRows, decrypted } = await decryptPageRows(rows, this.encryption, void 0, this.idKey);
|
|
7111
|
+
if (decrypted) rows = decRows;
|
|
7112
|
+
}
|
|
7105
7113
|
this.batchUpdates(() => {
|
|
7106
|
-
this.pageData =
|
|
7114
|
+
this.pageData = rows;
|
|
7107
7115
|
this.rowCount = normalized.rowCount;
|
|
7108
7116
|
this.initialLoad = false;
|
|
7109
7117
|
});
|
|
@@ -7115,8 +7123,13 @@ class CFlatServerDataProvider extends ADataProvider {
|
|
|
7115
7123
|
const normalized = normalizeDataResult(result);
|
|
7116
7124
|
if (normalized) {
|
|
7117
7125
|
if (requestId !== this.latestRequestId) return;
|
|
7126
|
+
let rows = normalized.rows;
|
|
7127
|
+
if (this.encryption?.enabled && rows && rows.length > 0) {
|
|
7128
|
+
const { rows: decRows, decrypted } = await decryptPageRows(rows, this.encryption, void 0, this.idKey);
|
|
7129
|
+
if (decrypted) rows = decRows;
|
|
7130
|
+
}
|
|
7118
7131
|
this.batchUpdates(() => {
|
|
7119
|
-
this.pageData =
|
|
7132
|
+
this.pageData = rows;
|
|
7120
7133
|
this.rowCount = normalized.rowCount;
|
|
7121
7134
|
this.initialLoad = false;
|
|
7122
7135
|
});
|
|
@@ -7186,10 +7199,15 @@ class CAPIFlatServerDataProvider extends CFlatServerDataProvider {
|
|
|
7186
7199
|
this.encryption = options.encryption;
|
|
7187
7200
|
this.requestProvider.setEncryption(options.encryption);
|
|
7188
7201
|
}
|
|
7189
|
-
this.requestProvider.onDataReceived((data, generation) => {
|
|
7202
|
+
this.requestProvider.onDataReceived(async (data, generation) => {
|
|
7190
7203
|
if (generation !== void 0 && generation !== this._requestGeneration) return;
|
|
7191
7204
|
if (data) {
|
|
7192
|
-
|
|
7205
|
+
let rows = data.rows || data;
|
|
7206
|
+
if (this.encryption?.enabled && Array.isArray(rows) && rows.length > 0) {
|
|
7207
|
+
const { rows: decRows, decrypted } = await decryptPageRows(rows, this.encryption, void 0, this.idKey);
|
|
7208
|
+
if (decrypted) rows = decRows;
|
|
7209
|
+
}
|
|
7210
|
+
this.pageData = rows;
|
|
7193
7211
|
if (data.rowCount !== void 0) {
|
|
7194
7212
|
this.rowCount = data.rowCount;
|
|
7195
7213
|
}
|
|
@@ -7744,8 +7762,11 @@ class CTreeClientDataProvider extends CFlatClientDataProvider {
|
|
|
7744
7762
|
const { rows, decrypted } = await this.decryptRows(this.pageData);
|
|
7745
7763
|
if (decrypted) {
|
|
7746
7764
|
this.pageData = rows;
|
|
7747
|
-
|
|
7748
|
-
|
|
7765
|
+
const startIndex = this.pageSize <= 0 ? 0 : (this.currentPage - 1) * this.pageSize;
|
|
7766
|
+
if (this._allVisibleRowsCache) {
|
|
7767
|
+
for (let i = 0; i < rows.length; i++) {
|
|
7768
|
+
this._allVisibleRowsCache[startIndex + i] = rows[i];
|
|
7769
|
+
}
|
|
7749
7770
|
}
|
|
7750
7771
|
}
|
|
7751
7772
|
}
|
|
@@ -7758,6 +7779,13 @@ class CTreeClientDataProvider extends CFlatClientDataProvider {
|
|
|
7758
7779
|
}
|
|
7759
7780
|
});
|
|
7760
7781
|
}
|
|
7782
|
+
clearEncryption() {
|
|
7783
|
+
super.clearEncryption();
|
|
7784
|
+
this._filterDirty = true;
|
|
7785
|
+
this._sortDirty = true;
|
|
7786
|
+
this._filteredNodesCache = null;
|
|
7787
|
+
this._allVisibleRowsCache = null;
|
|
7788
|
+
}
|
|
7761
7789
|
// Public Tree API
|
|
7762
7790
|
get treeNodes() {
|
|
7763
7791
|
return this._staticNodes.map((node) => ({
|
|
@@ -7798,6 +7826,12 @@ class CTreeClientDataProvider extends CFlatClientDataProvider {
|
|
|
7798
7826
|
...node,
|
|
7799
7827
|
__treeNode: node
|
|
7800
7828
|
}));
|
|
7829
|
+
if (this.isEncryptionEnabled && this.pageData && this.pageData.length > 0) {
|
|
7830
|
+
const startIndex = this.pageSize <= 0 ? 0 : (this.currentPage - 1) * this.pageSize;
|
|
7831
|
+
for (let i = 0; i < this.pageData.length; i++) {
|
|
7832
|
+
this._allVisibleRowsCache[startIndex + i] = this.pageData[i];
|
|
7833
|
+
}
|
|
7834
|
+
}
|
|
7801
7835
|
}
|
|
7802
7836
|
return this._allVisibleRowsCache;
|
|
7803
7837
|
}
|
|
@@ -8262,8 +8296,13 @@ class CTreeServerDataProvider extends ADataProvider {
|
|
|
8262
8296
|
const normalized = normalizeDataResult(result);
|
|
8263
8297
|
if (normalized) {
|
|
8264
8298
|
if (requestId !== this.latestRequestId) return;
|
|
8299
|
+
let rows = normalized.rows;
|
|
8300
|
+
if (this.encryption?.enabled && rows && rows.length > 0) {
|
|
8301
|
+
const { rows: decRows, decrypted } = await decryptPageRows(rows, this.encryption, void 0, this.idKey);
|
|
8302
|
+
if (decrypted) rows = decRows;
|
|
8303
|
+
}
|
|
8265
8304
|
this.batchUpdates(() => {
|
|
8266
|
-
this.pageData =
|
|
8305
|
+
this.pageData = rows;
|
|
8267
8306
|
this.rowCount = normalized.rowCount;
|
|
8268
8307
|
this.initialLoad = false;
|
|
8269
8308
|
});
|
|
@@ -8275,8 +8314,13 @@ class CTreeServerDataProvider extends ADataProvider {
|
|
|
8275
8314
|
const normalized = normalizeDataResult(result);
|
|
8276
8315
|
if (normalized) {
|
|
8277
8316
|
if (requestId !== this.latestRequestId) return;
|
|
8317
|
+
let rows = normalized.rows;
|
|
8318
|
+
if (this.encryption?.enabled && rows && rows.length > 0) {
|
|
8319
|
+
const { rows: decRows, decrypted } = await decryptPageRows(rows, this.encryption, void 0, this.idKey);
|
|
8320
|
+
if (decrypted) rows = decRows;
|
|
8321
|
+
}
|
|
8278
8322
|
this.batchUpdates(() => {
|
|
8279
|
-
this.pageData =
|
|
8323
|
+
this.pageData = rows;
|
|
8280
8324
|
this.rowCount = normalized.rowCount;
|
|
8281
8325
|
this.initialLoad = false;
|
|
8282
8326
|
});
|
|
@@ -8389,14 +8433,18 @@ class CAPITreeServerDataProvider extends CTreeServerDataProvider {
|
|
|
8389
8433
|
this.encryption = options.encryption;
|
|
8390
8434
|
this.requestProvider.setEncryption(options.encryption);
|
|
8391
8435
|
}
|
|
8392
|
-
this.requestProvider.onDataReceived((data, generation) => {
|
|
8436
|
+
this.requestProvider.onDataReceived(async (data, generation) => {
|
|
8393
8437
|
if (generation !== void 0 && generation !== this._requestGeneration) return;
|
|
8394
8438
|
if (data) {
|
|
8395
|
-
|
|
8439
|
+
let rows = data.rows || data;
|
|
8440
|
+
if (this.encryption?.enabled && Array.isArray(rows) && rows.length > 0) {
|
|
8441
|
+
const { rows: decRows, decrypted } = await decryptPageRows(rows, this.encryption, void 0, this.idKey);
|
|
8442
|
+
if (decrypted) rows = decRows;
|
|
8443
|
+
}
|
|
8444
|
+
this.pageData = rows;
|
|
8396
8445
|
if (data.rowCount !== void 0) {
|
|
8397
8446
|
this.rowCount = data.rowCount;
|
|
8398
8447
|
}
|
|
8399
|
-
this.notify();
|
|
8400
8448
|
}
|
|
8401
8449
|
});
|
|
8402
8450
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -633,6 +633,7 @@ declare class CFlatClientDataProvider<TRow = TDataRow> extends AEncryptedClientP
|
|
|
633
633
|
protected onSortUpdated(): void;
|
|
634
634
|
setFilter(filter: IDataFilter | null, immediate?: boolean): void;
|
|
635
635
|
setSortList(sortList: IDataSort[], immediate?: boolean): void;
|
|
636
|
+
clearEncryption(): void;
|
|
636
637
|
/**
|
|
637
638
|
* Explicitly rebuilds the reference map array if row properties inside allData were mutated in-place.
|
|
638
639
|
*/
|
|
@@ -821,6 +822,7 @@ declare class CTreeClientDataProvider<TRow extends TDataRow = TDataRow> extends
|
|
|
821
822
|
private paginateNodes;
|
|
822
823
|
private updatePageData;
|
|
823
824
|
loadPageData(): Promise<void>;
|
|
825
|
+
clearEncryption(): void;
|
|
824
826
|
get treeNodes(): ITreeNode<TRow>[];
|
|
825
827
|
get allVisibleNodes(): ITreeNode<TRow>[];
|
|
826
828
|
get rowMap(): readonly (TRow & ITreeNode<TRow> & {
|
package/dist/index.d.mts
CHANGED
|
@@ -633,6 +633,7 @@ declare class CFlatClientDataProvider<TRow = TDataRow> extends AEncryptedClientP
|
|
|
633
633
|
protected onSortUpdated(): void;
|
|
634
634
|
setFilter(filter: IDataFilter | null, immediate?: boolean): void;
|
|
635
635
|
setSortList(sortList: IDataSort[], immediate?: boolean): void;
|
|
636
|
+
clearEncryption(): void;
|
|
636
637
|
/**
|
|
637
638
|
* Explicitly rebuilds the reference map array if row properties inside allData were mutated in-place.
|
|
638
639
|
*/
|
|
@@ -821,6 +822,7 @@ declare class CTreeClientDataProvider<TRow extends TDataRow = TDataRow> extends
|
|
|
821
822
|
private paginateNodes;
|
|
822
823
|
private updatePageData;
|
|
823
824
|
loadPageData(): Promise<void>;
|
|
825
|
+
clearEncryption(): void;
|
|
824
826
|
get treeNodes(): ITreeNode<TRow>[];
|
|
825
827
|
get allVisibleNodes(): ITreeNode<TRow>[];
|
|
826
828
|
get rowMap(): readonly (TRow & ITreeNode<TRow> & {
|
package/dist/index.d.ts
CHANGED
|
@@ -633,6 +633,7 @@ declare class CFlatClientDataProvider<TRow = TDataRow> extends AEncryptedClientP
|
|
|
633
633
|
protected onSortUpdated(): void;
|
|
634
634
|
setFilter(filter: IDataFilter | null, immediate?: boolean): void;
|
|
635
635
|
setSortList(sortList: IDataSort[], immediate?: boolean): void;
|
|
636
|
+
clearEncryption(): void;
|
|
636
637
|
/**
|
|
637
638
|
* Explicitly rebuilds the reference map array if row properties inside allData were mutated in-place.
|
|
638
639
|
*/
|
|
@@ -821,6 +822,7 @@ declare class CTreeClientDataProvider<TRow extends TDataRow = TDataRow> extends
|
|
|
821
822
|
private paginateNodes;
|
|
822
823
|
private updatePageData;
|
|
823
824
|
loadPageData(): Promise<void>;
|
|
825
|
+
clearEncryption(): void;
|
|
824
826
|
get treeNodes(): ITreeNode<TRow>[];
|
|
825
827
|
get allVisibleNodes(): ITreeNode<TRow>[];
|
|
826
828
|
get rowMap(): readonly (TRow & ITreeNode<TRow> & {
|
package/dist/index.mjs
CHANGED
|
@@ -4279,7 +4279,8 @@ class AEncryptedClientProvider extends ADataProvider {
|
|
|
4279
4279
|
if (!this.isEncryptionEnabled || !rows || rows.length === 0) {
|
|
4280
4280
|
return { rows, decrypted: false };
|
|
4281
4281
|
}
|
|
4282
|
-
|
|
4282
|
+
const url = this.apiUrl || void 0;
|
|
4283
|
+
return await decryptPageRows(rows, this.encryption, url, this.idKey);
|
|
4283
4284
|
}
|
|
4284
4285
|
async setDataChunked(data, options) {
|
|
4285
4286
|
const ret = this.setData(data);
|
|
@@ -4628,6 +4629,11 @@ class CFlatClientDataProvider extends AEncryptedClientProvider {
|
|
|
4628
4629
|
this._sortDirty = true;
|
|
4629
4630
|
super.setSortList(sortList, immediate);
|
|
4630
4631
|
}
|
|
4632
|
+
clearEncryption() {
|
|
4633
|
+
super.clearEncryption();
|
|
4634
|
+
this._filterDirty = true;
|
|
4635
|
+
this._sortDirty = true;
|
|
4636
|
+
}
|
|
4631
4637
|
/**
|
|
4632
4638
|
* Explicitly rebuilds the reference map array if row properties inside allData were mutated in-place.
|
|
4633
4639
|
*/
|
|
@@ -4658,7 +4664,7 @@ class CFlatClientDataProvider extends AEncryptedClientProvider {
|
|
|
4658
4664
|
if (this.sortList.length > 0) {
|
|
4659
4665
|
this._sortDirty = true;
|
|
4660
4666
|
} else {
|
|
4661
|
-
this._rowMap = this.filteredData;
|
|
4667
|
+
this._rowMap = this.isEncryptionEnabled ? [...this.filteredData] : this.filteredData;
|
|
4662
4668
|
this._sortDirty = false;
|
|
4663
4669
|
}
|
|
4664
4670
|
}
|
|
@@ -4666,7 +4672,7 @@ class CFlatClientDataProvider extends AEncryptedClientProvider {
|
|
|
4666
4672
|
if (this.sortList.length > 0) {
|
|
4667
4673
|
this._rowMap = sortData(this.sortList, this.filteredData);
|
|
4668
4674
|
} else {
|
|
4669
|
-
this._rowMap = this.filteredData;
|
|
4675
|
+
this._rowMap = this.isEncryptionEnabled ? [...this.filteredData] : this.filteredData;
|
|
4670
4676
|
}
|
|
4671
4677
|
this._sortDirty = false;
|
|
4672
4678
|
}
|
|
@@ -4709,19 +4715,16 @@ class CFlatClientDataProvider extends AEncryptedClientProvider {
|
|
|
4709
4715
|
this.error = null;
|
|
4710
4716
|
try {
|
|
4711
4717
|
this._computeFilteredAndSorted();
|
|
4712
|
-
if (this.
|
|
4713
|
-
const { rows, decrypted } = await this.decryptRows(this.
|
|
4718
|
+
if (this.pageData && this.pageData.length > 0) {
|
|
4719
|
+
const { rows, decrypted } = await this.decryptRows(this.pageData);
|
|
4714
4720
|
if (decrypted) {
|
|
4715
|
-
this.
|
|
4721
|
+
this.pageData = rows;
|
|
4722
|
+
const startIndex = this.pageSize <= 0 ? 0 : (this.currentPage - 1) * this.pageSize;
|
|
4723
|
+
for (let i = 0; i < rows.length; i++) {
|
|
4724
|
+
this._rowMap[startIndex + i] = rows[i];
|
|
4725
|
+
}
|
|
4716
4726
|
}
|
|
4717
4727
|
}
|
|
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
|
-
}
|
|
4725
4728
|
} catch (err) {
|
|
4726
4729
|
this.error = err;
|
|
4727
4730
|
console.warn("[Katlux Providers] CFlatClientDataProvider loadPageData error", err);
|
|
@@ -7085,8 +7088,13 @@ class CFlatServerDataProvider extends ADataProvider {
|
|
|
7085
7088
|
const normalized = normalizeDataResult(result);
|
|
7086
7089
|
if (normalized) {
|
|
7087
7090
|
if (requestId !== this.latestRequestId) return;
|
|
7091
|
+
let rows = normalized.rows;
|
|
7092
|
+
if (this.encryption?.enabled && rows && rows.length > 0) {
|
|
7093
|
+
const { rows: decRows, decrypted } = await decryptPageRows(rows, this.encryption, void 0, this.idKey);
|
|
7094
|
+
if (decrypted) rows = decRows;
|
|
7095
|
+
}
|
|
7088
7096
|
this.batchUpdates(() => {
|
|
7089
|
-
this.pageData =
|
|
7097
|
+
this.pageData = rows;
|
|
7090
7098
|
this.rowCount = normalized.rowCount;
|
|
7091
7099
|
this.initialLoad = false;
|
|
7092
7100
|
});
|
|
@@ -7098,8 +7106,13 @@ class CFlatServerDataProvider extends ADataProvider {
|
|
|
7098
7106
|
const normalized = normalizeDataResult(result);
|
|
7099
7107
|
if (normalized) {
|
|
7100
7108
|
if (requestId !== this.latestRequestId) return;
|
|
7109
|
+
let rows = normalized.rows;
|
|
7110
|
+
if (this.encryption?.enabled && rows && rows.length > 0) {
|
|
7111
|
+
const { rows: decRows, decrypted } = await decryptPageRows(rows, this.encryption, void 0, this.idKey);
|
|
7112
|
+
if (decrypted) rows = decRows;
|
|
7113
|
+
}
|
|
7101
7114
|
this.batchUpdates(() => {
|
|
7102
|
-
this.pageData =
|
|
7115
|
+
this.pageData = rows;
|
|
7103
7116
|
this.rowCount = normalized.rowCount;
|
|
7104
7117
|
this.initialLoad = false;
|
|
7105
7118
|
});
|
|
@@ -7169,10 +7182,15 @@ class CAPIFlatServerDataProvider extends CFlatServerDataProvider {
|
|
|
7169
7182
|
this.encryption = options.encryption;
|
|
7170
7183
|
this.requestProvider.setEncryption(options.encryption);
|
|
7171
7184
|
}
|
|
7172
|
-
this.requestProvider.onDataReceived((data, generation) => {
|
|
7185
|
+
this.requestProvider.onDataReceived(async (data, generation) => {
|
|
7173
7186
|
if (generation !== void 0 && generation !== this._requestGeneration) return;
|
|
7174
7187
|
if (data) {
|
|
7175
|
-
|
|
7188
|
+
let rows = data.rows || data;
|
|
7189
|
+
if (this.encryption?.enabled && Array.isArray(rows) && rows.length > 0) {
|
|
7190
|
+
const { rows: decRows, decrypted } = await decryptPageRows(rows, this.encryption, void 0, this.idKey);
|
|
7191
|
+
if (decrypted) rows = decRows;
|
|
7192
|
+
}
|
|
7193
|
+
this.pageData = rows;
|
|
7176
7194
|
if (data.rowCount !== void 0) {
|
|
7177
7195
|
this.rowCount = data.rowCount;
|
|
7178
7196
|
}
|
|
@@ -7727,8 +7745,11 @@ class CTreeClientDataProvider extends CFlatClientDataProvider {
|
|
|
7727
7745
|
const { rows, decrypted } = await this.decryptRows(this.pageData);
|
|
7728
7746
|
if (decrypted) {
|
|
7729
7747
|
this.pageData = rows;
|
|
7730
|
-
|
|
7731
|
-
|
|
7748
|
+
const startIndex = this.pageSize <= 0 ? 0 : (this.currentPage - 1) * this.pageSize;
|
|
7749
|
+
if (this._allVisibleRowsCache) {
|
|
7750
|
+
for (let i = 0; i < rows.length; i++) {
|
|
7751
|
+
this._allVisibleRowsCache[startIndex + i] = rows[i];
|
|
7752
|
+
}
|
|
7732
7753
|
}
|
|
7733
7754
|
}
|
|
7734
7755
|
}
|
|
@@ -7741,6 +7762,13 @@ class CTreeClientDataProvider extends CFlatClientDataProvider {
|
|
|
7741
7762
|
}
|
|
7742
7763
|
});
|
|
7743
7764
|
}
|
|
7765
|
+
clearEncryption() {
|
|
7766
|
+
super.clearEncryption();
|
|
7767
|
+
this._filterDirty = true;
|
|
7768
|
+
this._sortDirty = true;
|
|
7769
|
+
this._filteredNodesCache = null;
|
|
7770
|
+
this._allVisibleRowsCache = null;
|
|
7771
|
+
}
|
|
7744
7772
|
// Public Tree API
|
|
7745
7773
|
get treeNodes() {
|
|
7746
7774
|
return this._staticNodes.map((node) => ({
|
|
@@ -7781,6 +7809,12 @@ class CTreeClientDataProvider extends CFlatClientDataProvider {
|
|
|
7781
7809
|
...node,
|
|
7782
7810
|
__treeNode: node
|
|
7783
7811
|
}));
|
|
7812
|
+
if (this.isEncryptionEnabled && this.pageData && this.pageData.length > 0) {
|
|
7813
|
+
const startIndex = this.pageSize <= 0 ? 0 : (this.currentPage - 1) * this.pageSize;
|
|
7814
|
+
for (let i = 0; i < this.pageData.length; i++) {
|
|
7815
|
+
this._allVisibleRowsCache[startIndex + i] = this.pageData[i];
|
|
7816
|
+
}
|
|
7817
|
+
}
|
|
7784
7818
|
}
|
|
7785
7819
|
return this._allVisibleRowsCache;
|
|
7786
7820
|
}
|
|
@@ -8245,8 +8279,13 @@ class CTreeServerDataProvider extends ADataProvider {
|
|
|
8245
8279
|
const normalized = normalizeDataResult(result);
|
|
8246
8280
|
if (normalized) {
|
|
8247
8281
|
if (requestId !== this.latestRequestId) return;
|
|
8282
|
+
let rows = normalized.rows;
|
|
8283
|
+
if (this.encryption?.enabled && rows && rows.length > 0) {
|
|
8284
|
+
const { rows: decRows, decrypted } = await decryptPageRows(rows, this.encryption, void 0, this.idKey);
|
|
8285
|
+
if (decrypted) rows = decRows;
|
|
8286
|
+
}
|
|
8248
8287
|
this.batchUpdates(() => {
|
|
8249
|
-
this.pageData =
|
|
8288
|
+
this.pageData = rows;
|
|
8250
8289
|
this.rowCount = normalized.rowCount;
|
|
8251
8290
|
this.initialLoad = false;
|
|
8252
8291
|
});
|
|
@@ -8258,8 +8297,13 @@ class CTreeServerDataProvider extends ADataProvider {
|
|
|
8258
8297
|
const normalized = normalizeDataResult(result);
|
|
8259
8298
|
if (normalized) {
|
|
8260
8299
|
if (requestId !== this.latestRequestId) return;
|
|
8300
|
+
let rows = normalized.rows;
|
|
8301
|
+
if (this.encryption?.enabled && rows && rows.length > 0) {
|
|
8302
|
+
const { rows: decRows, decrypted } = await decryptPageRows(rows, this.encryption, void 0, this.idKey);
|
|
8303
|
+
if (decrypted) rows = decRows;
|
|
8304
|
+
}
|
|
8261
8305
|
this.batchUpdates(() => {
|
|
8262
|
-
this.pageData =
|
|
8306
|
+
this.pageData = rows;
|
|
8263
8307
|
this.rowCount = normalized.rowCount;
|
|
8264
8308
|
this.initialLoad = false;
|
|
8265
8309
|
});
|
|
@@ -8372,14 +8416,18 @@ class CAPITreeServerDataProvider extends CTreeServerDataProvider {
|
|
|
8372
8416
|
this.encryption = options.encryption;
|
|
8373
8417
|
this.requestProvider.setEncryption(options.encryption);
|
|
8374
8418
|
}
|
|
8375
|
-
this.requestProvider.onDataReceived((data, generation) => {
|
|
8419
|
+
this.requestProvider.onDataReceived(async (data, generation) => {
|
|
8376
8420
|
if (generation !== void 0 && generation !== this._requestGeneration) return;
|
|
8377
8421
|
if (data) {
|
|
8378
|
-
|
|
8422
|
+
let rows = data.rows || data;
|
|
8423
|
+
if (this.encryption?.enabled && Array.isArray(rows) && rows.length > 0) {
|
|
8424
|
+
const { rows: decRows, decrypted } = await decryptPageRows(rows, this.encryption, void 0, this.idKey);
|
|
8425
|
+
if (decrypted) rows = decRows;
|
|
8426
|
+
}
|
|
8427
|
+
this.pageData = rows;
|
|
8379
8428
|
if (data.rowCount !== void 0) {
|
|
8380
8429
|
this.rowCount = data.rowCount;
|
|
8381
8430
|
}
|
|
8382
|
-
this.notify();
|
|
8383
8431
|
}
|
|
8384
8432
|
});
|
|
8385
8433
|
}
|