@klippa/ngx-enhancy-forms 14.12.2 → 14.14.0
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/lib/form/form-submit-button/form-submit-button.component.mjs +6 -3
- package/esm2020/lib/form/form.component.mjs +3 -3
- package/fesm2015/klippa-ngx-enhancy-forms.mjs +8 -5
- package/fesm2015/klippa-ngx-enhancy-forms.mjs.map +1 -1
- package/fesm2020/klippa-ngx-enhancy-forms.mjs +8 -5
- package/fesm2020/klippa-ngx-enhancy-forms.mjs.map +1 -1
- package/lib/form/form-submit-button/form-submit-button.component.d.ts +2 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { Directive, Input, EventEmitter, Component, SkipSelf, Optional, Output,
|
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import * as i2 from '@angular/forms';
|
|
6
|
-
import { UntypedFormArray, UntypedFormGroup,
|
|
6
|
+
import { UntypedFormArray, UntypedFormGroup, FormControl, UntypedFormControl, FormArray, FormGroup, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
7
7
|
import { isString } from 'lodash-es';
|
|
8
8
|
import { isArray } from 'lodash';
|
|
9
9
|
import * as i4 from '@ng-select/ng-select';
|
|
@@ -202,13 +202,13 @@ class FormComponent {
|
|
|
202
202
|
const injectAt = this.subFormPlaceholder.at;
|
|
203
203
|
if (injectInto instanceof UntypedFormArray) {
|
|
204
204
|
const idx = injectInto.controls.findIndex(e => e === this.formGroup);
|
|
205
|
-
injectInto.
|
|
205
|
+
injectInto.setControl(idx, new FormControl());
|
|
206
206
|
}
|
|
207
207
|
else if (injectInto instanceof UntypedFormGroup) {
|
|
208
208
|
if (typeof injectAt !== 'string') {
|
|
209
209
|
throw new Error(`cannot index FormGroup with ${typeof injectAt}`);
|
|
210
210
|
}
|
|
211
|
-
injectInto.
|
|
211
|
+
injectInto.setControl(injectAt, new FormControl());
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
}
|
|
@@ -1413,6 +1413,7 @@ class FormSubmitButtonComponent {
|
|
|
1413
1413
|
this.variant = 'greenFilled';
|
|
1414
1414
|
this.before = () => Promise.resolve();
|
|
1415
1415
|
this.after = () => Promise.resolve();
|
|
1416
|
+
this.disabled = false;
|
|
1416
1417
|
this.setValidationError = (e) => {
|
|
1417
1418
|
this.parentForm.formGroup.get(e.path)?.setErrors({ message: { value: e.message } });
|
|
1418
1419
|
};
|
|
@@ -1436,10 +1437,10 @@ class FormSubmitButtonComponent {
|
|
|
1436
1437
|
}
|
|
1437
1438
|
}
|
|
1438
1439
|
FormSubmitButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: FormSubmitButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1439
|
-
FormSubmitButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: FormSubmitButtonComponent, selector: "klp-form-submit-button", inputs: { isLoading: "isLoading", fullWidth: "fullWidth", variant: "variant", submitCallback: "submitCallback", before: "before", after: "after" }, host: { properties: { "class._fullWidth": "this.fullWidth" } }, ngImport: i0, template: "<klp-form-button\n\t\t[variant]=\"variant\"\n\t\t(click)=\"submitForm()\"\n\t\t[disabled]=\"isLoading\"\n\t\t[isLoading]=\"isLoading\"\n\t\t[fullWidth]=\"fullWidth\"\n\t\ttype=\"submit\"\n\t\t[ngClass]=\"fullWidth ? 'fullWidth' : ''\"\n\t>\n\t<ng-content></ng-content>\n</klp-form-button>\n", styles: [":host{display:inline-block}:host._fullWidth{display:block}.fullWidth{width:100%}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ButtonComponent, selector: "klp-form-button", inputs: ["variant", "size", "fullWidth", "hasBorder", "disabled", "isLoading", "type", "clickCallback"] }] });
|
|
1440
|
+
FormSubmitButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.8", type: FormSubmitButtonComponent, selector: "klp-form-submit-button", inputs: { isLoading: "isLoading", fullWidth: "fullWidth", variant: "variant", submitCallback: "submitCallback", before: "before", after: "after", disabled: "disabled" }, host: { properties: { "class._fullWidth": "this.fullWidth" } }, ngImport: i0, template: "<klp-form-button\n\t\t[variant]=\"variant\"\n\t\t(click)=\"submitForm()\"\n\t\t[disabled]=\"isLoading || disabled\"\n\t\t[isLoading]=\"isLoading\"\n\t\t[fullWidth]=\"fullWidth\"\n\t\ttype=\"submit\"\n\t\t[ngClass]=\"fullWidth ? 'fullWidth' : ''\"\n\t>\n\t<ng-content></ng-content>\n</klp-form-button>\n", styles: [":host{display:inline-block}:host._fullWidth{display:block}.fullWidth{width:100%}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ButtonComponent, selector: "klp-form-button", inputs: ["variant", "size", "fullWidth", "hasBorder", "disabled", "isLoading", "type", "clickCallback"] }] });
|
|
1440
1441
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImport: i0, type: FormSubmitButtonComponent, decorators: [{
|
|
1441
1442
|
type: Component,
|
|
1442
|
-
args: [{ selector: 'klp-form-submit-button', template: "<klp-form-button\n\t\t[variant]=\"variant\"\n\t\t(click)=\"submitForm()\"\n\t\t[disabled]=\"isLoading\"\n\t\t[isLoading]=\"isLoading\"\n\t\t[fullWidth]=\"fullWidth\"\n\t\ttype=\"submit\"\n\t\t[ngClass]=\"fullWidth ? 'fullWidth' : ''\"\n\t>\n\t<ng-content></ng-content>\n</klp-form-button>\n", styles: [":host{display:inline-block}:host._fullWidth{display:block}.fullWidth{width:100%}\n"] }]
|
|
1443
|
+
args: [{ selector: 'klp-form-submit-button', template: "<klp-form-button\n\t\t[variant]=\"variant\"\n\t\t(click)=\"submitForm()\"\n\t\t[disabled]=\"isLoading || disabled\"\n\t\t[isLoading]=\"isLoading\"\n\t\t[fullWidth]=\"fullWidth\"\n\t\ttype=\"submit\"\n\t\t[ngClass]=\"fullWidth ? 'fullWidth' : ''\"\n\t>\n\t<ng-content></ng-content>\n</klp-form-button>\n", styles: [":host{display:inline-block}:host._fullWidth{display:block}.fullWidth{width:100%}\n"] }]
|
|
1443
1444
|
}], propDecorators: { isLoading: [{
|
|
1444
1445
|
type: Input
|
|
1445
1446
|
}], fullWidth: [{
|
|
@@ -1455,6 +1456,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.8", ngImpor
|
|
|
1455
1456
|
type: Input
|
|
1456
1457
|
}], after: [{
|
|
1457
1458
|
type: Input
|
|
1459
|
+
}], disabled: [{
|
|
1460
|
+
type: Input
|
|
1458
1461
|
}] } });
|
|
1459
1462
|
|
|
1460
1463
|
class MultipleValueAccessorBase extends ValueAccessorBase {
|