import { computed, inject } from 'vue';
import { defaultConfigProvider } from '../../config-provider';
export default (function (name, props) {
  var configProvider = inject('configProvider', defaultConfigProvider);
  var prefixCls = computed(function () {
    return configProvider.getPrefixCls(name, props.prefixCls);
  });
  var direction = computed(function () {
    var _props$direction;

    return (_props$direction = props.direction) !== null && _props$direction !== void 0 ? _props$direction : configProvider.direction;
  });
  var rootPrefixCls = computed(function () {
    return configProvider.getPrefixCls();
  });
  var autoInsertSpaceInButton = computed(function () {
    return configProvider.autoInsertSpaceInButton;
  });
  var renderEmpty = computed(function () {
    return configProvider.renderEmpty;
  });
  var space = computed(function () {
    return configProvider.space;
  });
  var pageHeader = computed(function () {
    return configProvider.pageHeader;
  });
  var form = computed(function () {
    return configProvider.form;
  });
  var getTargetContainer = computed(function () {
    return props.getTargetContainer || configProvider.getTargetContainer;
  });
  var getPopupContainer = computed(function () {
    return props.getPopupContainer || configProvider.getPopupContainer;
  });
  var virtual = computed(function () {
    var _props$virtual;

    return (_props$virtual = props.virtual) !== null && _props$virtual !== void 0 ? _props$virtual : configProvider.virtual;
  });
  var dropdownMatchSelectWidth = computed(function () {
    var _props$dropdownMatchS;

    return (_props$dropdownMatchS = props.dropdownMatchSelectWidth) !== null && _props$dropdownMatchS !== void 0 ? _props$dropdownMatchS : configProvider.dropdownMatchSelectWidth;
  });
  var size = computed(function () {
    return props.size || configProvider.componentSize;
  });
  return {
    configProvider: configProvider,
    prefixCls: prefixCls,
    direction: direction,
    size: size,
    getTargetContainer: getTargetContainer,
    getPopupContainer: getPopupContainer,
    space: space,
    pageHeader: pageHeader,
    form: form,
    autoInsertSpaceInButton: autoInsertSpaceInButton,
    renderEmpty: renderEmpty,
    virtual: virtual,
    dropdownMatchSelectWidth: dropdownMatchSelectWidth,
    rootPrefixCls: rootPrefixCls
  };
});