Refactor #4103 - unstyled option updates

This commit is contained in:
Tuğçe Küçükoğlu 2023-07-07 14:23:03 +03:00
parent 6c9b61aa65
commit 0f0c9b95b2
4 changed files with 23 additions and 23 deletions

View file

@ -31,8 +31,8 @@ const Tooltip = BaseTooltip.extend('tooltip', {
}
}
target.$_ptooltipZIndex = options.instance.$primevue.config?.zIndex?.tooltip;
target.$_ptooltipUnstyled = options.instance.$primevue.config?.unstyled || options.value?.unstyled || false;
target.$_ptooltipZIndex = options.instance.$primevue?.config?.zIndex?.tooltip;
target.unstyled = options.instance.$primevue?.config?.unstyled || options.value?.unstyled || false;
this.bindEvents(target, options);
},
@ -75,7 +75,7 @@ const Tooltip = BaseTooltip.extend('tooltip', {
}
}
target.$_ptooltipUnstyled = options.instance.$primevue.config?.unstyled || options.value?.unstyled || false;
target.unstyled = options.instance.$primevue?.config?.unstyled || options.value?.unstyled || false;
},
unmounted(el, options) {
let target = this.getTarget(el);
@ -184,7 +184,7 @@ const Tooltip = BaseTooltip.extend('tooltip', {
let tooltipElement = this.create(el, options);
this.align(el);
!el.$_ptooltipUnstyled && DomHandler.fadeIn(tooltipElement, 250);
!el.unstyled && DomHandler.fadeIn(tooltipElement, 250);
const $this = this;
@ -224,12 +224,12 @@ const Tooltip = BaseTooltip.extend('tooltip', {
},
create(el, options) {
const tooltipArrow = DomHandler.createElement('div', {
class: !el.$_ptooltipUnstyled && this.cx('arrow'),
class: !el.unstyled && this.cx('arrow'),
'p-bind': this.ptm('arrow')
});
const tooltipText = DomHandler.createElement('div', {
class: !el.$_ptooltipUnstyled && this.cx('text'),
class: !el.unstyled && this.cx('text'),
'p-bind': this.ptm('text')
});
@ -249,7 +249,7 @@ const Tooltip = BaseTooltip.extend('tooltip', {
display: 'inline-block',
width: el.$_ptooltipFitContent ? 'fit-content' : undefined
},
class: [!el.$_ptooltipUnstyled && this.cx('root'), el.$_ptooltipClass],
class: [!el.unstyled && this.cx('root'), el.$_ptooltipClass],
'p-bind': this.ptm('root')
},
tooltipArrow,