@3kles/kles-material-dynamicforms 1.1.10 → 1.1.13

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 (95) hide show
  1. package/3kles-kles-material-dynamicforms.metadata.json +1 -1
  2. package/bundles/3kles-kles-material-dynamicforms.umd.js +94 -27
  3. package/bundles/3kles-kles-material-dynamicforms.umd.js.map +1 -1
  4. package/bundles/3kles-kles-material-dynamicforms.umd.min.js +2 -2
  5. package/bundles/3kles-kles-material-dynamicforms.umd.min.js.map +1 -1
  6. package/esm2015/lib/directive/dynamic-field.directive.js +1 -2
  7. package/esm2015/lib/fields/array.component.js +4 -4
  8. package/esm2015/lib/fields/badge.component.js +7 -4
  9. package/esm2015/lib/fields/button-form.component.js +5 -2
  10. package/esm2015/lib/fields/button-submit.component.js +4 -1
  11. package/esm2015/lib/fields/button-toogle-group.component.js +4 -6
  12. package/esm2015/lib/fields/buttonchecker-form.component.js +6 -3
  13. package/esm2015/lib/fields/buttonfile-form.component.js +4 -1
  14. package/esm2015/lib/fields/checkbox.component.js +4 -1
  15. package/esm2015/lib/fields/chip.component.js +4 -1
  16. package/esm2015/lib/fields/color.component.js +4 -1
  17. package/esm2015/lib/fields/date.component.js +4 -1
  18. package/esm2015/lib/fields/field.abstract.js +11 -2
  19. package/esm2015/lib/fields/group.component.js +4 -1
  20. package/esm2015/lib/fields/icon.component.js +4 -1
  21. package/esm2015/lib/fields/input.clearable.component.js +5 -2
  22. package/esm2015/lib/fields/input.component.js +4 -1
  23. package/esm2015/lib/fields/label.component.js +4 -1
  24. package/esm2015/lib/fields/line-break.component.js +4 -1
  25. package/esm2015/lib/fields/link.component.js +4 -1
  26. package/esm2015/lib/fields/list-field.component.js +4 -1
  27. package/esm2015/lib/fields/radio.component.js +6 -3
  28. package/esm2015/lib/fields/select.component.js +8 -5
  29. package/esm2015/lib/fields/select.search.component.js +10 -10
  30. package/esm2015/lib/fields/selection-list.component.js +4 -1
  31. package/esm2015/lib/fields/slide-toggle.component.js +6 -3
  32. package/esm2015/lib/fields/text.component.js +4 -1
  33. package/esm2015/lib/fields/textarea.component.js +6 -3
  34. package/esm2015/lib/forms/buttonfile-control.component.js +1 -5
  35. package/esm5/lib/directive/dynamic-field.directive.js +1 -2
  36. package/esm5/lib/fields/array.component.js +4 -4
  37. package/esm5/lib/fields/badge.component.js +7 -4
  38. package/esm5/lib/fields/button-form.component.js +5 -2
  39. package/esm5/lib/fields/button-submit.component.js +4 -1
  40. package/esm5/lib/fields/button-toogle-group.component.js +4 -6
  41. package/esm5/lib/fields/buttonchecker-form.component.js +5 -2
  42. package/esm5/lib/fields/buttonfile-form.component.js +4 -1
  43. package/esm5/lib/fields/checkbox.component.js +4 -1
  44. package/esm5/lib/fields/chip.component.js +4 -1
  45. package/esm5/lib/fields/color.component.js +4 -1
  46. package/esm5/lib/fields/date.component.js +4 -1
  47. package/esm5/lib/fields/field.abstract.js +9 -2
  48. package/esm5/lib/fields/group.component.js +4 -1
  49. package/esm5/lib/fields/icon.component.js +4 -1
  50. package/esm5/lib/fields/input.clearable.component.js +5 -2
  51. package/esm5/lib/fields/input.component.js +4 -1
  52. package/esm5/lib/fields/label.component.js +4 -1
  53. package/esm5/lib/fields/line-break.component.js +4 -1
  54. package/esm5/lib/fields/link.component.js +4 -1
  55. package/esm5/lib/fields/list-field.component.js +4 -1
  56. package/esm5/lib/fields/radio.component.js +6 -3
  57. package/esm5/lib/fields/select.component.js +5 -2
  58. package/esm5/lib/fields/select.search.component.js +7 -7
  59. package/esm5/lib/fields/selection-list.component.js +4 -1
  60. package/esm5/lib/fields/slide-toggle.component.js +6 -3
  61. package/esm5/lib/fields/text.component.js +4 -1
  62. package/esm5/lib/fields/textarea.component.js +6 -3
  63. package/esm5/lib/forms/buttonfile-control.component.js +1 -5
  64. package/fesm2015/3kles-kles-material-dynamicforms.js +105 -36
  65. package/fesm2015/3kles-kles-material-dynamicforms.js.map +1 -1
  66. package/fesm5/3kles-kles-material-dynamicforms.js +96 -29
  67. package/fesm5/3kles-kles-material-dynamicforms.js.map +1 -1
  68. package/lib/fields/array.component.d.ts +3 -2
  69. package/lib/fields/badge.component.d.ts +4 -3
  70. package/lib/fields/button-form.component.d.ts +3 -2
  71. package/lib/fields/button-submit.component.d.ts +3 -2
  72. package/lib/fields/button-toogle-group.component.d.ts +3 -2
  73. package/lib/fields/buttonchecker-form.component.d.ts +3 -2
  74. package/lib/fields/buttonfile-form.component.d.ts +3 -2
  75. package/lib/fields/checkbox.component.d.ts +3 -2
  76. package/lib/fields/chip.component.d.ts +3 -2
  77. package/lib/fields/color.component.d.ts +3 -2
  78. package/lib/fields/date.component.d.ts +3 -2
  79. package/lib/fields/field.abstract.d.ts +5 -2
  80. package/lib/fields/group.component.d.ts +3 -2
  81. package/lib/fields/icon.component.d.ts +3 -2
  82. package/lib/fields/input.clearable.component.d.ts +3 -2
  83. package/lib/fields/input.component.d.ts +3 -2
  84. package/lib/fields/label.component.d.ts +3 -2
  85. package/lib/fields/line-break.component.d.ts +3 -2
  86. package/lib/fields/link.component.d.ts +3 -2
  87. package/lib/fields/list-field.component.d.ts +3 -2
  88. package/lib/fields/radio.component.d.ts +3 -2
  89. package/lib/fields/select.component.d.ts +3 -2
  90. package/lib/fields/select.search.component.d.ts +0 -1
  91. package/lib/fields/selection-list.component.d.ts +3 -2
  92. package/lib/fields/slide-toggle.component.d.ts +3 -2
  93. package/lib/fields/text.component.d.ts +3 -2
  94. package/lib/fields/textarea.component.d.ts +4 -3
  95. package/package.json +1 -1
@@ -545,6 +545,7 @@
545
545
 
