@engie-group/fluid-design-system-angular
Version:
Fluid Design System Angular
55 lines (47 loc) • 1.25 kB
text/typescript
import { CommonModule } from '@angular/common';
import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core';
import { ThemeComponentsVariants } from '../../models/theme-variant.model';
import { Utils } from '../../utils/utils.util';
import { BulletSize } from './bullet.model';
({
selector: 'nj-bullet',
templateUrl: './bullet.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
standalone: true,
imports: [CommonModule]
})
export class BulletComponent {
private bulletClassName = 'nj-bullet';
/**
* Bullet variant
*/
() variant: ThemeComponentsVariants = 'brand';
/**
* Bullet custom color, overrides variant
*/
() customColor: string;
/**
* Bullet size
*/
() size: BulletSize = 'md';
constructor() {}
/**
* @ignore
*/
getBulletVariantClass(): string {
if (!this.variant || !Utils.isUndefinedOrNull(this.customColor)) {
return '';
}
return `${this.bulletClassName}--${this.variant}`;
}
/**
* @ignore
*/
getButtonSizeClass(): string {
if (!this.size) {
return '';
}
return `${this.bulletClassName}--${this.size}`;
}
}