@pepperi-addons/ngx-lib 0.3.15-loader.26 → 0.3.15-loader.29

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.
@@ -3223,17 +3223,9 @@
3223
3223
  this.internalFormFieldClick = new core.EventEmitter();
3224
3224
  this.formValueChange = new core.EventEmitter();
3225
3225
  this.formFieldClick = new core.EventEmitter();
3226
+ this.componentMapper = new Map();
3227
+ this.createMap(); //temp - move to singleton service
3226
3228
  }
3227
- Object.defineProperty(PepDynamicFieldGeneratorComponent.prototype, "controlContainer", {
3228
- get: function () {
3229
- return this._controlContainer;
3230
- },
3231
- set: function (val) {
3232
- this._controlContainer = val;
3233
- },
3234
- enumerable: false,
3235
- configurable: true
3236
- });
3237
3229
  Object.defineProperty(PepDynamicFieldGeneratorComponent.prototype, "field", {
3238
3230
  set: function (value) {
3239
3231
  var _this = this;
@@ -3248,13 +3240,21 @@
3248
3240
  PepDynamicFieldGeneratorComponent.prototype.hasProperty = function (obj, prop) {
3249
3241
  return Object.prototype.hasOwnProperty.call(obj, prop);
3250
3242
  };
3243
+ PepDynamicFieldGeneratorComponent.prototype.createMap = function () {
3244
+ this.componentMapper.set('address', address.PepAddressComponent);
3245
+ this.componentMapper.set('attachment', attachment.PepAttachmentComponent);
3246
+ this.componentMapper.set('checkbox', checkbox.PepCheckboxComponent);
3247
+ this.componentMapper.set('date', date.PepDateComponent);
3248
+ this.componentMapper.set('textbox', textbox.PepTextboxComponent);
3249
+ };
3251
3250
  PepDynamicFieldGeneratorComponent.prototype.createControlDynamically = function () {
3252
- if (this._controlContainer) {
3253
- var factory = this.getComponentFactory();
3254
- // const factory = this._resolver.resolveComponentFactory(PepTextboxComponent);
3251
+ if (this.controlContainer) {
3252
+ //const factory: ComponentFactory<any> = this.getComponentFactory();
3253
+ // const factory = this.componentMapper.get(this._field.controlType);
3254
+ var factory = this._resolver.resolveComponentFactory(textbox.PepTextboxComponent);
3255
3255
  if (factory) {
3256
- var componentRef = this._controlContainer.createComponent(factory);
3257
- //const componentRef: ComponentRef<PepTextboxComponent> = this._controlContainer.createComponent(factory);
3256
+ // const componentRef: ComponentRef<any> = this.controlContainer.createComponent(factory);
3257
+ var componentRef = this.controlContainer.createComponent(factory);
3258
3258
  this._containerRef = componentRef.instance;
3259
3259
  this.setBaseProperties();
3260
3260
  this.setControlProperties();
@@ -3364,7 +3364,7 @@
3364
3364
  PepDynamicFieldGeneratorComponent.decorators = [
3365
3365
  { type: core.Component, args: [{
3366
3366
  selector: 'pep-dynamic-field-generator',
3367
- template: "<!-- <ng-container [formGroup]=\"form\"> -->\n <ng-container #controlContainer></ng-container>\n<!-- </ng-container> -->",
3367
+ template: "<!-- <ng-container [formGroup]=\"form\"> -->\n <div #controlContainer></div>\n<!-- </ng-container> -->",
3368
3368
  changeDetection: core.ChangeDetectionStrategy.OnPush,
3369
3369
  styles: [":host{width:100%;height:100%}"]
3370
3370
  },] }
@@ -3373,7 +3373,7 @@
3373
3373
  { type: core.ComponentFactoryResolver }
3374
3374
  ]; };
3375
3375
  PepDynamicFieldGeneratorComponent.propDecorators = {
3376
- controlContainer: [{ type: core.ViewChild, args: ['controlContainer', { read: core.ViewContainerRef, static: true },] }],
3376
+ controlContainer: [{ type: core.ViewChild, args: ['controlContainer', { read: core.ViewContainerRef },] }],
3377
3377
  field: [{ type: core.Input }],
3378
3378
  isActive: [{ type: core.Input }],
3379
3379
  uid: [{ type: core.Input }],