coreui-angular-ex
Version:
CoreUI Components Library for Angular
63 lines (55 loc) • 1.59 kB
text/typescript
import { booleanAttribute, Component, HostBinding, Input } from '@angular/core';
import { NgClass, NgIf } from '@angular/common';
import { Colors } from '../../coreui.types';
import { CardBodyComponent, CardComponent } from '../../card';
({
selector: 'c-widget-stat-b',
templateUrl: './widget-stat-b.component.html',
exportAs: 'cWidgetStatB',
standalone: true,
imports: [CardBodyComponent, NgIf, NgClass]
})
export class WidgetStatBComponent extends CardComponent {
constructor() {
super();
}
/**
* Sets the color context of the component to one of CoreUI’s themed colors.
* @type Colors
*/
() override color?: Colors;
/**
* Sets the text-color context of the component to one of CoreUI’s themed colors.
* @type Colors
*/
() override textColor?: Colors | 'white' | 'muted';
/**
* Title of the widget to display
* @type string
*/
() title?: string;
/**
* Helper text for your widget.
* @type string
*/
() text?: string;
/**
* Value for your widget to display
* @type string
*/
() value?: string;
/**
* Invert colors from their default dark shade.
* @type boolean
*/
({ transform: booleanAttribute }) inverse: string | boolean = false;
('class')
override get hostClasses() {
return {
'card': true,
[`bg-${this.color}`]: !!this.color,
[`text-${this.textColor}`]: !!this.textColor,
'text-high-emphasis-inverse': !!this.color
};
}
}