546
546
  var KlesFieldAbstract = /** @class */ (function () {
547
547
  function KlesFieldAbstract() {
548
+ this._onDestroy = new rxjs.Subject();
548
549
  }
549
550
  KlesFieldAbstract.prototype.ngOnInit = function () {
550
551
  var _this = this;
@@ -553,7 +554,7 @@
553
554
  if (this.field.valueChanges) {
554
555
  this.field.valueChanges(this.field, this.group, this.siblingFields);
555
556
  }
556
- (_a = this.group.controls[this.field.name]) === null || _a === void 0 ? void 0 : _a.valueChanges.pipe().subscribe(function (val) {
557
+ (_a = this.group.controls[this.field.name]) === null || _a === void 0 ? void 0 : _a.valueChanges.pipe(operators.takeUntil(this._onDestroy)).subscribe(function (val) {
557
558
  if (_this.field.valueChanges) {
558
559
  _this.field.valueChanges(_this.field, _this.group, _this.siblingFields, val);
559
560
  }
@@ -562,6 +563,10 @@
562
563
  };
563
564
  KlesFieldAbstract.prototype.ngAfterViewInit = function () {
564
565
  };
566
+ KlesFieldAbstract.prototype.ngOnDestroy = function () {
567
+ this._onDestroy.next();
568
+ this._onDestroy.complete();
569
+ };
565
570
  KlesFieldAbstract.prototype.applyPipeTransform = function () {
566
571
  if (this.group && this.field) {
567
572
  var control_1 = this.group.controls[this.field.name];
@@ -596,6 +601,9 @@
596
601
  this.group.controls[this.field.name].disable();
597
602
  _super.prototype.ngOnInit.call(this);
598
603
  };
604
+ KlesFormLabelComponent.prototype.ngOnDestroy = function () {
605
+ _super.prototype.ngOnDestroy.call(this);
606
+ };
599
607
  KlesFormLabelComponent = __decorate([
600
608
  core.Component({
601
609
  selector: "kles-form-label",
@@ -659,6 +667,9 @@
659
667
  return value ? value : '';
660
668
  }
661
669
  };
670
+ KlesFormInputComponent.prototype.ngOnDestroy = function () {
671
+ _super.prototype.ngOnDestroy.call(this);
672
+ };
662
673
  KlesFormInputComponent = __decorate([
663
674
  core.Component({
664
675
  selector: 'kles-form-input',
@@ -677,6 +688,9 @@
677
688
  KlesFormSubmitButtonComponent.prototype.ngOnInit = function () {
678
689
  _super.prototype.ngOnInit.call(this);
679
690
  };
691
+ KlesFormSubmitButtonComponent.prototype.ngOnDestroy = function () {
692
+ _super.prototype.ngOnDestroy.call(this);
693
+ };
680
694
  KlesFormSubmitButtonComponent = __decorate([
681
695
  core.Component({
682
696
  selector: 'kles-submit-button',
@@ -707,6 +721,9 @@
707
721
  this.options$ = this.field.options;
708
722
  }
709
723
  };
724
+ KlesFormSelectComponent.prototype.ngOnDestroy = function () {
725
+ _super.prototype.ngOnDestroy.call(this);
726
+ };
710
727
  KlesFormSelectComponent.prototype.openChange = function ($event) {
711
728
  if (this.field.virtualScroll) {
712
729
  if ($event) {
@@ -724,7 +741,7 @@
724
741
  KlesFormSelectComponent = __decorate([
725
742
  core.Component({
726
743
  selector: 'kles-form-select',
727
- template: "\n <mat-form-field class=\"margin-top\" [formGroup]=\"group\">\n <mat-select matTooltip=\"{{field.tooltip}}\" [attr.id]=\"field.id\"\n (openedChange)=\"openChange($event)\" [compareWith]=\"compareFn\"\n [ngClass]=\"field.ngClass\" [placeholder]=\"field.placeholder | translate\" [formControlName]=\"field.name\" [multiple]=\"field.multiple\">\n <mat-select-trigger *ngIf=\"field.triggerComponent\">\n <ng-container klesComponent [component]=\"field.triggerComponent\" [value]=\"group.controls[field.name].value\" [field]=\"field\"></ng-container>\n </mat-select-trigger>\n\n\n <ng-container *ngIf=\"!field.virtualScroll\">\n <ng-container *ngIf=\"!field.autocompleteComponent\">\n <mat-option *ngFor=\"let item of options$ | async\" [value]=\"item\">{{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}</mat-option>\n </ng-container>\n\n <ng-container *ngIf=\"field.autocompleteComponent\">\n <mat-option *ngFor=\"let item of options$ | async\" [value]=\"item\">\n <ng-container klesComponent [component]=\"field.autocompleteComponent\" [value]=\"item\" [field]=\"field\"></ng-container>\n </mat-option>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"field.virtualScroll\">\n <cdk-virtual-scroll-viewport [itemSize]=\"field.itemSize || 50\" [style.height.px]=5*48>\n <ng-container *ngIf=\"!field.autocompleteComponent\">\n <mat-option *cdkVirtualFor=\"let item of options$ | async\" [value]=\"item\">\n {{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}\n </mat-option>\n\n <ng-container *ngIf=\"field.multiple\">\n <mat-option *ngFor=\"let item of group.controls[field.name].value | slice:0:30\" [value]=\"item\"\n style=\"display:none\">\n {{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}\n </mat-option>\n </ng-container>\n\n <ng-container *ngIf=\"!field.multiple && group.controls[field.name].value\">\n <mat-option *ngFor=\"let item of [group?.controls[field.name]?.value]\" [value]=\"item\" style=\"display:none\">\n {{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}\n </mat-option>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"field.autocompleteComponent\">\n <mat-option *cdkVirtualFor=\"let item of options$ | async\" [value]=\"item\">\n <ng-container klesComponent [component]=\"field.autocompleteComponent\" [value]=\"item\" [field]=\"field\"></ng-container>\n </mat-option>\n <ng-container *ngIf=\"field.multiple\">\n <mat-option *ngFor=\"let item of group.controls[field.name].value | slice:0:30\" [value]=\"item\"\n style=\"display:none\">\n <ng-container klesComponent [component]=\"field.autocompleteComponent\" [value]=\"item\" [field]=\"field\"></ng-container>\n </mat-option>\n </ng-container>\n <ng-container *ngIf=\"!field.multiple && group.controls[field.name].value\">\n <mat-option *ngFor=\"let item of [group?.controls[field.name]?.value]\" [value]=\"item\" style=\"display:none\">\n <ng-container klesComponent [component]=\"field.autocompleteComponent\" [value]=\"item\" [field]=\"field\"></ng-container>\n </mat-option>\n </ng-container>\n </ng-container>\n </cdk-virtual-scroll-viewport>\n\n </ng-container>\n\n </mat-select>\n <ng-container *ngFor=\"let validation of field.validations;\" ngProjectAs=\"mat-error\">\n <mat-error *ngIf=\"group.get(field.name).hasError(validation.name)\">{{validation.message | translate}}</mat-error>\n </ng-container>\n <ng-container *ngFor=\"let validation of field.asyncValidations;\" ngProjectAs=\"mat-error\">\n <mat-error *ngIf=\"group.get(field.name).hasError(validation.name)\">{{validation.message | translate}}</mat-error>\n </ng-container>\n </mat-form-field>\n",
744
+ template: "\n <mat-form-field class=\"margin-top\" [formGroup]=\"group\">\n <mat-select matTooltip=\"{{field.tooltip}}\" [attr.id]=\"field.id\"\n (openedChange)=\"openChange($event)\" [compareWith]=\"compareFn\"\n [ngClass]=\"field.ngClass\" [placeholder]=\"field.placeholder | translate\" [formControlName]=\"field.name\" [multiple]=\"field.multiple\">\n <mat-select-trigger *ngIf=\"field.triggerComponent\">\n <ng-container klesComponent [component]=\"field.triggerComponent\" [value]=\"group.controls[field.name].value\" [field]=\"field\"></ng-container>\n </mat-select-trigger>\n\n\n <ng-container *ngIf=\"!field.virtualScroll\">\n <ng-container *ngIf=\"!field.autocompleteComponent\">\n <mat-option *ngFor=\"let item of options$ | async\" [value]=\"item\" [disabled]=\"item?.disabled\">{{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}</mat-option>\n </ng-container>\n\n <ng-container *ngIf=\"field.autocompleteComponent\">\n <mat-option *ngFor=\"let item of options$ | async\" [value]=\"item\" [disabled]=\"item?.disabled\">\n <ng-container klesComponent [component]=\"field.autocompleteComponent\" [value]=\"item\" [field]=\"field\"></ng-container>\n </mat-option>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"field.virtualScroll\">\n <cdk-virtual-scroll-viewport [itemSize]=\"field.itemSize || 50\" [style.height.px]=5*48>\n <ng-container *ngIf=\"!field.autocompleteComponent\">\n <mat-option *cdkVirtualFor=\"let item of options$ | async\" [value]=\"item\" [disabled]=\"item?.disabled\">\n {{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}\n </mat-option>\n\n <ng-container *ngIf=\"field.multiple\">\n <mat-option *ngFor=\"let item of group.controls[field.name].value | slice:0:30\" [value]=\"item\"\n style=\"display:none\">\n {{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}\n </mat-option>\n </ng-container>\n\n <ng-container *ngIf=\"!field.multiple && group.controls[field.name].value\">\n <mat-option *ngFor=\"let item of [group?.controls[field.name]?.value]\" [value]=\"item\" style=\"display:none\">\n {{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}\n </mat-option>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"field.autocompleteComponent\">\n <mat-option *cdkVirtualFor=\"let item of options$ | async\" [value]=\"item\" [disabled]=\"item?.disabled\">\n <ng-container klesComponent [component]=\"field.autocompleteComponent\" [value]=\"item\" [field]=\"field\"></ng-container>\n </mat-option>\n <ng-container *ngIf=\"field.multiple\">\n <mat-option *ngFor=\"let item of group.controls[field.name].value | slice:0:30\" [value]=\"item\"\n style=\"display:none\">\n <ng-container klesComponent [component]=\"field.autocompleteComponent\" [value]=\"item\" [field]=\"field\"></ng-container>\n </mat-option>\n </ng-container>\n <ng-container *ngIf=\"!field.multiple && group.controls[field.name].value\">\n <mat-option *ngFor=\"let item of [group?.controls[field.name]?.value]\" [value]=\"item\" style=\"display:none\">\n <ng-container klesComponent [component]=\"field.autocompleteComponent\" [value]=\"item\" [field]=\"field\"></ng-container>\n </mat-option>\n </ng-container>\n </ng-container>\n </cdk-virtual-scroll-viewport>\n\n </ng-container>\n\n </mat-select>\n <ng-container *ngFor=\"let validation of field.validations;\" ngProjectAs=\"mat-error\">\n <mat-error *ngIf=\"group.get(field.name).hasError(validation.name)\">{{validation.message | translate}}</mat-error>\n </ng-container>\n <ng-container *ngFor=\"let validation of field.asyncValidations;\" ngProjectAs=\"mat-error\">\n <mat-error *ngIf=\"group.get(field.name).hasError(validation.name)\">{{validation.message | translate}}</mat-error>\n </ng-container>\n </mat-form-field>\n",
728
745
  styles: ['mat-form-field {width: calc(100%)}']
729
746
  })
730
747
  ], KlesFormSelectComponent);
@@ -737,6 +754,9 @@
737
754
  return _super !== null && _super.apply(this, arguments) || this;
738
755
  }
739
756
  KlesFormDateComponent.prototype.ngOnInit = function () { _super.prototype.ngOnInit.call(this); };
757
+ KlesFormDateComponent.prototype.ngOnDestroy = function () {
758
+ _super.prototype.ngOnDestroy.call(this);
759
+ };
740
760
  KlesFormDateComponent = __decorate([
741
761
  core.Component({
742
762
  selector: "kles-form-datepicker",
@@ -752,9 +772,12 @@
752
772
  return _super !== null && _super.apply(this, arguments) || this;
753
773
  }
754
774
  KlesFormRadioComponent.prototype.ngOnInit = function () { _super.prototype.ngOnInit.call(this); };
775
+ KlesFormRadioComponent.prototype.ngOnDestroy = function () {
776
+ _super.prototype.ngOnDestroy.call(this);
777
+ };
755
778
  KlesFormRadioComponent = __decorate([
756
779
  core.Component({
757
- selector: "kles-form-radiobutton",
780
+ selector: 'kles-form-radiobutton',
758
781
  template: "\n <div [formGroup]=\"group\">\n <label class=\"radio-label-padding\">{{field.label}}</label>\n <mat-radio-group matTooltip=\"{{field.tooltip}}\" [attr.id]=\"field.id\" [ngClass]=\"field.ngClass\" [formControlName]=\"field.name\">\n <mat-radio-button *ngFor=\"let item of field.options\" [value]=\"item\">{{item}}</mat-radio-button>\n </mat-radio-group>\n <ng-container *ngFor=\"let validation of field.validations;\" ngProjectAs=\"mat-error\">\n <mat-error *ngIf=\"group.get(field.name).hasError(validation.name)\">{{validation.message | translate}}</mat-error>\n </ng-container>\n <ng-container *ngFor=\"let validation of field.asyncValidations;\" ngProjectAs=\"mat-error\">\n <mat-error *ngIf=\"group.get(field.name).hasError(validation.name)\">{{validation.message | translate}}</mat-error>\n </ng-container>\n </div>\n"
759
782
  })
760
783
  ], KlesFormRadioComponent);
@@ -767,6 +790,9 @@
767
790
  return _super !== null && _super.apply(this, arguments) || this;
768
791
  }
769
792
  KlesFormCheckboxComponent.prototype.ngOnInit = function () { _super.prototype.ngOnInit.call(this); };
793
+ KlesFormCheckboxComponent.prototype.ngOnDestroy = function () {
794
+ _super.prototype.ngOnDestroy.call(this);
795
+ };
770
796
  KlesFormCheckboxComponent = __decorate([
771
797
  core.Component({
772
798
  selector: "kles-form-checkbox",
@@ -822,6 +848,9 @@
822
848
  }
823
849
  return null;
824
850
  };
851
+ KlesFormListFieldComponent.prototype.ngOnDestroy = function () {
852
+ _super.prototype.ngOnDestroy.call(this);
853
+ };
825
854
  KlesFormListFieldComponent.ctorParameters = function () { return [
826
855
  { type: forms.FormBuilder }
827
856
  ]; };
@@ -866,6 +895,9 @@
866
895
  // pad each with zeros and return
867
896
  return "#" + r1 + g1 + b1;
868
897
  };
898
+ KlesFormColorComponent.prototype.ngOnDestroy = function () {
899
+ _super.prototype.ngOnDestroy.call(this);
900
+ };
869
901
  KlesFormColorComponent = __decorate([
870
902
  core.Component({
871
903
  selector: 'kles-form-color',
@@ -882,6 +914,9 @@
882
914
  return _super !== null && _super.apply(this, arguments) || this;
883
915
  }
884
916
  KlesFormChipComponent.prototype.ngOnInit = function () { _super.prototype.ngOnInit.call(this); };
917
+ KlesFormChipComponent.prototype.ngOnDestroy = function () {
918
+ _super.prototype.ngOnDestroy.call(this);
919
+ };
885
920
  KlesFormChipComponent = __decorate([
886
921
  core.Component({
887
922
  selector: "kles-form-chip",
@@ -900,6 +935,9 @@
900
935
  this.subGroup = this.group.controls[this.field.name];
901
936
  _super.prototype.ngOnInit.call(this);
902
937
  };
938
+ KlesFormGroupComponent.prototype.ngOnDestroy = function () {
939
+ _super.prototype.ngOnDestroy.call(this);
940
+ };
903
941
  KlesFormGroupComponent = __decorate([
904
942
  core.Component({
905
943
  selector: 'kles-group',
@@ -918,6 +956,9 @@
918
956
  return _super !== null && _super.apply(this, arguments) || this;
919
957
  }
920
958
  KlesFormIconComponent.prototype.ngOnInit = function () { _super.prototype.ngOnInit.call(this); };
959
+ KlesFormIconComponent.prototype.ngOnDestroy = function () {
960
+ _super.prototype.ngOnDestroy.call(this);
961
+ };
921
962
  KlesFormIconComponent = __decorate([
922
963
  core.Component({
923
964
  selector: "kles-form-icon",
@@ -934,7 +975,6 @@
934
975
  _this.searchControl = new forms.FormControl();
935
976
  _this.selectAllControl = new forms.FormControl(false);
936
977
  _this.optionsFiltered$ = new rxjs.ReplaySubject(1);
937
- _this._onDestroy = new rxjs.Subject();
938
978
  _this.compareFn = function (o1, o2) {
939
979
  if (_this.field.property && o1 && o2) {
940
980
  return o1[_this.field.property] === o2[_this.field.property];
@@ -982,7 +1022,7 @@
982
1022
  })).subscribe(this.optionsFiltered$);
983
1023
  this.group.controls[this.field.name]
984
1024
  .valueChanges.pipe(operators.takeUntil(this._onDestroy), operators.startWith(this.group.controls[this.field.name].value), operators.switchMap(function (selected) {
985
- return _this.optionsFiltered$.pipe(operators.map(function (options) {
1025
+ return _this.optionsFiltered$.pipe(operators.map(function (options) { return options.filter(function (option) { return !(option === null || option === void 0 ? void 0 : option.disabled); }); }), operators.map(function (options) {
986
1026
  if (!selected) {
987
1027
  return false;
988
1028
  }
@@ -998,12 +1038,13 @@
998
1038
  });
999
1039
  };
1000
1040
  KlesFormSelectSearchComponent.prototype.ngOnDestroy = function () {
1001
- this._onDestroy.next();
1041
+ // this._onDestroy.next();
1042
+ _super.prototype.ngOnDestroy.call(this);
1002
1043
  };
1003
1044
  KlesFormSelectSearchComponent.prototype.toggleAllSelection = function (state) {
1004
1045
  var _this = this;
1005
1046
  if (state.checked) {
1006
- this.optionsFiltered$.pipe(operators.take(1)).subscribe(function (options) {
1047
+ this.optionsFiltered$.pipe(operators.take(1), operators.map(function (options) { return options.filter(function (option) { return !(option === null || option === void 0 ? void 0 : option.disabled); }); })).subscribe(function (options) {
1007
1048
  if (options.length > 0) {
1008
1049
  _this.group.controls[_this.field.name].patchValue(options.slice());
1009
1050
  }
@@ -1030,7 +1071,7 @@
1030
1071
  KlesFormSelectSearchComponent = __decorate([
1031
1072
  core.Component({
1032
1073
  selector: 'kles-form-select-search',
1033
- template: "\n <mat-form-field class=\"margin-top\" [formGroup]=\"group\">\n <mat-select matTooltip=\"{{field.tooltip}}\" [attr.id]=\"field.id\" [ngClass]=\"field.ngClass\"\n (openedChange)=\"openChange($event)\" [compareWith]=\"compareFn\"\n [placeholder]=\"field.placeholder | translate\" [formControlName]=\"field.name\" [multiple]=\"field.multiple\">\n <mat-select-trigger *ngIf=\"field.triggerComponent\">\n <ng-container klesComponent [component]=\"field.triggerComponent\" [value]=\"group.controls[field.name].value\" [field]=\"field\"></ng-container>\n </mat-select-trigger>\n\n <ng-container *ngIf=\"field.virtualScroll\">\n <mat-option>\n <ngx-mat-select-search [formControl]=\"searchControl\"\n placeholderLabel=\"\" noEntriesFoundLabel =\"\"></ngx-mat-select-search>\n </mat-option>\n \n <cdk-virtual-scroll-viewport [itemSize]=\"field.itemSize || 50\" [style.height.px]=4*48>\n <ng-container *ngIf=\"!field.autocompleteComponent\">\n <mat-checkbox *ngIf=\"field.multiple\" class=\"selectAll\" [formControl]=\"selectAllControl\"\n (change)=\"toggleAllSelection($event)\">\n {{'selectAll' | translate}}\n </mat-checkbox>\n <mat-option *cdkVirtualFor=\"let item of optionsFiltered$ | async\" [value]=\"item\">{{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}</mat-option>\n \n <ng-container *ngIf=\"field.multiple\">\n <mat-option *ngFor=\"let item of group.controls[field.name].value | slice:0:30\" [value]=\"item\"\n style=\"display:none\">\n {{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}\n </mat-option>\n </ng-container>\n\n <ng-container *ngIf=\"!field.multiple && group.controls[field.name].value\">\n <mat-option *ngFor=\"let item of [group?.controls[field.name]?.value]\" [value]=\"item\" style=\"display:none\">\n {{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}\n </mat-option>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"field.autocompleteComponent\">\n <mat-option *cdkVirtualFor=\"let item of optionsFiltered$ | async\" [value]=\"item\">\n <ng-container klesComponent [component]=\"field.autocompleteComponent\" [value]=\"item\" [field]=\"field\"></ng-container>\n </mat-option>\n\n <ng-container *ngIf=\"field.multiple\">\n <mat-option *ngFor=\"let item of group.controls[field.name].value | slice:0:30\" [value]=\"item\"\n style=\"display:none\">\n <ng-container klesComponent [component]=\"field.autocompleteComponent\" [value]=\"item\" [field]=\"field\"></ng-container>\n </mat-option>\n </ng-container>\n\n <ng-container *ngIf=\"!field.multiple && group.controls[field.name].value\">\n <mat-option *ngFor=\"let item of [group?.controls[field.name]?.value]\" [value]=\"item\" style=\"display:none\">\n <ng-container klesComponent [component]=\"field.autocompleteComponent\" [value]=\"item\" [field]=\"field\"></ng-container>\n </mat-option>\n </ng-container>\n </ng-container>\n </cdk-virtual-scroll-viewport>\n\n </ng-container>\n\n <ng-container *ngIf=\"!field.virtualScroll\">\n \n <mat-option>\n <ngx-mat-select-search [formControl]=\"searchControl\"\n placeholderLabel=\"\" noEntriesFoundLabel =\"\"></ngx-mat-select-search>\n </mat-option>\n \n <mat-checkbox *ngIf=\"field.multiple\" class=\"selectAll\" [formControl]=\"selectAllControl\"\n (change)=\"toggleAllSelection($event)\">\n {{'selectAll' | translate}}\n </mat-checkbox>\n\n <ng-container *ngIf=\"!field.autocompleteComponent\">\n <mat-option *ngFor=\"let item of optionsFiltered$ | async\" [value]=\"item\">{{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}</mat-option>\n </ng-container>\n\n <ng-container *ngIf=\"field.autocompleteComponent\">\n <mat-option *ngFor=\"let item of optionsFiltered$ | async\" [value]=\"item\">\n <ng-container klesComponent [component]=\"field.autocompleteComponent\" [value]=\"item\" [field]=\"field\"></ng-container>\n </mat-option>\n </ng-container>\n </ng-container>\n\n\n </mat-select>\n <ng-container *ngFor=\"let validation of field.validations;\" ngProjectAs=\"mat-error\">\n <mat-error *ngIf=\"group.get(field.name).hasError(validation.name)\">{{validation.message | translate}}</mat-error>\n </ng-container>\n <ng-container *ngFor=\"let validation of field.asyncValidations;\" ngProjectAs=\"mat-error\">\n <mat-error *ngIf=\"group.get(field.name).hasError(validation.name)\">{{validation.message | translate}}</mat-error>\n </ng-container>\n </mat-form-field>\n",
1074
+ template: "\n <mat-form-field class=\"margin-top\" [formGroup]=\"group\">\n <mat-select matTooltip=\"{{field.tooltip}}\" [attr.id]=\"field.id\" [ngClass]=\"field.ngClass\"\n (openedChange)=\"openChange($event)\" [compareWith]=\"compareFn\"\n [placeholder]=\"field.placeholder | translate\" [formControlName]=\"field.name\" [multiple]=\"field.multiple\">\n <mat-select-trigger *ngIf=\"field.triggerComponent\">\n <ng-container klesComponent [component]=\"field.triggerComponent\" [value]=\"group.controls[field.name].value\" [field]=\"field\"></ng-container>\n </mat-select-trigger>\n\n <ng-container *ngIf=\"field.virtualScroll\">\n <mat-option>\n <ngx-mat-select-search [formControl]=\"searchControl\"\n placeholderLabel=\"\" noEntriesFoundLabel =\"\"></ngx-mat-select-search>\n </mat-option>\n \n <cdk-virtual-scroll-viewport [itemSize]=\"field.itemSize || 50\" [style.height.px]=4*48>\n <ng-container *ngIf=\"!field.autocompleteComponent\">\n <mat-checkbox *ngIf=\"field.multiple\" class=\"selectAll\" [formControl]=\"selectAllControl\"\n (change)=\"toggleAllSelection($event)\">\n {{'selectAll' | translate}}\n </mat-checkbox>\n <mat-option *cdkVirtualFor=\"let item of optionsFiltered$ | async\" [value]=\"item\" [disabled]=\"item?.disabled\">{{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}</mat-option>\n \n <ng-container *ngIf=\"field.multiple\">\n <mat-option *ngFor=\"let item of group.controls[field.name].value | slice:0:30\" [value]=\"item\"\n style=\"display:none\">\n {{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}\n </mat-option>\n </ng-container>\n\n <ng-container *ngIf=\"!field.multiple && group.controls[field.name].value\">\n <mat-option *ngFor=\"let item of [group?.controls[field.name]?.value]\" [value]=\"item\" style=\"display:none\">\n {{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}\n </mat-option>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"field.autocompleteComponent\">\n <mat-option *cdkVirtualFor=\"let item of optionsFiltered$ | async\" [value]=\"item\" [disabled]=\"item?.disabled\">\n <ng-container klesComponent [component]=\"field.autocompleteComponent\" [value]=\"item\" [field]=\"field\"></ng-container>\n </mat-option>\n\n <ng-container *ngIf=\"field.multiple\">\n <mat-option *ngFor=\"let item of group.controls[field.name].value | slice:0:30\" [value]=\"item\"\n style=\"display:none\">\n <ng-container klesComponent [component]=\"field.autocompleteComponent\" [value]=\"item\" [field]=\"field\"></ng-container>\n </mat-option>\n </ng-container>\n\n <ng-container *ngIf=\"!field.multiple && group.controls[field.name].value\">\n <mat-option *ngFor=\"let item of [group?.controls[field.name]?.value]\" [value]=\"item\" style=\"display:none\">\n <ng-container klesComponent [component]=\"field.autocompleteComponent\" [value]=\"item\" [field]=\"field\"></ng-container>\n </mat-option>\n </ng-container>\n </ng-container>\n </cdk-virtual-scroll-viewport>\n\n </ng-container>\n\n <ng-container *ngIf=\"!field.virtualScroll\">\n \n <mat-option>\n <ngx-mat-select-search [formControl]=\"searchControl\"\n placeholderLabel=\"\" noEntriesFoundLabel =\"\"></ngx-mat-select-search>\n </mat-option>\n \n <mat-checkbox *ngIf=\"field.multiple\" class=\"selectAll\" [formControl]=\"selectAllControl\"\n (change)=\"toggleAllSelection($event)\">\n {{'selectAll' | translate}}\n </mat-checkbox>\n\n <ng-container *ngIf=\"!field.autocompleteComponent\">\n <mat-option *ngFor=\"let item of optionsFiltered$ | async\" [value]=\"item\" [disabled]=\"item?.disabled\">{{(field.property ? item[field.property] : item) | klesTransform:field.pipeTransform}}</mat-option>\n </ng-container>\n\n <ng-container *ngIf=\"field.autocompleteComponent\">\n <mat-option *ngFor=\"let item of optionsFiltered$ | async\" [value]=\"item\" [disabled]=\"item?.disabled\">\n <ng-container klesComponent [component]=\"field.autocompleteComponent\" [value]=\"item\" [field]=\"field\"></ng-container>\n </mat-option>\n </ng-container>\n </ng-container>\n\n\n </mat-select>\n <ng-container *ngFor=\"let validation of field.validations;\" ngProjectAs=\"mat-error\">\n <mat-error *ngIf=\"group.get(field.name).hasError(validation.name)\">{{validation.message | translate}}</mat-error>\n </ng-container>\n <ng-container *ngFor=\"let validation of field.asyncValidations;\" ngProjectAs=\"mat-error\">\n <mat-error *ngIf=\"group.get(field.name).hasError(validation.name)\">{{validation.message | translate}}</mat-error>\n </ng-container>\n </mat-form-field>\n",
1034
1075
  styles: ['mat-form-field {width: calc(100%)}', '.selectAll {padding: 10px 16px;}']
1035
1076
  })
1036
1077
  ], KlesFormSelectSearchComponent);
@@ -1043,6 +1084,9 @@
1043
1084
  return _super !== null && _super.apply(this, arguments) || this;
1044
1085
  }
1045
1086
  KlesFormLineBreakComponent.prototype.ngOnInit = function () { _super.prototype.ngOnInit.call(this); };
1087
+ KlesFormLineBreakComponent.prototype.ngOnDestroy = function () {
1088
+ _super.prototype.ngOnDestroy.call(this);
1089
+ };
1046
1090
  KlesFormLineBreakComponent = __decorate([
1047
1091
  core.Component({
1048
1092
  selector: "kles-form-line-break",
@@ -1061,6 +1105,9 @@
1061
1105
  KlesFormLinkComponent.prototype.ngOnInit = function () {
1062
1106
  _super.prototype.ngOnInit.call(this);
1063
1107
  };
1108
+ KlesFormLinkComponent.prototype.ngOnDestroy = function () {
1109
+ _super.prototype.ngOnDestroy.call(this);
1110
+ };
1064
1111
  KlesFormLinkComponent = __decorate([
1065
1112
  core.Component({
1066
1113
  selector: 'kles-form-link',
@@ -1084,6 +1131,9 @@
1084
1131
  this.options$ = this.field.options;
1085
1132
  }
1086
1133
  };
1134
+ KlesFormSelectionListComponent.prototype.ngOnDestroy = function () {
1135
+ _super.prototype.ngOnDestroy.call(this);
1136
+ };
1087
1137
  KlesFormSelectionListComponent = __decorate([
1088
1138
  core.Component({
1089
1139
  selector: 'kles-form-selection-list',
@@ -1108,6 +1158,9 @@
1108
1158
  this.options$ = this.field.options;
1109
1159
  }
1110
1160
  };
1161
+ KlesFormButtonToogleGroupComponent.prototype.ngOnDestroy = function () {
1162
+ _super.prototype.ngOnDestroy.call(this);
1163
+ };
1111
1164
  KlesFormButtonToogleGroupComponent = __decorate([
1112
1165
  core.Component({
1113
1166
  selector: 'kles-form-button-toogle-group',
@@ -1116,11 +1169,6 @@
1116
1169
  ], KlesFormButtonToogleGroupComponent);
1117
1170
  return KlesFormButtonToogleGroupComponent;
1118
1171
  }(KlesFieldAbstract));
1119
- // <mat-button-toggle-group [formControlName]="field.name">
1120
- // <mat-button-toggle value="bold">Bold</mat-button-toggle>
1121
- // <mat-button-toggle value="italic">Italic</mat-button-toggle>
1122
- // <mat-button-toggle value="underline">Underline</mat-button-toggle>
1123
- // </mat-button-toggle-group>
1124
1172
 
1125
1173
  var KlesFormArrayComponent = /** @class */ (function (_super) {
1126
1174
  __extends(KlesFormArrayComponent, _super);
@@ -1131,9 +1179,9 @@
1131
1179
  // this.subGroup = this.group.controls[this.field.name] as FormGroup;
1132
1180
  _super.prototype.ngOnInit.call(this);
1133
1181
  this.formArray = this.group.controls[this.field.name];
1134
- console.log('on arrive ici');
1135
- console.log(this.field);
1136
- console.log(this.formArray);
1182
+ };
1183
+ KlesFormArrayComponent.prototype.ngOnDestroy = function () {
1184
+ _super.prototype.ngOnDestroy.call(this);
1137
1185
  };
1138
1186
  KlesFormArrayComponent = __decorate([
1139
1187
  core.Component({
@@ -1182,7 +1230,6 @@
1182
1230
  this.buildComponent();
1183
1231
  };
1184
1232
  KlesDynamicFieldDirective.prototype.ngOnChanges = function (changes) {
1185
- console.log('ngOnCHange', changes);
1186
1233
  if (changes.group) {
1187
1234
  this.group = changes.group.currentValue;
1188
1235
  }
@@ -1426,10 +1473,13 @@
1426
1473
  KlesFormButtonComponent.prototype.ngOnInit = function () {
1427
1474
  _super.prototype.ngOnInit.call(this);
1428
1475
  };
1476
+ KlesFormButtonComponent.prototype.ngOnDestroy = function () {
1477
+ _super.prototype.ngOnDestroy.call(this);
1478
+ };
1429
1479
  KlesFormButtonComponent = __decorate([
1430
1480
  core.Component({
1431
1481
  selector: 'kles-form-button',
1432
- template: "\n <div [formGroup]=\"group\">\n <kles-button \n [attr.id]=\"field.id\" [classButton]=\"field.ngClass\" \n [name]=\"field.name\" [label]=\"field.label\" [color]=\"field.color\" \n [icon]=\"field.icon\"\n [iconSvg]=\"field.iconSvg\"\n [value]=\"field.value\"\n [formControlName]=\"field.name\"\n [tooltip]=\"field.tooltip\">\n </kles-button>\n </div>\n "
1482
+ template: "\n <div [formGroup]=\"group\">\n <kles-button\n [attr.id]=\"field.id\" [classButton]=\"field.ngClass\" \n [name]=\"field.name\" [label]=\"field.label\" [color]=\"field.color\" \n [icon]=\"field.icon\"\n [iconSvg]=\"field.iconSvg\"\n [value]=\"field.value\"\n [formControlName]=\"field.name\"\n [tooltip]=\"field.tooltip\">\n </kles-button>\n </div>\n "
1433
1483
  })
1434
1484
  ], KlesFormButtonComponent);
1435
1485
  return KlesFormButtonComponent;
@@ -1475,10 +1525,13 @@
1475
1525
  KlesFormButtonCheckerComponent.prototype.ngOnInit = function () {
1476
1526
  _super.prototype.ngOnInit.call(this);
1477
1527
  };
1528
+ KlesFormButtonCheckerComponent.prototype.ngOnDestroy = function () {
1529
+ _super.prototype.ngOnDestroy.call(this);
1530
+ };
1478
1531
  KlesFormButtonCheckerComponent = __decorate([
1479
1532
  core.Component({
1480
1533
  selector: 'kles-form-button-checker',
1481
- template: "\n <div [formGroup]=\"group\">\n <kles-button-checker\n [attr.id]=\"field.id\" [classButton]=\"field.ngClass\" \n [name]=\"field.name\" [label]=\"field.label\" [color]=\"field.color\" \n [icon]=\"field.icon\"\n [iconSvg]=\"field.iconSvg\"\n [value]=\"field.value\"\n [formControlName]=\"field.name\"\n [tooltip]=\"field.tooltip\">\n </kles-button-checker>\n </div>\n "
1534
+ template: "\n <div [formGroup]=\"group\">\n <kles-button-checker\n [attr.id]=\"field.id\" [classButton]=\"field.ngClass\"\n [name]=\"field.name\" [label]=\"field.label\" [color]=\"field.color\"\n [icon]=\"field.icon\"\n [iconSvg]=\"field.iconSvg\"\n [value]=\"field.value\"\n [formControlName]=\"field.name\"\n [tooltip]=\"field.tooltip\">\n </kles-button-checker>\n </div>\n "
1482
1535
  })
1483
1536
  ], KlesFormButtonCheckerComponent);
1484
1537
  return KlesFormButtonCheckerComponent;
@@ -1529,10 +1582,6 @@
1529
1582
  files = input.files;
1530
1583
  fileContent = [];
1531
1584
  if (!(files && files.length)) return [3 /*break*/, 7];
1532
- console.log('Filename: ' + files[0].name);
1533
- console.log('Type: ' + files[0].type);
1534
- console.log('Size: ' + files[0].size + ' bytes');
1535
- console.log('Files=', files.length);
1536
1585
  i = 0;
1537
1586
  _c.label = 1;
1538
1587
  case 1:
@@ -1610,6 +1659,9 @@
1610
1659
  KlesFormButtonFileComponent.prototype.ngOnInit = function () {
1611
1660
  _super.prototype.ngOnInit.call(this);
1612
1661
  };
1662
+ KlesFormButtonFileComponent.prototype.ngOnDestroy = function () {
1663
+ _super.prototype.ngOnDestroy.call(this);
1664
+ };
1613
1665
  KlesFormButtonFileComponent = __decorate([
1614
1666
  core.Component({
1615
1667
  selector: 'kles-form-button-file',
@@ -1627,6 +1679,9 @@
1627
1679
  KlesFormTextareaComponent.prototype.ngOnInit = function () {
1628
1680
  _super.prototype.ngOnInit.call(this);
1629
1681
  };
1682
+ KlesFormTextareaComponent.prototype.ngOnDestroy = function () {
1683
+ _super.prototype.ngOnDestroy.call(this);
1684
+ };
1630
1685
  KlesFormTextareaComponent = __decorate([
1631
1686
  core.Component({
1632
1687
  selector: 'kles-form-textarea',
@@ -1645,6 +1700,9 @@
1645
1700
  KlesFormTextComponent.prototype.ngOnInit = function () {
1646
1701
  _super.prototype.ngOnInit.call(this);
1647
1702
  };
1703
+ KlesFormTextComponent.prototype.ngOnDestroy = function () {
1704
+ _super.prototype.ngOnDestroy.call(this);
1705
+ };
1648
1706
  KlesFormTextComponent = __decorate([
1649
1707
  core.Component({
1650
1708
  selector: 'kles-form-text',
@@ -1659,10 +1717,13 @@
1659
1717
  function KlesFormInputClearableComponent() {
1660
1718
  return _super !== null && _super.apply(this, arguments) || this;
1661
1719
  }
1720
+ KlesFormInputClearableComponent.prototype.ngOnDestroy = function () {
1721
+ _super.prototype.ngOnDestroy.call(this);
1722
+ };
1662
1723
  KlesFormInputClearableComponent = __decorate([
1663
1724
  core.Component({
1664
1725
  selector: 'kles-form-input-clearable',
1665
- template: "\n <mat-form-field [formGroup]=\"group\" class=\"form-element\">\n\n <ng-container *ngIf=\"field.autocomplete; else notAutoComplete\">\n <input matInput matTooltip=\"{{field.tooltip}}\" [attr.id]=\"field.id\" [ngClass]=\"field.ngClass\" [formControlName]=\"field.name\" [placeholder]=\"field.placeholder | translate\" [type]=\"field.inputType\"\n [maxLength]=\"field.maxLength\" [min]=\"field.min\" [max]=\"field.max\" [step]=\"field.step\"\n [matAutocomplete]=\"auto\">\n\n <mat-autocomplete #auto=\"matAutocomplete\" [displayWith]=\"displayFn.bind(this)\" [panelWidth]=\"this.field.panelWidth\">\n <ng-container *ngIf=\"!field.autocompleteComponent\">\n <mat-option *ngFor=\"let option of filteredOption | async\" [value]=\"option\">\n {{field.property ? option[field.property] : option}}\n </mat-option>\n </ng-container>\n\n <ng-container *ngIf=\"field.autocompleteComponent\">\n <mat-option *ngFor=\"let option of filteredOption | async\" [value]=\"option\">\n <ng-container klesComponent [component]=\"field.autocompleteComponent\" [value]=\"option\" [field]=\"field\">\n </ng-container>\n </mat-option>\n </ng-container>\n </mat-autocomplete>\n </ng-container>\n\n <ng-template #notAutoComplete>\n <input matInput matTooltip=\"{{field.tooltip}}\" [attr.id]=\"field.id\" [ngClass]=\"field.ngClass\" [formControlName]=\"field.name\" [placeholder]=\"field.placeholder | translate\" [type]=\"field.inputType\"\n [maxLength]=\"field.maxLength\" [min]=\"field.min\" [max]=\"field.max\" [step]=\"field.step\">\n </ng-template>\n <button mat-button matSuffix mat-icon-button aria-label=\"Clear\" type=\"button\"\n (click)=\"group.controls[field.name].reset();\">\n <mat-icon>close</mat-icon>\n </button>\n\n <mat-spinner matSuffix mode=\"indeterminate\" *ngIf=\"isPending()\" diameter=\"17\"></mat-spinner>\n\n <ng-container *ngFor=\"let validation of field.validations;\" ngProjectAs=\"mat-error\">\n <mat-error *ngIf=\"group.get(field.name).hasError(validation.name)\">{{validation.message | translate}}</mat-error>\n </ng-container>\n <ng-container *ngFor=\"let validation of field.asyncValidations;\" ngProjectAs=\"mat-error\">\n <mat-error *ngIf=\"group.get(field.name).hasError(validation.name)\">{{validation.message | translate}}</mat-error>\n </ng-container>\n </mat-form-field>\n ",
1726
+ template: "\n <mat-form-field [formGroup]=\"group\" class=\"form-element\">\n\n <ng-container *ngIf=\"field.autocomplete; else notAutoComplete\">\n <input matInput matTooltip=\"{{field.tooltip}}\" [attr.id]=\"field.id\" [ngClass]=\"field.ngClass\" [formControlName]=\"field.name\" [placeholder]=\"field.placeholder | translate\" [type]=\"field.inputType\"\n [maxLength]=\"field.maxLength\" [min]=\"field.min\" [max]=\"field.max\" [step]=\"field.step\"\n [matAutocomplete]=\"auto\">\n\n <mat-autocomplete #auto=\"matAutocomplete\" [displayWith]=\"displayFn.bind(this)\" [panelWidth]=\"this.field.panelWidth\">\n <ng-container *ngIf=\"!field.autocompleteComponent\">\n <mat-option *ngFor=\"let option of filteredOption | async\" [value]=\"option\">\n {{field.property ? option[field.property] : option}}\n </mat-option>\n </ng-container>\n\n <ng-container *ngIf=\"field.autocompleteComponent\">\n <mat-option *ngFor=\"let option of filteredOption | async\" [value]=\"option\">\n <ng-container klesComponent [component]=\"field.autocompleteComponent\" [value]=\"option\" [field]=\"field\">\n </ng-container>\n </mat-option>\n </ng-container>\n </mat-autocomplete>\n </ng-container>\n\n <ng-template #notAutoComplete>\n <input matInput matTooltip=\"{{field.tooltip}}\" [attr.id]=\"field.id\" [ngClass]=\"field.ngClass\" [formControlName]=\"field.name\" [placeholder]=\"field.placeholder | translate\" [type]=\"field.inputType\"\n [maxLength]=\"field.maxLength\" [min]=\"field.min\" [max]=\"field.max\" [step]=\"field.step\">\n </ng-template>\n <button *ngIf=\"!group.get(field.name).disabled\" mat-button matSuffix mat-icon-button aria-label=\"Clear\" type=\"button\"\n (click)=\"group.controls[field.name].reset();\">\n <mat-icon>close</mat-icon>\n </button>\n\n <mat-spinner matSuffix mode=\"indeterminate\" *ngIf=\"isPending()\" diameter=\"17\"></mat-spinner>\n\n <ng-container *ngFor=\"let validation of field.validations;\" ngProjectAs=\"mat-error\">\n <mat-error *ngIf=\"group.get(field.name).hasError(validation.name)\">{{validation.message | translate}}</mat-error>\n </ng-container>\n <ng-container *ngFor=\"let validation of field.asyncValidations;\" ngProjectAs=\"mat-error\">\n <mat-error *ngIf=\"group.get(field.name).hasError(validation.name)\">{{validation.message | translate}}</mat-error>\n </ng-container>\n </mat-form-field>\n ",
1666
1727
  styles: ['mat-form-field {width: calc(100%)}']
1667
1728
  })
1668
1729
  ], KlesFormInputClearableComponent);
@@ -1720,10 +1781,13 @@
1720
1781
  return _super !== null && _super.apply(this, arguments) || this;
1721
1782
  }
1722
1783
  KlesFormSlideToggleComponent.prototype.ngOnInit = function () { _super.prototype.ngOnInit.call(this); };
1784
+ KlesFormSlideToggleComponent.prototype.ngOnDestroy = function () {
1785
+ _super.prototype.ngOnDestroy.call(this);
1786
+ };
1723
1787
  KlesFormSlideToggleComponent = __decorate([
1724
1788
  core.Component({
1725
- selector: "kles-form-slide-toggle",
1726
- template: "\n <div [formGroup]=\"group\" > \n <mat-slide-toggle matTooltip=\"{{field.tooltip}}\" [attr.id]=\"field.id\" [ngClass]=\"field.ngClass\" [color]=\"field.color\" [formControlName]=\"field.name\">{{field.label | translate}}</mat-slide-toggle>\n <ng-container *ngFor=\"let validation of field.validations;\" ngProjectAs=\"mat-error\">\n <mat-error *ngIf=\"group.get(field.name).hasError(validation.name)\">{{validation.message}}</mat-error>\n </ng-container>\n <ng-container *ngFor=\"let validation of field.asyncValidations;\" ngProjectAs=\"mat-error\">\n <mat-error *ngIf=\"group.get(field.name).hasError(validation.name)\">{{validation.message}}</mat-error>\n </ng-container>\n </div>\n"
1789
+ selector: 'kles-form-slide-toggle',
1790
+ template: "\n <div [formGroup]=\"group\" >\n <mat-slide-toggle matTooltip=\"{{field.tooltip}}\" [attr.id]=\"field.id\" [ngClass]=\"field.ngClass\" [color]=\"field.color\" [formControlName]=\"field.name\">{{field.label | translate}}</mat-slide-toggle>\n <ng-container *ngFor=\"let validation of field.validations;\" ngProjectAs=\"mat-error\">\n <mat-error *ngIf=\"group.get(field.name).hasError(validation.name)\">{{validation.message}}</mat-error>\n </ng-container>\n <ng-container *ngFor=\"let validation of field.asyncValidations;\" ngProjectAs=\"mat-error\">\n <mat-error *ngIf=\"group.get(field.name).hasError(validation.name)\">{{validation.message}}</mat-error>\n </ng-container>\n </div>\n"
1727
1791
  })
1728
1792
  ], KlesFormSlideToggleComponent);
1729
1793
  return KlesFormSlideToggleComponent;
@@ -1737,10 +1801,13 @@
1737
1801
  KlesFormBadgeComponent.prototype.ngOnInit = function () {
1738
1802
  _super.prototype.ngOnInit.call(this);
1739
1803
  };
1804
+ KlesFormBadgeComponent.prototype.ngOnDestroy = function () {
1805
+ _super.prototype.ngOnDestroy.call(this);
1806
+ };
1740
1807
  KlesFormBadgeComponent = __decorate([
1741
1808
  core.Component({
1742
1809
  selector: 'kles-form-badge',
1743
- template: "\n <span matTooltip=\"{{field.tooltip}}\" [attr.id]=\"field.id\" [ngClass]=\"field.ngClass\" \n matBadge=\"{{group.controls[field.name].value}}\" matBadgeOverlap=\"false\" matBadgeColor=\"{{field.color}}\">\n </span> \n"
1810
+ template: "\n <span matTooltip=\"{{field.tooltip}}\" [attr.id]=\"field.id\" [ngClass]=\"field.ngClass\" \n matBadge=\"{{group.controls[field.name].value}}\" matBadgeOverlap=\"false\" matBadgeColor=\"{{field.color}}\">\n </span>\n"
1744
1811
  })
1745
1812
  ], KlesFormBadgeComponent);
1746
1813
  return KlesFormBadgeComponent;