import { __decorate, __extends } from "tslib";
import Component from 'vue-class-component';
import { Emit, Prop } from 'vue-property-decorator';
import uuid from '../../utils/uuid/uuid';
import { INPUT_GROUP_NAME } from '../component-names';
import { MValidationMessage } from '../validation-message/validation-message';
import { InputManagement } from './../../mixins/input-management/input-management';
import { InputState } from './../../mixins/input-state/input-state';
import { ModulVue } from './../../utils/vue/vue';
import WithRender from './input-group.html?style=./input-group.scss';
export var MMInputGroupValidationMessagePosition;
(function (MMInputGroupValidationMessagePosition) {
    MMInputGroupValidationMessagePosition["Top"] = "top";
    MMInputGroupValidationMessagePosition["Bottom"] = "bottom";
})(MMInputGroupValidationMessagePosition || (MMInputGroupValidationMessagePosition = {}));
var MInputGroup = /** @class */ (function (_super) {
    __extends(MInputGroup, _super);
    function MInputGroup() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    MInputGroup.prototype.emitFocusin = function (_event) { };
    MInputGroup.prototype.emitFocusout = function (_event) { };
    Object.defineProperty(MInputGroup.prototype, "hasLabel", {
        get: function () {
            return !!this.label;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MInputGroup.prototype, "isValidationMessagePositionBottom", {
        get: function () {
            return this.validationMessagePosition === MMInputGroupValidationMessagePosition.Bottom;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MInputGroup.prototype, "labelId", {
        get: function () {
            return this.hasLabel ? uuid.generate() : undefined;
        },
        enumerable: false,
        configurable: true
    });
    __decorate([
        Prop()
    ], MInputGroup.prototype, "label", void 0);
    __decorate([
        Prop()
    ], MInputGroup.prototype, "requiredMarker", void 0);
    __decorate([
        Prop({
            default: MMInputGroupValidationMessagePosition.Top,
            validator: function (value) {
                return value === MMInputGroupValidationMessagePosition.Top ||
                    value === MMInputGroupValidationMessagePosition.Bottom;
            }
        })
    ], MInputGroup.prototype, "validationMessagePosition", void 0);
    __decorate([
        Prop({
            default: function () { return uuid.generate(); }
        })
    ], MInputGroup.prototype, "validationMessageId", void 0);
    __decorate([
        Emit('focusin')
    ], MInputGroup.prototype, "emitFocusin", null);
    __decorate([
        Emit('focusout')
    ], MInputGroup.prototype, "emitFocusout", null);
    MInputGroup = __decorate([
        WithRender,
        Component({
            components: {
                MValidationMessage: MValidationMessage
            },
            mixins: [
                InputState,
                InputManagement
            ]
        })
    ], MInputGroup);
    return MInputGroup;
}(ModulVue));
export { MInputGroup };
var InputGroupPlugin = {
    install: function (v, options) {
        v.component(INPUT_GROUP_NAME, MInputGroup);
    }
};
export default InputGroupPlugin;
//# sourceMappingURL=input-group.js.map