Statusable enforces consistent use of status across components.
import { DaffStatusableDirective } from '@daffodil/design'
Enforces consistent use of DaffStatus on a component by applying
status-specific CSS classes and validating the status in dev mode.
@Directive()
class DaffStatusableDirective implements DaffStatusable, OnChanges, OnInit {
defaultStatus: DaffStatus
@Input() status: DaffStatus
}
DaffStatus| Default | – |
|---|---|
| Description | The status of the component. |
DaffStatus| Default | – |
|---|---|
| Description | The default status used when no status is set. |
import { DaffStatusable } from '@daffodil/design'
The DaffStatusable interface defines a component that can have a status.
This status determines the styling or behavior of the component.
interface DaffStatusable {
status: DaffStatus
}
status DaffStatus |
|---|
The status of the component. |
import { DaffStatus } from '@daffodil/design'
The DaffStatus type defines the possible status values that a component can have.
type DaffStatus = 'info' | 'warn' | 'critical' | 'success'
import { DaffStatusEnum } from '@daffodil/design'
The DaffStatusEnum enumerates the possible status values for a component.
enum DaffStatusEnum {
Info = DaffStatusEnum.Info,
Warn = DaffStatusEnum.Warn,
Critical = DaffStatusEnum.Critical,
Success = DaffStatusEnum.Success,
}