@esfaenza/forms-and-validations 18.2.2 → 19.2.3

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 (100) hide show
  1. package/README.md +63 -1
  2. package/fesm2022/esfaenza-forms-and-validations.mjs +1099 -3972
  3. package/fesm2022/esfaenza-forms-and-validations.mjs.map +1 -1
  4. package/lib/forms/adaptive/form-adaptive.component.d.ts +23 -0
  5. package/lib/forms/autocomplete/form-autocomplete.component.d.ts +40 -0
  6. package/lib/forms/base/base-form-control.d.ts +132 -0
  7. package/lib/forms/base/skeleton/input-skeleton.component.d.ts +12 -0
  8. package/lib/forms/checkbox/form-checkbox.component.d.ts +11 -0
  9. package/lib/forms/currency/form-currency.component.d.ts +10 -0
  10. package/lib/forms/date/form-date.component.d.ts +36 -0
  11. package/lib/forms/datetime/form-datetime.component.d.ts +7 -0
  12. package/lib/forms/{form-info/form-info.component.d.ts → error/form-error.component.d.ts} +4 -4
  13. package/lib/forms/file/form-file.component.d.ts +38 -0
  14. package/lib/forms/{form-error/form-error.component.d.ts → info/form-info.component.d.ts} +4 -4
  15. package/lib/forms/input/form-input.component.d.ts +25 -0
  16. package/lib/forms/multiselect/form-multiselect.component.d.ts +20 -0
  17. package/lib/forms/select/form-select.component.d.ts +9 -0
  18. package/lib/forms/{form-template → template}/form-template.component.d.ts +3 -3
  19. package/lib/forms/textarea/form-textarea.component.d.ts +13 -0
  20. package/lib/forms/time/form-time.component.d.ts +7 -0
  21. package/lib/forms.module.d.ts +32 -0
  22. package/lib/models/AppFile.d.ts +5 -15
  23. package/lib/models/BaseFormConfiguration.d.ts +27 -0
  24. package/lib/models/EsFormsModuleConfig.d.ts +7 -0
  25. package/lib/services/helper.d.ts +15 -0
  26. package/lib/tokens.d.ts +1 -5
  27. package/package.json +10 -16
  28. package/public-api.d.ts +18 -28
  29. package/esm2022/esfaenza-forms-and-validations.mjs +0 -5
  30. package/esm2022/lib/forms/base-form-control.mjs +0 -558
  31. package/esm2022/lib/forms/form-adaptive/form-adaptive.component.loc.mjs +0 -22
  32. package/esm2022/lib/forms/form-adaptive/form-adaptive.component.mjs +0 -420
  33. package/esm2022/lib/forms/form-autocomplete/form-autocomplete.component.loc.mjs +0 -21
  34. package/esm2022/lib/forms/form-autocomplete/form-autocomplete.component.mjs +0 -289
  35. package/esm2022/lib/forms/form-checkbox/form-checkbox.component.mjs +0 -74
  36. package/esm2022/lib/forms/form-date/form-date.component.mjs +0 -69
  37. package/esm2022/lib/forms/form-datetime/form-datetime.component.mjs +0 -67
  38. package/esm2022/lib/forms/form-empty/form-empty.component.mjs +0 -30
  39. package/esm2022/lib/forms/form-error/form-error.component.mjs +0 -42
  40. package/esm2022/lib/forms/form-file/form-file.component.loc.mjs +0 -22
  41. package/esm2022/lib/forms/form-file/form-file.component.mjs +0 -175
  42. package/esm2022/lib/forms/form-info/form-info.component.mjs +0 -42
  43. package/esm2022/lib/forms/form-input/form-input.component.mjs +0 -83
  44. package/esm2022/lib/forms/form-multiselect/form-multiselect.component.loc.mjs +0 -23
  45. package/esm2022/lib/forms/form-multiselect/form-multiselect.component.mjs +0 -163
  46. package/esm2022/lib/forms/form-select/form-select.component.loc.mjs +0 -21
  47. package/esm2022/lib/forms/form-select/form-select.component.mjs +0 -165
  48. package/esm2022/lib/forms/form-template/form-template.component.mjs +0 -77
  49. package/esm2022/lib/forms/form-textarea/form-textarea.component.mjs +0 -57
  50. package/esm2022/lib/forms/form-time/form-time.component.mjs +0 -115
  51. package/esm2022/lib/forms-and-validations.module.mjs +0 -213
  52. package/esm2022/lib/models/AppFile.mjs +0 -14
  53. package/esm2022/lib/models/ChangeEvent.mjs +0 -7
  54. package/esm2022/lib/models/FormsAndValidationsModuleConfig.mjs +0 -6
  55. package/esm2022/lib/models/dayjs-adapter/dayjs-date-adapter.mjs +0 -89
  56. package/esm2022/lib/tokens.mjs +0 -8
  57. package/esm2022/lib/validations/base-validation.loc.mjs +0 -23
  58. package/esm2022/lib/validations/base-validation.mjs +0 -328
  59. package/esm2022/lib/validations/customValidators/CustomRequiredDirective.mjs +0 -41
  60. package/esm2022/lib/validations/validation-autocomplete/validation-autocomplete.component.mjs +0 -147
  61. package/esm2022/lib/validations/validation-autocomplete-multi/validation-autocomplete-multi.component.mjs +0 -240
  62. package/esm2022/lib/validations/validation-currency/validation-currency.component.mjs +0 -75
  63. package/esm2022/lib/validations/validation-date/validation-date.component.mjs +0 -183
  64. package/esm2022/lib/validations/validation-datetime/validation-datetime.component.mjs +0 -212
  65. package/esm2022/lib/validations/validation-input/validation-input.component.mjs +0 -222
  66. package/esm2022/lib/validations/validation-select/validation-select.component.mjs +0 -183
  67. package/esm2022/lib/validations/validation-text-area/validation-text-area.component.mjs +0 -78
  68. package/esm2022/public-api.mjs +0 -40
  69. package/lib/forms/base-form-control.d.ts +0 -276
  70. package/lib/forms/form-adaptive/form-adaptive.component.d.ts +0 -126
  71. package/lib/forms/form-adaptive/form-adaptive.component.loc.d.ts +0 -14
  72. package/lib/forms/form-autocomplete/form-autocomplete.component.d.ts +0 -84
  73. package/lib/forms/form-autocomplete/form-autocomplete.component.loc.d.ts +0 -14
  74. package/lib/forms/form-checkbox/form-checkbox.component.d.ts +0 -23
  75. package/lib/forms/form-date/form-date.component.d.ts +0 -21
  76. package/lib/forms/form-datetime/form-datetime.component.d.ts +0 -23
  77. package/lib/forms/form-empty/form-empty.component.d.ts +0 -15
  78. package/lib/forms/form-file/form-file.component.d.ts +0 -46
  79. package/lib/forms/form-file/form-file.component.loc.d.ts +0 -14
  80. package/lib/forms/form-input/form-input.component.d.ts +0 -33
  81. package/lib/forms/form-multiselect/form-multiselect.component.d.ts +0 -67
  82. package/lib/forms/form-multiselect/form-multiselect.component.loc.d.ts +0 -14
  83. package/lib/forms/form-select/form-select.component.d.ts +0 -43
  84. package/lib/forms/form-select/form-select.component.loc.d.ts +0 -14
  85. package/lib/forms/form-textarea/form-textarea.component.d.ts +0 -18
  86. package/lib/forms/form-time/form-time.component.d.ts +0 -40
  87. package/lib/forms-and-validations.module.d.ts +0 -47
  88. package/lib/models/FormsAndValidationsModuleConfig.d.ts +0 -11
  89. package/lib/models/dayjs-adapter/dayjs-date-adapter.d.ts +0 -49
  90. package/lib/validations/base-validation.d.ts +0 -219
  91. package/lib/validations/base-validation.loc.d.ts +0 -14
  92. package/lib/validations/customValidators/CustomRequiredDirective.d.ts +0 -24
  93. package/lib/validations/validation-autocomplete/validation-autocomplete.component.d.ts +0 -58
  94. package/lib/validations/validation-autocomplete-multi/validation-autocomplete-multi.component.d.ts +0 -88
  95. package/lib/validations/validation-currency/validation-currency.component.d.ts +0 -28
  96. package/lib/validations/validation-date/validation-date.component.d.ts +0 -79
  97. package/lib/validations/validation-datetime/validation-datetime.component.d.ts +0 -109
  98. package/lib/validations/validation-input/validation-input.component.d.ts +0 -134
  99. package/lib/validations/validation-select/validation-select.component.d.ts +0 -95
  100. package/lib/validations/validation-text-area/validation-text-area.component.d.ts +0 -28
