import { SplitDirection } from '../index' ; export default function getInnerSize ( direction , element ) { const computedStyle = getComputedStyle ( element ) ; if ( ! computedStyle ) return ; let size = direction === SplitDirection . Horizontal ? element . clientWidth : element . clientHeight ; if ( size === 0 ) return ; if ( direction === SplitDirection . Horizontal ) { size -= parseFloat ( computedStyle . paddingLeft ) + parseFloat ( computedStyle . paddingRight ) ; } else { size -= parseFloat ( computedStyle . paddingTop ) + parseFloat ( computedStyle . paddingBottom ) ; } return size ; }