2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
|
|
|
/* Direction */
|
|
|
|
const inlineStyles = {
|
|
|
|
root: ({ props }) => ({
|
2023-11-17 14:30:23 +00:00
|
|
|
alignItems: (props.direction === 'up' || props.direction === 'down') && 'center',
|
|
|
|
justifyContent: (props.direction === 'left' || props.direction === 'right') && 'center',
|
2023-10-02 10:46:09 +00:00
|
|
|
flexDirection: props.direction === 'up' ? 'column-reverse' : props.direction === 'down' ? 'column' : props.direction === 'left' ? 'row-reverse' : props.direction === 'right' ? 'row' : null
|
|
|
|
}),
|
|
|
|
menu: ({ props }) => ({
|
|
|
|
flexDirection: props.direction === 'up' ? 'column-reverse' : props.direction === 'down' ? 'column' : props.direction === 'left' ? 'row-reverse' : props.direction === 'right' ? 'row' : null
|
|
|
|
})
|
|
|
|
};
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
root: ({ instance, props }) => [
|
|
|
|
`p-speeddial p-component p-speeddial-${props.type}`,
|
|
|
|
{
|
|
|
|
[`p-speeddial-direction-${props.direction}`]: props.type !== 'circle',
|
2024-04-07 21:36:28 +00:00
|
|
|
'p-speeddial-open': instance.d_visible,
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-disabled': props.disabled
|
|
|
|
}
|
|
|
|
],
|
|
|
|
button: ({ props }) => [
|
2024-03-22 08:53:44 +00:00
|
|
|
'p-speeddial-button',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
|
|
|
'p-speeddial-rotate': props.rotateAnimation && !props.hideIcon
|
|
|
|
}
|
|
|
|
],
|
|
|
|
menu: 'p-speeddial-list',
|
2024-04-09 11:24:04 +00:00
|
|
|
menuitem: 'p-speeddial-item',
|
|
|
|
action: 'p-speeddial-action',
|
2023-10-02 10:46:09 +00:00
|
|
|
actionIcon: 'p-speeddial-action-icon',
|
|
|
|
mask: ({ instance }) => [
|
|
|
|
'p-speeddial-mask',
|
|
|
|
{
|
|
|
|
'p-speeddial-mask-visible': instance.d_visible
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'speeddial',
|
|
|
|
classes,
|
|
|
|
inlineStyles
|
|
|
|
});
|