import { computed as d, unref as s } from "vue";
import { n as i, o as c, j as r, h as l, i as o } from "./index-16cc6938.mjs";
function m(e, a, t) {
  const n = i("el-table", e);
  return n.data = a, n["#"] = u(e, t), n;
}
function u(e, a) {
  const t = [];
  for (const n of e._container || [])
    t.push(p(n, a));
  return t;
}
function p(e, a) {
  const t = i("el-table-column", e);
  return !e.type && e._formatter ? t.formatter = function() {
    return a.methodManager.methodCall({ method: e._formatter }, void 0, ...arguments);
  } : e.type == "container" && (t["#"] = c(e)), t;
}
const y = {
  key: "_table",
  name: "Table",
  description: "Basic table",
  icon: "mdiTable",
  sequence: 14,
  transform: m,
  editor: {
    basic: {
      ui: [
        r("stripe"),
        r("border"),
        l("empty-text"),
        {
          "~component": "lc-editable-list",
          "~label": "Columns",
          "~prop": "_container",
          labelColumn: "label",
          editConfig: function(e) {
            return [
              l("label"),
              l("prop"),
              l("width"),
              o("align", ["left", "center", "right"]),
              o("type", ["selection", "index", "container"]),
              o("_formatter", "#method", void 0, {
                "~show": d(() => !s(e).type)
              })
            ];
          }
        }
      ],
      init: {
        border: !0,
        "empty-text": "No data is found!",
        _container: [
          {
            type: "selection"
          },
          {
            type: "index",
            label: "#"
          },
          {
            prop: "date",
            label: "Date"
          },
          {
            prop: "name",
            label: "Name"
          },
          {
            prop: "address",
            label: "Address"
          }
        ]
      }
    },
    event: {
      list: ["row-click", "row-dblclick", "cell-click", "cell-dblclick", "select"]
    },
    data: {
      modelValueName: "data",
      //readonly:true,
      type: "Array",
      init: {
        mode: "fixed",
        dataContent: `[{"date":"2023-12-23","name":"Tom","address":"Who know it?"},
{"date":"2023-01-02","name":"Jack","address":"May be in the city?"},
{"date":"2021-11-12","name":"Alice","address":"In castle?"}
]`
      }
    },
    display: {
      init: {
        style: {
          display: "block",
          width: "100%",
          margin: "4px 0 4px 0"
        }
      }
    }
  }
};
export {
  y as default
};