@@ -0,0 +1,23 @@
1
+ import { Injector, WritableSignal } from "@angular/core";
2
+ import { ControlValueAccessor } from "@angular/forms";
3
+ import { Observable } from "rxjs";
4
+ import { BaseFormControl } from "../base/base-form-control";
5
+ import { BaseFormConfiguration } from "../../models/BaseFormConfiguration";
6
+ import * as i0 from "@angular/core";
7
+ export declare class EsFormAdaptiveComponent extends BaseFormControl implements ControlValueAccessor {
8
+ /** Tipologia che decide che componente mostrare */
9
+ Type: 'string' | 'float' | 'date' | 'number' | 'int' | 'boolean' | 'enum' | 'autocomplete' | 'datetime' | 'time' | 'file' | 'currency';
10
+ /** Messaggio per quando si binda un form-adaptive senza tipo */
11
+ TypeMissingMessage: string;
12
+ SearchFunction: (search: string, byid: boolean, context?: any) => Observable<{
13
+ id: string;
14
+ description: string;
15
+ }[]>;
16
+ IntPattern: WritableSignal<string>;
17
+ FloatPattern: WritableSignal<string>;
18
+ config: WritableSignal<BaseFormConfiguration>;
19
+ constructor(inj: Injector);
20
+ ngAfterViewInit(): void;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<EsFormAdaptiveComponent, never>;
22
+ static ɵcmp: i0.ɵɵComponentDeclaration<EsFormAdaptiveComponent, "form-adaptive", never, { "Type": { "alias": "Type"; "required": false; }; "TypeMissingMessage": { "alias": "TypeMissingMessage"; "required": false; }; "SearchFunction": { "alias": "SearchFunction"; "required": false; }; }, {}, never, never, true, never>;
23
+ }
@@ -0,0 +1,40 @@
1
+ import { ControlValueAccessor } from "@angular/forms";
2
+ import { AutoCompleteCompleteEvent } from 'primeng/autocomplete';
3
+ import { BaseFormControl } from "../base/base-form-control";
4
+ import { Observable } from "rxjs";
5
+ import * as i0 from "@angular/core";
6
+ export declare class EsFormAutocompleteComponent extends BaseFormControl implements ControlValueAccessor {
7
+ /** Contesto per la funzione di ricerca */
8
+ SearchFunctionContext: any;
9
+ SearchFunction: (search: string, byid: boolean, context?: any) => Observable<{
10
+ id: string;
11
+ description: string;
12
+ }[]>;
13
+ /** Indica se usare la modalità multiselezione o no */
14
+ multiple: boolean | undefined;
15
+ forceSelection: boolean | undefined;
16
+ style: import("@angular/core").WritableSignal<{
17
+ width: string;
18
+ }>;
19
+ ngAfterViewInit(): void;
20
+ search(event: AutoCompleteCompleteEvent): void;
21
+ protected getValueOut(value: string | {
22
+ id: string;
23
+ description: string;
24
+ } | {
25
+ id: string;
26
+ description: string;
27
+ }[]): Promise<string | string[]>;
28
+ protected getValueIn(value: string | string[]): Promise<{
29
+ id: string;
30
+ description: string;
31
+ } | {
32
+ id: string;
33
+ description: string;
34
+ }[]>;
35
+ protected getEvaluatedModel(value: string | string[]): Promise<string>;
36
+ static ɵfac: i0.ɵɵFactoryDeclaration<EsFormAutocompleteComponent, never>;
37
+ static ɵcmp: i0.ɵɵComponentDeclaration<EsFormAutocompleteComponent, "form-autocomplete", never, { "SearchFunctionContext": { "alias": "SearchFunctionContext"; "required": false; }; "SearchFunction": { "alias": "SearchFunction"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "forceSelection": { "alias": "forceSelection"; "required": false; }; }, {}, never, never, true, never>;
38
+ static ngAcceptInputType_multiple: unknown;
39
+ static ngAcceptInputType_forceSelection: unknown;
40
+ }
@@ -0,0 +1,132 @@
1
+ import { ChangeDetectorRef, ElementRef, EventEmitter, Injector, Signal, TemplateRef } from "@angular/core";
2
+ import { ControlValueAccessor, NgControl, NgForm, NgModel } from "@angular/forms";
3
+ import { Observable, Subject } from "rxjs";
4
+ import { LocalizationService } from "@esfaenza/localizations";
5
+ import { MessageService, UtilityService } from "@esfaenza/extensions";
6
+ import { ChangeEvent } from "../../models/ChangeEvent";
7
+ import { BaseFormConfiguration } from "../../models/BaseFormConfiguration";
8
+ import { FormsHelper } from "../../services/helper";
9
+ import * as i0 from "@angular/core";
10
+ /**
11
+ * Componente base da cui tutti i componenti Form implementano
12
+ * N.B:
13
+ * innerInput è il componente interno
14
+ * ngControl è il componente esterno (form-roba)
15
+ */
16
+ export declare abstract class BaseFormControl implements ControlValueAccessor {
17
+ protected inj: Injector;
18
+ protected onChange: (_: any) => void;
19
+ onTouched: () => void;
20
+ registerOnChange(fn: any): void;
21
+ registerOnTouched(fn: any): void;
22
+ setDisabledState?(isDisabled: boolean): void;
23
+ value: any;
24
+ innerInput: NgModel;
25
+ innerElement?: ElementRef;
26
+ private tooltip?;
27
+ inputChange: EventEmitter<ChangeEvent>;
28
+ inputFocus: EventEmitter<any>;
29
+ inputFinalized: EventEmitter<string>;
30
+ DisplayCondition: boolean;
31
+ DisplayMode: boolean;
32
+ DisplayLayout: 'form' | 'inline' | 'hidden';
33
+ FormLayout: boolean;
34
+ DisplayModeTemplate: TemplateRef<any>;
35
+ EvaluatedModel: string;
36
+ InlineSeparator: string;
37
+ Label: string;
38
+ Last: boolean;
39
+ FormGroupClass: string;
40
+ Placeholder: string;
41
+ set LabelInputRatio(input: string);
42
+ LabelColWidth: number;
43
+ InputColWidth: number;
44
+ Form: NgForm;
45
+ name: string;
46
+ readonly: boolean | undefined;
47
+ disabled: boolean | undefined;
48
+ pattern: string | undefined;
49
+ Validation: boolean;
50
+ SetValidationSubject: Subject<{
51
+ fieldName: string;
52
+ error: string;
53
+ }>;
54
+ TooltipText: string;
55
+ InternalName: string;
56
+ required: boolean | '' | undefined;
57
+ /**
58
+ * Espressione simil-Angular per cambiare il testo dei componenti che scelgono il proprio modello da una **Source**
59
+ *
60
+ * Il funzionamento è identico al binder di angular, solo con una graffa invece che 2.
61
+ * È inoltre possibile aggiungere pezzi di descrizione in maniera condizionale con la sintassi **:prop?(Prop vale {prop})**
62
+ */
63
+ Display: string;
64
+ IdField: string;
65
+ private BindCheckingGroups;
66
+ private BindProperties;
67
+ private _source;
68
+ get Source(): any[] | undefined;
69
+ set Source(val: any[] | undefined);
70
+ protected BoundSourceCache: {
71
+ [id: string]: string;
72
+ };
73
+ BoundSource: Signal<{
74
+ id: string;
75
+ description: string;
76
+ }[]>;
77
+ protected helper: FormsHelper;
78
+ protected utiExts: UtilityService;
79
+ protected lc: LocalizationService;
80
+ protected msgs: MessageService;
81
+ protected ngControl: NgControl;
82
+ protected ngModel: NgModel;
83
+ protected FRM_DEBUG_MODE: boolean;
84
+ protected cdr: ChangeDetectorRef;
85
+ /**
86
+ * Indica se l'input del componente dev'essere risparato fuori con le trasformazioni da *outValue*
87
+ *
88
+ * Il controllo potrebbe essere automatico ma rischia di diventare pesante per componenti particolari/pesanti
89
+ */
90
+ protected shouldReemitAdjustedInput: boolean;
91
+ /**
92
+ * Indica se devo ignorare la prima validazione utile del componente. Se il componente che estende questa classe base dichiara una sua validaizone, serve,
93
+ * altrimenti quando parte invalido viene skippata solo la validazione del componente base e la prima validazione del componente implementato passerebbe
94
+ */
95
+ protected skipFirstValidation: boolean;
96
+ statusChangesObservable: Observable<any>;
97
+ protected performFormLogic: boolean;
98
+ protected destroyed$: Subject<void>;
99
+ Configuration: BaseFormConfiguration;
100
+ constructor(inj: Injector);
101
+ ngOnDestroy(): void;
102
+ ngOnInit(): void;
103
+ ngAfterViewInit(): void;
104
+ private showTooltip;
105
+ private hideTooltip;
106
+ log(message: string): void;
107
+ writeValue(obj: any): Promise<void>;
108
+ changed(value: any): Promise<void>;
109
+ finalized(): void;
110
+ focused(event: any): void;
111
+ /** Valuta il contenuto della variabile BindCheckingGroups */
112
+ private evaluateBindCheckingGroups;
113
+ /** Valuta il contenuto della variabile BindProperties */
114
+ private evaluateBindProperties;
115
+ /**
116
+ * Trasforma un oggetto della Source alla sua versione "nuova" basandosi sulle informazioni su gruppi e proprietà
117
+ *
118
+ * @param {any} item Oggetto da trasformare
119
+ *
120
+ * @returns {{id: string, description: string}} Oggetto finale trasformato
121
+ */
122
+ private transformSourceItem;
123
+ protected getEvaluatedModel(valueAfterInTransform: any): Promise<string>;
124
+ protected getValueOut(value: any): Promise<any>;
125
+ protected getValueIn(value: any): Promise<any>;
126
+ protected isEmptyValue(value: any): boolean;
127
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaseFormControl, never>;
128
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BaseFormControl, never, never, { "DisplayCondition": { "alias": "DisplayCondition"; "required": false; }; "DisplayMode": { "alias": "DisplayMode"; "required": false; }; "DisplayLayout": { "alias": "DisplayLayout"; "required": false; }; "FormLayout": { "alias": "FormLayout"; "required": false; }; "DisplayModeTemplate": { "alias": "DisplayModeTemplate"; "required": false; }; "Label": { "alias": "Label"; "required": false; }; "Last": { "alias": "Last"; "required": false; }; "FormGroupClass": { "alias": "FormGroupClass"; "required": false; }; "Placeholder": { "alias": "Placeholder"; "required": false; }; "LabelInputRatio": { "alias": "LabelInputRatio"; "required": false; }; "Form": { "alias": "Form"; "required": false; }; "name": { "alias": "name"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "pattern": { "alias": "pattern"; "required": false; }; "Validation": { "alias": "Validation"; "required": false; }; "SetValidationSubject": { "alias": "SetValidationSubject"; "required": false; }; "required": { "alias": "required"; "required": false; }; "Display": { "alias": "Display"; "required": false; }; "IdField": { "alias": "IdField"; "required": false; }; "Source": { "alias": "Source"; "required": false; }; "statusChangesObservable": { "alias": "statusChangesObservable"; "required": false; }; "Configuration": { "alias": "Configuration"; "required": false; }; }, { "inputChange": "inputChange"; "inputFocus": "inputFocus"; "inputFinalized": "inputFinalized"; }, never, never, true, never>;
129
+ static ngAcceptInputType_readonly: unknown;
130
+ static ngAcceptInputType_disabled: unknown;
131
+ static ngAcceptInputType_required: unknown;
132
+ }
@@ -0,0 +1,12 @@
1
+ import { TemplateRef } from "@angular/core";
2
+ import { BaseFormControl } from "../base-form-control";
3
+ import * as i0 from "@angular/core";
4
+ /** Semplice componente di Input testuale, con eventuale prefisso/suffisso */
5
+ export declare class InputSkeletonComponent {
6
+ For: BaseFormControl;
7
+ Control: TemplateRef<any>;
8
+ /** @ignore Costruttore */
9
+ constructor();
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<InputSkeletonComponent, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<InputSkeletonComponent, "input-skeleton", never, { "For": { "alias": "For"; "required": false; }; "Control": { "alias": "Control"; "required": false; }; }, {}, never, never, true, never>;
12
+ }
@@ -0,0 +1,11 @@
1
+ import { ControlValueAccessor } from "@angular/forms";
2
+ import { BaseFormControl } from "../base/base-form-control";
3
+ import * as i0 from "@angular/core";
4
+ export declare class EsFormCheckboxComponent extends BaseFormControl implements ControlValueAccessor {
5
+ SliderMode: boolean;
6
+ ngOnInit(): void;
7
+ protected getValueIn(value: any): Promise<boolean>;
8
+ protected getEvaluatedModel(value: any): Promise<string>;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<EsFormCheckboxComponent, never>;
10
+ static ɵcmp: i0.ɵɵComponentDeclaration<EsFormCheckboxComponent, "form-checkbox", never, { "SliderMode": { "alias": "SliderMode"; "required": false; }; }, {}, never, never, true, never>;
11
+ }
@@ -0,0 +1,10 @@
1
+ import { ControlValueAccessor } from "@angular/forms";
2
+ import { BaseFormControl } from "../base/base-form-control";
3
+ import * as i0 from "@angular/core";
4
+ export declare class EsFormCurrencyComponent extends BaseFormControl implements ControlValueAccessor {
5
+ mode: 'currency' | 'decimal';
6
+ Precision: number;
7
+ ngAfterViewInit(): void;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<EsFormCurrencyComponent, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<EsFormCurrencyComponent, "form-currency", never, { "mode": { "alias": "mode"; "required": false; }; "Precision": { "alias": "Precision"; "required": false; }; }, {}, never, never, true, never>;
10
+ }
@@ -0,0 +1,36 @@
1
+ import { WritableSignal } from "@angular/core";
2
+ import { ControlValueAccessor } from "@angular/forms";
3
+ import { DateService } from "@esfaenza/extensions";
4
+ import { BaseFormControl } from "../base/base-form-control";
5
+ import * as i0 from "@angular/core";
6
+ export declare class EsFormDateComponent extends BaseFormControl implements ControlValueAccessor {
7
+ /**
8
+ * Indica il formato da utilizzare sia in Input che in Output
9
+ *
10
+ * 1. Se date vengono utilizzate le Date di Javascript
11
+ *
12
+ * 2. Se timestring vengono utilizzate stringhe del tipo '00:00:00'
13
+ *
14
+ * 3. Se dayjs viene utilizzato, appunto, dayjs
15
+ */
16
+ InOutFormat: 'date' | 'timestring' | 'dayjs';
17
+ /** Nel caso dei componenti data il Placeholder è il formato, mentre la label floattante, se esistente, dev'essere specificata */
18
+ FloatingLabel: boolean;
19
+ protected datesExts: DateService;
20
+ protected mode: 'date' | 'datetime' | 'time' | 'month' | 'year' | 'daterange';
21
+ view: WritableSignal<'month' | 'year' | 'date'>;
22
+ dateFormat: WritableSignal<string | undefined>;
23
+ showTime: WritableSignal<boolean | undefined>;
24
+ hourFormat: WritableSignal<number | undefined>;
25
+ timeOnly: WritableSignal<boolean | undefined>;
26
+ showButtonBar: WritableSignal<boolean | undefined>;
27
+ selectionMode: WritableSignal<'single' | 'multiple' | 'range' | undefined>;
28
+ ngAfterViewInit(): void;
29
+ protected setInputMode(): void;
30
+ protected getEvaluatedModel(value: any): Promise<string>;
31
+ protected getValueOut(value: any): Promise<any>;
32
+ protected getValueIn(obj: any): Promise<any>;
33
+ private adjustInputModeVisuals;
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<EsFormDateComponent, never>;
35
+ static ɵcmp: i0.ɵɵComponentDeclaration<EsFormDateComponent, "form-date", never, { "InOutFormat": { "alias": "InOutFormat"; "required": false; }; "FloatingLabel": { "alias": "FloatingLabel"; "required": false; }; }, {}, never, never, true, never>;
36
+ }
@@ -0,0 +1,7 @@
1
+ import { EsFormDateComponent } from "../date/form-date.component";
2
+ import * as i0 from "@angular/core";
3
+ export declare class EsFormDateTimeComponent extends EsFormDateComponent {
4
+ setInputMode(): void;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<EsFormDateTimeComponent, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<EsFormDateTimeComponent, "form-datetime", never, {}, {}, never, never, true, never>;
7
+ }
@@ -1,9 +1,9 @@
1
1
  import * as i0 from "@angular/core";
2
2
  /**
3
- * Componente placeholder per la creazione dei form che rappresenta un blocchetto di informazioni,
3
+ * Componente placeholder per la creazione dei form che rappresenta un blocchetto di erorre,
4
4
  * al posto del quale possono poi comparire dei componenti form senza incasinare la grafica
5
5
  */
6
- export declare class FormInfoComponent {
6
+ export declare class EsFormErrorComponent {
7
7
  /** col-md-X per la label (Che in questoc aso è vuota) */
8
8
  LabelColWidth: number;
9
9
  /** col-md-X per l'input (che in questo caso contiene il messaggio d'errore proiettato nell'HTML) */
@@ -14,6 +14,6 @@ export declare class FormInfoComponent {
14
14
  FormGroupClass: string;
15
15
  /** Permette di settare in una volta solo gli input LabelColWidth e InputColWidth, basta scriverlo con la sintassi "X Y" */
16
16
  set LabelInputRatio(input: string);
17
- static ɵfac: i0.ɵɵFactoryDeclaration<FormInfoComponent, never>;
18
- static ɵcmp: i0.ɵɵComponentDeclaration<FormInfoComponent, "form-info", never, { "LabelColWidth": { "alias": "LabelColWidth"; "required": false; }; "InputColWidth": { "alias": "InputColWidth"; "required": false; }; "Last": { "alias": "Last"; "required": false; }; "FormGroupClass": { "alias": "FormGroupClass"; "required": false; }; "LabelInputRatio": { "alias": "LabelInputRatio"; "required": false; }; }, {}, never, ["*"], false, never>;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<EsFormErrorComponent, never>;
18
+ static ɵcmp: i0.ɵɵComponentDeclaration<EsFormErrorComponent, "form-error", never, { "LabelColWidth": { "alias": "LabelColWidth"; "required": false; }; "InputColWidth": { "alias": "InputColWidth"; "required": false; }; "Last": { "alias": "Last"; "required": false; }; "FormGroupClass": { "alias": "FormGroupClass"; "required": false; }; "LabelInputRatio": { "alias": "LabelInputRatio"; "required": false; }; }, {}, never, ["*"], true, never>;
19
19
  }
@@ -0,0 +1,38 @@
1
+ import { Injector } from "@angular/core";
2
+ import { AbstractControl, ControlValueAccessor, ValidationErrors, Validator } from "@angular/forms";
3
+ import { BaseFormControl } from "../base/base-form-control";
4
+ import { AppFile } from "../../models/AppFile";
5
+ import * as i0 from "@angular/core";
6
+ export declare class EsFormFileComponent extends BaseFormControl implements ControlValueAccessor, Validator {
7
+ /** Permette di caricare file multipli */
8
+ Multiple: boolean;
9
+ /** Permette di scaricare l'eventuale file selezionato */
10
+ AllowDownload: boolean;
11
+ /** Controllo sulla dimensione di ogni singolo file in Byte. 0 -> nessun limite */
12
+ MaxSize: number;
13
+ /** Sportivo */
14
+ FancyMode: boolean;
15
+ /** Legge sempre il contenuto del file e ne estrapola il base64 */
16
+ ReadFile: boolean;
17
+ /** @ignore Costruttore */
18
+ constructor(inj: Injector);
19
+ ngOnInit(): void;
20
+ validate(_: AbstractControl): ValidationErrors;
21
+ protected isEmptyValue(value: AppFile): boolean;
22
+ protected getValueIn(value: any): Promise<any>;
23
+ protected getValueOut(value: any): Promise<any>;
24
+ protected getEvaluatedModel(valueAfterInTransform: AppFile): Promise<string>;
25
+ /**
26
+ * Helper per gestire la modifica del file attualmente bindato
27
+ *
28
+ * @param {boolean} clear Indica se bisogna svuotare l'input o meno
29
+ */
30
+ fileChange(clear?: boolean): Promise<void>;
31
+ private loadFileB64;
32
+ /** Permette di scaricare l'eventuale file selezionato */
33
+ onDownloadFile(): void;
34
+ onFileDragOver(event: DragEvent): void;
35
+ onFileDropped(event: DragEvent): void;
36
+ static ɵfac: i0.ɵɵFactoryDeclaration<EsFormFileComponent, never>;
37
+ static ɵcmp: i0.ɵɵComponentDeclaration<EsFormFileComponent, "form-file", never, { "Multiple": { "alias": "Multiple"; "required": false; }; "AllowDownload": { "alias": "AllowDownload"; "required": false; }; "MaxSize": { "alias": "MaxSize"; "required": false; }; "FancyMode": { "alias": "FancyMode"; "required": false; }; "ReadFile": { "alias": "ReadFile"; "required": false; }; }, {}, never, never, true, never>;
38
+ }
@@ -1,9 +1,9 @@
1
1
  import * as i0 from "@angular/core";
2
2
  /**
3
- * Componente placeholder per la creazione dei form che rappresenta un blocchetto di erorre,
3
+ * Componente placeholder per la creazione dei form che rappresenta un blocchetto di informazioni,
4
4
  * al posto del quale possono poi comparire dei componenti form senza incasinare la grafica
5
5
  */
6
- export declare class FormErrorComponent {
6
+ export declare class EsFormInfoComponent {
7
7
  /** col-md-X per la label (Che in questoc aso è vuota) */
8
8
  LabelColWidth: number;
9
9
  /** col-md-X per l'input (che in questo caso contiene il messaggio d'errore proiettato nell'HTML) */
@@ -14,6 +14,6 @@ export declare class FormErrorComponent {
14
14
  FormGroupClass: string;
15
15
  /** Permette di settare in una volta solo gli input LabelColWidth e InputColWidth, basta scriverlo con la sintassi "X Y" */
16
16
  set LabelInputRatio(input: string);
17
- static ɵfac: i0.ɵɵFactoryDeclaration<FormErrorComponent, never>;
18
- static ɵcmp: i0.ɵɵComponentDeclaration<FormErrorComponent, "form-error", never, { "LabelColWidth": { "alias": "LabelColWidth"; "required": false; }; "InputColWidth": { "alias": "InputColWidth"; "required": false; }; "Last": { "alias": "Last"; "required": false; }; "FormGroupClass": { "alias": "FormGroupClass"; "required": false; }; "LabelInputRatio": { "alias": "LabelInputRatio"; "required": false; }; }, {}, never, ["*"], false, never>;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<EsFormInfoComponent, never>;
18
+ static ɵcmp: i0.ɵɵComponentDeclaration<EsFormInfoComponent, "form-info", never, { "LabelColWidth": { "alias": "LabelColWidth"; "required": false; }; "InputColWidth": { "alias": "InputColWidth"; "required": false; }; "Last": { "alias": "Last"; "required": false; }; "FormGroupClass": { "alias": "FormGroupClass"; "required": false; }; "LabelInputRatio": { "alias": "LabelInputRatio"; "required": false; }; }, {}, never, ["*"], true, never>;
19
19
  }
@@ -0,0 +1,25 @@
1
+ import { EventEmitter } from "@angular/core";
2
+ import { ControlValueAccessor } from "@angular/forms";
3
+ import { BaseFormControl } from "../base/base-form-control";
4
+ import * as i0 from "@angular/core";
5
+ export declare class EsFormInputComponent extends BaseFormControl implements ControlValueAccessor {
6
+ /** Elemento che contiene la proiezione dell'HTML del suffisso */
7
+ suffix: any;
8
+ /** Delegato per l'esecuzione di un'operazione al click del suffisso */
9
+ onSuffixAction: EventEmitter<void>;
10
+ /** Elemento che contiene la proiezione dell'HTML del prefisso */
11
+ prefix: any;
12
+ /** Delegato per l'esecuzione di un'operazione al click del prefisso */
13
+ onPrefixAction: EventEmitter<void>;
14
+ minlength: number | undefined;
15
+ maxlength: number | undefined;
16
+ pattern: string | undefined;
17
+ Password: boolean;
18
+ passShown: import("@angular/core").WritableSignal<boolean>;
19
+ Type: import("@angular/core").WritableSignal<string>;
20
+ ngOnInit(): void;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<EsFormInputComponent, never>;
22
+ static ɵcmp: i0.ɵɵComponentDeclaration<EsFormInputComponent, "form-input", never, { "minlength": { "alias": "minlength"; "required": false; }; "maxlength": { "alias": "maxlength"; "required": false; }; "pattern": { "alias": "pattern"; "required": false; }; "Password": { "alias": "Password"; "required": false; }; }, { "onSuffixAction": "onSuffixAction"; "onPrefixAction": "onPrefixAction"; }, ["suffix", "prefix"], never, true, never>;
23
+ static ngAcceptInputType_minlength: unknown;
24
+ static ngAcceptInputType_maxlength: unknown;
25
+ }
@@ -0,0 +1,20 @@
1
+ import { ControlValueAccessor } from "@angular/forms";
2
+ import { BaseFormControl } from "../base/base-form-control";
3
+ import * as i0 from "@angular/core";
4
+ export declare class EsFormMultiselectComponent extends BaseFormControl implements ControlValueAccessor {
5
+ display: "comma" | "chip";
6
+ InOutFormat: 'KeyValues' | 'CommaSeparatedList' | 'JsonList' | 'List';
7
+ /** Nel caso dei componenti data il Placeholder è il formato, mentre la label floattante, se esistente, dev'essere specificata */
8
+ FloatingLabel: boolean;
9
+ ngOnInit(): void;
10
+ protected setDisplayMode(): void;
11
+ ngAfterViewInit(): void;
12
+ protected getValueIn(value: any): Promise<any>;
13
+ protected getValueOut(value: string[]): Promise<any>;
14
+ protected getEvaluatedModel(value: {
15
+ id: string;
16
+ description: string;
17
+ }[]): Promise<string>;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<EsFormMultiselectComponent, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<EsFormMultiselectComponent, "form-multiselect", never, { "display": { "alias": "display"; "required": false; }; "InOutFormat": { "alias": "InOutFormat"; "required": false; }; "FloatingLabel": { "alias": "FloatingLabel"; "required": false; }; }, {}, never, never, true, never>;
20
+ }
@@ -0,0 +1,9 @@
1
+ import { ControlValueAccessor } from "@angular/forms";
2
+ import { BaseFormControl } from "../base/base-form-control";
3
+ import * as i0 from "@angular/core";
4
+ export declare class EsFormSelectComponent extends BaseFormControl implements ControlValueAccessor {
5
+ ngAfterViewInit(): void;
6
+ protected getEvaluatedModel(value: any): Promise<string>;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<EsFormSelectComponent, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<EsFormSelectComponent, "form-select", never, {}, {}, never, never, true, never>;
9
+ }
@@ -4,7 +4,7 @@ import * as i0 from "@angular/core";
4
4
  * Componente da utilizzare quando l'implementazione dell'input non è disponibile nella libreria,
5
5
  * fornisce la struttura standard di un form-component ma l'input vero e proprio viene proiettato dall'esterno
6
6
  */
7
- export declare class FormTemplateComponent {
7
+ export declare class EsFormTemplateComponent {
8
8
  /** Indica se l'input è obbligatorio o no */
9
9
  Required: boolean;
10
10
  /** Mostra un testo a sinistra dell'input, **FormLayout** permettendo */
@@ -33,6 +33,6 @@ export declare class FormTemplateComponent {
33
33
  InlineSeparator: string;
34
34
  /** Permette di settare in una volta solo gli input LabelColWidth e InputColWidth, basta scriverlo con la sintassi "X Y" */
35
35
  set LabelInputRatio(input: string);
36
- static ɵfac: i0.ɵɵFactoryDeclaration<FormTemplateComponent, never>;
37
- static ɵcmp: i0.ɵɵComponentDeclaration<FormTemplateComponent, "form-template", never, { "Required": { "alias": "Required"; "required": false; }; "Label": { "alias": "Label"; "required": false; }; "LabelClass": { "alias": "LabelClass"; "required": false; }; "FormLayout": { "alias": "FormLayout"; "required": false; }; "LabelColWidth": { "alias": "LabelColWidth"; "required": false; }; "InputColWidth": { "alias": "InputColWidth"; "required": false; }; "Last": { "alias": "Last"; "required": false; }; "FormGroupClass": { "alias": "FormGroupClass"; "required": false; }; "DisplayMode": { "alias": "DisplayMode"; "required": false; }; "DisplayModeTemplate": { "alias": "DisplayModeTemplate"; "required": false; }; "DisplayLayout": { "alias": "DisplayLayout"; "required": false; }; "DisplayCondition": { "alias": "DisplayCondition"; "required": false; }; "InlineSeparator": { "alias": "InlineSeparator"; "required": false; }; "LabelInputRatio": { "alias": "LabelInputRatio"; "required": false; }; }, {}, never, ["*"], false, never>;
36
+ static ɵfac: i0.ɵɵFactoryDeclaration<EsFormTemplateComponent, never>;
37
+ static ɵcmp: i0.ɵɵComponentDeclaration<EsFormTemplateComponent, "form-template", never, { "Required": { "alias": "Required"; "required": false; }; "Label": { "alias": "Label"; "required": false; }; "LabelClass": { "alias": "LabelClass"; "required": false; }; "FormLayout": { "alias": "FormLayout"; "required": false; }; "LabelColWidth": { "alias": "LabelColWidth"; "required": false; }; "InputColWidth": { "alias": "InputColWidth"; "required": false; }; "Last": { "alias": "Last"; "required": false; }; "FormGroupClass": { "alias": "FormGroupClass"; "required": false; }; "DisplayMode": { "alias": "DisplayMode"; "required": false; }; "DisplayModeTemplate": { "alias": "DisplayModeTemplate"; "required": false; }; "DisplayLayout": { "alias": "DisplayLayout"; "required": false; }; "DisplayCondition": { "alias": "DisplayCondition"; "required": false; }; "InlineSeparator": { "alias": "InlineSeparator"; "required": false; }; "LabelInputRatio": { "alias": "LabelInputRatio"; "required": false; }; }, {}, never, ["*"], true, never>;
38
38
  }
@@ -0,0 +1,13 @@
1
+ import { ControlValueAccessor } from "@angular/forms";
2
+ import { BaseFormControl } from "../base/base-form-control";
3
+ import * as i0 from "@angular/core";
4
+ export declare class EsFormTextareaComponent extends BaseFormControl implements ControlValueAccessor {
5
+ rows: number | undefined;
6
+ minlength: number | undefined;
7
+ maxlength: number | undefined;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<EsFormTextareaComponent, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<EsFormTextareaComponent, "form-textarea", never, { "rows": { "alias": "rows"; "required": false; }; "minlength": { "alias": "minlength"; "required": false; }; "maxlength": { "alias": "maxlength"; "required": false; }; }, {}, never, never, true, never>;
10
+ static ngAcceptInputType_rows: unknown;
11
+ static ngAcceptInputType_minlength: unknown;
12
+ static ngAcceptInputType_maxlength: unknown;
13
+ }
@@ -0,0 +1,7 @@
1
+ import { EsFormDateComponent } from "../date/form-date.component";
2
+ import * as i0 from "@angular/core";
3
+ export declare class EsFormTimeComponent extends EsFormDateComponent {
4
+ setInputMode(): void;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<EsFormTimeComponent, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<EsFormTimeComponent, "form-time", never, {}, {}, never, never, true, never>;
7
+ }
@@ -0,0 +1,32 @@
1
+ import { ModuleWithProviders } from '@angular/core';
2
+ import { BaseLocalization } from "@esfaenza/localizations";
3
+ import { EsFormsModuleConfig } from './models/EsFormsModuleConfig';
4
+ import { PrimeNG } from 'primeng/config';
5
+ import * as i0 from "@angular/core";
6
+ import * as i1 from "@angular/common";
7
+ import * as i2 from "@angular/forms";
8
+ import * as i3 from "@esfaenza/localizations";
9
+ import * as i4 from "./forms/input/form-input.component";
10
+ import * as i5 from "./forms/select/form-select.component";
11
+ import * as i6 from "./forms/date/form-date.component";
12
+ import * as i7 from "./forms/datetime/form-datetime.component";
13
+ import * as i8 from "./forms/time/form-time.component";
14
+ import * as i9 from "./forms/checkbox/form-checkbox.component";
15
+ import * as i10 from "./forms/textarea/form-textarea.component";
16
+ import * as i11 from "./forms/info/form-info.component";
17
+ import * as i12 from "./forms/error/form-error.component";
18
+ import * as i13 from "./forms/template/form-template.component";
19
+ import * as i14 from "./forms/file/form-file.component";
20
+ import * as i15 from "./forms/multiselect/form-multiselect.component";
21
+ import * as i16 from "./forms/autocomplete/form-autocomplete.component";
22
+ import * as i17 from "./forms/adaptive/form-adaptive.component";
23
+ import * as i18 from "./forms/currency/form-currency.component";
24
+ export declare class FormsAndValidationsModule {
25
+ private lc;
26
+ private primeng;
27
+ constructor(lc: BaseLocalization, primeng: PrimeNG);
28
+ static forRoot(config?: EsFormsModuleConfig): ModuleWithProviders<FormsAndValidationsModule>;
29
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormsAndValidationsModule, never>;
30
+ static ɵmod: i0.ɵɵNgModuleDeclaration<FormsAndValidationsModule, never, [typeof i1.CommonModule, typeof i2.FormsModule, typeof i3.LocalizationModule, typeof i4.EsFormInputComponent, typeof i5.EsFormSelectComponent, typeof i6.EsFormDateComponent, typeof i7.EsFormDateTimeComponent, typeof i8.EsFormTimeComponent, typeof i9.EsFormCheckboxComponent, typeof i10.EsFormTextareaComponent, typeof i11.EsFormInfoComponent, typeof i12.EsFormErrorComponent, typeof i13.EsFormTemplateComponent, typeof i14.EsFormFileComponent, typeof i15.EsFormMultiselectComponent, typeof i16.EsFormAutocompleteComponent, typeof i17.EsFormAdaptiveComponent, typeof i18.EsFormCurrencyComponent], [typeof i4.EsFormInputComponent, typeof i5.EsFormSelectComponent, typeof i6.EsFormDateComponent, typeof i7.EsFormDateTimeComponent, typeof i8.EsFormTimeComponent, typeof i9.EsFormCheckboxComponent, typeof i10.EsFormTextareaComponent, typeof i11.EsFormInfoComponent, typeof i12.EsFormErrorComponent, typeof i13.EsFormTemplateComponent, typeof i14.EsFormFileComponent, typeof i15.EsFormMultiselectComponent, typeof i16.EsFormAutocompleteComponent, typeof i17.EsFormAdaptiveComponent, typeof i18.EsFormCurrencyComponent]>;
31
+ static ɵinj: i0.ɵɵInjectorDeclaration<FormsAndValidationsModule>;
32
+ }
@@ -1,21 +1,11 @@
1
- /**
2
- * Classe che identifica un file
3
- */
1
+ /** Classe che identifica un file */
4
2
  export declare class AppFile {
5
- /**
6
- * @ignore
7
- */
3
+ /** @ignore */
8
4
  constructor();
9
- /**
10
- * Nome del file, Viene letto in Input e valorizzato in Output
11
- */
5
+ /** Nome del file, Viene letto in Input e valorizzato in Output */
12
6
  filename: string;
13
- /**
14
- * B64 del file, Viene letto in Input ma non valorizzato in Output (non puà leggere dal filesystem)
15
- */
7
+ /** B64 del file, Viene letto in Input ma non valorizzato in Output (non puà leggere dal filesystem) */
16
8
  fileb64: string;
17
- /**
18
- * Lista di file nativi collegati a questo input. Viene solo valorizzato in Output. Non è letto come Input
19
- */
9
+ /** Lista di file nativi collegati a questo input. Viene solo valorizzato in Output. Non è letto come Input */
20
10
  nativefiles: File[];
21
11
  }
@@ -0,0 +1,27 @@
1
+ import { TemplateRef } from "@angular/core";
2
+ import { Observable, Subject } from "rxjs";
3
+ export declare class BaseFormConfiguration {
4
+ DisplayCondition: boolean;
5
+ DisplayMode: boolean;
6
+ DisplayLayout: 'form' | 'inline' | 'hidden';
7
+ FormLayout: boolean;
8
+ DisplayModeTemplate: TemplateRef<any>;
9
+ Label: string;
10
+ Last: boolean;
11
+ FormGroupClass: string;
12
+ Placeholder: string;
13
+ LabelInputRatio: string;
14
+ name: string;
15
+ readonly: boolean | undefined;
16
+ disabled: boolean | undefined;
17
+ Validation: boolean;
18
+ SetValidationSubject: Subject<{
19
+ fieldName: string;
20
+ error: string;
21
+ }>;
22
+ required: boolean | '' | undefined;
23
+ Display: string;
24
+ IdField: string;
25
+ Source: any[];
26
+ statusChangesObservable: Observable<any>;
27
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Classe di configurazione del modulo
3
+ */
4
+ export declare class EsFormsModuleConfig {
5
+ /** Abilita o meno la modalità di debug */
6
+ debugMode?: boolean;
7
+ }
@@ -0,0 +1,15 @@
1
+ import { Injector } from "@angular/core";
2
+ import { NgControl, NgForm, NgModel } from "@angular/forms";
3
+ import * as i0 from "@angular/core";
4
+ export declare class FormsHelper {
5
+ retrieveModelControlAndForm(inj: Injector, fieldName: string, explicitForm?: NgForm): {
6
+ control: NgControl;
7
+ model: NgModel;
8
+ form: {
9
+ natural: boolean;
10
+ entity: NgForm;
11
+ };
12
+ };
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormsHelper, never>;
14
+ static ɵprov: i0.ɵɵInjectableDeclaration<FormsHelper>;
15
+ }
package/lib/tokens.d.ts CHANGED
@@ -1,7 +1,3 @@
1
1
  import { InjectionToken } from '@angular/core';
2
- /** Chiave che indica il prefisso dei Contesti Applicativi per permettere l'abilitazione/disabilitazione di input in maniera contestuale */
3
- export declare const ACO_CUSTOMKEY: InjectionToken<string>;
4
2
  /** Token che indica la lingua da utilizzare, sono supportate "it-IT" ed "en-US" */
5
- export declare const FAV_DEBUG_MODE: InjectionToken<boolean>;
6
- /** Token che indica se far apparire l'input delle checkbox come slider o come input nativi */
7
- export declare const FAV_SLIDER_MODE: InjectionToken<boolean>;
3
+ export declare const FRM_DEBUG_MODE: InjectionToken<boolean>;