Refactor #3832 Refactor #3833 - Chips update & .d.ts fixes

pull/3976/head
Tuğçe Küçükoğlu 2023-04-18 10:37:05 +03:00
parent a8f3e2d5e3
commit a42abd68a0
11 changed files with 53 additions and 7 deletions

View File

@ -206,6 +206,7 @@ export interface AutoCompleteProps {
panelProps?: HTMLAttributes | undefined;
/**
* Icon to display in the dropdown.
* @deprecated since v3.27.0. Use 'dropdownicon' slot.
*/
dropdownIcon?: string | undefined;
/**
@ -214,10 +215,12 @@ export interface AutoCompleteProps {
dropdownClass?: string | object | undefined;
/**
* Icon to display in loading state.
* @deprecated since v3.27.0. Use 'loadingicon' slot.
*/
loadingIcon?: string | undefined;
/**
* Icon to display in chip remove action.
* @deprecated since v3.27.0. Use 'removetokenicon' slot.
*/
removeTokenIcon?: string | undefined;
/**

View File

@ -19,6 +19,7 @@ export interface AvatarProps {
label?: string | undefined;
/**
* Defines the icon to display.
* @deprecated since v3.27.0. Use 'icon' slot.
*/
icon?: string | undefined;
/**
@ -53,6 +54,10 @@ export interface AvatarSlots {
* Content can easily be customized with the default slot instead of using the built-in modes.
*/
default(): VNode[];
/**
* Content can easily be customized with the default slot instead of using the built-in modes.
*/
icon(): VNode[];
}
/**

View File

@ -109,22 +109,27 @@ export interface CalendarProps {
showIcon?: boolean | undefined;
/**
* Icon of the calendar button.
* @deprecated since v3.27.0. Use 'triggericon' slot.
*/
icon?: string | undefined;
/**
* Icon to show in the previous button.
* @deprecated since v3.27.0. Use 'previousicon' slot.
*/
previousIcon?: string | undefined;
/**
* Icon to show in the next button.
* @deprecated since v3.27.0. Use 'nexticon' slot.
*/
nextIcon?: string | undefined;
/**
* Icon to show in each of the increment buttons.
* @deprecated since v3.27.0. Use 'incrementicon' slot.
*/
incrementIcon?: string | undefined;
/**
* Icon to show in each of the decrement buttons.
* @deprecated since v3.27.0. Use 'decrementicon' slot.
*/
decrementIcon?: string | undefined;
/**
@ -370,7 +375,7 @@ export interface CalendarSlots {
/**
* Custom previous icon template.
*/
previcon(): VNode[];
previousicon(): VNode[];
/**
* Custom next icon template.
*/

View File

@ -133,7 +133,7 @@ export interface CarouselSlots {
/**
* Custom previous icon template.
*/
previcon(): VNode[];
previousicon(): VNode[];
/**
* Custom next icon template.
*/

View File

@ -116,14 +116,17 @@ export interface CascadeSelectProps {
loading?: boolean | undefined;
/**
* Icon to display in the dropdown.
* @deprecated since v3.27.0. Use 'dropdownicon' slot.
*/
dropdownIcon?: string | undefined;
/**
* Icon to display in loading state.
* @deprecated since v3.27.0. Use 'loadingicon' slot.
*/
loadingIcon?: string | undefined;
/**
* Icon to display in the option group.
* @deprecated since v3.27.0. Use 'optiongroupicon' slot.
*/
optionGroupIcon?: string | undefined;
/**
@ -211,6 +214,14 @@ export interface CascadeSelectSlots {
* Custom indicator template.
*/
indicator(): VNode[];
/**
* Custom dropdown icon template.
*/
dropdownicon(): VNode[];
/**
* Custom loading icon template.
*/
loadingicon(): VNode[];
/**
* Custom option group icon template.
*/

View File

@ -20,6 +20,7 @@ export interface ChipProps {
label?: string;
/**
* Defines the icon to display.
* @deprecated since v3.27.0. Use 'icon' slot.
*/
icon?: string;
/**
@ -33,6 +34,7 @@ export interface ChipProps {
removable?: boolean;
/**
* Icon of the remove element.
* @deprecated since v3.27.0. Use 'removeicon' slot.
*/
removeIcon?: string;
}
@ -45,6 +47,10 @@ export interface ChipSlots {
* Content can easily be customized with the default slot instead of using the built-in modes.
*/
default(): VNode[];
/**
* Custom icon template.
*/
icon(): VNode[];
/**
* Custom remove icon template of chip component.
* @param {Object} scope - remove icon slot's params.
@ -53,11 +59,11 @@ export interface ChipSlots {
/**
* Remove icon click event
*/
click(): void;
onClick(): void;
/**
* Remove icon keydown event
*/
keydown(): void;
onKeydown(): void;
}): VNode[];
}

View File

@ -72,10 +72,12 @@ export interface ChipsProps {
inputStyle?: object | undefined;
/**
* Uses to pass all properties of the HTMLInputElement to the focusable input element inside the component.
* @deprecated since v3.26.0. Use 'pt' property instead.
*/
inputProps?: InputHTMLAttributes | undefined;
/**
* Icon to display in chip remove action.
* @deprecated since v3.27.0. Use 'removetokenicon' slot.
*/
removeTokenIcon?: string | undefined;
/**
@ -111,8 +113,14 @@ export interface ChipsSlots {
}): VNode[];
/**
* Custom remove token icon template.
* @param {Object} scope - remove token icon slot's params.
*/
removetokenicon(): VNode[];
removetokenicon(scope: {
/**
* Remove icon click event
*/
onClick(): void;
}): VNode[];
}
/**
* Defines valid emits in Chips component.

View File

@ -28,7 +28,7 @@
<slot name="chip" :value="val">
<span class="p-chips-token-label">{{ val }}</span>
</slot>
<slot name="removetokenicon">
<slot name="removetokenicon" :onClick="(event) => removeItem(event, i)">
<component :is="removeTokenIcon ? 'span' : 'TimesCircleIcon'" :class="['p-chips-token-icon', removeTokenIcon]" @click="removeItem($event, i)" aria-hidden="true" />
</slot>
</li>

View File

@ -221,6 +221,7 @@ export interface ColumnProps {
rowReorder?: boolean | undefined;
/**
* Icon of the drag handle to reorder rows.
* @deprecated since v3.27.0. Use 'rowreordericon' slot.
*/
rowReorderIcon?: string | undefined;
/**
@ -557,6 +558,10 @@ export interface ColumnSlots {
*/
checked: boolean;
}): VNode[];
/**
* Custom row reorder icon template.
*/
rowreordericon(): VNode[];
}
export interface ColumnEmits {}

View File

@ -140,7 +140,7 @@ export default {
},
rowReorderIcon: {
type: String,
default: 'pi pi-bars'
default: undefined
},
reorderableColumn: {
type: Boolean,

View File

@ -611,6 +611,7 @@ export interface DataTableProps {
loading?: boolean | undefined;
/**
* The icon to show while indicating data load is in progress.
* @deprecated since v3.27.0. Use 'loadingicon' slot.
*/
loadingIcon?: string | undefined;
/**
@ -729,10 +730,12 @@ export interface DataTableProps {
expandedRows?: any[] | DataTableExpandedRows | null;
/**
* Icon of the row toggler to display the row as expanded.
* @deprecated since v3.27.0. Use 'rowtogglericon' slot.
*/
expandedRowIcon?: string | undefined;
/**
* Icon of the row toggler to display the row as collapsed.
* @deprecated since v3.27.0. Use 'rowtogglericon' slot.
*/
collapsedRowIcon?: string | undefined;
/**