"use strict";
// @ts-nocheck
exports.__esModule = true;
exports.SelectContainer = void 0;
var tslib_1 = require("tslib");
var react_1 = (0, tslib_1.__importStar)(require("react"));
var getSizeByMap_1 = require("../../../utils/getSizeByMap");
var FieldCaption_1 = require("../../FieldCaption/FieldCaption");
var FieldLabel_1 = require("../../FieldLabel/FieldLabel");
var cnSelect_1 = require("../cnSelect");
var helpers_1 = require("../helpers");
var types_1 = require("../types");
exports.SelectContainer = (0, react_1.forwardRef)(function (props, ref) {
    var _a = props.size, size = _a === void 0 ? types_1.defaultPropSize : _a, _b = props.form, form = _b === void 0 ? types_1.defaultPropForm : _b, _c = props.view, view = _c === void 0 ? types_1.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 = (0, tslib_1.__rest)(props, ["size", "form", "view", "className", "disabled", "required", "children", "status", "focused", "multiple", "labelPosition", "label", "caption"]);
    return (react_1["default"].createElement("div", (0, tslib_1.__assign)({ className: (0, cnSelect_1.cnSelect)({ labelPosition: labelPosition, size: size, view: view }, [className]) }, otherProps),
        label && (react_1["default"].createElement(FieldLabel_1.FieldLabel, { required: required, className: (0, cnSelect_1.cnSelect)('Label', { labelPosition: labelPosition }), size: (0, getSizeByMap_1.getSizeByMap)(helpers_1.sizeMap, size) }, label)),
        react_1["default"].createElement("div", { className: (0, cnSelect_1.cnSelect)('Body') },
            react_1["default"].createElement("div", { className: (0, cnSelect_1.cnSelect)('SelectContainer', {
                    view: view,
                    form: form,
                    disabled: disabled,
                    focused: focused,
                    multiple: multiple,
                    status: status
                }), ref: ref }, children),
            caption && (react_1["default"].createElement(FieldCaption_1.FieldCaption, { className: (0, cnSelect_1.cnSelect)('Caption'), status: status }, caption)))));
});
