Refactor #3832 Refactor #3833 - For Inplace

pull/3861/head
Bahadır Sofuoğlu 2023-04-13 13:32:32 +03:00
parent 79fa6ea527
commit ca3eadc8e3
2 changed files with 11 additions and 5 deletions

View File

@ -31,7 +31,6 @@ export interface InplaceProps {
disabled?: boolean | undefined;
/**
* Icon to display in the close button.
* @defaultValue pi pi-times
*/
closeIcon?: string | undefined;
/**

View File

@ -5,7 +5,13 @@
</div>
<div v-else class="p-inplace-content">
<slot name="content"></slot>
<IPButton v-if="closable" :icon="closeIcon" :aria-label="closeAriaLabel" @click="close" v-bind="closeButtonProps" />
<IPButton v-if="closable" :aria-label="closeAriaLabel" @click="close" v-bind="closeButtonProps">
<template #icon>
<slot name="closeicon">
<component :is="closeIcon ? 'span' : 'TimesIcon'" :class="closeIcon"></component>
</slot>
</template>
</IPButton>
</div>
</div>
</template>
@ -13,7 +19,7 @@
<script>
import Button from 'primevue/button';
import FocusTrap from 'primevue/focustrap';
import TimesIcon from 'primevue/icon/times';
export default {
name: 'Inplace',
emits: ['open', 'close', 'update:active'],
@ -32,7 +38,7 @@ export default {
},
closeIcon: {
type: String,
default: 'pi pi-times'
default: undefined
},
displayProps: {
type: null,
@ -84,7 +90,8 @@ export default {
}
},
components: {
IPButton: Button
IPButton: Button,
TimesIcon
},
directives: {
focustrap: FocusTrap