coreui-angular-ex-dev
Version:
CoreUI Components Library for Angular
32 lines (25 loc) • 836 B
text/typescript
import { AfterContentInit, ContentChild, Directive, HostBinding, Input } from '@angular/core';
import { PlaceholderDirective } from './placeholder.directive';
({
selector: '[cPlaceholderAnimation]',
standalone: true
})
export class PlaceholderAnimationDirective implements AfterContentInit {
/**
* Animation type for placeholder
* @type 'glow' | 'wave'
* @default undefined
*/
('cPlaceholderAnimation') animation?: 'glow' | 'wave';
(PlaceholderDirective) placeholder!: PlaceholderDirective;
#animate: boolean = false;
('class')
get hostClasses(): any {
return {
[`placeholder-${this.animation}`]: this.#animate && !!this.animation
};
}
ngAfterContentInit() {
this.#animate = this.placeholder?.visible;
}
}