@annalib/anna-core 1.2.6 → 1.2.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.
- package/esm2020/lib/anna-core-shared-lib/anna-core-shared-lib.module.mjs +11 -6
- package/esm2020/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.mjs +35 -0
- package/esm2020/lib/anna-core-shared-lib/directives/show-ellipsis-text/show-ellipsis-text.directive.mjs +27 -0
- package/esm2020/lib/anna-core-shared-lib/models/anna-generic-data-type.model.mjs +1 -1
- package/esm2020/lib/anna-core-shared-lib/models/anna-non-editable-gt-models.mjs +1 -1
- package/esm2020/lib/anna-core-shared-lib/public-api.mjs +3 -2
- package/esm2020/lib/anna-core-shared-lib/services/anna-filter.service.mjs +18 -195
- package/esm2020/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.mjs +129 -289
- package/esm2020/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.mjs +5 -5
- package/esm2020/src/lib/anna-core-shared-lib/anna-core-shared-lib.module.mjs +11 -6
- package/esm2020/src/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.mjs +35 -0
- package/esm2020/src/lib/anna-core-shared-lib/directives/show-ellipsis-text/show-ellipsis-text.directive.mjs +27 -0
- package/esm2020/src/lib/anna-core-shared-lib/models/anna-generic-data-type.model.mjs +1 -1
- package/esm2020/src/lib/anna-core-shared-lib/models/anna-non-editable-gt-models.mjs +1 -1
- package/esm2020/src/lib/anna-core-shared-lib/public-api.mjs +3 -2
- package/esm2020/src/lib/anna-core-shared-lib/services/anna-filter.service.mjs +18 -195
- package/esm2020/src/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.mjs +129 -289
- package/esm2020/src/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.mjs +5 -5
- package/fesm2015/annalib-anna-core-src-lib-anna-core-shared-lib.mjs +90 -235
- package/fesm2015/annalib-anna-core-src-lib-anna-core-shared-lib.mjs.map +1 -1
- package/fesm2015/annalib-anna-core-src-lib-anna-generic-table-lib.mjs +133 -293
- package/fesm2015/annalib-anna-core-src-lib-anna-generic-table-lib.mjs.map +1 -1
- package/fesm2015/annalib-anna-core.mjs +220 -525
- package/fesm2015/annalib-anna-core.mjs.map +1 -1
- package/fesm2020/annalib-anna-core-src-lib-anna-core-shared-lib.mjs +90 -235
- package/fesm2020/annalib-anna-core-src-lib-anna-core-shared-lib.mjs.map +1 -1
- package/fesm2020/annalib-anna-core-src-lib-anna-generic-table-lib.mjs +133 -293
- package/fesm2020/annalib-anna-core-src-lib-anna-generic-table-lib.mjs.map +1 -1
- package/fesm2020/annalib-anna-core.mjs +220 -525
- package/fesm2020/annalib-anna-core.mjs.map +1 -1
- package/lib/anna-core-shared-lib/anna-core-shared-lib.module.d.ts +4 -3
- package/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.d.ts +16 -0
- package/lib/anna-core-shared-lib/directives/show-ellipsis-text/show-ellipsis-text.directive.d.ts +9 -0
- package/lib/anna-core-shared-lib/models/anna-generic-data-type.model.d.ts +4 -0
- package/lib/anna-core-shared-lib/models/anna-non-editable-gt-models.d.ts +1 -0
- package/lib/anna-core-shared-lib/public-api.d.ts +2 -1
- package/lib/anna-core-shared-lib/services/anna-filter.service.d.ts +4 -13
- package/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.d.ts +23 -9
- package/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.d.ts +1 -1
- package/package.json +1 -1
- package/src/lib/anna-core-shared-lib/anna-core-shared-lib.module.d.ts +4 -3
- package/src/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.d.ts +16 -0
- package/src/lib/anna-core-shared-lib/directives/show-ellipsis-text/show-ellipsis-text.directive.d.ts +9 -0
- package/src/lib/anna-core-shared-lib/models/anna-generic-data-type.model.d.ts +4 -0
- package/src/lib/anna-core-shared-lib/models/anna-non-editable-gt-models.d.ts +1 -0
- package/src/lib/anna-core-shared-lib/public-api.d.ts +2 -1
- package/src/lib/anna-core-shared-lib/services/anna-filter.service.d.ts +4 -13
- package/src/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.d.ts +23 -9
- package/src/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.d.ts +1 -1
- package/esm2020/lib/anna-core-shared-lib/directives/show-tooltip/show-tooltip.directive.mjs +0 -27
- package/esm2020/src/lib/anna-core-shared-lib/directives/show-tooltip/show-tooltip.directive.mjs +0 -27
- package/lib/anna-core-shared-lib/directives/show-tooltip/show-tooltip.directive.d.ts +0 -9
- package/src/lib/anna-core-shared-lib/directives/show-tooltip/show-tooltip.directive.d.ts +0 -9
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, ChangeDetectionStrategy, Input, Pipe, Directive, HostListener, NgModule, Injectable } from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy, Input, Pipe, Directive, HostListener, EventEmitter, Output, NgModule, Injectable } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import { memoize, min, max,
|
|
5
|
+
import { memoize, min, max, uniq, cloneDeep, isEqual, map, sortBy } from 'lodash-es';
|
|
6
6
|
import moment from 'moment';
|
|
7
7
|
import { Subject } from 'rxjs';
|
|
8
8
|
|
|
@@ -120,7 +120,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImpor
|
|
|
120
120
|
args: [{ selector: 'anna-rejected-icon-template', template: "<ng-container [ngTemplateOutlet]=\"rejectedIcon\"></ng-container>\r\n\r\n<ng-template #rejectedIcon>\r\n <svg width=\"15px\" height=\"15px\" viewBox=\"0 0 20 20\">\r\n <g id=\"Buyer-rejected-icon\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n <path\r\n d=\"M15.7822266,4.21777344 C14.3671875,2.80276367 12.4951465,2 10.5,2 C6.37918945,2 3,5.37253906 3,9.5 C3,13.6296289 6.37133789,17 10.5,17 C14.6105273,17 18,13.6429004 18,9.5 C18,7.50485352 17.1972656,5.6327832 15.7822266,4.21777344 Z M10.5,15.2128906 C7.34220703,15.2128906 4.78710938,12.664502 4.78710938,9.5 C4.78710938,8.26950195 5.17382812,7.10055664 5.88574219,6.13375977 L13.8662402,14.1054395 C12.8993848,14.8261719 11.730498,15.2128906 10.5,15.2128906 Z M15.1054688,12.8661816 L7.13375977,4.88574219 C8.10061523,4.17382813 9.26950195,3.78710938 10.5,3.78710938 C13.6578809,3.78710938 16.2128906,6.33549805 16.2128906,9.5 C16.2128906,10.7304395 15.8261719,11.8993848 15.1054688,12.8661816 Z\"\r\n id=\"Shape\"\r\n fill=\"#4A4A4A\"\r\n fill-rule=\"nonzero\"\r\n ></path>\r\n </g>\r\n </svg>\r\n</ng-template>\r\n", styles: [""] }]
|
|
121
121
|
}], ctorParameters: function () { return []; } });
|
|
122
122
|
|
|
123
|
-
class
|
|
123
|
+
class showEllipsisTextOnHoverDirective {
|
|
124
124
|
constructor(elementRef) {
|
|
125
125
|
this.elementRef = elementRef;
|
|
126
126
|
}
|
|
@@ -133,18 +133,45 @@ class ShowTooltipDirective {
|
|
|
133
133
|
element.removeAttribute('title');
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type:
|
|
136
|
+
showEllipsisTextOnHoverDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: showEllipsisTextOnHoverDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
137
|
+
showEllipsisTextOnHoverDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.7", type: showEllipsisTextOnHoverDirective, selector: "[showEllipsisTextOnHover]", host: { listeners: { "mouseenter": "onMouseEnter()" } }, ngImport: i0 });
|
|
138
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: showEllipsisTextOnHoverDirective, decorators: [{
|
|
139
139
|
type: Directive,
|
|
140
140
|
args: [{
|
|
141
|
-
selector: '[
|
|
141
|
+
selector: '[showEllipsisTextOnHover]'
|
|
142
142
|
}]
|
|
143
143
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { onMouseEnter: [{
|
|
144
144
|
type: HostListener,
|
|
145
145
|
args: ['mouseenter']
|
|
146
146
|
}] } });
|
|
147
147
|
|
|
148
|
+
class AnnaIconColumnComponent {
|
|
149
|
+
constructor() {
|
|
150
|
+
this.PfpIconActiveColor = "#9B1B93";
|
|
151
|
+
this.PfpIconDisableColor = "rgba(189,189,189,0.5)";
|
|
152
|
+
this.onColumnIconClicked = new EventEmitter();
|
|
153
|
+
}
|
|
154
|
+
ngOnInit() {
|
|
155
|
+
}
|
|
156
|
+
svgIconClicked(rowData, key) {
|
|
157
|
+
this.onColumnIconClicked.emit({ data: rowData, key: key });
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
AnnaIconColumnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: AnnaIconColumnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
161
|
+
AnnaIconColumnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: AnnaIconColumnComponent, selector: "anna-core-anna-icon-column", inputs: { componentName: "componentName", objectKey: "objectKey", dataObject: "dataObject" }, outputs: { onColumnIconClicked: "onColumnIconClicked" }, ngImport: i0, template: "<ng-container *ngIf=\"componentName == 'ORDER_LISTING_INFLIGHT'\">\n <span\n *ngIf=\"dataObject.payForPerformance && objectKey == 'payForPerformance'\"\n class=\"cursor-not-allowed\"\n (click)=\"$event.stopPropagation()\"\n >\n <anna-pay-for-performance-icon-template\n [color]=\"PfpIconActiveColor\"\n [width]=\"'15px'\"\n [height]=\"'15px'\"\n >\n </anna-pay-for-performance-icon-template>\n </span>\n <span\n *ngIf=\"dataObject.orderStatus != 'LIVE' && !dataObject.payForPerformance && objectKey == 'payForPerformance'\"\n (click)=\"svgIconClicked(dataObject,'payForPerformance')\"\n >\n <anna-pay-for-performance-icon-template\n [color]=\"PfpIconDisableColor\"\n [width]=\"'15px'\"\n [height]=\"'15px'\"\n >\n </anna-pay-for-performance-icon-template>\n </span>\n\n <anna-live-icon-template *ngIf=\"dataObject.orderStatus == 'LIVE' && objectKey == 'orderStatus' \"></anna-live-icon-template>\n</ng-container>\n<ng-container *ngIf=\"componentName == 'ORDER_LISTING_COMPLETED'\">\n <span *ngIf=\"dataObject.payForPerformance && objectKey == 'payForPerformance'\" (click)=\"$event.stopPropagation()\">\n <anna-pay-for-performance-icon-template\n [color]=\"PfpIconActiveColor\"\n [width]=\"'20px'\"\n [height]=\"'20px'\"\n >\n </anna-pay-for-performance-icon-template>\n </span>\n</ng-container>\n<ng-container *ngIf=\"objectKey == 'bizRuleStatus'\">\n <anna-rejected-icon-template *ngIf=\"dataObject.bizRuleStatus == 'REJECTED'\"></anna-rejected-icon-template>\n <anna-notify-icon-template *ngIf=\"dataObject.bizRuleStatus == 'NOTIFY'\"></anna-notify-icon-template>\n <anna-buyer-approval-icon-template *ngIf=\"dataObject.bizRuleStatus == 'AWAITING_APPROVAL'\"></anna-buyer-approval-icon-template>\n</ng-container>\n", styles: [""], components: [{ type: AnnaPayForPerformanceIconTemplateComponent, selector: "anna-pay-for-performance-icon-template", inputs: ["color", "width", "height"] }, { type: AnnaLiveIconTemplateComponent, selector: "anna-live-icon-template" }, { type: AnnaRejectedIconTemplateComponent, selector: "anna-rejected-icon-template" }, { type: AnnaNotifyIconTemplateComponent, selector: "anna-notify-icon-template" }, { type: AnnaBuyerApprovalIconTemplateComponent, selector: "anna-buyer-approval-icon-template" }], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
162
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: AnnaIconColumnComponent, decorators: [{
|
|
163
|
+
type: Component,
|
|
164
|
+
args: [{ selector: 'anna-core-anna-icon-column', template: "<ng-container *ngIf=\"componentName == 'ORDER_LISTING_INFLIGHT'\">\n <span\n *ngIf=\"dataObject.payForPerformance && objectKey == 'payForPerformance'\"\n class=\"cursor-not-allowed\"\n (click)=\"$event.stopPropagation()\"\n >\n <anna-pay-for-performance-icon-template\n [color]=\"PfpIconActiveColor\"\n [width]=\"'15px'\"\n [height]=\"'15px'\"\n >\n </anna-pay-for-performance-icon-template>\n </span>\n <span\n *ngIf=\"dataObject.orderStatus != 'LIVE' && !dataObject.payForPerformance && objectKey == 'payForPerformance'\"\n (click)=\"svgIconClicked(dataObject,'payForPerformance')\"\n >\n <anna-pay-for-performance-icon-template\n [color]=\"PfpIconDisableColor\"\n [width]=\"'15px'\"\n [height]=\"'15px'\"\n >\n </anna-pay-for-performance-icon-template>\n </span>\n\n <anna-live-icon-template *ngIf=\"dataObject.orderStatus == 'LIVE' && objectKey == 'orderStatus' \"></anna-live-icon-template>\n</ng-container>\n<ng-container *ngIf=\"componentName == 'ORDER_LISTING_COMPLETED'\">\n <span *ngIf=\"dataObject.payForPerformance && objectKey == 'payForPerformance'\" (click)=\"$event.stopPropagation()\">\n <anna-pay-for-performance-icon-template\n [color]=\"PfpIconActiveColor\"\n [width]=\"'20px'\"\n [height]=\"'20px'\"\n >\n </anna-pay-for-performance-icon-template>\n </span>\n</ng-container>\n<ng-container *ngIf=\"objectKey == 'bizRuleStatus'\">\n <anna-rejected-icon-template *ngIf=\"dataObject.bizRuleStatus == 'REJECTED'\"></anna-rejected-icon-template>\n <anna-notify-icon-template *ngIf=\"dataObject.bizRuleStatus == 'NOTIFY'\"></anna-notify-icon-template>\n <anna-buyer-approval-icon-template *ngIf=\"dataObject.bizRuleStatus == 'AWAITING_APPROVAL'\"></anna-buyer-approval-icon-template>\n</ng-container>\n", styles: [""] }]
|
|
165
|
+
}], ctorParameters: function () { return []; }, propDecorators: { componentName: [{
|
|
166
|
+
type: Input
|
|
167
|
+
}], objectKey: [{
|
|
168
|
+
type: Input
|
|
169
|
+
}], dataObject: [{
|
|
170
|
+
type: Input
|
|
171
|
+
}], onColumnIconClicked: [{
|
|
172
|
+
type: Output
|
|
173
|
+
}] } });
|
|
174
|
+
|
|
148
175
|
// Angular import statements
|
|
149
176
|
class AnnaCoreSharedLibModule {
|
|
150
177
|
}
|
|
@@ -156,14 +183,16 @@ AnnaCoreSharedLibModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0",
|
|
|
156
183
|
AnnaNotifyIconTemplateComponent,
|
|
157
184
|
AnnaPayForPerformanceIconTemplateComponent,
|
|
158
185
|
AnnaRejectedIconTemplateComponent,
|
|
159
|
-
|
|
186
|
+
showEllipsisTextOnHoverDirective,
|
|
187
|
+
AnnaIconColumnComponent], imports: [CommonModule], exports: [AnnaNoDataComponent,
|
|
160
188
|
AnnaFilterSearchedTextPipe,
|
|
161
189
|
AnnaBuyerApprovalIconTemplateComponent,
|
|
162
190
|
AnnaLiveIconTemplateComponent,
|
|
163
191
|
AnnaNotifyIconTemplateComponent,
|
|
164
192
|
AnnaPayForPerformanceIconTemplateComponent,
|
|
165
193
|
AnnaRejectedIconTemplateComponent,
|
|
166
|
-
|
|
194
|
+
showEllipsisTextOnHoverDirective,
|
|
195
|
+
AnnaIconColumnComponent] });
|
|
167
196
|
AnnaCoreSharedLibModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: AnnaCoreSharedLibModule, imports: [[
|
|
168
197
|
CommonModule
|
|
169
198
|
]] });
|
|
@@ -178,7 +207,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImpor
|
|
|
178
207
|
AnnaNotifyIconTemplateComponent,
|
|
179
208
|
AnnaPayForPerformanceIconTemplateComponent,
|
|
180
209
|
AnnaRejectedIconTemplateComponent,
|
|
181
|
-
|
|
210
|
+
showEllipsisTextOnHoverDirective,
|
|
211
|
+
AnnaIconColumnComponent,
|
|
182
212
|
],
|
|
183
213
|
imports: [
|
|
184
214
|
CommonModule
|
|
@@ -191,7 +221,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImpor
|
|
|
191
221
|
AnnaNotifyIconTemplateComponent,
|
|
192
222
|
AnnaPayForPerformanceIconTemplateComponent,
|
|
193
223
|
AnnaRejectedIconTemplateComponent,
|
|
194
|
-
|
|
224
|
+
showEllipsisTextOnHoverDirective,
|
|
225
|
+
AnnaIconColumnComponent
|
|
195
226
|
]
|
|
196
227
|
}]
|
|
197
228
|
}] });
|
|
@@ -503,36 +534,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImpor
|
|
|
503
534
|
}]
|
|
504
535
|
}], ctorParameters: function () { return []; } });
|
|
505
536
|
|
|
506
|
-
class TooltipModel {
|
|
507
|
-
constructor(obj, id) {
|
|
508
|
-
this.label = obj ? obj.toString() : null;
|
|
509
|
-
this.value = obj;
|
|
510
|
-
this.isSelected = false;
|
|
511
|
-
this.id = id;
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
class tooltipModelForColumnLevelFiltering {
|
|
515
|
-
constructor(data) {
|
|
516
|
-
this.data = data;
|
|
517
|
-
this.isSelected = true;
|
|
518
|
-
this.isHidden = false;
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
class radioButtonModel {
|
|
522
|
-
constructor(key, value, sort, filter) {
|
|
523
|
-
this.key = key;
|
|
524
|
-
this.label = value;
|
|
525
|
-
this.isSortRequired = sort;
|
|
526
|
-
this.isFilterRequired = filter;
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
var AllSelectedStatus;
|
|
530
|
-
(function (AllSelectedStatus) {
|
|
531
|
-
AllSelectedStatus[AllSelectedStatus["none"] = 0] = "none";
|
|
532
|
-
AllSelectedStatus[AllSelectedStatus["allSelected"] = 1] = "allSelected";
|
|
533
|
-
AllSelectedStatus[AllSelectedStatus["fewSelected"] = 2] = "fewSelected";
|
|
534
|
-
})(AllSelectedStatus || (AllSelectedStatus = {}));
|
|
535
|
-
|
|
536
537
|
// Angular import statements
|
|
537
538
|
// Third party import statements
|
|
538
539
|
// User defined import statements
|
|
@@ -683,6 +684,7 @@ class AnnaFilterService {
|
|
|
683
684
|
this.tooltipSelectedMap = new Map();
|
|
684
685
|
this.appliedFiltersArray = [];
|
|
685
686
|
this.sliderCurrencySet = new Set(["booked", "cpp", "cpm", "rcvPreempt", "osPreempt", "postedAdu", "scheduledAdu", "audienceDeficit", "Rate"]);
|
|
687
|
+
this.isFilterSortActive = null;
|
|
686
688
|
this.percentTranslateFunction = (data) => {
|
|
687
689
|
const val = data.toFixed(1) + "%";
|
|
688
690
|
return val;
|
|
@@ -775,42 +777,6 @@ class AnnaFilterService {
|
|
|
775
777
|
this.annaSortService.columnSortState.set(this.selectedRadio, "DEFAULT");
|
|
776
778
|
}
|
|
777
779
|
}
|
|
778
|
-
populateSliderTooltip(completeData, filteredData) {
|
|
779
|
-
let minValue;
|
|
780
|
-
let maxValue;
|
|
781
|
-
if (this.appliedFiltersArray.length > 0 &&
|
|
782
|
-
this.appliedFiltersArray[this.appliedFiltersArray.length - 1] === this.selectedRadio) {
|
|
783
|
-
let subsetData;
|
|
784
|
-
let subfilterApplied = false;
|
|
785
|
-
//applying all filterexcept the current filter
|
|
786
|
-
if (this.selectedRadio === "postedAdu" && this.tooltipSelectedMap.has("isAudRequired")) {
|
|
787
|
-
this.tooltipSelectedMap.delete("isAudRequired");
|
|
788
|
-
subfilterApplied = true;
|
|
789
|
-
}
|
|
790
|
-
subsetData = this.filterData(completeData, this.selectedRadio);
|
|
791
|
-
//need to find min and max value for
|
|
792
|
-
minValue = this.returnMaxAndMinValue(subsetData, this.selectedRadio, true);
|
|
793
|
-
maxValue = this.returnMaxAndMinValue(subsetData, this.selectedRadio, false);
|
|
794
|
-
if (this.selectedRadio === "postedAdu" && subfilterApplied) {
|
|
795
|
-
this.tooltipSelectedMap.set("isAudRequired", [false]);
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
else {
|
|
799
|
-
minValue = this.returnMaxAndMinValue(filteredData, this.selectedRadio, true);
|
|
800
|
-
maxValue = this.returnMaxAndMinValue(filteredData, this.selectedRadio, false);
|
|
801
|
-
}
|
|
802
|
-
this.ngxSliderObj = this.setOptionValues(minValue, maxValue);
|
|
803
|
-
if (this.translateFunc === "normal") {
|
|
804
|
-
this.ngxSliderObj.translate = this.normalTranslateFunction;
|
|
805
|
-
}
|
|
806
|
-
else if (this.translateFunc === "percent") {
|
|
807
|
-
this.ngxSliderObj.translate = this.percentTranslateFunction;
|
|
808
|
-
}
|
|
809
|
-
else if (this.translateFunc === "currency") {
|
|
810
|
-
this.ngxSliderObj.translate = this.currencyTranslateFunction;
|
|
811
|
-
}
|
|
812
|
-
return this.ngxSliderObj;
|
|
813
|
-
}
|
|
814
780
|
setOptionValues(minValue, maxValue) {
|
|
815
781
|
return {
|
|
816
782
|
floor: minValue,
|
|
@@ -819,121 +785,6 @@ class AnnaFilterService {
|
|
|
819
785
|
translate: this.normalTranslateFunction
|
|
820
786
|
};
|
|
821
787
|
}
|
|
822
|
-
populateTooltip(selectedColumnName, completeData, filteredData) {
|
|
823
|
-
let tooltipData;
|
|
824
|
-
if (this.appliedFiltersArray.length === 0) {
|
|
825
|
-
tooltipData = this.populateTooltipDataBasedOnSelectedRadio([selectedColumnName], completeData);
|
|
826
|
-
tooltipData.forEach((item) => (item.isHidden = false));
|
|
827
|
-
}
|
|
828
|
-
else if (selectedColumnName === this.appliedFiltersArray[this.appliedFiltersArray.length - 1]) {
|
|
829
|
-
let subsetData = this.filterData(completeData, selectedColumnName); //filter the data without applying the latest filter
|
|
830
|
-
tooltipData = this.showHideFilterCheckbox(subsetData, selectedColumnName);
|
|
831
|
-
}
|
|
832
|
-
else {
|
|
833
|
-
//if it is not the latest filter
|
|
834
|
-
//then filtered Data will be used
|
|
835
|
-
//create the option data
|
|
836
|
-
if (!this.tooltipMap.has(selectedColumnName)) {
|
|
837
|
-
this.populateTooltipDataBasedOnSelectedRadio([selectedColumnName], completeData);
|
|
838
|
-
}
|
|
839
|
-
tooltipData = this.showHideFilterCheckbox(filteredData, selectedColumnName);
|
|
840
|
-
}
|
|
841
|
-
return tooltipData;
|
|
842
|
-
}
|
|
843
|
-
populateTooltipDataBasedOnSelectedRadio(value, originalData) {
|
|
844
|
-
//if the initial tooltip data is already present fetch from the map
|
|
845
|
-
if (this.tooltipMap.has(value[0])) {
|
|
846
|
-
return this.tooltipMap.get(value[0]);
|
|
847
|
-
}
|
|
848
|
-
else {
|
|
849
|
-
//get the unique values from the column and save it in the map
|
|
850
|
-
this.selectedRadio = value[0];
|
|
851
|
-
const data = sortBy(originalData.map((u) => u[this.selectedRadio])).filter((n) => n !== null); //sorting the data in alphabetical order
|
|
852
|
-
const dataSet = new Set(data); //created a set from the data
|
|
853
|
-
const toolTipdata = [...dataSet].map((x) => new tooltipModelForColumnLevelFiltering(x));
|
|
854
|
-
this.tooltipMap.set(value[0], toolTipdata); //setting the key value pair in the tooltipMap
|
|
855
|
-
this.tooltipSelectedMap.set(value[0], map(toolTipdata, "data")); //setting the key value pair in tooltipSelectedMap
|
|
856
|
-
return toolTipdata;
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
showHideFilterCheckbox(arr, selectedColumnName) {
|
|
860
|
-
let currentSubsetData = uniq(arr.map((u) => u[selectedColumnName]));
|
|
861
|
-
//get the initial tooltip Data
|
|
862
|
-
let tooltipData = this.tooltipMap.get(selectedColumnName);
|
|
863
|
-
//show or hide the value
|
|
864
|
-
tooltipData.forEach((value) => {
|
|
865
|
-
//if the element is not present then hide the element
|
|
866
|
-
let elementToFindIndex = currentSubsetData.findIndex((n) => n === value.data);
|
|
867
|
-
if (elementToFindIndex === -1) {
|
|
868
|
-
value.isHidden = true;
|
|
869
|
-
}
|
|
870
|
-
else {
|
|
871
|
-
//show the element
|
|
872
|
-
value.isHidden = false;
|
|
873
|
-
}
|
|
874
|
-
});
|
|
875
|
-
return tooltipData;
|
|
876
|
-
}
|
|
877
|
-
isAllOptionsSelected() {
|
|
878
|
-
let allSelected;
|
|
879
|
-
let totalOptionsCount = this.tooltipMap.get(this.selectedRadio).filter((x) => !x.isHidden).length;
|
|
880
|
-
let selectedOptionsCount = this.tooltipMap.get(this.selectedRadio).filter((x) => !x.isHidden && x.isSelected).length;
|
|
881
|
-
if (selectedOptionsCount === 0) {
|
|
882
|
-
allSelected = AllSelectedStatus.none;
|
|
883
|
-
}
|
|
884
|
-
else if (selectedOptionsCount > 0 && selectedOptionsCount < totalOptionsCount) {
|
|
885
|
-
allSelected = AllSelectedStatus.fewSelected;
|
|
886
|
-
}
|
|
887
|
-
else {
|
|
888
|
-
allSelected = AllSelectedStatus.allSelected;
|
|
889
|
-
}
|
|
890
|
-
return allSelected;
|
|
891
|
-
}
|
|
892
|
-
populateDatePickerTooltipWithData(completeData, filteredData) {
|
|
893
|
-
let enabledDates;
|
|
894
|
-
//some filter is applied and the latest filter is the date filter
|
|
895
|
-
if (this.appliedFiltersArray.length > 0 &&
|
|
896
|
-
this.appliedFiltersArray[this.appliedFiltersArray.length - 1] === this.selectedRadio) {
|
|
897
|
-
let subsetData;
|
|
898
|
-
//applying all filterexcept thec current filter
|
|
899
|
-
if (this.selectedRadio === "period") {
|
|
900
|
-
subsetData = this.filterData(completeData, "period");
|
|
901
|
-
let minStartDate = this.returnMinAndMaxDate(subsetData, "startDate");
|
|
902
|
-
let maxEndDate = this.returnMinAndMaxDate(subsetData, "endDate");
|
|
903
|
-
enabledDates = { minStartDate: minStartDate[0], maxEndDate: maxEndDate[1] };
|
|
904
|
-
}
|
|
905
|
-
else if (this.selectedRadio === "AirDate" || this.selectedRadio === "flightStartDate" ||
|
|
906
|
-
this.selectedRadio === "flightEndDate" || this.selectedRadio == "date") {
|
|
907
|
-
subsetData = this.filterData(completeData, this.selectedRadio);
|
|
908
|
-
let minAndMaxDate = this.returnMinAndMaxDate(subsetData, this.selectedRadio);
|
|
909
|
-
enabledDates = { minStartDate: minAndMaxDate[0], maxEndDate: minAndMaxDate[1] };
|
|
910
|
-
}
|
|
911
|
-
else {
|
|
912
|
-
subsetData = this.filterData(completeData, this.selectedRadio);
|
|
913
|
-
//need to find min and max date for start and end date
|
|
914
|
-
//enabledDates is an arr of minDate and maxDate
|
|
915
|
-
enabledDates = this.returnMinAndMaxDate(subsetData, this.selectedRadio);
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
else {
|
|
919
|
-
if (this.selectedRadio === "period") {
|
|
920
|
-
let minStartDate = this.returnMinAndMaxDate(filteredData, "startDate");
|
|
921
|
-
let maxEndDate = this.returnMinAndMaxDate(filteredData, "endDate");
|
|
922
|
-
enabledDates = { minStartDate: minStartDate[0], maxEndDate: maxEndDate[1] };
|
|
923
|
-
}
|
|
924
|
-
else if (this.selectedRadio === "AirDate" || this.selectedRadio === "flightStartDate" ||
|
|
925
|
-
this.selectedRadio === "flightEndDate" || this.selectedRadio == "date") {
|
|
926
|
-
let minAndMaxDate = this.returnMinAndMaxDate(filteredData, this.selectedRadio);
|
|
927
|
-
enabledDates = { minStartDate: minAndMaxDate[0], maxEndDate: minAndMaxDate[1] };
|
|
928
|
-
}
|
|
929
|
-
else {
|
|
930
|
-
//need to find min and max date for start and end date.
|
|
931
|
-
// enabledDates is an arr of minDate and maxDate
|
|
932
|
-
enabledDates = this.returnMinAndMaxDate(filteredData, this.selectedRadio);
|
|
933
|
-
}
|
|
934
|
-
}
|
|
935
|
-
return enabledDates;
|
|
936
|
-
}
|
|
937
788
|
findUniqueDatesWithData(data) {
|
|
938
789
|
let uniqueDates = uniq(data.map((u) => u["date"]));
|
|
939
790
|
let uniqueDatesInNgbDateFormat = [];
|
|
@@ -942,33 +793,6 @@ class AnnaFilterService {
|
|
|
942
793
|
});
|
|
943
794
|
return uniqueDatesInNgbDateFormat;
|
|
944
795
|
}
|
|
945
|
-
isCheckboxSelected(selectedData) {
|
|
946
|
-
selectedData.isSelected = !selectedData.isSelected;
|
|
947
|
-
let allSelected = this.isAllOptionsSelected();
|
|
948
|
-
return allSelected;
|
|
949
|
-
}
|
|
950
|
-
allOptionsClicked(status) {
|
|
951
|
-
let header = this.selectedRadio;
|
|
952
|
-
if (status === 1) {
|
|
953
|
-
this.tooltipMap.get(header).forEach((item) => {
|
|
954
|
-
if (!item.isHidden) {
|
|
955
|
-
item.isSelected = true;
|
|
956
|
-
}
|
|
957
|
-
});
|
|
958
|
-
this.tooltipSelectedMap.set(header, this.tooltipMap
|
|
959
|
-
.get(header)
|
|
960
|
-
.filter((x) => x.isSelected)
|
|
961
|
-
.map((x) => x.data));
|
|
962
|
-
}
|
|
963
|
-
else {
|
|
964
|
-
this.tooltipMap.get(header).forEach((item) => {
|
|
965
|
-
if (!item.isHidden) {
|
|
966
|
-
item.isSelected = false;
|
|
967
|
-
}
|
|
968
|
-
});
|
|
969
|
-
this.tooltipSelectedMap.delete(header);
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
796
|
reOrderAppliedFiltersArray(isHierarchialUserFiltered, date) {
|
|
973
797
|
let isFiltered = true;
|
|
974
798
|
isFiltered = this.checkIfDataIsFiltered(isFiltered, isHierarchialUserFiltered, date);
|
|
@@ -1100,17 +924,7 @@ class AnnaFilterService {
|
|
|
1100
924
|
if (!selectedData.includeTimeRange) {
|
|
1101
925
|
return false;
|
|
1102
926
|
}
|
|
1103
|
-
// objTime = this.dateTimeFormatService.formatToTwelveHrs(objTime, true);
|
|
1104
|
-
// objTime = this.dateTimeFormatService.convertTotwentyFourHrsFormat(
|
|
1105
|
-
// objTime[0] + ":" + objTime[1] + " " + objTime[2],
|
|
1106
|
-
// true
|
|
1107
|
-
// );
|
|
1108
|
-
// objTime = objTime[0] + ":" + objTime[1] + ":00";
|
|
1109
|
-
// objTime = moment(objTime, format);
|
|
1110
927
|
let momentTime = moment(objTime, format);
|
|
1111
|
-
console.log(momentTime);
|
|
1112
|
-
console.log(selectedFromTime);
|
|
1113
|
-
console.log(selectedToTime);
|
|
1114
928
|
let isObjTimeSameAsSelectedFromTime = momentTime.isSame(selectedFromTime);
|
|
1115
929
|
let isObjTimeSameAsSelectedToTime = momentTime.isSame(selectedToTime);
|
|
1116
930
|
let isObjTimeBetweenSelectedFromTimeAndToTime = momentTime.isBetween(selectedFromTime, selectedToTime);
|
|
@@ -1156,7 +970,6 @@ class AnnaFilterService {
|
|
|
1156
970
|
let momentEndDate = moment(obj.endDate);
|
|
1157
971
|
let startDateIsBetweenSelDate = momentStartDate.isBetween(value.fromDate, value.toDate);
|
|
1158
972
|
let endDateIsBetweenSelDate = momentEndDate.isBetween(value.fromDate, value.toDate);
|
|
1159
|
-
console.log(moment(obj.startDate, parsingFormat));
|
|
1160
973
|
let startDateIsSameAsSelStartDate = value.fromDate.isSame(momentStartDate);
|
|
1161
974
|
let endDateIsSameAsSelEndDate = value.toDate.isSame(momentEndDate);
|
|
1162
975
|
return ((startDateIsBetweenSelDate || startDateIsSameAsSelStartDate) &&
|
|
@@ -1195,8 +1008,6 @@ class AnnaFilterService {
|
|
|
1195
1008
|
}
|
|
1196
1009
|
getFilterOptionsData(data, clonedData) {
|
|
1197
1010
|
let appliedFilterSet = new Set(this.appliedFiltersArray);
|
|
1198
|
-
console.log("appliedFilterSet");
|
|
1199
|
-
console.log(appliedFilterSet);
|
|
1200
1011
|
if (appliedFilterSet.has(this.selectedRadio)) {
|
|
1201
1012
|
return this.filterData(clonedData, this.selectedRadio);
|
|
1202
1013
|
}
|
|
@@ -1242,13 +1053,27 @@ class AnnaFilterService {
|
|
|
1242
1053
|
isObjectInTheRange(obj, value, key) {
|
|
1243
1054
|
let objVal = obj[key];
|
|
1244
1055
|
let momentDate = moment(objVal);
|
|
1245
|
-
console.log(objVal);
|
|
1246
|
-
console.log(value.fromDate);
|
|
1247
1056
|
let isDateSameAsStartOfTheRange = value.fromDate.isSame(objVal);
|
|
1248
1057
|
let isDateSameAsEndOfTheRange = value.toDate.isSame(objVal);
|
|
1249
1058
|
let isDateBetweenTheStartAndEndOfRange = momentDate.isBetween(value.fromDate, value.toDate);
|
|
1250
1059
|
return isDateSameAsStartOfTheRange || isDateSameAsEndOfTheRange || isDateBetweenTheStartAndEndOfRange;
|
|
1251
1060
|
}
|
|
1061
|
+
updateStateOfTheCurrentFilterTab(sortMap) {
|
|
1062
|
+
let activeKey = this.selectedRadio;
|
|
1063
|
+
let keyArr = [];
|
|
1064
|
+
Object.keys(this.isFilterSortActive).forEach(key => {
|
|
1065
|
+
if (key.includes(activeKey)) {
|
|
1066
|
+
keyArr = key.split(",");
|
|
1067
|
+
this.isFilterSortActive[key] = this.isTooltipActive(keyArr, sortMap);
|
|
1068
|
+
}
|
|
1069
|
+
});
|
|
1070
|
+
}
|
|
1071
|
+
updateStateOfAllTheKeys(sortMap) {
|
|
1072
|
+
Object.keys(this.isFilterSortActive).forEach(key => {
|
|
1073
|
+
let keyArr = key.split(",");
|
|
1074
|
+
this.isFilterSortActive[key] = this.isTooltipActive(keyArr, sortMap);
|
|
1075
|
+
});
|
|
1076
|
+
}
|
|
1252
1077
|
}
|
|
1253
1078
|
AnnaFilterService.bufferSize = 20;
|
|
1254
1079
|
AnnaFilterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: AnnaFilterService, deps: [{ token: AnnaDateTimeFormatService }, { token: AnnaSortService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -1301,6 +1126,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImpor
|
|
|
1301
1126
|
|
|
1302
1127
|
;
|
|
1303
1128
|
|
|
1129
|
+
class TooltipModel {
|
|
1130
|
+
constructor(obj, id) {
|
|
1131
|
+
this.label = obj ? obj.toString() : null;
|
|
1132
|
+
this.value = obj;
|
|
1133
|
+
this.isSelected = false;
|
|
1134
|
+
this.id = id;
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
class tooltipModelForColumnLevelFiltering {
|
|
1138
|
+
constructor(data) {
|
|
1139
|
+
this.data = data;
|
|
1140
|
+
this.isSelected = true;
|
|
1141
|
+
this.isHidden = false;
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
class radioButtonModel {
|
|
1145
|
+
constructor(key, value, sort, filter) {
|
|
1146
|
+
this.key = key;
|
|
1147
|
+
this.label = value;
|
|
1148
|
+
this.isSortRequired = sort;
|
|
1149
|
+
this.isFilterRequired = filter;
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
var AllSelectedStatus;
|
|
1153
|
+
(function (AllSelectedStatus) {
|
|
1154
|
+
AllSelectedStatus[AllSelectedStatus["none"] = 0] = "none";
|
|
1155
|
+
AllSelectedStatus[AllSelectedStatus["allSelected"] = 1] = "allSelected";
|
|
1156
|
+
AllSelectedStatus[AllSelectedStatus["fewSelected"] = 2] = "fewSelected";
|
|
1157
|
+
})(AllSelectedStatus || (AllSelectedStatus = {}));
|
|
1158
|
+
|
|
1304
1159
|
class Constants {
|
|
1305
1160
|
}
|
|
1306
1161
|
Constants.SUCCESS_STRING = "success";
|
|
@@ -1341,5 +1196,5 @@ var Days;
|
|
|
1341
1196
|
* Generated bundle index. Do not edit.
|
|
1342
1197
|
*/
|
|
1343
1198
|
|
|
1344
|
-
export { AllSelectedStatus, AnnaBuyerApprovalIconTemplateComponent, AnnaCoreSharedLibModule, AnnaDateTimeFormatService, AnnaFilterSearchedTextPipe, AnnaFilterService, AnnaGenericTableService, AnnaGlobalConfigService, AnnaLiveIconTemplateComponent, AnnaNoDataComponent, AnnaNotifyIconTemplateComponent, AnnaPayForPerformanceIconTemplateComponent, AnnaRejectedIconTemplateComponent, AnnaSortService, Constants, Days, ErrorCodes,
|
|
1199
|
+
export { AllSelectedStatus, AnnaBuyerApprovalIconTemplateComponent, AnnaCoreSharedLibModule, AnnaDateTimeFormatService, AnnaFilterSearchedTextPipe, AnnaFilterService, AnnaGenericTableService, AnnaGlobalConfigService, AnnaIconColumnComponent, AnnaLiveIconTemplateComponent, AnnaNoDataComponent, AnnaNotifyIconTemplateComponent, AnnaPayForPerformanceIconTemplateComponent, AnnaRejectedIconTemplateComponent, AnnaSortService, Constants, Days, ErrorCodes, TooltipModel, radioButtonModel, showEllipsisTextOnHoverDirective, tooltipModelForColumnLevelFiltering };
|
|
1345
1200
|
//# sourceMappingURL=annalib-anna-core-src-lib-anna-core-shared-lib.mjs.map
|