@ieeesa-npm/presentation 0.6.6 → 0.6.7
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/assets/constants.json +5 -0
- package/esm2022/lib/components/autocomplete/autocomplete.component.mjs +6 -6
- package/esm2022/lib/components/breadcrumb/breadcrumb.component.mjs +5 -5
- package/esm2022/lib/components/checkbox/checkbox.component.mjs +13 -15
- package/esm2022/lib/components/chips/chips.component.mjs +5 -5
- package/esm2022/lib/components/data-table/data-table.component.mjs +5 -5
- package/esm2022/lib/components/date-picker/date-picker.component.mjs +9 -9
- package/esm2022/lib/components/date-picker-header/date-picker-header.component.mjs +5 -5
- package/esm2022/lib/components/dynamic-form/dynamic-form.component.mjs +76 -7
- package/esm2022/lib/components/filter/filter.component.mjs +5 -5
- package/esm2022/lib/components/footer/footer.component.mjs +6 -7
- package/esm2022/lib/components/form-error/form-error.component.mjs +5 -5
- package/esm2022/lib/components/form-support-text/form-support-text.component.mjs +10 -6
- package/esm2022/lib/components/header/header.component.mjs +5 -5
- package/esm2022/lib/components/icon-button/icon-button.component.mjs +4 -4
- package/esm2022/lib/components/input/input.component.mjs +21 -7
- package/esm2022/lib/components/legend/legend.component.mjs +4 -4
- package/esm2022/lib/components/menu/menu.component.mjs +5 -5
- package/esm2022/lib/components/modal/modal.component.mjs +5 -5
- package/esm2022/lib/components/modal-confirmation/modal-confirmation.component.mjs +5 -5
- package/esm2022/lib/components/navigation-menu/navigation-menu.component.mjs +5 -5
- package/esm2022/lib/components/notification/notification.component.mjs +5 -5
- package/esm2022/lib/components/radio/radio.component.mjs +5 -5
- package/esm2022/lib/components/search/search.component.mjs +13 -6
- package/esm2022/lib/components/select/select.component.mjs +6 -6
- package/esm2022/lib/components/text-area/text-area.component.mjs +5 -5
- package/esm2022/lib/components/toggle-button/toggle-button.component.mjs +5 -5
- package/esm2022/lib/components/welcome/welcome.component.mjs +5 -5
- package/esm2022/lib/directives/dynamic-form-field/dynamic-form-field.directive.mjs +14 -4
- package/esm2022/lib/directives/focus-invalid-form-field/focus-invalid-form-field.directive.mjs +4 -4
- package/esm2022/lib/directives/set-background/set-background.directive.mjs +4 -4
- package/esm2022/lib/directives/text-truncated/text-truncated.directive.mjs +4 -4
- package/esm2022/lib/models/app-config-info.model.mjs +1 -1
- package/esm2022/lib/models/field-config.model.mjs +1 -1
- package/esm2022/lib/models/footer-config.model.mjs +1 -1
- package/esm2022/lib/models/input-field-type.model.mjs +8 -0
- package/esm2022/lib/presentation.module.mjs +5 -5
- package/esm2022/lib/services/datepicker.service.mjs +4 -4
- package/esm2022/lib/services/form-utility.service.mjs +17 -5
- package/fesm2022/ieeesa-npm-presentation.mjs +303 -182
- package/fesm2022/ieeesa-npm-presentation.mjs.map +1 -1
- package/lib/components/checkbox/checkbox.component.d.ts +1 -1
- package/lib/components/dynamic-form/dynamic-form.component.d.ts +24 -2
- package/lib/components/form-support-text/form-support-text.component.d.ts +1 -0
- package/lib/components/input/input.component.d.ts +6 -1
- package/lib/components/search/search.component.d.ts +3 -2
- package/lib/directives/dynamic-form-field/dynamic-form-field.directive.d.ts +3 -1
- package/lib/models/app-config-info.model.d.ts +0 -1
- package/lib/models/field-config.model.d.ts +2 -0
- package/lib/models/footer-config.model.d.ts +0 -1
- package/lib/models/input-field-type.model.d.ts +5 -0
- package/lib/services/form-utility.service.d.ts +1 -1
- package/package.json +3 -3
- package/src/lib/assets/constants.json +5 -0
|
@@ -49,7 +49,7 @@ export declare class CheckboxComponent implements OnInit, FormField, OnDestroy {
|
|
|
49
49
|
* @param {boolean} checked
|
|
50
50
|
* @memberof CheckboxComponent
|
|
51
51
|
*/
|
|
52
|
-
onChange(option: CheckboxOption): void;
|
|
52
|
+
onChange(option: CheckboxOption, checked: boolean): void;
|
|
53
53
|
/**
|
|
54
54
|
* Allows Angular to detect the specific checkbox option that needs to change or be added instead of rebuilding the whole checkbox options in DOM by tracking option unique Id.
|
|
55
55
|
* @param {number} index
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { AfterContentInit, EventEmitter, OnInit, QueryList } from '@angular/core';
|
|
2
|
-
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
|
2
|
+
import { FormArray, FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
|
3
3
|
import { FormModel } from '../../models/form.model';
|
|
4
4
|
import { FieldConfig } from '../../models/field-config.model';
|
|
5
5
|
import { FormGrid } from '../../models/form-grid.model';
|
|
6
6
|
import { DynamicFormFieldDirective } from '../../directives/dynamic-form-field/dynamic-form-field.directive';
|
|
7
7
|
import { AlignType } from '../../models/align-type.model';
|
|
8
|
+
import { CheckboxOption } from '../../models/checkbox-option.model';
|
|
8
9
|
import * as i0 from "@angular/core";
|
|
9
10
|
/**
|
|
10
11
|
* Creates a reactive form dynamically based on the passed form field configuration and handles the form events.
|
|
@@ -53,6 +54,7 @@ export declare class DynamicFormComponent implements OnInit, AfterContentInit {
|
|
|
53
54
|
formSearchApply: EventEmitter<any>;
|
|
54
55
|
formGroupsReference: EventEmitter<FormGroup<any>[]>;
|
|
55
56
|
dropdownChange: EventEmitter<any>;
|
|
57
|
+
formCheckboxSelection: EventEmitter<CheckboxOption>;
|
|
56
58
|
formDateSelected: EventEmitter<string>;
|
|
57
59
|
formSelectSearch: EventEmitter<{
|
|
58
60
|
searchEvent: Event;
|
|
@@ -94,6 +96,20 @@ export declare class DynamicFormComponent implements OnInit, AfterContentInit {
|
|
|
94
96
|
* @memberof DynamicFormComponent
|
|
95
97
|
*/
|
|
96
98
|
createGroup(controls: any[]): FormGroup;
|
|
99
|
+
/**
|
|
100
|
+
* Creates form array for Checkbox group and returns.
|
|
101
|
+
* @param {FieldConfig} controls
|
|
102
|
+
* @return {FormArray<any>}
|
|
103
|
+
* @memberof DynamicFormComponent
|
|
104
|
+
*/
|
|
105
|
+
createFormArray(controls: FieldConfig): FormArray<any>;
|
|
106
|
+
/**
|
|
107
|
+
* Custom validator to set required filed validation error for the checkbox field type based on the number of configured minimum checkbox options to be selected whenever the filed configured with required.
|
|
108
|
+
* @param {number} [minSelectionRequired=1]
|
|
109
|
+
* @return {*}
|
|
110
|
+
* @memberof DynamicFormComponent
|
|
111
|
+
*/
|
|
112
|
+
checkboxSelectionRequiredValidator(minSelectionRequired?: number): any;
|
|
97
113
|
/**
|
|
98
114
|
* Creates form control based on form field configuration
|
|
99
115
|
* @param {FieldConfig} control
|
|
@@ -172,6 +188,12 @@ export declare class DynamicFormComponent implements OnInit, AfterContentInit {
|
|
|
172
188
|
* @memberof DynamicFormComponent
|
|
173
189
|
*/
|
|
174
190
|
onAutoCompleteSearch(event: Event): void;
|
|
191
|
+
/**
|
|
192
|
+
* Handles form field checkbox selection event
|
|
193
|
+
* @param {CheckboxOption} option
|
|
194
|
+
* @memberof DynamicFormComponent
|
|
195
|
+
*/
|
|
196
|
+
onCheckboxSelection(option: CheckboxOption): void;
|
|
175
197
|
/**
|
|
176
198
|
* Handles form field auto complete option selection event
|
|
177
199
|
* @memberof DynamicFormComponent
|
|
@@ -185,5 +207,5 @@ export declare class DynamicFormComponent implements OnInit, AfterContentInit {
|
|
|
185
207
|
*/
|
|
186
208
|
getRowClassName(className: string): string;
|
|
187
209
|
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFormComponent, never>;
|
|
188
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFormComponent, "ieeesa-dynamic-form", ["dynamicForm"], { "formGroups": { "alias": "formGroups"; "required": false; }; "submitResponse": { "alias": "submitResponse"; "required": false; }; "searchResponse": { "alias": "searchResponse"; "required": false; }; "colWidth": { "alias": "colWidth"; "required": false; }; "isLegendVisible": { "alias": "isLegendVisible"; "required": false; }; "rightButtonLabel": { "alias": "rightButtonLabel"; "required": false; }; "leftButtonLabel": { "alias": "leftButtonLabel"; "required": false; }; "isSubmitButtonDisabled": { "alias": "isSubmitButtonDisabled"; "required": false; }; "isLeftButtonDisabled": { "alias": "isLeftButtonDisabled"; "required": false; }; "isLeftButtonNeeded": { "alias": "isLeftButtonNeeded"; "required": false; }; "actionButtonAlign": { "alias": "actionButtonAlign"; "required": false; }; }, { "formSubmit": "formSubmit"; "formChange": "formChange"; "formInput": "formInput"; "formLeftButtonClicked": "formLeftButtonClicked"; "formSearchApply": "formSearchApply"; "formGroupsReference": "formGroupsReference"; "dropdownChange": "dropdownChange"; "formDateSelected": "formDateSelected"; "formSelectSearch": "formSelectSearch"; "formControlChange": "formControlChange"; "formAutoCompleteSearch": "formAutoCompleteSearch"; "autoCompleteOptionSelected": "autoCompleteOptionSelected"; "formAfterContentInit": "formAfterContentInit"; "formSelectedDateRange": "formSelectedDateRange"; }, never, never, true, never>;
|
|
210
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFormComponent, "ieeesa-dynamic-form", ["dynamicForm"], { "formGroups": { "alias": "formGroups"; "required": false; }; "submitResponse": { "alias": "submitResponse"; "required": false; }; "searchResponse": { "alias": "searchResponse"; "required": false; }; "colWidth": { "alias": "colWidth"; "required": false; }; "isLegendVisible": { "alias": "isLegendVisible"; "required": false; }; "rightButtonLabel": { "alias": "rightButtonLabel"; "required": false; }; "leftButtonLabel": { "alias": "leftButtonLabel"; "required": false; }; "isSubmitButtonDisabled": { "alias": "isSubmitButtonDisabled"; "required": false; }; "isLeftButtonDisabled": { "alias": "isLeftButtonDisabled"; "required": false; }; "isLeftButtonNeeded": { "alias": "isLeftButtonNeeded"; "required": false; }; "actionButtonAlign": { "alias": "actionButtonAlign"; "required": false; }; }, { "formSubmit": "formSubmit"; "formChange": "formChange"; "formInput": "formInput"; "formLeftButtonClicked": "formLeftButtonClicked"; "formSearchApply": "formSearchApply"; "formGroupsReference": "formGroupsReference"; "dropdownChange": "dropdownChange"; "formCheckboxSelection": "formCheckboxSelection"; "formDateSelected": "formDateSelected"; "formSelectSearch": "formSelectSearch"; "formControlChange": "formControlChange"; "formAutoCompleteSearch": "formAutoCompleteSearch"; "autoCompleteOptionSelected": "autoCompleteOptionSelected"; "formAfterContentInit": "formAfterContentInit"; "formSelectedDateRange": "formSelectedDateRange"; }, never, never, true, never>;
|
|
189
211
|
}
|
|
@@ -4,6 +4,7 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
export declare class FormSupportTextComponent {
|
|
5
5
|
formGroup: FormGroup;
|
|
6
6
|
config: FieldConfig;
|
|
7
|
+
safeType: string;
|
|
7
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormSupportTextComponent, never>;
|
|
8
9
|
static ɵcmp: i0.ɵɵComponentDeclaration<FormSupportTextComponent, "ieeesa-form-support-text", never, { "formGroup": { "alias": "formGroup"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
|
|
9
10
|
}
|
|
@@ -3,7 +3,7 @@ import { FieldConfig } from '../../models/field-config.model';
|
|
|
3
3
|
import { FormField } from '../../models/form-field.model';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
/**
|
|
6
|
-
* Provides implementation of input type number and text
|
|
6
|
+
* Provides implementation of input type number, email and text
|
|
7
7
|
* @export
|
|
8
8
|
* @class InputComponent
|
|
9
9
|
* @implements {FormField}
|
|
@@ -29,6 +29,11 @@ export declare class InputComponent implements FormField {
|
|
|
29
29
|
* @memberof InputComponent
|
|
30
30
|
*/
|
|
31
31
|
onChange(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Returns input field type
|
|
34
|
+
* @memberof InputComponent
|
|
35
|
+
*/
|
|
36
|
+
getInputFieldType(): string;
|
|
32
37
|
static ɵfac: i0.ɵɵFactoryDeclaration<InputComponent, never>;
|
|
33
38
|
static ɵcmp: i0.ɵɵComponentDeclaration<InputComponent, "ieeesa-input", never, {}, {}, never, never, true, never>;
|
|
34
39
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AfterViewInit, ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { Subject } from 'rxjs';
|
|
3
3
|
import { FormGroup } from '@angular/forms';
|
|
4
4
|
import { FieldConfig } from '../../models/field-config.model';
|
|
@@ -16,6 +16,7 @@ import * as i0 from "@angular/core";
|
|
|
16
16
|
* @implements {FormField}
|
|
17
17
|
*/
|
|
18
18
|
export declare class SearchComponent implements OnInit, AfterViewInit, OnDestroy, FormField {
|
|
19
|
+
private cd;
|
|
19
20
|
private formUtilityService;
|
|
20
21
|
config: FieldConfig;
|
|
21
22
|
group: FormGroup;
|
|
@@ -28,7 +29,7 @@ export declare class SearchComponent implements OnInit, AfterViewInit, OnDestroy
|
|
|
28
29
|
searchResponse: string;
|
|
29
30
|
destroy$: Subject<boolean>;
|
|
30
31
|
searchInfo: any;
|
|
31
|
-
constructor(formUtilityService: FormUtilityService);
|
|
32
|
+
constructor(cd: ChangeDetectorRef, formUtilityService: FormUtilityService);
|
|
32
33
|
/**
|
|
33
34
|
* Implementation of ngOnInit lifecycle hook method to initialize config and form group if its undefined
|
|
34
35
|
* @memberof SearchComponent
|
|
@@ -3,6 +3,7 @@ import { FormGroup } from '@angular/forms';
|
|
|
3
3
|
import { Subject } from 'rxjs';
|
|
4
4
|
import { FieldConfig } from '../../models/field-config.model';
|
|
5
5
|
import { FormField } from '../../models/form-field.model';
|
|
6
|
+
import { CheckboxOption } from '../../models/checkbox-option.model';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
/**
|
|
8
9
|
* Provides the implementation of DynamicFormFieldDirective which hosts and creates the form fields components dynamically.
|
|
@@ -56,6 +57,7 @@ export declare class DynamicFormFieldDirective implements FormField, OnInit, OnD
|
|
|
56
57
|
}>;
|
|
57
58
|
formAutoCompleteSearch: EventEmitter<Event>;
|
|
58
59
|
autoCompleteOptionSelected: EventEmitter<Event>;
|
|
60
|
+
formCheckboxSelection: EventEmitter<CheckboxOption>;
|
|
59
61
|
component: ComponentRef<any>;
|
|
60
62
|
constructor(container: ViewContainerRef);
|
|
61
63
|
/**
|
|
@@ -74,5 +76,5 @@ export declare class DynamicFormFieldDirective implements FormField, OnInit, OnD
|
|
|
74
76
|
*/
|
|
75
77
|
ngOnDestroy(): void;
|
|
76
78
|
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFormFieldDirective, never>;
|
|
77
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<DynamicFormFieldDirective, "[ieeesaDynamicFormField]", never, { "config": { "alias": "config"; "required": false; }; "group": { "alias": "group"; "required": false; }; "submitResponse": { "alias": "submitResponse"; "required": false; }; "searchResponse": { "alias": "searchResponse"; "required": false; }; }, { "formSearchApply": "formSearchApply"; "formDropdownSelected": "formDropdownSelected"; "formDateSelected": "formDateSelected"; "formSelectedDateRange": "formSelectedDateRange"; "formSelectSearch": "formSelectSearch"; "formAutoCompleteSearch": "formAutoCompleteSearch"; "autoCompleteOptionSelected": "autoCompleteOptionSelected"; }, never, never, true, never>;
|
|
79
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DynamicFormFieldDirective, "[ieeesaDynamicFormField]", never, { "config": { "alias": "config"; "required": false; }; "group": { "alias": "group"; "required": false; }; "submitResponse": { "alias": "submitResponse"; "required": false; }; "searchResponse": { "alias": "searchResponse"; "required": false; }; }, { "formSearchApply": "formSearchApply"; "formDropdownSelected": "formDropdownSelected"; "formDateSelected": "formDateSelected"; "formSelectedDateRange": "formSelectedDateRange"; "formSelectSearch": "formSelectSearch"; "formAutoCompleteSearch": "formAutoCompleteSearch"; "autoCompleteOptionSelected": "autoCompleteOptionSelected"; "formCheckboxSelection": "formCheckboxSelection"; }, never, never, true, never>;
|
|
78
80
|
}
|
|
@@ -26,6 +26,7 @@ export interface FieldConfig {
|
|
|
26
26
|
isMultiSelect?: boolean;
|
|
27
27
|
value?: any;
|
|
28
28
|
isNumber?: boolean;
|
|
29
|
+
isEmail?: boolean;
|
|
29
30
|
min?: number;
|
|
30
31
|
max?: number;
|
|
31
32
|
maxLength?: number;
|
|
@@ -44,4 +45,5 @@ export interface FieldConfig {
|
|
|
44
45
|
ariaLabel?: string;
|
|
45
46
|
ariaDescribedById?: string;
|
|
46
47
|
ariaMultiline?: boolean;
|
|
48
|
+
minSelectionRequired?: number;
|
|
47
49
|
}
|
|
@@ -23,7 +23,7 @@ export declare class FormUtilityService {
|
|
|
23
23
|
* @return {FormGroup}
|
|
24
24
|
* @memberof FormUtilityService
|
|
25
25
|
*/
|
|
26
|
-
getFormGroup(controlName: string): FormGroup;
|
|
26
|
+
getFormGroup(controlName: string, formControlConfig?: FieldConfig): FormGroup;
|
|
27
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormUtilityService, never>;
|
|
28
28
|
static ɵprov: i0.ɵɵInjectableDeclaration<FormUtilityService>;
|
|
29
29
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ieeesa-npm/presentation",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^16.1.0",
|
|
6
6
|
"@angular/core": "^16.1.0",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"moment": "^2.29.4",
|
|
19
19
|
"rxjs": "~7.8.0",
|
|
20
20
|
"zone.js": "~0.13.0",
|
|
21
|
-
"@ieeesa-npm/shared-styles": "^0.1.
|
|
22
|
-
"@ieeesa-npm/feature": "^0.
|
|
21
|
+
"@ieeesa-npm/shared-styles": "^0.1.7",
|
|
22
|
+
"@ieeesa-npm/feature": "^0.5.0"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"tslib": "^2.3.0"
|