@antscorp/antsomi-genai 1.0.4 → 1.0.6

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.
Files changed (30) hide show
  1. package/dist/{Component-B5BdubLB.mjs → Component-BKr0w4Us.mjs} +22 -22
  2. package/dist/{Component-DFkXgjdO.mjs → Component-BgBLJsOt.mjs} +26 -26
  3. package/dist/{Component-jz5SxZrw.mjs → Component-CTfDbD_d.mjs} +3 -3
  4. package/dist/{Component-D3IQ3b1e.mjs → Component-DCaEyotc.mjs} +11 -11
  5. package/dist/{Component-BMh2NjoG.mjs → Component-DKrH_QkH.mjs} +1 -1
  6. package/dist/{Component-Cs1Q5_4Z.mjs → Component-DOVG-vCq.mjs} +6 -6
  7. package/dist/{Component-cIhr0XF8.mjs → Component-DXg6OcXi.mjs} +3 -3
  8. package/dist/{Component-BtOlYW3V.mjs → Component-Deoa-f1C.mjs} +7 -7
  9. package/dist/{Component-ydRxUGBj.mjs → Component-JWAUzkP5.mjs} +10 -10
  10. package/dist/{Component-BfYdR2OG.mjs → Component-UboAHscO.mjs} +55 -58
  11. package/dist/{index-D4vz-jRA.mjs → index-B5HGiE1g.mjs} +5618 -5603
  12. package/dist/{index-DRw3mwoe.mjs → index-BunB7Zfa.mjs} +2 -2
  13. package/dist/{index-Kxt8Aex_.mjs → index-CQEJnKKK.mjs} +1 -1
  14. package/dist/{index-BEEl4Oav.mjs → index-Cmy0W3pf.mjs} +3 -3
  15. package/dist/{index-BKRp_b-R.mjs → index-DHqQn4M-.mjs} +1 -1
  16. package/dist/index-DUG__POS.mjs +5 -0
  17. package/dist/{index-Dl-606ht.mjs → index-Dh9EYLoH.mjs} +3 -3
  18. package/dist/{index-xRiS8mAv.mjs → index-DiwQ5kuX.mjs} +1 -1
  19. package/dist/{index-uuxjgmdq.mjs → index-JaNOziH3.mjs} +2 -2
  20. package/dist/index-RnRjfUZ7.mjs +5 -0
  21. package/dist/{index-BMMEF6Aa.mjs → index-j8mMwpTN.mjs} +16 -16
  22. package/dist/{index-B8aoEnXh.mjs → index-sCbsA1DR.mjs} +2 -2
  23. package/dist/{index-DznvLL2L.mjs → index-uqO3Q0gN.mjs} +3 -3
  24. package/dist/index.d.ts +86 -86
  25. package/dist/index.es.js +1 -1
  26. package/dist/main.css +1 -1
  27. package/dist/{useGetSchema-eOp9PT4q.mjs → useGetSchema-B4FeKOfN.mjs} +1 -1
  28. package/package.json +1 -1
  29. package/dist/index-Diw3uKxZ.mjs +0 -5
  30. package/dist/index-UbCk3cXH.mjs +0 -5
@@ -1,18 +1,18 @@
1
1
  import { Report as I } from "@antscorp/antsomi-charts";
2
2
  import { Spin as T } from "@antscorp/antsomi-ui";
3
- import { useState as u, useEffect as E, useMemo as V } from "react";
4
- import { u as v } from "./useGetSchema-eOp9PT4q.mjs";
5
- import { k as R } from "./index-BMMEF6Aa.mjs";
6
- import { v as y, E as A, w as D, U as M } from "./index-D4vz-jRA.mjs";
3
+ import { useState as u, useEffect as V, useMemo as v } from "react";
4
+ import { u as E } from "./useGetSchema-B4FeKOfN.mjs";
5
+ import { k as R } from "./index-j8mMwpTN.mjs";
6
+ import { v as y, a7 as A, a8 as D, U as M } from "./index-B5HGiE1g.mjs";
7
7
  function b(o = []) {
8
- let a = o[0], r;
8
+ let n = o[0], r;
9
9
  for (let e = 0; e < o.length; e++) {
10
10
  const t = o[e];
11
- (r == null || t < r) && (r = t, a = t);
11
+ (r == null || t < r) && (r = t, n = t);
12
12
  }
13
- return a;
13
+ return n;
14
14
  }
