@klippa/ngx-enhancy-forms 14.7.16 → 14.8.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 +28 -43
- package/esm2020/lib/form/form-validation-error/form-validation-error.mjs +22 -0
- package/esm2020/lib/util/arrays.mjs +4 -1
- package/esm2020/lib/util/classes.mjs +2 -0
- package/esm2020/lib/withTooltip.component.mjs +2 -2
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/klippa-ngx-enhancy-forms.mjs +50 -41
- package/fesm2015/klippa-ngx-enhancy-forms.mjs.map +1 -1
- package/fesm2020/klippa-ngx-enhancy-forms.mjs +48 -39
- package/fesm2020/klippa-ngx-enhancy-forms.mjs.map +1 -1
- package/lib/form/form-submit-button/form-submit-button.component.d.ts +5 -6
- package/lib/form/form-validation-error/form-validation-error.d.ts +10 -0
- package/lib/util/arrays.d.ts +2 -0
- package/lib/util/classes.d.ts +1 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { FormComponent } from '../form.component';
|
|
2
1
|
import { ButtonVariant } from '../../elements/button/button.component';
|
|
3
2
|
import * as i0 from "@angular/core";
|
|
4
3
|
export declare type SubmitButtonVariant = Extract<ButtonVariant, 'greenFilled' | 'redFilled' | 'greenOutlined' | 'white'>;
|
|
5
4
|
export declare class FormSubmitButtonComponent {
|
|
6
5
|
private parentForm;
|
|
6
|
+
private handleError;
|
|
7
7
|
isLoading: boolean;
|
|
8
8
|
fullWidth: boolean;
|
|
9
9
|
variant: SubmitButtonVariant;
|
|
10
|
+
submitCallback: (renderedAndEnabledValues: object, renderedButDisabledValues: object) => Promise<any>;
|
|
10
11
|
before: () => Promise<any>;
|
|
11
12
|
after: () => Promise<any>;
|
|
12
|
-
|
|
13
|
-
get _(): boolean;
|
|
14
|
-
constructor(parentForm: FormComponent);
|
|
13
|
+
private setValidationError;
|
|
15
14
|
submitForm(): Promise<void>;
|
|
16
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FormSubmitButtonComponent,
|
|
17
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FormSubmitButtonComponent, "klp-form-submit-button", never, { "isLoading": "isLoading"; "fullWidth": "fullWidth"; "variant": "variant"; "
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormSubmitButtonComponent, never>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormSubmitButtonComponent, "klp-form-submit-button", never, { "isLoading": "isLoading"; "fullWidth": "fullWidth"; "variant": "variant"; "submitCallback": "submitCallback"; "before": "before"; "after": "after"; }, {}, never, ["*"], false>;
|
|
18
17
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
export declare class FormValidationError extends Error {
|
|
3
|
+
readonly name = "FormValidationError";
|
|
4
|
+
readonly path: string;
|
|
5
|
+
constructor(path: string, message: string);
|
|
6
|
+
}
|
|
7
|
+
export declare type FormValidationErrors = Array<FormValidationError>;
|
|
8
|
+
export declare type FormErrorHandler = (error: any) => FormValidationErrors;
|
|
9
|
+
export declare const KLP_FORM_ERROR_HANDLER: InjectionToken<FormErrorHandler>;
|
|
10
|
+
export declare const DefaultErrorHandler: FormErrorHandler;
|
package/lib/util/arrays.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { Newable } from './classes';
|
|
1
2
|
export declare function removeDuplicatesFromArraysWithComparator(comparator: (e1: any, e2: any) => boolean, ...arrays: any[]): any;
|
|
2
3
|
export declare function removeDuplicatesFromArray<T>(array: Array<T>): Array<T>;
|
|
3
4
|
export declare function insertAtIndex(arr: any, index: any, item: any): void;
|
|
4
5
|
export declare function arrayIsSetAndFilled(arr: any): boolean;
|
|
5
6
|
export declare function asArray(value: any): Array<any>;
|
|
6
7
|
export declare function splitArrayByCondition<T>(value: Array<T>, condition: (current: T) => boolean): Array<Array<T>>;
|
|
8
|
+
export declare function isArrayOf<T>(arr: Array<T | any>, kind: Newable<T>): arr is Array<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type Newable<T> = new (...args: any[]) => T;
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -24,5 +24,6 @@ export * from './lib/form/form-caption/form-caption.component';
|
|
|
24
24
|
export * from './lib/form/form-element/form-element.component';
|
|
25
25
|
export * from './lib/form/form-error/form-error.component';
|
|
26
26
|
export * from './lib/form/form-submit-button/form-submit-button.component';
|
|
27
|
+
export * from './lib/form/form-validation-error/form-validation-error';
|
|
27
28
|
export * from './lib/validators/dateValidator';
|
|
28
29
|
export * from './lib/types';
|