2023-03-01 12:52:17 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Avatar represents people using icons, labels and images.
|
|
|
|
*
|
2023-03-02 09:22:22 +00:00
|
|
|
* - [Live Demo](https://primevue.org/avatar)
|
2023-03-01 12:52:17 +00:00
|
|
|
*
|
|
|
|
* @module avatar
|
|
|
|
*/
|
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, PassThrough } from '../ts-helpers';
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-07-11 22:42:43 +00:00
|
|
|
export declare type AvatarPassThroughOptionType = AvatarPassThroughAttributes | ((options: AvatarPassThroughMethodOptions) => AvatarPassThroughAttributes | string) | string | null | undefined;
|
2023-04-21 12:04:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) option method.
|
|
|
|
*/
|
|
|
|
export interface AvatarPassThroughMethodOptions {
|
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 12:04:27 +00:00
|
|
|
props: AvatarProps;
|
2023-12-10 21:41:17 +00:00
|
|
|
/**
|
|
|
|
* Defines valid attributes.
|
|
|
|
*/
|
|
|
|
attrs: any;
|
2023-09-05 06:50:04 +00:00
|
|
|
/**
|
2023-12-05 11:06:32 +00:00
|
|
|
* Defines parent options.
|
2023-09-05 06:50:04 +00:00
|
|
|
*/
|
2023-12-05 11:06:32 +00:00
|
|
|
parent: any;
|
2023-09-05 08:50:46 +00:00
|
|
|
/**
|
|
|
|
* Defines passthrough(pt) options in global config.
|
|
|
|
*/
|
|
|
|
global: object | undefined;
|
2023-04-21 12:04:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough attributes for each DOM elements
|
|
|
|
*/
|
|
|
|
export interface AvatarPassThroughAttributes {
|
|
|
|
[key: string]: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Custom passthrough(pt) options.
|
|
|
|
* @see {@link AvatarProps.pt}
|
|
|
|
*/
|
|
|
|
export interface AvatarPassThroughOptions {
|
|
|
|
/**
|
2024-05-15 09:24:26 +00:00
|
|
|
* Used to pass attributes to the root's DOM element.
|
2023-04-21 12:04:27 +00:00
|
|
|
*/
|
|
|
|
root?: AvatarPassThroughOptionType;
|
|
|
|
/**
|
2024-05-15 09:24:26 +00:00
|
|
|
* Used to pass attributes to the label's DOM element.
|
2023-04-21 12:04:27 +00:00
|
|
|
*/
|
|
|
|
label?: AvatarPassThroughOptionType;
|
|
|
|
/**
|
2024-05-15 09:24:26 +00:00
|
|
|
* Used to pass attributes to the icon's DOM element.
|
2023-04-21 12:04:27 +00:00
|
|
|
*/
|
|
|
|
icon?: AvatarPassThroughOptionType;
|
|
|
|
/**
|
2024-05-15 09:24:26 +00:00
|
|
|
* Used to pass attributes to the image's DOM element.
|
2023-04-21 12:04:27 +00:00
|
|
|
*/
|
|
|
|
image?: AvatarPassThroughOptionType;
|
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 12:04:27 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 12:52:17 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties in Avatar component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface AvatarProps {
|
|
|
|
/**
|
|
|
|
* Defines the text to display.
|
|
|
|
*/
|
|
|
|
label?: string | undefined;
|
|
|
|
/**
|
|
|
|
* Defines the icon to display.
|
|
|
|
*/
|
|
|
|
icon?: string | undefined;
|
|
|
|
/**
|
|
|
|
* Defines the image to display.
|
|
|
|
*/
|
|
|
|
image?: string | undefined;
|
|
|
|
/**
|
2023-03-01 12:52:17 +00:00
|
|
|
* Size of the element.
|
2023-03-08 10:51:52 +00:00
|
|
|
* @defaultValue normal
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
2023-03-01 12:52:17 +00:00
|
|
|
size?: 'normal' | 'large' | 'xlarge' | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
2023-03-01 12:52:17 +00:00
|
|
|
* Shape of the element.
|
2023-03-08 10:51:52 +00:00
|
|
|
* @defaultValue square
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
2023-03-01 12:52:17 +00:00
|
|
|
shape?: 'square' | 'circle' | undefined;
|
2022-12-08 11:04:25 +00:00
|
|
|
/**
|
|
|
|
* Establishes a string value that labels the component.
|
|
|
|
*/
|
2023-11-24 12:21:54 +00:00
|
|
|
ariaLabel?: string | undefined;
|
2022-12-08 11:04:25 +00:00
|
|
|
/**
|
|
|
|
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
|
|
|
|
*/
|
2023-11-24 12:21:54 +00:00
|
|
|
ariaLabelledby?: string | 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 12:04:27 +00:00
|
|
|
/**
|
2023-08-01 14:01:12 +00:00
|
|
|
* Used to pass attributes to DOM elements inside the component.
|
2023-04-21 12:04:27 +00:00
|
|
|
* @type {AvatarPassThroughOptions}
|
|
|
|
*/
|
2023-09-05 11:28:04 +00:00
|
|
|
pt?: PassThrough<AvatarPassThroughOptions>;
|
2023-09-05 08:50:46 +00:00
|
|
|
/**
|
|
|
|
* Used to configure passthrough(pt) options of the component.
|
|
|
|
* @type {PassThroughOptions}
|
|
|
|
*/
|
|
|
|
ptOptions?: PassThroughOptions;
|
2023-05-23 13:16:38 +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 12:52:17 +00:00
|
|
|
/**
|
|
|
|
* Defines valid slots in Avatar component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface AvatarSlots {
|
|
|
|
/**
|
|
|
|
* Content can easily be customized with the default slot instead of using the built-in modes.
|
|
|
|
*/
|
2023-03-01 12:52:17 +00:00
|
|
|
default(): VNode[];
|
2023-04-18 07:37:05 +00:00
|
|
|
/**
|
2023-04-18 13:42:36 +00:00
|
|
|
* Custom icon template.
|
2023-04-18 07:37:05 +00:00
|
|
|
*/
|
|
|
|
icon(): VNode[];
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
2023-03-01 12:52:17 +00:00
|
|
|
/**
|
|
|
|
* Defines valid emits in Avatar component.
|
|
|
|
*/
|
2024-05-16 14:05:43 +00:00
|
|
|
export interface AvatarEmitsOptions {
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Triggered when an error occurs while loading an image file.
|
|
|
|
*/
|
2023-08-02 09:18:47 +00:00
|
|
|
error(event: Event): void;
|
2023-03-01 12:52:17 +00:00
|
|
|
}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2024-05-16 10:50:43 +00:00
|
|
|
export declare type AvatarEmits = EmitFn<AvatarEmitsOptions>;
|
|
|
|
|
2023-03-01 12:52:17 +00:00
|
|
|
/**
|
|
|
|
* **PrimeVue - Avatar**
|
|
|
|
*
|
|
|
|
* _Avatar represents people using icons, labels and images._
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/avatar/)
|
|
|
|
* --- ---
|
|
|
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo-100.png)
|
|
|
|
*
|
|
|
|
* @group Component
|
2024-05-16 10:50:43 +00:00
|
|
|
*
|
2023-03-01 12:52:17 +00:00
|
|
|
*/
|
2024-05-16 10:50:43 +00:00
|
|
|
declare const Avatar: DefineComponent<AvatarProps, AvatarSlots, AvatarEmits>;
|
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
|
|
|
Avatar: GlobalComponentConstructor<AvatarProps, AvatarSlots, AvatarEmits>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Avatar;
|