"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
/**
 * @file 页面布局，支持左边栏、顶部、内容区域布局。
 *
 * 参数说明：
 *
 * * children 会渲染在内容区。
 * * header 头部区域
 * * aside 边栏
 * * asideWide 边栏是否加宽
 * * asideClassName 边栏附加样式class
 * * footer 页脚
 * * folder 是否收起边栏
 * * asideFixed 边栏是否为固定模式，如果是会用 position:fixed 来定位.
 * * className 附件的样式名
 * * contentClassName 内容区域附加样式名称
 *
 * @author fex
 */
var React = require("react");
var theme_1 = require("../theme");
var Layout = /** @class */ (function (_super) {
    tslib_1.__extends(Layout, _super);
    function Layout() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    Layout.prototype.render = function () {
        var _a = this.props, header = _a.header, aside = _a.aside, 
        // asideWide,
        asideClassName = _a.asideClassName, children = _a.children, className = _a.className, contentClassName = _a.contentClassName, folded = _a.folded, asideFixed = _a.asideFixed, headerFixed = _a.headerFixed, footer = _a.footer, offScreen = _a.offScreen, size = _a.size, classPrefix = _a.classPrefix, cx = _a.classnames;
        var body = (React.createElement("div", { className: cx("Layout-body", contentClassName) }, children));
        if (aside) {
            body = (React.createElement("div", { className: cx('Layout-content'), role: "main" }, body));
        }
        return (React.createElement("div", { className: cx("Layout", className, (_b = {
                    'Layout--withAside': !!aside,
                    'Layout--headerFixed': header ? headerFixed : false,
                    'Layout--asideFixed': aside ? asideFixed : false,
                    // 'Layout--wide': aside ? asideWide : false,
                    'Layout--folded': folded,
                    'Layout--offScreen': offScreen
                },
                _b["Layout--" + size] = size,
                _b['Layout--noFooter'] = !footer,
                _b)) },
            header ? (React.createElement("div", { className: cx('Layout-header') }, header)) : null,
            aside ? (React.createElement("div", { className: cx("Layout-aside", asideClassName) },
                React.createElement("div", { className: cx('Layout-asideWrap') },
                    React.createElement("div", { id: "asideInner", className: cx('Layout-asideInner') }, aside)))) : null,
            body,
            footer ? (React.createElement("footer", { className: cx('Layout-footer'), role: "footer" }, footer)) : null));
        var _b;
    };
    Layout.defaultProps = {
        // asideWide: false,
        asideFixed: true,
        asideClassName: '',
        headerFixed: true,
        offScreen: false,
        footer: false
    };
    return Layout;
}(React.Component));
exports.Layout = Layout;
exports.default = theme_1.themeable(Layout);
//# sourceMappingURL=./components/Layout.js.map
