primevue-mirror/components/lib/speeddial/style/SpeedDialStyle.js

47 lines
1.6 KiB
JavaScript
Raw Normal View History

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',
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,
'p-disabled': props.disabled
}
],
button: ({ props }) => [
'p-speeddial-button',
{
'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',
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
});