var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import * as _ from "lodash";
import * as classnames from "classnames";
import * as React from "react";
import * as PropTypes from "prop-types";
import ContentAlign from "./ContentAlign";
import FlexItem from "./FlexItem";
import ItemAlign from "./ItemAlign";
import Justify from "./Justify";
import "../less/flex.less";
export var cssClass = {
    FLEXBOX: "flexbox",
    COLUMN: "flex--direction--column",
    FLEXBOX_INLINE: "flexbox--inline",
    WRAP: "flex--wrap",
    alignContent: function (value) { return "content--" + value; },
    alignItems: function (value) { return "items--" + value; },
    justify: function (value) { return "justify--" + value; },
};
export default function FlexBox(_a) {
    var alignContent = _a.alignContent, alignItems = _a.alignItems, children = _a.children, className = _a.className, _b = _a.column, column = _b === void 0 ? false : _b, _c = _a.inline, inline = _c === void 0 ? false : _c, justify = _a.justify, _d = _a.wrap, wrap = _d === void 0 ? false : _d, additionalProps = __rest(_a, ["alignContent", "alignItems", "children", "className", "column", "inline", "justify", "wrap"]);
    return (React.createElement(FlexItem, __assign({ className: classnames(inline ? cssClass.FLEXBOX_INLINE : cssClass.FLEXBOX, column && cssClass.COLUMN, alignContent && cssClass.alignContent(alignContent), alignItems && cssClass.alignItems(alignItems), justify && cssClass.justify(justify), wrap && cssClass.WRAP, className) }, additionalProps), children));
}
FlexBox.propTypes = __assign(__assign({}, FlexItem.propTypes), { alignContent: PropTypes.oneOf(_.values(ContentAlign)), alignItems: PropTypes.oneOf(_.values(ItemAlign)), children: PropTypes.node, className: PropTypes.string, column: PropTypes.bool, inline: PropTypes.bool, justify: PropTypes.oneOf(_.values(Justify)), wrap: PropTypes.bool });
FlexBox.defaultProps = {
    component: "div",
};
