g-ui-web 1.1.24 → 1.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/g-ui-web.js CHANGED
@@ -48722,7 +48722,7 @@ class K3 {
48722
48722
  R0(this, "events");
48723
48723
  if (this.events = {}, !t)
48724
48724
  throw console.error("dataUrl is undefined or null"), new Error("Invalid dataUrl");
48725
- if (typeof t == "string" || typeof t == "number" || typeof t == "object" && t !== null && !t.path)
48725
+ if (!(t != null && t.path) && !["string", "number"].includes(typeof t) && !Array.isArray(t) || Array.isArray(t) && !t.some((r) => r.path))
48726
48726
  this.loadStaticData(t);
48727
48727
  else if (Array.isArray(t)) {
48728
48728
  if (!t.some((r) => r && r.path))
@@ -95500,87 +95500,130 @@ const Clt = (e, t) => {
95500
95500
  let i = z(0);
95501
95501
  const s = z(!1), l = z(), u = z(null), c = z({});
95502
95502
  let d = null, f = z(!1);
95503
- const p = async (v) => {
95504
- if (ya(v)) {
95503
+ const p = async (g) => {
95504
+ if (ya(g)) {
95505
95505
  s.value = !0;
95506
95506
  return;
95507
95507
  } else
95508
95508
  s.value = !1;
95509
- const g = Zd(o.dbOptions.xAxisField);
95510
- f.value = !1;
95511
- let m = z([]), _ = zp(o.options), b = [], w = [], C = {
95509
+ const m = Zd(o.dbOptions.xAxisField), { newDbO: _, newData: b } = h(o.dbOptions, g);
95510
+ console.log(_, b), g = b, f.value = !1;
95511
+ let w = z([]), C = zp(o.options), x = [], S = [], E = {
95512
95512
  xAxis: [],
95513
95513
  series: []
95514
95514
  };
95515
- if (d = v, m.value = v, f.value = !0, m.value && o.dbOptions) {
95516
- m.value.map((S) => {
95517
- w.push(
95518
- g == "function" ? o.dbOptions.xAxisField(S) : S[o.dbOptions.xAxisField]
95515
+ if (d = g, w.value = g, f.value = !0, w.value && _) {
95516
+ w.value.map((A) => {
95517
+ S.push(
95518
+ m == "function" ? _.xAxisField(A) : A[_.xAxisField]
95519
95519
  );
95520
95520
  });
95521
- let x = [];
95522
- if (o.dbOptions.yAxis && o.dbOptions.yAxis.yAxisFields ? x = o.dbOptions.columns.map((S) => {
95523
- const E = o.dbOptions.yAxis.yAxisFields.find((T) => T.field === S.field);
95524
- return E ? { ...S, ...E } : S;
95521
+ let T = [];
95522
+ if (_.yAxis && _.yAxis.yAxisFields ? T = _.columns.map((A) => {
95523
+ const M = _.yAxis.yAxisFields.find((k) => k.field === A.field);
95524
+ return M ? { ...A, ...M } : A;
95525
95525
  }).concat(
95526
- o.dbOptions.yAxis.yAxisFields.filter(
95527
- (S) => !o.dbOptions.columns.some((E) => E.field === S.field)
95526
+ _.yAxis.yAxisFields.filter(
95527
+ (A) => !_.columns.some((M) => M.field === A.field)
95528
95528
  )
95529
- ) : x = o.dbOptions.columns, x.map((S) => {
95530
- let E = {
95529
+ ) : T = _.columns, T.map((A) => {
95530
+ let M = {
95531
95531
  name: "",
95532
- type: S.type || "line",
95533
- yAxisIndex: S.yAxisIndex,
95534
- stack: S.stack,
95532
+ type: A.type || "line",
95533
+ yAxisIndex: A.yAxisIndex,
95534
+ stack: A.stack,
95535
95535
  data: [],
95536
- lineStyle: S.lineStyle,
95537
- areaStyle: S.areaStyle
95536
+ lineStyle: A.lineStyle,
95537
+ areaStyle: A.areaStyle
95538
95538
  };
95539
- m.value.map((T) => {
95540
- E.name = T[S.title] || S.title, E.data.push(T[S.field]);
95541
- }), b.push(E);
95542
- }), _) {
95543
- if (_.xAxis ? _.xAxis[0].data = w : _.xAxis = [{ data: w }], _.series ? _.series = An({}, _.series, b) : _.series = b, o.dbOptions && o.dbOptions.yAxis && o.dbOptions.yAxis.yAxises) {
95544
- let S = [];
95545
- o.dbOptions.yAxis.yAxises.map((E) => {
95546
- let T = {
95547
- name: E.name,
95539
+ w.value.map((k) => {
95540
+ M.name = k[A.title] || A.title, M.data.push(k[A.field]);
95541
+ }), x.push(M);
95542
+ }), C) {
95543
+ if (C.xAxis ? C.xAxis[0].data = S : C.xAxis = [{ data: S }], C.series ? C.series = An({}, C.series, x) : C.series = x, _ && _.yAxis && _.yAxis.yAxises) {
95544
+ let A = [];
95545
+ _.yAxis.yAxises.map((M) => {
95546
+ let k = {
95547
+ name: M.name,
95548
95548
  type: "value",
95549
- position: E.position,
95550
- alignTicks: E.alignTicks,
95551
- offset: E.offset
95549
+ position: M.position,
95550
+ alignTicks: M.alignTicks,
95551
+ offset: M.offset
95552
95552
  };
95553
- S.push(T);
95554
- }), _.yAxis = An({}, _.yAxis, S);
95553
+ A.push(k);
95554
+ }), C.yAxis = An({}, C.yAxis, A);
95555
95555
  }
95556
95556
  } else
95557
- C.xAxis = [{ data: w }], C.series = b;
95558
- }
95559
- _ ? l.value = UB(_, o.dbOptions.columns) : l.value = UB(C, o.dbOptions.columns);
95557
+ E.xAxis = [{ data: S }], E.series = x;
95558
+ }
95559
+ C ? l.value = UB(C, _.columns) : l.value = UB(E, _.columns);
95560
+ }, h = (g, m) => {
95561
+ if (g.groupField) {
95562
+ const _ = g.groupField, b = g.xAxisField, w = g.columns && g.columns[0].field, C = m, x = [...new Set(C.map((A) => A[_]))], S = [];
95563
+ x.forEach((A, M) => {
95564
+ C.filter((O) => O[_] === A).forEach((O) => {
95565
+ const V = S.find((L) => L[b] === O[b]);
95566
+ if (V)
95567
+ V[`${_}${M + 1}`] = A, V[`${w}${M + 1}`] = O.contractAmount;
95568
+ else {
95569
+ const L = {
95570
+ [b]: O[b],
95571
+ [`${_}${M + 1}`]: A,
95572
+ [`${w}${M + 1}`]: O.contractAmount
95573
+ };
95574
+ for (let P = 0; P < x.length; P++)
95575
+ P !== M && (L[`${_}${P + 1}`] = "", L[`${w}${P + 1}`] = 0);
95576
+ S.push(L);
95577
+ }
95578
+ });
95579
+ });
95580
+ const E = [];
95581
+ return x.forEach((A, M) => {
95582
+ g.columns.forEach((k, O) => {
95583
+ E.push({
95584
+ // ...column,
95585
+ title: A,
95586
+ field: `${k.field}${M + 1}`
95587
+ });
95588
+ });
95589
+ }), {
95590
+ newDbO: {
95591
+ xAxisField: g.xAxisField,
95592
+ groupField: g.groupField,
95593
+ columns: E,
95594
+ data: S
95595
+ },
95596
+ newData: S
95597
+ };
95598
+ } else
95599
+ return {
95600
+ newDbO: g,
95601
+ newData: m
95602
+ };
95560
95603
  };
95561
95604
  ke(
95562
95605
  () => o.dbOptions.data,
95563
- (v) => {
95564
- c.value = Kt(v);
95565
- const g = ["http://", "https://", void 0];
95566
- !v.path && !v.dsKey && !c.value.dataUrl && !(typeof v == "string" && g.some((m) => v.includes(m))) && c.value.loadStaticData(v), (typeof v == "string" || v.path) && c.value.reload(v.data);
95606
+ (g) => {
95607
+ c.value = Kt(g);
95608
+ const m = ["http://", "https://", void 0];
95609
+ g ? (typeof g == "object" && !g.path && !g.dsKey && !c.value.dataUrl && !(typeof g == "string" && m.some((_) => g.includes(_))) && c.value.loadStaticData(g), (typeof g == "string" || typeof g == "object") && (g.path || g.data && typeof g.data == "string") && c.value.reload(g.data || g)) : console.warn("props.dbOptions.data is undefined");
95567
95610
  },
95568
95611
  {
95569
95612
  deep: !0
95570
95613
  }
95571
95614
  ), ke(
95572
95615
  () => n["gui-theme"],
95573
- async (v) => {
95616
+ async (g) => {
95574
95617
  c.value = null, xe(async () => {
95575
- i++, c.value = Kt(o.dbOptions.data), p(c.value.data), c.value.on("load", (g) => {
95576
- p(g);
95618
+ i++, c.value = Kt(o.dbOptions.data), p(c.value.data), c.value.on("load", (m) => {
95619
+ p(m);
95577
95620
  });
95578
95621
  });
95579
95622
  },
95580
95623
  { deep: !0 }
95581
95624
  ), xe(async () => {
95582
- c.value = Kt(o.dbOptions.data), c.value.on("load", (v) => {
95583
- p(v);
95625
+ c.value = Kt(o.dbOptions.data), c.value.on("load", (g) => {
95626
+ p(g);
95584
95627
  });
95585
95628
  }), t({
95586
95629
  props: o,
@@ -95592,24 +95635,24 @@ const Clt = (e, t) => {
95592
95635
  return f.value;
95593
95636
  }
95594
95637
  });
95595
- const h = (v) => {
95596
- a("chart-click", v);
95638
+ const v = (g) => {
95639
+ a("chart-click", g);
95597
95640
  };
95598
- return (v, g) => {
95599
- const m = vt("g-chart");
95641
+ return (g, m) => {
95642
+ const _ = vt("g-chart");
95600
95643
  return D(), $("div", Blt, [
95601
- (D(), Se(m, Pt({ options: l.value }, v.$attrs, {
95644
+ (D(), Se(_, Pt({ options: l.value }, g.$attrs, {
95602
95645
  ref_key: "lineRef",
95603
95646
  ref: u,
95604
95647
  isEmpty: s.value,
95605
95648
  description: e.description,
95606
- onClick: h,
95649
+ onClick: v,
95607
95650
  key: y(i)
95608
95651
  }), null, 16, ["options", "isEmpty", "description"]))
95609
95652
  ]);
95610
95653
  };
95611
95654
  }
95612
- }), Wlt = /* @__PURE__ */ Qn(Hlt, [["__scopeId", "data-v-2a477454"]]), Glt = rr(Wlt), wm = Tr(), Gf = document.documentElement, Ult = (e) => e || "-", Klt = (e) => e || "", Ylt = (e, t) => {
95655
+ }), Wlt = /* @__PURE__ */ Qn(Hlt, [["__scopeId", "data-v-7bf18ebb"]]), Glt = rr(Wlt), wm = Tr(), Gf = document.documentElement, Ult = (e) => e || "-", Klt = (e) => e || "", Ylt = (e, t) => {
95613
95656
  let r = [];
95614
95657
  for (let n = 0; n <= e; n++)
95615
95658
  r.push({
@@ -97061,17 +97104,17 @@ const Wut = /* @__PURE__ */ Ll(Hut), Gut = ["id"], Uut = /* @__PURE__ */ H({
97061
97104
  emits: ["arrow-click"],
97062
97105
  setup(e, { expose: t, emit: r }) {
97063
97106
  Ws((k) => ({
97064
- "24481de6": l.value,
97065
- "46f0e802": u.value,
97066
- "7492fb4c": c.value,
97067
- 34238811: d.value,
97068
- "6042a298": f.value,
97069
- "4eff2f5e": g.value,
97070
- "53a262c5": h.value,
97071
- "1b86ecac": v.value,
97072
- "65a27447": m.value,
97073
- "14ca86b0": b.value,
97074
- "58f19446": _.value
97107
+ e11189a0: l.value,
97108
+ "667d6fe2": u.value,
97109
+ "295993c9": c.value,
97110
+ "447fc864": d.value,
97111
+ "134923d6": f.value,
97112
+ "121f067e": g.value,
97113
+ "44cf72b0": h.value,
97114
+ c84dc532: v.value,
97115
+ "20cf4fac": m.value,
97116
+ "868857da": b.value,
97117
+ "00e2e1a9": _.value
97075
97118
  }));
97076
97119
  const n = Tr(), a = e, o = R(() => a.bg && a.type != "default" ? `g-target-s-top-${a.size} g-target-s-${a.type} g-target-s-bg` : a.border && !a.bg ? `g-target-s-top-${a.size} g-target-s-${a.type} g-target-s-border` : `g-target-s-top-${a.size} g-target-s-${a.type}`), i = R(() => a.bg && a.type != "default" ? `g-target-s-bottom-${a.size} g-target-s-${a.type} g-target-s-bg` : a.border && !a.bg ? `g-target-s-bottom-${a.size} g-target-s-${a.type} g-target-s-border` : `g-target-s-bottom-${a.size} g-target-s-${a.type}`), s = R(() => a.bg && a.type != "default" ? `g-target-s-left-${a.size} g-target-s-${a.type} g-target-s-bg` : a.border && !a.bg ? `g-target-s-left-${a.size} g-target-s-${a.type} g-target-s-border` : `g-target-s-left-${a.size} g-target-s-${a.type}`), l = R(() => a.border ? "1px solid" : "0"), u = R(() => a.border ? "var(--border-radius-base)" : ""), c = R(() => a.bg ? n.name && typeof n.name == "string" && n.name.includes("white") ? `var(--color-${a.type}-lights-7)` : `var(--color-${a.type}-lights-6)` : ""), d = R(() => a.bg ? `var(--color-${a.type})` : ""), f = R(() => a.border && a.type != "default" ? `var(--color-${a.type})` : "var(--target-font-color)"), p = R(() => {
97077
97120
  if (a.aspect)
@@ -97145,7 +97188,7 @@ const Wut = /* @__PURE__ */ Ll(Hut), Gut = ["id"], Uut = /* @__PURE__ */ H({
97145
97188
  (k) => {
97146
97189
  S.value = Kt(k);
97147
97190
  const O = ["http://", "https://", void 0];
97148
- k && (!k.path && !k.dsKey && !S.value.dataUrl && !(typeof k == "string" && O.some((V) => k.includes(V))) && S.value.loadStaticData(k), (typeof k == "string" || k.path) && S.value.reload(k.data));
97191
+ k && (!k.path && !k.dsKey && !S.value.dataUrl && !(typeof k == "string" && O.some((V) => k.includes(V))) && S.value.loadStaticData(k), (typeof k == "string" || typeof k == "object") && (k.path || k.data && typeof k.data == "string") && S.value.reload(k.data || k));
97149
97192
  },
97150
97193
  {
97151
97194
  deep: !0
@@ -97181,7 +97224,9 @@ const Wut = /* @__PURE__ */ Ll(Hut), Gut = ["id"], Uut = /* @__PURE__ */ H({
97181
97224
  x.value && x.value.title ? (D(), $("div", {
97182
97225
  key: 0,
97183
97226
  class: "title",
97184
- style: dt({ color: y(n).name == "om-blue" ? "var(--gui-text-color-primary)" : "var(--gui-text-color-regular)" })
97227
+ style: dt({
97228
+ color: y(n).name == "om-blue" ? "var(--gui-text-color-primary)" : "var(--gui-text-color-regular)"
97229
+ })
97185
97230
  }, [
97186
97231
  a.tooltipPlacement == "icon" ? (D(), $("div", jut, [
97187
97232
  tr(De(x.value.title) + " ", 1),
@@ -97278,7 +97323,9 @@ const Wut = /* @__PURE__ */ Ll(Hut), Gut = ["id"], Uut = /* @__PURE__ */ H({
97278
97323
  x.value && x.value.title ? (D(), $("div", {
97279
97324
  key: 0,
97280
97325
  class: "title",
97281
- style: dt({ color: y(n).name == "om-blue" ? "var(--gui-text-color-primary)" : "var(--gui-text-color-regular)" })
97326
+ style: dt({
97327
+ color: y(n).name == "om-blue" ? "var(--gui-text-color-primary)" : "var(--gui-text-color-regular)"
97328
+ })
97282
97329
  }, [
97283
97330
  a.tooltipPlacement == "icon" ? (D(), $("div", ict, [
97284
97331
  tr(De(x.value.title) + " ", 1),
@@ -97334,7 +97381,9 @@ const Wut = /* @__PURE__ */ Ll(Hut), Gut = ["id"], Uut = /* @__PURE__ */ H({
97334
97381
  N("div", cct, [
97335
97382
  N("div", {
97336
97383
  class: "title",
97337
- style: dt({ color: y(n).name == "om-blue" ? "var(--gui-text-color-primary)" : "var(--gui-text-color-regular)" })
97384
+ style: dt({
97385
+ color: y(n).name == "om-blue" ? "var(--gui-text-color-primary)" : "var(--gui-text-color-regular)"
97386
+ })
97338
97387
  }, [
97339
97388
  a.tooltipPlacement == "icon" ? (D(), $("div", dct, [
97340
97389
  tr(De(x.value.title) + " ", 1),
@@ -97395,7 +97444,7 @@ const Wut = /* @__PURE__ */ Ll(Hut), Gut = ["id"], Uut = /* @__PURE__ */ H({
97395
97444
  ], 64);
97396
97445
  };
97397
97446
  }
97398
- }), _ct = /* @__PURE__ */ Qn(bct, [["__scopeId", "data-v-34081212"]]), wct = rr(_ct), Cct = { class: "left" }, xct = { class: "right" }, Sct = { class: "right" }, Ect = { class: "left" }, Tct = { class: "left" }, Act = { class: "right" }, Mct = { class: "right" }, kct = { class: "left" }, Dct = { class: "top" }, Oct = { class: "bottom" }, Ict = H({
97447
+ }), _ct = /* @__PURE__ */ Qn(bct, [["__scopeId", "data-v-04ccfb6d"]]), wct = rr(_ct), Cct = { class: "left" }, xct = { class: "right" }, Sct = { class: "right" }, Ect = { class: "left" }, Tct = { class: "left" }, Act = { class: "right" }, Mct = { class: "right" }, kct = { class: "left" }, Dct = { class: "top" }, Oct = { class: "bottom" }, Ict = H({
97399
97448
  name: "GTargetR"
97400
97449
  }), Rct = /* @__PURE__ */ H({
97401
97450
  ...Ict,
Binary file