2023-03-02 11:05:45 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Badge directive is a small status indicator for another element.
|
|
|
|
*
|
2023-03-03 14:17:03 +00:00
|
|
|
* [Live Demo](https://primevue.org/badge)
|
2023-03-02 14:25:05 +00:00
|
|
|
*
|
|
|
|
* @module badgedirective
|
2023-03-02 11:05:45 +00:00
|
|
|
*/
|
|
|
|
import { DirectiveBinding, ObjectDirective } from 'vue';
|
2023-07-06 11:09:01 +00:00
|
|
|
import { DirectiveHooks } from '../basedirective';
|
|
|
|
|
2023-07-31 11:24:02 +00:00
|
|
|
export declare type BadgeDirectivePassThroughOptionType = BadgeDirectivePassThroughAttributes | ((options: BadgePassThroughMethodOptions) => BadgeDirectivePassThroughAttributes) | null | undefined;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) option method.
|
|
|
|
*/
|
|
|
|
export interface BadgePassThroughMethodOptions {
|
|
|
|
context: BadgeContext;
|
|
|
|
}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-06-23 09:47:31 +00:00
|
|
|
/**
|
|
|
|
* Defines options of Badge.
|
|
|
|
*/
|
2023-06-23 14:51:42 +00:00
|
|
|
export interface BadgeDirectiveOptions {
|
2023-06-23 09:47:31 +00:00
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to DOM elements inside the component.
|
2023-06-23 14:51:42 +00:00
|
|
|
* @type {BadgeDirectivePassThroughOptions}
|
2023-06-23 09:47:31 +00:00
|
|
|
*/
|
2023-06-23 14:51:42 +00:00
|
|
|
pt?: BadgeDirectivePassThroughOptions;
|
2023-07-06 10:11:23 +00:00
|
|
|
/**
|
|
|
|
* When enabled, it removes component related styles in the core.
|
|
|
|
* @defaultValue false
|
|
|
|
*/
|
|
|
|
unstyled?: boolean;
|
2023-06-23 09:47:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) options.
|
2023-06-23 14:51:42 +00:00
|
|
|
* @see {@link BadgeDirectiveOptions.pt}
|
2023-06-23 09:47:31 +00:00
|
|
|
*/
|
2023-06-23 14:51:42 +00:00
|
|
|
export interface BadgeDirectivePassThroughOptions {
|
2023-06-23 09:47:31 +00:00
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to the root's DOM element.
|
2023-06-23 09:47:31 +00:00
|
|
|
*/
|
2023-07-06 11:09:01 +00:00
|
|
|
root?: BadgeDirectivePassThroughOptionType;
|
2023-06-23 09:47:31 +00:00
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to manage all lifecycle hooks
|
2023-07-06 11:09:01 +00:00
|
|
|
* @see {@link BaseDirective.DirectiveHooks}
|
2023-06-23 09:47:31 +00:00
|
|
|
*/
|
2023-07-06 11:09:01 +00:00
|
|
|
hooks?: DirectiveHooks;
|
2023-06-23 09:47:31 +00:00
|
|
|
}
|
|
|
|
|
2023-06-22 13:50:40 +00:00
|
|
|
/**
|
2023-07-06 11:09:01 +00:00
|
|
|
* Custom passthrough attributes for each DOM elements
|
2023-06-22 13:50:40 +00:00
|
|
|
*/
|
2023-07-06 11:09:01 +00:00
|
|
|
export interface BadgeDirectivePassThroughAttributes {
|
|
|
|
[key: string]: any;
|
2023-06-22 13:50:40 +00:00
|
|
|
}
|
|
|
|
|
2023-07-31 11:24:02 +00:00
|
|
|
/**
|
|
|
|
* Defines current options in Badge directive.
|
|
|
|
*/
|
|
|
|
export interface BadgeContext {
|
|
|
|
/**
|
|
|
|
* Current info state as a boolean.
|
|
|
|
* @defaultValue true
|
|
|
|
*/
|
|
|
|
info: boolean;
|
|
|
|
/**
|
|
|
|
* Current success state as a boolean.
|
2023-07-31 12:12:50 +00:00
|
|
|
* @defaultValue false
|
2023-07-31 11:24:02 +00:00
|
|
|
*/
|
|
|
|
success: boolean;
|
|
|
|
/**
|
|
|
|
* Current warning state as a boolean.
|
2023-07-31 12:12:50 +00:00
|
|
|
* @defaultValue false
|
2023-07-31 11:24:02 +00:00
|
|
|
*/
|
|
|
|
warning: boolean;
|
|
|
|
/**
|
|
|
|
* Current danger state as a boolean.
|
2023-07-31 12:12:50 +00:00
|
|
|
* @defaultValue false
|
2023-07-31 11:24:02 +00:00
|
|
|
*/
|
|
|
|
danger: boolean;
|
2023-07-31 12:12:50 +00:00
|
|
|
/**
|
|
|
|
* Current gutter state as a boolean.
|
|
|
|
*/
|
|
|
|
nogutter: boolean;
|
|
|
|
/**
|
|
|
|
* Current dot state as a boolean.
|
|
|
|
*/
|
|
|
|
dot: boolean;
|
2023-07-31 11:24:02 +00:00
|
|
|
}
|
|
|
|
|
2023-03-02 11:05:45 +00:00
|
|
|
/**
|
|
|
|
* Defines modifiers of Badge directive.
|
|
|
|
*/
|
2023-03-02 14:25:05 +00:00
|
|
|
export interface BadgeDirectiveModifiers {
|
2023-03-02 11:05:45 +00:00
|
|
|
/**
|
2023-03-02 18:53:47 +00:00
|
|
|
* Info severity for Badge directive.
|
|
|
|
* @defaultValue true
|
2023-03-02 11:05:45 +00:00
|
|
|
*/
|
2023-03-02 18:53:47 +00:00
|
|
|
info?: boolean | undefined;
|
2023-03-02 11:05:45 +00:00
|
|
|
/**
|
2023-03-02 18:53:47 +00:00
|
|
|
* Success severity for Badge directive.
|
|
|
|
* @defaultValue false
|
2023-03-02 11:05:45 +00:00
|
|
|
*/
|
2023-03-02 18:53:47 +00:00
|
|
|
success?: boolean | undefined;
|
2023-03-02 11:05:45 +00:00
|
|
|
/**
|
|
|
|
* Warning severity for Badge directive.
|
2023-03-02 18:53:47 +00:00
|
|
|
* @defaultValue false
|
2023-03-02 11:05:45 +00:00
|
|
|
*/
|
2023-03-02 18:53:47 +00:00
|
|
|
warning?: boolean | undefined;
|
2023-03-02 11:05:45 +00:00
|
|
|
/**
|
|
|
|
* Danger severity for Badge directive.
|
2023-03-02 18:53:47 +00:00
|
|
|
* @defaultValue false
|
2023-03-02 11:05:45 +00:00
|
|
|
*/
|
2023-03-02 18:53:47 +00:00
|
|
|
danger?: boolean | undefined;
|
2023-03-02 14:25:05 +00:00
|
|
|
}
|
2023-03-02 11:05:45 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Binding of Badge directive.
|
|
|
|
*/
|
|
|
|
export interface BadgeDirectiveBinding extends Omit<DirectiveBinding, 'modifiers' | 'value'> {
|
|
|
|
/**
|
|
|
|
* Value of the Badge.
|
|
|
|
*/
|
2023-06-23 14:51:42 +00:00
|
|
|
value?: string | BadgeDirectiveOptions | undefined;
|
2023-03-02 11:05:45 +00:00
|
|
|
/**
|
|
|
|
* Modifiers of the Badge.
|
|
|
|
* @type {BadgeDirectiveModifiers}
|
|
|
|
*/
|
|
|
|
modifiers?: BadgeDirectiveModifiers | undefined;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* **PrimeVue - Badge**
|
|
|
|
*
|
|
|
|
* _Badge directive provides advisory information for a component._
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/badge/)
|
|
|
|
* --- ---
|
2023-03-03 10:55:20 +00:00
|
|
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
2023-03-02 11:05:45 +00:00
|
|
|
*
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
declare const BadgeDirective: ObjectDirective;
|
|
|
|
|
|
|
|
export default BadgeDirective;
|