var _a;
import { __decorate, __extends } from "tslib";
import Component from 'vue-class-component';
import { Prop } from 'vue-property-decorator';
import { InputLabel } from '../../mixins/input-label/input-label';
import { InputManagement } from '../../mixins/input-management/input-management';
import { InputState } from '../../mixins/input-state/input-state';
import { InputWidth } from '../../mixins/input-width/input-width';
import uuid from '../../utils/uuid/uuid';
import { ModulVue } from '../../utils/vue/vue';
import { INPUT_STYLE_NAME, MASKEDFIELD_NAME, VALIDATION_MESSAGE_NAME } from '../component-names';
import { MInputMask } from '../input-mask/input-mask';
import { MInputStyle } from '../input-style/input-style';
import { MValidationMessage } from '../validation-message/validation-message';
import WithRender from './maskedfield.html?style=./maskedfield.scss';
var MMaskedfield = /** @class */ (function (_super) {
    __extends(MMaskedfield, _super);
    function MMaskedfield() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.validationMessageId = uuid.generate();
        return _this;
    }
    Object.defineProperty(MMaskedfield.prototype, "hasMaskedfieldError", {
        get: function () {
            return this.as().hasError;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MMaskedfield.prototype, "isMaskedfieldValid", {
        get: function () {
            return this.as().isValid;
        },
        enumerable: false,
        configurable: true
    });
    __decorate([
        Prop({ default: {} })
    ], MMaskedfield.prototype, "maskOptions", void 0);
    __decorate([
        Prop({ default: true })
    ], MMaskedfield.prototype, "raw", void 0);
    __decorate([
        Prop({ default: function () { return "mMaskedfield-" + uuid.generate(); } })
    ], MMaskedfield.prototype, "id", void 0);
    MMaskedfield = __decorate([
        WithRender,
        Component({
            mixins: [
                InputState,
                InputWidth,
                InputLabel,
                InputManagement
            ],
            components: (_a = {
                    MInputMask: MInputMask
                },
                _a[INPUT_STYLE_NAME] = MInputStyle,
                _a[VALIDATION_MESSAGE_NAME] = MValidationMessage,
                _a)
        })
    ], MMaskedfield);
    return MMaskedfield;
}(ModulVue));
export { MMaskedfield };
var MaskedfieldPlugin = {
    install: function (v) {
        v.component(MASKEDFIELD_NAME, MMaskedfield);
    }
};
export default MaskedfieldPlugin;
//# sourceMappingURL=maskedfield.js.map