ng-firebase-table-kxp 1.2.8 → 1.2.9
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/esm2020/lib/components/table/table.component.mjs +9 -4
- package/esm2020/lib/services/table.service.mjs +2 -2
- package/esm2020/lib/types/Table.mjs +1 -1
- package/fesm2015/ng-firebase-table-kxp.mjs +10 -5
- package/fesm2015/ng-firebase-table-kxp.mjs.map +1 -1
- package/fesm2020/ng-firebase-table-kxp.mjs +9 -4
- package/fesm2020/ng-firebase-table-kxp.mjs.map +1 -1
- package/lib/types/Table.d.ts +1 -0
- package/package.json +1 -1
|
@@ -874,7 +874,7 @@ class TableService {
|
|
|
874
874
|
else {
|
|
875
875
|
currentClientPageIndex = params.clientPageIndex || 0;
|
|
876
876
|
}
|
|
877
|
-
const pageSize = params.batchSize;
|
|
877
|
+
const pageSize = params.fullPageSize ?? params.batchSize;
|
|
878
878
|
const startIndex = currentClientPageIndex * pageSize;
|
|
879
879
|
const endIndex = startIndex + pageSize;
|
|
880
880
|
const paginatedItems = items.slice(startIndex, endIndex);
|
|
@@ -3283,14 +3283,18 @@ class TableComponent {
|
|
|
3283
3283
|
this.filterPredicate = this.dataSource.filterPredicate;
|
|
3284
3284
|
this.cdr.markForCheck();
|
|
3285
3285
|
}
|
|
3286
|
-
async loadItemsPaginated(navigation = 'reload', reset = false) {
|
|
3286
|
+
async loadItemsPaginated(navigation = 'reload', reset = false, fullPageSize) {
|
|
3287
3287
|
this.imageLoadingState.clear();
|
|
3288
3288
|
if (reset && ['forward', 'reload'].includes(navigation)) {
|
|
3289
3289
|
this.lastDoc = null;
|
|
3290
|
-
this.currentClientPageIndex = 0;
|
|
3291
3290
|
}
|
|
3292
3291
|
if (reset && ['backward', 'reload'].includes(navigation)) {
|
|
3293
3292
|
this.firstDoc = null;
|
|
3293
|
+
}
|
|
3294
|
+
// Só o 'reload' volta para a primeira página. Em forward/backward (inclusive
|
|
3295
|
+
// pulos com reset de cursor) o currentClientPageIndex já foi definido por
|
|
3296
|
+
// onPageChange e é essencial para o offset da paginação client-side.
|
|
3297
|
+
if (navigation === 'reload') {
|
|
3294
3298
|
this.currentClientPageIndex = 0;
|
|
3295
3299
|
}
|
|
3296
3300
|
const activeFilters = this.filterService.extractActiveFilters(this.filtersForm);
|
|
@@ -3308,6 +3312,7 @@ class TableComponent {
|
|
|
3308
3312
|
size: this.totalItems,
|
|
3309
3313
|
filterFn: this.data.filterFn,
|
|
3310
3314
|
clientPageIndex: this.currentClientPageIndex,
|
|
3315
|
+
fullPageSize: fullPageSize ?? this.pageSize,
|
|
3311
3316
|
};
|
|
3312
3317
|
const result = await this.tableService.getPaginated(paginated);
|
|
3313
3318
|
this.items = result.items;
|
|
@@ -3375,7 +3380,7 @@ class TableComponent {
|
|
|
3375
3380
|
}
|
|
3376
3381
|
}
|
|
3377
3382
|
try {
|
|
3378
|
-
await this.loadItemsPaginated(navigation.direction, navigation.resetDocs);
|
|
3383
|
+
await this.loadItemsPaginated(navigation.direction, navigation.resetDocs, event.pageSize);
|
|
3379
3384
|
}
|
|
3380
3385
|
catch (error) {
|
|
3381
3386
|
console.error('Erro ao carregar itens paginados:', error);
|