"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useProvideGlobalForm = exports.useInjectGlobalForm = exports.useConfigContextProvider = exports.useConfigContextInject = exports.defaultIconPrefixCls = exports.defaultConfigProvider = exports.configProviderProps = exports.configProviderKey = exports.configComponentProps = exports.Variants = exports.GlobalFormContextKey = exports.GlobalConfigContextKey = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _vue = require("vue");
var _type = require("../_util/type");
const Variants = exports.Variants = ['outlined', 'borderless', 'filled', 'underlined'];
const defaultIconPrefixCls = exports.defaultIconPrefixCls = 'anticon';
const GlobalFormContextKey = exports.GlobalFormContextKey = Symbol('GlobalFormContextKey');
const useProvideGlobalForm = state => {
  (0, _vue.provide)(GlobalFormContextKey, state);
};
exports.useProvideGlobalForm = useProvideGlobalForm;
const useInjectGlobalForm = () => {
  return (0, _vue.inject)(GlobalFormContextKey, {
    validateMessages: (0, _vue.computed)(() => undefined)
  });
};
exports.useInjectGlobalForm = useInjectGlobalForm;
const GlobalConfigContextKey = exports.GlobalConfigContextKey = Symbol('GlobalConfigContextKey');
const configComponentProps = () => ({
  input: (0, _type.objectType)(),
  pagination: (0, _type.objectType)(),
  form: (0, _type.objectType)(),
  select: (0, _type.objectType)(),
  cascader: (0, _type.objectType)(),
  datePicker: (0, _type.objectType)(),
  rangePicker: (0, _type.objectType)(),
  treeSelect: (0, _type.objectType)(),
  textArea: (0, _type.objectType)(),
  inputNumber: (0, _type.objectType)(),
  mentions: (0, _type.objectType)(),
  timePicker: (0, _type.objectType)(),
  card: (0, _type.objectType)(),
  table: (0, _type.objectType)(),
  tooltip: (0, _type.objectType)(),
  popover: (0, _type.objectType)(),
  popconfirm: (0, _type.objectType)(),
  modal: (0, _type.objectType)(),
  drawer: (0, _type.objectType)(),
  image: (0, _type.objectType)()
});
exports.configComponentProps = configComponentProps;
const configProviderProps = () => (0, _extends2.default)((0, _extends2.default)({}, configComponentProps()), {
  iconPrefixCls: String,
  getTargetContainer: {
    type: Function
  },
  getPopupContainer: {
    type: Function
  },
  prefixCls: String,
  getPrefixCls: {
    type: Function
  },
  renderEmpty: {
    type: Function
  },
  transformCellText: {
    type: Function
  },
  csp: (0, _type.objectType)(),
  autoInsertSpaceInButton: {
    type: Boolean,
    default: undefined
  },
  locale: (0, _type.objectType)(),
  pageHeader: (0, _type.objectType)(),
  componentSize: {
    type: String
  },
  componentDisabled: {
    type: Boolean,
    default: undefined
  },
  direction: {
    type: String,
    default: 'ltr'
  },
  space: (0, _type.objectType)(),
  virtual: {
    type: Boolean,
    default: undefined
  },
  variant: {
    type: String
  },
  dropdownMatchSelectWidth: {
    type: [Number, Boolean],
    default: true
  },
  theme: (0, _type.objectType)(),
  wave: (0, _type.objectType)()
});
exports.configProviderProps = configProviderProps;
const configProviderKey = exports.configProviderKey = Symbol('configProvider');
const defaultConfigProvider = exports.defaultConfigProvider = {
  getPrefixCls: (suffixCls, customizePrefixCls) => {
    if (customizePrefixCls) return customizePrefixCls;
    return suffixCls ? `ant-${suffixCls}` : 'ant';
  },
  iconPrefixCls: (0, _vue.computed)(() => defaultIconPrefixCls),
  getPopupContainer: (0, _vue.computed)(() => () => document.body),
  direction: (0, _vue.computed)(() => 'ltr')
};
const useConfigContextInject = () => {
  return (0, _vue.inject)(configProviderKey, defaultConfigProvider);
};
exports.useConfigContextInject = useConfigContextInject;
const useConfigContextProvider = props => {
  return (0, _vue.provide)(configProviderKey, props);
};
exports.useConfigContextProvider = useConfigContextProvider;