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