mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Refactor #3879 - For Chip
This commit is contained in:
parent
c50efe4bbf
commit
b228f30c52
3 changed files with 74 additions and 6 deletions
60
components/lib/chip/Chip.d.ts
vendored
60
components/lib/chip/Chip.d.ts
vendored
|
@ -10,6 +10,61 @@
|
|||
import { VNode } from 'vue';
|
||||
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
||||
|
||||
export declare type ChipPassThroughOptionType = ChipPassThroughAttributes | ((options: ChipPassThroughMethodOptions) => ChipPassThroughAttributes) | null | undefined;
|
||||
|
||||
/**
|
||||
* Custom passthrough(pt) option method.
|
||||
*/
|
||||
export interface ChipPassThroughMethodOptions {
|
||||
props: ChipProps;
|
||||
state: ChipState;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom passthrough(pt) options.
|
||||
* @see {@link ChipProps.pt}
|
||||
*/
|
||||
export interface ChipPassThroughOptions {
|
||||
/**
|
||||
* Uses to pass attributes to the root's DOM element.
|
||||
*/
|
||||
root?: ChipPassThroughOptionType;
|
||||
/**
|
||||
* Uses to pass attributes to the image's DOM element.
|
||||
*/
|
||||
image?: ChipPassThroughOptionType;
|
||||
/**
|
||||
* Uses to pass attributes to the icon's DOM element.
|
||||
*/
|
||||
icon?: ChipPassThroughOptionType;
|
||||
/**
|
||||
* Uses to pass attributes to the label' DOM element.
|
||||
*/
|
||||
label?: ChipPassThroughOptionType;
|
||||
/**
|
||||
* Uses to pass attributes to the removeIcon's DOM element.
|
||||
*/
|
||||
removeIcon?: ChipPassThroughOptionType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom passthrough attributes for each DOM elements
|
||||
*/
|
||||
export interface ChipPassThroughAttributes {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines current inline state in Chip component.
|
||||
*/
|
||||
export interface ChipState {
|
||||
/**
|
||||
* Current visible state as a boolean.
|
||||
* @defaultValue true
|
||||
*/
|
||||
visible: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines valid properties in Chip component.
|
||||
*/
|
||||
|
@ -37,6 +92,11 @@ export interface ChipProps {
|
|||
* @deprecated since v3.27.0. Use 'removeicon' slot.
|
||||
*/
|
||||
removeIcon?: string;
|
||||
/**
|
||||
* Uses to pass attributes to DOM elements inside the component.
|
||||
* @type {ChipPassThroughOptions}
|
||||
*/
|
||||
pt?: ChipPassThroughOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue