/**
 * amis-ui v6.14.0-beta.1
 * Copyright 2018-2025 fex
 */

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var tslib = require('tslib');
var React = require('react');
var amisCore = require('amis-core');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

var __react_jsx__ = require('react');
var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
(__react_jsx__["default"] || __react_jsx__).Fragment;
var TitleBar = /** @class */ (function (_super) {
    tslib.__extends(TitleBar, _super);
    function TitleBar() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    TitleBar.prototype.render = function () {
        var _a = this.props, className = _a.className, title = _a.title, titleClassName = _a.titleClassName, right = _a.right, cx = _a.classnames;
        var left = title ? _J$X_("div", { className: titleClassName }, title) : null;
        var body = left;
        if (right) {
            body = (_J$X_("div", { className: "hbox hbox-auto-xs h-auto" },
                _J$X_("div", { className: "col bg-light b-b wrapper" }, left),
                _J$X_("div", { className: "col v-middle padder-md text-right bg-light b-b wrapper-sm" }, right)));
        }
        else {
            body = _J$X_("div", { className: "wrapper" }, left);
        }
        return _J$X_("div", { className: cx(className, 'TitleBar') }, body);
    };
    TitleBar.defaultProps = {
        className: 'bg-light lter b-b',
        title: '标题',
        titleClassName: 'm-n font-thin h3',
        right: false
    };
    return TitleBar;
}(React__default["default"].PureComponent));
var TitleBar$1 = amisCore.themeable(TitleBar);

exports.TitleBar = TitleBar;
exports["default"] = TitleBar$1;
