import type { VNode } from 'vue'; import type { DropdownButtonItemArgs } from '../dropdown-button/dropdown-button-item'; import type { FormItemWrapperArgs, MarginType } from '../form/form-item-wrapper'; import { Prop, toNative } from 'vue-facing-decorator'; import PowerduckState from '../../app/powerduck-state'; import TsxComponent, { Component } from '../../app/vuetsx'; import FormItemWrapper from '../form/form-item-wrapper'; interface TextAreaArgs extends Omit { value: string; placeholder?: string; changed: (newValue: string) => void; rows: number; maxLength?: number; disabled?: boolean; } @Component class TextAreaComponent extends TsxComponent implements TextAreaArgs { @Prop() label!: string | VNode; @Prop() labelButtons!: DropdownButtonItemArgs[]; @Prop() subtitle!: string; @Prop() cssClass: string; @Prop() disabled!: boolean; @Prop() value!: string; @Prop() placeholder!: string; @Prop() mandatory!: boolean; @Prop() marginType?: MarginType; @Prop() maxWidth?: number; @Prop() wrap!: boolean; @Prop() showClearValueButton!: boolean; @Prop() hint: string; @Prop() rows: number; @Prop() maxLength: number; @Prop() appendIcon: string; @Prop() prependIcon: string; @Prop() appendClicked: () => void; @Prop() prependClicked: () => void; @Prop() changed: (newValue: string) => void; private get errorId(): string { return `textarea-error-${this.$.uid}`; } raiseChangeEvent(e) { this.populateValidationDeclaration(); if (this.changed != null) { const newValue = e.target.value; this.changed(newValue); } } render(h) { return (