@rxap/remote-method 21.0.1-dev.1 → 22.0.0-dev.0

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/compodoc/changelog.html +23 -0
  3. package/compodoc/dependencies.html +6 -6
  4. package/compodoc/js/search/search_index.js +2 -2
  5. package/compodoc/properties.html +1 -1
  6. package/docs/documentation.json +130 -130
  7. package/docs/html/classes/BaseRemoteMethod.html +10 -10
  8. package/docs/html/classes/ProxyRemoteMethod.html +10 -10
  9. package/docs/html/classes/RemoteMethodLoader.html +2 -2
  10. package/docs/html/classes/RxapRemoteMethodError.html +5 -5
  11. package/docs/html/functions/RxapRemoteMethod.html +1 -1
  12. package/docs/html/hierarchy.html +1 -1
  13. package/docs/html/index.html +2 -2
  14. package/docs/html/interfaces/BaseRemoteMethodMetadata.html +2 -2
  15. package/docs/html/modules.html +1 -1
  16. package/docs/html/variables/REMOTE_METHOD_META_DATA.html +1 -1
  17. package/docs/html/variables/RXAP_PROXY_REMOTE_METHOD_TARGET.html +1 -1
  18. package/docs/markdown/README.md +1 -1
  19. package/docs/markdown/classes/BaseRemoteMethod.md +31 -31
  20. package/docs/markdown/classes/ProxyRemoteMethod.md +32 -32
  21. package/docs/markdown/classes/RemoteMethodLoader.md +4 -4
  22. package/docs/markdown/classes/RxapRemoteMethodError.md +16 -16
  23. package/docs/markdown/functions/RxapRemoteMethod.md +2 -2
  24. package/docs/markdown/globals.md +2 -2
  25. package/docs/markdown/interfaces/BaseRemoteMethodMetadata.md +4 -4
  26. package/docs/markdown/variables/REMOTE_METHOD_META_DATA.md +2 -2
  27. package/docs/markdown/variables/RXAP_PROXY_REMOTE_METHOD_TARGET.md +2 -2
  28. package/docs/wiki/Class.BaseRemoteMethod.md +30 -30
  29. package/docs/wiki/Class.ProxyRemoteMethod.md +31 -31
  30. package/docs/wiki/Class.RemoteMethodLoader.md +3 -3
  31. package/docs/wiki/Class.RxapRemoteMethodError.md +15 -15
  32. package/docs/wiki/Function.RxapRemoteMethod.md +1 -1
  33. package/docs/wiki/Interface.BaseRemoteMethodMetadata.md +3 -3
  34. package/docs/wiki/Variable.REMOTE_METHOD_META_DATA.md +1 -1
  35. package/docs/wiki/Variable.RXAP_PROXY_REMOTE_METHOD_TARGET.md +1 -1
  36. package/docs/wiki/globals.md +1 -1
  37. package/fesm2022/rxap-remote-method-directive.mjs +804 -522
  38. package/fesm2022/rxap-remote-method-directive.mjs.map +1 -1
  39. package/fesm2022/rxap-remote-method-http-directive.mjs +352 -99
  40. package/fesm2022/rxap-remote-method-http-directive.mjs.map +1 -1
  41. package/fesm2022/rxap-remote-method-http.mjs +206 -162
  42. package/fesm2022/rxap-remote-method-http.mjs.map +1 -1
  43. package/fesm2022/rxap-remote-method-testing.mjs +37 -54
  44. package/fesm2022/rxap-remote-method-testing.mjs.map +1 -1
  45. package/fesm2022/rxap-remote-method.mjs +199 -134
  46. package/fesm2022/rxap-remote-method.mjs.map +1 -1
  47. package/package.json +13 -13
  48. package/types/rxap-remote-method-directive.d.ts +295 -203
  49. package/types/rxap-remote-method-http-directive.d.ts +104 -39
  50. package/types/rxap-remote-method-http.d.ts +63 -64
  51. package/types/rxap-remote-method-testing.d.ts +15 -16
  52. package/types/rxap-remote-method.d.ts +47 -48
