import { Dimensions } from '../dimensions.interface' ; import { AlignmentTypes } from '../alignment-types.enum' ; import { verticalPosition } from '../vertical-position/vertical-position.util' ; param elDimensions param popoverDimensions param alignment memberOf export const calculateVerticalAlignment = ( elDimensions , popoverDimensions , alignment ) : number => { let result = verticalPosition ( elDimensions , popoverDimensions , alignment ) ; if ( result + popoverDimensions . height > window . innerHeight ) { result = window . innerHeight - popoverDimensions . height ; } return result ; } ;