igniteui-angular-extras 16.1.0 → 17.0.0

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.
Files changed (29) hide show
  1. package/esm2022/igniteui-angular-extras.mjs +4 -4
  2. package/esm2022/images/charts.mjs +17 -17
  3. package/esm2022/images/conditions.mjs +11 -11
  4. package/esm2022/lib/context-menu/chart-dialog/chart-dialog.component.mjs +67 -67
  5. package/esm2022/lib/context-menu/context-menu.component.mjs +176 -176
  6. package/esm2022/lib/context-menu/igx-context-menu.directive.mjs +154 -154
  7. package/esm2022/lib/directives/chart-integration/chart-integration.directive.mjs +312 -312
  8. package/esm2022/lib/directives/chart-integration/chart-types.mjs +27 -27
  9. package/esm2022/lib/directives/chart-integration/initializers.mjs +102 -102
  10. package/esm2022/lib/directives/conditional-formatting/conditional-formatting.directive.mjs +303 -303
  11. package/esm2022/lib/igniteui-angular-extras.module.mjs +107 -107
  12. package/esm2022/lib/pipes/svg.pipe.mjs +19 -19
  13. package/esm2022/public-api.mjs +20 -20
  14. package/fesm2022/igniteui-angular-extras.mjs +1228 -1228
  15. package/fesm2022/igniteui-angular-extras.mjs.map +1 -1
  16. package/images/charts.d.ts +16 -16
  17. package/images/conditions.d.ts +10 -10
  18. package/index.d.ts +5 -5
  19. package/lib/context-menu/chart-dialog/chart-dialog.component.d.ts +31 -31
  20. package/lib/context-menu/context-menu.component.d.ts +37 -37
  21. package/lib/context-menu/igx-context-menu.directive.d.ts +33 -33
  22. package/lib/directives/chart-integration/chart-integration.directive.d.ts +52 -52
  23. package/lib/directives/chart-integration/chart-types.d.ts +25 -25
  24. package/lib/directives/chart-integration/initializers.d.ts +39 -39
  25. package/lib/directives/conditional-formatting/conditional-formatting.directive.d.ts +95 -95
  26. package/lib/igniteui-angular-extras.module.d.ts +15 -15
  27. package/lib/pipes/svg.pipe.d.ts +10 -10
  28. package/package.json +6 -6
  29. package/public-api.d.ts +17 -17
@@ -1,16 +1,16 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Pipe, EventEmitter, ViewContainerRef, Component, ViewEncapsulation, ViewChild, Output, HostBinding, Directive, Input, Optional, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
3
3
  import * as i1$1 from 'igniteui-angular';
4
- import { CloseScrollStrategy, AutoPositionStrategy, HorizontalAlignment, VerticalAlignment, IgxToggleDirective, IgxTabsComponent, AbsoluteScrollStrategy, IgxButtonModule, IgxDividerModule, IgxGridModule, IgxTabsModule, IgxToggleModule, IgxIconModule } from 'igniteui-angular';
4
+ import { CloseScrollStrategy, HorizontalAlignment, VerticalAlignment, AutoPositionStrategy, IgxToggleDirective, IgxTabsComponent, AbsoluteScrollStrategy, IgxButtonModule, IgxDividerModule, IgxGridModule, IgxTabsModule, IgxToggleModule, IgxIconModule } from 'igniteui-angular';
5
5
  import { IgxCategoryXAxisComponent, IgxNumericYAxisComponent, IgxScatterLineSeriesComponent, IgxNumericXAxisComponent, IgxBubbleSeriesComponent, IgxScatterSeriesComponent, IgxBarSeriesComponent, IgxCategoryYAxisComponent, IgxStackedBarSeriesComponent, IgxStacked100BarSeriesComponent, IgxStackedFragmentSeriesComponent, IgxSizeScaleComponent, IgxColumnSeriesComponent, IgxAreaSeriesComponent, IgxLineSeriesComponent, IgxStackedColumnSeriesComponent, IgxStackedAreaSeriesComponent, IgxStackedLineSeriesComponent, IgxStacked100ColumnSeriesComponent, IgxStacked100AreaSeriesComponent, IgxStacked100LineSeriesComponent, IgxPieChartComponent, IgxDataChartComponent, IgxItemLegendComponent, IgxLegendComponent, IgxDataChartCategoryModule, IgxDataChartCoreModule, IgxLegendModule, IgxDataChartInteractivityModule, IgxNumericXAxisModule, IgxNumericYAxisModule, IgxCategoryXAxisModule, IgxItemLegendModule, IgxPieChartModule, IgxDataChartStackedModule, IgxDataChartScatterModule, IgxBarSeriesModule, IgxCategoryChartModule } from 'igniteui-angular-charts';
6
6
  import { Subject } from 'rxjs';
7
7
  import { ResizeObserver } from '@juggle/resize-observer';
8
8
  import * as i2 from '@angular/common';
9
9
  import { CommonModule } from '@angular/common';
10
10
  import * as i1 from '@angular/platform-browser';
11
- import { takeUntil, merge, debounceTime, filter } from 'rxjs/operators';
11
+ import { takeUntil, debounceTime, merge, filter } from 'rxjs/operators';
12
12
 
13
- // tslint:disable: max-line-length
13
+ // tslint:disable: max-line-length
14
14
  const Area100Stacked = `
15
15
  <svg id="Layer_1" data-name="Layer 1"
16
16
  xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
@@ -22,7 +22,7 @@ const Area100Stacked = `
22
22
  <path class="cls-Area100Stacked-3" d="M0,54V95.7H96V18.37l-3.79,6.51-3.79,18-3.16,6.51-5.68,3.06-2.84,3.45s-3.42,6-3.48,6.12-7.58,4.6-7.58,4.6L60,67l-2.21.77-7.9-4.6-3.78,1.15-7.58-3.44L34.42,62.4l-3.79-1.15-4.1,3.44-3.48-.76L15.16,53.21,7.26,54,3.47,49Z"/>
23
23
  <polygon class="cls-Area100Stacked-4" points="0 78.75 4.72 77.11 7.87 78.2 15.42 76.56 19.52 80.39 26.44 83.67 36.2 83.67 45.33 85.31 50.05 78.75 58.23 84.22 68.3 85.86 87.82 90.23 96 83.12 96 95.7 0 95.7 0 78.75"/>
24
24
  </svg>
25
- `;
25
+ `;
26
26
  const AreaGrouped = `
27
27
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
28
28
  <defs>
@@ -35,7 +35,7 @@ const AreaGrouped = `
35
35
  <polygon class="cls-AreaGrouped-4" points="96 93.77 96 77.49 80.22 81.31 64.11 91.54 48.34 93.13 32.56 94.09 0 95.37 0 96 96 96 96 93.77"/>
36
36
  </g>
37
37
  </svg>
38
- `;
38
+ `;
39
39
  const AreaStacked = `
40
40
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
41
41
  <defs>
@@ -48,7 +48,7 @@ const AreaStacked = `
48
48
  <polygon class="cls-AreaStacked-4" points="0.14 96 95.96 96 95.96 74.45 92.19 79.15 80.56 83.07 69.25 91.3 58.57 91.69 54.17 92.08 49.78 90.12 45.38 91.3 38.47 91.3 28.73 91.69 23.7 91.3 18.99 92.86 13.96 92.08 0.14 93.65 0.14 96"/>
49
49
  </g>
50
50
  </svg>
51
- `;
51
+ `;
52
52
  const Bar100Stacked = `
53
53
  <svg id="Layer_1" data-name="Layer 1"
54
54
  xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
@@ -61,7 +61,7 @@ const Bar100Stacked = `
61
61
  <path class="cls-Bar100Stacked-4" d="M14,34.61H0V46H14Zm4.25,13.72H0v11.1H18.29ZM15,75.1H0V86.2H15ZM22.2,21.22H0V32.33H22.2ZM11.43,61.71H0V72.82H11.43Z"/>
62
62
  <rect class="cls-Bar100Stacked-5" y="7.84" width="10.78" height="11.1"/>
63
63
  </svg>
64
- `;
64
+ `;
65
65
  const BarGrouped = `
66
66
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
67
67
  <defs>
@@ -82,7 +82,7 @@ const BarGrouped = `
82
82
  <rect class="cls-BarGrouped-4" y="28.47" width="33.43" height="6.29"/>
83
83
  </g>
84
84
  </svg>
85
- `;
85
+ `;
86
86
  const BarStacked = `
87
87
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
88
88
  <defs>
@@ -95,7 +95,7 @@ const BarStacked = `
95
95
  <path class="cls-BarStacked-4" d="M14.91,8.85H.16V19.66H14.91ZM27.36,22.28H.16V33.09h27.2ZM19.17,35.71H.16V46.85h19ZM15.56,49.47H.16V60.29h15.4ZM27.69,62.91H.16V73.72H27.69ZM16.22,76.34H.16V87.15H16.22Z"/>
96
96
  </g>
97
97
  </svg>
98
- `;
98
+ `;
99
99
  const Column100Stacked = `
100
100
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
101
101
  <defs>
@@ -108,7 +108,7 @@ const Column100Stacked = `
108
108
  <path class="cls-Column100Stacked-4" d="M32.88,82.11V96h13.8V82.11Zm16.44-4.45V96h13.8V77.66Zm32.87,3.41V96H96V81.07ZM16.44,73.73V96H30.25V73.73ZM65.75,84.47V96H79.56V84.47ZM0,85.08V96H13.81V85.08Z"/>
109
109
  </g>
110
110
  </svg>
111
- `;
111
+ `;
112
112
  const ColumnGrouped = `
113
113
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
114
114
  <defs>
@@ -129,7 +129,7 @@ const ColumnGrouped = `
129
129
  <rect class="cls-ColumnGrouped-3" x="88.56" y="63.21" width="7.44" height="32.79"/>
130
130
  </g>
131
131
  </svg>
132
- `;
132
+ `;
133
133
  const ColumnStacked = `
134
134
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
135
135
  <defs>
@@ -142,7 +142,7 @@ const ColumnStacked = `
142
142
  <path class="cls-ColumnStacked-4" d="M16.44,71.72V96H30.25V71.72Zm49.31,1.51V96H79.56V73.23ZM32.88,77V96h13.8V77Zm16.44,3.79V96h13.8V80.82Zm32.87,3V96H96V83.86ZM0,81.2V96H13.81V81.2Z"/>
143
143
  </g>
144
144
  </svg>
145
- `;
145
+ `;
146
146
  const Line100Stacked = `
147
147
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
148
148
  <defs>
@@ -155,7 +155,7 @@ const Line100Stacked = `
155
155
  <polyline class="cls-Line100Stacked-4" points="0 85.81 17.34 78.52 59.39 88.12 80.78 76.87 96 82.48"/>
156
156
  </g>
157
157
  </svg>
158
- `;
158
+ `;
159
159
  const LineGrouped = `
160
160
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
161
161
  <defs>
@@ -168,7 +168,7 @@ const LineGrouped = `
168
168
  <polyline class="cls-LineGrouped-4" points="0 92.26 14.7 90.69 19.9 92.1 24.93 90.03 30.13 91.1 47.13 90.78 51.72 89.12 56.75 90.69 71.06 90.11 83.63 83.1 96 79.33"/>
169
169
  </g>
170
170
  </svg>
171
- `;
171
+ `;
172
172
  const LineStacked = `
173
173
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
174
174
  <defs>
@@ -181,7 +181,7 @@ const LineStacked = `
181
181
  <polyline class="cls-LineStacked-4" points="0 96 31.16 90.78 64.95 88.38 82.19 77.78 96 74.53"/>
182
182
  </g>
183
183
  </svg>
184
- `;
184
+ `;
185
185
  const Pie = `
186
186
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
187
187
  <defs>
@@ -194,7 +194,7 @@ const Pie = `
194
194
  <path class="cls-Pie-4" d="M44.19,48,84.24,29.52a43.13,43.13,0,0,0-40-25.73Z"/>
195
195
  </g>
196
196
  </svg>
197
- `;
197
+ `;
198
198
  const ScatterBubble = `
199
199
  <svg id="Layer_1" data-name="Layer 1"
200
200
  xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
@@ -250,7 +250,7 @@ const ScatterBubble = `
250
250
  <circle class="cls-ScatterBubble-1" cx="28.24" cy="74.55" r="5.06"/>
251
251
  <circle class="cls-ScatterBubble-2" cx="57.02" cy="22.04" r="4.28"/>
252
252
  </svg>
253
- `;
253
+ `;
254
254
  const ScatterLine = `
255
255
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
256
256
  <defs>
@@ -311,7 +311,7 @@ const ScatterLine = `
311
311
  <circle class="cls-ScatterLine-6" cx="88.32" cy="6.59" r="1.5"/>
312
312
  </g>
313
313
  </svg>
314
- `;
314
+ `;
315
315
  const ScatterPoint = `
316
316
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96">
317
317
  <defs>
@@ -438,83 +438,83 @@ var charts = /*#__PURE__*/Object.freeze({
438
438
  ScatterPoint: ScatterPoint
439
439
  });
440
440
 
441
- class SvgPipe {
442
- constructor(sanitizer) {
443
- this.sanitizer = sanitizer;
444
- }
445
- transform(markup) {
446
- return this.sanitizer.bypassSecurityTrustHtml(markup);
447
- }
448
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: SvgPipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe }); }
449
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.5", ngImport: i0, type: SvgPipe, name: "svg" }); }
450
- }
451
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: SvgPipe, decorators: [{
452
- type: Pipe,
453
- args: [{
454
- name: 'svg'
455
- }]
456
- }], ctorParameters: function () { return [{ type: i1.DomSanitizer }]; } });
441
+ class SvgPipe {
442
+ constructor(sanitizer) {
443
+ this.sanitizer = sanitizer;
444
+ }
445
+ transform(markup) {
446
+ return this.sanitizer.bypassSecurityTrustHtml(markup);
447
+ }
448
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: SvgPipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe }); }
449
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.0.0", ngImport: i0, type: SvgPipe, name: "svg" }); }
450
+ }
451
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: SvgPipe, decorators: [{
452
+ type: Pipe,
453
+ args: [{
454
+ name: 'svg'
455
+ }]
456
+ }], ctorParameters: () => [{ type: i1.DomSanitizer }] });
457
457
 
458
- class IgxChartMenuComponent {
459
- get width() {
460
- return this.fullScreen ? this._width : 0.7 * this._width;
461
- }
462
- set width(value) {
463
- this._width = value;
464
- }
465
- get height() {
466
- return this.fullScreen ? this._height : 0.7 * this._height;
467
- }
468
- set height(value) {
469
- this._height = value;
470
- }
471
- constructor(element) {
472
- this.element = element;
473
- this.onClose = new EventEmitter();
474
- this.chartDialogResizeNotify = new Subject();
475
- this.allCharts = [];
476
- this.fullScreen = false;
477
- this.isConfigAreaExpanded = false;
478
- this.mainChartTypes = ['Column', 'Area', 'Bar', 'Line', 'Scatter', 'Pie'];
479
- this.images = charts;
480
- }
481
- ngAfterViewInit() {
482
- this.contentObserver = new ResizeObserver((args) => this.chartDialogResizeNotify.next(args));
483
- this.contentObserver.observe(this.element.nativeElement);
484
- this.createChart(this.currentChartType);
485
- }
486
- toggleFullScreen() {
487
- this.fullScreen = !this.fullScreen;
488
- }
489
- hasAvailableChart(chartType) {
490
- return this.allCharts.some(c => c.includes(chartType));
491
- }
492
- createChart(chartType) {
493
- this.currentChartType = chartType;
494
- this.title = chartType.split(/(?=[A-Z])/).toString().replace(',', ' ');
495
- this.chartArea.clear();
496
- this.chartDirective.chartFactory(chartType, this.chartArea);
497
- }
498
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: IgxChartMenuComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
499
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.5", type: IgxChartMenuComponent, selector: "igx-chart-menu", outputs: { onClose: "onClose" }, host: { properties: { "style.width.px": "this.width", "style.height.px": "this.height" } }, viewQueries: [{ propertyName: "chartArea", first: true, predicate: ["chartArea"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div class=\"header\">\r\n <span class=\"header-text\">\r\n {{ title }} Chart\r\n </span>\r\n <span class=\"action-buttons-wrapper\">\r\n <button igxButton=\"icon\" (click)=\"toggleFullScreen()\">\r\n <igx-icon class=\"material\">fullscreen{{fullScreen ? '_exit' : ''}}</igx-icon>\r\n </button>\r\n <button igxButton=\"icon\" (click)=\"onClose.emit()\">\r\n <igx-icon class=\"material\">close</igx-icon>\r\n </button>\r\n </span>\r\n</div>\r\n<div class=\"selection-area ig-scrollbar\">\r\n <igc-trial-watermark></igc-trial-watermark>\r\n <div class=\"chart-area\" [ngClass]=\"{'expanded': isConfigAreaExpanded}\">\r\n <ng-template #chartArea ></ng-template>\r\n </div>\r\n <div>\r\n <button igxButton=\"icon\" igxRipple (click)=\"isConfigAreaExpanded = !isConfigAreaExpanded\">\r\n <igx-icon family=\"material\">chevron_{{ isConfigAreaExpanded ? 'left': 'right'}}</igx-icon>\r\n </button>\r\n </div>\r\n <div #configArea [ngClass]=\"{'chart-config-area': true, 'opened': !isConfigAreaExpanded, 'closed': isConfigAreaExpanded }\">\r\n <div class=\"config-area-header\">\r\n <span>Chart Types</span>\r\n </div>\r\n <igx-divider class=\"divider\"></igx-divider>\r\n <div class=\"wrapper\" *ngFor=\"let chartType of mainChartTypes\">\r\n <ng-container *ngIf=\"hasAvailableChart(chartType)\">\r\n <div>{{chartType | titlecase}} Chart</div>\r\n <div class=\"types-section\">\r\n <ng-container *ngFor=\"let chart of allCharts\">\r\n <span *ngIf=\"chart.startsWith(chartType)\" class=\"types-section-btn\" title=\"{{chart}}\"\r\n [ngClass]=\"{'selected': chart === currentChartType}\" (click)=\"createChart(chart)\">\r\n <div [innerHTML]=\"images[chart] | svg\">\r\n </div>\r\n </span>\r\n </ng-container>\r\n </div>\r\n <igx-divider></igx-divider>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".ig-chart-legend-items-list{height:20%;display:inline-flex;flex-wrap:wrap;margin-bottom:1rem}igx-chart-menu{display:flex;flex-flow:column;overflow:hidden;background-color:#fff;transition:width .2s ease-in-out,height .3s ease-in-out}.header{height:10%;background-color:#e0e0e0;display:flex;font-size:1.8rem}.header .action-buttons-wrapper{margin-left:auto;margin-right:10px;align-self:center}.header .header-text{margin-right:auto;align-self:center;margin-left:3rem}.selection-area{width:100%;height:90%;display:inline-flex;flex-flow:row}.selection-area,.selection-area .ig-scrollbar{--scrollbar-size: var(--ig-scrollbar-scrollbar-size, 8px);--thumb-background: var(--ig-scrollbar-thumb-background, hsla(var(--ig-gray-400), var(--ig-gray-a)));--track-background: var(--ig-scrollbar-track-background, hsla(var(--ig-gray-100), var(--ig-gray-a)))}.selection-area .chart-area{margin-top:1rem;overflow-y:hidden;overflow-x:hidden;width:100%}.selection-area .chart-config-area{transition:all;transition-duration:.3s;transition-timing-function:ease-in-out}.selection-area .chart-config-area.opened{width:25%;overflow-y:auto;overflow-x:hidden}.selection-area .chart-config-area.closed{width:0;transform:translate(100%)}.selection-area .chart-config-area .config-area-header{margin-bottom:3px;font-size:1rem;font-weight:700;text-align:center}.selection-area .chart-config-area .types-section-btn{width:40%;margin-right:5px;cursor:pointer}.selection-area .chart-config-area .types-section-btn.selected{opacity:.5}.selection-area .wrapper{padding:3px}.selection-area .wrapper .types-section{display:flex;flex-wrap:wrap}.selection-area .wrapper .igx-divider{margin:5px!important;background:black!important}\n"], dependencies: [{ kind: "directive", type: i1$1.IgxButtonDirective, selector: "[igxButton]", inputs: ["selected", "igxButton", "igxButtonColor", "igxButtonBackground", "igxLabel", "disabled"], outputs: ["buttonClick", "buttonSelected"] }, { kind: "directive", type: i1$1.IgxDividerDirective, selector: "igx-divider", inputs: ["id", "role", "type", "middle", "vertical", "inset"] }, { kind: "component", type: i1$1.IgxIconComponent, selector: "igx-icon", inputs: ["family", "active", "name"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.TitleCasePipe, name: "titlecase" }, { kind: "pipe", type: SvgPipe, name: "svg" }], encapsulation: i0.ViewEncapsulation.None }); }
500
- }
501
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: IgxChartMenuComponent, decorators: [{
502
- type: Component,
503
- args: [{ selector: 'igx-chart-menu', encapsulation: ViewEncapsulation.None, template: "<div class=\"header\">\r\n <span class=\"header-text\">\r\n {{ title }} Chart\r\n </span>\r\n <span class=\"action-buttons-wrapper\">\r\n <button igxButton=\"icon\" (click)=\"toggleFullScreen()\">\r\n <igx-icon class=\"material\">fullscreen{{fullScreen ? '_exit' : ''}}</igx-icon>\r\n </button>\r\n <button igxButton=\"icon\" (click)=\"onClose.emit()\">\r\n <igx-icon class=\"material\">close</igx-icon>\r\n </button>\r\n </span>\r\n</div>\r\n<div class=\"selection-area ig-scrollbar\">\r\n <igc-trial-watermark></igc-trial-watermark>\r\n <div class=\"chart-area\" [ngClass]=\"{'expanded': isConfigAreaExpanded}\">\r\n <ng-template #chartArea ></ng-template>\r\n </div>\r\n <div>\r\n <button igxButton=\"icon\" igxRipple (click)=\"isConfigAreaExpanded = !isConfigAreaExpanded\">\r\n <igx-icon family=\"material\">chevron_{{ isConfigAreaExpanded ? 'left': 'right'}}</igx-icon>\r\n </button>\r\n </div>\r\n <div #configArea [ngClass]=\"{'chart-config-area': true, 'opened': !isConfigAreaExpanded, 'closed': isConfigAreaExpanded }\">\r\n <div class=\"config-area-header\">\r\n <span>Chart Types</span>\r\n </div>\r\n <igx-divider class=\"divider\"></igx-divider>\r\n <div class=\"wrapper\" *ngFor=\"let chartType of mainChartTypes\">\r\n <ng-container *ngIf=\"hasAvailableChart(chartType)\">\r\n <div>{{chartType | titlecase}} Chart</div>\r\n <div class=\"types-section\">\r\n <ng-container *ngFor=\"let chart of allCharts\">\r\n <span *ngIf=\"chart.startsWith(chartType)\" class=\"types-section-btn\" title=\"{{chart}}\"\r\n [ngClass]=\"{'selected': chart === currentChartType}\" (click)=\"createChart(chart)\">\r\n <div [innerHTML]=\"images[chart] | svg\">\r\n </div>\r\n </span>\r\n </ng-container>\r\n </div>\r\n <igx-divider></igx-divider>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".ig-chart-legend-items-list{height:20%;display:inline-flex;flex-wrap:wrap;margin-bottom:1rem}igx-chart-menu{display:flex;flex-flow:column;overflow:hidden;background-color:#fff;transition:width .2s ease-in-out,height .3s ease-in-out}.header{height:10%;background-color:#e0e0e0;display:flex;font-size:1.8rem}.header .action-buttons-wrapper{margin-left:auto;margin-right:10px;align-self:center}.header .header-text{margin-right:auto;align-self:center;margin-left:3rem}.selection-area{width:100%;height:90%;display:inline-flex;flex-flow:row}.selection-area,.selection-area .ig-scrollbar{--scrollbar-size: var(--ig-scrollbar-scrollbar-size, 8px);--thumb-background: var(--ig-scrollbar-thumb-background, hsla(var(--ig-gray-400), var(--ig-gray-a)));--track-background: var(--ig-scrollbar-track-background, hsla(var(--ig-gray-100), var(--ig-gray-a)))}.selection-area .chart-area{margin-top:1rem;overflow-y:hidden;overflow-x:hidden;width:100%}.selection-area .chart-config-area{transition:all;transition-duration:.3s;transition-timing-function:ease-in-out}.selection-area .chart-config-area.opened{width:25%;overflow-y:auto;overflow-x:hidden}.selection-area .chart-config-area.closed{width:0;transform:translate(100%)}.selection-area .chart-config-area .config-area-header{margin-bottom:3px;font-size:1rem;font-weight:700;text-align:center}.selection-area .chart-config-area .types-section-btn{width:40%;margin-right:5px;cursor:pointer}.selection-area .chart-config-area .types-section-btn.selected{opacity:.5}.selection-area .wrapper{padding:3px}.selection-area .wrapper .types-section{display:flex;flex-wrap:wrap}.selection-area .wrapper .igx-divider{margin:5px!important;background:black!important}\n"] }]
504
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { chartArea: [{
505
- type: ViewChild,
506
- args: ['chartArea', { read: ViewContainerRef }]
507
- }], onClose: [{
508
- type: Output
509
- }], width: [{
510
- type: HostBinding,
511
- args: ['style.width.px']
512
- }], height: [{
513
- type: HostBinding,
514
- args: ['style.height.px']
458
+ class IgxChartMenuComponent {
459
+ get width() {
460
+ return this.fullScreen ? this._width : 0.7 * this._width;
461
+ }
462
+ set width(value) {
463
+ this._width = value;
464
+ }
465
+ get height() {
466
+ return this.fullScreen ? this._height : 0.7 * this._height;
467
+ }
468
+ set height(value) {
469
+ this._height = value;
470
+ }
471
+ constructor(element) {
472
+ this.element = element;
473
+ this.onClose = new EventEmitter();
474
+ this.chartDialogResizeNotify = new Subject();
475
+ this.allCharts = [];
476
+ this.fullScreen = false;
477
+ this.isConfigAreaExpanded = false;
478
+ this.mainChartTypes = ['Column', 'Area', 'Bar', 'Line', 'Scatter', 'Pie'];
479
+ this.images = charts;
480
+ }
481
+ ngAfterViewInit() {
482
+ this.contentObserver = new ResizeObserver((args) => this.chartDialogResizeNotify.next(args));
483
+ this.contentObserver.observe(this.element.nativeElement);
484
+ this.createChart(this.currentChartType);
485
+ }
486
+ toggleFullScreen() {
487
+ this.fullScreen = !this.fullScreen;
488
+ }
489
+ hasAvailableChart(chartType) {
490
+ return this.allCharts.some(c => c.includes(chartType));
491
+ }
492
+ createChart(chartType) {
493
+ this.currentChartType = chartType;
494
+ this.title = chartType.split(/(?=[A-Z])/).toString().replace(',', ' ');
495
+ this.chartArea.clear();
496
+ this.chartDirective.chartFactory(chartType, this.chartArea);
497
+ }
498
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: IgxChartMenuComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
499
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.0", type: IgxChartMenuComponent, selector: "igx-chart-menu", outputs: { onClose: "onClose" }, host: { properties: { "style.width.px": "this.width", "style.height.px": "this.height" } }, viewQueries: [{ propertyName: "chartArea", first: true, predicate: ["chartArea"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div class=\"header\">\r\n <span class=\"header-text\">\r\n {{ title }} Chart\r\n </span>\r\n <span class=\"action-buttons-wrapper\">\r\n <button igxButton=\"icon\" (click)=\"toggleFullScreen()\">\r\n <igx-icon class=\"material\">fullscreen{{fullScreen ? '_exit' : ''}}</igx-icon>\r\n </button>\r\n <button igxButton=\"icon\" (click)=\"onClose.emit()\">\r\n <igx-icon class=\"material\">close</igx-icon>\r\n </button>\r\n </span>\r\n</div>\r\n<div class=\"selection-area ig-scrollbar\">\r\n <igc-trial-watermark></igc-trial-watermark>\r\n <div class=\"chart-area\" [ngClass]=\"{'expanded': isConfigAreaExpanded}\">\r\n <ng-template #chartArea ></ng-template>\r\n </div>\r\n <div>\r\n <button igxButton=\"icon\" igxRipple (click)=\"isConfigAreaExpanded = !isConfigAreaExpanded\">\r\n <igx-icon family=\"material\">chevron_{{ isConfigAreaExpanded ? 'left': 'right'}}</igx-icon>\r\n </button>\r\n </div>\r\n <div #configArea [ngClass]=\"{'chart-config-area': true, 'opened': !isConfigAreaExpanded, 'closed': isConfigAreaExpanded }\">\r\n <div class=\"config-area-header\">\r\n <span>Chart Types</span>\r\n </div>\r\n <igx-divider class=\"divider\"></igx-divider>\r\n <div class=\"wrapper\" *ngFor=\"let chartType of mainChartTypes\">\r\n <ng-container *ngIf=\"hasAvailableChart(chartType)\">\r\n <div>{{chartType | titlecase}} Chart</div>\r\n <div class=\"types-section\">\r\n <ng-container *ngFor=\"let chart of allCharts\">\r\n <span *ngIf=\"chart.startsWith(chartType)\" class=\"types-section-btn\" title=\"{{chart}}\"\r\n [ngClass]=\"{'selected': chart === currentChartType}\" (click)=\"createChart(chart)\">\r\n <div [innerHTML]=\"images[chart] | svg\">\r\n </div>\r\n </span>\r\n </ng-container>\r\n </div>\r\n <igx-divider></igx-divider>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".ig-chart-legend-items-list{height:20%;display:inline-flex;flex-wrap:wrap;margin-bottom:1rem}igx-chart-menu{display:flex;flex-flow:column;overflow:hidden;background-color:#fff;transition:width .2s ease-in-out,height .3s ease-in-out}.header{height:10%;background-color:#e0e0e0;display:flex;font-size:1.8rem}.header .action-buttons-wrapper{margin-left:auto;margin-right:10px;align-self:center}.header .header-text{margin-right:auto;align-self:center;margin-left:3rem}.selection-area{width:100%;height:90%;display:inline-flex;flex-flow:row}.selection-area,.selection-area .ig-scrollbar{--scrollbar-size: var(--ig-scrollbar-scrollbar-size, 8px);--thumb-background: var(--ig-scrollbar-thumb-background, hsla(var(--ig-gray-400), var(--ig-gray-a)));--track-background: var(--ig-scrollbar-track-background, hsla(var(--ig-gray-100), var(--ig-gray-a)))}.selection-area .chart-area{margin-top:1rem;overflow-y:hidden;overflow-x:hidden;width:100%}.selection-area .chart-config-area{transition:all;transition-duration:.3s;transition-timing-function:ease-in-out}.selection-area .chart-config-area.opened{width:25%;overflow-y:auto;overflow-x:hidden}.selection-area .chart-config-area.closed{width:0;transform:translate(100%)}.selection-area .chart-config-area .config-area-header{margin-bottom:3px;font-size:1rem;font-weight:700;text-align:center}.selection-area .chart-config-area .types-section-btn{width:40%;margin-right:5px;cursor:pointer}.selection-area .chart-config-area .types-section-btn.selected{opacity:.5}.selection-area .wrapper{padding:3px}.selection-area .wrapper .types-section{display:flex;flex-wrap:wrap}.selection-area .wrapper .igx-divider{margin:5px!important;background:black!important}\n"], dependencies: [{ kind: "directive", type: i1$1.IgxButtonDirective, selector: "[igxButton]", inputs: ["selected", "igxButton", "igxButtonColor", "igxButtonBackground", "igxLabel", "disabled"], outputs: ["buttonClick", "buttonSelected"] }, { kind: "directive", type: i1$1.IgxDividerDirective, selector: "igx-divider", inputs: ["id", "role", "type", "middle", "vertical", "inset"] }, { kind: "component", type: i1$1.IgxIconComponent, selector: "igx-icon", inputs: ["family", "active", "name"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.TitleCasePipe, name: "titlecase" }, { kind: "pipe", type: SvgPipe, name: "svg" }], encapsulation: i0.ViewEncapsulation.None }); }
500
+ }
501
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: IgxChartMenuComponent, decorators: [{
502
+ type: Component,
503
+ args: [{ selector: 'igx-chart-menu', encapsulation: ViewEncapsulation.None, template: "<div class=\"header\">\r\n <span class=\"header-text\">\r\n {{ title }} Chart\r\n </span>\r\n <span class=\"action-buttons-wrapper\">\r\n <button igxButton=\"icon\" (click)=\"toggleFullScreen()\">\r\n <igx-icon class=\"material\">fullscreen{{fullScreen ? '_exit' : ''}}</igx-icon>\r\n </button>\r\n <button igxButton=\"icon\" (click)=\"onClose.emit()\">\r\n <igx-icon class=\"material\">close</igx-icon>\r\n </button>\r\n </span>\r\n</div>\r\n<div class=\"selection-area ig-scrollbar\">\r\n <igc-trial-watermark></igc-trial-watermark>\r\n <div class=\"chart-area\" [ngClass]=\"{'expanded': isConfigAreaExpanded}\">\r\n <ng-template #chartArea ></ng-template>\r\n </div>\r\n <div>\r\n <button igxButton=\"icon\" igxRipple (click)=\"isConfigAreaExpanded = !isConfigAreaExpanded\">\r\n <igx-icon family=\"material\">chevron_{{ isConfigAreaExpanded ? 'left': 'right'}}</igx-icon>\r\n </button>\r\n </div>\r\n <div #configArea [ngClass]=\"{'chart-config-area': true, 'opened': !isConfigAreaExpanded, 'closed': isConfigAreaExpanded }\">\r\n <div class=\"config-area-header\">\r\n <span>Chart Types</span>\r\n </div>\r\n <igx-divider class=\"divider\"></igx-divider>\r\n <div class=\"wrapper\" *ngFor=\"let chartType of mainChartTypes\">\r\n <ng-container *ngIf=\"hasAvailableChart(chartType)\">\r\n <div>{{chartType | titlecase}} Chart</div>\r\n <div class=\"types-section\">\r\n <ng-container *ngFor=\"let chart of allCharts\">\r\n <span *ngIf=\"chart.startsWith(chartType)\" class=\"types-section-btn\" title=\"{{chart}}\"\r\n [ngClass]=\"{'selected': chart === currentChartType}\" (click)=\"createChart(chart)\">\r\n <div [innerHTML]=\"images[chart] | svg\">\r\n </div>\r\n </span>\r\n </ng-container>\r\n </div>\r\n <igx-divider></igx-divider>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".ig-chart-legend-items-list{height:20%;display:inline-flex;flex-wrap:wrap;margin-bottom:1rem}igx-chart-menu{display:flex;flex-flow:column;overflow:hidden;background-color:#fff;transition:width .2s ease-in-out,height .3s ease-in-out}.header{height:10%;background-color:#e0e0e0;display:flex;font-size:1.8rem}.header .action-buttons-wrapper{margin-left:auto;margin-right:10px;align-self:center}.header .header-text{margin-right:auto;align-self:center;margin-left:3rem}.selection-area{width:100%;height:90%;display:inline-flex;flex-flow:row}.selection-area,.selection-area .ig-scrollbar{--scrollbar-size: var(--ig-scrollbar-scrollbar-size, 8px);--thumb-background: var(--ig-scrollbar-thumb-background, hsla(var(--ig-gray-400), var(--ig-gray-a)));--track-background: var(--ig-scrollbar-track-background, hsla(var(--ig-gray-100), var(--ig-gray-a)))}.selection-area .chart-area{margin-top:1rem;overflow-y:hidden;overflow-x:hidden;width:100%}.selection-area .chart-config-area{transition:all;transition-duration:.3s;transition-timing-function:ease-in-out}.selection-area .chart-config-area.opened{width:25%;overflow-y:auto;overflow-x:hidden}.selection-area .chart-config-area.closed{width:0;transform:translate(100%)}.selection-area .chart-config-area .config-area-header{margin-bottom:3px;font-size:1rem;font-weight:700;text-align:center}.selection-area .chart-config-area .types-section-btn{width:40%;margin-right:5px;cursor:pointer}.selection-area .chart-config-area .types-section-btn.selected{opacity:.5}.selection-area .wrapper{padding:3px}.selection-area .wrapper .types-section{display:flex;flex-wrap:wrap}.selection-area .wrapper .igx-divider{margin:5px!important;background:black!important}\n"] }]
504
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { chartArea: [{
505
+ type: ViewChild,
506
+ args: ['chartArea', { read: ViewContainerRef }]
507
+ }], onClose: [{
508
+ type: Output
509
+ }], width: [{
510
+ type: HostBinding,
511
+ args: ['style.width.px']
512
+ }], height: [{
513
+ type: HostBinding,
514
+ args: ['style.height.px']
515
515
  }] } });
516
516
 
517
- // tslint:disable: max-line-length
517
+ // tslint:disable: max-line-length
518
518
  const Clear = `
519
519
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
520
520
  <defs>
@@ -533,7 +533,7 @@ const Clear = `
533
533
  </g>
534
534
  </g>
535
535
  </svg>
536
- `;
536
+ `;
537
537
  const ColorScale = `
538
538
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
539
539
  <path d="M13 13.65h5a5.63 5.63 0 00-.09-1H13zM13 10.65h4.19a6.29 6.29 0 00-.74-1H13zM13 19.58a5.87 5.87 0 002.34-.93H13zM13 6.18v1.48h1.48l-1-1-.48-.48zM13 15.65v1h4.2a5.68 5.68 0 00.46-1zM11 6.18L7.76 9.43A6 6 0 0011 19.58z" fill="none"/>
@@ -542,14 +542,14 @@ const ColorScale = `
542
542
  <path d="M0 0h24v24H0z" fill="none"/>
543
543
  </svg>
544
544
 
545
- `;
545
+ `;
546
546
  const DataBars = `
547
547
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
548
548
  <path d="M3 7h12v2H3zM3 15h12v2H3zM3 19h18v2H3zM3 11h18v2H3zM3 3h18v2H3z"/>
549
549
  <path d="M0 0h24v24H0z" fill="none"/>
550
550
  </svg>
551
551
 
552
- `;
552
+ `;
553
553
  const DuplicateValues = `
554
554
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
555
555
  <path d="M4.94 10.56a1 1 0 00-.38.79.79.79 0 00.25.63 1.06 1.06 0 00.74.24 1.9 1.9 0 001.06-.3 1.48 1.48 0 00.63-.67v-1H6a1.58 1.58 0 00-1.06.31zM16.94 14.69a1 1 0 00-.38.79.82.82 0 00.25.63 1.11 1.11 0 00.74.23 2 2 0 001.06-.29 1.5 1.5 0 00.63-.68v-1H18a1.54 1.54 0 00-1.06.32z" fill="none"/>
@@ -558,7 +558,7 @@ const DuplicateValues = `
558
558
  <path d="M0 0h24v24H0z" fill="none"/>
559
559
  </svg>
560
560
 
561
- `;
561
+ `;
562
562
  const Empty = `
563
563
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
564
564
  <path d="M0 0h24v24H0z" fill="none"/>
@@ -566,19 +566,19 @@ const Empty = `
566
566
  <path d="M0 0h24v24H0z" fill="none"/>
567
567
  </svg>
568
568
 
569
- `;
569
+ `;
570
570
  const Equal = `
571
571
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
572
572
  <path d="M5 13.5h14v2H5zM5 8.5h14v2H5z"/>
573
573
  </svg>
574
574
 
575
- `;
575
+ `;
576
576
  const GreaterThan = `
577
577
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
578
578
  <path d="M6 7.11L15.09 12 6 16.89V19l12-6.46v-1.08L6 5v2.11z"/>
579
579
  </svg>
580
580
 
581
- `;
581
+ `;
582
582
  const TextContains = `
583
583
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
584
584
  <path d="M10.79 12.77a1.16 1.16 0 00-.44.9.92.92 0 00.3.72 1.18 1.18 0 00.84.27 2.27 2.27 0 001.21-.34 1.61 1.61 0 00.71-.77v-1.17H12a1.76 1.76 0 00-1.21.39z" fill="none"/>
@@ -588,7 +588,7 @@ const TextContains = `
588
588
  <path d="M0 0h24v24H0z" fill="none"/>
589
589
  </svg>
590
590
 
591
- `;
591
+ `;
592
592
  const Top10 = `
593
593
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
594
594
  <path d="M17.34 7.14a.5.5 0 00-.13.33v.33a.48.48 0 00.13.33.41.41 0 00.31.14.37.37 0 00.42-.37v-.41a.49.49 0 00-.07-.34.45.45 0 00-.62 0zM10.84 8a.54.54 0 00.51-.3 2.05 2.05 0 00.17-.92V5.3a2 2 0 00-.17-.94.6.6 0 00-1 0 2.13 2.13 0 00-.17.88V6.7a2.14 2.14 0 00.17 1 .55.55 0 00.49.3zM14.88 5c.28 0 .42-.18.42-.53v-.26a.53.53 0 00-.11-.34.4.4 0 00-.32-.14.42.42 0 00-.31.13.52.52 0 00-.12.36v.29a.49.49 0 00.12.34.39.39 0 00.32.15z" fill="none"/>
@@ -596,7 +596,7 @@ const Top10 = `
596
596
  <path d="M0 0h24v24H0z" fill="none"/>
597
597
  </svg>
598
598
 
