@astrato-io/visualizations 0.6.4 → 0.6.5
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/CHANGELOG.md +0 -0
- package/THIRD_PARTY_NOTICES.md +94 -4
- package/chunks/ClickAwayListener-BbeNMAvj.js +52 -0
- package/chunks/{LinearProgress-CUZ0D8_t.js → LinearProgress-B1FeWaen.js} +54 -54
- package/chunks/app-filter-bar.compiler-BGJ7HAbr.js +64 -0
- package/chunks/bar.compiler-CT0ZbQKc.js +374 -0
- package/chunks/{src-Cum_2NLV.js → builder-B6dWSIdD.js} +5779 -5635
- package/chunks/{coloring-C16AUZEi.js → coloring-B1XAfg6b.js} +234 -233
- package/chunks/{src-BC7cGcJ-.js → definitions-D3OVqmXl.js} +438 -360
- package/chunks/{escobar-BGqT1EsE.js → escobar-eDjtGpkC.js} +4645 -4619
- package/chunks/filter.compiler-DBsyRBJt.js +70 -0
- package/chunks/{filtering-Yq4DEa0t.js → filtering-tqjAyJH5.js} +432 -313
- package/chunks/{grouping-type-BX_9Ix5q.js → grouping-type-On4s9Thj.js} +1 -1
- package/chunks/handlers-VTBfIZYZ.js +13072 -0
- package/chunks/isEqual-BDxAhUo8.js +7514 -0
- package/chunks/line.compiler-CzdM5Ld0.js +198 -0
- package/chunks/{metadata-CPXdYoln.js → metadata-BGElBy5Z.js} +1 -1
- package/chunks/number.compiler-G-R7y16P.js +53 -0
- package/chunks/{src-C0LgoUWY.js → operations-CTNUX6Sy.js} +9576 -9432
- package/chunks/{range-DrzdfBX4.js → range-CiwTbMig.js} +2 -2
- package/chunks/{registry-CExpGJ1N.js → registry-CsQQzukD.js} +153 -153
- package/chunks/{requirements-DNhuShLS.js → requirements-DYjZCFyf.js} +1 -1
- package/chunks/{shared-CKDL4hx9.js → shared-CBvcC5YV.js} +460 -413
- package/chunks/{standalone-D5vnf-9y.js → standalone-0M4HlmDW2.js} +823 -822
- package/chunks/standalone-0ashe9w1.js +411 -0
- package/chunks/{standalone-C85u7U6I.js → standalone-B7jax8wa.js} +93 -94
- package/chunks/standalone-BK0VYU-l.js +463 -0
- package/chunks/{standalone-BDCwI6Hn.js → standalone-BMIbT1b2.js} +815 -815
- package/chunks/standalone-BZV5vOwA.js +6 -0
- package/chunks/standalone-BhDrWj4p.js +1980 -0
- package/chunks/{standalone-CNyNHKVx.js → standalone-BtSHCp2U2.js} +97 -98
- package/chunks/{standalone-CDQnr6qT.js → standalone-BvaKdky9.js} +95 -96
- package/chunks/standalone-BwtM31-f.js +2 -0
- package/chunks/{standalone-CY57qwZ-.js → standalone-C3gg736V.js} +153 -153
- package/chunks/{standalone-DFPva_ku.js → standalone-CC1VUjO32.js} +60 -60
- package/chunks/{standalone-CCNtaJ7s.js → standalone-C_rYnZ0N.js} +41 -41
- package/chunks/{standalone-CZynjFG7.js → standalone-CoLrAxRV.js} +3701 -3482
- package/chunks/{standalone-jiz0L2Dg.js → standalone-DC-aUgXC.js} +104 -104
- package/chunks/standalone-DCtRoTWg.js +675 -0
- package/chunks/standalone-DUDFTBqL.js +833 -0
- package/chunks/standalone-DhZkX9Td.js +2 -0
- package/chunks/{standalone-Dx3MLlrO.js → standalone-DtLElfuM.js} +141 -141
- package/chunks/{standalone-BmfMt74U.js → standalone-G9Q4Uczu.js} +192 -192
- package/chunks/{standalone-BH5NqDwp.js → standalone-JuLF-OoH.js} +390 -391
- package/chunks/standalone-_DeX21JJ.js +383 -0
- package/chunks/{standalone-lBm9hQ-q.js → standalone-gFhKZh8m.js} +34 -34
- package/chunks/standalone-tDNy-SFH.js +281 -0
- package/chunks/{standalone-rJ45Zfl1.js → standalone-v1oxfU20.js} +10 -10
- package/chunks/{standalone-BYm1UjLr.js → standalone-vzBY6q0I2.js} +18 -18
- package/chunks/table.compiler-tb914oj3.js +222 -0
- package/chunks/{ui-D1HQNIBy.js → ui-DQWtv2iM.js} +13485 -3973
- package/chunks/{useFieldName-oqQ3bvnO.js → useFieldName-BvdcoJRl.js} +1 -1
- package/chunks/{utils-Ba9T0TqC.js → utils-Bg7K-t6K.js} +7306 -6024
- package/chunks/{src-DvX5LU9T.js → view-Bn83C8d9.js} +2555 -4831
- package/definitions.js +3 -3
- package/docs/operations/astrato-app-filter-bar.md +17 -17
- package/docs/operations/bar.md +989 -1071
- package/docs/operations/combo.md +717 -738
- package/docs/operations/date-picker.md +25 -25
- package/docs/operations/distribution-gauge.md +471 -607
- package/docs/operations/dot.md +787 -879
- package/docs/operations/filter.md +139 -163
- package/docs/operations/gauge.md +491 -627
- package/docs/operations/heatMap.md +834 -916
- package/docs/operations/histogram.md +166 -180
- package/docs/operations/iframe.md +5 -5
- package/docs/operations/image.md +16 -16
- package/docs/operations/index.md +12 -12
- package/docs/operations/line.md +811 -888
- package/docs/operations/number.md +470 -536
- package/docs/operations/pie.md +825 -958
- package/docs/operations/radar.md +599 -679
- package/docs/operations/sankey.md +462 -584
- package/docs/operations/scatter.md +823 -929
- package/docs/operations/shape.md +34 -34
- package/docs/operations/simpleTextObject.md +18 -25
- package/docs/operations/slider.md +33 -43
- package/docs/operations/table.md +1160 -1150
- package/docs/operations/tree.md +354 -361
- package/docs/operations/treemap.md +545 -637
- package/docs/operations/waterfall.md +369 -379
- package/docs/operations/word-cloud.md +512 -583
- package/getters.js +3 -3
- package/index.js +51 -51
- package/metadata.js +3 -3
- package/operations.js +7 -7
- package/package.json +80 -86
- package/src/definitions/index.d.ts +2 -2
- package/src/definitions/{shared/lib → model/definitions}/available-fields.d.ts +0 -1
- package/src/definitions/{shared/lib/compilers/index.d.ts → model/definitions/compilers/compile.d.ts} +1 -1
- package/src/definitions/model/definitions/data-item-resolution.d.ts +19 -0
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +1341 -0
- package/src/definitions/model/definitions/descriptors/json-schema.d.ts +2 -0
- package/src/definitions/model/definitions/diagnostics.d.ts +5 -0
- package/src/definitions/model/definitions/field-suggestions.d.ts +2 -0
- package/src/definitions/model/definitions/index.d.ts +23 -0
- package/src/definitions/{shared/lib → model/definitions}/registry/compile.d.ts +1 -1
- package/src/definitions/model/definitions/registry/descriptor-registry.d.ts +3 -0
- package/src/definitions/model/definitions/schema-registry.d.ts +660 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/broad-chart.schema.d.ts +1 -1
- package/src/definitions/{shared/lib → model/definitions}/schemas/common.schema.d.ts +0 -1
- package/src/definitions/model/definitions/schemas/index.d.ts +9 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/object.schema.d.ts +6 -6
- package/src/definitions/{shared/lib → model/definitions}/types/definition.types.d.ts +1 -1
- package/src/definitions/model/definitions/types/index.d.ts +3 -0
- package/src/definitions/{shared/lib/registry → model/definitions}/validation.d.ts +1 -1
- package/chunks/Radio-Ciu-F4CU.js +0 -957
- package/chunks/ToggleButton-BCJc3Jlc.js +0 -153
- package/chunks/_baseFlatten-DPXPOrea.js +0 -7076
- package/chunks/app-filter-bar.compiler-j_CVoWTa.js +0 -55
- package/chunks/bar.compiler-oqaPzIut.js +0 -370
- package/chunks/data-item-resolution-1lvYB5ln.js +0 -53
- package/chunks/event-bus-KiSiCJrC.js +0 -2683
- package/chunks/filter.compiler-CuLtc_02.js +0 -60
- package/chunks/gauge-target-type-BkKXAqkX.js +0 -4
- package/chunks/interfaces-VUY4_yVO.js +0 -8742
- package/chunks/line-settings-DfYTUyPz.js +0 -4
- package/chunks/line.compiler-BpA_6Tc7.js +0 -188
- package/chunks/number.compiler-DbkWcG4S.js +0 -44
- package/chunks/pie-uv42Eqal.js +0 -10
- package/chunks/src-Dun_jXtz.js +0 -10295
- package/chunks/standalone-87YV_m9n.js +0 -687
- package/chunks/standalone-BLVAWLNJ.js +0 -385
- package/chunks/standalone-BPomtAVs.js +0 -2
- package/chunks/standalone-BXyBcUOQ.js +0 -2
- package/chunks/standalone-BllF4rDp.js +0 -383
- package/chunks/standalone-BqWyrnZI.js +0 -281
- package/chunks/standalone-DQxxNwF8.js +0 -675
- package/chunks/standalone-DS9T0FZ-.js +0 -830
- package/chunks/standalone-DzixzZAL.js +0 -411
- package/chunks/standalone-QJ1kKMnO.js +0 -6
- package/chunks/table.compiler-BrXkm4Fz.js +0 -213
- package/chunks/toInteger-DVZr-D1j.js +0 -11
- package/chunks/treemap-x_zmJoG7.js +0 -23
- package/chunks/types-dVVCsDWD.js +0 -4
- package/chunks/view-CLqWMV7Z.js +0 -156
- package/src/definitions/shared/index.d.ts +0 -5
- package/src/definitions/shared/lib/registry/descriptor-registry.d.ts +0 -587
- package/src/definitions/shared/lib/registry/index.d.ts +0 -3
- package/src/definitions/shared/lib/schemas/index.d.ts +0 -9
- package/src/definitions/shared/lib/types/index.d.ts +0 -3
- package/src/definitions/{shared/lib → model/definitions}/schemas/app-filter-bar.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/bar.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/filter.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/line.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/number.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/table.schema.d.ts +4 -4
- /package/src/definitions/{shared/lib → model/definitions}/types/compilation.types.d.ts +0 -0
- /package/src/definitions/{shared/lib → model/definitions}/types/descriptor.types.d.ts +0 -0
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { o as e } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
+
import { An as t, Cn as n, Fn as r, Ks as i, No as a, Sa as o, Si as s, Ta as c, Ys as l, fc as u, mc as d, vo as f, yo as p } from "./isEqual-BDxAhUo8.js";
|
|
3
|
+
import { $t as m, Ei as h, I as g, P as _, Yi as v } from "./utils-Bg7K-t6K.js";
|
|
4
|
+
import { Bm as y, Pm as b } from "./handlers-VTBfIZYZ.js";
|
|
5
|
+
import { t as x } from "./stroke-dash-UgMEcCS4.js";
|
|
6
|
+
import { B as S, Et as C, Ft as w, G as T, I as E, Jt as D, L as O, M as k, N as ee, Pt as A, Rt as j, St as M, Wt as N, Xt as P, Y as F, Yt as I, Zt as L, at as R, dn as z, dt as B, ft as V, gt as H, ht as U, i as W, j as G, kt as K, mt as q, n as J, rn as Y, sn as te, st as X, ut as Z, vt as Q } from "./escobar-eDjtGpkC.js";
|
|
7
|
+
import { g as ne, t as re } from "./coloring-B1XAfg6b.js";
|
|
8
|
+
import { t as ie } from "./set-coloring-datafield-B3uIS1Pe.js";
|
|
9
|
+
var ae = /* @__PURE__ */ e(v()), oe = (e, t, a) => {
|
|
10
|
+
let o = e.dimensions.filter((e) => s(e)), c = e.measures.filter((e) => s(e)), f = o[0], p = c[0], m = !1, h = {}, { coloring: g } = e || {}, _ = g?.fieldId;
|
|
11
|
+
if (g?.type === l.Categorical && (_ ||= u(f.dataItem)), g?.type === l.Gradient && (_ ||= u(p.dataItem)), _ && U(a, 0, { color: { field: _ } }), f && e?.axes?.dimension?.continuousAxis) {
|
|
12
|
+
let e = d(f.dataItem), t = !!f.datePart, i = n(e) || r(e);
|
|
13
|
+
m = !t && i;
|
|
14
|
+
}
|
|
15
|
+
if (h = M(ie(e, _), t, h), h = T(e, h, a.collections, m, !0), c.filter((e) => e.graphType === i.Bar).length > 1 && !e.barSettings?.grouped) {
|
|
16
|
+
let t = P(e, c.find((e) => e.graphType === i.Bar));
|
|
17
|
+
h[t].data = { collection: C.ComboChartCollection };
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
...a,
|
|
21
|
+
scales: h
|
|
22
|
+
};
|
|
23
|
+
}, $ = (e, t, n) => {
|
|
24
|
+
let r = e.measures.filter((e) => s(e)), a = e.dimensions.filter((e) => s(e)), o = (e.supportingMeasures ?? []).filter((e) => s(e)), c = r.reduce((e, t) => {
|
|
25
|
+
let n = u(t.dataItem);
|
|
26
|
+
return e[n] = { field: n }, e;
|
|
27
|
+
}, {}), l = k(o), d = a.reduce((e, t) => {
|
|
28
|
+
let n = u(t.dataItem);
|
|
29
|
+
return e[n] = { field: n }, e;
|
|
30
|
+
}, {}), f = a[0];
|
|
31
|
+
if (!f) return n;
|
|
32
|
+
let p = u(f.dataItem), m = {
|
|
33
|
+
key: C.ComboChartCollection,
|
|
34
|
+
data: { extract: [] }
|
|
35
|
+
};
|
|
36
|
+
if (m.data.extract = r.map((e, t) => {
|
|
37
|
+
let n = u(e.dataItem);
|
|
38
|
+
return {
|
|
39
|
+
field: p,
|
|
40
|
+
props: {
|
|
41
|
+
end: { field: n },
|
|
42
|
+
...c,
|
|
43
|
+
...l,
|
|
44
|
+
...d,
|
|
45
|
+
start: 0,
|
|
46
|
+
graphType: e.graphType,
|
|
47
|
+
measureIndex: t,
|
|
48
|
+
fieldId: n
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}), r.filter((e) => e.graphType === i.Bar).length > 1) {
|
|
52
|
+
let t = !!r.find((e) => e.graphType === i.Bar)?.secondaryAxis, n = new Map(r.map((e) => [u(e.dataItem), !!e.secondaryAxis]));
|
|
53
|
+
e.barSettings?.grouped || (m.data.stack = {
|
|
54
|
+
stackKey: (e) => e.graphType.value === i.Bar ? `${e.value}` : `${e.value}-${e.graphType.value}-${e.measureIndex.value}`,
|
|
55
|
+
value: (e) => {
|
|
56
|
+
let r = e.fieldId?.value;
|
|
57
|
+
return typeof r != "string" || n.get(r) !== t ? null : e.end.value;
|
|
58
|
+
},
|
|
59
|
+
offset: y.Diverging
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
...n,
|
|
64
|
+
collections: [...n.collections, m]
|
|
65
|
+
};
|
|
66
|
+
}, se = (e, t, n, r, a, o) => {
|
|
67
|
+
let c = [];
|
|
68
|
+
return e.measures.filter((e) => s(e)).forEach((r) => {
|
|
69
|
+
let s = u(r.dataItem), l = (e) => e.fieldId.value === s;
|
|
70
|
+
switch (r.graphType || e.type) {
|
|
71
|
+
case i.Bar:
|
|
72
|
+
c.push(le(e, t, a, n, r, o, l));
|
|
73
|
+
break;
|
|
74
|
+
case i.Point:
|
|
75
|
+
c.push(V(e, t, n, r, !1, C.ComboChartCollection, l));
|
|
76
|
+
break;
|
|
77
|
+
default: c.push(ce(e, t, n, r, l)), c.push(V(e, t, n, r, !r.showDataPoints, C.ComboChartCollection, l));
|
|
78
|
+
}
|
|
79
|
+
}), c.sort((e) => e.type === z.Box ? -1 : 0), {
|
|
80
|
+
...n,
|
|
81
|
+
components: [...n.components, ...c]
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
function ce(e, t, n, r, o) {
|
|
85
|
+
let c = e.dimensions.filter((e) => s(e));
|
|
86
|
+
if (!c[0]) throw Error("Combo chart without dimension is not supported.");
|
|
87
|
+
if (c.length > 1) throw Error("Combo chart currently support only one dimension.");
|
|
88
|
+
let l = x(r.strokeDash), d = u(r.dataItem), f = ne(e, n, t, r, d);
|
|
89
|
+
return {
|
|
90
|
+
type: z.Line,
|
|
91
|
+
layout: { displayOrder: w.VisualizationElement },
|
|
92
|
+
key: q(e, r, i.Line),
|
|
93
|
+
data: {
|
|
94
|
+
collection: C.ComboChartCollection,
|
|
95
|
+
filter: o
|
|
96
|
+
},
|
|
97
|
+
settings: {
|
|
98
|
+
orientation: e.orientation === a.Horizontal ? a.Vertical : a.Horizontal,
|
|
99
|
+
coordinates: {
|
|
100
|
+
major: { scale: I(e) },
|
|
101
|
+
minor: {
|
|
102
|
+
scale: P(e, r),
|
|
103
|
+
ref: d
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
layers: {
|
|
107
|
+
curve: e.lineSettings?.lineCurve,
|
|
108
|
+
skipCollisions: !0,
|
|
109
|
+
line: {
|
|
110
|
+
stroke: f,
|
|
111
|
+
strokeWidth: r.strokeWidth,
|
|
112
|
+
strokeDasharray: l
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
animations: {
|
|
117
|
+
enabled: !0,
|
|
118
|
+
presetId: "simple-opacity"
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function le(e, n, r, o, c, l, d) {
|
|
123
|
+
let f = e.dimensions.filter((e) => s(e)), p = e.measures.filter((e) => s(e) && e.graphType === i.Bar);
|
|
124
|
+
if (!f[0]) throw Error("Combo chart without dimension is not supported.");
|
|
125
|
+
let m = { scale: I(e) }, h = {
|
|
126
|
+
scale: P(e, c),
|
|
127
|
+
end: { ref: "end" }
|
|
128
|
+
}, g = {
|
|
129
|
+
minWidthPx: 2,
|
|
130
|
+
rx: t(e?.barSettings.barRadius, 0),
|
|
131
|
+
roundAllEdges: e?.barSettings?.roundAllEdges,
|
|
132
|
+
useCustomBoxRounding: !0,
|
|
133
|
+
boxPadding: e?.barSettings?.barPadding ?? te.scale.padding
|
|
134
|
+
};
|
|
135
|
+
g.fill = new re(e, n, r?.[0]?.itemsNotAffectedByFiltering).getColorDefinition({ ref: "fieldId" });
|
|
136
|
+
let _ = {
|
|
137
|
+
enabled: !0,
|
|
138
|
+
presetId: "bar-chart"
|
|
139
|
+
}, v = c?.graphType !== i.Bar;
|
|
140
|
+
if (p.length > 1 && e.barSettings?.grouped) {
|
|
141
|
+
let t = 1 * (1 / p.length), n = (1 - (e.barSettings?.barPadding ?? 0)) * t, r = .5 / p.length, i = (1 + 0 * (p.length - 1)) * r, a = p.findIndex((e) => u(e.dataItem) === u(c.dataItem));
|
|
142
|
+
m.fn = (n) => {
|
|
143
|
+
let r = n.resources.scale(I(e));
|
|
144
|
+
return r(n.datum.value) + i * r.bandwidth?.() + a * r.bandwidth?.() * t;
|
|
145
|
+
}, g.width = n;
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
type: z.Box,
|
|
149
|
+
layout: { displayOrder: w.VisualizationElement },
|
|
150
|
+
key: q(e, c, i.Bar),
|
|
151
|
+
data: {
|
|
152
|
+
collection: C.ComboChartCollection,
|
|
153
|
+
filter: d
|
|
154
|
+
},
|
|
155
|
+
settings: {
|
|
156
|
+
orientation: e.orientation ?? a.Vertical,
|
|
157
|
+
major: m,
|
|
158
|
+
minor: h,
|
|
159
|
+
box: g
|
|
160
|
+
},
|
|
161
|
+
animations: _,
|
|
162
|
+
brush: v ? null : N([""], l)
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
var ue = (e, t) => {
|
|
166
|
+
let n = t ? [b.Inside] : [
|
|
167
|
+
b.Inside,
|
|
168
|
+
b.Outside,
|
|
169
|
+
b.Opposite
|
|
170
|
+
];
|
|
171
|
+
return (e || [
|
|
172
|
+
{
|
|
173
|
+
position: b.Inside,
|
|
174
|
+
justify: 1
|
|
175
|
+
},
|
|
176
|
+
{ position: b.Outside },
|
|
177
|
+
{ position: b.Opposite }
|
|
178
|
+
]).map((e) => ({
|
|
179
|
+
...e,
|
|
180
|
+
possible: n.includes(e.position)
|
|
181
|
+
}));
|
|
182
|
+
}, de = ({ data: e }) => e ? e.end.value > e.start.value ? "up" : "down" : null, fe = ({ data: e }) => e ? e.end.value > e.start.value ? "right" : "left" : null, pe = (e, t, n, r, a, o) => {
|
|
183
|
+
let l = e.measures.filter((e) => s(e)), d = l.filter((e) => e.graphType === i.Bar), m = d.filter((e) => e.dataLabels?.show), h = d.length >= 2 && !("barSettings" in e && e.barSettings?.grouped), g = L(e), _ = m.map((n) => {
|
|
184
|
+
let r = !!n.dataLabels?.barLabelPlacements, a = ue(n.dataLabels?.barLabelPlacements, h).filter((e) => e.possible).map((e) => ({
|
|
185
|
+
position: e.position,
|
|
186
|
+
fill: e.position === b.Inside ? c.white : "#242424",
|
|
187
|
+
...e.justify === void 0 ? {} : { justify: e.justify },
|
|
188
|
+
...r ? { overflow: [b.Outside, b.Opposite].includes(e.position) } : {}
|
|
189
|
+
}));
|
|
190
|
+
return n.dataLabels?.showBackdrop && !h && (a = a.map((e) => ee(e, t, g))), {
|
|
191
|
+
key: `combo-bar-labels-${n.dataItem.uniqueSignature}`,
|
|
192
|
+
type: z.Labels,
|
|
193
|
+
layout: { displayOrder: w.Labels },
|
|
194
|
+
settings: { sources: [{
|
|
195
|
+
component: q(e, n, i.Bar),
|
|
196
|
+
selector: Y.Rect,
|
|
197
|
+
strategy: {
|
|
198
|
+
type: "bar",
|
|
199
|
+
settings: {
|
|
200
|
+
direction: g ? fe : de,
|
|
201
|
+
fontSize: D(n.dataLabels?.size),
|
|
202
|
+
fontFamily: t.fonts.general.fontFamily,
|
|
203
|
+
labels: [{
|
|
204
|
+
label: E(n),
|
|
205
|
+
placements: a
|
|
206
|
+
}]
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}] },
|
|
210
|
+
animations: {
|
|
211
|
+
enabled: !0,
|
|
212
|
+
presetId: "chart-labels"
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
}), v = {}, y = {}, x = l.filter((e) => e.graphType !== i.Bar).map((t) => {
|
|
216
|
+
let n = u(t.dataItem), r = q(e, t, i.Point);
|
|
217
|
+
return y[r] = n, v[r] = {
|
|
218
|
+
enabled: t.dataLabels?.show || !1,
|
|
219
|
+
fontSize: D(t.dataLabels?.size),
|
|
220
|
+
backdropColor: t.dataLabels?.backdropColor,
|
|
221
|
+
textColor: t.dataLabels?.textColor,
|
|
222
|
+
isColored: t.dataLabels?.isColored,
|
|
223
|
+
colorType: t.dataLabels?.showBackdrop ? f.Backdrop : f.Text,
|
|
224
|
+
density: t.dataLabels?.density || p.Medium
|
|
225
|
+
}, r;
|
|
226
|
+
}).filter((e) => v[e].enabled), C = x.length ? [S({
|
|
227
|
+
targetComponentKeys: x,
|
|
228
|
+
targetSelector: `.${B}`,
|
|
229
|
+
label: ({ data: e, node: t }) => e[y[t.key]]?.label,
|
|
230
|
+
skipBrush: !0
|
|
231
|
+
}, v, o, t)] : [];
|
|
232
|
+
if (_.length && C.length) {
|
|
233
|
+
let e = {
|
|
234
|
+
...C[0],
|
|
235
|
+
settings: {
|
|
236
|
+
...C[0].settings,
|
|
237
|
+
sources: [..._.flatMap((e) => e.settings.sources), ...C[0].settings.sources]
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
return {
|
|
241
|
+
...n,
|
|
242
|
+
components: [...n.components, e]
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
return {
|
|
246
|
+
...n,
|
|
247
|
+
components: [
|
|
248
|
+
...n.components,
|
|
249
|
+
..._,
|
|
250
|
+
...C
|
|
251
|
+
]
|
|
252
|
+
};
|
|
253
|
+
}, me = class extends G {
|
|
254
|
+
constructor() {
|
|
255
|
+
super([
|
|
256
|
+
$,
|
|
257
|
+
oe,
|
|
258
|
+
j,
|
|
259
|
+
Q,
|
|
260
|
+
se,
|
|
261
|
+
X,
|
|
262
|
+
H,
|
|
263
|
+
pe,
|
|
264
|
+
R,
|
|
265
|
+
F,
|
|
266
|
+
K,
|
|
267
|
+
A,
|
|
268
|
+
Z,
|
|
269
|
+
O
|
|
270
|
+
]);
|
|
271
|
+
}
|
|
272
|
+
}, he = h(), ge = m(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: a }) => {
|
|
273
|
+
let s = _(), [c] = (0, ae.useState)(() => new me()), l = g(), u = t || o, d = c.compile(e, u, n, r, a, i.Combo, s, l, J());
|
|
274
|
+
return d ? /* @__PURE__ */ (0, he.jsx)(W, {
|
|
275
|
+
config: a,
|
|
276
|
+
definition: d,
|
|
277
|
+
size: r,
|
|
278
|
+
vSpec: e
|
|
279
|
+
}) : null;
|
|
280
|
+
});
|
|
281
|
+
export { ge as ComboChart };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as e } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
var c = /* @__PURE__ */ e(
|
|
2
|
+
import { An as t, mr as n } from "./isEqual-BDxAhUo8.js";
|
|
3
|
+
import { Cn as r, Ei as i, G as a, Yi as o, d as s } from "./utils-Bg7K-t6K.js";
|
|
4
|
+
var c = /* @__PURE__ */ e(o()), l = a({
|
|
5
5
|
iframeWrapper: {
|
|
6
6
|
width: "100%",
|
|
7
7
|
height: "100%",
|
|
@@ -24,17 +24,17 @@ var c = /* @__PURE__ */ e(i()), l = r({
|
|
|
24
24
|
width: "100%",
|
|
25
25
|
height: "100%"
|
|
26
26
|
}
|
|
27
|
-
}), u =
|
|
28
|
-
let n = t(e.iframeSettings.url, null),
|
|
27
|
+
}), u = i(), d = n(), f = ({ vSpec: e = d }) => {
|
|
28
|
+
let n = t(e.iframeSettings.url, null), i = s(), a = l(), o = r();
|
|
29
29
|
if ((0, c.useEffect)(() => {
|
|
30
|
-
|
|
30
|
+
i();
|
|
31
31
|
}, []), !n) return /* @__PURE__ */ (0, u.jsx)("div", {
|
|
32
|
-
className:
|
|
32
|
+
className: a.emptyState,
|
|
33
33
|
"data-testid": "iframe-empty-container"
|
|
34
34
|
});
|
|
35
35
|
let f = "\n allow-scripts\n allow-forms\n allow-same-origin\n allow-popups\n allow-popups-to-escape-sandbox\n allow-modals\n allow-downloads\n ", p = "\n autoplay\n clipboard-write\n clipboard-read\n ";
|
|
36
36
|
return o.daedalus.objectCapabilities.editable ? /* @__PURE__ */ (0, u.jsxs)("div", {
|
|
37
|
-
className:
|
|
37
|
+
className: a.iframeWrapper,
|
|
38
38
|
"data-testid": "iframe-container",
|
|
39
39
|
children: [/* @__PURE__ */ (0, u.jsx)("iframe", {
|
|
40
40
|
src: n,
|
|
@@ -47,11 +47,11 @@ var c = /* @__PURE__ */ e(i()), l = r({
|
|
|
47
47
|
referrerPolicy: "no-referrer-when-downgrade",
|
|
48
48
|
"data-testid": "iframe-content"
|
|
49
49
|
}), /* @__PURE__ */ (0, u.jsx)("div", {
|
|
50
|
-
className:
|
|
50
|
+
className: a.overlay,
|
|
51
51
|
"data-testid": "iframe-overlay"
|
|
52
52
|
})]
|
|
53
53
|
}) : /* @__PURE__ */ (0, u.jsx)("div", {
|
|
54
|
-
className:
|
|
54
|
+
className: a.iframeWrapper,
|
|
55
55
|
"data-testid": "iframe-container",
|
|
56
56
|
children: /* @__PURE__ */ (0, u.jsx)("iframe", {
|
|
57
57
|
src: n,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { o as e } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Aa as t, Ta as n } from "./isEqual-BDxAhUo8.js";
|
|
3
|
+
import { $t as r, Cn as i, Ei as a, Fn as o, G as s, Yi as c, a as l, d as u, q as d, ta as f, zr as p } from "./utils-Bg7K-t6K.js";
|
|
4
4
|
import { t as m } from "./events-WZut5Ow6.js";
|
|
5
|
-
var h = /* @__PURE__ */ e(
|
|
5
|
+
var h = /* @__PURE__ */ e(c());
|
|
6
6
|
h.forwardRef(function(e, t) {
|
|
7
7
|
return h.createElement("img", {
|
|
8
8
|
...e,
|
|
@@ -17,7 +17,7 @@ var g = "data:image/svg+xml,%3Csvg%20width%3D%22177%22%20height%3D%22177%22%20vi
|
|
|
17
17
|
saturation: n?.imageSettings.saturation ?? 1,
|
|
18
18
|
blur: n?.imageSettings.blur ?? 0,
|
|
19
19
|
shadow: n?.imageSettings.shadow ?? !1
|
|
20
|
-
}), y =
|
|
20
|
+
}), y = s({
|
|
21
21
|
singleImageContainer: {
|
|
22
22
|
display: "flex",
|
|
23
23
|
height: "100%",
|
|
@@ -35,7 +35,7 @@ var g = "data:image/svg+xml,%3Csvg%20width%3D%22177%22%20height%3D%22177%22%20vi
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
addGalleryButton: {
|
|
38
|
-
...
|
|
38
|
+
...d.normal14,
|
|
39
39
|
padding: "10px 20px",
|
|
40
40
|
background: n.white,
|
|
41
41
|
borderRadius: 4,
|
|
@@ -47,7 +47,7 @@ var g = "data:image/svg+xml,%3Csvg%20width%3D%22177%22%20height%3D%22177%22%20vi
|
|
|
47
47
|
alignItems: "center"
|
|
48
48
|
},
|
|
49
49
|
buttonIcon: { marginRight: 5 }
|
|
50
|
-
}), b =
|
|
50
|
+
}), b = s({
|
|
51
51
|
mainContainer: {
|
|
52
52
|
display: "flex",
|
|
53
53
|
flexDirection: "column",
|
|
@@ -75,19 +75,19 @@ var g = "data:image/svg+xml,%3Csvg%20width%3D%22177%22%20height%3D%22177%22%20vi
|
|
|
75
75
|
"&.fill": { objectFit: "fill" },
|
|
76
76
|
"&.none": { objectFit: "none" }
|
|
77
77
|
}
|
|
78
|
-
}), x =
|
|
78
|
+
}), x = a(), S = (e) => o({
|
|
79
79
|
contain: e === t.Contain,
|
|
80
80
|
cover: e === t.Cover,
|
|
81
81
|
fill: e === t.Fill,
|
|
82
82
|
none: e === t.None
|
|
83
|
-
}), C = ({ imageSrc: e, imageFit: t, opacity: n, saturation: r, blur: i, shadow: a, onLoadCallback:
|
|
83
|
+
}), C = ({ imageSrc: e, imageFit: t, opacity: n, saturation: r, blur: i, shadow: a, onLoadCallback: s }) => {
|
|
84
84
|
let c = b(), l = a ? "drop-shadow(0px 3px 6px rgba(0,0,0,0.25))" : "";
|
|
85
85
|
return /* @__PURE__ */ (0, x.jsx)("div", {
|
|
86
86
|
className: c.mainContainer,
|
|
87
87
|
children: /* @__PURE__ */ (0, x.jsx)("div", {
|
|
88
88
|
className: c.imageContainer,
|
|
89
89
|
children: /* @__PURE__ */ (0, x.jsx)("img", {
|
|
90
|
-
className:
|
|
90
|
+
className: o({
|
|
91
91
|
[c.image]: !0,
|
|
92
92
|
[S(t)]: !0
|
|
93
93
|
}),
|
|
@@ -98,24 +98,24 @@ var g = "data:image/svg+xml,%3Csvg%20width%3D%22177%22%20height%3D%22177%22%20vi
|
|
|
98
98
|
alt: "",
|
|
99
99
|
title: e.trim() ? "" : "Add Image",
|
|
100
100
|
src: e.trim() || "data:image/svg+xml,%3Csvg%20width%3D%22177%22%20height%3D%22177%22%20viewBox%3D%220%200%20177%20177%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cpath%20d%3D%22M177%2041.2427V164.357C177%20167.71%20175.668%20170.926%20173.297%20173.297C170.926%20175.668%20167.71%20177%20164.357%20177H12.6429C9.28976%20177%206.074%20175.668%203.70301%20173.297C1.33201%20170.926%200%20167.71%200%20164.357V12.6429C0%209.28976%201.33201%206.074%203.70301%203.70301C6.074%201.33201%209.28976%200%2012.6429%200L135.757%200C139.11%200%20152.289%2016.5319%20154.66%2018.9029C157.031%2021.2739%20177%2037.8896%20177%2041.2427Z%22%20fill%3D%22%23F2F2F2%22%2F%3E%0A%20%20%3Cmask%20id%3D%22mask0%22%20mask-type%3D%22alpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%2225%22%20y%3D%2225%22%20width%3D%22127%22%20height%3D%22127%22%3E%0A%20%20%20%20%3Crect%20x%3D%2225.2857%22%20y%3D%2225.2857%22%20width%3D%22126.429%22%20height%3D%22126.429%22%20fill%3D%22%23F2F2F2%22%2F%3E%0A%20%20%3C%2Fmask%3E%0A%20%20%3Cg%20mask%3D%22url(%23mask0)%22%3E%0A%20%20%20%20%3Cpath%20d%3D%22M135.703%20147.315L126.644%20123.059L90.9439%2027.4276C90.4703%2026.1541%2089.227%2025.2857%2087.8653%2025.2857C86.4444%2025.2857%2085.201%2026.0962%2084.7274%2027.3118L61.2231%2083.9847L44.3497%2069.7441C43.3432%2068.8758%2041.8631%2068.7021%2040.679%2069.281C39.4949%2069.8599%2038.7252%2071.0756%2038.8436%2072.407L42.3367%20130.469C42.3959%20131.685%2043.1656%20132.727%2044.2905%20133.248C45.4154%20133.769%2046.7179%20133.595%2047.7244%20132.901L80.287%20108.645L130.493%20150.904C131.144%20151.425%20131.914%20151.714%20132.683%20151.714C133.335%20151.714%20133.986%20151.541%20134.578%20151.135C135.703%20150.267%20136.236%20148.704%20135.703%20147.315ZM58.5589%2090.4103L48.0796%20115.65L45.9482%2079.8167L58.5589%2090.4103ZM53.2896%20120.454L63.8873%2094.9257L75.0178%20104.304L53.2896%20120.454ZM66.5515%2088.5L87.6284%2037.616L104.324%2082.3638L80.4055%20100.136L66.5515%2088.5ZM85.6155%20104.593L106.752%2088.8474L120.369%20125.259L125.046%20137.763L85.6155%20104.593Z%22%20fill%3D%22%23BDBDBD%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%20%20%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M137.419%200H135.757V28.5999C135.757%2031.953%20137.089%2035.1687%20139.46%2037.5397C141.831%2039.9107%20145.047%2041.2427%20148.4%2041.2427H177V39.581L137.419%200Z%22%20fill%3D%22%23E0E0E0%22%2F%3E%0A%3C%2Fsvg%3E%0A",
|
|
101
|
-
onLoad:
|
|
102
|
-
onError:
|
|
101
|
+
onLoad: s,
|
|
102
|
+
onError: s
|
|
103
103
|
})
|
|
104
104
|
})
|
|
105
105
|
});
|
|
106
|
-
}, w =
|
|
107
|
-
let t =
|
|
106
|
+
}, w = r(({ vSpec: e }) => {
|
|
107
|
+
let t = i(), r = y(), { variablesDict: a } = l(), o = v(t, e, a), s = u();
|
|
108
108
|
return (0, h.useEffect)(() => {
|
|
109
|
-
(!e || !
|
|
110
|
-
}, [e,
|
|
109
|
+
(!e || !o.imageSrc) && t.daedalus.objectCapabilities.editable && s();
|
|
110
|
+
}, [e, o.imageSrc]), !e || !o.imageSrc ? t.daedalus.objectCapabilities.editable ? /* @__PURE__ */ (0, x.jsx)("div", {
|
|
111
111
|
className: r.previewImageContainer,
|
|
112
112
|
children: /* @__PURE__ */ (0, x.jsxs)("button", {
|
|
113
113
|
"data-testid": "open-media-gallery-button",
|
|
114
114
|
className: r.addGalleryButton,
|
|
115
115
|
onClick: () => {
|
|
116
|
-
t.emitEvent(
|
|
116
|
+
t.emitEvent(f.SET_PROPERTY_PANEL_OBJECT_TAB, "ITEM"), t.emitEvent(m.OpenMediaPicker);
|
|
117
117
|
},
|
|
118
|
-
children: [/* @__PURE__ */ (0, x.jsx)(
|
|
118
|
+
children: [/* @__PURE__ */ (0, x.jsx)(p, {
|
|
119
119
|
fill: n.mainDarkNavy,
|
|
120
120
|
size: 16,
|
|
121
121
|
className: r.buttonIcon
|
|
@@ -132,7 +132,7 @@ var g = "data:image/svg+xml,%3Csvg%20width%3D%22177%22%20height%3D%22177%22%20vi
|
|
|
132
132
|
}) : /* @__PURE__ */ (0, x.jsx)("div", {
|
|
133
133
|
className: r.singleImageContainer,
|
|
134
134
|
children: /* @__PURE__ */ (0, x.jsx)(C, {
|
|
135
|
-
...
|
|
135
|
+
...o,
|
|
136
136
|
onLoadCallback: s
|
|
137
137
|
})
|
|
138
138
|
});
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { a as e, ec as t, ns as n, qs as r } from "./isEqual-BDxAhUo8.js";
|
|
2
|
+
import { C as i, D as a, N as o, T as s, d as c, g as l, h as u, i as d, k as f, o as p, p as m, s as h, t as g, u as _, v, w as y, x as b, y as x } from "./shared-CBvcC5YV.js";
|
|
3
|
+
import { Hd as S, bd as C } from "./handlers-VTBfIZYZ.js";
|
|
4
|
+
import { p as w } from "./operations-CTNUX6Sy.js";
|
|
5
|
+
e();
|
|
6
|
+
var T = {
|
|
7
|
+
all: n.ShowAll,
|
|
8
|
+
auto: n.Auto,
|
|
9
|
+
horizontal: n.ShowHorizontal,
|
|
10
|
+
none: n.NoBorders,
|
|
11
|
+
vertical: n.ShowVertical
|
|
12
|
+
}, E = (e) => e.flatMap(([e, t]) => t === void 0 ? [] : [{
|
|
13
|
+
name: e,
|
|
14
|
+
payload: t
|
|
15
|
+
}]), D = (e) => e ? E([
|
|
16
|
+
[w.SET_TABLE_COLUMN_WIDTH_BEHAVIOR, e.columnWidthBehavior],
|
|
17
|
+
[w.SET_TABLE_FIXED_ROW_HEIGHT_ENABLED, e.rowHeight !== void 0 || void 0],
|
|
18
|
+
[w.SET_TABLE_FIXED_ROW_HEIGHT_VALUE, e.rowHeight]
|
|
19
|
+
]) : [], O = (e) => e ? E([
|
|
20
|
+
[w.SET_TABLE_BACKGROUND_TYPE, e.type],
|
|
21
|
+
[w.SET_TABLE_BACKGROUND_COLOR, e.color],
|
|
22
|
+
[w.SET_TABLE_ODD_BACKGROUND_COLOR, e.oddColor],
|
|
23
|
+
[w.SET_TABLE_EVEN_BACKGROUND_COLOR, e.evenColor]
|
|
24
|
+
]) : [], k = (e) => e ? E([
|
|
25
|
+
[w.SET_TABLE_BODY_FONT_FAMILY, e.fontFamily],
|
|
26
|
+
[w.SET_TABLE_BODY_FONT_SIZE, e.fontSize],
|
|
27
|
+
[w.SET_TABLE_ALL_COLUMNS_FONT_COLOR, e.fontColor],
|
|
28
|
+
[w.SET_TABLE_ALL_COLUMNS_FONT_STYLE, e.fontStyle],
|
|
29
|
+
[w.SET_TABLE_ALL_COLUMNS_HORIZONTAL_ALIGN, e.horizontalAlign],
|
|
30
|
+
[w.SET_TABLE_ALL_COLUMNS_VERTICAL_ALIGN, e.verticalAlign]
|
|
31
|
+
]) : [], A = (e) => e ? E([
|
|
32
|
+
[w.SET_TABLE_HEADER_BACKGROUND_COLOR, e.backgroundColor],
|
|
33
|
+
[w.SET_TABLE_HEADER_BORDER_COLOR, e.borderColor],
|
|
34
|
+
[w.SET_TABLE_HEADER_FONT_COLOR, e.fontColor],
|
|
35
|
+
[w.SET_TABLE_HEADER_FONT_FAMILY, e.fontFamily],
|
|
36
|
+
[w.SET_TABLE_HEADER_FONT_SIZE, e.fontSize],
|
|
37
|
+
[w.SET_TABLE_HEADER_FONT_STYLE, e.fontStyle],
|
|
38
|
+
[w.SET_TABLE_HEADER_RESPONSIVE_HEIGHT, e.responsiveHeight]
|
|
39
|
+
]) : [], j = (e) => e ? E([
|
|
40
|
+
[w.SET_TABLE_BORDER_ENABLED, e.enabled],
|
|
41
|
+
[w.SET_TABLE_BORDER_COLOR, e.color],
|
|
42
|
+
[w.SET_TABLE_BORDER_LINE_STYLE, e.lineStyle],
|
|
43
|
+
[w.SET_TABLE_BORDER_RADIUS, e.radius],
|
|
44
|
+
[w.SET_TABLE_BORDER_STROKE_WIDTH, e.strokeWidth],
|
|
45
|
+
[w.SET_TABLE_COLUMN_BORDERS, e.dividers === void 0 ? void 0 : T[e.dividers]],
|
|
46
|
+
[w.SET_TABLE_COLUMN_BORDER_COLOR, e.dividerColor]
|
|
47
|
+
]) : [], M = (e) => e ? E([
|
|
48
|
+
[w.SET_TABLE_HIGHLIGHT_MODE, e.mode],
|
|
49
|
+
[w.SET_TABLE_HIGHLIGHT_BACKGROUND_COLOR, e.backgroundColor],
|
|
50
|
+
[w.SET_TABLE_HIGHLIGHT_TEXT_COLOR, e.textColor]
|
|
51
|
+
]) : [], N = (e) => e ? [
|
|
52
|
+
...D(e.layout),
|
|
53
|
+
...O(e.background),
|
|
54
|
+
...k(e.body),
|
|
55
|
+
...A(e.header),
|
|
56
|
+
...j(e.borders),
|
|
57
|
+
...M(e.highlight)
|
|
58
|
+
] : [], P = (e) => e ? E([
|
|
59
|
+
[w.SET_TABLE_TOTALS_ENABLED, e.enabled],
|
|
60
|
+
[w.SET_TABLE_TOTALS_SHOW_RECORDS_COUNT, e.showRecordsCount],
|
|
61
|
+
[w.SET_TABLE_TOTALS_APPLY_TO, e.applyTo],
|
|
62
|
+
[w.SET_TABLE_TOTALS_BACKGROUND_COLOR, e.style?.backgroundColor],
|
|
63
|
+
[w.SET_TABLE_TOTALS_FONT_COLOR, e.style?.fontColor],
|
|
64
|
+
[w.SET_TABLE_TOTALS_FONT_STYLE, e.style?.fontStyle],
|
|
65
|
+
[w.SET_TABLE_TOTALS_POSITION, e.style?.position],
|
|
66
|
+
[w.SET_TABLE_TOTALS_RESPONSIVE_HEIGHT, e.style?.responsiveHeight]
|
|
67
|
+
]) : [], F = (e, t, n, r = !1) => ({
|
|
68
|
+
...e,
|
|
69
|
+
path: n,
|
|
70
|
+
role: t,
|
|
71
|
+
topDimension: r
|
|
72
|
+
}), I = (e) => "columns" in e ? [{
|
|
73
|
+
items: e.columns.map((e, t) => F(e, e.role, [
|
|
74
|
+
"data",
|
|
75
|
+
"columns",
|
|
76
|
+
t
|
|
77
|
+
])),
|
|
78
|
+
path: ["data", "columns"]
|
|
79
|
+
}] : e.structure === "expandable" ? [{
|
|
80
|
+
items: e.dimensions.map((e, t) => F(e, "dimension", [
|
|
81
|
+
"data",
|
|
82
|
+
"dimensions",
|
|
83
|
+
t
|
|
84
|
+
])),
|
|
85
|
+
path: ["data", "dimensions"]
|
|
86
|
+
}, {
|
|
87
|
+
items: e.measures.map((e, t) => F(e, "measure", [
|
|
88
|
+
"data",
|
|
89
|
+
"measures",
|
|
90
|
+
t
|
|
91
|
+
])),
|
|
92
|
+
path: ["data", "measures"]
|
|
93
|
+
}] : [
|
|
94
|
+
{
|
|
95
|
+
items: e.rowDimensions.map((e, t) => F(e, "dimension", [
|
|
96
|
+
"data",
|
|
97
|
+
"rowDimensions",
|
|
98
|
+
t
|
|
99
|
+
])),
|
|
100
|
+
path: ["data", "rowDimensions"]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
items: e.columnDimensions.map((e, t) => F(e, "dimension", [
|
|
104
|
+
"data",
|
|
105
|
+
"columnDimensions",
|
|
106
|
+
t
|
|
107
|
+
], !0)),
|
|
108
|
+
path: ["data", "columnDimensions"]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
items: e.measures.map((e, t) => F(e, "measure", [
|
|
112
|
+
"data",
|
|
113
|
+
"measures",
|
|
114
|
+
t
|
|
115
|
+
])),
|
|
116
|
+
path: ["data", "measures"]
|
|
117
|
+
}
|
|
118
|
+
], L = (e) => {
|
|
119
|
+
if (!(!("structure" in e) || e.structure === void 0)) switch (e.structure) {
|
|
120
|
+
case "normal": return r.Normal;
|
|
121
|
+
case "expandable": return r.Hierarchical;
|
|
122
|
+
case "pivot": return r.Pivot;
|
|
123
|
+
}
|
|
124
|
+
}, R = (e, t) => u(e, t.flatMap((t) => t.role !== "dimension" || t.showNullValues === void 0 ? [] : [{
|
|
125
|
+
name: w.SET_COLUMN_SHOW_NULL_VALUES,
|
|
126
|
+
payload: {
|
|
127
|
+
...x(e.resolvedRefs[t.ref]),
|
|
128
|
+
showNullValues: t.showNullValues
|
|
129
|
+
}
|
|
130
|
+
}]), ["data"]), z = (e, n, r) => {
|
|
131
|
+
let i = [
|
|
132
|
+
"formatType",
|
|
133
|
+
"formatString",
|
|
134
|
+
"currency",
|
|
135
|
+
"currencyIsPrefix",
|
|
136
|
+
"negativeType"
|
|
137
|
+
];
|
|
138
|
+
return u(e, n.flatMap((n) => {
|
|
139
|
+
let a = e.availableFields.find((e) => e.key === n.fieldKey), o = a ? t(a) : n.fieldKey;
|
|
140
|
+
return i.flatMap((e) => {
|
|
141
|
+
let t = n.format?.[e], i = r[e];
|
|
142
|
+
return t !== void 0 && i ? [m(i, o, n.ref, n.path, e, t, n.role)] : [];
|
|
143
|
+
});
|
|
144
|
+
}), ["data"]);
|
|
145
|
+
}, B = async (e) => {
|
|
146
|
+
let t = C(e);
|
|
147
|
+
if (t) return {
|
|
148
|
+
issues: [{
|
|
149
|
+
code: "invalid_structure",
|
|
150
|
+
message: t,
|
|
151
|
+
path: []
|
|
152
|
+
}],
|
|
153
|
+
success: !1
|
|
154
|
+
};
|
|
155
|
+
let n = o.safeParse(e.definition);
|
|
156
|
+
if (!n.success) return {
|
|
157
|
+
issues: y(n.error, e.definition),
|
|
158
|
+
success: !1
|
|
159
|
+
};
|
|
160
|
+
let r = S.safeParse(e.baseVSpec);
|
|
161
|
+
if (!r.success) return {
|
|
162
|
+
issues: [c("invalid_structure", ["baseVSpec"], "Base table vSpec is invalid.", { details: { issues: r.error.issues } })],
|
|
163
|
+
success: !1
|
|
164
|
+
};
|
|
165
|
+
let m = r.data;
|
|
166
|
+
if (!v(m, [
|
|
167
|
+
"columns",
|
|
168
|
+
"dimensions",
|
|
169
|
+
"measures",
|
|
170
|
+
"supportingMeasures",
|
|
171
|
+
"sortingMeasures"
|
|
172
|
+
])) return {
|
|
173
|
+
issues: [c("non_fresh_base_vspec", ["baseVSpec"], "Table definitions require a fresh base vSpec.")],
|
|
174
|
+
success: !1
|
|
175
|
+
};
|
|
176
|
+
let x = n.data, T = I(x.data), E = T.flatMap((e) => e.items), D = [
|
|
177
|
+
...E.flatMap((t) => a(t, e.availableFields, t.path, t.role)),
|
|
178
|
+
...i(T),
|
|
179
|
+
...f(x.filterGroup, e.availableFields),
|
|
180
|
+
...b(x.sorting, E.map((e) => e.ref))
|
|
181
|
+
];
|
|
182
|
+
if (D.length) return {
|
|
183
|
+
issues: D,
|
|
184
|
+
success: !1
|
|
185
|
+
};
|
|
186
|
+
let O = {
|
|
187
|
+
state: _(e, m),
|
|
188
|
+
success: !0
|
|
189
|
+
}, k = L(x.data);
|
|
190
|
+
k !== void 0 && (O = await u(O.state, [{
|
|
191
|
+
name: w.SET_TABLE_DATA_STRUCTURE,
|
|
192
|
+
payload: k
|
|
193
|
+
}], ["data", "structure"]));
|
|
194
|
+
for (let t of E) {
|
|
195
|
+
if ("issue" in O) return {
|
|
196
|
+
issues: [O.issue],
|
|
197
|
+
success: !1
|
|
198
|
+
};
|
|
199
|
+
O = await g(O.state, t, t.role, w.ADD_COLUMN, t.role === "measure" ? s(t, e.availableFields, { columnType: t.role }) : {
|
|
200
|
+
columnType: t.role,
|
|
201
|
+
key: t.fieldKey,
|
|
202
|
+
topDimension: t.topDimension
|
|
203
|
+
}, t.path);
|
|
204
|
+
}
|
|
205
|
+
return "issue" in O || (O = await R(O.state, E), "issue" in O) || (O = await h(O.state, E.filter((e) => e.role === "dimension"), w.SET_COLUMN_TEMPORAL_GROUPING, ["data"]), "issue" in O) || (O = await z(O.state, E, {
|
|
206
|
+
currency: w.SET_COLUMN_CURRENCY,
|
|
207
|
+
currencyIsPrefix: w.SET_COLUMN_CURRENCY_IS_PREFIX,
|
|
208
|
+
formatString: w.SET_COLUMN_FORMAT_STRING,
|
|
209
|
+
formatType: w.SET_COLUMN_FORMAT_TYPE,
|
|
210
|
+
negativeType: w.SET_COLUMN_NEGATIVE_TYPE
|
|
211
|
+
}), "issue" in O) || (O = await u(O.state, N(x.presentation), ["presentation"]), "issue" in O) || (O = await d(O.state, x.filterGroup), "issue" in O) || (O = await p(O.state, x.sorting, w.CHANGE_SORT_ORDER_AND_DIRECTION, w.TOGGLE_SORTING_ITEM), "issue" in O) || (O = await u(O.state, x.limiting?.queryLimit === void 0 ? [] : [{
|
|
212
|
+
name: w.SET_QUERY_LIMIT,
|
|
213
|
+
payload: x.limiting.queryLimit
|
|
214
|
+
}], ["limiting"]), "issue" in O) ? {
|
|
215
|
+
issues: [O.issue],
|
|
216
|
+
success: !1
|
|
217
|
+
} : (O = await u(O.state, P(x.totals), ["totals"]), "issue" in O ? {
|
|
218
|
+
issues: [O.issue],
|
|
219
|
+
success: !1
|
|
220
|
+
} : l(O.state, S));
|
|
221
|
+
};
|
|
222
|
+
export { B as compileTableVisualizationDefinition };
|