2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
const theme = ({ dt }) => `
|
|
|
|
.p-inputtext {
|
|
|
|
font-family: inherit;
|
|
|
|
font-feature-settings: inherit;
|
|
|
|
font-size: 1rem;
|
|
|
|
color: ${dt('inputtext.color')};
|
|
|
|
background: ${dt('inputtext.background')};
|
2024-05-06 15:48:28 +00:00
|
|
|
padding: ${dt('inputtext.padding.y')} ${dt('inputtext.padding.x')};
|
2024-05-01 08:26:48 +00:00
|
|
|
border: 1px solid ${dt('inputtext.border.color')};
|
2024-05-26 21:38:39 +00:00
|
|
|
transition: background ${dt('inputtext.transition.duration')}, color ${dt('inputtext.transition.duration')}, border-color ${dt('inputtext.transition.duration')}, outline-color ${dt('inputtext.transition.duration')}, box-shadow ${dt(
|
|
|
|
'inputtext.transition.duration'
|
|
|
|
)};
|
2024-05-01 08:26:48 +00:00
|
|
|
appearance: none;
|
2024-05-06 15:48:28 +00:00
|
|
|
border-radius: ${dt('inputtext.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
outline-color: transparent;
|
2024-05-06 21:23:42 +00:00
|
|
|
box-shadow: ${dt('inputtext.shadow')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-inputtext:enabled:hover {
|
|
|
|
border-color: ${dt('inputtext.hover.border.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-inputtext:enabled:focus {
|
|
|
|
border-color: ${dt('inputtext.focus.border.color')};
|
2024-05-07 06:51:53 +00:00
|
|
|
box-shadow: ${dt('inputtext.focus.ring.shadow')};
|
|
|
|
outline: ${dt('inputtext.focus.ring.width')} ${dt('inputtext.focus.ring.style')} ${dt('inputtext.focus.ring.color')};
|
|
|
|
outline-offset: ${dt('inputtext.focus.ring.offset')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.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 {
|
2024-05-07 08:33:44 +00:00
|
|
|
background: ${dt('inputtext.filled.focus.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.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%;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const classes = {
|
|
|
|
root: ({ instance, props }) => [
|
|
|
|
'p-inputtext p-component',
|
|
|
|
{
|
|
|
|
'p-filled': instance.filled,
|
|
|
|
'p-inputtext-sm': props.size === 'small',
|
2024-01-30 11:27:56 +00:00
|
|
|
'p-inputtext-lg': props.size === 'large',
|
2024-01-31 08:02:53 +00:00
|
|
|
'p-invalid': props.invalid,
|
2024-02-01 13:11:24 +00:00
|
|
|
'p-variant-filled': props.variant ? props.variant === 'filled' : instance.$primevue.config.inputStyle === 'filled'
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'inputtext',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2023-10-04 09:20:15 +00:00
|
|
|
classes
|
2023-10-02 10:46:09 +00:00
|
|
|
});
|