import { jsx as _jsx } from "react/jsx-runtime";
import { cn } from '../../../utils/cn.js';
import { DataFormFieldLayout } from '../shared/data_form_field_layout.js';
export function TextareaField(props) {
    const { field, mode, value, config, on_change, on_blur } = props;
    const string_value = value != null ? String(value) : '';
    const field_style = config.style_resolver.has_style(mode === 'view' ? 'field_view' : 'field')
        ? config.style_resolver.to_style(mode === 'view' ? 'field_view' : 'field')
        : undefined;
    return (_jsx(DataFormFieldLayout, { ...props, force_layout: "stacked", children: mode === 'edit' ? (_jsx("textarea", { className: cn('cls_data_form_textarea_input', 'w-full min-h-[80px] resize-y'), style: field_style, value: string_value, placeholder: field.placeholder, disabled: field.disabled, maxLength: field.max_length, onChange: (e) => on_change(e.target.value), onBlur: on_blur })) : (_jsx("div", { className: "cls_data_form_textarea_view whitespace-pre-wrap", style: field_style, children: string_value || '\u00A0' })) }));
}
//# sourceMappingURL=textarea_field.js.map