/**
 * DevExtreme (esm/renovation/ui/editors/text_area.js)
 * Version: 23.2.6 (build 24140-0112)
 * Build date: Sun May 19 2024
 *
 * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import _extends from "@babel/runtime/helpers/esm/extends";
var _excluded = ["accessKey", "activeStateEnabled", "autoResizeEnabled", "className", "defaultValue", "disabled", "focusStateEnabled", "height", "hint", "hoverStateEnabled", "inputAttr", "isDirty", "isValid", "label", "labelMode", "maxLength", "name", "onClick", "onFocusIn", "onKeyDown", "readOnly", "rtlEnabled", "spellCheck", "stylingMode", "tabIndex", "validationError", "validationErrors", "validationMessageMode", "validationMessagePosition", "validationStatus", "value", "valueChange", "valueChangeEvent", "visible", "width"];
import {
    createComponentVNode,
    normalizeProps
} from "inferno";
import {
    BaseInfernoComponent
} from "@devextreme/runtime/inferno";
import LegacyTextArea from "../../../ui/text_area";
import {
    DomComponentWrapper
} from "../common/dom_component_wrapper";
import {
    EditorProps
} from "./common/editor";
import {
    EditorStateProps
} from "./common/editor_state_props";
import {
    EditorLabelProps
} from "./common/editor_label_props";
import {
    TextEditorProps
} from "./common/text_editor_props";
export var viewFunction = _ref => {
    var {
        componentProps: componentProps,
        restAttributes: restAttributes
    } = _ref;
    return normalizeProps(createComponentVNode(2, DomComponentWrapper, _extends({
        componentType: LegacyTextArea,
        componentProps: componentProps,
        templateNames: []
    }, restAttributes)))
};
export var TextAreaProps = Object.create(Object.prototype, _extends(Object.getOwnPropertyDescriptors(EditorProps), Object.getOwnPropertyDescriptors({
    autoResizeEnabled: false,
    isReactComponentWrapper: true
})));
export var TextAreaPropsType = {
    get autoResizeEnabled() {
        return TextAreaProps.autoResizeEnabled
    },
    get readOnly() {
        return TextAreaProps.readOnly
    },
    get name() {
        return TextAreaProps.name
    },
    get validationError() {
        return TextAreaProps.validationError
    },
    get validationErrors() {
        return TextAreaProps.validationErrors
    },
    get validationMessageMode() {
        return TextAreaProps.validationMessageMode
    },
    get validationMessagePosition() {
        return TextAreaProps.validationMessagePosition
    },
    get validationStatus() {
        return TextAreaProps.validationStatus
    },
    get isValid() {
        return TextAreaProps.isValid
    },
    get isDirty() {
        return TextAreaProps.isDirty
    },
    get defaultValue() {
        return TextEditorProps.defaultValue
    },
    get className() {
        return TextAreaProps.className
    },
    get activeStateEnabled() {
        return EditorStateProps.activeStateEnabled
    },
    get disabled() {
        return TextAreaProps.disabled
    },
    get focusStateEnabled() {
        return EditorStateProps.focusStateEnabled
    },
    get hoverStateEnabled() {
        return EditorStateProps.hoverStateEnabled
    },
    get tabIndex() {
        return TextAreaProps.tabIndex
    },
    get visible() {
        return TextAreaProps.visible
    },
    get label() {
        return EditorLabelProps.label
    },
    get labelMode() {
        return EditorLabelProps.labelMode
    },
    get maxLength() {
        return TextEditorProps.maxLength
    },
    get spellCheck() {
        return TextEditorProps.spellCheck
    },
    get valueChangeEvent() {
        return TextEditorProps.valueChangeEvent
    },
    get stylingMode() {
        return TextEditorProps.stylingMode
    },
    isReactComponentWrapper: true
};
export class TextArea extends BaseInfernoComponent {
    constructor(props) {
        super(props);
        this.state = {
            value: void 0 !== this.props.value ? this.props.value : this.props.defaultValue
        }
    }
    get componentProps() {
        return _extends({}, this.props, {
            value: void 0 !== this.props.value ? this.props.value : this.state.value
        })
    }
    get restAttributes() {
        var _this$props$value = _extends({}, this.props, {
                value: void 0 !== this.props.value ? this.props.value : this.state.value
            }),
            restProps = _objectWithoutPropertiesLoose(_this$props$value, _excluded);
        return restProps
    }
    render() {
        var props = this.props;
        return viewFunction({
            props: _extends({}, props, {
                value: void 0 !== this.props.value ? this.props.value : this.state.value
            }),
            componentProps: this.componentProps,
            restAttributes: this.restAttributes
        })
    }
}
TextArea.defaultProps = TextAreaPropsType;
