import { __decorate, __extends } from "tslib";
import { Component, Emit, Prop } from 'vue-property-decorator';
import { Enums } from '../../utils/enums/enums';
import { REGEX_CSS_NUMBER_VALUE } from '../../utils/props-validation/props-validation';
import { ModulVue } from '../../utils/vue/vue';
import { EMPTY_AREA_NAME } from '../component-names';
import { MAdd } from './../add/add';
import { MButton, MButtonSkin } from './../button/button';
import { MSvg } from './../svg/svg';
import WithRender from './empty-area.html?style=./empty-area.scss';
export var MEmptyAreaButtonType;
(function (MEmptyAreaButtonType) {
    MEmptyAreaButtonType["Button"] = "button";
    MEmptyAreaButtonType["AddButton"] = "add-button";
})(MEmptyAreaButtonType || (MEmptyAreaButtonType = {}));
export var MEmptyAreaBackgroundStyle;
(function (MEmptyAreaBackgroundStyle) {
    MEmptyAreaBackgroundStyle["Any"] = "any";
    MEmptyAreaBackgroundStyle["Light"] = "light";
})(MEmptyAreaBackgroundStyle || (MEmptyAreaBackgroundStyle = {}));
export var MEmptyAreaDisplayMode;
(function (MEmptyAreaDisplayMode) {
    MEmptyAreaDisplayMode["Inline"] = "inline";
    MEmptyAreaDisplayMode["Block"] = "block";
})(MEmptyAreaDisplayMode || (MEmptyAreaDisplayMode = {}));
var MEmptyArea = /** @class */ (function (_super) {
    __extends(MEmptyArea, _super);
    function MEmptyArea() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.buttonSkin = MButtonSkin.Secondary;
        return _this;
    }
    MEmptyArea.prototype.emitButtonClick = function (event) { };
    Object.defineProperty(MEmptyArea.prototype, "isButtonTypeAdd", {
        get: function () {
            return this.buttonType === MEmptyAreaButtonType.AddButton;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MEmptyArea.prototype, "hasContentArea", {
        get: function () {
            return Boolean(this.svgName || this.title || this.subtitle);
        },
        enumerable: false,
        configurable: true
    });
    __decorate([
        Prop()
    ], MEmptyArea.prototype, "title", void 0);
    __decorate([
        Prop()
    ], MEmptyArea.prototype, "subtitle", void 0);
    __decorate([
        Prop()
    ], MEmptyArea.prototype, "buttonText", void 0);
    __decorate([
        Prop({
            default: MEmptyAreaButtonType.AddButton,
            validator: function (value) {
                return Enums.toValueArray(MEmptyAreaButtonType).includes(value);
            }
        })
    ], MEmptyArea.prototype, "buttonType", void 0);
    __decorate([
        Prop()
    ], MEmptyArea.prototype, "svgName", void 0);
    __decorate([
        Prop({
            default: MEmptyAreaBackgroundStyle.Light,
            validator: function (value) {
                return Enums.toValueArray(MEmptyAreaBackgroundStyle).includes(value);
            }
        })
    ], MEmptyArea.prototype, "backgroundStyle", void 0);
    __decorate([
        Prop({
            default: MEmptyAreaDisplayMode.Block,
            validator: function (value) {
                return Enums.toValueArray(MEmptyAreaDisplayMode).includes(value);
            }
        })
    ], MEmptyArea.prototype, "displayMode", void 0);
    __decorate([
        Prop({
            default: '60px',
            validator: function (value) {
                return REGEX_CSS_NUMBER_VALUE.test(value);
            }
        })
    ], MEmptyArea.prototype, "svgSize", void 0);
    __decorate([
        Prop({
            default: '280px',
            validator: function (value) {
                return REGEX_CSS_NUMBER_VALUE.test(value) || value === 'auto';
            }
        })
    ], MEmptyArea.prototype, "minHeight", void 0);
    __decorate([
        Emit('button-click')
    ], MEmptyArea.prototype, "emitButtonClick", null);
    MEmptyArea = __decorate([
        WithRender,
        Component({
            components: {
                MButton: MButton,
                MAdd: MAdd,
                MSvg: MSvg
            }
        })
    ], MEmptyArea);
    return MEmptyArea;
}(ModulVue));
export { MEmptyArea };
var EmptyAreaPlugin = {
    install: function (v, options) {
        v.component(EMPTY_AREA_NAME, MEmptyArea);
    }
};
export default EmptyAreaPlugin;
//# sourceMappingURL=empty-area.js.map