(newState: TransitionCheckState)
| 366 | } |
| 367 | |
| 368 | private _transitionCheckState(newState: TransitionCheckState) { |
| 369 | let oldState = this._currentCheckState; |
| 370 | let element = this._getAnimationTargetElement(); |
| 371 | |
| 372 | if (oldState === newState || !element) { |
| 373 | return; |
| 374 | } |
| 375 | if (this._currentAnimationClass) { |
| 376 | element.classList.remove(this._currentAnimationClass); |
| 377 | } |
| 378 | |
| 379 | this._currentAnimationClass = this._getAnimationClassForCheckStateTransition( |
| 380 | oldState, |
| 381 | newState, |
| 382 | ); |
| 383 | this._currentCheckState = newState; |
| 384 | |
| 385 | if (this._currentAnimationClass.length > 0) { |
| 386 | element.classList.add(this._currentAnimationClass); |
| 387 | |
| 388 | // Remove the animation class to avoid animation when the checkbox is moved between containers |
| 389 | const animationClass = this._currentAnimationClass; |
| 390 | |
| 391 | this._ngZone.runOutsideAngular(() => { |
| 392 | setTimeout(() => { |
| 393 | element!.classList.remove(animationClass); |
| 394 | }, 1000); |
| 395 | }); |
| 396 | } |
| 397 | } |
| 398 | |
| 399 | private _emitChangeEvent() { |
| 400 | this._controlValueAccessorChangeFn(this.checked); |
no test coverage detected