@@ -1 +1 @@
1
- {"version":3,"file":"rxap-remote-method-directive.mjs","sources":["../../../../../packages/angular/remote-method/directive/src/lib/error.ts","../../../../../packages/angular/remote-method/directive/src/lib/tokens.ts","../../../../../packages/angular/remote-method/directive/src/lib/remote-method-template-collection.directive.ts","../../../../../packages/angular/remote-method/directive/src/lib/remote-method-template.directive.ts","../../../../../packages/angular/remote-method/directive/src/lib/remote-method.directive.ts","../../../../../packages/angular/remote-method/directive/src/index.ts","../../../../../packages/angular/remote-method/directive/src/rxap-remote-method-directive.ts"],"sourcesContent":["import { RxapRemoteMethodError } from '@rxap/remote-method';\n\nexport class RxapRemoteMethodDirectiveError extends RxapRemoteMethodError {\n\n constructor(message: string, code?: string, scope?: string) {\n super(message, code ?? '', scope);\n }\n\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN = new InjectionToken('rxap/remote-method/directive/token');\n","import { ChangeDetectorRef, Directive, DoCheck, EmbeddedViewRef, Injector, INJECTOR, isDevMode, IterableChangeRecord, IterableChanges, IterableDiffer, IterableDiffers, OnInit, TemplateRef, TrackByFunction, ViewContainerRef, input, inject, computed, effect, untracked } from '@angular/core';\nimport {\n BaseRemoteMethod,\n BaseRemoteMethodMetadata,\n RemoteMethodLoader,\n} from '@rxap/remote-method';\nimport { IdOrInstanceOrToken } from '@rxap/definition';\nimport { RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN } from './tokens';\n\nexport class RemoteMethodTemplateCollectionDirectiveContext<ReturnType = any> {\n constructor(\n public $implicit: ReturnType,\n public index: number,\n public count: number,\n ) {\n }\n\n get first(): boolean {\n return this.index === 0;\n }\n\n get last(): boolean {\n return this.index === this.count - 1;\n }\n\n get even(): boolean {\n return this.index % 2 === 0;\n }\n\n get odd(): boolean {\n return !this.even;\n }\n}\n\nexport interface RemoteMethodTemplateCollectionDirectiveErrorContext {\n $implicit: Error;\n message?: string;\n name?: string;\n}\n\nfunction getTypeName(type: any): string {\n return type['name'] || typeof type;\n}\n\nclass RecordViewTuple<T> {\n constructor(public record: any, public view: EmbeddedViewRef<RemoteMethodTemplateCollectionDirectiveContext<T>>) {\n }\n}\n\n@Directive({\n selector: '[rxapRemoteMethodCollection]',\n exportAs: 'rxapRemoteMethodCollection',\n standalone: true,\n})\nexport class RemoteMethodTemplateCollectionDirective<ReturnType = any,\n Parameters = any,\n Metadata extends BaseRemoteMethodMetadata = BaseRemoteMethodMetadata>\n implements DoCheck, OnInit {\n private readonly template = inject<TemplateRef<RemoteMethodTemplateCollectionDirectiveContext<ReturnType>>>(TemplateRef);\n protected readonly remoteMethodLoader = inject<RemoteMethodLoader>(RemoteMethodLoader);\n private readonly injector = inject<Injector>(INJECTOR);\n private readonly viewContainerRef = inject<ViewContainerRef>(ViewContainerRef);\n protected readonly cdr = inject<ChangeDetectorRef>(ChangeDetectorRef);\n private readonly differs = inject<IterableDiffers>(IterableDiffers);\n private readonly remoteMethodToken = inject<any>(RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN, { optional: true, self: true });\n\n\n public readonly parameters = input<Parameters>(undefined, { alias: \"rxapRemoteMethodCollectionParameters\" });\n // eslint-disable-next-line @angular-eslint/no-input-rename\n public readonly emptyTemplate = input<TemplateRef<void>>(undefined, { alias: \"rxapRemoteMethodCollectionEmpty\" });\n // eslint-disable-next-line @angular-eslint/no-input-rename\n public readonly errorTemplate = input<TemplateRef<RemoteMethodTemplateCollectionDirectiveErrorContext>>(undefined, { alias: \"rxapRemoteMethodCollectionError\" });\n public readonly withoutParameters = input(false, { alias: \"rxapRemoteMethodCollectionWithoutParameters\" });\n private _differ: IterableDiffer<ReturnType> | null = null;\n private _dirty = true;\n /**\n * Indicates that the remote method returned a empty collection\n *\n * true - is empty\n * false - is NOT empty\n * null - unknown\n *\n * @private\n */\n private _empty: boolean | null = null;\n /**\n * Holds the error that call of the remote method throws\n *\n * @private\n */\n private _error: Error | null = null;\n /**\n * Holds the empty template view ref.\n *\n * Is used to determine if a empty template is added to the\n * view. And used to destruct the empty template if the remote method\n * changes from empty to not empty.\n *\n * @private\n */\n private _emptyTemplateViewRef: EmbeddedViewRef<void> | null = null;\n /**\n * Holds the error template view ref.\n *\n * Is used to determine if a error template is added to the\n * view. And used to destruct the error template if the remote method\n * is called again with an error.\n *\n * @private\n */\n private _errorTemplateViewRef: EmbeddedViewRef<RemoteMethodTemplateCollectionDirectiveErrorContext> | null = null;\n\n /**\n * A function that defines how to track changes for items in the iterable.\n *\n * When items are added, moved, or removed in the iterable,\n * the directive must re-render the appropriate DOM nodes.\n * To minimize churn in the DOM, only nodes that have changed\n * are re-rendered.\n *\n * By default, the change detector assumes that\n * the object instance identifies the node in the iterable.\n * When this function is supplied, the directive uses\n * the result of calling this function to identify the item node,\n * rather than the identity of the object itself.\n *\n * The function receives two inputs,\n * the iteration index and the node object ID.\n */\n public readonly trackBy = input<TrackByFunction<ReturnType>, TrackByFunction<ReturnType> | undefined>(\n undefined as any,\n {\n alias: 'rxapRemoteMethodCollectionTrackBy',\n transform: (fn) => {\n if (isDevMode() && fn != null && typeof fn !== 'function') {\n console.warn(\n `trackBy must be a function, but received ${ JSON.stringify(fn) }. ` +\n `See https://angular.io/api/common/NgForOf#change-propagation for more information.`);\n }\n return fn as TrackByFunction<ReturnType>;\n },\n },\n );\n\n public readonly remoteMethodOrIdOrToken = input<IdOrInstanceOrToken<BaseRemoteMethod<ReturnType[], Parameters, Metadata>>>(undefined, { alias: 'rxapRemoteMethodCollectionCall' });\n\n protected readonly _remoteMethodOrIdOrToken = computed(() => this.remoteMethodOrIdOrToken() || this.remoteMethodToken);\n\n /**\n * Holds the data that should be displayed\n * @private\n */\n private _data: ReturnType[] | null = null;\n\n protected set data(data: ReturnType[]) {\n this._data = data;\n this._dirty = true;\n }\n\n /**\n * Asserts the correct type of the context for the template that `NgForOf` will render.\n *\n * The presence of this method is a signal to the Ivy template type-check compiler that the\n * `NgForOf` structural directive renders its template with a specific context type.\n */\n static ngTemplateContextGuard<T>(dir: RemoteMethodTemplateCollectionDirective<T>, ctx: any):\n ctx is RemoteMethodTemplateCollectionDirectiveContext<T> {\n return true;\n }\n\n constructor() {\n // re-run whenever the bound parameters change\n effect(() => {\n const parameters = this.parameters();\n if (parameters !== undefined) {\n untracked(() => this.call(parameters));\n }\n });\n }\n\n public ngOnInit() {\n if (this.withoutParameters()) {\n this.call();\n }\n }\n\n public call(parameters?: Parameters): void {\n this.remoteMethodLoader\n .call$(this._remoteMethodOrIdOrToken(), parameters, undefined, this.injector)\n .then(response => {\n // guard against non-array responses (null/undefined/scalar) to\n // avoid reading .length off a non-iterable and crashing\n const isArray = Array.isArray(response);\n // a successful call clears a previous error, otherwise the error template sticks forever\n this._error = null;\n this._empty = !isArray || response.length === 0;\n this._data = isArray ? response : [];\n this.cdr.detectChanges();\n })\n .catch(error => {\n this._error = error;\n this.cdr.detectChanges();\n });\n }\n\n /**\n * Applies the changes when needed.\n */\n public ngDoCheck(): void {\n if (this._error !== null) {\n\n this.viewContainerRef.clear();\n this._differ = null;\n\n const errorTemplate = this.errorTemplate();\n if (errorTemplate) {\n this._errorTemplateViewRef = this.viewContainerRef.createEmbeddedView(errorTemplate, {\n $implicit: this._error,\n message: this._error.message,\n name: this._error.name,\n });\n }\n\n } else if (this._empty === true) {\n\n this.viewContainerRef.clear();\n this._differ = null;\n\n // attaches the empty template if the data source is empty\n const emptyTemplate = this.emptyTemplate();\n if (emptyTemplate) {\n this._emptyTemplateViewRef = this.viewContainerRef.createEmbeddedView(emptyTemplate);\n }\n\n } else if (this._empty === false) {\n\n // detach and destroy the empty template if the data source is not\n // empty any more\n if (this._emptyTemplateViewRef) {\n this._emptyTemplateViewRef.detach();\n this._emptyTemplateViewRef.destroy();\n this._emptyTemplateViewRef = null;\n }\n\n if (this._errorTemplateViewRef) {\n this._errorTemplateViewRef.detach();\n this._errorTemplateViewRef.destroy();\n this._errorTemplateViewRef = null;\n }\n\n if (this._data) {\n this._dirty = false;\n // React on ngForOf changes only once all inputs have been initialized\n const value = this._data;\n if (!this._differ && value) {\n try {\n this._differ = this.differs.find(value).create(this.trackBy());\n } catch {\n throw new Error(`Cannot find a differ supporting object '${ value }' of type '${\n getTypeName(value) }'. NgFor only supports binding to Iterables such as Arrays.`);\n }\n }\n }\n if (this._differ) {\n const changes = this._differ.diff(this._data);\n if (changes) {\n this.applyChanges(changes);\n }\n }\n }\n }\n\n protected applyChanges(changes: IterableChanges<ReturnType>) {\n\n const insertTuples: RecordViewTuple<ReturnType>[] = [];\n changes.forEachOperation(\n (item: IterableChangeRecord<any>, adjustedPreviousIndex: number | null, currentIndex: number | null) => {\n\n if (item.previousIndex == null) {\n\n // NgForOf is never \"null\" or \"undefined\" here because the differ detected\n // that a new item needs to be inserted from the iterable. This implies that\n // there is an iterable value for \"_ngForOf\".\n const view = this.viewContainerRef.createEmbeddedView(\n this.template,\n new RemoteMethodTemplateCollectionDirectiveContext<ReturnType>(null!, -1, -1),\n currentIndex === null ? undefined : currentIndex,\n );\n const tuple = new RecordViewTuple<ReturnType>(item, view);\n insertTuples.push(tuple);\n\n } else if (currentIndex == null) {\n\n this.viewContainerRef.remove(adjustedPreviousIndex === null ? undefined : adjustedPreviousIndex);\n\n } else if (adjustedPreviousIndex !== null) {\n\n const view = this.viewContainerRef.get(adjustedPreviousIndex)!;\n this.viewContainerRef.move(view, currentIndex);\n const tuple = new RecordViewTuple(\n item,\n <EmbeddedViewRef<RemoteMethodTemplateCollectionDirectiveContext<ReturnType>>>view,\n );\n insertTuples.push(tuple);\n\n }\n\n });\n\n for (let i = 0; i < insertTuples.length; i++) {\n this.perViewChange(insertTuples[i].view, insertTuples[i].record);\n }\n\n for (let i = 0,\n ilen = this.viewContainerRef.length; i < ilen; i++) {\n const viewRef = <EmbeddedViewRef<RemoteMethodTemplateCollectionDirectiveContext<ReturnType>>>this.viewContainerRef.get(\n i);\n viewRef.context.index = i;\n viewRef.context.count = ilen;\n }\n\n changes.forEachIdentityChange((record: any) => {\n const viewRef =\n <EmbeddedViewRef<RemoteMethodTemplateCollectionDirectiveContext<ReturnType>>>this.viewContainerRef.get(record.currentIndex);\n viewRef.context.$implicit = record.item;\n });\n\n }\n\n private perViewChange(\n view: EmbeddedViewRef<RemoteMethodTemplateCollectionDirectiveContext<ReturnType>>,\n record: IterableChangeRecord<any>,\n ) {\n view.context.$implicit = record.item;\n }\n\n}\n\n\n","import { ChangeDetectorRef, Directive, Injector, INJECTOR, isDevMode, OnInit, TemplateRef, ViewContainerRef, input, output, inject, linkedSignal, computed, effect, untracked } from '@angular/core';\nimport {\n BaseRemoteMethod,\n BaseRemoteMethodMetadata,\n RemoteMethodLoader,\n} from '@rxap/remote-method';\nimport {\n Deprecated,\n} from '@rxap/utilities';\nimport { IdOrInstanceOrToken } from '@rxap/definition';\nimport { RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN } from './tokens';\nimport { ToggleSubject } from '@rxap/rxjs';\n\nexport interface RemoteMethodTemplateDirectiveContext<ReturnType = any> {\n $implicit: ReturnType;\n}\n\nexport interface RemoteMethodTemplateDirectiveErrorContext {\n $implicit: Error;\n message: string;\n}\n\n@Directive({\n selector: '[rxapRemoteMethod]',\n exportAs: 'rxapRemoteMethod',\n standalone: true,\n})\nexport class RemoteMethodTemplateDirective<ReturnType = any, Parameters = any, Metadata extends BaseRemoteMethodMetadata = BaseRemoteMethodMetadata>\n implements OnInit {\n private readonly template = inject<TemplateRef<RemoteMethodTemplateDirectiveContext<ReturnType>>>(TemplateRef);\n protected readonly remoteMethodLoader = inject<RemoteMethodLoader>(RemoteMethodLoader);\n private readonly injector = inject<Injector>(INJECTOR);\n private readonly viewContainerRef = inject<ViewContainerRef>(ViewContainerRef);\n protected readonly cdr = inject<ChangeDetectorRef>(ChangeDetectorRef);\n private readonly remoteMethodToken = inject<any>(RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN, { optional: true, self: true });\n\n\n // TODO : remove template context Guard\n // the template context Guard must be defined with a concrete context type\n // else the context guard is resolved to any\n // For each child directive that should have a template context guard\n // the template context guard must be defined\n // eslint-disable-next-line @angular-eslint/no-output-rename\n public readonly executed$ = output({ alias: 'executed' });\n // eslint-disable-next-line @angular-eslint/no-output-rename\n public readonly failure$ = output<Error>({ alias: 'failure' });\n // eslint-disable-next-line @angular-eslint/no-output-rename\n public readonly successful$ = output<ReturnType>({ alias: 'successful' });\n public readonly metadata = input<Metadata>(undefined, { alias: \"rxapRemoteMethodMetadata\" });\n /**\n * true - a remote method call is in progress\n */\n public executing$ = new ToggleSubject();\n public readonly parameters = input<Parameters>(undefined, { alias: \"rxapRemoteMethodParameters\" });\n protected readonly currentParameters = linkedSignal(() => this.parameters());\n // eslint-disable-next-line @angular-eslint/no-input-rename\n public readonly errorTemplate = input<TemplateRef<RemoteMethodTemplateDirectiveErrorContext>>(undefined, { alias: \"rxapRemoteMethodError\" });\n // eslint-disable-next-line @angular-eslint/no-input-rename\n public readonly loadingTemplate = input<TemplateRef<void>>(undefined, { alias: \"rxapRemoteMethodLoading\" });\n public readonly withoutParameters = input(false, { alias: \"rxapRemoteMethodWithoutParameters\" });\n public readonly embedded = output();\n\n public readonly remoteMethodOrIdOrToken = input<IdOrInstanceOrToken<BaseRemoteMethod<ReturnType, Parameters, Metadata>>>(undefined, { alias: 'rxapRemoteMethodCall' });\n\n protected readonly _remoteMethodOrIdOrToken = computed(() => this.remoteMethodOrIdOrToken() || this.remoteMethodToken);\n\n // !! add generation of concrete template context guard to openapi schematics !!\n static ngTemplateContextGuard<T>(dir: RemoteMethodTemplateDirective<T>, ctx: any):\n ctx is RemoteMethodTemplateDirectiveContext<T> {\n return true;\n }\n\n constructor() {\n // re-run whenever the bound parameters change\n effect(() => {\n const parameters = this.parameters();\n if (parameters !== undefined) {\n untracked(() => this.execute(parameters));\n }\n });\n }\n\n public ngOnInit() {\n this.renderLoadingTemplate();\n if (this.withoutParameters()) {\n this.execute();\n }\n }\n\n public async execute(parameters: Parameters | undefined = this.currentParameters()): Promise<void> {\n this.executing$.enable();\n this.renderLoadingTemplate();\n try {\n const result = await this.remoteMethodLoader.call$(\n this._remoteMethodOrIdOrToken(),\n parameters,\n this.metadata(),\n this.injector,\n );\n this.executed(result);\n this.renderTemplate(result);\n this.successful(result);\n } catch (error: any) {\n if (isDevMode()) {\n console.error(`Remote method directive execution failed:`, error.message);\n }\n this.failure(error);\n } finally {\n this.executing$.disable();\n }\n }\n\n /**\n * @deprecated removed\n * @protected\n */\n @Deprecated('removed')\n public call(parameters?: Parameters): void {\n this.execute(parameters)\n .catch(error => console.error('Remote method template rendering failed: ' + error.message));\n }\n\n public setParameter<Key extends keyof Parameters>(parameterKey: Key, value: Parameters[Key]): void {\n this.updateParameters({ [parameterKey]: value } as any);\n }\n\n public updateParameters(parameters: Partial<Parameters>): void {\n this.currentParameters.set({ ...(this.currentParameters() ?? {}), ...parameters } as any);\n }\n\n protected executed(result: any) {\n this.executed$.emit(result);\n }\n\n protected failure(error: Error) {\n this.failure$.emit(error);\n }\n\n protected successful(result: ReturnType) {\n this.successful$.emit(result);\n }\n\n protected renderTemplate(result: ReturnType) {\n\n this.viewContainerRef.clear();\n\n try {\n this.viewContainerRef.createEmbeddedView(this.template, { $implicit: result });\n } catch (error: any) {\n const errorTemplate = this.errorTemplate();\n if (errorTemplate) {\n this.viewContainerRef.createEmbeddedView(\n errorTemplate,\n {\n $implicit: error,\n message: error.message,\n },\n );\n }\n console.error(error.message);\n }\n\n this.embedded.emit();\n\n this.cdr.detectChanges();\n\n }\n\n private renderLoadingTemplate() {\n const loadingTemplate = this.loadingTemplate();\n if (loadingTemplate) {\n this.viewContainerRef.clear();\n this.viewContainerRef.createEmbeddedView(loadingTemplate);\n }\n }\n\n}\n\n\n","import { Directive, Injector, INJECTOR, isDevMode, OnInit, input, output, inject, linkedSignal, computed } from '@angular/core';\nimport {\n BaseRemoteMethod,\n BaseRemoteMethodMetadata,\n RemoteMethodLoader,\n} from '@rxap/remote-method';\nimport {\n coerceBoolean,\n Deprecated,\n} from '@rxap/utilities';\nimport { IdOrInstanceOrToken } from '@rxap/definition';\nimport { RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN } from './tokens';\nimport { ToggleSubject } from '@rxap/rxjs';\n\n@Directive({\n selector: '[rxapRemoteMethod]',\n exportAs: 'rxapRemoteMethod',\n standalone: true,\n host: {\n '(confirmed)': 'onConfirmed()',\n '(click)': 'onClick()',\n },\n})\nexport class RemoteMethodDirective<ReturnType = any, Parameters = any, Metadata extends BaseRemoteMethodMetadata = BaseRemoteMethodMetadata>\n implements OnInit {\n protected readonly remoteMethodLoader = inject<RemoteMethodLoader>(RemoteMethodLoader);\n private readonly injector = inject<Injector>(INJECTOR) ?? Injector.NULL;\n private readonly remoteMethodToken = inject<any>(RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN, { optional: true, self: true });\n\n\n public readonly parameters = input<Parameters>();\n protected readonly currentParameters = linkedSignal(() => this.parameters());\n public readonly metadata = input<Metadata>();\n // eslint-disable-next-line @angular-eslint/no-output-rename\n public readonly executed$ = output({ alias: 'executed' });\n // eslint-disable-next-line @angular-eslint/no-output-rename\n public readonly failure$ = output<Error>({ alias: 'failure' });\n // eslint-disable-next-line @angular-eslint/no-output-rename\n public readonly successful$ = output<ReturnType>({ alias: 'successful' });\n public readonly immediately = input(false);\n /**\n * true - a remote method call is in progress\n */\n public executing$ = new ToggleSubject();\n\n public readonly remoteMethodOrIdOrToken = input<IdOrInstanceOrToken<BaseRemoteMethod<ReturnType, Parameters, Metadata>>>(undefined, { alias: 'rxapRemoteMethod' });\n\n protected readonly _remoteMethodOrIdOrToken = computed(() => this.remoteMethodOrIdOrToken() || this.remoteMethodToken);\n\n public readonly hasConfirmDirective = input(false, { alias: 'rxapConfirm', transform: coerceBoolean });\n\n public ngOnInit(): void {\n if (this.immediately()) {\n this.execute();\n }\n }\n\n public onConfirmed() {\n this.execute();\n }\n\n public onClick() {\n if (!this.hasConfirmDirective()) {\n this.execute();\n } else {\n console.debug('skip remote method call. Wait for confirmation.');\n }\n }\n\n public async execute(): Promise<void> {\n this.executing$.enable();\n try {\n const result = await this.remoteMethodLoader.call$(\n this._remoteMethodOrIdOrToken(),\n this.currentParameters(),\n this.metadata(),\n this.injector,\n );\n this.executed(result);\n this.successful(result);\n } catch (error: any) {\n if (isDevMode()) {\n console.error(`Remote method directive execution failed:`, error.message);\n }\n this.failure(error);\n } finally {\n this.executing$.disable();\n }\n }\n\n public setParameter<Key extends keyof Parameters>(parameterKey: Key, value: Parameters[Key]): void {\n this.updateParameters({ [parameterKey]: value } as any);\n }\n\n public updateParameters(parameters: Partial<Parameters>): void {\n this.currentParameters.set({ ...(this.currentParameters() ?? {}), ...parameters } as any);\n }\n\n protected executed(result: any) {\n this.executed$.emit(result);\n }\n\n protected failure(error: Error) {\n this.failure$.emit(error);\n }\n\n protected successful(result: ReturnType) {\n this.successful$.emit(result);\n }\n\n /**\n * @deprecated removed\n * @protected\n */\n @Deprecated('removed')\n protected async call(): Promise<any> {\n this.executing$.enable();\n const result = await this.remoteMethodLoader.call$(\n this._remoteMethodOrIdOrToken(),\n this.currentParameters(),\n this.metadata(),\n this.injector,\n );\n this.executing$.disable();\n return result;\n }\n\n}\n\n\n","// region \nexport * from './lib/error';\nexport * from './lib/remote-method-template-collection.directive';\nexport * from './lib/remote-method-template.directive';\nexport * from './lib/remote-method.directive';\nexport * from './lib/tokens';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEM,MAAO,8BAA+B,SAAQ,qBAAqB,CAAA;AAEvE,IAAA,WAAA,CAAY,OAAe,EAAE,IAAa,EAAE,KAAc,EAAA;QACxD,KAAK,CAAC,OAAO,EAAE,IAAI,IAAI,EAAE,EAAE,KAAK,CAAC;IACnC;AAED;;MCNY,kCAAkC,GAAG,IAAI,cAAc,CAAC,oCAAoC;;MCO5F,8CAA8C,CAAA;AACzD,IAAA,WAAA,CACS,SAAqB,EACrB,KAAa,EACb,KAAa,EAAA;QAFb,IAAA,CAAA,SAAS,GAAT,SAAS;QACT,IAAA,CAAA,KAAK,GAAL,KAAK;QACL,IAAA,CAAA,KAAK,GAAL,KAAK;IAEd;AAEA,IAAA,IAAI,KAAK,GAAA;AACP,QAAA,OAAO,IAAI,CAAC,KAAK,KAAK,CAAC;IACzB;AAEA,IAAA,IAAI,IAAI,GAAA;QACN,OAAO,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,GAAG,CAAC;IACtC;AAEA,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC;IAC7B;AAEA,IAAA,IAAI,GAAG,GAAA;AACL,QAAA,O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,SAAA,EAAA,WAAA,EAAA,YAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,WAAA,EAAA,eAAA,EAAA,OAAA,EAAA,WAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;AA4FhB,UAAA,CAAA;IADf,UAAU,CAAC,SAAS,CAAC;;;;AAWrB,CAAA,EAAA,qBAAA,CAAA,SAAA,EAAA,MAAA,EAAA,IAAA,CAAA;2FAtGU,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBATjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACJ,wBAAA,aAAa,EAAE,eAAe;AAC9B,wBAAA,SAAS,EAAE,WAAW;AACvB,qBAAA;AACF,iBAAA;;;ACtBD;AAMA;;ACNA;;AAEG;;;;"}
1
+ {"version":3,"file":"rxap-remote-method-directive.mjs","names":[],"sources":["../../../../../packages/angular/remote-method/directive/src/lib/error.ts","../../../../../packages/angular/remote-method/directive/src/lib/tokens.ts","../../../../../packages/angular/remote-method/directive/src/lib/remote-method-template-collection.directive.ts","../../../../../packages/angular/remote-method/directive/src/lib/remote-method-template.directive.ts","../../../../../packages/angular/remote-method/directive/src/lib/remote-method.directive.ts"],"sourcesContent":["import { RxapRemoteMethodError } from '@rxap/remote-method';\n\nexport class RxapRemoteMethodDirectiveError extends RxapRemoteMethodError {\n\n constructor(message: string, code?: string, scope?: string) {\n super(message, code ?? '', scope);\n }\n\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN = new InjectionToken('rxap/remote-method/directive/token');\n","import { ChangeDetectorRef, Directive, DoCheck, EmbeddedViewRef, Injector, INJECTOR, isDevMode, IterableChangeRecord, IterableChanges, IterableDiffer, IterableDiffers, OnInit, TemplateRef, TrackByFunction, ViewContainerRef, input, inject, computed, effect, untracked } from '@angular/core';\nimport {\n BaseRemoteMethod,\n BaseRemoteMethodMetadata,\n RemoteMethodLoader,\n} from '@rxap/remote-method';\nimport { IdOrInstanceOrToken } from '@rxap/definition';\nimport { RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN } from './tokens';\n\nexport class RemoteMethodTemplateCollectionDirectiveContext<ReturnType = any> {\n constructor(\n public $implicit: ReturnType,\n public index: number,\n public count: number,\n ) {\n }\n\n get first(): boolean {\n return this.index === 0;\n }\n\n get last(): boolean {\n return this.index === this.count - 1;\n }\n\n get even(): boolean {\n return this.index % 2 === 0;\n }\n\n get odd(): boolean {\n return !this.even;\n }\n}\n\nexport interface RemoteMethodTemplateCollectionDirectiveErrorContext {\n $implicit: Error;\n message?: string;\n name?: string;\n}\n\nfunction getTypeName(type: any): string {\n return type['name'] || typeof type;\n}\n\nclass RecordViewTuple<T> {\n constructor(public record: any, public view: EmbeddedViewRef<RemoteMethodTemplateCollectionDirectiveContext<T>>) {\n }\n}\n\n@Directive({\n selector: '[rxapRemoteMethodCollection]',\n exportAs: 'rxapRemoteMethodCollection',\n standalone: true,\n})\nexport class RemoteMethodTemplateCollectionDirective<ReturnType = any,\n Parameters = any,\n Metadata extends BaseRemoteMethodMetadata = BaseRemoteMethodMetadata>\n implements DoCheck, OnInit {\n private readonly template = inject<TemplateRef<RemoteMethodTemplateCollectionDirectiveContext<ReturnType>>>(TemplateRef);\n protected readonly remoteMethodLoader = inject<RemoteMethodLoader>(RemoteMethodLoader);\n private readonly injector = inject<Injector>(INJECTOR);\n private readonly viewContainerRef = inject<ViewContainerRef>(ViewContainerRef);\n protected readonly cdr = inject<ChangeDetectorRef>(ChangeDetectorRef);\n private readonly differs = inject<IterableDiffers>(IterableDiffers);\n private readonly remoteMethodToken = inject<any>(RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN, { optional: true, self: true });\n\n\n public readonly parameters = input<Parameters>(undefined, { alias: \"rxapRemoteMethodCollectionParameters\" });\n // eslint-disable-next-line @angular-eslint/no-input-rename\n public readonly emptyTemplate = input<TemplateRef<void>>(undefined, { alias: \"rxapRemoteMethodCollectionEmpty\" });\n // eslint-disable-next-line @angular-eslint/no-input-rename\n public readonly errorTemplate = input<TemplateRef<RemoteMethodTemplateCollectionDirectiveErrorContext>>(undefined, { alias: \"rxapRemoteMethodCollectionError\" });\n public readonly withoutParameters = input(false, { alias: \"rxapRemoteMethodCollectionWithoutParameters\" });\n private _differ: IterableDiffer<ReturnType> | null = null;\n private _dirty = true;\n /**\n * Indicates that the remote method returned a empty collection\n *\n * true - is empty\n * false - is NOT empty\n * null - unknown\n *\n * @private\n */\n private _empty: boolean | null = null;\n /**\n * Holds the error that call of the remote method throws\n *\n * @private\n */\n private _error: Error | null = null;\n /**\n * Holds the empty template view ref.\n *\n * Is used to determine if a empty template is added to the\n * view. And used to destruct the empty template if the remote method\n * changes from empty to not empty.\n *\n * @private\n */\n private _emptyTemplateViewRef: EmbeddedViewRef<void> | null = null;\n /**\n * Holds the error template view ref.\n *\n * Is used to determine if a error template is added to the\n * view. And used to destruct the error template if the remote method\n * is called again with an error.\n *\n * @private\n */\n private _errorTemplateViewRef: EmbeddedViewRef<RemoteMethodTemplateCollectionDirectiveErrorContext> | null = null;\n\n /**\n * A function that defines how to track changes for items in the iterable.\n *\n * When items are added, moved, or removed in the iterable,\n * the directive must re-render the appropriate DOM nodes.\n * To minimize churn in the DOM, only nodes that have changed\n * are re-rendered.\n *\n * By default, the change detector assumes that\n * the object instance identifies the node in the iterable.\n * When this function is supplied, the directive uses\n * the result of calling this function to identify the item node,\n * rather than the identity of the object itself.\n *\n * The function receives two inputs,\n * the iteration index and the node object ID.\n */\n public readonly trackBy = input<TrackByFunction<ReturnType>, TrackByFunction<ReturnType> | undefined>(\n undefined as any,\n {\n alias: 'rxapRemoteMethodCollectionTrackBy',\n transform: (fn) => {\n if (isDevMode() && fn != null && typeof fn !== 'function') {\n console.warn(\n `trackBy must be a function, but received ${ JSON.stringify(fn) }. ` +\n `See https://angular.io/api/common/NgForOf#change-propagation for more information.`);\n }\n return fn as TrackByFunction<ReturnType>;\n },\n },\n );\n\n public readonly remoteMethodOrIdOrToken = input<IdOrInstanceOrToken<BaseRemoteMethod<ReturnType[], Parameters, Metadata>>>(undefined, { alias: 'rxapRemoteMethodCollectionCall' });\n\n protected readonly _remoteMethodOrIdOrToken = computed(() => this.remoteMethodOrIdOrToken() || this.remoteMethodToken);\n\n /**\n * Holds the data that should be displayed\n * @private\n */\n private _data: ReturnType[] | null = null;\n\n protected set data(data: ReturnType[]) {\n this._data = data;\n this._dirty = true;\n }\n\n /**\n * Asserts the correct type of the context for the template that `NgForOf` will render.\n *\n * The presence of this method is a signal to the Ivy template type-check compiler that the\n * `NgForOf` structural directive renders its template with a specific context type.\n */\n static ngTemplateContextGuard<T>(dir: RemoteMethodTemplateCollectionDirective<T>, ctx: any):\n ctx is RemoteMethodTemplateCollectionDirectiveContext<T> {\n return true;\n }\n\n constructor() {\n // re-run whenever the bound parameters change\n effect(() => {\n const parameters = this.parameters();\n if (parameters !== undefined) {\n untracked(() => this.call(parameters));\n }\n });\n }\n\n public ngOnInit() {\n if (this.withoutParameters()) {\n this.call();\n }\n }\n\n public call(parameters?: Parameters): void {\n this.remoteMethodLoader\n .call$(this._remoteMethodOrIdOrToken(), parameters, undefined, this.injector)\n .then(response => {\n // guard against non-array responses (null/undefined/scalar) to\n // avoid reading .length off a non-iterable and crashing\n const isArray = Array.isArray(response);\n // a successful call clears a previous error, otherwise the error template sticks forever\n this._error = null;\n this._empty = !isArray || response.length === 0;\n this._data = isArray ? response : [];\n this.cdr.detectChanges();\n })\n .catch(error => {\n this._error = error;\n this.cdr.detectChanges();\n });\n }\n\n /**\n * Applies the changes when needed.\n */\n public ngDoCheck(): void {\n if (this._error !== null) {\n\n this.viewContainerRef.clear();\n this._differ = null;\n\n const errorTemplate = this.errorTemplate();\n if (errorTemplate) {\n this._errorTemplateViewRef = this.viewContainerRef.createEmbeddedView(errorTemplate, {\n $implicit: this._error,\n message: this._error.message,\n name: this._error.name,\n });\n }\n\n } else if (this._empty === true) {\n\n this.viewContainerRef.clear();\n this._differ = null;\n\n // attaches the empty template if the data source is empty\n const emptyTemplate = this.emptyTemplate();\n if (emptyTemplate) {\n this._emptyTemplateViewRef = this.viewContainerRef.createEmbeddedView(emptyTemplate);\n }\n\n } else if (this._empty === false) {\n\n // detach and destroy the empty template if the data source is not\n // empty any more\n if (this._emptyTemplateViewRef) {\n this._emptyTemplateViewRef.detach();\n this._emptyTemplateViewRef.destroy();\n this._emptyTemplateViewRef = null;\n }\n\n if (this._errorTemplateViewRef) {\n this._errorTemplateViewRef.detach();\n this._errorTemplateViewRef.destroy();\n this._errorTemplateViewRef = null;\n }\n\n if (this._data) {\n this._dirty = false;\n // React on ngForOf changes only once all inputs have been initialized\n const value = this._data;\n if (!this._differ && value) {\n try {\n this._differ = this.differs.find(value).create(this.trackBy());\n } catch {\n throw new Error(`Cannot find a differ supporting object '${ value }' of type '${\n getTypeName(value) }'. NgFor only supports binding to Iterables such as Arrays.`);\n }\n }\n }\n if (this._differ) {\n const changes = this._differ.diff(this._data);\n if (changes) {\n this.applyChanges(changes);\n }\n }\n }\n }\n\n protected applyChanges(changes: IterableChanges<ReturnType>) {\n\n const insertTuples: RecordViewTuple<ReturnType>[] = [];\n changes.forEachOperation(\n (item: IterableChangeRecord<any>, adjustedPreviousIndex: number | null, currentIndex: number | null) => {\n\n if (item.previousIndex == null) {\n\n // NgForOf is never \"null\" or \"undefined\" here because the differ detected\n // that a new item needs to be inserted from the iterable. This implies that\n // there is an iterable value for \"_ngForOf\".\n const view = this.viewContainerRef.createEmbeddedView(\n this.template,\n new RemoteMethodTemplateCollectionDirectiveContext<ReturnType>(null!, -1, -1),\n currentIndex === null ? undefined : currentIndex,\n );\n const tuple = new RecordViewTuple<ReturnType>(item, view);\n insertTuples.push(tuple);\n\n } else if (currentIndex == null) {\n\n this.viewContainerRef.remove(adjustedPreviousIndex === null ? undefined : adjustedPreviousIndex);\n\n } else if (adjustedPreviousIndex !== null) {\n\n const view = this.viewContainerRef.get(adjustedPreviousIndex)!;\n this.viewContainerRef.move(view, currentIndex);\n const tuple = new RecordViewTuple(\n item,\n <EmbeddedViewRef<RemoteMethodTemplateCollectionDirectiveContext<ReturnType>>>view,\n );\n insertTuples.push(tuple);\n\n }\n\n });\n\n for (let i = 0; i < insertTuples.length; i++) {\n this.perViewChange(insertTuples[i].view, insertTuples[i].record);\n }\n\n for (let i = 0,\n ilen = this.viewContainerRef.length; i < ilen; i++) {\n const viewRef = <EmbeddedViewRef<RemoteMethodTemplateCollectionDirectiveContext<ReturnType>>>this.viewContainerRef.get(\n i);\n viewRef.context.index = i;\n viewRef.context.count = ilen;\n }\n\n changes.forEachIdentityChange((record: any) => {\n const viewRef =\n <EmbeddedViewRef<RemoteMethodTemplateCollectionDirectiveContext<ReturnType>>>this.viewContainerRef.get(record.currentIndex);\n viewRef.context.$implicit = record.item;\n });\n\n }\n\n private perViewChange(\n view: EmbeddedViewRef<RemoteMethodTemplateCollectionDirectiveContext<ReturnType>>,\n record: IterableChangeRecord<any>,\n ) {\n view.context.$implicit = record.item;\n }\n\n}\n\n\n","import { ChangeDetectorRef, Directive, Injector, INJECTOR, isDevMode, OnInit, TemplateRef, ViewContainerRef, input, output, inject, linkedSignal, computed, effect, untracked } from '@angular/core';\nimport {\n BaseRemoteMethod,\n BaseRemoteMethodMetadata,\n RemoteMethodLoader,\n} from '@rxap/remote-method';\nimport {\n Deprecated,\n} from '@rxap/utilities';\nimport { IdOrInstanceOrToken } from '@rxap/definition';\nimport { RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN } from './tokens';\nimport { ToggleSubject } from '@rxap/rxjs';\n\nexport interface RemoteMethodTemplateDirectiveContext<ReturnType = any> {\n $implicit: ReturnType;\n}\n\nexport interface RemoteMethodTemplateDirectiveErrorContext {\n $implicit: Error;\n message: string;\n}\n\n@Directive({\n selector: '[rxapRemoteMethod]',\n exportAs: 'rxapRemoteMethod',\n standalone: true,\n})\nexport class RemoteMethodTemplateDirective<ReturnType = any, Parameters = any, Metadata extends BaseRemoteMethodMetadata = BaseRemoteMethodMetadata>\n implements OnInit {\n private readonly template = inject<TemplateRef<RemoteMethodTemplateDirectiveContext<ReturnType>>>(TemplateRef);\n protected readonly remoteMethodLoader = inject<RemoteMethodLoader>(RemoteMethodLoader);\n private readonly injector = inject<Injector>(INJECTOR);\n private readonly viewContainerRef = inject<ViewContainerRef>(ViewContainerRef);\n protected readonly cdr = inject<ChangeDetectorRef>(ChangeDetectorRef);\n private readonly remoteMethodToken = inject<any>(RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN, { optional: true, self: true });\n\n\n // TODO : remove template context Guard\n // the template context Guard must be defined with a concrete context type\n // else the context guard is resolved to any\n // For each child directive that should have a template context guard\n // the template context guard must be defined\n // eslint-disable-next-line @angular-eslint/no-output-rename\n public readonly executed$ = output({ alias: 'executed' });\n // eslint-disable-next-line @angular-eslint/no-output-rename\n public readonly failure$ = output<Error>({ alias: 'failure' });\n // eslint-disable-next-line @angular-eslint/no-output-rename\n public readonly successful$ = output<ReturnType>({ alias: 'successful' });\n public readonly metadata = input<Metadata>(undefined, { alias: \"rxapRemoteMethodMetadata\" });\n /**\n * true - a remote method call is in progress\n */\n public executing$ = new ToggleSubject();\n public readonly parameters = input<Parameters>(undefined, { alias: \"rxapRemoteMethodParameters\" });\n protected readonly currentParameters = linkedSignal(() => this.parameters());\n // eslint-disable-next-line @angular-eslint/no-input-rename\n public readonly errorTemplate = input<TemplateRef<RemoteMethodTemplateDirectiveErrorContext>>(undefined, { alias: \"rxapRemoteMethodError\" });\n // eslint-disable-next-line @angular-eslint/no-input-rename\n public readonly loadingTemplate = input<TemplateRef<void>>(undefined, { alias: \"rxapRemoteMethodLoading\" });\n public readonly withoutParameters = input(false, { alias: \"rxapRemoteMethodWithoutParameters\" });\n public readonly embedded = output();\n\n public readonly remoteMethodOrIdOrToken = input<IdOrInstanceOrToken<BaseRemoteMethod<ReturnType, Parameters, Metadata>>>(undefined, { alias: 'rxapRemoteMethodCall' });\n\n protected readonly _remoteMethodOrIdOrToken = computed(() => this.remoteMethodOrIdOrToken() || this.remoteMethodToken);\n\n // !! add generation of concrete template context guard to openapi schematics !!\n static ngTemplateContextGuard<T>(dir: RemoteMethodTemplateDirective<T>, ctx: any):\n ctx is RemoteMethodTemplateDirectiveContext<T> {\n return true;\n }\n\n constructor() {\n // re-run whenever the bound parameters change\n effect(() => {\n const parameters = this.parameters();\n if (parameters !== undefined) {\n untracked(() => this.execute(parameters));\n }\n });\n }\n\n public ngOnInit() {\n this.renderLoadingTemplate();\n if (this.withoutParameters()) {\n this.execute();\n }\n }\n\n public async execute(parameters: Parameters | undefined = this.currentParameters()): Promise<void> {\n this.executing$.enable();\n this.renderLoadingTemplate();\n try {\n const result = await this.remoteMethodLoader.call$(\n this._remoteMethodOrIdOrToken(),\n parameters,\n this.metadata(),\n this.injector,\n );\n this.executed(result);\n this.renderTemplate(result);\n this.successful(result);\n } catch (error: any) {\n if (isDevMode()) {\n console.error(`Remote method directive execution failed:`, error.message);\n }\n this.failure(error);\n } finally {\n this.executing$.disable();\n }\n }\n\n /**\n * @deprecated removed\n * @protected\n */\n @Deprecated('removed')\n public call(parameters?: Parameters): void {\n this.execute(parameters)\n .catch(error => console.error('Remote method template rendering failed: ' + error.message));\n }\n\n public setParameter<Key extends keyof Parameters>(parameterKey: Key, value: Parameters[Key]): void {\n this.updateParameters({ [parameterKey]: value } as any);\n }\n\n public updateParameters(parameters: Partial<Parameters>): void {\n this.currentParameters.set({ ...(this.currentParameters() ?? {}), ...parameters } as any);\n }\n\n protected executed(result: any) {\n this.executed$.emit(result);\n }\n\n protected failure(error: Error) {\n this.failure$.emit(error);\n }\n\n protected successful(result: ReturnType) {\n this.successful$.emit(result);\n }\n\n protected renderTemplate(result: ReturnType) {\n\n this.viewContainerRef.clear();\n\n try {\n this.viewContainerRef.createEmbeddedView(this.template, { $implicit: result });\n } catch (error: any) {\n const errorTemplate = this.errorTemplate();\n if (errorTemplate) {\n this.viewContainerRef.createEmbeddedView(\n errorTemplate,\n {\n $implicit: error,\n message: error.message,\n },\n );\n }\n console.error(error.message);\n }\n\n this.embedded.emit();\n\n this.cdr.detectChanges();\n\n }\n\n private renderLoadingTemplate() {\n const loadingTemplate = this.loadingTemplate();\n if (loadingTemplate) {\n this.viewContainerRef.clear();\n this.viewContainerRef.createEmbeddedView(loadingTemplate);\n }\n }\n\n}\n\n\n","import { Directive, Injector, INJECTOR, isDevMode, OnInit, input, output, inject, linkedSignal, computed } from '@angular/core';\nimport {\n BaseRemoteMethod,\n BaseRemoteMethodMetadata,\n RemoteMethodLoader,\n} from '@rxap/remote-method';\nimport {\n coerceBoolean,\n Deprecated,\n} from '@rxap/utilities';\nimport { IdOrInstanceOrToken } from '@rxap/definition';\nimport { RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN } from './tokens';\nimport { ToggleSubject } from '@rxap/rxjs';\n\n@Directive({\n selector: '[rxapRemoteMethod]',\n exportAs: 'rxapRemoteMethod',\n standalone: true,\n host: {\n '(confirmed)': 'onConfirmed()',\n '(click)': 'onClick()',\n },\n})\nexport class RemoteMethodDirective<ReturnType = any, Parameters = any, Metadata extends BaseRemoteMethodMetadata = BaseRemoteMethodMetadata>\n implements OnInit {\n protected readonly remoteMethodLoader = inject<RemoteMethodLoader>(RemoteMethodLoader);\n private readonly injector = inject<Injector>(INJECTOR) ?? Injector.NULL;\n private readonly remoteMethodToken = inject<any>(RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN, { optional: true, self: true });\n\n\n public readonly parameters = input<Parameters>();\n protected readonly currentParameters = linkedSignal(() => this.parameters());\n public readonly metadata = input<Metadata>();\n // eslint-disable-next-line @angular-eslint/no-output-rename\n public readonly executed$ = output({ alias: 'executed' });\n // eslint-disable-next-line @angular-eslint/no-output-rename\n public readonly failure$ = output<Error>({ alias: 'failure' });\n // eslint-disable-next-line @angular-eslint/no-output-rename\n public readonly successful$ = output<ReturnType>({ alias: 'successful' });\n public readonly immediately = input(false);\n /**\n * true - a remote method call is in progress\n */\n public executing$ = new ToggleSubject();\n\n public readonly remoteMethodOrIdOrToken = input<IdOrInstanceOrToken<BaseRemoteMethod<ReturnType, Parameters, Metadata>>>(undefined, { alias: 'rxapRemoteMethod' });\n\n protected readonly _remoteMethodOrIdOrToken = computed(() => this.remoteMethodOrIdOrToken() || this.remoteMethodToken);\n\n public readonly hasConfirmDirective = input(false, { alias: 'rxapConfirm', transform: coerceBoolean });\n\n public ngOnInit(): void {\n if (this.immediately()) {\n this.execute();\n }\n }\n\n public onConfirmed() {\n this.execute();\n }\n\n public onClick() {\n if (!this.hasConfirmDirective()) {\n this.execute();\n } else {\n console.debug('skip remote method call. Wait for confirmation.');\n }\n }\n\n public async execute(): Promise<void> {\n this.executing$.enable();\n try {\n const result = await this.remoteMethodLoader.call$(\n this._remoteMethodOrIdOrToken(),\n this.currentParameters(),\n this.metadata(),\n this.injector,\n );\n this.executed(result);\n this.successful(result);\n } catch (error: any) {\n if (isDevMode()) {\n console.error(`Remote method directive execution failed:`, error.message);\n }\n this.failure(error);\n } finally {\n this.executing$.disable();\n }\n }\n\n public setParameter<Key extends keyof Parameters>(parameterKey: Key, value: Parameters[Key]): void {\n this.updateParameters({ [parameterKey]: value } as any);\n }\n\n public updateParameters(parameters: Partial<Parameters>): void {\n this.currentParameters.set({ ...(this.currentParameters() ?? {}), ...parameters } as any);\n }\n\n protected executed(result: any) {\n this.executed$.emit(result);\n }\n\n protected failure(error: Error) {\n this.failure$.emit(error);\n }\n\n protected successful(result: ReturnType) {\n this.successful$.emit(result);\n }\n\n /**\n * @deprecated removed\n * @protected\n */\n @Deprecated('removed')\n protected async call(): Promise<any> {\n this.executing$.enable();\n const result = await this.remoteMethodLoader.call$(\n this._remoteMethodOrIdOrToken(),\n this.currentPar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