axidio-styleguide-library1-v2 0.2.18 → 0.2.19

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,52 +1,77 @@
1
1
  import { OnInit, EventEmitter } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
+ interface TableMetaData {
4
+ title?: string;
5
+ isPaginationHidden?: boolean;
6
+ isHeaderVisible?: boolean;
7
+ isSearchHidden?: boolean;
8
+ isHeaderAlignedToCenter?: boolean;
9
+ isHeaderSortHidden?: boolean;
10
+ isFirstColumnHeaderHidden?: boolean;
11
+ isAllAlignedToRight?: boolean;
12
+ hasDrillDown?: boolean;
13
+ headerColor?: string;
14
+ headerTextColor?: string;
15
+ }
16
+ interface TableData {
17
+ data: any[];
18
+ metaData: TableMetaData;
19
+ highlightedTexts?: string[];
20
+ }
21
+ type SortDirection = 'asc' | 'desc';
3
22
  export declare class AxTableComponent implements OnInit {
4
- tableData: any;
23
+ tableData: TableData;
5
24
  customChartConfiguration: any;
6
25
  clickEvent: EventEmitter<any>;
7
26
  isHeaderVisible: boolean;
8
27
  isUserSort: boolean;
9
28
  tableHeadList: string[];
10
- masterList: any[];
11
29
  itemList: any[];
30
+ masterList: any[];
12
31
  currentList: any[];
13
- pageSize: number;
32
+ readonly DEFAULT_PAGE_SIZE = 10;
33
+ readonly MAX_PAGES_TO_SHOW = 5;
14
34
  currentPage: number;
35
+ pageSize: number;
15
36
  totalItems: number;
16
37
  totalPages: number;
17
38
  goToPageNumber: number;
18
39
  pagesToShow: number[];
40
+ sortDirection: SortDirection;
19
41
  sortColumn: string;
20
- sortDirection: 'asc' | 'desc' | '';
21
42
  chartConfiguration: any;
22
43
  defaultConfiguration: any;
23
44
  constructor();
24
45
  ngOnInit(): void;
25
- /** ---------------- Initialization ---------------- */
26
- private initializeTable;
27
- private setupChartConfiguration;
28
- private setHeaderVisibility;
29
- /** ---------------- Pagination ---------------- */
46
+ private initializeComponent;
47
+ private extractTableHeaders;
48
+ private mergeConfigurations;
49
+ private initializeData;
50
+ private updateHeaderVisibility;
30
51
  private loadPage;
31
52
  private calculateTotalPages;
32
53
  private generatePagesToShow;
33
- private refreshPagination;
54
+ private onPaginationChange;
34
55
  goToFirstPage(): void;
35
56
  goToPreviousPage(): void;
36
57
  goToNextPage(): void;
37
58
  goToLastPage(): void;
59
+ goToPage(page: number): void;
38
60
  goToSpecificPage(): void;
61
+ sortByColumn(columnId: string): void;
62
+ private performSort;
63
+ private compareValues;
64
+ private resetPaginationAfterSort;
65
+ checkIfColumnCurrentlyBeingSorted(columnId: string): boolean;
66
+ getSortDirection(): string;
67
+ onEnter(event: Event): void;
68
+ private filterItems;
69
+ private resetPaginationAfterSearch;
70
+ getWidthById(columnId: string, index: number): string;
39
71
  preventNegative(event: KeyboardEvent): void;
40
- /** ---------------- Sorting ---------------- */
41
- sortByColumn(id: string): void;
42
- private sortItemList;
43
- private resetSort;
44
- checkIfColumnCurrentlyBeingSorted(id: string): boolean;
45
- /** ---------------- Search ---------------- */
46
- onSearch(event: any): void;
47
- /** ---------------- Utilities ---------------- */
48
- getWidthById(_: string, index: number): string;
49
- handleClick(row: any): void;
72
+ validateNumberInput(event: KeyboardEvent): boolean;
73
+ handleClick(data: any): void;
50
74
  static ɵfac: i0.ɵɵFactoryDeclaration<AxTableComponent, never>;
51
75
  static ɵcmp: i0.ɵɵComponentDeclaration<AxTableComponent, "lib-ax-table", never, { "tableData": { "alias": "tableData"; "required": false; }; "customChartConfiguration": { "alias": "customChartConfiguration"; "required": false; }; }, { "clickEvent": "clickEvent"; }, never, never, false, never>;
52
76
  }
77
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axidio-styleguide-library1-v2",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.3.1",
6
6
  "@angular/core": "^17.3.1",