Extension of beam propagation method to time-dependent optical waveforms