2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
|
|
|
const inlineStyles = {
|
|
|
|
mask: ({ position }) => ({
|
|
|
|
position: 'fixed',
|
|
|
|
height: '100%',
|
|
|
|
width: '100%',
|
|
|
|
left: 0,
|
|
|
|
top: 0,
|
|
|
|
display: 'flex',
|
|
|
|
justifyContent: position === 'left' ? 'flex-start' : position === 'right' ? 'flex-end' : 'center',
|
|
|
|
alignItems: position === 'top' ? 'flex-start' : position === 'bottom' ? 'flex-end' : 'center'
|
|
|
|
})
|
|
|
|
};
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
mask: ({ instance, props }) => {
|
|
|
|
const positions = ['left', 'right', 'top', 'bottom'];
|
|
|
|
const pos = positions.find((item) => item === props.position);
|
|
|
|
|
|
|
|
return [
|
2024-04-08 15:26:46 +00:00
|
|
|
'p-drawer-mask',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
|
|
|
'p-component-overlay p-component-overlay-enter': props.modal,
|
2024-04-08 15:26:46 +00:00
|
|
|
'p-drawer-open': instance.containerVisible,
|
|
|
|
'p-drawer-full': instance.fullScreen
|
2023-10-02 10:46:09 +00:00
|
|
|
},
|
2024-04-08 15:26:46 +00:00
|
|
|
pos ? `p-drawer-${pos}` : ''
|
2023-10-02 10:46:09 +00:00
|
|
|
];
|
|
|
|
},
|
|
|
|
root: ({ instance }) => [
|
2024-04-08 15:26:46 +00:00
|
|
|
'p-drawer p-component',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
|
|
|
'p-ripple-disabled': instance.$primevue.config.ripple === false,
|
2024-04-08 15:26:46 +00:00
|
|
|
'p-drawer-full': instance.fullScreen
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
2024-04-08 15:26:46 +00:00
|
|
|
header: 'p-drawer-header',
|
|
|
|
title: 'p-drawer-title',
|
|
|
|
closeButton: 'p-drawer-close-button',
|
|
|
|
content: 'p-drawer-content'
|
2023-10-02 10:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'sidebar',
|
|
|
|
classes,
|
|
|
|
inlineStyles
|
|
|
|
});
|