import { defineComponent, resolveComponent, createElementBlock, openBlock, normalizeClass, unref, createCommentVNode, createVNode, createElementVNode, toDisplayString, withCtx, createTextVNode, Fragment, renderList, createBlock } from 'vue';
import './json-xml-table-row.vue.mjs';
import '../../../../utils/index.mjs';
import '../config/index.mjs';
import { createNamespace } from '../../../../utils/create-namespace.mjs';
import _sfc_main$1 from './json-xml-table-row.vue2.mjs';
import { jsonXmlTableEmits, jsonXmlTableProps } from '../config/json-xml.mjs';

"use strict";
var _sfc_main = /* @__PURE__ */ defineComponent({
  ...{ name: "LlJsonXmlTable" },
  __name: "json-xml-table",
  props: jsonXmlTableProps,
  emits: jsonXmlTableEmits,
  setup(__props, { emit: __emit }) {
    const bem = createNamespace("json-xml");
    const props = __props;
    const emits = __emit;
    const handleChange = (child) => {
      emits("change", [child]);
    };
    return (_ctx, _cache) => {
      const _component_a_col = resolveComponent("a-col");
      const _component_a_row = resolveComponent("a-row");
      return openBlock(), createElementBlock(
        "div",
        {
          class: normalizeClass(unref(bem).e("table"))
        },
        [
          props.type === "xml" ? (openBlock(), createElementBlock(
            "div",
            {
              key: 0,
              class: normalizeClass(unref(bem).m("xml"))
            },
            toDisplayString('<?xml version="1.0" encoding="UTF-8"?>'),
            2
            /* CLASS */
          )) : createCommentVNode("v-if", true),
          createVNode(_component_a_row, {
            class: normalizeClass(unref(bem).m("table-header")),
            gutter: 20
          }, {
            default: withCtx(() => [
              createVNode(_component_a_col, {
                span: 7,
                style: { "padding-left": "60px" }
              }, {
                default: withCtx(() => [..._cache[0] || (_cache[0] = [
                  createTextVNode(
                    " \u540D\u79F0 ",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }),
              createVNode(_component_a_col, { span: 3 }, {
                default: withCtx(() => [..._cache[1] || (_cache[1] = [
                  createTextVNode(
                    " \u7C7B\u578B ",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }),
              createVNode(_component_a_col, { span: 4 }, {
                default: withCtx(() => [..._cache[2] || (_cache[2] = [
                  createTextVNode(
                    " Mock ",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }),
              createVNode(_component_a_col, { span: 4 }, {
                default: withCtx(() => [..._cache[3] || (_cache[3] = [
                  createTextVNode(
                    " \u4E2D\u6587\u540D ",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }),
              createVNode(_component_a_col, { span: 4 }, {
                default: withCtx(() => [..._cache[4] || (_cache[4] = [
                  createTextVNode(
                    " \u8BF4\u660E ",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }),
              createVNode(_component_a_col, { span: 2 }, {
                default: withCtx(() => [..._cache[5] || (_cache[5] = [
                  createTextVNode(
                    " \u64CD\u4F5C ",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              })
            ]),
            _: 1
            /* STABLE */
          }, 8, ["class"]),
          createElementVNode(
            "div",
            {
              class: normalizeClass(unref(bem).m("table-body"))
            },
            [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(props.dataSource, (item, index) => {
                  return openBlock(), createBlock(_sfc_main$1, {
                    key: index,
                    list: props.dataSource,
                    data: item,
                    "tree-key": (index + 1).toString(),
                    onChange: handleChange
                  }, null, 8, ["list", "data", "tree-key"]);
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ],
            2
            /* CLASS */
          )
        ],
        2
        /* CLASS */
      );
    };
  }
});

export { _sfc_main as default };
//# sourceMappingURL=json-xml-table.vue2.mjs.map
