"use strict";
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;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.cssClass = void 0;
var _ = require("lodash");
var classnames = require("classnames");
var React = require("react");
var PropTypes = require("prop-types");
var ContentAlign_1 = require("./ContentAlign");
var FlexItem_1 = require("./FlexItem");
var ItemAlign_1 = require("./ItemAlign");
var Justify_1 = require("./Justify");
require("../less/flex.less");
exports.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; },
};
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_1.default, __assign({ className: classnames(inline ? exports.cssClass.FLEXBOX_INLINE : exports.cssClass.FLEXBOX, column && exports.cssClass.COLUMN, alignContent && exports.cssClass.alignContent(alignContent), alignItems && exports.cssClass.alignItems(alignItems), justify && exports.cssClass.justify(justify), wrap && exports.cssClass.WRAP, className) }, additionalProps), children));
}
exports.default = FlexBox;
FlexBox.propTypes = __assign(__assign({}, FlexItem_1.default.propTypes), { alignContent: PropTypes.oneOf(_.values(ContentAlign_1.default)), alignItems: PropTypes.oneOf(_.values(ItemAlign_1.default)), children: PropTypes.node, className: PropTypes.string, column: PropTypes.bool, inline: PropTypes.bool, justify: PropTypes.oneOf(_.values(Justify_1.default)), wrap: PropTypes.bool });
FlexBox.defaultProps = {
    component: "div",
};
