import { __decorate, __extends } from "tslib";
import Component from 'vue-class-component';
import { Emit, Prop } from 'vue-property-decorator';
import { ModulVue } from '../../../utils/vue/vue';
import { TABLE_EMPTY_ROW_NAME } from '../../component-names';
import { MEmptyArea, MEmptyAreaBackgroundStyle, MEmptyAreaDisplayMode } from './../../empty-area/empty-area';
import WithRender from './table-empty-row.html?style=./table-empty-row.scss';
var MTableEmptyRow = /** @class */ (function (_super) {
    __extends(MTableEmptyRow, _super);
    function MTableEmptyRow() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    MTableEmptyRow.prototype.emitEmptyButtonClick = function (event) { };
    Object.defineProperty(MTableEmptyRow.prototype, "title", {
        get: function () {
            if (this.waiting) {
                return this.$i18n.translate('m-table-empty-row:loading');
            }
            var title = this.emptyArea && this.emptyArea.title ? this.emptyArea.title : '';
            return !title && this.displayDefaultText
                ? this.$i18n.translate('m-table-empty-row:no-data')
                : title;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MTableEmptyRow.prototype, "subtitle", {
        get: function () {
            return this.emptyArea && this.emptyArea.subtitle && !this.waiting
                ? this.emptyArea.subtitle
                : '';
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MTableEmptyRow.prototype, "svgName", {
        get: function () {
            return this.emptyArea && this.emptyArea.svgName && !this.waiting
                ? this.emptyArea.svgName
                : '';
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MTableEmptyRow.prototype, "svgSize", {
        get: function () {
            if (this.emptyArea && this.emptyArea.svgSize) {
                return this.emptyArea.svgSize;
            }
            return this.insideOfTableGroup ? '30px' : '60px';
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MTableEmptyRow.prototype, "buttonText", {
        get: function () {
            return this.emptyArea && this.emptyArea.buttonText && !this.waiting
                ? this.emptyArea.buttonText
                : '';
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MTableEmptyRow.prototype, "backgroundStyle", {
        get: function () {
            if (this.emptyArea && this.emptyArea.backgroundStyle) {
                return this.emptyArea.backgroundStyle;
            }
            return this.insideOfTableGroup ? MEmptyAreaBackgroundStyle.Any : MEmptyAreaBackgroundStyle.Light;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MTableEmptyRow.prototype, "displayMode", {
        get: function () {
            if (this.emptyArea && this.emptyArea.displayMode) {
                return this.emptyArea.displayMode;
            }
            return this.insideOfTableGroup ? MEmptyAreaDisplayMode.Inline : MEmptyAreaDisplayMode.Block;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MTableEmptyRow.prototype, "minHeight", {
        get: function () {
            if (this.emptyArea && this.emptyArea.minHeight) {
                return this.emptyArea.minHeight;
            }
            return this.insideOfTableGroup ? 'auto' : '280px';
        },
        enumerable: false,
        configurable: true
    });
    __decorate([
        Prop({
            required: true
        })
    ], MTableEmptyRow.prototype, "tableComponentWidth", void 0);
    __decorate([
        Prop({
            required: false
        })
    ], MTableEmptyRow.prototype, "waiting", void 0);
    __decorate([
        Prop({
            required: true
        })
    ], MTableEmptyRow.prototype, "horizontalScrollOffset", void 0);
    __decorate([
        Prop()
    ], MTableEmptyRow.prototype, "nbColumns", void 0);
    __decorate([
        Prop()
    ], MTableEmptyRow.prototype, "emptyArea", void 0);
    __decorate([
        Prop({
            default: false
        })
    ], MTableEmptyRow.prototype, "displayDefaultText", void 0);
    __decorate([
        Prop({
            default: false
        })
    ], MTableEmptyRow.prototype, "insideOfTableGroup", void 0);
    __decorate([
        Emit('empty-button-click')
    ], MTableEmptyRow.prototype, "emitEmptyButtonClick", null);
    MTableEmptyRow = __decorate([
        WithRender,
        Component({
            modul: {
                i18n: {
                    'fr': require('./table-empty-row.lang.fr.json'),
                    'en': require('./table-empty-row.lang.en.json')
                }
            },
            components: {
                MEmptyArea: MEmptyArea
            }
        })
    ], MTableEmptyRow);
    return MTableEmptyRow;
}(ModulVue));
export { MTableEmptyRow };
var TableEmptyRowPlugin = {
    install: function (v) {
        v.prototype.$log.debug(TABLE_EMPTY_ROW_NAME, 'plugin.install');
        v.component(TABLE_EMPTY_ROW_NAME, MTableEmptyRow);
    }
};
export default TableEmptyRowPlugin;
//# sourceMappingURL=table-empty-row.js.map