@tinkoff/ng-polymorpheus
Advanced tools
Comparing version 4.0.3 to 4.0.4
@@ -150,4 +150,5 @@ (function (global, factory) { | ||
var content = _b.content; | ||
var context = this.getContext(); | ||
if (this.viewRef) { | ||
this.viewRef.context = this.getContext(); | ||
this.viewRef.context = context; | ||
} | ||
@@ -171,6 +172,8 @@ if (this.componentRef) { | ||
this.componentRef = this.viewContainerRef.createComponent(componentFactory, 0, injector); | ||
// tslint:disable-next-line:triple-equals | ||
return; | ||
} | ||
else if (this.content != null) { | ||
this.viewRef = this.viewContainerRef.createEmbeddedView(this.template, this.getContext()); | ||
var $implicit = context instanceof PolymorpheusContext && context.$implicit; | ||
// tslint:disable-next-line:triple-equals | ||
if ($implicit != null) { | ||
this.viewRef = this.viewContainerRef.createEmbeddedView(this.template, context); | ||
} | ||
@@ -177,0 +180,0 @@ }; |
@@ -20,4 +20,5 @@ import { ChangeDetectorRef, ComponentFactoryResolver, Directive, Input, TemplateRef, } from '@angular/core'; | ||
ngOnChanges({ content }) { | ||
const context = this.getContext(); | ||
if (this.viewRef) { | ||
this.viewRef.context = this.getContext(); | ||
this.viewRef.context = context; | ||
} | ||
@@ -41,6 +42,8 @@ if (this.componentRef) { | ||
this.componentRef = this.viewContainerRef.createComponent(componentFactory, 0, injector); | ||
// tslint:disable-next-line:triple-equals | ||
return; | ||
} | ||
else if (this.content != null) { | ||
this.viewRef = this.viewContainerRef.createEmbeddedView(this.template, this.getContext()); | ||
const $implicit = context instanceof PolymorpheusContext && context.$implicit; | ||
// tslint:disable-next-line:triple-equals | ||
if ($implicit != null) { | ||
this.viewRef = this.viewContainerRef.createEmbeddedView(this.template, context); | ||
} | ||
@@ -88,2 +91,2 @@ } | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0bGV0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvbmctcG9seW1vcnBoZXVzL3Ny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mdPbkNoYW5nZXMoe2NvbnRlbnR9OiBTaW1wbGVDaGFuZ2VzKSB7XG4gICAgICAgIGlmICh0aGlzLnZpZXdSZWYpIHtcbiAgICAgICAgICAgIHRoaXMudmlld1JlZi5jb250ZXh0ID0gdGhpcy5nZXRDb250ZXh0KCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5jb21wb25lbnRSZWYpIHtcbiAgICAgICAgICAgIHRoaXMuY29tcG9uZW50UmVmLmluamVjdG9yLmdldChDaGFuZ2VEZXRlY3RvclJlZikubWFya0ZvckNoZWNrKCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIWNvbnRlbnQpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMudmlld0NvbnRhaW5lclJlZi5jbGVhcigpO1xuXG4gICAgICAgIGlmIChpc0NvbXBvbmVudCh0aGlzLmNvbnRlbnQpKSB7XG4gICAgICAgICAgICBjb25zdCBwcm94eSA9XG4gICAgICAgICAgICAgICAgdGhpcy5jb250ZXh0ICYmXG4gICAgICAgICAgICAgICAgbmV3IFByb3h5KHRoaXMuY29udGV4dCwge1xuICAgICAgICAgICAgICAgICAgICBnZXQ6IChfLCBrZXkpID0+IHRoaXMuY29udGV4dD8uW2tleSBhcyBrZXlvZiBDXSxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGNvbnN0IGluamVjdG9yID0gdGhpcy5jb250ZW50LmNyZWF0ZUluamVjdG9yKHRoaXMuaW5qZWN0b3IsIHByb3h5KTtcbiAgICAgICAgICAgIGNvbnN0IGNvbXBvbmVudEZhY3RvcnkgPSBpbmplY3RvclxuICAgICAgICAgICAgICAgIC5nZXQoQ29tcG9uZW50RmFjdG9yeVJlc29sdmVyKVxuICAgICAgICAgICAgICAgIC5yZXNvbHZlQ29tcG9uZW50RmFjdG9yeSh0aGlzLmNvbnRlbnQuY29tcG9uZW50KTtcblxuICAgICAgICAgICAgdGhpcy5jb21wb25lbnRSZWYgPSB0aGlzLnZpZXdDb250YWluZXJSZWYuY3JlYXRlQ29tcG9uZW50KFxuICAgICAgICAgICAgICAgIGNvbXBvbmVudEZhY3RvcnksXG4gICAgICAgICAgICAgICAgMCxcbiAgICAgICAgICAgICAgICBpbmplY3RvcixcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICAvLyB0c2xpbnQ6ZGlzYWJsZS1uZXh0LWxpbmU6dHJpcGxlLWVxdWFsc1xuICAgICAgICB9IGVsc2UgaWYgKHRoaXMuY29udGVudCAhPSBudWxsKSB7XG4gICAgICAgICAgICB0aGlzLnZpZXdSZWYgPSB0aGlzLnZpZXdDb250YWluZXJSZWYuY3JlYXRlRW1iZWRkZWRWaWV3KFxuICAgICAgICAgICAgICAgIHRoaXMudGVtcGxhdGUsXG4gICAgICAgICAgICAgICAgdGhpcy5nZXRDb250ZXh0KCksXG4gICAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgbmdEb0NoZWNrKCkge1xuICAgICAgICBpZiAoaXNEaXJlY3RpdmUodGhpcy5jb250ZW50KSkge1xuICAgICAgICAgICAgdGhpcy5jb250ZW50LmNoZWNrKCk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBzdGF0aWMgbmdUZW1wbGF0ZUNvbnRleHRHdWFyZDxUPihcbiAgICAgICAgX2RpcjogUG9seW1vcnBoZXVzT3V0bGV0RGlyZWN0aXZlPFQ+LFxuICAgICAgICBfY3R4OiBhbnksXG4gICAgKTogX2N0eCBpcyBQb2x5bW9ycGhldXNDb250ZXh0PHN0cmluZz4ge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9XG5cbiAgICBwcml2YXRlIGdldENvbnRleHQoKTogdW5rbm93biB7XG4gICAgICAgIGlmIChpc1RlbXBsYXRlKHRoaXMuY29udGVudCkgfHwgaXNDb21wb25lbnQodGhpcy5jb250ZW50KSkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29udGV4dDtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBuZXcgUG9seW1vcnBoZXVzQ29udGV4dChcbiAgICAgICAgICAgIHR5cGVvZiB0aGlzLmNvbnRlbnQgPT09ICdmdW5jdGlvbidcbiAgICAgICAgICAgICAgICA/IHRoaXMuY29udGVudCh0aGlzLmNvbnRleHQhKVxuICAgICAgICAgICAgICAgIDogdGhpcy5jb250ZW50LFxuICAgICAgICApO1xuICAgIH1cbn1cblxuZnVuY3Rpb24gaXNEaXJlY3RpdmU8QyBleHRlbmRzIFJlY29yZDxhbnksIGFueT4+KFxuICAgIGNvbnRlbnQ6IFBvbHltb3JwaGV1c0NvbnRlbnQ8Qz4sXG4pOiBjb250ZW50IGlzIFBvbHltb3JwaGV1c1RlbXBsYXRlPEM+IHtcbiAgICByZXR1cm4gY29udGVudCBpbnN0YW5jZW9mIFBvbHltb3JwaGV1c1RlbXBsYXRlO1xufVxuXG5mdW5jdGlvbiBpc0NvbXBvbmVudDxDIGV4dGVuZHMgUmVjb3JkPGFueSwgYW55Pj4oXG4gICAgY29udGVudDogUG9seW1vcnBoZXVzQ29udGVudDxDPixcbik6IGNvbnRlbnQgaXMgUG9seW1vcnBoZXVzQ29tcG9uZW50PGFueSwgQz4ge1xuICAgIHJldHVybiBjb250ZW50IGluc3RhbmNlb2YgUG9seW1vcnBoZXVzQ29tcG9uZW50O1xufVxuXG5mdW5jdGlvbiBpc1RlbXBsYXRlPEMgZXh0ZW5kcyBSZWNvcmQ8YW55LCBhbnk+PihcbiAgICBjb250ZW50OiBQb2x5bW9ycGhldXNDb250ZW50PEM+LFxuKTogY29udGVudCBpcyBQb2x5bW9ycGhldXNUZW1wbGF0ZTxDPiB8IFRlbXBsYXRlUmVmPEM+IHtcbiAgICByZXR1cm4gaXNEaXJlY3RpdmUoY29udGVudCkgfHwgY29udGVudCBpbnN0YW5jZW9mIFRlbXBsYXRlUmVmO1xufVxuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW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F0ZSgpOiBUZW1wbGF0ZVJlZjx1bmtub3duPiB7XHJcbiAgICAgICAgaWYgKGlzRGlyZWN0aXZlKHRoaXMuY29udGVudCkpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29udGVudC50ZW1wbGF0ZTtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHJldHVybiB0aGlzLmNvbnRlbnQgaW5zdGFuY2VvZiBUZW1wbGF0ZVJlZiA/IHRoaXMuY29udGVudCA6IHRoaXMudGVtcGxhdGVSZWY7XHJcbiAgICB9XHJcblxyXG4gICAgbmdPbkNoYW5nZXMoe2NvbnRlbnR9OiBTaW1wbGVDaGFuZ2VzKSB7XHJcbiAgICAgICAgY29uc3QgY29udGV4dCA9IHRoaXMuZ2V0Q29udGV4dCgpO1xyXG5cclxuICAgICAgICBpZiAodGhpcy52aWV3UmVmKSB7XHJcbiAgICAgICAgICAgIHRoaXMudmlld1JlZi5jb250ZXh0ID0gY29udGV4dDtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIGlmICh0aGlzLmNvbXBvbmVudFJlZikge1xyXG4gICAgICAgICAgICB0aGlzLmNvbXBvbmVudFJlZi5pbmplY3Rvci5nZXQoQ2hhbmdlRGV0ZWN0b3JSZWYpLm1hcmtGb3JDaGVjaygpO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgaWYgKCFjb250ZW50KSB7XHJcbiAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHRoaXMudmlld0NvbnRhaW5lclJlZi5jbGVhcigpO1xyXG5cclxuICAgICAgICBpZiAoaXNDb21wb25lbnQodGhpcy5jb250ZW50KSkge1xyXG4gICAgICAgICAgICBjb25zdCBwcm94eSA9XHJcbiAgICAgICAgICAgICAgICB0aGlzLmNvbnRleHQgJiZcclxuICAgICAgICAgICAgICAgIG5ldyBQcm94eSh0aGlzLmNvbnRleHQsIHtcclxuICAgICAgICAgICAgICAgICAgICBnZXQ6IChfLCBrZXkpID0+IHRoaXMuY29udGV4dD8uW2tleSBhcyBrZXlvZiBDXSxcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICBjb25zdCBpbmplY3RvciA9IHRoaXMuY29udGVudC5jcmVhdGVJbmplY3Rvcih0aGlzLmluamVjdG9yLCBwcm94eSk7XHJcbiAgICAgICAgICAgIGNvbnN0IGNvbXBvbmVudEZhY3RvcnkgPSBpbmplY3RvclxyXG4gICAgICAgICAgICAgICAgLmdldChDb21wb25lbnRGYWN0b3J5UmVzb2x2ZXIpXHJcbiAgICAgICAgICAgICAgICAucmVzb2x2ZUNvbXBvbmVudEZhY3RvcnkodGhpcy5jb250ZW50LmNvbXBvbmVudCk7XHJcblxyXG4gICAgICAgICAgICB0aGlzLmNvbXBvbmVudFJlZiA9IHRoaXMudmlld0NvbnRhaW5lclJlZi5jcmVhdGVDb21wb25lbnQoXHJcbiAgICAgICAgICAgICAgICBjb21wb25lbnRGYWN0b3J5LFxyXG4gICAgICAgICAgICAgICAgMCxcclxuICAgICAgICAgICAgICAgIGluamVjdG9yLFxyXG4gICAgICAgICAgICApO1xyXG5cclxuICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgY29uc3QgJGltcGxpY2l0ID0gY29udGV4dCBpbnN0YW5jZW9mIFBvbHltb3JwaGV1c0NvbnRleHQgJiYgY29udGV4dC4kaW1wbGljaXQ7XHJcblxyXG4gICAgICAgIC8vIHRzbGludDpkaXNhYmxlLW5leHQtbGluZTp0cmlwbGUtZXF1YWxzXHJcbiAgICAgICAgaWYgKCRpbXBsaWNpdCAhPSBudWxsKSB7XHJcbiAgICAgICAgICAgIHRoaXMudmlld1JlZiA9IHRoaXMudmlld0NvbnRhaW5lclJlZi5jcmVhdGVFbWJlZGRlZFZpZXcoXHJcbiAgICAgICAgICAgICAgICB0aGlzLnRlbXBsYXRlLFxyXG4gICAgICAgICAgICAgICAgY29udGV4dCxcclxuICAgICAgICAgICAgKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgbmdEb0NoZWNrKCkge1xyXG4gICAgICAgIGlmIChpc0RpcmVjdGl2ZSh0aGlzLmNvbnRlbnQpKSB7XHJcbiAgICAgICAgICAgIHRoaXMuY29udGVudC5jaGVjaygpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICBzdGF0aWMgbmdUZW1wbGF0ZUNvbnRleHRHdWFyZDxUPihcclxuICAgICAgICBfZGlyOiBQb2x5bW9ycGhldXNPdXRsZXREaXJlY3RpdmU8VD4sXHJcbiAgICAgICAgX2N0eDogYW55LFxyXG4gICAgKTogX2N0eCBpcyBQb2x5bW9ycGhldXNDb250ZXh0PHN0cmluZz4ge1xyXG4gICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgfVxyXG5cclxuICAgIHByaXZhdGUgZ2V0Q29udGV4dCgpOiB1bmtub3duIHtcclxuICAgICAgICBpZiAoaXNUZW1wbGF0ZSh0aGlzLmNvbnRlbnQpIHx8IGlzQ29tcG9uZW50KHRoaXMuY29udGVudCkpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29udGV4dDtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHJldHVybiBuZXcgUG9seW1vcnBoZXVzQ29udGV4dChcclxuICAgICAgICAgICAgdHlwZW9mIHRoaXMuY29udGVudCA9PT0gJ2Z1bmN0aW9uJ1xyXG4gICAgICAgICAgICAgICAgPyB0aGlzLmNvbnRlbnQodGhpcy5jb250ZXh0ISlcclxuICAgICAgICAgICAgICAgIDogdGhpcy5jb250ZW50LFxyXG4gICAgICAgICk7XHJcbiAgICB9XHJcbn1cclxuXHJcbmZ1bmN0aW9uIGlzRGlyZWN0aXZlPEMgZXh0ZW5kcyBSZWNvcmQ8YW55LCBhbnk+PihcclxuICAgIGNvbnRlbnQ6IFBvbHltb3JwaGV1c0NvbnRlbnQ8Qz4sXHJcbik6IGNvbnRlbnQgaXMgUG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nQgdHlwZSBQb2x5bW9ycGhldXNIYW5kbGVyPEMgZXh0ZW5kcyBSZWNvcmQ8YW55LCBhbnk+PiA9IChcclxuICAgIGNvbnRleHQ6IEMsXHJcbikgPT4gc3RyaW5nIHwgbnVtYmVyO1xyXG4iXX0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGFuZGxlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL25nLXBvbHltb3JwaGV1cy9zcmMvdHlwZXMvaGFuZGxlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXHJcbiAqIEEgaGFuZGxlciBmdW5jdGlvbiByZWNlaXZpbmcgY29udGV4dCBhcyBpbnB1dCBhbmQgcmV0dXJuaW5nIGEgcHJpbWl0aXZlXHJcbiAqL1xyXG5leHBvcnQgdHlwZSBQb2x5bW9ycGhldXNIYW5kbGVyPEMgZXh0ZW5kcyBSZWNvcmQ8YW55LCBhbnk+PiA9IChcclxuICAgIGNvbnRleHQ6IEMsXHJcbikgPT4gc3RyaW5nIHwgbnVtYmVyIHwgbnVsbCB8IHVuZGVmaW5lZDtcclxuIl19 |
@@ -104,4 +104,5 @@ import * as i0 from '@angular/core'; | ||
ngOnChanges({ content }) { | ||
const context = this.getContext(); | ||
if (this.viewRef) { | ||
this.viewRef.context = this.getContext(); | ||
this.viewRef.context = context; | ||
} | ||
@@ -125,6 +126,8 @@ if (this.componentRef) { | ||
this.componentRef = this.viewContainerRef.createComponent(componentFactory, 0, injector); | ||
// tslint:disable-next-line:triple-equals | ||
return; | ||
} | ||
else if (this.content != null) { | ||
this.viewRef = this.viewContainerRef.createEmbeddedView(this.template, this.getContext()); | ||
const $implicit = context instanceof PolymorpheusContext && context.$implicit; | ||
// tslint:disable-next-line:triple-equals | ||
if ($implicit != null) { | ||
this.viewRef = this.viewContainerRef.createEmbeddedView(this.template, context); | ||
} | ||
@@ -131,0 +134,0 @@ } |
{ | ||
"name": "@tinkoff/ng-polymorpheus", | ||
"version": "4.0.3", | ||
"version": "4.0.4", | ||
"peerDependencies": { | ||
@@ -5,0 +5,0 @@ "@angular/core": ">=12.0.0" |
/** | ||
* A handler function receiving context as input and returning a primitive | ||
*/ | ||
export declare type PolymorpheusHandler<C extends Record<any, any>> = (context: C) => string | number; | ||
export declare type PolymorpheusHandler<C extends Record<any, any>> = (context: C) => string | number | null | undefined; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
99803
758