@smallpearl/ngx-helper 0.29.23 → 0.29.26
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/smallpearl-ngx-helper-mat-entity-crud.mjs +75 -26
- package/fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs +99 -23
- package/fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs.map +1 -1
- package/mat-entity-crud/src/mat-entity-crud-internal-types.d.ts +9 -0
- package/mat-entity-crud/src/mat-entity-crud.component.d.ts +8 -1
- package/mat-entity-crud/src/preview-pane.component.d.ts +13 -8
- package/mat-entity-list/src/mat-entity-list.component.d.ts +45 -4
- package/package.json +16 -16
|
@@ -23,7 +23,7 @@ import { getNgxHelperConfig } from '@smallpearl/ngx-helper/core';
|
|
|
23
23
|
import { SPEntityField, SP_ENTITY_FIELD_CONFIG } from '@smallpearl/ngx-helper/entity-field';
|
|
24
24
|
import { InfiniteScrollDirective } from 'ngx-infinite-scroll';
|
|
25
25
|
import { plural } from 'pluralize';
|
|
26
|
-
import { Subscription, tap, finalize } from 'rxjs';
|
|
26
|
+
import { Subscription, Subject, takeUntil, tap, filter, distinctUntilChanged, switchMap, finalize } from 'rxjs';
|
|
27
27
|
|
|
28
28
|
const SP_MAT_ENTITY_LIST_HTTP_CONTEXT = new HttpContextToken(() => ({
|
|
29
29
|
entityName: '',
|
|
@@ -80,6 +80,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImpor
|
|
|
80
80
|
standalone: true
|
|
81
81
|
}]
|
|
82
82
|
}], ctorParameters: () => [{ type: i0.ElementRef }] });
|
|
83
|
+
/**
|
|
84
|
+
* Represents a request to load entities from the remote. This is used to
|
|
85
|
+
* compare two requests to determine if they are equal. This is useful to
|
|
86
|
+
* prevent duplicate requests being sent to the remote.
|
|
87
|
+
*/
|
|
88
|
+
class LoadRequest {
|
|
89
|
+
endpoint;
|
|
90
|
+
params;
|
|
91
|
+
force;
|
|
92
|
+
constructor(endpoint, params, force = false) {
|
|
93
|
+
this.endpoint = endpoint;
|
|
94
|
+
this.params = params;
|
|
95
|
+
this.force = force;
|
|
96
|
+
}
|
|
97
|
+
// Returns true if two LoadRequest objects are equal and this object's
|
|
98
|
+
// 'force' is not set to true.
|
|
99
|
+
isEqualToAndNotForced(prev) {
|
|
100
|
+
// console.log(
|
|
101
|
+
// `isEqualToAndNotForced - ${this.endpoint}, ${this.params.toString()} ${
|
|
102
|
+
// this.force
|
|
103
|
+
// }, other: ${prev.endpoint}, ${prev.params.toString()}, ${prev.force}`
|
|
104
|
+
// );
|
|
105
|
+
return this.force
|
|
106
|
+
? false
|
|
107
|
+
: this.endpoint.localeCompare(prev.endpoint) === 0 &&
|
|
108
|
+
this.params.toString().localeCompare(prev.params.toString()) === 0;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
83
111
|
/**
|
|
84
112
|
* A component to display a list of entities loaded from remote.
|
|
85
113
|
*/
|
|
@@ -215,6 +243,7 @@ class SPMatEntityListComponent {
|
|
|
215
243
|
clientColumnDefs;
|
|
216
244
|
contentColumnDefs = [];
|
|
217
245
|
subs$ = new Subscription();
|
|
246
|
+
destroy$ = new Subject();
|
|
218
247
|
// Pagination state
|
|
219
248
|
entityCount = signal(0);
|
|
220
249
|
pageIndex = signal(0);
|
|
@@ -299,9 +328,16 @@ class SPMatEntityListComponent {
|
|
|
299
328
|
ngxHelperConfig = getNgxHelperConfig();
|
|
300
329
|
fieldConfig = inject(SP_ENTITY_FIELD_CONFIG, { optional: true });
|
|
301
330
|
entityListConfig = getEntityListConfig();
|
|
331
|
+
/**
|
|
332
|
+
* A signal that can be used to trigger loading of more entities from the
|
|
333
|
+
* remote. This can be visualized as the event loop of the entity list
|
|
334
|
+
* component.
|
|
335
|
+
*/
|
|
336
|
+
loadRequest$ = new Subject();
|
|
302
337
|
endpointChanged = effect(() => {
|
|
303
338
|
runInInjectionContext(this.injector, () => {
|
|
304
339
|
if (this.endpoint()) {
|
|
340
|
+
// console.log(`endpointChanged - ${this.endpoint()}`);
|
|
305
341
|
setTimeout(() => { this.refresh(); });
|
|
306
342
|
}
|
|
307
343
|
});
|
|
@@ -323,32 +359,37 @@ class SPMatEntityListComponent {
|
|
|
323
359
|
this._paginator = this.paginator()
|
|
324
360
|
? this.paginator()
|
|
325
361
|
: this.entityListConfig?.paginator;
|
|
326
|
-
this.
|
|
327
|
-
.pipe(tap((entities) => {
|
|
362
|
+
this.entities$
|
|
363
|
+
.pipe(takeUntil(this.destroy$), tap((entities) => {
|
|
328
364
|
// .data is a setter property, which ought to trigger the necessary
|
|
329
365
|
// signals resulting in mat-table picking up the changes without
|
|
330
366
|
// requiring us to call cdr.detectChanges() explicitly.
|
|
331
367
|
this.dataSource().data = entities;
|
|
332
368
|
}))
|
|
333
|
-
.subscribe()
|
|
369
|
+
.subscribe();
|
|
370
|
+
this.loadRequest$
|
|
371
|
+
.pipe(takeUntil(this.destroy$), filter((lr) => lr.endpoint !== '' || lr.force === true), distinctUntilChanged((prev, current) => current.isEqualToAndNotForced(prev)), switchMap((lr) => this.doActualLoad(lr)))
|
|
372
|
+
.subscribe();
|
|
334
373
|
}
|
|
335
374
|
ngOnDestroy() {
|
|
336
|
-
this.
|
|
375
|
+
this.destroy$.next();
|
|
376
|
+
this.destroy$.complete();
|
|
337
377
|
}
|
|
338
378
|
ngAfterViewInit() {
|
|
339
379
|
if (!this._deferViewInit()) {
|
|
340
380
|
this.buildContentColumnDefs();
|
|
341
381
|
this.buildColumns();
|
|
342
382
|
this.setupSort();
|
|
383
|
+
this.loadMoreEntities();
|
|
343
384
|
}
|
|
344
385
|
}
|
|
345
386
|
/**
|
|
346
387
|
* Clear all entities in store and reload them from endpoint as if
|
|
347
388
|
* the entities are being loaded for the first time.
|
|
348
389
|
*/
|
|
349
|
-
refresh() {
|
|
390
|
+
refresh(force = false) {
|
|
350
391
|
this.pageIndex.set(0);
|
|
351
|
-
this.loadMoreEntities();
|
|
392
|
+
this.loadMoreEntities(force);
|
|
352
393
|
}
|
|
353
394
|
addEntity(entity) {
|
|
354
395
|
const pagination = this.pagination();
|
|
@@ -497,29 +538,67 @@ class SPMatEntityListComponent {
|
|
|
497
538
|
this.loadMoreEntities();
|
|
498
539
|
}
|
|
499
540
|
}
|
|
500
|
-
loadMoreEntities() {
|
|
541
|
+
loadMoreEntities(forceRefresh = false) {
|
|
542
|
+
this.loadRequest$.next(this.createNextLoadRequest(forceRefresh));
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Creates a LoadRequest object for loading entities using the current state
|
|
546
|
+
* of the component. Therefore, if the request is for next page of entities,
|
|
547
|
+
* the LoadRequest object will have the updated page index. However, if
|
|
548
|
+
* pagination has been reset (refer to refresh()), the LoadRequest object
|
|
549
|
+
* will be for the first page of data. Note that when 'endpoint' value
|
|
550
|
+
* changes, the component's pagination state is reset causing a refresh()
|
|
551
|
+
* to be called, which in turn will create a new LoadRequest object for the
|
|
552
|
+
* first page of data.
|
|
553
|
+
* @returns LoadRequest object for the next load request.
|
|
554
|
+
*/
|
|
555
|
+
createNextLoadRequest(forceRefresh) {
|
|
501
556
|
let pageParams = {};
|
|
557
|
+
const parts = this.endpoint().split('?');
|
|
558
|
+
const endpoint = parts[0];
|
|
502
559
|
if (this._paginator) {
|
|
503
|
-
pageParams = this._paginator.getRequestPageParams(
|
|
560
|
+
pageParams = this._paginator.getRequestPageParams(endpoint, this.pageIndex(), this.pageSize());
|
|
504
561
|
}
|
|
505
|
-
const
|
|
506
|
-
let params = new HttpParams(parts.length > 1 ? { fromString: parts[1] } : undefined);
|
|
562
|
+
const paramsSet = new Map();
|
|
507
563
|
for (const key in pageParams) {
|
|
508
|
-
|
|
564
|
+
paramsSet.set(key, pageParams[key]);
|
|
509
565
|
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
566
|
+
if (parts.length > 1) {
|
|
567
|
+
const embeddedParams = new HttpParams({ fromString: parts[1] });
|
|
568
|
+
embeddedParams.keys().forEach((key) => {
|
|
569
|
+
paramsSet.set(key, embeddedParams.get(key));
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
let params = new HttpParams();
|
|
573
|
+
paramsSet.forEach((value, key) => {
|
|
574
|
+
params = params.set(key, value ? value.toString() : '');
|
|
575
|
+
});
|
|
576
|
+
// let params = new HttpParams(parts.length > 1 ? { fromString: parts[1] } : undefined);
|
|
577
|
+
// for (const key in pageParams) {
|
|
578
|
+
// params = params.append(key, (pageParams as any)[key]);
|
|
579
|
+
// }
|
|
580
|
+
return new LoadRequest(endpoint, params, forceRefresh || !!this.entityLoaderFn());
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Does the actual load of entities from the remote or via calling the
|
|
584
|
+
* entityLoaderFn. This method is the workhorse of the entity list
|
|
585
|
+
* 'loader-loop'.
|
|
586
|
+
* @param lr
|
|
587
|
+
* @returns Observable that emits the response from the remote or from
|
|
588
|
+
* entityLoaderFn().
|
|
589
|
+
*/
|
|
590
|
+
doActualLoad(lr) {
|
|
591
|
+
// console.log(`doActualLoad - endpoint: ${lr.endpoint}, params: ${lr.params.toString()}`);
|
|
513
592
|
const loaderFn = this.entityLoaderFn();
|
|
593
|
+
const params = lr.params;
|
|
514
594
|
const obs = loaderFn !== undefined
|
|
515
595
|
? loaderFn({ params })
|
|
516
|
-
: this.http.get(this.getUrl(
|
|
596
|
+
: this.http.get(this.getUrl(lr.endpoint), {
|
|
517
597
|
context: this._httpReqContext(),
|
|
518
598
|
params,
|
|
519
599
|
});
|
|
520
600
|
this.loading.set(true);
|
|
521
|
-
|
|
522
|
-
.pipe(tap((resp) => {
|
|
601
|
+
return obs.pipe(tap((resp) => {
|
|
523
602
|
// TODO: defer this to a pagination provider so that we can support
|
|
524
603
|
// many types of pagination. DRF itself has different schemes. And
|
|
525
604
|
// express may have yet another pagination protocol.
|
|
@@ -527,7 +606,7 @@ class SPMatEntityListComponent {
|
|
|
527
606
|
if (this._paginator) {
|
|
528
607
|
// Convert HttpParams to JS object
|
|
529
608
|
const paramsObj = {};
|
|
530
|
-
params.keys().forEach(key => {
|
|
609
|
+
params.keys().forEach((key) => {
|
|
531
610
|
paramsObj[key] = params.get(key);
|
|
532
611
|
});
|
|
533
612
|
const { entities, total } = this._paginator.parseRequestResponse(this.entityName(), this._entityNamePlural(), this.endpoint(), paramsObj, resp);
|
|
@@ -557,10 +636,7 @@ class SPMatEntityListComponent {
|
|
|
557
636
|
else {
|
|
558
637
|
this.store.update(upsertEntities(this.findArrayInResult(resp)));
|
|
559
638
|
}
|
|
560
|
-
}), finalize(() =>
|
|
561
|
-
this.loading.set(false);
|
|
562
|
-
}))
|
|
563
|
-
.subscribe());
|
|
639
|
+
}), finalize(() => this.loading.set(false)));
|
|
564
640
|
}
|
|
565
641
|
findArrayInResult(res) {
|
|
566
642
|
if (Array.isArray(res)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smallpearl-ngx-helper-mat-entity-list.mjs","sources":["../../../../projects/smallpearl/ngx-helper/mat-entity-list/src/mat-entity-list-types.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-list/src/providers.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-list/src/config.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-list/src/mat-entity-list.component.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-list/smallpearl-ngx-helper-mat-entity-list.ts"],"sourcesContent":["import { HttpContextToken } from \"@angular/common/http\";\nimport { Observable } from \"rxjs\";\n\nexport interface SPMatEntityListHttpContext {\n entityName: string;\n entityNamePlural: string;\n endpoint: string;\n}\n\nexport const SP_MAT_ENTITY_LIST_HTTP_CONTEXT =\n new HttpContextToken<SPMatEntityListHttpContext>(() => ({\n entityName: '',\n entityNamePlural: '',\n endpoint: '',\n }));\n\n/**\n * Pagination HTTP request params. Actually copied from Angular's HttpParams\n * declaration. The ReadonlyArray<string|number|boolean> is a bit of an\n * overkill for pagination params, but what the heck. When you copy-paste,\n * do it in full!\n */\nexport type SPPageParams = { [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>; }\n\n/**\n * An interface that the clients should provide, either via a global config\n * (see above), that handles parsing the GET response and returns the entities\n * stored therein. This class will allow the entity-list component to be\n * used across different pagination response types as long as the appropriate\n * SPMatEntityListPaginator class is provided to the component.\n */\nexport interface SPMatEntityListPaginator {\n getRequestPageParams: (endpoint: string, pageIndex: number, pageSize: number) => SPPageParams;\n parseRequestResponse: <\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n >(\n entityName: string,\n entityNamePlural: string,\n endpoint: string,\n params: SPPageParams,\n resp: any\n ) => { total: number; entities: TEntity[] };\n}\n\n/**\n * 'entity' is really TEntity arg of SPMatEntityListComponent<TEntity>.\n * 'column' is the column name. This allows the same value function to support\n * multiple columns further enabing DRY.\n */\nexport type COLUMN_VALUE_FN = (entity: any, column: string) => string|number|Date|boolean;\n\n/**\n * Global config for SPMatEntityList component.\n */\nexport interface SPMatEntityListConfig {\n urlResolver?: (endpoint: string) => string;\n paginator?: SPMatEntityListPaginator;\n defaultPageSize?: number;\n pageSizes?: Array<number>;\n /**\n * These are global column value functions.\n *\n * If a value function for a column is not explicitly specified, this map is\n * looked up with the column name. If an entry exists in this table, it will\n * be used to render the column's value.\n *\n * This is useful for formatting certain column types which tends to have the\n * same name across the app. For instance columns such as 'amount', 'total'\n * or 'balance'. Or 'date', 'timestamp', etc. The return value from the\n * column value functions are deemed safe and therefore\n */\n // columnValueFns?: Map<string, COLUMN_VALUE_FN>;\n}\n\n/**\n * Type for custom entities loader function, which if provided will be called\n * instead of HttpClient.get.\n */\nexport type SPMatEntityListEntityLoaderFn = (params: any) => Observable<any>;\n","import { InjectionToken } from '@angular/core';\nimport { SPMatEntityListConfig } from './mat-entity-list-types';\n\nexport const SP_MAT_ENTITY_LIST_CONFIG = new InjectionToken<SPMatEntityListConfig>(\n 'SPMatEntityListConfig'\n);\n","import { inject } from '@angular/core';\nimport { SPMatEntityListConfig } from './mat-entity-list-types';\nimport { SP_MAT_ENTITY_LIST_CONFIG } from './providers';\n\nexport const DefaultSPMatEntityListConfig: SPMatEntityListConfig = {\n urlResolver: (endpoint: string) => endpoint,\n paginator: undefined,\n defaultPageSize: 50,\n pageSizes: [10, 25, 50, 100],\n};\n\n/**\n * To be called from an object's constructor.\n */\nexport function getEntityListConfig(): SPMatEntityListConfig {\n const entityListConfig = inject(SP_MAT_ENTITY_LIST_CONFIG, {\n optional: true,\n });\n return {\n ...DefaultSPMatEntityListConfig,\n ...(entityListConfig ?? {}),\n };\n}\n","import { CommonModule } from '@angular/common';\nimport { HttpClient, HttpContext, HttpContextToken, HttpParams } from '@angular/common/http';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n ContentChildren,\n Directive,\n effect,\n ElementRef,\n EventEmitter,\n inject,\n Injector,\n input,\n OnDestroy,\n OnInit,\n Output,\n QueryList,\n runInInjectionContext,\n signal,\n viewChild,\n viewChildren\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatPaginatorModule, PageEvent } from '@angular/material/paginator';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatSort, MatSortModule } from '@angular/material/sort';\nimport {\n MatColumnDef,\n MatTable,\n MatTableDataSource,\n MatTableModule,\n} from '@angular/material/table';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { RouterModule } from '@angular/router';\nimport { createStore } from '@ngneat/elf';\nimport {\n addEntities,\n deleteEntities,\n getEntitiesCount,\n hasEntity,\n selectAllEntities,\n updateEntities,\n upsertEntities,\n withEntities,\n} from '@ngneat/elf-entities';\nimport { getNgxHelperConfig } from '@smallpearl/ngx-helper/core';\nimport {\n SP_ENTITY_FIELD_CONFIG,\n SPEntityField,\n SPEntityFieldSpec\n} from '@smallpearl/ngx-helper/entity-field';\nimport { InfiniteScrollDirective } from 'ngx-infinite-scroll';\nimport { plural } from 'pluralize';\nimport { finalize, Observable, Subscription, tap } from 'rxjs';\nimport { getEntityListConfig } from './config';\nimport {\n SP_MAT_ENTITY_LIST_HTTP_CONTEXT,\n SPMatEntityListEntityLoaderFn,\n SPMatEntityListPaginator\n} from './mat-entity-list-types';\n\n@Directive({\n selector: '[headerAlignment]',\n standalone: true\n})\nexport class HeaderAlignmentDirective implements AfterViewInit {\n\n headerAlignment = input<string>();\n\n constructor(private el: ElementRef) {\n // this.el.nativeElement.style.backgroundColor = 'yellow';\n }\n\n ngAfterViewInit(): void {\n if (this.headerAlignment()) {\n const sortHeader = this.el.nativeElement.querySelector('.mat-sort-header-container');\n if (sortHeader) {\n sortHeader.style.justifyContent = this.headerAlignment();\n } else {\n this.el.nativeElement.style.justifyContent = this.headerAlignment();\n }\n }\n }\n}\n\n/**\n * A component to display a list of entities loaded from remote.\n */\n@Component({\n imports: [\n CommonModule,\n RouterModule,\n MatTableModule,\n MatSortModule,\n MatPaginatorModule,\n MatButtonModule,\n MatInputModule,\n MatProgressSpinnerModule,\n InfiniteScrollDirective,\n HeaderAlignmentDirective,\n ],\n selector: 'sp-mat-entity-list',\n template: `\n <div\n class=\"entities-list-wrapper\"\n infiniteScroll\n [infiniteScrollDistance]=\"infiniteScrollDistance()\"\n [infiniteScrollThrottle]=\"infiniteScrollThrottle()\"\n [infiniteScrollContainer]=\"infiniteScrollContainer()\"\n [scrollWindow]=\"infiniteScrollWindow()\"\n [infiniteScrollDisabled]=\"\n pagination() !== 'infinite' || !_paginator || !hasMore()\n \"\n (scrolled)=\"infiniteScrollLoadNextPage($event)\"\n >\n <div\n class=\"busy-overlay\"\n [ngClass]=\"{ show: pagination() === 'discrete' && loading() }\"\n >\n <ng-container *ngTemplateOutlet=\"busySpinner\"></ng-container>\n </div>\n <table mat-table [dataSource]=\"dataSource()\">\n <tr mat-header-row *matHeaderRowDef=\"_displayedColumns()\"></tr>\n <tr\n mat-row\n [class.active-row]=\"activeEntityId() === row[this.idKey()]\"\n *matRowDef=\"let row; columns: _displayedColumns()\"\n (click)=\"toggleActiveEntity(row)\"\n ></tr>\n </table>\n @if (pagination() == 'discrete' && _paginator) {\n <mat-paginator\n showFirstLastButtons\n [length]=\"entityCount()\"\n [pageSize]=\"_pageSize()\"\n [pageIndex]=\"pageIndex()\"\n [pageSizeOptions]=\"[]\"\n [hidePageSize]=\"true\"\n (page)=\"handlePageEvent($event)\"\n [disabled]=\"loading()\"\n aria-label=\"Select page\"\n ></mat-paginator>\n }\n <div\n class=\"infinite-scroll-loading\"\n [ngClass]=\"{ show: pagination() === 'infinite' && loading() }\"\n >\n <ng-container *ngTemplateOutlet=\"busySpinner\"></ng-container>\n </div>\n </div>\n <!-- We keep the column definitions outside the <table> so that they can\n be dynamically added to the MatTable. -->\n <span matSort=\"sorter()\">\n @for (column of __columns(); track $index) {\n <ng-container [matColumnDef]=\"column.spec.name\">\n @if (disableSort()) {\n <th [class]=\"column.class\" [headerAlignment]=\"column.options.alignment\" mat-header-cell *matHeaderCellDef>\n {{ column.label() }}\n </th>\n } @else {\n <th [class]=\"column.class\" [headerAlignment]=\"column.options.alignment\" mat-header-cell mat-sort-header *matHeaderCellDef>\n {{ column.label() }}\n </th>\n }\n <td\n [class]=\"column.class\"\n [style.text-align]=\"column.options.alignment\"\n mat-cell\n *matCellDef=\"let element\"\n [routerLink]=\"column.getRouterLink(element)\"\n >\n @if (column.hasRouterLink(element)) {\n <a [routerLink]=\"column.getRouterLink(element)\">\n <span [innerHTML]=\"column.value(element)\"></span>\n </a>\n } @else {\n <span [innerHTML]=\"column.value(element)\"></span>\n }\n </td>\n </ng-container>\n }\n </span>\n <ng-template #busySpinner>\n <div class=\"busy-spinner\">\n <mat-spinner mode=\"indeterminate\" diameter=\"28\"></mat-spinner>\n </div>\n </ng-template>\n `,\n styles: [`\n .entities-list-wrapper {\n position: relative;\n }\n .busy-overlay {\n display: none;\n height: 100%;\n width: 100%;\n position: absolute;\n top: 0px;\n left: 0px;\n z-index: 1000;\n opacity: 0.6;\n background-color: transparent;\n }\n .show {\n display: block;\n }\n .busy-spinner {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .infinite-scroll-loading {\n display: none;\n width: 100%;\n padding: 8px;\n }\n .active-row {\n font-weight: bold;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SPMatEntityListComponent<\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n> implements OnInit, OnDestroy, AfterViewInit\n{\n /* CLIENT PROVIDED PARAMETERS */\n entityName = input.required<string>();\n entityNamePlural = input<string>();\n\n /**\n * The endpoint from where the entities are to be retrieved\n */\n endpoint = input<string>('');\n /**\n * Custom entities loader function, which if provided will be called\n * instead of HttpClient.get.\n */\n entityLoaderFn = input<SPMatEntityListEntityLoaderFn | undefined>(undefined);\n /**\n * The columns of the entity to be displayed. This is an array of\n * SPEntityFieldSpec objects. If there's a one-to-one mapping between the\n * column's field name, its title & the rendered value, a string can be\n * specified instead. That is, the value of this property is a heterogeneous\n * array consisting of SPEntityFieldSpec<> objects and strings.\n */\n columns =\n input.required<Array<SPEntityFieldSpec<TEntity, IdKey> | string>>();\n\n /**\n * Names of columns that are displayed. This will default to all the columns\n * listed in columns.\n */\n displayedColumns = input<string[]>([]); // ['name', 'cell', 'gender'];\n\n /**\n * Number of entities per page. If this is not set and paginator is defined,\n * the number of entities int in the first request, will be taken as the\n * page size.\n */\n pageSize = input<number>(0);\n /**\n * Entity idKey, if idKey is different from the default 'id'.\n */\n idKey = input<string>('id');\n /**\n * Type of pagination -- continuous or discrete. 'infinite' pagination\n * uses an 'infiniteScroll' and 'discrete' pagination uses a mat-paginator\n * at the bottom to navigate between pages.\n */\n pagination = input<'infinite' | 'discrete' | 'none'>('discrete');\n /**\n * Component specific paginator. Only used if pagination != 'none'.\n */\n paginator = input<SPMatEntityListPaginator>();\n /**\n *\n */\n sorter = input<MatSort>();\n /**\n * Disable sorting of rows\n */\n disableSort = input<boolean>(false);\n /**\n * Wrappers for infiniteScroll properties, for customization by the client\n */\n infiniteScrollContainer = input<any>('');\n infiniteScrollDistance = input<number>(1);\n infiniteScrollThrottle = input<number>(400);\n infiniteScrollWindow = input<boolean>(false);\n /**\n * Custom context to be set for HttpClient requests. In the client code\n * specify this property by initializing a member variable as:\n\n ```\n Component({\n ...\n template: `\n <sp-mat-entity-list\n [httpReqContext]=\"httpReqContext\"\n ></sp-mat-entity-list>\n `\n })\n export class YourComponent {\n httpReqContext: [HttpContextToken<any>, any] = [\n SIDELOAD_TO_COMPOSITE_PARAMS, 'customers'\n ];\n }\n ```\n *\n * Of course if you want to pass multiple context properties, declare the type\n * as an array of array. That is, `[[HttpContextToken<any>, any]]` and\n * initialize it appropriately.\n */\n httpReqContext = input<[[HttpContextToken<any>, any]]|[HttpContextToken<any>, any]>();\n /* END CLIENT PROVIDED PARAMETERS */\n\n // *** INTERNAL *** //\n _entityNamePlural = computed(() =>\n this.entityNamePlural()\n ? this.entityNamePlural()\n : plural(this.entityName())\n );\n\n _httpReqContext = computed(() => {\n let reqContext = this.httpReqContext();\n const context = new HttpContext();\n if (reqContext && Array.isArray(reqContext)) {\n if (reqContext.length == 2 && !Array.isArray(reqContext[0])) {\n // one dimensional array of a key, value pair.\n context.set(reqContext[0], reqContext[1]);\n } else {\n reqContext.forEach(([k, v]) => context.set(k, v));\n }\n }\n context.set(SP_MAT_ENTITY_LIST_HTTP_CONTEXT, {\n entityName: this.entityName(),\n entityNamePlural: this._entityNamePlural(),\n endpoint: this.endpoint()\n })\n return context;\n })\n _deferViewInit = input<boolean>(false);\n firstLoadDone = false;\n allColumnNames = signal<string[]>([]);\n _displayedColumns = computed(() =>\n this.displayedColumns().length > 0\n ? this.displayedColumns().filter(\n (colName) =>\n this.allColumnNames().find((name) => name === colName) !== undefined\n )\n : this.allColumnNames()\n );\n dataSource = signal<MatTableDataSource<TEntity>>(\n new MatTableDataSource<TEntity>()\n );\n\n table = viewChild(MatTable);\n sort = viewChild(MatSort);\n // These are our own <ng-container matColumnDef></ng-container>\n // which we create for each column that we create by the declaration:\n // <ng-container *ngFor=\"let column of columns()\" [matColumnDef]=\"column.name\">\n viewColumnDefs = viewChildren(MatColumnDef);\n // These are the <ng-container matColumnDef></ng-container> placed\n // inside <sp-mat-entity-list></<sp-mat-entity-list> by the client to override\n // the default <ng-container matColumnDef> created by the component.\n @ContentChildren(MatColumnDef) clientColumnDefs!: QueryList<MatColumnDef>;\n\n contentColumnDefs: MatColumnDef[] = [];\n\n subs$ = new Subscription();\n\n // Pagination state\n entityCount = signal<number>(0);\n pageIndex = signal<number>(0);\n\n // Mechanism to default pageSize to last entities length.\n lastFetchedEntitiesCount = signal<number>(0);\n _pageSize = computed<number>(() =>\n this.pageSize()\n ? this.pageSize()\n : this.entityListConfig.defaultPageSize ?? this.lastFetchedEntitiesCount()\n );\n // Effective columns, derived from columns(), which can either be an array\n // of objects of array of strings.\n _columns = computed<SPEntityFieldSpec<TEntity, IdKey>[]>(() => {\n const columns = this.columns();\n let fields: SPEntityField<TEntity, IdKey>[] = [];\n let cols: SPEntityFieldSpec<TEntity, IdKey>[] = [];\n columns.forEach((colDef) => {\n // fields.push(new SPEntityField(colDef))\n if (typeof colDef === 'string') {\n cols.push({ name: String(colDef) });\n } else if (typeof colDef === 'object') {\n cols.push(colDef as SPEntityFieldSpec<TEntity, IdKey>);\n }\n });\n return cols;\n });\n\n __columns = computed<SPEntityField<TEntity, IdKey>[]>(() =>\n this.columns().map((colDef) => new SPEntityField<TEntity, IdKey>(colDef, this.ngxHelperConfig, this.fieldConfig))\n );\n\n // We isolate retrieving items from the remote and providing the items\n // to the component into two distinct operations. The retrieval operation\n // retrieves data asynchronously and then stores the data in a local store.\n // The UI would be 'listening' to a reactive callback that would be triggered\n // whenever items in the store changes. This is because store is an immutable\n // data structure and any changes (addition/deletion) to it would result in\n // the entire store being replaced with a copy with the changes applied.\n\n // Ideally we should declare this as\n // store!: Store<...>. But @ngneat/elf does not provide a generic type\n // for Store<...>, which can be composed from its type arguments. Instead it\n // uses type composition using its arguments to generate store's type\n // implicitly. So we use the same mechanism to enforce type safety in our\n // code. The code below results in a type declaration for store that is\n // dependent on the components generic arguments. (Making use of TypeScript's\n // type deduction system from variable assignment). Later on in the\n // constructor we reassign this.store with a new object that uses the\n // client provided idKey() value as the identifying key for each entity in\n // the sore.\n store = createStore(\n { name: Math.random().toString(36).slice(2) },\n withEntities<TEntity, IdKey>({ idKey: this.idKey() as IdKey })\n );\n // We'll initialize this in ngOnInit() when 'store' is initialized with the\n // correct TEntity store that can be safely indexed using IdKey.\n entities$!: Observable<TEntity[]>;\n // Effective paginator, coalescing local paginator and paginator from global\n // config.\n _paginator!: SPMatEntityListPaginator | undefined;\n // We will toggle this during every entity load.\n loading = signal<boolean>(false);\n // We will update this after every load and pagination() == 'infinite'\n hasMore = signal<boolean>(true);\n\n activeEntity = signal<TEntity | undefined>(undefined);\n activeEntityId = computed(() =>\n this.activeEntity() ? (this.activeEntity() as any)[this.idKey()] : undefined\n );\n _prevActiveEntity!: TEntity | undefined;\n _activeEntityChange = effect(() => {\n runInInjectionContext(this.injector, () => {\n const activeEntity = this.activeEntity();\n // Though we can raise the selectEntity event directly from effect handler,\n // that would prevent the event handler from being able to update any\n // signals from inside it. So we generate the event asyncronously.\n // Also, this effect handler will be invoked for the initial 'undefined'\n // during which we shouldn't emit the selectEntity event. Therefore we\n // keep another state variable to filter out this state.\n if (activeEntity || this._prevActiveEntity) {\n setTimeout(() => {\n this._prevActiveEntity = activeEntity;\n this.selectEntity.emit(activeEntity);\n // if (this._prevActiveEntity && !activeEntity) {\n // this.selectEntity.emit(activeEntity);\n // } else if (activeEntity) {\n // this.selectEntity.emit(activeEntity);\n // }\n });\n }\n });\n });\n @Output() selectEntity = new EventEmitter<TEntity | undefined>();\n\n ngxHelperConfig = getNgxHelperConfig();\n fieldConfig = inject(SP_ENTITY_FIELD_CONFIG, { optional: true })!;\n entityListConfig = getEntityListConfig();\n\n endpointChanged = effect(() => {\n runInInjectionContext(this.injector, () => {\n if (this.endpoint()) {\n setTimeout(() => { this.refresh(); });\n }\n });\n });\n\n constructor(\n protected http: HttpClient,\n private sanitizer: DomSanitizer,\n private injector: Injector,\n ) {\n // if (!this.config) {\n // this.config = new DefaultSPMatEntityListConfig();\n // }\n // this.fieldConfig = inject(SP_ENTITY_FIELD_CONFIG, { optional: true })!;\n }\n\n ngOnInit() {\n // This is the reactive callback that listens for changes to table entities\n // which are reflected in the mat-table.\n this.store = createStore(\n { name: Math.random().toString(36).slice(2) },\n withEntities<TEntity, IdKey>({ idKey: this.idKey() as IdKey })\n );\n this.entities$ = this.store.pipe(selectAllEntities());\n this._paginator = this.paginator()\n ? this.paginator()\n : this.entityListConfig?.paginator;\n\n this.subs$.add(\n this.entities$\n .pipe(\n tap((entities) => {\n // .data is a setter property, which ought to trigger the necessary\n // signals resulting in mat-table picking up the changes without\n // requiring us to call cdr.detectChanges() explicitly.\n this.dataSource().data = entities;\n })\n )\n .subscribe()\n );\n }\n\n ngOnDestroy(): void {\n this.subs$.unsubscribe();\n }\n\n ngAfterViewInit(): void {\n if (!this._deferViewInit()) {\n this.buildContentColumnDefs();\n this.buildColumns();\n this.setupSort();\n }\n }\n\n /**\n * Clear all entities in store and reload them from endpoint as if\n * the entities are being loaded for the first time.\n */\n refresh() {\n this.pageIndex.set(0);\n this.loadMoreEntities();\n }\n\n addEntity(entity: TEntity) {\n const pagination = this.pagination();\n const count = this.store.query(getEntitiesCount());\n if (\n pagination === 'infinite' ||\n pagination === 'none' ||\n count < this._pageSize()\n ) {\n this.store.update(addEntities(entity));\n } else {\n // 'discrete' pagination, refresh the crud items from the beginning.\n // Let component client set the behavior using a property\n // this.pageIndex.set(0);\n // this.loadMoreEntities();\n }\n }\n\n /**\n * Update an entity with a modified version. Can be used by CRUD UPDATE\n * operation to update an entity in the local store that is used to as the\n * source of MatTableDataSource.\n * @param id\n * @param entity\n */\n updateEntity(id: TEntity[IdKey], entity: TEntity) {\n if (this.store.query(hasEntity(id))) {\n this.store.update(updateEntities(id, entity));\n }\n }\n\n /**\n * Clients can call this method when it has deleted and entity via a CRUD\n * operation. Depending on the pagination mode, MatEntityList implements\n * an appropriate behavior.\n *\n * If the pagination is 'infinite', the relevent entity is removed from our\n * entity list. View will be repained as data store has changed.\n *\n * If the pagination is 'discrete', the entity is removed from the page.\n * If this is the only entity in the page, the current pageNumber is\n * decremented by 1 if it's possible (if the current pageNumber > 1).\n * The page is reloaded from remote.\n */\n removeEntity(id: TEntity[IdKey]) {\n const paginator = this._paginator;\n if (paginator) {\n if (this.pagination() === 'infinite') {\n // This will cause store to mutate which will trigger this.entity$ to\n // emit which in turn will update our MatTableDataSource instance.\n this.store.update(deleteEntities(id));\n } else {\n // Logic\n this.store.update(deleteEntities(id));\n const count = this.store.query(getEntitiesCount());\n if (count == 0) {\n // No more entities in this page\n // Go back one page\n if (this.pageIndex() > 0) {\n this.pageIndex.set(this.pageIndex() - 1);\n }\n }\n // load the page again\n this.loadMoreEntities();\n }\n } else {\n // Just remove the entity that has been deleted.\n this.store.update(deleteEntities(id));\n }\n }\n\n // getColumnValue(\n // entity: TEntity,\n // column: SPEntityFieldSpec<TEntity>\n // ) {\n // let val = undefined;\n // if (!column.valueFn) {\n // if (\n // this.config?.columnValueFns &&\n // this.config.columnValueFns.has(column.name)\n // ) {\n // val = this.config.columnValueFns.get(column.name)!(entity, column.name);\n // } else {\n // val = (entity as any)[column.name];\n // }\n // } else {\n // val = column.valueFn(entity);\n // }\n // if (val instanceof Date) {\n // return spFormatDate(val);\n // } else if (typeof val === 'boolean') {\n // return val ? '✔' : '✖';\n // }\n // return val;\n // }\n\n // getColumnLabel(column: SPEntityFieldSpec<TEntity>) {\n // return this.config && this.config?.i18nTranslate\n // ? this.config.i18nTranslate(column?.label || column.name)\n // : column?.label || column.name;\n // }\n\n /**\n * Build the contentColumnDefs array by enumerating all of client's projected\n * content with matColumnDef directive.\n */\n buildContentColumnDefs() {\n const clientColumnDefs = this.clientColumnDefs;\n if (clientColumnDefs) {\n this.contentColumnDefs = clientColumnDefs.toArray();\n }\n }\n\n /**\n * Build the effective columns by parsing our own <ng-container matColumnDef>\n * statements for each column in columns() property and client's\n * <ng-container matColumnDef> provided via content projection.\n */\n buildColumns() {\n const matTable = this.table();\n\n if (matTable) {\n const columnNames = new Set<string>();\n const columnDefs: MatColumnDef[] = [];\n\n this._columns().forEach((colDef) => {\n if (!columnNames.has(colDef.name)) {\n const matColDef = this.viewColumnDefs().find(\n (cd) => cd.name === colDef.name\n );\n const clientColDef = this.contentColumnDefs.find(\n (cd) => cd.name === colDef.name\n );\n const columnDef = clientColDef ? clientColDef : matColDef;\n if (columnDef) {\n columnDefs.push(columnDef);\n columnNames.add(colDef.name);\n }\n }\n });\n columnDefs.forEach((cd) => {\n matTable.addColumnDef(cd);\n });\n\n this.allColumnNames.set(Array.from(columnNames));\n // this.displayedColumns.set(Array.from(columnNames) as string[]);\n }\n }\n\n setupSort() {\n const matSort = this.sort();\n if (matSort) {\n this.dataSource().sort = matSort;\n }\n }\n\n infiniteScrollLoadNextPage(ev: any) {\n // console.log(`infiniteScrollLoadNextPage - ${JSON.stringify(ev)}`);\n if (this._paginator) {\n this.loadMoreEntities();\n }\n }\n\n loadMoreEntities() {\n let pageParams = {};\n if (this._paginator) {\n pageParams = this._paginator.getRequestPageParams(\n this.endpoint(),\n this.pageIndex(),\n this.pageSize()\n );\n }\n const parts = this.endpoint().split('?');\n let params = new HttpParams(parts.length > 1 ? { fromString: parts[1] } : undefined);\n for (const key in pageParams) {\n params = params.append(key, (pageParams as any)[key]);\n }\n\n // Inline check for input signal value before calling its value doesn't\n // seem to work as of now. So we assign the value to a const and check\n // it for undefined before calling it.\n const loaderFn = this.entityLoaderFn();\n const obs =\n loaderFn !== undefined\n ? loaderFn({ params })\n : this.http.get<any>(this.getUrl(parts[0]), {\n context: this._httpReqContext(),\n params,\n });\n\n this.loading.set(true);\n this.subs$.add(\n obs\n .pipe(\n tap((resp) => {\n // TODO: defer this to a pagination provider so that we can support\n // many types of pagination. DRF itself has different schemes. And\n // express may have yet another pagination protocol.\n this.firstLoadDone = true;\n\n if (this._paginator) {\n // Convert HttpParams to JS object\n const paramsObj: any = {};\n params.keys().forEach(key => {\n paramsObj[key] = params.get(key);\n });\n const { entities, total } = this._paginator.parseRequestResponse(\n this.entityName(),\n this._entityNamePlural()!,\n this.endpoint(),\n paramsObj,\n resp\n );\n this.entityCount.set(total);\n this.lastFetchedEntitiesCount.set(entities.length);\n // this.pageIndex.set(this.pageIndex() + 1)\n // entities = this._paginator.getEntitiesFromResponse(entities);\n if (this.pagination() === 'discrete') {\n this.store.reset();\n } else if (this.pagination() === 'infinite') {\n const pageSize = this._pageSize();\n const entityCount = this.entityCount();\n if (pageSize > 0) {\n const pageCount =\n Math.floor(entityCount / pageSize) +\n (entityCount % pageSize ? 1 : 0);\n this.hasMore.set(this.pageIndex() === pageCount);\n } else {\n this.hasMore.set(false);\n }\n }\n // store the entities in the store\n // TODO: remove as any\n this.store.update(upsertEntities(entities as any));\n } else {\n this.store.update(\n upsertEntities(this.findArrayInResult(resp) as TEntity[])\n );\n }\n }),\n finalize(() => {\n this.loading.set(false);\n })\n )\n .subscribe()\n );\n }\n\n private findArrayInResult(res: any): any[] | undefined {\n if (Array.isArray(res)) {\n return res;\n }\n for (const key in res) {\n if (Object.prototype.hasOwnProperty.call(res, key)) {\n const element = res[key];\n if (Array.isArray(element)) {\n return element;\n }\n }\n }\n return [];\n }\n\n handlePageEvent(e: PageEvent) {\n this.pageIndex.set(e.pageIndex);\n this.loadMoreEntities();\n }\n\n getUrl(endpoint: string) {\n return this.entityListConfig?.urlResolver\n ? this.entityListConfig?.urlResolver(endpoint)\n : endpoint;\n }\n\n toggleActiveEntity(entity: TEntity|undefined) {\n if (entity) {\n if (entity === this.activeEntity()) {\n this.activeEntity.set(undefined);\n } else {\n this.activeEntity.set(entity);\n }\n } else {\n this.activeEntity.set(undefined);\n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A,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqFX,EAoCkB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,4XAAA,CAAA,EAAA;iIAmJlB,gBAAgB,EAAA,CAAA;sBAA9C,eAAe;uBAAC,YAAY;gBAmGnB,YAAY,EAAA,CAAA;sBAArB;;;ACxdH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"smallpearl-ngx-helper-mat-entity-list.mjs","sources":["../../../../projects/smallpearl/ngx-helper/mat-entity-list/src/mat-entity-list-types.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-list/src/providers.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-list/src/config.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-list/src/mat-entity-list.component.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-list/smallpearl-ngx-helper-mat-entity-list.ts"],"sourcesContent":["import { HttpContextToken } from \"@angular/common/http\";\nimport { Observable } from \"rxjs\";\n\nexport interface SPMatEntityListHttpContext {\n entityName: string;\n entityNamePlural: string;\n endpoint: string;\n}\n\nexport const SP_MAT_ENTITY_LIST_HTTP_CONTEXT =\n new HttpContextToken<SPMatEntityListHttpContext>(() => ({\n entityName: '',\n entityNamePlural: '',\n endpoint: '',\n }));\n\n/**\n * Pagination HTTP request params. Actually copied from Angular's HttpParams\n * declaration. The ReadonlyArray<string|number|boolean> is a bit of an\n * overkill for pagination params, but what the heck. When you copy-paste,\n * do it in full!\n */\nexport type SPPageParams = { [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>; }\n\n/**\n * An interface that the clients should provide, either via a global config\n * (see above), that handles parsing the GET response and returns the entities\n * stored therein. This class will allow the entity-list component to be\n * used across different pagination response types as long as the appropriate\n * SPMatEntityListPaginator class is provided to the component.\n */\nexport interface SPMatEntityListPaginator {\n getRequestPageParams: (endpoint: string, pageIndex: number, pageSize: number) => SPPageParams;\n parseRequestResponse: <\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n >(\n entityName: string,\n entityNamePlural: string,\n endpoint: string,\n params: SPPageParams,\n resp: any\n ) => { total: number; entities: TEntity[] };\n}\n\n/**\n * 'entity' is really TEntity arg of SPMatEntityListComponent<TEntity>.\n * 'column' is the column name. This allows the same value function to support\n * multiple columns further enabing DRY.\n */\nexport type COLUMN_VALUE_FN = (entity: any, column: string) => string|number|Date|boolean;\n\n/**\n * Global config for SPMatEntityList component.\n */\nexport interface SPMatEntityListConfig {\n urlResolver?: (endpoint: string) => string;\n paginator?: SPMatEntityListPaginator;\n defaultPageSize?: number;\n pageSizes?: Array<number>;\n /**\n * These are global column value functions.\n *\n * If a value function for a column is not explicitly specified, this map is\n * looked up with the column name. If an entry exists in this table, it will\n * be used to render the column's value.\n *\n * This is useful for formatting certain column types which tends to have the\n * same name across the app. For instance columns such as 'amount', 'total'\n * or 'balance'. Or 'date', 'timestamp', etc. The return value from the\n * column value functions are deemed safe and therefore\n */\n // columnValueFns?: Map<string, COLUMN_VALUE_FN>;\n}\n\n/**\n * Type for custom entities loader function, which if provided will be called\n * instead of HttpClient.get.\n */\nexport type SPMatEntityListEntityLoaderFn = (params: any) => Observable<any>;\n","import { InjectionToken } from '@angular/core';\nimport { SPMatEntityListConfig } from './mat-entity-list-types';\n\nexport const SP_MAT_ENTITY_LIST_CONFIG = new InjectionToken<SPMatEntityListConfig>(\n 'SPMatEntityListConfig'\n);\n","import { inject } from '@angular/core';\nimport { SPMatEntityListConfig } from './mat-entity-list-types';\nimport { SP_MAT_ENTITY_LIST_CONFIG } from './providers';\n\nexport const DefaultSPMatEntityListConfig: SPMatEntityListConfig = {\n urlResolver: (endpoint: string) => endpoint,\n paginator: undefined,\n defaultPageSize: 50,\n pageSizes: [10, 25, 50, 100],\n};\n\n/**\n * To be called from an object's constructor.\n */\nexport function getEntityListConfig(): SPMatEntityListConfig {\n const entityListConfig = inject(SP_MAT_ENTITY_LIST_CONFIG, {\n optional: true,\n });\n return {\n ...DefaultSPMatEntityListConfig,\n ...(entityListConfig ?? {}),\n };\n}\n","import { CommonModule } from '@angular/common';\nimport { HttpClient, HttpContext, HttpContextToken, HttpParams } from '@angular/common/http';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n computed,\n ContentChildren,\n Directive,\n effect,\n ElementRef,\n EventEmitter,\n inject,\n Injector,\n input,\n OnDestroy,\n OnInit,\n Output,\n QueryList,\n runInInjectionContext,\n signal,\n viewChild,\n viewChildren\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatPaginatorModule, PageEvent } from '@angular/material/paginator';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatSort, MatSortModule } from '@angular/material/sort';\nimport {\n MatColumnDef,\n MatTable,\n MatTableDataSource,\n MatTableModule,\n} from '@angular/material/table';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { RouterModule } from '@angular/router';\nimport { createStore } from '@ngneat/elf';\nimport {\n addEntities,\n deleteEntities,\n getEntitiesCount,\n hasEntity,\n selectAllEntities,\n updateEntities,\n upsertEntities,\n withEntities,\n} from '@ngneat/elf-entities';\nimport { getNgxHelperConfig } from '@smallpearl/ngx-helper/core';\nimport {\n SP_ENTITY_FIELD_CONFIG,\n SPEntityField,\n SPEntityFieldSpec\n} from '@smallpearl/ngx-helper/entity-field';\nimport { InfiniteScrollDirective } from 'ngx-infinite-scroll';\nimport { plural } from 'pluralize';\nimport {\n distinctUntilChanged,\n filter,\n finalize,\n Observable,\n Subject,\n Subscription,\n switchMap,\n takeUntil,\n tap\n} from 'rxjs';\nimport { getEntityListConfig } from './config';\nimport {\n SP_MAT_ENTITY_LIST_HTTP_CONTEXT,\n SPMatEntityListEntityLoaderFn,\n SPMatEntityListPaginator\n} from './mat-entity-list-types';\n\n@Directive({\n selector: '[headerAlignment]',\n standalone: true\n})\nexport class HeaderAlignmentDirective implements AfterViewInit {\n\n headerAlignment = input<string>();\n\n constructor(private el: ElementRef) {\n // this.el.nativeElement.style.backgroundColor = 'yellow';\n }\n\n ngAfterViewInit(): void {\n if (this.headerAlignment()) {\n const sortHeader = this.el.nativeElement.querySelector('.mat-sort-header-container');\n if (sortHeader) {\n sortHeader.style.justifyContent = this.headerAlignment();\n } else {\n this.el.nativeElement.style.justifyContent = this.headerAlignment();\n }\n }\n }\n}\n\n/**\n * Represents a request to load entities from the remote. This is used to\n * compare two requests to determine if they are equal. This is useful to\n * prevent duplicate requests being sent to the remote.\n */\nclass LoadRequest {\n constructor(\n public endpoint: string,\n public params: HttpParams,\n public force = false\n ) {}\n\n // Returns true if two LoadRequest objects are equal and this object's\n // 'force' is not set to true.\n isEqualToAndNotForced(prev: LoadRequest): boolean {\n // console.log(\n // `isEqualToAndNotForced - ${this.endpoint}, ${this.params.toString()} ${\n // this.force\n // }, other: ${prev.endpoint}, ${prev.params.toString()}, ${prev.force}`\n // );\n return this.force\n ? false\n : this.endpoint.localeCompare(prev.endpoint) === 0 &&\n this.params.toString().localeCompare(prev.params.toString()) === 0;\n }\n}\n\n/**\n * A component to display a list of entities loaded from remote.\n */\n@Component({\n imports: [\n CommonModule,\n RouterModule,\n MatTableModule,\n MatSortModule,\n MatPaginatorModule,\n MatButtonModule,\n MatInputModule,\n MatProgressSpinnerModule,\n InfiniteScrollDirective,\n HeaderAlignmentDirective,\n ],\n selector: 'sp-mat-entity-list',\n template: `\n <div\n class=\"entities-list-wrapper\"\n infiniteScroll\n [infiniteScrollDistance]=\"infiniteScrollDistance()\"\n [infiniteScrollThrottle]=\"infiniteScrollThrottle()\"\n [infiniteScrollContainer]=\"infiniteScrollContainer()\"\n [scrollWindow]=\"infiniteScrollWindow()\"\n [infiniteScrollDisabled]=\"\n pagination() !== 'infinite' || !_paginator || !hasMore()\n \"\n (scrolled)=\"infiniteScrollLoadNextPage($event)\"\n >\n <div\n class=\"busy-overlay\"\n [ngClass]=\"{ show: pagination() === 'discrete' && loading() }\"\n >\n <ng-container *ngTemplateOutlet=\"busySpinner\"></ng-container>\n </div>\n <table mat-table [dataSource]=\"dataSource()\">\n <tr mat-header-row *matHeaderRowDef=\"_displayedColumns()\"></tr>\n <tr\n mat-row\n [class.active-row]=\"activeEntityId() === row[this.idKey()]\"\n *matRowDef=\"let row; columns: _displayedColumns()\"\n (click)=\"toggleActiveEntity(row)\"\n ></tr>\n </table>\n @if (pagination() == 'discrete' && _paginator) {\n <mat-paginator\n showFirstLastButtons\n [length]=\"entityCount()\"\n [pageSize]=\"_pageSize()\"\n [pageIndex]=\"pageIndex()\"\n [pageSizeOptions]=\"[]\"\n [hidePageSize]=\"true\"\n (page)=\"handlePageEvent($event)\"\n [disabled]=\"loading()\"\n aria-label=\"Select page\"\n ></mat-paginator>\n }\n <div\n class=\"infinite-scroll-loading\"\n [ngClass]=\"{ show: pagination() === 'infinite' && loading() }\"\n >\n <ng-container *ngTemplateOutlet=\"busySpinner\"></ng-container>\n </div>\n </div>\n <!-- We keep the column definitions outside the <table> so that they can\n be dynamically added to the MatTable. -->\n <span matSort=\"sorter()\">\n @for (column of __columns(); track $index) {\n <ng-container [matColumnDef]=\"column.spec.name\">\n @if (disableSort()) {\n <th [class]=\"column.class\" [headerAlignment]=\"column.options.alignment\" mat-header-cell *matHeaderCellDef>\n {{ column.label() }}\n </th>\n } @else {\n <th [class]=\"column.class\" [headerAlignment]=\"column.options.alignment\" mat-header-cell mat-sort-header *matHeaderCellDef>\n {{ column.label() }}\n </th>\n }\n <td\n [class]=\"column.class\"\n [style.text-align]=\"column.options.alignment\"\n mat-cell\n *matCellDef=\"let element\"\n [routerLink]=\"column.getRouterLink(element)\"\n >\n @if (column.hasRouterLink(element)) {\n <a [routerLink]=\"column.getRouterLink(element)\">\n <span [innerHTML]=\"column.value(element)\"></span>\n </a>\n } @else {\n <span [innerHTML]=\"column.value(element)\"></span>\n }\n </td>\n </ng-container>\n }\n </span>\n <ng-template #busySpinner>\n <div class=\"busy-spinner\">\n <mat-spinner mode=\"indeterminate\" diameter=\"28\"></mat-spinner>\n </div>\n </ng-template>\n `,\n styles: [`\n .entities-list-wrapper {\n position: relative;\n }\n .busy-overlay {\n display: none;\n height: 100%;\n width: 100%;\n position: absolute;\n top: 0px;\n left: 0px;\n z-index: 1000;\n opacity: 0.6;\n background-color: transparent;\n }\n .show {\n display: block;\n }\n .busy-spinner {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .infinite-scroll-loading {\n display: none;\n width: 100%;\n padding: 8px;\n }\n .active-row {\n font-weight: bold;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SPMatEntityListComponent<\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n> implements OnInit, OnDestroy, AfterViewInit\n{\n /* CLIENT PROVIDED PARAMETERS */\n entityName = input.required<string>();\n entityNamePlural = input<string>();\n\n /**\n * The endpoint from where the entities are to be retrieved\n */\n endpoint = input<string>('');\n /**\n * Custom entities loader function, which if provided will be called\n * instead of HttpClient.get.\n */\n entityLoaderFn = input<SPMatEntityListEntityLoaderFn | undefined>(undefined);\n /**\n * The columns of the entity to be displayed. This is an array of\n * SPEntityFieldSpec objects. If there's a one-to-one mapping between the\n * column's field name, its title & the rendered value, a string can be\n * specified instead. That is, the value of this property is a heterogeneous\n * array consisting of SPEntityFieldSpec<> objects and strings.\n */\n columns =\n input.required<Array<SPEntityFieldSpec<TEntity, IdKey> | string>>();\n\n /**\n * Names of columns that are displayed. This will default to all the columns\n * listed in columns.\n */\n displayedColumns = input<string[]>([]); // ['name', 'cell', 'gender'];\n\n /**\n * Number of entities per page. If this is not set and paginator is defined,\n * the number of entities int in the first request, will be taken as the\n * page size.\n */\n pageSize = input<number>(0);\n /**\n * Entity idKey, if idKey is different from the default 'id'.\n */\n idKey = input<string>('id');\n /**\n * Type of pagination -- continuous or discrete. 'infinite' pagination\n * uses an 'infiniteScroll' and 'discrete' pagination uses a mat-paginator\n * at the bottom to navigate between pages.\n */\n pagination = input<'infinite' | 'discrete' | 'none'>('discrete');\n /**\n * Component specific paginator. Only used if pagination != 'none'.\n */\n paginator = input<SPMatEntityListPaginator>();\n /**\n *\n */\n sorter = input<MatSort>();\n /**\n * Disable sorting of rows\n */\n disableSort = input<boolean>(false);\n /**\n * Wrappers for infiniteScroll properties, for customization by the client\n */\n infiniteScrollContainer = input<any>('');\n infiniteScrollDistance = input<number>(1);\n infiniteScrollThrottle = input<number>(400);\n infiniteScrollWindow = input<boolean>(false);\n /**\n * Custom context to be set for HttpClient requests. In the client code\n * specify this property by initializing a member variable as:\n\n ```\n Component({\n ...\n template: `\n <sp-mat-entity-list\n [httpReqContext]=\"httpReqContext\"\n ></sp-mat-entity-list>\n `\n })\n export class YourComponent {\n httpReqContext: [HttpContextToken<any>, any] = [\n SIDELOAD_TO_COMPOSITE_PARAMS, 'customers'\n ];\n }\n ```\n *\n * Of course if you want to pass multiple context properties, declare the type\n * as an array of array. That is, `[[HttpContextToken<any>, any]]` and\n * initialize it appropriately.\n */\n httpReqContext = input<[[HttpContextToken<any>, any]]|[HttpContextToken<any>, any]>();\n /* END CLIENT PROVIDED PARAMETERS */\n\n // *** INTERNAL *** //\n _entityNamePlural = computed(() =>\n this.entityNamePlural()\n ? this.entityNamePlural()\n : plural(this.entityName())\n );\n\n _httpReqContext = computed(() => {\n let reqContext = this.httpReqContext();\n const context = new HttpContext();\n if (reqContext && Array.isArray(reqContext)) {\n if (reqContext.length == 2 && !Array.isArray(reqContext[0])) {\n // one dimensional array of a key, value pair.\n context.set(reqContext[0], reqContext[1]);\n } else {\n reqContext.forEach(([k, v]) => context.set(k, v));\n }\n }\n context.set(SP_MAT_ENTITY_LIST_HTTP_CONTEXT, {\n entityName: this.entityName(),\n entityNamePlural: this._entityNamePlural(),\n endpoint: this.endpoint()\n })\n return context;\n })\n _deferViewInit = input<boolean>(false);\n firstLoadDone = false;\n allColumnNames = signal<string[]>([]);\n _displayedColumns = computed(() =>\n this.displayedColumns().length > 0\n ? this.displayedColumns().filter(\n (colName) =>\n this.allColumnNames().find((name) => name === colName) !== undefined\n )\n : this.allColumnNames()\n );\n dataSource = signal<MatTableDataSource<TEntity>>(\n new MatTableDataSource<TEntity>()\n );\n\n table = viewChild(MatTable);\n sort = viewChild(MatSort);\n // These are our own <ng-container matColumnDef></ng-container>\n // which we create for each column that we create by the declaration:\n // <ng-container *ngFor=\"let column of columns()\" [matColumnDef]=\"column.name\">\n viewColumnDefs = viewChildren(MatColumnDef);\n // These are the <ng-container matColumnDef></ng-container> placed\n // inside <sp-mat-entity-list></<sp-mat-entity-list> by the client to override\n // the default <ng-container matColumnDef> created by the component.\n @ContentChildren(MatColumnDef) clientColumnDefs!: QueryList<MatColumnDef>;\n\n contentColumnDefs: MatColumnDef[] = [];\n\n subs$ = new Subscription();\n destroy$ = new Subject<void>();\n\n // Pagination state\n entityCount = signal<number>(0);\n pageIndex = signal<number>(0);\n\n // Mechanism to default pageSize to last entities length.\n lastFetchedEntitiesCount = signal<number>(0);\n _pageSize = computed<number>(() =>\n this.pageSize()\n ? this.pageSize()\n : this.entityListConfig.defaultPageSize ?? this.lastFetchedEntitiesCount()\n );\n // Effective columns, derived from columns(), which can either be an array\n // of objects of array of strings.\n _columns = computed<SPEntityFieldSpec<TEntity, IdKey>[]>(() => {\n const columns = this.columns();\n let fields: SPEntityField<TEntity, IdKey>[] = [];\n let cols: SPEntityFieldSpec<TEntity, IdKey>[] = [];\n columns.forEach((colDef) => {\n // fields.push(new SPEntityField(colDef))\n if (typeof colDef === 'string') {\n cols.push({ name: String(colDef) });\n } else if (typeof colDef === 'object') {\n cols.push(colDef as SPEntityFieldSpec<TEntity, IdKey>);\n }\n });\n return cols;\n });\n\n __columns = computed<SPEntityField<TEntity, IdKey>[]>(() =>\n this.columns().map((colDef) => new SPEntityField<TEntity, IdKey>(colDef, this.ngxHelperConfig, this.fieldConfig))\n );\n\n // We isolate retrieving items from the remote and providing the items\n // to the component into two distinct operations. The retrieval operation\n // retrieves data asynchronously and then stores the data in a local store.\n // The UI would be 'listening' to a reactive callback that would be triggered\n // whenever items in the store changes. This is because store is an immutable\n // data structure and any changes (addition/deletion) to it would result in\n // the entire store being replaced with a copy with the changes applied.\n\n // Ideally we should declare this as\n // store!: Store<...>. But @ngneat/elf does not provide a generic type\n // for Store<...>, which can be composed from its type arguments. Instead it\n // uses type composition using its arguments to generate store's type\n // implicitly. So we use the same mechanism to enforce type safety in our\n // code. The code below results in a type declaration for store that is\n // dependent on the components generic arguments. (Making use of TypeScript's\n // type deduction system from variable assignment). Later on in the\n // constructor we reassign this.store with a new object that uses the\n // client provided idKey() value as the identifying key for each entity in\n // the sore.\n store = createStore(\n { name: Math.random().toString(36).slice(2) },\n withEntities<TEntity, IdKey>({ idKey: this.idKey() as IdKey })\n );\n // We'll initialize this in ngOnInit() when 'store' is initialized with the\n // correct TEntity store that can be safely indexed using IdKey.\n entities$!: Observable<TEntity[]>;\n // Effective paginator, coalescing local paginator and paginator from global\n // config.\n _paginator!: SPMatEntityListPaginator | undefined;\n // We will toggle this during every entity load.\n loading = signal<boolean>(false);\n // We will update this after every load and pagination() == 'infinite'\n hasMore = signal<boolean>(true);\n\n activeEntity = signal<TEntity | undefined>(undefined);\n activeEntityId = computed(() =>\n this.activeEntity() ? (this.activeEntity() as any)[this.idKey()] : undefined\n );\n _prevActiveEntity!: TEntity | undefined;\n _activeEntityChange = effect(() => {\n runInInjectionContext(this.injector, () => {\n const activeEntity = this.activeEntity();\n // Though we can raise the selectEntity event directly from effect handler,\n // that would prevent the event handler from being able to update any\n // signals from inside it. So we generate the event asyncronously.\n // Also, this effect handler will be invoked for the initial 'undefined'\n // during which we shouldn't emit the selectEntity event. Therefore we\n // keep another state variable to filter out this state.\n if (activeEntity || this._prevActiveEntity) {\n setTimeout(() => {\n this._prevActiveEntity = activeEntity;\n this.selectEntity.emit(activeEntity);\n // if (this._prevActiveEntity && !activeEntity) {\n // this.selectEntity.emit(activeEntity);\n // } else if (activeEntity) {\n // this.selectEntity.emit(activeEntity);\n // }\n });\n }\n });\n });\n @Output() selectEntity = new EventEmitter<TEntity | undefined>();\n\n ngxHelperConfig = getNgxHelperConfig();\n fieldConfig = inject(SP_ENTITY_FIELD_CONFIG, { optional: true })!;\n entityListConfig = getEntityListConfig();\n\n /**\n * A signal that can be used to trigger loading of more entities from the\n * remote. This can be visualized as the event loop of the entity list\n * component.\n */\n loadRequest$ = new Subject<LoadRequest>();\n\n endpointChanged = effect(() => {\n runInInjectionContext(this.injector, () => {\n if (this.endpoint()) {\n // console.log(`endpointChanged - ${this.endpoint()}`);\n setTimeout(() => { this.refresh(); });\n }\n });\n });\n\n constructor(\n protected http: HttpClient,\n private sanitizer: DomSanitizer,\n private injector: Injector,\n ) {\n // if (!this.config) {\n // this.config = new DefaultSPMatEntityListConfig();\n // }\n // this.fieldConfig = inject(SP_ENTITY_FIELD_CONFIG, { optional: true })!;\n }\n\n ngOnInit() {\n // This is the reactive callback that listens for changes to table entities\n // which are reflected in the mat-table.\n this.store = createStore(\n { name: Math.random().toString(36).slice(2) },\n withEntities<TEntity, IdKey>({ idKey: this.idKey() as IdKey })\n );\n this.entities$ = this.store.pipe(selectAllEntities());\n this._paginator = this.paginator()\n ? this.paginator()\n : this.entityListConfig?.paginator;\n\n this.entities$\n .pipe(\n takeUntil(this.destroy$),\n tap((entities) => {\n // .data is a setter property, which ought to trigger the necessary\n // signals resulting in mat-table picking up the changes without\n // requiring us to call cdr.detectChanges() explicitly.\n this.dataSource().data = entities;\n })\n )\n .subscribe()\n\n this.loadRequest$\n .pipe(\n takeUntil(this.destroy$),\n filter((lr) => lr.endpoint !== '' || lr.force === true),\n distinctUntilChanged((prev, current) => current.isEqualToAndNotForced(prev)),\n switchMap((lr: LoadRequest) => this.doActualLoad(lr))\n )\n .subscribe()\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n ngAfterViewInit(): void {\n if (!this._deferViewInit()) {\n this.buildContentColumnDefs();\n this.buildColumns();\n this.setupSort();\n this.loadMoreEntities();\n }\n }\n\n /**\n * Clear all entities in store and reload them from endpoint as if\n * the entities are being loaded for the first time.\n */\n refresh(force = false) {\n this.pageIndex.set(0);\n this.loadMoreEntities(force);\n }\n\n addEntity(entity: TEntity) {\n const pagination = this.pagination();\n const count = this.store.query(getEntitiesCount());\n if (\n pagination === 'infinite' ||\n pagination === 'none' ||\n count < this._pageSize()\n ) {\n this.store.update(addEntities(entity));\n } else {\n // 'discrete' pagination, refresh the crud items from the beginning.\n // Let component client set the behavior using a property\n // this.pageIndex.set(0);\n // this.loadMoreEntities();\n }\n }\n\n /**\n * Update an entity with a modified version. Can be used by CRUD UPDATE\n * operation to update an entity in the local store that is used to as the\n * source of MatTableDataSource.\n * @param id\n * @param entity\n */\n updateEntity(id: TEntity[IdKey], entity: TEntity) {\n if (this.store.query(hasEntity(id))) {\n this.store.update(updateEntities(id, entity));\n }\n }\n\n /**\n * Clients can call this method when it has deleted and entity via a CRUD\n * operation. Depending on the pagination mode, MatEntityList implements\n * an appropriate behavior.\n *\n * If the pagination is 'infinite', the relevent entity is removed from our\n * entity list. View will be repained as data store has changed.\n *\n * If the pagination is 'discrete', the entity is removed from the page.\n * If this is the only entity in the page, the current pageNumber is\n * decremented by 1 if it's possible (if the current pageNumber > 1).\n * The page is reloaded from remote.\n */\n removeEntity(id: TEntity[IdKey]) {\n const paginator = this._paginator;\n if (paginator) {\n if (this.pagination() === 'infinite') {\n // This will cause store to mutate which will trigger this.entity$ to\n // emit which in turn will update our MatTableDataSource instance.\n this.store.update(deleteEntities(id));\n } else {\n // Logic\n this.store.update(deleteEntities(id));\n const count = this.store.query(getEntitiesCount());\n if (count == 0) {\n // No more entities in this page\n // Go back one page\n if (this.pageIndex() > 0) {\n this.pageIndex.set(this.pageIndex() - 1);\n }\n }\n // load the page again\n this.loadMoreEntities();\n }\n } else {\n // Just remove the entity that has been deleted.\n this.store.update(deleteEntities(id));\n }\n }\n\n // getColumnValue(\n // entity: TEntity,\n // column: SPEntityFieldSpec<TEntity>\n // ) {\n // let val = undefined;\n // if (!column.valueFn) {\n // if (\n // this.config?.columnValueFns &&\n // this.config.columnValueFns.has(column.name)\n // ) {\n // val = this.config.columnValueFns.get(column.name)!(entity, column.name);\n // } else {\n // val = (entity as any)[column.name];\n // }\n // } else {\n // val = column.valueFn(entity);\n // }\n // if (val instanceof Date) {\n // return spFormatDate(val);\n // } else if (typeof val === 'boolean') {\n // return val ? '✔' : '✖';\n // }\n // return val;\n // }\n\n // getColumnLabel(column: SPEntityFieldSpec<TEntity>) {\n // return this.config && this.config?.i18nTranslate\n // ? this.config.i18nTranslate(column?.label || column.name)\n // : column?.label || column.name;\n // }\n\n /**\n * Build the contentColumnDefs array by enumerating all of client's projected\n * content with matColumnDef directive.\n */\n buildContentColumnDefs() {\n const clientColumnDefs = this.clientColumnDefs;\n if (clientColumnDefs) {\n this.contentColumnDefs = clientColumnDefs.toArray();\n }\n }\n\n /**\n * Build the effective columns by parsing our own <ng-container matColumnDef>\n * statements for each column in columns() property and client's\n * <ng-container matColumnDef> provided via content projection.\n */\n buildColumns() {\n const matTable = this.table();\n\n if (matTable) {\n const columnNames = new Set<string>();\n const columnDefs: MatColumnDef[] = [];\n\n this._columns().forEach((colDef) => {\n if (!columnNames.has(colDef.name)) {\n const matColDef = this.viewColumnDefs().find(\n (cd) => cd.name === colDef.name\n );\n const clientColDef = this.contentColumnDefs.find(\n (cd) => cd.name === colDef.name\n );\n const columnDef = clientColDef ? clientColDef : matColDef;\n if (columnDef) {\n columnDefs.push(columnDef);\n columnNames.add(colDef.name);\n }\n }\n });\n columnDefs.forEach((cd) => {\n matTable.addColumnDef(cd);\n });\n\n this.allColumnNames.set(Array.from(columnNames));\n // this.displayedColumns.set(Array.from(columnNames) as string[]);\n }\n }\n\n setupSort() {\n const matSort = this.sort();\n if (matSort) {\n this.dataSource().sort = matSort;\n }\n }\n\n infiniteScrollLoadNextPage(ev: any) {\n // console.log(`infiniteScrollLoadNextPage - ${JSON.stringify(ev)}`);\n if (this._paginator) {\n this.loadMoreEntities();\n }\n }\n\n loadMoreEntities(forceRefresh=false) {\n this.loadRequest$.next(this.createNextLoadRequest(forceRefresh));\n }\n\n /**\n * Creates a LoadRequest object for loading entities using the current state\n * of the component. Therefore, if the request is for next page of entities,\n * the LoadRequest object will have the updated page index. However, if\n * pagination has been reset (refer to refresh()), the LoadRequest object\n * will be for the first page of data. Note that when 'endpoint' value\n * changes, the component's pagination state is reset causing a refresh()\n * to be called, which in turn will create a new LoadRequest object for the\n * first page of data.\n * @returns LoadRequest object for the next load request.\n */\n private createNextLoadRequest(forceRefresh: boolean): LoadRequest {\n let pageParams = {};\n const parts = this.endpoint().split('?');\n const endpoint = parts[0];\n if (this._paginator) {\n pageParams = this._paginator.getRequestPageParams(\n endpoint,\n this.pageIndex(),\n this.pageSize()\n );\n }\n const paramsSet = new Map<string, string|number|boolean|null>();\n for (const key in pageParams) {\n paramsSet.set(key, (pageParams as any)[key]);\n }\n if (parts.length > 1) {\n const embeddedParams = new HttpParams({ fromString: parts[1] });\n embeddedParams.keys().forEach((key) => {\n paramsSet.set(key, embeddedParams.get(key));\n });\n }\n let params = new HttpParams();\n paramsSet.forEach((value, key) => {\n params = params.set(key, value ? value.toString() : '');\n });\n // let params = new HttpParams(parts.length > 1 ? { fromString: parts[1] } : undefined);\n // for (const key in pageParams) {\n // params = params.append(key, (pageParams as any)[key]);\n // }\n return new LoadRequest(endpoint, params, forceRefresh || !!this.entityLoaderFn());\n }\n\n /**\n * Does the actual load of entities from the remote or via calling the\n * entityLoaderFn. This method is the workhorse of the entity list\n * 'loader-loop'.\n * @param lr\n * @returns Observable that emits the response from the remote or from\n * entityLoaderFn().\n */\n private doActualLoad(lr: LoadRequest) {\n // console.log(`doActualLoad - endpoint: ${lr.endpoint}, params: ${lr.params.toString()}`);\n const loaderFn = this.entityLoaderFn();\n const params = lr.params\n const obs =\n loaderFn !== undefined\n ? loaderFn({ params })\n : this.http.get<any>(this.getUrl(lr.endpoint), {\n context: this._httpReqContext(),\n params,\n });\n\n this.loading.set(true);\n return obs.pipe(\n tap((resp) => {\n // TODO: defer this to a pagination provider so that we can support\n // many types of pagination. DRF itself has different schemes. And\n // express may have yet another pagination protocol.\n this.firstLoadDone = true;\n if (this._paginator) {\n // Convert HttpParams to JS object\n const paramsObj: any = {};\n params.keys().forEach((key) => {\n paramsObj[key] = params.get(key);\n });\n const { entities, total } = this._paginator.parseRequestResponse(\n this.entityName(),\n this._entityNamePlural()!,\n this.endpoint(),\n paramsObj,\n resp\n );\n this.entityCount.set(total);\n this.lastFetchedEntitiesCount.set(entities.length);\n // this.pageIndex.set(this.pageIndex() + 1)\n // entities = this._paginator.getEntitiesFromResponse(entities);\n if (this.pagination() === 'discrete') {\n this.store.reset();\n } else if (this.pagination() === 'infinite') {\n const pageSize = this._pageSize();\n const entityCount = this.entityCount();\n if (pageSize > 0) {\n const pageCount =\n Math.floor(entityCount / pageSize) +\n (entityCount % pageSize ? 1 : 0);\n this.hasMore.set(this.pageIndex() === pageCount);\n } else {\n this.hasMore.set(false);\n }\n }\n // store the entities in the store\n // TODO: remove as any\n this.store.update(upsertEntities(entities as any));\n } else {\n this.store.update(\n upsertEntities(this.findArrayInResult(resp) as TEntity[])\n );\n }\n }),\n finalize(() => this.loading.set(false))\n );\n }\n\n private findArrayInResult(res: any): any[] | undefined {\n if (Array.isArray(res)) {\n return res;\n }\n for (const key in res) {\n if (Object.prototype.hasOwnProperty.call(res, key)) {\n const element = res[key];\n if (Array.isArray(element)) {\n return element;\n }\n }\n }\n return [];\n }\n\n handlePageEvent(e: PageEvent) {\n this.pageIndex.set(e.pageIndex);\n this.loadMoreEntities();\n }\n\n getUrl(endpoint: string) {\n return this.entityListConfig?.urlResolver\n ? this.entityListConfig?.urlResolver(endpoint)\n : endpoint;\n }\n\n toggleActiveEntity(entity: TEntity|undefined) {\n if (entity) {\n if (entity === this.activeEntity()) {\n this.activeEntity.set(undefined);\n } else {\n this.activeEntity.set(entity);\n }\n } else {\n this.activeEntity.set(undefined);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AASa,MAAA,+BAA+B,GAC1C,IAAI,gBAAgB,CAA6B,OAAO;AACtD,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,QAAQ,EAAE,EAAE;AACb,CAAA,CAAC;;MCXS,yBAAyB,GAAG,IAAI,cAAc,CACzD,uBAAuB;;ACAlB,MAAM,4BAA4B,GAA0B;AACjE,IAAA,WAAW,EAAE,CAAC,QAAgB,KAAK,QAAQ;AAC3C,IAAA,SAAS,EAAE,SAAS;AACpB,IAAA,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;CAC7B;AAED;;AAEG;SACa,mBAAmB,GAAA;AACjC,IAAA,MAAM,gBAAgB,GAAG,MAAM,CAAC,yBAAyB,EAAE;AACzD,QAAA,QAAQ,EAAE,IAAI;AACf,KAAA,CAAC;IACF,OAAO;AACL,QAAA,GAAG,4BAA4B;AAC/B,QAAA,IAAI,gBAAgB,IAAI,EAAE,CAAC;KAC5B;AACH;;MCwDa,wBAAwB,CAAA;AAIf,IAAA,EAAA;IAFpB,eAAe,GAAG,KAAK,EAAU;AAEjC,IAAA,WAAA,CAAoB,EAAc,EAAA;QAAd,IAAE,CAAA,EAAA,GAAF,EAAE;;;IAItB,eAAe,GAAA;AACb,QAAA,IAAI,IAAI,CAAC,eAAe,EAAE,EAAE;AAC1B,YAAA,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,aAAa,CAAC,4BAA4B,CAAC;YACpF,IAAI,UAAU,EAAE;gBACd,UAAU,CAAC,KAAK,CAAC,cAAc,GAAG,IAA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@
|
|
|
1
|
+
import { SPContextMenuItem } from "@smallpearl/ngx-helper/mat-context-menu";
|
|
1
2
|
import { Observable } from "rxjs";
|
|
3
|
+
export declare const ITEM_ACTION_UPDATE = "_update_";
|
|
4
|
+
export declare const ITEM_ACTION_DELETE = "_delete_";
|
|
2
5
|
/**
|
|
3
6
|
* SPMatEntityCrudCreateEditBridge implementer uses this interface to
|
|
4
7
|
* communicate with the parent SPMatEntityCreateComponent. The bridge
|
|
@@ -63,4 +66,10 @@ export interface SPMatEntityCrudComponentBase<TEntity> {
|
|
|
63
66
|
* @returns
|
|
64
67
|
*/
|
|
65
68
|
closePreview: () => void;
|
|
69
|
+
/**
|
|
70
|
+
* Returns the context menu items for the entity. This can be used to build
|
|
71
|
+
* the context menu for an entity in its preview pane toolbar.
|
|
72
|
+
* @returns
|
|
73
|
+
*/
|
|
74
|
+
getItemActions(): SPContextMenuItem[];
|
|
66
75
|
}
|
|
@@ -224,7 +224,7 @@ export declare class SPMatEntityCrudComponent<TEntity extends {
|
|
|
224
224
|
* @returns
|
|
225
225
|
*/
|
|
226
226
|
canDeactivate(): boolean;
|
|
227
|
-
refresh(): void;
|
|
227
|
+
refresh(force?: boolean): void;
|
|
228
228
|
closeCreateEdit(cancelled: boolean): void;
|
|
229
229
|
canCancelEdit(): boolean;
|
|
230
230
|
registerCanCancelEditCallback(callback: () => boolean): void;
|
|
@@ -262,6 +262,13 @@ export declare class SPMatEntityCrudComponent<TEntity extends {
|
|
|
262
262
|
handleSelectEntity(entity: TEntity | undefined): void;
|
|
263
263
|
handleNewItemSubType(subtype: NewItemSubType): void;
|
|
264
264
|
private getCrudReqHttpContext;
|
|
265
|
+
isItemActionAllowed(action: string, entity: TEntity): boolean;
|
|
266
|
+
/**
|
|
267
|
+
* Returns the list of item actions. Calls 'allowItemActionFn' for each action
|
|
268
|
+
* to determine if the action is allowed for the given entity.
|
|
269
|
+
* @returns
|
|
270
|
+
*/
|
|
271
|
+
getItemActions(): SPContextMenuItem[];
|
|
265
272
|
static ɵfac: i0.ɵɵFactoryDeclaration<SPMatEntityCrudComponent<any, any>, never>;
|
|
266
273
|
static ɵcmp: i0.ɵɵComponentDeclaration<SPMatEntityCrudComponent<any, any>, "sp-mat-entity-crud", never, { "itemLabel": { "alias": "itemLabel"; "required": false; "isSignal": true; }; "itemLabelPlural": { "alias": "itemLabelPlural"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "itemActions": { "alias": "itemActions"; "required": false; "isSignal": true; }; "newItemLink": { "alias": "newItemLink"; "required": false; "isSignal": true; }; "newItemLabel": { "alias": "newItemLabel"; "required": false; "isSignal": true; }; "editItemTitle": { "alias": "editItemTitle"; "required": false; "isSignal": true; }; "newItemSubTypes": { "alias": "newItemSubTypes"; "required": false; "isSignal": true; }; "crudOpFn": { "alias": "crudOpFn"; "required": false; "isSignal": true; }; "previewTemplate": { "alias": "previewTemplate"; "required": false; "isSignal": true; }; "allowEntityActionFn": { "alias": "allowEntityActionFn"; "required": false; "isSignal": true; }; "headerTemplate": { "alias": "headerTemplate"; "required": false; "isSignal": true; }; "actionsTemplate": { "alias": "actionsTemplate"; "required": false; "isSignal": true; }; "crudResponseParser": { "alias": "crudResponseParser"; "required": false; "isSignal": true; }; "createEditFormTemplate": { "alias": "createEditFormTemplate"; "required": false; "isSignal": true; }; "disableItemActions": { "alias": "disableItemActions"; "required": false; "isSignal": true; }; "disableCreate": { "alias": "disableCreate"; "required": false; "isSignal": true; }; "refreshAfterEdit": { "alias": "refreshAfterEdit"; "required": false; "isSignal": true; }; "crudHttpReqContext": { "alias": "crudHttpReqContext"; "required": false; "isSignal": true; }; "editPaneWidth": { "alias": "editPaneWidth"; "required": false; "isSignal": true; }; "previewPaneWidth": { "alias": "previewPaneWidth"; "required": false; "isSignal": true; }; }, { "action": "action"; "entityViewPaneActivated": "entityViewPaneActivated"; }, ["_clientColumnDefs"], ["[breadCrumbs]"], true, never>;
|
|
267
274
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { OnDestroy, OnInit } from '@angular/core';
|
|
1
|
+
import { InputSignal, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { SPMatEntityCrudComponentBase } from './mat-entity-crud-internal-types';
|
|
3
3
|
import { SPMatEntityCrudConfig } from './mat-entity-crud-types';
|
|
4
|
+
import { SPContextMenuItem } from '@smallpearl/ngx-helper/mat-context-menu';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
/**
|
|
6
7
|
* A preview pane container to provide a consistent UX for all preview panes.
|
|
@@ -8,14 +9,18 @@ import * as i0 from "@angular/core";
|
|
|
8
9
|
* the rest of the preview pane area.
|
|
9
10
|
*/
|
|
10
11
|
export declare class SPMatEntityCrudPreviewPaneComponent<TEntity> implements OnInit, OnDestroy {
|
|
11
|
-
entity:
|
|
12
|
-
entityCrudComponent:
|
|
13
|
-
title:
|
|
14
|
-
disableUpdate:
|
|
15
|
-
hideUpdate:
|
|
16
|
-
disableDelete:
|
|
17
|
-
hideDelete:
|
|
12
|
+
entity: InputSignal<TEntity>;
|
|
13
|
+
entityCrudComponent: InputSignal<SPMatEntityCrudComponentBase<TEntity>>;
|
|
14
|
+
title: InputSignal<string | undefined>;
|
|
15
|
+
disableUpdate: InputSignal<boolean>;
|
|
16
|
+
hideUpdate: InputSignal<boolean>;
|
|
17
|
+
disableDelete: InputSignal<boolean>;
|
|
18
|
+
hideDelete: InputSignal<boolean>;
|
|
18
19
|
config: SPMatEntityCrudConfig;
|
|
20
|
+
itemActions: SPContextMenuItem[];
|
|
21
|
+
_disableActionFactory: (role: string, signal?: InputSignal<boolean>) => import("@angular/core").Signal<boolean>;
|
|
22
|
+
_disableUpdate: import("@angular/core").Signal<boolean>;
|
|
23
|
+
_disableDelete: import("@angular/core").Signal<boolean>;
|
|
19
24
|
constructor();
|
|
20
25
|
ngOnInit(): void;
|
|
21
26
|
ngOnDestroy(): void;
|