@masterteam/client-components 0.0.66 → 0.0.68

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@masterteam/client-components",
3
- "version": "0.0.66",
3
+ "version": "0.0.68",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/client-components",
6
6
  "linkDirectory": true,
@@ -16,10 +16,10 @@
16
16
  "rxjs": "^7.8.2",
17
17
  "tailwindcss": "^4.2.2",
18
18
  "tailwindcss-primeui": "^0.6.1",
19
- "@masterteam/forms": "^0.0.126",
20
- "@masterteam/icons": "^0.0.17",
21
- "@masterteam/dashboard-builder": "^0.0.68",
22
- "@masterteam/components": "^0.0.238"
19
+ "@masterteam/forms": "^0.0.127",
20
+ "@masterteam/components": "^0.0.241",
21
+ "@masterteam/dashboard-builder": "^0.0.69",
22
+ "@masterteam/icons": "^0.0.17"
23
23
  },
24
24
  "dependencies": {
25
25
  "tslib": "^2.8.1"
@@ -138,14 +138,28 @@ interface ClientListFormConfiguration extends ClientListBaseConfiguration {
138
138
  mode?: ClientListMode;
139
139
  columnKeys?: string[];
140
140
  /**
141
- * Defaults to true. Paginated tables use backend page/pageSize requests and
142
- * render a paginator. Set false only for bounded local datasets that should
143
- * render through virtual scroll.
141
+ * `areaType: 'table'` — defaults to true. Paginated tables use backend
142
+ * page/pageSize requests and render a paginator. Set false only for
143
+ * bounded local datasets that should render through virtual scroll.
144
+ *
145
+ * `areaType: 'cards'` — defaults to false (the full record set is fetched
146
+ * in one call, preserving pre-existing behavior). Set true to opt into
147
+ * backend-paginated cards, fetched page by page and appended as the user
148
+ * scrolls (infinite scroll) instead of loading every record up front.
149
+ *
150
+ * Note for cards: this flag used to be ignored entirely — cards always
151
+ * fetched everything regardless of what was configured. A cards config
152
+ * that already carries `isPaginated: true` (copied from a table config,
153
+ * or a config object shared across area types) therefore changes
154
+ * behaviour: it now pages. Requires backend support for `page`/`pageSize`
155
+ * on the `Card` projection; without a `pagination` block in the response
156
+ * the list degrades to the first page only.
144
157
  */
145
158
  isPaginated?: boolean;
146
159
  /**
147
160
  * Backend page size when `isPaginated` is true. For local virtual-scroll
148
- * tables (`isPaginated: false`), this is the explicit fetch cap.
161
+ * tables (`isPaginated: false`), this is the explicit fetch cap. Ignored
162
+ * for cards when `isPaginated` is false.
149
163
  */
150
164
  take?: number;
151
165
  /**
@@ -459,7 +473,20 @@ declare class ClientListStateService {
459
473
  setError(key: string, message: string | null): void;
460
474
  setTablePaging(key: string, skip: number, take: number): void;
461
475
  setRowsResult(key: string, response: RuntimeTableRowsResponse, config: NormalizedClientListConfiguration, skip: number, take: number): void;
462
- setCardsResult(key: string, response: ClientListCardsPayload, config: NormalizedClientListConfiguration): void;
476
+ setCardsResult(key: string, response: ClientListCardsPayload, config: NormalizedClientListConfiguration, skip?: number, take?: number, append?: boolean): void;
477
+ /**
478
+ * Appends `next` to `current`, dropping any card whose id is already
479
+ * present. Ids are the grid's `@for` track key, so duplicates are a runtime
480
+ * error, not a cosmetic issue.
481
+ */
482
+ private concatDistinctCards;
483
+ /**
484
+ * The page size the backend actually applied, falling back to the size we
485
+ * asked for. Returns `0` when neither is usable — i.e. the response carried
486
+ * no paging contract, so there is no stride to walk and the caller should
487
+ * treat the set as complete.
488
+ */
489
+ private resolveEffectivePageSize;
463
490
  setInformativeResult(key: string, response: ClientListInformativeDashboardPayload | null, config: NormalizedClientListConfiguration): void;
464
491
  toggleExpanded(key: string): void;
465
492
  private mergeItemState;
@@ -501,6 +528,19 @@ declare class ClientList implements OnDestroy {
501
528
  private readonly runtimeFilters;
502
529
  constructor();
503
530
  onLazyLoad(itemKey: string, event: ClientListLazyLoadEvent): void;
531
+ /**
532
+ * Fetches the next page of cards and appends it to the currently loaded
533
+ * set — the infinite-scroll counterpart to table pagination. No-op unless
534
+ * `isPaginated` is enabled for this cards list, a load is already in
535
+ * flight, or every record has already been loaded.
536
+ *
537
+ * The offset comes from `item.skip`, which the state service advances by
538
+ * the page size the backend actually applied. Deriving it from
539
+ * `cards.length` instead would drift the moment a page came back short (a
540
+ * capped `pageSize`, a de-duplicated overlap) and re-request a page we
541
+ * already hold.
542
+ */
543
+ loadMoreCards(itemKey: string): void;
504
544
  reload(itemKey?: string): void;
505
545
  reloadByKey(itemKey: string): void;
506
546
  toggleExpanded(key: string): void;
@@ -583,7 +623,7 @@ declare class ClientListApiService {
583
623
  private readonly runtimeFetchBaseUrl;
584
624
  private readonly informativeBaseUrl;
585
625
  getRows(contextKey: ClientListRuntimeContext, query: ClientListTableQuery, filters?: ClientListFetchRequestFilter[]): Observable<Response<RuntimeTableRowsResponse>>;
586
- getCards(contextKey: ClientListRuntimeContext, filters?: ClientListFetchRequestFilter[]): Observable<Response<ClientListCardsPayload>>;
626
+ getCards(contextKey: ClientListRuntimeContext, filters?: ClientListFetchRequestFilter[], skip?: number, take?: number): Observable<Response<ClientListCardsPayload>>;
587
627
  getInformativeDashboard(levelId: number, moduleId: number): Observable<Response<ClientListInformativeDashboardPayload>>;
588
628
  private queryRuntime;
589
629
  private resolveTablePropertyKeys;