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-inputtextarea {
|
|
|
|
font-family: inherit;
|
|
|
|
font-feature-settings: inherit;
|
|
|
|
font-size: 1rem;
|
|
|
|
color: ${dt('textarea.color')};
|
|
|
|
background: ${dt('textarea.background')};
|
2024-05-06 21:33:13 +00:00
|
|
|
padding: ${dt('textarea.padding.y')} ${dt('textarea.padding.x')};
|
2024-05-01 08:26:48 +00:00
|
|
|
border: 1px solid ${dt('textarea.border.color')};
|
2024-05-06 21:33:13 +00:00
|
|
|
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, outline-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')};
|
2024-05-01 08:26:48 +00:00
|
|
|
appearance: none;
|
2024-05-06 21:33:13 +00:00
|
|
|
border-radius: ${dt('textarea.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
outline-color: transparent;
|
2024-05-06 21:23:42 +00:00
|
|
|
box-shadow: ${dt('textarea.shadow')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-inputtextarea:enabled:hover {
|
|
|
|
border-color: ${dt('textarea.hover.border.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-inputtextarea:enabled:focus {
|
|
|
|
border-color: ${dt('textarea.focus.border.color')};
|
2024-05-06 21:33:13 +00:00
|
|
|
box-shadow: ${dt('textarea.focus.shadow')};
|
2024-05-01 08:26:48 +00:00
|
|
|
outline: 0 none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-inputtextarea.p-invalid {
|
|
|
|
border-color: ${dt('textarea.invalid.border.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-inputtextarea.p-variant-filled {
|
|
|
|
background-color: ${dt('textarea.filled.background')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-inputtextarea.p-variant-filled:enabled:focus {
|
|
|
|
background-color: ${dt('textarea.filled.focus.background')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-inputtextarea:disabled {
|
|
|
|
opacity: 1;
|
|
|
|
background: ${dt('textarea.disabled.background')};
|
|
|
|
color: ${dt('textarea.disabled.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-inputtextarea::placeholder {
|
|
|
|
color: ${dt('textarea.placeholder.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fluid .p-inputtextarea {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-inputtextarea-resizable {
|
|
|
|
overflow: hidden;
|
|
|
|
resize: none;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const classes = {
|
|
|
|
root: ({ instance, props }) => [
|
2024-03-22 08:53:44 +00:00
|
|
|
'p-inputtextarea p-component',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
|
|
|
'p-filled': instance.filled,
|
2024-01-30 11:27:56 +00:00
|
|
|
'p-inputtextarea-resizable ': props.autoResize,
|
2024-01-31 08:02:53 +00:00
|
|
|
'p-invalid': props.invalid,
|
2024-02-02 11:46:26 +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: 'textarea',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2023-10-02 10:46:09 +00:00
|
|
|
classes
|
|
|
|
});
|