@annalib/anna-core 38.0.2 → 38.0.4
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/fesm2022/annalib-anna-core.mjs +504 -185
- package/fesm2022/annalib-anna-core.mjs.map +1 -1
- package/lib/anna-core-shared-lib/models/anna-non-editable-gt-models.d.ts +15 -0
- package/lib/anna-core-shared-lib/services/anna-date-time-format.service.d.ts +2 -2
- package/lib/anna-core-shared-lib/services/customizable-columns.service.d.ts +95 -0
- package/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.d.ts +16 -6
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/src/lib/anna-common-scss/_show-hide-total-row.scss +13 -0
|
@@ -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;
|
|
@@ -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):
|
|
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):
|
|
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,95 @@
|
|
|
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
|
+
* Each group is treated independently so we can keep filter metadata aligned with the rendered columns.
|
|
7
|
+
*
|
|
8
|
+
* @param tableHeaders List of header groups whose visibility state should be updated.
|
|
9
|
+
* @param selectedColumnNames Column keys coming from stored preferences.
|
|
10
|
+
*/
|
|
11
|
+
applyColumnPreferences(tableHeaders: IGtTableHeader[], selectedColumnNames: string[]): void;
|
|
12
|
+
/**
|
|
13
|
+
* Ensures a header carries immutable copies of its default filter/tooltip configuration.
|
|
14
|
+
*
|
|
15
|
+
* @param header Header definition that needs default metadata cached once.
|
|
16
|
+
*/
|
|
17
|
+
private preserveHeaderDefaults;
|
|
18
|
+
/**
|
|
19
|
+
* Determines whether a filter configuration contains actionable data.
|
|
20
|
+
*
|
|
21
|
+
* @param config Immutable default filter configuration to inspect.
|
|
22
|
+
* @returns True when filter-related arrays or filter definitions are present.
|
|
23
|
+
*/
|
|
24
|
+
private hasFilterSettings;
|
|
25
|
+
/**
|
|
26
|
+
* Applies filter state for a header group based on visible headers and the selected filter header.
|
|
27
|
+
* The first visible column becomes the single filter owner to avoid duplicate filter icons.
|
|
28
|
+
*
|
|
29
|
+
* @param headerGroup Target header group whose aggregate visibility state changes.
|
|
30
|
+
* @param visibleHeaders Headers currently rendered in the UI for this group.
|
|
31
|
+
* @param firstHeaderWithFilter First visible header that carries filter metadata, if any.
|
|
32
|
+
* @param groupHasFilters Indicates whether any header in the group exposes filtering.
|
|
33
|
+
* @param headersWithFilters List of all headers that contain filter metadata (visible or hidden).
|
|
34
|
+
*/
|
|
35
|
+
private alignGroupFilterState;
|
|
36
|
+
/**
|
|
37
|
+
* Applies filter configuration to header info and updates active filter states.
|
|
38
|
+
*
|
|
39
|
+
* @param header Target header whose mutable properties must stay in sync with defaults.
|
|
40
|
+
* @param config Filter configuration to apply (undefined clears filter data and icons).
|
|
41
|
+
*/
|
|
42
|
+
private setHeaderFilterConfig;
|
|
43
|
+
/**
|
|
44
|
+
* Picks a header that owns the filter metadata to project on the visible columns.
|
|
45
|
+
* Since we use positional mapping (header position → filterSortObjectKeys index),
|
|
46
|
+
* we need a header that has filterSortObjectKeys to map from. We prefer the first visible
|
|
47
|
+
* header that has filterSortObjectKeys, otherwise fall back to any header with filterSortObjectKeys.
|
|
48
|
+
*
|
|
49
|
+
* @param preferredHeader First visible header that carries filter metadata, if available.
|
|
50
|
+
* @param headersWithFilters All headers that contain filter metadata (visible or hidden).
|
|
51
|
+
* @returns Header whose defaults should drive the filter UI (preferably one with filterSortObjectKeys).
|
|
52
|
+
*/
|
|
53
|
+
private pickFilterSourceHeader;
|
|
54
|
+
/**
|
|
55
|
+
* Keeps filter metadata in sync with the columns that remain visible.
|
|
56
|
+
* Maps visible headers to their corresponding filter keys by position in the header group.
|
|
57
|
+
*
|
|
58
|
+
* @param defaultConfig Original filter configuration attached to the header.
|
|
59
|
+
* @param visibleHeaders Headers currently rendered in the UI for this group.
|
|
60
|
+
* @param headerGroup Header group containing all headers (used to determine header positions).
|
|
61
|
+
* @returns Filter configuration aligned with the current visibility state.
|
|
62
|
+
*/
|
|
63
|
+
private buildVisibleFilterConfig;
|
|
64
|
+
/**
|
|
65
|
+
* Extracts selected (checked) column object keys from table headers.
|
|
66
|
+
*
|
|
67
|
+
* @param tableHeaders Table headers to evaluate.
|
|
68
|
+
* @returns Array of selected column object keys (only non-fixed columns).
|
|
69
|
+
*/
|
|
70
|
+
collectSelectedColumnKeys(tableHeaders: IGtTableHeader[]): string[];
|
|
71
|
+
/**
|
|
72
|
+
* Gets the count of fixed header groups in the customizable columns list.
|
|
73
|
+
*
|
|
74
|
+
* @param tableHeaders Table headers to count fixed groups from.
|
|
75
|
+
* @returns Number of fixed header groups that should always remain visible.
|
|
76
|
+
*/
|
|
77
|
+
countFixedHeaderGroups(tableHeaders: IGtTableHeader[]): number;
|
|
78
|
+
/**
|
|
79
|
+
* Checks if visible columns have changed between previous and new headers.
|
|
80
|
+
*
|
|
81
|
+
* @param previousHeaders Previous snapshot of header groups.
|
|
82
|
+
* @param newHeaders Updated header groups to compare against.
|
|
83
|
+
* @returns True if visible column keys differ, false otherwise.
|
|
84
|
+
*/
|
|
85
|
+
haveVisibleColumnKeysChanged(previousHeaders: IGtTableHeader[], newHeaders: IGtTableHeader[]): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Extracts all visible column keys from table headers so diffs are quick and reliable.
|
|
88
|
+
*
|
|
89
|
+
* @param headers Complete set of header groups to inspect.
|
|
90
|
+
* @returns Set of object keys representing currently visible columns.
|
|
91
|
+
*/
|
|
92
|
+
collectVisibleColumnKeys(headers: IGtTableHeader[]): Set<string>;
|
|
93
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomizableColumnsService, never>;
|
|
94
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CustomizableColumnsService>;
|
|
95
|
+
}
|
|
@@ -3,10 +3,11 @@ import { NgbModal } from "@ng-bootstrap/ng-bootstrap";
|
|
|
3
3
|
import { BehaviorSubject } from "rxjs";
|
|
4
4
|
import { GtColumnIconEmittedData, RatingSellerGroupHierarchy } from "../../../anna-core-shared-lib/models/anna-generic-data-type.model";
|
|
5
5
|
import { IWeekCalendar } from "../../../anna-core-shared-lib/models/anna-global-dropdown-config.model";
|
|
6
|
-
import { EllipsisWithTableTooltip,
|
|
6
|
+
import { EllipsisWithTableTooltip, IGtGeneralConfig, IGtTableHeader, IHeaderInfo, InnerHTMLTooltipAction, ITimeInputData, ITotalRowInfo } from "../../../anna-core-shared-lib/models/anna-non-editable-gt-models";
|
|
7
7
|
import { AnnaDateTimeFormatService } from "../../../anna-core-shared-lib/services/anna-date-time-format.service";
|
|
8
8
|
import { AnnaFilterService } from "../../../anna-core-shared-lib/services/anna-filter.service";
|
|
9
9
|
import { AnnaSortService } from "../../../anna-core-shared-lib/services/anna-sort.service";
|
|
10
|
+
import { CustomizableColumnsService } from "../../../anna-core-shared-lib/services/customizable-columns.service";
|
|
10
11
|
import * as i0 from "@angular/core";
|
|
11
12
|
interface TableTooltipType {
|
|
12
13
|
tooltipTableHeader: string[];
|
|
@@ -21,6 +22,7 @@ export declare class AnnaNonEditableGenericTableComponent implements OnInit, OnC
|
|
|
21
22
|
annaDateTimeFormatService: AnnaDateTimeFormatService;
|
|
22
23
|
annaFilterService: AnnaFilterService;
|
|
23
24
|
modalService: NgbModal;
|
|
25
|
+
private customizableColumnsService;
|
|
24
26
|
showSkeletonLoading: boolean;
|
|
25
27
|
tableHeaders: IGtTableHeader[];
|
|
26
28
|
tableData: any[];
|
|
@@ -54,7 +56,6 @@ export declare class AnnaNonEditableGenericTableComponent implements OnInit, OnC
|
|
|
54
56
|
multipleTablesPresent: boolean;
|
|
55
57
|
showOrHideToggleForTotalRow: boolean;
|
|
56
58
|
enableCustomizableColumns: boolean;
|
|
57
|
-
customizableColumnsList: ICustomizableColumn[];
|
|
58
59
|
toggleCheckbox: EventEmitter<any>;
|
|
59
60
|
toggleRowCheckbox: EventEmitter<any>;
|
|
60
61
|
toggleHeaderCheckbox: EventEmitter<any>;
|
|
@@ -180,7 +181,8 @@ export declare class AnnaNonEditableGenericTableComponent implements OnInit, OnC
|
|
|
180
181
|
open: () => void;
|
|
181
182
|
close: () => void;
|
|
182
183
|
};
|
|
183
|
-
|
|
184
|
+
tableHeadersClone: IGtTableHeader[];
|
|
185
|
+
private initialCustomizeSelectedColumns;
|
|
184
186
|
customizeColumnsModalReference: any;
|
|
185
187
|
customizeColumnsModal: TemplateRef<any>;
|
|
186
188
|
statusNoteTooltip: any;
|
|
@@ -201,7 +203,7 @@ export declare class AnnaNonEditableGenericTableComponent implements OnInit, OnC
|
|
|
201
203
|
time: string;
|
|
202
204
|
}[];
|
|
203
205
|
selectedRowForTimeEdit: any;
|
|
204
|
-
constructor(cdRef: ChangeDetectorRef, annaSortService: AnnaSortService, annaDateTimeFormatService: AnnaDateTimeFormatService, annaFilterService: AnnaFilterService, modalService: NgbModal);
|
|
206
|
+
constructor(cdRef: ChangeDetectorRef, annaSortService: AnnaSortService, annaDateTimeFormatService: AnnaDateTimeFormatService, annaFilterService: AnnaFilterService, modalService: NgbModal, customizableColumnsService: CustomizableColumnsService);
|
|
205
207
|
ngAfterViewChecked(): void;
|
|
206
208
|
ngOnInit(): void;
|
|
207
209
|
detectChanges(): void;
|
|
@@ -277,9 +279,17 @@ export declare class AnnaNonEditableGenericTableComponent implements OnInit, OnC
|
|
|
277
279
|
timeInputTooltipClickedInTableBody(event: ITimeInputData, rowData: any): void;
|
|
278
280
|
timeSelectedInTableRow(event: string[][]): void;
|
|
279
281
|
openCustomizeColumnsModal(): void;
|
|
280
|
-
selectUnselectCustomizeColumns(
|
|
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;
|
|
281
291
|
customizeColumns(customize: boolean): void;
|
|
282
292
|
static ɵfac: i0.ɵɵFactoryDeclaration<AnnaNonEditableGenericTableComponent, never>;
|
|
283
|
-
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; };
|
|
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>;
|
|
284
294
|
}
|
|
285
295
|
export {};
|
package/package.json
CHANGED
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
|
+
}
|