2022-09-06 12:03:37 +00:00
|
|
|
import { VNode } from 'vue';
|
|
|
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
|
|
|
|
|
|
type MessageSeverityType = 'success' | 'info' | 'warn' | 'error' | undefined;
|
|
|
|
|
|
|
|
export interface MessageProps {
|
|
|
|
/**
|
|
|
|
* Severity level of the message.
|
|
|
|
* @see MessageSeverityType
|
|
|
|
* Default value is 'info'.
|
|
|
|
*/
|
|
|
|
severity?: MessageSeverityType;
|
|
|
|
/**
|
|
|
|
* Whether the message can be closed manually using the close icon.
|
|
|
|
* Default value is true.
|
|
|
|
*/
|
|
|
|
closable?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* When enabled, message is not removed automatically.
|
|
|
|
*/
|
|
|
|
sticky?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Delay in milliseconds to close the message automatically.
|
|
|
|
* Default value is 3000.
|
|
|
|
*/
|
|
|
|
life?: number | undefined;
|
|
|
|
/**
|
|
|
|
* Display a custom icon for the message.
|
|
|
|
*/
|
|
|
|
icon?: string | undefined;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MessageSlots {
|
|
|
|
/**
|
|
|
|
* Default custom slot.
|
|
|
|
*/
|
|
|
|
default: () => VNode[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export declare type MessageEmits = {
|
|
|
|
/**
|
|
|
|
* Callback to invoke when a message is closed.
|
|
|
|
* @param {Event} event - Browser event.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
close: (event: Event) => void;
|
|
|
|
};
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2022-09-14 11:26:01 +00:00
|
|
|
declare class Message extends ClassComponent<MessageProps, MessageSlots, MessageEmits> {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
declare module '@vue/runtime-core' {
|
|
|
|
interface GlobalComponents {
|
2022-09-14 11:26:01 +00:00
|
|
|
Message: GlobalComponentConstructor<Message>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Messages is used to display inline messages with various severities.
|
|
|
|
*
|
|
|
|
* Demos:
|
|
|
|
*
|
2022-09-14 11:26:01 +00:00
|
|
|
* - [Message](https://www.primefaces.org/primevue/message)
|
2022-09-06 12:03:37 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
export default Message;
|