15
- const l = (o, a) => {
15
+ const l = (o, n) => {
16
16
  const r = [];
17
17
  for (const e of o) {
18
18
  const t = {
@@ -20,35 +20,35 @@ const l = (o, a) => {
20
20
  nodes: []
21
21
  };
22
22
  if (Array.isArray(e.item))
23
- for (const n of e.item)
24
- n.aggregationType === "none" ? t[n.name] = n.value : t.aggregations = [
23
+ for (const a of e.item)
24
+ a.aggregationType === "none" ? t[a.name] = a.value : t.aggregations = [
25
25
  {
26
- name: n.name,
27
- type: n.aggregationType,
28
- value: n.value
26
+ name: a.name,
27
+ type: a.aggregationType,
28
+ value: a.value
29
29
  }
30
30
  ];
31
31
  e.nodes && (t.nodes = l(e.nodes)), r.push(t);
32
32
  }
33
33
  return r;
34
34
  }, z = (o) => {
35
- const { nodeViewProps: a } = o, {
35
+ const { nodeViewProps: n } = o, {
36
36
  extension: { options: r },
37
37
  node: e
38
- } = a, [t, n] = u(""), [d, p] = u(0), [s, f] = u(), { data: c, dataSourceSchema: m, isLoading: S, error: h } = v({
38
+ } = n, [t, a] = u(""), [d, p] = u(0), [s, f] = u(), { data: c, dataSourceSchema: m, isLoading: S, error: h } = E({
39
39
  id: t,
40
40
  attrs: s,
41
41
  dataSourceId: d,
42
42
  enabled: !!s
43
43
  });
44
- E(() => {
44
+ V(() => {
45
45
  const { messageId: i, dataSourceId: w } = y({
46
46
  messageId: D(),
47
47
  dataSourceId: A()
48
48
  }).parse(r);
49
- f(R.parse(e.attrs)), n(i), p(w);
49
+ f(R.parse(e.attrs)), a(i), p(w);
50
50
  }, [e.attrs, r]);
51
- const g = V(() => {
51
+ const g = v(() => {
52
52
  if (!(c && s && m))
53
53
  return null;
54
54
  const i = M.nodeView.report.attrsToCompSetting({
@@ -62,17 +62,17 @@ const l = (o, a) => {
62
62
  }, [c, s, m]);
63
63
  return { data: g?.data, settings: g?.settings, isLoading: S, error: h };
64
64
  }, { Treemap: N } = I, j = (o) => {
65
- const { chartWrapperSize: a, renderDropdownAction: r } = o, { data: e, settings: t, isLoading: n } = z({
65
+ const { chartWrapperSize: n, renderDropdownAction: r } = o, { data: e, settings: t, isLoading: a } = z({
66
66
  nodeViewProps: o
67
67
  });
68
- if (n || !e || !t)
68
+ if (a || !e || !t)
69
69
  return /* @__PURE__ */ React.createElement(T, { indicatorSize: 20 });
70
- const d = b([a?.width, 500]);
70
+ const d = b([n?.width, 500]);
71
71
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
72
72
  N,
73
73
  {
74
74
  levelToShow: t.levelToShow,
75
- height: a?.height,
75
+ height: n?.height,
76
76
  width: d,
77
77
  renderMetric: t.renderMetric,
78
78
  dimension: t.dimension,
@@ -1,11 +1,11 @@
1
1
  import { Report as ee } from "@antscorp/antsomi-charts";
2
2
  import { Spin as te } from "@antscorp/antsomi-ui";
3
- import { U as x, x as ae, b as ie, v as ne, E as se, w as re, a7 as oe } from "./index-D4vz-jRA.mjs";
4
- import { useState as L, useEffect as q } from "react";
5
- import { G as le, u as me } from "./useGetSchema-eOp9PT4q.mjs";
3
+ import { U as x, x as ae, b as ie, v as ne, a7 as se, a8 as re, a9 as oe } from "./index-B5HGiE1g.mjs";
4
+ import { useState as _, useEffect as q } from "react";
5
+ import { G as le, u as me } from "./useGetSchema-B4FeKOfN.mjs";
6
6
  import "@tanstack/react-query";
7
7
  import "@antscorp/antsomi-constants";
8
- import { d as fe } from "./index-BMMEF6Aa.mjs";
8
+ import { d as fe } from "./index-j8mMwpTN.mjs";
9
9
  function ce(T) {
10
10
  const A = /D[0-9]+_/, O = (e) => e.aliasAggregation || e.aggregation || "", n = {
11
11
  summary: 0,
@@ -16,11 +16,11 @@ function ce(T) {
16
16
  }, { data: y, settings: C } = T, { style: B, dimension: k, breakdownDimension: P } = C, c = C.metric.map((e, i) => ({
17
17
  ...e,
18
18
  key: `${e.name}_${i}`
19
- })), { axes: H, showOtherBars: $ = !1, showOtherSeries: j = !1 } = B, K = H.mode || "double", M = P.length, v = 6, N = 512;
19
+ })), { axes: H, showOtherBars: $ = !1, showOtherSeries: j = !1 } = B, K = H.mode || "double", M = P.length, E = 6, N = 512;
20
20
  let o = [], u = [];
21
- const r = {}, w = [], _ = [];
21
+ const r = {}, L = [], w = [];
22
22
  let U = 0, W = 0, X = [], h = B.maxBars;
23
- const g = B.maxSeries || v, { rows: Y } = y;
23
+ const g = B.maxSeries || E, { rows: Y } = y;
24
24
  if (Y.length <= 0)
25
25
  return { arrYAxis: [], data: [] };
26
26
  const z = [];
@@ -31,13 +31,13 @@ function ce(T) {
31
31
  for (let e = 0, i = y.rows.length; e < i; e++)
32
32
  if (M && c[0].name) {
33
33
  let t = y.rows[e].dimension.length;
34
- if (t = t < v ? t : v, typeof g == "number" && g > 0 && (t = +g < t ? g : t), F += t || 0, G = +t, F > N) {
34
+ if (t = t < E ? t : E, typeof g == "number" && g > 0 && (t = +g < t ? g : t), F += t || 0, G = +t, F > N) {
35
35
  R = e;
36
36
  break;
37
37
  }
38
38
  } else if (typeof y.rows[e].aggregations < "u") {
39
39
  let t = y.rows[e].aggregations.length;
40
- if (t = t < v ? t : v, typeof g == "number" && g > 0 && (t = +g < t ? g : t), F += t || 0, G = +t, F > N) {
40
+ if (t = t < E ? t : E, typeof g == "number" && g > 0 && (t = +g < t ? g : t), F += t || 0, G = +t, F > N) {
41
41
  R = e;
42
42
  break;
43
43
  }
@@ -101,17 +101,17 @@ function ce(T) {
101
101
  value: V,
102
102
  field: P[0]
103
103
  }).toString();
104
- const E = s.id.toString() || s.name.toString() && x.helpers.changeSpecialCharacterToSnake(s.name.toString()) || "";
105
- if (E) {
106
- w.indexOf(E) < 0 && w.length < N && (_.push(s), S && (w.push(E), o.push({
104
+ const v = s.id.toString() || s.name.toString() && x.helpers.changeSpecialCharacterToSnake(s.name.toString()) || "";
105
+ if (v) {
106
+ L.indexOf(v) < 0 && L.length < N && (w.push(s), S && (L.push(v), o.push({
107
107
  yAxisId: "",
108
- name: `D${E}`,
108
+ name: `D${v}`,
109
109
  label: V,
110
110
  key: c[0].key,
111
111
  isActive: !0
112
- }), X = [...X, `D${E}`])), ++t;
112
+ }), X = [...X, `D${v}`])), ++t;
113
113
  const p = a[d] ? +a[d] : 0;
114
- S && (l[`D${E}`] = p), S || (D += p), (S || !S && j) && (p < 0 ? I += p : m += p);
114
+ S && (l[`D${v}`] = p), S || (D += p), (S || !S && j) && (p < 0 ? I += p : m += p);
115
115
  }
116
116
  }), j)
117
117
  D && (l["D-1"] = D);
@@ -127,8 +127,8 @@ function ce(T) {
127
127
  if (z.indexOf(a.name) >= 0) {
128
128
  const S = a.name, V = O(a);
129
129
  if (S && e.aggregations.length > 0) {
130
- const E = e.aggregations.find((p) => p.name === S && V === p.aggregationType);
131
- E?.value && (s = E.value[0] ? E.value[0] : 0);
130
+ const v = e.aggregations.find((p) => p.name === S && V === p.aggregationType);
131
+ v?.value && (s = v.value[0] ? v.value[0] : 0);
132
132
  }
133
133
  }
134
134
  s = +x.helpers.convertValueFromDataType({
@@ -165,8 +165,8 @@ function ce(T) {
165
165
  let D = I;
166
166
  if (l + 1 < +h)
167
167
  D = [...D, b];
168
- else if (_.length > 0)
169
- for (const a of _) {
168
+ else if (w.length > 0)
169
+ for (const a of w) {
170
170
  const d = `D${a.id || a.name && x.helpers.changeSpecialCharacterToSnake(a.name.toString()) || ""}`;
171
171
  i[d] = i[d] ? (+i[d] || 0) + (+b[d] || 0) : b[d] || 0;
172
172
  }
@@ -251,7 +251,7 @@ function ce(T) {
251
251
  return {
252
252
  data: u,
253
253
  arrYAxis: o,
254
- arrDimensions: _,
254
+ arrDimensions: w,
255
255
  isAllBarOnLeft: J,
256
256
  isAllBarOnRight: Z,
257
257
  coordinateAxis: f,
@@ -262,16 +262,16 @@ const ge = (T) => {
262
262
  const { nodeViewProps: A } = T, {
263
263
  extension: { options: O },
264
264
  node: n
265
- } = A, y = ie(), [C, B] = L(""), [k, P] = L(0), [c, H] = L(), [$, j] = L(), [K, M] = L(), { data: v } = le.query({
265
+ } = A, y = ie(), [C, B] = _(""), [k, P] = _(0), [c, H] = _(), [$, j] = _(), [K, M] = _(), { data: E } = le.query({
266
266
  dataSourceId: k,
267
267
  auth: y
268
268
  });
269
269
  q(() => {
270
- const { messageId: r, dataSourceId: w } = ne({
270
+ const { messageId: r, dataSourceId: L } = ne({
271
271
  messageId: re(),
272
272
  dataSourceId: se()
273
273
  }).parse(O);
274
- H(fe.parse(n.attrs)), B(r), P(w);
274
+ H(fe.parse(n.attrs)), B(r), P(L);
275
275
  }, [n.attrs, O]);
276
276
  const {
277
277
  data: N,
@@ -284,14 +284,14 @@ const ge = (T) => {
284
284
  enabled: !!c
285
285
  });
286
286
  return q(() => {
287
- if (!(N && c && v))
287
+ if (!(N && c && E))
288
288
  return;
289
289
  const r = x.nodeView.report.attrsToCompSetting({
290
- dataSourceSchema: v,
290
+ dataSourceSchema: E,
291
291
  attrs: c
292
292
  });
293
293
  M(r), j(ce({ data: N, settings: r }));
294
- }, [N, c, v]), { data: $, settings: K, isLoading: o, error: u };
294
+ }, [N, c, E]), { data: $, settings: K, isLoading: o, error: u };
295
295
  };
296
296
  function xe(T) {
297
297
  const { chartWrapperSize: A, renderDropdownAction: O } = T, { data: n, settings: y, isLoading: C } = ge({
@@ -1,10 +1,10 @@
1
1
  import { Spin as ow } from "@antscorp/antsomi-ui";
2
- import { a9 as hi, K as ye, c as oe, U as gt, aa as gl, x as uw, ab as bl, a6 as sw, v as cw, E as lw, w as fw } from "./index-D4vz-jRA.mjs";
2
+ import { ab as hi, K as ye, c as oe, U as gt, ac as gl, x as uw, ad as bl, a6 as sw, v as cw, a7 as lw, a8 as fw } from "./index-B5HGiE1g.mjs";
3
3
  import { t as He } from "./toNumber-CHl49cGq.mjs";
4
4
  import * as qt from "react";
5
5
  import M, { isValidElement as ft, Children as Qt, PureComponent as Lt, forwardRef as Hb, useRef as Mi, useImperativeHandle as hw, useState as br, useCallback as dw, useEffect as ja, useMemo as Lf, cloneElement as Pe, createElement as Kb, useContext as jt, createContext as or, Component as Vb } from "react";
6
- import { u as pw } from "./useGetSchema-eOp9PT4q.mjs";
7
- import { f as vw } from "./index-BMMEF6Aa.mjs";
6
+ import { u as pw } from "./useGetSchema-B4FeKOfN.mjs";
7
+ import { f as vw } from "./index-j8mMwpTN.mjs";
8
8
  var fo, Kh;
9
9
  function Be() {
10
10
  if (Kh) return fo;
@@ -1,9 +1,9 @@
1
1
  import { Report as B } from "@antscorp/antsomi-charts";
2
2
  import { Spin as K } from "@antscorp/antsomi-ui";
3
3
  import { useState as z, useEffect as q, useMemo as G } from "react";
4
- import { u as J } from "./useGetSchema-eOp9PT4q.mjs";
5
- import { e as Z } from "./index-BMMEF6Aa.mjs";
6
- import { U as f, a8 as Q, r as ee, v as te, E as ae, w as ne } from "./index-D4vz-jRA.mjs";
4
+ import { u as J } from "./useGetSchema-B4FeKOfN.mjs";
5
+ import { e as Z } from "./index-j8mMwpTN.mjs";
6
+ import { U as f, aa as Q, r as ee, v as te, a7 as ae, a8 as ne } from "./index-B5HGiE1g.mjs";
7
7
  function oe(l, a) {
8
8
  const n = /* @__PURE__ */ Object.create(null);
9
9
  for (let t = 0; t < l.length; t++) {
@@ -170,18 +170,18 @@ const re = (l) => {
170
170
  let O = !1, k = 0;
171
171
  const Y = A.aliasAggregation || A.aggregation || "", j = typeof b.cellId == "string" ? b.cellId.split(";") : "", _ = typeof j[1] == "string" ? j[1].split(">") : [];
172
172
  t.some((M) => {
173
- const U = s.every((V, E) => {
174
- const N = f.helpers.getInfoFieldToQuery({ field: V }), x = `${N.name}-${N.semantics.semanticType}-${N.aggregationType}`.toLowerCase();
175
- return `${M[x]}` === L[E];
176
- }), X = g.every((V, E) => {
177
- const N = f.helpers.getInfoFieldToQuery({ field: V }), x = `${N.name}-${N.semantics.semanticType}-${N.aggregationType}`.toLowerCase();
178
- return `${M[x]}` === _[E];
173
+ const U = s.every((V, N) => {
174
+ const E = f.helpers.getInfoFieldToQuery({ field: V }), x = `${E.name}-${E.semantics.semanticType}-${E.aggregationType}`.toLowerCase();
175
+ return `${M[x]}` === L[N];
176
+ }), X = g.every((V, N) => {
177
+ const E = f.helpers.getInfoFieldToQuery({ field: V }), x = `${E.name}-${E.semantics.semanticType}-${E.aggregationType}`.toLowerCase();
178
+ return `${M[x]}` === _[N];
179
179
  });
180
180
  if (U && X) {
181
181
  if (Array.isArray(M.aggregations) && M.aggregations.length > 0) {
182
182
  let V = 0;
183
- for (const E of M.aggregations)
184
- E.name === A.name && E.type === Y && (V += +E.value);
183
+ for (const N of M.aggregations)
184
+ N.name === A.name && N.type === Y && (V += +N.value);
185
185
  return O = !0, k += V, k;
186
186
  }
187
187
  return O = !0, k += +M[A.name], k;
@@ -1,4 +1,4 @@
1
- import { N as o, c, D as n } from "./index-D4vz-jRA.mjs";
1
+ import { N as o, c, D as n } from "./index-B5HGiE1g.mjs";
2
2
  import { useRef as d } from "react";
3
3
  const s = {
4
4
  "node-wrapper": "_node-wrapper_omxhi_1"
@@ -1,9 +1,9 @@
1
1
  import { Report as V } from "@antscorp/antsomi-charts";
2
2
  import { Spin as z } from "@antscorp/antsomi-ui";
3
- import { useState as T, useEffect as E, useMemo as C } from "react";
4
- import { u as D } from "./useGetSchema-eOp9PT4q.mjs";
5
- import { h as Y } from "./index-BMMEF6Aa.mjs";
6
- import { a7 as M, U as A, ac as v, ae as R, v as L, E as X, w as G } from "./index-D4vz-jRA.mjs";
3
+ import { useState as T, useEffect as C, useMemo as E } from "react";
4
+ import { u as D } from "./useGetSchema-B4FeKOfN.mjs";
5
+ import { h as Y } from "./index-j8mMwpTN.mjs";
6
+ import { a9 as M, U as A, ae as v, ah as R, v as L, a7 as X, a8 as G } from "./index-B5HGiE1g.mjs";
7
7
  function N(p, y, l) {
8
8
  const { rows: n = [] } = p, i = [];
9
9
  for (const o of n) {
@@ -100,13 +100,13 @@ const P = (p) => {
100
100
  dataSourceId: f,
101
101
  enabled: !!t
102
102
  });
103
- return E(() => {
103
+ return C(() => {
104
104
  const { messageId: k, dataSourceId: m } = L({
105
105
  messageId: G(),
106
106
  dataSourceId: X()
107
107
  }).parse(l);
108
108
  g(Y.parse(n.attrs)), o(k), S(m);
109
- }, [n.attrs, l]), { ...C(() => {
109
+ }, [n.attrs, l]), { ...E(() => {
110
110
  if (!(h && t && r))
111
111
  return null;
112
112
  const k = A.nodeView.report.attrsToCompSetting({
@@ -1,9 +1,9 @@
1
1
  import { getSizeOfText as ce, Report as ue } from "@antscorp/antsomi-charts";
2
2
  import { Spin as me } from "@antscorp/antsomi-ui";
3
3
  import { useState as Z, useEffect as fe, useMemo as ee } from "react";
4
- import { u as ge } from "./useGetSchema-eOp9PT4q.mjs";
5
- import { c as he } from "./index-BMMEF6Aa.mjs";
6
- import { a1 as pe, U as h, x as de, a6 as te, v as ve, E as ye, w as De } from "./index-D4vz-jRA.mjs";
4
+ import { u as ge } from "./useGetSchema-B4FeKOfN.mjs";
5
+ import { c as he } from "./index-j8mMwpTN.mjs";
6
+ import { a1 as pe, U as h, x as de, a6 as te, v as ve, a7 as ye, a8 as De } from "./index-B5HGiE1g.mjs";
7
7
  import { t as E } from "./toNumber-CHl49cGq.mjs";
8
8
  function W(...y) {
9
9
  return pe(y);
@@ -1,9 +1,9 @@
1
1
  import { Report as I } from "@antscorp/antsomi-charts";
2
- import { Spin as E } from "@antscorp/antsomi-ui";
3
- import { useState as f, useEffect as M, useMemo as V } from "react";
4
- import { u as C } from "./useGetSchema-eOp9PT4q.mjs";
5
- import { j as D } from "./index-BMMEF6Aa.mjs";
6
- import { U as h, v as N, E as R, w as b } from "./index-D4vz-jRA.mjs";
2
+ import { Spin as M } from "@antscorp/antsomi-ui";
3
+ import { useState as f, useEffect as E, useMemo as V } from "react";
4
+ import { u as C } from "./useGetSchema-B4FeKOfN.mjs";
5
+ import { j as D } from "./index-j8mMwpTN.mjs";
6
+ import { U as h, v as N, a7 as R, a8 as b } from "./index-B5HGiE1g.mjs";
7
7
  const y = (o) => {
8
8
  const { data: i, settings: a } = o, s = h.helpers.safeParseListField(a.metric), n = (a.renderMetric ? h.helpers.safeParseListField(a.renderMetric) : s).at(0), u = [];
9
9
  for (const d of i.rows) {
@@ -46,7 +46,7 @@ const y = (o) => {
46
46
  dataSourceId: u,
47
47
  enabled: !!t
48
48
  });
49
- M(() => {
49
+ E(() => {
50
50
  const { messageId: g, dataSourceId: w } = N({
51
51
  messageId: b(),
52
52
  dataSourceId: R()
@@ -73,7 +73,7 @@ const y = (o) => {
73
73
  const { chartWrapperSize: i, renderDropdownAction: a } = o, { data: s, settings: c, isLoading: n } = P({
74
74
  nodeViewProps: o
75
75
  });
76
- return n || !s || !c ? /* @__PURE__ */ React.createElement(E, { indicatorSize: 20 }) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
76
+ return n || !s || !c ? /* @__PURE__ */ React.createElement(M, { indicatorSize: 20 }) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
77
77
  I.SunburstChart,
78
78
  {
79
79
  data: s,
@@ -1,9 +1,9 @@
1
1
  import { Report as N } from "@antscorp/antsomi-charts";
2
2
  import { Spin as z } from "@antscorp/antsomi-ui";
3
- import g, { forwardRef as C, useState as w, useEffect as E, useMemo as v } from "react";
4
- import { u as b } from "./useGetSchema-eOp9PT4q.mjs";
5
- import { i as y } from "./index-BMMEF6Aa.mjs";
6
- import { a as I, j as f, v as j, E as L, w as F, U as V } from "./index-D4vz-jRA.mjs";
3
+ import g, { forwardRef as C, useState as v, useEffect as b, useMemo as w } from "react";
4
+ import { u as y } from "./useGetSchema-B4FeKOfN.mjs";
5
+ import { i as E } from "./index-j8mMwpTN.mjs";
6
+ import { a as I, j as f, v as j, a7 as L, a8 as F, U as V } from "./index-B5HGiE1g.mjs";
7
7
  const S = C((a, o) => {
8
8
  const { width: s, height: e } = I(a);
9
9
  return f.jsx("svg", { viewBox: "0 0 32 32", fill: "currentColor", ...a, ref: o, width: s, height: e, children: f.jsx("g", { transform: "scale(0.03125 0.03125)", children: f.jsx("path", { d: "M389.74 204.8v80.64h270.72l-476.16 476.16 57.6 57.6 476.16-476.16v270.72h80.64v-408.96z" }) }) });
@@ -59,24 +59,24 @@ const S = C((a, o) => {
59
59
  const { nodeViewProps: o } = a, {
60
60
  extension: { options: s },
61
61
  node: e
62
- } = o, [r, i] = w(""), [h, m] = w(0), [d, p] = w();
63
- E(() => {
62
+ } = o, [r, i] = v(""), [h, m] = v(0), [d, p] = v();
63
+ b(() => {
64
64
  const { messageId: x, dataSourceId: D } = j({
65
65
  messageId: F(),
66
66
  dataSourceId: L()
67
67
  }).parse(s);
68
- p(y.parse(e.attrs)), i(x), m(D);
68
+ p(E.parse(e.attrs)), i(x), m(D);
69
69
  }, [e.attrs, s]);
70
- const { data: u, dataSourceSchema: t, isLoading: l, error: c } = b({
70
+ const { data: u, dataSourceSchema: t, isLoading: l, error: c } = y({
71
71
  id: r,
72
72
  attrs: d,
73
73
  dataSourceId: h,
74
74
  enabled: !!d
75
- }), n = v(() => d && t ? V.nodeView.report.attrsToCompSetting({
75
+ }), n = w(() => d && t ? V.nodeView.report.attrsToCompSetting({
76
76
  dataSourceSchema: t,
77
77
  attrs: d
78
78
  }) : null, [d, t]);
79
- return { data: v(() => u && n ? M({
79
+ return { data: w(() => u && n ? M({
80
80
  data: u,
81
81
  settings: n
82
82
  }) : null, [u, n])?.data, settings: n, isLoading: l, error: c };
@@ -1,20 +1,17 @@
1
1
  import { Report as L } from "@antscorp/antsomi-charts";
2
2
  import { Spin as M } from "@antscorp/antsomi-ui";
3
- import { useState as E, useEffect as T, useMemo as O } from "react";
4
- import { u as _ } from "./useGetSchema-eOp9PT4q.mjs";
5
- import { g as z } from "./index-BMMEF6Aa.mjs";
6
- import { ac as P, U as R, aa as H, ad as F, v as G, E as K, w as U } from "./index-D4vz-jRA.mjs";
7
- function W(c) {
8
- return c === null;
9
- }
3
+ import { useState as P, useEffect as T, useMemo as O } from "react";
4
+ import { u as _ } from "./useGetSchema-B4FeKOfN.mjs";
5
+ import { g as z } from "./index-j8mMwpTN.mjs";
6
+ import { ae as E, U as R, ac as H, af as F, ag as G, v as K, a7 as U, a8 as W } from "./index-B5HGiE1g.mjs";
10
7
  const N = 10;
11
- function Y(c) {
12
- const { apiData: m, metrics: u, dimensions: r, numberOfSlice: l = N } = c;
8
+ function Y(g) {
9
+ const { apiData: c, metrics: l, dimensions: s, numberOfSlice: m = N } = g;
13
10
  function I() {
14
- const { rows: t = [] } = m, s = [];
11
+ const { rows: t = [] } = c, r = [];
15
12
  for (const a of t) {
16
13
  const [i, S] = a;
17
- s.push({
14
+ r.push({
18
15
  aggregations: [
19
16
  {
20
17
  name: S.name,
@@ -29,36 +26,36 @@ function Y(c) {
29
26
  });
30
27
  }
31
28
  return {
32
- ...F(m, ["rows"]),
33
- rows: s
29
+ ...G(c, ["rows"]),
30
+ rows: r
34
31
  };
35
32
  }
36
- const g = [], { rows: p } = I(), n = {};
37
- let f, e = "", h = 0, v = 0, w = 0, y = 0;
38
- u.length > 0 && (f = u[0], e = f.name || "");
39
- const o = r.at(0);
40
- if (!(e && f && o))
33
+ const f = [], { rows: p } = I(), n = {};
34
+ let u, e = "", h = 0, v = 0, w = 0, y = 0;
35
+ l.length > 0 && (u = l[0], e = u.name || "");
36
+ const o = s.at(0);
37
+ if (!(e && u && o))
41
38
  return { data: [], totalValue: 0 };
42
39
  for (const t of p) {
43
- let s = 0;
40
+ let r = 0;
44
41
  if (e && t.aggregations && t.aggregations.length > 0) {
45
42
  const a = t.aggregations.find((i) => i.name === e);
46
- a?.value && (s = +a.value);
43
+ a?.value && (r = +a.value);
47
44
  }
48
- s = +P({
49
- field: f,
50
- value: s
51
- }), typeof n[e] != "number" && (n[e] = 0), n[e] += s;
45
+ r = +E({
46
+ field: u,
47
+ value: r
48
+ }), typeof n[e] != "number" && (n[e] = 0), n[e] += r;
52
49
  }
53
- return p.forEach((t, s) => {
50
+ return p.forEach((t, r) => {
54
51
  let a = t.dimension.name, i = 0, S = 0;
55
- if (a && r.length > 0 && ["IMAGE", "HYPERLINK"].includes(r[0].dataType)) {
52
+ if (a && s.length > 0 && ["IMAGE", "HYPERLINK"].includes(s[0].dataType)) {
56
53
  const d = R.helpers.formattedHyperlink(a, "—");
57
54
  if (d.length <= 0)
58
55
  return;
59
56
  o.dataType === "IMAGE" ? a = d[0] : o.dataType === "HYPERLINK" && (a = d[1]);
60
57
  }
61
- if (a = P({
58
+ if (a = E({
62
59
  value: a,
63
60
  field: o
64
61
  }).toString(), a = H({
@@ -68,48 +65,48 @@ function Y(c) {
68
65
  const d = t.aggregations.find((C) => C.name === e);
69
66
  d?.value && (i = +d.value);
70
67
  }
71
- i = +P({
68
+ i = +E({
72
69
  value: i,
73
- field: f
70
+ field: u
74
71
  }), h += i, typeof n[e] == "number" && (S = i / n[e] * 100);
75
- const A = +t.dimension.id == -1, V = p.length, D = Math.min(V, l) - 1, b = v === N - 1 && !A || V < N && l >= V;
72
+ const A = +t.dimension.id == -1, V = p.length, D = Math.min(V, m) - 1, b = v === N - 1 && !A || V < N && m >= V;
76
73
  if (v < D || b) {
77
74
  const d = typeof t.dimension.id > "u" ? "" : t.dimension.id;
78
- g.push({
79
- id: W(d) ? `null_${s}` : d,
75
+ f.push({
76
+ id: F(d) ? `null_${r}` : d,
80
77
  name: a,
81
78
  value: i,
82
79
  percent: S
83
80
  }), v++;
84
81
  } else
85
- w += i, s === p.length - 1 && typeof n[e] == "number" && (y = w / n[e] * 100);
86
- }), g.push({
82
+ w += i, r === p.length - 1 && typeof n[e] == "number" && (y = w / n[e] * 100);
83
+ }), f.push({
87
84
  id: -1,
88
85
  name: "Other",
89
86
  value: w,
90
87
  percent: y
91
88
  }), {
92
- data: g.length > 0 ? g : [],
89
+ data: f.length > 0 ? f : [],
93
90
  totalValue: h
94
91
  };
95
92
  }
96
- const j = (c) => {
97
- const { nodeViewProps: m } = c, {
98
- extension: { options: u },
99
- node: r
100
- } = m, [l, I] = E(""), [g, p] = E(0), [n, f] = E(), { data: e, dataSourceSchema: h, isLoading: v, error: w } = _({
101
- id: l,
93
+ const j = (g) => {
94
+ const { nodeViewProps: c } = g, {
95
+ extension: { options: l },
96
+ node: s
97
+ } = c, [m, I] = P(""), [f, p] = P(0), [n, u] = P(), { data: e, dataSourceSchema: h, isLoading: v, error: w } = _({
98
+ id: m,
102
99
  attrs: n,
103
- dataSourceId: g,
100
+ dataSourceId: f,
104
101
  enabled: !!n
105
102
  });
106
103
  T(() => {
107
- const { messageId: o, dataSourceId: t } = G({
108
- messageId: U(),
109
- dataSourceId: K()
110
- }).parse(u);
111
- f(z.parse(r.attrs)), I(o), p(t);
112
- }, [r.attrs, u]);
104
+ const { messageId: o, dataSourceId: t } = K({
105
+ messageId: W(),
106
+ dataSourceId: U()
107
+ }).parse(l);
108
+ u(z.parse(s.attrs)), I(o), p(t);
109
+ }, [s.attrs, l]);
113
110
  const y = O(() => {
114
111
  if (!(e && n && h))
115
112
  return null;
@@ -127,21 +124,21 @@ const j = (c) => {
127
124
  };
128
125
  }, [e, n, h]);
129
126
  return { data: y?.data, settings: y?.settings, isLoading: v, error: w };
130
- }, J = (c) => {
131
- const { chartWrapperSize: m, renderDropdownAction: u } = c, { data: r, settings: l, isLoading: I } = j({
132
- nodeViewProps: c
127
+ }, J = (g) => {
128
+ const { chartWrapperSize: c, renderDropdownAction: l } = g, { data: s, settings: m, isLoading: I } = j({
129
+ nodeViewProps: g
133
130
  });
134
- return I || !r || !l || !m ? /* @__PURE__ */ React.createElement(M, { indicatorSize: 20 }) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
131
+ return I || !s || !m || !c ? /* @__PURE__ */ React.createElement(M, { indicatorSize: 20 }) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
135
132
  L.PieChart,
136
133
  {
137
- data: r.data,
138
- metric: l.metric,
139
- dimension: l.dimension,
134
+ data: s.data,
135
+ metric: m.metric,
136
+ dimension: m.dimension,
140
137
  minWidthOfLegend: 200,
141
- width: m.width,
142
- height: m.height
138
+ width: c.width,
139
+ height: c.height
143
140
  }
144
- ), u(r.data));
141
+ ), l(s.data));
145
142
  };
146
143
  export {
147
144
  J as PieChartNodeView