survey-angular-ui 2.5.29 → 2.5.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/survey-angular-ui.umd.js +19 -15
- package/bundles/survey-angular-ui.umd.js.map +1 -1
- package/component-factory.d.ts +2 -2
- package/components/popup/popup.service.d.ts +2 -3
- package/esm2015/component-factory.js +7 -2
- package/esm2015/components/popup/popup.service.js +7 -6
- package/esm2015/utils/dynamic.directive.js +10 -11
- package/fesm2015/survey-angular-ui.js +20 -16
- package/fesm2015/survey-angular-ui.js.map +1 -1
- package/package.json +2 -2
- package/utils/dynamic.directive.d.ts +3 -3
|
@@ -723,17 +723,22 @@
|
|
|
723
723
|
var componentType = this.creatorHash[elementType];
|
|
724
724
|
if (!componentType)
|
|
725
725
|
return null;
|
|
726
|
-
|
|
726
|
+
try {
|
|
727
|
+
return containerRef.createComponent(componentType);
|
|
728
|
+
}
|
|
729
|
+
catch (e) {
|
|
730
|
+
return containerRef.createComponent(resolver.resolveComponentFactory(componentType));
|
|
731
|
+
}
|
|
727
732
|
};
|
|
728
733
|
return AngularComponentFactory;
|
|
729
734
|
}());
|
|
730
735
|
AngularComponentFactory.Instance = new AngularComponentFactory();
|
|
731
736
|
|
|
732
737
|
var DynamicComponentDirective = /** @class */ (function () {
|
|
733
|
-
function DynamicComponentDirective(containerRef, templateRef,
|
|
738
|
+
function DynamicComponentDirective(containerRef, templateRef, injector) {
|
|
734
739
|
this.containerRef = containerRef;
|
|
735
740
|
this.templateRef = templateRef;
|
|
736
|
-
this.
|
|
741
|
+
this.injector = injector;
|
|
737
742
|
}
|
|
738
743
|
DynamicComponentDirective.prototype.ngOnChanges = function (changes) {
|
|
739
744
|
var _a;
|
|
@@ -748,11 +753,10 @@
|
|
|
748
753
|
};
|
|
749
754
|
DynamicComponentDirective.prototype.createComponent = function () {
|
|
750
755
|
this.containerRef.clear();
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
this.componentInstance = AngularComponentFactory.Instance.create(this.containerRef, this.component.default, this.resolver).instance;
|
|
756
|
+
var componentName = AngularComponentFactory.Instance.isComponentRegistered(this.component.name) ? this.component.name : this.component.default;
|
|
757
|
+
if (componentName) {
|
|
758
|
+
var resolver = this.injector.get(i0.NgModuleRef).componentFactoryResolver;
|
|
759
|
+
this.componentInstance = AngularComponentFactory.Instance.create(this.containerRef, componentName, resolver).instance;
|
|
756
760
|
}
|
|
757
761
|
if (!this.componentInstance) {
|
|
758
762
|
throw new Error("Can't create component with name: " + this.component.name + " and default: " + this.component.default);
|
|
@@ -771,14 +775,14 @@
|
|
|
771
775
|
};
|
|
772
776
|
return DynamicComponentDirective;
|
|
773
777
|
}());
|
|
774
|
-
DynamicComponentDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: DynamicComponentDirective, deps: [{ token: i0__namespace.ViewContainerRef }, { token: i0__namespace.TemplateRef }, { token: i0__namespace.
|
|
778
|
+
DynamicComponentDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: DynamicComponentDirective, deps: [{ token: i0__namespace.ViewContainerRef }, { token: i0__namespace.TemplateRef }, { token: i0__namespace.Injector }], target: i0__namespace.ɵɵFactoryTarget.Directive });
|
|
775
779
|
DynamicComponentDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: DynamicComponentDirective, selector: "[component]", inputs: { component: "component" }, usesOnChanges: true, ngImport: i0__namespace });
|
|
776
780
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: DynamicComponentDirective, decorators: [{
|
|
777
781
|
type: i0.Directive,
|
|
778
782
|
args: [{
|
|
779
783
|
selector: "[component]"
|
|
780
784
|
}]
|
|
781
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.ViewContainerRef }, { type: i0__namespace.TemplateRef }, { type: i0__namespace.
|
|
785
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.ViewContainerRef }, { type: i0__namespace.TemplateRef }, { type: i0__namespace.Injector }]; }, propDecorators: { component: [{
|
|
782
786
|
type: i0.Input
|
|
783
787
|
}] } });
|
|
784
788
|
|
|
@@ -989,10 +993,9 @@
|
|
|
989
993
|
}] } });
|
|
990
994
|
|
|
991
995
|
var PopupService = /** @class */ (function () {
|
|
992
|
-
function PopupService(injector, applicationRef
|
|
996
|
+
function PopupService(injector, applicationRef) {
|
|
993
997
|
this.injector = injector;
|
|
994
998
|
this.applicationRef = applicationRef;
|
|
995
|
-
this.componentFactoryResolver = componentFactoryResolver;
|
|
996
999
|
}
|
|
997
1000
|
PopupService.prototype.createComponent = function (popupViewModel) {
|
|
998
1001
|
var portalHost;
|
|
@@ -1002,7 +1005,8 @@
|
|
|
1002
1005
|
portalHost = new portal.DomPortalOutlet(popupViewModel.container, this.applicationRef, this.injector);
|
|
1003
1006
|
}
|
|
1004
1007
|
else {
|
|
1005
|
-
|
|
1008
|
+
var resolver = this.injector.get(i0.NgModuleRef).componentFactoryResolver;
|
|
1009
|
+
portalHost = new portal.DomPortalOutlet(popupViewModel.container, resolver, this.applicationRef, this.injector);
|
|
1006
1010
|
}
|
|
1007
1011
|
var portal$1 = new portal.ComponentPortal(PopupBaseContainerComponent);
|
|
1008
1012
|
var componentRef = portalHost.attach(portal$1);
|
|
@@ -1013,11 +1017,11 @@
|
|
|
1013
1017
|
};
|
|
1014
1018
|
return PopupService;
|
|
1015
1019
|
}());
|
|
1016
|
-
PopupService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PopupService, deps: [{ token: i0__namespace.Injector }, { token: i0__namespace.ApplicationRef }
|
|
1020
|
+
PopupService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PopupService, deps: [{ token: i0__namespace.Injector }, { token: i0__namespace.ApplicationRef }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1017
1021
|
PopupService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PopupService });
|
|
1018
1022
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PopupService, decorators: [{
|
|
1019
1023
|
type: i0.Injectable
|
|
1020
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.Injector }, { type: i0__namespace.ApplicationRef }
|
|
1024
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.Injector }, { type: i0__namespace.ApplicationRef }]; } });
|
|
1021
1025
|
|
|
1022
1026
|
var ModalComponent = /** @class */ (function () {
|
|
1023
1027
|
function ModalComponent(popupService) {
|