@stemy/ngx-dynamic-form 13.1.17 → 13.1.18
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/esm2020/ngx-dynamic-form/components/base/dynamic-base-form-control.component.mjs +10 -4
- package/esm2020/ngx-dynamic-form/directives/async-submit.directive.mjs +3 -2
- package/fesm2015/stemy-ngx-dynamic-form.mjs +14 -9
- package/fesm2015/stemy-ngx-dynamic-form.mjs.map +1 -1
- package/fesm2020/stemy-ngx-dynamic-form.mjs +14 -9
- package/fesm2020/stemy-ngx-dynamic-form.mjs.map +1 -1
- package/ngx-dynamic-form/components/base/dynamic-base-form-control.component.d.ts +6 -2
- package/package.json +1 -1
|
@@ -4,11 +4,11 @@ import { __decorate } from 'tslib';
|
|
|
4
4
|
import * as i1 from '@ng-dynamic-forms/core';
|
|
5
5
|
import { DynamicInputControlModel, DYNAMIC_FORM_CONTROL_TYPE_EDITOR, serializable, DynamicFormArrayGroupModel as DynamicFormArrayGroupModel$1, DynamicFormArrayModel as DynamicFormArrayModel$1, DynamicFormOption as DynamicFormOption$1, DynamicSelectModel as DynamicSelectModel$1, DynamicFormService as DynamicFormService$1, DynamicDatePickerModel, DynamicFormGroupModel, DynamicInputModel, DynamicFormValueControlModel, DynamicFileUploadModel, DynamicCheckboxModel, DynamicTextAreaModel, DynamicFormComponent, DynamicTemplateDirective, DynamicFormControlContainerComponent, DYNAMIC_FORM_CONTROL_TYPE_ARRAY, DynamicFormArrayComponent, DynamicFormControlComponent, DynamicFormGroupComponent, DYNAMIC_FORM_CONTROL_MAP_FN, DYNAMIC_VALIDATORS } from '@ng-dynamic-forms/core';
|
|
6
6
|
export { DYNAMIC_FORM_CONTROL_TYPE_ARRAY, DYNAMIC_FORM_CONTROL_TYPE_CHECKBOX, DYNAMIC_FORM_CONTROL_TYPE_CHECKBOX_GROUP, DYNAMIC_FORM_CONTROL_TYPE_DATEPICKER, DYNAMIC_FORM_CONTROL_TYPE_EDITOR, DYNAMIC_FORM_CONTROL_TYPE_FILE_UPLOAD, DYNAMIC_FORM_CONTROL_TYPE_GROUP, DYNAMIC_FORM_CONTROL_TYPE_INPUT, DYNAMIC_FORM_CONTROL_TYPE_RADIO_GROUP, DYNAMIC_FORM_CONTROL_TYPE_SELECT, DYNAMIC_FORM_CONTROL_TYPE_TEXTAREA, DynamicCheckboxGroupModel, DynamicCheckboxModel, DynamicDatePickerModel, DynamicFileUploadModel, DynamicFormControlComponent, DynamicFormGroupModel, DynamicFormsCoreModule, DynamicInputModel, DynamicListDirective, DynamicRadioGroupModel, DynamicTemplateDirective, DynamicTextAreaModel } from '@ng-dynamic-forms/core';
|
|
7
|
-
import { BehaviorSubject, of, isObservable, map, Subject, firstValueFrom, Subscription, debounceTime, groupBy, mergeMap } from 'rxjs';
|
|
7
|
+
import { BehaviorSubject, of, isObservable, map, Subject, firstValueFrom, Subscription, debounceTime as debounceTime$1, groupBy, mergeMap } from 'rxjs';
|
|
8
8
|
import * as i0 from '@angular/core';
|
|
9
9
|
import { Injector, Injectable, Inject, EventEmitter, Directive, Input, Output, HostBinding, HostListener, QueryList, Component, ChangeDetectionStrategy, ContentChildren, ViewChildren, ViewContainerRef, ViewChild, forwardRef, NgModule } from '@angular/core';
|
|
10
10
|
import { FormGroup, FormArray, FormsModule, ReactiveFormsModule, NG_VALIDATORS } from '@angular/forms';
|
|
11
|
-
import { first } from 'rxjs/operators';
|
|
11
|
+
import { debounceTime, first } from 'rxjs/operators';
|
|
12
12
|
import { CommonModule } from '@angular/common';
|
|
13
13
|
|
|
14
14
|
// --- Decorator functions ---
|
|
@@ -1030,7 +1030,7 @@ class AsyncSubmitDirective {
|
|
|
1030
1030
|
}
|
|
1031
1031
|
this.callback = null;
|
|
1032
1032
|
});
|
|
1033
|
-
this.onSubmit = this.form.onSubmit.subscribe(() => this.callMethod());
|
|
1033
|
+
this.onSubmit = this.form.onSubmit.pipe(debounceTime(200)).subscribe(() => this.callMethod());
|
|
1034
1034
|
}
|
|
1035
1035
|
ngOnDestroy() {
|
|
1036
1036
|
if (this.onStatusChange)
|
|
@@ -1129,10 +1129,10 @@ class DynamicBaseFormComponent extends DynamicFormComponent {
|
|
|
1129
1129
|
if (this.group) {
|
|
1130
1130
|
this.groupSubscription = ObservableUtils.multiSubscription(this.group.statusChanges.subscribe(() => {
|
|
1131
1131
|
this.onStatusChange.emit(this);
|
|
1132
|
-
}), this.group.valueChanges.pipe(debounceTime(500)).subscribe(() => {
|
|
1132
|
+
}), this.group.valueChanges.pipe(debounceTime$1(500)).subscribe(() => {
|
|
1133
1133
|
this.formService.notifyChanges(this.model, this.group);
|
|
1134
1134
|
}), this.change.pipe(groupBy(ev => ev.model))
|
|
1135
|
-
.pipe(mergeMap(t => t.pipe(debounceTime(500))))
|
|
1135
|
+
.pipe(mergeMap(t => t.pipe(debounceTime$1(500))))
|
|
1136
1136
|
.subscribe(ev => {
|
|
1137
1137
|
this.onValueChange.emit({ ...ev, form: this });
|
|
1138
1138
|
}));
|
|
@@ -1475,15 +1475,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
|
|
|
1475
1475
|
}] } });
|
|
1476
1476
|
|
|
1477
1477
|
class DynamicBaseFormControlComponent extends DynamicFormControlComponent {
|
|
1478
|
-
constructor(
|
|
1478
|
+
constructor(layoutService, validationService, form, injector, cdr) {
|
|
1479
1479
|
super(layoutService, validationService);
|
|
1480
|
+
this.form = form;
|
|
1481
|
+
this.injector = injector;
|
|
1480
1482
|
this.cdr = cdr;
|
|
1481
1483
|
this.blur = new EventEmitter();
|
|
1482
1484
|
this.change = new EventEmitter();
|
|
1483
1485
|
this.focus = new EventEmitter();
|
|
1484
1486
|
}
|
|
1485
1487
|
ngAfterViewInit() {
|
|
1486
|
-
this.subscription = this.control.valueChanges.pipe(debounceTime(500)).subscribe(value => {
|
|
1488
|
+
this.subscription = this.control.valueChanges.pipe(debounceTime$1(500)).subscribe(value => {
|
|
1487
1489
|
this.onValueChanged(value);
|
|
1488
1490
|
});
|
|
1489
1491
|
}
|
|
@@ -1492,10 +1494,13 @@ class DynamicBaseFormControlComponent extends DynamicFormControlComponent {
|
|
|
1492
1494
|
return;
|
|
1493
1495
|
this.subscription.unsubscribe();
|
|
1494
1496
|
}
|
|
1497
|
+
submit() {
|
|
1498
|
+
this.form.submit();
|
|
1499
|
+
}
|
|
1495
1500
|
onValueChanged(value) {
|
|
1496
1501
|
}
|
|
1497
1502
|
}
|
|
1498
|
-
DynamicBaseFormControlComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: DynamicBaseFormControlComponent, deps: [{ token:
|
|
1503
|
+
DynamicBaseFormControlComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: DynamicBaseFormControlComponent, deps: [{ token: i1.DynamicFormLayoutService }, { token: i1.DynamicFormValidationService }, { token: DynamicBaseFormComponent }, { token: i0.Injector }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1499
1504
|
DynamicBaseFormControlComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.8", type: DynamicBaseFormControlComponent, selector: "dynamic-base-form-control", inputs: { formLayout: "formLayout", group: "group", layout: "layout", model: "model" }, outputs: { blur: "blur", change: "change", focus: "focus" }, usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1500
1505
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: DynamicBaseFormControlComponent, decorators: [{
|
|
1501
1506
|
type: Component,
|
|
@@ -1504,7 +1509,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
|
|
|
1504
1509
|
template: "",
|
|
1505
1510
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
1506
1511
|
}]
|
|
1507
|
-
}], ctorParameters: function () { return [{ type:
|
|
1512
|
+
}], ctorParameters: function () { return [{ type: i1.DynamicFormLayoutService }, { type: i1.DynamicFormValidationService }, { type: DynamicBaseFormComponent }, { type: i0.Injector }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { formLayout: [{
|
|
1508
1513
|
type: Input
|
|
1509
1514
|
}], group: [{
|
|
1510
1515
|
type: Input
|