Refactor #3885 - button updates

This commit is contained in:
Tuğçe Küçükoğlu 2023-05-02 11:01:27 +03:00
parent 21ab0ad7d0
commit cadc7e87c4
8 changed files with 32 additions and 47 deletions

View file

@ -8,6 +8,7 @@
*
*/
import { HTMLAttributes, VNode } from 'vue';
import { ButtonPassThroughOptions } from '../button';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
export declare type DialogPassThroughOptionType = DialogPassThroughAttributes | ((options: DialogPassThroughMethodOptions) => DialogPassThroughAttributes) | null | undefined;
@ -51,12 +52,9 @@ export interface DialogPassThroughOptions {
maximizableIcon?: DialogPassThroughOptionType;
/**
* Uses to pass attributes to the close button's DOM element.
* @see {@link ButtonPassThroughOptions}
*/
closeButton?: DialogPassThroughOptionType;
/**
* Uses to pass attributes to the close icon's DOM element.
*/
closeIcon?: DialogPassThroughOptionType;
closeButton?: ButtonPassThroughOptions;
/**
* Uses to pass attributes to the content's DOM element.
*/

View file

@ -32,10 +32,11 @@
@click="close"
:aria-label="closeAriaLabel"
type="button"
v-bind="{ ...closeButtonProps, ...ptm('closeButton') }"
:pt="ptm('closeButton')"
v-bind="closeButtonProps"
>
<slot name="closeicon">
<component :is="closeIcon ? 'span' : 'TimesIcon'" :class="['p-dialog-header-close-icon', closeIcon]" v-bind="ptm('closeIcon')"></component>
<component :is="closeIcon ? 'span' : 'TimesIcon'" :class="['p-dialog-header-close-icon', closeIcon]" v-bind="ptm('closeButton')['icon']"></component>
</slot>
</button>
</div>