2023-03-01 13:00:40 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Badge represents people using icons, labels and images.
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/badge)
|
|
|
|
*
|
|
|
|
* @module badge
|
|
|
|
*
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
import { VNode } from 'vue';
|
2023-07-06 11:17:08 +00:00
|
|
|
import { ComponentHooks } from '../basecomponent';
|
2023-09-05 08:50:46 +00:00
|
|
|
import { PassThroughOptions } from '../passthrough';
|
2024-05-16 10:50:43 +00:00
|
|
|
import { DefineComponent, DesignToken, EmitFn, GlobalComponentConstructor, HintedString, PassThrough } from '../ts-helpers';
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-12-05 07:06:55 +00:00
|
|
|
export declare type BadgePassThroughOptionType<T = any> = BadgePassThroughAttributes | ((options: BadgePassThroughMethodOptions<T>) => BadgePassThroughAttributes | string) | string | null | undefined;
|
2023-04-21 13:22:04 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) option method.
|
|
|
|
*/
|
2023-12-05 07:06:55 +00:00
|
|
|
export interface BadgePassThroughMethodOptions<T> {
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines instance.
|
|
|
|
*/
|
2023-07-06 12:01:33 +00:00
|
|
|
instance: any;
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties.
|
|
|
|
*/
|
2023-04-21 13:22:04 +00:00
|
|
|
props: BadgeProps;
|
2023-09-05 08:50:46 +00:00
|
|
|
/**
|
|
|
|
* Defines passthrough(pt) options in global config.
|
|
|
|
*/
|
|
|
|
global: object | undefined;
|
2023-12-05 07:06:55 +00:00
|
|
|
/**
|
|
|
|
* Defines parent instance.
|
|
|
|
*/
|
|
|
|
parent: T;
|
2023-04-21 13:22:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough attributes for each DOM elements
|
|
|
|
*/
|
|
|
|
export interface BadgePassThroughAttributes {
|
|
|
|
[key: string]: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) options.
|
|
|
|
* @see {@link BadgeProps.pt}
|
|
|
|
*/
|
2023-12-05 07:06:55 +00:00
|
|
|
export interface BadgePassThroughOptions<T = any> {
|
2023-04-21 13:22:04 +00:00
|
|
|
/**
|
2024-05-15 09:24:26 +00:00
|
|
|
* Used to pass attributes to the root's DOM element.
|
2023-04-21 13:22:04 +00:00
|
|
|
*/
|
2023-12-05 07:06:55 +00:00
|
|
|
root?: BadgePassThroughOptionType<T>;
|
2023-07-06 11:09:01 +00:00
|
|
|
/**
|
2023-11-07 06:16:39 +00:00
|
|
|
* Used to manage all lifecycle hooks.
|
2023-07-06 11:09:01 +00:00
|
|
|
* @see {@link BaseComponent.ComponentHooks}
|
|
|
|
*/
|
|
|
|
hooks?: ComponentHooks;
|
2023-04-21 13:22:04 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 13:00:40 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties in Badge component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface BadgeProps {
|
|
|
|
/**
|
|
|
|
* Value to display inside the badge.
|
|
|
|
*/
|
2023-03-07 07:32:19 +00:00
|
|
|
value?: string | number;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Severity type of the badge.
|
|
|
|
*/
|
2024-04-16 07:34:11 +00:00
|
|
|
severity?: HintedString<'secondary' | 'info' | 'success' | 'warn' | 'danger' | 'contrast'> | null | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
2024-05-13 15:20:54 +00:00
|
|
|
* Size of the badge, valid options are 'small', 'large', and 'xlarge'.
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
2024-05-14 09:11:50 +00:00
|
|
|
size?: 'small' | 'large' | 'xlarge' | null | undefined;
|
2024-04-02 08:24:31 +00:00
|
|
|
/**
|
|
|
|
* It generates scoped CSS variables using design tokens for the component.
|
|
|
|
*/
|
|
|
|
dt?: DesignToken<any>;
|
2023-04-21 13:22:04 +00:00
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to DOM elements inside the component.
|
2023-04-21 13:22:04 +00:00
|
|
|
* @type {BadgePassThroughOptions}
|
|
|
|
*/
|
2023-09-05 11:28:04 +00:00
|
|
|
pt?: PassThrough<BadgePassThroughOptions>;
|
2023-09-05 08:50:46 +00:00
|
|
|
/**
|
|
|
|
* Used to configure passthrough(pt) options of the component.
|
|
|
|
* @type {PassThroughOptions}
|
|
|
|
*/
|
|
|
|
ptOptions?: PassThroughOptions;
|
2023-05-25 06:38:12 +00:00
|
|
|
/**
|
|
|
|
* When enabled, it removes component related styles in the core.
|
|
|
|
* @defaultValue false
|
|
|
|
*/
|
|
|
|
unstyled?: boolean;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 13:00:40 +00:00
|
|
|
/**
|
|
|
|
* Defines valid slots in Badge component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface BadgeSlots {
|
|
|
|
/**
|
|
|
|
* Content can easily be customized with the default slot instead of using the built-in display.
|
|
|
|
*/
|
2023-03-01 13:00:40 +00:00
|
|
|
default(): VNode[];
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 13:00:40 +00:00
|
|
|
/**
|
|
|
|
* Defines valid emits in Badge component.
|
|
|
|
*/
|
2024-05-16 10:50:43 +00:00
|
|
|
interface BadgeEmitsOptions {}
|
|
|
|
|
|
|
|
export declare type BadgeEmits = EmitFn<BadgeEmitsOptions>;
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-03-01 13:00:40 +00:00
|
|
|
/**
|
|
|
|
* **PrimeVue - Badge**
|
|
|
|
*
|
|
|
|
* _Badge represents people using icons, labels and images._
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/badge/)
|
|
|
|
* --- ---
|
|
|
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
|
|
|
*
|
|
|
|
* @group Component
|
2024-05-16 10:50:43 +00:00
|
|
|
*
|
2023-03-01 13:00:40 +00:00
|
|
|
*/
|
2024-05-16 10:50:43 +00:00
|
|
|
declare const Badge: DefineComponent<BadgeProps, BadgeSlots, BadgeEmits>;
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2024-03-14 22:58:11 +00:00
|
|
|
declare module 'vue' {
|
|
|
|
export interface GlobalComponents {
|
2024-05-16 10:50:43 +00:00
|
|
|
Badge: GlobalComponentConstructor<BadgeProps, BadgeSlots, BadgeEmits>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Badge;
|