import { defineComponent as M, useCssVars as A, ref as v, onMounted as H, watch as S, createElementBlock as p, createCommentVNode as V, openBlock as m, createVNode as J, normalizeStyle as u, Fragment as O, renderList as y, normalizeClass as W, createElementVNode as T, toDisplayString as g, unref as q, withCtx as P } from "vue";
import { cloneDeep as k, isEqual as z } from "lodash";
import { Vue3SeamlessScroll as U } from "vue3-seamless-scroll";
import { nanoid as w } from "nanoid";
import "../text-text-basic/index.mjs";
import "../text-table-basic/index.mjs";
import "../chart-other-gauge/index.mjs";
import "../chart-other-gauge-stage/index.mjs";
import "../chart-other-gauge-grade/index.mjs";
import "../chart-other-word-cloud/index.mjs";
import "../chart-other-liquidfill/index.mjs";
import "../chart-other-funnel/index.mjs";
import "../chart-other-force/index.mjs";
import "../chart-other-radar/index.mjs";
import "../chart-other-funnel-split/index.mjs";
import "../chart-other-funnel-contrast/index.mjs";
import "../chart-other-candlestick-basic/index.mjs";
import "../chart-other-candlestick-shanghai/index.mjs";
import "../chart-other-candlestick-demo/index.mjs";
import "../chart-other-heatmap/index.mjs";
import "../chart-other-force2/index.mjs";
import "../chart-other-graph-basic/index.mjs";
import "../chart-other-graph-basic2/index.mjs";
import "../chart-other-graph-calendar/index.mjs";
import "../chart-other-tree-line/index.mjs";
import "../chart-other-treemap-basic/index.mjs";
import "../chart-other-sunburst-basic/index.mjs";
import "../chart-other-sunburst-basic2/index.mjs";
import "../chart-other-sunburst-basic3/index.mjs";
import "../chart-other-sunburst-basic4/index.mjs";
import "../chart-other-sunburst-book/index.mjs";
import "../chart-other-sunburst-radius/index.mjs";
import "../chart-other-sunburst-flavors/index.mjs";
import "../chart-other-parallel-basic/index.mjs";
import "../chart-other-parallel-mul/index.mjs";
import "../chart-other-circular-graph/index.mjs";
import "../map-earth-basic/index.mjs";
import "../map-earth-cool-tech/index.mjs";
import "../map-earth-particle/index.mjs";
import "../map-earth-hacker/index.mjs";
import "../map-earth-fly-line/index.mjs";
import "../chart-other-grid-percentage/index.mjs";
import "../chart-other-radar-stack/index.mjs";
import "../chart-other-funnel2/index.mjs";
import "../chart-other-label-gauge/index.mjs";
import "../chart-other-theme-river/index.mjs";
import "../chart-other-tree/index.mjs";
import "../chart-other-treemap/index.mjs";
import "../commons-product-model/index.mjs";
import "../commons-vr-photo/index.mjs";
import "../commons-vr-video/index.mjs";
import "../commons-three-loader/index.mjs";
import "../commons-three-loader3/index.mjs";
import "../commons-loop-iterator/index.mjs";
import "../commons-gaussian-splatting-view/index.mjs";
import "../commons-babylon/index.mjs";
import "../commons-svg/index.mjs";
import "../commons-weather/index.mjs";
import "../commons-weather-dynamic/index.mjs";
import "../media-wavesurfer/index.mjs";
import "../interaction-tabs/index.mjs";
import "../interaction-tabs2/index.mjs";
import "../interaction-button/index.mjs";
import "../interaction-button-image/index.mjs";
import "../interaction-select/index.mjs";
import "../interaction-input/index.mjs";
import "../interaction-radio/index.mjs";
import "../interaction-slider/index.mjs";
import "../interaction-switch/index.mjs";
import "../interaction-data-picker/index.mjs";
import "../interaction-button-refresh/index.mjs";
import "../media-image/index.mjs";
import "../text-title/index.mjs";
import "../commons-qrcode/index.mjs";
import "../media-video/index.mjs";
import "../media-audio/index.mjs";
import "../text-real-time/index.mjs";
import "../media-carousel/index.mjs";
import "../media-carousel-slides/index.mjs";
import "../media-iframe-carousel/index.mjs";
import "../media-iframe/index.mjs";
import "../media-m3u8/index.mjs";
import "../media-m3u8-dynamic/index.mjs";
import "../media-audio-dynamic/index.mjs";
import "../media-video-dynamic/index.mjs";
import "../media-image-dynamic/index.mjs";
import "../media-iframe-dynamic/index.mjs";
import "../media-flv/index.mjs";
import "../commons-echarts/index.mjs";
import "../text-over-number/index.mjs";
import "../text-table-scroll/index.mjs";
import "../text-carousel/index.mjs";
import "./index.mjs";
import "../text-text-dynamic/index.mjs";
import "../text-count-down/index.mjs";
import "../graphical-circle/index.mjs";
import "../graphical-diamond/index.mjs";
import "../graphical-hexagon/index.mjs";
import "../graphical-isosceles-triangle/index.mjs";
import "../graphical-pentagon/index.mjs";
import "../graphical-rect/index.mjs";
import "../graphical-right-triangle/index.mjs";
import "../scene-map3d/index.mjs";
import "../scene-amap2d/index.mjs";
import "../scene-amap3d/index.mjs";
import "../scene-vr/index.mjs";
import "../scene-unity-iframe/index.mjs";
import "../scene-unity-webgl/index.mjs";
import "../scene-ue-iframe/index.mjs";
import "../scene-ue-shj/index.mjs";
import "../scene-default/index.mjs";
import "../interaction/tabs/index.mjs";
import "../interaction/tabs-icon/index.mjs";
import "../interaction/button/index.mjs";
import "../interaction/date-picker/src/date-picker/index.mjs";
import "../interaction/date-picker/src/date-picker-range/index.mjs";
import "../text/list/index.mjs";
import "../chart/src/bar/basic/index.mjs";
import "../chart/src/bar/animation/index.mjs";
import "../chart/src/bar/contrast/index.mjs";
import "../chart/src/bar/contrast2/index.mjs";
import "../chart/src/bar/contrast3/index.mjs";
import "../chart/src/bar/gradient-column-chart/index.mjs";
import "../chart/src/bar/horizontal/index.mjs";
import "../chart/src/bar/horizontal-stack/index.mjs";
import "../chart/src/bar/line-bar/index.mjs";
import "../chart/src/bar/line-bar2/index.mjs";
import "../chart/src/bar/loop/index.mjs";
import "../chart/src/bar/mini/index.mjs";
import "../chart/src/bar/polar/index.mjs";
import "../chart/src/bar/polar-stack/index.mjs";
import "../chart/src/bar/polar2/index.mjs";
import "../chart/src/bar/radius-circle/index.mjs";
import "../chart/src/bar/rank/index.mjs";
import "../chart/src/bar/segmented-progress/index.mjs";
import "../chart/src/bar/spire/index.mjs";
import "../chart/src/bar/stack/index.mjs";
import "../chart/src/bar/stack-line/index.mjs";
import "../chart/src/bar/stack2/index.mjs";
import "../chart/src/bar/stack3/index.mjs";
import "../chart/src/bar/staggered/index.mjs";
import "../chart/src/bar/three/index.mjs";
import "../chart/src/bar/waterfall/index.mjs";
import "../chart/src/bar/zebra/index.mjs";
import "../chart/src/line/area-gradient/index.mjs";
import "../chart/src/line/area-highlight/index.mjs";
import "../chart/src/line/area-highlight2/index.mjs";
import "../chart/src/line/basic/index.mjs";
import "../chart/src/line/bump/index.mjs";
import "../chart/src/line/dashed/index.mjs";
import "../chart/src/line/ladder/index.mjs";
import "../chart/src/line/logarithm/index.mjs";
import "../chart/src/line/multix/index.mjs";
import "../chart/src/line/polar-double/index.mjs";
import "../chart/src/line/rain-flow/index.mjs";
import "../chart/src/line/scale/index.mjs";
import "../chart/src/line/smooth/index.mjs";
import "../chart/src/line/smooth-area/index.mjs";
import "../chart/src/line/stack/index.mjs";
import "../chart/src/line/stack-area/index.mjs";
import "../chart/src/line/temp/index.mjs";
import "../chart/src/line/vertical/index.mjs";
import "../chart/src/map/basic/index.mjs";
import "../chart/src/map/bmap-basic/index.mjs";
import "../chart/src/map/bmap-heatmap/index.mjs";
import "../chart/src/map/bmap-rich/index.mjs";
import "../chart/src/map/customize/index.mjs";
import "../chart/src/map/lines/index.mjs";
import "../chart/src/map/scatter/index.mjs";
import "../chart/src/pie/3d/index.mjs";
import "../chart/src/pie/basic/index.mjs";
import "../chart/src/pie/basic2/index.mjs";
import "../chart/src/pie/customized/index.mjs";
import "../chart/src/pie/index/index.mjs";
import "../chart/src/pie/interval/index.mjs";
import "../chart/src/pie/legend-scroll/index.mjs";
import "../chart/src/pie/radius/index.mjs";
import "../chart/src/pie/rose/index.mjs";
import "../chart/src/pie/round/index.mjs";
import "../chart/src/pie/sunburst/index.mjs";
import "../chart/src/scatter/basic/index.mjs";
import "../chart/src/scatter/basic2/index.mjs";
import "../chart/src/scatter/bubble/index.mjs";
import "../chart/src/scatter/ripples/index.mjs";
import "../commons/custom-component-render/index.mjs";
import "../hj-componets/zv-hj-tree-list/index.mjs";
import "../hj-componets/zv-hj-model-resource/index.mjs";
import "../hj-componets/zv-hj-one-map-config/index.mjs";
import "../hj-componets/zv-hj-video-control/index.mjs";
import "../hj-componets/zv-hj-video-page/index.mjs";
import "../hj-componets/zv-hj-password-input/index.mjs";
import "../hj-componets/zv-hj-carousel/index.mjs";
import "../hj-componets/zv-hj-video-monitor/index.mjs";
import "../hj-componets/zv-hj-scene-amap2d/index.mjs";
import "../hj-componets/zv-hj-scene-amap3d/index.mjs";
import "../hj-componets/zv-hj-person-face/index.mjs";
import "../hj-componets/zv-hj-resource-type-phone/index.mjs";
import "../hj-componets/zv-hj-tree-list-phone/index.mjs";
import "../hj-componets/zv-hj-video-page-phone/index.mjs";
import "../hj-componets/zv-hj-model-resource-phone/index.mjs";
import "../hj-componets/zv-hj-bottom-suspend/index.mjs";
import "../hj-componets/zv-hj-pagination/index.mjs";
import "../hj-componets/zv-hj-password-input-phone/index.mjs";
/* empty css                        */
/* empty css                               */
import { SHJDatasourceV2 as G } from "../../plugins/datasource/index.mjs";
import { SHJParseEvent as l } from "../../plugins/event/index.mjs";
const K = ["onClick", "onMouseenter", "onMouseout"], Q = ["onClick"], X = { key: 1 }, Y = M({ name: "zv-text-row-scroll" }), Pr = /* @__PURE__ */ M({
  ...Y,
  props: {
    basicOption: {},
    useEvents: {},
    sources: {},
    uuid: {}
  },
  emits: ["on-click-item", "on-click-row", "on-mouseenter-row", "on-mouseout-row"],
  setup($, { expose: D, emit: F }) {
    A((o) => ({
      "4653a853": o.basicOption.css.table.borderWidth + "px",
      "098502e5": o.basicOption.css.table.borderStyle,
      "08a11497": o.basicOption.css.table.borderColor,
      "68c05bd5": o.basicOption.css.table.paddingLeft + "px",
      "5c6aadbb": o.basicOption.css.table.alignItems,
      "3beddc6e": o.basicOption.css.table.justifyContent,
      a0197162: o.basicOption.css.header.background,
      "77f51bc5": o.basicOption.css.header.height + "px",
      "4313aca2": o.basicOption.css.header.color,
      "7015d41c": o.basicOption.css.header.fontSize + "px",
      "58d71470": o.basicOption.css.header.fontWeight,
      "2fec4061": o.basicOption.css.header.fontStyle,
      "48f93bcc": o.basicOption.css.body.height + "px",
      "5f19a91a": o.basicOption.css.body.background,
      "24ca5fdd": o.basicOption.css.oddBackground,
      "418417f7": o.basicOption.css.body.color,
      "292bd931": o.basicOption.css.body.fontSize + "px",
      fa8a50da: o.basicOption.css.body.fontWeight,
      "5edcf936": o.basicOption.css.body.fontStyle
    }));
    const d = F, f = v(w()), n = v([]), r = $, b = v(r.basicOption.scroll.start), c = () => {
      G.parse({
        tId: r.uuid,
        sources: r.sources,
        callback: (o) => {
          try {
            l.parseEvents(r.useEvents, "dataListener", n), n.value = k(o.data[0].data) || [], f.value = w(), b.value = r.basicOption.scroll.start;
          } catch {
            l.parseEvents(r.useEvents, "dataListener", null), n.value = [], f.value = w(), b.value = r.basicOption.scroll.start;
          }
        }
      });
    }, L = (o) => {
      const t = [];
      for (const i in o)
        t.push(o[i]);
      return t;
    };
    H(() => c()), S(() => k(r.basicOption), (o, t) => {
      z(o, t) || c();
    }, {
      deep: !0
    }), S(() => k(r.sources), (o, t) => {
      z(o, t) || c();
    }, {
      deep: !0
    }), D({
      refresh: () => c(),
      refreshView: () => c(),
      refreshData: () => c()
    });
    const N = (o) => {
      if (!r.basicOption.columns)
        return !0;
      const t = r.basicOption.columns.find((i) => i.index === o);
      return t ? t.font.auto : !0;
    }, h = (o) => {
      if (!r.basicOption.columns)
        return null;
      const t = r.basicOption.columns.find((i) => i.index === o);
      return t && t.font.auto === !1 ? t.font : null;
    }, C = (o) => {
      if (!r.basicOption.columns)
        return !0;
      const t = r.basicOption.columns.find((i) => i.index === o);
      return t ? t.width.auto : !0;
    }, E = (o) => {
      if (!r.basicOption.columns)
        return null;
      const t = r.basicOption.columns.find((i) => i.index === o);
      return t && t.width.auto === !1 ? t.width.width : null;
    }, B = (o, t) => {
      const i = { row: o, rowIndex: t };
      d("on-click-row", i), l.parseEvents(r.useEvents, "on-click-row", i);
    }, I = (o, t) => {
      const i = { row: o, rowIndex: t };
      d("on-mouseenter-row", i), l.parseEvents(r.useEvents, "on-mouseenter-row", i);
    }, R = (o, t) => {
      const i = { row: o, rowIndex: t };
      d("on-mouseout-row", i), l.parseEvents(r.useEvents, "on-mouseout-row", i);
    }, j = (o, t, i, s) => {
      const e = { row: o, item: t, rowIndex: i, columnIndex: s };
      d("on-click-item", e), l.parseEvents(r.useEvents, "on-click-item", e);
    };
    return (o, t) => n.value.length > 0 ? (m(), p("div", {
      key: f.value,
      class: "table-scroll"
    }, [
      o.basicOption.css.header.show ? (m(), p("div", {
        key: 0,
        class: "table-header",
        style: u({
          "--header-background-image": `url(${o.basicOption.css.header.backgroundImage})`
        })
      }, [
        (m(!0), p(O, null, y(Object.keys(n.value[0]), (i, s) => (m(), p("div", {
          key: i,
          class: W(["th", { customWidth: !C(s + 1) }]),
          style: u({ "--width": E(s + 1) + "px" })
        }, [
          T("p", null, g(i), 1)
        ], 6))), 128))
      ], 4)) : V("", !0),
      J(q(U), {
        modelValue: b.value,
        "onUpdate:modelValue": t[0] || (t[0] = (i) => b.value = i),
        direction: o.basicOption.scroll.direction,
        list: n.value,
        "is-watch": "",
        hover: o.basicOption.scroll.hover,
        "limit-scroll-num": o.basicOption.scroll.limitScrollNum,
        "single-height": o.basicOption.scroll.isSingle ? o.basicOption.css.body.height : 0,
        "single-wait-time": o.basicOption.scroll.singleWaitTime,
        class: "table-body"
      }, {
        default: P(() => [
          (m(!0), p(O, null, y(n.value, (i, s) => (m(), p("div", {
            key: i,
            class: "tr",
            style: u({
              "--row-hover": o.basicOption.css.hoverColor
            }),
            onClick: (e) => B(i, s),
            onMouseenter: (e) => I(i, s),
            onMouseout: (e) => R(i, s)
          }, [
            (m(!0), p(O, null, y(L(i), (e, a) => (m(), p("div", {
              key: e,
              class: W(["td", { customWidth: !C(a + 1) }]),
              style: u({ "--width": E(a + 1) + "px" }),
              onClick: (Z) => j(i, e, s, a)
            }, [
              N(a + 1) ? (m(), p("p", X, g(e), 1)) : (m(), p("p", {
                key: 0,
                class: "customFont",
                style: u({
                  "--text-color": h(a + 1).color,
                  "--text-font-size": h(a + 1).fontSize + "px",
                  "--text-font-style": h(a + 1).fontStyle
                })
              }, g(e), 5))
            ], 14, Q))), 128))
          ], 44, K))), 128))
        ]),
        _: 1
      }, 8, ["modelValue", "direction", "list", "hover", "limit-scroll-num", "single-height", "single-wait-time"])
    ])) : V("", !0);
  }
});
export {
  Pr as default
};
