import { ABSTRACT_CONTROL_NAME } from '../../directives/directive-names';
import ScrollToPlugin from '../../utils/scroll-to/scroll-to';
import ToastServicePlugin from '../../utils/toast/toast-service.plugin';
import { FORM_NAME } from '../component-names';
import { AbstractControlDirective } from './control-directive';
import { ClearErrorToast, ErrorToast, FocusOnFirstError } from './fallouts/built-in-form-action-fallouts';
import { MForm } from './form';
import { MFormService } from './form-service';
export var FormPlugin = {
    install: function (v, options) {
        v.prototype.$log.debug(FORM_NAME, 'plugin.install');
        v.use(ToastServicePlugin);
        v.use(ScrollToPlugin);
        v.directive(ABSTRACT_CONTROL_NAME, AbstractControlDirective);
        v.component(FORM_NAME, MForm);
        (v.prototype).$form = new MFormService(options && options.formAfterActionEffects ?
            options.formAfterActionEffects : [
            ErrorToast,
            ClearErrorToast,
            FocusOnFirstError
        ]);
    }
};
export default FormPlugin;
//# sourceMappingURL=form.plugin.js.map