2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
|
|
|
/* Position */
|
|
|
|
const inlineStyles = {
|
|
|
|
mask: ({ position, modal }) => ({
|
|
|
|
position: 'fixed',
|
|
|
|
height: '100%',
|
|
|
|
width: '100%',
|
|
|
|
left: 0,
|
|
|
|
top: 0,
|
|
|
|
display: 'flex',
|
|
|
|
justifyContent: position === 'left' || position === 'topleft' || position === 'bottomleft' ? 'flex-start' : position === 'right' || position === 'topright' || position === 'bottomright' ? 'flex-end' : 'center',
|
|
|
|
alignItems: position === 'top' || position === 'topleft' || position === 'topright' ? 'flex-start' : position === 'bottom' || position === 'bottomleft' || position === 'bottomright' ? 'flex-end' : 'center',
|
|
|
|
pointerEvents: modal ? 'auto' : 'none'
|
|
|
|
}),
|
|
|
|
root: {
|
|
|
|
display: 'flex',
|
|
|
|
flexDirection: 'column',
|
|
|
|
pointerEvents: 'auto'
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
mask: ({ props }) => {
|
|
|
|
const positions = ['left', 'right', 'top', 'topleft', 'topright', 'bottom', 'bottomleft', 'bottomright'];
|
|
|
|
const pos = positions.find((item) => item === props.position);
|
|
|
|
|
|
|
|
return [
|
|
|
|
'p-dialog-mask',
|
|
|
|
{
|
|
|
|
'p-component-overlay p-component-overlay-enter': props.modal
|
|
|
|
},
|
|
|
|
pos ? `p-dialog-${pos}` : ''
|
|
|
|
];
|
|
|
|
},
|
|
|
|
root: ({ props, instance }) => [
|
|
|
|
'p-dialog p-component',
|
|
|
|
{
|
|
|
|
'p-dialog-rtl': props.rtl,
|
|
|
|
'p-dialog-maximized': props.maximizable && instance.maximized,
|
|
|
|
'p-ripple-disabled': instance.$primevue.config.ripple === false
|
|
|
|
}
|
|
|
|
],
|
|
|
|
header: 'p-dialog-header',
|
2023-11-20 10:07:00 +00:00
|
|
|
title: 'p-dialog-title',
|
2024-04-30 09:58:12 +00:00
|
|
|
headerActions: 'p-dialog-header-actions',
|
2024-04-08 12:08:29 +00:00
|
|
|
maximizableButton: 'p-dialog-maximize-button',
|
|
|
|
closeButton: 'p-dialog-close-button',
|
2023-10-02 10:46:09 +00:00
|
|
|
content: 'p-dialog-content',
|
|
|
|
footer: 'p-dialog-footer'
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'dialog',
|
|
|
|
classes,
|
|
|
|
inlineStyles
|
|
|
|
});
|