599
- `;
599
+ `;
600
600
  const UniqueValues = `
601
601
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
602
602
  <path d="M0 0h24v24H0z" fill="none"/>
@@ -623,1153 +623,1153 @@ var conditions = /*#__PURE__*/Object.freeze({
623
623
  UniqueValues: UniqueValues
624
624
  });
625
625
 
626
- var CHART_TYPE;
627
- (function (CHART_TYPE) {
628
- CHART_TYPE["PIE"] = "Pie";
629
- CHART_TYPE["COLUMN_GROUPED"] = "ColumnGrouped";
630
- CHART_TYPE["AREA_GROUPED"] = "AreaGrouped";
631
- CHART_TYPE["LINE_GROUPED"] = "LineGrouped";
632
- CHART_TYPE["BAR_GROUPED"] = "BarGrouped";
633
- CHART_TYPE["COLUMN_STACKED"] = "ColumnStacked";
634
- CHART_TYPE["AREA_STACKED"] = "AreaStacked";
635
- CHART_TYPE["LINE_STACKED"] = "LineStacked";
636
- CHART_TYPE["BAR_STACKED"] = "BarStacked";
637
- CHART_TYPE["COLUMN_100_STACKED"] = "Column100Stacked";
638
- CHART_TYPE["AREA_100_STACKED"] = "Area100Stacked";
639
- CHART_TYPE["LINE_100_STACKED"] = "Line100Stacked";
640
- CHART_TYPE["BAR_100_STACKED"] = "Bar100Stacked";
641
- CHART_TYPE["SCATTER_POINT"] = "ScatterPoint";
642
- CHART_TYPE["SCATTER_BUBBLE"] = "ScatterBubble";
643
- CHART_TYPE["SCATTER_LINE"] = "ScatterLine";
644
- })(CHART_TYPE || (CHART_TYPE = {}));
645
- var OPTIONS_TYPE;
646
- (function (OPTIONS_TYPE) {
647
- OPTIONS_TYPE["CHART"] = "chartOptions";
648
- OPTIONS_TYPE["SERIES"] = "seriesModel";
649
- OPTIONS_TYPE["X_AXIS"] = "xAxisOptions";
650
- OPTIONS_TYPE["Y_AXIS"] = "yAxisOptions";
651
- OPTIONS_TYPE["STACKED_SERIES"] = "stackedFragmentOptions";
626
+ var CHART_TYPE;
627
+ (function (CHART_TYPE) {
628
+ CHART_TYPE["PIE"] = "Pie";
629
+ CHART_TYPE["COLUMN_GROUPED"] = "ColumnGrouped";
630
+ CHART_TYPE["AREA_GROUPED"] = "AreaGrouped";
631
+ CHART_TYPE["LINE_GROUPED"] = "LineGrouped";
632
+ CHART_TYPE["BAR_GROUPED"] = "BarGrouped";
633
+ CHART_TYPE["COLUMN_STACKED"] = "ColumnStacked";
634
+ CHART_TYPE["AREA_STACKED"] = "AreaStacked";
635
+ CHART_TYPE["LINE_STACKED"] = "LineStacked";
636
+ CHART_TYPE["BAR_STACKED"] = "BarStacked";
637
+ CHART_TYPE["COLUMN_100_STACKED"] = "Column100Stacked";
638
+ CHART_TYPE["AREA_100_STACKED"] = "Area100Stacked";
639
+ CHART_TYPE["LINE_100_STACKED"] = "Line100Stacked";
640
+ CHART_TYPE["BAR_100_STACKED"] = "Bar100Stacked";
641
+ CHART_TYPE["SCATTER_POINT"] = "ScatterPoint";
642
+ CHART_TYPE["SCATTER_BUBBLE"] = "ScatterBubble";
643
+ CHART_TYPE["SCATTER_LINE"] = "ScatterLine";
644
+ })(CHART_TYPE || (CHART_TYPE = {}));
645
+ var OPTIONS_TYPE;
646
+ (function (OPTIONS_TYPE) {
647
+ OPTIONS_TYPE["CHART"] = "chartOptions";
648
+ OPTIONS_TYPE["SERIES"] = "seriesModel";
649
+ OPTIONS_TYPE["X_AXIS"] = "xAxisOptions";
650
+ OPTIONS_TYPE["Y_AXIS"] = "yAxisOptions";
651
+ OPTIONS_TYPE["STACKED_SERIES"] = "stackedFragmentOptions";
652
652
  })(OPTIONS_TYPE || (OPTIONS_TYPE = {}));
653
653
 
654
- class IgxContextMenuComponent {
655
- constructor(overlayService) {
656
- this.overlayService = overlayService;
657
- this.chartTypes = [];
658
- this.textFormatters = [];
659
- this.destroy$ = new Subject();
660
- this._chartDialogOS = { closeOnOutsideClick: false };
661
- this._tabsMenuOverlaySettings = {
662
- closeOnOutsideClick: false,
663
- modal: false,
664
- outlet: null,
665
- scrollStrategy: new CloseScrollStrategy(),
666
- positionStrategy: new AutoPositionStrategy({
667
- horizontalDirection: HorizontalAlignment.Center,
668
- horizontalStartPoint: HorizontalAlignment.Center,
669
- verticalStartPoint: VerticalAlignment.Bottom,
670
- verticalDirection: VerticalAlignment.Bottom,
671
- openAnimation: null,
672
- closeAnimation: null
673
- })
674
- };
675
- this._chartPreviewDialogOverlaySettings = {
676
- closeOnOutsideClick: false,
677
- modal: false,
678
- outlet: null,
679
- scrollStrategy: new CloseScrollStrategy(),
680
- positionStrategy: new AutoPositionStrategy({
681
- horizontalDirection: HorizontalAlignment.Center,
682
- horizontalStartPoint: HorizontalAlignment.Center,
683
- verticalStartPoint: VerticalAlignment.Top,
684
- verticalDirection: VerticalAlignment.Top,
685
- openAnimation: null,
686
- closeAnimation: null
687
- })
688
- };
689
- this.chartImages = charts;
690
- this.conditionImages = conditions;
691
- }
692
- ngAfterViewInit() {
693
- this.chartTypes = this.contextDirective.charts;
694
- this.textFormatters = this.contextDirective.formatters;
695
- if (this.contextDirective.chartsDirective) {
696
- this.contextDirective.chartsDirective.onChartTypesDetermined.pipe(takeUntil(this.destroy$))
697
- .subscribe((args) => this.chartTypes = args.chartsForCreation);
698
- }
699
- if (this.contextDirective.textFormatter) {
700
- this.contextDirective.textFormatter.onFormattersReady.pipe(takeUntil(this.destroy$))
701
- .subscribe(names => this.textFormatters = names);
702
- }
703
- this.contextDirective.onButtonClose.pipe(takeUntil(this.destroy$))
704
- .subscribe(() => { if (this.tabsMenu && !this.tabsMenu.collapsed) {
705
- this.tabsMenu.close();
706
- } });
707
- this.contextDirective.gridResizeNotify.pipe(takeUntil(this.destroy$))
708
- .subscribe(() => {
709
- if (!this.tabsMenu.collapsed) {
710
- this.tabsMenu.close();
711
- }
712
- });
713
- this.tabsMenu.opening.pipe(takeUntil(this.destroy$))
714
- .subscribe(() => {
715
- if (this.tabs.selectedItem.disabled) {
716
- debugger;
717
- // const i = this.tabs.items.find(tab => !tab.disabled)?.index || 0;
718
- // this.tabs.selectTab(this.tabs.tabs.toArray()[i], true);
719
- }
720
- });
721
- this.overlayService.opening.pipe(takeUntil(this.destroy$))
722
- .subscribe((args) => {
723
- if (args.componentRef) {
724
- const instance = args.componentRef.instance;
725
- instance.width = this.contextDirective.grid.nativeElement.clientWidth;
726
- instance.height = this.contextDirective.grid.nativeElement.clientHeight;
727
- instance.currentChartType = this.currentChartType;
728
- instance.allCharts = this.chartTypes;
729
- instance.chartDirective = this.contextDirective.chartsDirective;
730
- instance.onClose?.subscribe(() => {
731
- this.closeDialog();
732
- });
733
- instance.chartDialogResizeNotify?.subscribe(resizedContentArgs => {
734
- // This is a temporary fix, which should be removed right after
735
- // the overlay service is capable of notifying the overlay content elements
736
- // that their children has been resized.
737
- if (this.overlayService._overlayElement.children[1]) {
738
- // tslint:disable-next-line: max-line-length
739
- this.overlayService._overlayElement.children[1].children[0].style.width = resizedContentArgs[0].contentRect.width + 'px';
740
- }
741
- });
742
- }
743
- });
744
- this.overlayService.closing.pipe(takeUntil(this.destroy$))
745
- .subscribe((args) => {
746
- if (args.componentRef && args.componentRef.instance instanceof IgxChartMenuComponent) {
747
- if (this._dialogId) {
748
- this.tabsMenu.open(this._tabsMenuOverlaySettings);
749
- }
750
- }
751
- });
752
- }
753
- ngOnDestroy() {
754
- this.destroy$.next(true);
755
- this.destroy$.complete();
756
- }
757
- toggleTabMenu() {
758
- this.currentChartType = this.currentChartType ? this.currentChartType : CHART_TYPE.COLUMN_GROUPED;
759
- this._tabsMenuOverlaySettings.target = this.button.nativeElement;
760
- this.tabsMenu.collapsed ? this.tabsMenu.open(this._tabsMenuOverlaySettings) : this.tabsMenu.close();
761
- }
762
- formatCells(condition) {
763
- this.currentFormatter = condition;
764
- this.contextDirective.textFormatter.formatCells(condition);
765
- }
766
- clearFormat() {
767
- this.contextDirective.textFormatter.clearFormatting();
768
- this.currentFormatter = undefined;
769
- }
770
- previewChart(currentChartType) {
771
- this.currentChartType = currentChartType;
772
- this.chartPreview.clear();
773
- this.contextDirective.chartsDirective.chartFactory(currentChartType, this.chartPreview);
774
- this._chartPreviewDialogOverlaySettings.target = this.tabsMenu.element;
775
- this.chartPreviewDialog.open(this._chartPreviewDialogOverlaySettings);
776
- }
777
- hidePreview() {
778
- this.chartPreviewDialog.close();
779
- }
780
- openDialog(type) {
781
- this.currentChartType = type ? type : this.currentChartType ? this.currentChartType : CHART_TYPE.COLUMN_GROUPED;
782
- this._dialogId = this._dialogId ? this._dialogId :
783
- this.overlayService.attach(IgxChartMenuComponent, this._chartDialogOS);
784
- this.tabsMenu.close();
785
- this.overlayService.show(this._dialogId);
786
- }
787
- closeDialog() {
788
- const info = this.overlayService.getOverlayById(this._dialogId);
789
- if (info) {
790
- this.overlayService.hide(this._dialogId);
791
- this.overlayService.detach(this._dialogId);
792
- this._dialogId = undefined;
793
- }
794
- }
795
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: IgxContextMenuComponent, deps: [{ token: i1$1.IgxOverlayService }], target: i0.ɵɵFactoryTarget.Component }); }
796
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.5", type: IgxContextMenuComponent, selector: "igx-context-menu", viewQueries: [{ propertyName: "button", first: true, predicate: ["analyticsBtn"], descendants: true }, { propertyName: "tabsMenu", first: true, predicate: ["tabsMenu"], descendants: true, read: IgxToggleDirective }, { propertyName: "chartPreview", first: true, predicate: ["chartPreview"], descendants: true, read: ViewContainerRef }, { propertyName: "chartPreviewDialog", first: true, predicate: ["chartPreviewDialog"], descendants: true, read: IgxToggleDirective }, { propertyName: "tabs", first: true, predicate: IgxTabsComponent, descendants: true }], ngImport: i0, template: "<span #analyticsBtn class=\"analytics-btn\">\r\n <button #btn igxButton=\"icon\" (click)=\"toggleTabMenu()\">\r\n <igx-icon #icon class=\"icon\" family=\"material\">insert_chart_outlined</igx-icon>\r\n </button>\r\n</span>\r\n<div #tabsMenu igxToggle class=\"toggle-content ig-scrollbar\">\r\n <!--NOTE: This component has been updated by Infragistics migration: v12.0.0\r\nPlease check your template whether all bindings/event handlers are correct.-->\r\n <igx-tabs tabsType=\"fixed\" [selectedIndex]=\"!this.textFormatters.length && chartTypes.length ? 1 : 0\">\r\n <igx-tab-item [disabled]=\"!textFormatters.length\">\r\n <igx-tab-header>\r\n <span igxTabHeaderLabel>Conditional Formatting</span>\r\n </igx-tab-header>\r\n <igx-tab-content>\r\n <igc-trial-watermark></igc-trial-watermark>\r\n <div class=\"tabs\">\r\n <span class=\"tab-option\">\r\n <span *ngFor=\"let condition of textFormatters\" class=\"action btn condition\"\r\n [ngClass]=\"{'selected--condition': condition === currentFormatter}\"\r\n (click)=\"formatCells(condition)\">\r\n <div class=\"imgSize\" [innerHTML]=\"conditionImages[condition.replace(' ', '')] | svg\">\r\n </div>\r\n <span class=\"name\">{{condition.replace('10', '10%')}}</span>\r\n </span>\r\n </span>\r\n <span class=\"clear action\"\r\n [ngClass]=\"{'disableButton': contextDirective.textFormatter ? !contextDirective.textFormatter.formatter : true }\"\r\n (click)=\"clearFormat()\">\r\n <div class=\"imgSize\" [innerHTML]=\"conditionImages['Clear'] | svg\">\r\n </div>\r\n <span class=\"btn name\">Clear All</span>\r\n </span>\r\n </div>\r\n </igx-tab-content>\r\n </igx-tab-item>\r\n <igx-tab-item [disabled]=\"!chartTypes.length\">\r\n <igx-tab-header>\r\n <span igxTabHeaderLabel>Create Chart</span>\r\n </igx-tab-header>\r\n <igx-tab-content>\r\n <igc-trial-watermark></igc-trial-watermark>\r\n <div class=\"tabs\">\r\n <span class=\"tab-option\">\r\n <span *ngFor=\"let chart of chartTypes | slice:0:4\" class=\"action btn chart\"\r\n [ngClass]=\"{'selected': chart === currentChartType}\" (mouseenter)=\"previewChart(chart)\"\r\n (mouseleave)=\"hidePreview()\" (click)=\"openDialog(chart)\">\r\n <span [innerHTML]=\"chartImages[chart] | svg\" class=\"imgSize\">\r\n </span>\r\n <span class=\"name\">{{chart}}</span>\r\n </span>\r\n </span>\r\n <span class=\"more-action chart\" [ngClass]=\"{'disableButton': !chartTypes.length}\"\r\n (click)=\"openDialog()\">\r\n <button class=\"more-btn more-icon\" igxButton=\"icon\" igxButtonBackground=\"#EBEBEB\"\r\n igxButtonColor=\"black\">\r\n <igx-icon class=\"icon\" family=\"material\">more_horiz</igx-icon>\r\n </button>\r\n <span class=\"name btn\">More...</span>\r\n </span>\r\n </div>\r\n </igx-tab-content>\r\n </igx-tab-item>\r\n </igx-tabs>\r\n</div>\r\n<div igxToggle #chartPreviewDialog class=\"chart-preview\">\r\n <div class=\"chart-preview-title\">\r\n <h5>Preview Chart</h5>\r\n </div>\r\n <div class=\"chart-preview-area\">\r\n <ng-template #chartPreview></ng-template>\r\n </div>\r\n</div>", styles: [".analytics-btn,.analytics-btn [igxButton=flat],.analytics-btn .igx-button--flat{--shadow-color: var(--igx-button-shadow-color, transparent);--border-color: var(--igx-button-border-color, transparent);--hover-border-color: var(--igx-button-hover-border-color, transparent);--focus-border-color: var(--igx-button-focus-border-color, transparent);--focus-visible-border-color: var(--igx-button-focus-visible-border-color, transparent);--active-border-color: var(--igx-button-active-border-color, transparent);--disabled-border-color: var(--igx-button-disabled-border-color, transparent);--disabled-background: var(--igx-button-disabled-background, transparent);--disabled-foreground: var(--igx-button-disabled-foreground, hsla(var(--ig-gray-500), var(--ig-gray-a)));--size: var(--igx-button-size, max(var(--is-large, 1) * max(2.25rem, -1 * 2.25rem), var(--is-medium, 1) * max(1.875rem, -1 * 1.875rem), var(--is-small, 1) * max(1.5rem, -1 * 1.5rem)));--resting-elevation: var(--igx-button-resting-elevation, var(--ig-elevation-0));--hover-elevation: var(--igx-button-hover-elevation, var(--ig-elevation-0));--focus-elevation: var(--igx-button-focus-elevation, var(--ig-elevation-0));--active-elevation: var(--igx-button-active-elevation, var(--ig-elevation-0));--background: var(--igx-button-background, #335e3b);--foreground: var(--igx-button-foreground, #fff);--hover-background: var(--igx-button-hover-background, #459a55);--hover-foreground: var(--igx-button-hover-foreground, black);--focus-background: var(--igx-button-focus-background, #396a42);--focus-foreground: var(--igx-button-focus-foreground, white);--focus-visible-background: var(--igx-button-focus-visible-background, #396a42);--focus-visible-foreground: var(--igx-button-focus-visible-foreground, white);--active-background: var(--igx-button-active-background, hsla(var(--ig-secondary-400), .12));--active-foreground: var(--igx-button-active-foreground, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--border-radius: var(--igx-button-border-radius, 0);--resting-shadow: var(--igx-button-resting-shadow, var(--ig-elevation-0));--hover-shadow: var(--igx-button-hover-shadow, var(--ig-elevation-0));--focus-shadow: var(--igx-button-focus-shadow, var(--ig-elevation-0));--active-shadow: var(--igx-button-active-shadow, var(--ig-elevation-0))}.analytics-btn,.analytics-btn [igxButton=outlined],.analytics-btn .igx-button--outlined{--shadow-color: var(--igx-button-shadow-color, transparent);--border-color: var(--igx-button-border-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--hover-border-color: var(--igx-button-hover-border-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--focus-border-color: var(--igx-button-focus-border-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--focus-visible-border-color: var(--igx-button-focus-visible-border-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--active-border-color: var(--igx-button-active-border-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--disabled-border-color: var(--igx-button-disabled-border-color, hsla(var(--ig-gray-300), var(--ig-gray-a)));--disabled-background: var(--igx-button-disabled-background, transparent);--disabled-foreground: var(--igx-button-disabled-foreground, hsla(var(--ig-gray-500), var(--ig-gray-a)));--size: var(--igx-button-size, max(var(--is-large, 1) * max(2.25rem, -1 * 2.25rem), var(--is-medium, 1) * max(1.875rem, -1 * 1.875rem), var(--is-small, 1) * max(1.5rem, -1 * 1.5rem)));--resting-elevation: var(--igx-button-resting-elevation, var(--ig-elevation-0));--hover-elevation: var(--igx-button-hover-elevation, var(--ig-elevation-0));--focus-elevation: var(--igx-button-focus-elevation, var(--ig-elevation-0));--active-elevation: var(--igx-button-active-elevation, var(--ig-elevation-0));--background: var(--igx-button-background, #335e3b);--foreground: var(--igx-button-foreground, #fff);--hover-background: var(--igx-button-hover-background, #459a55);--hover-foreground: var(--igx-button-hover-foreground, black);--focus-background: var(--igx-button-focus-background, #396a42);--focus-foreground: var(--igx-button-focus-foreground, white);--focus-visible-background: var(--igx-button-focus-visible-background, #396a42);--focus-visible-foreground: var(--igx-button-focus-visible-foreground, white);--active-background: var(--igx-button-active-background, hsla(var(--ig-secondary-400), .12));--active-foreground: var(--igx-button-active-foreground, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--border-radius: var(--igx-button-border-radius, 0);--resting-shadow: var(--igx-button-resting-shadow, var(--ig-elevation-0));--hover-shadow: var(--igx-button-hover-shadow, var(--ig-elevation-0));--focus-shadow: var(--igx-button-focus-shadow, var(--ig-elevation-0));--active-shadow: var(--igx-button-active-shadow, var(--ig-elevation-0))}.analytics-btn,.analytics-btn [igxButton=raised],.analytics-btn .igx-button--raised{--shadow-color: var(--igx-button-shadow-color, transparent);--border-color: var(--igx-button-border-color, transparent);--hover-border-color: var(--igx-button-hover-border-color, transparent);--focus-border-color: var(--igx-button-focus-border-color, transparent);--focus-visible-border-color: var(--igx-button-focus-visible-border-color, transparent);--active-border-color: var(--igx-button-active-border-color, transparent);--disabled-border-color: var(--igx-button-disabled-border-color, transparent);--disabled-background: var(--igx-button-disabled-background, hsla(var(--ig-gray-300), var(--ig-gray-a)));--disabled-foreground: var(--igx-button-disabled-foreground, hsla(var(--ig-gray-500), var(--ig-gray-a)));--size: var(--igx-button-size, max(var(--is-large, 1) * max(2.25rem, -1 * 2.25rem), var(--is-medium, 1) * max(1.875rem, -1 * 1.875rem), var(--is-small, 1) * max(1.5rem, -1 * 1.5rem)));--resting-elevation: var(--igx-button-resting-elevation, var(--ig-elevation-2));--hover-elevation: var(--igx-button-hover-elevation, var(--ig-elevation-4));--focus-elevation: var(--igx-button-focus-elevation, var(--ig-elevation-8));--active-elevation: var(--igx-button-active-elevation, var(--ig-elevation-8));--background: var(--igx-button-background, #335e3b);--foreground: var(--igx-button-foreground, #fff);--hover-background: var(--igx-button-hover-background, #459a55);--hover-foreground: var(--igx-button-hover-foreground, black);--focus-background: var(--igx-button-focus-background, #396a42);--focus-foreground: var(--igx-button-focus-foreground, white);--focus-visible-background: var(--igx-button-focus-visible-background, #396a42);--focus-visible-foreground: var(--igx-button-focus-visible-foreground, white);--active-background: var(--igx-button-active-background, hsla(var(--ig-secondary-300), var(--ig-secondary-a)));--active-foreground: var(--igx-button-active-foreground, var(--ig-secondary-300-contrast));--border-radius: var(--igx-button-border-radius, 0);--resting-shadow: var(--igx-button-resting-shadow, var(--ig-elevation-2));--hover-shadow: var(--igx-button-hover-shadow, var(--ig-elevation-4));--focus-shadow: var(--igx-button-focus-shadow, var(--ig-elevation-8));--active-shadow: var(--igx-button-active-shadow, var(--ig-elevation-8))}.analytics-btn,.analytics-btn [igxButton=fab],.analytics-btn .igx-button--fab{--shadow-color: var(--igx-button-shadow-color, transparent);--border-color: var(--igx-button-border-color, transparent);--hover-border-color: var(--igx-button-hover-border-color, transparent);--focus-border-color: var(--igx-button-focus-border-color, transparent);--focus-visible-border-color: var(--igx-button-focus-visible-border-color, transparent);--active-border-color: var(--igx-button-active-border-color, transparent);--disabled-border-color: var(--igx-button-disabled-border-color, transparent);--disabled-background: var(--igx-button-disabled-background, hsla(var(--ig-gray-300), var(--ig-gray-a)));--disabled-foreground: var(--igx-button-disabled-foreground, hsla(var(--ig-gray-500), var(--ig-gray-a)));--size: var(--igx-button-size, max(var(--is-large, 1) * max(3rem, -1 * 3rem), var(--is-medium, 1) * max(2.5rem, -1 * 2.5rem), var(--is-small, 1) * max(2rem, -1 * 2rem)));--resting-elevation: var(--igx-button-resting-elevation, var(--ig-elevation-6));--hover-elevation: var(--igx-button-hover-elevation, var(--ig-elevation-12));--focus-elevation: var(--igx-button-focus-elevation, var(--ig-elevation-12));--active-elevation: var(--igx-button-active-elevation, var(--ig-elevation-12));--background: var(--igx-button-background, #335e3b);--foreground: var(--igx-button-foreground, #fff);--hover-background: var(--igx-button-hover-background, #459a55);--hover-foreground: var(--igx-button-hover-foreground, black);--focus-background: var(--igx-button-focus-background, #396a42);--focus-foreground: var(--igx-button-focus-foreground, white);--focus-visible-background: var(--igx-button-focus-visible-background, #396a42);--focus-visible-foreground: var(--igx-button-focus-visible-foreground, white);--active-background: var(--igx-button-active-background, hsla(var(--ig-secondary-300), var(--ig-secondary-a)));--active-foreground: var(--igx-button-active-foreground, var(--ig-secondary-300-contrast));--border-radius: var(--igx-button-border-radius, 0);--resting-shadow: var(--igx-button-resting-shadow, var(--ig-elevation-6));--hover-shadow: var(--igx-button-hover-shadow, var(--ig-elevation-12));--focus-shadow: var(--igx-button-focus-shadow, var(--ig-elevation-12));--active-shadow: var(--igx-button-active-shadow, var(--ig-elevation-12))}.analytics-btn,.analytics-btn [igxButton=icon],.analytics-btn .igx-button--icon{--shadow-color: var(--igx-button-shadow-color, transparent);--border-color: var(--igx-button-border-color, transparent);--hover-border-color: var(--igx-button-hover-border-color, transparent);--focus-border-color: var(--igx-button-focus-border-color, hsla(var(--ig-gray-400), var(--ig-gray-a)));--focus-visible-border-color: var(--igx-button-focus-visible-border-color, hsla(var(--ig-gray-400), var(--ig-gray-a)));--active-border-color: var(--igx-button-active-border-color, hsla(var(--ig-gray-400), var(--ig-gray-a)));--disabled-border-color: var(--igx-button-disabled-border-color, transparent);--disabled-background: var(--igx-button-disabled-background, transparent);--disabled-foreground: var(--igx-button-disabled-foreground, hsla(var(--ig-gray-500), var(--ig-gray-a)));--size: var(--igx-button-size, max(var(--is-large, 1) * max(2.25rem, -1 * 2.25rem), var(--is-medium, 1) * max(1.875rem, -1 * 1.875rem), var(--is-small, 1) * max(1.5rem, -1 * 1.5rem)));--resting-elevation: var(--igx-button-resting-elevation, var(--ig-elevation-0));--hover-elevation: var(--igx-button-hover-elevation, var(--ig-elevation-0));--focus-elevation: var(--igx-button-focus-elevation, var(--ig-elevation-0));--active-elevation: var(--igx-button-active-elevation, var(--ig-elevation-0));--background: var(--igx-button-background, #335e3b);--foreground: var(--igx-button-foreground, #fff);--hover-background: var(--igx-button-hover-background, #459a55);--hover-foreground: var(--igx-button-hover-foreground, black);--focus-background: var(--igx-button-focus-background, #396a42);--focus-foreground: var(--igx-button-focus-foreground, white);--focus-visible-background: var(--igx-button-focus-visible-background, #396a42);--focus-visible-foreground: var(--igx-button-focus-visible-foreground, white);--active-background: var(--igx-button-active-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--active-foreground: var(--igx-button-active-foreground, hsla(var(--ig-gray-900), var(--ig-gray-a)));--border-radius: var(--igx-button-border-radius, 0);--resting-shadow: var(--igx-button-resting-shadow, var(--ig-elevation-0));--hover-shadow: var(--igx-button-hover-shadow, var(--ig-elevation-0));--focus-shadow: var(--igx-button-focus-shadow, var(--ig-elevation-0));--active-shadow: var(--igx-button-active-shadow, var(--ig-elevation-0))}.disableButton{opacity:.4;pointer-events:none}.clear,.more-action{display:flex;flex-flow:column;justify-content:center;border-left:1px solid #bdbdbd}.clear .btn,.clear .more-btn,.more-action .btn,.more-action .more-btn{width:68px;margin:0 0 7px;padding:0}.clear .more-btn,.more-action .more-btn{width:36px;height:36px;align-self:center;border-radius:20px}.clear .name,.more-action .name{font-size:.9rem;font-weight:400;text-align:center}.icon{pointer-events:none}.btn{display:inline-flex;flex-flow:column;align-items:center}.btn.condition{padding-right:16px}.btn.chart{padding-right:24px}.btn img,.btn span{pointer-events:none}.chart-preview{width:350px;height:300px;background-color:#fff;overflow:hidden}.chart-preview .chart-preview-title{margin:1rem;justify-content:center}.chart-preview .chart-preview-area{height:270px}::ng-deep .toggle-content{width:354px;max-width:358px;height:148px;background-color:#fff}::ng-deep .toggle-content,::ng-deep .toggle-content .ig-scrollbar{--scrollbar-size: var(--ig-scrollbar-scrollbar-size, 8px);--thumb-background: var(--ig-scrollbar-thumb-background, hsla(var(--ig-gray-400), var(--ig-gray-a)));--track-background: var(--ig-scrollbar-track-background, hsla(var(--ig-gray-100), var(--ig-gray-a)))}::ng-deep .toggle-content .tabs{display:flex!important;border:.2px solid;border-color:#d3d3d3}::ng-deep .toggle-content .tab-option{padding:.9rem;height:100px;width:358px;display:inline-flex;overflow-x:auto;overflow-y:hidden;white-space:nowrap;align-content:center}::ng-deep .toggle-content .tab-option .chartImgButton{width:48px;height:48px}::ng-deep .toggle-content .tab-option .imgSize,::ng-deep .toggle-content .clear.action .imgSize{width:36px;height:36px;align-self:center}::ng-deep .toggle-content .action{cursor:pointer;opacity:1}::ng-deep .toggle-content .action.selected{opacity:.62}::ng-deep .toggle-content .action.selected--condition{pointer-events:none;opacity:.62}\n"], dependencies: [{ kind: "directive", type: i1$1.IgxButtonDirective, selector: "[igxButton]", inputs: ["selected", "igxButton", "igxButtonColor", "igxButtonBackground", "igxLabel", "disabled"], outputs: ["buttonClick", "buttonSelected"] }, { kind: "component", type: i1$1.IgxTabsComponent, selector: "igx-tabs", inputs: ["tabAlignment"] }, { kind: "component", type: i1$1.IgxTabItemComponent, selector: "igx-tab-item" }, { kind: "component", type: i1$1.IgxTabHeaderComponent, selector: "igx-tab-header" }, { kind: "component", type: i1$1.IgxTabContentComponent, selector: "igx-tab-content" }, { kind: "directive", type: i1$1.IgxTabHeaderLabelDirective, selector: "igx-tab-header-label,[igxTabHeaderLabel]" }, { kind: "directive", type: i1$1.IgxToggleDirective, selector: "[igxToggle]", inputs: ["id"], outputs: ["opened", "opening", "closed", "closing", "appended"], exportAs: ["toggle"] }, { kind: "component", type: i1$1.IgxIconComponent, selector: "igx-icon", inputs: ["family", "active", "name"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: i2.SlicePipe, name: "slice" }, { kind: "pipe", type: SvgPipe, name: "svg" }] }); }
797
- }
798
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: IgxContextMenuComponent, decorators: [{
799
- type: Component,
800
- args: [{ selector: 'igx-context-menu', template: "<span #analyticsBtn class=\"analytics-btn\">\r\n <button #btn igxButton=\"icon\" (click)=\"toggleTabMenu()\">\r\n <igx-icon #icon class=\"icon\" family=\"material\">insert_chart_outlined</igx-icon>\r\n </button>\r\n</span>\r\n<div #tabsMenu igxToggle class=\"toggle-content ig-scrollbar\">\r\n <!--NOTE: This component has been updated by Infragistics migration: v12.0.0\r\nPlease check your template whether all bindings/event handlers are correct.-->\r\n <igx-tabs tabsType=\"fixed\" [selectedIndex]=\"!this.textFormatters.length && chartTypes.length ? 1 : 0\">\r\n <igx-tab-item [disabled]=\"!textFormatters.length\">\r\n <igx-tab-header>\r\n <span igxTabHeaderLabel>Conditional Formatting</span>\r\n </igx-tab-header>\r\n <igx-tab-content>\r\n <igc-trial-watermark></igc-trial-watermark>\r\n <div class=\"tabs\">\r\n <span class=\"tab-option\">\r\n <span *ngFor=\"let condition of textFormatters\" class=\"action btn condition\"\r\n [ngClass]=\"{'selected--condition': condition === currentFormatter}\"\r\n (click)=\"formatCells(condition)\">\r\n <div class=\"imgSize\" [innerHTML]=\"conditionImages[condition.replace(' ', '')] | svg\">\r\n </div>\r\n <span class=\"name\">{{condition.replace('10', '10%')}}</span>\r\n </span>\r\n </span>\r\n <span class=\"clear action\"\r\n [ngClass]=\"{'disableButton': contextDirective.textFormatter ? !contextDirective.textFormatter.formatter : true }\"\r\n (click)=\"clearFormat()\">\r\n <div class=\"imgSize\" [innerHTML]=\"conditionImages['Clear'] | svg\">\r\n </div>\r\n <span class=\"btn name\">Clear All</span>\r\n </span>\r\n </div>\r\n </igx-tab-content>\r\n </igx-tab-item>\r\n <igx-tab-item [disabled]=\"!chartTypes.length\">\r\n <igx-tab-header>\r\n <span igxTabHeaderLabel>Create Chart</span>\r\n </igx-tab-header>\r\n <igx-tab-content>\r\n <igc-trial-watermark></igc-trial-watermark>\r\n <div class=\"tabs\">\r\n <span class=\"tab-option\">\r\n <span *ngFor=\"let chart of chartTypes | slice:0:4\" class=\"action btn chart\"\r\n [ngClass]=\"{'selected': chart === currentChartType}\" (mouseenter)=\"previewChart(chart)\"\r\n (mouseleave)=\"hidePreview()\" (click)=\"openDialog(chart)\">\r\n <span [innerHTML]=\"chartImages[chart] | svg\" class=\"imgSize\">\r\n </span>\r\n <span class=\"name\">{{chart}}</span>\r\n </span>\r\n </span>\r\n <span class=\"more-action chart\" [ngClass]=\"{'disableButton': !chartTypes.length}\"\r\n (click)=\"openDialog()\">\r\n <button class=\"more-btn more-icon\" igxButton=\"icon\" igxButtonBackground=\"#EBEBEB\"\r\n igxButtonColor=\"black\">\r\n <igx-icon class=\"icon\" family=\"material\">more_horiz</igx-icon>\r\n </button>\r\n <span class=\"name btn\">More...</span>\r\n </span>\r\n </div>\r\n </igx-tab-content>\r\n </igx-tab-item>\r\n </igx-tabs>\r\n</div>\r\n<div igxToggle #chartPreviewDialog class=\"chart-preview\">\r\n <div class=\"chart-preview-title\">\r\n <h5>Preview Chart</h5>\r\n </div>\r\n <div class=\"chart-preview-area\">\r\n <ng-template #chartPreview></ng-template>\r\n </div>\r\n</div>", styles: [".analytics-btn,.analytics-btn [igxButton=flat],.analytics-btn .igx-button--flat{--shadow-color: var(--igx-button-shadow-color, transparent);--border-color: var(--igx-button-border-color, transparent);--hover-border-color: var(--igx-button-hover-border-color, transparent);--focus-border-color: var(--igx-button-focus-border-color, transparent);--focus-visible-border-color: var(--igx-button-focus-visible-border-color, transparent);--active-border-color: var(--igx-button-active-border-color, transparent);--disabled-border-color: var(--igx-button-disabled-border-color, transparent);--disabled-background: var(--igx-button-disabled-background, transparent);--disabled-foreground: var(--igx-button-disabled-foreground, hsla(var(--ig-gray-500), var(--ig-gray-a)));--size: var(--igx-button-size, max(var(--is-large, 1) * max(2.25rem, -1 * 2.25rem), var(--is-medium, 1) * max(1.875rem, -1 * 1.875rem), var(--is-small, 1) * max(1.5rem, -1 * 1.5rem)));--resting-elevation: var(--igx-button-resting-elevation, var(--ig-elevation-0));--hover-elevation: var(--igx-button-hover-elevation, var(--ig-elevation-0));--focus-elevation: var(--igx-button-focus-elevation, var(--ig-elevation-0));--active-elevation: var(--igx-button-active-elevation, var(--ig-elevation-0));--background: var(--igx-button-background, #335e3b);--foreground: var(--igx-button-foreground, #fff);--hover-background: var(--igx-button-hover-background, #459a55);--hover-foreground: var(--igx-button-hover-foreground, black);--focus-background: var(--igx-button-focus-background, #396a42);--focus-foreground: var(--igx-button-focus-foreground, white);--focus-visible-background: var(--igx-button-focus-visible-background, #396a42);--focus-visible-foreground: var(--igx-button-focus-visible-foreground, white);--active-background: var(--igx-button-active-background, hsla(var(--ig-secondary-400), .12));--active-foreground: var(--igx-button-active-foreground, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--border-radius: var(--igx-button-border-radius, 0);--resting-shadow: var(--igx-button-resting-shadow, var(--ig-elevation-0));--hover-shadow: var(--igx-button-hover-shadow, var(--ig-elevation-0));--focus-shadow: var(--igx-button-focus-shadow, var(--ig-elevation-0));--active-shadow: var(--igx-button-active-shadow, var(--ig-elevation-0))}.analytics-btn,.analytics-btn [igxButton=outlined],.analytics-btn .igx-button--outlined{--shadow-color: var(--igx-button-shadow-color, transparent);--border-color: var(--igx-button-border-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--hover-border-color: var(--igx-button-hover-border-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--focus-border-color: var(--igx-button-focus-border-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--focus-visible-border-color: var(--igx-button-focus-visible-border-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--active-border-color: var(--igx-button-active-border-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--disabled-border-color: var(--igx-button-disabled-border-color, hsla(var(--ig-gray-300), var(--ig-gray-a)));--disabled-background: var(--igx-button-disabled-background, transparent);--disabled-foreground: var(--igx-button-disabled-foreground, hsla(var(--ig-gray-500), var(--ig-gray-a)));--size: var(--igx-button-size, max(var(--is-large, 1) * max(2.25rem, -1 * 2.25rem), var(--is-medium, 1) * max(1.875rem, -1 * 1.875rem), var(--is-small, 1) * max(1.5rem, -1 * 1.5rem)));--resting-elevation: var(--igx-button-resting-elevation, var(--ig-elevation-0));--hover-elevation: var(--igx-button-hover-elevation, var(--ig-elevation-0));--focus-elevation: var(--igx-button-focus-elevation, var(--ig-elevation-0));--active-elevation: var(--igx-button-active-elevation, var(--ig-elevation-0));--background: var(--igx-button-background, #335e3b);--foreground: var(--igx-button-foreground, #fff);--hover-background: var(--igx-button-hover-background, #459a55);--hover-foreground: var(--igx-button-hover-foreground, black);--focus-background: var(--igx-button-focus-background, #396a42);--focus-foreground: var(--igx-button-focus-foreground, white);--focus-visible-background: var(--igx-button-focus-visible-background, #396a42);--focus-visible-foreground: var(--igx-button-focus-visible-foreground, white);--active-background: var(--igx-button-active-background, hsla(var(--ig-secondary-400), .12));--active-foreground: var(--igx-button-active-foreground, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--border-radius: var(--igx-button-border-radius, 0);--resting-shadow: var(--igx-button-resting-shadow, var(--ig-elevation-0));--hover-shadow: var(--igx-button-hover-shadow, var(--ig-elevation-0));--focus-shadow: var(--igx-button-focus-shadow, var(--ig-elevation-0));--active-shadow: var(--igx-button-active-shadow, var(--ig-elevation-0))}.analytics-btn,.analytics-btn [igxButton=raised],.analytics-btn .igx-button--raised{--shadow-color: var(--igx-button-shadow-color, transparent);--border-color: var(--igx-button-border-color, transparent);--hover-border-color: var(--igx-button-hover-border-color, transparent);--focus-border-color: var(--igx-button-focus-border-color, transparent);--focus-visible-border-color: var(--igx-button-focus-visible-border-color, transparent);--active-border-color: var(--igx-button-active-border-color, transparent);--disabled-border-color: var(--igx-button-disabled-border-color, transparent);--disabled-background: var(--igx-button-disabled-background, hsla(var(--ig-gray-300), var(--ig-gray-a)));--disabled-foreground: var(--igx-button-disabled-foreground, hsla(var(--ig-gray-500), var(--ig-gray-a)));--size: var(--igx-button-size, max(var(--is-large, 1) * max(2.25rem, -1 * 2.25rem), var(--is-medium, 1) * max(1.875rem, -1 * 1.875rem), var(--is-small, 1) * max(1.5rem, -1 * 1.5rem)));--resting-elevation: var(--igx-button-resting-elevation, var(--ig-elevation-2));--hover-elevation: var(--igx-button-hover-elevation, var(--ig-elevation-4));--focus-elevation: var(--igx-button-focus-elevation, var(--ig-elevation-8));--active-elevation: var(--igx-button-active-elevation, var(--ig-elevation-8));--background: var(--igx-button-background, #335e3b);--foreground: var(--igx-button-foreground, #fff);--hover-background: var(--igx-button-hover-background, #459a55);--hover-foreground: var(--igx-button-hover-foreground, black);--focus-background: var(--igx-button-focus-background, #396a42);--focus-foreground: var(--igx-button-focus-foreground, white);--focus-visible-background: var(--igx-button-focus-visible-background, #396a42);--focus-visible-foreground: var(--igx-button-focus-visible-foreground, white);--active-background: var(--igx-button-active-background, hsla(var(--ig-secondary-300), var(--ig-secondary-a)));--active-foreground: var(--igx-button-active-foreground, var(--ig-secondary-300-contrast));--border-radius: var(--igx-button-border-radius, 0);--resting-shadow: var(--igx-button-resting-shadow, var(--ig-elevation-2));--hover-shadow: var(--igx-button-hover-shadow, var(--ig-elevation-4));--focus-shadow: var(--igx-button-focus-shadow, var(--ig-elevation-8));--active-shadow: var(--igx-button-active-shadow, var(--ig-elevation-8))}.analytics-btn,.analytics-btn [igxButton=fab],.analytics-btn .igx-button--fab{--shadow-color: var(--igx-button-shadow-color, transparent);--border-color: var(--igx-button-border-color, transparent);--hover-border-color: var(--igx-button-hover-border-color, transparent);--focus-border-color: var(--igx-button-focus-border-color, transparent);--focus-visible-border-color: var(--igx-button-focus-visible-border-color, transparent);--active-border-color: var(--igx-button-active-border-color, transparent);--disabled-border-color: var(--igx-button-disabled-border-color, transparent);--disabled-background: var(--igx-button-disabled-background, hsla(var(--ig-gray-300), var(--ig-gray-a)));--disabled-foreground: var(--igx-button-disabled-foreground, hsla(var(--ig-gray-500), var(--ig-gray-a)));--size: var(--igx-button-size, max(var(--is-large, 1) * max(3rem, -1 * 3rem), var(--is-medium, 1) * max(2.5rem, -1 * 2.5rem), var(--is-small, 1) * max(2rem, -1 * 2rem)));--resting-elevation: var(--igx-button-resting-elevation, var(--ig-elevation-6));--hover-elevation: var(--igx-button-hover-elevation, var(--ig-elevation-12));--focus-elevation: var(--igx-button-focus-elevation, var(--ig-elevation-12));--active-elevation: var(--igx-button-active-elevation, var(--ig-elevation-12));--background: var(--igx-button-background, #335e3b);--foreground: var(--igx-button-foreground, #fff);--hover-background: var(--igx-button-hover-background, #459a55);--hover-foreground: var(--igx-button-hover-foreground, black);--focus-background: var(--igx-button-focus-background, #396a42);--focus-foreground: var(--igx-button-focus-foreground, white);--focus-visible-background: var(--igx-button-focus-visible-background, #396a42);--focus-visible-foreground: var(--igx-button-focus-visible-foreground, white);--active-background: var(--igx-button-active-background, hsla(var(--ig-secondary-300), var(--ig-secondary-a)));--active-foreground: var(--igx-button-active-foreground, var(--ig-secondary-300-contrast));--border-radius: var(--igx-button-border-radius, 0);--resting-shadow: var(--igx-button-resting-shadow, var(--ig-elevation-6));--hover-shadow: var(--igx-button-hover-shadow, var(--ig-elevation-12));--focus-shadow: var(--igx-button-focus-shadow, var(--ig-elevation-12));--active-shadow: var(--igx-button-active-shadow, var(--ig-elevation-12))}.analytics-btn,.analytics-btn [igxButton=icon],.analytics-btn .igx-button--icon{--shadow-color: var(--igx-button-shadow-color, transparent);--border-color: var(--igx-button-border-color, transparent);--hover-border-color: var(--igx-button-hover-border-color, transparent);--focus-border-color: var(--igx-button-focus-border-color, hsla(var(--ig-gray-400), var(--ig-gray-a)));--focus-visible-border-color: var(--igx-button-focus-visible-border-color, hsla(var(--ig-gray-400), var(--ig-gray-a)));--active-border-color: var(--igx-button-active-border-color, hsla(var(--ig-gray-400), var(--ig-gray-a)));--disabled-border-color: var(--igx-button-disabled-border-color, transparent);--disabled-background: var(--igx-button-disabled-background, transparent);--disabled-foreground: var(--igx-button-disabled-foreground, hsla(var(--ig-gray-500), var(--ig-gray-a)));--size: var(--igx-button-size, max(var(--is-large, 1) * max(2.25rem, -1 * 2.25rem), var(--is-medium, 1) * max(1.875rem, -1 * 1.875rem), var(--is-small, 1) * max(1.5rem, -1 * 1.5rem)));--resting-elevation: var(--igx-button-resting-elevation, var(--ig-elevation-0));--hover-elevation: var(--igx-button-hover-elevation, var(--ig-elevation-0));--focus-elevation: var(--igx-button-focus-elevation, var(--ig-elevation-0));--active-elevation: var(--igx-button-active-elevation, var(--ig-elevation-0));--background: var(--igx-button-background, #335e3b);--foreground: var(--igx-button-foreground, #fff);--hover-background: var(--igx-button-hover-background, #459a55);--hover-foreground: var(--igx-button-hover-foreground, black);--focus-background: var(--igx-button-focus-background, #396a42);--focus-foreground: var(--igx-button-focus-foreground, white);--focus-visible-background: var(--igx-button-focus-visible-background, #396a42);--focus-visible-foreground: var(--igx-button-focus-visible-foreground, white);--active-background: var(--igx-button-active-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--active-foreground: var(--igx-button-active-foreground, hsla(var(--ig-gray-900), var(--ig-gray-a)));--border-radius: var(--igx-button-border-radius, 0);--resting-shadow: var(--igx-button-resting-shadow, var(--ig-elevation-0));--hover-shadow: var(--igx-button-hover-shadow, var(--ig-elevation-0));--focus-shadow: var(--igx-button-focus-shadow, var(--ig-elevation-0));--active-shadow: var(--igx-button-active-shadow, var(--ig-elevation-0))}.disableButton{opacity:.4;pointer-events:none}.clear,.more-action{display:flex;flex-flow:column;justify-content:center;border-left:1px solid #bdbdbd}.clear .btn,.clear .more-btn,.more-action .btn,.more-action .more-btn{width:68px;margin:0 0 7px;padding:0}.clear .more-btn,.more-action .more-btn{width:36px;height:36px;align-self:center;border-radius:20px}.clear .name,.more-action .name{font-size:.9rem;font-weight:400;text-align:center}.icon{pointer-events:none}.btn{display:inline-flex;flex-flow:column;align-items:center}.btn.condition{padding-right:16px}.btn.chart{padding-right:24px}.btn img,.btn span{pointer-events:none}.chart-preview{width:350px;height:300px;background-color:#fff;overflow:hidden}.chart-preview .chart-preview-title{margin:1rem;justify-content:center}.chart-preview .chart-preview-area{height:270px}::ng-deep .toggle-content{width:354px;max-width:358px;height:148px;background-color:#fff}::ng-deep .toggle-content,::ng-deep .toggle-content .ig-scrollbar{--scrollbar-size: var(--ig-scrollbar-scrollbar-size, 8px);--thumb-background: var(--ig-scrollbar-thumb-background, hsla(var(--ig-gray-400), var(--ig-gray-a)));--track-background: var(--ig-scrollbar-track-background, hsla(var(--ig-gray-100), var(--ig-gray-a)))}::ng-deep .toggle-content .tabs{display:flex!important;border:.2px solid;border-color:#d3d3d3}::ng-deep .toggle-content .tab-option{padding:.9rem;height:100px;width:358px;display:inline-flex;overflow-x:auto;overflow-y:hidden;white-space:nowrap;align-content:center}::ng-deep .toggle-content .tab-option .chartImgButton{width:48px;height:48px}::ng-deep .toggle-content .tab-option .imgSize,::ng-deep .toggle-content .clear.action .imgSize{width:36px;height:36px;align-self:center}::ng-deep .toggle-content .action{cursor:pointer;opacity:1}::ng-deep .toggle-content .action.selected{opacity:.62}::ng-deep .toggle-content .action.selected--condition{pointer-events:none;opacity:.62}\n"] }]
801
- }], ctorParameters: function () { return [{ type: i1$1.IgxOverlayService }]; }, propDecorators: { button: [{
802
- type: ViewChild,
803
- args: ['analyticsBtn']
804
- }], tabsMenu: [{
805
- type: ViewChild,
806
- args: ['tabsMenu', { read: IgxToggleDirective }]
807
- }], chartPreview: [{
808
- type: ViewChild,
809
- args: ['chartPreview', { read: ViewContainerRef }]
810
- }], chartPreviewDialog: [{
811
- type: ViewChild,
812
- args: ['chartPreviewDialog', { read: IgxToggleDirective }]
813
- }], tabs: [{
814
- type: ViewChild,
815
- args: [IgxTabsComponent]
654
+ class IgxContextMenuComponent {
655
+ constructor(overlayService) {
656
+ this.overlayService = overlayService;
657
+ this.chartTypes = [];
658
+ this.textFormatters = [];
659
+ this.destroy$ = new Subject();
660
+ this._chartDialogOS = { closeOnOutsideClick: false };
661
+ this._tabsMenuOverlaySettings = {
662
+ closeOnOutsideClick: false,
663
+ modal: false,
664
+ outlet: null,
665
+ scrollStrategy: new CloseScrollStrategy(),
666
+ positionStrategy: new AutoPositionStrategy({
667
+ horizontalDirection: HorizontalAlignment.Center,
668
+ horizontalStartPoint: HorizontalAlignment.Center,
669
+ verticalStartPoint: VerticalAlignment.Bottom,
670
+ verticalDirection: VerticalAlignment.Bottom,
671
+ openAnimation: null,
672
+ closeAnimation: null
673
+ })
674
+ };
675
+ this._chartPreviewDialogOverlaySettings = {
676
+ closeOnOutsideClick: false,
677
+ modal: false,
678
+ outlet: null,
679
+ scrollStrategy: new CloseScrollStrategy(),
680
+ positionStrategy: new AutoPositionStrategy({
681
+ horizontalDirection: HorizontalAlignment.Center,
682
+ horizontalStartPoint: HorizontalAlignment.Center,
683
+ verticalStartPoint: VerticalAlignment.Top,
684
+ verticalDirection: VerticalAlignment.Top,
685
+ openAnimation: null,
686
+ closeAnimation: null
687
+ })
688
+ };
689
+ this.chartImages = charts;
690
+ this.conditionImages = conditions;
691
+ }
692
+ ngAfterViewInit() {
693
+ this.chartTypes = this.contextDirective.charts;
694
+ this.textFormatters = this.contextDirective.formatters;
695
+ if (this.contextDirective.chartsDirective) {
696
+ this.contextDirective.chartsDirective.onChartTypesDetermined.pipe(takeUntil(this.destroy$))
697
+ .subscribe((args) => this.chartTypes = args.chartsForCreation);
698
+ }
699
+ if (this.contextDirective.textFormatter) {
700
+ this.contextDirective.textFormatter.onFormattersReady.pipe(takeUntil(this.destroy$))
701
+ .subscribe(names => this.textFormatters = names);
702
+ }
703
+ this.contextDirective.onButtonClose.pipe(takeUntil(this.destroy$))
704
+ .subscribe(() => { if (this.tabsMenu && !this.tabsMenu.collapsed) {
705
+ this.tabsMenu.close();
706
+ } });
707
+ this.contextDirective.gridResizeNotify.pipe(takeUntil(this.destroy$))
708
+ .subscribe(() => {
709
+ if (!this.tabsMenu.collapsed) {
710
+ this.tabsMenu.close();
711
+ }
712
+ });
713
+ this.tabsMenu.opening.pipe(takeUntil(this.destroy$))
714
+ .subscribe(() => {
715
+ if (this.tabs.selectedItem.disabled) {
716
+ debugger;
717
+ // const i = this.tabs.items.find(tab => !tab.disabled)?.index || 0;
718
+ // this.tabs.selectTab(this.tabs.tabs.toArray()[i], true);
719
+ }
720
+ });
721
+ this.overlayService.opening.pipe(takeUntil(this.destroy$))
722
+ .subscribe((args) => {
723
+ if (args.componentRef) {
724
+ const instance = args.componentRef.instance;
725
+ instance.width = this.contextDirective.grid.nativeElement.clientWidth;
726
+ instance.height = this.contextDirective.grid.nativeElement.clientHeight;
727
+ instance.currentChartType = this.currentChartType;
728
+ instance.allCharts = this.chartTypes;
729
+ instance.chartDirective = this.contextDirective.chartsDirective;
730
+ instance.onClose?.subscribe(() => {
731
+ this.closeDialog();
732
+ });
733
+ instance.chartDialogResizeNotify?.subscribe(resizedContentArgs => {
734
+ // This is a temporary fix, which should be removed right after
735
+ // the overlay service is capable of notifying the overlay content elements
736
+ // that their children has been resized.
737
+ if (this.overlayService._overlayElement.children[1]) {
738
+ // tslint:disable-next-line: max-line-length
739
+ this.overlayService._overlayElement.children[1].children[0].style.width = resizedContentArgs[0].contentRect.width + 'px';
740
+ }
741
+ });
742
+ }
743
+ });
744
+ this.overlayService.closing.pipe(takeUntil(this.destroy$))
745
+ .subscribe((args) => {
746
+ if (args.componentRef && args.componentRef.instance instanceof IgxChartMenuComponent) {
747
+ if (this._dialogId) {
748
+ this.tabsMenu.open(this._tabsMenuOverlaySettings);
749
+ }
750
+ }
751
+ });
752
+ }
753
+ ngOnDestroy() {
754
+ this.destroy$.next(true);
755
+ this.destroy$.complete();
756
+ }
757
+ toggleTabMenu() {
758
+ this.currentChartType = this.currentChartType ? this.currentChartType : CHART_TYPE.COLUMN_GROUPED;
759
+ this._tabsMenuOverlaySettings.target = this.button.nativeElement;
760
+ this.tabsMenu.collapsed ? this.tabsMenu.open(this._tabsMenuOverlaySettings) : this.tabsMenu.close();
761
+ }
762
+ formatCells(condition) {
763
+ this.currentFormatter = condition;
764
+ this.contextDirective.textFormatter.formatCells(condition);
765
+ }
766
+ clearFormat() {
767
+ this.contextDirective.textFormatter.clearFormatting();
768
+ this.currentFormatter = undefined;
769
+ }
770
+ previewChart(currentChartType) {
771
+ this.currentChartType = currentChartType;
772
+ this.chartPreview.clear();
773
+ this.contextDirective.chartsDirective.chartFactory(currentChartType, this.chartPreview);
774
+ this._chartPreviewDialogOverlaySettings.target = this.tabsMenu.element;
775
+ this.chartPreviewDialog.open(this._chartPreviewDialogOverlaySettings);
776
+ }
777
+ hidePreview() {
778
+ this.chartPreviewDialog.close();
779
+ }
780
+ openDialog(type) {
781
+ this.currentChartType = type ? type : this.currentChartType ? this.currentChartType : CHART_TYPE.COLUMN_GROUPED;
782
+ this._dialogId = this._dialogId ? this._dialogId :
783
+ this.overlayService.attach(IgxChartMenuComponent, this._chartDialogOS);
784
+ this.tabsMenu.close();
785
+ this.overlayService.show(this._dialogId);
786
+ }
787
+ closeDialog() {
788
+ const info = this.overlayService.getOverlayById(this._dialogId);
789
+ if (info) {
790
+ this.overlayService.hide(this._dialogId);
791
+ this.overlayService.detach(this._dialogId);
792
+ this._dialogId = undefined;
793
+ }
794
+ }
795
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: IgxContextMenuComponent, deps: [{ token: i1$1.IgxOverlayService }], target: i0.ɵɵFactoryTarget.Component }); }
796
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.0", type: IgxContextMenuComponent, selector: "igx-context-menu", viewQueries: [{ propertyName: "button", first: true, predicate: ["analyticsBtn"], descendants: true }, { propertyName: "tabsMenu", first: true, predicate: ["tabsMenu"], descendants: true, read: IgxToggleDirective }, { propertyName: "chartPreview", first: true, predicate: ["chartPreview"], descendants: true, read: ViewContainerRef }, { propertyName: "chartPreviewDialog", first: true, predicate: ["chartPreviewDialog"], descendants: true, read: IgxToggleDirective }, { propertyName: "tabs", first: true, predicate: IgxTabsComponent, descendants: true }], ngImport: i0, template: "<span #analyticsBtn class=\"analytics-btn\">\r\n <button #btn igxButton=\"icon\" (click)=\"toggleTabMenu()\">\r\n <igx-icon #icon class=\"icon\" family=\"material\">insert_chart_outlined</igx-icon>\r\n </button>\r\n</span>\r\n<div #tabsMenu igxToggle class=\"toggle-content ig-scrollbar\">\r\n <!--NOTE: This component has been updated by Infragistics migration: v12.0.0\r\nPlease check your template whether all bindings/event handlers are correct.-->\r\n <igx-tabs tabsType=\"fixed\" [selectedIndex]=\"!this.textFormatters.length && chartTypes.length ? 1 : 0\">\r\n <igx-tab-item [disabled]=\"!textFormatters.length\">\r\n <igx-tab-header>\r\n <span igxTabHeaderLabel>Conditional Formatting</span>\r\n </igx-tab-header>\r\n <igx-tab-content>\r\n <igc-trial-watermark></igc-trial-watermark>\r\n <div class=\"tabs\">\r\n <span class=\"tab-option\">\r\n <span *ngFor=\"let condition of textFormatters\" class=\"action btn condition\"\r\n [ngClass]=\"{'selected--condition': condition === currentFormatter}\"\r\n (click)=\"formatCells(condition)\">\r\n <div class=\"imgSize\" [innerHTML]=\"conditionImages[condition.replace(' ', '')] | svg\">\r\n </div>\r\n <span class=\"name\">{{condition.replace('10', '10%')}}</span>\r\n </span>\r\n </span>\r\n <span class=\"clear action\"\r\n [ngClass]=\"{'disableButton': contextDirective.textFormatter ? !contextDirective.textFormatter.formatter : true }\"\r\n (click)=\"clearFormat()\">\r\n <div class=\"imgSize\" [innerHTML]=\"conditionImages['Clear'] | svg\">\r\n </div>\r\n <span class=\"btn name\">Clear All</span>\r\n </span>\r\n </div>\r\n </igx-tab-content>\r\n </igx-tab-item>\r\n <igx-tab-item [disabled]=\"!chartTypes.length\">\r\n <igx-tab-header>\r\n <span igxTabHeaderLabel>Create Chart</span>\r\n </igx-tab-header>\r\n <igx-tab-content>\r\n <igc-trial-watermark></igc-trial-watermark>\r\n <div class=\"tabs\">\r\n <span class=\"tab-option\">\r\n <span *ngFor=\"let chart of chartTypes | slice:0:4\" class=\"action btn chart\"\r\n [ngClass]=\"{'selected': chart === currentChartType}\" (mouseenter)=\"previewChart(chart)\"\r\n (mouseleave)=\"hidePreview()\" (click)=\"openDialog(chart)\">\r\n <span [innerHTML]=\"chartImages[chart] | svg\" class=\"imgSize\">\r\n </span>\r\n <span class=\"name\">{{chart}}</span>\r\n </span>\r\n </span>\r\n <span class=\"more-action chart\" [ngClass]=\"{'disableButton': !chartTypes.length}\"\r\n (click)=\"openDialog()\">\r\n <button class=\"more-btn more-icon\" igxButton=\"icon\" igxButtonBackground=\"#EBEBEB\"\r\n igxButtonColor=\"black\">\r\n <igx-icon class=\"icon\" family=\"material\">more_horiz</igx-icon>\r\n </button>\r\n <span class=\"name btn\">More...</span>\r\n </span>\r\n </div>\r\n </igx-tab-content>\r\n </igx-tab-item>\r\n </igx-tabs>\r\n</div>\r\n<div igxToggle #chartPreviewDialog class=\"chart-preview\">\r\n <div class=\"chart-preview-title\">\r\n <h5>Preview Chart</h5>\r\n </div>\r\n <div class=\"chart-preview-area\">\r\n <ng-template #chartPreview></ng-template>\r\n </div>\r\n</div>", styles: [".analytics-btn,.analytics-btn [igxButton=flat],.analytics-btn .igx-button--flat{--shadow-color: var(--igx-button-shadow-color, transparent);--border-color: var(--igx-button-border-color, transparent);--hover-border-color: var(--igx-button-hover-border-color, transparent);--focus-border-color: var(--igx-button-focus-border-color, transparent);--focus-visible-border-color: var(--igx-button-focus-visible-border-color, transparent);--active-border-color: var(--igx-button-active-border-color, transparent);--disabled-border-color: var(--igx-button-disabled-border-color, transparent);--disabled-background: var(--igx-button-disabled-background, transparent);--disabled-foreground: var(--igx-button-disabled-foreground, hsla(var(--ig-gray-500), var(--ig-gray-a)));--size: var(--igx-button-size, max(var(--is-large, 1) * max(2.25rem, -1 * 2.25rem), var(--is-medium, 1) * max(1.875rem, -1 * 1.875rem), var(--is-small, 1) * max(1.5rem, -1 * 1.5rem)));--default-size: var(--igx-button-default-size, 1);--resting-elevation: var(--igx-button-resting-elevation, var(--ig-elevation-0));--hover-elevation: var(--igx-button-hover-elevation, var(--ig-elevation-0));--focus-elevation: var(--igx-button-focus-elevation, var(--ig-elevation-0));--active-elevation: var(--igx-button-active-elevation, var(--ig-elevation-0));--background: var(--igx-button-background, #335e3b);--foreground: var(--igx-button-foreground, #fff);--hover-background: var(--igx-button-hover-background, #459a55);--hover-foreground: var(--igx-button-hover-foreground, black);--focus-background: var(--igx-button-focus-background, #396a42);--focus-foreground: var(--igx-button-focus-foreground, white);--focus-visible-background: var(--igx-button-focus-visible-background, #396a42);--focus-visible-foreground: var(--igx-button-focus-visible-foreground, white);--active-background: var(--igx-button-active-background, hsla(var(--ig-secondary-400), .12));--active-foreground: var(--igx-button-active-foreground, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--border-radius: var(--igx-button-border-radius, 0);--resting-shadow: var(--igx-button-resting-shadow, var(--ig-elevation-0));--hover-shadow: var(--igx-button-hover-shadow, var(--ig-elevation-0));--focus-shadow: var(--igx-button-focus-shadow, var(--ig-elevation-0));--active-shadow: var(--igx-button-active-shadow, var(--ig-elevation-0))}.analytics-btn,.analytics-btn [igxButton=outlined],.analytics-btn .igx-button--outlined{--shadow-color: var(--igx-button-shadow-color, transparent);--border-color: var(--igx-button-border-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--hover-border-color: var(--igx-button-hover-border-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--focus-border-color: var(--igx-button-focus-border-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--focus-visible-border-color: var(--igx-button-focus-visible-border-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--active-border-color: var(--igx-button-active-border-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--disabled-border-color: var(--igx-button-disabled-border-color, hsla(var(--ig-gray-300), var(--ig-gray-a)));--disabled-background: var(--igx-button-disabled-background, transparent);--disabled-foreground: var(--igx-button-disabled-foreground, hsla(var(--ig-gray-500), var(--ig-gray-a)));--size: var(--igx-button-size, max(var(--is-large, 1) * max(2.25rem, -1 * 2.25rem), var(--is-medium, 1) * max(1.875rem, -1 * 1.875rem), var(--is-small, 1) * max(1.5rem, -1 * 1.5rem)));--default-size: var(--igx-button-default-size, 1);--resting-elevation: var(--igx-button-resting-elevation, var(--ig-elevation-0));--hover-elevation: var(--igx-button-hover-elevation, var(--ig-elevation-0));--focus-elevation: var(--igx-button-focus-elevation, var(--ig-elevation-0));--active-elevation: var(--igx-button-active-elevation, var(--ig-elevation-0));--background: var(--igx-button-background, #335e3b);--foreground: var(--igx-button-foreground, #fff);--hover-background: var(--igx-button-hover-background, #459a55);--hover-foreground: var(--igx-button-hover-foreground, black);--focus-background: var(--igx-button-focus-background, #396a42);--focus-foreground: var(--igx-button-focus-foreground, white);--focus-visible-background: var(--igx-button-focus-visible-background, #396a42);--focus-visible-foreground: var(--igx-button-focus-visible-foreground, white);--active-background: var(--igx-button-active-background, hsla(var(--ig-secondary-400), .12));--active-foreground: var(--igx-button-active-foreground, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--border-radius: var(--igx-button-border-radius, 0);--resting-shadow: var(--igx-button-resting-shadow, var(--ig-elevation-0));--hover-shadow: var(--igx-button-hover-shadow, var(--ig-elevation-0));--focus-shadow: var(--igx-button-focus-shadow, var(--ig-elevation-0));--active-shadow: var(--igx-button-active-shadow, var(--ig-elevation-0))}.analytics-btn,.analytics-btn [igxButton=raised],.analytics-btn .igx-button--raised{--shadow-color: var(--igx-button-shadow-color, transparent);--border-color: var(--igx-button-border-color, transparent);--hover-border-color: var(--igx-button-hover-border-color, transparent);--focus-border-color: var(--igx-button-focus-border-color, transparent);--focus-visible-border-color: var(--igx-button-focus-visible-border-color, transparent);--active-border-color: var(--igx-button-active-border-color, transparent);--disabled-border-color: var(--igx-button-disabled-border-color, transparent);--disabled-background: var(--igx-button-disabled-background, hsla(var(--ig-gray-300), var(--ig-gray-a)));--disabled-foreground: var(--igx-button-disabled-foreground, hsla(var(--ig-gray-500), var(--ig-gray-a)));--size: var(--igx-button-size, max(var(--is-large, 1) * max(2.25rem, -1 * 2.25rem), var(--is-medium, 1) * max(1.875rem, -1 * 1.875rem), var(--is-small, 1) * max(1.5rem, -1 * 1.5rem)));--default-size: var(--igx-button-default-size, 1);--resting-elevation: var(--igx-button-resting-elevation, var(--ig-elevation-2));--hover-elevation: var(--igx-button-hover-elevation, var(--ig-elevation-4));--focus-elevation: var(--igx-button-focus-elevation, var(--ig-elevation-8));--active-elevation: var(--igx-button-active-elevation, var(--ig-elevation-8));--background: var(--igx-button-background, #335e3b);--foreground: var(--igx-button-foreground, #fff);--hover-background: var(--igx-button-hover-background, #459a55);--hover-foreground: var(--igx-button-hover-foreground, black);--focus-background: var(--igx-button-focus-background, #396a42);--focus-foreground: var(--igx-button-focus-foreground, white);--focus-visible-background: var(--igx-button-focus-visible-background, #396a42);--focus-visible-foreground: var(--igx-button-focus-visible-foreground, white);--active-background: var(--igx-button-active-background, hsla(var(--ig-secondary-300), var(--ig-secondary-a)));--active-foreground: var(--igx-button-active-foreground, var(--ig-secondary-300-contrast));--border-radius: var(--igx-button-border-radius, 0);--resting-shadow: var(--igx-button-resting-shadow, var(--ig-elevation-2));--hover-shadow: var(--igx-button-hover-shadow, var(--ig-elevation-4));--focus-shadow: var(--igx-button-focus-shadow, var(--ig-elevation-8));--active-shadow: var(--igx-button-active-shadow, var(--ig-elevation-8))}.analytics-btn,.analytics-btn [igxButton=fab],.analytics-btn .igx-button--fab{--shadow-color: var(--igx-button-shadow-color, transparent);--border-color: var(--igx-button-border-color, transparent);--hover-border-color: var(--igx-button-hover-border-color, transparent);--focus-border-color: var(--igx-button-focus-border-color, transparent);--focus-visible-border-color: var(--igx-button-focus-visible-border-color, transparent);--active-border-color: var(--igx-button-active-border-color, transparent);--disabled-border-color: var(--igx-button-disabled-border-color, transparent);--disabled-background: var(--igx-button-disabled-background, hsla(var(--ig-gray-300), var(--ig-gray-a)));--disabled-foreground: var(--igx-button-disabled-foreground, hsla(var(--ig-gray-500), var(--ig-gray-a)));--size: var(--igx-button-size, max(var(--is-large, 1) * max(3rem, -1 * 3rem), var(--is-medium, 1) * max(2.5rem, -1 * 2.5rem), var(--is-small, 1) * max(2rem, -1 * 2rem)));--default-size: var(--igx-button-default-size, 1);--resting-elevation: var(--igx-button-resting-elevation, var(--ig-elevation-6));--hover-elevation: var(--igx-button-hover-elevation, var(--ig-elevation-12));--focus-elevation: var(--igx-button-focus-elevation, var(--ig-elevation-12));--active-elevation: var(--igx-button-active-elevation, var(--ig-elevation-12));--background: var(--igx-button-background, #335e3b);--foreground: var(--igx-button-foreground, #fff);--hover-background: var(--igx-button-hover-background, #459a55);--hover-foreground: var(--igx-button-hover-foreground, black);--focus-background: var(--igx-button-focus-background, #396a42);--focus-foreground: var(--igx-button-focus-foreground, white);--focus-visible-background: var(--igx-button-focus-visible-background, #396a42);--focus-visible-foreground: var(--igx-button-focus-visible-foreground, white);--active-background: var(--igx-button-active-background, hsla(var(--ig-secondary-300), var(--ig-secondary-a)));--active-foreground: var(--igx-button-active-foreground, var(--ig-secondary-300-contrast));--border-radius: var(--igx-button-border-radius, 0);--resting-shadow: var(--igx-button-resting-shadow, var(--ig-elevation-6));--hover-shadow: var(--igx-button-hover-shadow, var(--ig-elevation-12));--focus-shadow: var(--igx-button-focus-shadow, var(--ig-elevation-12));--active-shadow: var(--igx-button-active-shadow, var(--ig-elevation-12))}.analytics-btn,.analytics-btn [igxButton=icon],.analytics-btn .igx-button--icon{--shadow-color: var(--igx-button-shadow-color, transparent);--border-color: var(--igx-button-border-color, transparent);--hover-border-color: var(--igx-button-hover-border-color, transparent);--focus-border-color: var(--igx-button-focus-border-color, hsla(var(--ig-gray-400), var(--ig-gray-a)));--focus-visible-border-color: var(--igx-button-focus-visible-border-color, hsla(var(--ig-gray-400), var(--ig-gray-a)));--active-border-color: var(--igx-button-active-border-color, hsla(var(--ig-gray-400), var(--ig-gray-a)));--disabled-border-color: var(--igx-button-disabled-border-color, transparent);--disabled-background: var(--igx-button-disabled-background, transparent);--disabled-foreground: var(--igx-button-disabled-foreground, hsla(var(--ig-gray-500), var(--ig-gray-a)));--size: var(--igx-button-size, max(var(--is-large, 1) * max(2.25rem, -1 * 2.25rem), var(--is-medium, 1) * max(1.875rem, -1 * 1.875rem), var(--is-small, 1) * max(1.5rem, -1 * 1.5rem)));--default-size: var(--igx-button-default-size, 2);--resting-elevation: var(--igx-button-resting-elevation, var(--ig-elevation-0));--hover-elevation: var(--igx-button-hover-elevation, var(--ig-elevation-0));--focus-elevation: var(--igx-button-focus-elevation, var(--ig-elevation-0));--active-elevation: var(--igx-button-active-elevation, var(--ig-elevation-0));--background: var(--igx-button-background, #335e3b);--foreground: var(--igx-button-foreground, #fff);--hover-background: var(--igx-button-hover-background, #459a55);--hover-foreground: var(--igx-button-hover-foreground, black);--focus-background: var(--igx-button-focus-background, #396a42);--focus-foreground: var(--igx-button-focus-foreground, white);--focus-visible-background: var(--igx-button-focus-visible-background, #396a42);--focus-visible-foreground: var(--igx-button-focus-visible-foreground, white);--active-background: var(--igx-button-active-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--active-foreground: var(--igx-button-active-foreground, hsla(var(--ig-gray-900), var(--ig-gray-a)));--border-radius: var(--igx-button-border-radius, 0);--resting-shadow: var(--igx-button-resting-shadow, var(--ig-elevation-0));--hover-shadow: var(--igx-button-hover-shadow, var(--ig-elevation-0));--focus-shadow: var(--igx-button-focus-shadow, var(--ig-elevation-0));--active-shadow: var(--igx-button-active-shadow, var(--ig-elevation-0))}.disableButton{opacity:.4;pointer-events:none}.clear,.more-action{display:flex;flex-flow:column;justify-content:center;border-left:1px solid #bdbdbd}.clear .btn,.clear .more-btn,.more-action .btn,.more-action .more-btn{width:68px;margin:0 0 7px;padding:0}.clear .more-btn,.more-action .more-btn{width:36px;height:36px;align-self:center;border-radius:20px}.clear .name,.more-action .name{font-size:.9rem;font-weight:400;text-align:center}.icon{pointer-events:none}.btn{display:inline-flex;flex-flow:column;align-items:center}.btn.condition{padding-right:16px}.btn.chart{padding-right:24px}.btn img,.btn span{pointer-events:none}.chart-preview{width:350px;height:300px;background-color:#fff;overflow:hidden}.chart-preview .chart-preview-title{margin:1rem;justify-content:center}.chart-preview .chart-preview-area{height:270px}::ng-deep .toggle-content{width:354px;max-width:358px;height:148px;background-color:#fff}::ng-deep .toggle-content,::ng-deep .toggle-content .ig-scrollbar{--scrollbar-size: var(--ig-scrollbar-scrollbar-size, 8px);--thumb-background: var(--ig-scrollbar-thumb-background, hsla(var(--ig-gray-400), var(--ig-gray-a)));--track-background: var(--ig-scrollbar-track-background, hsla(var(--ig-gray-100), var(--ig-gray-a)))}::ng-deep .toggle-content .tabs{display:flex!important;border:.2px solid;border-color:#d3d3d3}::ng-deep .toggle-content .tab-option{padding:.9rem;height:100px;width:358px;display:inline-flex;overflow-x:auto;overflow-y:hidden;white-space:nowrap;align-content:center}::ng-deep .toggle-content .tab-option .chartImgButton{width:48px;height:48px}::ng-deep .toggle-content .tab-option .imgSize,::ng-deep .toggle-content .clear.action .imgSize{width:36px;height:36px;align-self:center}::ng-deep .toggle-content .action{cursor:pointer;opacity:1}::ng-deep .toggle-content .action.selected{opacity:.62}::ng-deep .toggle-content .action.selected--condition{pointer-events:none;opacity:.62}\n"], dependencies: [{ kind: "directive", type: i1$1.IgxButtonDirective, selector: "[igxButton]", inputs: ["selected", "igxButton", "igxButtonColor", "igxButtonBackground", "igxLabel", "disabled"], outputs: ["buttonClick", "buttonSelected"] }, { kind: "component", type: i1$1.IgxTabsComponent, selector: "igx-tabs", inputs: ["tabAlignment"] }, { kind: "component", type: i1$1.IgxTabItemComponent, selector: "igx-tab-item" }, { kind: "component", type: i1$1.IgxTabHeaderComponent, selector: "igx-tab-header" }, { kind: "component", type: i1$1.IgxTabContentComponent, selector: "igx-tab-content" }, { kind: "directive", type: i1$1.IgxTabHeaderLabelDirective, selector: "igx-tab-header-label,[igxTabHeaderLabel]" }, { kind: "directive", type: i1$1.IgxToggleDirective, selector: "[igxToggle]", inputs: ["id"], outputs: ["opened", "opening", "closed", "closing", "appended"], exportAs: ["toggle"] }, { kind: "component", type: i1$1.IgxIconComponent, selector: "igx-icon", inputs: ["family", "active", "name"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: i2.SlicePipe, name: "slice" }, { kind: "pipe", type: SvgPipe, name: "svg" }] }); }
797
+ }
798
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: IgxContextMenuComponent, decorators: [{
799
+ type: Component,
800
+ args: [{ selector: 'igx-context-menu', template: "<span #analyticsBtn class=\"analytics-btn\">\r\n <button #btn igxButton=\"icon\" (click)=\"toggleTabMenu()\">\r\n <igx-icon #icon class=\"icon\" family=\"material\">insert_chart_outlined</igx-icon>\r\n </button>\r\n</span>\r\n<div #tabsMenu igxToggle class=\"toggle-content ig-scrollbar\">\r\n <!--NOTE: This component has been updated by Infragistics migration: v12.0.0\r\nPlease check your template whether all bindings/event handlers are correct.-->\r\n <igx-tabs tabsType=\"fixed\" [selectedIndex]=\"!this.textFormatters.length && chartTypes.length ? 1 : 0\">\r\n <igx-tab-item [disabled]=\"!textFormatters.length\">\r\n <igx-tab-header>\r\n <span igxTabHeaderLabel>Conditional Formatting</span>\r\n </igx-tab-header>\r\n <igx-tab-content>\r\n <igc-trial-watermark></igc-trial-watermark>\r\n <div class=\"tabs\">\r\n <span class=\"tab-option\">\r\n <span *ngFor=\"let condition of textFormatters\" class=\"action btn condition\"\r\n [ngClass]=\"{'selected--condition': condition === currentFormatter}\"\r\n (click)=\"formatCells(condition)\">\r\n <div class=\"imgSize\" [innerHTML]=\"conditionImages[condition.replace(' ', '')] | svg\">\r\n </div>\r\n <span class=\"name\">{{condition.replace('10', '10%')}}</span>\r\n </span>\r\n </span>\r\n <span class=\"clear action\"\r\n [ngClass]=\"{'disableButton': contextDirective.textFormatter ? !contextDirective.textFormatter.formatter : true }\"\r\n (click)=\"clearFormat()\">\r\n <div class=\"imgSize\" [innerHTML]=\"conditionImages['Clear'] | svg\">\r\n </div>\r\n <span class=\"btn name\">Clear All</span>\r\n </span>\r\n </div>\r\n </igx-tab-content>\r\n </igx-tab-item>\r\n <igx-tab-item [disabled]=\"!chartTypes.length\">\r\n <igx-tab-header>\r\n <span igxTabHeaderLabel>Create Chart</span>\r\n </igx-tab-header>\r\n <igx-tab-content>\r\n <igc-trial-watermark></igc-trial-watermark>\r\n <div class=\"tabs\">\r\n <span class=\"tab-option\">\r\n <span *ngFor=\"let chart of chartTypes | slice:0:4\" class=\"action btn chart\"\r\n [ngClass]=\"{'selected': chart === currentChartType}\" (mouseenter)=\"previewChart(chart)\"\r\n (mouseleave)=\"hidePreview()\" (click)=\"openDialog(chart)\">\r\n <span [innerHTML]=\"chartImages[chart] | svg\" class=\"imgSize\">\r\n </span>\r\n <span class=\"name\">{{chart}}</span>\r\n </span>\r\n </span>\r\n <span class=\"more-action chart\" [ngClass]=\"{'disableButton': !chartTypes.length}\"\r\n (click)=\"openDialog()\">\r\n <button class=\"more-btn more-icon\" igxButton=\"icon\" igxButtonBackground=\"#EBEBEB\"\r\n igxButtonColor=\"black\">\r\n <igx-icon class=\"icon\" family=\"material\">more_horiz</igx-icon>\r\n </button>\r\n <span class=\"name btn\">More...</span>\r\n </span>\r\n </div>\r\n </igx-tab-content>\r\n </igx-tab-item>\r\n </igx-tabs>\r\n</div>\r\n<div igxToggle #chartPreviewDialog class=\"chart-preview\">\r\n <div class=\"chart-preview-title\">\r\n <h5>Preview Chart</h5>\r\n </div>\r\n <div class=\"chart-preview-area\">\r\n <ng-template #chartPreview></ng-template>\r\n </div>\r\n</div>", styles: [".analytics-btn,.analytics-btn [igxButton=flat],.analytics-btn .igx-button--flat{--shadow-color: var(--igx-button-shadow-color, transparent);--border-color: var(--igx-button-border-color, transparent);--hover-border-color: var(--igx-button-hover-border-color, transparent);--focus-border-color: var(--igx-button-focus-border-color, transparent);--focus-visible-border-color: var(--igx-button-focus-visible-border-color, transparent);--active-border-color: var(--igx-button-active-border-color, transparent);--disabled-border-color: var(--igx-button-disabled-border-color, transparent);--disabled-background: var(--igx-button-disabled-background, transparent);--disabled-foreground: var(--igx-button-disabled-foreground, hsla(var(--ig-gray-500), var(--ig-gray-a)));--size: var(--igx-button-size, max(var(--is-large, 1) * max(2.25rem, -1 * 2.25rem), var(--is-medium, 1) * max(1.875rem, -1 * 1.875rem), var(--is-small, 1) * max(1.5rem, -1 * 1.5rem)));--default-size: var(--igx-button-default-size, 1);--resting-elevation: var(--igx-button-resting-elevation, var(--ig-elevation-0));--hover-elevation: var(--igx-button-hover-elevation, var(--ig-elevation-0));--focus-elevation: var(--igx-button-focus-elevation, var(--ig-elevation-0));--active-elevation: var(--igx-button-active-elevation, var(--ig-elevation-0));--background: var(--igx-button-background, #335e3b);--foreground: var(--igx-button-foreground, #fff);--hover-background: var(--igx-button-hover-background, #459a55);--hover-foreground: var(--igx-button-hover-foreground, black);--focus-background: var(--igx-button-focus-background, #396a42);--focus-foreground: var(--igx-button-focus-foreground, white);--focus-visible-background: var(--igx-button-focus-visible-background, #396a42);--focus-visible-foreground: var(--igx-button-focus-visible-foreground, white);--active-background: var(--igx-button-active-background, hsla(var(--ig-secondary-400), .12));--active-foreground: var(--igx-button-active-foreground, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--border-radius: var(--igx-button-border-radius, 0);--resting-shadow: var(--igx-button-resting-shadow, var(--ig-elevation-0));--hover-shadow: var(--igx-button-hover-shadow, var(--ig-elevation-0));--focus-shadow: var(--igx-button-focus-shadow, var(--ig-elevation-0));--active-shadow: var(--igx-button-active-shadow, var(--ig-elevation-0))}.analytics-btn,.analytics-btn [igxButton=outlined],.analytics-btn .igx-button--outlined{--shadow-color: var(--igx-button-shadow-color, transparent);--border-color: var(--igx-button-border-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--hover-border-color: var(--igx-button-hover-border-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--focus-border-color: var(--igx-button-focus-border-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--focus-visible-border-color: var(--igx-button-focus-visible-border-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--active-border-color: var(--igx-button-active-border-color, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--disabled-border-color: var(--igx-button-disabled-border-color, hsla(var(--ig-gray-300), var(--ig-gray-a)));--disabled-background: var(--igx-button-disabled-background, transparent);--disabled-foreground: var(--igx-button-disabled-foreground, hsla(var(--ig-gray-500), var(--ig-gray-a)));--size: var(--igx-button-size, max(var(--is-large, 1) * max(2.25rem, -1 * 2.25rem), var(--is-medium, 1) * max(1.875rem, -1 * 1.875rem), var(--is-small, 1) * max(1.5rem, -1 * 1.5rem)));--default-size: var(--igx-button-default-size, 1);--resting-elevation: var(--igx-button-resting-elevation, var(--ig-elevation-0));--hover-elevation: var(--igx-button-hover-elevation, var(--ig-elevation-0));--focus-elevation: var(--igx-button-focus-elevation, var(--ig-elevation-0));--active-elevation: var(--igx-button-active-elevation, var(--ig-elevation-0));--background: var(--igx-button-background, #335e3b);--foreground: var(--igx-button-foreground, #fff);--hover-background: var(--igx-button-hover-background, #459a55);--hover-foreground: var(--igx-button-hover-foreground, black);--focus-background: var(--igx-button-focus-background, #396a42);--focus-foreground: var(--igx-button-focus-foreground, white);--focus-visible-background: var(--igx-button-focus-visible-background, #396a42);--focus-visible-foreground: var(--igx-button-focus-visible-foreground, white);--active-background: var(--igx-button-active-background, hsla(var(--ig-secondary-400), .12));--active-foreground: var(--igx-button-active-foreground, hsla(var(--ig-secondary-500), var(--ig-secondary-a)));--border-radius: var(--igx-button-border-radius, 0);--resting-shadow: var(--igx-button-resting-shadow, var(--ig-elevation-0));--hover-shadow: var(--igx-button-hover-shadow, var(--ig-elevation-0));--focus-shadow: var(--igx-button-focus-shadow, var(--ig-elevation-0));--active-shadow: var(--igx-button-active-shadow, var(--ig-elevation-0))}.analytics-btn,.analytics-btn [igxButton=raised],.analytics-btn .igx-button--raised{--shadow-color: var(--igx-button-shadow-color, transparent);--border-color: var(--igx-button-border-color, transparent);--hover-border-color: var(--igx-button-hover-border-color, transparent);--focus-border-color: var(--igx-button-focus-border-color, transparent);--focus-visible-border-color: var(--igx-button-focus-visible-border-color, transparent);--active-border-color: var(--igx-button-active-border-color, transparent);--disabled-border-color: var(--igx-button-disabled-border-color, transparent);--disabled-background: var(--igx-button-disabled-background, hsla(var(--ig-gray-300), var(--ig-gray-a)));--disabled-foreground: var(--igx-button-disabled-foreground, hsla(var(--ig-gray-500), var(--ig-gray-a)));--size: var(--igx-button-size, max(var(--is-large, 1) * max(2.25rem, -1 * 2.25rem), var(--is-medium, 1) * max(1.875rem, -1 * 1.875rem), var(--is-small, 1) * max(1.5rem, -1 * 1.5rem)));--default-size: var(--igx-button-default-size, 1);--resting-elevation: var(--igx-button-resting-elevation, var(--ig-elevation-2));--hover-elevation: var(--igx-button-hover-elevation, var(--ig-elevation-4));--focus-elevation: var(--igx-button-focus-elevation, var(--ig-elevation-8));--active-elevation: var(--igx-button-active-elevation, var(--ig-elevation-8));--background: var(--igx-button-background, #335e3b);--foreground: var(--igx-button-foreground, #fff);--hover-background: var(--igx-button-hover-background, #459a55);--hover-foreground: var(--igx-button-hover-foreground, black);--focus-background: var(--igx-button-focus-background, #396a42);--focus-foreground: var(--igx-button-focus-foreground, white);--focus-visible-background: var(--igx-button-focus-visible-background, #396a42);--focus-visible-foreground: var(--igx-button-focus-visible-foreground, white);--active-background: var(--igx-button-active-background, hsla(var(--ig-secondary-300), var(--ig-secondary-a)));--active-foreground: var(--igx-button-active-foreground, var(--ig-secondary-300-contrast));--border-radius: var(--igx-button-border-radius, 0);--resting-shadow: var(--igx-button-resting-shadow, var(--ig-elevation-2));--hover-shadow: var(--igx-button-hover-shadow, var(--ig-elevation-4));--focus-shadow: var(--igx-button-focus-shadow, var(--ig-elevation-8));--active-shadow: var(--igx-button-active-shadow, var(--ig-elevation-8))}.analytics-btn,.analytics-btn [igxButton=fab],.analytics-btn .igx-button--fab{--shadow-color: var(--igx-button-shadow-color, transparent);--border-color: var(--igx-button-border-color, transparent);--hover-border-color: var(--igx-button-hover-border-color, transparent);--focus-border-color: var(--igx-button-focus-border-color, transparent);--focus-visible-border-color: var(--igx-button-focus-visible-border-color, transparent);--active-border-color: var(--igx-button-active-border-color, transparent);--disabled-border-color: var(--igx-button-disabled-border-color, transparent);--disabled-background: var(--igx-button-disabled-background, hsla(var(--ig-gray-300), var(--ig-gray-a)));--disabled-foreground: var(--igx-button-disabled-foreground, hsla(var(--ig-gray-500), var(--ig-gray-a)));--size: var(--igx-button-size, max(var(--is-large, 1) * max(3rem, -1 * 3rem), var(--is-medium, 1) * max(2.5rem, -1 * 2.5rem), var(--is-small, 1) * max(2rem, -1 * 2rem)));--default-size: var(--igx-button-default-size, 1);--resting-elevation: var(--igx-button-resting-elevation, var(--ig-elevation-6));--hover-elevation: var(--igx-button-hover-elevation, var(--ig-elevation-12));--focus-elevation: var(--igx-button-focus-elevation, var(--ig-elevation-12));--active-elevation: var(--igx-button-active-elevation, var(--ig-elevation-12));--background: var(--igx-button-background, #335e3b);--foreground: var(--igx-button-foreground, #fff);--hover-background: var(--igx-button-hover-background, #459a55);--hover-foreground: var(--igx-button-hover-foreground, black);--focus-background: var(--igx-button-focus-background, #396a42);--focus-foreground: var(--igx-button-focus-foreground, white);--focus-visible-background: var(--igx-button-focus-visible-background, #396a42);--focus-visible-foreground: var(--igx-button-focus-visible-foreground, white);--active-background: var(--igx-button-active-background, hsla(var(--ig-secondary-300), var(--ig-secondary-a)));--active-foreground: var(--igx-button-active-foreground, var(--ig-secondary-300-contrast));--border-radius: var(--igx-button-border-radius, 0);--resting-shadow: var(--igx-button-resting-shadow, var(--ig-elevation-6));--hover-shadow: var(--igx-button-hover-shadow, var(--ig-elevation-12));--focus-shadow: var(--igx-button-focus-shadow, var(--ig-elevation-12));--active-shadow: var(--igx-button-active-shadow, var(--ig-elevation-12))}.analytics-btn,.analytics-btn [igxButton=icon],.analytics-btn .igx-button--icon{--shadow-color: var(--igx-button-shadow-color, transparent);--border-color: var(--igx-button-border-color, transparent);--hover-border-color: var(--igx-button-hover-border-color, transparent);--focus-border-color: var(--igx-button-focus-border-color, hsla(var(--ig-gray-400), var(--ig-gray-a)));--focus-visible-border-color: var(--igx-button-focus-visible-border-color, hsla(var(--ig-gray-400), var(--ig-gray-a)));--active-border-color: var(--igx-button-active-border-color, hsla(var(--ig-gray-400), var(--ig-gray-a)));--disabled-border-color: var(--igx-button-disabled-border-color, transparent);--disabled-background: var(--igx-button-disabled-background, transparent);--disabled-foreground: var(--igx-button-disabled-foreground, hsla(var(--ig-gray-500), var(--ig-gray-a)));--size: var(--igx-button-size, max(var(--is-large, 1) * max(2.25rem, -1 * 2.25rem), var(--is-medium, 1) * max(1.875rem, -1 * 1.875rem), var(--is-small, 1) * max(1.5rem, -1 * 1.5rem)));--default-size: var(--igx-button-default-size, 2);--resting-elevation: var(--igx-button-resting-elevation, var(--ig-elevation-0));--hover-elevation: var(--igx-button-hover-elevation, var(--ig-elevation-0));--focus-elevation: var(--igx-button-focus-elevation, var(--ig-elevation-0));--active-elevation: var(--igx-button-active-elevation, var(--ig-elevation-0));--background: var(--igx-button-background, #335e3b);--foreground: var(--igx-button-foreground, #fff);--hover-background: var(--igx-button-hover-background, #459a55);--hover-foreground: var(--igx-button-hover-foreground, black);--focus-background: var(--igx-button-focus-background, #396a42);--focus-foreground: var(--igx-button-focus-foreground, white);--focus-visible-background: var(--igx-button-focus-visible-background, #396a42);--focus-visible-foreground: var(--igx-button-focus-visible-foreground, white);--active-background: var(--igx-button-active-background, hsla(var(--ig-gray-200), var(--ig-gray-a)));--active-foreground: var(--igx-button-active-foreground, hsla(var(--ig-gray-900), var(--ig-gray-a)));--border-radius: var(--igx-button-border-radius, 0);--resting-shadow: var(--igx-button-resting-shadow, var(--ig-elevation-0));--hover-shadow: var(--igx-button-hover-shadow, var(--ig-elevation-0));--focus-shadow: var(--igx-button-focus-shadow, var(--ig-elevation-0));--active-shadow: var(--igx-button-active-shadow, var(--ig-elevation-0))}.disableButton{opacity:.4;pointer-events:none}.clear,.more-action{display:flex;flex-flow:column;justify-content:center;border-left:1px solid #bdbdbd}.clear .btn,.clear .more-btn,.more-action .btn,.more-action .more-btn{width:68px;margin:0 0 7px;padding:0}.clear .more-btn,.more-action .more-btn{width:36px;height:36px;align-self:center;border-radius:20px}.clear .name,.more-action .name{font-size:.9rem;font-weight:400;text-align:center}.icon{pointer-events:none}.btn{display:inline-flex;flex-flow:column;align-items:center}.btn.condition{padding-right:16px}.btn.chart{padding-right:24px}.btn img,.btn span{pointer-events:none}.chart-preview{width:350px;height:300px;background-color:#fff;overflow:hidden}.chart-preview .chart-preview-title{margin:1rem;justify-content:center}.chart-preview .chart-preview-area{height:270px}::ng-deep .toggle-content{width:354px;max-width:358px;height:148px;background-color:#fff}::ng-deep .toggle-content,::ng-deep .toggle-content .ig-scrollbar{--scrollbar-size: var(--ig-scrollbar-scrollbar-size, 8px);--thumb-background: var(--ig-scrollbar-thumb-background, hsla(var(--ig-gray-400), var(--ig-gray-a)));--track-background: var(--ig-scrollbar-track-background, hsla(var(--ig-gray-100), var(--ig-gray-a)))}::ng-deep .toggle-content .tabs{display:flex!important;border:.2px solid;border-color:#d3d3d3}::ng-deep .toggle-content .tab-option{padding:.9rem;height:100px;width:358px;display:inline-flex;overflow-x:auto;overflow-y:hidden;white-space:nowrap;align-content:center}::ng-deep .toggle-content .tab-option .chartImgButton{width:48px;height:48px}::ng-deep .toggle-content .tab-option .imgSize,::ng-deep .toggle-content .clear.action .imgSize{width:36px;height:36px;align-self:center}::ng-deep .toggle-content .action{cursor:pointer;opacity:1}::ng-deep .toggle-content .action.selected{opacity:.62}::ng-deep .toggle-content .action.selected--condition{pointer-events:none;opacity:.62}\n"] }]
801
+ }], ctorParameters: () => [{ type: i1$1.IgxOverlayService }], propDecorators: { button: [{
802
+ type: ViewChild,
803
+ args: ['analyticsBtn']
804
+ }], tabsMenu: [{
805
+ type: ViewChild,
806
+ args: ['tabsMenu', { read: IgxToggleDirective }]
807
+ }], chartPreview: [{
808
+ type: ViewChild,
809
+ args: ['chartPreview', { read: ViewContainerRef }]
810
+ }], chartPreviewDialog: [{
811
+ type: ViewChild,
812
+ args: ['chartPreviewDialog', { read: IgxToggleDirective }]
813
+ }], tabs: [{
814
+ type: ViewChild,
815
+ args: [IgxTabsComponent]
816
816
  }] } });
817
817
 
818
- var ConditionalFormattingType;
819
- (function (ConditionalFormattingType) {
820
- ConditionalFormattingType["dataBars"] = "Data Bars";
821
- ConditionalFormattingType["colorScale"] = "Color Scale";
822
- ConditionalFormattingType["top10"] = "Top 10";
823
- ConditionalFormattingType["textContains"] = "Text Contains";
824
- ConditionalFormattingType["single"] = "Duplicate Values";
825
- ConditionalFormattingType["unique"] = "Unique Values";
826
- ConditionalFormattingType["empty"] = "Empty";
827
- })(ConditionalFormattingType || (ConditionalFormattingType = {}));
828
- class IgxConditionalFormattingDirective {
829
- set formatColors(val) {
830
- this._formatColors = val;
831
- }
832
- get formatColors() {
833
- return this._formatColors;
834
- }
835
- get selectedData() {
836
- if (!this._selectedData.length) {
837
- this._selectedData = this.toArray(this.grid.getSelectedData());
838
- }
839
- return this._selectedData;
840
- }
841
- get textData() {
842
- return this.selectedData.filter(val => typeof val === 'string');
843
- }
844
- get numericData() {
845
- return this.selectedData.filter(val => typeof val === 'number');
846
- }
847
- constructor(grid) {
848
- this.grid = grid;
849
- this.onFormattersReady = new EventEmitter();
850
- this.colorScale = {
851
- backgroundColor: (rowData, colname, cellValue, rowIndex) => {
852
- if (!(typeof cellValue === 'number' && this.isWithInFormattedRange(rowIndex, colname))) {
853
- return;
854
- }
855
- return this.lowTresholdValue >= cellValue ? this.formatColors.error :
856
- this.middleTresholdValue >= cellValue ? this.formatColors.warning : this.formatColors.success;
857
- }
858
- };
859
- this.dataBars = {
860
- backgroundImage: (rowData, colname, cellValue, rowIndex) => {
861
- if (!(typeof cellValue === 'number' && this.isWithInFormattedRange(rowIndex, colname))) {
862
- return;
863
- }
864
- const treshold = this.threshold;
865
- let gradientPercents;
866
- if (cellValue < 0) {
867
- const negativeStartingPoint = 100 - treshold;
868
- gradientPercents = this.getNegativePercentage(cellValue);
818
+ var ConditionalFormattingType;
819
+ (function (ConditionalFormattingType) {
820
+ ConditionalFormattingType["dataBars"] = "Data Bars";
821
+ ConditionalFormattingType["colorScale"] = "Color Scale";
822
+ ConditionalFormattingType["top10"] = "Top 10";
823
+ ConditionalFormattingType["textContains"] = "Text Contains";
824
+ ConditionalFormattingType["single"] = "Duplicate Values";
825
+ ConditionalFormattingType["unique"] = "Unique Values";
826
+ ConditionalFormattingType["empty"] = "Empty";
827
+ })(ConditionalFormattingType || (ConditionalFormattingType = {}));
828
+ class IgxConditionalFormattingDirective {
829
+ set formatColors(val) {
830
+ this._formatColors = val;
831
+ }
832
+ get formatColors() {
833
+ return this._formatColors;
834
+ }
835
+ get selectedData() {
836
+ if (!this._selectedData.length) {
837
+ this._selectedData = this.toArray(this.grid.getSelectedData());
838
+ }
839
+ return this._selectedData;
840
+ }
841
+ get textData() {
842
+ return this.selectedData.filter(val => typeof val === 'string');
843
+ }
844
+ get numericData() {
845
+ return this.selectedData.filter(val => typeof val === 'number');
846
+ }
847
+ constructor(grid) {
848
+ this.grid = grid;
849
+ this.onFormattersReady = new EventEmitter();
850
+ this.colorScale = {
851
+ backgroundColor: (rowData, colname, cellValue, rowIndex) => {
852
+ if (!(typeof cellValue === 'number' && this.isWithInFormattedRange(rowIndex, colname))) {
853
+ return;
854
+ }
855
+ return this.lowTresholdValue >= cellValue ? this.formatColors.error :
856
+ this.middleTresholdValue >= cellValue ? this.formatColors.warning : this.formatColors.success;
857
+ }
858
+ };
859
+ this.dataBars = {
860
+ backgroundImage: (rowData, colname, cellValue, rowIndex) => {
861
+ if (!(typeof cellValue === 'number' && this.isWithInFormattedRange(rowIndex, colname))) {
862
+ return;
863
+ }
864
+ const treshold = this.threshold;
865
+ let gradientPercents;
866
+ if (cellValue < 0) {
867
+ const negativeStartingPoint = 100 - treshold;
868
+ gradientPercents = this.getNegativePercentage(cellValue);
869
869
  return `linear-gradient(to left, transparent 0% ${negativeStartingPoint}%,
870
870
  ${this.formatColors.error} ${negativeStartingPoint}% ${negativeStartingPoint + gradientPercents}%,
871
- transparent ${gradientPercents}% 100%)`;
872
- }
873
- else {
874
- gradientPercents = this.getPositivePercentage(cellValue);
871
+ transparent ${gradientPercents}% 100%)`;
872
+ }
873
+ else {
874
+ gradientPercents = this.getPositivePercentage(cellValue);
875
875
  return `linear-gradient(to right, transparent 0% ${treshold}%,
876
876
  ${this.formatColors.success} ${treshold}% ${treshold + gradientPercents}%,
877
- transparent ${treshold + gradientPercents}% 100%)`;
878
- }
879
- },
880
- backgroundSize: '100% 80%',
881
- backgroundRepeat: 'no-repeat',
882
- backgroundPositionY: 'center'
883
- };
884
- this.top10Percent = {
885
- backgroundColor: (rowData, colname, cellValue, rowIndex) => {
886
- if (typeof cellValue === 'number' && this.isWithInFormattedRange(rowIndex, colname)
887
- && cellValue > this.top10PercentTreshold) {
888
- return this.formatColors.info;
889
- }
890
- },
891
- color: (rowData, colname, cellValue, rowIndex) => {
892
- if (typeof cellValue === 'number' && this.isWithInFormattedRange(rowIndex, colname)
893
- && cellValue > this.top10PercentTreshold) {
894
- return this.formatColors.text;
895
- }
896
- }
897
- };
898
- this.greaterThan = {
899
- backgroundColor: (rowData, colname, cellValue, rowIndex) => {
900
- if (typeof cellValue === 'number' && this.isWithInFormattedRange(rowIndex, colname)
901
- && cellValue > this.avgValue) {
902
- return this.formatColors.info;
903
- }
904
- },
905
- color: (rowData, colname, cellValue, rowIndex) => {
906
- if (typeof cellValue === 'number' && this.isWithInFormattedRange(rowIndex, colname)
907
- && cellValue > this.avgValue) {
908
- return this.formatColors.text;
909
- }
910
- }
911
- };
912
- this.empty = {
913
- backgroundColor: (rowData, colname, cellValue, rowIndex) => {
914
- if (this.isWithInFormattedRange(rowIndex, colname) && cellValue === undefined) {
915
- return this.formatColors.info;
916
- }
917
- },
918
- color: (rowData, colname, cellValue, rowIndex) => {
919
- if (this.isWithInFormattedRange(rowIndex, colname) && cellValue === undefined) {
920
- return this.formatColors.text;
921
- }
922
- }
923
- };
924
- this.duplicates = {
925
- backgroundColor: (rowData, colname, cellValue, rowIndex) => {
926
- if (!this.isWithInFormattedRange(rowIndex, colname)) {
927
- return;
928
- }
929
- const arr = typeof cellValue === 'number' ? this.numericData : this.textData;
930
- return arr.indexOf(cellValue) !== arr.lastIndexOf(cellValue) ? this.formatColors.info : '';
931
- },
932
- color: (rowData, colname, cellValue, rowIndex) => {
933
- if (!this.isWithInFormattedRange(rowIndex, colname)) {
934
- return;
935
- }
936
- const arr = typeof cellValue === 'number' ? this.numericData : this.textData;
937
- return arr.indexOf(cellValue) !== arr.lastIndexOf(cellValue) ? this.formatColors.text : '';
938
- }
939
- };
940
- this.textContains = {
941
- backgroundColor: (rowData, colname, cellValue, rowIndex) => {
942
- if (typeof cellValue === 'string' && this.isWithInFormattedRange(rowIndex, colname) &&
943
- cellValue.toLowerCase().indexOf(this._valueForComparison.toLowerCase()) !== -1) {
944
- return this.formatColors.info;
945
- }
946
- },
947
- color: (rowData, colname, cellValue, rowIndex) => {
948
- if (typeof cellValue === 'string' && this.isWithInFormattedRange(rowIndex, colname) &&
949
- cellValue.toLowerCase().indexOf(this._valueForComparison.toLowerCase()) !== -1) {
950
- return this.formatColors.text;
951
- }
952
- }
953
- };
954
- this.uniques = {
955
- backgroundColor: (rowData, colname, cellValue, rowIndex) => {
956
- if (!this.isWithInFormattedRange(rowIndex, colname)) {
957
- return;
958
- }
959
- const arr = typeof cellValue === 'number' ? this.numericData : this.textData;
960
- return arr.indexOf(cellValue) === arr.lastIndexOf(cellValue) ? this.formatColors.info : '';
961
- },
962
- color: (rowData, colname, cellValue, rowIndex) => {
963
- if (!this.isWithInFormattedRange(rowIndex, colname)) {
964
- return;
965
- }
966
- const arr = typeof cellValue === 'number' ? this.numericData : this.textData;
967
- return arr.indexOf(cellValue) === arr.lastIndexOf(cellValue) ? this.formatColors.text : '';
968
- }
969
- };
970
- this._formatColors = {
971
- success: '#4EB862',
972
- error: '#FF134A',
973
- warning: '#FBB13C',
974
- info: '#1377D5',
975
- text: '#FFF'
976
- };
977
- this._numericFormatters = ['Data Bars', 'Color Scale', 'Top 10', 'Greater Than'];
978
- this._textFormatters = ['Text Contains'];
979
- this._commonFormattersName = ['Duplicate Values', 'Unique Values', 'Empty'];
980
- this._selectedData = [];
981
- this._formattersData = new Map();
982
- this.destroy$ = new Subject();
983
- this.formatedRange = new Map();
984
- this._formattersData.set('Data Bars', this.dataBars);
985
- this._formattersData.set('Color Scale', this.colorScale);
986
- this._formattersData.set('Top 10', this.top10Percent);
987
- this._formattersData.set('Greater Than', this.greaterThan);
988
- this._formattersData.set('Text Contains', this.textContains);
989
- this._formattersData.set('Duplicate Values', this.duplicates);
990
- this._formattersData.set('Unique Values', this.uniques);
991
- this._formattersData.set('Empty', this.empty);
992
- }
993
- ngAfterViewInit() {
994
- this.grid.rangeSelected.pipe(takeUntil(this.destroy$)).subscribe(() => {
995
- this.determineFormatters();
996
- });
997
- this.grid.cellEdit.pipe(takeUntil(this.destroy$)).subscribe((args) => {
998
- if ((args.newValue === args.oldValue || !this.formatter)) {
999
- return;
1000
- }
1001
- if (this.isWithInFormattedRange(args.cellID.rowIndex, args.cellID.columnID - 1)) {
1002
- const value = Number(args.newValue);
1003
- const valueToBeAdded = !Number.isNaN(value) && Number.isFinite(value) ? value : args.newValue;
1004
- this.selectedData.splice(this.selectedData.indexOf(args.oldValue), 1, valueToBeAdded);
1005
- this.recalcCachedValues();
1006
- this.formatCells(this.formatter, undefined, false);
1007
- }
1008
- });
1009
- }
1010
- ngOnDestroy() {
1011
- this.destroy$.next(true);
1012
- this.destroy$.complete();
1013
- }
1014
- formatCells(formatterName, formatRange, reset = true) {
1015
- if (reset) {
1016
- this.resetRange(formatRange);
1017
- }
1018
- this.clearFormatting();
1019
- this.formatter = formatterName;
1020
- this.grid.visibleColumns.forEach(c => {
1021
- if (c.visibleIndex >= this._startColumn && c.visibleIndex <= this._endColumn) {
1022
- c.cellStyles = this._formattersData.get(this.formatter);
1023
- this.grid.notifyChanges();
1024
- }
1025
- });
1026
- }
1027
- clearFormatting() {
1028
- this.formatter = undefined;
1029
- this.grid.visibleColumns.forEach(c => {
1030
- c.cellStyles = undefined;
1031
- this.grid.cdr.detectChanges();
1032
- });
1033
- }
1034
- determineFormatters() {
1035
- const numericData = this.toArray(this.grid.getSelectedData()).some(rec => typeof rec === 'number');
1036
- const textData = this.toArray(this.grid.getSelectedData()).some(rec => typeof rec === 'string');
1037
- const formatters = Array.of(...this._commonFormattersName);
1038
- if (!(numericData) && textData) {
1039
- formatters.splice(0, 0, ...this._textFormatters);
1040
- }
1041
- else if (numericData && !textData) {
1042
- formatters.splice(0, 0, ...this._numericFormatters);
1043
- }
1044
- else {
1045
- formatters.splice(0, 0, ...['Data Bars', 'Color Scale', 'Text Contains']);
1046
- }
1047
- this.onFormattersReady.emit(formatters);
1048
- }
1049
- recalcCachedValues(clearAll = false) {
1050
- if (clearAll) {
1051
- this._startColumn = Math.min(...this.grid.getSelectedRanges().map(r => Number(r.columnStart)));
1052
- this._endColumn = Math.max(...this.grid.getSelectedRanges().map(r => Number(r.columnEnd)));
1053
- this._selectedData = [];
1054
- }
1055
- this._valueForComparison = this.textData[0];
1056
- this._maxValue = Math.max(...this.numericData);
1057
- this._minValue = Math.min(...this.numericData.filter(value => value < 0)) | 0;
1058
- }
1059
- isWithInFormattedRange(rowIndex, colID) {
1060
- const visibleIndex = typeof colID === 'string' ? this.grid.getColumnByName(colID).visibleIndex : colID;
1061
- if (!this.formatedRange.size) {
1062
- return false;
1063
- }
1064
- return this.formatedRange.has(rowIndex) && this.formatedRange.get(rowIndex).has(visibleIndex);
1065
- }
1066
- get middleTresholdValue() { return 0.66 * Math.ceil(this._maxValue); }
1067
- get lowTresholdValue() { return 0.33 * Math.ceil(this._maxValue); }
1068
- get top10PercentTreshold() { return 0.9 * Math.ceil(this._maxValue); }
1069
- get avgValue() {
1070
- return Math.ceil((this.numericData.reduce((a, b) => a + b, 0)) / this.numericData.length);
1071
- }
1072
- get threshold() {
1073
- return Math.ceil(Math.abs(this._minValue) / (this._maxValue + Math.abs(this._minValue)) * 100);
1074
- }
1075
- getPositivePercentage(val) {
1076
- const result = (Math.ceil(val) / (this._maxValue + Math.abs(this._minValue))) * 100;
1077
- return Math.ceil(result);
1078
- }
1079
- getNegativePercentage(val) {
1080
- const result = (Math.abs(val) / (this._maxValue + Math.abs(this._minValue))) * 100;
1081
- return Math.ceil(result);
1082
- }
1083
- resetRange(formatRange) {
1084
- this.formatedRange.clear();
1085
- const customRange = formatRange ? formatRange : this.grid.getSelectedRanges();
1086
- customRange.forEach(range => {
1087
- for (let ri = range.rowStart; ri <= Number(range.rowEnd); ri++) {
1088
- for (let ci = Number(range.columnStart); ci <= Number(range.columnEnd); ci++) {
1089
- this.addToCache(ri, ci);
1090
- }
1091
- }
1092
- });
1093
- this.recalcCachedValues(true);
1094
- }
1095
- addToCache(rowIndex, colIndex, selection = true) {
1096
- this.formatedRange.has(rowIndex) ? this.formatedRange.get(rowIndex).add(colIndex) :
1097
- this.formatedRange.set(rowIndex, new Set()).get(rowIndex).add(colIndex);
1098
- }
1099
- toArray(data) {
1100
- let result = [];
1101
- data.forEach(rec => result = result.concat(Object.values(rec)));
1102
- return result;
1103
- }
1104
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: IgxConditionalFormattingDirective, deps: [{ token: i1$1.IgxGridComponent }], target: i0.ɵɵFactoryTarget.Directive }); }
1105
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.5", type: IgxConditionalFormattingDirective, selector: "[igxConditionalFormatting]", inputs: { formatter: "formatter", formatColors: "formatColors" }, outputs: { onFormattersReady: "onFormattersReady" }, ngImport: i0 }); }
1106
- }
1107
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: IgxConditionalFormattingDirective, decorators: [{
1108
- type: Directive,
1109
- args: [{
1110
- selector: '[igxConditionalFormatting]'
1111
- }]
1112
- }], ctorParameters: function () { return [{ type: i1$1.IgxGridComponent }]; }, propDecorators: { formatter: [{
1113
- type: Input
1114
- }], formatColors: [{
1115
- type: Input
1116
- }], onFormattersReady: [{
1117
- type: Output
877
+ transparent ${treshold + gradientPercents}% 100%)`;
878
+ }
879
+ },
880
+ backgroundSize: '100% 80%',
881
+ backgroundRepeat: 'no-repeat',
882
+ backgroundPositionY: 'center'
883
+ };
884
+ this.top10Percent = {
885
+ backgroundColor: (rowData, colname, cellValue, rowIndex) => {
886
+ if (typeof cellValue === 'number' && this.isWithInFormattedRange(rowIndex, colname)
887
+ && cellValue > this.top10PercentTreshold) {
888
+ return this.formatColors.info;
889
+ }
890
+ },
891
+ color: (rowData, colname, cellValue, rowIndex) => {
892
+ if (typeof cellValue === 'number' && this.isWithInFormattedRange(rowIndex, colname)
893
+ && cellValue > this.top10PercentTreshold) {
894
+ return this.formatColors.text;
895
+ }
896
+ }
897
+ };
898
+ this.greaterThan = {
899
+ backgroundColor: (rowData, colname, cellValue, rowIndex) => {
900
+ if (typeof cellValue === 'number' && this.isWithInFormattedRange(rowIndex, colname)
901
+ && cellValue > this.avgValue) {
902
+ return this.formatColors.info;
903
+ }
904
+ },
905
+ color: (rowData, colname, cellValue, rowIndex) => {
906
+ if (typeof cellValue === 'number' && this.isWithInFormattedRange(rowIndex, colname)
907
+ && cellValue > this.avgValue) {
908
+ return this.formatColors.text;
909
+ }
910
+ }
911
+ };
912
+ this.empty = {
913
+ backgroundColor: (rowData, colname, cellValue, rowIndex) => {
914
+ if (this.isWithInFormattedRange(rowIndex, colname) && cellValue === undefined) {
915
+ return this.formatColors.info;
916
+ }
917
+ },
918
+ color: (rowData, colname, cellValue, rowIndex) => {
919
+ if (this.isWithInFormattedRange(rowIndex, colname) && cellValue === undefined) {
920
+ return this.formatColors.text;
921
+ }
922
+ }
923
+ };
924
+ this.duplicates = {
925
+ backgroundColor: (rowData, colname, cellValue, rowIndex) => {
926
+ if (!this.isWithInFormattedRange(rowIndex, colname)) {
927
+ return;
928
+ }
929
+ const arr = typeof cellValue === 'number' ? this.numericData : this.textData;
930
+ return arr.indexOf(cellValue) !== arr.lastIndexOf(cellValue) ? this.formatColors.info : '';
931
+ },
932
+ color: (rowData, colname, cellValue, rowIndex) => {
933
+ if (!this.isWithInFormattedRange(rowIndex, colname)) {
934
+ return;
935
+ }
936
+ const arr = typeof cellValue === 'number' ? this.numericData : this.textData;
937
+ return arr.indexOf(cellValue) !== arr.lastIndexOf(cellValue) ? this.formatColors.text : '';
938
+ }
939
+ };
940
+ this.textContains = {
941
+ backgroundColor: (rowData, colname, cellValue, rowIndex) => {
942
+ if (typeof cellValue === 'string' && this.isWithInFormattedRange(rowIndex, colname) &&
943
+ cellValue.toLowerCase().indexOf(this._valueForComparison.toLowerCase()) !== -1) {
944
+ return this.formatColors.info;
945
+ }
946
+ },
947
+ color: (rowData, colname, cellValue, rowIndex) => {
948
+ if (typeof cellValue === 'string' && this.isWithInFormattedRange(rowIndex, colname) &&
949
+ cellValue.toLowerCase().indexOf(this._valueForComparison.toLowerCase()) !== -1) {
950
+ return this.formatColors.text;
951
+ }
952
+ }
953
+ };
954
+ this.uniques = {
955
+ backgroundColor: (rowData, colname, cellValue, rowIndex) => {
956
+ if (!this.isWithInFormattedRange(rowIndex, colname)) {
957
+ return;
958
+ }
959
+ const arr = typeof cellValue === 'number' ? this.numericData : this.textData;
960
+ return arr.indexOf(cellValue) === arr.lastIndexOf(cellValue) ? this.formatColors.info : '';
961
+ },
962
+ color: (rowData, colname, cellValue, rowIndex) => {
963
+ if (!this.isWithInFormattedRange(rowIndex, colname)) {
964
+ return;
965
+ }
966
+ const arr = typeof cellValue === 'number' ? this.numericData : this.textData;
967
+ return arr.indexOf(cellValue) === arr.lastIndexOf(cellValue) ? this.formatColors.text : '';
968
+ }
969
+ };
970
+ this._formatColors = {
971
+ success: '#4EB862',
972
+ error: '#FF134A',
973
+ warning: '#FBB13C',
974
+ info: '#1377D5',
975
+ text: '#FFF'
976
+ };
977
+ this._numericFormatters = ['Data Bars', 'Color Scale', 'Top 10', 'Greater Than'];
978
+ this._textFormatters = ['Text Contains'];
979
+ this._commonFormattersName = ['Duplicate Values', 'Unique Values', 'Empty'];
980
+ this._selectedData = [];
981
+ this._formattersData = new Map();
982
+ this.destroy$ = new Subject();
983
+ this.formatedRange = new Map();
984
+ this._formattersData.set('Data Bars', this.dataBars);
985
+ this._formattersData.set('Color Scale', this.colorScale);
986
+ this._formattersData.set('Top 10', this.top10Percent);
987
+ this._formattersData.set('Greater Than', this.greaterThan);
988
+ this._formattersData.set('Text Contains', this.textContains);
989
+ this._formattersData.set('Duplicate Values', this.duplicates);
990
+ this._formattersData.set('Unique Values', this.uniques);
991
+ this._formattersData.set('Empty', this.empty);
992
+ }
993
+ ngAfterViewInit() {
994
+ this.grid.rangeSelected.pipe(takeUntil(this.destroy$)).subscribe(() => {
995
+ this.determineFormatters();
996
+ });
997
+ this.grid.cellEdit.pipe(takeUntil(this.destroy$)).subscribe((args) => {
998
+ if ((args.newValue === args.oldValue || !this.formatter)) {
999
+ return;
1000
+ }
1001
+ if (this.isWithInFormattedRange(args.cellID.rowIndex, args.cellID.columnID - 1)) {
1002
+ const value = Number(args.newValue);
1003
+ const valueToBeAdded = !Number.isNaN(value) && Number.isFinite(value) ? value : args.newValue;
1004
+ this.selectedData.splice(this.selectedData.indexOf(args.oldValue), 1, valueToBeAdded);
1005
+ this.recalcCachedValues();
1006
+ this.formatCells(this.formatter, undefined, false);
1007
+ }
1008
+ });
1009
+ }
1010
+ ngOnDestroy() {
1011
+ this.destroy$.next(true);
1012
+ this.destroy$.complete();
1013
+ }
1014
+ formatCells(formatterName, formatRange, reset = true) {
1015
+ if (reset) {
1016
+ this.resetRange(formatRange);
1017
+ }
1018
+ this.clearFormatting();
1019
+ this.formatter = formatterName;
1020
+ this.grid.visibleColumns.forEach(c => {
1021
+ if (c.visibleIndex >= this._startColumn && c.visibleIndex <= this._endColumn) {
1022
+ c.cellStyles = this._formattersData.get(this.formatter);
1023
+ this.grid.notifyChanges();
1024
+ }
1025
+ });
1026
+ }
1027
+ clearFormatting() {
1028
+ this.formatter = undefined;
1029
+ this.grid.visibleColumns.forEach(c => {
1030
+ c.cellStyles = undefined;
1031
+ this.grid.cdr.detectChanges();
1032
+ });
1033
+ }
1034
+ determineFormatters() {
1035
+ const numericData = this.toArray(this.grid.getSelectedData()).some(rec => typeof rec === 'number');
1036
+ const textData = this.toArray(this.grid.getSelectedData()).some(rec => typeof rec === 'string');
1037
+ const formatters = Array.of(...this._commonFormattersName);
1038
+ if (!(numericData) && textData) {
1039
+ formatters.splice(0, 0, ...this._textFormatters);
1040
+ }
1041
+ else if (numericData && !textData) {
1042
+ formatters.splice(0, 0, ...this._numericFormatters);
1043
+ }
1044
+ else {
1045
+ formatters.splice(0, 0, ...['Data Bars', 'Color Scale', 'Text Contains']);
1046
+ }
1047
+ this.onFormattersReady.emit(formatters);
1048
+ }
1049
+ recalcCachedValues(clearAll = false) {
1050
+ if (clearAll) {
1051
+ this._startColumn = Math.min(...this.grid.getSelectedRanges().map(r => Number(r.columnStart)));
1052
+ this._endColumn = Math.max(...this.grid.getSelectedRanges().map(r => Number(r.columnEnd)));
1053
+ this._selectedData = [];
1054
+ }
1055
+ this._valueForComparison = this.textData[0];
1056
+ this._maxValue = Math.max(...this.numericData);
1057
+ this._minValue = Math.min(...this.numericData.filter(value => value < 0)) | 0;
1058
+ }
1059
+ isWithInFormattedRange(rowIndex, colID) {
1060
+ const visibleIndex = typeof colID === 'string' ? this.grid.getColumnByName(colID).visibleIndex : colID;
1061
+ if (!this.formatedRange.size) {
1062
+ return false;
1063
+ }
1064
+ return this.formatedRange.has(rowIndex) && this.formatedRange.get(rowIndex).has(visibleIndex);
1065
+ }
1066
+ get middleTresholdValue() { return 0.66 * Math.ceil(this._maxValue); }
1067
+ get lowTresholdValue() { return 0.33 * Math.ceil(this._maxValue); }
1068
+ get top10PercentTreshold() { return 0.9 * Math.ceil(this._maxValue); }
1069
+ get avgValue() {
1070
+ return Math.ceil((this.numericData.reduce((a, b) => a + b, 0)) / this.numericData.length);
1071
+ }
1072
+ get threshold() {
1073
+ return Math.ceil(Math.abs(this._minValue) / (this._maxValue + Math.abs(this._minValue)) * 100);
1074
+ }
1075
+ getPositivePercentage(val) {
1076
+ const result = (Math.ceil(val) / (this._maxValue + Math.abs(this._minValue))) * 100;
1077
+ return Math.ceil(result);
1078
+ }
1079
+ getNegativePercentage(val) {
1080
+ const result = (Math.abs(val) / (this._maxValue + Math.abs(this._minValue))) * 100;
1081
+ return Math.ceil(result);
1082
+ }
1083
+ resetRange(formatRange) {
1084
+ this.formatedRange.clear();
1085
+ const customRange = formatRange ? formatRange : this.grid.getSelectedRanges();
1086
+ customRange.forEach(range => {
1087
+ for (let ri = range.rowStart; ri <= Number(range.rowEnd); ri++) {
1088
+ for (let ci = Number(range.columnStart); ci <= Number(range.columnEnd); ci++) {
1089
+ this.addToCache(ri, ci);
1090
+ }
1091
+ }
1092
+ });
1093
+ this.recalcCachedValues(true);
1094
+ }
1095
+ addToCache(rowIndex, colIndex, selection = true) {
1096
+ this.formatedRange.has(rowIndex) ? this.formatedRange.get(rowIndex).add(colIndex) :
1097
+ this.formatedRange.set(rowIndex, new Set()).get(rowIndex).add(colIndex);
1098
+ }
1099
+ toArray(data) {
1100
+ let result = [];
1101
+ data.forEach(rec => result = result.concat(Object.values(rec)));
1102
+ return result;
1103
+ }
1104
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: IgxConditionalFormattingDirective, deps: [{ token: i1$1.IgxGridComponent }], target: i0.ɵɵFactoryTarget.Directive }); }
1105
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.0", type: IgxConditionalFormattingDirective, selector: "[igxConditionalFormatting]", inputs: { formatter: "formatter", formatColors: "formatColors" }, outputs: { onFormattersReady: "onFormattersReady" }, ngImport: i0 }); }
1106
+ }
1107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: IgxConditionalFormattingDirective, decorators: [{
1108
+ type: Directive,
1109
+ args: [{
1110
+ selector: '[igxConditionalFormatting]'
1111
+ }]
1112
+ }], ctorParameters: () => [{ type: i1$1.IgxGridComponent }], propDecorators: { formatter: [{
1113
+ type: Input
1114
+ }], formatColors: [{
1115
+ type: Input
1116
+ }], onFormattersReady: [{
1117
+ type: Output
1118
1118
  }] } });
1119
1119
 
1120
- // tslint:disable: max-line-length
1121
- class SeriesFactory {
1122
- create(type) {
1123
- return new type();
1124
- }
1125
- }
1126
- class ChartInitializer {
1127
- constructor() {
1128
- this.seriesFactory = new SeriesFactory();
1129
- }
1130
- applyOptions(target, options) {
1131
- if (options) {
1132
- Object.keys(options).forEach(key => {
1133
- if (target[key] instanceof EventEmitter) {
1134
- target[key].subscribe(options[key]);
1135
- }
1136
- else {
1137
- target[key] = options[key];
1138
- }
1139
- });
1140
- }
1141
- }
1142
- }
1143
- class IgxPieChartInitializer extends ChartInitializer {
1144
- constructor() {
1145
- super();
1146
- }
1147
- initChart(chart, options) {
1148
- this.applyOptions(chart, options.chartOptions);
1149
- return chart;
1150
- }
1151
- }
1152
- class IgxDataChartInitializer extends ChartInitializer {
1153
- constructor(seriesType) {
1154
- super();
1155
- switch (seriesType) {
1156
- case IgxBarSeriesComponent:
1157
- this.xAxis = new IgxNumericXAxisComponent();
1158
- this.yAxis = new IgxCategoryYAxisComponent();
1159
- break;
1160
- case IgxScatterSeriesComponent:
1161
- case IgxBubbleSeriesComponent:
1162
- case IgxScatterLineSeriesComponent:
1163
- this.xAxis = new IgxNumericXAxisComponent();
1164
- this.yAxis = new IgxNumericYAxisComponent();
1165
- break;
1166
- default:
1167
- this.xAxis = new IgxCategoryXAxisComponent();
1168
- this.yAxis = new IgxNumericYAxisComponent();
1169
- }
1170
- this.seriesType = seriesType;
1171
- }
1172
- initChart(chart, options) {
1173
- options.seriesOptions.forEach((option) => {
1174
- const series = this.seriesFactory.create(this.seriesType);
1175
- series.xAxis = this.xAxis;
1176
- series.yAxis = this.yAxis;
1177
- this.applyOptions(series, option);
1178
- chart.series.add(series);
1179
- });
1180
- this.applyOptions(chart, options.chartOptions);
1181
- this.applyOptions(this.xAxis, options.xAxisOptions);
1182
- this.applyOptions(this.yAxis, options.yAxisOptions);
1183
- chart.axes.add(this.xAxis);
1184
- chart.axes.add(this.yAxis);
1185
- return chart;
1186
- }
1187
- }
1188
- class IgxStackedDataChartInitializer extends ChartInitializer {
1189
- constructor(seriesType) {
1190
- super();
1191
- if (seriesType === IgxStackedBarSeriesComponent || seriesType === IgxStacked100BarSeriesComponent) {
1192
- this.xAxis = new IgxNumericXAxisComponent();
1193
- this.yAxis = new IgxCategoryYAxisComponent();
1194
- }
1195
- else {
1196
- this.xAxis = new IgxCategoryXAxisComponent();
1197
- this.yAxis = new IgxNumericYAxisComponent();
1198
- }
1199
- this.seriesType = seriesType;
1200
- }
1201
- initChart(chart, options) {
1202
- const series = this.seriesFactory.create(this.seriesType);
1203
- series.xAxis = this.xAxis;
1204
- series.yAxis = this.yAxis;
1205
- options.stackedFragmentOptions.forEach(fragOpt => {
1206
- const frag = new IgxStackedFragmentSeriesComponent();
1207
- this.applyOptions(frag, fragOpt);
1208
- series.series.add(frag);
1209
- });
1210
- this.applyOptions(series, options.seriesOptions);
1211
- this.applyOptions(chart, options.chartOptions);
1212
- this.applyOptions(this.xAxis, options.xAxisOptions);
1213
- this.applyOptions(this.yAxis, options.yAxisOptions);
1214
- chart.series.add(series);
1215
- chart.axes.add(this.xAxis);
1216
- chart.axes.add(this.yAxis);
1217
- return chart;
1218
- }
1120
+ // tslint:disable: max-line-length
1121
+ class SeriesFactory {
1122
+ create(type) {
1123
+ return new type();
1124
+ }
1125
+ }
1126
+ class ChartInitializer {
1127
+ constructor() {
1128
+ this.seriesFactory = new SeriesFactory();
1129
+ }
1130
+ applyOptions(target, options) {
1131
+ if (options) {
1132
+ Object.keys(options).forEach(key => {
1133
+ if (target[key] instanceof EventEmitter) {
1134
+ target[key].subscribe(options[key]);
1135
+ }
1136
+ else {
1137
+ target[key] = options[key];
1138
+ }
1139
+ });
1140
+ }
1141
+ }
1142
+ }
1143
+ class IgxPieChartInitializer extends ChartInitializer {
1144
+ constructor() {
1145
+ super();
1146
+ }
1147
+ initChart(chart, options) {
1148
+ this.applyOptions(chart, options.chartOptions);
1149
+ return chart;
1150
+ }
1151
+ }
1152
+ class IgxDataChartInitializer extends ChartInitializer {
1153
+ constructor(seriesType) {
1154
+ super();
1155
+ switch (seriesType) {
1156
+ case IgxBarSeriesComponent:
1157
+ this.xAxis = new IgxNumericXAxisComponent();
1158
+ this.yAxis = new IgxCategoryYAxisComponent();
1159
+ break;
1160
+ case IgxScatterSeriesComponent:
1161
+ case IgxBubbleSeriesComponent:
1162
+ case IgxScatterLineSeriesComponent:
1163
+ this.xAxis = new IgxNumericXAxisComponent();
1164
+ this.yAxis = new IgxNumericYAxisComponent();
1165
+ break;
1166
+ default:
1167
+ this.xAxis = new IgxCategoryXAxisComponent();
1168
+ this.yAxis = new IgxNumericYAxisComponent();
1169
+ }
1170
+ this.seriesType = seriesType;
1171
+ }
1172
+ initChart(chart, options) {
1173
+ options.seriesOptions.forEach((option) => {
1174
+ const series = this.seriesFactory.create(this.seriesType);
1175
+ series.xAxis = this.xAxis;
1176
+ series.yAxis = this.yAxis;
1177
+ this.applyOptions(series, option);
1178
+ chart.series.add(series);
1179
+ });
1180
+ this.applyOptions(chart, options.chartOptions);
1181
+ this.applyOptions(this.xAxis, options.xAxisOptions);
1182
+ this.applyOptions(this.yAxis, options.yAxisOptions);
1183
+ chart.axes.add(this.xAxis);
1184
+ chart.axes.add(this.yAxis);
1185
+ return chart;
1186
+ }
1187
+ }
1188
+ class IgxStackedDataChartInitializer extends ChartInitializer {
1189
+ constructor(seriesType) {
1190
+ super();
1191
+ if (seriesType === IgxStackedBarSeriesComponent || seriesType === IgxStacked100BarSeriesComponent) {
1192
+ this.xAxis = new IgxNumericXAxisComponent();
1193
+ this.yAxis = new IgxCategoryYAxisComponent();
1194
+ }
1195
+ else {
1196
+ this.xAxis = new IgxCategoryXAxisComponent();
1197
+ this.yAxis = new IgxNumericYAxisComponent();
1198
+ }
1199
+ this.seriesType = seriesType;
1200
+ }
1201
+ initChart(chart, options) {
1202
+ const series = this.seriesFactory.create(this.seriesType);
1203
+ series.xAxis = this.xAxis;
1204
+ series.yAxis = this.yAxis;
1205
+ options.stackedFragmentOptions.forEach(fragOpt => {
1206
+ const frag = new IgxStackedFragmentSeriesComponent();
1207
+ this.applyOptions(frag, fragOpt);
1208
+ series.series.add(frag);
1209
+ });
1210
+ this.applyOptions(series, options.seriesOptions);
1211
+ this.applyOptions(chart, options.chartOptions);
1212
+ this.applyOptions(this.xAxis, options.xAxisOptions);
1213
+ this.applyOptions(this.yAxis, options.yAxisOptions);
1214
+ chart.series.add(series);
1215
+ chart.axes.add(this.xAxis);
1216
+ chart.axes.add(this.yAxis);
1217
+ return chart;
1218
+ }
1219
1219
  }
1220
1220
 
1221
- class IgxChartIntegrationDirective {
1222
- get chartData() {
1223
- return this._chartData;
1224
- }
1225
- set chartData(selectedData) {
1226
- const charts = new Set(this._dataChartTypes);
1227
- const dataModel = selectedData.length ? selectedData[0] : {};
1228
- this._labelMemberPaths = Object.keys(dataModel).filter(key => typeof dataModel[key] === 'string');
1229
- this._valueMemberPaths = Object.keys(dataModel).filter(key => typeof dataModel[key] === 'number');
1230
- this._chartData = selectedData.map((dataRecord, index) => this.addIndexMemberPath(dataRecord, index + 1));
1231
- const args = {
1232
- chartsAvailabilty: new Map(),
1233
- chartsForCreation: []
1234
- };
1235
- if (selectedData.length === 0 || this._valueMemberPaths.length === 0) {
1236
- this.onChartTypesDetermined.emit(args);
1237
- return;
1238
- }
1239
- if (selectedData.length === 1) {
1240
- charts.forEach((chart, _, set) => {
1241
- const isColumnChart = chart.indexOf('Column') !== -1;
1242
- const isBarChart = chart.indexOf('Bar') !== -1;
1243
- const isPieChart = chart.indexOf('Pie') !== -1;
1244
- if (!(isColumnChart || isBarChart || isPieChart)) {
1245
- set.delete(chart);
1246
- }
1247
- });
1248
- }
1249
- // Config pie chart
1250
- const cannotCreatePieChart = selectedData.some(record => record[this._valueMemberPaths[0]] <= 0);
1251
- if (cannotCreatePieChart) {
1252
- charts.delete(CHART_TYPE.PIE);
1253
- }
1254
- // Config scatter chart member paths
1255
- const canCreateScatterChart = this._valueMemberPaths.length >= 2;
1256
- const canCreateBubbleChart = this._valueMemberPaths.length >= 3;
1257
- if (!canCreateScatterChart) {
1258
- charts.delete(CHART_TYPE.SCATTER_BUBBLE);
1259
- charts.delete(CHART_TYPE.SCATTER_LINE);
1260
- charts.delete(CHART_TYPE.SCATTER_POINT);
1261
- }
1262
- if (!canCreateBubbleChart) {
1263
- charts.delete(CHART_TYPE.SCATTER_BUBBLE);
1264
- }
1265
- args.chartsAvailabilty = this.chartTypesAvailability;
1266
- args.chartsForCreation = [...charts];
1267
- this.onChartTypesDetermined.emit(args);
1268
- }
1269
- set scatterChartYAxisValueMemberPath(path) {
1270
- this._scatterChartYAxisValueMemberPath = path;
1271
- }
1272
- get scatterChartYAxisValueMemberPath() {
1273
- return this._scatterChartYAxisValueMemberPath &&
1274
- this._valueMemberPaths.indexOf(this._scatterChartYAxisValueMemberPath) !== -1 ?
1275
- this._scatterChartYAxisValueMemberPath : this._valueMemberPaths[0];
1276
- }
1277
- set bubbleChartRadiusMemberPath(path) {
1278
- this._bubbleChartRadiusMemberPath = path;
1279
- }
1280
- get bubbleChartRadiusMemberPath() {
1281
- return this._bubbleChartRadiusMemberPath &&
1282
- this._valueMemberPaths.indexOf(this._bubbleChartRadiusMemberPath) !== -1 ?
1283
- this._bubbleChartRadiusMemberPath : this._valueMemberPaths[1];
1284
- }
1285
- get _labelMemberPath() {
1286
- return this.defaultLabelMemberPath && this._chartData.some(r => r[this.defaultLabelMemberPath] !== undefined) ?
1287
- this.defaultLabelMemberPath : this._labelMemberPaths.length > 0 ? this._labelMemberPaths[0] : 'Index';
1288
- }
1289
- get pieChartOptions() {
1290
- return {
1291
- width: '85%',
1292
- height: '75%',
1293
- dataSource: this.chartData,
1294
- valueMemberPath: this._valueMemberPaths[0],
1295
- legendLabelMemberPath: this._labelMemberPath,
1296
- labelMemberPath: this._labelMemberPath,
1297
- };
1298
- }
1299
- get dataChartOptions() {
1300
- return {
1301
- width: '100%',
1302
- height: '85%',
1303
- autoMarginWidth: 50,
1304
- isVerticalZoomEnabled: true,
1305
- isHorizontalZoomEnabled: true,
1306
- dataSource: this.chartData
1307
- };
1308
- }
1309
- constructor(factoryResolver) {
1310
- this.factoryResolver = factoryResolver;
1311
- this.onChartTypesDetermined = new EventEmitter();
1312
- this.onChartCreationDone = new EventEmitter();
1313
- this.useLegend = true;
1314
- this.defaultLabelMemberPath = undefined;
1315
- this.chartTypesAvailability = new Map();
1316
- this.customChartComponentOptions = new Map();
1317
- this.dataCharts = new Map();
1318
- this._scatterChartYAxisValueMemberPath = undefined;
1319
- this._bubbleChartRadiusMemberPath = undefined;
1320
- this._valueMemberPaths = [];
1321
- this._labelMemberPaths = [];
1322
- this._sizeScale = new IgxSizeScaleComponent();
1323
- this._dataChartTypes = new Set();
1324
- this.dataChartSeriesOptionsModel = {
1325
- isHighlightingEnabled: true,
1326
- areaFillOpacity: .4,
1327
- markerType: 3,
1328
- showDefaultTooltip: true
1329
- };
1330
- this.scatterChartSeriesOptionsModel = {
1331
- markerType: 3,
1332
- showDefaultTooltip: true
1333
- };
1334
- this.bubbleChartSeriesOptionsModel = {
1335
- radiusScale: this._sizeScale
1336
- };
1337
- this.dataCharts.set(CHART_TYPE.COLUMN_GROUPED, IgxColumnSeriesComponent);
1338
- this.dataCharts.set(CHART_TYPE.AREA_GROUPED, IgxAreaSeriesComponent);
1339
- this.dataCharts.set(CHART_TYPE.LINE_GROUPED, IgxLineSeriesComponent);
1340
- this.dataCharts.set(CHART_TYPE.BAR_GROUPED, IgxBarSeriesComponent);
1341
- this.dataCharts.set(CHART_TYPE.COLUMN_STACKED, IgxStackedColumnSeriesComponent);
1342
- this.dataCharts.set(CHART_TYPE.AREA_STACKED, IgxStackedAreaSeriesComponent);
1343
- this.dataCharts.set(CHART_TYPE.LINE_STACKED, IgxStackedLineSeriesComponent);
1344
- this.dataCharts.set(CHART_TYPE.BAR_STACKED, IgxStackedBarSeriesComponent);
1345
- this.dataCharts.set(CHART_TYPE.COLUMN_100_STACKED, IgxStacked100ColumnSeriesComponent);
1346
- this.dataCharts.set(CHART_TYPE.AREA_100_STACKED, IgxStacked100AreaSeriesComponent);
1347
- this.dataCharts.set(CHART_TYPE.LINE_100_STACKED, IgxStacked100LineSeriesComponent);
1348
- this.dataCharts.set(CHART_TYPE.BAR_100_STACKED, IgxStacked100BarSeriesComponent);
1349
- this.dataCharts.set(CHART_TYPE.SCATTER_POINT, IgxScatterSeriesComponent);
1350
- this.dataCharts.set(CHART_TYPE.SCATTER_BUBBLE, IgxBubbleSeriesComponent);
1351
- this.dataCharts.set(CHART_TYPE.SCATTER_LINE, IgxScatterLineSeriesComponent);
1352
- this.dataCharts.set(CHART_TYPE.PIE, IgxPieChartComponent);
1353
- const iterable = this.dataCharts.keys();
1354
- for (let head = iterable.next().value; head !== undefined; head = iterable.next().value) {
1355
- this._dataChartTypes.add(head);
1356
- this.chartTypesAvailability.set(head, true);
1357
- this.customChartComponentOptions.set(head, {});
1358
- }
1359
- }
1360
- getAvailableCharts() {
1361
- const res = [];
1362
- this.chartTypesAvailability.forEach((isAvailable, chartType) => {
1363
- if (isAvailable) {
1364
- res.push(chartType);
1365
- }
1366
- });
1367
- return res;
1368
- }
1369
- disableCharts(types) {
1370
- types.forEach(type => {
1371
- if (this.chartTypesAvailability.get(type)) {
1372
- this.chartTypesAvailability.set(type, false);
1373
- }
1374
- });
1375
- }
1376
- enableCharts(types) {
1377
- types.forEach(type => {
1378
- if (!this.chartTypesAvailability.get(type)) {
1379
- this.chartTypesAvailability.set(type, true);
1380
- }
1381
- });
1382
- }
1383
- chartFactory(type, viewContainerRef) {
1384
- if (!this.chartTypesAvailability.get(type)) {
1385
- return;
1386
- }
1387
- let componentFactory;
1388
- let componentRef;
1389
- this._sizeScale.maximumValue = 60;
1390
- this._sizeScale.minimumValue = 10;
1391
- const chartType = this.dataCharts.get(type);
1392
- if (type === CHART_TYPE.PIE) {
1393
- componentFactory = this.factoryResolver.resolveComponentFactory(IgxPieChartComponent);
1394
- componentRef = viewContainerRef.createComponent(componentFactory);
1395
- }
1396
- else {
1397
- componentFactory = this.factoryResolver.resolveComponentFactory(IgxDataChartComponent);
1398
- componentRef = viewContainerRef.createComponent(componentFactory);
1399
- }
1400
- const options = this.getChartOptions(type);
1401
- const initializer = this.getInitializer(type, chartType);
1402
- if (this.useLegend) {
1403
- const legendType = type === CHART_TYPE.PIE ? IgxItemLegendComponent : IgxLegendComponent;
1404
- const legendFactory = this.factoryResolver.resolveComponentFactory(legendType);
1405
- const legendComponentRef = viewContainerRef.createComponent(legendFactory);
1406
- options.chartOptions['legend'] = legendComponentRef.instance;
1407
- }
1408
- const chart = initializer.initChart(componentRef.instance, options);
1409
- this.onChartCreationDone.emit(chart);
1410
- }
1411
- getInitializer(chartType, componentClassRef) {
1412
- if (chartType.includes('Pie')) {
1413
- return new IgxPieChartInitializer();
1414
- }
1415
- else if (chartType.includes('Stacked')) {
1416
- return new IgxStackedDataChartInitializer(componentClassRef);
1417
- }
1418
- else {
1419
- return new IgxDataChartInitializer(componentClassRef);
1420
- }
1421
- }
1422
- getChartOptions(type) {
1423
- const chartComponentOptions = {};
1424
- return type === CHART_TYPE.PIE ? this.addPieChartDataOptions(chartComponentOptions) :
1425
- this.addDataChartDataOptions(type, chartComponentOptions, type.includes('Stacked'));
1426
- }
1427
- addPieChartDataOptions(chartComponentOptions) {
1428
- // tslint:disable-next-line: max-line-length
1429
- chartComponentOptions.chartOptions = Object.assign(this.pieChartOptions, this.customChartComponentOptions.get(CHART_TYPE.PIE).chartOptions);
1430
- return chartComponentOptions;
1431
- }
1432
- addDataChartDataOptions(type, chartComponentOptions, stacked) {
1433
- chartComponentOptions.chartOptions = Object.assign(this.dataChartOptions, this.customChartComponentOptions.get(type));
1434
- if (type.indexOf('Scatter') !== -1) {
1435
- this.addScatterChartDataOptions(type, chartComponentOptions);
1436
- }
1437
- else {
1438
- // tslint:disable-next-line: max-line-length
1439
- chartComponentOptions.seriesModel = Object.assign(this.dataChartSeriesOptionsModel, this.customChartComponentOptions.get(type).seriesModel);
1440
- this.setAxisLabelOption(type, chartComponentOptions);
1441
- const options = [];
1442
- this._valueMemberPaths.forEach(valueMemberPath => {
1443
- const dataOptions = {
1444
- title: valueMemberPath,
1445
- valueMemberPath
1446
- };
1447
- if (stacked) {
1448
- options.push({ ...dataOptions });
1449
- }
1450
- else {
1451
- options.push({ ...dataOptions, ...chartComponentOptions.seriesModel });
1452
- }
1453
- });
1454
- stacked ? chartComponentOptions.stackedFragmentOptions = options :
1455
- chartComponentOptions.seriesOptions = options;
1456
- }
1457
- return chartComponentOptions;
1458
- }
1459
- addScatterChartDataOptions(scatterChart, chartComponentOptions) {
1460
- // tslint:disable-next-line: max-line-length
1461
- chartComponentOptions.seriesModel = Object.assign(this.scatterChartSeriesOptionsModel, this.customChartComponentOptions.get(scatterChart).seriesModel);
1462
- chartComponentOptions.seriesModel['yMemberPath'] = this.scatterChartYAxisValueMemberPath;
1463
- if (scatterChart === CHART_TYPE.SCATTER_BUBBLE) {
1464
- chartComponentOptions.seriesModel = Object.assign(chartComponentOptions.seriesModel, this.bubbleChartSeriesOptionsModel);
1465
- chartComponentOptions.seriesModel['radiusMemberPath'] = this.bubbleChartRadiusMemberPath;
1466
- }
1467
- const model = chartComponentOptions.seriesModel;
1468
- const seriesOptions = [];
1469
- this._valueMemberPaths.filter(v => !(v === model['yMemberPath'] ||
1470
- v === model['radiusMemberPath'])).forEach(valueMemberPath => {
1471
- const dataOptions = {
1472
- title: `${model['yMemberPath']} vs ${valueMemberPath}`,
1473
- xMemberPath: valueMemberPath,
1474
- labelMemberPath: this._labelMemberPath
1475
- };
1476
- seriesOptions.push({ ...dataOptions, ...model });
1477
- });
1478
- chartComponentOptions.seriesOptions = seriesOptions;
1479
- }
1480
- addIndexMemberPath(dataRecord, index) {
1481
- dataRecord = { ...{ [this._labelMemberPath]: index }, ...dataRecord };
1482
- return dataRecord;
1483
- }
1484
- setAxisLabelOption(type, options) {
1485
- if (type.indexOf('Bar') !== -1) {
1486
- options.yAxisOptions = Object.assign({
1487
- label: this._labelMemberPath
1488
- }, this.customChartComponentOptions.get(type).yAxisOptions);
1489
- }
1490
- else {
1491
- options.xAxisOptions = Object.assign({
1492
- label: this._labelMemberPath
1493
- }, this.customChartComponentOptions.get(type).xAxisOptions);
1494
- }
1495
- }
1496
- setChartComponentOptions(chart, optionsType, options) {
1497
- if (!this.customChartComponentOptions.get(chart)[optionsType]) {
1498
- this.customChartComponentOptions.get(chart)[optionsType] = {};
1499
- }
1500
- Object.keys(options).forEach(property => {
1501
- this.customChartComponentOptions.get(chart)[optionsType][property] = options[property];
1502
- });
1503
- }
1504
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: IgxChartIntegrationDirective, deps: [{ token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Directive }); }
1505
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.5", type: IgxChartIntegrationDirective, selector: "[igxChartIntegration]", inputs: { chartData: "chartData", useLegend: "useLegend", defaultLabelMemberPath: "defaultLabelMemberPath", scatterChartYAxisValueMemberPath: "scatterChartYAxisValueMemberPath", bubbleChartRadiusMemberPath: "bubbleChartRadiusMemberPath" }, outputs: { onChartTypesDetermined: "onChartTypesDetermined", onChartCreationDone: "onChartCreationDone" }, ngImport: i0 }); }
1506
- }
1507
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: IgxChartIntegrationDirective, decorators: [{
1508
- type: Directive,
1509
- args: [{
1510
- selector: '[igxChartIntegration]'
1511
- }]
1512
- }], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }]; }, propDecorators: { chartData: [{
1513
- type: Input
1514
- }], onChartTypesDetermined: [{
1515
- type: Output
1516
- }], onChartCreationDone: [{
1517
- type: Output
1518
- }], useLegend: [{
1519
- type: Input
1520
- }], defaultLabelMemberPath: [{
1521
- type: Input
1522
- }], scatterChartYAxisValueMemberPath: [{
1523
- type: Input
1524
- }], bubbleChartRadiusMemberPath: [{
1525
- type: Input
1221
+ class IgxChartIntegrationDirective {
1222
+ get chartData() {
1223
+ return this._chartData;
1224
+ }
1225
+ set chartData(selectedData) {
1226
+ const charts = new Set(this._dataChartTypes);
1227
+ const dataModel = selectedData.length ? selectedData[0] : {};
1228
+ this._labelMemberPaths = Object.keys(dataModel).filter(key => typeof dataModel[key] === 'string');
1229
+ this._valueMemberPaths = Object.keys(dataModel).filter(key => typeof dataModel[key] === 'number');
1230
+ this._chartData = selectedData.map((dataRecord, index) => this.addIndexMemberPath(dataRecord, index + 1));
1231
+ const args = {
1232
+ chartsAvailabilty: new Map(),
1233
+ chartsForCreation: []
1234
+ };
1235
+ if (selectedData.length === 0 || this._valueMemberPaths.length === 0) {
1236
+ this.onChartTypesDetermined.emit(args);
1237
+ return;
1238
+ }
1239
+ if (selectedData.length === 1) {
1240
+ charts.forEach((chart, _, set) => {
1241
+ const isColumnChart = chart.indexOf('Column') !== -1;
1242
+ const isBarChart = chart.indexOf('Bar') !== -1;
1243
+ const isPieChart = chart.indexOf('Pie') !== -1;
1244
+ if (!(isColumnChart || isBarChart || isPieChart)) {
1245
+ set.delete(chart);
1246
+ }
1247
+ });
1248
+ }
1249
+ // Config pie chart
1250
+ const cannotCreatePieChart = selectedData.some(record => record[this._valueMemberPaths[0]] <= 0);
1251
+ if (cannotCreatePieChart) {
1252
+ charts.delete(CHART_TYPE.PIE);
1253
+ }
1254
+ // Config scatter chart member paths
1255
+ const canCreateScatterChart = this._valueMemberPaths.length >= 2;
1256
+ const canCreateBubbleChart = this._valueMemberPaths.length >= 3;
1257
+ if (!canCreateScatterChart) {
1258
+ charts.delete(CHART_TYPE.SCATTER_BUBBLE);
1259
+ charts.delete(CHART_TYPE.SCATTER_LINE);
1260
+ charts.delete(CHART_TYPE.SCATTER_POINT);
1261
+ }
1262
+ if (!canCreateBubbleChart) {
1263
+ charts.delete(CHART_TYPE.SCATTER_BUBBLE);
1264
+ }
1265
+ args.chartsAvailabilty = this.chartTypesAvailability;
1266
+ args.chartsForCreation = [...charts];
1267
+ this.onChartTypesDetermined.emit(args);
1268
+ }
1269
+ set scatterChartYAxisValueMemberPath(path) {
1270
+ this._scatterChartYAxisValueMemberPath = path;
1271
+ }
1272
+ get scatterChartYAxisValueMemberPath() {
1273
+ return this._scatterChartYAxisValueMemberPath &&
1274
+ this._valueMemberPaths.indexOf(this._scatterChartYAxisValueMemberPath) !== -1 ?
1275
+ this._scatterChartYAxisValueMemberPath : this._valueMemberPaths[0];
1276
+ }
1277
+ set bubbleChartRadiusMemberPath(path) {
1278
+ this._bubbleChartRadiusMemberPath = path;
1279
+ }
1280
+ get bubbleChartRadiusMemberPath() {
1281
+ return this._bubbleChartRadiusMemberPath &&
1282
+ this._valueMemberPaths.indexOf(this._bubbleChartRadiusMemberPath) !== -1 ?
1283
+ this._bubbleChartRadiusMemberPath : this._valueMemberPaths[1];
1284
+ }
1285
+ get _labelMemberPath() {
1286
+ return this.defaultLabelMemberPath && this._chartData.some(r => r[this.defaultLabelMemberPath] !== undefined) ?
1287
+ this.defaultLabelMemberPath : this._labelMemberPaths.length > 0 ? this._labelMemberPaths[0] : 'Index';
1288
+ }
1289
+ get pieChartOptions() {
1290
+ return {
1291
+ width: '85%',
1292
+ height: '75%',
1293
+ dataSource: this.chartData,
1294
+ valueMemberPath: this._valueMemberPaths[0],
1295
+ legendLabelMemberPath: this._labelMemberPath,
1296
+ labelMemberPath: this._labelMemberPath,
1297
+ };
1298
+ }
1299
+ get dataChartOptions() {
1300
+ return {
1301
+ width: '100%',
1302
+ height: '85%',
1303
+ autoMarginWidth: 50,
1304
+ isVerticalZoomEnabled: true,
1305
+ isHorizontalZoomEnabled: true,
1306
+ dataSource: this.chartData
1307
+ };
1308
+ }
1309
+ constructor(factoryResolver) {
1310
+ this.factoryResolver = factoryResolver;
1311
+ this.onChartTypesDetermined = new EventEmitter();
1312
+ this.onChartCreationDone = new EventEmitter();
1313
+ this.useLegend = true;
1314
+ this.defaultLabelMemberPath = undefined;
1315
+ this.chartTypesAvailability = new Map();
1316
+ this.customChartComponentOptions = new Map();
1317
+ this.dataCharts = new Map();
1318
+ this._scatterChartYAxisValueMemberPath = undefined;
1319
+ this._bubbleChartRadiusMemberPath = undefined;
1320
+ this._valueMemberPaths = [];
1321
+ this._labelMemberPaths = [];
1322
+ this._sizeScale = new IgxSizeScaleComponent();
1323
+ this._dataChartTypes = new Set();
1324
+ this.dataChartSeriesOptionsModel = {
1325
+ isHighlightingEnabled: true,
1326
+ areaFillOpacity: .4,
1327
+ markerType: 3,
1328
+ showDefaultTooltip: true
1329
+ };
1330
+ this.scatterChartSeriesOptionsModel = {
1331
+ markerType: 3,
1332
+ showDefaultTooltip: true
1333
+ };
1334
+ this.bubbleChartSeriesOptionsModel = {
1335
+ radiusScale: this._sizeScale
1336
+ };
1337
+ this.dataCharts.set(CHART_TYPE.COLUMN_GROUPED, IgxColumnSeriesComponent);
1338
+ this.dataCharts.set(CHART_TYPE.AREA_GROUPED, IgxAreaSeriesComponent);
1339
+ this.dataCharts.set(CHART_TYPE.LINE_GROUPED, IgxLineSeriesComponent);
1340
+ this.dataCharts.set(CHART_TYPE.BAR_GROUPED, IgxBarSeriesComponent);
1341
+ this.dataCharts.set(CHART_TYPE.COLUMN_STACKED, IgxStackedColumnSeriesComponent);
1342
+ this.dataCharts.set(CHART_TYPE.AREA_STACKED, IgxStackedAreaSeriesComponent);
1343
+ this.dataCharts.set(CHART_TYPE.LINE_STACKED, IgxStackedLineSeriesComponent);
1344
+ this.dataCharts.set(CHART_TYPE.BAR_STACKED, IgxStackedBarSeriesComponent);
1345
+ this.dataCharts.set(CHART_TYPE.COLUMN_100_STACKED, IgxStacked100ColumnSeriesComponent);
1346
+ this.dataCharts.set(CHART_TYPE.AREA_100_STACKED, IgxStacked100AreaSeriesComponent);
1347
+ this.dataCharts.set(CHART_TYPE.LINE_100_STACKED, IgxStacked100LineSeriesComponent);
1348
+ this.dataCharts.set(CHART_TYPE.BAR_100_STACKED, IgxStacked100BarSeriesComponent);
1349
+ this.dataCharts.set(CHART_TYPE.SCATTER_POINT, IgxScatterSeriesComponent);
1350
+ this.dataCharts.set(CHART_TYPE.SCATTER_BUBBLE, IgxBubbleSeriesComponent);
1351
+ this.dataCharts.set(CHART_TYPE.SCATTER_LINE, IgxScatterLineSeriesComponent);
1352
+ this.dataCharts.set(CHART_TYPE.PIE, IgxPieChartComponent);
1353
+ const iterable = this.dataCharts.keys();
1354
+ for (let head = iterable.next().value; head !== undefined; head = iterable.next().value) {
1355
+ this._dataChartTypes.add(head);
1356
+ this.chartTypesAvailability.set(head, true);
1357
+ this.customChartComponentOptions.set(head, {});
1358
+ }
1359
+ }
1360
+ getAvailableCharts() {
1361
+ const res = [];
1362
+ this.chartTypesAvailability.forEach((isAvailable, chartType) => {
1363
+ if (isAvailable) {
1364
+ res.push(chartType);
1365
+ }
1366
+ });
1367
+ return res;
1368
+ }
1369
+ disableCharts(types) {
1370
+ types.forEach(type => {
1371
+ if (this.chartTypesAvailability.get(type)) {
1372
+ this.chartTypesAvailability.set(type, false);
1373
+ }
1374
+ });
1375
+ }
1376
+ enableCharts(types) {
1377
+ types.forEach(type => {
1378
+ if (!this.chartTypesAvailability.get(type)) {
1379
+ this.chartTypesAvailability.set(type, true);
1380
+ }
1381
+ });
1382
+ }
1383
+ chartFactory(type, viewContainerRef) {
1384
+ if (!this.chartTypesAvailability.get(type)) {
1385
+ return;
1386
+ }
1387
+ let componentFactory;
1388
+ let componentRef;
1389
+ this._sizeScale.maximumValue = 60;
1390
+ this._sizeScale.minimumValue = 10;
1391
+ const chartType = this.dataCharts.get(type);
1392
+ if (type === CHART_TYPE.PIE) {
1393
+ componentFactory = this.factoryResolver.resolveComponentFactory(IgxPieChartComponent);
1394
+ componentRef = viewContainerRef.createComponent(componentFactory);
1395
+ }
1396
+ else {
1397
+ componentFactory = this.factoryResolver.resolveComponentFactory(IgxDataChartComponent);
1398
+ componentRef = viewContainerRef.createComponent(componentFactory);
1399
+ }
1400
+ const options = this.getChartOptions(type);
1401
+ const initializer = this.getInitializer(type, chartType);
1402
+ if (this.useLegend) {
1403
+ const legendType = type === CHART_TYPE.PIE ? IgxItemLegendComponent : IgxLegendComponent;
1404
+ const legendFactory = this.factoryResolver.resolveComponentFactory(legendType);
1405
+ const legendComponentRef = viewContainerRef.createComponent(legendFactory);
1406
+ options.chartOptions['legend'] = legendComponentRef.instance;
1407
+ }
1408
+ const chart = initializer.initChart(componentRef.instance, options);
1409
+ this.onChartCreationDone.emit(chart);
1410
+ }
1411
+ getInitializer(chartType, componentClassRef) {
1412
+ if (chartType.includes('Pie')) {
1413
+ return new IgxPieChartInitializer();
1414
+ }
1415
+ else if (chartType.includes('Stacked')) {
1416
+ return new IgxStackedDataChartInitializer(componentClassRef);
1417
+ }
1418
+ else {
1419
+ return new IgxDataChartInitializer(componentClassRef);
1420
+ }
1421
+ }
1422
+ getChartOptions(type) {
1423
+ const chartComponentOptions = {};
1424
+ return type === CHART_TYPE.PIE ? this.addPieChartDataOptions(chartComponentOptions) :
1425
+ this.addDataChartDataOptions(type, chartComponentOptions, type.includes('Stacked'));
1426
+ }
1427
+ addPieChartDataOptions(chartComponentOptions) {
1428
+ // tslint:disable-next-line: max-line-length
1429
+ chartComponentOptions.chartOptions = Object.assign(this.pieChartOptions, this.customChartComponentOptions.get(CHART_TYPE.PIE).chartOptions);
1430
+ return chartComponentOptions;
1431
+ }
1432
+ addDataChartDataOptions(type, chartComponentOptions, stacked) {
1433
+ chartComponentOptions.chartOptions = Object.assign(this.dataChartOptions, this.customChartComponentOptions.get(type));
1434
+ if (type.indexOf('Scatter') !== -1) {
1435
+ this.addScatterChartDataOptions(type, chartComponentOptions);
1436
+ }
1437
+ else {
1438
+ // tslint:disable-next-line: max-line-length
1439
+ chartComponentOptions.seriesModel = Object.assign(this.dataChartSeriesOptionsModel, this.customChartComponentOptions.get(type).seriesModel);
1440
+ this.setAxisLabelOption(type, chartComponentOptions);
1441
+ const options = [];
1442
+ this._valueMemberPaths.forEach(valueMemberPath => {
1443
+ const dataOptions = {
1444
+ title: valueMemberPath,
1445
+ valueMemberPath
1446
+ };
1447
+ if (stacked) {
1448
+ options.push({ ...dataOptions });
1449
+ }
1450
+ else {
1451
+ options.push({ ...dataOptions, ...chartComponentOptions.seriesModel });
1452
+ }
1453
+ });
1454
+ stacked ? chartComponentOptions.stackedFragmentOptions = options :
1455
+ chartComponentOptions.seriesOptions = options;
1456
+ }
1457
+ return chartComponentOptions;
1458
+ }
1459
+ addScatterChartDataOptions(scatterChart, chartComponentOptions) {
1460
+ // tslint:disable-next-line: max-line-length
1461
+ chartComponentOptions.seriesModel = Object.assign(this.scatterChartSeriesOptionsModel, this.customChartComponentOptions.get(scatterChart).seriesModel);
1462
+ chartComponentOptions.seriesModel['yMemberPath'] = this.scatterChartYAxisValueMemberPath;
1463
+ if (scatterChart === CHART_TYPE.SCATTER_BUBBLE) {
1464
+ chartComponentOptions.seriesModel = Object.assign(chartComponentOptions.seriesModel, this.bubbleChartSeriesOptionsModel);
1465
+ chartComponentOptions.seriesModel['radiusMemberPath'] = this.bubbleChartRadiusMemberPath;
1466
+ }
1467
+ const model = chartComponentOptions.seriesModel;
1468
+ const seriesOptions = [];
1469
+ this._valueMemberPaths.filter(v => !(v === model['yMemberPath'] ||
1470
+ v === model['radiusMemberPath'])).forEach(valueMemberPath => {
1471
+ const dataOptions = {
1472
+ title: `${model['yMemberPath']} vs ${valueMemberPath}`,
1473
+ xMemberPath: valueMemberPath,
1474
+ labelMemberPath: this._labelMemberPath
1475
+ };
1476
+ seriesOptions.push({ ...dataOptions, ...model });
1477
+ });
1478
+ chartComponentOptions.seriesOptions = seriesOptions;
1479
+ }
1480
+ addIndexMemberPath(dataRecord, index) {
1481
+ dataRecord = { ...{ [this._labelMemberPath]: index }, ...dataRecord };
1482
+ return dataRecord;
1483
+ }
1484
+ setAxisLabelOption(type, options) {
1485
+ if (type.indexOf('Bar') !== -1) {
1486
+ options.yAxisOptions = Object.assign({
1487
+ label: this._labelMemberPath
1488
+ }, this.customChartComponentOptions.get(type).yAxisOptions);
1489
+ }
1490
+ else {
1491
+ options.xAxisOptions = Object.assign({
1492
+ label: this._labelMemberPath
1493
+ }, this.customChartComponentOptions.get(type).xAxisOptions);
1494
+ }
1495
+ }
1496
+ setChartComponentOptions(chart, optionsType, options) {
1497
+ if (!this.customChartComponentOptions.get(chart)[optionsType]) {
1498
+ this.customChartComponentOptions.get(chart)[optionsType] = {};
1499
+ }
1500
+ Object.keys(options).forEach(property => {
1501
+ this.customChartComponentOptions.get(chart)[optionsType][property] = options[property];
1502
+ });
1503
+ }
1504
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: IgxChartIntegrationDirective, deps: [{ token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Directive }); }
1505
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.0", type: IgxChartIntegrationDirective, selector: "[igxChartIntegration]", inputs: { chartData: "chartData", useLegend: "useLegend", defaultLabelMemberPath: "defaultLabelMemberPath", scatterChartYAxisValueMemberPath: "scatterChartYAxisValueMemberPath", bubbleChartRadiusMemberPath: "bubbleChartRadiusMemberPath" }, outputs: { onChartTypesDetermined: "onChartTypesDetermined", onChartCreationDone: "onChartCreationDone" }, ngImport: i0 }); }
1506
+ }
1507
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: IgxChartIntegrationDirective, decorators: [{
1508
+ type: Directive,
1509
+ args: [{
1510
+ selector: '[igxChartIntegration]'
1511
+ }]
1512
+ }], ctorParameters: () => [{ type: i0.ComponentFactoryResolver }], propDecorators: { chartData: [{
1513
+ type: Input
1514
+ }], onChartTypesDetermined: [{
1515
+ type: Output
1516
+ }], onChartCreationDone: [{
1517
+ type: Output
1518
+ }], useLegend: [{
1519
+ type: Input
1520
+ }], defaultLabelMemberPath: [{
1521
+ type: Input
1522
+ }], scatterChartYAxisValueMemberPath: [{
1523
+ type: Input
1524
+ }], bubbleChartRadiusMemberPath: [{
1525
+ type: Input
1526
1526
  }] } });
1527
1527
 
1528
- class IgxContextMenuDirective {
1529
- constructor(grid, textFormatter, chartsDirective, overlayService) {
1530
- this.grid = grid;
1531
- this.textFormatter = textFormatter;
1532
- this.chartsDirective = chartsDirective;
1533
- this.overlayService = overlayService;
1534
- this.onButtonClose = new EventEmitter();
1535
- this.formatters = [];
1536
- this.charts = [];
1537
- this.gridResizeNotify = new Subject();
1538
- this._collapsed = true;
1539
- this.destroy$ = new Subject();
1540
- this._analyticsBtnSettings = {
1541
- closeOnOutsideClick: false,
1542
- modal: false
1543
- };
1544
- }
1545
- ngOnInit() {
1546
- this.gridResizeNotify.pipe(takeUntil(this.destroy$))
1547
- .subscribe(() => {
1548
- if (this._id && !this._collapsed) {
1549
- this.renderButton();
1550
- }
1551
- });
1552
- }
1553
- ngAfterViewInit() {
1554
- this.setUpGridListeners();
1555
- if (this.textFormatter) {
1556
- this.textFormatter.onFormattersReady.pipe(takeUntil(this.destroy$))
1557
- .subscribe(names => this.formatters = names);
1558
- }
1559
- if (this.chartsDirective) {
1560
- this.chartsDirective.onChartTypesDetermined.pipe(takeUntil(this.destroy$))
1561
- .subscribe((args) => this.charts = args.chartsForCreation);
1562
- }
1563
- this.overlayService.opening.pipe(takeUntil(this.destroy$))
1564
- .subscribe((args) => {
1565
- if (args.componentRef) {
1566
- const instance = args.componentRef.instance;
1567
- instance.contextDirective = this;
1568
- }
1569
- });
1570
- }
1571
- ngOnDestroy() {
1572
- this.destroy$.next(true);
1573
- this.destroy$.complete();
1574
- if (!this._collapsed) {
1575
- this.close();
1576
- }
1577
- }
1578
- setUpGridListeners() {
1579
- this.contentObserver = new ResizeObserver(() => this.gridResizeNotify.next());
1580
- this.contentObserver.observe(this.grid.nativeElement);
1581
- this.grid.rangeSelected.pipe(takeUntil(this.destroy$))
1582
- .subscribe((args) => {
1583
- this._range = args;
1584
- if (this.chartsDirective) {
1585
- if (this.grid.getSelectedRanges().length === 1) {
1586
- this.chartsDirective.chartData = this.grid.getSelectedData();
1587
- }
1588
- else {
1589
- this.chartsDirective.chartData = [];
1590
- }
1591
- }
1592
- if (!this._collapsed) {
1593
- this.onButtonClose.emit();
1594
- }
1595
- this.renderButton();
1596
- });
1597
- this.grid.verticalScrollContainer.chunkLoad.pipe(merge(this.grid.parentVirtDir.chunkLoad, this.grid.filteringDone, this.grid.columnResized, this.grid.columnVisibilityChanged.pipe(debounceTime(30))), filter(() => this._range), takeUntil(this.destroy$)).subscribe(() => {
1598
- this.onButtonClose.emit();
1599
- this.renderButton();
1600
- });
1601
- }
1602
- renderButton() {
1603
- if (!this._range) {
1604
- return;
1605
- }
1606
- let rowIndex = this._range.rowEnd;
1607
- let colIndex = +this._range.columnEnd;
1608
- while (colIndex >= this._range.columnStart && !this.grid.navigation.isColumnFullyVisible(colIndex)) {
1609
- colIndex--;
1610
- }
1611
- while (rowIndex >= this._range.rowStart && this.grid.navigation.shouldPerformVerticalScroll(rowIndex, -1)) {
1612
- rowIndex--;
1613
- }
1614
- const field = this.grid.visibleColumns[colIndex] ? this.grid.visibleColumns[colIndex].field : '';
1615
- const cell = this.grid.gridAPI.get_cell_by_index(rowIndex, field);
1616
- if (!cell || !this.isWithInRange(cell.row.key, cell.column.index - 1)) {
1617
- this.close();
1618
- return;
1619
- }
1620
- this._analyticsBtnSettings.positionStrategy = new AutoPositionStrategy({
1621
- horizontalDirection: HorizontalAlignment.Right,
1622
- horizontalStartPoint: HorizontalAlignment.Right,
1623
- verticalStartPoint: VerticalAlignment.Bottom,
1624
- verticalDirection: VerticalAlignment.Bottom, closeAnimation: null,
1625
- target: cell.nativeElement
1626
- });
1627
- this._analyticsBtnSettings.scrollStrategy = new AbsoluteScrollStrategy();
1628
- const info = this.overlayService.getOverlayById(this._id);
1629
- if (info) {
1630
- info.settings.positionStrategy = this._analyticsBtnSettings.positionStrategy;
1631
- }
1632
- this._collapsed ? this.show() : this.overlayService.reposition(this._id);
1633
- }
1634
- show() {
1635
- if (!this._collapsed) {
1636
- return;
1637
- }
1638
- this._collapsed = false;
1639
- this._id = this._id ? this._id :
1640
- this.overlayService.attach(IgxContextMenuComponent, this._analyticsBtnSettings);
1641
- this.overlayService.show(this._id);
1642
- }
1643
- close() {
1644
- if (this._collapsed) {
1645
- return;
1646
- }
1647
- this._collapsed = true;
1648
- this.overlayService.hide(this._id);
1649
- this.onButtonClose.emit();
1650
- this._id = undefined;
1651
- }
1652
- isWithInRange(rInex, cIndex) {
1653
- return rInex >= this._range.rowStart && rInex <= this._range.rowEnd
1654
- && cIndex >= this._range.columnStart && cIndex <= this._range.columnEnd;
1655
- }
1656
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: IgxContextMenuDirective, deps: [{ token: i1$1.IgxGridComponent }, { token: IgxConditionalFormattingDirective, optional: true }, { token: IgxChartIntegrationDirective, optional: true }, { token: i1$1.IgxOverlayService }], target: i0.ɵɵFactoryTarget.Directive }); }
1657
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.5", type: IgxContextMenuDirective, selector: "[igxContextMenu]", outputs: { onButtonClose: "onButtonClose" }, ngImport: i0 }); }
1658
- }
1659
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: IgxContextMenuDirective, decorators: [{
1660
- type: Directive,
1661
- args: [{
1662
- selector: '[igxContextMenu]'
1663
- }]
1664
- }], ctorParameters: function () { return [{ type: i1$1.IgxGridComponent }, { type: IgxConditionalFormattingDirective, decorators: [{
1665
- type: Optional
1666
- }] }, { type: IgxChartIntegrationDirective, decorators: [{
1667
- type: Optional
1668
- }] }, { type: i1$1.IgxOverlayService }]; }, propDecorators: { onButtonClose: [{
1669
- type: Output
1528
+ class IgxContextMenuDirective {
1529
+ constructor(grid, textFormatter, chartsDirective, overlayService) {
1530
+ this.grid = grid;
1531
+ this.textFormatter = textFormatter;
1532
+ this.chartsDirective = chartsDirective;
1533
+ this.overlayService = overlayService;
1534
+ this.onButtonClose = new EventEmitter();
1535
+ this.formatters = [];
1536
+ this.charts = [];
1537
+ this.gridResizeNotify = new Subject();
1538
+ this._collapsed = true;
1539
+ this.destroy$ = new Subject();
1540
+ this._analyticsBtnSettings = {
1541
+ closeOnOutsideClick: false,
1542
+ modal: false
1543
+ };
1544
+ }
1545
+ ngOnInit() {
1546
+ this.gridResizeNotify.pipe(takeUntil(this.destroy$))
1547
+ .subscribe(() => {
1548
+ if (this._id && !this._collapsed) {
1549
+ this.renderButton();
1550
+ }
1551
+ });
1552
+ }
1553
+ ngAfterViewInit() {
1554
+ this.setUpGridListeners();
1555
+ if (this.textFormatter) {
1556
+ this.textFormatter.onFormattersReady.pipe(takeUntil(this.destroy$))
1557
+ .subscribe(names => this.formatters = names);
1558
+ }
1559
+ if (this.chartsDirective) {
1560
+ this.chartsDirective.onChartTypesDetermined.pipe(takeUntil(this.destroy$))
1561
+ .subscribe((args) => this.charts = args.chartsForCreation);
1562
+ }
1563
+ this.overlayService.opening.pipe(takeUntil(this.destroy$))
1564
+ .subscribe((args) => {
1565
+ if (args.componentRef) {
1566
+ const instance = args.componentRef.instance;
1567
+ instance.contextDirective = this;
1568
+ }
1569
+ });
1570
+ }
1571
+ ngOnDestroy() {
1572
+ this.destroy$.next(true);
1573
+ this.destroy$.complete();
1574
+ if (!this._collapsed) {
1575
+ this.close();
1576
+ }
1577
+ }
1578
+ setUpGridListeners() {
1579
+ this.contentObserver = new ResizeObserver(() => this.gridResizeNotify.next());
1580
+ this.contentObserver.observe(this.grid.nativeElement);
1581
+ this.grid.rangeSelected.pipe(takeUntil(this.destroy$))
1582
+ .subscribe((args) => {
1583
+ this._range = args;
1584
+ if (this.chartsDirective) {
1585
+ if (this.grid.getSelectedRanges().length === 1) {
1586
+ this.chartsDirective.chartData = this.grid.getSelectedData();
1587
+ }
1588
+ else {
1589
+ this.chartsDirective.chartData = [];
1590
+ }
1591
+ }
1592
+ if (!this._collapsed) {
1593
+ this.onButtonClose.emit();
1594
+ }
1595
+ this.renderButton();
1596
+ });
1597
+ this.grid.verticalScrollContainer.chunkLoad.pipe(merge(this.grid.parentVirtDir.chunkLoad, this.grid.filteringDone, this.grid.columnResized, this.grid.columnVisibilityChanged.pipe(debounceTime(30))), filter(() => this._range), takeUntil(this.destroy$)).subscribe(() => {
1598
+ this.onButtonClose.emit();
1599
+ this.renderButton();
1600
+ });
1601
+ }
1602
+ renderButton() {
1603
+ if (!this._range) {
1604
+ return;
1605
+ }
1606
+ let rowIndex = this._range.rowEnd;
1607
+ let colIndex = +this._range.columnEnd;
1608
+ while (colIndex >= this._range.columnStart && !this.grid.navigation.isColumnFullyVisible(colIndex)) {
1609
+ colIndex--;
1610
+ }
1611
+ while (rowIndex >= this._range.rowStart && this.grid.navigation.shouldPerformVerticalScroll(rowIndex, -1)) {
1612
+ rowIndex--;
1613
+ }
1614
+ const field = this.grid.visibleColumns[colIndex] ? this.grid.visibleColumns[colIndex].field : '';
1615
+ const cell = this.grid.gridAPI.get_cell_by_index(rowIndex, field);
1616
+ if (!cell || !this.isWithInRange(cell.row.key, cell.column.index - 1)) {
1617
+ this.close();
1618
+ return;
1619
+ }
1620
+ this._analyticsBtnSettings.positionStrategy = new AutoPositionStrategy({
1621
+ horizontalDirection: HorizontalAlignment.Right,
1622
+ horizontalStartPoint: HorizontalAlignment.Right,
1623
+ verticalStartPoint: VerticalAlignment.Bottom,
1624
+ verticalDirection: VerticalAlignment.Bottom, closeAnimation: null,
1625
+ target: cell.nativeElement
1626
+ });
1627
+ this._analyticsBtnSettings.scrollStrategy = new AbsoluteScrollStrategy();
1628
+ const info = this.overlayService.getOverlayById(this._id);
1629
+ if (info) {
1630
+ info.settings.positionStrategy = this._analyticsBtnSettings.positionStrategy;
1631
+ }
1632
+ this._collapsed ? this.show() : this.overlayService.reposition(this._id);
1633
+ }
1634
+ show() {
1635
+ if (!this._collapsed) {
1636
+ return;
1637
+ }
1638
+ this._collapsed = false;
1639
+ this._id = this._id ? this._id :
1640
+ this.overlayService.attach(IgxContextMenuComponent, this._analyticsBtnSettings);
1641
+ this.overlayService.show(this._id);
1642
+ }
1643
+ close() {
1644
+ if (this._collapsed) {
1645
+ return;
1646
+ }
1647
+ this._collapsed = true;
1648
+ this.overlayService.hide(this._id);
1649
+ this.onButtonClose.emit();
1650
+ this._id = undefined;
1651
+ }
1652
+ isWithInRange(rInex, cIndex) {
1653
+ return rInex >= this._range.rowStart && rInex <= this._range.rowEnd
1654
+ && cIndex >= this._range.columnStart && cIndex <= this._range.columnEnd;
1655
+ }
1656
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: IgxContextMenuDirective, deps: [{ token: i1$1.IgxGridComponent }, { token: IgxConditionalFormattingDirective, optional: true }, { token: IgxChartIntegrationDirective, optional: true }, { token: i1$1.IgxOverlayService }], target: i0.ɵɵFactoryTarget.Directive }); }
1657
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.0", type: IgxContextMenuDirective, selector: "[igxContextMenu]", outputs: { onButtonClose: "onButtonClose" }, ngImport: i0 }); }
1658
+ }
1659
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: IgxContextMenuDirective, decorators: [{
1660
+ type: Directive,
1661
+ args: [{
1662
+ selector: '[igxContextMenu]'
1663
+ }]
1664
+ }], ctorParameters: () => [{ type: i1$1.IgxGridComponent }, { type: IgxConditionalFormattingDirective, decorators: [{
1665
+ type: Optional
1666
+ }] }, { type: IgxChartIntegrationDirective, decorators: [{
1667
+ type: Optional
1668
+ }] }, { type: i1$1.IgxOverlayService }], propDecorators: { onButtonClose: [{
1669
+ type: Output
1670
1670
  }] } });
1671
1671
 
1672
- class IgxExtrasModule {
1673
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: IgxExtrasModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1674
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.5", ngImport: i0, type: IgxExtrasModule, declarations: [IgxConditionalFormattingDirective,
1675
- IgxChartIntegrationDirective,
1676
- IgxContextMenuDirective,
1677
- IgxContextMenuComponent,
1678
- IgxChartMenuComponent,
1679
- SvgPipe], imports: [IgxButtonModule,
1680
- IgxDividerModule,
1681
- IgxGridModule,
1682
- IgxTabsModule,
1683
- IgxToggleModule,
1684
- IgxDataChartCategoryModule,
1685
- IgxDataChartCoreModule,
1686
- IgxLegendModule,
1687
- IgxDataChartInteractivityModule,
1688
- IgxNumericXAxisModule,
1689
- IgxNumericYAxisModule,
1690
- IgxCategoryXAxisModule,
1691
- IgxItemLegendModule,
1692
- IgxPieChartModule,
1693
- IgxDataChartStackedModule,
1694
- IgxDividerModule,
1695
- IgxDataChartScatterModule,
1696
- IgxBarSeriesModule,
1697
- IgxIconModule,
1698
- IgxCategoryChartModule,
1699
- CommonModule], exports: [IgxConditionalFormattingDirective,
1700
- IgxChartIntegrationDirective,
1701
- IgxContextMenuDirective] }); }
1702
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: IgxExtrasModule, imports: [IgxButtonModule,
1703
- IgxDividerModule,
1704
- IgxGridModule,
1705
- IgxTabsModule,
1706
- IgxToggleModule,
1707
- IgxDataChartCategoryModule,
1708
- IgxDataChartCoreModule,
1709
- IgxLegendModule,
1710
- IgxDataChartInteractivityModule,
1711
- IgxNumericXAxisModule,
1712
- IgxNumericYAxisModule,
1713
- IgxCategoryXAxisModule,
1714
- IgxItemLegendModule,
1715
- IgxPieChartModule,
1716
- IgxDataChartStackedModule,
1717
- IgxDividerModule,
1718
- IgxDataChartScatterModule,
1719
- IgxBarSeriesModule,
1720
- IgxIconModule,
1721
- IgxCategoryChartModule,
1722
- CommonModule] }); }
1723
- }
1724
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: IgxExtrasModule, decorators: [{
1725
- type: NgModule,
1726
- args: [{
1727
- declarations: [
1728
- IgxConditionalFormattingDirective,
1729
- IgxChartIntegrationDirective,
1730
- IgxContextMenuDirective,
1731
- IgxContextMenuComponent,
1732
- IgxChartMenuComponent,
1733
- SvgPipe
1734
- ],
1735
- imports: [
1736
- IgxButtonModule,
1737
- IgxDividerModule,
1738
- IgxGridModule,
1739
- IgxTabsModule,
1740
- IgxToggleModule,
1741
- IgxDataChartCategoryModule,
1742
- IgxDataChartCoreModule,
1743
- IgxLegendModule,
1744
- IgxDataChartInteractivityModule,
1745
- IgxNumericXAxisModule,
1746
- IgxNumericYAxisModule,
1747
- IgxCategoryXAxisModule,
1748
- IgxItemLegendModule,
1749
- IgxPieChartModule,
1750
- IgxDataChartStackedModule,
1751
- IgxDividerModule,
1752
- IgxDataChartScatterModule,
1753
- IgxBarSeriesModule,
1754
- IgxIconModule,
1755
- IgxCategoryChartModule,
1756
- CommonModule
1757
- ],
1758
- exports: [
1759
- IgxConditionalFormattingDirective,
1760
- IgxChartIntegrationDirective,
1761
- IgxContextMenuDirective
1762
- ],
1763
- schemas: [CUSTOM_ELEMENTS_SCHEMA]
1764
- }]
1672
+ class IgxExtrasModule {
1673
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: IgxExtrasModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1674
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.0", ngImport: i0, type: IgxExtrasModule, declarations: [IgxConditionalFormattingDirective,
1675
+ IgxChartIntegrationDirective,
1676
+ IgxContextMenuDirective,
1677
+ IgxContextMenuComponent,
1678
+ IgxChartMenuComponent,
1679
+ SvgPipe], imports: [IgxButtonModule,
1680
+ IgxDividerModule,
1681
+ IgxGridModule,
1682
+ IgxTabsModule,
1683
+ IgxToggleModule,
1684
+ IgxDataChartCategoryModule,
1685
+ IgxDataChartCoreModule,
1686
+ IgxLegendModule,
1687
+ IgxDataChartInteractivityModule,
1688
+ IgxNumericXAxisModule,
1689
+ IgxNumericYAxisModule,
1690
+ IgxCategoryXAxisModule,
1691
+ IgxItemLegendModule,
1692
+ IgxPieChartModule,
1693
+ IgxDataChartStackedModule,
1694
+ IgxDividerModule,
1695
+ IgxDataChartScatterModule,
1696
+ IgxBarSeriesModule,
1697
+ IgxIconModule,
1698
+ IgxCategoryChartModule,
1699
+ CommonModule], exports: [IgxConditionalFormattingDirective,
1700
+ IgxChartIntegrationDirective,
1701
+ IgxContextMenuDirective] }); }
1702
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: IgxExtrasModule, imports: [IgxButtonModule,
1703
+ IgxDividerModule,
1704
+ IgxGridModule,
1705
+ IgxTabsModule,
1706
+ IgxToggleModule,
1707
+ IgxDataChartCategoryModule,
1708
+ IgxDataChartCoreModule,
1709
+ IgxLegendModule,
1710
+ IgxDataChartInteractivityModule,
1711
+ IgxNumericXAxisModule,
1712
+ IgxNumericYAxisModule,
1713
+ IgxCategoryXAxisModule,
1714
+ IgxItemLegendModule,
1715
+ IgxPieChartModule,
1716
+ IgxDataChartStackedModule,
1717
+ IgxDividerModule,
1718
+ IgxDataChartScatterModule,
1719
+ IgxBarSeriesModule,
1720
+ IgxIconModule,
1721
+ IgxCategoryChartModule,
1722
+ CommonModule] }); }
1723
+ }
1724
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: IgxExtrasModule, decorators: [{
1725
+ type: NgModule,
1726
+ args: [{
1727
+ declarations: [
1728
+ IgxConditionalFormattingDirective,
1729
+ IgxChartIntegrationDirective,
1730
+ IgxContextMenuDirective,
1731
+ IgxContextMenuComponent,
1732
+ IgxChartMenuComponent,
1733
+ SvgPipe
1734
+ ],
1735
+ imports: [
1736
+ IgxButtonModule,
1737
+ IgxDividerModule,
1738
+ IgxGridModule,
1739
+ IgxTabsModule,
1740
+ IgxToggleModule,
1741
+ IgxDataChartCategoryModule,
1742
+ IgxDataChartCoreModule,
1743
+ IgxLegendModule,
1744
+ IgxDataChartInteractivityModule,
1745
+ IgxNumericXAxisModule,
1746
+ IgxNumericYAxisModule,
1747
+ IgxCategoryXAxisModule,
1748
+ IgxItemLegendModule,
1749
+ IgxPieChartModule,
1750
+ IgxDataChartStackedModule,
1751
+ IgxDividerModule,
1752
+ IgxDataChartScatterModule,
1753
+ IgxBarSeriesModule,
1754
+ IgxIconModule,
1755
+ IgxCategoryChartModule,
1756
+ CommonModule
1757
+ ],
1758
+ exports: [
1759
+ IgxConditionalFormattingDirective,
1760
+ IgxChartIntegrationDirective,
1761
+ IgxContextMenuDirective
1762
+ ],
1763
+ schemas: [CUSTOM_ELEMENTS_SCHEMA]
1764
+ }]
1765
1765
  }] });
1766
1766
 
1767
- /*
1768
- * Public API Surface of igniteui-angular-extras
1767
+ /*
1768
+ * Public API Surface of igniteui-angular-extras
1769
1769
  */
1770
1770
 
1771
- /**
1772
- * Generated bundle index. Do not edit.
1771
+ /**
1772
+ * Generated bundle index. Do not edit.
1773
1773
  */
1774
1774
 
1775
1775
  export { CHART_TYPE, ChartInitializer, ConditionalFormattingType, IgxChartIntegrationDirective, IgxChartMenuComponent, IgxConditionalFormattingDirective, IgxContextMenuComponent, IgxContextMenuDirective, IgxDataChartInitializer, IgxExtrasModule, IgxPieChartInitializer, IgxStackedDataChartInitializer, OPTIONS_TYPE };