@klippa/ngx-enhancy-forms 18.33.24 → 20.0.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.
Files changed (91) hide show
  1. package/fesm2022/klippa-ngx-enhancy-forms.mjs +167 -148
  2. package/fesm2022/klippa-ngx-enhancy-forms.mjs.map +1 -1
  3. package/index.d.ts +707 -3
  4. package/package.json +5 -7
  5. package/esm2022/klippa-ngx-enhancy-forms.mjs +0 -5
  6. package/esm2022/lib/elementIsTruncatedCb.component.mjs +0 -58
  7. package/esm2022/lib/elements/button/button.component.mjs +0 -57
  8. package/esm2022/lib/elements/checkbox/checkbox.component.mjs +0 -23
  9. package/esm2022/lib/elements/date-picker/date-picker.component.mjs +0 -108
  10. package/esm2022/lib/elements/date-time-picker/date-time-picker.component.mjs +0 -436
  11. package/esm2022/lib/elements/email/email-input.component.mjs +0 -21
  12. package/esm2022/lib/elements/file-input/file-input.component.mjs +0 -76
  13. package/esm2022/lib/elements/hour-minute-input/hour-minute-input.component.mjs +0 -90
  14. package/esm2022/lib/elements/loading-indicator/loading-indicator.component.mjs +0 -20
  15. package/esm2022/lib/elements/number-input/number-input.component.mjs +0 -31
  16. package/esm2022/lib/elements/password-field/password-field.component.mjs +0 -21
  17. package/esm2022/lib/elements/radio/radio.component.mjs +0 -34
  18. package/esm2022/lib/elements/select/select-footer/select-footer.component.mjs +0 -15
  19. package/esm2022/lib/elements/select/select.component.mjs +0 -385
  20. package/esm2022/lib/elements/sortable-grouped-items/sortable-grouped-items.component.mjs +0 -54
  21. package/esm2022/lib/elements/sortable-items/sortable-items.component.mjs +0 -189
  22. package/esm2022/lib/elements/text-area/text-area.component.mjs +0 -23
  23. package/esm2022/lib/elements/text-input/text-input.component.mjs +0 -52
  24. package/esm2022/lib/elements/toggle/toggle.component.mjs +0 -21
  25. package/esm2022/lib/elements/value-accessor-base/multiple-value-accessor-base.component.mjs +0 -61
  26. package/esm2022/lib/elements/value-accessor-base/value-accessor-base.component.mjs +0 -167
  27. package/esm2022/lib/form/form-caption/form-caption.component.mjs +0 -31
  28. package/esm2022/lib/form/form-caption-end/form-caption-end.component.mjs +0 -34
  29. package/esm2022/lib/form/form-element/form-element.component.mjs +0 -317
  30. package/esm2022/lib/form/form-error/form-error.component.mjs +0 -40
  31. package/esm2022/lib/form/form-submit-button/form-submit-button.component.mjs +0 -71
  32. package/esm2022/lib/form/form-validation-error/form-validation-error.mjs +0 -22
  33. package/esm2022/lib/form/form.component.mjs +0 -442
  34. package/esm2022/lib/material.module.mjs +0 -22
  35. package/esm2022/lib/ngx-enhancy-forms.module.mjs +0 -191
  36. package/esm2022/lib/onRender.component.mjs +0 -19
  37. package/esm2022/lib/types.mjs +0 -2
  38. package/esm2022/lib/util/angular.mjs +0 -9
  39. package/esm2022/lib/util/arrays.mjs +0 -48
  40. package/esm2022/lib/util/classes.mjs +0 -2
  41. package/esm2022/lib/util/dom.mjs +0 -15
  42. package/esm2022/lib/util/objects.mjs +0 -38
  43. package/esm2022/lib/util/values.mjs +0 -23
  44. package/esm2022/lib/validators/dateValidator.mjs +0 -6
  45. package/esm2022/lib/validators/timeValidator.mjs +0 -6
  46. package/esm2022/lib/warning-icon/warning-icon.component.mjs +0 -17
  47. package/esm2022/lib/withTooltip.component.mjs +0 -185
  48. package/esm2022/public-api.mjs +0 -38
  49. package/lib/elementIsTruncatedCb.component.d.ts +0 -14
  50. package/lib/elements/button/button.component.d.ts +0 -16
  51. package/lib/elements/checkbox/checkbox.component.d.ts +0 -8
  52. package/lib/elements/date-picker/date-picker.component.d.ts +0 -26
  53. package/lib/elements/date-time-picker/date-time-picker.component.d.ts +0 -83
  54. package/lib/elements/email/email-input.component.d.ts +0 -7
  55. package/lib/elements/file-input/file-input.component.d.ts +0 -18
  56. package/lib/elements/hour-minute-input/hour-minute-input.component.d.ts +0 -20
  57. package/lib/elements/loading-indicator/loading-indicator.component.d.ts +0 -7
  58. package/lib/elements/number-input/number-input.component.d.ts +0 -9
  59. package/lib/elements/password-field/password-field.component.d.ts +0 -7
  60. package/lib/elements/radio/radio.component.d.ts +0 -21
  61. package/lib/elements/select/select-footer/select-footer.component.d.ts +0 -7
  62. package/lib/elements/select/select.component.d.ts +0 -91
  63. package/lib/elements/sortable-grouped-items/sortable-grouped-items.component.d.ts +0 -12
  64. package/lib/elements/sortable-items/sortable-items.component.d.ts +0 -29
  65. package/lib/elements/text-area/text-area.component.d.ts +0 -9
  66. package/lib/elements/text-input/text-input.component.d.ts +0 -19
  67. package/lib/elements/toggle/toggle.component.d.ts +0 -7
  68. package/lib/elements/value-accessor-base/multiple-value-accessor-base.component.d.ts +0 -14
  69. package/lib/elements/value-accessor-base/value-accessor-base.component.d.ts +0 -50
  70. package/lib/form/form-caption/form-caption.component.d.ts +0 -11
  71. package/lib/form/form-caption-end/form-caption-end.component.d.ts +0 -12
  72. package/lib/form/form-element/form-element.component.d.ts +0 -81
  73. package/lib/form/form-error/form-error.component.d.ts +0 -15
  74. package/lib/form/form-submit-button/form-submit-button.component.d.ts +0 -21
  75. package/lib/form/form-validation-error/form-validation-error.d.ts +0 -10
  76. package/lib/form/form.component.d.ts +0 -58
  77. package/lib/material.module.d.ts +0 -11
  78. package/lib/ngx-enhancy-forms.module.d.ts +0 -41
  79. package/lib/onRender.component.d.ts +0 -8
  80. package/lib/types.d.ts +0 -16
  81. package/lib/util/angular.d.ts +0 -2
  82. package/lib/util/arrays.d.ts +0 -8
  83. package/lib/util/classes.d.ts +0 -1
  84. package/lib/util/dom.d.ts +0 -2
  85. package/lib/util/objects.d.ts +0 -1
  86. package/lib/util/values.d.ts +0 -6
  87. package/lib/validators/dateValidator.d.ts +0 -3
  88. package/lib/validators/timeValidator.d.ts +0 -3
  89. package/lib/warning-icon/warning-icon.component.d.ts +0 -6
  90. package/lib/withTooltip.component.d.ts +0 -23
  91. package/public-api.d.ts +0 -34
