// @ts-nocheck
import { __assign, __rest } from "tslib";
import React, { forwardRef } from 'react';
import { getSizeByMap } from '../../../utils/getSizeByMap';
import { FieldCaption } from '../../FieldCaption/FieldCaption';
import { FieldLabel } from '../../FieldLabel/FieldLabel';
import { cnSelect } from '../cnSelect';
import { sizeMap } from '../helpers';
import { defaultPropForm, defaultPropSize, defaultPropView, } from '../types';
export var SelectContainer = forwardRef(function (props, ref) {
    var _a = props.size, size = _a === void 0 ? defaultPropSize : _a, _b = props.form, form = _b === void 0 ? defaultPropForm : _b, _c = props.view, view = _c === void 0 ? defaultPropView : _c, className = props.className, disabled = props.disabled, required = props.required, children = props.children, status = props.status, focused = props.focused, multiple = props.multiple, _d = props.labelPosition, labelPosition = _d === void 0 ? 'top' : _d, label = props.label, caption = props.caption, otherProps = __rest(props, ["size", "form", "view", "className", "disabled", "required", "children", "status", "focused", "multiple", "labelPosition", "label", "caption"]);
    return (React.createElement("div", __assign({ className: cnSelect({ labelPosition: labelPosition, size: size, view: view }, [className]) }, otherProps),
        label && (React.createElement(FieldLabel, { required: required, className: cnSelect('Label', { labelPosition: labelPosition }), size: getSizeByMap(sizeMap, size) }, label)),
        React.createElement("div", { className: cnSelect('Body') },
            React.createElement("div", { className: cnSelect('SelectContainer', {
                    view: view,
                    form: form,
                    disabled: disabled,
                    focused: focused,
                    multiple: multiple,
                    status: status
                }), ref: ref }, children),
            caption && (React.createElement(FieldCaption, { className: cnSelect('Caption'), status: status }, caption)))));
});
