@praxisui/list 8.0.0-beta.5 → 8.0.0-beta.6
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/fesm2022/praxisui-list.mjs +14 -5
- package/package.json +2 -2
|
@@ -469,10 +469,9 @@ class ListDataService {
|
|
|
469
469
|
}
|
|
470
470
|
this.loading$.next(true);
|
|
471
471
|
const obs = this.crud.filter(query || {}, req).pipe(map((page) => {
|
|
472
|
-
const
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
: content.length;
|
|
472
|
+
const resolvedPage = unwrapApiEnvelope(page);
|
|
473
|
+
const content = extractPageContent(resolvedPage);
|
|
474
|
+
const total = extractPageTotal(resolvedPage, content.length);
|
|
476
475
|
this.total$.next(total);
|
|
477
476
|
return content;
|
|
478
477
|
}),
|
|
@@ -480,7 +479,7 @@ class ListDataService {
|
|
|
480
479
|
catchError((err) => {
|
|
481
480
|
this.warnFilterFallbackOnce(resourcePath, err);
|
|
482
481
|
return this.crud.getAll().pipe(map((arr) => {
|
|
483
|
-
const content = arr
|
|
482
|
+
const content = extractPageContent(unwrapApiEnvelope(arr));
|
|
484
483
|
this.total$.next(content.length);
|
|
485
484
|
return content;
|
|
486
485
|
}));
|
|
@@ -601,6 +600,16 @@ class ListDataService {
|
|
|
601
600
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: ListDataService, decorators: [{
|
|
602
601
|
type: Injectable
|
|
603
602
|
}] });
|
|
603
|
+
function unwrapApiEnvelope(page) {
|
|
604
|
+
return page?.data ?? page;
|
|
605
|
+
}
|
|
606
|
+
function extractPageContent(page) {
|
|
607
|
+
const content = page?.content ?? page ?? [];
|
|
608
|
+
return Array.isArray(content) ? content : [];
|
|
609
|
+
}
|
|
610
|
+
function extractPageTotal(page, fallback) {
|
|
611
|
+
return typeof page?.totalElements === 'number' ? page.totalElements : fallback;
|
|
612
|
+
}
|
|
604
613
|
function stableSerialize$1(value) {
|
|
605
614
|
if (value === null || value === undefined)
|
|
606
615
|
return String(value);
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/list",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.6",
|
|
4
4
|
"description": "List components and helpers for Praxis UI.",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": ">=16 <21",
|
|
7
7
|
"@angular/core": ">=16 <21",
|
|
8
8
|
"@angular/material": ">=16 <21",
|
|
9
|
-
"@praxisui/dynamic-fields": "^8.0.0-beta.
|
|
9
|
+
"@praxisui/dynamic-fields": "^8.0.0-beta.6",
|
|
10
10
|
"rxjs": ">=7 <9"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|