UNPKG

@rx-angular/template

Version:

**Fully** Reactive Component Template Rendering in Angular. @rx-angular/template aims to be a reflection of Angular's built in renderings just reactive.

1 lines 29.9 kB
{"version":3,"file":"template-for.mjs","sources":["../../../../libs/template/for/src/lib/for-view-context.ts","../../../../libs/template/for/src/lib/provide-legacy-reconciler.ts","../../../../libs/template/for/src/lib/for.config.ts","../../../../libs/template/for/src/lib/inject-reconciler.ts","../../../../libs/template/for/src/lib/for.directive.ts","../../../../libs/template/for/src/lib/provide-experimental-reconciler.ts","../../../../libs/template/for/src/template-for.ts"],"sourcesContent":["import { NgIterable } from '@angular/core';\nimport { RxDefaultListViewContext } from '@rx-angular/cdk/template';\n\nexport class RxForViewContext<\n T,\n U extends NgIterable<T> = NgIterable<T>,\n K = keyof T\n> extends RxDefaultListViewContext<T, U, K> {\n constructor(\n item: T,\n public rxForOf: U,\n customProps?: { count: number; index: number }\n ) {\n super(item, customProps);\n }\n}\n","import { inject, IterableDiffers, NgIterable, Provider } from '@angular/core';\nimport {\n createListTemplateManager,\n RxDefaultListViewContext,\n} from '@rx-angular/cdk/template';\nimport { INTERNAL_RX_FOR_RECONCILER_TOKEN } from './for.config';\nimport { ReconcileFactoryOptions } from './reconcile-factory';\n\nexport const LEGACY_RXFOR_RECONCILIATION_FACTORY = () => {\n const iterableDiffers = inject(IterableDiffers);\n return <T, U extends NgIterable<T> = NgIterable<T>>(\n options: ReconcileFactoryOptions<T, U>,\n ) => {\n const {\n values$,\n strategy$,\n viewContainerRef,\n template,\n strategyProvider,\n errorHandler,\n createViewContext,\n updateViewContext,\n cdRef,\n trackBy,\n parent,\n patchZone,\n } = options;\n const listManager = createListTemplateManager<\n T,\n RxDefaultListViewContext<T>\n >({\n iterableDiffers: iterableDiffers,\n renderSettings: {\n cdRef: cdRef,\n strategies: strategyProvider.strategies as any, // TODO: move strategyProvider\n defaultStrategyName: strategyProvider.primaryStrategy,\n parent,\n patchZone,\n errorHandler,\n },\n templateSettings: {\n viewContainerRef,\n templateRef: template,\n createViewContext,\n updateViewContext,\n },\n trackBy,\n });\n listManager.nextStrategy(strategy$);\n\n return listManager.render(values$);\n };\n};\n\nexport function provideLegacyRxForReconciliation(): Provider {\n return {\n provide: INTERNAL_RX_FOR_RECONCILER_TOKEN,\n useFactory: LEGACY_RXFOR_RECONCILIATION_FACTORY,\n };\n}\n","import { InjectionToken } from '@angular/core';\nimport { LEGACY_RXFOR_RECONCILIATION_FACTORY } from './provide-legacy-reconciler';\nimport { RxReconcileFactory } from './reconcile-factory';\n\n/** @internal */\nexport const INTERNAL_RX_FOR_RECONCILER_TOKEN =\n new InjectionToken<RxReconcileFactory>('rx-for-reconciler', {\n providedIn: 'root',\n factory: LEGACY_RXFOR_RECONCILIATION_FACTORY,\n });\n","import { inject } from '@angular/core';\nimport { INTERNAL_RX_FOR_RECONCILER_TOKEN } from './for.config';\n\nexport function injectReconciler() {\n return inject(INTERNAL_RX_FOR_RECONCILER_TOKEN);\n}\n","import {\n ChangeDetectorRef,\n Directive,\n DoCheck,\n EmbeddedViewRef,\n ErrorHandler,\n inject,\n Injector,\n Input,\n isSignal,\n NgIterable,\n NgZone,\n OnDestroy,\n OnInit,\n Signal,\n TemplateRef,\n TrackByFunction,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n coerceDistinctWith,\n coerceObservableWith,\n} from '@rx-angular/cdk/coercing';\nimport { toObservableMicrotaskInternal } from '@rx-angular/cdk/internals/core';\nimport {\n RxStrategyNames,\n RxStrategyProvider,\n} from '@rx-angular/cdk/render-strategies';\nimport { RxListViewComputedContext } from '@rx-angular/cdk/template';\nimport {\n isObservable,\n Observable,\n ReplaySubject,\n Subject,\n Subscription,\n} from 'rxjs';\nimport { shareReplay, switchAll } from 'rxjs/operators';\nimport { RxForViewContext } from './for-view-context';\nimport { injectReconciler } from './inject-reconciler';\n\n/**\n * @description Will be provided through Terser global definitions by Angular CLI\n * during the production build.\n */\ndeclare const ngDevMode: boolean;\n\n/**\n * @Directive RxFor\n *\n * @description\n *\n * The most common way to render lists in angular is by using the `*ngFor` structural directive. `*ngFor` is able\n * to take an arbitrary list of data and repeat a defined template per item of the list. However, it can\n * only do it synchronously.\n *\n * Compared to the `NgFor`, `RxFor` treats each child template as single renderable unit.\n * The change detection of the child templates get prioritized, scheduled and executed by\n * leveraging `RenderStrategies` under the hood.\n * This technique enables non-blocking rendering of lists and can be referred to as `concurrent mode`.\n *\n * Read more about this in the [strategies\n * section](https://www.rx-angular.io/docs/template/rx-for-directive#rxfor-with-concurrent-strategies).\n *\n * Furthermore, `RxFor` provides hooks to react to rendered items in form of a `renderCallback: Subject`.\n *\n * Together with the `RxRenderStrategies`, this makes the rendering behavior extremely versatile\n * and transparent for the developer.\n * Each instance of `RxFor` can be configured to render with different settings.\n *\n * Read more in the [official docs](https://www.rx-angular.io/docs/template/rx-for-directive)\n *\n * @docsCategory RxFor\n * @docsPage RxFor\n * @publicApi\n */\n@Directive({\n selector: '[rxFor][rxForOf]',\n standalone: true,\n})\nexport class RxFor<T, U extends NgIterable<T> = NgIterable<T>>\n implements OnInit, DoCheck, OnDestroy\n{\n /** @internal */\n private cdRef = inject(ChangeDetectorRef);\n /** @internal */\n private ngZone = inject(NgZone);\n /** @internal */\n private injector = inject(Injector);\n /** @internal */\n private viewContainerRef = inject(ViewContainerRef);\n /** @internal */\n private strategyProvider = inject(RxStrategyProvider);\n /** @internal */\n private errorHandler = inject(ErrorHandler);\n\n /** @internal */\n private staticValue?: U;\n /** @internal */\n private renderStatic = false;\n\n /**\n * @description\n * The iterable input\n *\n * @example\n * <ng-container *rxFor=\"heroes$; let hero\">\n * <app-hero [hero]=\"hero\"></app-hero>\n * </ng-container>\n *\n * @param { Observable<(U & NgIterable<T>) | undefined | null>\n * | Signal<(U & NgIterable<T>) | undefined | null>\n * | (U & NgIterable<T>)\n * | null\n * | undefined } potentialSignalOrObservable\n */\n @Input()\n set rxForOf(\n potentialSignalOrObservable:\n | Observable<(U & NgIterable<T>) | undefined | null>\n | Signal<(U & NgIterable<T>) | undefined | null>\n | (U & NgIterable<T>)\n | null\n | undefined,\n ) {\n if (isSignal(potentialSignalOrObservable)) {\n this.staticValue = undefined;\n this.renderStatic = false;\n this.observables$.next(\n toObservableMicrotaskInternal(potentialSignalOrObservable, {\n injector: this.injector,\n }),\n );\n } else if (!isObservable(potentialSignalOrObservable)) {\n this.staticValue = potentialSignalOrObservable;\n this.renderStatic = true;\n } else {\n this.staticValue = undefined;\n this.renderStatic = false;\n this.observables$.next(potentialSignalOrObservable);\n }\n }\n\n /**\n * @internal\n * A reference to the template that is created for each item in the iterable.\n * @see [template reference variable](guide/template-reference-variables)\n * (inspired by @angular/common `ng_for_of.ts`)\n */\n private _template: TemplateRef<RxForViewContext<T, U>>;\n @Input()\n set rxForTemplate(value: TemplateRef<RxForViewContext<T, U>>) {\n this._template = value;\n }\n\n /**\n * @description\n *\n * You can change the used `RenderStrategy` by using the `strategy` input of the `*rxFor`. It accepts\n * an `Observable<RxStrategyNames>` or\n * [`RxStrategyNames`](https://github.com/rx-angular/rx-angular/blob/b0630f69017cc1871d093e976006066d5f2005b9/libs/cdk/render-strategies/src/lib/model.ts#L52).\n *\n * The default value for strategy is\n * [`normal`](https://www.rx-angular.io/docs/template/cdk/render-strategies/strategies/concurrent-strategies).\n *\n * Read more about this in the\n * [official docs](https://www.rx-angular.io/docs/template/rx-for-directive#use-render-strategies-strategy).\n *\n * @example\n *\n * \\@Component({\n * selector: 'app-root',\n * template: `\n * <ng-container *rxFor=\"let hero of heroes$; strategy: strategy\">\n * <app-hero [hero]=\"hero\"></app-hero>\n * </ng-container>\n *\n * <ng-container *rxFor=\"let hero of heroes$; strategy: strategy$\">\n * <app-hero [hero]=\"hero\"></app-hero>\n * </ng-container>\n * `\n * })\n * export class AppComponent {\n * strategy = 'low';\n * strategy$ = of('immediate');\n * }\n *\n * @param {string | Observable<string> | undefined} strategyName\n * @see {@link strategies}\n */\n @Input()\n set rxForStrategy(\n strategyName: RxStrategyNames | Observable<RxStrategyNames> | undefined,\n ) {\n this.strategyInput$.next(strategyName);\n }\n\n /**\n * @description\n *\n * When local rendering strategies are used, we need to treat view and content queries in a\n * special way.\n * To make `*rxFor` in such situations, a certain mechanism is implemented to\n * execute change detection on the parent (`parent`).\n *\n * This is required if your components state is dependent on its view or content children:\n *\n * - `@ViewChild`\n * - `@ViewChildren`\n * - `@ContentChild`\n * - `@ContentChildren`\n *\n * Read more about this in the\n * [official\n * docs](https://www.rx-angular.io/docs/template/rx-for-directive#local-strategies-and-view-content-queries-parent).\n *\n * @example\n * \\@Component({\n * selector: 'app-root',\n * template: `\n * <app-list-component>\n * <app-list-item\n * *rxFor=\"\n * let item of items$;\n * trackBy: trackItem;\n * parent: true;\n * \"\n * >\n * <div>{{ item.name }}</div>\n * </app-list-item>\n * </app-list-component>\n * `\n * })\n * export class AppComponent {\n * items$ = itemService.getItems();\n * }\n *\n * @param {boolean} renderParent\n *\n * @deprecated this flag will be dropped soon, as it is no longer required when using signal based view & content\n * queries\n */\n @Input('rxForParent') renderParent = this.strategyProvider.config.parent;\n\n /**\n * @description\n *\n * A flag to control whether *rxFor templates are created within `NgZone` or not.\n * The default value is `true, `*rxFor` will create it's `EmbeddedViews` inside `NgZone`.\n *\n * Event listeners normally trigger zone. Especially high frequently events cause performance issues.\n *\n * Read more about this in the\n * [official\n * docs](https://www.rx-angular.io/docs/template/rx-for-directive#working-with-event-listeners-patchzone).\n *\n * @example\n * \\@Component({\n * selector: 'app-root',\n * template: `\n * <app-list-component>\n * <app-list-item\n * *rxFor=\"\n * let item of items$;\n * trackBy: trackItem;\n * patchZone: false;\n * \"\n * >\n * <div>{{ item.name }}</div>\n * </app-list-item>\n * </app-list-component>\n * `\n * })\n * export class AppComponent {\n * items$ = itemService.getItems();\n * }\n *\n * @param {boolean} patchZone\n */\n @Input('rxForPatchZone') patchZone = this.strategyProvider.config.patchZone;\n\n private defaultTrackBy: TrackByFunction<unknown> = (i, item) => item;\n\n /**\n * @description\n * A function or key 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, rxFor assumes that the object instance identifies the node in the iterable (equality check `===`).\n * When a function or key is supplied, rxFor uses the result to identify the item node.\n *\n * @example\n * \\@Component({\n * selector: 'app-root',\n * template: `\n * <app-list-component>\n * <app-list-item\n * *rxFor=\"\n * let item of items$;\n * trackBy: 'id';\n * \"\n * >\n * <div>{{ item.name }}</div>\n * </app-list-item>\n * </app-list-component>\n * `\n * })\n * export class AppComponent {\n * items$ = itemService.getItems();\n * }\n *\n * // OR\n *\n * \\@Component({\n * selector: 'app-root',\n * template: `\n * <app-list-component>\n * <app-list-item\n * *rxFor=\"\n * let item of items$;\n * trackBy: trackItem;\n * \"\n * >\n * <div>{{ item.name }}</div>\n * </app-list-item>\n * </app-list-component>\n * `\n * })\n * export class AppComponent {\n * items$ = itemService.getItems();\n * trackItem = (idx, item) => item.id;\n * }\n *\n * @param trackByFnOrKey\n */\n @Input('rxForTrackBy')\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n set trackBy(trackByFnOrKey: keyof T | ((idx: number, i: T) => any)) {\n if (\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n trackByFnOrKey != null &&\n typeof trackByFnOrKey !== 'string' &&\n typeof trackByFnOrKey !== 'function'\n ) {\n console.warn(\n `trackBy must be a function, but received ${JSON.stringify(\n trackByFnOrKey,\n )}.`,\n );\n }\n if (trackByFnOrKey == null) {\n this._trackBy = this.defaultTrackBy;\n } else {\n this._trackBy =\n typeof trackByFnOrKey !== 'function'\n ? (i, a) => a[trackByFnOrKey]\n : trackByFnOrKey;\n }\n }\n\n /**\n * @description\n * A `Subject` which emits whenever *rxFor finished rendering a set changes to the view.\n * This enables developers to perform actions when a list has finished rendering.\n * The `renderCallback` is useful in situations where you rely on specific DOM properties like the `height` a\n * table after all items got rendered.\n * It is also possible to use the renderCallback in order to determine if a view should be visible or not. This\n * way developers can hide a list as long as it has not finished rendering.\n *\n * The result of the `renderCallback` will contain the currently rendered set of items in the iterable.\n *\n * @example\n * \\Component({\n * selector: 'app-root',\n * template: `\n * <app-list-component>\n * <app-list-item\n * *rxFor=\"\n * let item of items$;\n * trackBy: trackItem;\n * renderCallback: itemsRendered;\n * \">\n * <div>{{ item.name }}</div>\n * </app-list-item>\n * </app-list-component>\n * `\n * })\n * export class AppComponent {\n * items$: Observable<Item[]> = itemService.getItems();\n * trackItem = (idx, item) => item.id;\n * // this emits whenever rxFor finished rendering changes\n * itemsRendered = new Subject<Item[]>();\n *\n * constructor(elementRef: ElementRef<HTMLElement>) {\n * itemsRendered.subscribe(() => {\n * // items are rendered, we can now scroll\n * elementRef.scrollTo({bottom: 0});\n * })\n * }\n * }\n *\n * @param {Subject<U>} renderCallback\n */\n @Input('rxForRenderCallback') set renderCallback(renderCallback: Subject<U>) {\n this._renderCallback = renderCallback;\n }\n\n private get template(): TemplateRef<RxForViewContext<T, U>> {\n return this._template || this.templateRef;\n }\n\n /** @internal */\n private strategyInput$ = new ReplaySubject<\n RxStrategyNames | Observable<RxStrategyNames>\n >(1);\n\n /** @internal */\n private observables$ = new ReplaySubject<Observable<U> | U>(1);\n\n /** @internal */\n private _renderCallback: Subject<any>;\n\n /** @internal */\n private readonly values$ = this.observables$.pipe(\n coerceObservableWith(),\n switchAll(),\n shareReplay({ refCount: true, bufferSize: 1 }),\n );\n\n /** @internal */\n private values: U | undefined | null = null;\n\n /** @internal */\n private readonly strategy$ = this.strategyInput$.pipe(coerceDistinctWith());\n\n /** @internal */\n private _subscription = new Subscription();\n\n /** @internal */\n _trackBy: TrackByFunction<T> = this.defaultTrackBy;\n /** @internal */\n _distinctBy = (a: T, b: T) => a === b;\n\n private reconciler = injectReconciler();\n\n constructor(\n private readonly templateRef: TemplateRef<RxForViewContext<T, U>>,\n ) {}\n\n /** @internal */\n ngOnInit() {\n this._subscription.add(this.values$.subscribe((v) => (this.values = v)));\n this._subscription.add(\n this.reconciler({\n values$: this.values$,\n strategy$: this.strategy$,\n viewContainerRef: this.viewContainerRef,\n template: this.template,\n strategyProvider: this.strategyProvider,\n errorHandler: this.errorHandler,\n cdRef: this.cdRef,\n trackBy: this._trackBy,\n createViewContext: this.createViewContext.bind(this),\n updateViewContext: this.updateViewContext.bind(this),\n parent: !!this.renderParent,\n patchZone: this.patchZone ? this.ngZone : undefined,\n }).subscribe((values) => this._renderCallback?.next(values)),\n );\n }\n\n /** @internal */\n createViewContext(\n item: T,\n computedContext: RxListViewComputedContext,\n ): RxForViewContext<T, U> {\n return new RxForViewContext<T, U>(item, this.values, computedContext);\n }\n\n /** @internal */\n updateViewContext(\n item: T,\n view: EmbeddedViewRef<RxForViewContext<T>>,\n computedContext: RxListViewComputedContext,\n ): void {\n view.context.updateContext(computedContext);\n view.context.rxForOf = this.values;\n view.context.$implicit = item;\n }\n\n /** @internal */\n ngDoCheck() {\n if (this.renderStatic) {\n this.observables$.next(this.staticValue);\n }\n }\n\n /** @internal */\n ngOnDestroy() {\n this._subscription.unsubscribe();\n this.viewContainerRef.clear();\n }\n\n /** @internal */\n static ngTemplateContextGuard<\n T,\n U extends NgIterable<T> = NgIterable<T>,\n K = keyof T,\n >(dir: RxFor<T, U>, ctx: any): ctx is RxForViewContext<T, U, K> {\n return true;\n }\n}\n","import { NgIterable, Provider } from '@angular/core';\nimport { onStrategy } from '@rx-angular/cdk/render-strategies';\nimport { reconcile, RxLiveCollection } from '@rx-angular/cdk/template';\nimport { combineLatest, concat, Observable, of } from 'rxjs';\nimport {\n catchError,\n ignoreElements,\n map,\n startWith,\n switchMap,\n} from 'rxjs/operators';\nimport { INTERNAL_RX_FOR_RECONCILER_TOKEN } from './for.config';\nimport { ReconcileFactoryOptions } from './reconcile-factory';\n\nexport function provideExperimentalRxForReconciliation(): Provider {\n return {\n provide: INTERNAL_RX_FOR_RECONCILER_TOKEN,\n useFactory:\n () =>\n <T, U extends NgIterable<T> = NgIterable<T>>(\n options: ReconcileFactoryOptions<T, U>,\n ) => {\n const {\n values$,\n strategy$,\n viewContainerRef,\n template,\n strategyProvider,\n errorHandler,\n createViewContext,\n updateViewContext,\n cdRef,\n trackBy,\n parent,\n patchZone,\n } = options;\n const liveCollection = new RxLiveCollection<T>(\n viewContainerRef,\n template,\n strategyProvider,\n createViewContext,\n updateViewContext,\n );\n return combineLatest([\n values$,\n strategy$.pipe(startWith(strategyProvider.primaryStrategy)),\n ]).pipe(\n switchMap(([iterable, strategyName]) => {\n if (iterable == null) {\n iterable = <U>[];\n }\n if (!iterable[Symbol.iterator]) {\n throw new Error(\n `Error trying to diff '${iterable}'. Only arrays and iterables are allowed`,\n );\n }\n const strategy = strategyProvider.strategies[strategyName]\n ? strategyName\n : strategyProvider.primaryStrategy;\n liveCollection.reset();\n reconcile(liveCollection, iterable, trackBy);\n liveCollection.updateIndexes();\n return <Observable<U>>liveCollection.flushQueue(strategy).pipe(\n (o$) =>\n parent && liveCollection.needHostUpdate\n ? concat(\n o$,\n onStrategy(\n null,\n strategyProvider.strategies[strategy],\n (_, work, options) => {\n work(cdRef, options.scope);\n },\n {\n scope: (cdRef as any).context ?? cdRef,\n ngZone: patchZone,\n },\n ).pipe(ignoreElements()),\n )\n : o$,\n map(() => iterable),\n );\n }),\n catchError((e) => {\n errorHandler.handleError(e);\n return of(null);\n }),\n );\n },\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAGM,MAAO,gBAIX,SAAQ,wBAAiC,CAAA;AACzC,IAAA,WAAA,CACE,IAAO,EACA,OAAU,EACjB,WAA8C,EAAA;AAE9C,QAAA,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC;QAHjB,IAAO,CAAA,OAAA,GAAP,OAAO;;AAKjB;;ACPM,MAAM,mCAAmC,GAAG,MAAK;AACtD,IAAA,MAAM,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;IAC/C,OAAO,CACL,OAAsC,KACpC;QACF,MAAM,EACJ,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