@ieeesa-npm/presentation 0.8.7 → 0.8.9

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.
@@ -1,4 +1,4 @@
1
- import { ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
1
+ import { AfterViewInit, 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';
@@ -15,19 +15,20 @@ import * as i0 from "@angular/core";
15
15
  * @implements {FormField}
16
16
  * @implements {OnDestroy}
17
17
  */
18
- export declare class AutocompleteComponent implements OnInit, FormField, OnDestroy {
18
+ export declare class AutocompleteComponent implements OnInit, FormField, OnDestroy, AfterViewInit {
19
19
  private formUtilityService;
20
20
  config: FieldConfig;
21
21
  group: FormGroup;
22
22
  value: string;
23
- filteredOptions: AutoCompleteOption[];
23
+ autoCompleteOptionList: AutoCompleteOption[];
24
+ set autoCompleteOptions(value: AutoCompleteOption[]);
25
+ get autoCompleteOptions(): AutoCompleteOption[];
24
26
  isSelectedOptionsVisible: boolean;
25
27
  autoCompleteSearchValue: EventEmitter<string>;
26
- autoCompleteOptionSelected: EventEmitter<string>;
28
+ autoCompleteOptionSelected: EventEmitter<AutoCompleteOption>;
27
29
  autoComplete: ElementRef;
28
30
  destroy$: Subject<boolean>;
29
31
  autocompleteConstInfo: any;
30
- optionsToFilter: AutoCompleteOption[];
31
32
  constructor(formUtilityService: FormUtilityService);
32
33
  /**
33
34
  * Implementation of ngOnInit lifecycle hook method to initialize components instance properties.
@@ -35,17 +36,29 @@ export declare class AutocompleteComponent implements OnInit, FormField, OnDestr
35
36
  */
36
37
  ngOnInit(): void;
37
38
  /**
38
- * Filters the options on form control value changes.
39
+ * Initialize the form control change event once the form control is ready on ngAfterViewInit by calling onValueChanges method.
39
40
  * @memberof AutocompleteComponent
40
41
  */
41
- filterOptions(): void;
42
+ ngAfterViewInit(): void;
42
43
  /**
43
- * Emits the selected option name when the form on change event is triggered and returns option name.
44
- * @param {AutoCompleteOption} data // data is an selected option of filteredOptions.
45
- * @return {string} // Returns selected option name as string
44
+ * Emits an autoCompleteSearchValue change event when the value is changed and value is greater than minCharToSearch or equal to zero.
46
45
  * @memberof AutocompleteComponent
47
46
  */
48
- onChange(data: AutoCompleteOption): string;
47
+ onValueChanges(): void;
48
+ /**
49
+ * Emits the selected option when the form on change event is triggered and returns option.
50
+ * @param {AutoCompleteOption} data // data is an selected option of autoCompleteOptions.
51
+ * @return {AutoCompleteOption} // Returns selected option as AutoCompleteOption
52
+ * @memberof AutocompleteComponent
53
+ */
54
+ onChange(data: AutoCompleteOption): AutoCompleteOption;
55
+ /**
56
+ * Display the selected option name
57
+ * @param {AutoCompleteOption} option
58
+ * @return {string}
59
+ * @memberof AutocompleteComponent
60
+ */
61
+ displayOptionName(option: AutoCompleteOption): string;
49
62
  /**
50
63
  * Takes the index and the current item as arguments and needs to return the unique identifier for this item.
51
64
  * @param {number} index
@@ -60,5 +73,5 @@ export declare class AutocompleteComponent implements OnInit, FormField, OnDestr
60
73
  */
61
74
  ngOnDestroy(): void;
62
75
  static ɵfac: i0.ɵɵFactoryDeclaration<AutocompleteComponent, never>;
63
- static ɵcmp: i0.ɵɵComponentDeclaration<AutocompleteComponent, "ieeesa-autocomplete", never, { "filteredOptions": { "alias": "filteredOptions"; "required": false; }; "isSelectedOptionsVisible": { "alias": "isSelectedOptionsVisible"; "required": false; }; }, { "autoCompleteSearchValue": "autoCompleteSearchValue"; "autoCompleteOptionSelected": "autoCompleteOptionSelected"; }, never, never, true, never>;
76
+ static ɵcmp: i0.ɵɵComponentDeclaration<AutocompleteComponent, "ieeesa-autocomplete", never, { "autoCompleteOptions": { "alias": "autoCompleteOptions"; "required": false; }; "isSelectedOptionsVisible": { "alias": "isSelectedOptionsVisible"; "required": false; }; }, { "autoCompleteSearchValue": "autoCompleteSearchValue"; "autoCompleteOptionSelected": "autoCompleteOptionSelected"; }, never, never, true, never>;
64
77
  }
@@ -26,6 +26,7 @@ export declare class CheckboxComponent implements OnInit, FormField, OnDestroy {
26
26
  */
27
27
  set checkboxes(value: CheckboxOption[]);
28
28
  get checkboxes(): CheckboxOption[];
29
+ set isRecreateCheckboxControls(value: CheckboxOption[]);
29
30
  selectedCheckboxesInfo: SelectionModel<CheckboxOption>;
30
31
  checkboxSelection: EventEmitter<CheckboxOption>;
31
32
  checkboxOptionsAndSelection: EventEmitter<CheckboxOption[]>;
@@ -38,6 +39,11 @@ export declare class CheckboxComponent implements OnInit, FormField, OnDestroy {
38
39
  * @memberof CheckboxComponent
39
40
  */
40
41
  ngOnInit(): void;
42
+ /**
43
+ * Recreate form controls whenever the new set of checkboxes are loaded when component is already initialized
44
+ * @memberof CheckboxComponent
45
+ */
46
+ recreateFormControl(checkboxes: CheckboxOption[]): void;
41
47
  /**
42
48
  * Creates form group and initializes components properties from config.
43
49
  * @memberof CheckboxComponent
@@ -63,5 +69,5 @@ export declare class CheckboxComponent implements OnInit, FormField, OnDestroy {
63
69
  */
64
70
  ngOnDestroy(): void;
65
71
  static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxComponent, never>;
66
- static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxComponent, "ieeesa-checkbox", never, { "checkboxes": { "alias": "checkboxes"; "required": false; }; }, { "checkboxSelection": "checkboxSelection"; "checkboxOptionsAndSelection": "checkboxOptionsAndSelection"; "selectedCheckboxes": "selectedCheckboxes"; }, never, never, true, never>;
72
+ static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxComponent, "ieeesa-checkbox", never, { "checkboxes": { "alias": "checkboxes"; "required": false; }; "isRecreateCheckboxControls": { "alias": "isRecreateCheckboxControls"; "required": false; }; }, { "checkboxSelection": "checkboxSelection"; "checkboxOptionsAndSelection": "checkboxOptionsAndSelection"; "selectedCheckboxes": "selectedCheckboxes"; }, never, never, true, never>;
67
73
  }
@@ -96,6 +96,7 @@ export declare class ChipsComponent implements OnInit, OnDestroy {
96
96
  label: {
97
97
  filterBy: string;
98
98
  applyButton: string;
99
+ clearAll: string;
99
100
  };
100
101
  buttons: {
101
102
  id: number;
@@ -134,10 +135,7 @@ export declare class ChipsComponent implements OnInit, OnDestroy {
134
135
  label: string;
135
136
  ariaLabel: string;
136
137
  toolTip: string;
137
- isToolTipNeeded: boolean; /**
138
- * Shows list of chips on the basis of view more/less button state.
139
- * @memberof ChipComponent
140
- */
138
+ isToolTipNeeded: boolean;
141
139
  }[];
142
140
  };
143
141
  footer: {
@@ -1,7 +1,7 @@
1
1
  import { EventEmitter, OnInit, AfterViewInit, OnDestroy } from '@angular/core';
2
2
  import { MatTableDataSource } from '@angular/material/table';
3
3
  import { MatPaginator, PageEvent } from '@angular/material/paginator';
4
- import { MatSort, SortDirection } from '@angular/material/sort';
4
+ import { MatSort, Sort, SortDirection } from '@angular/material/sort';
5
5
  import { SelectionModel } from '@angular/cdk/collections';
6
6
  import { Subject } from 'rxjs';
7
7
  import { BreakpointObserverService } from '@ieeesa-npm/utility';
@@ -12,6 +12,7 @@ import { IconButton } from '../../models/icon-button.model';
12
12
  import { TableActions } from '../../models/table-actions.model';
13
13
  import { ChipOption } from '../../models/chip-option.model';
14
14
  import { SearchType } from '../../models/search.model';
15
+ import { FiltersAndOptions } from '../../models/filters-options.model';
15
16
  import * as i0 from "@angular/core";
16
17
  /**
17
18
  * Provides a Material Design styled data-table that can be used to display rows of data with sortBy, filterBy, add/edit/delete table row data, pagination, search table data.
@@ -45,6 +46,9 @@ export declare class DataTableComponent implements OnInit, AfterViewInit, OnDest
45
46
  selectedFilterOptions: CheckboxOption[];
46
47
  appliedFilterOptions: ChipOption[];
47
48
  searchType: SearchType;
49
+ className: string;
50
+ inbuiltSortingNeeded: boolean;
51
+ isCellTextOverflowEllipsis: boolean;
48
52
  rowSelected: EventEmitter<any>;
49
53
  selectedRowToEdit: EventEmitter<any>;
50
54
  selectedRowToDelete: EventEmitter<any>;
@@ -58,8 +62,9 @@ export declare class DataTableComponent implements OnInit, AfterViewInit, OnDest
58
62
  }>;
59
63
  selectedFilter: EventEmitter<ChipOption>;
60
64
  removeFilteredOption: EventEmitter<any>;
61
- filteredOptions: EventEmitter<CheckboxOption[]>;
65
+ filteredOptions: EventEmitter<FiltersAndOptions[]>;
62
66
  searchedValue: EventEmitter<string>;
67
+ sortChange: EventEmitter<Sort>;
63
68
  displayedColumns: string[];
64
69
  isMobileView: boolean;
65
70
  dataSource: MatTableDataSource<any>;
@@ -89,6 +94,12 @@ export declare class DataTableComponent implements OnInit, AfterViewInit, OnDest
89
94
  * @memberof DataTableComponent
90
95
  */
91
96
  tableDataChanges(): void;
97
+ /**
98
+ * SortTableData method emits the clicked table column name and sorting direction
99
+ * @param {Sort} sort
100
+ * @memberof DataTableComponent
101
+ */
102
+ sortTableData(sort: Sort): void;
92
103
  /**
93
104
  * OnSelectClick method emits the rowSelected event with selected row data.
94
105
  * @param {*} row
@@ -146,14 +157,13 @@ export declare class DataTableComponent implements OnInit, AfterViewInit, OnDest
146
157
  * @param {CheckboxOption[]} options
147
158
  * @memberof DataTableComponent
148
159
  */
149
- onSelectedFilterOptions(options: CheckboxOption[]): void;
160
+ onSelectedFilterOptions(selectedOptions: FiltersAndOptions[]): void;
150
161
  /**
151
162
  * OnRemovalOfFilteredOption method emits the removeFilteredOption event with removed option.
152
- * Sets the new appliedFilterOptions without removed option.
153
163
  * @param {ChipOption} option
154
164
  * @memberof DataTableComponent
155
165
  */
156
- onRemovalOfFilteredOption(option: ChipOption): void;
166
+ onRemovalOfFilteredOption(options: FiltersAndOptions[]): void;
157
167
  /**
158
168
  * SearchValue method emits the searched value.
159
169
  * @param {string} value
@@ -192,5 +202,5 @@ export declare class DataTableComponent implements OnInit, AfterViewInit, OnDest
192
202
  */
193
203
  ngOnDestroy(): void;
194
204
  static ɵfac: i0.ɵɵFactoryDeclaration<DataTableComponent, never>;
195
- static ɵcmp: i0.ɵɵComponentDeclaration<DataTableComponent, "ieeesa-data-table", never, { "tableDataInfo": { "alias": "tableDataInfo"; "required": false; }; "columnSchemaInfo": { "alias": "columnSchemaInfo"; "required": false; }; "tableActions": { "alias": "tableActions"; "required": false; }; "caption": { "alias": "caption"; "required": false; }; "paginatorConfig": { "alias": "paginatorConfig"; "required": false; }; "searchPlaceHolderText": { "alias": "searchPlaceHolderText"; "required": false; }; "rowEditButton": { "alias": "rowEditButton"; "required": false; }; "rowDeleteButton": { "alias": "rowDeleteButton"; "required": false; }; "tableEditButton": { "alias": "tableEditButton"; "required": false; }; "tableDeleteButton": { "alias": "tableDeleteButton"; "required": false; }; "addButton": { "alias": "addButton"; "required": false; }; "defaultColumnSortDirection": { "alias": "defaultColumnSortDirection"; "required": false; }; "defaultSortedColumn": { "alias": "defaultSortedColumn"; "required": false; }; "filters": { "alias": "filters"; "required": false; }; "selectedFilterOptions": { "alias": "selectedFilterOptions"; "required": false; }; "appliedFilterOptions": { "alias": "appliedFilterOptions"; "required": false; }; "searchType": { "alias": "searchType"; "required": false; }; }, { "rowSelected": "rowSelected"; "selectedRowToEdit": "selectedRowToEdit"; "selectedRowToDelete": "selectedRowToDelete"; "selectedRowsToDelete": "selectedRowsToDelete"; "rowLink": "rowLink"; "addRow": "addRow"; "columnDataOnRowLinkClick": "columnDataOnRowLinkClick"; "paginationChange": "paginationChange"; "selectedFilter": "selectedFilter"; "removeFilteredOption": "removeFilteredOption"; "filteredOptions": "filteredOptions"; "searchedValue": "searchedValue"; }, never, never, true, never>;
205
+ static ɵcmp: i0.ɵɵComponentDeclaration<DataTableComponent, "ieeesa-data-table", never, { "tableDataInfo": { "alias": "tableDataInfo"; "required": false; }; "columnSchemaInfo": { "alias": "columnSchemaInfo"; "required": false; }; "tableActions": { "alias": "tableActions"; "required": false; }; "caption": { "alias": "caption"; "required": false; }; "paginatorConfig": { "alias": "paginatorConfig"; "required": false; }; "searchPlaceHolderText": { "alias": "searchPlaceHolderText"; "required": false; }; "rowEditButton": { "alias": "rowEditButton"; "required": false; }; "rowDeleteButton": { "alias": "rowDeleteButton"; "required": false; }; "tableEditButton": { "alias": "tableEditButton"; "required": false; }; "tableDeleteButton": { "alias": "tableDeleteButton"; "required": false; }; "addButton": { "alias": "addButton"; "required": false; }; "defaultColumnSortDirection": { "alias": "defaultColumnSortDirection"; "required": false; }; "defaultSortedColumn": { "alias": "defaultSortedColumn"; "required": false; }; "filters": { "alias": "filters"; "required": false; }; "selectedFilterOptions": { "alias": "selectedFilterOptions"; "required": false; }; "appliedFilterOptions": { "alias": "appliedFilterOptions"; "required": false; }; "searchType": { "alias": "searchType"; "required": false; }; "className": { "alias": "className"; "required": false; }; "inbuiltSortingNeeded": { "alias": "inbuiltSortingNeeded"; "required": false; }; "isCellTextOverflowEllipsis": { "alias": "isCellTextOverflowEllipsis"; "required": false; }; }, { "rowSelected": "rowSelected"; "selectedRowToEdit": "selectedRowToEdit"; "selectedRowToDelete": "selectedRowToDelete"; "selectedRowsToDelete": "selectedRowsToDelete"; "rowLink": "rowLink"; "addRow": "addRow"; "columnDataOnRowLinkClick": "columnDataOnRowLinkClick"; "paginationChange": "paginationChange"; "selectedFilter": "selectedFilter"; "removeFilteredOption": "removeFilteredOption"; "filteredOptions": "filteredOptions"; "searchedValue": "searchedValue"; "sortChange": "sortChange"; }, never, never, true, never>;
196
206
  }
@@ -61,7 +61,7 @@ export declare class DynamicFormComponent implements OnInit, AfterContentInit {
61
61
  controlName: string;
62
62
  }>;
63
63
  formControlChange: EventEmitter<Event>;
64
- formAutoCompleteSearch: EventEmitter<Event>;
64
+ formAutoCompleteSearch: EventEmitter<string>;
65
65
  autoCompleteOptionSelected: EventEmitter<FormGroup<any>[]>;
66
66
  formAfterContentInit: EventEmitter<FormGroup<any>[]>;
67
67
  formSelectedDateRange: EventEmitter<{
@@ -187,7 +187,7 @@ export declare class DynamicFormComponent implements OnInit, AfterContentInit {
187
187
  * @param {Event} event
188
188
  * @memberof DynamicFormComponent
189
189
  */
190
- onAutoCompleteSearch(event: Event): void;
190
+ onAutoCompleteSearch(event: string): void;
191
191
  /**
192
192
  * Handles form field checkbox selection event
193
193
  * @param {CheckboxOption} option
@@ -4,6 +4,7 @@ import { Subject } from 'rxjs';
4
4
  import { CheckboxOption } from '../../models/checkbox-option.model';
5
5
  import { IconButton } from '../../models/icon-button.model';
6
6
  import { ChipOption } from '../../models/chip-option.model';
7
+ import { FiltersAndOptions } from '../../models/filters-options.model';
7
8
  import * as i0 from "@angular/core";
8
9
  /**
9
10
  * Provides an implementation for group of filter.
@@ -23,16 +24,24 @@ export declare class FilterComponent implements OnDestroy {
23
24
  isFilterActive: boolean;
24
25
  isMobileView: boolean;
25
26
  isApplyButtonDisabled: boolean;
27
+ filtersAndOptions: Map<string | number, CheckboxOption[]>;
26
28
  destroy$: Subject<boolean>;
29
+ isRecreateCheckboxControls: CheckboxOption[];
30
+ prevFilterId: number | string;
31
+ currFilterId: number | string;
27
32
  private filteredTypeOptionsInfo;
28
33
  set appliedFilterOptions(options: ChipOption[]);
29
34
  get appliedFilterOptions(): ChipOption[];
30
35
  filterButton: IconButton;
31
36
  filters: ChipOption[];
32
- selectedFilterOptions: CheckboxOption[];
37
+ private selectedFilterOptionsList;
38
+ selectedFilterId: string | number;
39
+ selectedFilterChecked: boolean;
40
+ set selectedFilterOptions(options: CheckboxOption[]);
41
+ get selectedFilterOptions(): CheckboxOption[];
33
42
  selectedFilter: EventEmitter<ChipOption>;
34
- filteredOptions: EventEmitter<CheckboxOption[]>;
35
- removeFilteredOption: EventEmitter<ChipOption>;
43
+ filteredOptions: EventEmitter<FiltersAndOptions[]>;
44
+ removeFilteredOption: EventEmitter<any>;
36
45
  constructor(breakpointObserverService: BreakpointObserverService, changeDetectorReference: ChangeDetectorRef);
37
46
  /**
38
47
  * OnFilterSelected receives the selected filter from chip component, emits the selected filter and toggle the isFilterByOptionsVisible state.
@@ -46,6 +55,7 @@ export declare class FilterComponent implements OnDestroy {
46
55
  * @memberof FilterComponent
47
56
  */
48
57
  onRemovalOfFilteredOption(option: ChipOption): void;
58
+ getListOfSelectedCheckboxes(): FiltersAndOptions[];
49
59
  /**
50
60
  * OnFilterApply toggles the isFilterByOptionsVisible state, emits the selected filter options and toggles the filter stateO
51
61
  * @memberof FilterComponent
@@ -53,7 +63,7 @@ export declare class FilterComponent implements OnDestroy {
53
63
  onFilterApply(): void;
54
64
  /**
55
65
  * SelectedFilterOptions method is called for every selection and deselection of filter option and stores the selected filter options.
56
- * @param {CheckboxOption[]} values
66
+ * @param {FiltersAndOptions[]} values
57
67
  * @memberof FilterComponent
58
68
  */
59
69
  selectedFilterOptionsInfo(values: CheckboxOption[]): void;
@@ -55,7 +55,7 @@ export declare class DynamicFormFieldDirective implements FormField, OnInit, OnD
55
55
  searchEvent: Event;
56
56
  controlName: string;
57
57
  }>;
58
- formAutoCompleteSearch: EventEmitter<Event>;
58
+ formAutoCompleteSearch: EventEmitter<string>;
59
59
  autoCompleteOptionSelected: EventEmitter<Event>;
60
60
  formCheckboxSelection: EventEmitter<CheckboxOption>;
61
61
  component: ComponentRef<any>;
@@ -0,0 +1,4 @@
1
+ import { CheckboxOption } from './checkbox-option.model';
2
+ export interface FiltersAndOptions {
3
+ [key: string | number]: CheckboxOption[];
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ieeesa-npm/presentation",
3
- "version": "0.8.7",
3
+ "version": "0.8.9",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^16.1.0",
6
6
  "@angular/core": "^16.1.0",
@@ -19,7 +19,7 @@
19
19
  "rxjs": "~7.8.0",
20
20
  "zone.js": "~0.13.0",
21
21
  "@ieeesa-npm/shared-styles": "^0.2.1",
22
- "@ieeesa-npm/feature": "^0.7.0"
22
+ "@ieeesa-npm/feature": "^0.7.1"
23
23
  },
24
24
  "dependencies": {
25
25
  "tslib": "^2.3.0"
package/public-api.d.ts CHANGED
@@ -59,6 +59,7 @@ export * from './lib/models/table-actions.model';
59
59
  export * from './lib/models/table-schema.model';
60
60
  export * from './lib/models/breadcrumb.model';
61
61
  export * from './lib/models/tile.model';
62
+ export * from './lib/models/filters-options.model';
62
63
  export * from './lib/models/profile-menu.model';
63
64
  export * from './lib/services/datepicker.service';
64
65
  export * from './lib/services/form-utility.service';
@@ -95,7 +95,8 @@
95
95
  "filter": {
96
96
  "label": {
97
97
  "filterBy": "Filter By:",
98
- "applyButton": "Apply"
98
+ "applyButton": "Apply",
99
+ "clearAll": "Clear All"
99
100
  },
100
101
  "buttons": [
101
102
  {