import { computed as b, unref as c } from "vue";
import { D as u, z as s, n as e, B as m, x as o, w as r, c as i } from "./index-e250a75e.mjs";
function d({ config: t, data: n, context: l }) {
  const a = u("el-table", { config: t });
  return a.data = n, a["#"] = _(t, l), a;
}
function _(t, n) {
  const l = [];
  for (const a of t._container || [])
    l.push(p(a, n));
  return l;
}
function p(t, n) {
  const l = u("el-table-column", { config: t });
  return !t.type && t._formatter ? l.formatter = function() {
    return n.methodManager.methodCall({ method: t._formatter }, void 0, ...arguments);
  } : t.type == "container" && (l["#"] = s(t)), l;
}
const I = {
  key: "_table",
  name: e("_.builtIn.element.table.name"),
  description: "",
  icon: "mdiTable",
  sequence: 14,
  transform: d,
  editor: {
    basic: {
      ui: [
        m("stripe", e("_.builtIn.element.table.stripe")),
        m("border", e("_.builtIn.element.table.border")),
        o("empty-text", e("_.builtIn.element.table.empty-text")),
        {
          "~component": "lc-editable-list",
          "~label": e("_.builtIn.element.table.columns"),
          "~prop": "_container",
          labelColumn: "label",
          editConfig: function(t) {
            return [
              o("label", e("_.builtIn.element.table.columns_label")),
              o("prop", e("_.builtIn.element.table.columns_prop")),
              o("width", e("_.builtIn.element.table.columns_width")),
              r(
                "align",
                [
                  { value: "left", label: e("_.builtIn.element.table.columns_align_left") },
                  { value: "center", label: e("_.builtIn.element.table.columns_align_center") },
                  { value: "right", label: e("_.builtIn.element.table.columns_align_right") }
                ],
                e("_.builtIn.element.table.columns_align")
              ),
              r(
                "type",
                [
                  {
                    value: "selection",
                    label: e("_.builtIn.element.table.columns_type_selection")
                  },
                  { value: "index", label: e("_.builtIn.element.table.columns_type_index") },
                  { value: "container", label: e("_.builtIn.element.table.columns_type_container") }
                ],
                e("_.builtIn.element.table.columns_type")
              ),
              r(
                "_formatter",
                "#method",
                e("_.builtIn.element.table.columns_formatter"),
                {
                  "~show": b(() => !c(t).type),
                  "~description": e("_.builtIn.element.table.columns_formatter_description")
                }
              )
            ];
          }
        }
      ],
      init: {
        border: !0,
        "empty-text": "No data is found!",
        _container: [
          {
            type: "selection",
            key: i()
          },
          {
            type: "index",
            label: "#",
            key: i()
          },
          {
            prop: "date",
            label: "Date",
            key: i()
          },
          {
            prop: "name",
            label: "Name",
            key: i()
          },
          {
            prop: "address",
            label: "Address",
            key: i()
          }
        ]
      }
    },
    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 {
  I as default
};
