'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
require('../context/index.cjs');
var renderEmpty = require('../renderEmpty.cjs');
var sizeContext = require('../context/sizeContext.cjs');
var disabledContext = require('../context/disabledContext.cjs');
var context = require('../context/context.cjs');

const configProviderKey = Symbol("configProvider");
var useConfigInject = (name, props) => {
  const sizeContext$1 = sizeContext.useInjectSize();
  const disabledContext$1 = disabledContext.useInjectDisabled();
  const configProvider = vue.inject(configProviderKey, {
    ...context.defaultConfigProvider,
    renderEmpty: (n) => vue.h(renderEmpty.DefaultRenderEmpty, { componentName: n, prefixCls: props.prefixCls })
  });
  const prefixCls = vue.computed(() => configProvider.getPrefixCls(name, props.prefixCls));
  const customizePrefixCls = vue.computed(() => props.customizePrefixCls);
  const direction = vue.computed(() => {
    var _a, _b;
    return (_b = props.direction) != null ? _b : (_a = configProvider.direction) == null ? void 0 : _a.value;
  });
  const iconPrefixCls = vue.computed(() => {
    var _a;
    return (_a = props.iconPrefixCls) != null ? _a : configProvider.iconPrefixCls.value;
  });
  const rootPrefixCls = vue.computed(() => configProvider.getPrefixCls());
  const autoInsertSpaceInButton = vue.computed(() => {
    var _a;
    return (_a = configProvider.autoInsertSpaceInButton) == null ? void 0 : _a.value;
  });
  const renderEmpty$1 = configProvider.renderEmpty;
  const space = configProvider.space;
  const pageHeader = configProvider.pageHeader;
  const form = configProvider.form;
  const getTargetContainer = vue.computed(
    () => {
      var _a, _b;
      return (_b = props.getTargetContainer) != null ? _b : (_a = configProvider.getTargetContainer) == null ? void 0 : _a.value;
    }
  );
  const getPopupContainer = vue.computed(
    () => {
      var _a, _b, _c;
      return (_c = (_a = props.getContainer) != null ? _a : props.getPopupContainer) != null ? _c : (_b = configProvider.getPopupContainer) == null ? void 0 : _b.value;
    }
  );
  const dropdownMatchSelectWidth = vue.computed(
    () => {
      var _a, _b;
      return (_b = props.dropdownMatchSelectWidth) != null ? _b : (_a = configProvider.dropdownMatchSelectWidth) == null ? void 0 : _a.value;
    }
  );
  const virtual = vue.computed(
    () => {
      var _a;
      return (props.virtual === void 0 ? ((_a = configProvider.virtual) == null ? void 0 : _a.value) !== false : props.virtual !== false) && dropdownMatchSelectWidth.value !== false;
    }
  );
  const size = vue.computed(() => props.size || sizeContext$1.value);
  const autocomplete = vue.computed(
    () => {
      var _a, _b, _c;
      return (_c = props.autocomplete) != null ? _c : (_b = (_a = configProvider.input) == null ? void 0 : _a.value) == null ? void 0 : _b.autocomplete;
    }
  );
  const disabled = vue.computed(() => {
    var _a;
    return (_a = props.disabled) != null ? _a : disabledContext$1.value;
  });
  const csp = vue.computed(() => {
    var _a;
    return (_a = props.csp) != null ? _a : configProvider.csp;
  });
  const wave = vue.computed(() => {
    var _a, _b;
    return (_b = props.wave) != null ? _b : (_a = configProvider == null ? void 0 : configProvider.wave) == null ? void 0 : _a.value;
  });
  return {
    configProvider,
    prefixCls,
    customizePrefixCls,
    direction,
    size,
    getTargetContainer,
    getPopupContainer,
    space,
    pageHeader,
    form,
    autoInsertSpaceInButton,
    renderEmpty: renderEmpty$1,
    virtual,
    dropdownMatchSelectWidth,
    rootPrefixCls,
    getPrefixCls: configProvider.getPrefixCls,
    autocomplete,
    csp,
    iconPrefixCls,
    disabled,
    select: configProvider.select,
    wave
  };
};

exports.configProviderKey = configProviderKey;
exports.default = useConfigInject;
//# sourceMappingURL=useConfigInject.cjs.map
