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 }) => `
|
2024-05-22 08:11:33 +00:00
|
|
|
.p-textarea {
|
2024-05-01 08:26:48 +00:00
|
|
|
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-25 08:18:55 +00:00
|
|
|
transition: background ${dt('textarea.transition.duration')}, color ${dt('textarea.transition.duration')}, border-color ${dt('textarea.transition.duration')}, outline-color ${dt('textarea.transition.duration')}, box-shadow ${dt('textarea.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
|
|
|
}
|
|
|
|
|
2024-05-22 08:11:33 +00:00
|
|
|
.p-textarea:enabled:hover {
|
2024-05-01 08:26:48 +00:00
|
|
|
border-color: ${dt('textarea.hover.border.color')};
|
|
|
|
}
|
|
|
|
|
2024-05-22 08:11:33 +00:00
|
|
|
.p-textarea:enabled:focus {
|
2024-05-01 08:26:48 +00:00
|
|
|
border-color: ${dt('textarea.focus.border.color')};
|
2024-05-07 06:51:53 +00:00
|
|
|
box-shadow: ${dt('textarea.focus.ring.shadow')};
|
|
|
|
outline: ${dt('textarea.focus.ring.width')} ${dt('textarea.focus.ring.style')} ${dt('textarea.focus.ring.color')};
|
|
|
|
outline-offset: ${dt('textarea.focus.ring.offset')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-22 08:11:33 +00:00
|
|
|
.p-textarea.p-invalid {
|
2024-05-01 08:26:48 +00:00
|
|
|
border-color: ${dt('textarea.invalid.border.color')};
|
|
|
|
}
|
|
|
|
|
2024-05-22 08:11:33 +00:00
|
|
|
.p-textarea.p-variant-filled {
|
2024-05-24 05:50:38 +00:00
|
|
|
background: ${dt('textarea.filled.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-22 08:11:33 +00:00
|
|
|
.p-textarea.p-variant-filled:enabled:focus {
|
2024-05-24 05:50:38 +00:00
|
|
|
background: ${dt('textarea.filled.focus.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-22 08:11:33 +00:00
|
|
|
.p-textarea:disabled {
|
2024-05-01 08:26:48 +00:00
|
|
|
opacity: 1;
|
|
|
|
background: ${dt('textarea.disabled.background')};
|
|
|
|
color: ${dt('textarea.disabled.color')};
|
|
|
|
}
|
|
|
|
|
2024-05-22 08:11:33 +00:00
|
|
|
.p-textarea::placeholder {
|
2024-05-01 08:26:48 +00:00
|
|
|
color: ${dt('textarea.placeholder.color')};
|
|
|
|
}
|
|
|
|
|
2024-05-22 08:11:33 +00:00
|
|
|
.p-fluid .p-textarea {
|
2024-05-01 08:26:48 +00:00
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
2024-05-22 08:11:33 +00:00
|
|
|
.p-textarea-resizable {
|
2024-05-01 08:26:48 +00:00
|
|
|
overflow: hidden;
|
|
|
|
resize: none;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const classes = {
|
|
|
|
root: ({ instance, props }) => [
|
2024-05-22 08:11:33 +00:00
|
|
|
'p-textarea p-component',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
|
|
|
'p-filled': instance.filled,
|
2024-05-22 08:11:33 +00:00
|
|
|
'p-textarea-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
|
|
|
|
});
|