@annalib/anna-core 37.0.30 → 37.0.32

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.
@@ -4,6 +4,7 @@ export interface IGtTableHeader {
4
4
  headerInfo: IHeaderInfo[];
5
5
  visible: boolean;
6
6
  width: string;
7
+ isFixedGroup?: boolean;
7
8
  rowspan?: number;
8
9
  colspan?: number;
9
10
  rowNumber?: number;
@@ -14,6 +15,20 @@ export type TDCellClass = "CENTRE";
14
15
  export interface IHeaderInfo {
15
16
  name: string;
16
17
  objectKey: string;
18
+ isVisible?: boolean;
19
+ visibleOrder?: number;
20
+ defaultShowTooltipIcon?: boolean;
21
+ defaultFilterConfig?: {
22
+ filter?: FILTERTYPE;
23
+ filterSortObjectKeys?: string[];
24
+ isSortRequired?: boolean[];
25
+ isFilterRequired?: boolean[];
26
+ };
27
+ activeFilterSortObjectKeys?: string[];
28
+ activeIsSortRequired?: boolean[];
29
+ activeIsFilterRequired?: boolean[];
30
+ customizeLabel?: string;
31
+ isChecked?: boolean;
17
32
  actionKey?: string;
18
33
  tooltipKey?: string;
19
34
  isDisabledKey?: string;
@@ -271,4 +286,10 @@ export interface IDropdownConfigWithIconForGT {
271
286
  showTooltip: boolean;
272
287
  tooltipData?: string;
273
288
  }
289
+ export interface ICustomizableColumn {
290
+ name: string;
291
+ objectKey: string;
292
+ isFixed: boolean;
293
+ isChecked: boolean;
294
+ }
274
295
  export {};
@@ -16,14 +16,14 @@ export declare class AnnaDateTimeFormatService {
16
16
  addZero(time: any): any;
17
17
  sortByTimeAscending(a: any, b: any): number;
18
18
  sortByTimeDescending(a: any, b: any): number;
19
- compareTime(a: dayjs.Dayjs, b: dayjs.Dayjs, unit: UnitType, isAsc: boolean): 1 | -1 | 0;
19
+ compareTime(a: dayjs.Dayjs, b: dayjs.Dayjs, unit: UnitType, isAsc: boolean): 1 | 0 | -1;
20
20
  convertNgbDateToMoment(ngbDate: NgbDate | NgbDateType): string;
21
21
  compareDate(a: string, b: string, isAsc: boolean): number;
22
22
  static formatTwentyFourHourTimeToHHMMAFormat(value: any, date?: string): string;
23
23
  static formatTwelveHourTimeToHHMMAFormat(timeValue: any, date?: string): string;
24
24
  formatDateAndHHMMATimeToStandardFormat(dateAndTime: any): string;
25
25
  compare(a: number | string, b: number | string, isAsc: boolean): number;
26
- sortDataByBroadcastTimeAsc(firstParamTime: string, secondParamTime: string, broadcastTime: string): 1 | -1 | 0;
26
+ sortDataByBroadcastTimeAsc(firstParamTime: string, secondParamTime: string, broadcastTime: string): 1 | 0 | -1;
27
27
  convertNgbDateToMomentInSpecificFormat(ngbDate: NgbDateType, format: string): string;
28
28
  getBroadcastWeek(startDate: any, format?: string): {
29
29
  start: dayjs.Dayjs;
@@ -0,0 +1,76 @@
1
+ import { IGtTableHeader } from "../models/anna-non-editable-gt-models";
2
+ import * as i0 from "@angular/core";
3
+ export declare class CustomizableColumnsService {
4
+ /**
5
+ * Applies table preferences by updating table headers visibility and checked state
6
+ * @param tableHeaders - Table headers to update visibility for
7
+ * @param selectedColumnNames - Array of selected column object keys from preferences
8
+ */
9
+ applyColumnPreferences(tableHeaders: IGtTableHeader[], selectedColumnNames: string[]): void;
10
+ /**
11
+ * Ensures a header carries immutable copies of its default filter/tooltip configuration.
12
+ */
13
+ private ensureHeaderDefaultsAreStored;
14
+ /**
15
+ * Checks if a filter configuration has any filter settings
16
+ * @param config - Filter configuration to check
17
+ * @returns True if configuration has filter settings, false otherwise
18
+ */
19
+ private isFilterConfigPopulated;
20
+ /**
21
+ * Applies filter state for a header group based on visible headers and the selected filter header
22
+ * @param headerGroup - Header group to apply filter state to
23
+ * @param visibleHeaders - Array of visible header info
24
+ * @param firstHeaderWithFilter - Visible header with filter configuration
25
+ */
26
+ private updateGroupFilterState;
27
+ /**
28
+ * Checks if a header's filter config has keys that match visible columns
29
+ * @param header - Header to check
30
+ * @param visibleObjectKeys - Set of visible column keys
31
+ * @returns True if header has filter keys for visible columns, false otherwise
32
+ */
33
+ private headerHasVisibleColumnKeys;
34
+ /**
35
+ * Applies filter configuration to header info and updates active filter states
36
+ * @param header - Header info to apply configuration to
37
+ * @param config - Filter configuration to apply (if undefined, clears filter config)
38
+ */
39
+ private applyFilterConfigToHeader;
40
+ /**
41
+ * Keeps filter metadata in sync with the columns that remain visible.
42
+ * @param defaultConfig - Original filter configuration attached to the header
43
+ * @param visibleColumnKeys - Set of column object keys currently rendered
44
+ * @param visibleHeaderCount - Number of headers still visible within the group
45
+ * @param firstVisibleHeaderIndex - Index of the first visible header inside the group
46
+ * @returns Filter configuration aligned with the current visibility state
47
+ */
48
+ private buildFilteredConfig;
49
+ /**
50
+ * Extracts selected (checked) column object keys from table headers
51
+ * @param tableHeaders - Table headers to extract from
52
+ * @returns Array of selected column object keys (only non-fixed columns)
53
+ */
54
+ collectSelectedColumnKeys(tableHeaders: IGtTableHeader[]): string[];
55
+ /**
56
+ * Gets the count of fixed columns in the customizable columns list
57
+ * @param tableHeaders - Table headers to count fixed columns from
58
+ * @returns Number of fixed columns
59
+ */
60
+ countFixedColumns(tableHeaders: IGtTableHeader[]): number;
61
+ /**
62
+ * Checks if visible columns have changed between previous and new headers
63
+ * @param previousHeaders - Previous table headers to compare
64
+ * @param newHeaders - New table headers to compare
65
+ * @returns True if visible columns have changed, false otherwise
66
+ */
67
+ haveVisibleColumnKeysChanged(previousHeaders: IGtTableHeader[], newHeaders: IGtTableHeader[]): boolean;
68
+ /**
69
+ * Extracts all visible object keys from table headers
70
+ * @param headers - Table headers to extract visible keys from
71
+ * @returns Set of visible object keys
72
+ */
73
+ collectVisibleObjectKeys(headers: IGtTableHeader[]): Set<string>;
74
+ static ɵfac: i0.ɵɵFactoryDeclaration<CustomizableColumnsService, never>;
75
+ static ɵprov: i0.ɵɵInjectableDeclaration<CustomizableColumnsService>;
76
+ }
@@ -1,4 +1,5 @@
1
1
  import { AfterViewChecked, ChangeDetectorRef, ElementRef, EventEmitter, OnChanges, OnInit, QueryList, SimpleChanges, TemplateRef } from "@angular/core";
2
+ import { NgbModal } from "@ng-bootstrap/ng-bootstrap";
2
3
  import { BehaviorSubject } from "rxjs";
3
4
  import { GtColumnIconEmittedData, RatingSellerGroupHierarchy } from "../../../anna-core-shared-lib/models/anna-generic-data-type.model";
4
5
  import { IWeekCalendar } from "../../../anna-core-shared-lib/models/anna-global-dropdown-config.model";
@@ -6,6 +7,7 @@ import { EllipsisWithTableTooltip, IGtGeneralConfig, IGtTableHeader, IHeaderInfo
6
7
  import { AnnaDateTimeFormatService } from "../../../anna-core-shared-lib/services/anna-date-time-format.service";
7
8
  import { AnnaFilterService } from "../../../anna-core-shared-lib/services/anna-filter.service";
8
9
  import { AnnaSortService } from "../../../anna-core-shared-lib/services/anna-sort.service";
10
+ import { CustomizableColumnsService } from "../../../anna-core-shared-lib/services/customizable-columns.service";
9
11
  import * as i0 from "@angular/core";
10
12
  interface TableTooltipType {
11
13
  tooltipTableHeader: string[];
@@ -19,6 +21,8 @@ export declare class AnnaNonEditableGenericTableComponent implements OnInit, OnC
19
21
  private annaSortService;
20
22
  annaDateTimeFormatService: AnnaDateTimeFormatService;
21
23
  annaFilterService: AnnaFilterService;
24
+ modalService: NgbModal;
25
+ private customizableColumnsService;
22
26
  showSkeletonLoading: boolean;
23
27
  tableHeaders: IGtTableHeader[];
24
28
  tableData: any[];
@@ -51,6 +55,7 @@ export declare class AnnaNonEditableGenericTableComponent implements OnInit, OnC
51
55
  tdsHaveRowSpan: boolean;
52
56
  multipleTablesPresent: boolean;
53
57
  showOrHideToggleForTotalRow: boolean;
58
+ enableCustomizableColumns: boolean;
54
59
  toggleCheckbox: EventEmitter<any>;
55
60
  toggleRowCheckbox: EventEmitter<any>;
56
61
  toggleHeaderCheckbox: EventEmitter<any>;
@@ -98,6 +103,10 @@ export declare class AnnaNonEditableGenericTableComponent implements OnInit, OnC
98
103
  }>;
99
104
  totalRowRadioButtonClicked: EventEmitter<string>;
100
105
  totalRowRadioButtonIconClicked: EventEmitter<string>;
106
+ columnsCustomized: EventEmitter<{
107
+ selectedColumns: string[];
108
+ tableHeaders: IGtTableHeader[];
109
+ }>;
101
110
  acfiRateInputChanged: EventEmitter<{
102
111
  data: any;
103
112
  key: string;
@@ -172,6 +181,10 @@ export declare class AnnaNonEditableGenericTableComponent implements OnInit, OnC
172
181
  open: () => void;
173
182
  close: () => void;
174
183
  };
184
+ tableHeadersClone: IGtTableHeader[];
185
+ private initialCustomizeSelectedColumns;
186
+ customizeColumnsModalReference: any;
187
+ customizeColumnsModal: TemplateRef<any>;
175
188
  statusNoteTooltip: any;
176
189
  statusNoteForTooltip: string;
177
190
  statusNoteForPopup: string;
@@ -190,7 +203,7 @@ export declare class AnnaNonEditableGenericTableComponent implements OnInit, OnC
190
203
  time: string;
191
204
  }[];
192
205
  selectedRowForTimeEdit: any;
193
- constructor(cdRef: ChangeDetectorRef, annaSortService: AnnaSortService, annaDateTimeFormatService: AnnaDateTimeFormatService, annaFilterService: AnnaFilterService);
206
+ constructor(cdRef: ChangeDetectorRef, annaSortService: AnnaSortService, annaDateTimeFormatService: AnnaDateTimeFormatService, annaFilterService: AnnaFilterService, modalService: NgbModal, customizableColumnsService: CustomizableColumnsService);
194
207
  ngAfterViewChecked(): void;
195
208
  ngOnInit(): void;
196
209
  detectChanges(): void;
@@ -265,7 +278,18 @@ export declare class AnnaNonEditableGenericTableComponent implements OnInit, OnC
265
278
  closeTimeInputTooltip(): void;
266
279
  timeInputTooltipClickedInTableBody(event: ITimeInputData, rowData: any): void;
267
280
  timeSelectedInTableRow(event: string[][]): void;
281
+ openCustomizeColumnsModal(): void;
282
+ selectUnselectCustomizeColumns(objectKey: string): void;
283
+ getSelectedColumnsCount(): number;
284
+ private getCustomizableColumnsCount;
285
+ private getSelectedCustomizableColumnsCount;
286
+ isSelectAllDisabled(): boolean;
287
+ isUnselectAllDisabled(): boolean;
288
+ selectAllCustomizeColumns(): void;
289
+ unselectAllCustomizeColumns(): void;
290
+ hasCustomizeSelectionChanged(): boolean;
291
+ customizeColumns(customize: boolean): void;
268
292
  static ɵfac: i0.ɵɵFactoryDeclaration<AnnaNonEditableGenericTableComponent, never>;
269
- static ɵcmp: i0.ɵɵComponentDeclaration<AnnaNonEditableGenericTableComponent, "anna-core-non-editable-generic-table-lib", never, { "showSkeletonLoading": { "alias": "showSkeletonLoading"; "required": false; }; "tableHeaders": { "alias": "tableHeaders"; "required": true; }; "tableData": { "alias": "tableData"; "required": true; }; "clonedTableData": { "alias": "clonedTableData"; "required": true; }; "gtGeneralConfig": { "alias": "gtGeneralConfig"; "required": true; }; "totalRowInfo": { "alias": "totalRowInfo"; "required": false; }; "gtDimension": { "alias": "gtDimension"; "required": true; }; "extraHeaderRowForAdjustingColumnWidths": { "alias": "extraHeaderRowForAdjustingColumnWidths"; "required": false; }; "tableClass": { "alias": "tableClass"; "required": false; }; "maximumRowsWhichCanBeRenderedWithoutScroll": { "alias": "maximumRowsWhichCanBeRenderedWithoutScroll"; "required": false; }; "fixNumberOfRowsForPopup": { "alias": "fixNumberOfRowsForPopup"; "required": false; }; "fixRowsToRender": { "alias": "fixRowsToRender"; "required": false; }; "includeBorderInTableHeight": { "alias": "includeBorderInTableHeight"; "required": false; }; "downloadInProgress": { "alias": "downloadInProgress"; "required": false; }; "percentDone": { "alias": "percentDone"; "required": false; }; "starredInProgress": { "alias": "starredInProgress"; "required": false; }; "clickableRow": { "alias": "clickableRow"; "required": false; }; "setTableHeightWhenRowSizeIsFixed": { "alias": "setTableHeightWhenRowSizeIsFixed"; "required": false; }; "tableBorderBottomClassRequired": { "alias": "tableBorderBottomClassRequired"; "required": false; }; "hideSomeTds": { "alias": "hideSomeTds"; "required": false; }; "tdsHaveRowSpan": { "alias": "tdsHaveRowSpan"; "required": false; }; "multipleTablesPresent": { "alias": "multipleTablesPresent"; "required": false; }; "showOrHideToggleForTotalRow": { "alias": "showOrHideToggleForTotalRow"; "required": false; }; }, { "toggleCheckbox": "toggleCheckbox"; "toggleRowCheckbox": "toggleRowCheckbox"; "toggleHeaderCheckbox": "toggleHeaderCheckbox"; "undoIconClicked": "undoIconClicked"; "filterAppliedToTable": "filterAppliedToTable"; "sortingAppliedToTable": "sortingAppliedToTable"; "rowClicked": "rowClicked"; "radioButtonSelected": "radioButtonSelected"; "columnFilterOpened": "columnFilterOpened"; "columnFilterClosed": "columnFilterClosed"; "gtIconClicked": "gtIconClicked"; "gtSVGIconClicked": "gtSVGIconClicked"; "gtTextActionClicked": "gtTextActionClicked"; "gtViewDetailClicked": "gtViewDetailClicked"; "gtInnerHTMLClicked": "gtInnerHTMLClicked"; "downloadSpotDetails": "downloadSpotDetails"; "clickableDataClicked": "clickableDataClicked"; "totalRowIconClicked": "totalRowIconClicked"; "notificationIconHover": "notificationIconHover"; "notificationIconHoverLeave": "notificationIconHoverLeave"; "editableInputEdited": "editableInputEdited"; "radioButtonMessageIconClicked": "radioButtonMessageIconClicked"; "statusNotePopupOpened": "statusNotePopupOpened"; "textPopupOpened": "textPopupOpened"; "digitOnlyInputChanged": "digitOnlyInputChanged"; "singleSelectDropdownValueEmit": "singleSelectDropdownValueEmit"; "timeSelected": "timeSelected"; "totalRowRadioButtonClicked": "totalRowRadioButtonClicked"; "totalRowRadioButtonIconClicked": "totalRowRadioButtonIconClicked"; "acfiRateInputChanged": "acfiRateInputChanged"; "acfiRateCopyRequested": "acfiRateCopyRequested"; }, never, never, true, never>;
293
+ static ɵcmp: i0.ɵɵComponentDeclaration<AnnaNonEditableGenericTableComponent, "anna-core-non-editable-generic-table-lib", never, { "showSkeletonLoading": { "alias": "showSkeletonLoading"; "required": false; }; "tableHeaders": { "alias": "tableHeaders"; "required": true; }; "tableData": { "alias": "tableData"; "required": true; }; "clonedTableData": { "alias": "clonedTableData"; "required": true; }; "gtGeneralConfig": { "alias": "gtGeneralConfig"; "required": true; }; "totalRowInfo": { "alias": "totalRowInfo"; "required": false; }; "gtDimension": { "alias": "gtDimension"; "required": true; }; "extraHeaderRowForAdjustingColumnWidths": { "alias": "extraHeaderRowForAdjustingColumnWidths"; "required": false; }; "tableClass": { "alias": "tableClass"; "required": false; }; "maximumRowsWhichCanBeRenderedWithoutScroll": { "alias": "maximumRowsWhichCanBeRenderedWithoutScroll"; "required": false; }; "fixNumberOfRowsForPopup": { "alias": "fixNumberOfRowsForPopup"; "required": false; }; "fixRowsToRender": { "alias": "fixRowsToRender"; "required": false; }; "includeBorderInTableHeight": { "alias": "includeBorderInTableHeight"; "required": false; }; "downloadInProgress": { "alias": "downloadInProgress"; "required": false; }; "percentDone": { "alias": "percentDone"; "required": false; }; "starredInProgress": { "alias": "starredInProgress"; "required": false; }; "clickableRow": { "alias": "clickableRow"; "required": false; }; "setTableHeightWhenRowSizeIsFixed": { "alias": "setTableHeightWhenRowSizeIsFixed"; "required": false; }; "tableBorderBottomClassRequired": { "alias": "tableBorderBottomClassRequired"; "required": false; }; "hideSomeTds": { "alias": "hideSomeTds"; "required": false; }; "tdsHaveRowSpan": { "alias": "tdsHaveRowSpan"; "required": false; }; "multipleTablesPresent": { "alias": "multipleTablesPresent"; "required": false; }; "showOrHideToggleForTotalRow": { "alias": "showOrHideToggleForTotalRow"; "required": false; }; "enableCustomizableColumns": { "alias": "enableCustomizableColumns"; "required": false; }; }, { "toggleCheckbox": "toggleCheckbox"; "toggleRowCheckbox": "toggleRowCheckbox"; "toggleHeaderCheckbox": "toggleHeaderCheckbox"; "undoIconClicked": "undoIconClicked"; "filterAppliedToTable": "filterAppliedToTable"; "sortingAppliedToTable": "sortingAppliedToTable"; "rowClicked": "rowClicked"; "radioButtonSelected": "radioButtonSelected"; "columnFilterOpened": "columnFilterOpened"; "columnFilterClosed": "columnFilterClosed"; "gtIconClicked": "gtIconClicked"; "gtSVGIconClicked": "gtSVGIconClicked"; "gtTextActionClicked": "gtTextActionClicked"; "gtViewDetailClicked": "gtViewDetailClicked"; "gtInnerHTMLClicked": "gtInnerHTMLClicked"; "downloadSpotDetails": "downloadSpotDetails"; "clickableDataClicked": "clickableDataClicked"; "totalRowIconClicked": "totalRowIconClicked"; "notificationIconHover": "notificationIconHover"; "notificationIconHoverLeave": "notificationIconHoverLeave"; "editableInputEdited": "editableInputEdited"; "radioButtonMessageIconClicked": "radioButtonMessageIconClicked"; "statusNotePopupOpened": "statusNotePopupOpened"; "textPopupOpened": "textPopupOpened"; "digitOnlyInputChanged": "digitOnlyInputChanged"; "singleSelectDropdownValueEmit": "singleSelectDropdownValueEmit"; "timeSelected": "timeSelected"; "totalRowRadioButtonClicked": "totalRowRadioButtonClicked"; "totalRowRadioButtonIconClicked": "totalRowRadioButtonIconClicked"; "columnsCustomized": "columnsCustomized"; "acfiRateInputChanged": "acfiRateInputChanged"; "acfiRateCopyRequested": "acfiRateCopyRequested"; }, never, never, true, never>;
270
294
  }
271
295
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@annalib/anna-core",
3
- "version": "37.0.30",
3
+ "version": "37.0.32",
4
4
  "peerDependencies": {
5
5
  "@angular-slider/ngx-slider": "^19.0.0",
6
6
  "@angular/common": "^19.2.10",
package/public-api.d.ts CHANGED
@@ -22,6 +22,7 @@ export * from "./lib/anna-core-shared-lib/services/anna-persisting-filter.servic
22
22
  export * from "./lib/anna-core-shared-lib/services/anna-regex-patterns.service";
23
23
  export * from "./lib/anna-core-shared-lib/services/anna-sort.service";
24
24
  export * from "./lib/anna-core-shared-lib/services/anna-spinner-loader.service";
25
+ export * from "./lib/anna-core-shared-lib/services/customizable-columns.service";
25
26
  export * from "./lib/anna-core-shared-lib/services/update-station-id.service";
26
27
  export * from "./lib/anna-generic-table-lib/services/gt-table-related-common-functions.service";
27
28
  export * from "./lib/anna-core-shared-lib/models/anna-generic-data-type.model";
@@ -25,3 +25,16 @@
25
25
  #generic-table-conatiner.table-with-show-hide-total-row-toggle .total-row td:nth-of-type(2) {
26
26
  padding-left: 16px !important;
27
27
  }
28
+
29
+ // Apply padding to first column instead of second column for posting-and-ud-tracking-table
30
+ :host.posting-and-ud-tracking-table {
31
+ #generic-table-conatiner.table-with-show-hide-total-row-toggle .total-row {
32
+ td:nth-of-type(1) {
33
+ padding-left: 16px !important;
34
+ }
35
+
36
+ td:nth-of-type(2) {
37
+ padding-left: 8px !important;
38
+ }
39
+ }
40
+ }