import { defineComponent as ce, computed as B, resolveDirective as bt, openBlock as u, createElementBlock as g, normalizeClass as R, createElementVNode as I, renderSlot as D, withDirectives as Le, createCommentVNode as k, ref as O, normalizeStyle as _, createBlock as se, Fragment as Z, renderList as H, withCtx as M, toDisplayString as me, createTextVNode as Ne, unref as et, createVNode as Q, useSlots as Kt, reactive as oe, watch as Te, nextTick as Y, onMounted as qt, onBeforeUnmount as jt, resolveComponent as Qe, createSlots as ve, vShow as xt, mergeProps as St, toRaw as zt } from "vue";
import { C as a } from "../Shared/base-PQGakkrl.js";
import { C as ae } from "../Shared/index-BnerInzC.js";
import { R as Jt } from "../Shared/resize-kOWxHVSP.js";
import { _ as Ct } from "../Shared/One.vue_vue_type_script_setup_true_lang-BuNRS-9u.js";
/* empty css                       */
import { tooltipDirectives as Gt } from "./__directive__/Tooltip.js";
import { _ as It } from "../Shared/Index.vue_vue_type_script_setup_true_lang-Cuv5NgcY.js";
import { u as Qt } from "../Shared/language-DxTlvFs2.js";
const Zt = /* @__PURE__ */ ce({
  name: "ClTableTh",
  __name: "Th",
  props: {
    isOrder: {
      type: Boolean,
      default: !1
    },
    orderSort: {
      type: Array,
      default: () => []
    },
    isUseScrollX: {
      type: Boolean,
      default: !1
    },
    thIndex: {
      type: Number,
      default: 0
    },
    thInfo: {
      type: Object,
      default: () => ({})
    },
    fixedLeftIndex: {
      type: Number,
      default: -1
    },
    fixedRightIndex: {
      type: Number,
      default: -1
    }
  },
  emits: ["onClickOrderBy"],
  setup(t, { emit: v }) {
    const h = t, i = v, C = B(() => {
      const b = {};
      if (a.isEmpty(h.thInfo.width) || (b[`w-${h.thInfo.width}`] = !0), !a.isEmpty(h.thInfo.widthMin) && h.isUseScrollX && (b[`w-min-${h.thInfo.widthMin}`] = !0), h.fixedLeftIndex > -1 && (b["th-hidden"] = h.thIndex > h.fixedLeftIndex), h.fixedRightIndex > -1 && (b["th-hidden"] = h.thIndex < h.fixedRightIndex), h.isOrder) {
        const x = h.orderSort;
        if ((a.isBoolean(h.thInfo.sort) ? h.thInfo.sort : !0) && (b["th-sort"] = !0, b["sort-none"] = !0, b["th-sort-near"] = a.isBoolean(h.thInfo.sortNear) ? h.thInfo.sortNear : !1, x.length > 0 && x[0] === h.thIndex)) {
          const U = x.length === 2 ? x[1] : "desc";
          b[`sort-${U}`] = !0, b["sort-none"] = !1;
        }
      }
      return a.isEmpty(h.thInfo.tipMsg) || (b["th-tip"] = !0, b["th-tip-sideAlign"] = a.isBoolean(h.thInfo.tipSideAlign) ? h.thInfo.tipSideAlign : !1), a.isEmpty(h.thInfo.textAlign) || a.isExistValue(["left", "center", "right"], h.thInfo.textAlign) && (b[`text-${h.thInfo.textAlign}`] = !0), a.isEmpty(h.thInfo.className) || h.thInfo.className.split(" ").forEach((x) => {
        a.isEmpty(x) || (b[x] = !0);
      }), a.isEmpty(h.thInfo.classTh) || h.thInfo.classTh.split(" ").forEach((x) => {
        a.isEmpty(x) || (b[x] = !0);
      }), b;
    }), K = (b) => {
      const x = {
        "th-tip-icon": !0
      };
      return a.isEmpty(b.tipIcon) ? x["clIconFont clIcon-question-circle"] = !0 : x[b.tipIcon] = !0, x;
    }, j = (b) => {
      i("onClickOrderBy", h.thInfo, h.thIndex, b);
    }, N = () => {
      const b = a.isBoolean(h.thInfo.sort) ? h.thInfo.sort : !0;
      if (h.isOrder && b) {
        const { orderSort: x } = h;
        let c = "desc";
        x.length > 0 && x[0] === h.thIndex && (c = (x.length === 2 ? x[1] : "desc") === "desc" ? "asc" : "desc"), j(c);
      }
    };
    return (b, x) => {
      const c = bt("cltooltip");
      return typeof t.thInfo.visible != "boolean" || t.thInfo.visible ? (u(), g("th", {
        key: 0,
        class: R(C.value)
      }, [
        I("span", {
          class: "th-title",
          onClick: N
        }, [
          D(b.$slots, "default")
        ]),
        t.thInfo.tipMsg && t.thInfo.tipMsg.length > 0 ? Le((u(), g("i", {
          key: 0,
          class: R(K(t.thInfo))
        }, null, 2)), [
          [c, { html: t.thInfo.tipMsg, className: "tooltip-modal" }]
        ]) : k("", !0),
        t.isOrder ? (u(), g("i", {
          key: 1,
          class: "tr-sort-icon clIconFont",
          onClick: N
        })) : k("", !0)
      ], 2)) : k("", !0);
    };
  }
}), tt = /* @__PURE__ */ ce({
  name: "ClTableTd",
  __name: "Td",
  props: {
    tdIndex: {
      type: Number,
      default: 0
    },
    tdInfo: {
      type: Object,
      default: () => ({})
    },
    isOrder: {
      type: Boolean,
      default: !1
    },
    isUseScrollX: {
      type: Boolean,
      default: !1
    },
    fixedLeftIndex: {
      type: Number,
      default: -1
    },
    fixedRightIndex: {
      type: Number,
      default: -1
    },
    useType: {
      type: String,
      default: "td"
      // td|total
    }
  },
  setup(t) {
    const v = t, h = B(() => {
      const i = {};
      return a.isEmpty(v.tdInfo.width) || (i[`w-${v.tdInfo.width}`] = !0), !a.isEmpty(v.tdInfo.widthMin) && v.isUseScrollX && (i[`w-min-${v.tdInfo.widthMin}`] = !0), v.fixedLeftIndex > -1 && (i["td-hidden"] = v.tdIndex > v.fixedLeftIndex), v.fixedRightIndex > -1 && (i["td-hidden"] = v.tdIndex < v.fixedRightIndex), v.isOrder && (!a.isBoolean(v.tdInfo.sort) || v.tdInfo.sort) && (i["td-sort"] = !0, i["td-sort-near"] = a.isBoolean(v.tdInfo.sortNear) ? v.tdInfo.sortNear : !1), a.isEmpty(v.tdInfo.tipMsg) || (i["td-tip"] = !0, i["td-tip-sideAlign"] = a.isBoolean(v.tdInfo.tipSideAlign) ? v.tdInfo.tipSideAlign : !1), a.isEmpty(v.tdInfo.textAlign) || a.isExistValue(["left", "center", "right"], v.tdInfo.textAlign) && (i[`text-${v.tdInfo.textAlign}`] = !0), a.isEmpty(v.tdInfo.className) || v.tdInfo.className.split(" ").forEach((C) => {
        a.isEmpty(C) || (i[C] = !0);
      }), v.useType === "td" ? a.isEmpty(v.tdInfo.classTd) || v.tdInfo.classTd.split(" ").forEach((C) => {
        a.isEmpty(C) || (i[C] = !0);
      }) : v.useType === "total" && (a.isEmpty(v.tdInfo.classTotal) || v.tdInfo.classTotal.split(" ").forEach((C) => {
        a.isEmpty(C) || (i[C] = !0);
      })), i;
    });
    return (i, C) => typeof t.tdInfo.visible != "boolean" || t.tdInfo.visible ? (u(), g("td", {
      key: 0,
      class: R(h.value)
    }, [
      D(i.$slots, "default")
    ], 2)) : k("", !0);
  }
}), _t = { key: 0 }, el = { key: 0 }, Ze = /* @__PURE__ */ ce({
  name: "ClTableHead",
  __name: "Head",
  props: {
    columns: {
      type: Array,
      required: !0,
      default: () => []
    },
    isOrder: {
      type: Boolean,
      default: !1
    },
    orderSort: {
      type: Array,
      default: () => []
    },
    isShowTotal: {
      type: Boolean,
      default: !1
    },
    totalInfo: {
      type: Object,
      default: () => ({})
    },
    keyIndex: String,
    width: {
      type: String,
      default: "none"
    },
    minWidth: {
      type: String,
      default: "none"
    },
    hoverIndex: {
      type: Number,
      default: -1
    },
    isUseScrollX: {
      type: Boolean,
      default: !1
    },
    isShowRadio: {
      type: Boolean,
      default: !1
    },
    isShowCheckbox: {
      type: Boolean,
      default: !1
    },
    isShowCheckboxAll: {
      type: Boolean,
      default: !0
    },
    checkboxAllvalue: {
      type: Boolean,
      default: !1
    },
    fixedType: {
      type: String,
      default: ""
      // left right
    },
    fixedLeftIndex: {
      type: Number,
      default: -1
    },
    fixedRightIndex: {
      type: Number,
      default: -1
    }
  },
  emits: ["onClickAll", "onClickOrderBy", "onHoverIn", "onHoverOut"],
  setup(t, { expose: v, emit: h }) {
    const i = t, C = h, K = O(null), j = O(99999999), N = B(() => {
      const w = {};
      return i.fixedType.length === 0 ? w.minWidth = i.isUseScrollX ? i.minWidth : "none" : w.width = i.width, w;
    }), b = (w) => a.isUndefined(w.title) ? a.isUndefined(w.data) ? "" : w.data : w.title, x = (w, $) => a.isUndefined(w) ? "" : a.isEmpty($.format) ? w : a.getValueByFormat(w, $.format, $.formatExt), c = () => {
      C("onClickAll");
    }, U = (w, $, f) => {
      C("onClickOrderBy", w, $, f);
    }, q = () => {
      C("onHoverIn", j.value);
    }, z = () => {
      C("onHoverOut");
    };
    return v({
      getOffsetHeight: () => K.value.offsetHeight,
      getRcWidth: () => {
        let w = 0;
        return (i.isShowRadio || i.isShowCheckbox) && (w = K.value.querySelector(".th-rc").clientWidth), w;
      },
      getPaddingLr: () => {
        let w = 0;
        const $ = K.value.querySelectorAll("th:not(.th-rc)");
        for (let f = 0; f < $.length; f++) {
          const S = ae.getStyle($[f]), m = Number(S.paddingLeft.replace("px", "")), T = Number(S.paddingRight.replace("px", ""));
          w += m + T;
        }
        return w;
      },
      getElTh: () => K.value.querySelectorAll("th"),
      getTotalHeight: () => {
        let w = 0;
        return i.isShowTotal && (w = K.value.querySelector(".tr-total").clientHeight), w;
      }
    }), (w, $) => (u(), g("table", {
      class: "table table-default",
      style: _(N.value),
      ref_key: "refElTable",
      ref: K
    }, [
      I("thead", null, [
        I("tr", null, [
          t.isShowRadio || t.isShowCheckbox ? (u(), g("th", {
            key: 0,
            class: R({ "th-rc": !0, "th-hidden": t.fixedRightIndex > -1 })
          }, [
            t.isShowCheckbox && t.isShowCheckboxAll ? (u(), se(Ct, {
              key: 0,
              forId: `${t.keyIndex}_${t.fixedType}_cb_all`,
              value: t.checkboxAllvalue,
              onOnChange: c
            }, null, 8, ["forId", "value"])) : k("", !0)
          ], 2)) : k("", !0),
          (u(!0), g(Z, null, H(t.columns, (f, S) => (u(), se(Zt, {
            key: `${t.keyIndex}_${t.fixedType}_head_th_${S}`,
            thInfo: f,
            thIndex: S,
            isOrder: t.isOrder,
            orderSort: t.orderSort,
            isUseScrollX: t.isUseScrollX,
            fixedLeftIndex: t.fixedLeftIndex,
            fixedRightIndex: t.fixedRightIndex,
            onOnClickOrderBy: U
          }, {
            default: M(() => [
              D(w.$slots, `th_${f.data}`, {}, () => [
                I("span", null, me(b(f)), 1)
              ])
            ]),
            _: 2
          }, 1032, ["thInfo", "thIndex", "isOrder", "orderSort", "isUseScrollX", "fixedLeftIndex", "fixedRightIndex"]))), 128))
        ])
      ]),
      t.isShowTotal ? (u(), g("tbody", _t, [
        I("tr", {
          class: R({
            "tr-total": !0,
            "tr-hover": t.hoverIndex === j.value
          }),
          onMouseenter: q,
          onMouseleave: z
        }, [
          t.isShowRadio || t.isShowCheckbox ? (u(), g("td", el)) : k("", !0),
          (u(!0), g(Z, null, H(t.columns, (f, S) => (u(), se(tt, {
            key: `${t.keyIndex}_${t.fixedType}_body_total_td_${S}`,
            isOrder: t.isOrder,
            tdIndex: S,
            tdInfo: f,
            isUseScrollX: t.isUseScrollX,
            fixedLeftIndex: t.fixedLeftIndex,
            fixedRightIndex: t.fixedRightIndex,
            useType: "total"
          }, {
            default: M(() => [
              D(w.$slots, `total_${f.data}`, { data: t.totalInfo }, () => [
                Ne(me(x(t.totalInfo[f.data], f)), 1)
              ])
            ]),
            _: 2
          }, 1032, ["isOrder", "tdIndex", "tdInfo", "isUseScrollX", "fixedLeftIndex", "fixedRightIndex"]))), 128))
        ], 34)
      ])) : k("", !0)
    ], 4));
  }
}), tl = ["id", "name", "checked", "disabled"], ll = ["for"], il = /* @__PURE__ */ ce({
  name: "ClRadioOne",
  directives: {
    cltooltip: Gt
  },
  __name: "One",
  props: {
    className: {},
    forId: {},
    name: {},
    label: {},
    value: { type: Boolean },
    isDisabled: { type: Boolean },
    icon: {},
    tipMsg: {},
    tipIcon: {}
  },
  emits: ["update:value", "onChange"],
  setup(t, { emit: v }) {
    const h = t, i = v, C = a.isEmpty(h.forId) ? `rd_${h.name}_${a.getRandom(8)}` : h.forId, K = B(() => {
      const x = {
        radio: !0,
        "radio-default": !0,
        "radio-inline": !0
      };
      return h.className && !a.isEmpty(h.className) && h.className.split(" ").forEach((c) => {
        a.isEmpty(c) || (x[c] = !0);
      }), x;
    }), j = B(() => {
      const { tipIcon: x } = h, c = {
        "radio-icon-tip": !0
      };
      return !a.isEmpty(x) && x ? c[x] = !0 : c["clIconFont clIcon-question-circle"] = !0, c;
    }), N = (x) => {
      i("update:value", x), i("onChange", x);
    }, b = (x) => {
      const c = x.currentTarget.checked;
      c || N(c);
    };
    return (x, c) => {
      const U = bt("cltooltip");
      return u(), g("div", {
        class: R(K.value)
      }, [
        I("span", null, [
          I("span", null, [
            I("input", {
              type: "radio",
              id: et(C),
              name: t.name,
              checked: t.value,
              disabled: t.isDisabled,
              onClick: b
            }, null, 8, tl),
            I("label", { for: et(C) }, [
              t.icon && t.icon.length > 0 ? Le((u(), g("i", {
                key: 0,
                class: R(t.icon)
              }, null, 2)), [
                [U, { html: t.label, className: "tooltip-modal" }]
              ]) : (u(), g(Z, { key: 1 }, [
                Ne(me(t.label), 1)
              ], 64))
            ], 8, ll)
          ]),
          t.tipMsg && t.tipMsg.length > 0 ? Le((u(), g("i", {
            key: 0,
            class: R(j.value)
          }, null, 2)), [
            [U, { html: t.tipMsg, className: "tooltip-modal" }]
          ]) : k("", !0)
        ])
      ], 2);
    };
  }
}), ol = {
  key: 0,
  class: "th-rc"
}, al = /* @__PURE__ */ ce({
  name: "ClTableTdChecked",
  __name: "TdChecked",
  props: {
    isDisabled: {
      type: Boolean,
      default: !1
    },
    value: {
      type: Boolean,
      default: !1
    },
    isShowRadio: {
      type: Boolean,
      default: !1
    },
    isShowCheckbox: {
      type: Boolean,
      default: !1
    },
    keyIndex: String,
    info: {
      type: Object,
      default: () => ({})
    }
  },
  setup(t) {
    const v = t, h = B(() => {
      let i = !1;
      return v.isDisabled ? i = !0 : i = a.isBoolean(v.info.isDisabled) ? v.info.isDisabled : !1, i;
    });
    return (i, C) => t.isShowRadio || t.isShowCheckbox ? (u(), g("td", ol, [
      t.isShowCheckbox ? (u(), se(Ct, {
        key: 0,
        forId: `${t.keyIndex}_cb`,
        value: t.value,
        disabled: h.value
      }, null, 8, ["forId", "value", "disabled"])) : t.isShowRadio ? (u(), se(il, {
        key: 1,
        forId: `${t.keyIndex}_rd`,
        value: t.value,
        disabled: h.value
      }, null, 8, ["forId", "value", "disabled"])) : k("", !0)
    ])) : k("", !0);
  }
}), sl = ["onClick", "onMouseenter"], nl = ["onMouseenter"], dl = ["colspan"], rl = {
  key: 0,
  class: "panel-elastic-load"
}, cl = { class: "elastic-load-container" }, ul = ["onMouseenter"], hl = ["colspan"], fl = {
  key: 0,
  class: "panel-elastic-load"
}, gl = { class: "elastic-load-container" }, yl = ["onMouseenter"], vl = { key: 1 }, ml = ["colspan"], xl = { class: "panel-table-empty" }, _e = /* @__PURE__ */ ce({
  name: "ClTableBody",
  __name: "Body",
  props: {
    columns: {
      type: Array,
      required: !0,
      default: () => []
    },
    list: {
      type: Array,
      default: () => []
    },
    isDisabled: {
      type: Boolean,
      default: !1
    },
    isOrder: {
      type: Boolean,
      default: !1
    },
    selectValue: {
      type: Array,
      default: () => []
    },
    keyIndex: String,
    width: {
      type: String,
      default: "none"
    },
    minWidth: {
      type: String,
      default: "none"
    },
    hoverIndex: {
      type: Number,
      default: -1
    },
    hoverElasticIndex: {
      type: Number,
      default: -1
    },
    isUseScrollX: {
      type: Boolean,
      default: !1
    },
    colspanCount: {
      type: Number,
      default: 1
    },
    isRunLoading: {
      type: Boolean,
      default: !1
    },
    isShowRadio: {
      type: Boolean,
      default: !1
    },
    isShowCheckbox: {
      type: Boolean,
      default: !1
    },
    isElastic: {
      type: Boolean,
      default: !1
    },
    elasticOpen: {
      type: Array,
      default: () => []
    },
    elasticLoading: {
      type: Array,
      default: () => []
    },
    elasticType: {
      type: String,
      default: "default"
      // default | data
    },
    elasticData: {
      type: Object,
      default: () => ({})
    },
    fixedType: {
      type: String,
      default: ""
      // left right
    },
    fixedLeftIndex: {
      type: Number,
      default: -1
    },
    fixedRightIndex: {
      type: Number,
      default: -1
    },
    trIntervalNum: {
      type: Number,
      default: -1
    },
    emptyText: String
  },
  emits: ["onClickTr", "onHoverIn", "onHoverOut"],
  setup(t, { expose: v, emit: h }) {
    const i = t, C = h, { optPageLanguage: K, getPageLanguage: j } = Qt();
    j("common");
    const N = O(null), b = B(() => ({
      table: !0,
      "table-default": !0,
      "table-empty": i.list.length === 0
    })), x = B(() => {
      const f = {};
      return i.fixedType.length === 0 ? f.minWidth = i.isUseScrollX ? i.minWidth : "none" : f.width = i.width, f;
    }), c = (f, S) => a.isUndefined(f) ? "" : a.isEmpty(S.format) ? f : a.getValueByFormat(f, S.format, S.formatExt), U = (f, S, m) => {
      C("onClickTr", f, S, m);
    }, q = (f, S = -1) => {
      C("onHoverIn", f, S);
    }, z = () => {
      C("onHoverOut");
    };
    return v({
      getWidth: () => N.value.clientWidth,
      getHeight: () => N.value.clientHeight,
      setElasticWidth: () => {
        const f = N.value.querySelectorAll(".panel-elastic-load");
        if (f) {
          const S = N.value.parentNode.clientWidth;
          for (let m = 0; m < f.length; m++)
            f[m].style.width = `${S}px`;
        }
      },
      setElasticHeight: (f) => {
        const S = N.value.querySelector(`.elastic_${f}`);
        if (S) {
          const m = `${S.clientHeight}px`;
          S.style.height = m, S.parentNode.style.height = m, S.className = ae.getAddClass(S.className, "elastic-container-absolute");
        }
      },
      setElasticLoadLeft: (f) => {
        const S = N.value.querySelectorAll(".panel-elastic-load");
        if (S)
          for (let m = 0; m < S.length; m++)
            S[m].style.left = `${f}px`;
      },
      setEmptyWidth: () => {
        const f = N.value.querySelector(".panel-table-empty");
        if (f) {
          const S = N.value.parentNode.clientWidth;
          f.style.width = `${S}px`;
        }
      },
      setEmptyLeft: (f) => {
        const S = N.value.querySelector(".panel-table-empty");
        S && (S.style.left = `${f}px`);
      }
    }), (f, S) => (u(), g("table", {
      class: R(b.value),
      style: _(x.value),
      ref_key: "refElTable",
      ref: N
    }, [
      I("tbody", null, [
        t.list.length > 0 ? (u(!0), g(Z, { key: 0 }, H(t.list, (m, T) => (u(), g(Z, {
          key: `${t.keyIndex}_${t.fixedType}_body_tr_${T}`
        }, [
          I("tr", {
            class: R({
              odd: T % 2 === 0,
              even: T % 2 === 1,
              "tr-customInterval-odd": t.trIntervalNum > 0 && parseInt((T / t.trIntervalNum).toString()) % 2 === 0,
              "tr-customInterval-even": t.trIntervalNum > 0 && parseInt((T / t.trIntervalNum).toString()) % 2 === 1,
              "tr-disabled": m.isDisabled,
              "tr-selected": m.id && t.selectValue.indexOf(m.id.toString()) > -1,
              "tr-hover": t.hoverIndex === T
            }),
            onClick: (E) => U(E, m, T),
            onMouseenter: (E) => q(T),
            onMouseleave: z
          }, [
            t.isShowRadio || t.isShowCheckbox ? (u(), se(al, {
              key: 0,
              keyIndex: `${t.keyIndex}_${t.fixedType}_body_tr_${T}`,
              isShowRadio: t.isShowRadio,
              isShowCheckbox: t.isShowCheckbox,
              value: m.id && t.selectValue.indexOf(m.id.toString()) > -1,
              info: m,
              isDisabled: t.isDisabled
            }, null, 8, ["keyIndex", "isShowRadio", "isShowCheckbox", "value", "info", "isDisabled"])) : k("", !0),
            (u(!0), g(Z, null, H(t.columns, (E, L) => (u(), se(tt, {
              key: `${t.keyIndex}_${t.fixedType}_body_tr_${T}_td_${L}`,
              isOrder: t.isOrder,
              tdIndex: L,
              tdInfo: E,
              isUseScrollX: t.isUseScrollX,
              fixedLeftIndex: t.fixedLeftIndex,
              fixedRightIndex: t.fixedRightIndex
            }, {
              default: M(() => [
                D(f.$slots, `td_${E.data}`, {
                  data: m,
                  trIndex: T
                }, () => [
                  Ne(me(c(m[E.data], E)), 1)
                ])
              ]),
              _: 2
            }, 1032, ["isOrder", "tdIndex", "tdInfo", "isUseScrollX", "fixedLeftIndex", "fixedRightIndex"]))), 128))
          ], 42, sl),
          t.isElastic && m.id && t.elasticOpen.indexOf(m.id.toString()) > -1 ? (u(), g(Z, { key: 0 }, [
            t.elasticType === "default" ? (u(), g("tr", {
              key: 0,
              class: R({ "tr-elastic": !0, "tr-hover": t.hoverIndex === T }),
              onMouseenter: (E) => q(T),
              onMouseleave: z
            }, [
              I("td", {
                colspan: t.colspanCount,
                class: R({ "td-elastic-load": m.id && t.elasticLoading.indexOf(m.id.toString()) > -1 })
              }, [
                m.id && t.elasticLoading.indexOf(m.id.toString()) > -1 ? (u(), g("div", rl, [
                  I("div", cl, [
                    Q(It, { theme: "circleBubble" })
                  ])
                ])) : (u(), g("div", {
                  key: 1,
                  class: R(`elastic-container elastic_${m.id}`)
                }, [
                  D(f.$slots, "tr_elastic_children", { data: m })
                ], 2))
              ], 10, dl)
            ], 42, nl)) : t.elasticType === "sameDataStructure" ? (u(), g(Z, { key: 1 }, [
              m.id && t.elasticLoading.indexOf(m.id.toString()) > -1 ? (u(), g("tr", {
                key: 0,
                class: R({ "tr-elastic": !0, "tr-hover": t.hoverIndex === T }),
                onMouseenter: (E) => q(T),
                onMouseleave: z
              }, [
                I("td", {
                  colspan: t.colspanCount,
                  class: R({ "td-elastic-load": m.id && t.elasticLoading.indexOf(m.id.toString()) > -1 })
                }, [
                  m.id && t.elasticLoading.indexOf(m.id.toString()) > -1 ? (u(), g("div", fl, [
                    I("div", gl, [
                      Q(It, { theme: "circleBubble" })
                    ])
                  ])) : k("", !0)
                ], 10, hl)
              ], 42, ul)) : (u(!0), g(Z, { key: 1 }, H(t.elasticData[m.id.toString()], (E, L) => (u(), g("tr", {
                key: `${t.keyIndex}_${t.fixedType}_body_tr_${T}_elastic_${L}`,
                class: R({
                  "tr-elastic-sameDataStructure": !0,
                  odd: L % 2 === 0,
                  even: L % 2 === 1,
                  "tr-disabled": E.isDisabled,
                  "tr-hover": t.hoverElasticIndex === L && t.hoverIndex === T
                }),
                onMouseenter: (te) => q(T, L),
                onMouseleave: z
              }, [
                (u(!0), g(Z, null, H(t.columns, (te, r) => (u(), se(tt, {
                  key: `${t.keyIndex}_${t.fixedType}_body_tr_${T}_elastic_${L}_td_${r}`,
                  isOrder: t.isOrder,
                  tdIndex: r,
                  tdInfo: te,
                  isUseScrollX: t.isUseScrollX,
                  fixedLeftIndex: t.fixedLeftIndex,
                  fixedRightIndex: t.fixedRightIndex
                }, {
                  default: M(() => [
                    D(f.$slots, `td_elastic_${te.data}`, {
                      data: E,
                      trIndex: T,
                      trElasticInx: L
                    }, () => [
                      Ne(me(c(E[te.data], te)), 1)
                    ])
                  ]),
                  _: 2
                }, 1032, ["isOrder", "tdIndex", "tdInfo", "isUseScrollX", "fixedLeftIndex", "fixedRightIndex"]))), 128))
              ], 42, yl))), 128))
            ], 64)) : k("", !0)
          ], 64)) : k("", !0)
        ], 64))), 128)) : k("", !0),
        t.list.length === 0 && !t.isRunLoading && t.fixedType.length === 0 ? (u(), g("tr", vl, [
          I("td", {
            colspan: t.colspanCount,
            class: "td-empty"
          }, [
            I("div", xl, me(t.emptyText && t.emptyText.length > 0 ? t.emptyText : et(K).noResultsText), 1)
          ], 8, ml)
        ])) : k("", !0)
      ])
    ], 6));
  }
}), Sl = { class: "table-wrapper" }, Il = {
  key: 0,
  class: "table-fixed-column-left"
}, bl = {
  key: 1,
  class: "table-fixed-column-right"
}, Cl = {
  key: 0,
  class: "table-scroll-occupy-container"
}, kl = {
  key: 1,
  class: "table-fixed-column-scrollX"
}, wl = {
  key: 2,
  class: "table-fixed-head-load"
}, pl = {
  key: 0,
  class: "table-fixed-column-left"
}, El = {
  key: 1,
  class: "table-fixed-column-right"
}, Tl = {
  key: 1,
  class: "table-fixed-column-scrollX"
}, Ll = {
  key: 1,
  class: "table-footer-wrapper"
}, Ol = {
  key: 0,
  class: "table-load"
}, Bl = { class: "table-load-wrapper" }, Ql = /* @__PURE__ */ ce({
  name: "ClTable",
  __name: "Index",
  props: {
    className: String,
    columns: {
      type: Array,
      required: !0,
      default: () => []
    },
    list: {
      type: Array,
      default: () => []
    },
    totalLength: Number,
    totalData: {
      type: Object,
      default: () => ({})
    },
    isServer: {
      type: Boolean,
      default: !0
    },
    isParamTriggerServer: {
      type: Boolean,
      default: !1
    },
    isDisabled: {
      type: Boolean,
      default: !1
    },
    isLoading: {
      type: Boolean,
      default: !0
    },
    isShowInitLoadIng: {
      type: Boolean,
      default: !0
    },
    isPaginate: {
      type: Boolean,
      default: !0
    },
    pageOffset: {
      type: Number,
      default: 0
    },
    isPaginateLimit: {
      type: Boolean,
      default: !0
    },
    paginateLimit: {
      type: Number,
      default: 10
    },
    paginateLimitData: Array,
    isOrder: {
      type: Boolean,
      default: !1
    },
    orderSort: {
      type: Array,
      default: () => []
    },
    selectValue: {
      type: [String, Number],
      default: ""
    },
    checkedRowType: {
      type: String,
      default: "none"
      // none | radio | checkbox
    },
    isShowCheckboxAll: {
      type: Boolean,
      default: !0
    },
    isScrollX: {
      type: Boolean,
      default: !1
    },
    isScrollXBottom: {
      type: Boolean,
      default: !1
    },
    isFixedHead: {
      type: Boolean,
      default: !1
    },
    scrollY: {
      type: Number,
      default: -1
    },
    fixedColumnLeftIndex: {
      type: Number,
      default: -1
    },
    fixedColumnRightIndex: {
      type: Number,
      default: -1
    },
    isClickRowLinkage: {
      type: Boolean,
      default: !1
    },
    isElastic: {
      type: Boolean,
      default: !1
    },
    isElasticLoad: {
      type: Boolean,
      default: !0
    },
    rowClickKeyInvalid: {
      type: String,
      default: ".tr-click-invalid"
    },
    rowClickKeyElastic: {
      type: String,
      default: ".tr-click-elastic"
    },
    elasticIconCls: {
      type: Array,
      default: () => []
    },
    elasticType: {
      type: String,
      default: "default"
      // default | sameDataStructure
    },
    elasticData: {
      type: Object,
      default: () => ({})
    },
    trIntervalNum: {
      type: Number,
      default: -1
    },
    emptyText: String,
    isHead: {
      type: Boolean,
      default: !0
    }
  },
  emits: ["onGetData", "onClickRow", "onClickElastic", "onChangeChecked", "onChangeParams"],
  setup(t, { expose: v, emit: h }) {
    const i = t, C = h, K = Kt(), j = (e) => {
      let l = [];
      if (i.isOrder) {
        let o = [0, "desc"];
        for (let d = 0; d < i.columns.length; d += 1) {
          const n = i.columns[d], s = a.isBoolean(n.sort) ? n.sort : !0, y = a.isBoolean(n.visible) ? n.visible : !0;
          if (s && y) {
            o = [d, "desc"];
            break;
          }
        }
        if (e.length === 0)
          l = o;
        else {
          const d = i.columns[e[0]], n = a.isBoolean(d.sort) ? d.sort : !0, s = a.isBoolean(d.visible) ? d.visible : !0;
          l = n && s ? e : o;
        }
      }
      return l;
    }, N = () => {
      const e = Object.keys(K), l = { th: [], td: [], total: [], tdElastic: [] };
      return e.forEach((o) => {
        o.indexOf("th_") === 0 && l.th.push(o), o.indexOf("td_") === 0 && l.td.push(o), o.indexOf("total_") === 0 && l.total.push(o), o.indexOf("td_elastic_") === 0 && l.tdElastic.push(o);
      }), l;
    }, b = () => {
      const e = i.pageOffset / i.paginateLimit;
      return parseInt(e.toString(), 10) + 1;
    }, x = j(i.orderSort), c = {
      dataJson: a.getJsonByList(i.list),
      changeNewPaginate: {
        pages: b(),
        limit: i.paginateLimit
      },
      changeNewSort: {
        orderIndex: x[0],
        orderBy: x[1]
      },
      sortLocalData: [],
      scrollBody: {
        top: 0,
        left: 0
      },
      resizeEvent: null
    }, U = {}, q = O("tb-" + a.getRandom(8)), z = N();
    i.isElastic && z.td.push("tr_elastic_children");
    const xe = O(z.th), Se = O(z.td), Ie = O(z.total), be = O(z.tdElastic), Ce = O(null), w = O(null), $ = O(null), f = O(null), S = O(null), m = O(null), T = O(null), E = O(null), L = O(null), te = O(null), r = oe({
      isRunLoading: !1,
      isCheckedRadio: i.checkedRowType === "radio",
      isCheckedCheckbox: i.checkedRowType === "checkbox",
      colspanCount: 0,
      hoverTrIndex: -1,
      hoverTrElasticIndex: -1,
      totalHeight: "0"
    }), W = O([]), ue = oe({
      pages: c.changeNewPaginate.pages,
      limit: c.changeNewPaginate.limit
    }), lt = oe({
      orderIndex: c.changeNewSort.orderIndex,
      orderBy: c.changeNewSort.orderBy
    }), ke = O(x), ne = O(!1), J = O(a.split(i.selectValue.toString())), P = oe({
      open: [],
      loading: []
    }), A = oe({
      isShow: !1,
      minWidth: "auto",
      posType: "left"
    }), we = O(!1), p = oe({
      totalWidth: "0",
      centerWidth: "0",
      leftColumnLength: 0,
      leftWidth: "0",
      leftColspanCount: 0,
      rightColumnLength: 0,
      rightWidth: "0",
      rightColspanCount: 0
    }), le = oe({
      isShow: !1,
      width: "auto",
      height: "auto"
    }), it = oe({
      headHeight: 0
    }), We = B(() => i.isShowCheckboxAll && W.value.length > 0), he = B(() => !a.isEmpty(i.totalData) && W.value.length > 0), G = B(() => i.isScrollX || i.isScrollXBottom), de = B(() => i.scrollY > 0), F = B(() => i.fixedColumnLeftIndex > -1 && G.value), V = B(() => i.fixedColumnRightIndex > -1 && G.value && i.fixedColumnRightIndex > i.fixedColumnLeftIndex + 1), kt = B(() => {
      const e = {
        "panel-table": !0,
        "table-disabled": i.isDisabled
      };
      return r.isRunLoading && (e["table-loading"] = !0), a.osType().isMobile && (e["table-mob"] = !0), i.className && !a.isEmpty(i.className) && i.className.split(" ").forEach((l) => {
        a.isEmpty(l) || (e[l] = !0);
      }), e;
    }), wt = B(() => {
      const e = {
        "table-head-wrapper": !0,
        "table-scrollY": de.value,
        "table-scroll-occupy-y": we.value,
        "table-total": he.value
      };
      return le.isShow && (e["table-fixed-head"] = !0), e;
    }), pt = B(() => {
      const e = {
        "table-head-container": !0
      };
      return i.isScrollX && (e["table-scrollX"] = !0), (F.value || V.value) && (e["table-fixed-column"] = !0, A.isShow ? e[`table-scrollX-${A.posType}`] = !0 : e["table-scrollX-none"] = !0), e;
    }), Et = B(() => {
      const e = {
        "table-body-wrapper": !0,
        "table-scrollY": de.value,
        "table-scrollX": i.isScrollX,
        "table-scrollX-bottom": A.isShow
      };
      return e["table-scroll-borderT0"] = A.isShow && i.isScrollX, (F.value || V.value) && (e["table-fixed-column"] = !0, A.isShow ? e[`table-scrollX-${A.posType}`] = !0 : e["table-scrollX-none"] = !0), e;
    }), Tt = B(() => {
      const e = {};
      if ((F.value || V.value) && de.value) {
        const l = A.isShow ? i.scrollY - 15 : i.scrollY;
        e.maxHeight = `${l}px`;
      }
      return e;
    }), Lt = B(() => {
      const e = {};
      return F.value || V.value || de.value && (e.maxHeight = `${i.scrollY}px`), e;
    }), Ot = B(() => ({})), Bt = B(() => {
      const e = {};
      return (F.value || V.value) && (e["data-pad-left"] = p.leftWidth, e["data-pad-right"] = p.rightWidth), e;
    }), Rt = B(() => {
      const e = {};
      return r.isRunLoading && (e.height = `${it.headHeight}px`), e;
    }), $t = (e) => {
      C("onGetData", e);
    }, Nt = (e, l, o, d, n) => {
      C("onClickElastic", e, l, o, d, n);
    }, Wt = (e, l) => {
      C("onClickRow", e, l);
    }, Dt = (e, l, o) => {
      C("onChangeChecked", e, l, o);
    }, ot = () => {
      const e = $e();
      C("onChangeParams", e);
    }, De = () => {
      Y(() => {
        $.value && (it.headHeight = $.value.querySelector("thead").offsetHeight);
      }), r.isRunLoading = !0;
    }, at = () => {
      r.isRunLoading = !1;
    }, He = () => {
      let e = 0, l = 0;
      (r.isCheckedRadio || r.isCheckedCheckbox) && (e = 1, l = f.value.getRcWidth()), i.columns.forEach((d) => {
        (a.isBoolean(d.visible) ? d.visible : !0) && (e += 1, a.isEmpty(d.width) ? a.isEmpty(d.widthMin) || (l += d.widthMin) : l += d.width);
      });
      const o = f.value.getPaddingLr();
      l += o, r.colspanCount = e, G.value && (A.minWidth = l > 0 ? `${l}px` : "auto");
    }, Ae = () => new Promise((e) => {
      Y(() => {
        const l = L.value.getWidth();
        p.totalWidth = `${L.value.getWidth()}px`;
        let o = l;
        if (F.value || V.value) {
          const d = [], n = [];
          i.columns.forEach((ee, Ee) => {
            (a.isBoolean(ee.visible) ? ee.visible : !0) && (F.value && Ee <= i.fixedColumnLeftIndex && d.push(ee), V.value && Ee >= i.fixedColumnRightIndex && n.push(ee));
          });
          const s = r.isCheckedRadio || r.isCheckedCheckbox, y = f.value.getElTh(), X = y.length;
          let re = d.length;
          const ie = n.length;
          let ye = re - 1;
          const Yt = X - ie;
          s && (re += 1, ye += 1);
          let Je = 0, Ge = 0;
          for (let ee = 0; ee < X; ee++) {
            const Ee = y[ee].clientWidth;
            ee <= ye && (Je += Ee), ee >= Yt && (Ge += Ee);
          }
          F.value && (p.leftColspanCount = re, p.leftColumnLength = d.length, p.leftWidth = `${Je}px`, o -= Je), V.value && (p.rightColspanCount = ie, p.rightColumnLength = n.length, p.rightWidth = `${Ge}px`, o -= Ge);
        }
        p.centerWidth = `${o}px`, Y(() => {
          e("");
        });
      });
    }), st = () => {
      Y(() => {
        L.value.setElasticWidth();
      });
    }, Ht = (e) => {
      (F.value || V.value) && L.value.setElasticHeight(e);
    }, nt = (e) => {
      if (i.isElasticLoad) {
        const l = a.getArrClone(P.loading);
        l.push(e), P.loading = l;
      }
    }, dt = (e) => {
      if (i.isElasticLoad) {
        const l = a.getArrClone(P.loading);
        l.splice(l.indexOf(e), 1), P.loading = l, Y(() => {
          Ht(e);
        });
      }
    }, Xe = (e, l, o, d) => {
      const n = e.id.toString(), s = a.getArrClone(P.open), y = s.indexOf(n), X = y === -1;
      X ? (s.push(n), nt(n)) : (s.splice(y, 1), dt(n)), Xt(o, X), (a.isBoolean(d) ? d : !0) && Nt(n, e, l, X, o), P.open = s, st();
    }, At = () => {
      const e = [], l = i.elasticIconCls;
      if (l.length === 2) {
        const o = W.value, d = P.open;
        o.forEach((n) => {
          const s = a.getJsonClone(n);
          if (s.id) {
            const y = s.id.toString();
            s._elasticIconCls = d.indexOf(y) > -1 ? l[1] : l[0], e.push(s);
          }
        });
      }
      e.length > 0 && (W.value = e);
    }, Xt = (e, l = !1) => {
      if (e) {
        const o = [], d = ["elastic-expand", "elastic-retract"];
        l ? o.push("elastic-expand") : o.push("elastic-retract");
        const n = i.elasticIconCls;
        n.length === 2 && (d.push(n[0]), d.push(n[1]), l ? o.push(n[1]) : o.push(n[0]));
        let s = ae.getRemoveClass(e.className, d.join(" "));
        s = ae.getAddClass(s, o), e.className = s;
      }
    }, Oe = () => {
      const e = [];
      return W.value.forEach((l) => {
        (a.isBoolean(l.isDisabled) ? l.isDisabled : !1) || e.push(l.id.toString());
      }), e;
    }, Ue = (e = null) => {
      const l = a.isUndefined(e) ? J.value : e, o = [];
      if (l.length > 0) {
        const d = Oe();
        l.forEach((n) => {
          a.isExistValue(d, n) && o.push(n);
        });
      }
      return o;
    }, Pe = () => {
      if (r.isCheckedCheckbox) {
        const e = Oe(), l = Ue();
        ne.value = l.length > 0 && l.length === e.length;
      }
    }, rt = () => {
      const e = [], l = Ue(), o = [];
      return Oe().forEach((n) => {
        a.isExistValue(l, n) || o.push(n);
      }), r.isCheckedCheckbox ? l.forEach((n) => {
        e.push(c.dataJson[n.toString()]);
      }) : r.isCheckedRadio && l.length > 0 && e.push(c.dataJson[l[0].toString()]), { checkedIds: l, unCheckedIds: o, checkedData: e };
    }, Me = () => {
      const e = rt();
      Dt(e.checkedIds.join(","), e.checkedData, {
        checkedIds: e.checkedIds,
        unCheckedIds: e.unCheckedIds
      });
    }, ct = (e) => {
      const l = e.id.toString(), o = J.value;
      let d = [];
      if (r.isCheckedCheckbox) {
        const n = a.isExistValue(o, l);
        o.forEach((s) => {
          s !== l && d.push(s);
        }), n || d.push(l), J.value = d, Pe(), Me();
      } else
        o.length > 0 && o[0] === l || (d = [l], J.value = d, Me());
    }, Fe = () => {
      if (G.value) {
        const e = E.value.clientWidth, l = L.value.getWidth();
        A.isShow = l > e;
      }
    }, Ve = () => {
      if (de.value) {
        const e = L.value.getHeight();
        let l = e > i.scrollY;
        if (l || (F.value || V.value ? l = e > T.value.clientHeight : E.value.offsetHeight === i.scrollY && (l = e > E.value.clientHeight)), l && he.value) {
          const o = f.value.getTotalHeight() - (a.osType().isMobile ? 2 : 0);
          r.totalHeight = `${o}px`;
        }
        we.value = l;
      }
    }, Be = () => {
      if (F.value || V.value) {
        let e = E.value.scrollLeft;
        const l = E.value.clientWidth, o = L.value.getWidth();
        let d = "left";
        if (e > 0) {
          const n = l + e;
          n >= o ? (d = "right", n > o && (e = 0)) : d = "center";
        }
        A.posType = d;
      }
    }, ut = () => {
      let e = $.value.scrollLeft;
      const l = m.value.clientWidth, o = L.value.getWidth();
      l + e > o && (e = 0), P.loading.length > 0 && L.value.setElasticLoadLeft(e), W.value.length === 0 && L.value.setEmptyLeft(e);
    }, Re = (e) => {
      const o = e.target.scrollLeft;
      $.value.scrollLeft = o, E.value.scrollLeft = o, S.value && S.value.setScrollLeft(o), te.value && te.value.setScrollLeft(o), Be(), ut();
    }, ht = (e) => {
      const l = e.target.scrollLeft, o = e.target.scrollTop;
      l !== c.scrollBody.left && Re(e), c.scrollBody.left = l, c.scrollBody.top = o;
    }, Ye = () => {
      if (i.isFixedHead && Ce.value && !r.isRunLoading) {
        let e = !1, l = "auto", o = "auto";
        const d = ae.getPositionView(Ce.value.parentNode);
        if (d.top < 0) {
          const n = m.value.clientHeight;
          if (d.top > (n - 30) * -1) {
            e = !0;
            const s = m.value.offsetWidth, y = A.isShow && i.isScrollX ? w.value.offsetHeight : f.value.getOffsetHeight();
            l = `${s}px`, o = `${y}px`;
          }
        }
        le.isShow = e, le.width = l, le.height = o;
      }
    }, Ke = () => {
      W.value.length === 0 && Y(() => {
        L.value.setEmptyWidth();
      });
    }, $e = () => {
      const e = {};
      if (i.isPaginate) {
        const { pages: l, limit: o } = c.changeNewPaginate;
        e.pages = l, e.limit = o, e.offset = (e.pages - 1) * e.limit;
      }
      if (i.isOrder) {
        const { orderIndex: l, orderBy: o } = c.changeNewSort;
        e.orderIndex = l, e.orderBy = o, e.orderColumns = i.columns[l].data;
      }
      return e;
    }, Ut = () => {
      i.scrollY > 0 && Y(() => {
        const e = E.value.querySelectorAll(".tr-selected");
        E.value.scrollTop = e && e.length > 0 && e[0].offsetTop > 180 ? e[0].offsetTop - 50 : 0;
      });
    }, ft = (e = {}) => {
      if (r.isCheckedRadio || r.isCheckedCheckbox) {
        const l = a.split(i.selectValue.toString());
        J.value = Ue(l), Pe(), Ut();
      }
      i.isElastic && ((!a.isBoolean(e.isElasticCloseAll) || e.isElasticCloseAll) && (P.open = []), P.loading = [], At()), Y(() => {
        i.isPaginate && (ue.pages = c.changeNewPaginate.pages, ue.limit = c.changeNewPaginate.limit), i.isOrder && (lt.orderIndex = c.changeNewSort.orderIndex, lt.orderBy = c.changeNewSort.orderBy, ke.value = j([
          c.changeNewSort.orderIndex,
          c.changeNewSort.orderBy
        ])), at(), He(), Y(() => {
          Ve(), Fe(), Ae().then(() => {
            Be();
          }), Ke(), Ye();
        });
      });
    }, gt = (e, l) => {
      let o = [];
      if (l) {
        if (i.isOrder) {
          const d = {}, n = [];
          let s = "string";
          if (!a.isUndefined(e.orderIndex)) {
            const y = e.orderColumns, X = i.columns[e.orderIndex];
            if (a.isEmpty(X.sortType))
              switch (X.format) {
                case "int":
                case "float2":
                case "float3":
                  s = "number";
                  break;
                case "date":
                case "dateTime":
                case "time":
                  s = "date";
                  break;
                default:
                  s = "string";
              }
            else
              s = X.sortType;
            i.list.forEach((re) => {
              let ie = re[y];
              ie = a.isUndefined(ie) ? "" : ie;
              const ye = ie.toString();
              a.isExistJsonKey(d, ye) || (d[ye] = [], n.push(ie)), d[ye].push(a.getJsonClone(re));
            });
          }
          n.length > 0 && (e.orderBy === "desc" ? a.getArrDesc(n, s) : a.getArrAsc(n, s)).forEach((X) => {
            o.push(...d[X.toString()]);
          });
        } else
          o = a.getListClone(i.list);
        c.sortLocalData = o;
      } else
        o = c.sortLocalData;
      if (i.isPaginate) {
        const d = [], n = o.length, s = e.offset;
        let y = e.offset + e.limit;
        if (y = n < y ? n : y, n && n >= s && n > 0)
          for (let X = s; X < y; X += 1)
            n >= X && d.push(a.getJsonClone(o[X]));
        return d;
      } else
        return o;
    }, pe = (e = {}) => {
      const l = $e();
      J.value = [], ne.value = !1, De(), i.isServer ? $t(l) : setTimeout(() => {
        const o = a.isBoolean(e.isChangePage) ? !e.isChangePage : !0;
        W.value = gt(l, o), ft();
      }, 300);
    }, Pt = () => {
      G.value && ($.value && $.value.addEventListener("scroll", Re), E.value && E.value.addEventListener("scroll", ht));
    }, Mt = () => {
      if (de.value) {
        const e = window, l = e.MutationObserver || e.WebKitMutationObserver || e.MozMutationObserver;
        U.observerBodyScrollY = new l(() => {
          Ve();
        }), U.observerBodyScrollY.observe(L.value.$el, {
          childList: !0,
          subtree: !0
        });
      }
    }, yt = () => {
      Fe(), Ae().then(() => {
        Be();
      }), st(), Ke(), ut(), Y(() => {
        Ye();
      });
    }, vt = () => {
      Ye();
    }, Ft = () => {
      He(), Y(() => {
        i.isServer ? pe() : (a.isEmpty(i.list) ? i.isShowInitLoadIng ? De() : Y(() => {
          Ke();
        }) : (pe(), i.isShowInitLoadIng || (r.isRunLoading = !1)), W.value = i.list);
      });
    };
    Te(
      () => i.list,
      (e, l) => {
        if (c.dataJson = a.getJsonByList(e), q.value = "tb-" + a.getRandom(8), i.isServer)
          W.value = e;
        else if (i.isParamTriggerServer)
          W.value = a.getListClone(e, !0);
        else {
          c.changeNewPaginate.pages = 1;
          const d = $e();
          W.value = gt(d, !0);
        }
        const o = {};
        if (i.isElastic) {
          let d = !1;
          e.forEach((n, s) => {
            d || !a.isUndefined(n.id) && l && l[s] && n.id !== l[s].id && (d = !0);
          }), d || (o.isElasticCloseAll = !1);
        }
        ft(o);
      },
      { deep: !0 }
    ), Te(
      () => i.columns,
      () => {
        Y(() => {
          He(), Y(() => {
            Ve(), Fe(), Ae().then(() => {
              Be();
            });
          });
        });
      },
      { deep: !0 }
    ), Te(
      () => i.selectValue,
      (e) => {
        J.value = a.split(e.toString()), Pe();
      }
    ), Te(
      () => i.orderSort,
      (e, l) => {
        if (e && l && !(e[0] === l[0] && e[1] === l[1]) && !(e[0] === c.changeNewSort.orderIndex && e[1] === c.changeNewSort.orderBy)) {
          const o = j(i.orderSort);
          c.changeNewSort = {
            orderIndex: o[0],
            orderBy: o[1]
          }, ke.value = o;
        }
      }
    ), Te(
      [() => i.pageOffset, () => i.paginateLimit],
      ([e, l], [o, d]) => {
        const n = b();
        c.changeNewPaginate.pages = n, c.changeNewPaginate.limit = l, ue.pages = n, ue.limit = l;
      }
    ), qt(() => {
      Y(() => {
        Ft(), Pt(), Mt(), c.resizeEvent = new Jt({
          isDelay: !1,
          callback: () => {
            yt();
          }
        }), i.isFixedHead && window.addEventListener("scroll", vt);
      });
    }), jt(() => {
      U.observerBodyScrollY && (U.observerBodyScrollY.disconnect(), U.observerBodyScrollY.takeRecords(), U.observerBodyScrollY = null), G.value && ($.value && $.value.removeEventListener("click", Re), E.value && E.value.removeEventListener("click", ht)), c.resizeEvent && c.resizeEvent.destroy(), i.isFixedHead && window.removeEventListener("scroll", vt);
    });
    const qe = () => {
      const e = !ne.value;
      let l = [];
      if (e) {
        const o = Oe(), d = J.value, n = [];
        o.forEach((s) => {
          a.isExistValue(d, s) || n.push(s);
        }), l = d.concat(n);
      }
      ne.value = e, J.value = l, Me();
    }, je = (e, l, o) => {
      r.isRunLoading || (c.changeNewPaginate.pages = 1, c.changeNewSort.orderIndex = l, c.changeNewSort.orderBy = o, !i.isServer && i.isParamTriggerServer ? ot() : pe({}));
    }, ze = (e, l, o) => {
      const d = ae.getParent(e.target, i.rowClickKeyInvalid, e.currentTarget, !1);
      if (a.isUndefined(d)) {
        if (i.isElastic) {
          const n = ae.getParent(
            e.target,
            i.rowClickKeyElastic,
            e.currentTarget,
            !1
          );
          a.isUndefined(n) ? i.isClickRowLinkage && Xe(l, o) : Xe(l, o, n);
        }
        if (r.isCheckedRadio || r.isCheckedCheckbox) {
          let n = ae.getParent(e.target, ".th-rc", e.currentTarget, !1);
          n === e.currentTarget && (n = null), a.isUndefined(n) ? i.isClickRowLinkage && !(a.isBoolean(l.isDisabled) && l.isDisabled) && !i.isDisabled && ct(l) : ct(l);
        }
        Wt(l, o);
      }
    }, fe = (e, l = -1) => {
      r.hoverTrIndex = e, r.hoverTrElasticIndex = l;
    }, ge = () => {
      r.hoverTrIndex = -1, r.hoverTrElasticIndex = -1;
    }, Vt = (e, l) => {
      i.isPaginate && (c.changeNewPaginate.pages = e, c.changeNewPaginate.limit = l, !i.isServer && i.isParamTriggerServer ? ot() : pe({ isChangePage: !0 }));
    }, mt = (e) => {
      Re(e);
    };
    return v({
      getParamInfo: () => $e(),
      refresh: (e = !0) => {
        e && (c.changeNewPaginate.pages = 1), pe();
      },
      getData: () => {
        const e = zt(W.value);
        return a.getListClone(e);
      },
      getSelectData: () => {
        const e = rt();
        return { ids: e.checkedIds.join(","), list: e.checkedData };
      },
      loadStart: () => {
        De();
      },
      loadStop: () => {
        at();
      },
      loadElasticStart: (e) => {
        nt(e);
      },
      loadElasticStop: (e) => {
        dt(e);
      },
      closeElastic: (e, l, o) => {
        Xe(e, l, o, !1);
      },
      refreshResize: () => {
        yt();
      }
    }), (e, l) => {
      const o = Qe("cl-scrollx-fence"), d = Qe("cl-paginate"), n = Qe("cl-load-ing");
      return u(), g("div", {
        class: R(kt.value)
      }, [
        I("div", Sl, [
          t.isHead ? (u(), g(Z, { key: 0 }, [
            I("div", {
              class: R(wt.value),
              style: _({ width: le.width }),
              ref_key: "refElHeadWrapper",
              ref: Ce
            }, [
              I("div", {
                class: R(pt.value),
                ref_key: "refElHeadContainer",
                ref: w
              }, [
                I("div", {
                  class: "table-head-main",
                  ref_key: "refElHeadMain",
                  ref: $
                }, [
                  Q(Ze, {
                    minWidth: A.minWidth,
                    columns: t.columns,
                    isOrder: t.isOrder,
                    orderSort: ke.value,
                    isShowTotal: he.value,
                    totalInfo: t.totalData,
                    keyIndex: q.value,
                    hoverIndex: r.hoverTrIndex,
                    hoverElasticIndex: r.hoverTrElasticIndex,
                    isUseScrollX: G.value,
                    isShowRadio: r.isCheckedRadio,
                    isShowCheckbox: r.isCheckedCheckbox,
                    isShowCheckboxAll: We.value,
                    checkboxAllvalue: ne.value,
                    onOnClickAll: qe,
                    onOnClickOrderBy: je,
                    onOnHoverIn: fe,
                    onOnHoverOut: ge,
                    ref_key: "refElHeadTable",
                    ref: f
                  }, ve({ _: 2 }, [
                    H(xe.value, (s) => ({
                      name: s,
                      fn: M((y) => [
                        D(e.$slots, s, {
                          data: y.data
                        })
                      ])
                    })),
                    H(Ie.value, (s) => ({
                      name: s,
                      fn: M((y) => [
                        D(e.$slots, s, {
                          data: y.data
                        })
                      ])
                    }))
                  ]), 1032, ["minWidth", "columns", "isOrder", "orderSort", "isShowTotal", "totalInfo", "keyIndex", "hoverIndex", "hoverElasticIndex", "isUseScrollX", "isShowRadio", "isShowCheckbox", "isShowCheckboxAll", "checkboxAllvalue"])
                ], 512),
                F.value && p.leftColumnLength > 0 ? (u(), g("div", Il, [
                  I("div", {
                    class: "table-fixed-column-left-container",
                    style: _({ width: p.leftWidth })
                  }, [
                    Q(Ze, {
                      fixedType: "left",
                      fixedLeftIndex: t.fixedColumnLeftIndex,
                      width: p.totalWidth,
                      columns: t.columns,
                      isOrder: t.isOrder,
                      orderSort: ke.value,
                      isShowTotal: he.value,
                      totalInfo: t.totalData,
                      keyIndex: q.value,
                      hoverIndex: r.hoverTrIndex,
                      hoverElasticIndex: r.hoverTrElasticIndex,
                      isUseScrollX: G.value,
                      isShowRadio: r.isCheckedRadio,
                      isShowCheckbox: r.isCheckedCheckbox,
                      isShowCheckboxAll: We.value,
                      checkboxAllvalue: ne.value,
                      onOnClickAll: qe,
                      onOnClickOrderBy: je,
                      onOnHoverIn: fe,
                      onOnHoverOut: ge
                    }, ve({ _: 2 }, [
                      H(xe.value, (s) => ({
                        name: s,
                        fn: M(() => [
                          D(e.$slots, s)
                        ])
                      })),
                      H(Ie.value, (s) => ({
                        name: s,
                        fn: M((y) => [
                          D(e.$slots, s, {
                            data: y.data
                          })
                        ])
                      }))
                    ]), 1032, ["fixedLeftIndex", "width", "columns", "isOrder", "orderSort", "isShowTotal", "totalInfo", "keyIndex", "hoverIndex", "hoverElasticIndex", "isUseScrollX", "isShowRadio", "isShowCheckbox", "isShowCheckboxAll", "checkboxAllvalue"])
                  ], 4)
                ])) : k("", !0),
                V.value && p.rightColumnLength > 0 ? (u(), g("div", bl, [
                  I("div", {
                    class: "table-fixed-column-right-container",
                    style: _({ width: p.rightWidth })
                  }, [
                    Q(Ze, {
                      fixedType: "right",
                      fixedRightIndex: t.fixedColumnRightIndex,
                      width: p.totalWidth,
                      columns: t.columns,
                      isOrder: t.isOrder,
                      orderSort: ke.value,
                      keyIndex: q.value,
                      hoverIndex: r.hoverTrIndex,
                      hoverElasticIndex: r.hoverTrElasticIndex,
                      isShowTotal: he.value,
                      totalInfo: t.totalData,
                      isUseScrollX: G.value,
                      isShowRadio: r.isCheckedRadio,
                      isShowCheckbox: r.isCheckedCheckbox,
                      isShowCheckboxAll: We.value,
                      checkboxAllvalue: ne.value,
                      onOnClickAll: qe,
                      onOnClickOrderBy: je,
                      onOnHoverIn: fe,
                      onOnHoverOut: ge
                    }, ve({ _: 2 }, [
                      H(xe.value, (s) => ({
                        name: s,
                        fn: M(() => [
                          D(e.$slots, s)
                        ])
                      })),
                      H(Ie.value, (s) => ({
                        name: s,
                        fn: M((y) => [
                          D(e.$slots, s, {
                            data: y.data
                          })
                        ])
                      }))
                    ]), 1032, ["fixedRightIndex", "width", "columns", "isOrder", "orderSort", "keyIndex", "hoverIndex", "hoverElasticIndex", "isShowTotal", "totalInfo", "isUseScrollX", "isShowRadio", "isShowCheckbox", "isShowCheckboxAll", "checkboxAllvalue"])
                  ], 4)
                ])) : k("", !0)
              ], 2),
              we.value ? (u(), g("div", Cl, [
                l[0] || (l[0] = I("div", null, null, -1)),
                he.value ? (u(), g("div", {
                  key: 0,
                  class: "table-scroll-occupy-total",
                  style: _({ height: r.totalHeight })
                }, null, 4)) : k("", !0),
                t.isScrollX ? (u(), g("div", {
                  key: 1,
                  class: R({ "table-scroll-occupy-corner": A.isShow })
                }, null, 2)) : k("", !0)
              ])) : k("", !0),
              t.isScrollX ? Le((u(), g("div", kl, [
                Q(o, {
                  isShowLeft: F.value,
                  isShowRight: V.value,
                  leftWidth: p.leftWidth,
                  centerWidth: p.centerWidth,
                  rightWidth: p.rightWidth,
                  isShowCorner: we.value,
                  cornerType: "right-top",
                  onOnScrollX: mt,
                  ref_key: "refElHeadFixedScrollX",
                  ref: S
                }, null, 8, ["isShowLeft", "isShowRight", "leftWidth", "centerWidth", "rightWidth", "isShowCorner"])
              ], 512)), [
                [xt, A.isShow && t.isScrollX]
              ]) : k("", !0),
              le.isShow && r.isRunLoading ? (u(), g("div", wl)) : k("", !0)
            ], 6),
            le.isShow ? (u(), g("div", {
              key: 0,
              style: _({ height: le.height, width: le.width })
            }, null, 4)) : k("", !0)
          ], 64)) : k("", !0),
          I("div", {
            class: R(Et.value),
            ref_key: "refElBodyWrapper",
            ref: m
          }, [
            I("div", St({ class: "table-body-container" }, Ot.value, {
              style: Tt.value,
              ref_key: "refElBodyContainer",
              ref: T
            }), [
              I("div", St({
                class: { "table-body-main": !0, "table-body-empty": W.value.length === 0 }
              }, Bt.value, {
                style: Lt.value,
                ref_key: "refElBodyMain",
                ref: E
              }), [
                Q(_e, {
                  minWidth: A.minWidth,
                  columns: t.columns,
                  list: W.value,
                  isDisabled: t.isDisabled,
                  isOrder: t.isOrder,
                  selectValue: J.value,
                  keyIndex: q.value,
                  hoverIndex: r.hoverTrIndex,
                  hoverElasticIndex: r.hoverTrElasticIndex,
                  isUseScrollX: G.value,
                  colspanCount: r.colspanCount,
                  isRunLoading: r.isRunLoading,
                  isShowRadio: r.isCheckedRadio,
                  isShowCheckbox: r.isCheckedCheckbox,
                  isElastic: t.isElastic,
                  elasticOpen: P.open,
                  elasticLoading: P.loading,
                  elasticType: t.elasticType,
                  elasticData: t.elasticData,
                  trIntervalNum: t.trIntervalNum,
                  emptyText: t.emptyText,
                  onOnClickTr: ze,
                  onOnHoverIn: fe,
                  onOnHoverOut: ge,
                  ref_key: "refElBodyTable",
                  ref: L
                }, ve({ _: 2 }, [
                  H(Se.value, (s) => ({
                    name: s,
                    fn: M((y) => [
                      D(e.$slots, s, {
                        data: y.data,
                        trIndex: y.trIndex
                      })
                    ])
                  })),
                  H(be.value, (s) => ({
                    name: s,
                    fn: M((y) => [
                      D(e.$slots, s, {
                        data: y.data,
                        trIndex: y.trIndex,
                        trElasticInx: y.trElasticInx
                      })
                    ])
                  }))
                ]), 1032, ["minWidth", "columns", "list", "isDisabled", "isOrder", "selectValue", "keyIndex", "hoverIndex", "hoverElasticIndex", "isUseScrollX", "colspanCount", "isRunLoading", "isShowRadio", "isShowCheckbox", "isElastic", "elasticOpen", "elasticLoading", "elasticType", "elasticData", "trIntervalNum", "emptyText"])
              ], 16),
              F.value && p.leftColumnLength > 0 ? (u(), g("div", pl, [
                I("div", {
                  class: "table-fixed-column-left-container",
                  style: _({ width: p.leftWidth })
                }, [
                  Q(_e, {
                    width: p.totalWidth,
                    fixedType: "left",
                    fixedLeftIndex: t.fixedColumnLeftIndex,
                    columns: t.columns,
                    list: W.value,
                    isDisabled: t.isDisabled,
                    isOrder: t.isOrder,
                    selectValue: J.value,
                    keyIndex: q.value,
                    hoverIndex: r.hoverTrIndex,
                    hoverElasticIndex: r.hoverTrElasticIndex,
                    isUseScrollX: G.value,
                    colspanCount: r.colspanCount,
                    isRunLoading: r.isRunLoading,
                    isShowRadio: r.isCheckedRadio,
                    isShowCheckbox: r.isCheckedCheckbox,
                    isElastic: t.isElastic,
                    elasticOpen: P.open,
                    elasticLoading: P.loading,
                    elasticType: t.elasticType,
                    elasticData: t.elasticData,
                    trIntervalNum: t.trIntervalNum,
                    emptyText: t.emptyText,
                    onOnClickTr: ze,
                    onOnHoverIn: fe,
                    onOnHoverOut: ge
                  }, ve({ _: 2 }, [
                    H(Se.value, (s) => ({
                      name: s,
                      fn: M((y) => [
                        D(e.$slots, s, {
                          data: y.data
                        })
                      ])
                    })),
                    H(be.value, (s) => ({
                      name: s,
                      fn: M((y) => [
                        D(e.$slots, s, {
                          data: y.data,
                          trIndex: y.trIndex,
                          trElasticInx: y.trElasticInx
                        })
                      ])
                    }))
                  ]), 1032, ["width", "fixedLeftIndex", "columns", "list", "isDisabled", "isOrder", "selectValue", "keyIndex", "hoverIndex", "hoverElasticIndex", "isUseScrollX", "colspanCount", "isRunLoading", "isShowRadio", "isShowCheckbox", "isElastic", "elasticOpen", "elasticLoading", "elasticType", "elasticData", "trIntervalNum", "emptyText"])
                ], 4)
              ])) : k("", !0),
              V.value && p.rightColumnLength > 0 ? (u(), g("div", El, [
                I("div", {
                  class: "table-fixed-column-right-container",
                  style: _({ width: p.rightWidth })
                }, [
                  Q(_e, {
                    width: p.totalWidth,
                    fixedType: "right",
                    fixedRightIndex: t.fixedColumnRightIndex,
                    columns: t.columns,
                    list: W.value,
                    isDisabled: t.isDisabled,
                    isOrder: t.isOrder,
                    selectValue: J.value,
                    keyIndex: q.value,
                    hoverIndex: r.hoverTrIndex,
                    hoverElasticIndex: r.hoverTrElasticIndex,
                    isUseScrollX: G.value,
                    colspanCount: r.colspanCount,
                    isRunLoading: r.isRunLoading,
                    isShowRadio: r.isCheckedRadio,
                    isShowCheckbox: r.isCheckedCheckbox,
                    isElastic: t.isElastic,
                    elasticOpen: P.open,
                    elasticLoading: P.loading,
                    elasticType: t.elasticType,
                    elasticData: t.elasticData,
                    trIntervalNum: t.trIntervalNum,
                    emptyText: t.emptyText,
                    onOnClickTr: ze,
                    onOnHoverIn: fe,
                    onOnHoverOut: ge
                  }, ve({ _: 2 }, [
                    H(Se.value, (s) => ({
                      name: s,
                      fn: M((y) => [
                        D(e.$slots, s, {
                          data: y.data
                        })
                      ])
                    })),
                    H(be.value, (s) => ({
                      name: s,
                      fn: M((y) => [
                        D(e.$slots, s, {
                          data: y.data,
                          trIndex: y.trIndex,
                          trElasticInx: y.trElasticInx
                        })
                      ])
                    }))
                  ]), 1032, ["width", "fixedRightIndex", "columns", "list", "isDisabled", "isOrder", "selectValue", "keyIndex", "hoverIndex", "hoverElasticIndex", "isUseScrollX", "colspanCount", "isRunLoading", "isShowRadio", "isShowCheckbox", "isElastic", "elasticOpen", "elasticLoading", "elasticType", "elasticData", "trIntervalNum", "emptyText"])
                ], 4)
              ])) : k("", !0)
            ], 16),
            t.isScrollX && W.value.length > 0 && A.isShow ? (u(), g(Z, { key: 0 }, [
              t.isScrollXBottom ? Le((u(), g("div", {
                key: 0,
                class: "table-fixed-column-scrollX",
                style: _({ bottom: de.value ? "-1px" : "1px" })
              }, [
                Q(o, {
                  isShowLeft: F.value,
                  isShowRight: V.value,
                  leftWidth: p.leftWidth,
                  centerWidth: p.centerWidth,
                  rightWidth: p.rightWidth,
                  isShowCorner: we.value,
                  isShowCover: !1,
                  cornerType: "right-bottom",
                  onOnScrollX: mt,
                  ref_key: "refElBodyFixedScrollX",
                  ref: te
                }, null, 8, ["isShowLeft", "isShowRight", "leftWidth", "centerWidth", "rightWidth", "isShowCorner"])
              ], 4)), [
                [xt, A.isShow && t.isScrollXBottom]
              ]) : (u(), g("div", Tl, [...l[1] || (l[1] = [
                I("div", { style: { height: "15px" } }, null, -1)
              ])]))
            ], 64)) : k("", !0)
          ], 2),
          t.isPaginate && W.value.length > 0 ? (u(), g("div", Ll, [
            l[2] || (l[2] = I("div", null, null, -1)),
            Q(d, {
              currentPage: ue.pages,
              limitValue: ue.limit,
              limitData: t.paginateLimitData,
              totalCount: t.totalLength,
              isDisabled: r.isRunLoading,
              onOnChange: Vt
            }, null, 8, ["currentPage", "limitValue", "limitData", "totalCount", "isDisabled"])
          ])) : k("", !0)
        ]),
        r.isRunLoading ? (u(), g("div", Ol, [
          I("div", Bl, [
            I("div", {
              class: "table-load-head",
              style: _(Rt.value)
            }, null, 4),
            I("div", {
              class: R({ "table-load-body": !0, "table-load-bg-gray": t.isLoading })
            }, [
              Q(n, { isLoadIng: t.isLoading }, null, 8, ["isLoadIng"])
            ], 2)
          ])
        ])) : k("", !0)
      ], 2);
    };
  }
});
export {
  Ql as default
};
//# sourceMappingURL=ClTable.js.map
