import { defineComponent, toRefs, computed, openBlock, createElementBlock, Fragment, renderList, unref, normalizeClass, createElementVNode, normalizeStyle, createVNode, withCtx, createTextVNode, toDisplayString } from "vue";
import _sfc_main$1 from "../../../NComponents/configCommon/refConfig.mjs";
import "./index.vue_vue_type_style_index_0_scoped_true_lang.mjs";
import _export_sfc from "../../../../_virtual/plugin-vue_export-helper.mjs";
const _hoisted_1 = { class: "btns" };
const _hoisted_2 = ["onClick"];
const __default__ = defineComponent({ name: "ESwitchComponent01" });
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: {
    chartConfig: {
      type: Object,
      required: true
    }
  },
  setup(__props) {
    const props = __props;
    const { dataset, active, bgImageConfig, titleConfig, spaceBetween } = toRefs(props.chartConfig.option);
    let style = computed(() => {
      return {
        margin: `0 ${spaceBetween.value}px`
      };
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        (openBlock(true), createElementBlock(Fragment, null, renderList(unref(dataset), (item, index) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass({ active: unref(active) == index }),
            key: index
          }, [
            createElementVNode("div", {
              onClick: ($event) => active.value = index,
              style: normalizeStyle({ ...unref(style) })
            }, [
              createVNode(_sfc_main$1, {
                config: unref(bgImageConfig),
                type: "bgImg",
                class: "allcenter",
                showImg: unref(active) == index
              }, {
                default: withCtx(() => [
                  createVNode(_sfc_main$1, {
                    config: unref(titleConfig),
                    type: "text"
                  }, {
                    text: withCtx(() => [
                      createTextVNode(toDisplayString(item.label), 1)
                    ]),
                    _: 2
                  }, 1032, ["config"])
                ]),
                _: 2
              }, 1032, ["config", "showImg"])
            ], 12, _hoisted_2)
          ], 2);
        }), 128))
      ]);
    };
  }
});
var _ESwitchComponent01 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-58a9e355"]]);
export { _ESwitchComponent01 as default };
