@smallpearl/ngx-helper 21.0.1 → 21.0.3
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.
|
@@ -5,7 +5,7 @@ import { createStore, withProps, select, setProps } from '@ngneat/elf';
|
|
|
5
5
|
import { withEntities, getAllEntities, getEntitiesCount, upsertEntities, getEntity } from '@ngneat/elf-entities';
|
|
6
6
|
import { withPagination, getPaginationData, skipWhilePageExists, updatePaginationData, setPage } from '@ngneat/elf-pagination';
|
|
7
7
|
import { SP_MAT_ENTITY_LIST_CONFIG } from '@smallpearl/ngx-helper/mat-entity-list';
|
|
8
|
-
import { capitalize } from 'lodash';
|
|
8
|
+
import { capitalize } from 'lodash-es';
|
|
9
9
|
import { plural } from 'pluralize';
|
|
10
10
|
import { Subject, filter, distinctUntilChanged, switchMap, of, tap, finalize } from 'rxjs';
|
|
11
11
|
|
|
@@ -44,7 +44,7 @@ class LoadRequest {
|
|
|
44
44
|
const DEFAULT_STATE_PROPS = {
|
|
45
45
|
allEntitiesLoaded: false,
|
|
46
46
|
loading: false,
|
|
47
|
-
loaded: false
|
|
47
|
+
loaded: false,
|
|
48
48
|
};
|
|
49
49
|
// Default paginator implementation. This can handle dynamic-rest and DRF
|
|
50
50
|
// native pagination schemes. It also has a fallback to handle response conists
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smallpearl-ngx-helper-entities.mjs","sources":["../../../../projects/smallpearl/ngx-helper/entities/src/paged-loader.ts","../../../../projects/smallpearl/ngx-helper/entities/smallpearl-ngx-helper-entities.ts"],"sourcesContent":["import {\n HttpClient,\n HttpContext,\n HttpContextToken,\n HttpParams,\n} from '@angular/common/http';\nimport { computed, Directive, inject, input } from '@angular/core';\nimport { createStore, select, setProps, withProps } from '@ngneat/elf';\nimport { getAllEntities, getEntitiesCount, getEntity, upsertEntities, withEntities } from '@ngneat/elf-entities';\nimport { getPaginationData, setPage, skipWhilePageExists, updatePaginationData, withPagination } from '@ngneat/elf-pagination';\nimport { SP_MAT_ENTITY_LIST_CONFIG, SPMatEntityListPaginator, SPPageParams } from '@smallpearl/ngx-helper/mat-entity-list';\nimport { capitalize } from 'lodash';\nimport { plural } from 'pluralize';\nimport {\n distinctUntilChanged,\n filter,\n finalize,\n Observable,\n of,\n Subject,\n Subscription,\n switchMap,\n tap\n} from 'rxjs';\n\n/**\n * A type representing an entity loader function that takes page number,\n * page size, and an optional search value and returns an Observable of\n * the response. This is similar the http.get() method of HttpClient but\n * with pagination parameters. The return value is deliberately kept generic\n * (Observable<any>) to allow flexibility in the response type. This reponse\n * will be parsed by the provided paginator's parseRequestResponse() method.\n * So as long as the function return type and paginator are compatible,\n * any response type can be handled.\n *\n * Ideally the response should contain the total number of entities available\n * at the remote and the array of entities for the requested page.\n */\nexport type SPEntityLoaderFn = (\n page: number,\n pageSize: number,\n searchValue: string | undefined\n) => Observable<any>;\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 | SPEntityLoaderFn,\n public pageNumber: number,\n public searchStr: string | undefined,\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 : (typeof this.endpoint === 'function' ||\n this.endpoint.localeCompare(prev.endpoint as string) === 0) &&\n this.pageNumber === prev.pageNumber &&\n this.searchStr === prev.searchStr;\n }\n}\n\ntype StateProps = {\n allEntitiesLoaded: boolean;\n loading: boolean;\n loaded: boolean\n};\n\nconst DEFAULT_STATE_PROPS: StateProps = {\n allEntitiesLoaded: false,\n loading: false,\n loaded: false\n}\n\n// Default paginator implementation. This can handle dynamic-rest and DRF\n// native pagination schemes. It also has a fallback to handle response conists\n// of an array of entities.\nclass DefaultPaginator implements SPMatEntityListPaginator {\n getRequestPageParams(\n endpoint: string,\n page: number,\n pageSize: number\n ): SPPageParams {\n return {\n page: page + 1,\n pageSize,\n };\n }\n\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 ) {\n if (Array.isArray(resp)) {\n return {\n total: resp.length,\n entities: resp,\n };\n }\n\n if (typeof resp === 'object') {\n const keys = Object.keys(resp);\n // Handle dynamic-rest sideloaded response\n // Rudimentary sideloaded response support. This should work for most\n // of the sideloaded responses where the main entities are stored\n // under the plural entity name key and resp['meta'] object contains\n // the total count.\n if (\n keys.includes(entityNamePlural) &&\n Array.isArray(resp[entityNamePlural])\n ) {\n let total = resp[entityNamePlural].length;\n if (\n keys.includes('meta') &&\n typeof resp['meta'] === 'object' &&\n typeof resp['meta']['total'] === 'number'\n ) {\n total = resp['meta']['total'];\n }\n return {\n total,\n entities: resp[entityNamePlural],\n };\n }\n\n // Handle django-rest-framework style response\n if (keys.includes('results') && Array.isArray(resp['results'])) {\n let total = resp['results'].length;\n if (keys.includes('count') && typeof resp['count'] === 'number') {\n total = resp['count'];\n }\n return {\n total,\n entities: resp['results'],\n };\n }\n\n // Finally, look for \"items\" key\n if (keys.includes('items') && Array.isArray(resp['items'])) {\n return {\n total: resp['items'].length,\n entities: resp['items'],\n };\n }\n }\n\n return {\n total: 0,\n entities: [],\n };\n }\n}\n\n/**\n * An abstract class that you can use wherever you would like to load entities\n * from a remote endpoint in a paged manner. Entities can be loaded in one of\n * two ways:\n *\n * 1. By providing an entityLoaderFn that takes an endpoint and HttpParams\n * and returns a Observable of entities.\n * 2. Or by providing a URL and using the default loader that uses HttpClient\n * to load entities.\n * This class uses RxJS to manage the loading of entities and provides\n * signals to track the loading state, entity count, page index, page size,\n * and whether more entities are available to load.\n *\n * How to use this class:\n *\n * 1. Dervice your component from SPPagedEntityLoader.\n * 2. After your component is initialized, call the startLoader() method to\n * get the component going. This sets up the necessary subscriptions to\n * listen for load requests. Load requests are triggered by calling the\n * loadPage() or loadNextPage() methods.\n * 3. If your component supports infinite scrolling, call loadMoreEntities()\n * method to load the next page of entities when it detects a scroll event.\n * 4. If you component needs to load a specific page (via a pagination control),\n * call the loadPage(pageNumber) method to load the specified page.\n * 5. Entities are stored in an internal entities store which is an @ngneat/elf\n * store. You can subscribe to the store's query to get the list of entities.\n * 6. When your component is destroyed, call the stopLoader() method to clean up\n * internal subscriptions.\n *\n * The class is decorated with Angular's @Directive decorator so that we can\n * use signals for the input properties and dependency injection for HttpClient.\n * There are no abstract methods as such, but the class is meant to be extended\n * by your component to provide the necessary configuration via input properties.\n * This is why it is declared as abstract.\n */\n@Directive({\n selector: '**spPagedEntityLoader**',\n})\nexport abstract class SPPagedEntityLoader<\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n> {\n // We cache the entities that we fetch from remote here. Cache is indexed\n // by the endpoint. Each endpoint also keeps a refCount, which is incremented\n // for each instance of the component using the same endpoint. When this\n // refcount reaches 0, the endpoint is removed from the cache.\n //\n // This mechanism is to suppress multiple fetches from the remote from the\n // same endpoint as that can occur if a form has multiple instances of\n // this component with the same url.\n static _entitiesCache = new Map<string, { refCount: number; resp: any }>();\n // cache keys for this instance\n cacheKeys = new Set<string>();\n\n // Current search parameter value. This is used to load entities\n // matching the search string.\n searchParamValue: string | undefined;\n\n //** REQUIRED ATTRIBUTES **//\n /**\n * Entity name, that is used to form the \"New { item }\" menu item if\n * inlineNew=true. This is also used as the key of the object in GET response\n * if the reponse JSON is an object (sideloaded response), where the values\n * are stored indexed by the server model name. For eg:-\n *\n * {\n * 'customers': [\n * {...},\n * {...},\n * {...},\n * ]\n * }\n */\n entityName = input.required<string>();\n url = input.required<string | SPEntityLoaderFn>();\n\n //** OPTIONAL ATTRIBUTES **//\n // Number of entities to be loaded per page from the server. This will be\n // passed to PagedEntityLoader to load entities in pages. Defaults to 50.\n // Adjust this accordingly based on the average size of your entities to\n // optimize server round-trips and memory usage.\n pageSize = input<number>(50);\n\n // Paginator for the remote entity list. This is used to determine the\n // pagination parameters for the API request. If not specified, the global\n // paginator specified in SPMatEntityListConfig will be used. If that too is\n // not specified, a default paginator will be used. Default paginator can\n // handle DRF native PageNumberPagination and dynamic-rest style pagination.\n paginator = input<SPMatEntityListPaginator>();\n\n // Search parameter name to be used in the HTTP request.\n // Defaults to 'search'. That is when a search string is specified and\n // the entire entity list has not been fetched, a fresh HTTP request is made\n // to the remote server with `?<searchParamName>=<search string>` parameter.\n searchParamName = input<string>('search');\n\n // Entity idKey, if idKey is different from the default 'id'.\n idKey = input<string>('id');\n\n // Plural entity name, used when grouping options. If not specified, it is\n // derived by pluralizing the entityName.\n pluralEntityName = input<string | undefined>(undefined); // defaults to pluralized entityName\n\n httpReqContext = input<\n [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any] | HttpContext | undefined\n >(undefined); // defaults to empty context\n\n // Parameters to be added to the HTTP request to retrieve data from\n // remote. This won't be used if `loadFromRemoteFn` is specified.\n httpParams = input<HttpParams | undefined>(undefined); // defaults to empty params\n\n // Mechanism to default pageSize to last entities length.\n protected loadRequest$ = new Subject<LoadRequest>();\n protected sub$: Subscription | undefined;\n protected _pageSize = computed<number>(() =>\n this.pageSize() ? this.pageSize() : 50\n );\n\n protected _pluralEntityName = computed<string>(() => {\n const pluralEntityName = this.pluralEntityName();\n return pluralEntityName ? pluralEntityName : plural(this.entityName());\n });\n\n protected _capitalizedEntityName = computed<string>(() =>\n capitalize(this.entityName())\n );\n\n protected _httpReqContext = computed(() => {\n let reqContext = this.httpReqContext();\n const context = new HttpContext();\n if (reqContext instanceof HttpContext) {\n // Copy existing context values\n for (const key of reqContext.keys()) {\n context.set(key, reqContext.get(key));\n }\n } else {\n // Likely to be array of `(HttpContextToken, value)` pairs.\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 }\n\n // Give subclasses a chance to add their own context tokens.\n this.addAddlContextTokens(context);\n\n return context;\n });\n\n entityListConfig = inject(SP_MAT_ENTITY_LIST_CONFIG, {\n optional: true,\n });\n protected _paginator = computed<SPMatEntityListPaginator>(() => {\n const paginator = this.paginator();\n const entityListConfigPaginator = this.entityListConfig\n ? (this.entityListConfig.paginator as SPMatEntityListPaginator)\n : undefined;\n return paginator\n ? paginator\n : entityListConfigPaginator\n ? entityListConfigPaginator\n : new DefaultPaginator();\n });\n\n // We create it here so that store member variable will have the correct\n // type. Unfortunately elf doesn't have a simple generic type that we can\n // use to declare the type of the store and then initialize it later.\n // We will recreate it in the constructor to have the correct idKey.\n protected store = createStore(\n { name: Math.random().toString(36).slice(2) },\n withEntities<TEntity, IdKey>({ idKey: 'id' as IdKey }),\n withProps<StateProps>(DEFAULT_STATE_PROPS),\n withPagination({\n initialPage: 0,\n })\n );\n\n protected http = inject(HttpClient);\n\n constructor() {}\n\n /**\n * Starts listening for load requests and processes them. Call this from your\n * component's ngOnInit() or ngAfterViewInit() method.\n */\n startLoader() {\n // Recreate store with the correct idKey. We have to do this after\n // the idKey is available from the constructor argument.\n const entities = this.store.query(getAllEntities());\n this.store = createStore(\n { name: Math.random().toString(36).slice(2) },\n withEntities<TEntity, IdKey>({\n initialValue: entities,\n idKey: this.idKey() as IdKey,\n }),\n withProps<StateProps>(DEFAULT_STATE_PROPS),\n withPagination({\n initialPage: 0,\n })\n );\n\n this.sub$ = this.loadRequest$\n .pipe(\n filter((lr) => lr.endpoint !== '' || lr.force === true),\n distinctUntilChanged((prev, current) =>\n current.isEqualToAndNotForced(prev)\n ),\n switchMap((lr: LoadRequest) => this.doActualLoad(lr))\n )\n .subscribe();\n }\n\n /**\n * Stops listening for load requests and cleans up subscriptions.\n */\n stopLoader() {\n if (this.sub$) {\n this.sub$.unsubscribe();\n this.sub$ = undefined;\n }\n // Remove references to this component's pages from the cache. If this\n // is the only component using those cached pages, they will be cleared\n // from the cache.\n this.removeFromCache();\n }\n\n hasStarted(): boolean {\n return this.sub$ !== undefined;\n }\n\n /**\n * Returns a boolean indicating whether all entities at the remote have been\n * loaded. All entities are considered loaded when there are no more entities\n * to load from the remote (that is all pages have been loaded without\n * a search filter).\n * @returns\n */\n allEntitiesLoaded(): boolean {\n return this.store.query((state) => state.allEntitiesLoaded);\n }\n\n /**\n * Returns the total number of entities at the remote as reported by the\n * server (or load fn) during each load.\n * @returns\n */\n totalEntitiesAtRemote(): number {\n return this.store.query(getPaginationData()).total;\n }\n\n /**\n * Returns number of entities currently stored in the internal store.\n * @returns\n */\n totalEntitiesCount(): number {\n return this.store.query(getEntitiesCount());\n }\n\n /**\n * Returns true if there are more entities to load from the remote.\n * This is computed based on the total entities count and the number of\n * entities loaded so far. For this method to work correctly, an initial\n * load must have been performed to get the total count from the remote.\n * @returns\n */\n hasMore(): boolean {\n const paginationData = this.store.query(getPaginationData());\n return (\n Object.keys(paginationData.pages).length * paginationData.perPage <\n paginationData.total\n );\n // return this.store.query((state) => state.hasMore);\n }\n\n /**\n * Returns true if a load operation is in progress. The load async operation\n * method turns the loading state to true when a load operation starts and\n * turns it to false when the operation completes.\n * @returns\n */\n loading(): boolean {\n return this.store.query((state) => state.loading);\n }\n\n /**\n * Returns the loading state as an Observable that emits when the state changes.\n * @returns\n */\n get loading$() {\n return this.store.pipe(\n select((state) => state.loading),\n distinctUntilChanged()\n );\n }\n\n /**\n * Boolean indicates whether the loader has completed at least one load\n * operation.\n */\n loaded(): boolean {\n return this.store.query((state) => state.loaded);\n }\n\n /**\n * Returns the endpoint URL if the loader was created with an endpoint.\n * If the loader was created with a loader function, an empty string is\n * returned.\n * @returns\n */\n endpoint(): string {\n return this.url() instanceof Function ? '' : (this.url() as string);\n }\n\n /**\n * Loads the specified page number of entities from the remote.\n * @param pageNumber\n */\n loadPage(pageNumber: number) {\n this.loadRequest$.next(\n new LoadRequest(this.url(), pageNumber, this.searchParamValue, false)\n );\n }\n\n /**\n * Returns the total number of pages available at the remote.\n * @returns\n */\n totalPages(): number {\n const paginationData = this.store.query(getPaginationData());\n return Math.ceil(paginationData.total / paginationData.perPage);\n }\n\n /**\n * Loads the next page of entities from the remote.\n *\n * @param searchParamValue Optional search parameter value. If specified\n * and is different from the current search parameter value, the internal\n * store is reset and entities are loaded from page 0 with the new search\n * parameter value. Otherwise, the next page of entities is loaded.\n */\n loadNextPage() {\n if (\n this.store.query(getPaginationData()).currentPage >= this.totalPages() &&\n this.loaded()\n ) {\n return;\n }\n\n const paginationData = this.store.query(getPaginationData());\n // console.log(`Loading page - forceRefresh: ${forceRefresh}, currentPage: ${paginationData.currentPage}...`);\n this.loadRequest$.next(\n new LoadRequest(\n this.url(),\n paginationData.currentPage,\n this.searchParamValue,\n false\n )\n );\n }\n\n // Sets the search parameter value to be used in subsequent loads.\n // If the search parameter value is different from the current value,\n // the internal store is reset to clear any previously loaded entities.\n setSearchParamValue(searchStr: string) {\n if (searchStr !== this.searchParamValue) {\n this.searchParamValue = searchStr;\n this.store.reset();\n }\n }\n\n setEntities(entities: TEntity[]) {\n this.store.update(upsertEntities(entities as any));\n }\n\n getEntities(): TEntity[] {\n return this.store.query(getAllEntities());\n }\n\n getEntity(id: TEntity[IdKey]): TEntity | undefined {\n return this.store.query(getEntity(id));\n }\n\n protected addAddlContextTokens(context: HttpContext): void {\n // Add any additional context tokens required for this request.\n // Note that context is a mutable object. Subclasses can override\n // this method to add their own context tokens.\n }\n\n // Does the actual loading of entities from the remote or the loader\n // function. Once loaded, the entities are stored in the internal store and\n // pagination properties are updated.\n protected doActualLoad(lr: LoadRequest) {\n const loaderFn =\n typeof this.url() === 'function'\n ? (this.url() as SPEntityLoaderFn)\n : undefined;\n let obs: Observable<any>;\n let paramsObj: any = {};\n const pageSize = this._pageSize();\n if (loaderFn) {\n obs = (loaderFn as SPEntityLoaderFn)(\n lr.pageNumber,\n pageSize,\n lr.searchStr\n );\n paramsObj = {\n page: lr.pageNumber,\n pageSize,\n };\n if (lr.searchStr) {\n paramsObj[this.searchParamName()] = lr.searchStr || '';\n }\n } else {\n // Form the HttpParams which consists of pagination params and any\n // embedded params in the URL which doesn't conflict with the page\n // params.\n const urlParts = (this.url() as string).split('?');\n const pageParams = this._paginator().getRequestPageParams(\n urlParts[0],\n lr.pageNumber,\n pageSize\n );\n if (lr.searchStr) {\n pageParams[this.searchParamName()] = lr.searchStr || '';\n }\n let httpParams = new HttpParams({ fromObject: pageParams });\n if (this.httpParams()) {\n this.httpParams()!\n .keys()\n .forEach((key) => {\n const value = this.httpParams()!.getAll(key);\n (value || []).forEach((v) => {\n httpParams = httpParams.append(key, v);\n });\n });\n }\n if (urlParts.length > 1) {\n const embeddedParams = new HttpParams({ fromString: urlParts[1] });\n embeddedParams.keys().forEach((key) => {\n const value = embeddedParams.getAll(key);\n (value || []).forEach((v) => {\n if (!httpParams.has(key)) {\n httpParams = httpParams.append(key, v);\n }\n });\n });\n }\n const cacheKey = this.getCacheKey(urlParts[0], httpParams);\n if (this.existsInCache(cacheKey)) {\n obs = of(this.getFromCache(cacheKey));\n } else {\n obs = this.http\n .get<any>(urlParts[0], {\n context: this._httpReqContext(),\n params: httpParams,\n })\n .pipe(tap((resp) => this.addToCache(cacheKey, resp)));\n }\n\n // Convert HttpParams to JS object\n httpParams.keys().forEach((key) => {\n paramsObj[key] = httpParams.get(key);\n });\n }\n\n this.store.update(\n setProps((state) => ({\n ...state,\n loading: true,\n }))\n );\n return obs.pipe(\n // skipWhilePageExistsInCacheOrCache(cacheKey, resp),\n skipWhilePageExists(this.store, lr.pageNumber),\n tap((resp) => {\n let hasMore = false;\n\n let entities: TEntity[] = [];\n let total = 0;\n\n if (Array.isArray(resp)) {\n // If the response is an array, we assume it's the array of entities.\n // Obviously, in this case, there's no pagination and therefore\n // set the total number of entities to the length of the array.\n total = resp.length;\n entities = resp;\n } else {\n const result = this._paginator().parseRequestResponse(\n this.entityName(),\n this._pluralEntityName()!,\n this.endpoint(),\n paramsObj,\n resp\n );\n total = result.total;\n entities = result.entities as unknown as TEntity[];\n }\n\n this.store.update(\n upsertEntities(entities as any),\n setProps((state) => ({\n ...state,\n totalCount: total,\n })),\n updatePaginationData({\n total: total,\n perPage: this.pageSize(),\n lastPage: lr.pageNumber,\n currentPage: lr.pageNumber + 1,\n }),\n setPage(\n lr.pageNumber,\n entities.map((e) => (e as any)[this.idKey()])\n )\n );\n }),\n finalize(() => {\n this.store.update(\n setProps((state) => ({\n ...state,\n allEntitiesLoaded: !this.hasMore() && !this.searchParamValue,\n loading: false,\n loaded: true,\n }))\n );\n })\n );\n }\n\n private existsInCache(cacheKey: string): boolean {\n return SPPagedEntityLoader._entitiesCache.has(cacheKey);\n }\n\n private getCacheKey(url: string, params?: HttpParams): string {\n if (params) {\n return `${url}?${params.toString()}`;\n }\n return url;\n }\n\n private getFromCache(cacheKey: string): any {\n if (cacheKey && SPPagedEntityLoader._entitiesCache.has(cacheKey)) {\n return SPPagedEntityLoader._entitiesCache.get(cacheKey)?.resp;\n }\n return [];\n }\n\n addToCache(cacheKey: string, resp: any) {\n if (!SPPagedEntityLoader._entitiesCache.has(cacheKey)) {\n SPPagedEntityLoader._entitiesCache.set(cacheKey, {\n refCount: 0,\n resp,\n });\n }\n const cacheEntry = SPPagedEntityLoader._entitiesCache.get(cacheKey);\n cacheEntry!.refCount += 1;\n this.cacheKeys.add(cacheKey);\n }\n\n private removeFromCache() {\n for (const cacheKey of this.cacheKeys) {\n const cacheEntry = SPPagedEntityLoader._entitiesCache.get(cacheKey);\n if (cacheEntry) {\n cacheEntry!.refCount -= 1;\n if (cacheEntry.refCount <= 0) {\n SPPagedEntityLoader._entitiesCache.delete(cacheKey);\n }\n }\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;A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.mjs","sources":["../../../../projects/smallpearl/ngx-helper/entities/src/paged-loader.ts","../../../../projects/smallpearl/ngx-helper/entities/smallpearl-ngx-helper-entities.ts"],"sourcesContent":["import {\n HttpClient,\n HttpContext,\n HttpContextToken,\n HttpParams,\n} from '@angular/common/http';\nimport { computed, Directive, inject, input } from '@angular/core';\nimport { createStore, select, setProps, withProps } from '@ngneat/elf';\nimport {\n getAllEntities,\n getEntitiesCount,\n getEntity,\n upsertEntities,\n withEntities,\n} from '@ngneat/elf-entities';\nimport {\n getPaginationData,\n setPage,\n skipWhilePageExists,\n updatePaginationData,\n withPagination,\n} from '@ngneat/elf-pagination';\nimport {\n SP_MAT_ENTITY_LIST_CONFIG,\n SPMatEntityListPaginator,\n SPPageParams,\n} from '@smallpearl/ngx-helper/mat-entity-list';\nimport { capitalize } from 'lodash-es';\nimport { plural } from 'pluralize';\nimport {\n distinctUntilChanged,\n filter,\n finalize,\n Observable,\n of,\n Subject,\n Subscription,\n switchMap,\n tap,\n} from 'rxjs';\n\n/**\n * A type representing an entity loader function that takes page number,\n * page size, and an optional search value and returns an Observable of\n * the response. This is similar the http.get() method of HttpClient but\n * with pagination parameters. The return value is deliberately kept generic\n * (Observable<any>) to allow flexibility in the response type. This reponse\n * will be parsed by the provided paginator's parseRequestResponse() method.\n * So as long as the function return type and paginator are compatible,\n * any response type can be handled.\n *\n * Ideally the response should contain the total number of entities available\n * at the remote and the array of entities for the requested page.\n */\nexport type SPEntityLoaderFn = (\n page: number,\n pageSize: number,\n searchValue: string | undefined,\n) => Observable<any>;\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 | SPEntityLoaderFn,\n public pageNumber: number,\n public searchStr: string | undefined,\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 : (typeof this.endpoint === 'function' ||\n this.endpoint.localeCompare(prev.endpoint as string) === 0) &&\n this.pageNumber === prev.pageNumber &&\n this.searchStr === prev.searchStr;\n }\n}\n\ntype StateProps = {\n allEntitiesLoaded: boolean;\n loading: boolean;\n loaded: boolean;\n};\n\nconst DEFAULT_STATE_PROPS: StateProps = {\n allEntitiesLoaded: false,\n loading: false,\n loaded: false,\n};\n\n// Default paginator implementation. This can handle dynamic-rest and DRF\n// native pagination schemes. It also has a fallback to handle response conists\n// of an array of entities.\nclass DefaultPaginator implements SPMatEntityListPaginator {\n getRequestPageParams(\n endpoint: string,\n page: number,\n pageSize: number,\n ): SPPageParams {\n return {\n page: page + 1,\n pageSize,\n };\n }\n\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 ) {\n if (Array.isArray(resp)) {\n return {\n total: resp.length,\n entities: resp,\n };\n }\n\n if (typeof resp === 'object') {\n const keys = Object.keys(resp);\n // Handle dynamic-rest sideloaded response\n // Rudimentary sideloaded response support. This should work for most\n // of the sideloaded responses where the main entities are stored\n // under the plural entity name key and resp['meta'] object contains\n // the total count.\n if (\n keys.includes(entityNamePlural) &&\n Array.isArray(resp[entityNamePlural])\n ) {\n let total = resp[entityNamePlural].length;\n if (\n keys.includes('meta') &&\n typeof resp['meta'] === 'object' &&\n typeof resp['meta']['total'] === 'number'\n ) {\n total = resp['meta']['total'];\n }\n return {\n total,\n entities: resp[entityNamePlural],\n };\n }\n\n // Handle django-rest-framework style response\n if (keys.includes('results') && Array.isArray(resp['results'])) {\n let total = resp['results'].length;\n if (keys.includes('count') && typeof resp['count'] === 'number') {\n total = resp['count'];\n }\n return {\n total,\n entities: resp['results'],\n };\n }\n\n // Finally, look for \"items\" key\n if (keys.includes('items') && Array.isArray(resp['items'])) {\n return {\n total: resp['items'].length,\n entities: resp['items'],\n };\n }\n }\n\n return {\n total: 0,\n entities: [],\n };\n }\n}\n\n/**\n * An abstract class that you can use wherever you would like to load entities\n * from a remote endpoint in a paged manner. Entities can be loaded in one of\n * two ways:\n *\n * 1. By providing an entityLoaderFn that takes an endpoint and HttpParams\n * and returns a Observable of entities.\n * 2. Or by providing a URL and using the default loader that uses HttpClient\n * to load entities.\n * This class uses RxJS to manage the loading of entities and provides\n * signals to track the loading state, entity count, page index, page size,\n * and whether more entities are available to load.\n *\n * How to use this class:\n *\n * 1. Dervice your component from SPPagedEntityLoader.\n * 2. After your component is initialized, call the startLoader() method to\n * get the component going. This sets up the necessary subscriptions to\n * listen for load requests. Load requests are triggered by calling the\n * loadPage() or loadNextPage() methods.\n * 3. If your component supports infinite scrolling, call loadMoreEntities()\n * method to load the next page of entities when it detects a scroll event.\n * 4. If you component needs to load a specific page (via a pagination control),\n * call the loadPage(pageNumber) method to load the specified page.\n * 5. Entities are stored in an internal entities store which is an @ngneat/elf\n * store. You can subscribe to the store's query to get the list of entities.\n * 6. When your component is destroyed, call the stopLoader() method to clean up\n * internal subscriptions.\n *\n * The class is decorated with Angular's @Directive decorator so that we can\n * use signals for the input properties and dependency injection for HttpClient.\n * There are no abstract methods as such, but the class is meant to be extended\n * by your component to provide the necessary configuration via input properties.\n * This is why it is declared as abstract.\n */\n@Directive({\n selector: '**spPagedEntityLoader**',\n})\nexport abstract class SPPagedEntityLoader<\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id',\n> {\n // We cache the entities that we fetch from remote here. Cache is indexed\n // by the endpoint. Each endpoint also keeps a refCount, which is incremented\n // for each instance of the component using the same endpoint. When this\n // refcount reaches 0, the endpoint is removed from the cache.\n //\n // This mechanism is to suppress multiple fetches from the remote from the\n // same endpoint as that can occur if a form has multiple instances of\n // this component with the same url.\n static _entitiesCache = new Map<string, { refCount: number; resp: any }>();\n // cache keys for this instance\n cacheKeys = new Set<string>();\n\n // Current search parameter value. This is used to load entities\n // matching the search string.\n searchParamValue: string | undefined;\n\n //** REQUIRED ATTRIBUTES **//\n /**\n * Entity name, that is used to form the \"New { item }\" menu item if\n * inlineNew=true. This is also used as the key of the object in GET response\n * if the reponse JSON is an object (sideloaded response), where the values\n * are stored indexed by the server model name. For eg:-\n *\n * {\n * 'customers': [\n * {...},\n * {...},\n * {...},\n * ]\n * }\n */\n entityName = input.required<string>();\n url = input.required<string | SPEntityLoaderFn>();\n\n //** OPTIONAL ATTRIBUTES **//\n // Number of entities to be loaded per page from the server. This will be\n // passed to PagedEntityLoader to load entities in pages. Defaults to 50.\n // Adjust this accordingly based on the average size of your entities to\n // optimize server round-trips and memory usage.\n pageSize = input<number>(50);\n\n // Paginator for the remote entity list. This is used to determine the\n // pagination parameters for the API request. If not specified, the global\n // paginator specified in SPMatEntityListConfig will be used. If that too is\n // not specified, a default paginator will be used. Default paginator can\n // handle DRF native PageNumberPagination and dynamic-rest style pagination.\n paginator = input<SPMatEntityListPaginator>();\n\n // Search parameter name to be used in the HTTP request.\n // Defaults to 'search'. That is when a search string is specified and\n // the entire entity list has not been fetched, a fresh HTTP request is made\n // to the remote server with `?<searchParamName>=<search string>` parameter.\n searchParamName = input<string>('search');\n\n // Entity idKey, if idKey is different from the default 'id'.\n idKey = input<string>('id');\n\n // Plural entity name, used when grouping options. If not specified, it is\n // derived by pluralizing the entityName.\n pluralEntityName = input<string | undefined>(undefined); // defaults to pluralized entityName\n\n httpReqContext = input<\n | [[HttpContextToken<any>, any]]\n | [HttpContextToken<any>, any]\n | HttpContext\n | undefined\n >(undefined); // defaults to empty context\n\n // Parameters to be added to the HTTP request to retrieve data from\n // remote. This won't be used if `loadFromRemoteFn` is specified.\n httpParams = input<HttpParams | undefined>(undefined); // defaults to empty params\n\n // Mechanism to default pageSize to last entities length.\n protected loadRequest$ = new Subject<LoadRequest>();\n protected sub$: Subscription | undefined;\n protected _pageSize = computed<number>(() =>\n this.pageSize() ? this.pageSize() : 50,\n );\n\n protected _pluralEntityName = computed<string>(() => {\n const pluralEntityName = this.pluralEntityName();\n return pluralEntityName ? pluralEntityName : plural(this.entityName());\n });\n\n protected _capitalizedEntityName = computed<string>(() =>\n capitalize(this.entityName()),\n );\n\n protected _httpReqContext = computed(() => {\n let reqContext = this.httpReqContext();\n const context = new HttpContext();\n if (reqContext instanceof HttpContext) {\n // Copy existing context values\n for (const key of reqContext.keys()) {\n context.set(key, reqContext.get(key));\n }\n } else {\n // Likely to be array of `(HttpContextToken, value)` pairs.\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 }\n\n // Give subclasses a chance to add their own context tokens.\n this.addAddlContextTokens(context);\n\n return context;\n });\n\n entityListConfig = inject(SP_MAT_ENTITY_LIST_CONFIG, {\n optional: true,\n });\n protected _paginator = computed<SPMatEntityListPaginator>(() => {\n const paginator = this.paginator();\n const entityListConfigPaginator = this.entityListConfig\n ? (this.entityListConfig.paginator as SPMatEntityListPaginator)\n : undefined;\n return paginator\n ? paginator\n : entityListConfigPaginator\n ? entityListConfigPaginator\n : new DefaultPaginator();\n });\n\n // We create it here so that store member variable will have the correct\n // type. Unfortunately elf doesn't have a simple generic type that we can\n // use to declare the type of the store and then initialize it later.\n // We will recreate it in the constructor to have the correct idKey.\n protected store = createStore(\n { name: Math.random().toString(36).slice(2) },\n withEntities<TEntity, IdKey>({ idKey: 'id' as IdKey }),\n withProps<StateProps>(DEFAULT_STATE_PROPS),\n withPagination({\n initialPage: 0,\n }),\n );\n\n protected http = inject(HttpClient);\n\n constructor() {}\n\n /**\n * Starts listening for load requests and processes them. Call this from your\n * component's ngOnInit() or ngAfterViewInit() method.\n */\n startLoader() {\n // Recreate store with the correct idKey. We have to do this after\n // the idKey is available from the constructor argument.\n const entities = this.store.query(getAllEntities());\n this.store = createStore(\n { name: Math.random().toString(36).slice(2) },\n withEntities<TEntity, IdKey>({\n initialValue: entities,\n idKey: this.idKey() as IdKey,\n }),\n withProps<StateProps>(DEFAULT_STATE_PROPS),\n withPagination({\n initialPage: 0,\n }),\n );\n\n this.sub$ = this.loadRequest$\n .pipe(\n filter((lr) => lr.endpoint !== '' || lr.force === true),\n distinctUntilChanged((prev, current) =>\n current.isEqualToAndNotForced(prev),\n ),\n switchMap((lr: LoadRequest) => this.doActualLoad(lr)),\n )\n .subscribe();\n }\n\n /**\n * Stops listening for load requests and cleans up subscriptions.\n */\n stopLoader() {\n if (this.sub$) {\n this.sub$.unsubscribe();\n this.sub$ = undefined;\n }\n // Remove references to this component's pages from the cache. If this\n // is the only component using those cached pages, they will be cleared\n // from the cache.\n this.removeFromCache();\n }\n\n hasStarted(): boolean {\n return this.sub$ !== undefined;\n }\n\n /**\n * Returns a boolean indicating whether all entities at the remote have been\n * loaded. All entities are considered loaded when there are no more entities\n * to load from the remote (that is all pages have been loaded without\n * a search filter).\n * @returns\n */\n allEntitiesLoaded(): boolean {\n return this.store.query((state) => state.allEntitiesLoaded);\n }\n\n /**\n * Returns the total number of entities at the remote as reported by the\n * server (or load fn) during each load.\n * @returns\n */\n totalEntitiesAtRemote(): number {\n return this.store.query(getPaginationData()).total;\n }\n\n /**\n * Returns number of entities currently stored in the internal store.\n * @returns\n */\n totalEntitiesCount(): number {\n return this.store.query(getEntitiesCount());\n }\n\n /**\n * Returns true if there are more entities to load from the remote.\n * This is computed based on the total entities count and the number of\n * entities loaded so far. For this method to work correctly, an initial\n * load must have been performed to get the total count from the remote.\n * @returns\n */\n hasMore(): boolean {\n const paginationData = this.store.query(getPaginationData());\n return (\n Object.keys(paginationData.pages).length * paginationData.perPage <\n paginationData.total\n );\n // return this.store.query((state) => state.hasMore);\n }\n\n /**\n * Returns true if a load operation is in progress. The load async operation\n * method turns the loading state to true when a load operation starts and\n * turns it to false when the operation completes.\n * @returns\n */\n loading(): boolean {\n return this.store.query((state) => state.loading);\n }\n\n /**\n * Returns the loading state as an Observable that emits when the state changes.\n * @returns\n */\n get loading$() {\n return this.store.pipe(\n select((state) => state.loading),\n distinctUntilChanged(),\n );\n }\n\n /**\n * Boolean indicates whether the loader has completed at least one load\n * operation.\n */\n loaded(): boolean {\n return this.store.query((state) => state.loaded);\n }\n\n /**\n * Returns the endpoint URL if the loader was created with an endpoint.\n * If the loader was created with a loader function, an empty string is\n * returned.\n * @returns\n */\n endpoint(): string {\n return this.url() instanceof Function ? '' : (this.url() as string);\n }\n\n /**\n * Loads the specified page number of entities from the remote.\n * @param pageNumber\n */\n loadPage(pageNumber: number) {\n this.loadRequest$.next(\n new LoadRequest(this.url(), pageNumber, this.searchParamValue, false),\n );\n }\n\n /**\n * Returns the total number of pages available at the remote.\n * @returns\n */\n totalPages(): number {\n const paginationData = this.store.query(getPaginationData());\n return Math.ceil(paginationData.total / paginationData.perPage);\n }\n\n /**\n * Loads the next page of entities from the remote.\n *\n * @param searchParamValue Optional search parameter value. If specified\n * and is different from the current search parameter value, the internal\n * store is reset and entities are loaded from page 0 with the new search\n * parameter value. Otherwise, the next page of entities is loaded.\n */\n loadNextPage() {\n if (\n this.store.query(getPaginationData()).currentPage >= this.totalPages() &&\n this.loaded()\n ) {\n return;\n }\n\n const paginationData = this.store.query(getPaginationData());\n // console.log(`Loading page - forceRefresh: ${forceRefresh}, currentPage: ${paginationData.currentPage}...`);\n this.loadRequest$.next(\n new LoadRequest(\n this.url(),\n paginationData.currentPage,\n this.searchParamValue,\n false,\n ),\n );\n }\n\n // Sets the search parameter value to be used in subsequent loads.\n // If the search parameter value is different from the current value,\n // the internal store is reset to clear any previously loaded entities.\n setSearchParamValue(searchStr: string) {\n if (searchStr !== this.searchParamValue) {\n this.searchParamValue = searchStr;\n this.store.reset();\n }\n }\n\n setEntities(entities: TEntity[]) {\n this.store.update(upsertEntities(entities as any));\n }\n\n getEntities(): TEntity[] {\n return this.store.query(getAllEntities());\n }\n\n getEntity(id: TEntity[IdKey]): TEntity | undefined {\n return this.store.query(getEntity(id));\n }\n\n protected addAddlContextTokens(context: HttpContext): void {\n // Add any additional context tokens required for this request.\n // Note that context is a mutable object. Subclasses can override\n // this method to add their own context tokens.\n }\n\n // Does the actual loading of entities from the remote or the loader\n // function. Once loaded, the entities are stored in the internal store and\n // pagination properties are updated.\n protected doActualLoad(lr: LoadRequest) {\n const loaderFn =\n typeof this.url() === 'function'\n ? (this.url() as SPEntityLoaderFn)\n : undefined;\n let obs: Observable<any>;\n let paramsObj: any = {};\n const pageSize = this._pageSize();\n if (loaderFn) {\n obs = (loaderFn as SPEntityLoaderFn)(\n lr.pageNumber,\n pageSize,\n lr.searchStr,\n );\n paramsObj = {\n page: lr.pageNumber,\n pageSize,\n };\n if (lr.searchStr) {\n paramsObj[this.searchParamName()] = lr.searchStr || '';\n }\n } else {\n // Form the HttpParams which consists of pagination params and any\n // embedded params in the URL which doesn't conflict with the page\n // params.\n const urlParts = (this.url() as string).split('?');\n const pageParams = this._paginator().getRequestPageParams(\n urlParts[0],\n lr.pageNumber,\n pageSize,\n );\n if (lr.searchStr) {\n pageParams[this.searchParamName()] = lr.searchStr || '';\n }\n let httpParams = new HttpParams({ fromObject: pageParams });\n if (this.httpParams()) {\n this.httpParams()!\n .keys()\n .forEach((key) => {\n const value = this.httpParams()!.getAll(key);\n (value || []).forEach((v) => {\n httpParams = httpParams.append(key, v);\n });\n });\n }\n if (urlParts.length > 1) {\n const embeddedParams = new HttpParams({ fromString: urlParts[1] });\n embeddedParams.keys().forEach((key) => {\n const value = embeddedParams.getAll(key);\n (value || []).forEach((v) => {\n if (!httpParams.has(key)) {\n httpParams = httpParams.append(key, v);\n }\n });\n });\n }\n const cacheKey = this.getCacheKey(urlParts[0], httpParams);\n if (this.existsInCache(cacheKey)) {\n obs = of(this.getFromCache(cacheKey));\n } else {\n obs = this.http\n .get<any>(urlParts[0], {\n context: this._httpReqContext(),\n params: httpParams,\n })\n .pipe(tap((resp) => this.addToCache(cacheKey, resp)));\n }\n\n // Convert HttpParams to JS object\n httpParams.keys().forEach((key) => {\n paramsObj[key] = httpParams.get(key);\n });\n }\n\n this.store.update(\n setProps((state) => ({\n ...state,\n loading: true,\n })),\n );\n return obs.pipe(\n // skipWhilePageExistsInCacheOrCache(cacheKey, resp),\n skipWhilePageExists(this.store, lr.pageNumber),\n tap((resp) => {\n let hasMore = false;\n\n let entities: TEntity[] = [];\n let total = 0;\n\n if (Array.isArray(resp)) {\n // If the response is an array, we assume it's the array of entities.\n // Obviously, in this case, there's no pagination and therefore\n // set the total number of entities to the length of the array.\n total = resp.length;\n entities = resp;\n } else {\n const result = this._paginator().parseRequestResponse(\n this.entityName(),\n this._pluralEntityName()!,\n this.endpoint(),\n paramsObj,\n resp,\n );\n total = result.total;\n entities = result.entities as unknown as TEntity[];\n }\n\n this.store.update(\n upsertEntities(entities as any),\n setProps((state) => ({\n ...state,\n totalCount: total,\n })),\n updatePaginationData({\n total: total,\n perPage: this.pageSize(),\n lastPage: lr.pageNumber,\n currentPage: lr.pageNumber + 1,\n }),\n setPage(\n lr.pageNumber,\n entities.map((e) => (e as any)[this.idKey()]),\n ),\n );\n }),\n finalize(() => {\n this.store.update(\n setProps((state) => ({\n ...state,\n allEntitiesLoaded: !this.hasMore() && !this.searchParamValue,\n loading: false,\n loaded: true,\n })),\n );\n }),\n );\n }\n\n private existsInCache(cacheKey: string): boolean {\n return SPPagedEntityLoader._entitiesCache.has(cacheKey);\n }\n\n private getCacheKey(url: string, params?: HttpParams): string {\n if (params) {\n return `${url}?${params.toString()}`;\n }\n return url;\n }\n\n private getFromCache(cacheKey: string): any {\n if (cacheKey && SPPagedEntityLoader._entitiesCache.has(cacheKey)) {\n return SPPagedEntityLoader._entitiesCache.get(cacheKey)?.resp;\n }\n return [];\n }\n\n addToCache(cacheKey: string, resp: any) {\n if (!SPPagedEntityLoader._entitiesCache.has(cacheKey)) {\n SPPagedEntityLoader._entitiesCache.set(cacheKey, {\n refCount: 0,\n resp,\n });\n }\n const cacheEntry = SPPagedEntityLoader._entitiesCache.get(cacheKey);\n cacheEntry!.refCount += 1;\n this.cacheKeys.add(cacheKey);\n }\n\n private removeFromCache() {\n for (const cacheKey of this.cacheKeys) {\n const cacheEntry = SPPagedEntityLoader._entitiesCache.get(cacheKey);\n if (cacheEntry) {\n cacheEntry!.refCount -= 1;\n if (cacheEntry.refCount <= 0) {\n SPPagedEntityLoader._entitiesCache.delete(cacheKey);\n }\n }\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AA4DA;;;;AAIG;AACH,MAAM,WAAW,CAAA;AAEN,IAAA,QAAA;AACA,IAAA,UAAA;AACA,IAAA,SAAA;AACA,IAAA,KAAA;AAJT,IAAA,WAAA,CACS,QAAmC,EACnC,UAAkB,EAClB,SAA6B,EAC7B,QAAQ,KAAK,EAAA;QAHb,IAAA,CAAA,QAAQ,GAAR,QAAQ;QACR,IAAA,CAAA,UAAU,GAAV,UAAU;QACV,IAAA,CAAA,SAAS,GAAT,SAAS;QACT,IAAA,CAAA,KAAK,GAAL,KAAK;IACX;;;AAIH,IAAA,qBAAqB,CAAC,IAAiB,EAAA;;;;;;QAMrC,OAAO,IAAI,CAAC;AACV,cAAE;AACF,cAAE,CAAC,OAAO,IAAI,CAAC,QAAQ,KAAK,UAAU;gBAClC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,QAAkB,CAAC,KAAK,CAAC;AAC1D,gBAAA,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU;AACnC,gBAAA,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS;IACzC;AACD;AAQD,MAAM,mBAAmB,GAAe;AACtC,IAAA,iBAAiB,EAAE,KAAK;AACxB,IAAA,OAAO,EAAE,KAAK;AACd,IAAA,MAAM,EAAE,KAAK;CACd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UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,UAAA,EAAA,YAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAHxC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,yBAAyB;AACpC,iBAAA;;;AChOD;;AAEG;;;;"}
|
|
@@ -31,7 +31,7 @@ import { SPMatContextMenuComponent } from '@smallpearl/ngx-helper/mat-context-me
|
|
|
31
31
|
import { SPMatEntityListComponent } from '@smallpearl/ngx-helper/mat-entity-list';
|
|
32
32
|
import * as i11 from 'angular-split';
|
|
33
33
|
import { AngularSplitModule } from 'angular-split';
|
|
34
|
-
import { startCase, clone } from 'lodash';
|
|
34
|
+
import { startCase, clone } from 'lodash-es';
|
|
35
35
|
import { plural } from 'pluralize';
|
|
36
36
|
|
|
37
37
|
const SP_MAT_ENTITY_CRUD_CONFIG = new InjectionToken('SPMatEntityCrudConfig');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smallpearl-ngx-helper-mat-entity-crud.mjs","sources":["../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/providers.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/convert-context-input-to-http-context.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/mat-entity-crud-types.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/mat-entity-crud-form-base.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/mat-entity-crud-internal-types.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/preview-pane.component.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/default-config.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/form-view-host.component.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/preview-host.component.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/mat-entity-crud.component.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/smallpearl-ngx-helper-mat-entity-crud.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { SPMatEntityCrudConfig } from './mat-entity-crud-types';\n\nexport const SP_MAT_ENTITY_CRUD_CONFIG = new InjectionToken<SPMatEntityCrudConfig>('SPMatEntityCrudConfig');\n","import { HttpContext, HttpContextToken } from '@angular/common/http';\n\nexport type HttpContextInput =\n | [[HttpContextToken<any>, any]]\n | [HttpContextToken<any>, any]\n | HttpContext;\n\n/**\n * Converts array of HttpContextToken key, value pairs to HttpContext\n * object in argument 'context'.\n * @param context HTTP context to which the key, value pairs are added\n * @param reqContext HttpContextToken key, value pairs array\n * @returns HttpContext object, with the key, value pairs added. This is\n * the same object as the 'context' argument.\n */\nexport function convertHttpContextInputToHttpContext(\n context: HttpContext,\n reqContext: HttpContextInput\n): HttpContext {\n if (reqContext instanceof HttpContext) {\n // reqContext is already an HttpContext object.\n for (const k of reqContext.keys()) {\n context.set(k, reqContext.get(k));\n }\n } else if (Array.isArray(reqContext) && 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 return context;\n}\n","import { HttpContextToken } from \"@angular/common/http\";\nimport { SPContextMenuItem } from \"@smallpearl/ngx-helper/mat-context-menu\";\nimport { Observable } from \"rxjs\";\n\n/**\n * Prototype of the function to parse the CRUD action response.\n */\nexport type SPMatEntityCrudResponseParser = (\n entityName: string,\n idKey: string,\n method: string, // 'create' | 'retrieve' | 'update' | 'delete',\n resp: any\n) => any|undefined;\n\n\n/**\n * Global config for SPMatEntityList component.\n */\nexport interface SPMatEntityCrudConfig {\n /**\n * The item actions that will be shown for each item in the list.\n * This defaults to 'Update' & 'Delete' actions, but can be customized\n * by this property. Note the item actions can be set for individual\n * <sp-mat-entity-crud> component through its itemActions property.\n */\n defaultItemActions?: SPContextMenuItem[];\n /**\n * Global crud response parser.\n */\n crudOpResponseParser?: SPMatEntityCrudResponseParser;\n}\n\n/**\n * This is the interface through which the client provided CRUD form component\n * interacts with the 'host' SPMatEntityCrudComponent. When the form wants to\n * submit an entity to the server (for create or update), it should call the\n * one of the create or update methods. The interface also provides other\n * methods for the form component to interact with SPMatEntityCrudComponent\n * such as refresh its entities list, close the form pane, etc.\n *\n * The interface name has a 'Bridge' as the interface acts as a bridge between\n * the client provided form handler component and the host\n * SPMatEntityCrudComponent.\n */\nexport interface SPMatEntityCrudCreateEditBridge {\n /**\n * Returns the entity name as provided to the host SPMatEntityCrudComponent.\n * @returns The entity name string.\n */\n getEntityName(): string;\n\n /**\n * Returns the entity id key as provided to the host SPMatEntityCrudComponent.\n * @returns The entity id key string.\n */\n getIdKey(): string;\n\n /**\n * Get Entity url\n * @param cancel\n * @returns\n */\n getEntityUrl(entityId: any): string;\n\n /**\n * Close the edit/update form pane. This WON'T call the 'cancelEditCallback'\n * even if one is registered.\n */\n close: (cancel: boolean) => void;\n /**\n * Client form view can register a callback that will be invoked by the\n * framework when user cancels the create/edit operation by clicking on the\n * close button on the top right.\n * @param callback\n * @returns None\n */\n registerCanCancelEditCallback: (callback: () => boolean) => void;\n // Parameters of type any are entity values are typically the output of\n // form.value and therefore their types would not necessarily match TEntity.\n // id can be typed as TEntity[Idkey], but TSC doesn't allow that yet.\n /**\n * Create a new instance of TEntity, by sending a POST request to remote.\n * @param entityValue This is the typically the output of Reactive form's\n * form.value. Since this value's shape may be different from TEntity and is\n * known only to client form, we use 'any'.\n * @returns None\n * @inner Implementation will show a busy wheel centered on the form\n * view while the async function to update the object remains active.\n */\n create: (entityValue: any) => Observable<any>;\n /**\n * Update the entity with id `id` with new values in entityValue.\n * @param id TEntity id\n * @param entityValue Entity values to be updated.\n * @returns None\n * @inner Implementation will show a busy wheel centered on the form\n * view while the async function to update the object remains active.\n */\n update: (id: any, entityValue: any) => Observable<any>;\n}\n\n/**\n * Prototype of the function that will be used instead of HttpClient for\n * CRUD operations.\n * @param op - the CRUD operation being requested\n * @param entityValue - The entity or entity value upon which the operation\n * is being requested. for 'create' & 'update' this will be the value\n * of the reactive form. This is typically form.value or the 2nd arg to create\n * & update methods of SPMatEntityCrudCreateEditBridge.\n */\nexport type CRUD_OP_FN<\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n> = (\n op: string,\n id: TEntity[IdKey] | undefined, // valid only for 'get', 'update' & 'delete'\n entityValue: any, // valid only for 'create' & 'update'\n entityCrudComponent: any,\n) => Observable<TEntity | null>;\n\n\nexport type ALLOW_ITEM_ACTION_FN<TEntity> = (entity: TEntity, action: string) => boolean;\n\n/**\n * This interface is used to define sub types for the \"New {{item}}\" button on\n * top of the CRUD UI. An array of these is provided as the value to the\n * component property 'newItemSubTypes'.\n */\nexport interface NewItemSubType {\n /**\n * A role string that will be passed as argument to the (action) event\n * handler. This string allows the event handler to distinguish the selected\n * sub-type.\n *\n * The special keyword '_new_' can be used to activate the\n * `createEditTemplate` template if one is provided. In this case the params\n * element value (see below) can be used in the template to distinguish\n * between different menu items.\n */\n role: string;\n /**\n * Label displayed in the menu representing this role.\n */\n label: string;\n /**\n * Arbitrary value that will be passed to the 'createEditTemplate' in the\n * $implicit template context as 'params'. You can access this in the\n * template like below (see `data.params`):-\n ```\n <ng-template #createEdit let-data>\n <app-create-edit-entity-demo\n [bridge]=\"data.bridge\"\n [entity]=\"data.entity\"\n [params]=\"data.params\"\n ></app-create-edit-entity-demo>\n </ng-template>\n ```\n\n If params is an object and it includes the key 'title', its value will be\n used as the title for the edit form.\n */\n params?: any;\n}\n\nexport type CrudOp = 'create'|'retrieve'|'update'|'delete'|undefined;\n\nexport interface SPMatEntityCrudHttpContext {\n entityName: string;\n entityNamePlural: string;\n endpoint: string;\n op: CrudOp;\n}\n\nexport const SP_MAT_ENTITY_CRUD_HTTP_CONTEXT =\n new HttpContextToken<SPMatEntityCrudHttpContext>(() => ({\n entityName: '',\n entityNamePlural: '',\n endpoint: '',\n op: undefined,\n }));\n","import { HttpClient, HttpContext, HttpParams } from '@angular/common/http';\nimport { ChangeDetectorRef, Component, computed, inject, input, OnDestroy, OnInit, signal } from '@angular/core';\nimport { AbstractControl, FormArray, FormGroup, UntypedFormGroup } from '@angular/forms';\nimport { TranslocoService } from '@jsverse/transloco';\nimport { setServerErrorsAsFormErrors } from '@smallpearl/ngx-helper/forms';\nimport { map, Observable, Subscription, tap } from 'rxjs';\n// import { getEntityCrudConfig } from './default-config';\nimport { sideloadToComposite } from '@smallpearl/ngx-helper/sideload';\nimport { convertHttpContextInputToHttpContext, HttpContextInput } from './convert-context-input-to-http-context';\nimport { SPMatEntityCrudCreateEditBridge } from './mat-entity-crud-types';\n\n/**\n * This is a convenience base class that clients can derive from to implement\n * their CRUD form component. Particularly this class registers the change\n * detection hook which will be called when the user attempts to close the\n * form's parent container pane via the Close button on the top right.\n *\n * This button behaves like a Cancel button in a desktop app and therefore if\n * the user has entered any data in the form's controls, (determined by\n * checking form.touched), then a 'Lose Changes' prompt is displayed allowing\n * the user to cancel the closure.\n *\n * The `@Component` decorator is fake to keep the VSCode angular linter quiet.\n *\n * This class can be used in two modes:\n *\n * I. SPMatEntityCrudComponent mode\n * This mode relies on a bridge interface that implements the\n * SPMatEntityCrudCreateEditBridge interface to perform the entity\n * load/create/update operations. This is the intended mode when the\n * component is used as a part of the SPMatEntityCrudComponent to\n * create/update an entity. This mode requires the following properties\n * to be set:\n * - entity: TEntity | TEntity[IdKey] | undefined (for create)\n * - bridge: SPMatEntityCrudCreateEditBridge\n *\n * II. Standalone mode\n * This mode does not rely on the bridge interface and the component\n * itself performs the entity load/create/update operations. However, if\n * the `bridge` input is set, then it will be used to close the create/edit\n * form pane when create/update is successful.\n *\n * This mode requires the following properties to be set:\n * - entity: TEntity | TEntity[IdKey] | undefined (for create)\n * - baseUrl: string - Base URL for CRUD operations. This URL does not\n * include the entity id. The entity id will be appended to this URL\n * for entity load and update operations. For create operation, this\n * URL is used as is.\n * - entityName: string - Name of the entity, used to parse sideloaded\n * entity responses.\n * - httpReqContext?: HttpContextInput - Optional HTTP context to be\n * passed to the HTTP requests. For instance, if your app has a HTTP\n * interceptor that adds authentication tokens to the requests based\n * on a HttpContextToken, then you can pass that token here.\n *\n * I. SPMatEntityCrudComponent mode:\n *\n * 1. Declare a FormGroup<> type as\n *\n * ```\n * type MyForm = FormGroup<{\n * name: FormControl<string>;\n * type: FormControl<string>;\n * notes: FormControl<string>;\n * }>;\n * ```\n *\n * 2. Derive your form's component class from this and implement the\n * createForm() method returing the FormGroup<> instance that matches\n * the FormGroup concrete type above.\n *\n * ```\n * class MyFormComponent extends SPMatEntityCrudFormBase<MyForm, MyEntity> {\n * constructor() {\n * super()\n * }\n * createForm() {\n * return new FormGroup([...])\n * }\n * }\n * ```\n *\n * 3. If your form's value requires manipulation before being sent to the\n * server, override `getFormValue()` method and do it there before returning\n * the modified values.\n *\n * 4. Wire up the form in the template as below\n *\n * ```html\n * @if (loadEntity$ | async) {\n * <form [formGroup]='form'.. (ngSubmit)=\"onSubmit()\">\n * <button type=\"submit\">Submit</button>\n * </form>\n * } @else {\n * <div>Loading...</div>\n * }\n * ```\n *\n * Here `loadEntity$` is an Observable<boolean> that upon emission of `true`\n * indicates that the entity has been loaded from server (in case of edit)\n * and the form is ready to be displayed. Note that if the full entity was\n * passed in the `entity` input property, then no server load is necessary\n * and the form will be created immediately.\n *\n * 5. In the parent component that hosts the SPMatEntityCrudComponent, set\n * the `entity` and `bridge` input properties of this component to\n * appropriate values. For instance, if your form component has the\n * selector `app-my-entity-form`, then the parent component's template\n * will have:\n *\n * ```html\n * <sp-mat-entity-crud\n * ...\n * createEditFormTemplate=\"entityFormTemplate\"\n * ></sp-mat-entity-crud>\n * <ng-template #entityFormTemplate let-data=\"data\">\n * <app-my-entity-form\n * [entity]=\"data.entity\"\n * [bridge]=\"data.bridge\"\n * ></app-my-entity-form>\n * </ng-template>\n * ```\n *\n * II. Standalone mode\n *\n * 1..4. Same as above, except set the required `bridge` input to `undefined`.\n * 5. Initialize the component's inputs `baseUrl` and `entityName` with the\n * appropriate values. If you would like to pass additional HTTP context to\n * the HTTP requests, then set the `httpReqContext` input as well.\n * If the entity uses an id key other than 'id', then set the `idKey` input\n * to the appropriate id key name.\n * 6. If you want to retrieve the created/updated entity after the create/update\n * operation, override the `onPostCreate()` and/or `onPostUpdate()` methods\n * respectively.\n */\n@Component({\n selector: '_#_sp-mat-entity-crud-form-base_#_',\n template: ``,\n standalone: false,\n})\nexport abstract class SPMatEntityCrudFormBase<\n TFormGroup extends AbstractControl,\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n> implements OnInit, OnDestroy\n{\n // bridge mode inputs\n entity = input<TEntity | TEntity[IdKey]>();\n bridge = input<SPMatEntityCrudCreateEditBridge | undefined>();\n params = input<any>();\n // END bridge mode inputs\n\n // standalone mode inputs\n // Entity name, which is used to parse sideloaded entity responses\n entityName = input<string>();\n // Base CRUD URL, which is the GET-list-of-entities/POST-to-create\n // URL. Update URL will be derived from this ias `baseUrl()/${TEntity[IdKey]}`\n baseUrl = input<string>();\n // Additional request context to be passed to the request\n httpReqContext = input<HttpContextInput | undefined>();\n // ID key, defaults to 'id'\n idKey = input<string>('id');\n // END standalone mode inputs\n\n // IMPLEMENTATION\n loadEntity$!: Observable<boolean>;\n // This will hold the raw response returned by load() method\n loadResponse = signal<any>(undefined);\n // This will hold the loaded entity after it's extracted from the\n // load response.\n _entity = signal<TEntity | undefined>(undefined);\n sub$ = new Subscription();\n\n // Store for internal form signal. form() is computed from this.\n _form = signal<TFormGroup | undefined>(undefined);\n // Force typecast to TFormGroup so that we can use it in the template\n // without having to use the non-nullable operator ! with every reference\n // of form(). In any case the form() signal is always set in ngOnInit()\n // method after the form is created. And if form() is not set, then there\n // will be errors while loading the form in the template.\n form = computed(() => this._form() as TFormGroup);\n\n transloco = inject(TranslocoService);\n cdr = inject(ChangeDetectorRef);\n http = inject(HttpClient);\n\n canCancelEdit = () => {\n return this._canCancelEdit();\n };\n\n _canCancelEdit() {\n const form = this._form();\n if (form && form.touched) {\n return window.confirm(\n this.transloco.translate('spMatEntityCrud.loseChangesConfirm')\n );\n }\n return true;\n }\n\n ngOnInit() {\n // Validate inputs. Either bridge or (baseUrl and entityName) must be\n // defined.\n if (!this.bridge() && (!this.getBaseUrl() || !this.getEntityName())) {\n throw new Error(\n 'SPMatEntityCrudFormBase: baseUrl and entityName inputs must be defined in standalone mode.'\n );\n }\n this.loadEntity$ = this.load(this.entity() as any)\n .pipe(\n map((entity) => {\n this._entity.set(entity);\n this._form.set(this.createForm(entity));\n const bridge = this.bridge();\n if (bridge && bridge.registerCanCancelEditCallback) {\n bridge.registerCanCancelEditCallback(this.canCancelEdit);\n }\n return true;\n })\n );\n }\n\n ngOnDestroy() {\n this.sub$.unsubscribe();\n }\n\n /**\n * Additional parameters for loading the entity, in case this.entity() value\n * is of type TEntity[IdKey].\n * @returns\n */\n getLoadEntityParams(): string | HttpParams {\n return '';\n }\n\n /**\n * Returns true if the entity needs to be loaded from server. The default\n * implementation returns true if the `entity` parameter is not an object,\n * indicating that it's of type 'TEntity[IdKey]' or is undefined. Derived\n * classes can override this method to provide custom logic.\n * @param entityOrId\n * @returns Whether the entity needs to be loaded from server.\n */\n loadEntityRequired(entityOrId: TEntity | TEntity[IdKey] | undefined) {\n return entityOrId && typeof entityOrId !== 'object';\n }\n\n /**\n * Return the TEntity object from the response returned by the\n * load() method. Typically entity load returns the actual\n * entity object itself. In some cases, where response is sideloaded, the\n * default implementation here uses the `sideloadToComposite()` utility to\n * extract the entity from the response after merging (inplace) the\n * sideloaded data into a composite.\n *\n * If you have a different response shape, or if your sideloaded object\n * response requires custom custom `sideloadDataMap`, override this method\n * and implement your custom logic to extract the TEntity object from the\n * response.\n * @param resp\n * @returns\n */\n getEntityFromLoadResponse(resp: any): TEntity | undefined {\n if (!resp || typeof resp !== 'object') {\n return undefined;\n }\n const entityName = this.getEntityName();\n if (resp.hasOwnProperty(this.getIdKey())) {\n return resp as TEntity;\n } else if (entityName && resp.hasOwnProperty(entityName)) {\n // const sideloadDataMap = this.sideloadDataMap();\n return sideloadToComposite(resp, entityName, this.getIdKey()) as TEntity;\n }\n return undefined;\n }\n\n /**\n * Create the TFormGroup FormGroup class that will be used for the reactive\n * form.\n * @param entity\n */\n abstract createForm(entity: TEntity | undefined): TFormGroup;\n\n /**\n * Override to customize the id key name if it's not 'id'\n * @returns The name of the unique identifier key that will be used to\n * extract the entity's id for UPDATE operation.\n */\n getIdKey() {\n const bridge = this.bridge();\n const idKey = this.idKey();\n return idKey ? idKey : bridge ? bridge.getIdKey() : 'id';\n }\n\n getBusyWheelName() {\n return '';\n }\n\n /**\n * Return the form's value to be sent to server as Create/Update CRUD\n * operation data.\n * @returns\n */\n getFormValue() {\n const form = this.form();\n return form ? form.value : undefined;\n }\n\n onSubmit() {\n const value = this.getFormValue();\n const obs = !this._entity()\n ? this.create(value)\n : this.update((this._entity() as any)[this.getIdKey()], value);\n this.sub$.add(\n obs\n ?.pipe(\n tap((entity) => {\n const bridge = this.bridge();\n if (bridge) {\n bridge.close(false);\n }\n this._entity()\n ? this.onPostUpdate(entity)\n : this.onPostCreate(entity);\n }),\n setServerErrorsAsFormErrors(\n this._form() as unknown as UntypedFormGroup,\n this.cdr\n )\n )\n .subscribe()\n );\n }\n\n /**\n * Reset the form to its initial state. This is a generic implementation\n * that recursively resets all FormGroup and FormArray controls.\n */\n onReset() {\n function resetForm(form: FormGroup) {\n form.reset();\n const controls = form.controls;\n for (const name in controls) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const control: AbstractControl = (controls as any)[name];\n if (control instanceof FormArray) {\n const formArray = control as FormArray;\n for (let i = 0; i < formArray.length; i++) {\n const formArrayElem = formArray.at(i) as FormGroup;\n resetForm(formArrayElem);\n }\n }\n }\n }\n resetForm(this.form() as unknown as FormGroup);\n }\n\n onPostCreate(entity: TEntity) {\n /* empty */\n }\n\n onPostUpdate(entity: TEntity) {\n /* empty */\n }\n\n /**\n * Loads the entity if `this.entity()` is of type TEntity[IdKey]. If `bridge`\n * input is defined, then it's `loadEntity()` method is used to load the\n * entity. Otherwise, then this method attempts to load the entity using\n * HTTP GET from the URL derived from `baseUrl` input.\n * @param entityOrId Can be full entity or just the entity id.\n * @returns\n */\n load(entityOrId: any): Observable<TEntity> {\n if (!entityOrId || !this.loadEntityRequired(entityOrId)) {\n return new Observable<TEntity>((subscriber) => {\n subscriber.next(entityOrId as TEntity);\n subscriber.complete();\n });\n }\n return this.loadEntity(\n typeof entityOrId === 'object' ? entityOrId[this.getIdKey()] : entityOrId\n );\n }\n\n /**\n * Loads the entity using HTTP GET from the URL derived from `baseUrl` input.\n */\n protected loadEntity(entityId: any): Observable<TEntity> {\n // Try to load using baseUrl.\n const url = this.getEntityUrl(entityId);\n const params = this.getLoadEntityParams();\n return this.http\n .get<TEntity>(this.getEntityUrl(entityId), {\n params:\n typeof params === 'string'\n ? new HttpParams({ fromString: params })\n : params,\n context: this.getRequestContext(),\n })\n .pipe(\n map((resp) => {\n this.loadResponse.set(resp);\n return this.getEntityFromLoadResponse(resp) as TEntity;\n })\n );\n }\n\n /**\n * Create a new entity using the bridge if defined, otherwise using HTTP\n * POST to the `baseUrl`.\n * @param values\n * @returns\n */\n protected create(values: any): Observable<TEntity> {\n const bridge = this.bridge();\n if (!this.getStandaloneMode()) {\n return bridge!.create(values);\n }\n return this.createEntity(values);\n }\n\n protected createEntity(values: any): Observable<TEntity> {\n return this.http\n .post<TEntity>(this.getBaseUrl()!, values, {\n context: this.getRequestContext(),\n })\n .pipe(map((resp) => this.getEntityFromLoadResponse(resp) as TEntity));\n }\n\n /**\n * Update an existing entity using the bridge if defined, otherwise using HTTP\n * PATCH to the URL derived from `baseUrl` and the entity id.\n * @param id\n * @param values\n * @returns\n */\n protected update(id: any, values: any): Observable<TEntity> {\n const bridge = this.bridge();\n if (!this.getStandaloneMode()) {\n return bridge!.update(id, values);\n }\n return this.updateEntity(id, values);\n }\n\n protected updateEntity(id: any, values: any): Observable<TEntity> {\n return this.http\n .patch<TEntity>(this.getEntityUrl(id), values, {\n context: this.getRequestContext(),\n })\n .pipe(map((resp) => this.getEntityFromLoadResponse(resp) as TEntity));\n }\n\n /**\n * Override to get the standalone mode indicator. Standalone mode is\n * when both `baseUrl` and `entityName` inputs are defined. This is indication\n * that the component should perform the CRUD operations itself instead\n * of relying on the `bridge` input.\n * @returns\n */\n protected getStandaloneMode(): boolean {\n return !this.bridge() && !!this.getBaseUrl() && !!this.getEntityName();\n }\n\n /**\n * Wrapper around entityName input to get the entity name. If `bridge` input\n * is defined, then its `getEntityName()` method is used. This allows\n * derived classes to override this method to provide custom logic to\n * determine the entity name.\n * @returns\n */\n protected getEntityName(): string | undefined {\n const entityName = this.entityName();\n if (entityName) {\n return entityName;\n }\n const bridge = this.bridge();\n return bridge ? bridge.getEntityName() : undefined;\n }\n\n /**\n * Returns the baseUrl. Derived classes can override this to provide custom\n * logic to determine the baseUrl.\n * @returns\n */\n protected getBaseUrl(): string | undefined {\n return this.baseUrl();\n }\n\n /**\n * Returns the entity URL for the given entity id. If `bridge` input is\n * defined, then its `getEntityUrl()` method is used. Otherwise, the URL is\n * derived from `baseUrl` input.\n * @param entityId\n * @returns\n */\n protected getEntityUrl(entityId: any): string {\n const bridge = this.bridge();\n if (!this.getStandaloneMode()) {\n return bridge!.getEntityUrl(entityId);\n }\n const baseUrl = this.getBaseUrl();\n if (baseUrl) {\n const urlParts = baseUrl.split('?');\n return `${urlParts[0]}${String(entityId)}/${\n urlParts[1] ? '?' + urlParts[1] : ''\n }`;\n }\n console.warn(\n 'SPMatEntityCrudFormBase.getEntityUrl: Cannot determine entity URL as neither baseUrl nor bridge inputs are provided.'\n );\n return '';\n }\n\n protected getRequestContext(): HttpContext {\n let context = new HttpContext();\n const httpReqContext = this.httpReqContext();\n if (httpReqContext) {\n context = convertHttpContextInputToHttpContext(context, httpReqContext);\n }\n return context;\n }\n}\n","import { HttpParams } from \"@angular/common/http\";\nimport { SPContextMenuItem } from \"@smallpearl/ngx-helper/mat-context-menu\";\nimport { Observable } from \"rxjs\";\n\nexport const ITEM_ACTION_UPDATE = '_update_';\nexport const ITEM_ACTION_DELETE = '_delete_';\n\n/**\n * SPMatEntityCrudCreateEditBridge implementer uses this interface to\n * communicate with the parent SPMatEntityCreateComponent. The bridge\n * component would use the hideCreateEdit() to close itself, when user cancels\n * the create/edit operation.\n */\nexport interface SPMatEntityCrudComponentBase<\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n> {\n /**\n * Wrappers around entityName & entityNamePlural properties.\n */\n getEntityName(): string;\n getEntityNamePlural(): string;\n /**\n * Wrapper around idKey property.\n */\n getIdKey(): string;\n /**\n * This method should return the entity URL for the given entity id.\n * The entity URL should include any additional query parameters that were\n * passed to the SPMatEntityCrudComponentBase component's `url` property.\n * @param id\n */\n getEntityUrl(id: TEntity[IdKey]|undefined): string;\n /**\n * FormViewHostComponent will call this to close the Create/Edit pane.\n * SPMatEntityCrudComponentBase implementor will destroy the client form\n * view and hide the Create/Edit form view pane and show the hidden\n * entity list view.\n * @returns\n */\n closeCreateEdit: (cancelled: boolean) => void;\n /**\n * Used internally by FormViewHostComponent to determine if the client form\n * view wants to intercept user's cancel the create/edit operation. Perhaps\n * with the Yes/No prompt 'Lose changes?'\n * @returns boolean indicating it's okay to cancel the create/edit operation.\n */\n canCancelEdit: () => boolean;\n /**\n * Client form view can register a callback that will be invoked by the\n * framework when user cancels the create/edit operation by clicking on the\n * close button on the top right.\n * @param callback\n * @returns\n */\n registerCanCancelEditCallback: (callback: () => boolean) => void;\n /**\n * Initiates update on the given entity.\n * @returns\n */\n triggerEntityUpdate: (entity: TEntity) => void;\n /**\n * Initiates entity delete.\n * @returns\n */\n triggerEntityDelete: (entity: TEntity) => void;\n /**\n * Called by client form-view host component to close a new entity.\n * @param entityValue The ReactiveForm.value object that the server expects\n * to create a new object.\n * @returns The new Entity object returned by the server. For typical REST\n * API, this would be of the same shape as the objects returned by the\n * REST's GET request.\n */\n create: (entityValue: any) => Observable<any>;\n /**\n * Called by client form-view host component to close a new entity.\n * @param id The id of the entity being edited.\n * @param entityValue The ReactiveForm.value object that the server expects\n * to update the new object.\n * @returns The new Entity object returned by the server. For typical REST\n * API, this would be of the same shape as the objects returned by the\n * REST's GET request.\n */\n update: (id: any, entityValue: any) => Observable<any>;\n /**\n * Close the preview pane.\n * @returns\n */\n closePreview: () => void;\n /**\n * Returns the context menu items for the entity. This can be used to build\n * the context menu for an entity in its preview pane toolbar.\n * @returns\n */\n getItemActions(entity?: TEntity): SPContextMenuItem[];\n /**\n * Returns the class to be used for the preview pane content. This interface\n * is provided to allow the PreviewPaneComponent to access the client\n * configured class for the preview pane content.\n */\n getPreviewPaneContentClass(): string;\n\n getFormPaneWrapperClass(): string;\n\n getFormPaneContentClass(): string;\n\n getItemLabel(): string | Observable<string>;\n\n getItemLabelPlural(): string | Observable<string>;\n /*\n * Remove the entity with the given id from the list of entities.\n * This is typically called by the client when it peforms the delete\n * operation itself without using the MatEntityCrud's delete operation.\n *\n * @param id The id of the entity to remove.\n * @returns None\n **/\n removeEntity(id: TEntity[IdKey]): void;\n /**\n * Update the entity with the given id in the list of entities.\n * This is typically called by the client when it has performed an update\n * on the entity itself and want to reflect the resulting changed\n * entity in the list view.\n *\n * @param id The id of the entity to update.\n * @param data The updated entity.\n */\n updateEntity(id: TEntity[IdKey], data: TEntity): void;\n /**\n * Perform a custom action on the entity endpoint. The action is specified\n * by the verb argument, which will be used to derive the final URL. This\n * is keeping in line with DRF specification where viewsets can define\n * custom action methods, which translate into endpoints with the same name\n * ast he action method.\n * @param id id of the entity to perform the action on.\n * @param verb The action verb, which will be appended to the entity URL to\n * derive the final URL for the POST request.\n * @param addlParams additional query parameters to include in the request.\n * Called `additional` as these are in addition to the query params specified\n * in the CRUD's endpoint.\n * @param data the data to send with the request for the POST\n * @returns Observable<TEntity>\n */\n doEntityAction(\n id: TEntity[IdKey],\n verb: string,\n addlParams: HttpParams,\n data: any,\n busyWheelName: string\n ): Observable<any>;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n InputSignal,\n OnDestroy,\n OnInit,\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatToolbarModule } from '@angular/material/toolbar';\nimport { SPContextMenuItem } from '@smallpearl/ngx-helper/mat-context-menu';\nimport {\n ITEM_ACTION_DELETE,\n ITEM_ACTION_UPDATE,\n SPMatEntityCrudComponentBase,\n} from './mat-entity-crud-internal-types';\n\n/**\n * A preview pane container to provide a consistent UX for all preview panes.\n * It consits of a toolbar on the top and a container div below that takes up\n * the rest of the preview pane area.\n */\n@Component({\n imports: [MatToolbarModule, MatButtonModule, MatIconModule],\n selector: 'sp-mat-entity-crud-preview-pane',\n template: `\n <div class=\"preview-wrapper\">\n <mat-toolbar>\n <mat-toolbar-row>\n @if (title()) {\n <h2>{{ title() }}</h2>\n } @if (!hideUpdate()) {\n <button\n mat-icon-button\n aria-label=\"Edit\"\n (click)=\"onEdit()\"\n [disabled]=\"_disableUpdate()\"\n >\n <mat-icon>edit</mat-icon>\n </button>\n } @if (!hideDelete()) {\n <button\n mat-icon-button\n aria-label=\"Delete\"\n (click)=\"onDelete()\"\n [disabled]=\"_disableDelete()\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n }\n <ng-content select=\"[previewToolbarContent]\"></ng-content>\n <span class=\"spacer\"></span>\n <button mat-icon-button aria-label=\"Close\" (click)=\"onClose()\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-toolbar-row>\n </mat-toolbar>\n <div\n [class]=\"\n 'preview-content ' +\n entityCrudComponent().getPreviewPaneContentClass()\n \"\n >\n <ng-content select=\"[previewContent]\"></ng-content>\n </div>\n </div>\n `,\n styles: [\n `\n .preview-wrapper {\n display: flex;\n flex-direction: column;\n height: 100% !important;\n width: 100% !important;\n }\n mat-toolbar {\n background-color: var(--mat-sys-surface-variant);\n }\n .spacer {\n flex: 1 1 auto;\n }\n .preview-content {\n padding: 0.4em;\n flex-grow: 1;\n overflow: scroll;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SPMatEntityCrudPreviewPaneComponent<TEntity extends { [P in IdKey]: PropertyKey }, IdKey extends string = 'id'>\n implements OnInit, OnDestroy\n{\n entity = input.required<TEntity>();\n entityCrudComponent = input.required<SPMatEntityCrudComponentBase<TEntity, IdKey>>();\n title = input<string>();\n disableUpdate = input<boolean>(false);\n hideUpdate = input<boolean>(false);\n disableDelete = input<boolean>(false);\n hideDelete = input<boolean>(false);\n itemActions!: SPContextMenuItem[];\n\n _disableActionFactory = (role: string, signal?: InputSignal<boolean>) => {\n return computed(() => {\n if (signal && signal()) {\n return true;\n }\n const actionFn = this.itemActions.find((a) => a.role === role)?.disable;\n if (actionFn && actionFn(this.entity())) {\n return true;\n }\n return false;\n });\n };\n _disableUpdate = this._disableActionFactory(\n ITEM_ACTION_UPDATE,\n this.disableUpdate\n );\n _disableDelete = this._disableActionFactory(\n ITEM_ACTION_DELETE,\n this.disableDelete\n );\n\n ngOnInit() {\n this.itemActions = this.entityCrudComponent().getItemActions();\n }\n\n ngOnDestroy(): void {}\n\n onEdit() {\n this.entityCrudComponent().triggerEntityUpdate(this.entity());\n }\n\n onDelete() {\n this.entityCrudComponent().triggerEntityDelete(this.entity());\n }\n\n onClose() {\n this.entityCrudComponent().closePreview();\n }\n}\n","import { inject } from \"@angular/core\";\nimport { SPMatEntityCrudConfig } from \"./mat-entity-crud-types\";\nimport { SP_MAT_ENTITY_CRUD_CONFIG } from \"./providers\";\n\nfunction defaultCrudResponseParser(\n entityName: string,\n idKey: string,\n method: string, // 'create' | 'retrieve' | 'update' | 'delete',\n resp: any\n) {\n // If the response is an object with a property '<idKey>', return it as\n // TEntity.\n if (resp.hasOwnProperty(idKey)) {\n return resp;\n }\n // If the response has an object indexed at '<entityName>' and it has\n // the property '<idKey>', return it as TEntity.\n if (resp.hasOwnProperty(entityName)) {\n const obj = resp[entityName];\n if (obj.hasOwnProperty(idKey)) {\n return obj;\n }\n }\n // Return undefined, indicating that we could't parse the response.\n return undefined;\n}\n\nexport const DefaultSPMatEntityCrudConfig: SPMatEntityCrudConfig = {\n crudOpResponseParser: defaultCrudResponseParser\n};\n\n/**\n * To be called from an object constructor as it internally calls Angular's\n * inject() API.\n * @param userConfig\n * @returns\n */\nexport function getEntityCrudConfig(): SPMatEntityCrudConfig {\n const userCrudConfig = inject(SP_MAT_ENTITY_CRUD_CONFIG, {\n optional: true,\n });\n return {\n ...DefaultSPMatEntityCrudConfig,\n ...(userCrudConfig ?? {}),\n };\n}\n","import { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n EmbeddedViewRef,\n inject,\n input,\n OnDestroy,\n OnInit,\n signal,\n TemplateRef,\n viewChild,\n ViewContainerRef\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { TranslocoModule, TranslocoService } from '@jsverse/transloco';\nimport { SPMatHostBusyWheelDirective } from '@smallpearl/ngx-helper/mat-busy-wheel';\nimport { Observable, of, Subscription, tap } from 'rxjs';\nimport { getEntityCrudConfig } from './default-config';\nimport { SPMatEntityCrudComponentBase } from './mat-entity-crud-internal-types';\nimport { SPMatEntityCrudConfig, SPMatEntityCrudCreateEditBridge } from './mat-entity-crud-types';\n\n@Component({\n imports: [\n CommonModule,\n MatButtonModule,\n MatIconModule,\n TranslocoModule,\n SPMatHostBusyWheelDirective,\n ],\n selector: 'sp-create-edit-entity-host',\n template: `\n <div\n [class]=\"\n 'sp-mat-crud-form-wrapper ' +\n entityCrudComponentBase().getFormPaneWrapperClass()\n \"\n spHostBusyWheel=\"formBusyWheel\"\n *transloco=\"let t\"\n >\n <div\n [class]=\"\n 'sp-mat-crud-form-content ' +\n entityCrudComponentBase().getFormPaneContentClass()\n \"\n >\n <div class=\"create-edit-topbar\">\n <div class=\"title\">\n @if (title()) {\n {{ title() | async }}\n } @else {\n {{\n t('spMatEntityCrud.' + (entity() ? 'editItem' : 'newItem'), {\n item: (this._itemLabel() | async)\n })\n }}\n }\n </div>\n <div class=\"spacer\"></div>\n <div class=\"close\">\n <button mat-icon-button (click)=\"onClose()\">\n <mat-icon>cancel</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"form-container\">\n <ng-container #clientFormContainer></ng-container>\n </div>\n </div>\n </div>\n `,\n styles: `\n .sp-mat-crud-form-wrapper {\n width: 100% !important;\n height: 100% !important;\n }\n .sp-mat-crud-form-content {\n height: 100%;\n width: 100%;\n display: flex;\n flex-direction: column;\n padding: 0.4em;\n }\n .create-edit-topbar {\n display: flex;\n flex-direction: row;\n align-items: center;\n min-height: 48px;\n padding: 0.4em;\n }\n .form-container {\n padding-top: 0.4em;\n flex-grow: 1;\n overflow: auto;\n }\n .create-edit-topbar .title {\n font-size: 1.5em;\n font-weight: 500;\n }\n .create-edit-topbar .spacer {\n flex-grow: 1;\n }\n .create-edit-topbar .close {\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormViewHostComponent<\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n> implements SPMatEntityCrudCreateEditBridge, OnInit, OnDestroy\n{\n entityCrudComponentBase =\n input.required<SPMatEntityCrudComponentBase<TEntity, IdKey>>();\n clientViewTemplate = input<TemplateRef<any> | null>(null);\n\n _itemLabel = computed<Observable<string>>(() => {\n const label = this.entityCrudComponentBase().getItemLabel();\n return label instanceof Observable ? label : of(label);\n });\n _itemLabelPlural = computed<Observable<string>>(() => {\n const label = this.entityCrudComponentBase().getItemLabelPlural();\n return label instanceof Observable ? label : of(label);\n });\n\n entity = signal<TEntity | undefined>(undefined);\n title = signal<Observable<string> | undefined>(undefined);\n params = signal<any>(undefined);\n clientFormView!: EmbeddedViewRef<any> | null;\n vc = viewChild('clientFormContainer', { read: ViewContainerRef });\n config!: SPMatEntityCrudConfig;\n sub$ = new Subscription();\n transloco = inject(TranslocoService);\n\n constructor() {\n this.config = getEntityCrudConfig();\n }\n // loadEntity: (id: any, params: string | HttpParams) => Observable<any>;\n\n ngOnInit() {}\n\n ngOnDestroy(): void {\n this.sub$.unsubscribe();\n }\n\n show(entity: TEntity | undefined, params?: any) {\n this.entity.set(entity);\n if (params && params?.title) {\n this.title.set(\n params.title instanceof Observable ? params.title : of(params.title)\n );\n } else {\n // this.title.set(entity ? this.config.i18n.editItemLabel(this.itemLabel()) : this.config.i18n.newItemLabel(this.itemLabel()));\n // this.title.set(\n // this.transloco.translate(entity ? 'editItem' : 'newItem', {\n // item: this.itemLabel(),\n // })\n // );\n }\n this.params.set(params);\n this.createClientView();\n }\n\n // BEGIN SPMatEntityCrudCreateEditBridge METHODS //\n getEntityName(): string {\n return this.entityCrudComponentBase().getEntityName();\n }\n\n getIdKey(): string {\n return this.entityCrudComponentBase().getIdKey();\n }\n\n getEntityUrl(entityId: any): string {\n return this.entityCrudComponentBase().getEntityUrl(entityId);\n }\n\n close(cancel: boolean) {\n this.entityCrudComponentBase().closeCreateEdit(cancel);\n // destroy the client's form component\n this.destroyClientView();\n }\n\n registerCanCancelEditCallback(callback: () => boolean) {\n this.entityCrudComponentBase().registerCanCancelEditCallback(callback);\n }\n\n create(entityValue: any) {\n // console.log(\n // `SPCreateEditEntityHostComponent.create - entity: ${JSON.stringify(\n // entityValue\n // )}`\n // );\n const crudComponent = this.entityCrudComponentBase();\n return crudComponent\n ?.create(entityValue)\n .pipe(tap(() => this.close(false)));\n }\n\n update(id: any, entityValue: any) {\n // console.log(\n // `SPCreateEditEntityHostComponent.update - id: ${String(\n // id\n // )}, entity: ${entityValue}`\n // );\n const crudComponent = this.entityCrudComponentBase();\n return crudComponent\n ?.update(id, entityValue)\n .pipe(tap(() => this.close(false)));\n }\n // END SPMatEntityCrudCreateEditBridge METHODS //\n\n /**\n * Creates the client view provided via template\n */\n createClientView() {\n /** Render preview component if one was provided */\n const ft = this.clientViewTemplate();\n const vc = this.vc();\n if (ft && vc) {\n this.clientFormView = vc.createEmbeddedView(ft, {\n $implicit: {\n bridge: this,\n entity: this.entity(),\n params: this.params(),\n },\n });\n this.clientFormView.detectChanges();\n }\n }\n\n destroyClientView() {\n if (this.clientFormView) {\n this.clientFormView.destroy();\n this.clientFormView = null;\n }\n }\n\n onClose() {\n // Can we give the client form component a chance to intercept this\n // and cancel the closure?\n if (this.entityCrudComponentBase().canCancelEdit()) {\n this.entityCrudComponentBase().closeCreateEdit(true);\n this.destroyClientView();\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EmbeddedViewRef,\n input,\n OnDestroy,\n OnInit,\n signal,\n TemplateRef,\n viewChild,\n ViewContainerRef\n} from '@angular/core';\nimport { SPMatEntityCrudComponentBase } from './mat-entity-crud-internal-types';\n\n@Component({\n imports: [],\n selector: 'sp-entity-crud-preview-host',\n template: ` <ng-container #previewComponent></ng-container> `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class PreviewHostComponent<TEntity extends { [P in IdKey]: PropertyKey }, IdKey extends string = 'id'> implements OnInit, OnDestroy {\n vc = viewChild('previewComponent', { read: ViewContainerRef });\n\n entityCrudComponentBase = input.required<SPMatEntityCrudComponentBase<TEntity, IdKey>>();\n clientViewTemplate = input<TemplateRef<any> | null>(null);\n entity = signal<TEntity|undefined>(undefined);\n clientView!: EmbeddedViewRef<any> | null;\n\n constructor() {\n // effect(() => {\n // const tmpl = this.clientViewTemplate();\n // this.createClientView(tmpl);\n // });\n }\n\n ngOnInit(): void {}\n\n ngOnDestroy(): void {}\n\n show(entity: TEntity|undefined, params?: any) {\n this.entity.set(entity);\n // if (params && params?.title) {\n // this.title.set(params.title);\n // } else {\n // this.title.set(entity ? this.config.i18n.editItemLabel(this.itemLabel()) : this.config.i18n.newItemLabel(this.itemLabel()));\n // }\n // this.params.set(params);\n this.createClientView();\n }\n\n close() {\n // this.entityCrudComponentBase().closeCreateEdit(cancel);\n // destroy the client's form component\n this.destroyClientView();\n }\n\n private createClientView() {\n if (this.clientView) {\n // We have only one view in the ng-container. So we might as well\n // call clear() to remove all views contained in it.\n this.vc()!.clear();\n this.clientView.destroy();\n }\n /** Render preview component if one was provided */\n const ft = this.clientViewTemplate();\n const vc = this.vc();\n if (ft && vc) {\n this.clientView = this.vc()!.createEmbeddedView(\n ft,\n {\n $implicit: {\n entity: this.entity(),\n entityCrudComponent: this.entityCrudComponentBase(),\n },\n }\n );\n this.clientView.detectChanges();\n }\n }\n\n\n destroyClientView() {\n if (this.clientView) {\n this.clientView.destroy();\n this.clientView = null;\n }\n }\n\n // close() {\n // this.closePreview.emit();\n // }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n HttpClient,\n HttpContext,\n HttpContextToken,\n HttpParams,\n} from '@angular/common/http';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n ContentChildren,\n effect,\n EventEmitter,\n inject,\n Injector,\n input,\n Output,\n QueryList,\n signal,\n TemplateRef,\n viewChild,\n viewChildren,\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatMenuModule } from '@angular/material/menu';\nimport { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';\nimport { MatSortModule } from '@angular/material/sort';\nimport { MatColumnDef, MatTableModule } from '@angular/material/table';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { RouterModule } from '@angular/router';\nimport {\n provideTranslocoScope,\n TranslocoModule,\n TranslocoService,\n} from '@jsverse/transloco';\nimport {\n showBusyWheelUntilComplete,\n SPMatHostBusyWheelDirective,\n} from '@smallpearl/ngx-helper/mat-busy-wheel';\nimport { SPMatContextMenuComponent } from '@smallpearl/ngx-helper/mat-context-menu';\nimport { SPMatEntityListComponent } from '@smallpearl/ngx-helper/mat-entity-list';\nimport { AngularSplitModule } from 'angular-split';\nimport { clone, startCase } from 'lodash';\nimport { plural } from 'pluralize';\nimport {\n catchError,\n EMPTY,\n firstValueFrom,\n map,\n Observable,\n of,\n Subscription,\n switchMap,\n tap,\n throwError,\n} from 'rxjs';\nimport { convertHttpContextInputToHttpContext } from './convert-context-input-to-http-context';\nimport { getEntityCrudConfig } from './default-config';\nimport { FormViewHostComponent } from './form-view-host.component';\nimport { SPMatEntityCrudComponentBase } from './mat-entity-crud-internal-types';\nimport { MatEntityCrudItemAction } from './mat-entity-crud-item-action';\nimport {\n ALLOW_ITEM_ACTION_FN,\n CRUD_OP_FN,\n CrudOp,\n NewItemSubType,\n SP_MAT_ENTITY_CRUD_HTTP_CONTEXT,\n SPMatEntityCrudConfig,\n SPMatEntityCrudResponseParser,\n} from './mat-entity-crud-types';\nimport { PreviewHostComponent } from './preview-host.component';\n\n@Component({\n imports: [\n CommonModule,\n RouterModule,\n MatButtonModule,\n MatTableModule,\n MatSortModule,\n MatMenuModule,\n MatSnackBarModule,\n MatIconModule,\n TranslocoModule,\n AngularSplitModule,\n SPMatEntityListComponent,\n SPMatContextMenuComponent,\n FormViewHostComponent,\n SPMatHostBusyWheelDirective,\n PreviewHostComponent,\n ],\n providers: [provideTranslocoScope('sp-mat-entity-crud')],\n selector: 'sp-mat-entity-crud',\n template: `\n <as-split direction=\"horizontal\" [gutterSize]=\"6\" *transloco=\"let t\">\n <as-split-area\n [size]=\"entitiesPaneWidth()\"\n [visible]=\"!entitiesPaneHidden()\"\n >\n <div [class]=\"listPaneWrapperClass()\">\n <ng-content select=\"[breadCrumbs]\"></ng-content>\n\n <ng-template #defaultActionButtons>\n <div class=\"action-bar-actions\">\n @if (!disableCreate()) {\n @if (newItemSubTypes()) {\n <!-- New {{item}} displays a dropdown menu from which the subtype can be selected -->\n <button\n type=\"button\"\n mat-raised-button\n color=\"primary\"\n [matMenuTriggerFor]=\"newSubTypesMenu\"\n >\n {{\n newItemLabel() ??\n t('spMatEntityCrud.newItem', {\n item: _itemLabel() | async,\n })\n }}\n <mat-icon>expand_circle_down</mat-icon>\n </button>\n <mat-menu #newSubTypesMenu=\"matMenu\">\n @for (subtype of newItemSubTypes(); track $index) {\n @if (subtype.role) {\n <button\n mat-menu-item\n (click)=\"handleNewItemSubType(subtype)\"\n >\n {{ subtype.label }}\n </button>\n } @else {\n <div style=\"padding: .2em 0.5em;\">\n <strong>{{ subtype.label }}</strong>\n </div>\n }\n }\n </mat-menu>\n } @else {\n <button\n mat-raised-button\n color=\"primary\"\n (click)=\"onCreate($event)\"\n [routerLink]=\"newItemLink()\"\n >\n {{\n newItemLabel() ??\n t('spMatEntityCrud.newItem', {\n item: _itemLabel() | async,\n })\n }}\n <mat-icon>add_circle</mat-icon>\n </button>\n }\n }\n </div>\n </ng-template>\n\n <ng-template #defaultHeaderTemplate>\n <div class=\"action-bar\">\n <div class=\"action-bar-title\">\n {{ _title() | async }}\n </div>\n <span class=\"spacer\"></span>\n <!-- Hide the action buttons when Preview/Edit pane is active -->\n @if (!entityPaneActive()) {\n <ng-container\n [ngTemplateOutlet]=\"actionsTemplate() || defaultActionButtons\"\n ></ng-container>\n }\n </div>\n </ng-template>\n <ng-container\n [ngTemplateOutlet]=\"headerTemplate() || defaultHeaderTemplate\"\n ></ng-container>\n <sp-mat-entity-list\n #entitiesList\n [entityName]=\"entityName()\"\n [entityNamePlural]=\"entityNamePlural()\"\n [deferViewInit]=\"true\"\n [endpoint]=\"endpoint()\"\n [entityLoaderFn]=\"entityLoaderFn()\"\n [columns]=\"columnsWithAction()\"\n [displayedColumns]=\"visibleColumns()\"\n [idKey]=\"idKey()\"\n [pagination]=\"pagination()\"\n [paginator]=\"paginator()\"\n [pageSize]=\"pageSize()\"\n [sorter]=\"sorter()\"\n [disableSort]=\"disableSort()\"\n (selectEntity)=\"handleSelectEntity($event)\"\n [httpReqContext]=\"httpReqContext()\"\n >\n </sp-mat-entity-list>\n </div>\n\n <!--\n We'll be initializing the contentColumnDefs separately and not\n relying on <sp-mat-entity-list>'s internal @ContentChildre() querylist\n for building this. So we define this independenly and not as\n <sp-mat-entity-list> content.\n -->\n <ng-container matColumnDef=\"action\">\n <th mat-header-cell *matHeaderCellDef></th>\n <td mat-cell *matCellDef=\"let element\">\n <!-- <button\n mat-icon-button\n hoverDropDown\n >\n <mat-icon>more_vert</mat-icon>\n </button> -->\n <sp-mat-context-menu\n [menuItems]=\"_itemActions\"\n (selected)=\"onItemAction($event, element)\"\n [contextData]=\"element\"\n [hasBackdrop]=\"true\"\n ></sp-mat-context-menu>\n </td>\n </ng-container>\n </as-split-area>\n <as-split-area [size]=\"entityPaneWidth()\" [visible]=\"entityPaneActive()\">\n <div\n [class]=\"'entity-pane-wrapper ' + previewPaneWrapperClass()\"\n spHostBusyWheel=\"formBusyWheel\"\n >\n <sp-entity-crud-preview-host\n [ngClass]=\"createEditViewActive() ? 'sp-hidden' : 'sp-visible'\"\n [entityCrudComponentBase]=\"this\"\n [clientViewTemplate]=\"previewTemplate()!\"\n ></sp-entity-crud-preview-host>\n <!-- Create/Edit Entity -->\n <sp-create-edit-entity-host\n [ngClass]=\"createEditViewActive() ? 'sp-visible' : 'sp-hidden'\"\n [entityCrudComponentBase]=\"this\"\n [clientViewTemplate]=\"createEditFormTemplate()\"\n ></sp-create-edit-entity-host>\n </div>\n </as-split-area>\n </as-split>\n `,\n styles: `\n .sp-hidden {\n display: none;\n }\n .sp-visible {\n display: inherit;\n height: 100% !important;\n width: 100% !important;\n }\n .entity-pane-wrapper {\n height: 100% !important;\n width: 100% !important;\n }\n .action-bar {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding-bottom: 0.5em;\n }\n .action-bar-title {\n font-size: 1.5em;\n font-weight: 600;\n }\n .spacer {\n flex-grow: 1;\n }\n .action-bar-actions {\n text-align: end;\n }\n .active-row {\n font-weight: bold;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SPMatEntityCrudComponent<\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id',\n>\n extends SPMatEntityListComponent<TEntity, IdKey>\n implements SPMatEntityCrudComponentBase<TEntity, IdKey>\n{\n // entityName = input.required<string>();\n // entityNamePlural = input<string>();\n\n itemLabel = input<string | Observable<string>>();\n itemLabelPlural = input<string | Observable<string>>();\n\n /**\n * Title string displayed above the component. If not specified, will use\n * itemLabelPlural() as the title.\n */\n title = input<string | Observable<string>>();\n /**\n *\n */\n itemActions = input<MatEntityCrudItemAction<TEntity, IdKey>[]>([]);\n /**\n * Specify the list of router paths that will be set as the value for\n * [routerLink] for the 'New {{ item }}' button. If not specified,\n * if createEditTemplate is specified, it will be shown. If not, `action`\n * out event will be raised with `{ role: '_new_' }`.\n */\n newItemLink = input<string | string[]>();\n /**\n * If not specified, will default to 'New <itemLabel()>'.\n */\n newItemLabel = input<string | string[]>();\n /**\n * Text for the Edit <item> pane title\n */\n editItemTitle = input<string>();\n /**\n * If you want \"New {{item}}\" button to support multiple entity types,\n * you can set this to `NewItemSubType[]`, where each element stands for for\n * a dropdown menu item. Refer to `NewItemSubType` for details on this\n * interface.\n */\n newItemSubTypes = input<NewItemSubType[]>();\n /**\n * If you want to take control of the network operations for the CRUD\n * operations (GET/CREATE/UPDATE/DELETE), provide a value for this property.\n */\n crudOpFn = input<CRUD_OP_FN<TEntity, IdKey>>();\n /**\n * Item preview template.\n */\n previewTemplate = input<TemplateRef<any>>();\n /**\n * Whether to allow a context menu action or not. Return false to disable\n * the action.\n */\n allowEntityActionFn = input<ALLOW_ITEM_ACTION_FN<TEntity>>();\n /**\n * A template that allows the header to be replaced. Usage:-\n *\n * ```\n * <sp-map-entity-crud\n * [headerTemplate]=\"myCrudViewHeader\"\n * ></sp-map-entity-crud>\n * <ng-template #myCrudViewHeader>...</ng-template>\n * ```\n */\n headerTemplate = input<TemplateRef<any>>();\n /**\n * Set this to the custom template identifier that will replace the\n * \"New {{Item}}\" button portion. This template will expand towards the\n * title which will be placed to its left (right in rtl).\n *\n * ```\n * <sp-map-entity-crud\n * [actionsTemplate]=\"myCrudActions\"\n * ></sp-map-entity-crud>\n * <ng-template #myCrudActions>...</ng-template>\n * ```\n */\n actionsTemplate = input<TemplateRef<any>>();\n\n /**\n * CRUD action response parser. This will be called with the response\n * from CREATE & UPDATE operations to parse the response JSON and return\n * the created/updated TEntity.\n */\n crudResponseParser = input<SPMatEntityCrudResponseParser>();\n /**\n * An ng-template name that contains the component which provides the\n * create/edit CRUD action.\n *\n * ```\n * <ng-template #createEdit let-data>\n * <app-create-edit-entity-demo [bridge]=\"data.bridge\" [entity]=\"data.entity\"></app-create-edit-entity-demo>\n * </ng-template>\n * ```\n * Note how [bridge] & [entity] properties are set deriving them from the\n * implicit template context. [entity] will be undefined for Create\n * opreation and will be the valid entity for an Update.\n * (app-create-edit-entity-demo here is the client code that implements the\n * Create/Edit form)\n */\n createEditFormTemplate = input<TemplateRef<any> | null>(null);\n /**\n * Disables the per item actions column, preventing 'Edit' & 'Delete'\n * (and other user defined) item operations.\n */\n disableItemActions = input<boolean>(false);\n /**\n * Disables the Create function.\n */\n disableCreate = input<boolean>(false);\n /**\n * View refresh policy after a CREATE/UPDATE operation. Values\n * 'none' - Objects are not refreshed after an edit operation. The return\n * value of the edit operation is used as the object to\n * add/update the component's internal store. This is the default.\n * 'object' - Refresh just the object that was returned from the\n * CREATE/UPDATE operation. Use this if the JSON object returned\n * after a successful CREATE/UPDATE op differs from the JSON\n * object returned for the GET request.\n * 'all' - Refresh the entire list after a CREATE/UPDATE operation. This\n * mimics the behaviour of legacy HTML apps with pure server\n * defined UI.\n */\n refreshAfterEdit = input<'none' | 'object' | 'all'>('none');\n /**\n * HttpContext for crud requests - `create`, `retrieve`, `update` & `delete`.\n * Note that HttpContext for `list` operation should be set using the\n * `httpReqContext` property inherited from SPMatEntityListComponent.\n * The value of the property is an object where the key names reflect the CRUD\n * operation with each of these keys expected to have a value of type\n * `[[HttpContextToken<any>, any]] | [HttpContextToken<any>, any] | HttpContext`.\n *\n * Alternatively the property value can be set to\n * `[[HttpContextToken<any>, any]] | [HttpContextToken<any>, any] | HttpContext`,\n * in which case the same context would be used for all HTTP requests.\n */\n crudHttpReqContext = input<\n | [[HttpContextToken<any>, any]]\n | [HttpContextToken<any>, any]\n | {\n create?: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]; // CREATE\n retrieve?:\n | [[HttpContextToken<any>, any]]\n | [HttpContextToken<any>, any]; // RETRIEVE\n update?: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]; // UPDATE\n delete?: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]; // DELETE\n }\n >();\n /**\n * Width of the edit pane as a percentange of the overall <as-split> width.\n */\n editPaneWidth = input<number>(100);\n /**\n * Width of the preview pane as a percentange of the overall <as-split> width.\n */\n previewPaneWidth = input<number>(50);\n\n /**\n * The class class that will be applied to the list pane wrapper.\n */\n listPaneWrapperClass = input<string>('sp-mat-crud-list-pane-wrapper-class');\n\n /**\n * The class class that will be applied to the preview pane wrapper.\n * Inside this wrapper, another div element with class='previewPaneContentClass()'\n * will be created to host the preview content. The client supplied preview\n * template will be rendered inside this div.\n *\n * +----------------------------------------+\n * | previewPaneWrapperClass |\n * |----------------------------------------|\n * | preview toolbar |\n * |----------------------------------------|\n * | +------------------------------------+ |\n * | | div class=previewPaneContentClass()| |\n * | |------------------------------------| |\n * | | client supplied preview template | |\n * | +------------------------------------+ |\n * +----------------------------------------+\n */\n previewPaneWrapperClass = input<string>(\n 'sp-mat-crud-entity-pane-wrapper-class',\n );\n\n /**\n * The class class that will be applied to the preview pane content.\n */\n previewPaneContentClass = input<string>(\n 'sp-mat-crud-preview-pane-content-class',\n );\n\n /**\n * The class class that will be applied to the form pane wrapper. Inside this\n * wrapper, another div element with class='formPaneContentClass()' will be\n * created to host the form content. The client supplied form template will\n * be rendered inside this div.\n *\n * +----------------------------------------+\n * | formPaneWrapperClass |\n * | +------------------------------------+ |\n * | | div class=formPaneContentClass() | |\n * | |------------------------------------| |\n * | | form title + close button | |\n * | |------------------------------------| |\n * | | client supplied form template | |\n * | +------------------------------------+ |\n * +----------------------------------------+\n */\n formPaneWrapperClass = input<string>('sp-mat-crud-form-pane-wrapper-class');\n\n /**\n * The CSS class that will be applied to the form pane content.\n */\n formPaneContentClass = input<string>('sp-mat-crud-form-pane-content-class');\n\n // INTERNAL PROPERTIES //\n // Derive a label from a camelCase source string. If the camelCase string\n // can be translated, it returns the translated string. If not, the function\n // converts the camelCase to 'Title Case' and returns it.\n private getLabel = (source: string) => {\n const label = this.transloco.translate(source);\n if (label.localeCompare(source) !== 0) {\n // Successful translation, return it\n return label;\n }\n return startCase(source);\n };\n\n _itemLabel = computed<Observable<string>>(() => {\n const itemLabel = this.itemLabel();\n const label = itemLabel ? itemLabel : this.getLabel(this.entityName());\n return label instanceof Observable ? label : of(label);\n });\n _itemLabelPlural = computed<Observable<string>>(() => {\n const itemLabelPlural = this.itemLabelPlural();\n const label = itemLabelPlural\n ? itemLabelPlural\n : this.getLabel(plural(this.entityName()));\n return label instanceof Observable ? label : of(label);\n });\n\n // Computed title\n _title = computed(() => {\n const title = this.title() ? this.title() : this._itemLabelPlural();\n return title instanceof Observable ? title : of(title);\n });\n // endpoint with the QP string removed (if one was provided)\n _endpointSansParams = computed(() => this.endpoint().split('?')[0]);\n _endpointParams = computed(() => {});\n componentColumns = viewChildren(MatColumnDef);\n @ContentChildren(MatColumnDef) _clientColumnDefs!: QueryList<MatColumnDef>;\n\n /**\n * Event raised for user selecting an item action. It's also raised\n * for 'New <Item>' action, if 'newItemLink' property is not set.\n */\n @Output() action = new EventEmitter<{ role: string; entity?: TEntity }>();\n\n /**\n * Event raised when create Create/Edit pane is activated & deactivated.\n * Event contains two flags:-\n * activated - whether the createEdit form view was activated or\n * deactivated.\n * cancelled - whether the form view was cancelled by user. False for this\n * indicates that the form view was closed after a successful\n * edit operation.\n */\n @Output() entityViewPaneActivated = new EventEmitter<{\n activated: boolean;\n cancelled: boolean | undefined;\n mode: 'edit' | 'preview';\n }>();\n\n busyWheelId = `entityCrudBusyWheel-${Date.now()}`;\n sub$ = new Subscription();\n spEntitiesList =\n viewChild<SPMatEntityListComponent<TEntity, IdKey>>('entitiesList');\n\n // Theoritically, we ought to be able to initialize the mat-entities-list\n // columns from ngAfterViewInit lifecycle hook. But for some strange reason\n // when this hook is called, sp-mat-entities-list has not been initialized.\n // Therefore `spEntitiesList()` is null. So we have to use a computed signal,\n // which will be triggered when spEntitiesList() is initialized and use that\n // to initialize the columns.\n spEntitiesListInited = effect(() => {\n if (this.spEntitiesList()) {\n this._initEntitiesList();\n }\n });\n\n crudConfig!: SPMatEntityCrudConfig;\n\n // This is the internal component that will host the createEditFormTemplate\n createEditHostComponent = viewChild(FormViewHostComponent);\n // A flag to toggle the viewport's contents between the mat-table\n // and the create/edit form template.\n createEditViewActive = signal<boolean>(false);\n\n // Whether it's okay to cancel the edit\n canCancelEditCallback!: () => boolean;\n\n // Preview host component\n previewHostComponent = viewChild(PreviewHostComponent);\n previewActive = computed(() => this.previewedEntity() !== undefined);\n previewedEntity = signal<TEntity | undefined>(undefined);\n\n // Whether the pane that hosts the preview/edit-entity template is active.\n // We call it entityPane as it's used to either render a selected entity\n // or to edit one.\n entityPaneActive = computed(\n () => !!this.previewedEntity() || this.createEditViewActive(),\n );\n // Effective width of the entity pane.\n entityPaneWidth = computed(() =>\n this.entityPaneActive()\n ? !!this.previewedEntity()\n ? this.previewPaneWidth()\n : this.editPaneWidth()\n : 0,\n );\n\n // Width of the pane showing the list of entities. Calculated as\n entitiesPaneWidth = computed(() => 100 - this.entityPaneWidth());\n entitiesPaneHidden = computed(\n () => this.entityPaneActive() && this.entityPaneWidth() === 100,\n );\n\n defaultItemCrudActions = signal<MatEntityCrudItemAction<TEntity, IdKey>[]>(\n [],\n );\n columnsWithAction = computed(() => {\n const cols = clone(this.columns());\n const actionDefined =\n cols.find((c) =>\n typeof c === 'string' ? c === 'action' : c.name === 'action',\n ) !== undefined;\n if (!actionDefined) {\n cols.push('action');\n }\n return cols;\n });\n // Provide per entity actions as a function so that the actions are\n // enumerated only when the user clicks on the context menu button.\n _itemActions = (entity: TEntity) => this.getItemActions(entity);\n\n // This uses the previewActive signal to compute the visible columns\n // when preview is activated. For now we just hide the 'action' column when\n // preview is active. We can further customize this logic by allowing the\n // client to specify the columns to display when preview is active thereby\n // reducing column clutter when the table width becomes narrower owing to\n // preview pane taking up screen space.\n visibleColumns = computed(() =>\n this.entityPaneActive()\n ? this.columnsWithAction()\n .map((col) => (typeof col === 'string' ? col : col.name))\n .filter((name) => name !== 'action')\n : [],\n );\n transloco = inject(TranslocoService);\n\n constructor(\n http: HttpClient,\n private snackBar: MatSnackBar,\n sanitizer: DomSanitizer,\n injector: Injector,\n ) {\n super(http, sanitizer, injector);\n this.crudConfig = getEntityCrudConfig();\n if (this.crudConfig?.defaultItemActions) {\n this.defaultItemCrudActions.set(this.crudConfig?.defaultItemActions);\n } else {\n this.defaultItemCrudActions.set([\n {\n label: this.transloco.translate('spMatEntityCrud.edit'),\n role: '_update_',\n },\n {\n label: this.transloco.translate('spMatEntityCrud.delete'),\n role: '_delete_',\n },\n ]);\n }\n }\n\n override ngOnInit() {}\n\n override ngOnDestroy(): void {\n this.sub$.unsubscribe();\n }\n\n /**\n * Override so that we can suppress default action in SPMatEntityListComponent\n */\n override ngAfterViewInit(): void {}\n\n /**\n * If the create/edit entity form is active, it calls its registered\n * canCancelEdit callback to determine if it's okay to cancel the edit.\n * You can use this method from the host component's router guard to\n * ensure that any changes made to the form are not accidentally lost by\n * navigating away from the CRUD page.\n *\n * If your CRUD page has multiple sp-mat-entity-crud components, you have to\n * implement the logic to call this method on the appropriate component.\n *\n * If the the create/edit form is not active, this method returns true.\n * @returns\n */\n canDeactivate() {\n if (this.createEditViewActive()) {\n return this.canCancelEdit();\n }\n return true;\n }\n\n override refresh(force = false) {\n this.spEntitiesList()?.refresh(force);\n }\n\n // BEGIN SPMatEntityCrudComponentBase METHODS //\n getEntityName(): string {\n return this.entityName();\n }\n\n getEntityNamePlural(): string {\n return this._entityNamePlural();\n }\n\n getIdKey() {\n return this.idKey();\n }\n\n closeCreateEdit(cancelled: boolean) {\n this.createEditViewActive.set(false);\n this.entityViewPaneActivated.emit({\n activated: false,\n cancelled: !!cancelled,\n mode: 'edit',\n });\n }\n\n canCancelEdit() {\n if (this.canCancelEditCallback) {\n return this.canCancelEditCallback();\n }\n return true;\n }\n\n registerCanCancelEditCallback(callback: () => boolean) {\n this.canCancelEditCallback = callback;\n }\n\n triggerEntityUpdate(entity: TEntity) {\n this.onUpdate(entity);\n }\n\n triggerEntityDelete(entity: TEntity) {\n this.onDelete(entity);\n }\n\n create(entityValue: any) {\n let obs!: Observable<TEntity | null>;\n const crudOpFn = this.crudOpFn();\n if (crudOpFn) {\n obs = crudOpFn('create', undefined, entityValue, this);\n } else {\n obs = this.http.post<TEntity>(this.getUrl(this.endpoint()), entityValue, {\n context: this.getCrudReqHttpContext('create'),\n });\n }\n\n return obs.pipe(\n showBusyWheelUntilComplete('formBusyWheel'),\n switchMap((resp) =>\n resp ? this.doRefreshAfterEdit(resp, 'create') : of(null),\n ),\n tap((entity) => {\n // If pagination is infinite or if the pagination if none or if the\n // count of items in the current page is less than pageSize()\n // wec an safely add the item to the list, which will cause the view\n // render the new item in the mat-table.\n if (entity) {\n this.spEntitiesList()?.addEntity(entity);\n firstValueFrom(this._itemLabel()).then((itemLabel) => {\n this.snackBar.open(\n this.transloco.translate('spMatEntityCrud.createSuccess', {\n item: itemLabel,\n }),\n );\n });\n }\n }),\n );\n }\n\n update(id: TEntity[IdKey], entityValue: any) {\n let obs!: Observable<TEntity | null>;\n const crudOpFn = this.crudOpFn();\n if (crudOpFn) {\n obs = crudOpFn('update', id, entityValue, this);\n } else {\n obs = this.http.patch<TEntity>(this.getEntityUrl(id), entityValue, {\n context: this.getCrudReqHttpContext('update'),\n });\n }\n\n return obs.pipe(\n showBusyWheelUntilComplete('formBusyWheel'),\n switchMap((resp) =>\n resp ? this.doRefreshAfterEdit(resp, 'update') : of(null),\n ),\n tap((entity) => {\n if (entity) {\n this.spEntitiesList()?.updateEntity(id, entity);\n firstValueFrom(this._itemLabel()).then((itemLabel) => {\n this.snackBar.open(\n this.transloco.translate('spMatEntityCrud.updateSuccess', {\n item: itemLabel,\n }),\n );\n });\n }\n }),\n );\n }\n // END SPMatEntityCrudComponentBase METHODS //\n\n /**\n * Thunk these methods to the internal <sp-mat-entity-list> component.\n */\n override addEntity(entity: TEntity): void {\n this.spEntitiesList()?.addEntity(entity);\n }\n\n override removeEntity(id: TEntity[IdKey]): void {\n this.spEntitiesList()?.removeEntity(id);\n }\n\n override updateEntity(id: TEntity[IdKey], entity: TEntity): void {\n this.spEntitiesList()?.updateEntity(id, entity);\n }\n\n /**\n * Refresh the entity list, after a CRUD CREATE or UPDATE operation.\n * @param resp This is the response from the CRUD operation (CREATE/UPDATE).\n * @param method The CRUD operation post which REFRESH is requested.\n * @returns Observable<TEntity|null>\n */\n doRefreshAfterEdit(resp: any, method: 'create' | 'update') {\n const refreshAfterEdit = this.refreshAfterEdit();\n const entity = this.getCrudOpResponseParser()(\n this.entityName(),\n this.idKey(),\n method,\n resp,\n );\n if (refreshAfterEdit === 'object') {\n let obs!: Observable<TEntity>;\n const crudOpFn = this.crudOpFn();\n if (crudOpFn) {\n obs = crudOpFn(\n 'get',\n (entity as any)[this.idKey()],\n undefined,\n this,\n ) as Observable<TEntity>;\n } else {\n obs = this.http.get<TEntity>(\n this.getEntityUrl((entity as any)[this.idKey()]),\n { context: this.getCrudReqHttpContext('retrieve') },\n );\n }\n return obs.pipe(\n map((entity) => {\n return this.getCrudOpResponseParser()(\n this.entityName(),\n this.idKey(),\n 'retrieve',\n entity,\n );\n }),\n );\n } else if (refreshAfterEdit === 'all') {\n this.refresh(true);\n return of(null);\n }\n\n return of(entity);\n }\n\n getCrudOpResponseParser(): SPMatEntityCrudResponseParser {\n if (this.crudResponseParser()) {\n // Without the `as SPMatEntityCrudResponseParser`, TSC will complain.\n return this.crudResponseParser() as SPMatEntityCrudResponseParser;\n }\n // crudConfig will have a parser as our default config provides one.\n return this.crudConfig\n .crudOpResponseParser as SPMatEntityCrudResponseParser;\n }\n\n // SPMatEntityCrudComponentBase interface method. Thunk to the implementation\n // method closePreviewImpl().\n closePreview() {\n this.closePreviewImpl(true);\n }\n\n private closePreviewImpl(toggleEntityListActiveEntity: boolean) {\n if (this.previewedEntity()) {\n if (toggleEntityListActiveEntity) {\n this.spEntitiesList()?.toggleActiveEntity(this.previewedEntity());\n }\n this.previewedEntity.set(undefined);\n this.entityViewPaneActivated.emit({\n activated: false,\n cancelled: undefined,\n mode: 'preview',\n });\n }\n }\n\n onItemAction(role: string, entity: TEntity) {\n // Handle default roles, which always get default behavior. If you want\n // a custom behavior, change the role to a custom one.\n if (role === '_update_' || role === '_delete_') {\n role === '_update_' ? this.onUpdate(entity) : this.onDelete(entity);\n return;\n }\n\n // Find the SPMatEntityCrudItemAction for this role to see if it's\n // allowed.\n const actionItem = this.itemActions().find((a) => a.role === role);\n if (!actionItem) {\n return;\n }\n\n // If a custom action handler is specified, call it.\n if (actionItem?.action) {\n actionItem.action(entity);\n return;\n }\n\n // Perform custom HTTP action\n const httpRequestParameters: MatEntityCrudItemAction<\n TEntity,\n IdKey\n >['httpRequestParameters'] = actionItem?.httpRequestParameters || {\n method: 'POST',\n urlPath: actionItem.role,\n };\n const verb = httpRequestParameters?.urlPath || actionItem?.role;\n if (!verb) {\n return;\n }\n\n // If a confirm prompt is specified, display it and return if user\n // selects 'Cancel'.\n if (actionItem?.confirmPrompt) {\n if (!confirm(actionItem.confirmPrompt)) {\n return;\n }\n }\n\n this.doEntityAction(\n (entity as any)[this.idKey()],\n verb,\n httpRequestParameters.params || new HttpParams(),\n httpRequestParameters.body,\n )\n .pipe(\n tap((response) => {\n const successMessage =\n actionItem?.successMessage ||\n this.transloco.translate('spMatEntityCrud.done');\n this.snackBar.open(successMessage || 'Done');\n }),\n catchError((error) => {\n /**\n * If an errorMessage is specified in the actionItem, display it.\n * Otherwise rethrow the error so that it can be handled by the\n * global error handler.\n */\n if (actionItem?.errorMessage) {\n this.snackBar.open(actionItem.errorMessage);\n return EMPTY;\n }\n return throwError(() => error);\n }),\n )\n .subscribe();\n }\n\n onCreate(event: Event) {\n // If newItemLink() has not been provided, check if createEditFormTemplate\n // is specified. If it is, load it and make that cover the entire viewport.\n // If that too is not specified, emit an action event with role='_new_'.\n if (!this.newItemLink() || this.newItemLink()?.length == 0) {\n event.preventDefault();\n event.stopImmediatePropagation();\n this.showCreateEditView(undefined);\n if (!this.createEditViewActive()) {\n this.action.emit({ role: '_new_' });\n }\n }\n }\n\n onUpdate(entity: TEntity) {\n this.showCreateEditView(entity);\n if (!this.createEditViewActive()) {\n this.action.emit({ role: '_update_' });\n }\n }\n\n /**\n * Show the create/edit component. This is deliberately made public so as to\n * be callable from the client. This allows the client to dynamically\n * set the form edit template and then show the edit pane by calling this\n * method.\n * @param entity\n * @param params\n */\n showCreateEditView(entity?: TEntity | undefined, params?: any) {\n const tmpl = this.createEditFormTemplate();\n if (!this.createEditViewActive() && tmpl) {\n // If preview is active deactivate it\n if (this.previewActive()) {\n this.closePreviewImpl(true);\n }\n const createEditHost = this.createEditHostComponent();\n createEditHost!.show(entity, params);\n this.createEditViewActive.set(true);\n this.entityViewPaneActivated.emit({\n activated: true,\n cancelled: undefined,\n mode: 'edit',\n });\n }\n }\n\n showPreviewView(entity?: TEntity, params?: any) {\n const tmpl = this.previewTemplate();\n if (tmpl) {\n if (!this.createEditViewActive()) {\n const previewHost = this.previewHostComponent();\n this.previewedEntity.set(entity);\n previewHost?.show(entity, params);\n this.entityViewPaneActivated.emit({\n activated: true,\n cancelled: undefined,\n mode: 'preview',\n });\n // this.previewActivated.emit({ entity, activated: true });\n }\n }\n }\n\n hidePreviewView() {\n if (this.previewActive()) {\n const previewHost = this.previewHostComponent();\n previewHost?.close();\n this.closePreviewImpl(false);\n }\n }\n\n async onDelete(entity: TEntity) {\n // Do the delete prompt asynchronously so that the context menu is\n // dismissed before the prompt is displayed.\n setTimeout(() => {\n // We use firstValueFrom() to get the value of the observable\n // synchronously. firstValueFrom() also gracefully cleans up the\n // observable after a value is emitted.\n firstValueFrom(this._itemLabel()).then((itemLabel) => {\n const deletedItemPrompt = this.transloco.translate(\n 'spMatEntityCrud.deleteItemConfirm',\n { item: itemLabel.toLocaleLowerCase() },\n );\n const yes = confirm(deletedItemPrompt);\n if (yes) {\n const entityId = (entity as any)[this.idKey()];\n\n // If preview is active deactivate it\n if (this.previewActive()) {\n this.closePreviewImpl(false);\n }\n\n let obs!: Observable<any>;\n const crudOpFn = this.crudOpFn();\n if (crudOpFn) {\n obs = crudOpFn('delete', entityId, undefined, this);\n } else {\n obs = this.http.delete<void>(this.getEntityUrl(entityId), {\n context: this.getCrudReqHttpContext('delete'),\n });\n }\n\n this.sub$.add(\n obs\n .pipe(\n // TODO: how to display a busy wheel?\n // showBusyWheelUntilComplete(this.busyWheelId),\n tap(() => {\n this.spEntitiesList()!.removeEntity(entityId);\n // TODO: customize by providing an interface via SPMatEntityCrudConfig?\n firstValueFrom(this._itemLabel()).then((itemLabel) => {\n const deletedMessage = this.transloco.translate(\n 'spMatEntityCrud.deleteItemSuccess',\n { item: itemLabel },\n );\n this.snackBar.open(deletedMessage);\n });\n }),\n )\n .subscribe(),\n );\n }\n });\n });\n }\n\n override getUrl(endpoint: string) {\n return this.entityListConfig?.urlResolver\n ? this.entityListConfig?.urlResolver(endpoint)\n : endpoint;\n }\n\n getEntityUrl(entityId: TEntity[IdKey]) {\n const endpoint = this.endpoint();\n const endpointParts = endpoint.split('?');\n const entityEndpoint =\n (endpointParts[0].endsWith('/')\n ? endpointParts[0]\n : endpointParts[0] + '/') + `${String(entityId)}/`;\n if (endpointParts.length > 1) {\n return this.getUrl(entityEndpoint + `?${endpointParts[1]}`);\n }\n return this.getUrl(entityEndpoint);\n }\n\n getEntityActionUrl(entityId: TEntity[IdKey], action: string) {\n const url = this.getEntityUrl(entityId);\n const urlParts = url.split('?');\n if (action.endsWith('/')) {\n action = action.slice(0, -1); // We'll be adding the trailing slash\n }\n const actionUrl =\n (urlParts[0].endsWith('/') ? urlParts[0] : urlParts[0] + '/') +\n `${action}/`;\n return urlParts.length === 1 ? actionUrl : actionUrl + `?${urlParts[1]}`;\n }\n\n handleSelectEntity(entity: TEntity | undefined) {\n if (!this.createEditViewActive()) {\n if (this.previewTemplate()) {\n entity ? this.showPreviewView(entity) : this.hidePreviewView();\n // this.previewedEntity.set(entity);\n } else {\n // If 'previewTemplate' is not set, propagate the event to client.\n this.selectEntity.emit(entity);\n }\n }\n }\n\n handleNewItemSubType(subtype: NewItemSubType) {\n // console.log(`handleNewItemSubType: ${subtype}`);\n if (subtype.role === '_new_') {\n this.showCreateEditView(undefined, subtype?.params);\n } else {\n this.action.emit({ role: subtype.role });\n }\n }\n\n private getCrudReqHttpContext(op: CrudOp) {\n let context = new HttpContext();\n // HttpContext for crud operations are taken from either the global httpReqContext\n // or from the crudHttpReqContext, with the latter taking precedence.\n const crudHttpReqContext = this.crudHttpReqContext()\n ? this.crudHttpReqContext()\n : this.httpReqContext();\n if (crudHttpReqContext) {\n if (crudHttpReqContext instanceof HttpContext) {\n // crudHttpReqContext is an object of type HttpContext. Which means\n // the same context is to be applied to all crud requests.\n for (const k of crudHttpReqContext.keys()) {\n context.set(k, crudHttpReqContext.get(k));\n }\n } else {\n if (Array.isArray(crudHttpReqContext)) {\n // Same HttpContext for all crud requests. Being an array, it must\n // be an array of HttpContextToken key, value pairs.\n convertHttpContextInputToHttpContext(context, crudHttpReqContext);\n } else if (\n typeof crudHttpReqContext === 'object' &&\n op &&\n Object.keys(crudHttpReqContext).find((k) => k === op)\n ) {\n // HttpContext specific to this crud operation, 'create'|'retrieve'|'update'|'delete'\n convertHttpContextInputToHttpContext(\n context,\n crudHttpReqContext[op]!,\n );\n }\n }\n }\n\n // Add standard SP_MAT_ENTITY_CRUD_HTTP_CONTEXT info which is set for all\n // HTTP requests made by this component.\n context.set(SP_MAT_ENTITY_CRUD_HTTP_CONTEXT, {\n entityName: this.entityName(),\n entityNamePlural: this._entityNamePlural(),\n endpoint: this.endpoint(),\n op,\n });\n return context;\n }\n\n isItemActionAllowed(action: string, entity: TEntity) {\n return false;\n }\n\n /**\n * Returns the list of item actions. Calls 'allowItemActionFn' for each action\n * to determine if the action is allowed for the given entity.\n * @returns\n */\n getItemActions(entity: TEntity): MatEntityCrudItemAction<TEntity, IdKey>[] {\n // console.log(`SPMatEntityCrudComponent.getItemActions - entity: ${JSON.stringify(entity, null, 2)}`);\n const actions =\n this.itemActions() && this.itemActions().length\n ? this.itemActions()\n : this.defaultItemCrudActions();\n let actionsCopy: MatEntityCrudItemAction<TEntity, IdKey>[] = clone(actions);\n actionsCopy.forEach(\n (action: MatEntityCrudItemAction<TEntity, IdKey>, index: number) => {\n // localize default action item labels (Update & Delete)\n // Client specified action labels are to be localized by the client\n // before supplying them to the component.\n if (action.label.startsWith('spMatEntityCrud.')) {\n action.label = this.transloco.translate(action.label);\n }\n const orgDisable = actions[index]?.disable;\n action.disable = (entity: TEntity) => {\n if (orgDisable) {\n return orgDisable(entity);\n }\n const allowItemActionFn = this.allowEntityActionFn();\n if (allowItemActionFn) {\n return !allowItemActionFn(entity, action.role ?? action.label);\n }\n return false;\n };\n },\n );\n // If the item actions are disabled, disable all actions. Event user\n // defined actions.\n if (this.disableItemActions()) {\n actionsCopy.forEach((a) => (a.disable = () => true));\n }\n return actionsCopy;\n }\n\n getPreviewPaneContentClass() {\n return this.previewPaneContentClass();\n }\n\n getFormPaneWrapperClass() {\n return this.formPaneWrapperClass();\n }\n\n getFormPaneContentClass(): string {\n return this.formPaneContentClass();\n }\n\n getItemLabel(): string | Observable<string> {\n return this._itemLabel();\n }\n\n getItemLabelPlural(): string | Observable<string> {\n return this._itemLabelPlural();\n }\n\n /**\n * Perform an action on the entity with the given id. The endpoint for the\n * action is derived from the `verb` argument which is appended to the\n * entity URL. This is following DRF specification where ViewSets can be\n * extended with custom actions that are not part of the standard\n * CRUD operations. Such methods will have a URL like\n * `/api/v1/entity/<id>/<verb>/` where `<verb>` is the custom action verb.\n * @param id\n * @param verb\n * @param addlParams\n * @param data\n */\n doEntityAction(\n id: TEntity[IdKey],\n verb: string,\n addlParams: HttpParams,\n data: any,\n busyWheelName: string = 'formBusyWheel',\n ) {\n let obs!: Observable<TEntity | null>;\n const crudOpFn = this.crudOpFn();\n if (crudOpFn) {\n obs = crudOpFn(verb, id, data, this);\n } else {\n const url = this.getEntityActionUrl(id, verb);\n obs = this.http.post<TEntity>(url, data, {\n params: addlParams || {},\n context: this.getCrudReqHttpContext('update'), // KLUDGE!: use 'update' request context\n });\n }\n\n return obs.pipe(\n showBusyWheelUntilComplete(busyWheelName),\n switchMap((resp) =>\n resp ? this.doRefreshAfterEdit(resp, 'update') : of(null),\n ),\n tap((entity) => {\n if (entity) {\n this.spEntitiesList()?.updateEntity(id, entity);\n }\n }),\n );\n }\n\n /**\n * Initialize the columns for the mat-entities-list component. This is\n * called when the <sp-mat-entities-list> component has been properly\n * initialized.\n */\n private _initEntitiesList() {\n const spEntitiesList = this.spEntitiesList();\n if (spEntitiesList) {\n // Build contentColumnDefs using our component's content. Then add our own\n // 'action' column definition to it. Then set this as the value of\n // child SPMatEntityListComponent.contentColumnDef. This way we force\n // SPMatEntityListComponent to use our component's any project MatColumnDef\n // content in the final mat-table.\n const clientColumnDefs = this.clientColumnDefs;\n let contentColumnDefs = new Array<MatColumnDef>();\n if (clientColumnDefs.length) {\n // Note that we process any content projected matColumnDef first and\n // our own internal content later. And when we process our own internal\n // columns (for now only 'action'), it's not added if a column with that\n // name has already been defined via content projection. This allows the\n // clients to override even internal columns with their column defintion.\n clientColumnDefs.toArray().forEach((c) => contentColumnDefs.push(c));\n }\n this.componentColumns().forEach((ic) => {\n if (!contentColumnDefs.find((c) => c.name === ic.name)) {\n contentColumnDefs.push(ic);\n }\n });\n spEntitiesList.contentColumnDefs = contentColumnDefs;\n // This is a replication of SPMatEntityCrudList.ngAfterViewInit. That\n // code is skipped as we declare <sp-mat-entity-list> with\n // deferViewInit=true.\n spEntitiesList.buildColumns();\n spEntitiesList.setupSort();\n spEntitiesList.loadMoreEntities();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2","i3","i6","i9","i10"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAGa,yBAAyB,GAAG,IAAI,cAAc,CAAwB,uBAAuB;;ACI1G;;;;;;;AAOG;AACG,SAAU,oCAAoC,CAClD,OAAoB,EACpB,UAA4B,EAAA;AAE5B,IAAA,IAAI,UAAU,YAAY,WAAW,EAAE;;QAErC,KAAK,MAAM,CAAC,IAAI,UAAU,CAAC,IAAI,EAAE,EAAE;AACjC,YAAA,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACnC;IACF;SAAO,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE;;AAE/F,QAAA,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAC3C;SAAO;QACL,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACnD;AACA,IAAA,OAAO,OAAO;AAChB;;AC8IO,MAAM,+BAA+B,GAC1C,IAAI,gBAAgB,CAA6B,OAAO;AACtD,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,EAAE,EAAE,SAAS;AACd,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiJT,EAAA,eAAA,EAkCgB,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,2XAAA,CAAA,EAAA;4iGA+Pf,YAAY,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,iBAAA,EAAA,CAAA;sBAC3C,eAAe;uBAAC,YAAY;;sBAM5B;;sBAWA;8DASqD,cAAc,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,uBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAiBhC,qBAAqB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,oBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MASxB,oBAAoB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACrkBvD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"smallpearl-ngx-helper-mat-entity-crud.mjs","sources":["../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/providers.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/convert-context-input-to-http-context.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/mat-entity-crud-types.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/mat-entity-crud-form-base.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/mat-entity-crud-internal-types.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/preview-pane.component.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/default-config.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/form-view-host.component.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/preview-host.component.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/src/mat-entity-crud.component.ts","../../../../projects/smallpearl/ngx-helper/mat-entity-crud/smallpearl-ngx-helper-mat-entity-crud.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { SPMatEntityCrudConfig } from './mat-entity-crud-types';\n\nexport const SP_MAT_ENTITY_CRUD_CONFIG = new InjectionToken<SPMatEntityCrudConfig>('SPMatEntityCrudConfig');\n","import { HttpContext, HttpContextToken } from '@angular/common/http';\n\nexport type HttpContextInput =\n | [[HttpContextToken<any>, any]]\n | [HttpContextToken<any>, any]\n | HttpContext;\n\n/**\n * Converts array of HttpContextToken key, value pairs to HttpContext\n * object in argument 'context'.\n * @param context HTTP context to which the key, value pairs are added\n * @param reqContext HttpContextToken key, value pairs array\n * @returns HttpContext object, with the key, value pairs added. This is\n * the same object as the 'context' argument.\n */\nexport function convertHttpContextInputToHttpContext(\n context: HttpContext,\n reqContext: HttpContextInput\n): HttpContext {\n if (reqContext instanceof HttpContext) {\n // reqContext is already an HttpContext object.\n for (const k of reqContext.keys()) {\n context.set(k, reqContext.get(k));\n }\n } else if (Array.isArray(reqContext) && 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 return context;\n}\n","import { HttpContextToken } from \"@angular/common/http\";\nimport { SPContextMenuItem } from \"@smallpearl/ngx-helper/mat-context-menu\";\nimport { Observable } from \"rxjs\";\n\n/**\n * Prototype of the function to parse the CRUD action response.\n */\nexport type SPMatEntityCrudResponseParser = (\n entityName: string,\n idKey: string,\n method: string, // 'create' | 'retrieve' | 'update' | 'delete',\n resp: any\n) => any|undefined;\n\n\n/**\n * Global config for SPMatEntityList component.\n */\nexport interface SPMatEntityCrudConfig {\n /**\n * The item actions that will be shown for each item in the list.\n * This defaults to 'Update' & 'Delete' actions, but can be customized\n * by this property. Note the item actions can be set for individual\n * <sp-mat-entity-crud> component through its itemActions property.\n */\n defaultItemActions?: SPContextMenuItem[];\n /**\n * Global crud response parser.\n */\n crudOpResponseParser?: SPMatEntityCrudResponseParser;\n}\n\n/**\n * This is the interface through which the client provided CRUD form component\n * interacts with the 'host' SPMatEntityCrudComponent. When the form wants to\n * submit an entity to the server (for create or update), it should call the\n * one of the create or update methods. The interface also provides other\n * methods for the form component to interact with SPMatEntityCrudComponent\n * such as refresh its entities list, close the form pane, etc.\n *\n * The interface name has a 'Bridge' as the interface acts as a bridge between\n * the client provided form handler component and the host\n * SPMatEntityCrudComponent.\n */\nexport interface SPMatEntityCrudCreateEditBridge {\n /**\n * Returns the entity name as provided to the host SPMatEntityCrudComponent.\n * @returns The entity name string.\n */\n getEntityName(): string;\n\n /**\n * Returns the entity id key as provided to the host SPMatEntityCrudComponent.\n * @returns The entity id key string.\n */\n getIdKey(): string;\n\n /**\n * Get Entity url\n * @param cancel\n * @returns\n */\n getEntityUrl(entityId: any): string;\n\n /**\n * Close the edit/update form pane. This WON'T call the 'cancelEditCallback'\n * even if one is registered.\n */\n close: (cancel: boolean) => void;\n /**\n * Client form view can register a callback that will be invoked by the\n * framework when user cancels the create/edit operation by clicking on the\n * close button on the top right.\n * @param callback\n * @returns None\n */\n registerCanCancelEditCallback: (callback: () => boolean) => void;\n // Parameters of type any are entity values are typically the output of\n // form.value and therefore their types would not necessarily match TEntity.\n // id can be typed as TEntity[Idkey], but TSC doesn't allow that yet.\n /**\n * Create a new instance of TEntity, by sending a POST request to remote.\n * @param entityValue This is the typically the output of Reactive form's\n * form.value. Since this value's shape may be different from TEntity and is\n * known only to client form, we use 'any'.\n * @returns None\n * @inner Implementation will show a busy wheel centered on the form\n * view while the async function to update the object remains active.\n */\n create: (entityValue: any) => Observable<any>;\n /**\n * Update the entity with id `id` with new values in entityValue.\n * @param id TEntity id\n * @param entityValue Entity values to be updated.\n * @returns None\n * @inner Implementation will show a busy wheel centered on the form\n * view while the async function to update the object remains active.\n */\n update: (id: any, entityValue: any) => Observable<any>;\n}\n\n/**\n * Prototype of the function that will be used instead of HttpClient for\n * CRUD operations.\n * @param op - the CRUD operation being requested\n * @param entityValue - The entity or entity value upon which the operation\n * is being requested. for 'create' & 'update' this will be the value\n * of the reactive form. This is typically form.value or the 2nd arg to create\n * & update methods of SPMatEntityCrudCreateEditBridge.\n */\nexport type CRUD_OP_FN<\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n> = (\n op: string,\n id: TEntity[IdKey] | undefined, // valid only for 'get', 'update' & 'delete'\n entityValue: any, // valid only for 'create' & 'update'\n entityCrudComponent: any,\n) => Observable<TEntity | null>;\n\n\nexport type ALLOW_ITEM_ACTION_FN<TEntity> = (entity: TEntity, action: string) => boolean;\n\n/**\n * This interface is used to define sub types for the \"New {{item}}\" button on\n * top of the CRUD UI. An array of these is provided as the value to the\n * component property 'newItemSubTypes'.\n */\nexport interface NewItemSubType {\n /**\n * A role string that will be passed as argument to the (action) event\n * handler. This string allows the event handler to distinguish the selected\n * sub-type.\n *\n * The special keyword '_new_' can be used to activate the\n * `createEditTemplate` template if one is provided. In this case the params\n * element value (see below) can be used in the template to distinguish\n * between different menu items.\n */\n role: string;\n /**\n * Label displayed in the menu representing this role.\n */\n label: string;\n /**\n * Arbitrary value that will be passed to the 'createEditTemplate' in the\n * $implicit template context as 'params'. You can access this in the\n * template like below (see `data.params`):-\n ```\n <ng-template #createEdit let-data>\n <app-create-edit-entity-demo\n [bridge]=\"data.bridge\"\n [entity]=\"data.entity\"\n [params]=\"data.params\"\n ></app-create-edit-entity-demo>\n </ng-template>\n ```\n\n If params is an object and it includes the key 'title', its value will be\n used as the title for the edit form.\n */\n params?: any;\n}\n\nexport type CrudOp = 'create'|'retrieve'|'update'|'delete'|undefined;\n\nexport interface SPMatEntityCrudHttpContext {\n entityName: string;\n entityNamePlural: string;\n endpoint: string;\n op: CrudOp;\n}\n\nexport const SP_MAT_ENTITY_CRUD_HTTP_CONTEXT =\n new HttpContextToken<SPMatEntityCrudHttpContext>(() => ({\n entityName: '',\n entityNamePlural: '',\n endpoint: '',\n op: undefined,\n }));\n","import { HttpClient, HttpContext, HttpParams } from '@angular/common/http';\nimport { ChangeDetectorRef, Component, computed, inject, input, OnDestroy, OnInit, signal } from '@angular/core';\nimport { AbstractControl, FormArray, FormGroup, UntypedFormGroup } from '@angular/forms';\nimport { TranslocoService } from '@jsverse/transloco';\nimport { setServerErrorsAsFormErrors } from '@smallpearl/ngx-helper/forms';\nimport { map, Observable, Subscription, tap } from 'rxjs';\n// import { getEntityCrudConfig } from './default-config';\nimport { sideloadToComposite } from '@smallpearl/ngx-helper/sideload';\nimport { convertHttpContextInputToHttpContext, HttpContextInput } from './convert-context-input-to-http-context';\nimport { SPMatEntityCrudCreateEditBridge } from './mat-entity-crud-types';\n\n/**\n * This is a convenience base class that clients can derive from to implement\n * their CRUD form component. Particularly this class registers the change\n * detection hook which will be called when the user attempts to close the\n * form's parent container pane via the Close button on the top right.\n *\n * This button behaves like a Cancel button in a desktop app and therefore if\n * the user has entered any data in the form's controls, (determined by\n * checking form.touched), then a 'Lose Changes' prompt is displayed allowing\n * the user to cancel the closure.\n *\n * The `@Component` decorator is fake to keep the VSCode angular linter quiet.\n *\n * This class can be used in two modes:\n *\n * I. SPMatEntityCrudComponent mode\n * This mode relies on a bridge interface that implements the\n * SPMatEntityCrudCreateEditBridge interface to perform the entity\n * load/create/update operations. This is the intended mode when the\n * component is used as a part of the SPMatEntityCrudComponent to\n * create/update an entity. This mode requires the following properties\n * to be set:\n * - entity: TEntity | TEntity[IdKey] | undefined (for create)\n * - bridge: SPMatEntityCrudCreateEditBridge\n *\n * II. Standalone mode\n * This mode does not rely on the bridge interface and the component\n * itself performs the entity load/create/update operations. However, if\n * the `bridge` input is set, then it will be used to close the create/edit\n * form pane when create/update is successful.\n *\n * This mode requires the following properties to be set:\n * - entity: TEntity | TEntity[IdKey] | undefined (for create)\n * - baseUrl: string - Base URL for CRUD operations. This URL does not\n * include the entity id. The entity id will be appended to this URL\n * for entity load and update operations. For create operation, this\n * URL is used as is.\n * - entityName: string - Name of the entity, used to parse sideloaded\n * entity responses.\n * - httpReqContext?: HttpContextInput - Optional HTTP context to be\n * passed to the HTTP requests. For instance, if your app has a HTTP\n * interceptor that adds authentication tokens to the requests based\n * on a HttpContextToken, then you can pass that token here.\n *\n * I. SPMatEntityCrudComponent mode:\n *\n * 1. Declare a FormGroup<> type as\n *\n * ```\n * type MyForm = FormGroup<{\n * name: FormControl<string>;\n * type: FormControl<string>;\n * notes: FormControl<string>;\n * }>;\n * ```\n *\n * 2. Derive your form's component class from this and implement the\n * createForm() method returing the FormGroup<> instance that matches\n * the FormGroup concrete type above.\n *\n * ```\n * class MyFormComponent extends SPMatEntityCrudFormBase<MyForm, MyEntity> {\n * constructor() {\n * super()\n * }\n * createForm() {\n * return new FormGroup([...])\n * }\n * }\n * ```\n *\n * 3. If your form's value requires manipulation before being sent to the\n * server, override `getFormValue()` method and do it there before returning\n * the modified values.\n *\n * 4. Wire up the form in the template as below\n *\n * ```html\n * @if (loadEntity$ | async) {\n * <form [formGroup]='form'.. (ngSubmit)=\"onSubmit()\">\n * <button type=\"submit\">Submit</button>\n * </form>\n * } @else {\n * <div>Loading...</div>\n * }\n * ```\n *\n * Here `loadEntity$` is an Observable<boolean> that upon emission of `true`\n * indicates that the entity has been loaded from server (in case of edit)\n * and the form is ready to be displayed. Note that if the full entity was\n * passed in the `entity` input property, then no server load is necessary\n * and the form will be created immediately.\n *\n * 5. In the parent component that hosts the SPMatEntityCrudComponent, set\n * the `entity` and `bridge` input properties of this component to\n * appropriate values. For instance, if your form component has the\n * selector `app-my-entity-form`, then the parent component's template\n * will have:\n *\n * ```html\n * <sp-mat-entity-crud\n * ...\n * createEditFormTemplate=\"entityFormTemplate\"\n * ></sp-mat-entity-crud>\n * <ng-template #entityFormTemplate let-data=\"data\">\n * <app-my-entity-form\n * [entity]=\"data.entity\"\n * [bridge]=\"data.bridge\"\n * ></app-my-entity-form>\n * </ng-template>\n * ```\n *\n * II. Standalone mode\n *\n * 1..4. Same as above, except set the required `bridge` input to `undefined`.\n * 5. Initialize the component's inputs `baseUrl` and `entityName` with the\n * appropriate values. If you would like to pass additional HTTP context to\n * the HTTP requests, then set the `httpReqContext` input as well.\n * If the entity uses an id key other than 'id', then set the `idKey` input\n * to the appropriate id key name.\n * 6. If you want to retrieve the created/updated entity after the create/update\n * operation, override the `onPostCreate()` and/or `onPostUpdate()` methods\n * respectively.\n */\n@Component({\n selector: '_#_sp-mat-entity-crud-form-base_#_',\n template: ``,\n standalone: false,\n})\nexport abstract class SPMatEntityCrudFormBase<\n TFormGroup extends AbstractControl,\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n> implements OnInit, OnDestroy\n{\n // bridge mode inputs\n entity = input<TEntity | TEntity[IdKey]>();\n bridge = input<SPMatEntityCrudCreateEditBridge | undefined>();\n params = input<any>();\n // END bridge mode inputs\n\n // standalone mode inputs\n // Entity name, which is used to parse sideloaded entity responses\n entityName = input<string>();\n // Base CRUD URL, which is the GET-list-of-entities/POST-to-create\n // URL. Update URL will be derived from this ias `baseUrl()/${TEntity[IdKey]}`\n baseUrl = input<string>();\n // Additional request context to be passed to the request\n httpReqContext = input<HttpContextInput | undefined>();\n // ID key, defaults to 'id'\n idKey = input<string>('id');\n // END standalone mode inputs\n\n // IMPLEMENTATION\n loadEntity$!: Observable<boolean>;\n // This will hold the raw response returned by load() method\n loadResponse = signal<any>(undefined);\n // This will hold the loaded entity after it's extracted from the\n // load response.\n _entity = signal<TEntity | undefined>(undefined);\n sub$ = new Subscription();\n\n // Store for internal form signal. form() is computed from this.\n _form = signal<TFormGroup | undefined>(undefined);\n // Force typecast to TFormGroup so that we can use it in the template\n // without having to use the non-nullable operator ! with every reference\n // of form(). In any case the form() signal is always set in ngOnInit()\n // method after the form is created. And if form() is not set, then there\n // will be errors while loading the form in the template.\n form = computed(() => this._form() as TFormGroup);\n\n transloco = inject(TranslocoService);\n cdr = inject(ChangeDetectorRef);\n http = inject(HttpClient);\n\n canCancelEdit = () => {\n return this._canCancelEdit();\n };\n\n _canCancelEdit() {\n const form = this._form();\n if (form && form.touched) {\n return window.confirm(\n this.transloco.translate('spMatEntityCrud.loseChangesConfirm')\n );\n }\n return true;\n }\n\n ngOnInit() {\n // Validate inputs. Either bridge or (baseUrl and entityName) must be\n // defined.\n if (!this.bridge() && (!this.getBaseUrl() || !this.getEntityName())) {\n throw new Error(\n 'SPMatEntityCrudFormBase: baseUrl and entityName inputs must be defined in standalone mode.'\n );\n }\n this.loadEntity$ = this.load(this.entity() as any)\n .pipe(\n map((entity) => {\n this._entity.set(entity);\n this._form.set(this.createForm(entity));\n const bridge = this.bridge();\n if (bridge && bridge.registerCanCancelEditCallback) {\n bridge.registerCanCancelEditCallback(this.canCancelEdit);\n }\n return true;\n })\n );\n }\n\n ngOnDestroy() {\n this.sub$.unsubscribe();\n }\n\n /**\n * Additional parameters for loading the entity, in case this.entity() value\n * is of type TEntity[IdKey].\n * @returns\n */\n getLoadEntityParams(): string | HttpParams {\n return '';\n }\n\n /**\n * Returns true if the entity needs to be loaded from server. The default\n * implementation returns true if the `entity` parameter is not an object,\n * indicating that it's of type 'TEntity[IdKey]' or is undefined. Derived\n * classes can override this method to provide custom logic.\n * @param entityOrId\n * @returns Whether the entity needs to be loaded from server.\n */\n loadEntityRequired(entityOrId: TEntity | TEntity[IdKey] | undefined) {\n return entityOrId && typeof entityOrId !== 'object';\n }\n\n /**\n * Return the TEntity object from the response returned by the\n * load() method. Typically entity load returns the actual\n * entity object itself. In some cases, where response is sideloaded, the\n * default implementation here uses the `sideloadToComposite()` utility to\n * extract the entity from the response after merging (inplace) the\n * sideloaded data into a composite.\n *\n * If you have a different response shape, or if your sideloaded object\n * response requires custom custom `sideloadDataMap`, override this method\n * and implement your custom logic to extract the TEntity object from the\n * response.\n * @param resp\n * @returns\n */\n getEntityFromLoadResponse(resp: any): TEntity | undefined {\n if (!resp || typeof resp !== 'object') {\n return undefined;\n }\n const entityName = this.getEntityName();\n if (resp.hasOwnProperty(this.getIdKey())) {\n return resp as TEntity;\n } else if (entityName && resp.hasOwnProperty(entityName)) {\n // const sideloadDataMap = this.sideloadDataMap();\n return sideloadToComposite(resp, entityName, this.getIdKey()) as TEntity;\n }\n return undefined;\n }\n\n /**\n * Create the TFormGroup FormGroup class that will be used for the reactive\n * form.\n * @param entity\n */\n abstract createForm(entity: TEntity | undefined): TFormGroup;\n\n /**\n * Override to customize the id key name if it's not 'id'\n * @returns The name of the unique identifier key that will be used to\n * extract the entity's id for UPDATE operation.\n */\n getIdKey() {\n const bridge = this.bridge();\n const idKey = this.idKey();\n return idKey ? idKey : bridge ? bridge.getIdKey() : 'id';\n }\n\n getBusyWheelName() {\n return '';\n }\n\n /**\n * Return the form's value to be sent to server as Create/Update CRUD\n * operation data.\n * @returns\n */\n getFormValue() {\n const form = this.form();\n return form ? form.value : undefined;\n }\n\n onSubmit() {\n const value = this.getFormValue();\n const obs = !this._entity()\n ? this.create(value)\n : this.update((this._entity() as any)[this.getIdKey()], value);\n this.sub$.add(\n obs\n ?.pipe(\n tap((entity) => {\n const bridge = this.bridge();\n if (bridge) {\n bridge.close(false);\n }\n this._entity()\n ? this.onPostUpdate(entity)\n : this.onPostCreate(entity);\n }),\n setServerErrorsAsFormErrors(\n this._form() as unknown as UntypedFormGroup,\n this.cdr\n )\n )\n .subscribe()\n );\n }\n\n /**\n * Reset the form to its initial state. This is a generic implementation\n * that recursively resets all FormGroup and FormArray controls.\n */\n onReset() {\n function resetForm(form: FormGroup) {\n form.reset();\n const controls = form.controls;\n for (const name in controls) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const control: AbstractControl = (controls as any)[name];\n if (control instanceof FormArray) {\n const formArray = control as FormArray;\n for (let i = 0; i < formArray.length; i++) {\n const formArrayElem = formArray.at(i) as FormGroup;\n resetForm(formArrayElem);\n }\n }\n }\n }\n resetForm(this.form() as unknown as FormGroup);\n }\n\n onPostCreate(entity: TEntity) {\n /* empty */\n }\n\n onPostUpdate(entity: TEntity) {\n /* empty */\n }\n\n /**\n * Loads the entity if `this.entity()` is of type TEntity[IdKey]. If `bridge`\n * input is defined, then it's `loadEntity()` method is used to load the\n * entity. Otherwise, then this method attempts to load the entity using\n * HTTP GET from the URL derived from `baseUrl` input.\n * @param entityOrId Can be full entity or just the entity id.\n * @returns\n */\n load(entityOrId: any): Observable<TEntity> {\n if (!entityOrId || !this.loadEntityRequired(entityOrId)) {\n return new Observable<TEntity>((subscriber) => {\n subscriber.next(entityOrId as TEntity);\n subscriber.complete();\n });\n }\n return this.loadEntity(\n typeof entityOrId === 'object' ? entityOrId[this.getIdKey()] : entityOrId\n );\n }\n\n /**\n * Loads the entity using HTTP GET from the URL derived from `baseUrl` input.\n */\n protected loadEntity(entityId: any): Observable<TEntity> {\n // Try to load using baseUrl.\n const url = this.getEntityUrl(entityId);\n const params = this.getLoadEntityParams();\n return this.http\n .get<TEntity>(this.getEntityUrl(entityId), {\n params:\n typeof params === 'string'\n ? new HttpParams({ fromString: params })\n : params,\n context: this.getRequestContext(),\n })\n .pipe(\n map((resp) => {\n this.loadResponse.set(resp);\n return this.getEntityFromLoadResponse(resp) as TEntity;\n })\n );\n }\n\n /**\n * Create a new entity using the bridge if defined, otherwise using HTTP\n * POST to the `baseUrl`.\n * @param values\n * @returns\n */\n protected create(values: any): Observable<TEntity> {\n const bridge = this.bridge();\n if (!this.getStandaloneMode()) {\n return bridge!.create(values);\n }\n return this.createEntity(values);\n }\n\n protected createEntity(values: any): Observable<TEntity> {\n return this.http\n .post<TEntity>(this.getBaseUrl()!, values, {\n context: this.getRequestContext(),\n })\n .pipe(map((resp) => this.getEntityFromLoadResponse(resp) as TEntity));\n }\n\n /**\n * Update an existing entity using the bridge if defined, otherwise using HTTP\n * PATCH to the URL derived from `baseUrl` and the entity id.\n * @param id\n * @param values\n * @returns\n */\n protected update(id: any, values: any): Observable<TEntity> {\n const bridge = this.bridge();\n if (!this.getStandaloneMode()) {\n return bridge!.update(id, values);\n }\n return this.updateEntity(id, values);\n }\n\n protected updateEntity(id: any, values: any): Observable<TEntity> {\n return this.http\n .patch<TEntity>(this.getEntityUrl(id), values, {\n context: this.getRequestContext(),\n })\n .pipe(map((resp) => this.getEntityFromLoadResponse(resp) as TEntity));\n }\n\n /**\n * Override to get the standalone mode indicator. Standalone mode is\n * when both `baseUrl` and `entityName` inputs are defined. This is indication\n * that the component should perform the CRUD operations itself instead\n * of relying on the `bridge` input.\n * @returns\n */\n protected getStandaloneMode(): boolean {\n return !this.bridge() && !!this.getBaseUrl() && !!this.getEntityName();\n }\n\n /**\n * Wrapper around entityName input to get the entity name. If `bridge` input\n * is defined, then its `getEntityName()` method is used. This allows\n * derived classes to override this method to provide custom logic to\n * determine the entity name.\n * @returns\n */\n protected getEntityName(): string | undefined {\n const entityName = this.entityName();\n if (entityName) {\n return entityName;\n }\n const bridge = this.bridge();\n return bridge ? bridge.getEntityName() : undefined;\n }\n\n /**\n * Returns the baseUrl. Derived classes can override this to provide custom\n * logic to determine the baseUrl.\n * @returns\n */\n protected getBaseUrl(): string | undefined {\n return this.baseUrl();\n }\n\n /**\n * Returns the entity URL for the given entity id. If `bridge` input is\n * defined, then its `getEntityUrl()` method is used. Otherwise, the URL is\n * derived from `baseUrl` input.\n * @param entityId\n * @returns\n */\n protected getEntityUrl(entityId: any): string {\n const bridge = this.bridge();\n if (!this.getStandaloneMode()) {\n return bridge!.getEntityUrl(entityId);\n }\n const baseUrl = this.getBaseUrl();\n if (baseUrl) {\n const urlParts = baseUrl.split('?');\n return `${urlParts[0]}${String(entityId)}/${\n urlParts[1] ? '?' + urlParts[1] : ''\n }`;\n }\n console.warn(\n 'SPMatEntityCrudFormBase.getEntityUrl: Cannot determine entity URL as neither baseUrl nor bridge inputs are provided.'\n );\n return '';\n }\n\n protected getRequestContext(): HttpContext {\n let context = new HttpContext();\n const httpReqContext = this.httpReqContext();\n if (httpReqContext) {\n context = convertHttpContextInputToHttpContext(context, httpReqContext);\n }\n return context;\n }\n}\n","import { HttpParams } from \"@angular/common/http\";\nimport { SPContextMenuItem } from \"@smallpearl/ngx-helper/mat-context-menu\";\nimport { Observable } from \"rxjs\";\n\nexport const ITEM_ACTION_UPDATE = '_update_';\nexport const ITEM_ACTION_DELETE = '_delete_';\n\n/**\n * SPMatEntityCrudCreateEditBridge implementer uses this interface to\n * communicate with the parent SPMatEntityCreateComponent. The bridge\n * component would use the hideCreateEdit() to close itself, when user cancels\n * the create/edit operation.\n */\nexport interface SPMatEntityCrudComponentBase<\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n> {\n /**\n * Wrappers around entityName & entityNamePlural properties.\n */\n getEntityName(): string;\n getEntityNamePlural(): string;\n /**\n * Wrapper around idKey property.\n */\n getIdKey(): string;\n /**\n * This method should return the entity URL for the given entity id.\n * The entity URL should include any additional query parameters that were\n * passed to the SPMatEntityCrudComponentBase component's `url` property.\n * @param id\n */\n getEntityUrl(id: TEntity[IdKey]|undefined): string;\n /**\n * FormViewHostComponent will call this to close the Create/Edit pane.\n * SPMatEntityCrudComponentBase implementor will destroy the client form\n * view and hide the Create/Edit form view pane and show the hidden\n * entity list view.\n * @returns\n */\n closeCreateEdit: (cancelled: boolean) => void;\n /**\n * Used internally by FormViewHostComponent to determine if the client form\n * view wants to intercept user's cancel the create/edit operation. Perhaps\n * with the Yes/No prompt 'Lose changes?'\n * @returns boolean indicating it's okay to cancel the create/edit operation.\n */\n canCancelEdit: () => boolean;\n /**\n * Client form view can register a callback that will be invoked by the\n * framework when user cancels the create/edit operation by clicking on the\n * close button on the top right.\n * @param callback\n * @returns\n */\n registerCanCancelEditCallback: (callback: () => boolean) => void;\n /**\n * Initiates update on the given entity.\n * @returns\n */\n triggerEntityUpdate: (entity: TEntity) => void;\n /**\n * Initiates entity delete.\n * @returns\n */\n triggerEntityDelete: (entity: TEntity) => void;\n /**\n * Called by client form-view host component to close a new entity.\n * @param entityValue The ReactiveForm.value object that the server expects\n * to create a new object.\n * @returns The new Entity object returned by the server. For typical REST\n * API, this would be of the same shape as the objects returned by the\n * REST's GET request.\n */\n create: (entityValue: any) => Observable<any>;\n /**\n * Called by client form-view host component to close a new entity.\n * @param id The id of the entity being edited.\n * @param entityValue The ReactiveForm.value object that the server expects\n * to update the new object.\n * @returns The new Entity object returned by the server. For typical REST\n * API, this would be of the same shape as the objects returned by the\n * REST's GET request.\n */\n update: (id: any, entityValue: any) => Observable<any>;\n /**\n * Close the preview pane.\n * @returns\n */\n closePreview: () => void;\n /**\n * Returns the context menu items for the entity. This can be used to build\n * the context menu for an entity in its preview pane toolbar.\n * @returns\n */\n getItemActions(entity?: TEntity): SPContextMenuItem[];\n /**\n * Returns the class to be used for the preview pane content. This interface\n * is provided to allow the PreviewPaneComponent to access the client\n * configured class for the preview pane content.\n */\n getPreviewPaneContentClass(): string;\n\n getFormPaneWrapperClass(): string;\n\n getFormPaneContentClass(): string;\n\n getItemLabel(): string | Observable<string>;\n\n getItemLabelPlural(): string | Observable<string>;\n /*\n * Remove the entity with the given id from the list of entities.\n * This is typically called by the client when it peforms the delete\n * operation itself without using the MatEntityCrud's delete operation.\n *\n * @param id The id of the entity to remove.\n * @returns None\n **/\n removeEntity(id: TEntity[IdKey]): void;\n /**\n * Update the entity with the given id in the list of entities.\n * This is typically called by the client when it has performed an update\n * on the entity itself and want to reflect the resulting changed\n * entity in the list view.\n *\n * @param id The id of the entity to update.\n * @param data The updated entity.\n */\n updateEntity(id: TEntity[IdKey], data: TEntity): void;\n /**\n * Perform a custom action on the entity endpoint. The action is specified\n * by the verb argument, which will be used to derive the final URL. This\n * is keeping in line with DRF specification where viewsets can define\n * custom action methods, which translate into endpoints with the same name\n * ast he action method.\n * @param id id of the entity to perform the action on.\n * @param verb The action verb, which will be appended to the entity URL to\n * derive the final URL for the POST request.\n * @param addlParams additional query parameters to include in the request.\n * Called `additional` as these are in addition to the query params specified\n * in the CRUD's endpoint.\n * @param data the data to send with the request for the POST\n * @returns Observable<TEntity>\n */\n doEntityAction(\n id: TEntity[IdKey],\n verb: string,\n addlParams: HttpParams,\n data: any,\n busyWheelName: string\n ): Observable<any>;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n InputSignal,\n OnDestroy,\n OnInit,\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatToolbarModule } from '@angular/material/toolbar';\nimport { SPContextMenuItem } from '@smallpearl/ngx-helper/mat-context-menu';\nimport {\n ITEM_ACTION_DELETE,\n ITEM_ACTION_UPDATE,\n SPMatEntityCrudComponentBase,\n} from './mat-entity-crud-internal-types';\n\n/**\n * A preview pane container to provide a consistent UX for all preview panes.\n * It consits of a toolbar on the top and a container div below that takes up\n * the rest of the preview pane area.\n */\n@Component({\n imports: [MatToolbarModule, MatButtonModule, MatIconModule],\n selector: 'sp-mat-entity-crud-preview-pane',\n template: `\n <div class=\"preview-wrapper\">\n <mat-toolbar>\n <mat-toolbar-row>\n @if (title()) {\n <h2>{{ title() }}</h2>\n } @if (!hideUpdate()) {\n <button\n mat-icon-button\n aria-label=\"Edit\"\n (click)=\"onEdit()\"\n [disabled]=\"_disableUpdate()\"\n >\n <mat-icon>edit</mat-icon>\n </button>\n } @if (!hideDelete()) {\n <button\n mat-icon-button\n aria-label=\"Delete\"\n (click)=\"onDelete()\"\n [disabled]=\"_disableDelete()\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n }\n <ng-content select=\"[previewToolbarContent]\"></ng-content>\n <span class=\"spacer\"></span>\n <button mat-icon-button aria-label=\"Close\" (click)=\"onClose()\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-toolbar-row>\n </mat-toolbar>\n <div\n [class]=\"\n 'preview-content ' +\n entityCrudComponent().getPreviewPaneContentClass()\n \"\n >\n <ng-content select=\"[previewContent]\"></ng-content>\n </div>\n </div>\n `,\n styles: [\n `\n .preview-wrapper {\n display: flex;\n flex-direction: column;\n height: 100% !important;\n width: 100% !important;\n }\n mat-toolbar {\n background-color: var(--mat-sys-surface-variant);\n }\n .spacer {\n flex: 1 1 auto;\n }\n .preview-content {\n padding: 0.4em;\n flex-grow: 1;\n overflow: scroll;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SPMatEntityCrudPreviewPaneComponent<TEntity extends { [P in IdKey]: PropertyKey }, IdKey extends string = 'id'>\n implements OnInit, OnDestroy\n{\n entity = input.required<TEntity>();\n entityCrudComponent = input.required<SPMatEntityCrudComponentBase<TEntity, IdKey>>();\n title = input<string>();\n disableUpdate = input<boolean>(false);\n hideUpdate = input<boolean>(false);\n disableDelete = input<boolean>(false);\n hideDelete = input<boolean>(false);\n itemActions!: SPContextMenuItem[];\n\n _disableActionFactory = (role: string, signal?: InputSignal<boolean>) => {\n return computed(() => {\n if (signal && signal()) {\n return true;\n }\n const actionFn = this.itemActions.find((a) => a.role === role)?.disable;\n if (actionFn && actionFn(this.entity())) {\n return true;\n }\n return false;\n });\n };\n _disableUpdate = this._disableActionFactory(\n ITEM_ACTION_UPDATE,\n this.disableUpdate\n );\n _disableDelete = this._disableActionFactory(\n ITEM_ACTION_DELETE,\n this.disableDelete\n );\n\n ngOnInit() {\n this.itemActions = this.entityCrudComponent().getItemActions();\n }\n\n ngOnDestroy(): void {}\n\n onEdit() {\n this.entityCrudComponent().triggerEntityUpdate(this.entity());\n }\n\n onDelete() {\n this.entityCrudComponent().triggerEntityDelete(this.entity());\n }\n\n onClose() {\n this.entityCrudComponent().closePreview();\n }\n}\n","import { inject } from \"@angular/core\";\nimport { SPMatEntityCrudConfig } from \"./mat-entity-crud-types\";\nimport { SP_MAT_ENTITY_CRUD_CONFIG } from \"./providers\";\n\nfunction defaultCrudResponseParser(\n entityName: string,\n idKey: string,\n method: string, // 'create' | 'retrieve' | 'update' | 'delete',\n resp: any\n) {\n // If the response is an object with a property '<idKey>', return it as\n // TEntity.\n if (resp.hasOwnProperty(idKey)) {\n return resp;\n }\n // If the response has an object indexed at '<entityName>' and it has\n // the property '<idKey>', return it as TEntity.\n if (resp.hasOwnProperty(entityName)) {\n const obj = resp[entityName];\n if (obj.hasOwnProperty(idKey)) {\n return obj;\n }\n }\n // Return undefined, indicating that we could't parse the response.\n return undefined;\n}\n\nexport const DefaultSPMatEntityCrudConfig: SPMatEntityCrudConfig = {\n crudOpResponseParser: defaultCrudResponseParser\n};\n\n/**\n * To be called from an object constructor as it internally calls Angular's\n * inject() API.\n * @param userConfig\n * @returns\n */\nexport function getEntityCrudConfig(): SPMatEntityCrudConfig {\n const userCrudConfig = inject(SP_MAT_ENTITY_CRUD_CONFIG, {\n optional: true,\n });\n return {\n ...DefaultSPMatEntityCrudConfig,\n ...(userCrudConfig ?? {}),\n };\n}\n","import { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n EmbeddedViewRef,\n inject,\n input,\n OnDestroy,\n OnInit,\n signal,\n TemplateRef,\n viewChild,\n ViewContainerRef\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { TranslocoModule, TranslocoService } from '@jsverse/transloco';\nimport { SPMatHostBusyWheelDirective } from '@smallpearl/ngx-helper/mat-busy-wheel';\nimport { Observable, of, Subscription, tap } from 'rxjs';\nimport { getEntityCrudConfig } from './default-config';\nimport { SPMatEntityCrudComponentBase } from './mat-entity-crud-internal-types';\nimport { SPMatEntityCrudConfig, SPMatEntityCrudCreateEditBridge } from './mat-entity-crud-types';\n\n@Component({\n imports: [\n CommonModule,\n MatButtonModule,\n MatIconModule,\n TranslocoModule,\n SPMatHostBusyWheelDirective,\n ],\n selector: 'sp-create-edit-entity-host',\n template: `\n <div\n [class]=\"\n 'sp-mat-crud-form-wrapper ' +\n entityCrudComponentBase().getFormPaneWrapperClass()\n \"\n spHostBusyWheel=\"formBusyWheel\"\n *transloco=\"let t\"\n >\n <div\n [class]=\"\n 'sp-mat-crud-form-content ' +\n entityCrudComponentBase().getFormPaneContentClass()\n \"\n >\n <div class=\"create-edit-topbar\">\n <div class=\"title\">\n @if (title()) {\n {{ title() | async }}\n } @else {\n {{\n t('spMatEntityCrud.' + (entity() ? 'editItem' : 'newItem'), {\n item: (this._itemLabel() | async)\n })\n }}\n }\n </div>\n <div class=\"spacer\"></div>\n <div class=\"close\">\n <button mat-icon-button (click)=\"onClose()\">\n <mat-icon>cancel</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"form-container\">\n <ng-container #clientFormContainer></ng-container>\n </div>\n </div>\n </div>\n `,\n styles: `\n .sp-mat-crud-form-wrapper {\n width: 100% !important;\n height: 100% !important;\n }\n .sp-mat-crud-form-content {\n height: 100%;\n width: 100%;\n display: flex;\n flex-direction: column;\n padding: 0.4em;\n }\n .create-edit-topbar {\n display: flex;\n flex-direction: row;\n align-items: center;\n min-height: 48px;\n padding: 0.4em;\n }\n .form-container {\n padding-top: 0.4em;\n flex-grow: 1;\n overflow: auto;\n }\n .create-edit-topbar .title {\n font-size: 1.5em;\n font-weight: 500;\n }\n .create-edit-topbar .spacer {\n flex-grow: 1;\n }\n .create-edit-topbar .close {\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormViewHostComponent<\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id'\n> implements SPMatEntityCrudCreateEditBridge, OnInit, OnDestroy\n{\n entityCrudComponentBase =\n input.required<SPMatEntityCrudComponentBase<TEntity, IdKey>>();\n clientViewTemplate = input<TemplateRef<any> | null>(null);\n\n _itemLabel = computed<Observable<string>>(() => {\n const label = this.entityCrudComponentBase().getItemLabel();\n return label instanceof Observable ? label : of(label);\n });\n _itemLabelPlural = computed<Observable<string>>(() => {\n const label = this.entityCrudComponentBase().getItemLabelPlural();\n return label instanceof Observable ? label : of(label);\n });\n\n entity = signal<TEntity | undefined>(undefined);\n title = signal<Observable<string> | undefined>(undefined);\n params = signal<any>(undefined);\n clientFormView!: EmbeddedViewRef<any> | null;\n vc = viewChild('clientFormContainer', { read: ViewContainerRef });\n config!: SPMatEntityCrudConfig;\n sub$ = new Subscription();\n transloco = inject(TranslocoService);\n\n constructor() {\n this.config = getEntityCrudConfig();\n }\n // loadEntity: (id: any, params: string | HttpParams) => Observable<any>;\n\n ngOnInit() {}\n\n ngOnDestroy(): void {\n this.sub$.unsubscribe();\n }\n\n show(entity: TEntity | undefined, params?: any) {\n this.entity.set(entity);\n if (params && params?.title) {\n this.title.set(\n params.title instanceof Observable ? params.title : of(params.title)\n );\n } else {\n // this.title.set(entity ? this.config.i18n.editItemLabel(this.itemLabel()) : this.config.i18n.newItemLabel(this.itemLabel()));\n // this.title.set(\n // this.transloco.translate(entity ? 'editItem' : 'newItem', {\n // item: this.itemLabel(),\n // })\n // );\n }\n this.params.set(params);\n this.createClientView();\n }\n\n // BEGIN SPMatEntityCrudCreateEditBridge METHODS //\n getEntityName(): string {\n return this.entityCrudComponentBase().getEntityName();\n }\n\n getIdKey(): string {\n return this.entityCrudComponentBase().getIdKey();\n }\n\n getEntityUrl(entityId: any): string {\n return this.entityCrudComponentBase().getEntityUrl(entityId);\n }\n\n close(cancel: boolean) {\n this.entityCrudComponentBase().closeCreateEdit(cancel);\n // destroy the client's form component\n this.destroyClientView();\n }\n\n registerCanCancelEditCallback(callback: () => boolean) {\n this.entityCrudComponentBase().registerCanCancelEditCallback(callback);\n }\n\n create(entityValue: any) {\n // console.log(\n // `SPCreateEditEntityHostComponent.create - entity: ${JSON.stringify(\n // entityValue\n // )}`\n // );\n const crudComponent = this.entityCrudComponentBase();\n return crudComponent\n ?.create(entityValue)\n .pipe(tap(() => this.close(false)));\n }\n\n update(id: any, entityValue: any) {\n // console.log(\n // `SPCreateEditEntityHostComponent.update - id: ${String(\n // id\n // )}, entity: ${entityValue}`\n // );\n const crudComponent = this.entityCrudComponentBase();\n return crudComponent\n ?.update(id, entityValue)\n .pipe(tap(() => this.close(false)));\n }\n // END SPMatEntityCrudCreateEditBridge METHODS //\n\n /**\n * Creates the client view provided via template\n */\n createClientView() {\n /** Render preview component if one was provided */\n const ft = this.clientViewTemplate();\n const vc = this.vc();\n if (ft && vc) {\n this.clientFormView = vc.createEmbeddedView(ft, {\n $implicit: {\n bridge: this,\n entity: this.entity(),\n params: this.params(),\n },\n });\n this.clientFormView.detectChanges();\n }\n }\n\n destroyClientView() {\n if (this.clientFormView) {\n this.clientFormView.destroy();\n this.clientFormView = null;\n }\n }\n\n onClose() {\n // Can we give the client form component a chance to intercept this\n // and cancel the closure?\n if (this.entityCrudComponentBase().canCancelEdit()) {\n this.entityCrudComponentBase().closeCreateEdit(true);\n this.destroyClientView();\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EmbeddedViewRef,\n input,\n OnDestroy,\n OnInit,\n signal,\n TemplateRef,\n viewChild,\n ViewContainerRef\n} from '@angular/core';\nimport { SPMatEntityCrudComponentBase } from './mat-entity-crud-internal-types';\n\n@Component({\n imports: [],\n selector: 'sp-entity-crud-preview-host',\n template: ` <ng-container #previewComponent></ng-container> `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class PreviewHostComponent<TEntity extends { [P in IdKey]: PropertyKey }, IdKey extends string = 'id'> implements OnInit, OnDestroy {\n vc = viewChild('previewComponent', { read: ViewContainerRef });\n\n entityCrudComponentBase = input.required<SPMatEntityCrudComponentBase<TEntity, IdKey>>();\n clientViewTemplate = input<TemplateRef<any> | null>(null);\n entity = signal<TEntity|undefined>(undefined);\n clientView!: EmbeddedViewRef<any> | null;\n\n constructor() {\n // effect(() => {\n // const tmpl = this.clientViewTemplate();\n // this.createClientView(tmpl);\n // });\n }\n\n ngOnInit(): void {}\n\n ngOnDestroy(): void {}\n\n show(entity: TEntity|undefined, params?: any) {\n this.entity.set(entity);\n // if (params && params?.title) {\n // this.title.set(params.title);\n // } else {\n // this.title.set(entity ? this.config.i18n.editItemLabel(this.itemLabel()) : this.config.i18n.newItemLabel(this.itemLabel()));\n // }\n // this.params.set(params);\n this.createClientView();\n }\n\n close() {\n // this.entityCrudComponentBase().closeCreateEdit(cancel);\n // destroy the client's form component\n this.destroyClientView();\n }\n\n private createClientView() {\n if (this.clientView) {\n // We have only one view in the ng-container. So we might as well\n // call clear() to remove all views contained in it.\n this.vc()!.clear();\n this.clientView.destroy();\n }\n /** Render preview component if one was provided */\n const ft = this.clientViewTemplate();\n const vc = this.vc();\n if (ft && vc) {\n this.clientView = this.vc()!.createEmbeddedView(\n ft,\n {\n $implicit: {\n entity: this.entity(),\n entityCrudComponent: this.entityCrudComponentBase(),\n },\n }\n );\n this.clientView.detectChanges();\n }\n }\n\n\n destroyClientView() {\n if (this.clientView) {\n this.clientView.destroy();\n this.clientView = null;\n }\n }\n\n // close() {\n // this.closePreview.emit();\n // }\n}\n","import { CommonModule } from '@angular/common';\nimport {\n HttpClient,\n HttpContext,\n HttpContextToken,\n HttpParams,\n} from '@angular/common/http';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n ContentChildren,\n effect,\n EventEmitter,\n inject,\n Injector,\n input,\n Output,\n QueryList,\n signal,\n TemplateRef,\n viewChild,\n viewChildren,\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatMenuModule } from '@angular/material/menu';\nimport { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';\nimport { MatSortModule } from '@angular/material/sort';\nimport { MatColumnDef, MatTableModule } from '@angular/material/table';\nimport { DomSanitizer } from '@angular/platform-browser';\nimport { RouterModule } from '@angular/router';\nimport {\n provideTranslocoScope,\n TranslocoModule,\n TranslocoService,\n} from '@jsverse/transloco';\nimport {\n showBusyWheelUntilComplete,\n SPMatHostBusyWheelDirective,\n} from '@smallpearl/ngx-helper/mat-busy-wheel';\nimport { SPMatContextMenuComponent } from '@smallpearl/ngx-helper/mat-context-menu';\nimport { SPMatEntityListComponent } from '@smallpearl/ngx-helper/mat-entity-list';\nimport { AngularSplitModule } from 'angular-split';\nimport { clone, startCase } from 'lodash-es';\nimport { plural } from 'pluralize';\nimport {\n catchError,\n EMPTY,\n firstValueFrom,\n map,\n Observable,\n of,\n Subscription,\n switchMap,\n tap,\n throwError,\n} from 'rxjs';\nimport { convertHttpContextInputToHttpContext } from './convert-context-input-to-http-context';\nimport { getEntityCrudConfig } from './default-config';\nimport { FormViewHostComponent } from './form-view-host.component';\nimport { SPMatEntityCrudComponentBase } from './mat-entity-crud-internal-types';\nimport { MatEntityCrudItemAction } from './mat-entity-crud-item-action';\nimport {\n ALLOW_ITEM_ACTION_FN,\n CRUD_OP_FN,\n CrudOp,\n NewItemSubType,\n SP_MAT_ENTITY_CRUD_HTTP_CONTEXT,\n SPMatEntityCrudConfig,\n SPMatEntityCrudResponseParser,\n} from './mat-entity-crud-types';\nimport { PreviewHostComponent } from './preview-host.component';\n\n@Component({\n imports: [\n CommonModule,\n RouterModule,\n MatButtonModule,\n MatTableModule,\n MatSortModule,\n MatMenuModule,\n MatSnackBarModule,\n MatIconModule,\n TranslocoModule,\n AngularSplitModule,\n SPMatEntityListComponent,\n SPMatContextMenuComponent,\n FormViewHostComponent,\n SPMatHostBusyWheelDirective,\n PreviewHostComponent,\n ],\n providers: [provideTranslocoScope('sp-mat-entity-crud')],\n selector: 'sp-mat-entity-crud',\n template: `\n <as-split direction=\"horizontal\" [gutterSize]=\"6\" *transloco=\"let t\">\n <as-split-area\n [size]=\"entitiesPaneWidth()\"\n [visible]=\"!entitiesPaneHidden()\"\n >\n <div [class]=\"listPaneWrapperClass()\">\n <ng-content select=\"[breadCrumbs]\"></ng-content>\n\n <ng-template #defaultActionButtons>\n <div class=\"action-bar-actions\">\n @if (!disableCreate()) {\n @if (newItemSubTypes()) {\n <!-- New {{item}} displays a dropdown menu from which the subtype can be selected -->\n <button\n type=\"button\"\n mat-raised-button\n color=\"primary\"\n [matMenuTriggerFor]=\"newSubTypesMenu\"\n >\n {{\n newItemLabel() ??\n t('spMatEntityCrud.newItem', {\n item: _itemLabel() | async,\n })\n }}\n <mat-icon>expand_circle_down</mat-icon>\n </button>\n <mat-menu #newSubTypesMenu=\"matMenu\">\n @for (subtype of newItemSubTypes(); track $index) {\n @if (subtype.role) {\n <button\n mat-menu-item\n (click)=\"handleNewItemSubType(subtype)\"\n >\n {{ subtype.label }}\n </button>\n } @else {\n <div style=\"padding: .2em 0.5em;\">\n <strong>{{ subtype.label }}</strong>\n </div>\n }\n }\n </mat-menu>\n } @else {\n <button\n mat-raised-button\n color=\"primary\"\n (click)=\"onCreate($event)\"\n [routerLink]=\"newItemLink()\"\n >\n {{\n newItemLabel() ??\n t('spMatEntityCrud.newItem', {\n item: _itemLabel() | async,\n })\n }}\n <mat-icon>add_circle</mat-icon>\n </button>\n }\n }\n </div>\n </ng-template>\n\n <ng-template #defaultHeaderTemplate>\n <div class=\"action-bar\">\n <div class=\"action-bar-title\">\n {{ _title() | async }}\n </div>\n <span class=\"spacer\"></span>\n <!-- Hide the action buttons when Preview/Edit pane is active -->\n @if (!entityPaneActive()) {\n <ng-container\n [ngTemplateOutlet]=\"actionsTemplate() || defaultActionButtons\"\n ></ng-container>\n }\n </div>\n </ng-template>\n <ng-container\n [ngTemplateOutlet]=\"headerTemplate() || defaultHeaderTemplate\"\n ></ng-container>\n <sp-mat-entity-list\n #entitiesList\n [entityName]=\"entityName()\"\n [entityNamePlural]=\"entityNamePlural()\"\n [deferViewInit]=\"true\"\n [endpoint]=\"endpoint()\"\n [entityLoaderFn]=\"entityLoaderFn()\"\n [columns]=\"columnsWithAction()\"\n [displayedColumns]=\"visibleColumns()\"\n [idKey]=\"idKey()\"\n [pagination]=\"pagination()\"\n [paginator]=\"paginator()\"\n [pageSize]=\"pageSize()\"\n [sorter]=\"sorter()\"\n [disableSort]=\"disableSort()\"\n (selectEntity)=\"handleSelectEntity($event)\"\n [httpReqContext]=\"httpReqContext()\"\n >\n </sp-mat-entity-list>\n </div>\n\n <!--\n We'll be initializing the contentColumnDefs separately and not\n relying on <sp-mat-entity-list>'s internal @ContentChildre() querylist\n for building this. So we define this independenly and not as\n <sp-mat-entity-list> content.\n -->\n <ng-container matColumnDef=\"action\">\n <th mat-header-cell *matHeaderCellDef></th>\n <td mat-cell *matCellDef=\"let element\">\n <!-- <button\n mat-icon-button\n hoverDropDown\n >\n <mat-icon>more_vert</mat-icon>\n </button> -->\n <sp-mat-context-menu\n [menuItems]=\"_itemActions\"\n (selected)=\"onItemAction($event, element)\"\n [contextData]=\"element\"\n [hasBackdrop]=\"true\"\n ></sp-mat-context-menu>\n </td>\n </ng-container>\n </as-split-area>\n <as-split-area [size]=\"entityPaneWidth()\" [visible]=\"entityPaneActive()\">\n <div\n [class]=\"'entity-pane-wrapper ' + previewPaneWrapperClass()\"\n spHostBusyWheel=\"formBusyWheel\"\n >\n <sp-entity-crud-preview-host\n [ngClass]=\"createEditViewActive() ? 'sp-hidden' : 'sp-visible'\"\n [entityCrudComponentBase]=\"this\"\n [clientViewTemplate]=\"previewTemplate()!\"\n ></sp-entity-crud-preview-host>\n <!-- Create/Edit Entity -->\n <sp-create-edit-entity-host\n [ngClass]=\"createEditViewActive() ? 'sp-visible' : 'sp-hidden'\"\n [entityCrudComponentBase]=\"this\"\n [clientViewTemplate]=\"createEditFormTemplate()\"\n ></sp-create-edit-entity-host>\n </div>\n </as-split-area>\n </as-split>\n `,\n styles: `\n .sp-hidden {\n display: none;\n }\n .sp-visible {\n display: inherit;\n height: 100% !important;\n width: 100% !important;\n }\n .entity-pane-wrapper {\n height: 100% !important;\n width: 100% !important;\n }\n .action-bar {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding-bottom: 0.5em;\n }\n .action-bar-title {\n font-size: 1.5em;\n font-weight: 600;\n }\n .spacer {\n flex-grow: 1;\n }\n .action-bar-actions {\n text-align: end;\n }\n .active-row {\n font-weight: bold;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SPMatEntityCrudComponent<\n TEntity extends { [P in IdKey]: PropertyKey },\n IdKey extends string = 'id',\n>\n extends SPMatEntityListComponent<TEntity, IdKey>\n implements SPMatEntityCrudComponentBase<TEntity, IdKey>\n{\n // entityName = input.required<string>();\n // entityNamePlural = input<string>();\n\n itemLabel = input<string | Observable<string>>();\n itemLabelPlural = input<string | Observable<string>>();\n\n /**\n * Title string displayed above the component. If not specified, will use\n * itemLabelPlural() as the title.\n */\n title = input<string | Observable<string>>();\n /**\n *\n */\n itemActions = input<MatEntityCrudItemAction<TEntity, IdKey>[]>([]);\n /**\n * Specify the list of router paths that will be set as the value for\n * [routerLink] for the 'New {{ item }}' button. If not specified,\n * if createEditTemplate is specified, it will be shown. If not, `action`\n * out event will be raised with `{ role: '_new_' }`.\n */\n newItemLink = input<string | string[]>();\n /**\n * If not specified, will default to 'New <itemLabel()>'.\n */\n newItemLabel = input<string | string[]>();\n /**\n * Text for the Edit <item> pane title\n */\n editItemTitle = input<string>();\n /**\n * If you want \"New {{item}}\" button to support multiple entity types,\n * you can set this to `NewItemSubType[]`, where each element stands for for\n * a dropdown menu item. Refer to `NewItemSubType` for details on this\n * interface.\n */\n newItemSubTypes = input<NewItemSubType[]>();\n /**\n * If you want to take control of the network operations for the CRUD\n * operations (GET/CREATE/UPDATE/DELETE), provide a value for this property.\n */\n crudOpFn = input<CRUD_OP_FN<TEntity, IdKey>>();\n /**\n * Item preview template.\n */\n previewTemplate = input<TemplateRef<any>>();\n /**\n * Whether to allow a context menu action or not. Return false to disable\n * the action.\n */\n allowEntityActionFn = input<ALLOW_ITEM_ACTION_FN<TEntity>>();\n /**\n * A template that allows the header to be replaced. Usage:-\n *\n * ```\n * <sp-map-entity-crud\n * [headerTemplate]=\"myCrudViewHeader\"\n * ></sp-map-entity-crud>\n * <ng-template #myCrudViewHeader>...</ng-template>\n * ```\n */\n headerTemplate = input<TemplateRef<any>>();\n /**\n * Set this to the custom template identifier that will replace the\n * \"New {{Item}}\" button portion. This template will expand towards the\n * title which will be placed to its left (right in rtl).\n *\n * ```\n * <sp-map-entity-crud\n * [actionsTemplate]=\"myCrudActions\"\n * ></sp-map-entity-crud>\n * <ng-template #myCrudActions>...</ng-template>\n * ```\n */\n actionsTemplate = input<TemplateRef<any>>();\n\n /**\n * CRUD action response parser. This will be called with the response\n * from CREATE & UPDATE operations to parse the response JSON and return\n * the created/updated TEntity.\n */\n crudResponseParser = input<SPMatEntityCrudResponseParser>();\n /**\n * An ng-template name that contains the component which provides the\n * create/edit CRUD action.\n *\n * ```\n * <ng-template #createEdit let-data>\n * <app-create-edit-entity-demo [bridge]=\"data.bridge\" [entity]=\"data.entity\"></app-create-edit-entity-demo>\n * </ng-template>\n * ```\n * Note how [bridge] & [entity] properties are set deriving them from the\n * implicit template context. [entity] will be undefined for Create\n * opreation and will be the valid entity for an Update.\n * (app-create-edit-entity-demo here is the client code that implements the\n * Create/Edit form)\n */\n createEditFormTemplate = input<TemplateRef<any> | null>(null);\n /**\n * Disables the per item actions column, preventing 'Edit' & 'Delete'\n * (and other user defined) item operations.\n */\n disableItemActions = input<boolean>(false);\n /**\n * Disables the Create function.\n */\n disableCreate = input<boolean>(false);\n /**\n * View refresh policy after a CREATE/UPDATE operation. Values\n * 'none' - Objects are not refreshed after an edit operation. The return\n * value of the edit operation is used as the object to\n * add/update the component's internal store. This is the default.\n * 'object' - Refresh just the object that was returned from the\n * CREATE/UPDATE operation. Use this if the JSON object returned\n * after a successful CREATE/UPDATE op differs from the JSON\n * object returned for the GET request.\n * 'all' - Refresh the entire list after a CREATE/UPDATE operation. This\n * mimics the behaviour of legacy HTML apps with pure server\n * defined UI.\n */\n refreshAfterEdit = input<'none' | 'object' | 'all'>('none');\n /**\n * HttpContext for crud requests - `create`, `retrieve`, `update` & `delete`.\n * Note that HttpContext for `list` operation should be set using the\n * `httpReqContext` property inherited from SPMatEntityListComponent.\n * The value of the property is an object where the key names reflect the CRUD\n * operation with each of these keys expected to have a value of type\n * `[[HttpContextToken<any>, any]] | [HttpContextToken<any>, any] | HttpContext`.\n *\n * Alternatively the property value can be set to\n * `[[HttpContextToken<any>, any]] | [HttpContextToken<any>, any] | HttpContext`,\n * in which case the same context would be used for all HTTP requests.\n */\n crudHttpReqContext = input<\n | [[HttpContextToken<any>, any]]\n | [HttpContextToken<any>, any]\n | {\n create?: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]; // CREATE\n retrieve?:\n | [[HttpContextToken<any>, any]]\n | [HttpContextToken<any>, any]; // RETRIEVE\n update?: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]; // UPDATE\n delete?: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any]; // DELETE\n }\n >();\n /**\n * Width of the edit pane as a percentange of the overall <as-split> width.\n */\n editPaneWidth = input<number>(100);\n /**\n * Width of the preview pane as a percentange of the overall <as-split> width.\n */\n previewPaneWidth = input<number>(50);\n\n /**\n * The class class that will be applied to the list pane wrapper.\n */\n listPaneWrapperClass = input<string>('sp-mat-crud-list-pane-wrapper-class');\n\n /**\n * The class class that will be applied to the preview pane wrapper.\n * Inside this wrapper, another div element with class='previewPaneContentClass()'\n * will be created to host the preview content. The client supplied preview\n * template will be rendered inside this div.\n *\n * +----------------------------------------+\n * | previewPaneWrapperClass |\n * |----------------------------------------|\n * | preview toolbar |\n * |----------------------------------------|\n * | +------------------------------------+ |\n * | | div class=previewPaneContentClass()| |\n * | |------------------------------------| |\n * | | client supplied preview template | |\n * | +------------------------------------+ |\n * +----------------------------------------+\n */\n previewPaneWrapperClass = input<string>(\n 'sp-mat-crud-entity-pane-wrapper-class',\n );\n\n /**\n * The class class that will be applied to the preview pane content.\n */\n previewPaneContentClass = input<string>(\n 'sp-mat-crud-preview-pane-content-class',\n );\n\n /**\n * The class class that will be applied to the form pane wrapper. Inside this\n * wrapper, another div element with class='formPaneContentClass()' will be\n * created to host the form content. The client supplied form template will\n * be rendered inside this div.\n *\n * +----------------------------------------+\n * | formPaneWrapperClass |\n * | +------------------------------------+ |\n * | | div class=formPaneContentClass() | |\n * | |------------------------------------| |\n * | | form title + close button | |\n * | |------------------------------------| |\n * | | client supplied form template | |\n * | +------------------------------------+ |\n * +----------------------------------------+\n */\n formPaneWrapperClass = input<string>('sp-mat-crud-form-pane-wrapper-class');\n\n /**\n * The CSS class that will be applied to the form pane content.\n */\n formPaneContentClass = input<string>('sp-mat-crud-form-pane-content-class');\n\n // INTERNAL PROPERTIES //\n // Derive a label from a camelCase source string. If the camelCase string\n // can be translated, it returns the translated string. If not, the function\n // converts the camelCase to 'Title Case' and returns it.\n private getLabel = (source: string) => {\n const label = this.transloco.translate(source);\n if (label.localeCompare(source) !== 0) {\n // Successful translation, return it\n return label;\n }\n return startCase(source);\n };\n\n _itemLabel = computed<Observable<string>>(() => {\n const itemLabel = this.itemLabel();\n const label = itemLabel ? itemLabel : this.getLabel(this.entityName());\n return label instanceof Observable ? label : of(label);\n });\n _itemLabelPlural = computed<Observable<string>>(() => {\n const itemLabelPlural = this.itemLabelPlural();\n const label = itemLabelPlural\n ? itemLabelPlural\n : this.getLabel(plural(this.entityName()));\n return label instanceof Observable ? label : of(label);\n });\n\n // Computed title\n _title = computed(() => {\n const title = this.title() ? this.title() : this._itemLabelPlural();\n return title instanceof Observable ? title : of(title);\n });\n // endpoint with the QP string removed (if one was provided)\n _endpointSansParams = computed(() => this.endpoint().split('?')[0]);\n _endpointParams = computed(() => {});\n componentColumns = viewChildren(MatColumnDef);\n @ContentChildren(MatColumnDef) _clientColumnDefs!: QueryList<MatColumnDef>;\n\n /**\n * Event raised for user selecting an item action. It's also raised\n * for 'New <Item>' action, if 'newItemLink' property is not set.\n */\n @Output() action = new EventEmitter<{ role: string; entity?: TEntity }>();\n\n /**\n * Event raised when create Create/Edit pane is activated & deactivated.\n * Event contains two flags:-\n * activated - whether the createEdit form view was activated or\n * deactivated.\n * cancelled - whether the form view was cancelled by user. False for this\n * indicates that the form view was closed after a successful\n * edit operation.\n */\n @Output() entityViewPaneActivated = new EventEmitter<{\n activated: boolean;\n cancelled: boolean | undefined;\n mode: 'edit' | 'preview';\n }>();\n\n busyWheelId = `entityCrudBusyWheel-${Date.now()}`;\n sub$ = new Subscription();\n spEntitiesList =\n viewChild<SPMatEntityListComponent<TEntity, IdKey>>('entitiesList');\n\n // Theoritically, we ought to be able to initialize the mat-entities-list\n // columns from ngAfterViewInit lifecycle hook. But for some strange reason\n // when this hook is called, sp-mat-entities-list has not been initialized.\n // Therefore `spEntitiesList()` is null. So we have to use a computed signal,\n // which will be triggered when spEntitiesList() is initialized and use that\n // to initialize the columns.\n spEntitiesListInited = effect(() => {\n if (this.spEntitiesList()) {\n this._initEntitiesList();\n }\n });\n\n crudConfig!: SPMatEntityCrudConfig;\n\n // This is the internal component that will host the createEditFormTemplate\n createEditHostComponent = viewChild(FormViewHostComponent);\n // A flag to toggle the viewport's contents between the mat-table\n // and the create/edit form template.\n createEditViewActive = signal<boolean>(false);\n\n // Whether it's okay to cancel the edit\n canCancelEditCallback!: () => boolean;\n\n // Preview host component\n previewHostComponent = viewChild(PreviewHostComponent);\n previewActive = computed(() => this.previewedEntity() !== undefined);\n previewedEntity = signal<TEntity | undefined>(undefined);\n\n // Whether the pane that hosts the preview/edit-entity template is active.\n // We call it entityPane as it's used to either render a selected entity\n // or to edit one.\n entityPaneActive = computed(\n () => !!this.previewedEntity() || this.createEditViewActive(),\n );\n // Effective width of the entity pane.\n entityPaneWidth = computed(() =>\n this.entityPaneActive()\n ? !!this.previewedEntity()\n ? this.previewPaneWidth()\n : this.editPaneWidth()\n : 0,\n );\n\n // Width of the pane showing the list of entities. Calculated as\n entitiesPaneWidth = computed(() => 100 - this.entityPaneWidth());\n entitiesPaneHidden = computed(\n () => this.entityPaneActive() && this.entityPaneWidth() === 100,\n );\n\n defaultItemCrudActions = signal<MatEntityCrudItemAction<TEntity, IdKey>[]>(\n [],\n );\n columnsWithAction = computed(() => {\n const cols = clone(this.columns());\n const actionDefined =\n cols.find((c) =>\n typeof c === 'string' ? c === 'action' : c.name === 'action',\n ) !== undefined;\n if (!actionDefined) {\n cols.push('action');\n }\n return cols;\n });\n // Provide per entity actions as a function so that the actions are\n // enumerated only when the user clicks on the context menu button.\n _itemActions = (entity: TEntity) => this.getItemActions(entity);\n\n // This uses the previewActive signal to compute the visible columns\n // when preview is activated. For now we just hide the 'action' column when\n // preview is active. We can further customize this logic by allowing the\n // client to specify the columns to display when preview is active thereby\n // reducing column clutter when the table width becomes narrower owing to\n // preview pane taking up screen space.\n visibleColumns = computed(() =>\n this.entityPaneActive()\n ? this.columnsWithAction()\n .map((col) => (typeof col === 'string' ? col : col.name))\n .filter((name) => name !== 'action')\n : [],\n );\n transloco = inject(TranslocoService);\n\n constructor(\n http: HttpClient,\n private snackBar: MatSnackBar,\n sanitizer: DomSanitizer,\n injector: Injector,\n ) {\n super(http, sanitizer, injector);\n this.crudConfig = getEntityCrudConfig();\n if (this.crudConfig?.defaultItemActions) {\n this.defaultItemCrudActions.set(this.crudConfig?.defaultItemActions);\n } else {\n this.defaultItemCrudActions.set([\n {\n label: this.transloco.translate('spMatEntityCrud.edit'),\n role: '_update_',\n },\n {\n label: this.transloco.translate('spMatEntityCrud.delete'),\n role: '_delete_',\n },\n ]);\n }\n }\n\n override ngOnInit() {}\n\n override ngOnDestroy(): void {\n this.sub$.unsubscribe();\n }\n\n /**\n * Override so that we can suppress default action in SPMatEntityListComponent\n */\n override ngAfterViewInit(): void {}\n\n /**\n * If the create/edit entity form is active, it calls its registered\n * canCancelEdit callback to determine if it's okay to cancel the edit.\n * You can use this method from the host component's router guard to\n * ensure that any changes made to the form are not accidentally lost by\n * navigating away from the CRUD page.\n *\n * If your CRUD page has multiple sp-mat-entity-crud components, you have to\n * implement the logic to call this method on the appropriate component.\n *\n * If the the create/edit form is not active, this method returns true.\n * @returns\n */\n canDeactivate() {\n if (this.createEditViewActive()) {\n return this.canCancelEdit();\n }\n return true;\n }\n\n override refresh(force = false) {\n this.spEntitiesList()?.refresh(force);\n }\n\n // BEGIN SPMatEntityCrudComponentBase METHODS //\n getEntityName(): string {\n return this.entityName();\n }\n\n getEntityNamePlural(): string {\n return this._entityNamePlural();\n }\n\n getIdKey() {\n return this.idKey();\n }\n\n closeCreateEdit(cancelled: boolean) {\n this.createEditViewActive.set(false);\n this.entityViewPaneActivated.emit({\n activated: false,\n cancelled: !!cancelled,\n mode: 'edit',\n });\n }\n\n canCancelEdit() {\n if (this.canCancelEditCallback) {\n return this.canCancelEditCallback();\n }\n return true;\n }\n\n registerCanCancelEditCallback(callback: () => boolean) {\n this.canCancelEditCallback = callback;\n }\n\n triggerEntityUpdate(entity: TEntity) {\n this.onUpdate(entity);\n }\n\n triggerEntityDelete(entity: TEntity) {\n this.onDelete(entity);\n }\n\n create(entityValue: any) {\n let obs!: Observable<TEntity | null>;\n const crudOpFn = this.crudOpFn();\n if (crudOpFn) {\n obs = crudOpFn('create', undefined, entityValue, this);\n } else {\n obs = this.http.post<TEntity>(this.getUrl(this.endpoint()), entityValue, {\n context: this.getCrudReqHttpContext('create'),\n });\n }\n\n return obs.pipe(\n showBusyWheelUntilComplete('formBusyWheel'),\n switchMap((resp) =>\n resp ? this.doRefreshAfterEdit(resp, 'create') : of(null),\n ),\n tap((entity) => {\n // If pagination is infinite or if the pagination if none or if the\n // count of items in the current page is less than pageSize()\n // wec an safely add the item to the list, which will cause the view\n // render the new item in the mat-table.\n if (entity) {\n this.spEntitiesList()?.addEntity(entity);\n firstValueFrom(this._itemLabel()).then((itemLabel) => {\n this.snackBar.open(\n this.transloco.translate('spMatEntityCrud.createSuccess', {\n item: itemLabel,\n }),\n );\n });\n }\n }),\n );\n }\n\n update(id: TEntity[IdKey], entityValue: any) {\n let obs!: Observable<TEntity | null>;\n const crudOpFn = this.crudOpFn();\n if (crudOpFn) {\n obs = crudOpFn('update', id, entityValue, this);\n } else {\n obs = this.http.patch<TEntity>(this.getEntityUrl(id), entityValue, {\n context: this.getCrudReqHttpContext('update'),\n });\n }\n\n return obs.pipe(\n showBusyWheelUntilComplete('formBusyWheel'),\n switchMap((resp) =>\n resp ? this.doRefreshAfterEdit(resp, 'update') : of(null),\n ),\n tap((entity) => {\n if (entity) {\n this.spEntitiesList()?.updateEntity(id, entity);\n firstValueFrom(this._itemLabel()).then((itemLabel) => {\n this.snackBar.open(\n this.transloco.translate('spMatEntityCrud.updateSuccess', {\n item: itemLabel,\n }),\n );\n });\n }\n }),\n );\n }\n // END SPMatEntityCrudComponentBase METHODS //\n\n /**\n * Thunk these methods to the internal <sp-mat-entity-list> component.\n */\n override addEntity(entity: TEntity): void {\n this.spEntitiesList()?.addEntity(entity);\n }\n\n override removeEntity(id: TEntity[IdKey]): void {\n this.spEntitiesList()?.removeEntity(id);\n }\n\n override updateEntity(id: TEntity[IdKey], entity: TEntity): void {\n this.spEntitiesList()?.updateEntity(id, entity);\n }\n\n /**\n * Refresh the entity list, after a CRUD CREATE or UPDATE operation.\n * @param resp This is the response from the CRUD operation (CREATE/UPDATE).\n * @param method The CRUD operation post which REFRESH is requested.\n * @returns Observable<TEntity|null>\n */\n doRefreshAfterEdit(resp: any, method: 'create' | 'update') {\n const refreshAfterEdit = this.refreshAfterEdit();\n const entity = this.getCrudOpResponseParser()(\n this.entityName(),\n this.idKey(),\n method,\n resp,\n );\n if (refreshAfterEdit === 'object') {\n let obs!: Observable<TEntity>;\n const crudOpFn = this.crudOpFn();\n if (crudOpFn) {\n obs = crudOpFn(\n 'get',\n (entity as any)[this.idKey()],\n undefined,\n this,\n ) as Observable<TEntity>;\n } else {\n obs = this.http.get<TEntity>(\n this.getEntityUrl((entity as any)[this.idKey()]),\n { context: this.getCrudReqHttpContext('retrieve') },\n );\n }\n return obs.pipe(\n map((entity) => {\n return this.getCrudOpResponseParser()(\n this.entityName(),\n this.idKey(),\n 'retrieve',\n entity,\n );\n }),\n );\n } else if (refreshAfterEdit === 'all') {\n this.refresh(true);\n return of(null);\n }\n\n return of(entity);\n }\n\n getCrudOpResponseParser(): SPMatEntityCrudResponseParser {\n if (this.crudResponseParser()) {\n // Without the `as SPMatEntityCrudResponseParser`, TSC will complain.\n return this.crudResponseParser() as SPMatEntityCrudResponseParser;\n }\n // crudConfig will have a parser as our default config provides one.\n return this.crudConfig\n .crudOpResponseParser as SPMatEntityCrudResponseParser;\n }\n\n // SPMatEntityCrudComponentBase interface method. Thunk to the implementation\n // method closePreviewImpl().\n closePreview() {\n this.closePreviewImpl(true);\n }\n\n private closePreviewImpl(toggleEntityListActiveEntity: boolean) {\n if (this.previewedEntity()) {\n if (toggleEntityListActiveEntity) {\n this.spEntitiesList()?.toggleActiveEntity(this.previewedEntity());\n }\n this.previewedEntity.set(undefined);\n this.entityViewPaneActivated.emit({\n activated: false,\n cancelled: undefined,\n mode: 'preview',\n });\n }\n }\n\n onItemAction(role: string, entity: TEntity) {\n // Handle default roles, which always get default behavior. If you want\n // a custom behavior, change the role to a custom one.\n if (role === '_update_' || role === '_delete_') {\n role === '_update_' ? this.onUpdate(entity) : this.onDelete(entity);\n return;\n }\n\n // Find the SPMatEntityCrudItemAction for this role to see if it's\n // allowed.\n const actionItem = this.itemActions().find((a) => a.role === role);\n if (!actionItem) {\n return;\n }\n\n // If a custom action handler is specified, call it.\n if (actionItem?.action) {\n actionItem.action(entity);\n return;\n }\n\n // Perform custom HTTP action\n const httpRequestParameters: MatEntityCrudItemAction<\n TEntity,\n IdKey\n >['httpRequestParameters'] = actionItem?.httpRequestParameters || {\n method: 'POST',\n urlPath: actionItem.role,\n };\n const verb = httpRequestParameters?.urlPath || actionItem?.role;\n if (!verb) {\n return;\n }\n\n // If a confirm prompt is specified, display it and return if user\n // selects 'Cancel'.\n if (actionItem?.confirmPrompt) {\n if (!confirm(actionItem.confirmPrompt)) {\n return;\n }\n }\n\n this.doEntityAction(\n (entity as any)[this.idKey()],\n verb,\n httpRequestParameters.params || new HttpParams(),\n httpRequestParameters.body,\n )\n .pipe(\n tap((response) => {\n const successMessage =\n actionItem?.successMessage ||\n this.transloco.translate('spMatEntityCrud.done');\n this.snackBar.open(successMessage || 'Done');\n }),\n catchError((error) => {\n /**\n * If an errorMessage is specified in the actionItem, display it.\n * Otherwise rethrow the error so that it can be handled by the\n * global error handler.\n */\n if (actionItem?.errorMessage) {\n this.snackBar.open(actionItem.errorMessage);\n return EMPTY;\n }\n return throwError(() => error);\n }),\n )\n .subscribe();\n }\n\n onCreate(event: Event) {\n // If newItemLink() has not been provided, check if createEditFormTemplate\n // is specified. If it is, load it and make that cover the entire viewport.\n // If that too is not specified, emit an action event with role='_new_'.\n if (!this.newItemLink() || this.newItemLink()?.length == 0) {\n event.preventDefault();\n event.stopImmediatePropagation();\n this.showCreateEditView(undefined);\n if (!this.createEditViewActive()) {\n this.action.emit({ role: '_new_' });\n }\n }\n }\n\n onUpdate(entity: TEntity) {\n this.showCreateEditView(entity);\n if (!this.createEditViewActive()) {\n this.action.emit({ role: '_update_' });\n }\n }\n\n /**\n * Show the create/edit component. This is deliberately made public so as to\n * be callable from the client. This allows the client to dynamically\n * set the form edit template and then show the edit pane by calling this\n * method.\n * @param entity\n * @param params\n */\n showCreateEditView(entity?: TEntity | undefined, params?: any) {\n const tmpl = this.createEditFormTemplate();\n if (!this.createEditViewActive() && tmpl) {\n // If preview is active deactivate it\n if (this.previewActive()) {\n this.closePreviewImpl(true);\n }\n const createEditHost = this.createEditHostComponent();\n createEditHost!.show(entity, params);\n this.createEditViewActive.set(true);\n this.entityViewPaneActivated.emit({\n activated: true,\n cancelled: undefined,\n mode: 'edit',\n });\n }\n }\n\n showPreviewView(entity?: TEntity, params?: any) {\n const tmpl = this.previewTemplate();\n if (tmpl) {\n if (!this.createEditViewActive()) {\n const previewHost = this.previewHostComponent();\n this.previewedEntity.set(entity);\n previewHost?.show(entity, params);\n this.entityViewPaneActivated.emit({\n activated: true,\n cancelled: undefined,\n mode: 'preview',\n });\n // this.previewActivated.emit({ entity, activated: true });\n }\n }\n }\n\n hidePreviewView() {\n if (this.previewActive()) {\n const previewHost = this.previewHostComponent();\n previewHost?.close();\n this.closePreviewImpl(false);\n }\n }\n\n async onDelete(entity: TEntity) {\n // Do the delete prompt asynchronously so that the context menu is\n // dismissed before the prompt is displayed.\n setTimeout(() => {\n // We use firstValueFrom() to get the value of the observable\n // synchronously. firstValueFrom() also gracefully cleans up the\n // observable after a value is emitted.\n firstValueFrom(this._itemLabel()).then((itemLabel) => {\n const deletedItemPrompt = this.transloco.translate(\n 'spMatEntityCrud.deleteItemConfirm',\n { item: itemLabel.toLocaleLowerCase() },\n );\n const yes = confirm(deletedItemPrompt);\n if (yes) {\n const entityId = (entity as any)[this.idKey()];\n\n // If preview is active deactivate it\n if (this.previewActive()) {\n this.closePreviewImpl(false);\n }\n\n let obs!: Observable<any>;\n const crudOpFn = this.crudOpFn();\n if (crudOpFn) {\n obs = crudOpFn('delete', entityId, undefined, this);\n } else {\n obs = this.http.delete<void>(this.getEntityUrl(entityId), {\n context: this.getCrudReqHttpContext('delete'),\n });\n }\n\n this.sub$.add(\n obs\n .pipe(\n // TODO: how to display a busy wheel?\n // showBusyWheelUntilComplete(this.busyWheelId),\n tap(() => {\n this.spEntitiesList()!.removeEntity(entityId);\n // TODO: customize by providing an interface via SPMatEntityCrudConfig?\n firstValueFrom(this._itemLabel()).then((itemLabel) => {\n const deletedMessage = this.transloco.translate(\n 'spMatEntityCrud.deleteItemSuccess',\n { item: itemLabel },\n );\n this.snackBar.open(deletedMessage);\n });\n }),\n )\n .subscribe(),\n );\n }\n });\n });\n }\n\n override getUrl(endpoint: string) {\n return this.entityListConfig?.urlResolver\n ? this.entityListConfig?.urlResolver(endpoint)\n : endpoint;\n }\n\n getEntityUrl(entityId: TEntity[IdKey]) {\n const endpoint = this.endpoint();\n const endpointParts = endpoint.split('?');\n const entityEndpoint =\n (endpointParts[0].endsWith('/')\n ? endpointParts[0]\n : endpointParts[0] + '/') + `${String(entityId)}/`;\n if (endpointParts.length > 1) {\n return this.getUrl(entityEndpoint + `?${endpointParts[1]}`);\n }\n return this.getUrl(entityEndpoint);\n }\n\n getEntityActionUrl(entityId: TEntity[IdKey], action: string) {\n const url = this.getEntityUrl(entityId);\n const urlParts = url.split('?');\n if (action.endsWith('/')) {\n action = action.slice(0, -1); // We'll be adding the trailing slash\n }\n const actionUrl =\n (urlParts[0].endsWith('/') ? urlParts[0] : urlParts[0] + '/') +\n `${action}/`;\n return urlParts.length === 1 ? actionUrl : actionUrl + `?${urlParts[1]}`;\n }\n\n handleSelectEntity(entity: TEntity | undefined) {\n if (!this.createEditViewActive()) {\n if (this.previewTemplate()) {\n entity ? this.showPreviewView(entity) : this.hidePreviewView();\n // this.previewedEntity.set(entity);\n } else {\n // If 'previewTemplate' is not set, propagate the event to client.\n this.selectEntity.emit(entity);\n }\n }\n }\n\n handleNewItemSubType(subtype: NewItemSubType) {\n // console.log(`handleNewItemSubType: ${subtype}`);\n if (subtype.role === '_new_') {\n this.showCreateEditView(undefined, subtype?.params);\n } else {\n this.action.emit({ role: subtype.role });\n }\n }\n\n private getCrudReqHttpContext(op: CrudOp) {\n let context = new HttpContext();\n // HttpContext for crud operations are taken from either the global httpReqContext\n // or from the crudHttpReqContext, with the latter taking precedence.\n const crudHttpReqContext = this.crudHttpReqContext()\n ? this.crudHttpReqContext()\n : this.httpReqContext();\n if (crudHttpReqContext) {\n if (crudHttpReqContext instanceof HttpContext) {\n // crudHttpReqContext is an object of type HttpContext. Which means\n // the same context is to be applied to all crud requests.\n for (const k of crudHttpReqContext.keys()) {\n context.set(k, crudHttpReqContext.get(k));\n }\n } else {\n if (Array.isArray(crudHttpReqContext)) {\n // Same HttpContext for all crud requests. Being an array, it must\n // be an array of HttpContextToken key, value pairs.\n convertHttpContextInputToHttpContext(context, crudHttpReqContext);\n } else if (\n typeof crudHttpReqContext === 'object' &&\n op &&\n Object.keys(crudHttpReqContext).find((k) => k === op)\n ) {\n // HttpContext specific to this crud operation, 'create'|'retrieve'|'update'|'delete'\n convertHttpContextInputToHttpContext(\n context,\n crudHttpReqContext[op]!,\n );\n }\n }\n }\n\n // Add standard SP_MAT_ENTITY_CRUD_HTTP_CONTEXT info which is set for all\n // HTTP requests made by this component.\n context.set(SP_MAT_ENTITY_CRUD_HTTP_CONTEXT, {\n entityName: this.entityName(),\n entityNamePlural: this._entityNamePlural(),\n endpoint: this.endpoint(),\n op,\n });\n return context;\n }\n\n isItemActionAllowed(action: string, entity: TEntity) {\n return false;\n }\n\n /**\n * Returns the list of item actions. Calls 'allowItemActionFn' for each action\n * to determine if the action is allowed for the given entity.\n * @returns\n */\n getItemActions(entity: TEntity): MatEntityCrudItemAction<TEntity, IdKey>[] {\n // console.log(`SPMatEntityCrudComponent.getItemActions - entity: ${JSON.stringify(entity, null, 2)}`);\n const actions =\n this.itemActions() && this.itemActions().length\n ? this.itemActions()\n : this.defaultItemCrudActions();\n let actionsCopy: MatEntityCrudItemAction<TEntity, IdKey>[] = clone(actions);\n actionsCopy.forEach(\n (action: MatEntityCrudItemAction<TEntity, IdKey>, index: number) => {\n // localize default action item labels (Update & Delete)\n // Client specified action labels are to be localized by the client\n // before supplying them to the component.\n if (action.label.startsWith('spMatEntityCrud.')) {\n action.label = this.transloco.translate(action.label);\n }\n const orgDisable = actions[index]?.disable;\n action.disable = (entity: TEntity) => {\n if (orgDisable) {\n return orgDisable(entity);\n }\n const allowItemActionFn = this.allowEntityActionFn();\n if (allowItemActionFn) {\n return !allowItemActionFn(entity, action.role ?? action.label);\n }\n return false;\n };\n },\n );\n // If the item actions are disabled, disable all actions. Event user\n // defined actions.\n if (this.disableItemActions()) {\n actionsCopy.forEach((a) => (a.disable = () => true));\n }\n return actionsCopy;\n }\n\n getPreviewPaneContentClass() {\n return this.previewPaneContentClass();\n }\n\n getFormPaneWrapperClass() {\n return this.formPaneWrapperClass();\n }\n\n getFormPaneContentClass(): string {\n return this.formPaneContentClass();\n }\n\n getItemLabel(): string | Observable<string> {\n return this._itemLabel();\n }\n\n getItemLabelPlural(): string | Observable<string> {\n return this._itemLabelPlural();\n }\n\n /**\n * Perform an action on the entity with the given id. The endpoint for the\n * action is derived from the `verb` argument which is appended to the\n * entity URL. This is following DRF specification where ViewSets can be\n * extended with custom actions that are not part of the standard\n * CRUD operations. Such methods will have a URL like\n * `/api/v1/entity/<id>/<verb>/` where `<verb>` is the custom action verb.\n * @param id\n * @param verb\n * @param addlParams\n * @param data\n */\n doEntityAction(\n id: TEntity[IdKey],\n verb: string,\n addlParams: HttpParams,\n data: any,\n busyWheelName: string = 'formBusyWheel',\n ) {\n let obs!: Observable<TEntity | null>;\n const crudOpFn = this.crudOpFn();\n if (crudOpFn) {\n obs = crudOpFn(verb, id, data, this);\n } else {\n const url = this.getEntityActionUrl(id, verb);\n obs = this.http.post<TEntity>(url, data, {\n params: addlParams || {},\n context: this.getCrudReqHttpContext('update'), // KLUDGE!: use 'update' request context\n });\n }\n\n return obs.pipe(\n showBusyWheelUntilComplete(busyWheelName),\n switchMap((resp) =>\n resp ? this.doRefreshAfterEdit(resp, 'update') : of(null),\n ),\n tap((entity) => {\n if (entity) {\n this.spEntitiesList()?.updateEntity(id, entity);\n }\n }),\n );\n }\n\n /**\n * Initialize the columns for the mat-entities-list component. This is\n * called when the <sp-mat-entities-list> component has been properly\n * initialized.\n */\n private _initEntitiesList() {\n const spEntitiesList = this.spEntitiesList();\n if (spEntitiesList) {\n // Build contentColumnDefs using our component's content. Then add our own\n // 'action' column definition to it. Then set this as the value of\n // child SPMatEntityListComponent.contentColumnDef. This way we force\n // SPMatEntityListComponent to use our component's any project MatColumnDef\n // content in the final mat-table.\n const clientColumnDefs = this.clientColumnDefs;\n let contentColumnDefs = new Array<MatColumnDef>();\n if (clientColumnDefs.length) {\n // Note that we process any content projected matColumnDef first and\n // our own internal content later. And when we process our own internal\n // columns (for now only 'action'), it's not added if a column with that\n // name has already been defined via content projection. This allows the\n // clients to override even internal columns with their column defintion.\n clientColumnDefs.toArray().forEach((c) => contentColumnDefs.push(c));\n }\n this.componentColumns().forEach((ic) => {\n if (!contentColumnDefs.find((c) => c.name === ic.name)) {\n contentColumnDefs.push(ic);\n }\n });\n spEntitiesList.contentColumnDefs = contentColumnDefs;\n // This is a replication of SPMatEntityCrudList.ngAfterViewInit. That\n // code is skipped as we declare <sp-mat-entity-list> with\n // deferViewInit=true.\n spEntitiesList.buildColumns();\n spEntitiesList.setupSort();\n spEntitiesList.loadMoreEntities();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2","i3","i6","i9","i10"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAGa,yBAAyB,GAAG,IAAI,cAAc,CAAwB,uBAAuB;;ACI1G;;;;;;;AAOG;AACG,SAAU,oCAAoC,CAClD,OAAoB,EACpB,UAA4B,EAAA;AAE5B,IAAA,IAAI,UAAU,YAAY,WAAW,EAAE;;QAErC,KAAK,MAAM,CAAC,IAAI,UAAU,CAAC,IAAI,EAAE,EAAE;AACjC,YAAA,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACnC;IACF;SAAO,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE;;AAE/F,QAAA,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAC3C;SAAO;QACL,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACnD;AACA,IAAA,OAAO,OAAO;AAChB;;AC8IO,MAAM,+BAA+B,GAC1C,IAAI,gBAAgB,CAA6B,OAAO;AACtD,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,gBAAgB,EAAE,EAAE;AAC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,oBAAoB,EAAA,QAAA,EACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiJT,EAAA,eAAA,EAkCgB,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,2XAAA,CAAA,EAAA;4iGA+Pf,YAAY,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,iBAAA,EAAA,CAAA;sBAC3C,eAAe;uBAAC,YAAY;;sBAM5B;;sBAWA;8DASqD,cAAc,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,uBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAiBhC,qBAAqB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,oBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MASxB,oBAAoB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACrkBvD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -6,25 +6,25 @@
|
|
|
6
6
|
"path": "src/assets/i18n/"
|
|
7
7
|
}
|
|
8
8
|
],
|
|
9
|
-
"version": "21.0.
|
|
9
|
+
"version": "21.0.3",
|
|
10
10
|
"peerDependencies": {
|
|
11
|
-
"@angular/animations": "21.1.
|
|
12
|
-
"@angular/cdk": "
|
|
13
|
-
"@angular/common": "21.1.
|
|
14
|
-
"@angular/compiler": "21.1.
|
|
15
|
-
"@angular/core": "21.1.
|
|
16
|
-
"@angular/forms": "21.1.
|
|
17
|
-
"@angular/material": "
|
|
18
|
-
"@angular/platform-browser": "21.1.
|
|
19
|
-
"@angular/platform-browser-dynamic": "21.1.
|
|
20
|
-
"@angular/router": "21.1.
|
|
11
|
+
"@angular/animations": "^21.1.0",
|
|
12
|
+
"@angular/cdk": "^21.1.0",
|
|
13
|
+
"@angular/common": "^21.1.0",
|
|
14
|
+
"@angular/compiler": "^21.1.0",
|
|
15
|
+
"@angular/core": "^21.1.0",
|
|
16
|
+
"@angular/forms": "^21.1.0",
|
|
17
|
+
"@angular/material": "^21.1.0",
|
|
18
|
+
"@angular/platform-browser": "^21.1.0",
|
|
19
|
+
"@angular/platform-browser-dynamic": "^21.1.0",
|
|
20
|
+
"@angular/router": "^21.1.0",
|
|
21
21
|
"@jsverse/transloco": "7.5.1",
|
|
22
22
|
"@ngneat/elf": "^2.5.1",
|
|
23
23
|
"@ngneat/elf-entities": "^5.0.2",
|
|
24
24
|
"@ngneat/elf-pagination": "^1.1.0",
|
|
25
|
-
"angular-split": "^
|
|
25
|
+
"angular-split": "^20.0.0",
|
|
26
26
|
"google-libphonenumber": "^3.2.34",
|
|
27
|
-
"lodash": "^4.17.
|
|
27
|
+
"lodash-es": "^4.17.23",
|
|
28
28
|
"pluralize": "^8.0.0",
|
|
29
29
|
"ngx-infinite-scroll": "^21.0.0",
|
|
30
30
|
"ngx-mat-select-search": "^8.0.4",
|