74 lines
2.0 KiB
JavaScript
74 lines
2.0 KiB
JavaScript
import BaseStyle from 'primevue/base/style';
|
|
|
|
const theme = ({ dt }) => `
|
|
.p-inputtext {
|
|
font-family: inherit;
|
|
font-feature-settings: inherit;
|
|
font-size: 1rem;
|
|
color: ${dt('inputtext.color')};
|
|
background: ${dt('inputtext.background')};
|
|
padding: ${dt('inputtext.padding.y')} ${dt('inputtext.padding.x')};
|
|
border: 1px solid ${dt('inputtext.border.color')};
|
|
transition: background ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, outline-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')};
|
|
appearance: none;
|
|
border-radius: ${dt('inputtext.border.radius')};
|
|
outline-color: transparent;
|
|
box-shadow: ${dt('inputtext.box.shadow')};
|
|
}
|
|
|
|
.p-inputtext:enabled:hover {
|
|
border-color: ${dt('inputtext.hover.border.color')};
|
|
}
|
|
|
|
.p-inputtext:enabled:focus {
|
|
border-color: ${dt('inputtext.focus.border.color')};
|
|
box-shadow: ${dt('inputtext.focus.box.shadow')};
|
|
outline: 0 none;
|
|
}
|
|
|
|
.p-inputtext.p-invalid {
|
|
border-color: ${dt('inputtext.invalid.border.color')};
|
|
}
|
|
|
|
.p-inputtext.p-variant-filled {
|
|
background: ${dt('inputtext.filled.background')};
|
|
}
|
|
|
|
.p-inputtext.p-variant-filled:enabled:focus {
|
|
background-color: ${dt('inputtext.filled.focus.background')};
|
|
}
|
|
|
|
.p-inputtext:disabled {
|
|
opacity: 1;
|
|
background: ${dt('inputtext.disabled.background')};
|
|
color: ${dt('inputtext.disabled.color')};
|
|
}
|
|
|
|
.p-inputtext::placeholder {
|
|
color: ${dt('inputtext.placeholder.color')};
|
|
}
|
|
|
|
.p-fluid .p-inputtext {
|
|
width: 100%;
|
|
}
|
|
`;
|
|
|
|
const classes = {
|
|
root: ({ instance, props }) => [
|
|
'p-inputtext p-component',
|
|
{
|
|
'p-filled': instance.filled,
|
|
'p-inputtext-sm': props.size === 'small',
|
|
'p-inputtext-lg': props.size === 'large',
|
|
'p-invalid': props.invalid,
|
|
'p-variant-filled': props.variant ? props.variant === 'filled' : instance.$primevue.config.inputStyle === 'filled'
|
|
}
|
|
]
|
|
};
|
|
|
|
export default BaseStyle.extend({
|
|
name: 'inputtext',
|
|
theme,
|
|
classes
|
|
});
|