@@ -1,91 +0,0 @@
1
- import { AfterViewInit, ElementRef, EventEmitter, InjectionToken, NgZone, OnChanges, OnDestroy, SimpleChanges, TemplateRef } from '@angular/core';
2
- import { ControlContainer } from '@angular/forms';
3
- import { ValueAccessorBase } from '../value-accessor-base/value-accessor-base.component';
4
- import { FormElementComponent } from '../../form/form-element/form-element.component';
5
- import * as i0 from "@angular/core";
6
- export type AppSelectOptions = Array<AppSelectOption>;
7
- export type AppSelectOption = {
8
- id: any;
9
- name: string;
10
- description?: string;
11
- active?: boolean;
12
- disabled?: boolean;
13
- };
14
- export declare const SELECT_TRANSLATIONS: InjectionToken<any>;
15
- export declare class KlpSelectOptionTemplateDirective {
16
- static ɵfac: i0.ɵɵFactoryDeclaration<KlpSelectOptionTemplateDirective, never>;
17
- static ɵdir: i0.ɵɵDirectiveDeclaration<KlpSelectOptionTemplateDirective, "[klpSelectOptionTpl]", never, {}, {}, never, never, false, never>;
18
- }
19
- export declare class SelectComponent extends ValueAccessorBase<string | string[]> implements OnChanges, AfterViewInit, OnDestroy {
20
- protected parent: FormElementComponent;
21
- protected controlContainer: ControlContainer;
22
- private translations;
23
- private elRef;
24
- private ngZone;
25
- placeholder: string;
26
- prefix: string;
27
- orientation: 'vertical' | 'horizontal';
28
- options: AppSelectOptions;
29
- multiple: boolean;
30
- multipleDisplayedAsAmount: boolean;
31
- clearable: boolean;
32
- truncateOptions: boolean;
33
- withSeparatingLine: boolean;
34
- searchable: boolean;
35
- hasBorderLeft: boolean;
36
- hasBorderRight: boolean;
37
- dropdownPosition: 'auto' | 'bottom' | 'top' | 'left' | 'right';
38
- dropdownAlignment: 'left' | 'right';
39
- customSearchFn: (term: string, item: {
40
- id: string;
41
- name: string;
42
- description: string;
43
- }) => boolean;
44
- footerElement: TemplateRef<any>;
45
- onSearch: EventEmitter<string>;
46
- onEndReached: EventEmitter<void>;
47
- onOpened: EventEmitter<void>;
48
- onClosed: EventEmitter<void>;
49
- onBlur: EventEmitter<void>;
50
- onClear: EventEmitter<void>;
51
- onEnterKey: EventEmitter<string>;
52
- ngSelect: any;
53
- tailRef: ElementRef;
54
- tailMockRef: ElementRef;
55
- customOptionTpl: TemplateRef<any>;
56
- private lastItemIndexReached;
57
- dropdownPositionToUse: 'auto' | 'bottom' | 'top' | 'left' | 'right';
58
- private isOpen;
59
- private dropdownPanelOffsetX;
60
- private dropdownPanelOffsetY;
61
- private anchorAbsolute;
62
- private anchorFixed;
63
- constructor(parent: FormElementComponent, controlContainer: ControlContainer, translations: any, elRef: ElementRef, ngZone: NgZone);
64
- ngAfterViewInit(): void;
65
- private keyListener;
66
- private addTail;
67
- private addPrefix;
68
- ngOnChanges(changes: SimpleChanges): Promise<void>;
69
- getDefaultTranslation(key: string): (x: any) => string;
70
- getTranslation(key: string, params?: any): string;
71
- onScroll(lastItemIndex: number): void;
72
- searchQueryChanged(searchQuery: string): void;
73
- onOpen(): Promise<void>;
74
- private createAnchors;
75
- private removeAnchors;
76
- private setFixedDropdownPanelPosition;
77
- private setWidthBasedOnOptionsWidths;
78
- private getAllLimitingContainers;
79
- private setPanelOffsets;
80
- private determineDropdownPosition;
81
- private isLimitingContainer;
82
- focus: () => void;
83
- open: () => void;
84
- close: () => void;
85
- onClose(): void;
86
- onFocus(): void;
87
- private getScrollbarWidth;
88
- ngOnDestroy(): void;
89
- static ɵfac: i0.ɵɵFactoryDeclaration<SelectComponent, [{ optional: true; host: true; }, { optional: true; host: true; }, { optional: true; }, null, null]>;
90
- 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; }; "hasBorderLeft": { "alias": "hasBorderLeft"; "required": false; }; "hasBorderRight": { "alias": "hasBorderRight"; "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>;
91
- }
@@ -1,12 +0,0 @@
1
- import { TemplateRef } from '@angular/core';
2
- import { ValueAccessorBase } from '../value-accessor-base/value-accessor-base.component';
3
- import * as i0 from "@angular/core";
4
- export declare class SortableGroupedItemsComponent<T> extends ValueAccessorBase<Array<Array<T>>> {
5
- items: Array<T | string>;
6
- template: TemplateRef<any>;
7
- reloader: boolean;
8
- writeValue(value: Array<Array<T>>): void;
9
- onItemsRearranged(value: Array<T | string>): void;
10
- static ɵfac: i0.ɵɵFactoryDeclaration<SortableGroupedItemsComponent<any>, never>;
11
- static ɵcmp: i0.ɵɵComponentDeclaration<SortableGroupedItemsComponent<any>, "klp-form-sortable-grouped-items", never, {}, {}, ["template"], never, false, never>;
12
- }
@@ -1,29 +0,0 @@
1
- import { AfterViewInit, ElementRef, NgZone, OnInit, QueryList, TemplateRef } from '@angular/core';
2
- import { ControlContainer } from '@angular/forms';
3
- import { ValueAccessorBase } from '../value-accessor-base/value-accessor-base.component';
4
- import { FormElementComponent } from '../../form/form-element/form-element.component';
5
- import * as i0 from "@angular/core";
6
- export declare class SortableItemsComponent extends ValueAccessorBase<Array<any>> implements OnInit, AfterViewInit {
7
- protected parent: FormElementComponent;
8
- protected controlContainer: ControlContainer;
9
- private ngZone;
10
- template: TemplateRef<any>;
11
- sortableItemSize: 'sm' | 'lg';
12
- dragItems: QueryList<ElementRef>;
13
- dragSourceIndex: number;
14
- private currentDragPosition;
15
- private scrollInterval;
16
- constructor(parent: FormElementComponent, controlContainer: ControlContainer, ngZone: NgZone);
17
- ngAfterViewInit(): void;
18
- private setDragItemListeners;
19
- private onDragOver;
20
- private onDragEnter;
21
- private onDragStart;
22
- private onDragEnd;
23
- shouldShoveDown(index: number): boolean;
24
- shouldShoveUp(index: number): boolean;
25
- private scrollPage;
26
- private stopScrolling;
27
- static ɵfac: i0.ɵɵFactoryDeclaration<SortableItemsComponent, [{ optional: true; host: true; }, { optional: true; host: true; }, null]>;
28
- static ɵcmp: i0.ɵɵComponentDeclaration<SortableItemsComponent, "klp-form-sortable-items", never, { "sortableItemSize": { "alias": "sortableItemSize"; "required": false; }; }, {}, ["template"], never, false, never>;
29
- }
@@ -1,9 +0,0 @@
1
- import { EventEmitter } from '@angular/core';
2
- import { ValueAccessorBase } from '../value-accessor-base/value-accessor-base.component';
3
- import * as i0 from "@angular/core";
4
- export declare class TextAreaComponent extends ValueAccessorBase<string> {
5
- placeholder: string;
6
- onBlur: EventEmitter<void>;
7
- static ɵfac: i0.ɵɵFactoryDeclaration<TextAreaComponent, never>;
8
- static ɵcmp: i0.ɵɵComponentDeclaration<TextAreaComponent, "klp-form-text-area", never, { "placeholder": { "alias": "placeholder"; "required": false; }; }, { "onBlur": "onBlur"; }, never, never, false, never>;
9
- }
@@ -1,19 +0,0 @@
1
- import { EventEmitter, TemplateRef } from '@angular/core';
2
- import { ValueAccessorBase } from '../value-accessor-base/value-accessor-base.component';
3
- import * as i0 from "@angular/core";
4
- export declare class TextInputComponent extends ValueAccessorBase<string> {
5
- private isPeekingPassword;
6
- placeholder: string;
7
- type: 'text' | 'password';
8
- clearable: boolean;
9
- icon: 'search';
10
- hasBorderLeft: boolean;
11
- hasBorderRight: boolean;
12
- passwordPeekIcon: TemplateRef<any>;
13
- size: 'small' | 'medium';
14
- onBlur: EventEmitter<void>;
15
- togglePeakPassword(): void;
16
- getType(): 'text' | 'password';
17
- static ɵfac: i0.ɵɵFactoryDeclaration<TextInputComponent, never>;
18
- static ɵcmp: i0.ɵɵComponentDeclaration<TextInputComponent, "klp-form-text-input", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "type": { "alias": "type"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "hasBorderLeft": { "alias": "hasBorderLeft"; "required": false; }; "hasBorderRight": { "alias": "hasBorderRight"; "required": false; }; "passwordPeekIcon": { "alias": "passwordPeekIcon"; "required": false; }; "size": { "alias": "size"; "required": false; }; }, { "onBlur": "onBlur"; }, never, never, false, never>;
19
- }
@@ -1,7 +0,0 @@
1
- import { ValueAccessorBase } from '../value-accessor-base/value-accessor-base.component';
2
- import * as i0 from "@angular/core";
3
- export declare class ToggleComponent extends ValueAccessorBase<boolean> {
4
- transparentBackground: boolean;
5
- static ɵfac: i0.ɵɵFactoryDeclaration<ToggleComponent, never>;
6
- static ɵcmp: i0.ɵɵComponentDeclaration<ToggleComponent, "klp-form-toggle", never, { "transparentBackground": { "alias": "transparentBackground"; "required": false; }; }, {}, never, never, false, never>;
7
- }
@@ -1,14 +0,0 @@
1
- import { ControlContainer } from '@angular/forms';
2
- import { ValueAccessorBase } from './value-accessor-base.component';
3
- import { FormElementComponent } from '../../form/form-element/form-element.component';
4
- import * as i0 from "@angular/core";
5
- export declare class MultipleValueAccessorBase<T> extends ValueAccessorBase<Array<T> | T> {
6
- protected parent: FormElementComponent;
7
- protected controlContainer: ControlContainer;
8
- multiple: boolean;
9
- constructor(parent: FormElementComponent, controlContainer: ControlContainer);
10
- writeValue(value: Array<T> | T): void;
11
- setInnerValueAndNotify(value: T | Array<T>): void;
12
- static ɵfac: i0.ɵɵFactoryDeclaration<MultipleValueAccessorBase<any>, [{ optional: true; host: true; }, { optional: true; host: true; }]>;
13
- static ɵcmp: i0.ɵɵComponentDeclaration<MultipleValueAccessorBase<any>, "ng-component", never, { "multiple": { "alias": "multiple"; "required": false; }; }, {}, never, never, false, never>;
14
- }
@@ -1,50 +0,0 @@
1
- import { ControlContainer, ControlValueAccessor, UntypedFormControl } from '@angular/forms';
2
- import { ElementRef, EventEmitter, OnDestroy, OnInit, TemplateRef } from '@angular/core';
3
- import { FormElementComponent } from '../../form/form-element/form-element.component';
4
- import * as i0 from "@angular/core";
5
- /**
6
- * This component is a base in order to create a component that supports ngModel.
7
- * Some important things to know about it:
8
- *
9
- * innerValue = your own inner state, which you should use to store the current state of what ngModel should be.
10
- * writeValue() = called by angular, when ngModel is changed from OUTSIDE of the component. Feel free to patch this method if you need inner logic to happen when ngModel is altered from the outside. Always remember to also call the super.writeValue if you do!
11
- * setInnerValueAndNotify() = call this when you want your ngModel to be updated from INSIDE of your component, and provide it to the OUTSIDE.
12
- * ngOnInit() = Used to support the angular reactive forms framework. If you use ngOnInit in your own component (which happens fairly often) you must not forget to call the super.ngOnInit() method.
13
- */
14
- export declare class ValueAccessorBase<T> implements ControlValueAccessor, OnInit, OnDestroy {
15
- protected parent: FormElementComponent;
16
- protected controlContainer: ControlContainer;
17
- innerValue: T;
18
- changed: ((value: T) => void)[];
19
- private touched;
20
- private prevValue;
21
- disabled: boolean;
22
- private latestInnerValueChangedInterceptorPromise;
23
- innerValueChangeInterceptor: (prev: T, cur: T) => Promise<void>;
24
- formControlName: string;
25
- formControl: UntypedFormControl;
26
- inErrorState: boolean;
27
- getTailTplFn: () => TemplateRef<any>;
28
- onTouch: EventEmitter<void>;
29
- nativeInputRef: ElementRef;
30
- private attachedFormControl;
31
- private tailTpl;
32
- private getImmutableValueFn;
33
- constructor(parent: FormElementComponent, controlContainer: ControlContainer);
34
- ngOnInit(): void;
35
- protected getImmutableValue(): T;
36
- isInErrorState(): boolean;
37
- ngOnDestroy(): void;
38
- touch(): void;
39
- writeValue(value: T): void;
40
- registerOnChange(fn: (value: T) => void): void;
41
- registerOnTouched(fn: () => void): void;
42
- setInnerValueAndNotify(value: T): void;
43
- resetToNull(): void;
44
- hasValidator(validatorName: string): boolean;
45
- focus: () => void;
46
- setTailTpl: (tpl: TemplateRef<any>) => void;
47
- getTailTpl: () => TemplateRef<any>;
48
- static ɵfac: i0.ɵɵFactoryDeclaration<ValueAccessorBase<any>, [{ optional: true; host: true; }, { optional: true; host: true; }]>;
49
- 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>;
50
- }
@@ -1,11 +0,0 @@
1
- import { OnInit, TemplateRef } from '@angular/core';
2
- import { FormElementComponent } from "../form-element/form-element.component";
3
- import * as i0 from "@angular/core";
4
- export declare class FormCaptionComponent implements OnInit {
5
- private parent;
6
- contentRef: TemplateRef<any>;
7
- constructor(parent: FormElementComponent);
8
- ngOnInit(): void;
9
- static ɵfac: i0.ɵɵFactoryDeclaration<FormCaptionComponent, [{ optional: true; host: true; }]>;
10
- static ɵcmp: i0.ɵɵComponentDeclaration<FormCaptionComponent, "klp-form-caption", never, {}, {}, never, ["*"], false, never>;
11
- }
@@ -1,12 +0,0 @@
1
- import { OnDestroy, OnInit, TemplateRef } from '@angular/core';
2
- import { FormElementComponent } from "../form-element/form-element.component";
3
- import * as i0 from "@angular/core";
4
- export declare class FormCaptionEndComponent implements OnInit, OnDestroy {
5
- private parent;
6
- contentRef: TemplateRef<any>;
7
- constructor(parent: FormElementComponent);
8
- ngOnInit(): void;
9
- ngOnDestroy(): void;
10
- static ɵfac: i0.ɵɵFactoryDeclaration<FormCaptionEndComponent, [{ optional: true; host: true; }]>;
11
- static ɵcmp: i0.ɵɵComponentDeclaration<FormCaptionEndComponent, "klp-form-caption-end", never, {}, {}, never, ["*"], false, never>;
12
- }
@@ -1,81 +0,0 @@
1
- import { AfterViewInit, ElementRef, InjectionToken, NgZone, OnDestroy, TemplateRef } from '@angular/core';
2
- import { AbstractControl, UntypedFormControl } from '@angular/forms';
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
- import * as i0 from "@angular/core";
7
- export declare const FORM_ERROR_MESSAGES: InjectionToken<CustomErrorMessages>;
8
- export declare const DEFAULT_ERROR_MESSAGES: FormErrorMessages;
9
- export declare class FormElementComponent implements AfterViewInit, OnDestroy {
10
- private parent;
11
- private customMessages;
12
- private elRef;
13
- private ngZone;
14
- attachedControl: AbstractControl;
15
- caption: string;
16
- direction: 'horizontal' | 'vertical';
17
- captionSpacing: 'percentages' | 'none';
18
- verticalAlignment: 'center' | 'top';
19
- spaceDistribution: '40-60' | '34-66' | '30-70' | 'fixedInputWidth' | 'fixedCaptionWidth';
20
- swapInputAndCaption: boolean;
21
- errorMessageAsTooltip: boolean;
22
- errorMessageHasMaxWidth: boolean;
23
- internalComponentRef: ElementRef;
24
- tailTpl: TemplateRef<any>;
25
- captionDummyForSpaceCalculation: ElementRef;
26
- absoluteAnchor: ElementRef;
27
- fixedAnchor: ElementRef;
28
- fixedWrapper: ElementRef;
29
- inputContainer: ElementRef;
30
- fieldInput: ValueAccessorBase<any>;
31
- captionRef: TemplateRef<any>;
32
- captionEndRef: TemplateRef<any>;
33
- errorMessages: FormErrorMessages;
34
- customErrorHandlers: Array<{
35
- error: string;
36
- templateRef: TemplateRef<any>;
37
- }>;
38
- private input;
39
- errorFullyVisible: boolean;
40
- private popupState;
41
- private subscriptions;
42
- constructor(parent: FormComponent, customMessages: CustomErrorMessages, elRef: ElementRef, ngZone: NgZone);
43
- ngAfterViewInit(): Promise<void>;
44
- shouldShowErrorMessages(): boolean;
45
- substituteParameters(message: string, parameters: Record<string, any>): string;
46
- registerControl(formControl: UntypedFormControl, input?: ValueAccessorBase<any>): () => any;
47
- determinePopupState(): void;
48
- private setUpErrorTooltipListeners;
49
- unregisterControl(formControl: UntypedFormControl): void;
50
- getAttachedControl(): AbstractControl;
51
- getAttachedInput(): ValueAccessorBase<any>;
52
- registerErrorHandler(error: string, templateRef: TemplateRef<any>): void;
53
- registerCaption(templateRef: TemplateRef<any>): void;
54
- registerCaptionEnd(templateRef: TemplateRef<any>): void;
55
- getWarningToShow(): string | TemplateRef<any>;
56
- getWarningToShowAsTemplateRef(): TemplateRef<any>;
57
- getWarningToShowIsTemplateRef(): boolean;
58
- getErrorToShow(): string;
59
- getCustomErrorHandler(error: string): {
60
- error: string;
61
- templateRef: TemplateRef<any>;
62
- };
63
- showDefaultError(error: string): boolean;
64
- getScrollableParent(node: any): any;
65
- scrollTo(): void;
66
- isRequired(): boolean;
67
- getErrorMessage(key: keyof FormErrorMessages): string;
68
- getErrorLocation(): 'belowCaption' | 'rightOfCaption';
69
- shouldShowErrorTooltipOpened(): boolean;
70
- hasHoverableErrorTooltip(): boolean;
71
- hasRightOfCaptionError(): boolean;
72
- setErrorMessageIsTruncated: (isTruncated: boolean) => void;
73
- shouldShowWarningPopup(): boolean;
74
- closePopup(): void;
75
- togglePopup(): void;
76
- setErrorTooltipOffset: () => void;
77
- ngOnDestroy(): void;
78
- private initializeTailTpl;
79
- static ɵfac: i0.ɵɵFactoryDeclaration<FormElementComponent, [{ optional: true; }, { optional: true; }, null, null]>;
80
- 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; }; "errorMessageHasMaxWidth": { "alias": "errorMessageHasMaxWidth"; "required": false; }; }, {}, ["fieldInput"], ["*"], false, never>;
81
- }
@@ -1,15 +0,0 @@
1
- import { OnInit, TemplateRef } from '@angular/core';
2
- import { FormElementComponent } from "../form-element/form-element.component";
3
- import { ErrorTypes } from "../../types";
4
- import * as i0 from "@angular/core";
5
- export declare class FormErrorComponent implements OnInit {
6
- private parent;
7
- error: ErrorTypes;
8
- contentRef: TemplateRef<any>;
9
- contentChild: TemplateRef<any>;
10
- constructor(parent: FormElementComponent);
11
- ngOnInit(): void;
12
- getErrorValueMessage(): string;
13
- static ɵfac: i0.ɵɵFactoryDeclaration<FormErrorComponent, [{ optional: true; host: true; }]>;
14
- static ɵcmp: i0.ɵɵComponentDeclaration<FormErrorComponent, "klp-form-error", never, { "error": { "alias": "error"; "required": false; }; }, {}, ["contentChild"], never, false, never>;
15
- }
@@ -1,21 +0,0 @@
1
- import { OnInit } from '@angular/core';
2
- import { ButtonVariant } from '../../elements/button/button.component';
3
- import * as i0 from "@angular/core";
4
- export type SubmitButtonVariant = Extract<ButtonVariant, 'greenFilled' | 'redFilled' | 'greenOutlined' | 'white'>;
5
- export declare class FormSubmitButtonComponent implements OnInit {
6
- private parentForm;
7
- private handleError;
8
- buttonType: 'submit' | 'button';
9
- isLoading: boolean;
10
- fullWidth: boolean;
11
- variant: SubmitButtonVariant;
12
- submitCallback: (renderedAndEnabledValues: object, allRenderedValues: object) => Promise<any>;
13
- before: () => Promise<any>;
14
- after: () => Promise<any>;
15
- disabled: boolean;
16
- ngOnInit(): void;
17
- private setValidationError;
18
- submitForm(): Promise<void>;
19
- static ɵfac: i0.ɵɵFactoryDeclaration<FormSubmitButtonComponent, never>;
20
- 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>;
21
- }
@@ -1,10 +0,0 @@
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 type FormValidationErrors = Array<FormValidationError>;
8
- export type FormErrorHandler = (error: any) => FormValidationErrors;
9
- export declare const KLP_FORM_ERROR_HANDLER: InjectionToken<FormErrorHandler>;
10
- export declare const DefaultErrorHandler: FormErrorHandler;
@@ -1,58 +0,0 @@
1
- import { EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef } from '@angular/core';
2
- import { AbstractControl, FormArray, FormGroup, UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
3
- import { FormElementComponent } from './form-element/form-element.component';
4
- import * as i0 from "@angular/core";
5
- export declare const invalidFieldsSymbol: unique symbol;
6
- export declare class SubFormDirective {
7
- injectInto: UntypedFormArray | UntypedFormGroup;
8
- at: number | string;
9
- manuallyTriggerInjection: boolean;
10
- allowInjectionToOverwrite: boolean;
11
- static ɵfac: i0.ɵɵFactoryDeclaration<SubFormDirective, never>;
12
- static ɵdir: i0.ɵɵDirectiveDeclaration<SubFormDirective, "klp-sub-form", never, { "injectInto": { "alias": "injectInto"; "required": false; }; "at": { "alias": "at"; "required": false; }; "manuallyTriggerInjection": { "alias": "manuallyTriggerInjection"; "required": false; }; "allowInjectionToOverwrite": { "alias": "allowInjectionToOverwrite"; "required": false; }; }, {}, never, never, false, never>;
13
- }
14
- export declare class FormComponent implements OnInit, OnDestroy, OnChanges {
15
- private parent;
16
- private subFormDirective;
17
- readOnly: boolean;
18
- showErrorMessages: boolean;
19
- errorMessageLocation: 'belowCaption' | 'rightOfCaption';
20
- formGroup: FormGroup;
21
- formArray: FormArray;
22
- warnings: Map<AbstractControl, string | TemplateRef<any>>;
23
- immutableValues: Record<string, any>;
24
- errors: Map<AbstractControl, string>;
25
- patchValueInterceptor: (values: any) => Promise<any>;
26
- allowSubmitOn: 'buttonAndEnter' | 'buttonOnly';
27
- onInjected: EventEmitter<Record<string, any>>;
28
- private topLevelFormControl;
29
- private activeControls;
30
- constructor(parent: FormComponent, subFormDirective: SubFormDirective);
31
- ngOnInit(): void;
32
- _ext_attachAsSubForm(): void;
33
- private attachAsSubForm;
34
- ngOnChanges(simpleChanges: SimpleChanges): void;
35
- ngOnDestroy(): void;
36
- private patchFormWarningsMap;
37
- private patchFormErrorsMap;
38
- private addSupportForPatchValueInterceptor;
39
- registerControl(formControl: UntypedFormControl, formElement: FormElementComponent): () => any;
40
- private getPathFromParentToControl;
41
- private getImmutableValueFromPath;
42
- unregisterControl(formControl: UntypedFormControl): void;
43
- private addFormGroupControls;
44
- private addFormArrayControls;
45
- private getAllFormControls;
46
- private addFormControl;
47
- private disableInactiveFormControl;
48
- getFormElementByFormControl(control: AbstractControl): FormElementComponent;
49
- getWarningToShow(control: AbstractControl): string | TemplateRef<any>;
50
- trySubmit(): Promise<any>;
51
- private handleSubmission;
52
- private getRenderedFieldValuesFormGroup;
53
- private getRenderedFieldValuesFormArray;
54
- _ext_getRenderedFieldValues(): Record<string, any>;
55
- private setDisabledStatesForAllControls;
56
- static ɵfac: i0.ɵɵFactoryDeclaration<FormComponent, [{ optional: true; skipSelf: true; }, { optional: true; }]>;
57
- 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; }; "formArray": { "alias": "formArray"; "required": false; }; "warnings": { "alias": "warnings"; "required": false; }; "immutableValues": { "alias": "immutableValues"; "required": false; }; "errors": { "alias": "errors"; "required": false; }; "patchValueInterceptor": { "alias": "patchValueInterceptor"; "required": false; }; "allowSubmitOn": { "alias": "allowSubmitOn"; "required": false; }; }, { "onInjected": "onInjected"; }, never, ["*"], false, never>;
58
- }
@@ -1,11 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "@angular/material/datepicker";
3
- import * as i2 from "@angular/material/form-field";
4
- import * as i3 from "@angular/material/core";
5
- import * as i4 from "@angular/material/input";
6
- import * as i5 from "@angular/material/button";
7
- export declare class MaterialModule {
8
- static ɵfac: i0.ɵɵFactoryDeclaration<MaterialModule, never>;
9
- static ɵmod: i0.ɵɵNgModuleDeclaration<MaterialModule, never, [typeof i1.MatDatepickerModule, typeof i2.MatFormFieldModule, typeof i3.MatNativeDateModule, typeof i4.MatInputModule, typeof i5.MatButtonModule], [typeof i1.MatDatepickerModule, typeof i2.MatFormFieldModule, typeof i3.MatNativeDateModule, typeof i4.MatInputModule, typeof i5.MatButtonModule]>;
10
- static ɵinj: i0.ɵɵInjectorDeclaration<MaterialModule>;
11
- }
@@ -1,41 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "./elements/value-accessor-base/value-accessor-base.component";
3
- import * as i2 from "./elements/value-accessor-base/multiple-value-accessor-base.component";
4
- import * as i3 from "./elements/button/button.component";
5
- import * as i4 from "./elements/checkbox/checkbox.component";
6
- import * as i5 from "./elements/date-picker/date-picker.component";
7
- import * as i6 from "./elements/date-time-picker/date-time-picker.component";
8
- import * as i7 from "./elements/email/email-input.component";
9
- import * as i8 from "./elements/loading-indicator/loading-indicator.component";
10
- import * as i9 from "./elements/number-input/number-input.component";
11
- import * as i10 from "./elements/password-field/password-field.component";
12
- import * as i11 from "./elements/select/select.component";
13
- import * as i12 from "./elements/select/select-footer/select-footer.component";
14
- import * as i13 from "./elements/sortable-items/sortable-items.component";
15
- import * as i14 from "./elements/sortable-grouped-items/sortable-grouped-items.component";
16
- import * as i15 from "./elements/text-input/text-input.component";
17
- import * as i16 from "./elements/text-area/text-area.component";
18
- import * as i17 from "./elements/toggle/toggle.component";
19
- import * as i18 from "./elements/file-input/file-input.component";
20
- import * as i19 from "./form/form-caption/form-caption.component";
21
- import * as i20 from "./form/form-caption-end/form-caption-end.component";
22
- import * as i21 from "./form/form-element/form-element.component";
23
- import * as i22 from "./form/form-error/form-error.component";
24
- import * as i23 from "./form/form-submit-button/form-submit-button.component";
25
- import * as i24 from "./form/form.component";
26
- import * as i25 from "./elements/hour-minute-input/hour-minute-input.component";
27
- import * as i26 from "./elements/radio/radio.component";
28
- import * as i27 from "./withTooltip.component";
29
- import * as i28 from "./onRender.component";
30
- import * as i29 from "./warning-icon/warning-icon.component";
31
- import * as i30 from "./elementIsTruncatedCb.component";
32
- import * as i31 from "@angular/common";
33
- import * as i32 from "@angular/forms";
34
- import * as i33 from "@ng-select/ng-select";
35
- import * as i34 from "@dustfoundation/ngx-sortablejs";
36
- import * as i35 from "./material.module";
37
- export declare class NgxEnhancyFormsModule {
38
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxEnhancyFormsModule, never>;
39
- 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.TextAreaComponent, typeof i17.ToggleComponent, typeof i18.FileInputComponent, typeof i19.FormCaptionComponent, typeof i20.FormCaptionEndComponent, typeof i21.FormElementComponent, typeof i22.FormErrorComponent, typeof i23.FormSubmitButtonComponent, typeof i24.FormComponent, typeof i24.SubFormDirective, typeof i25.HourMinuteInputComponent, typeof i26.RadioComponent, typeof i27.WithTooltipDirective, typeof i28.OnRenderDirective, typeof i29.WarningIconComponent, typeof i30.ElementIsTruncatedCbComponent], [typeof i31.CommonModule, typeof i32.FormsModule, typeof i33.NgSelectModule, typeof i34.SortablejsModule, typeof i35.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.TextAreaComponent, typeof i17.ToggleComponent, typeof i18.FileInputComponent, typeof i19.FormCaptionComponent, typeof i20.FormCaptionEndComponent, typeof i21.FormElementComponent, typeof i22.FormErrorComponent, typeof i23.FormSubmitButtonComponent, typeof i24.FormComponent, typeof i24.SubFormDirective, typeof i25.HourMinuteInputComponent, typeof i26.RadioComponent, typeof i27.WithTooltipDirective, typeof i28.OnRenderDirective, typeof i30.ElementIsTruncatedCbComponent]>;
40
- static ɵinj: i0.ɵɵInjectorDeclaration<NgxEnhancyFormsModule>;
41
- }
@@ -1,8 +0,0 @@
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 DELETED
@@ -1,16 +0,0 @@
1
- import { MatDateFormats } from "@angular/material/core";
2
- export interface FormErrorMessages {
3
- min: string;
4
- max: string;
5
- required: string;
6
- email: string;
7
- minLength: string;
8
- maxLength: string;
9
- pattern: string;
10
- matchPassword: string;
11
- date: string;
12
- formLevel?: string;
13
- }
14
- export type CustomErrorMessages = Record<keyof FormErrorMessages, () => string>;
15
- export type KlpDateFormats = (format: string) => MatDateFormats;
16
- export type ErrorTypes = keyof FormErrorMessages | 'message' | 'async' | string;
@@ -1,2 +0,0 @@
1
- export declare function runNextRenderCycle(fn: () => void): void;
2
- export declare function awaitableForNextCycle(): Promise<void>;
@@ -1,8 +0,0 @@
1
- import { Newable } from './classes';
2
- export declare function removeDuplicatesFromArraysWithComparator(comparator: (e1: any, e2: any) => boolean, ...arrays: any[]): any;
3
- export declare function removeDuplicatesFromArray<T>(array: Array<T>): Array<T>;
4
- export declare function insertAtIndex(arr: any, index: any, item: any): void;
5
- export declare function arrayIsSetAndFilled(arr: any): boolean;
6
- export declare function asArray(value: any): Array<any>;
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>;
@@ -1 +0,0 @@
1
- export type Newable<T> = new (...args: any[]) => T;
package/lib/util/dom.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function getAllLimitingContainers(element: Element): Array<HTMLElement>;
2
- export declare function isLimitingContainer(element: Element): boolean;
@@ -1 +0,0 @@
1
- export declare function deepMerge<A extends object | Array<any>, B extends object | Array<any>>(objA: A, objB: B): A | B;
@@ -1,6 +0,0 @@
1
- export declare function stringIsSetAndFilled(s: string): boolean;
2
- export declare function isNullOrUndefined(value: any): boolean;
3
- export declare function numberIsSet(value: any): boolean;
4
- export declare function isValueSet(value: any): boolean;
5
- export declare function stringOrArrayIsSetAndEmpty(value: any[] | string): boolean;
6
- export declare function truncateString(s: string, length: number): string;
@@ -1,3 +0,0 @@
1
- import { AbstractControl, ValidationErrors } from '@angular/forms';
2
- export declare const invalidDateKey = "--invalid_date--";
3
- export declare function dateValidator(control: AbstractControl): ValidationErrors | null;
@@ -1,3 +0,0 @@
1
- import { AbstractControl, ValidationErrors } from '@angular/forms';
2
- export declare const invalidTimeKey = "--invalid_time--";
3
- export declare function timeValidator(control: AbstractControl): ValidationErrors | null;
@@ -1,6 +0,0 @@
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
- }