|
|
@ -388,9 +388,11 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI |
|
|
this.sources.push(source); |
|
|
this.sources.push(source); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
this.prepareDisplayedColumn(); |
|
|
if (this.sources.length) { |
|
|
this.sources[this.sourceIndex].displayedColumns = |
|
|
this.prepareDisplayedColumn(); |
|
|
this.displayedColumns[this.sourceIndex].filter(value => value.display).map(value => value.def); |
|
|
this.sources[this.sourceIndex].displayedColumns = |
|
|
|
|
|
this.displayedColumns[this.sourceIndex].filter(value => value.display).map(value => value.def); |
|
|
|
|
|
} |
|
|
this.updateActiveEntityInfo(); |
|
|
this.updateActiveEntityInfo(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -398,48 +400,50 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI |
|
|
if ($event) { |
|
|
if ($event) { |
|
|
$event.stopPropagation(); |
|
|
$event.stopPropagation(); |
|
|
} |
|
|
} |
|
|
const target = $event.target || $event.currentTarget; |
|
|
if (this.sources.length) { |
|
|
const config = new OverlayConfig(); |
|
|
const target = $event.target || $event.currentTarget; |
|
|
config.backdropClass = 'cdk-overlay-transparent-backdrop'; |
|
|
const config = new OverlayConfig(); |
|
|
config.hasBackdrop = true; |
|
|
config.backdropClass = 'cdk-overlay-transparent-backdrop'; |
|
|
const connectedPosition: ConnectedPosition = { |
|
|
config.hasBackdrop = true; |
|
|
originX: 'end', |
|
|
const connectedPosition: ConnectedPosition = { |
|
|
originY: 'bottom', |
|
|
originX: 'end', |
|
|
overlayX: 'end', |
|
|
originY: 'bottom', |
|
|
overlayY: 'top' |
|
|
overlayX: 'end', |
|
|
}; |
|
|
overlayY: 'top' |
|
|
config.positionStrategy = this.overlay.position().flexibleConnectedTo(target as HTMLElement) |
|
|
}; |
|
|
.withPositions([connectedPosition]); |
|
|
config.positionStrategy = this.overlay.position().flexibleConnectedTo(target as HTMLElement) |
|
|
|
|
|
.withPositions([connectedPosition]); |
|
|
const overlayRef = this.overlay.create(config); |
|
|
|
|
|
overlayRef.backdropClick().subscribe(() => { |
|
|
const overlayRef = this.overlay.create(config); |
|
|
overlayRef.dispose(); |
|
|
overlayRef.backdropClick().subscribe(() => { |
|
|
}); |
|
|
overlayRef.dispose(); |
|
|
const source = this.sources[this.sourceIndex]; |
|
|
}); |
|
|
|
|
|
const source = this.sources[this.sourceIndex]; |
|
|
this.prepareDisplayedColumn(); |
|
|
|
|
|
|
|
|
this.prepareDisplayedColumn(); |
|
|
const providers: StaticProvider[] = [ |
|
|
|
|
|
{ |
|
|
const providers: StaticProvider[] = [ |
|
|
provide: DISPLAY_COLUMNS_PANEL_DATA, |
|
|
{ |
|
|
useValue: { |
|
|
provide: DISPLAY_COLUMNS_PANEL_DATA, |
|
|
columns: this.displayedColumns[this.sourceIndex], |
|
|
useValue: { |
|
|
columnsUpdated: (newColumns) => { |
|
|
columns: this.displayedColumns[this.sourceIndex], |
|
|
source.displayedColumns = newColumns.filter(value => value.display).map(value => value.def); |
|
|
columnsUpdated: (newColumns) => { |
|
|
this.clearCache(); |
|
|
source.displayedColumns = newColumns.filter(value => value.display).map(value => value.def); |
|
|
|
|
|
this.clearCache(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
provide: OverlayRef, |
|
|
|
|
|
useValue: overlayRef |
|
|
} |
|
|
} |
|
|
}, |
|
|
]; |
|
|
{ |
|
|
|
|
|
provide: OverlayRef, |
|
|
|
|
|
useValue: overlayRef |
|
|
|
|
|
} |
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
const injector = Injector.create({parent: this.viewContainerRef.injector, providers}); |
|
|
const injector = Injector.create({parent: this.viewContainerRef.injector, providers}); |
|
|
overlayRef.attach(new ComponentPortal(DisplayColumnsPanelComponent, |
|
|
overlayRef.attach(new ComponentPortal(DisplayColumnsPanelComponent, |
|
|
this.viewContainerRef, injector)); |
|
|
this.viewContainerRef, injector)); |
|
|
this.ctx.detectChanges(); |
|
|
this.ctx.detectChanges(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private prepareDisplayedColumn() { |
|
|
private prepareDisplayedColumn() { |
|
|
|