2023-05-24 14:15:21 +00:00
|
|
|
<script>
|
|
|
|
import BaseComponent from 'primevue/basecomponent';
|
|
|
|
import { useStyle } from 'primevue/usestyle';
|
|
|
|
|
|
|
|
const styles = `
|
|
|
|
.p-inputtextarea-resizable {
|
|
|
|
overflow: hidden;
|
|
|
|
resize: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-fluid .p-inputtextarea {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
root: ({ instance, props }) => [
|
|
|
|
'p-inputtextarea p-inputtext p-component',
|
|
|
|
{
|
|
|
|
'p-filled': instance.filled,
|
|
|
|
'p-inputtextarea-resizable ': props.autoResize
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
2023-07-03 22:20:35 +00:00
|
|
|
const { load: loadStyle } = useStyle(styles, { name: 'textarea', manual: true });
|
2023-05-24 14:15:21 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'BaseTextarea',
|
|
|
|
extends: BaseComponent,
|
|
|
|
props: {
|
|
|
|
modelValue: null,
|
|
|
|
autoResize: Boolean
|
|
|
|
},
|
|
|
|
css: {
|
2023-05-30 12:28:04 +00:00
|
|
|
classes,
|
|
|
|
loadStyle
|
2023-05-24 14:15:21 +00:00
|
|
|
},
|
2023-05-30 12:28:04 +00:00
|
|
|
provide() {
|
|
|
|
return {
|
|
|
|
$parentInstance: this
|
|
|
|
};
|
2023-05-24 14:15:21 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|