/**
 * ldesign v0.2.14
 * (c) 2022/11/2 16:16 built by swimly
 * @license MIT
 */

import Vue from 'vue';
import cloneDeep from 'lodash/cloneDeep';
import { defaultGlobalConfig, mergeWith } from './context.js';
import 'lodash';
import '../../chunks/zh_CN.js';
import './type.js';

const ConfigProvider = Vue.extend({
  name: "ConfigProvider",
  provide() {
    return {
      globalConfig: this.mergedGlobalConfig
    };
  },
  props: {
    globalConfig: Object
  },
  data() {
    return {
      defaultData: cloneDeep(defaultGlobalConfig)
    };
  },
  computed: {
    mergedGlobalConfig() {
      const mergedGlobalConfig = mergeWith(this.defaultData, this.globalConfig);
      return mergedGlobalConfig;
    }
  },
  render() {
    const h = arguments[0];
    if (this.$slots.default.length === 1) return this.$slots.default[0];
    return h("div", [this.$slots.default]);
  }
});

export { ConfigProvider as default };
//# sourceMappingURL=config-provider.js.map
