import { on } from './event' ; import { _Event } from '../types/event' ; import { State } from '../types/store' ; import { has } from './typeOf' ; export function resetHoverColor ( el , theme ) { function hover ( e ) { el . style . color = e . type === 'mouseenter' ? theme : '' ; } on ( el , hover , 'mouseenter' ) ; on ( el , hover , 'mouseleave' ) ; } export function resetSelectColor ( el , state , classes ) { const { themeColor , rangeBgColor } = state ; const div = Array . from ( el . children ) . shift ( ) as HTMLElement ; if ( ! div ) return ; const { style } = div ; if ( rangeBgColor ) { style . backgroundColor = has ( classes , 'inRange' ) ? rangeBgColor : '' ; } if ( themeColor ) { style . backgroundColor = has ( classes , [ 'selected' , 'range-start' , 'range-end' , 'weekStart' , 'weekEnd' , ] ) ? themeColor : rangeBgColor ? style . backgroundColor : '' ; style . borderColor = has ( classes , 'today' ) ? themeColor : '' ; } }