import { __assign, __decorate, __extends, __metadata } from "tslib";
import { Component, Prop } from 'vue-property-decorator';
import BaseComponent from '../BaseComponent';
import { classNamesFunction } from '@uifabric-vue/utilities';
import { DialogType } from './DialogContent.types';
import { IconButton } from '../Button';
var getClassNames = classNamesFunction();
var DialogContentBase = /** @class */ (function (_super) {
    __extends(DialogContentBase, _super);
    function DialogContentBase() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    Object.defineProperty(DialogContentBase.prototype, "classNames", {
        get: function () {
            var _a = this, styles = _a.styles, theme = _a.theme, className = _a.className, type = _a.type, draggableHeaderClassName = _a.draggableHeaderClassName;
            return getClassNames(styles, {
                theme: theme,
                className: className,
                isLargeHeader: type === DialogType.largeHeader,
                isClose: type === DialogType.close,
                draggableHeaderClassName: draggableHeaderClassName,
            });
        },
        enumerable: false,
        configurable: true
    });
    DialogContentBase.prototype.render = function (h) {
        var _this = this;
        var _a = this, classNames = _a.classNames, css = _a.css, title = _a.title, type = _a.type, showCloseButton = _a.showCloseButton, closeButtonAriaLabel = _a.closeButtonAriaLabel, subText = _a.subText, subTextId = _a.subTextId;
        var titleProps = this.titleProps || {};
        var $subTextContent = subText && h('p', {
            class: classNames.subText,
            attrs: { id: subTextId },
        }, subText);
        var $inner = h('div', { class: classNames.inner }, [
            h('div', { class: classNames.innerContent }, [
                $subTextContent,
                this.$slots.default,
            ]),
            this.$slots.footer,
        ]);
        var $title = h('div', {
            class: css(classNames.title, titleProps.className),
            attrs: __assign({ role: 'heading', 'aria-level': 1 }, titleProps),
        }, title);
        var $topButton = h('div', { class: classNames.topButton }, [
            (type === DialogType.close || (showCloseButton && type !== DialogType.largeHeader)) && h(IconButton, {
                class: classNames.button,
                attrs: {
                    iconProps: { iconName: 'Cancel' },
                    ariaLabel: closeButtonAriaLabel,
                    title: closeButtonAriaLabel,
                },
                on: {
                    click: function (ev) { return _this.$emit('dismiss', ev); },
                },
            }),
        ]);
        return h('div', { class: classNames.content }, [
            h('div', { class: classNames.header }, [
                $title,
                $topButton,
            ]),
            $inner,
        ]);
    };
    __decorate([
        Prop({ type: Number, default: DialogType.normal }),
        __metadata("design:type", Number)
    ], DialogContentBase.prototype, "type", void 0);
    __decorate([
        Prop({ type: String, default: null }),
        __metadata("design:type", String)
    ], DialogContentBase.prototype, "draggableHeaderClassName", void 0);
    __decorate([
        Prop({ type: Object, default: function () { } }),
        __metadata("design:type", Object)
    ], DialogContentBase.prototype, "titleProps", void 0);
    __decorate([
        Prop({ type: [String, Object], default: null }),
        __metadata("design:type", Object)
    ], DialogContentBase.prototype, "title", void 0);
    __decorate([
        Prop({ type: Boolean, default: false }),
        __metadata("design:type", Boolean)
    ], DialogContentBase.prototype, "showCloseButton", void 0);
    __decorate([
        Prop({ type: String, default: 'Close' }),
        __metadata("design:type", String)
    ], DialogContentBase.prototype, "closeButtonAriaLabel", void 0);
    __decorate([
        Prop({ type: String, default: null }),
        __metadata("design:type", String)
    ], DialogContentBase.prototype, "subText", void 0);
    __decorate([
        Prop({ type: String, default: null }),
        __metadata("design:type", String)
    ], DialogContentBase.prototype, "subTextId", void 0);
    DialogContentBase = __decorate([
        Component
    ], DialogContentBase);
    return DialogContentBase;
}(BaseComponent));
export { DialogContentBase };
//# sourceMappingURL=DialogContent.base.js.map