chrv-components 1.11.6 → 1.11.8
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.
|
Binary file
|
|
@@ -2646,7 +2646,8 @@ class ChrPaginatorComponent {
|
|
|
2646
2646
|
this.pageChange = output();
|
|
2647
2647
|
this.pageSize = input(20);
|
|
2648
2648
|
this.pageSizeChange = output();
|
|
2649
|
-
this.
|
|
2649
|
+
this.instance = signal(undefined);
|
|
2650
|
+
this.dataSize = computed(() => this.instance()?.totalItems ?? 0);
|
|
2650
2651
|
this.currentlyShownSize = computed(() => {
|
|
2651
2652
|
const mult = this.page() * this.pageSize();
|
|
2652
2653
|
return mult > this.dataSize() ? this.dataSize() : mult;
|
|
@@ -2678,8 +2679,7 @@ class ChrPaginatorComponent {
|
|
|
2678
2679
|
this.isFirstPage = computed(() => this.page() == 1);
|
|
2679
2680
|
this.setPageSize = (pageSize) => {
|
|
2680
2681
|
this.setPage(1);
|
|
2681
|
-
if (this.instance)
|
|
2682
|
-
this.instance.itemsPerPage = pageSize;
|
|
2682
|
+
//if (this.instance) this.instance.itemsPerPage = pageSize;
|
|
2683
2683
|
this.dataService.set(`${this.id()}_pagesize`, pageSize);
|
|
2684
2684
|
this.pageSizeChange.emit(pageSize);
|
|
2685
2685
|
};
|
|
@@ -2687,15 +2687,18 @@ class ChrPaginatorComponent {
|
|
|
2687
2687
|
return this.setPageSize(event.target.value);
|
|
2688
2688
|
};
|
|
2689
2689
|
this.isLastPage = computed(() => {
|
|
2690
|
-
if (!this.instance?.totalItems)
|
|
2690
|
+
if (!this.instance()?.totalItems)
|
|
2691
2691
|
return false;
|
|
2692
2692
|
return this.page() >= Math.ceil(this.dataSize() / this.pageSize());
|
|
2693
2693
|
});
|
|
2694
2694
|
// public pageSize = () => this.instance.itemsPerPage;
|
|
2695
|
-
this.lastPage = computed(() => this.instance?.totalItems
|
|
2695
|
+
this.lastPage = computed(() => this.instance()?.totalItems
|
|
2696
|
+
? Math.ceil(this.dataSize() / this.pageSize())
|
|
2697
|
+
: 1);
|
|
2696
2698
|
}
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
+
ngAfterContentInit() {
|
|
2700
|
+
const paginationInstance = this.service.getInstance(`${this.id()}`);
|
|
2701
|
+
this.instance.set(paginationInstance);
|
|
2699
2702
|
}
|
|
2700
2703
|
ngOnInit() {
|
|
2701
2704
|
this.dataService
|