import { __decorate, __extends } from "tslib";
import Component from 'vue-class-component';
import { Prop } from 'vue-property-decorator';
import { ModulVue } from '../../utils/vue/vue';
import { MToastPosition, MToastTimeout } from '../toast/toast';
var MCopyToClipboardFeedback = /** @class */ (function (_super) {
    __extends(MCopyToClipboardFeedback, _super);
    function MCopyToClipboardFeedback() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    MCopyToClipboardFeedback.prototype.render = function () {
        var _this = this;
        if (this.$scopedSlots && this.$scopedSlots.default) {
            return this.$scopedSlots.default({
                showToast: function () { return _this.showToast(); }
            });
        }
        else {
            throw new Error('copy-to-clipboard expects a default scoped slot.');
        }
    };
    MCopyToClipboardFeedback.prototype.showToast = function () {
        this.$toast.show({
            text: this.message ? this.message : this.$i18n.translate('m-copy-to-clipboard:copied'),
            position: this.position,
            timeout: this.timeout
        });
    };
    __decorate([
        Prop()
    ], MCopyToClipboardFeedback.prototype, "message", void 0);
    __decorate([
        Prop({
            default: MToastPosition.BottomRight
        })
    ], MCopyToClipboardFeedback.prototype, "position", void 0);
    __decorate([
        Prop({
            default: MToastTimeout.xshort
        })
    ], MCopyToClipboardFeedback.prototype, "timeout", void 0);
    MCopyToClipboardFeedback = __decorate([
        Component
    ], MCopyToClipboardFeedback);
    return MCopyToClipboardFeedback;
}(ModulVue));
export { MCopyToClipboardFeedback };
//# sourceMappingURL=copy-to-clipboard-feedback.js.map