mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 08:52:34 +00:00
Refactor #5612 - Sidebar / Drawer
This commit is contained in:
parent
365879a41c
commit
fcf8599cfa
16 changed files with 614 additions and 503 deletions
|
@ -1,48 +1,5 @@
|
|||
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 [
|
||||
'p-drawer-mask',
|
||||
{
|
||||
'p-component-overlay p-component-overlay-enter': props.modal,
|
||||
'p-drawer-open': instance.containerVisible,
|
||||
'p-drawer-full': instance.fullScreen
|
||||
},
|
||||
pos ? `p-drawer-${pos}` : ''
|
||||
];
|
||||
},
|
||||
root: ({ instance }) => [
|
||||
'p-drawer p-component',
|
||||
{
|
||||
'p-ripple-disabled': instance.$primevue.config.ripple === false,
|
||||
'p-drawer-full': instance.fullScreen
|
||||
}
|
||||
],
|
||||
header: 'p-drawer-header',
|
||||
title: 'p-drawer-title',
|
||||
closeButton: 'p-drawer-close-button',
|
||||
content: 'p-drawer-content'
|
||||
};
|
||||
|
||||
export default BaseStyle.extend({
|
||||
name: 'sidebar',
|
||||
classes,
|
||||
inlineStyles
|
||||
name: 'sidebar'
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue