@klippa/ngx-enhancy-forms 16.9.3 → 16.21.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/esm2022/lib/elementIsTruncatedCb.component.mjs +49 -0
- package/esm2022/lib/elements/button/button.component.mjs +4 -4
- package/esm2022/lib/elements/checkbox/checkbox.component.mjs +4 -4
- package/esm2022/lib/elements/date-picker/date-picker.component.mjs +5 -5
- package/esm2022/lib/elements/date-time-picker/date-time-picker.component.mjs +6 -6
- package/esm2022/lib/elements/email/email-input.component.mjs +7 -6
- package/esm2022/lib/elements/file-input/file-input.component.mjs +7 -5
- package/esm2022/lib/elements/hour-minute-input/hour-minute-input.component.mjs +5 -5
- package/esm2022/lib/elements/loading-indicator/loading-indicator.component.mjs +4 -4
- package/esm2022/lib/elements/number-input/number-input.component.mjs +4 -4
- package/esm2022/lib/elements/password-field/password-field.component.mjs +4 -4
- package/esm2022/lib/elements/radio/radio.component.mjs +5 -5
- package/esm2022/lib/elements/select/select-footer/select-footer.component.mjs +4 -4
- package/esm2022/lib/elements/select/select.component.mjs +136 -40
- package/esm2022/lib/elements/sortable-grouped-items/sortable-grouped-items.component.mjs +4 -4
- package/esm2022/lib/elements/sortable-items/sortable-items.component.mjs +4 -4
- package/esm2022/lib/elements/text-input/text-input.component.mjs +5 -5
- package/esm2022/lib/elements/toggle/toggle.component.mjs +5 -5
- package/esm2022/lib/elements/value-accessor-base/multiple-value-accessor-base.component.mjs +4 -4
- package/esm2022/lib/elements/value-accessor-base/value-accessor-base.component.mjs +16 -4
- package/esm2022/lib/form/form-caption/form-caption.component.mjs +4 -4
- package/esm2022/lib/form/form-element/form-element.component.mjs +146 -14
- package/esm2022/lib/form/form-error/form-error.component.mjs +4 -4
- package/esm2022/lib/form/form-submit-button/form-submit-button.component.mjs +8 -5
- package/esm2022/lib/form/form.component.mjs +77 -10
- package/esm2022/lib/material.module.mjs +5 -5
- package/esm2022/lib/ngx-enhancy-forms.module.mjs +21 -8
- package/esm2022/lib/onRender.component.mjs +19 -0
- package/esm2022/lib/types.mjs +1 -1
- package/esm2022/lib/util/angular.mjs +9 -0
- package/esm2022/lib/util/dom.mjs +15 -0
- package/esm2022/lib/warning-icon/warning-icon.component.mjs +17 -0
- package/esm2022/lib/withTooltip.component.mjs +37 -15
- package/esm2022/public-api.mjs +3 -1
- package/fesm2022/klippa-ngx-enhancy-forms.mjs +651 -215
- package/fesm2022/klippa-ngx-enhancy-forms.mjs.map +1 -1
- package/lib/elementIsTruncatedCb.component.d.ts +12 -0
- package/lib/elements/file-input/file-input.component.d.ts +2 -1
- package/lib/elements/radio/radio.component.d.ts +1 -0
- package/lib/elements/select/select.component.d.ts +18 -3
- package/lib/elements/value-accessor-base/value-accessor-base.component.d.ts +6 -2
- package/lib/form/form-caption/form-caption.component.d.ts +2 -2
- package/lib/form/form-element/form-element.component.d.ts +37 -13
- package/lib/form/form-error/form-error.component.d.ts +2 -2
- package/lib/form/form-submit-button/form-submit-button.component.d.ts +2 -1
- package/lib/form/form.component.d.ts +10 -3
- package/lib/ngx-enhancy-forms.module.d.ts +9 -6
- package/lib/onRender.component.d.ts +8 -0
- package/lib/types.d.ts +1 -0
- package/lib/util/angular.d.ts +2 -0
- package/lib/util/dom.d.ts +2 -0
- package/lib/warning-icon/warning-icon.component.d.ts +6 -0
- package/lib/withTooltip.component.d.ts +3 -2
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef } from "@angular/core";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class ElementIsTruncatedCbComponent implements AfterViewInit {
|
|
4
|
+
private elementRef;
|
|
5
|
+
elementIsTruncatedCb: (isTruncated: boolean) => void;
|
|
6
|
+
constructor(elementRef: ElementRef);
|
|
7
|
+
ngAfterViewInit(): void;
|
|
8
|
+
private checkForTruncation;
|
|
9
|
+
private isTruncated;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ElementIsTruncatedCbComponent, never>;
|
|
11
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ElementIsTruncatedCbComponent, "[elementIsTruncatedCb]", never, { "elementIsTruncatedCb": { "alias": "elementIsTruncatedCb"; "required": false; }; }, {}, never, never, false, never>;
|
|
12
|
+
}
|
|
@@ -6,11 +6,12 @@ export declare class FileInputComponent extends MultipleValueAccessorBase<File>
|
|
|
6
6
|
clearable: boolean;
|
|
7
7
|
onlyShowUploadButton: boolean;
|
|
8
8
|
useFullParentSize: boolean;
|
|
9
|
+
buttonText: string;
|
|
9
10
|
nativeInputRef: ElementRef<HTMLInputElement>;
|
|
10
11
|
onChange(files: FileList): void;
|
|
11
12
|
getFileNames(): string;
|
|
12
13
|
shouldShowClearButton(): boolean;
|
|
13
14
|
uploadFileClicked(): void;
|
|
14
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<FileInputComponent, never>;
|
|
15
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FileInputComponent, "klp-form-file-input", never, { "isLoading": { "alias": "isLoading"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "onlyShowUploadButton": { "alias": "onlyShowUploadButton"; "required": false; }; "useFullParentSize": { "alias": "useFullParentSize"; "required": false; }; }, {}, never,
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FileInputComponent, "klp-form-file-input", never, { "isLoading": { "alias": "isLoading"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "onlyShowUploadButton": { "alias": "onlyShowUploadButton"; "required": false; }; "useFullParentSize": { "alias": "useFullParentSize"; "required": false; }; "buttonText": { "alias": "buttonText"; "required": false; }; }, {}, never, ["*"], false, never>;
|
|
16
17
|
}
|
|
@@ -32,6 +32,7 @@ export declare class SelectComponent extends ValueAccessorBase<string | string[]
|
|
|
32
32
|
withSeparatingLine: boolean;
|
|
33
33
|
searchable: boolean;
|
|
34
34
|
dropdownPosition: 'auto' | 'bottom' | 'top' | 'left' | 'right';
|
|
35
|
+
dropdownAlignment: 'left' | 'right';
|
|
35
36
|
customSearchFn: (term: string, item: {
|
|
36
37
|
id: string;
|
|
37
38
|
name: string;
|
|
@@ -46,26 +47,40 @@ export declare class SelectComponent extends ValueAccessorBase<string | string[]
|
|
|
46
47
|
onClear: EventEmitter<void>;
|
|
47
48
|
onEnterKey: EventEmitter<string>;
|
|
48
49
|
ngSelect: any;
|
|
50
|
+
tailRef: ElementRef;
|
|
51
|
+
tailMockRef: ElementRef;
|
|
49
52
|
customOptionTpl: TemplateRef<any>;
|
|
50
53
|
private lastItemIndexReached;
|
|
51
54
|
dropdownPositionToUse: 'auto' | 'bottom' | 'top' | 'left' | 'right';
|
|
55
|
+
private isOpen;
|
|
56
|
+
private dropdownPanelOffsetX;
|
|
57
|
+
private dropdownPanelOffsetY;
|
|
58
|
+
private anchorAbsolute;
|
|
59
|
+
private anchorFixed;
|
|
52
60
|
constructor(parent: FormElementComponent, controlContainer: ControlContainer, translations: any, elRef: ElementRef);
|
|
53
61
|
ngAfterViewInit(): void;
|
|
54
62
|
private keyListener;
|
|
63
|
+
private addTail;
|
|
55
64
|
private addPrefix;
|
|
56
|
-
ngOnChanges(changes: SimpleChanges): void
|
|
65
|
+
ngOnChanges(changes: SimpleChanges): Promise<void>;
|
|
57
66
|
getDefaultTranslation(key: string): (x: any) => string;
|
|
58
67
|
getTranslation(key: string, params?: any): string;
|
|
59
68
|
onScroll(lastItemIndex: number): void;
|
|
60
69
|
searchQueryChanged(searchQuery: string): void;
|
|
61
|
-
onOpen(): void
|
|
70
|
+
onOpen(): Promise<void>;
|
|
71
|
+
private createAnchors;
|
|
72
|
+
private removeAnchors;
|
|
73
|
+
private setFixedDropdownPanelPosition;
|
|
62
74
|
private setWidthBasedOnOptionsWidths;
|
|
75
|
+
private getAllLimitingContainers;
|
|
76
|
+
private setPanelOffsets;
|
|
63
77
|
private determineDropdownPosition;
|
|
64
78
|
private isLimitingContainer;
|
|
65
79
|
focus: () => void;
|
|
80
|
+
open: () => void;
|
|
66
81
|
close: () => void;
|
|
67
82
|
onClose(): void;
|
|
68
83
|
ngOnDestroy(): void;
|
|
69
84
|
static ɵfac: i0.ɵɵFactoryDeclaration<SelectComponent, [{ optional: true; host: true; }, { optional: true; host: true; }, { optional: true; }, null]>;
|
|
70
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SelectComponent, "klp-form-select", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "prefix": { "alias": "prefix"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; "options": { "alias": "options"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "multipleDisplayedAsAmount": { "alias": "multipleDisplayedAsAmount"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "truncateOptions": { "alias": "truncateOptions"; "required": false; }; "withSeparatingLine": { "alias": "withSeparatingLine"; "required": false; }; "searchable": { "alias": "searchable"; "required": false; }; "dropdownPosition": { "alias": "dropdownPosition"; "required": false; }; "customSearchFn": { "alias": "customSearchFn"; "required": false; }; "footerElement": { "alias": "footerElement"; "required": false; }; }, { "onSearch": "onSearch"; "onEndReached": "onEndReached"; "onOpened": "onOpened"; "onClosed": "onClosed"; "onBlur": "onBlur"; "onClear": "onClear"; "onEnterKey": "onEnterKey"; }, ["customOptionTpl"], never, false, never>;
|
|
85
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SelectComponent, "klp-form-select", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "prefix": { "alias": "prefix"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; "options": { "alias": "options"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "multipleDisplayedAsAmount": { "alias": "multipleDisplayedAsAmount"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "truncateOptions": { "alias": "truncateOptions"; "required": false; }; "withSeparatingLine": { "alias": "withSeparatingLine"; "required": false; }; "searchable": { "alias": "searchable"; "required": false; }; "dropdownPosition": { "alias": "dropdownPosition"; "required": false; }; "dropdownAlignment": { "alias": "dropdownAlignment"; "required": false; }; "customSearchFn": { "alias": "customSearchFn"; "required": false; }; "footerElement": { "alias": "footerElement"; "required": false; }; }, { "onSearch": "onSearch"; "onEndReached": "onEndReached"; "onOpened": "onOpened"; "onClosed": "onClosed"; "onBlur": "onBlur"; "onClear": "onClear"; "onEnterKey": "onEnterKey"; }, ["customOptionTpl"], never, false, never>;
|
|
71
86
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ControlContainer, ControlValueAccessor, UntypedFormControl } from '@angular/forms';
|
|
2
|
-
import { ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { ElementRef, EventEmitter, OnDestroy, OnInit, TemplateRef } from '@angular/core';
|
|
3
3
|
import { FormElementComponent } from '../../form/form-element/form-element.component';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
/**
|
|
@@ -24,9 +24,11 @@ export declare class ValueAccessorBase<T> implements ControlValueAccessor, OnIni
|
|
|
24
24
|
formControlName: string;
|
|
25
25
|
formControl: UntypedFormControl;
|
|
26
26
|
inErrorState: boolean;
|
|
27
|
+
getTailTplFn: () => TemplateRef<any>;
|
|
27
28
|
onTouch: EventEmitter<void>;
|
|
28
29
|
nativeInputRef: ElementRef;
|
|
29
30
|
private attachedFormControl;
|
|
31
|
+
private tailTpl;
|
|
30
32
|
constructor(parent: FormElementComponent, controlContainer: ControlContainer);
|
|
31
33
|
ngOnInit(): void;
|
|
32
34
|
isInErrorState(): boolean;
|
|
@@ -39,6 +41,8 @@ export declare class ValueAccessorBase<T> implements ControlValueAccessor, OnIni
|
|
|
39
41
|
resetToNull(): void;
|
|
40
42
|
hasValidator(validatorName: string): boolean;
|
|
41
43
|
focus: () => void;
|
|
44
|
+
setTailTpl: (tpl: TemplateRef<any>) => void;
|
|
45
|
+
getTailTpl: () => TemplateRef<any>;
|
|
42
46
|
static ɵfac: i0.ɵɵFactoryDeclaration<ValueAccessorBase<any>, [{ optional: true; host: true; }, { optional: true; host: true; }]>;
|
|
43
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ValueAccessorBase<any>, "ng-component", never, { "disabled": { "alias": "disabled"; "required": false; }; "innerValueChangeInterceptor": { "alias": "innerValueChangeInterceptor"; "required": false; }; "formControlName": { "alias": "formControlName"; "required": false; }; "formControl": { "alias": "formControl"; "required": false; }; "inErrorState": { "alias": "inErrorState"; "required": false; }; }, { "onTouch": "onTouch"; }, never, never, false, never>;
|
|
47
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ValueAccessorBase<any>, "ng-component", never, { "disabled": { "alias": "disabled"; "required": false; }; "innerValueChangeInterceptor": { "alias": "innerValueChangeInterceptor"; "required": false; }; "formControlName": { "alias": "formControlName"; "required": false; }; "formControl": { "alias": "formControl"; "required": false; }; "inErrorState": { "alias": "inErrorState"; "required": false; }; "getTailTplFn": { "alias": "getTailTplFn"; "required": false; }; }, { "onTouch": "onTouch"; }, never, never, false, never>;
|
|
44
48
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnInit, TemplateRef } from '@angular/core';
|
|
2
2
|
import { FormElementComponent } from "../form-element/form-element.component";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class FormCaptionComponent implements OnInit {
|
|
5
5
|
private parent;
|
|
6
|
-
contentRef:
|
|
6
|
+
contentRef: TemplateRef<any>;
|
|
7
7
|
constructor(parent: FormElementComponent);
|
|
8
8
|
ngOnInit(): void;
|
|
9
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormCaptionComponent, [{ optional: true; host: true; }]>;
|
|
@@ -1,41 +1,57 @@
|
|
|
1
|
-
import { ElementRef, InjectionToken } from '@angular/core';
|
|
1
|
+
import { AfterViewInit, ElementRef, InjectionToken, TemplateRef } from '@angular/core';
|
|
2
2
|
import { AbstractControl, UntypedFormControl } from '@angular/forms';
|
|
3
|
-
import { FormComponent } from '../form.component';
|
|
4
|
-
import { CustomErrorMessages, FormErrorMessages } from '../../types';
|
|
5
3
|
import { ValueAccessorBase } from '../../elements/value-accessor-base/value-accessor-base.component';
|
|
4
|
+
import { CustomErrorMessages, FormErrorMessages } from '../../types';
|
|
5
|
+
import { FormComponent } from '../form.component';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare const FORM_ERROR_MESSAGES: InjectionToken<CustomErrorMessages>;
|
|
8
8
|
export declare const DEFAULT_ERROR_MESSAGES: FormErrorMessages;
|
|
9
|
-
export declare class FormElementComponent {
|
|
9
|
+
export declare class FormElementComponent implements AfterViewInit {
|
|
10
10
|
private parent;
|
|
11
11
|
private customMessages;
|
|
12
|
+
private elRef;
|
|
12
13
|
attachedControl: AbstractControl;
|
|
13
14
|
caption: string;
|
|
14
15
|
direction: 'horizontal' | 'vertical';
|
|
15
16
|
captionSpacing: 'percentages' | 'none';
|
|
16
|
-
|
|
17
|
+
verticalAlignment: 'center' | 'top';
|
|
18
|
+
spaceDistribution: '40-60' | '34-66' | '30-70' | 'fixedInputWidth';
|
|
17
19
|
swapInputAndCaption: boolean;
|
|
18
20
|
errorMessageAsTooltip: boolean;
|
|
19
21
|
internalComponentRef: ElementRef;
|
|
20
|
-
|
|
22
|
+
tailTpl: TemplateRef<any>;
|
|
23
|
+
captionDummyForSpaceCalculation: ElementRef;
|
|
24
|
+
absoluteAnchor: ElementRef;
|
|
25
|
+
fixedAnchor: ElementRef;
|
|
26
|
+
fixedWrapper: ElementRef;
|
|
27
|
+
fieldInput: ValueAccessorBase<any>;
|
|
28
|
+
captionRef: TemplateRef<any>;
|
|
21
29
|
errorMessages: FormErrorMessages;
|
|
22
30
|
customErrorHandlers: Array<{
|
|
23
31
|
error: string;
|
|
24
|
-
templateRef:
|
|
32
|
+
templateRef: TemplateRef<any>;
|
|
25
33
|
}>;
|
|
26
34
|
private input;
|
|
27
|
-
|
|
35
|
+
errorFullyVisible: boolean;
|
|
36
|
+
private popupState;
|
|
37
|
+
constructor(parent: FormComponent, customMessages: CustomErrorMessages, elRef: ElementRef);
|
|
38
|
+
ngAfterViewInit(): Promise<void>;
|
|
28
39
|
shouldShowErrorMessages(): boolean;
|
|
29
40
|
substituteParameters(message: string, parameters: Record<string, any>): string;
|
|
30
41
|
registerControl(formControl: UntypedFormControl, input?: ValueAccessorBase<any>): void;
|
|
42
|
+
determinePopupState(): void;
|
|
31
43
|
unregisterControl(formControl: UntypedFormControl): void;
|
|
32
44
|
getAttachedControl(): AbstractControl;
|
|
33
|
-
|
|
34
|
-
|
|
45
|
+
getAttachedInput(): ValueAccessorBase<any>;
|
|
46
|
+
registerErrorHandler(error: string, templateRef: TemplateRef<any>): void;
|
|
47
|
+
registerCaption(templateRef: TemplateRef<any>): void;
|
|
48
|
+
getWarningToShow(): string | TemplateRef<any>;
|
|
49
|
+
getWarningToShowAsTemplateRef(): TemplateRef<any>;
|
|
50
|
+
getWarningToShowIsTemplateRef(): boolean;
|
|
35
51
|
getErrorToShow(): string;
|
|
36
52
|
getCustomErrorHandler(error: string): {
|
|
37
53
|
error: string;
|
|
38
|
-
templateRef:
|
|
54
|
+
templateRef: TemplateRef<any>;
|
|
39
55
|
};
|
|
40
56
|
showDefaultError(error: string): boolean;
|
|
41
57
|
getScrollableParent(node: any): any;
|
|
@@ -43,6 +59,14 @@ export declare class FormElementComponent {
|
|
|
43
59
|
isRequired(): boolean;
|
|
44
60
|
getErrorMessage(key: keyof FormErrorMessages): string;
|
|
45
61
|
getErrorLocation(): 'belowCaption' | 'rightOfCaption';
|
|
46
|
-
|
|
47
|
-
|
|
62
|
+
shouldShowErrorTooltipOpened(): boolean;
|
|
63
|
+
hasHoverableErrorTooltip(): boolean;
|
|
64
|
+
hasRightOfCaptionError(): boolean;
|
|
65
|
+
setErrorMessageIsTruncated: (isTruncated: boolean) => void;
|
|
66
|
+
shouldShowWarningPopup(): boolean;
|
|
67
|
+
closePopup(): void;
|
|
68
|
+
togglePopup(): void;
|
|
69
|
+
setErrorTooltipOffset: () => void;
|
|
70
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormElementComponent, [{ optional: true; }, { optional: true; }, null]>;
|
|
71
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormElementComponent, "klp-form-element", never, { "caption": { "alias": "caption"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "captionSpacing": { "alias": "captionSpacing"; "required": false; }; "verticalAlignment": { "alias": "verticalAlignment"; "required": false; }; "spaceDistribution": { "alias": "spaceDistribution"; "required": false; }; "swapInputAndCaption": { "alias": "swapInputAndCaption"; "required": false; }; "errorMessageAsTooltip": { "alias": "errorMessageAsTooltip"; "required": false; }; }, {}, ["fieldInput"], ["*"], false, never>;
|
|
48
72
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnInit, TemplateRef } from '@angular/core';
|
|
2
2
|
import { FormElementComponent } from "../form-element/form-element.component";
|
|
3
3
|
import { ErrorTypes } from "../../types";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
@@ -6,7 +6,7 @@ export declare class FormErrorComponent implements OnInit {
|
|
|
6
6
|
private parent;
|
|
7
7
|
error: ErrorTypes;
|
|
8
8
|
showError: boolean;
|
|
9
|
-
contentRef:
|
|
9
|
+
contentRef: TemplateRef<any>;
|
|
10
10
|
constructor(parent: FormElementComponent);
|
|
11
11
|
ngOnInit(): void;
|
|
12
12
|
getErrorValueMessage(): string;
|
|
@@ -10,8 +10,9 @@ export declare class FormSubmitButtonComponent {
|
|
|
10
10
|
submitCallback: (renderedAndEnabledValues: object, renderedButDisabledValues: object) => Promise<any>;
|
|
11
11
|
before: () => Promise<any>;
|
|
12
12
|
after: () => Promise<any>;
|
|
13
|
+
disabled: boolean;
|
|
13
14
|
private setValidationError;
|
|
14
15
|
submitForm(): Promise<void>;
|
|
15
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormSubmitButtonComponent, never>;
|
|
16
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FormSubmitButtonComponent, "klp-form-submit-button", never, { "isLoading": { "alias": "isLoading"; "required": false; }; "fullWidth": { "alias": "fullWidth"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "submitCallback": { "alias": "submitCallback"; "required": false; }; "before": { "alias": "before"; "required": false; }; "after": { "alias": "after"; "required": false; }; }, {}, never, ["*"], false, never>;
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormSubmitButtonComponent, "klp-form-submit-button", never, { "isLoading": { "alias": "isLoading"; "required": false; }; "fullWidth": { "alias": "fullWidth"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "submitCallback": { "alias": "submitCallback"; "required": false; }; "before": { "alias": "before"; "required": false; }; "after": { "alias": "after"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, ["*"], false, never>;
|
|
17
18
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
|
|
2
|
-
import { UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
|
1
|
+
import { EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef } from '@angular/core';
|
|
2
|
+
import { AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
|
3
3
|
import { FormElementComponent } from './form-element/form-element.component';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare const invalidFieldsSymbol: unique symbol;
|
|
@@ -16,12 +16,17 @@ export declare class FormComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
16
16
|
showErrorMessages: boolean;
|
|
17
17
|
errorMessageLocation: 'belowCaption' | 'rightOfCaption';
|
|
18
18
|
formGroup: UntypedFormGroup;
|
|
19
|
+
warnings: Map<AbstractControl, string | TemplateRef<any>>;
|
|
20
|
+
errors: Map<AbstractControl, string>;
|
|
19
21
|
patchValueInterceptor: (values: any) => Promise<any>;
|
|
22
|
+
onInjected: EventEmitter<Record<string, any>>;
|
|
20
23
|
private activeControls;
|
|
21
24
|
constructor(parent: FormComponent, subFormPlaceholder: SubFormDirective);
|
|
22
25
|
ngOnInit(): void;
|
|
23
26
|
ngOnChanges(simpleChanges: SimpleChanges): void;
|
|
24
27
|
ngOnDestroy(): void;
|
|
28
|
+
private patchFormWarningsMap;
|
|
29
|
+
private patchFormErrorsMap;
|
|
25
30
|
private addSupportForPatchValueInterceptor;
|
|
26
31
|
registerControl(formControl: UntypedFormControl, formElement: FormElementComponent): void;
|
|
27
32
|
unregisterControl(formControl: UntypedFormControl): void;
|
|
@@ -30,11 +35,13 @@ export declare class FormComponent implements OnInit, OnDestroy, OnChanges {
|
|
|
30
35
|
private getAllFormControls;
|
|
31
36
|
private addFormControl;
|
|
32
37
|
private disableInactiveFormControl;
|
|
38
|
+
getFormElementByFormControl(control: AbstractControl): FormElementComponent;
|
|
39
|
+
getWarningToShow(control: AbstractControl): string | TemplateRef<any>;
|
|
33
40
|
trySubmit(): Promise<any>;
|
|
34
41
|
private handleSubmission;
|
|
35
42
|
private getRenderedFieldValuesFormGroup;
|
|
36
43
|
private getRenderedFieldValuesFormArray;
|
|
37
44
|
private setDisabledStatesForAllControls;
|
|
38
45
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormComponent, [{ optional: true; skipSelf: true; }, { optional: true; }]>;
|
|
39
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FormComponent, "klp-form", never, { "readOnly": { "alias": "readOnly"; "required": false; }; "showErrorMessages": { "alias": "showErrorMessages"; "required": false; }; "errorMessageLocation": { "alias": "errorMessageLocation"; "required": false; }; "formGroup": { "alias": "formGroup"; "required": false; }; "patchValueInterceptor": { "alias": "patchValueInterceptor"; "required": false; }; }, {}, never, ["*"], false, never>;
|
|
46
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormComponent, "klp-form", never, { "readOnly": { "alias": "readOnly"; "required": false; }; "showErrorMessages": { "alias": "showErrorMessages"; "required": false; }; "errorMessageLocation": { "alias": "errorMessageLocation"; "required": false; }; "formGroup": { "alias": "formGroup"; "required": false; }; "warnings": { "alias": "warnings"; "required": false; }; "errors": { "alias": "errors"; "required": false; }; "patchValueInterceptor": { "alias": "patchValueInterceptor"; "required": false; }; }, { "onInjected": "onInjected"; }, never, ["*"], false, never>;
|
|
40
47
|
}
|
|
@@ -24,13 +24,16 @@ import * as i22 from "./form/form.component";
|
|
|
24
24
|
import * as i23 from "./elements/hour-minute-input/hour-minute-input.component";
|
|
25
25
|
import * as i24 from "./elements/radio/radio.component";
|
|
26
26
|
import * as i25 from "./withTooltip.component";
|
|
27
|
-
import * as i26 from "
|
|
28
|
-
import * as i27 from "
|
|
29
|
-
import * as i28 from "
|
|
30
|
-
import * as i29 from "@
|
|
31
|
-
import * as i30 from "
|
|
27
|
+
import * as i26 from "./onRender.component";
|
|
28
|
+
import * as i27 from "./warning-icon/warning-icon.component";
|
|
29
|
+
import * as i28 from "./elementIsTruncatedCb.component";
|
|
30
|
+
import * as i29 from "@angular/common";
|
|
31
|
+
import * as i30 from "@angular/forms";
|
|
32
|
+
import * as i31 from "@ng-select/ng-select";
|
|
33
|
+
import * as i32 from "@dustfoundation/ngx-sortablejs";
|
|
34
|
+
import * as i33 from "./material.module";
|
|
32
35
|
export declare class NgxEnhancyFormsModule {
|
|
33
36
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxEnhancyFormsModule, never>;
|
|
34
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxEnhancyFormsModule, [typeof i1.ValueAccessorBase, typeof i2.MultipleValueAccessorBase, typeof i3.ButtonComponent, typeof i4.CheckboxComponent, typeof i5.DatePickerComponent, typeof i6.DateTimePickerComponent, typeof i7.EmailInputComponent, typeof i8.LoadingIndicatorComponent, typeof i9.NumberInputComponent, typeof i10.PasswordFieldComponent, typeof i11.SelectComponent, typeof i11.KlpSelectOptionTemplateDirective, typeof i12.SelectFooterComponent, typeof i13.SortableItemsComponent, typeof i14.SortableGroupedItemsComponent, typeof i15.TextInputComponent, typeof i16.ToggleComponent, typeof i17.FileInputComponent, typeof i18.FormCaptionComponent, typeof i19.FormElementComponent, typeof i20.FormErrorComponent, typeof i21.FormSubmitButtonComponent, typeof i22.FormComponent, typeof i22.SubFormDirective, typeof i23.HourMinuteInputComponent, typeof i24.RadioComponent, typeof i25.WithTooltipDirective], [typeof
|
|
37
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxEnhancyFormsModule, [typeof i1.ValueAccessorBase, typeof i2.MultipleValueAccessorBase, typeof i3.ButtonComponent, typeof i4.CheckboxComponent, typeof i5.DatePickerComponent, typeof i6.DateTimePickerComponent, typeof i7.EmailInputComponent, typeof i8.LoadingIndicatorComponent, typeof i9.NumberInputComponent, typeof i10.PasswordFieldComponent, typeof i11.SelectComponent, typeof i11.KlpSelectOptionTemplateDirective, typeof i12.SelectFooterComponent, typeof i13.SortableItemsComponent, typeof i14.SortableGroupedItemsComponent, typeof i15.TextInputComponent, typeof i16.ToggleComponent, typeof i17.FileInputComponent, typeof i18.FormCaptionComponent, typeof i19.FormElementComponent, typeof i20.FormErrorComponent, typeof i21.FormSubmitButtonComponent, typeof i22.FormComponent, typeof i22.SubFormDirective, typeof i23.HourMinuteInputComponent, typeof i24.RadioComponent, typeof i25.WithTooltipDirective, typeof i26.OnRenderDirective, typeof i27.WarningIconComponent, typeof i28.ElementIsTruncatedCbComponent], [typeof i29.CommonModule, typeof i30.FormsModule, typeof i31.NgSelectModule, typeof i32.SortablejsModule, typeof i33.MaterialModule], [typeof i1.ValueAccessorBase, typeof i2.MultipleValueAccessorBase, typeof i3.ButtonComponent, typeof i5.DatePickerComponent, typeof i6.DateTimePickerComponent, typeof i4.CheckboxComponent, typeof i7.EmailInputComponent, typeof i8.LoadingIndicatorComponent, typeof i9.NumberInputComponent, typeof i10.PasswordFieldComponent, typeof i11.SelectComponent, typeof i11.KlpSelectOptionTemplateDirective, typeof i12.SelectFooterComponent, typeof i13.SortableItemsComponent, typeof i14.SortableGroupedItemsComponent, typeof i15.TextInputComponent, typeof i16.ToggleComponent, typeof i17.FileInputComponent, typeof i18.FormCaptionComponent, typeof i19.FormElementComponent, typeof i20.FormErrorComponent, typeof i21.FormSubmitButtonComponent, typeof i22.FormComponent, typeof i22.SubFormDirective, typeof i23.HourMinuteInputComponent, typeof i24.RadioComponent, typeof i25.WithTooltipDirective, typeof i26.OnRenderDirective, typeof i28.ElementIsTruncatedCbComponent]>;
|
|
35
38
|
static ɵinj: i0.ɵɵInjectorDeclaration<NgxEnhancyFormsModule>;
|
|
36
39
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AfterViewInit } from "@angular/core";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class OnRenderDirective implements AfterViewInit {
|
|
4
|
+
onRenderFn: () => any;
|
|
5
|
+
ngAfterViewInit(): void;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OnRenderDirective, never>;
|
|
7
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<OnRenderDirective, "[onRenderFn]", never, { "onRenderFn": { "alias": "onRenderFn"; "required": false; }; }, {}, never, never, false, never>;
|
|
8
|
+
}
|
package/lib/types.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface FormErrorMessages {
|
|
|
9
9
|
pattern: string;
|
|
10
10
|
matchPassword: string;
|
|
11
11
|
date: string;
|
|
12
|
+
formLevel?: string;
|
|
12
13
|
}
|
|
13
14
|
export type CustomErrorMessages = Record<keyof FormErrorMessages, () => string>;
|
|
14
15
|
export type KlpDateFormats = (format: string) => MatDateFormats;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class WarningIconComponent {
|
|
3
|
+
variant: 'line' | 'fill';
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WarningIconComponent, never>;
|
|
5
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<WarningIconComponent, "klp-form-warning-icon", never, { "variant": { "alias": "variant"; "required": false; }; }, {}, never, never, false, never>;
|
|
6
|
+
}
|
|
@@ -4,8 +4,9 @@ export declare class WithTooltipDirective {
|
|
|
4
4
|
private div;
|
|
5
5
|
private triangle;
|
|
6
6
|
private triangleWhite;
|
|
7
|
-
klpWithTooltip:
|
|
7
|
+
klpWithTooltip: 'orange' | 'black';
|
|
8
|
+
tooltipText: string;
|
|
8
9
|
constructor(el: ElementRef);
|
|
9
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<WithTooltipDirective, never>;
|
|
10
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<WithTooltipDirective, "[klpWithTooltip]", never, { "klpWithTooltip": { "alias": "klpWithTooltip"; "required": false; }; }, {}, never, never, false, never>;
|
|
11
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<WithTooltipDirective, "[klpWithTooltip]", never, { "klpWithTooltip": { "alias": "klpWithTooltip"; "required": false; }; "tooltipText": { "alias": "tooltipText"; "required": false; }; }, {}, never, never, false, never>;
|
|
11
12
|
}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export * from './lib/elements/hour-minute-input/hour-minute-input.component';
|
|
|
19
19
|
export * from './lib/elements/value-accessor-base/value-accessor-base.component';
|
|
20
20
|
export * from './lib/elements/value-accessor-base/multiple-value-accessor-base.component';
|
|
21
21
|
export * from './lib/withTooltip.component';
|
|
22
|
+
export * from './lib/onRender.component';
|
|
23
|
+
export * from './lib/elementIsTruncatedCb.component';
|
|
22
24
|
export * from './lib/form/form.component';
|
|
23
25
|
export * from './lib/form/form-caption/form-caption.component';
|
|
24
26
|
export * from './lib/form/form-element/form-element.component';
|