"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useProvideFormItemPrefix = exports.useProvideForm = exports.useInjectFormItemPrefix = exports.useInjectForm = exports.FormItemPrefixContextKey = exports.FormContextKey = void 0;
var _vueDemi = require("vue-demi");
var _messages = require("./utils/messages");
const FormContextKey = exports.FormContextKey = Symbol('formContextKey');
const useProvideForm = state => {
  (0, _vueDemi.provide)(FormContextKey, state);
};
exports.useProvideForm = useProvideForm;
const useInjectForm = () => {
  return (0, _vueDemi.inject)(FormContextKey, {
    name: (0, _vueDemi.computed)(() => undefined),
    labelAlign: (0, _vueDemi.computed)(() => 'right'),
    vertical: (0, _vueDemi.computed)(() => false),
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    addField: (_eventKey, _field) => {},
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    removeField: _eventKey => {},
    model: (0, _vueDemi.computed)(() => undefined),
    rules: (0, _vueDemi.computed)(() => undefined),
    colon: (0, _vueDemi.computed)(() => undefined),
    labelWrap: (0, _vueDemi.computed)(() => undefined),
    labelCol: (0, _vueDemi.computed)(() => undefined),
    requiredMark: (0, _vueDemi.computed)(() => false),
    validateTrigger: (0, _vueDemi.computed)(() => undefined),
    onValidate: () => {},
    validateMessages: (0, _vueDemi.computed)(() => _messages.defaultValidateMessages)
  });
};
exports.useInjectForm = useInjectForm;
const FormItemPrefixContextKey = exports.FormItemPrefixContextKey = Symbol('formItemPrefixContextKey');
const useProvideFormItemPrefix = state => {
  (0, _vueDemi.provide)(FormItemPrefixContextKey, state);
};
exports.useProvideFormItemPrefix = useProvideFormItemPrefix;
const useInjectFormItemPrefix = () => {
  return (0, _vueDemi.inject)(FormItemPrefixContextKey, {
    prefixCls: (0, _vueDemi.computed)(() => '')
  });
};
exports.useInjectFormItemPrefix = useInjectFormItemPrefix;