import { __decorate, __extends, __metadata } from "tslib";
import { Component, Prop } from 'vue-property-decorator';
import Vue from 'vue';
var DelayedRender = /** @class */ (function (_super) {
    __extends(DelayedRender, _super);
    function DelayedRender() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.isRendered = false;
        return _this;
    }
    DelayedRender.prototype.mounted = function () {
        var _this = this;
        this.timeoutId = setTimeout(function () {
            _this.isRendered = true;
        }, this.delay);
    };
    DelayedRender.prototype.beforeDestroy = function () {
        if (this.timeoutId)
            clearTimeout(this.timeoutId);
    };
    DelayedRender.prototype.render = function (h) {
        return this.isRendered ? h('div', [this.$slots.default]) : null;
    };
    __decorate([
        Prop({ type: Number, default: 0 }),
        __metadata("design:type", Number)
    ], DelayedRender.prototype, "delay", void 0);
    DelayedRender = __decorate([
        Component
    ], DelayedRender);
    return DelayedRender;
}(Vue));
export { DelayedRender };
//# sourceMappingURL=DelayedRender.js.map