2024-04-18 14:16:37 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
const theme = ({ dt }) => `
|
|
|
|
.p-popover {
|
2024-05-09 10:18:00 +00:00
|
|
|
margin-top: ${dt('popover.gutter')};
|
2024-05-01 08:26:48 +00:00
|
|
|
background: ${dt('popover.background')};
|
|
|
|
color: ${dt('popover.color')};
|
|
|
|
border: 1px solid ${dt('popover.border.color')};
|
2024-05-09 10:18:00 +00:00
|
|
|
border-radius: ${dt('popover.border.radius')};
|
|
|
|
box-shadow: ${dt('popover.shadow')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-popover-content {
|
2024-05-09 10:18:00 +00:00
|
|
|
padding: ${dt('popover.content.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-popover-flipped {
|
2024-05-10 06:41:00 +00:00
|
|
|
margin-top: calc(${dt('popover.gutter')} * -1);
|
2024-05-09 10:18:00 +00:00
|
|
|
margin-bottom: ${dt('popover.gutter')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-popover-enter-from {
|
|
|
|
opacity: 0;
|
|
|
|
transform: scaleY(0.8);
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-popover-leave-to {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-popover-enter-active {
|
|
|
|
transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1), opacity 0.12s cubic-bezier(0, 0, 0.2, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-popover-leave-active {
|
|
|
|
transition: opacity 0.1s linear;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-popover:after,
|
|
|
|
.p-popover:before {
|
|
|
|
bottom: 100%;
|
2024-05-09 10:18:00 +00:00
|
|
|
left: ${dt('popover.arrow.offset')};
|
2024-05-01 08:26:48 +00:00
|
|
|
content: " ";
|
|
|
|
height: 0;
|
|
|
|
width: 0;
|
|
|
|
position: absolute;
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-popover:after {
|
2024-05-09 10:18:00 +00:00
|
|
|
border-width: calc(${dt('popover.gutter')} - 2px);
|
|
|
|
margin-left: calc(-1 * (${dt('popover.gutter')} - 2px));
|
2024-05-01 08:26:48 +00:00
|
|
|
border-style: solid;
|
|
|
|
border-color: transparent;
|
|
|
|
border-bottom-color: ${dt('popover.background')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-popover:before {
|
2024-05-09 10:18:00 +00:00
|
|
|
border-width: ${dt('popover.gutter')};
|
|
|
|
margin-left: calc(-1 * ${dt('popover.gutter')});
|
2024-05-01 08:26:48 +00:00
|
|
|
border-style: solid;
|
|
|
|
border-color: transparent;
|
|
|
|
border-bottom-color: ${dt('popover.border.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-popover-flipped:after,
|
|
|
|
.p-popover-flipped:before {
|
|
|
|
bottom: auto;
|
|
|
|
top: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-popover.p-popover-flipped:after {
|
|
|
|
border-bottom-color: transparent;
|
|
|
|
border-top-color: ${dt('popover.background')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-popover.p-popover-flipped:before {
|
|
|
|
border-bottom-color: transparent;
|
|
|
|
border-top-color: ${dt('popover.border.color')};
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2024-04-18 14:16:37 +00:00
|
|
|
const classes = {
|
2024-05-08 15:58:22 +00:00
|
|
|
root: 'p-popover p-component',
|
2024-04-18 14:16:37 +00:00
|
|
|
content: 'p-popover-content'
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'popover',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2024-04-18 14:16:37 +00:00
|
|
|
classes
|
|
|
|
});
|