refactor: #7090 for Dialog

pull/7064/merge
Mert Sincan 2025-01-14 11:11:03 +00:00
parent cb346d2a29
commit 733d2d8f37
1 changed files with 1 additions and 10 deletions

View File

@ -64,7 +64,6 @@
<script> <script>
import { addClass, addStyle, blockBodyScroll, focus, getOuterHeight, getOuterWidth, getViewport, setAttribute, unblockBodyScroll } from '@primeuix/utils/dom'; import { addClass, addStyle, blockBodyScroll, focus, getOuterHeight, getOuterWidth, getViewport, setAttribute, unblockBodyScroll } from '@primeuix/utils/dom';
import { ZIndex } from '@primeuix/utils/zindex'; import { ZIndex } from '@primeuix/utils/zindex';
import { UniqueComponentId } from '@primevue/core/utils';
import TimesIcon from '@primevue/icons/times'; import TimesIcon from '@primevue/icons/times';
import WindowMaximizeIcon from '@primevue/icons/windowmaximize'; import WindowMaximizeIcon from '@primevue/icons/windowmaximize';
import WindowMinimizeIcon from '@primevue/icons/windowminimize'; import WindowMinimizeIcon from '@primevue/icons/windowminimize';
@ -87,7 +86,6 @@ export default {
}, },
data() { data() {
return { return {
id: this.$attrs.id,
containerVisible: this.visible, containerVisible: this.visible,
maximized: false, maximized: false,
focusableMax: null, focusableMax: null,
@ -95,11 +93,6 @@ export default {
target: null target: null
}; };
}, },
watch: {
'$attrs.id': function (newValue) {
this.id = newValue || UniqueComponentId();
}
},
documentKeydownListener: null, documentKeydownListener: null,
container: null, container: null,
mask: null, mask: null,
@ -133,8 +126,6 @@ export default {
this.mask = null; this.mask = null;
}, },
mounted() { mounted() {
this.id = this.id || UniqueComponentId();
if (this.breakpoints) { if (this.breakpoints) {
this.createStyle(); this.createStyle();
} }
@ -409,7 +400,7 @@ export default {
return this.maximized ? (this.minimizeIcon ? 'span' : 'WindowMinimizeIcon') : this.maximizeIcon ? 'span' : 'WindowMaximizeIcon'; return this.maximized ? (this.minimizeIcon ? 'span' : 'WindowMinimizeIcon') : this.maximizeIcon ? 'span' : 'WindowMaximizeIcon';
}, },
ariaLabelledById() { ariaLabelledById() {
return this.header != null || this.$attrs['aria-labelledby'] !== null ? this.id + '_header' : null; return this.header != null || this.$attrs['aria-labelledby'] !== null ? this.$id + '_header' : null;
}, },
closeAriaLabel() { closeAriaLabel() {
return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : undefined; return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : undefined;