2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
2024-01-12 07:07:55 +00:00
|
|
|
const css = `
|
|
|
|
@layer primevue {
|
|
|
|
.p-togglebutton {
|
2024-01-14 15:21:43 +00:00
|
|
|
position: relative;
|
2024-01-12 07:07:55 +00:00
|
|
|
display: inline-flex;
|
|
|
|
user-select: none;
|
|
|
|
vertical-align: bottom;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-togglebutton-input {
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
2024-01-14 15:21:43 +00:00
|
|
|
.p-togglebutton .p-button {
|
2024-01-12 07:07:55 +00:00
|
|
|
flex: 1 1 auto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const classes = {
|
|
|
|
root: ({ instance, props }) => [
|
2024-01-14 15:21:43 +00:00
|
|
|
'p-togglebutton p-component',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
|
|
|
'p-disabled': props.disabled,
|
2024-01-30 11:27:56 +00:00
|
|
|
'p-highlight': instance.active,
|
|
|
|
'p-invalid': props.invalid
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
2024-01-12 07:07:55 +00:00
|
|
|
input: 'p-togglebutton-input',
|
2024-01-14 15:21:43 +00:00
|
|
|
box: ({ instance }) => [
|
|
|
|
'p-button p-component',
|
|
|
|
{
|
|
|
|
'p-button-icon-only': instance.hasIcon && !instance.hasLabel
|
|
|
|
}
|
|
|
|
],
|
2023-10-02 10:46:09 +00:00
|
|
|
icon: ({ instance, props }) => [
|
|
|
|
'p-button-icon',
|
|
|
|
{
|
|
|
|
'p-button-icon-left': props.iconPos === 'left' && instance.label,
|
|
|
|
'p-button-icon-right': props.iconPos === 'right' && instance.label
|
|
|
|
}
|
|
|
|
],
|
|
|
|
label: 'p-button-label'
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
2024-01-12 07:07:55 +00:00
|
|
|
name: 'togglebutton',
|
|
|
|
css,
|
2023-10-04 09:20:15 +00:00
|
|
|
classes
|
2023-10-02 10:46:09 +00:00
|
|
|
});
|