import { F as m } from "./index-fe29d0c3.mjs";
import { b, a as d, p as a, c as h, d as f, B as x } from "./echartsUtil-835eaf3b.mjs";
import { computed as i, unref as o } from "vue";
function g(e, t) {
  const l = {};
  return p(l, e, "title", ["text", "subtext", "left", "top"]), p(l, e, "legend", ["icon", "formatter", "orient", "left", "top"]), p(l, e, "grid", ["show", "left", "top", "right", "bottom"]), p(l, e, "tooltip", ["trigger", "formatter"]), p(l, e, "xAxis", ["name", "inverse", "type"], !0), u(l, e, "xAxis", ["show", "formatter"], "axisLabel"), p(l, e, "yAxis", ["name", "inverse", "type"], !0), u(l, e, "yAxis", ["show", "formatter"], "axisLabel"), w(l, e), b(l, e), d(l, e, t), l;
}
function w(e, t) {
  const l = [];
  e.series = l;
  const n = t.series || [];
  if (!t.series || n.length <= 0) {
    l.push({ type: "pie" });
    return;
  }
  for (const s of n) {
    const r = y(s);
    r && l.push(r);
  }
}
function y(e) {
  if (e["series-config"] == "customize") {
    const t = e["series-customize-option"];
    return t ? m(t) : void 0;
  } else if (e["series-config"] == "ui")
    return A(e);
}
function A(e) {
  const t = {};
  a(t, e, "series", ["type", "name", "stack"]);
  const l = e["series-type"];
  return l == "line" ? a(t, e, "series", ["smooth"]) : l == "bar" ? a(t, e, "series", ["barWidth", "barGap"]) : l == "pie" && (a(t, e, "series", ["roseType"]), e["series-radius"] && (t.radius = h(e["series-radius"])), e["series-itemStyle-borderRadius"] && (t.itemStyle = {}, t.itemStyle.borderRadius = e["series-itemStyle-borderRadius"])), t;
}
function p(e, t, l, n, s = !1) {
  if (t[l + "-config"] == "ui") {
    const r = {};
    e[l] = r, a(r, t, l, n);
  } else
    t[l + "-config"] == "customize" && z(e, t, l, s);
}
function u(e, t, l, n, s) {
  if (t[l + "-config"] != "ui")
    return;
  const r = {};
  e[l][s] = r;
  for (const c of n)
    f(r, t, l + "-" + s + "-" + c, c);
}
function z(e, t, l, n) {
  let s = t[l + "-customize-option"];
  if (!s)
    if (n)
      s = "{}";
    else
      return;
  e[l] = m(s);
}
function S({ config: e, data: t, contextWrap: l }) {
  const n = g(e, t);
  return { "~": "div", "#": {
    "~component": x,
    //props
    option: n,
    // autoresize: true,
    theme: e.theme || "default"
    // style: {
    //   height: config.height || '100%',
    //   width: config.width || '100%'
    // },
    // ...buildDefaultEvents(contextWrap)
  } };
}
const O = {
  key: "_echartsTypical",
  name: "Echarts Typical",
  description: "",
  icon: "mdiChartBarStacked",
  sequence: 1,
  transform: S,
  editor: {
    basic: {
      init: {
        "xAxis-type": "category",
        "yAxis-type": "value"
      },
      ui: function({ config: e }) {
        return [
          //Basic
          {
            "~component": "el-collapse",
            "~label": "Basic config",
            _children: [
              // {
              //   '~component': 'el-input',
              //   '~label': 'Width',
              //   '~prop': 'wdith',
              //   '~default': '640px',
              //   clearable: true
              // },
              // {
              //   '~component': 'el-input',
              //   '~label': 'Height',
              //   '~prop': 'height',
              //   '~default': '480px',
              //   clearable: true
              // },
              {
                "~component": "el-input",
                "~label": "theme",
                "~prop": "theme",
                "~default": "light",
                clearable: !0
              }
            ]
          },
          //Title
          {
            "~component": "el-collapse",
            "~label": "Title config",
            _children: [
              {
                "~component": "el-select",
                "~label": "Title config mode",
                "~prop": "title-config",
                "~default": "ui",
                clearable: !0,
                "~options": ["none", "ui", "customize"]
              },
              {
                "~component": "el-input",
                "~label": "Title customize option",
                "~prop": "title-customize-option",
                type: "textarea",
                rows: 4,
                "~show": i(() => o(e)["title-config"] == "customize")
              },
              {
                "~component": "el-input",
                "~label": "Title text",
                "~prop": "title-text",
                "~show": i(() => o(e)["title-config"] == "ui")
              },
              {
                "~component": "el-input",
                "~label": "Title subtext",
                "~prop": "title-subtext",
                "~show": i(() => o(e)["title-config"] == "ui")
              },
              {
                "~component": "el-input",
                "~label": "Title left",
                "~prop": "title-left",
                "~show": i(() => o(e)["title-config"] == "ui")
              },
              {
                "~component": "el-input",
                "~label": "Title top",
                "~prop": "title-top",
                "~show": i(() => o(e)["title-config"] == "ui")
              }
            ]
          },
          //Legend
          {
            "~component": "el-collapse",
            "~label": "Legend config",
            "~default": "ui",
            _children: [
              {
                "~component": "el-select",
                "~label": "Legend config mode",
                "~prop": "legend-config",
                clearable: !0,
                "~options": ["none", "ui", "customize"]
              },
              {
                "~component": "el-input",
                "~label": "Legend customize option",
                "~prop": "legend-customize-option",
                type: "textarea",
                rows: 4,
                "~show": i(() => o(e)["legend-config"] == "customize")
              },
              {
                "~component": "el-select",
                "~label": "Legend icon",
                "~prop": "legend-icon",
                clearable: !0,
                "~options": [
                  "circle",
                  "rect",
                  "roundRect",
                  "triangle",
                  "diamond",
                  "pin",
                  "arrow",
                  "none"
                ],
                "~show": i(() => o(e)["legend-config"] == "ui")
              },
              {
                "~component": "el-input",
                "~label": "Legend formatter",
                "~prop": "legend-formatter",
                "~show": i(() => o(e)["legend-config"] == "ui")
              },
              {
                "~component": "el-select",
                "~label": "Legend orient",
                "~prop": "legend-orient",
                "~options": ["horizontal", "vertical"],
                "~show": i(() => o(e)["legend-config"] == "ui")
              },
              {
                "~component": "el-input",
                "~label": "Legend left",
                "~prop": "legend-left",
                "~show": i(() => o(e)["legend-config"] == "ui")
              },
              {
                "~component": "el-input",
                "~label": "Legend top",
                "~prop": "legend-top",
                "~show": i(() => o(e)["legend-config"] == "ui")
              }
            ]
          },
          //Grid
          {
            "~component": "el-collapse",
            "~label": "Grid config",
            _children: [
              {
                "~component": "el-select",
                "~label": "Grid config mode",
                "~prop": "grid-config",
                "~default": "ui",
                clearable: !0,
                "~options": ["none", "ui", "customize"]
              },
              {
                "~component": "el-input",
                "~label": "Grid customize option",
                "~prop": "grid-customize-option",
                type: "textarea",
                rows: 4,
                "~show": i(() => o(e)["grid-config"] == "customize")
              },
              {
                "~component": "el-switch",
                "~label": "Grid show",
                "~prop": "grid-show",
                "~show": i(() => o(e)["grid-config"] == "ui")
              },
              {
                "~component": "el-input",
                "~label": "Grid left",
                "~prop": "grid-left",
                "~show": i(() => o(e)["grid-config"] == "ui")
              },
              {
                "~component": "el-input",
                "~label": "Grid top",
                "~prop": "grid-top",
                "~show": i(() => o(e)["grid-config"] == "ui")
              },
              {
                "~component": "el-input",
                "~label": "Grid right",
                "~prop": "grid-right",
                "~show": i(() => o(e)["grid-config"] == "ui")
              },
              {
                "~component": "el-input",
                "~label": "Grid bottom",
                "~prop": "grid-bottom",
                "~show": i(() => o(e)["grid-config"] == "ui")
              }
            ]
          },
          //Tooltip
          {
            "~component": "el-collapse",
            "~label": "Tooltip config",
            _children: [
              {
                "~component": "el-select",
                "~label": "Tooltip config mode",
                "~prop": "tooltip-config",
                "~default": "ui",
                clearable: !0,
                "~options": ["none", "ui", "customize"]
              },
              {
                "~component": "el-input",
                "~label": "Tooltip customize option",
                "~prop": "tooltip-customize-option",
                type: "textarea",
                rows: 4,
                "~show": i(() => o(e)["tooltip-config"] == "customize")
              },
              {
                "~component": "el-select",
                "~label": "Tooltip trigger",
                "~prop": "tooltip-trigger",
                clearable: !0,
                "~options": ["item", "axis", "none"],
                "~show": i(() => o(e)["tooltip-config"] == "ui")
              },
              {
                "~component": "el-input",
                "~label": "Tooltip formatter",
                "~prop": "tooltip-formatter",
                "~show": i(() => o(e)["tooltip-config"] == "ui")
              }
            ]
          },
          //XAxis
          {
            "~component": "el-collapse",
            "~label": "XAxis config",
            _children: [
              {
                "~component": "el-select",
                "~label": "XAxis config mode",
                "~prop": "xAxis-config",
                "~default": "ui",
                clearable: !0,
                "~options": ["none", "ui", "customize"]
              },
              {
                "~component": "el-input",
                "~label": "XAxis customize option",
                "~prop": "xAxis-customize-option",
                type: "textarea",
                rows: 4,
                "~show": i(() => o(e)["xAxis-config"] == "customize")
              },
              {
                "~component": "el-select",
                "~label": "XAxis type",
                "~prop": "xAxis-type",
                "~default": "category",
                clearable: !0,
                "~options": ["category", "value", "time", "log"],
                "~show": i(() => o(e)["xAxis-config"] == "ui")
              },
              {
                "~component": "el-input",
                "~label": "XAxis name",
                "~prop": "xAxis-name",
                clearable: !0,
                "~show": i(() => o(e)["xAxis-config"] == "ui")
              },
              {
                "~component": "el-switch",
                "~label": "XAxis inverse",
                "~prop": "xAxis-inverse",
                "~show": i(() => o(e)["xAxis-config"] == "ui")
              },
              {
                "~component": "el-switch",
                "~label": "XAxis label show",
                "~prop": "xAxis-axisLabel-show",
                "~show": i(() => o(e)["xAxis-config"] == "ui")
              },
              {
                "~component": "el-input",
                "~label": "XAxis label formatter",
                "~prop": "xAxis-axisLabel-formatter",
                "~show": i(() => o(e)["xAxis-config"] == "ui")
              }
            ]
          },
          //YAxis
          {
            "~component": "el-collapse",
            "~label": "YAxis config",
            _children: [
              {
                "~component": "el-select",
                "~label": "YAxis config mode",
                "~prop": "yAxis-config",
                "~default": "ui",
                clearable: !0,
                "~options": ["none", "ui", "customize"]
              },
              {
                "~component": "el-input",
                "~label": "YAxis customize option",
                "~prop": "yAxis-customize-option",
                type: "textarea",
                rows: 4,
                "~show": i(() => o(e)["yAxis-config"] == "customize")
              },
              {
                "~component": "el-select",
                "~label": "YAxis type",
                "~prop": "yAxis-type",
                "~default": "value",
                clearable: !0,
                "~options": ["category", "value", "time", "log"],
                "~show": i(() => o(e)["yAxis-config"] == "ui")
              },
              {
                "~component": "el-input",
                "~label": "YAxis name",
                "~prop": "yAxis-name",
                clearable: !0,
                "~show": i(() => o(e)["yAxis-config"] == "ui")
              },
              {
                "~component": "el-switch",
                "~label": "YAxis inverse",
                "~prop": "yAxis-inverse",
                "~show": i(() => o(e)["yAxis-config"] == "ui")
              },
              {
                "~component": "el-switch",
                "~label": "YAxis label show",
                "~prop": "yAxis-axisLabel-show",
                "~show": i(() => o(e)["yAxis-config"] == "ui")
              },
              {
                "~component": "el-input",
                "~label": "YAxis label formatter",
                "~prop": "yAxis-axisLabel-formatter",
                "~show": i(() => o(e)["yAxis-config"] == "ui")
              }
            ]
          },
          //series
          {
            "~component": "lc-editable-list",
            "~label": "Series",
            "~prop": "series",
            labelColumn: "series-name",
            editConfig: function(t) {
              return [
                {
                  "~component": "el-select",
                  "~label": "Series config mode",
                  "~prop": "series-config",
                  "~default": "ui",
                  clearable: !0,
                  "~options": ["ui", "customize"]
                },
                {
                  "~component": "el-input",
                  "~label": "Series customize option",
                  "~prop": "series-customize-option",
                  type: "textarea",
                  rows: 4,
                  "~show": i(() => o(t)["series-config"] == "customize")
                },
                {
                  "~component": "el-select",
                  "~label": "Series type",
                  "~prop": "series-type",
                  clearable: !0,
                  "~options": ["line", "bar", "pie"],
                  "~show": i(() => o(t)["series-config"] == "ui")
                },
                {
                  "~component": "el-input",
                  "~label": "Series name",
                  "~prop": "series-name",
                  clearable: !0,
                  "~show": i(() => o(t)["series-config"] == "ui")
                },
                {
                  "~component": "el-input",
                  "~label": "Series stack",
                  "~prop": "series-stack",
                  "~show": i(() => o(t)["series-config"] == "ui")
                },
                {
                  "~component": "el-switch",
                  "~label": "Series label show",
                  "~prop": "series-label-show",
                  "~show": i(() => o(t)["series-config"] == "ui")
                },
                {
                  "~component": "el-input",
                  "~label": "Series label formatter",
                  "~prop": "series-label-formatter",
                  "~show": i(() => o(t)["series-config"] == "ui")
                },
                //line
                {
                  "~component": "el-switch",
                  "~label": "Series smooth",
                  "~prop": "series-smooth",
                  "~show": i(
                    () => o(t)["series-config"] == "ui" && o(t)["series-type"] == "line"
                  )
                },
                //bar
                {
                  "~component": "el-input",
                  "~label": "Bar width",
                  "~prop": "series-barWidth",
                  "~show": i(
                    () => o(t)["series-config"] == "ui" && o(t)["series-type"] == "bar"
                  )
                },
                {
                  "~component": "el-input",
                  "~label": "Bar gap",
                  "~prop": "series-barGap",
                  "~show": i(
                    () => o(t)["series-config"] == "ui" && o(t)["series-type"] == "bar"
                  )
                },
                //pie
                {
                  "~component": "el-select",
                  "~label": "Pie rose type",
                  "~prop": "series-roseType",
                  clearable: !0,
                  "~options": ["radius", "area"],
                  "~show": i(
                    () => o(t)["series-config"] == "ui" && o(t)["series-type"] == "pie"
                  )
                },
                {
                  "~component": "el-input",
                  "~label": "Pie radius",
                  "~prop": "series-radius",
                  clearable: !0,
                  "~show": i(
                    () => o(t)["series-config"] == "ui" && o(t)["series-type"] == "pie"
                  )
                },
                {
                  "~component": "el-input",
                  "~label": "Pie border radius",
                  "~prop": "series-itemStyle-borderRadius",
                  clearable: !0,
                  "~show": i(
                    () => o(t)["series-config"] == "ui" && o(t)["series-type"] == "pie"
                  )
                }
              ];
            }
          },
          //
          //Other options
          {
            "~component": "el-collapse",
            "~label": "Other option",
            _children: [
              {
                "~component": "el-input",
                "~label": "",
                //Use the collapse label instead
                "~prop": "optionOther",
                type: "textarea",
                rows: 4
              }
            ]
          }
        ];
      }
    },
    data: {
      //readonly:true,
      type: "Array",
      init: {
        mode: "fixed",
        dataContent: `[
        ["product", "2015", "2016", "2017"],
        ["Milk", 43.3, 85.8, 93.7],
        ["Computer", 83.1, 73.4, 55.1],
        ["TV", 86.4, 65.2, 82.5],
        ["Mobie", 72.4, 53.9, 39.1]
      ]`
      }
    },
    display: {
      init: { style: { width: "100%", height: "480px" } }
    }
  }
};
export {
  O as default
};
//# sourceMappingURL=index-12ae516e.mjs.map
