@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.
- package/3kles-kles-material-dynamicforms.metadata.json +1 -1
- package/bundles/3kles-kles-material-dynamicforms.umd.js +94 -27
- package/bundles/3kles-kles-material-dynamicforms.umd.js.map +1 -1
- package/bundles/3kles-kles-material-dynamicforms.umd.min.js +2 -2
- package/bundles/3kles-kles-material-dynamicforms.umd.min.js.map +1 -1
- package/esm2015/lib/directive/dynamic-field.directive.js +1 -2
- package/esm2015/lib/fields/array.component.js +4 -4
- package/esm2015/lib/fields/badge.component.js +7 -4
- package/esm2015/lib/fields/button-form.component.js +5 -2
- package/esm2015/lib/fields/button-submit.component.js +4 -1
- package/esm2015/lib/fields/button-toogle-group.component.js +4 -6
- package/esm2015/lib/fields/buttonchecker-form.component.js +6 -3
- package/esm2015/lib/fields/buttonfile-form.component.js +4 -1
- package/esm2015/lib/fields/checkbox.component.js +4 -1
- package/esm2015/lib/fields/chip.component.js +4 -1
- package/esm2015/lib/fields/color.component.js +4 -1
- package/esm2015/lib/fields/date.component.js +4 -1
- package/esm2015/lib/fields/field.abstract.js +11 -2
- package/esm2015/lib/fields/group.component.js +4 -1
- package/esm2015/lib/fields/icon.component.js +4 -1
- package/esm2015/lib/fields/input.clearable.component.js +5 -2
- package/esm2015/lib/fields/input.component.js +4 -1
- package/esm2015/lib/fields/label.component.js +4 -1
- package/esm2015/lib/fields/line-break.component.js +4 -1
- package/esm2015/lib/fields/link.component.js +4 -1
- package/esm2015/lib/fields/list-field.component.js +4 -1
- package/esm2015/lib/fields/radio.component.js +6 -3
- package/esm2015/lib/fields/select.component.js +8 -5
- package/esm2015/lib/fields/select.search.component.js +10 -10
- package/esm2015/lib/fields/selection-list.component.js +4 -1
- package/esm2015/lib/fields/slide-toggle.component.js +6 -3
- package/esm2015/lib/fields/text.component.js +4 -1
- package/esm2015/lib/fields/textarea.component.js +6 -3
- package/esm2015/lib/forms/buttonfile-control.component.js +1 -5
- package/esm5/lib/directive/dynamic-field.directive.js +1 -2
- package/esm5/lib/fields/array.component.js +4 -4
- package/esm5/lib/fields/badge.component.js +7 -4
- package/esm5/lib/fields/button-form.component.js +5 -2
- package/esm5/lib/fields/button-submit.component.js +4 -1
- package/esm5/lib/fields/button-toogle-group.component.js +4 -6
- package/esm5/lib/fields/buttonchecker-form.component.js +5 -2
- package/esm5/lib/fields/buttonfile-form.component.js +4 -1
- package/esm5/lib/fields/checkbox.component.js +4 -1
- package/esm5/lib/fields/chip.component.js +4 -1
- package/esm5/lib/fields/color.component.js +4 -1
- package/esm5/lib/fields/date.component.js +4 -1
- package/esm5/lib/fields/field.abstract.js +9 -2
- package/esm5/lib/fields/group.component.js +4 -1
- package/esm5/lib/fields/icon.component.js +4 -1
- package/esm5/lib/fields/input.clearable.component.js +5 -2
- package/esm5/lib/fields/input.component.js +4 -1
- package/esm5/lib/fields/label.component.js +4 -1
- package/esm5/lib/fields/line-break.component.js +4 -1
- package/esm5/lib/fields/link.component.js +4 -1
- package/esm5/lib/fields/list-field.component.js +4 -1
- package/esm5/lib/fields/radio.component.js +6 -3
- package/esm5/lib/fields/select.component.js +5 -2
- package/esm5/lib/fields/select.search.component.js +7 -7
- package/esm5/lib/fields/selection-list.component.js +4 -1
- package/esm5/lib/fields/slide-toggle.component.js +6 -3
- package/esm5/lib/fields/text.component.js +4 -1
- package/esm5/lib/fields/textarea.component.js +6 -3
- package/esm5/lib/forms/buttonfile-control.component.js +1 -5
- package/fesm2015/3kles-kles-material-dynamicforms.js +105 -36
- package/fesm2015/3kles-kles-material-dynamicforms.js.map +1 -1
- package/fesm5/3kles-kles-material-dynamicforms.js +96 -29
- package/fesm5/3kles-kles-material-dynamicforms.js.map +1 -1
- package/lib/fields/array.component.d.ts +3 -2
- package/lib/fields/badge.component.d.ts +4 -3
- package/lib/fields/button-form.component.d.ts +3 -2
- package/lib/fields/button-submit.component.d.ts +3 -2
- package/lib/fields/button-toogle-group.component.d.ts +3 -2
- package/lib/fields/buttonchecker-form.component.d.ts +3 -2
- package/lib/fields/buttonfile-form.component.d.ts +3 -2
- package/lib/fields/checkbox.component.d.ts +3 -2
- package/lib/fields/chip.component.d.ts +3 -2
- package/lib/fields/color.component.d.ts +3 -2
- package/lib/fields/date.component.d.ts +3 -2
- package/lib/fields/field.abstract.d.ts +5 -2
- package/lib/fields/group.component.d.ts +3 -2
- package/lib/fields/icon.component.d.ts +3 -2
- package/lib/fields/input.clearable.component.d.ts +3 -2
- package/lib/fields/input.component.d.ts +3 -2
- package/lib/fields/label.component.d.ts +3 -2
- package/lib/fields/line-break.component.d.ts +3 -2
- package/lib/fields/link.component.d.ts +3 -2
- package/lib/fields/list-field.component.d.ts +3 -2
- package/lib/fields/radio.component.d.ts +3 -2
- package/lib/fields/select.component.d.ts +3 -2
- package/lib/fields/select.search.component.d.ts +0 -1
- package/lib/fields/selection-list.component.d.ts +3 -2
- package/lib/fields/slide-toggle.component.d.ts +3 -2
- package/lib/fields/text.component.d.ts +3 -2
- package/lib/fields/textarea.component.d.ts +4 -3
- package/package.json +1 -1
|
@@ -2,8 +2,8 @@ import { __assign, __decorate, __extends, __awaiter, __generator } from 'tslib';
|
|
|
2
2
|
import { EventEmitter, Input, Output, Component, ComponentFactoryResolver, ViewContainerRef, Directive, ViewChild, ViewChildren, NgModule, forwardRef, Pipe, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import { Validators, FormBuilder, FormControl, NG_VALUE_ACCESSOR, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
5
|
-
import { Observable, of, ReplaySubject
|
|
6
|
-
import { startWith, switchMap, map,
|
|
5
|
+
import { Subject, Observable, of, ReplaySubject } from 'rxjs';
|
|
6
|
+
import { takeUntil, startWith, switchMap, map, take } from 'rxjs/operators';
|
|
7
7
|
import { CdkVirtualScrollViewport, ScrollingModule, CdkScrollable } from '@angular/cdk/scrolling';
|
|
8
8
|
import { MatOption, MatNativeDateModule, ErrorStateMatcher } from '@angular/material/core';
|
|
9
9
|
import { MatSliderModule } from '@angular/material/slider';
|
|
@@ -366,6 +366,7 @@ var KlesComponentDirective = /** @class */ (function () {
|
|
|
366
366
|
|
|
367
367
|
var KlesFieldAbstract = /** @class */ (function () {
|
|
368
368
|
function KlesFieldAbstract() {
|
|
369
|
+
this._onDestroy = new Subject();
|
|
369
370
|
}
|
|
370
371
|
KlesFieldAbstract.prototype.ngOnInit = function () {
|
|
371
372
|
var _this = this;
|
|
@@ -374,7 +375,7 @@ var KlesFieldAbstract = /** @class */ (function () {
|
|
|
374
375
|
if (this.field.valueChanges) {
|
|
375
376
|
this.field.valueChanges(this.field, this.group, this.siblingFields);
|
|
376
377
|
}
|
|
377
|
-
(_a = this.group.controls[this.field.name]) === null || _a === void 0 ? void 0 : _a.valueChanges.pipe().subscribe(function (val) {
|
|
378
|
+
(_a = this.group.controls[this.field.name]) === null || _a === void 0 ? void 0 : _a.valueChanges.pipe(takeUntil(this._onDestroy)).subscribe(function (val) {
|
|
378
379
|
if (_this.field.valueChanges) {
|
|
379
380
|
_this.field.valueChanges(_this.field, _this.group, _this.siblingFields, val);
|
|
380
381
|
}
|
|
@@ -383,6 +384,10 @@ var KlesFieldAbstract = /** @class */ (function () {
|
|
|
383
384
|
};
|
|
384
385
|
KlesFieldAbstract.prototype.ngAfterViewInit = function () {
|
|
385
386
|
};
|
|
387
|
+
KlesFieldAbstract.prototype.ngOnDestroy = function () {
|
|
388
|
+
this._onDestroy.next();
|
|
389
|
+
this._onDestroy.complete();
|
|
390
|
+
};
|
|
386
391
|
KlesFieldAbstract.prototype.applyPipeTransform = function () {
|
|
387
392
|
if (this.group && this.field) {
|
|
388
393
|
var control_1 = this.group.controls[this.field.name];
|
|
@@ -417,6 +422,9 @@ var KlesFormLabelComponent = /** @class */ (function (_super) {
|
|
|
417
422
|
this.group.controls[this.field.name].disable();
|
|
418
423
|
_super.prototype.ngOnInit.call(this);
|
|
419
424
|
};
|
|
425
|
+
KlesFormLabelComponent.prototype.ngOnDestroy = function () {
|
|
426
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
427
|
+
};
|
|
420
428
|
KlesFormLabelComponent = __decorate([
|
|
421
429
|
Component({
|
|
422
430
|
selector: "kles-form-label",
|
|
@@ -480,6 +488,9 @@ var KlesFormInputComponent = /** @class */ (function (_super) {
|
|
|
480
488
|
return value ? value : '';
|
|
481
489
|
}
|
|
482
490
|
};
|
|
491
|
+
KlesFormInputComponent.prototype.ngOnDestroy = function () {
|
|
492
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
493
|
+
};
|
|
483
494
|
KlesFormInputComponent = __decorate([
|
|
484
495
|
Component({
|
|
485
496
|
selector: 'kles-form-input',
|
|
@@ -498,6 +509,9 @@ var KlesFormSubmitButtonComponent = /** @class */ (function (_super) {
|
|
|
498
509
|
KlesFormSubmitButtonComponent.prototype.ngOnInit = function () {
|
|
499
510
|
_super.prototype.ngOnInit.call(this);
|
|
500
511
|
};
|
|
512
|
+
KlesFormSubmitButtonComponent.prototype.ngOnDestroy = function () {
|
|
513
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
514
|
+
};
|
|
501
515
|
KlesFormSubmitButtonComponent = __decorate([
|
|
502
516
|
Component({
|
|
503
517
|
selector: 'kles-submit-button',
|
|
@@ -528,6 +542,9 @@ var KlesFormSelectComponent = /** @class */ (function (_super) {
|
|
|
528
542
|
this.options$ = this.field.options;
|
|
529
543
|
}
|
|
530
544
|
};
|
|
545
|
+
KlesFormSelectComponent.prototype.ngOnDestroy = function () {
|
|
546
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
547
|
+
};
|
|
531
548
|
KlesFormSelectComponent.prototype.openChange = function ($event) {
|
|
532
549
|
if (this.field.virtualScroll) {
|
|
533
550
|
if ($event) {
|
|
@@ -545,7 +562,7 @@ var KlesFormSelectComponent = /** @class */ (function (_super) {
|
|
|
545
562
|
KlesFormSelectComponent = __decorate([
|
|
546
563
|
Component({
|
|
547
564
|
selector: 'kles-form-select',
|
|
548
|
-
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",
|
|
565
|
+
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",
|
|
549
566
|
styles: ['mat-form-field {width: calc(100%)}']
|
|
550
567
|
})
|
|
551
568
|
], KlesFormSelectComponent);
|
|
@@ -558,6 +575,9 @@ var KlesFormDateComponent = /** @class */ (function (_super) {
|
|
|
558
575
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
559
576
|
}
|
|
560
577
|
KlesFormDateComponent.prototype.ngOnInit = function () { _super.prototype.ngOnInit.call(this); };
|
|
578
|
+
KlesFormDateComponent.prototype.ngOnDestroy = function () {
|
|
579
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
580
|
+
};
|
|
561
581
|
KlesFormDateComponent = __decorate([
|
|
562
582
|
Component({
|
|
563
583
|
selector: "kles-form-datepicker",
|
|
@@ -573,9 +593,12 @@ var KlesFormRadioComponent = /** @class */ (function (_super) {
|
|
|
573
593
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
574
594
|
}
|
|
575
595
|
KlesFormRadioComponent.prototype.ngOnInit = function () { _super.prototype.ngOnInit.call(this); };
|
|
596
|
+
KlesFormRadioComponent.prototype.ngOnDestroy = function () {
|
|
597
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
598
|
+
};
|
|
576
599
|
KlesFormRadioComponent = __decorate([
|
|
577
600
|
Component({
|
|
578
|
-
selector:
|
|
601
|
+
selector: 'kles-form-radiobutton',
|
|
579
602
|
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"
|
|
580
603
|
})
|
|
581
604
|
], KlesFormRadioComponent);
|
|
@@ -588,6 +611,9 @@ var KlesFormCheckboxComponent = /** @class */ (function (_super) {
|
|
|
588
611
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
589
612
|
}
|
|
590
613
|
KlesFormCheckboxComponent.prototype.ngOnInit = function () { _super.prototype.ngOnInit.call(this); };
|
|
614
|
+
KlesFormCheckboxComponent.prototype.ngOnDestroy = function () {
|
|
615
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
616
|
+
};
|
|
591
617
|
KlesFormCheckboxComponent = __decorate([
|
|
592
618
|
Component({
|
|
593
619
|
selector: "kles-form-checkbox",
|
|
@@ -643,6 +669,9 @@ var KlesFormListFieldComponent = /** @class */ (function (_super) {
|
|
|
643
669
|
}
|
|
644
670
|
return null;
|
|
645
671
|
};
|
|
672
|
+
KlesFormListFieldComponent.prototype.ngOnDestroy = function () {
|
|
673
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
674
|
+
};
|
|
646
675
|
KlesFormListFieldComponent.ctorParameters = function () { return [
|
|
647
676
|
{ type: FormBuilder }
|
|
648
677
|
]; };
|
|
@@ -687,6 +716,9 @@ var KlesFormColorComponent = /** @class */ (function (_super) {
|
|
|
687
716
|
// pad each with zeros and return
|
|
688
717
|
return "#" + r1 + g1 + b1;
|
|
689
718
|
};
|
|
719
|
+
KlesFormColorComponent.prototype.ngOnDestroy = function () {
|
|
720
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
721
|
+
};
|
|
690
722
|
KlesFormColorComponent = __decorate([
|
|
691
723
|
Component({
|
|
692
724
|
selector: 'kles-form-color',
|
|
@@ -703,6 +735,9 @@ var KlesFormChipComponent = /** @class */ (function (_super) {
|
|
|
703
735
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
704
736
|
}
|
|
705
737
|
KlesFormChipComponent.prototype.ngOnInit = function () { _super.prototype.ngOnInit.call(this); };
|
|
738
|
+
KlesFormChipComponent.prototype.ngOnDestroy = function () {
|
|
739
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
740
|
+
};
|
|
706
741
|
KlesFormChipComponent = __decorate([
|
|
707
742
|
Component({
|
|
708
743
|
selector: "kles-form-chip",
|
|
@@ -721,6 +756,9 @@ var KlesFormGroupComponent = /** @class */ (function (_super) {
|
|
|
721
756
|
this.subGroup = this.group.controls[this.field.name];
|
|
722
757
|
_super.prototype.ngOnInit.call(this);
|
|
723
758
|
};
|
|
759
|
+
KlesFormGroupComponent.prototype.ngOnDestroy = function () {
|
|
760
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
761
|
+
};
|
|
724
762
|
KlesFormGroupComponent = __decorate([
|
|
725
763
|
Component({
|
|
726
764
|
selector: 'kles-group',
|
|
@@ -739,6 +777,9 @@ var KlesFormIconComponent = /** @class */ (function (_super) {
|
|
|
739
777
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
740
778
|
}
|
|
741
779
|
KlesFormIconComponent.prototype.ngOnInit = function () { _super.prototype.ngOnInit.call(this); };
|
|
780
|
+
KlesFormIconComponent.prototype.ngOnDestroy = function () {
|
|
781
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
782
|
+
};
|
|
742
783
|
KlesFormIconComponent = __decorate([
|
|
743
784
|
Component({
|
|
744
785
|
selector: "kles-form-icon",
|
|
@@ -755,7 +796,6 @@ var KlesFormSelectSearchComponent = /** @class */ (function (_super) {
|
|
|
755
796
|
_this.searchControl = new FormControl();
|
|
756
797
|
_this.selectAllControl = new FormControl(false);
|
|
757
798
|
_this.optionsFiltered$ = new ReplaySubject(1);
|
|
758
|
-
_this._onDestroy = new Subject();
|
|
759
799
|
_this.compareFn = function (o1, o2) {
|
|
760
800
|
if (_this.field.property && o1 && o2) {
|
|
761
801
|
return o1[_this.field.property] === o2[_this.field.property];
|
|
@@ -803,7 +843,7 @@ var KlesFormSelectSearchComponent = /** @class */ (function (_super) {
|
|
|
803
843
|
})).subscribe(this.optionsFiltered$);
|
|
804
844
|
this.group.controls[this.field.name]
|
|
805
845
|
.valueChanges.pipe(takeUntil(this._onDestroy), startWith(this.group.controls[this.field.name].value), switchMap(function (selected) {
|
|
806
|
-
return _this.optionsFiltered$.pipe(map(function (options) {
|
|
846
|
+
return _this.optionsFiltered$.pipe(map(function (options) { return options.filter(function (option) { return !(option === null || option === void 0 ? void 0 : option.disabled); }); }), map(function (options) {
|
|
807
847
|
if (!selected) {
|
|
808
848
|
return false;
|
|
809
849
|
}
|
|
@@ -819,12 +859,13 @@ var KlesFormSelectSearchComponent = /** @class */ (function (_super) {
|
|
|
819
859
|
});
|
|
820
860
|
};
|
|
821
861
|
KlesFormSelectSearchComponent.prototype.ngOnDestroy = function () {
|
|
822
|
-
this._onDestroy.next();
|
|
862
|
+
// this._onDestroy.next();
|
|
863
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
823
864
|
};
|
|
824
865
|
KlesFormSelectSearchComponent.prototype.toggleAllSelection = function (state) {
|
|
825
866
|
var _this = this;
|
|
826
867
|
if (state.checked) {
|
|
827
|
-
this.optionsFiltered$.pipe(take(1)).subscribe(function (options) {
|
|
868
|
+
this.optionsFiltered$.pipe(take(1), map(function (options) { return options.filter(function (option) { return !(option === null || option === void 0 ? void 0 : option.disabled); }); })).subscribe(function (options) {
|
|
828
869
|
if (options.length > 0) {
|
|
829
870
|
_this.group.controls[_this.field.name].patchValue(options.slice());
|
|
830
871
|
}
|
|
@@ -851,7 +892,7 @@ var KlesFormSelectSearchComponent = /** @class */ (function (_super) {
|
|
|
851
892
|
KlesFormSelectSearchComponent = __decorate([
|
|
852
893
|
Component({
|
|
853
894
|
selector: 'kles-form-select-search',
|
|
854
|
-
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",
|
|
895
|
+
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",
|
|
855
896
|
styles: ['mat-form-field {width: calc(100%)}', '.selectAll {padding: 10px 16px;}']
|
|
856
897
|
})
|
|
857
898
|
], KlesFormSelectSearchComponent);
|
|
@@ -864,6 +905,9 @@ var KlesFormLineBreakComponent = /** @class */ (function (_super) {
|
|
|
864
905
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
865
906
|
}
|
|
866
907
|
KlesFormLineBreakComponent.prototype.ngOnInit = function () { _super.prototype.ngOnInit.call(this); };
|
|
908
|
+
KlesFormLineBreakComponent.prototype.ngOnDestroy = function () {
|
|
909
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
910
|
+
};
|
|
867
911
|
KlesFormLineBreakComponent = __decorate([
|
|
868
912
|
Component({
|
|
869
913
|
selector: "kles-form-line-break",
|
|
@@ -882,6 +926,9 @@ var KlesFormLinkComponent = /** @class */ (function (_super) {
|
|
|
882
926
|
KlesFormLinkComponent.prototype.ngOnInit = function () {
|
|
883
927
|
_super.prototype.ngOnInit.call(this);
|
|
884
928
|
};
|
|
929
|
+
KlesFormLinkComponent.prototype.ngOnDestroy = function () {
|
|
930
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
931
|
+
};
|
|
885
932
|
KlesFormLinkComponent = __decorate([
|
|
886
933
|
Component({
|
|
887
934
|
selector: 'kles-form-link',
|
|
@@ -905,6 +952,9 @@ var KlesFormSelectionListComponent = /** @class */ (function (_super) {
|
|
|
905
952
|
this.options$ = this.field.options;
|
|
906
953
|
}
|
|
907
954
|
};
|
|
955
|
+
KlesFormSelectionListComponent.prototype.ngOnDestroy = function () {
|
|
956
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
957
|
+
};
|
|
908
958
|
KlesFormSelectionListComponent = __decorate([
|
|
909
959
|
Component({
|
|
910
960
|
selector: 'kles-form-selection-list',
|
|
@@ -929,6 +979,9 @@ var KlesFormButtonToogleGroupComponent = /** @class */ (function (_super) {
|
|
|
929
979
|
this.options$ = this.field.options;
|
|
930
980
|
}
|
|
931
981
|
};
|
|
982
|
+
KlesFormButtonToogleGroupComponent.prototype.ngOnDestroy = function () {
|
|
983
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
984
|
+
};
|
|
932
985
|
KlesFormButtonToogleGroupComponent = __decorate([
|
|
933
986
|
Component({
|
|
934
987
|
selector: 'kles-form-button-toogle-group',
|
|
@@ -937,11 +990,6 @@ var KlesFormButtonToogleGroupComponent = /** @class */ (function (_super) {
|
|
|
937
990
|
], KlesFormButtonToogleGroupComponent);
|
|
938
991
|
return KlesFormButtonToogleGroupComponent;
|
|
939
992
|
}(KlesFieldAbstract));
|
|
940
|
-
// <mat-button-toggle-group [formControlName]="field.name">
|
|
941
|
-
// <mat-button-toggle value="bold">Bold</mat-button-toggle>
|
|
942
|
-
// <mat-button-toggle value="italic">Italic</mat-button-toggle>
|
|
943
|
-
// <mat-button-toggle value="underline">Underline</mat-button-toggle>
|
|
944
|
-
// </mat-button-toggle-group>
|
|
945
993
|
|
|
946
994
|
var KlesFormArrayComponent = /** @class */ (function (_super) {
|
|
947
995
|
__extends(KlesFormArrayComponent, _super);
|
|
@@ -952,9 +1000,9 @@ var KlesFormArrayComponent = /** @class */ (function (_super) {
|
|
|
952
1000
|
// this.subGroup = this.group.controls[this.field.name] as FormGroup;
|
|
953
1001
|
_super.prototype.ngOnInit.call(this);
|
|
954
1002
|
this.formArray = this.group.controls[this.field.name];
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
1003
|
+
};
|
|
1004
|
+
KlesFormArrayComponent.prototype.ngOnDestroy = function () {
|
|
1005
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
958
1006
|
};
|
|
959
1007
|
KlesFormArrayComponent = __decorate([
|
|
960
1008
|
Component({
|
|
@@ -1003,7 +1051,6 @@ var KlesDynamicFieldDirective = /** @class */ (function () {
|
|
|
1003
1051
|
this.buildComponent();
|
|
1004
1052
|
};
|
|
1005
1053
|
KlesDynamicFieldDirective.prototype.ngOnChanges = function (changes) {
|
|
1006
|
-
console.log('ngOnCHange', changes);
|
|
1007
1054
|
if (changes.group) {
|
|
1008
1055
|
this.group = changes.group.currentValue;
|
|
1009
1056
|
}
|
|
@@ -1247,10 +1294,13 @@ var KlesFormButtonComponent = /** @class */ (function (_super) {
|
|
|
1247
1294
|
KlesFormButtonComponent.prototype.ngOnInit = function () {
|
|
1248
1295
|
_super.prototype.ngOnInit.call(this);
|
|
1249
1296
|
};
|
|
1297
|
+
KlesFormButtonComponent.prototype.ngOnDestroy = function () {
|
|
1298
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
1299
|
+
};
|
|
1250
1300
|
KlesFormButtonComponent = __decorate([
|
|
1251
1301
|
Component({
|
|
1252
1302
|
selector: 'kles-form-button',
|
|
1253
|
-
template: "\n <div [formGroup]=\"group\">\n <kles-button
|
|
1303
|
+
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 "
|
|
1254
1304
|
})
|
|
1255
1305
|
], KlesFormButtonComponent);
|
|
1256
1306
|
return KlesFormButtonComponent;
|
|
@@ -1296,10 +1346,13 @@ var KlesFormButtonCheckerComponent = /** @class */ (function (_super) {
|
|
|
1296
1346
|
KlesFormButtonCheckerComponent.prototype.ngOnInit = function () {
|
|
1297
1347
|
_super.prototype.ngOnInit.call(this);
|
|
1298
1348
|
};
|
|
1349
|
+
KlesFormButtonCheckerComponent.prototype.ngOnDestroy = function () {
|
|
1350
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
1351
|
+
};
|
|
1299
1352
|
KlesFormButtonCheckerComponent = __decorate([
|
|
1300
1353
|
Component({
|
|
1301
1354
|
selector: 'kles-form-button-checker',
|
|
1302
|
-
template: "\n <div [formGroup]=\"group\">\n <kles-button-checker\n [attr.id]=\"field.id\" [classButton]=\"field.ngClass\"
|
|
1355
|
+
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 "
|
|
1303
1356
|
})
|
|
1304
1357
|
], KlesFormButtonCheckerComponent);
|
|
1305
1358
|
return KlesFormButtonCheckerComponent;
|
|
@@ -1350,10 +1403,6 @@ var KlesButtonFileComponent = /** @class */ (function (_super) {
|
|
|
1350
1403
|
files = input.files;
|
|
1351
1404
|
fileContent = [];
|
|
1352
1405
|
if (!(files && files.length)) return [3 /*break*/, 7];
|
|
1353
|
-
console.log('Filename: ' + files[0].name);
|
|
1354
|
-
console.log('Type: ' + files[0].type);
|
|
1355
|
-
console.log('Size: ' + files[0].size + ' bytes');
|
|
1356
|
-
console.log('Files=', files.length);
|
|
1357
1406
|
i = 0;
|
|
1358
1407
|
_c.label = 1;
|
|
1359
1408
|
case 1:
|
|
@@ -1431,6 +1480,9 @@ var KlesFormButtonFileComponent = /** @class */ (function (_super) {
|
|
|
1431
1480
|
KlesFormButtonFileComponent.prototype.ngOnInit = function () {
|
|
1432
1481
|
_super.prototype.ngOnInit.call(this);
|
|
1433
1482
|
};
|
|
1483
|
+
KlesFormButtonFileComponent.prototype.ngOnDestroy = function () {
|
|
1484
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
1485
|
+
};
|
|
1434
1486
|
KlesFormButtonFileComponent = __decorate([
|
|
1435
1487
|
Component({
|
|
1436
1488
|
selector: 'kles-form-button-file',
|
|
@@ -1448,6 +1500,9 @@ var KlesFormTextareaComponent = /** @class */ (function (_super) {
|
|
|
1448
1500
|
KlesFormTextareaComponent.prototype.ngOnInit = function () {
|
|
1449
1501
|
_super.prototype.ngOnInit.call(this);
|
|
1450
1502
|
};
|
|
1503
|
+
KlesFormTextareaComponent.prototype.ngOnDestroy = function () {
|
|
1504
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
1505
|
+
};
|
|
1451
1506
|
KlesFormTextareaComponent = __decorate([
|
|
1452
1507
|
Component({
|
|
1453
1508
|
selector: 'kles-form-textarea',
|
|
@@ -1466,6 +1521,9 @@ var KlesFormTextComponent = /** @class */ (function (_super) {
|
|
|
1466
1521
|
KlesFormTextComponent.prototype.ngOnInit = function () {
|
|
1467
1522
|
_super.prototype.ngOnInit.call(this);
|
|
1468
1523
|
};
|
|
1524
|
+
KlesFormTextComponent.prototype.ngOnDestroy = function () {
|
|
1525
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
1526
|
+
};
|
|
1469
1527
|
KlesFormTextComponent = __decorate([
|
|
1470
1528
|
Component({
|
|
1471
1529
|
selector: 'kles-form-text',
|
|
@@ -1480,10 +1538,13 @@ var KlesFormInputClearableComponent = /** @class */ (function (_super) {
|
|
|
1480
1538
|
function KlesFormInputClearableComponent() {
|
|
1481
1539
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1482
1540
|
}
|
|
1541
|
+
KlesFormInputClearableComponent.prototype.ngOnDestroy = function () {
|
|
1542
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
1543
|
+
};
|
|
1483
1544
|
KlesFormInputClearableComponent = __decorate([
|
|
1484
1545
|
Component({
|
|
1485
1546
|
selector: 'kles-form-input-clearable',
|
|
1486
|
-
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 ",
|
|
1547
|
+
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 ",
|
|
1487
1548
|
styles: ['mat-form-field {width: calc(100%)}']
|
|
1488
1549
|
})
|
|
1489
1550
|
], KlesFormInputClearableComponent);
|
|
@@ -1541,10 +1602,13 @@ var KlesFormSlideToggleComponent = /** @class */ (function (_super) {
|
|
|
1541
1602
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1542
1603
|
}
|
|
1543
1604
|
KlesFormSlideToggleComponent.prototype.ngOnInit = function () { _super.prototype.ngOnInit.call(this); };
|
|
1605
|
+
KlesFormSlideToggleComponent.prototype.ngOnDestroy = function () {
|
|
1606
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
1607
|
+
};
|
|
1544
1608
|
KlesFormSlideToggleComponent = __decorate([
|
|
1545
1609
|
Component({
|
|
1546
|
-
selector:
|
|
1547
|
-
template: "\n <div [formGroup]=\"group\"
|
|
1610
|
+
selector: 'kles-form-slide-toggle',
|
|
1611
|
+
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"
|
|
1548
1612
|
})
|
|
1549
1613
|
], KlesFormSlideToggleComponent);
|
|
1550
1614
|
return KlesFormSlideToggleComponent;
|
|
@@ -1558,10 +1622,13 @@ var KlesFormBadgeComponent = /** @class */ (function (_super) {
|
|
|
1558
1622
|
KlesFormBadgeComponent.prototype.ngOnInit = function () {
|
|
1559
1623
|
_super.prototype.ngOnInit.call(this);
|
|
1560
1624
|
};
|
|
1625
|
+
KlesFormBadgeComponent.prototype.ngOnDestroy = function () {
|
|
1626
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
1627
|
+
};
|
|
1561
1628
|
KlesFormBadgeComponent = __decorate([
|
|
1562
1629
|
Component({
|
|
1563
1630
|
selector: 'kles-form-badge',
|
|
1564
|
-
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
|
|
1631
|
+
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"
|
|
1565
1632
|
})
|
|
1566
1633
|
], KlesFormBadgeComponent);
|
|
1567
1634
|
return KlesFormBadgeComponent;
|