primeng
Version:
PrimeNG is an open source UI library for Angular featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeB
157 lines (153 loc) • 5.77 kB
TypeScript
import * as i0 from '@angular/core';
import { OnChanges, AfterViewInit, SimpleChanges } from '@angular/core';
import { BaseComponent } from 'primeng/basecomponent';
import { BaseStyle } from 'primeng/base';
import * as i1 from 'primeng/api';
/**
*
* Badge represents people using icons, labels and images.
*
* [Live Demo](https://www.primeng.org/badge)
*
* @module badgestyle
*
*/
declare enum BadgeClasses {
/**
* Class name of the root element
*/
root = "p-badge"
}
declare class BadgeStyle extends BaseStyle {
name: string;
theme: string;
classes: {
root: ({ instance }: {
instance: any;
}) => (string | {
'p-badge-circle': boolean;
'p-badge-dot': boolean;
'p-badge-sm': boolean;
'p-badge-lg': boolean;
'p-badge-xl': boolean;
'p-badge-info': boolean;
'p-badge-success': boolean;
'p-badge-warn': boolean;
'p-badge-danger': boolean;
'p-badge-secondary': boolean;
'p-badge-contrast': boolean;
})[];
};
static ɵfac: i0.ɵɵFactoryDeclaration<BadgeStyle, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<BadgeStyle>;
}
interface BadgeStyle extends BaseStyle {
}
/**
* Badge Directive is directive usage of badge component.
* @group Components
*/
declare class BadgeDirective extends BaseComponent implements OnChanges, AfterViewInit {
/**
* When specified, disables the component.
* @group Props
*/
disabled: boolean;
/**
* Size of the badge, valid options are "large" and "xlarge".
* @group Props
*/
badgeSize: 'large' | 'xlarge' | 'small' | null | undefined;
/**
* Size of the badge, valid options are "large" and "xlarge".
* @group Props
* @deprecated use badgeSize instead.
*/
set size(value: 'large' | 'xlarge' | 'small' | null | undefined);
get size(): "large" | "xlarge" | "small" | null | undefined;
_size: 'large' | 'xlarge' | 'small' | null | undefined;
/**
* Severity type of the badge.
* @group Props
*/
severity: 'secondary' | 'info' | 'success' | 'warn' | 'danger' | 'contrast' | null | undefined;
/**
* Value to display inside the badge.
* @group Props
*/
value: string | number;
/**
* Inline style of the element.
* @group Props
*/
badgeStyle: {
[klass: string]: any;
} | null | undefined;
/**
* Class of the element.
* @group Props
*/
badgeStyleClass: string;
private id;
badgeEl: HTMLElement;
_componentStyle: BadgeStyle;
private get activeElement();
private get canUpdateBadge();
constructor();
ngOnChanges({ value, size, severity, disabled, badgeStyle, badgeStyleClass }: SimpleChanges): void;
ngAfterViewInit(): void;
private setValue;
private setSizeClasses;
private renderBadgeContent;
private applyStyles;
private setSeverity;
private toggleDisableState;
static ɵfac: i0.ɵɵFactoryDeclaration<BadgeDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<BadgeDirective, "[pBadge]", never, { "disabled": { "alias": "badgeDisabled"; "required": false; }; "badgeSize": { "alias": "badgeSize"; "required": false; }; "size": { "alias": "size"; "required": false; }; "severity": { "alias": "severity"; "required": false; }; "value": { "alias": "value"; "required": false; }; "badgeStyle": { "alias": "badgeStyle"; "required": false; }; "badgeStyleClass": { "alias": "badgeStyleClass"; "required": false; }; }, {}, never, never, true, never>;
}
/**
* Badge is a small status indicator for another element.
* @group Components
*/
declare class Badge extends BaseComponent {
/**
* Class of the element.
* @deprecated since v20.0.0, use `class` instead.
* @group Props
*/
styleClass: i0.InputSignal<string>;
/**
* Size of the badge, valid options are "large" and "xlarge".
* @group Props
*/
badgeSize: i0.InputSignal<"small" | "large" | "xlarge">;
/**
* Size of the badge, valid options are "large" and "xlarge".
* @group Props
*/
size: i0.InputSignal<"small" | "large" | "xlarge">;
/**
* Severity type of the badge.
* @group Props
*/
severity: i0.InputSignal<"info" | "success" | "warn" | "danger" | "secondary" | "contrast">;
/**
* Value to display inside the badge.
* @group Props
*/
value: i0.InputSignal<string | number>;
/**
* When specified, disables the component.
* @group Props
*/
badgeDisabled: i0.InputSignalWithTransform<boolean, boolean>;
_componentStyle: BadgeStyle;
static ɵfac: i0.ɵɵFactoryDeclaration<Badge, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<Badge, "p-badge", never, { "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; "badgeSize": { "alias": "badgeSize"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "severity": { "alias": "severity"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "badgeDisabled": { "alias": "badgeDisabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
declare class BadgeModule {
static ɵfac: i0.ɵɵFactoryDeclaration<BadgeModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<BadgeModule, never, [typeof Badge, typeof BadgeDirective, typeof i1.SharedModule], [typeof Badge, typeof BadgeDirective, typeof i1.SharedModule]>;
static ɵinj: i0.ɵɵInjectorDeclaration<BadgeModule>;
}
export { Badge, BadgeClasses, BadgeDirective, BadgeModule, BadgeStyle };