@astrato-io/visualizations 0.0.0-stage → 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 +23 -0
- package/LICENSE +93 -0
- package/README.md +843 -2
- package/THIRD_PARTY_NOTICES.md +8477 -0
- package/VISUALIZATION_DEFINITIONS.md +2378 -0
- package/chunks/ClickAwayListener-BbeNMAvj.js +52 -0
- package/chunks/LinearProgress-B1FeWaen.js +253 -0
- package/chunks/accessors-DemrDevR.js +128 -0
- package/chunks/app-filter-bar.compiler-BGJ7HAbr.js +64 -0
- package/chunks/bar.compiler-CT0ZbQKc.js +374 -0
- package/chunks/builder-B6dWSIdD.js +12289 -0
- package/chunks/color-settings-ZIvgNTq1.js +10 -0
- package/chunks/coloring-B1XAfg6b.js +664 -0
- package/chunks/debounce-fn-CUixuz45.js +7 -0
- package/chunks/definitions-D3OVqmXl.js +2102 -0
- package/chunks/escobar-eDjtGpkC.js +34606 -0
- package/chunks/events-WZut5Ow6.js +4 -0
- package/chunks/extend-BKUkc4_i.js +37 -0
- package/chunks/filter.compiler-DBsyRBJt.js +70 -0
- package/chunks/filtering-tqjAyJH5.js +1072 -0
- package/chunks/grouping-type-On4s9Thj.js +3 -0
- 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-BGElBy5Z.js +28 -0
- package/chunks/number.compiler-G-R7y16P.js +53 -0
- package/chunks/operations-CTNUX6Sy.js +26249 -0
- package/chunks/range-CiwTbMig.js +22 -0
- package/chunks/registry-CsQQzukD.js +920 -0
- package/chunks/requirements-DYjZCFyf.js +6 -0
- package/chunks/rolldown-runtime-DleVn1XH.js +28 -0
- package/chunks/set-coloring-datafield-B3uIS1Pe.js +8 -0
- package/chunks/shared-CBvcC5YV.js +1218 -0
- package/chunks/src-BOS6SqkZ.js +67 -0
- package/chunks/src-D9XogOrc.js +422 -0
- package/chunks/standalone-0M4HlmDW2.js +3944 -0
- package/chunks/standalone-0ashe9w1.js +411 -0
- package/chunks/standalone-B7jax8wa.js +339 -0
- package/chunks/standalone-BK0VYU-l.js +463 -0
- package/chunks/standalone-BMIbT1b2.js +4619 -0
- package/chunks/standalone-BZV5vOwA.js +6 -0
- package/chunks/standalone-BhDrWj4p.js +1980 -0
- package/chunks/standalone-BtSHCp2U2.js +673 -0
- package/chunks/standalone-BvaKdky9.js +344 -0
- package/chunks/standalone-BwtM31-f.js +2 -0
- package/chunks/standalone-C3gg736V.js +1129 -0
- package/chunks/standalone-CC1VUjO32.js +299 -0
- package/chunks/standalone-C_rYnZ0N.js +741 -0
- package/chunks/standalone-CoLrAxRV.js +13198 -0
- package/chunks/standalone-DC-aUgXC.js +3855 -0
- package/chunks/standalone-DCtRoTWg.js +675 -0
- package/chunks/standalone-DUDFTBqL.js +833 -0
- package/chunks/standalone-DhZkX9Td.js +2 -0
- package/chunks/standalone-DtLElfuM.js +512 -0
- package/chunks/standalone-G9Q4Uczu.js +726 -0
- package/chunks/standalone-JuLF-OoH.js +1762 -0
- package/chunks/standalone-_DeX21JJ.js +383 -0
- package/chunks/standalone-gFhKZh8m.js +179 -0
- package/chunks/standalone-tDNy-SFH.js +281 -0
- package/chunks/standalone-v1oxfU20.js +68 -0
- package/chunks/standalone-vzBY6q0I2.js +140 -0
- package/chunks/stroke-dash-UgMEcCS4.js +6 -0
- package/chunks/table.compiler-tb914oj3.js +222 -0
- package/chunks/typeof-CJDtcySz.js +13 -0
- package/chunks/ui-DQWtv2iM.js +63551 -0
- package/chunks/url-utils-B17gj_mr.js +5501 -0
- package/chunks/useFieldName-BvdcoJRl.js +7 -0
- package/chunks/utils-Bg7K-t6K.js +32379 -0
- package/chunks/view-Bn83C8d9.js +12466 -0
- package/definitions.js +3 -0
- package/docs/operations/astrato-app-filter-bar.md +161 -0
- package/docs/operations/bar.md +6968 -0
- package/docs/operations/combo.md +5804 -0
- package/docs/operations/date-picker.md +644 -0
- package/docs/operations/distribution-gauge.md +3082 -0
- package/docs/operations/dot.md +5570 -0
- package/docs/operations/filter.md +1483 -0
- package/docs/operations/gauge.md +3316 -0
- package/docs/operations/heatMap.md +5944 -0
- package/docs/operations/histogram.md +1856 -0
- package/docs/operations/iframe.md +56 -0
- package/docs/operations/image.md +177 -0
- package/docs/operations/index.md +46 -0
- package/docs/operations/line.md +6391 -0
- package/docs/operations/number.md +3903 -0
- package/docs/operations/pie.md +5956 -0
- package/docs/operations/radar.md +4566 -0
- package/docs/operations/sankey.md +3088 -0
- package/docs/operations/scatter.md +5969 -0
- package/docs/operations/shape.md +315 -0
- package/docs/operations/simpleTextObject.md +699 -0
- package/docs/operations/slider.md +220 -0
- package/docs/operations/table.md +8800 -0
- package/docs/operations/tree.md +2867 -0
- package/docs/operations/treemap.md +3527 -0
- package/docs/operations/waterfall.md +2928 -0
- package/docs/operations/word-cloud.md +3000 -0
- package/getters.js +18 -0
- package/index.js +1183 -0
- package/metadata.js +20 -0
- package/operations.js +64 -0
- package/package.json +185 -4
- package/src/definitions/index.d.ts +2 -0
- package/src/definitions/model/definitions/available-fields.d.ts +35 -0
- package/src/definitions/model/definitions/compilers/compile.d.ts +7 -0
- 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/model/definitions/registry/compile.d.ts +2 -0
- 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/model/definitions/schemas/app-filter-bar.schema.d.ts +22 -0
- package/src/definitions/model/definitions/schemas/bar.schema.d.ts +73 -0
- package/src/definitions/model/definitions/schemas/broad-chart.schema.d.ts +68 -0
- package/src/definitions/model/definitions/schemas/common.schema.d.ts +303 -0
- package/src/definitions/model/definitions/schemas/filter.schema.d.ts +22 -0
- package/src/definitions/model/definitions/schemas/index.d.ts +9 -0
- package/src/definitions/model/definitions/schemas/line.schema.d.ts +72 -0
- package/src/definitions/model/definitions/schemas/number.schema.d.ts +21 -0
- package/src/definitions/model/definitions/schemas/object.schema.d.ts +215 -0
- package/src/definitions/model/definitions/schemas/table.schema.d.ts +458 -0
- package/src/definitions/model/definitions/types/compilation.types.d.ts +36 -0
- package/src/definitions/model/definitions/types/definition.types.d.ts +2 -0
- package/src/definitions/model/definitions/types/descriptor.types.d.ts +39 -0
- package/src/definitions/model/definitions/types/index.d.ts +3 -0
- package/src/definitions/model/definitions/validation.d.ts +3 -0
- package/src/getters/index.d.ts +30 -0
- package/src/index.d.ts +4 -0
- package/src/metadata/index.d.ts +4 -0
- package/src/operations/index.d.ts +30 -0
- package/src/registry/index.d.ts +6 -0
- package/src/runtime/index.d.ts +2 -0
- package/src/types.d.ts +307 -0
- package/src/visualization-catalog.d.ts +82 -0
- package/src/web-components/index.d.ts +12 -0
- package/styles.css +2 -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 };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { o as e } from "./rolldown-runtime-DleVn1XH.js";
|
|
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
|
+
iframeWrapper: {
|
|
6
|
+
width: "100%",
|
|
7
|
+
height: "100%",
|
|
8
|
+
display: "flex",
|
|
9
|
+
justifyContent: "center",
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
position: "relative"
|
|
12
|
+
},
|
|
13
|
+
overlay: {
|
|
14
|
+
position: "absolute",
|
|
15
|
+
top: 0,
|
|
16
|
+
left: 0,
|
|
17
|
+
width: "100%",
|
|
18
|
+
height: "100%",
|
|
19
|
+
backgroundColor: "transparent",
|
|
20
|
+
pointerEvents: "all",
|
|
21
|
+
zIndex: 1
|
|
22
|
+
},
|
|
23
|
+
emptyState: {
|
|
24
|
+
width: "100%",
|
|
25
|
+
height: "100%"
|
|
26
|
+
}
|
|
27
|
+
}), u = i(), d = n(), f = ({ vSpec: e = d }) => {
|
|
28
|
+
let n = t(e.iframeSettings.url, null), i = s(), a = l(), o = r();
|
|
29
|
+
if ((0, c.useEffect)(() => {
|
|
30
|
+
i();
|
|
31
|
+
}, []), !n) return /* @__PURE__ */ (0, u.jsx)("div", {
|
|
32
|
+
className: a.emptyState,
|
|
33
|
+
"data-testid": "iframe-empty-container"
|
|
34
|
+
});
|
|
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
|
+
return o.daedalus.objectCapabilities.editable ? /* @__PURE__ */ (0, u.jsxs)("div", {
|
|
37
|
+
className: a.iframeWrapper,
|
|
38
|
+
"data-testid": "iframe-container",
|
|
39
|
+
children: [/* @__PURE__ */ (0, u.jsx)("iframe", {
|
|
40
|
+
src: n,
|
|
41
|
+
width: "100%",
|
|
42
|
+
height: "100%",
|
|
43
|
+
style: { border: "none" },
|
|
44
|
+
sandbox: f,
|
|
45
|
+
allow: p,
|
|
46
|
+
loading: "lazy",
|
|
47
|
+
referrerPolicy: "no-referrer-when-downgrade",
|
|
48
|
+
"data-testid": "iframe-content"
|
|
49
|
+
}), /* @__PURE__ */ (0, u.jsx)("div", {
|
|
50
|
+
className: a.overlay,
|
|
51
|
+
"data-testid": "iframe-overlay"
|
|
52
|
+
})]
|
|
53
|
+
}) : /* @__PURE__ */ (0, u.jsx)("div", {
|
|
54
|
+
className: a.iframeWrapper,
|
|
55
|
+
"data-testid": "iframe-container",
|
|
56
|
+
children: /* @__PURE__ */ (0, u.jsx)("iframe", {
|
|
57
|
+
src: n,
|
|
58
|
+
width: "100%",
|
|
59
|
+
height: "100%",
|
|
60
|
+
style: { border: "none" },
|
|
61
|
+
sandbox: f,
|
|
62
|
+
allow: p,
|
|
63
|
+
loading: "lazy",
|
|
64
|
+
referrerPolicy: "no-referrer-when-downgrade"
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
export { f as IframeObject };
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { o as e } from "./rolldown-runtime-DleVn1XH.js";
|
|
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
|
+
import { t as m } from "./events-WZut5Ow6.js";
|
|
5
|
+
var h = /* @__PURE__ */ e(c());
|
|
6
|
+
h.forwardRef(function(e, t) {
|
|
7
|
+
return h.createElement("img", {
|
|
8
|
+
...e,
|
|
9
|
+
ref: t,
|
|
10
|
+
src: "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"
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
var g = "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", _ = (e, t, n) => t?.imageSettings.image?.mediaItemId ? e.daedalus.mediaApi.getUrl(t?.imageSettings.image?.mediaItemId) : t?.imageSettings.image?.imageUrl ? t?.imageSettings.image?.imageUrl : t?.imageSettings.image?.imageVariable && n?.[t?.imageSettings.image?.imageVariable]?.value ? `${n?.[t?.imageSettings.image?.imageVariable]?.value}` : "", v = (e, n, r) => ({
|
|
14
|
+
imageSrc: _(e, n, r),
|
|
15
|
+
imageFit: n?.imageSettings.image?.imageFit ?? t.Contain,
|
|
16
|
+
opacity: n?.imageSettings.opacity ?? 1,
|
|
17
|
+
saturation: n?.imageSettings.saturation ?? 1,
|
|
18
|
+
blur: n?.imageSettings.blur ?? 0,
|
|
19
|
+
shadow: n?.imageSettings.shadow ?? !1
|
|
20
|
+
}), y = s({
|
|
21
|
+
singleImageContainer: {
|
|
22
|
+
display: "flex",
|
|
23
|
+
height: "100%",
|
|
24
|
+
width: "100%"
|
|
25
|
+
},
|
|
26
|
+
previewImageContainer: {
|
|
27
|
+
display: "flex",
|
|
28
|
+
height: "100%",
|
|
29
|
+
width: "100%",
|
|
30
|
+
justifyContent: "center",
|
|
31
|
+
alignItems: "center",
|
|
32
|
+
"& img": {
|
|
33
|
+
maxWidth: "100%",
|
|
34
|
+
maxHeight: "100%"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
addGalleryButton: {
|
|
38
|
+
...d.normal14,
|
|
39
|
+
padding: "10px 20px",
|
|
40
|
+
background: n.white,
|
|
41
|
+
borderRadius: 4,
|
|
42
|
+
border: `1px solid ${n.grey3}`,
|
|
43
|
+
color: n.secondaryPurple,
|
|
44
|
+
cursor: "pointer",
|
|
45
|
+
display: "flex",
|
|
46
|
+
justifyContent: "center",
|
|
47
|
+
alignItems: "center"
|
|
48
|
+
},
|
|
49
|
+
buttonIcon: { marginRight: 5 }
|
|
50
|
+
}), b = s({
|
|
51
|
+
mainContainer: {
|
|
52
|
+
display: "flex",
|
|
53
|
+
flexDirection: "column",
|
|
54
|
+
width: "100%",
|
|
55
|
+
flexGrow: 1,
|
|
56
|
+
maxHeight: "100%"
|
|
57
|
+
},
|
|
58
|
+
imageContainer: {
|
|
59
|
+
position: "relative",
|
|
60
|
+
display: "block",
|
|
61
|
+
width: "100%",
|
|
62
|
+
flexGrow: 1,
|
|
63
|
+
maxHeight: "100%"
|
|
64
|
+
},
|
|
65
|
+
image: {
|
|
66
|
+
height: "100%",
|
|
67
|
+
width: "100%",
|
|
68
|
+
pointerEvents: "none",
|
|
69
|
+
objectFit: "contain",
|
|
70
|
+
position: "absolute",
|
|
71
|
+
top: 0,
|
|
72
|
+
left: 0,
|
|
73
|
+
"&.cover": { objectFit: "cover" },
|
|
74
|
+
"&.contain": { objectFit: "contain" },
|
|
75
|
+
"&.fill": { objectFit: "fill" },
|
|
76
|
+
"&.none": { objectFit: "none" }
|
|
77
|
+
}
|
|
78
|
+
}), x = a(), S = (e) => o({
|
|
79
|
+
contain: e === t.Contain,
|
|
80
|
+
cover: e === t.Cover,
|
|
81
|
+
fill: e === t.Fill,
|
|
82
|
+
none: e === t.None
|
|
83
|
+
}), C = ({ imageSrc: e, imageFit: t, opacity: n, saturation: r, blur: i, shadow: a, onLoadCallback: s }) => {
|
|
84
|
+
let c = b(), l = a ? "drop-shadow(0px 3px 6px rgba(0,0,0,0.25))" : "";
|
|
85
|
+
return /* @__PURE__ */ (0, x.jsx)("div", {
|
|
86
|
+
className: c.mainContainer,
|
|
87
|
+
children: /* @__PURE__ */ (0, x.jsx)("div", {
|
|
88
|
+
className: c.imageContainer,
|
|
89
|
+
children: /* @__PURE__ */ (0, x.jsx)("img", {
|
|
90
|
+
className: o({
|
|
91
|
+
[c.image]: !0,
|
|
92
|
+
[S(t)]: !0
|
|
93
|
+
}),
|
|
94
|
+
style: {
|
|
95
|
+
filter: `blur(${i}px) saturate(${r}) ${l}`,
|
|
96
|
+
opacity: n
|
|
97
|
+
},
|
|
98
|
+
alt: "",
|
|
99
|
+
title: e.trim() ? "" : "Add Image",
|
|
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: s,
|
|
102
|
+
onError: s
|
|
103
|
+
})
|
|
104
|
+
})
|
|
105
|
+
});
|
|
106
|
+
}, w = r(({ vSpec: e }) => {
|
|
107
|
+
let t = i(), r = y(), { variablesDict: a } = l(), o = v(t, e, a), s = u();
|
|
108
|
+
return (0, h.useEffect)(() => {
|
|
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
|
+
className: r.previewImageContainer,
|
|
112
|
+
children: /* @__PURE__ */ (0, x.jsxs)("button", {
|
|
113
|
+
"data-testid": "open-media-gallery-button",
|
|
114
|
+
className: r.addGalleryButton,
|
|
115
|
+
onClick: () => {
|
|
116
|
+
t.emitEvent(f.SET_PROPERTY_PANEL_OBJECT_TAB, "ITEM"), t.emitEvent(m.OpenMediaPicker);
|
|
117
|
+
},
|
|
118
|
+
children: [/* @__PURE__ */ (0, x.jsx)(p, {
|
|
119
|
+
fill: n.mainDarkNavy,
|
|
120
|
+
size: 16,
|
|
121
|
+
className: r.buttonIcon
|
|
122
|
+
}), "Add from the Gallery"]
|
|
123
|
+
})
|
|
124
|
+
}) : /* @__PURE__ */ (0, x.jsx)("div", {
|
|
125
|
+
className: r.previewImageContainer,
|
|
126
|
+
children: /* @__PURE__ */ (0, x.jsx)("img", {
|
|
127
|
+
src: g,
|
|
128
|
+
alt: "no image",
|
|
129
|
+
onLoad: s,
|
|
130
|
+
onError: s
|
|
131
|
+
})
|
|
132
|
+
}) : /* @__PURE__ */ (0, x.jsx)("div", {
|
|
133
|
+
className: r.singleImageContainer,
|
|
134
|
+
children: /* @__PURE__ */ (0, x.jsx)(C, {
|
|
135
|
+
...o,
|
|
136
|
+
onLoadCallback: s
|
|
137
|
+
})
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
export { w as Image };
|