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; disabled?: boolean | undefined;
/** /**
* Icon to display in the close button. * Icon to display in the close button.
* @defaultValue pi pi-times
*/ */
closeIcon?: string | undefined; closeIcon?: string | undefined;
/** /**

View File

@ -5,7 +5,13 @@
</div> </div>
<div v-else class="p-inplace-content"> <div v-else class="p-inplace-content">
<slot name="content"></slot> <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>
</div> </div>
</template> </template>
@ -13,7 +19,7 @@
<script> <script>
import Button from 'primevue/button'; import Button from 'primevue/button';
import FocusTrap from 'primevue/focustrap'; import FocusTrap from 'primevue/focustrap';
import TimesIcon from 'primevue/icon/times';
export default { export default {
name: 'Inplace', name: 'Inplace',
emits: ['open', 'close', 'update:active'], emits: ['open', 'close', 'update:active'],
@ -32,7 +38,7 @@ export default {
}, },
closeIcon: { closeIcon: {
type: String, type: String,
default: 'pi pi-times' default: undefined
}, },
displayProps: { displayProps: {
type: null, type: null,
@ -84,7 +90,8 @@ export default {
} }
}, },
components: { components: {
IPButton: Button IPButton: Button,
TimesIcon
}, },
directives: { directives: {
focustrap: FocusTrap focustrap: FocusTrap