import { __extends, __decorate, __metadata } from 'tslib';
import { Prop, Component } from 'vue-property-decorator';
import Vue from 'vue';

var DelayedRender = function(_super) {
  __extends(DelayedRender2, _super);
  function DelayedRender2() {
    var _this = _super !== null && _super.apply(this, arguments) || this;
    _this.isRendered = false;
    return _this;
  }
  DelayedRender2.prototype.mounted = function() {
    var _this = this;
    this.timeoutId = setTimeout(function() {
      _this.isRendered = true;
    }, this.delay);
  };
  DelayedRender2.prototype.beforeDestroy = function() {
    if (this.timeoutId)
      clearTimeout(this.timeoutId);
  };
  DelayedRender2.prototype.render = function(h) {
    return this.isRendered ? h("div", [this.$slots.default]) : null;
  };
  __decorate([
    Prop({ type: Number, default: 0 }),
    __metadata("design:type", Number)
  ], DelayedRender2.prototype, "delay", void 0);
  DelayedRender2 = __decorate([
    Component
  ], DelayedRender2);
  return DelayedRender2;
}(Vue);

export { DelayedRender };
