import { __decorate, __extends } from "tslib";
import Vue from 'vue';
import Component from 'vue-class-component';
import { Emit, Prop } from 'vue-property-decorator';
import { Enums } from '../../../utils/enums/enums';
import { MIcon } from '../../icon/icon';
import WithRender from './chip-add.html?style=./chip-add.scss';
var MChipSize;
(function (MChipSize) {
    MChipSize["Small"] = "small";
    MChipSize["Large"] = "large";
})(MChipSize || (MChipSize = {}));
var MChipAdd = /** @class */ (function (_super) {
    __extends(MChipAdd, _super);
    function MChipAdd() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    MChipAdd.prototype.emitClick = function (_event) { };
    MChipAdd.prototype.emitAdd = function (_event) { };
    Object.defineProperty(MChipAdd.prototype, "iconSize", {
        get: function () {
            return this.size === MChipSize.Small ? '13px' : '20px';
        },
        enumerable: false,
        configurable: true
    });
    MChipAdd.prototype.onClick = function (event) {
        if (this.disabled) {
            return;
        }
        this.emitClick(event);
        this.emitAdd(event);
    };
    __decorate([
        Prop()
    ], MChipAdd.prototype, "disabled", void 0);
    __decorate([
        Prop()
    ], MChipAdd.prototype, "tabindex", void 0);
    __decorate([
        Prop({ default: true })
    ], MChipAdd.prototype, "icon", void 0);
    __decorate([
        Prop({
            default: MChipSize.Large,
            validator: function (value) { return Enums.toValueArray(MChipSize).includes(value); }
        })
    ], MChipAdd.prototype, "size", void 0);
    __decorate([
        Emit('click')
    ], MChipAdd.prototype, "emitClick", null);
    __decorate([
        Emit('add')
    ], MChipAdd.prototype, "emitAdd", null);
    MChipAdd = __decorate([
        WithRender,
        Component({
            components: {
                MIcon: MIcon
            },
            modul: {
                i18n: {
                    'fr': require('./../chip.lang.fr.json'),
                    'en': require('./../chip.lang.en.json')
                }
            }
        })
    ], MChipAdd);
    return MChipAdd;
}(Vue));
export default MChipAdd;
//# sourceMappingURL=chip-add.js.map