Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private _chartSelectionDilogOverlaySettings = {
closeOnOutsideClick: true,
modal: false,
outlet: null,
scrollStrategy: new CloseScrollStrategy(),
positionStrategy: null
};
private _chartPreviewDialogOverlaySettings = {
closeOnOutsideClick: false,
modal: false,
outlet: null,
scrollStrategy: new CloseScrollStrategy(),
positionStrategy: new AutoPositionStrategy({
horizontalDirection: HorizontalAlignment.Center,
horizontalStartPoint: HorizontalAlignment.Center,
verticalStartPoint: VerticalAlignment.Top,
verticalDirection: VerticalAlignment.Top,
openAnimation: null,
closeAnimation: null
})
};
// Chart, Series, Axes options
private bubbleChartSizeScale = new IgxSizeScaleComponent();
private rowIndex;
private colIndex;
private pieChartOptions: IChartOptions = {
width: "85%",
height: "75%",
labelsPosition: 3,
allowSliceExplosion: true,
private _chartSelectionDilogOverlaySettings = {
closeOnOutsideClick: true,
modal: false,
outlet: null,
scrollStrategy: new CloseScrollStrategy(),
positionStrategy: null
};
private _chartPreviewDialogOverlaySettings = {
closeOnOutsideClick: false,
modal: false,
outlet: null,
scrollStrategy: new CloseScrollStrategy(),
positionStrategy: new AutoPositionStrategy({
horizontalDirection: HorizontalAlignment.Center,
horizontalStartPoint: HorizontalAlignment.Center,
verticalStartPoint: VerticalAlignment.Top,
verticalDirection: VerticalAlignment.Top,
openAnimation: null,
closeAnimation: null
})
};
// Chart, Series, Axes options
private bubbleChartSizeScale = new IgxSizeScaleComponent();
private rowIndex;
private colIndex;
private pieChartOptions: IChartOptions = {
width: "85%",
height: "75%",
labelsPosition: 3,
@ViewChild("scrollDemo")
public scrollDemo: ElementRef;
@ViewChild("modalDemo")
public modalDemo: ElementRef;
@ViewChild("overlayDemo")
public overlayDemo: ElementRef;
@ViewChild("mainContainer")
public mainContainer: ElementRef;
private _defaultPositionSettings: PositionSettings = {
target: null,
horizontalDirection: HorizontalAlignment.Center,
horizontalStartPoint: HorizontalAlignment.Center,
verticalDirection: VerticalAlignment.Middle,
verticalStartPoint: VerticalAlignment.Middle
};
private _overlaySettings: OverlaySettings = {
positionStrategy: new GlobalPositionStrategy(),
scrollStrategy: new AbsoluteScrollStrategy(),
modal: true,
closeOnOutsideClick: true
};
constructor(
@Inject(IgxOverlayService) public overlay: IgxOverlayService
) { }
public onClickDirection(horAlign: HorizontalAlignment, vertAlign: VerticalAlignment) {
const positionSettings =
horizontalDirection: HorizontalAlignment.Right,
horizontalStartPoint: HorizontalAlignment.Right,
verticalDirection: VerticalAlignment.Bottom,
verticalStartPoint: VerticalAlignment.Bottom
});
let positionStrategy;
switch (strat) {
case ("auto"):
positionStrategy = new AutoPositionStrategy(positionSettings);
break;
case ("connected"):
positionStrategy = new ConnectedPositioningStrategy(positionSettings);
break;
default:
positionStrategy = new GlobalPositionStrategy(Object.assign(positionSettings, {
horizontalDirection: HorizontalAlignment.Center,
verticalDirection: VerticalAlignment.Middle
}));
}
const showSettings = Object.assign(Object.assign({}, this._overlaySettings), {
modal: this.modalValue,
positionStrategy
});
this.overlay.show(this.overlayDemo, showSettings);
}
}
public toggleChartSelectionDialog(event) {
if (!this.chartSelectionDialog.isOpen) {
this._chartSelectionDilogOverlaySettings.outlet = this.outlet;
const positionStrategy = {
verticalStartPoint: VerticalAlignment.Bottom,
target: event.target
};
if (((this.grid.visibleColumns.length - 1) - this.colIndex) < 2 || !this.grid.navigation.isColumnFullyVisible(this.colIndex + 1)) {
positionStrategy["horizontalDirection"] = HorizontalAlignment.Left;
positionStrategy["horizontalStartPoint"] = HorizontalAlignment.Right;
} else {
positionStrategy["horizontalDirection"] = HorizontalAlignment.Center;
positionStrategy["horizontalStartPoint"] = HorizontalAlignment.Center;
}
this._chartSelectionDilogOverlaySettings.positionStrategy = new AutoPositionStrategy({ ...positionStrategy });
this.chartSelectionDialog.open(this._chartSelectionDilogOverlaySettings);
} else {
this.chartSelectionDialog.close();
}
}
public toggleChartSelectionDialog(event) {
if (!this.chartSelectionDialog.isOpen) {
this._chartSelectionDilogOverlaySettings.outlet = this.outlet;
const positionStrategy = {
verticalStartPoint: VerticalAlignment.Bottom,
target: event.target
};
if (((this.grid.visibleColumns.length - 1) - this.colIndex) < 2 || !this.grid.navigation.isColumnFullyVisible(this.colIndex + 1)) {
positionStrategy["horizontalDirection"] = HorizontalAlignment.Left;
positionStrategy["horizontalStartPoint"] = HorizontalAlignment.Right;
} else {
positionStrategy["horizontalDirection"] = HorizontalAlignment.Center;
positionStrategy["horizontalStartPoint"] = HorizontalAlignment.Center;
}
this._chartSelectionDilogOverlaySettings.positionStrategy = new AutoPositionStrategy({ ...positionStrategy });
this.chartSelectionDialog.open(this._chartSelectionDilogOverlaySettings);
} else {
this.chartSelectionDialog.close();
}
}
@ViewChild("scrollDemo")
public scrollDemo: ElementRef;
@ViewChild("modalDemo")
public modalDemo: ElementRef;
@ViewChild("overlayDemo")
public overlayDemo: ElementRef;
@ViewChild("mainContainer")
public mainContainer: ElementRef;
private _defaultPositionSettings: PositionSettings = {
target: null,
horizontalDirection: HorizontalAlignment.Center,
horizontalStartPoint: HorizontalAlignment.Center,
verticalDirection: VerticalAlignment.Middle,
verticalStartPoint: VerticalAlignment.Middle
};
private _overlaySettings: OverlaySettings = {
positionStrategy: new GlobalPositionStrategy(),
scrollStrategy: new AbsoluteScrollStrategy(),
modal: true,
closeOnOutsideClick: true
};
constructor(
@Inject(IgxOverlayService) public overlay: IgxOverlayService
) { }
public onClickDirection(horAlign: HorizontalAlignment, vertAlign: VerticalAlignment) {
public modalValue = true;
@ViewChild("modalDemo")
public modalDemo: ElementRef;
@ViewChild("overlayDemo")
public overlayDemo: ElementRef;
@ViewChild("mainContainer")
public mainContainer: ElementRef;
private _defaultPositionSettings: PositionSettings = {
target: null,
horizontalDirection: HorizontalAlignment.Center,
horizontalStartPoint: HorizontalAlignment.Center,
verticalDirection: VerticalAlignment.Middle,
verticalStartPoint: VerticalAlignment.Middle
};
private _overlaySettings: OverlaySettings = {
positionStrategy: new GlobalPositionStrategy(),
scrollStrategy: new AbsoluteScrollStrategy(),
modal: true,
closeOnOutsideClick: true
};
private destroy$ = new Subject();
private _overlayId: string;
constructor(
@Inject(IgxOverlayService) public overlay: IgxOverlayService
export class OverlayScrollSample1Component implements OnDestroy {
public modalValue = true;
@ViewChild("modalDemo")
public modalDemo: ElementRef;
@ViewChild("overlayDemo")
public overlayDemo: ElementRef;
@ViewChild("mainContainer")
public mainContainer: ElementRef;
private _defaultPositionSettings: PositionSettings = {
target: null,
horizontalDirection: HorizontalAlignment.Center,
horizontalStartPoint: HorizontalAlignment.Center,
verticalDirection: VerticalAlignment.Middle,
verticalStartPoint: VerticalAlignment.Middle
};
private _overlaySettings: OverlaySettings = {
positionStrategy: new GlobalPositionStrategy(),
scrollStrategy: new AbsoluteScrollStrategy(),
modal: true,
closeOnOutsideClick: true
};
private destroy$ = new Subject();
private _overlayId: string;
constructor(
verticalStartPoint: VerticalAlignment.Bottom
});
let positionStrategy;
switch (strategy) {
case ("auto"):
positionStrategy = new AutoPositionStrategy(positionSettings);
break;
case ("elastic"):
positionStrategy = new ElasticPositionStrategy(positionSettings);
break;
case ("connected"):
positionStrategy = new ConnectedPositioningStrategy(positionSettings);
break;
default:
positionStrategy = new GlobalPositionStrategy(Object.assign(positionSettings, {
horizontalDirection: HorizontalAlignment.Center,
verticalDirection: VerticalAlignment.Middle
}));
}
const showSettings = Object.assign(Object.assign({}, this._overlaySettings), {
modal: this.modalValue,
positionStrategy
});
this.overlay.show(this.overlayId, showSettings);
}