2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
|
|
|
const css = `
|
|
|
|
@layer primevue {
|
|
|
|
.p-inputswitch {
|
|
|
|
display: inline-block;
|
|
|
|
}
|
|
|
|
|
2024-01-12 07:07:55 +00:00
|
|
|
.p-inputswitch-input {
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
.p-inputswitch-slider {
|
|
|
|
position: absolute;
|
|
|
|
cursor: pointer;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
border: 1px solid transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-inputswitch-slider:before {
|
|
|
|
position: absolute;
|
|
|
|
content: '';
|
|
|
|
top: 50%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const inlineStyles = {
|
|
|
|
root: { position: 'relative' }
|
|
|
|
};
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
root: ({ instance, props }) => [
|
|
|
|
'p-inputswitch p-component',
|
|
|
|
{
|
2024-01-12 07:07:55 +00:00
|
|
|
'p-highlight': instance.checked,
|
|
|
|
'p-disabled': props.disabled
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
2024-01-12 07:07:55 +00:00
|
|
|
input: 'p-inputswitch-input',
|
2023-10-02 10:46:09 +00:00
|
|
|
slider: 'p-inputswitch-slider'
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'inputswitch',
|
|
|
|
css,
|
|
|
|
classes,
|
|
|
|
inlineStyles
|
|
|
|
});
|