Refactor #5071 - Improve the structure of some components to comply with standards

This commit is contained in:
mertsincan 2024-01-12 07:07:55 +00:00
parent e7d3074af2
commit 99b1edd5ce
17 changed files with 355 additions and 355 deletions

View file

@ -1,22 +1,36 @@
import BaseStyle from 'primevue/base/style';
const css = `
@layer primevue {
.p-checkbox {
position: relative;
display: inline-flex;
user-select: none;
vertical-align: bottom;
}
.p-checkbox-input {
cursor: pointer;
}
.p-checkbox-box {
display: flex;
justify-content: center;
align-items: center;
}
}
`;
const classes = {
root: ({ instance, props }) => [
'p-checkbox p-component',
'p-tristatecheckbox p-checkbox p-component',
{
'p-checkbox-checked': props.modelValue === true,
'p-checkbox-disabled': props.disabled,
'p-checkbox-focused': instance.focused
}
],
checkbox: ({ instance, props }) => [
'p-checkbox-box',
{
'p-highlight': props.modelValue != null,
'p-disabled': props.disabled,
'p-focus': instance.focused
'p-highlight': instance.active,
'p-disabled': props.disabled
}
],
box: 'p-checkbox-box',
input: 'p-checkbox-input',
checkIcon: 'p-checkbox-icon',
uncheckIcon: 'p-checkbox-icon',
nullableIcon: 'p-checkbox-icon'
@ -24,5 +38,6 @@ const classes = {
export default BaseStyle.extend({
name: 'tristatecheckbox',
css,
classes
});