diff --git a/packages/primevue/src/cascadeselect/BaseCascadeSelect.vue b/packages/primevue/src/cascadeselect/BaseCascadeSelect.vue index fe2b5ad67..55f893579 100644 --- a/packages/primevue/src/cascadeselect/BaseCascadeSelect.vue +++ b/packages/primevue/src/cascadeselect/BaseCascadeSelect.vue @@ -18,6 +18,14 @@ export default { default: '960px' }, dataKey: null, + showClear: { + type: Boolean, + default: false + }, + clearIcon: { + type: String, + default: undefined + }, inputId: { type: String, default: null diff --git a/packages/primevue/src/cascadeselect/CascadeSelect.d.ts b/packages/primevue/src/cascadeselect/CascadeSelect.d.ts index a93d66ed7..cc1bf6e4a 100644 --- a/packages/primevue/src/cascadeselect/CascadeSelect.d.ts +++ b/packages/primevue/src/cascadeselect/CascadeSelect.d.ts @@ -327,6 +327,15 @@ export interface CascadeSelectProps { * A property to uniquely identify an option. */ dataKey?: string | undefined; + /** + * When enabled, a clear icon is displayed to clear the value. + * @defaultValue false + */ + showClear?: boolean | undefined; + /** + * Icon to display in clear button. + */ + clearIcon?: string | undefined; /** * Identifier of the underlying input element. */ @@ -553,6 +562,17 @@ export interface CascadeSelectSlots { */ options: any[]; }): VNode[]; + /** + * Custom clear icon template. + * @param {Object} scope - clear icon slot's params. + */ + clearicon(scope: { + /** + * Clear icon click function. + * @param {Event} event - Browser event + */ + clearCallback: (event: Event) => void; + }): VNode[]; } /** diff --git a/packages/primevue/src/cascadeselect/CascadeSelect.vue b/packages/primevue/src/cascadeselect/CascadeSelect.vue index 188a388f6..8c3c221b8 100644 --- a/packages/primevue/src/cascadeselect/CascadeSelect.vue +++ b/packages/primevue/src/cascadeselect/CascadeSelect.vue @@ -30,6 +30,9 @@ {{ label }} + + +