var _a, _b;
import { __decorate, __extends } from "tslib";
import Vue from 'vue';
import Component from 'vue-class-component';
import { Emit, Prop } from 'vue-property-decorator';
import { I18N_NAME } from '../../../filters/filter-names';
import { i18nFilter } from '../../../filters/i18n/i18n';
import uuid from '../../../utils/uuid/uuid';
import { ICON_NAME } from '../../component-names';
import { MIcon } from '../../icon/icon';
import WithRender from './chip-delete.html?style=./chip-delete.scss';
var MChipSize;
(function (MChipSize) {
    MChipSize["Small"] = "small";
    MChipSize["Large"] = "large";
})(MChipSize || (MChipSize = {}));
var MChipDelete = /** @class */ (function (_super) {
    __extends(MChipDelete, _super);
    function MChipDelete() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.textId = "mChipDeleteText-" + uuid.generate();
        _this.iconHover = false;
        return _this;
    }
    MChipDelete.prototype.emitClick = function () { };
    MChipDelete.prototype.emitDelete = function () { };
    Object.defineProperty(MChipDelete.prototype, "iconSize", {
        get: function () {
            return this.size === MChipSize.Small ? '8px' : '14px';
        },
        enumerable: true,
        configurable: true
    });
    MChipDelete.prototype.onClick = function (event) {
        if (this.disabled) {
            return;
        }
        this.emitClick();
        this.emitDelete();
    };
    MChipDelete.prototype.onMouseOver = function (event) {
        this.iconHover = true;
    };
    MChipDelete.prototype.onMouseLeave = function (event) {
        this.iconHover = false;
    };
    __decorate([
        Prop()
    ], MChipDelete.prototype, "disabled", void 0);
    __decorate([
        Prop({
            default: MChipSize.Large,
            validator: function (value) {
                return value === MChipSize.Large ||
                    value === MChipSize.Small;
            }
        })
    ], MChipDelete.prototype, "size", void 0);
    __decorate([
        Emit('click')
    ], MChipDelete.prototype, "emitClick", null);
    __decorate([
        Emit('delete')
    ], MChipDelete.prototype, "emitDelete", null);
    MChipDelete = __decorate([
        WithRender,
        Component({
            components: (_a = {},
                _a[ICON_NAME] = MIcon,
                _a),
            filters: (_b = {},
                _b[I18N_NAME] = i18nFilter,
                _b)
        })
    ], MChipDelete);
    return MChipDelete;
}(Vue));
export default MChipDelete;
//# sourceMappingURL=chip-delete.js.map