@praxisui/list 8.0.0-beta.5 → 8.0.0-beta.7

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.
@@ -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 content = (page?.content ?? page ?? []);
473
- const total = typeof page?.totalElements === 'number'
474
- ? page.totalElements
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);
@@ -9013,19 +9022,27 @@ class PraxisList {
9013
9022
  return this.resolveTemplate(raw, ctx);
9014
9023
  return raw;
9015
9024
  }
9016
- resolveTemplate(raw, ctx) {
9025
+ resolveTemplate(raw, ctx, key) {
9026
+ if (this.isDeferredTemplateExpressionKey(key) && typeof raw === 'string') {
9027
+ return raw;
9028
+ }
9017
9029
  if (typeof raw === 'string')
9018
9030
  return this.resolveStringTemplate(raw, ctx);
9019
9031
  if (Array.isArray(raw))
9020
- return raw.map((v) => this.resolveTemplate(v, ctx));
9032
+ return raw.map((v) => this.resolveTemplate(v, ctx, key));
9021
9033
  if (raw && typeof raw === 'object') {
9022
9034
  const out = {};
9023
9035
  for (const [k, v] of Object.entries(raw))
9024
- out[k] = this.resolveTemplate(v, ctx);
9036
+ out[k] = this.resolveTemplate(v, ctx, k);
9025
9037
  return out;
9026
9038
  }
9027
9039
  return raw;
9028
9040
  }
9041
+ isDeferredTemplateExpressionKey(key) {
9042
+ if (!key)
9043
+ return false;
9044
+ return key === 'expr' || key.endsWith('Expr');
9045
+ }
9029
9046
  resolveStringTemplate(raw, ctx) {
9030
9047
  const single = raw.match(/^\$\{([^}]+)\}$/);
9031
9048
  if (single)
package/index.d.ts CHANGED
@@ -585,6 +585,7 @@ declare class PraxisList implements OnInit, OnChanges, OnDestroy {
585
585
  private isGlobalCommand;
586
586
  private resolveActionPayload;
587
587
  private resolveTemplate;
588
+ private isDeferredTemplateExpressionKey;
588
589
  private resolveStringTemplate;
589
590
  private lookup;
590
591
  onSelectionChange(_change: MatSelectionListChange): void;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@praxisui/list",
3
- "version": "8.0.0-beta.5",
3
+ "version": "8.0.0-beta.7",
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.5",
9
+ "@praxisui/dynamic-fields": "^8.0.0-beta.7",
10
10
  "rxjs": ">=7 <9"
11
11
  },
12
12
  "dependencies": {