2023-07-03 22:20:35 +00:00
|
|
|
import BaseDirective from 'primevue/basedirective';
|
|
|
|
import { useStyle } from 'primevue/usestyle';
|
|
|
|
|
|
|
|
const styles = `
|
2022-09-06 12:03:37 +00:00
|
|
|
.p-tooltip {
|
|
|
|
position:absolute;
|
|
|
|
display:none;
|
2023-08-11 05:54:14 +00:00
|
|
|
pointer-events:none;
|
2022-09-06 12:03:37 +00:00
|
|
|
padding: .25em .5rem;
|
|
|
|
max-width: 12.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tooltip.p-tooltip-right,
|
|
|
|
.p-tooltip.p-tooltip-left {
|
|
|
|
padding: 0 .25rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tooltip.p-tooltip-top,
|
|
|
|
.p-tooltip.p-tooltip-bottom {
|
|
|
|
padding:.25em 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tooltip .p-tooltip-text {
|
2023-07-31 07:47:30 +00:00
|
|
|
white-space: pre-line;
|
|
|
|
word-break: break-word;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tooltip-arrow {
|
|
|
|
position: absolute;
|
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
border-color: transparent;
|
|
|
|
border-style: solid;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tooltip-right .p-tooltip-arrow {
|
|
|
|
margin-top: -.25rem;
|
|
|
|
border-width: .25em .25em .25em 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tooltip-left .p-tooltip-arrow {
|
|
|
|
margin-top: -.25rem;
|
|
|
|
border-width: .25em 0 .25em .25rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tooltip.p-tooltip-top {
|
|
|
|
padding: .25em 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tooltip-top .p-tooltip-arrow {
|
|
|
|
margin-left: -.25rem;
|
|
|
|
border-width: .25em .25em 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tooltip-bottom .p-tooltip-arrow {
|
|
|
|
margin-left: -.25rem;
|
|
|
|
border-width: 0 .25em .25rem;
|
2023-07-03 22:20:35 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
root: 'p-tooltip p-component',
|
|
|
|
arrow: 'p-tooltip-arrow',
|
|
|
|
text: 'p-tooltip-text'
|
|
|
|
};
|
|
|
|
|
|
|
|
const { load: loadStyle } = useStyle(styles, { name: 'tooltip', manual: true });
|
|
|
|
|
|
|
|
const BaseTooltip = BaseDirective.extend({
|
|
|
|
css: {
|
|
|
|
classes,
|
|
|
|
loadStyle
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default BaseTooltip;
|