react-semaphor 0.1.366 → 0.1.367
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/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +1 -1
- package/dist/chunks/{validation-WGWJOQsV.js → validation-CrUjNWby.js} +1 -1
- package/dist/chunks/{validation-DiCE3_4O.js → validation-DGl8wnTt.js} +1 -1
- package/dist/chunks/validators-Dq5X4mp0.js +1 -0
- package/dist/chunks/{validators-Bxc1OmZK.js → validators-L0xEXtjf.js} +257 -249
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +200 -193
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +400 -271
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +2 -2
- package/dist/types/analytics-protocol.d.ts +1 -1
- package/dist/types/dashboard-assistant.d.ts +1 -1
- package/dist/types/dashboard-authoring.d.ts +1 -1
- package/dist/types/data-app-builder.d.ts +1 -1
- package/dist/types/data-app-sdk-validation.d.ts +1 -1
- package/dist/types/data-app-sdk.d.ts +5 -1
- package/dist/types/main.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunks/validators-BxhJ_NtM.js +0 -1
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { D as B, a as
|
|
2
|
-
import { s as
|
|
3
|
-
import { v as
|
|
4
|
-
import { b as
|
|
1
|
+
import { D as B, a as be } from "../chunks/contracts-CoCOpd_i.js";
|
|
2
|
+
import { s as Ie, a as E, p as ye } from "../chunks/source-identity-Dj3dryN9.js";
|
|
3
|
+
import { v as ae, d as _e, n as we } from "../chunks/validators-L0xEXtjf.js";
|
|
4
|
+
import { b as ve } from "../chunks/catalog-field-grounding-DoEBOXQd.js";
|
|
5
5
|
function _(e) {
|
|
6
6
|
return e && typeof e == "object" ? e : null;
|
|
7
7
|
}
|
|
8
8
|
function C(e) {
|
|
9
9
|
return typeof e == "string" ? e : null;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function Se(e) {
|
|
12
12
|
var t, n, r;
|
|
13
13
|
return !!(e && typeof e == "object") && (((t = _(e)) == null ? void 0 : t.kind) === "semantic" || ((n = _(e)) == null ? void 0 : n.kind) === "physical" || ((r = _(e)) == null ? void 0 : r.kind) === "sql");
|
|
14
14
|
}
|
|
15
15
|
function z(e) {
|
|
16
|
-
return
|
|
16
|
+
return Se(e) ? e.kind === "semantic" ? !!(e.domainId && e.datasetName) : e.kind === "physical" ? !!(e.connectionId && e.tableName) : !1 : !1;
|
|
17
17
|
}
|
|
18
18
|
function wt(e) {
|
|
19
|
-
return
|
|
19
|
+
return Ie(e);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function ie(e, t) {
|
|
22
22
|
return E(e, t);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
24
|
+
function Ce(e, t) {
|
|
25
|
+
return ye(e, t);
|
|
26
26
|
}
|
|
27
27
|
function P(e) {
|
|
28
28
|
const t = [];
|
|
29
29
|
for (const n of e) {
|
|
30
30
|
const r = t.findIndex(
|
|
31
|
-
(
|
|
31
|
+
(o) => ie(o, n)
|
|
32
32
|
);
|
|
33
|
-
r === -1 ? t.push(n) : t[r] =
|
|
33
|
+
r === -1 ? t.push(n) : t[r] = Ce(
|
|
34
34
|
t[r],
|
|
35
35
|
n
|
|
36
36
|
);
|
|
@@ -56,23 +56,23 @@ function S(e, t) {
|
|
|
56
56
|
const n = j(e == null ? void 0 : e.source);
|
|
57
57
|
return n ? L(n, t) : void 0;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function ke({
|
|
60
60
|
explicitSource: e,
|
|
61
61
|
field: t,
|
|
62
62
|
defaultSource: n,
|
|
63
63
|
fallbackSources: r
|
|
64
64
|
}) {
|
|
65
|
-
const
|
|
65
|
+
const o = [n, ...r || []], a = j(e), i = a ? L(
|
|
66
66
|
a,
|
|
67
|
-
ne(a,
|
|
67
|
+
ne(a, o)
|
|
68
68
|
) : void 0;
|
|
69
|
-
if (
|
|
70
|
-
return
|
|
69
|
+
if (i)
|
|
70
|
+
return i;
|
|
71
71
|
if (e !== void 0)
|
|
72
72
|
return;
|
|
73
73
|
const d = S(t, n), s = d ? L(
|
|
74
74
|
d,
|
|
75
|
-
ne(d,
|
|
75
|
+
ne(d, o)
|
|
76
76
|
) : void 0;
|
|
77
77
|
if (s)
|
|
78
78
|
return s;
|
|
@@ -83,45 +83,45 @@ function St(e, t) {
|
|
|
83
83
|
if (!(e != null && e.name) || !(t != null && t.name) || e.name !== t.name)
|
|
84
84
|
return !1;
|
|
85
85
|
const n = S(e), r = S(t);
|
|
86
|
-
return !n || !r ? !0 :
|
|
86
|
+
return !n || !r ? !0 : ie(n, r);
|
|
87
87
|
}
|
|
88
88
|
function k(e) {
|
|
89
89
|
var t;
|
|
90
90
|
return C((t = _(e)) == null ? void 0 : t.kind);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function oe(e) {
|
|
93
93
|
var t, n;
|
|
94
94
|
return k(e) !== "semantic" ? null : ((n = C((t = _(e)) == null ? void 0 : t.domainId)) == null ? void 0 : n.trim()) || null;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function xe(e) {
|
|
97
97
|
var t;
|
|
98
98
|
return k(e) !== "semantic" ? null : C((t = _(e)) == null ? void 0 : t.datasetName);
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function De(e) {
|
|
101
101
|
var t;
|
|
102
102
|
return k(e) !== "semantic" ? null : C((t = _(e)) == null ? void 0 : t.datasetId);
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function Ae(e) {
|
|
105
105
|
var t;
|
|
106
106
|
return k(e) !== "physical" ? null : C((t = _(e)) == null ? void 0 : t.connectionId);
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function Fe(e) {
|
|
109
109
|
var t;
|
|
110
110
|
return k(e) !== "physical" ? null : C((t = _(e)) == null ? void 0 : t.tableName);
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function Te(e) {
|
|
113
113
|
var t;
|
|
114
114
|
return k(e) !== "physical" ? "" : C((t = _(e)) == null ? void 0 : t.databaseName) || "";
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function $e(e) {
|
|
117
117
|
var t;
|
|
118
118
|
return k(e) !== "physical" ? "" : C((t = _(e)) == null ? void 0 : t.schemaName) || "";
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function Me(e) {
|
|
121
121
|
if (e.analyticsIntent && typeof e.analyticsIntent == "object" && "source" in e.analyticsIntent)
|
|
122
122
|
return e.analyticsIntent.source;
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function Ne({
|
|
125
125
|
datasets: e,
|
|
126
126
|
requireAtLeastOne: t
|
|
127
127
|
}) {
|
|
@@ -129,17 +129,17 @@ function Me({
|
|
|
129
129
|
return { ok: !1, issue: "invalid_dataset_count" };
|
|
130
130
|
if (e.length <= 1)
|
|
131
131
|
return { ok: !0 };
|
|
132
|
-
const n = e.map(
|
|
133
|
-
return n.some((
|
|
132
|
+
const n = e.map(oe), r = new Set(n.filter(Boolean));
|
|
133
|
+
return n.some((o) => !o) || r.size !== 1 ? { ok: !1, issue: "invalid_multi_dataset_scope" } : { ok: !0 };
|
|
134
134
|
}
|
|
135
135
|
function H(e, t) {
|
|
136
136
|
if (!t)
|
|
137
137
|
return !1;
|
|
138
138
|
if (t.kind === "semantic") {
|
|
139
|
-
const n =
|
|
140
|
-
return
|
|
139
|
+
const n = De(e);
|
|
140
|
+
return oe(e) === t.domainId ? n && t.datasetId ? n === t.datasetId : xe(e) === t.datasetName : !1;
|
|
141
141
|
}
|
|
142
|
-
return t.kind === "physical" ?
|
|
142
|
+
return t.kind === "physical" ? Ae(e) === t.connectionId && Fe(e) === t.tableName && Te(e) === (t.databaseName || "") && $e(e) === (t.schemaName || "") : !1;
|
|
143
143
|
}
|
|
144
144
|
function Ct(e, t) {
|
|
145
145
|
return e.find(
|
|
@@ -158,14 +158,14 @@ function M(e) {
|
|
|
158
158
|
}
|
|
159
159
|
return null;
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function se({
|
|
162
162
|
card: e,
|
|
163
163
|
datasets: t,
|
|
164
164
|
errors: n
|
|
165
165
|
}) {
|
|
166
166
|
if (e.type === "text")
|
|
167
167
|
return;
|
|
168
|
-
const r =
|
|
168
|
+
const r = Me(e);
|
|
169
169
|
if (!r) {
|
|
170
170
|
if (t.length <= 1)
|
|
171
171
|
return;
|
|
@@ -178,7 +178,7 @@ function oe({
|
|
|
178
178
|
);
|
|
179
179
|
return;
|
|
180
180
|
}
|
|
181
|
-
t.some((
|
|
181
|
+
t.some((o) => H(o, r)) || n.push(
|
|
182
182
|
p(
|
|
183
183
|
"invalid_card_analytics_source",
|
|
184
184
|
"Dashboard cards with an explicit analytics source must use one of the selected datasets.",
|
|
@@ -194,7 +194,7 @@ function q(e) {
|
|
|
194
194
|
(t) => !!(t && typeof t == "object")
|
|
195
195
|
) : [];
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function re(e) {
|
|
198
198
|
return Array.isArray(e) ? e.filter(
|
|
199
199
|
(t) => !!(t && typeof t == "object")
|
|
200
200
|
) : [];
|
|
@@ -210,17 +210,18 @@ function Be(e) {
|
|
|
210
210
|
e.primaryMetric,
|
|
211
211
|
e.dateField,
|
|
212
212
|
...q(e.dimensions),
|
|
213
|
-
...
|
|
213
|
+
...re(e.filters).map((r) => r.field)
|
|
214
214
|
])
|
|
215
215
|
) : e.kind === "records" ? t.push(
|
|
216
216
|
...N([
|
|
217
217
|
...q(e.fields),
|
|
218
218
|
e.dateField,
|
|
219
|
-
(n = e.orderBy) == null ? void 0 : n.field
|
|
219
|
+
(n = e.orderBy) == null ? void 0 : n.field,
|
|
220
|
+
...re(e.filters).map((r) => r.field)
|
|
220
221
|
])
|
|
221
222
|
) : e.kind === "inputOptions" ? t.push(...N([e.field])) : e.kind === "sql" && t.push(...N(e.fields || [])), t;
|
|
222
223
|
}
|
|
223
|
-
function
|
|
224
|
+
function de({
|
|
224
225
|
card: e,
|
|
225
226
|
datasets: t,
|
|
226
227
|
errors: n
|
|
@@ -228,7 +229,7 @@ function se({
|
|
|
228
229
|
if (e.type !== "text") {
|
|
229
230
|
for (const r of Be(e.analyticsIntent))
|
|
230
231
|
if (r && !t.some(
|
|
231
|
-
(
|
|
232
|
+
(o) => H(o, r)
|
|
232
233
|
)) {
|
|
233
234
|
n.push(
|
|
234
235
|
p(
|
|
@@ -241,13 +242,13 @@ function se({
|
|
|
241
242
|
}
|
|
242
243
|
}
|
|
243
244
|
}
|
|
244
|
-
function
|
|
245
|
+
function ce({
|
|
245
246
|
card: e,
|
|
246
247
|
errors: t
|
|
247
248
|
}) {
|
|
248
249
|
if (e.type === "text" || !e.analyticsIntent)
|
|
249
250
|
return;
|
|
250
|
-
const n =
|
|
251
|
+
const n = ae(e.analyticsIntent);
|
|
251
252
|
if (!n.ok)
|
|
252
253
|
for (const r of n.errors)
|
|
253
254
|
t.push(
|
|
@@ -258,12 +259,12 @@ function de({
|
|
|
258
259
|
)
|
|
259
260
|
);
|
|
260
261
|
}
|
|
261
|
-
function
|
|
262
|
+
function le({
|
|
262
263
|
datasets: e,
|
|
263
264
|
errors: t,
|
|
264
265
|
requireAtLeastOne: n
|
|
265
266
|
}) {
|
|
266
|
-
const r =
|
|
267
|
+
const r = Ne({
|
|
267
268
|
datasets: e,
|
|
268
269
|
requireAtLeastOne: n
|
|
269
270
|
});
|
|
@@ -301,18 +302,18 @@ function Pe(e) {
|
|
|
301
302
|
};
|
|
302
303
|
const n = e, r = [...n.warnings || []];
|
|
303
304
|
n.version !== 1 && t.push(p("invalid_version", "Dashboard plan version must be 1.")), (f = n.title) != null && f.trim() || t.push(p("missing_title", "Dashboard plan needs a title."));
|
|
304
|
-
const
|
|
305
|
-
|
|
305
|
+
const o = Array.isArray(n.datasets) ? n.datasets : [], a = Array.isArray(n.sheets) ? n.sheets : [];
|
|
306
|
+
le({ datasets: o, errors: t, requireAtLeastOne: !0 }), a.length !== 1 && t.push(
|
|
306
307
|
p(
|
|
307
308
|
"invalid_sheet_count",
|
|
308
309
|
"MVP dashboard authoring creates exactly one dashboard sheet."
|
|
309
310
|
)
|
|
310
311
|
);
|
|
311
|
-
const
|
|
312
|
-
|
|
312
|
+
const i = a[0];
|
|
313
|
+
i && i.kind !== "dashboard" && t.push(
|
|
313
314
|
p("invalid_sheet_kind", 'Generated sheet must use kind "dashboard".')
|
|
314
315
|
);
|
|
315
|
-
const d = (
|
|
316
|
+
const d = (i == null ? void 0 : i.cards) || [];
|
|
316
317
|
d.length > B && t.push(
|
|
317
318
|
p(
|
|
318
319
|
"too_many_cards",
|
|
@@ -343,7 +344,7 @@ function Pe(e) {
|
|
|
343
344
|
"Non-text card has no analytics intent and may be skipped by the app layer.",
|
|
344
345
|
l.id
|
|
345
346
|
)
|
|
346
|
-
),
|
|
347
|
+
), se({ card: l, datasets: o, errors: t }), ce({ card: l, errors: t }), de({ card: l, datasets: o, errors: t });
|
|
347
348
|
const h = Array.isArray(n.filterInputs) ? n.filterInputs : [], I = h.map((l) => l.id), w = M(I);
|
|
348
349
|
w && t.push(
|
|
349
350
|
p(
|
|
@@ -369,7 +370,7 @@ function Pe(e) {
|
|
|
369
370
|
return { ok: t.length === 0, errors: t, warnings: r };
|
|
370
371
|
}
|
|
371
372
|
function ze(e) {
|
|
372
|
-
var
|
|
373
|
+
var i;
|
|
373
374
|
const t = [];
|
|
374
375
|
if (!e || typeof e != "object")
|
|
375
376
|
return {
|
|
@@ -385,11 +386,11 @@ function ze(e) {
|
|
|
385
386
|
const n = e, r = [...n.warnings || []];
|
|
386
387
|
n.version !== 1 && t.push(
|
|
387
388
|
p("invalid_version", "Dashboard change plan version must be 1.")
|
|
388
|
-
), (
|
|
389
|
+
), (i = n.dashboardId) != null && i.trim() || t.push(
|
|
389
390
|
p("missing_dashboard_id", "Dashboard change plan needs a dashboard id.")
|
|
390
391
|
);
|
|
391
|
-
const
|
|
392
|
-
|
|
392
|
+
const o = Array.isArray(n.datasets) ? n.datasets : [], a = Array.isArray(n.operations) ? n.operations : [];
|
|
393
|
+
le({ datasets: o, errors: t, requireAtLeastOne: !1 });
|
|
393
394
|
for (const d of a) {
|
|
394
395
|
if (d.kind === "unsupported") {
|
|
395
396
|
r.push(
|
|
@@ -403,16 +404,16 @@ function ze(e) {
|
|
|
403
404
|
"Whole-dashboard authoring supports built-in visual types only.",
|
|
404
405
|
d.card.id
|
|
405
406
|
)
|
|
406
|
-
), d.kind === "addCard" && (
|
|
407
|
+
), d.kind === "addCard" && (se({
|
|
407
408
|
card: d.card,
|
|
408
|
-
datasets:
|
|
409
|
+
datasets: o,
|
|
409
410
|
errors: t
|
|
410
|
-
}),
|
|
411
|
+
}), ce({
|
|
411
412
|
card: d.card,
|
|
412
413
|
errors: t
|
|
413
|
-
}),
|
|
414
|
+
}), de({
|
|
414
415
|
card: d.card,
|
|
415
|
-
datasets:
|
|
416
|
+
datasets: o,
|
|
416
417
|
errors: t
|
|
417
418
|
})), d.kind === "addCalculatedField" && d.field.scope === "domain" && d.field.reuseOnly !== !0 && t.push(
|
|
418
419
|
p(
|
|
@@ -431,26 +432,26 @@ const Ve = {
|
|
|
431
432
|
xxs: 6
|
|
432
433
|
};
|
|
433
434
|
function qe(e, t) {
|
|
434
|
-
let n = 0, r = 0,
|
|
435
|
+
let n = 0, r = 0, o = 0;
|
|
435
436
|
return e.map((a) => {
|
|
436
|
-
const
|
|
437
|
-
n > 0 && n +
|
|
437
|
+
const i = Math.min(a.w, t);
|
|
438
|
+
n > 0 && n + i > t && (n = 0, r += o, o = 0);
|
|
438
439
|
const d = {
|
|
439
440
|
i: a.frameId,
|
|
440
441
|
x: n,
|
|
441
442
|
y: r,
|
|
442
|
-
w:
|
|
443
|
+
w: i,
|
|
443
444
|
h: a.h,
|
|
444
445
|
minW: Math.min(a.minW, t),
|
|
445
446
|
minH: a.minH,
|
|
446
447
|
static: !1
|
|
447
448
|
};
|
|
448
|
-
return n +=
|
|
449
|
+
return n += i, o = Math.max(o, a.h), d;
|
|
449
450
|
});
|
|
450
451
|
}
|
|
451
452
|
function Re(e) {
|
|
452
|
-
const t = [...e].sort((s, u) => s.priority - u.priority), n = t.filter((s) => s.role === "kpi"), r = t.filter((s) => s.role === "chart"),
|
|
453
|
-
return { kpis: n, introText:
|
|
453
|
+
const t = [...e].sort((s, u) => s.priority - u.priority), n = t.filter((s) => s.role === "kpi"), r = t.filter((s) => s.role === "chart"), o = t.filter((s) => s.role === "table"), a = t.filter((s) => s.role === "text"), i = a.slice(0, 1), d = a.slice(i.length);
|
|
454
|
+
return { kpis: n, introText: i, charts: r, tables: o, supportingText: d };
|
|
454
455
|
}
|
|
455
456
|
function Oe(e, t, n) {
|
|
456
457
|
return t === "xxs" || t === "xs" ? n : t === "sm" ? Math.min(12, n) : t === "md" ? e <= 1 || e === 2 ? 18 : 12 : e <= 1 || e === 2 ? 24 : e === 3 ? 16 : 12;
|
|
@@ -459,48 +460,48 @@ function Le(e, t, n, r) {
|
|
|
459
460
|
return n === "xxs" || n === "xs" || n === "sm" || n === "md" || t === 1 || t % 2 === 1 && e === 0 ? r : r / 2;
|
|
460
461
|
}
|
|
461
462
|
function je(e) {
|
|
462
|
-
const { item: t, band: n, index: r, bandCount:
|
|
463
|
+
const { item: t, band: n, index: r, bandCount: o, breakpoint: a, columns: i } = e;
|
|
463
464
|
return n === "kpi" ? {
|
|
464
465
|
...t,
|
|
465
466
|
band: n,
|
|
466
|
-
w: Oe(
|
|
467
|
+
w: Oe(o, a, i),
|
|
467
468
|
h: 15,
|
|
468
|
-
minW: Math.min(6,
|
|
469
|
+
minW: Math.min(6, i),
|
|
469
470
|
minH: 12
|
|
470
471
|
} : n === "table" ? {
|
|
471
472
|
...t,
|
|
472
473
|
band: n,
|
|
473
|
-
w:
|
|
474
|
+
w: i,
|
|
474
475
|
h: a === "xxs" || a === "xs" ? 34 : 38,
|
|
475
|
-
minW: Math.min(12,
|
|
476
|
+
minW: Math.min(12, i),
|
|
476
477
|
minH: 18
|
|
477
478
|
} : n === "introText" ? {
|
|
478
479
|
...t,
|
|
479
480
|
band: n,
|
|
480
|
-
w:
|
|
481
|
+
w: i,
|
|
481
482
|
h: a === "xxs" || a === "xs" ? 12 : 10,
|
|
482
|
-
minW: Math.min(12,
|
|
483
|
+
minW: Math.min(12, i),
|
|
483
484
|
minH: 8
|
|
484
485
|
} : n === "supportingText" ? {
|
|
485
486
|
...t,
|
|
486
487
|
band: n,
|
|
487
|
-
w: a === "lg" ?
|
|
488
|
+
w: a === "lg" ? i / 2 : i,
|
|
488
489
|
h: a === "xxs" || a === "xs" ? 12 : 10,
|
|
489
|
-
minW: Math.min(12,
|
|
490
|
+
minW: Math.min(12, i),
|
|
490
491
|
minH: 8
|
|
491
492
|
} : {
|
|
492
493
|
...t,
|
|
493
494
|
band: n,
|
|
494
|
-
w: Le(r,
|
|
495
|
+
w: Le(r, o, a, i),
|
|
495
496
|
h: a === "xxs" || a === "xs" ? 28 : 30,
|
|
496
|
-
minW: Math.min(12,
|
|
497
|
+
minW: Math.min(12, i),
|
|
497
498
|
minH: 16
|
|
498
499
|
};
|
|
499
500
|
}
|
|
500
|
-
function
|
|
501
|
+
function A(e, t, n, r) {
|
|
501
502
|
return e.map(
|
|
502
|
-
(
|
|
503
|
-
item:
|
|
503
|
+
(o, a) => je({
|
|
504
|
+
item: o,
|
|
504
505
|
band: t,
|
|
505
506
|
index: a,
|
|
506
507
|
bandCount: e.length,
|
|
@@ -512,20 +513,20 @@ function D(e, t, n, r) {
|
|
|
512
513
|
function K(e) {
|
|
513
514
|
const t = Re(e);
|
|
514
515
|
return Object.fromEntries(
|
|
515
|
-
|
|
516
|
-
const r = Ve[n],
|
|
517
|
-
...
|
|
518
|
-
...
|
|
519
|
-
...
|
|
520
|
-
...
|
|
521
|
-
...
|
|
516
|
+
be.map((n) => {
|
|
517
|
+
const r = Ve[n], o = [
|
|
518
|
+
...A(t.introText, "introText", n, r),
|
|
519
|
+
...A(t.kpis, "kpi", n, r),
|
|
520
|
+
...A(t.charts, "chart", n, r),
|
|
521
|
+
...A(t.tables, "table", n, r),
|
|
522
|
+
...A(t.supportingText, "supportingText", n, r)
|
|
522
523
|
];
|
|
523
|
-
return [n, qe(
|
|
524
|
+
return [n, qe(o, r)];
|
|
524
525
|
})
|
|
525
526
|
);
|
|
526
527
|
}
|
|
527
528
|
function We(e) {
|
|
528
|
-
const t =
|
|
529
|
+
const t = ve(e);
|
|
529
530
|
return t === "datetime" ? "date" : t === "unknown" ? "string" : t;
|
|
530
531
|
}
|
|
531
532
|
function Ee(e) {
|
|
@@ -569,7 +570,7 @@ function G(e, t) {
|
|
|
569
570
|
fieldMeta: e.fieldMeta,
|
|
570
571
|
semanticContext: e.semanticContext
|
|
571
572
|
};
|
|
572
|
-
const
|
|
573
|
+
const o = Array.isArray(t) ? t : [t], a = n === "date" ? Ge(o) : Ke(o);
|
|
573
574
|
if (a.length !== 0 && !((r === "between" || r === "not between") && a.length < 2))
|
|
574
575
|
return {
|
|
575
576
|
filterId: e.id,
|
|
@@ -582,13 +583,13 @@ function G(e, t) {
|
|
|
582
583
|
semanticContext: e.semanticContext
|
|
583
584
|
};
|
|
584
585
|
}
|
|
585
|
-
function
|
|
586
|
+
function ue(e, t, n) {
|
|
586
587
|
return n ? { code: e, message: t, cardId: n } : { code: e, message: t };
|
|
587
588
|
}
|
|
588
589
|
function Ue(e, t, n) {
|
|
589
590
|
const r = (t || []).filter(
|
|
590
|
-
(
|
|
591
|
-
).map((
|
|
591
|
+
(o) => o.scope === "card" && o.targetCardId === n
|
|
592
|
+
).map((o) => o.field).filter(Boolean);
|
|
592
593
|
return r.length === 0 ? e : {
|
|
593
594
|
...e,
|
|
594
595
|
calculatedFields: [
|
|
@@ -631,11 +632,11 @@ function Xe(e, t) {
|
|
|
631
632
|
const n = {}, r = [];
|
|
632
633
|
return {
|
|
633
634
|
inputs: (e.filterInputs || []).flatMap(
|
|
634
|
-
(a,
|
|
635
|
+
(a, i) => {
|
|
635
636
|
const d = Je(a.scope, t);
|
|
636
637
|
if (d === null)
|
|
637
638
|
return r.push(
|
|
638
|
-
|
|
639
|
+
ue(
|
|
639
640
|
"filter_input_scope_empty",
|
|
640
641
|
`Filter input "${a.label}" was skipped because all scoped cards were skipped during query validation.`
|
|
641
642
|
)
|
|
@@ -660,7 +661,7 @@ function Xe(e, t) {
|
|
|
660
661
|
runtimeScope: "shared",
|
|
661
662
|
presentation: {
|
|
662
663
|
placement: "toolbar",
|
|
663
|
-
order:
|
|
664
|
+
order: i
|
|
664
665
|
},
|
|
665
666
|
exports: ["label", "value", "start", "end", "range"],
|
|
666
667
|
filter: Qe(a.filter, t)
|
|
@@ -680,9 +681,9 @@ function kt(e) {
|
|
|
680
681
|
t.errors.map((c) => c.message).join(`
|
|
681
682
|
`) || "Dashboard plan is invalid."
|
|
682
683
|
);
|
|
683
|
-
const n = e.plan.sheets[0], r = [...t.warnings],
|
|
684
|
+
const n = e.plan.sheets[0], r = [...t.warnings], o = [], a = new Map(
|
|
684
685
|
e.cardArtifacts.map((c) => [c.planCardId, c])
|
|
685
|
-
),
|
|
686
|
+
), i = new Map(
|
|
686
687
|
e.cardArtifacts.map((c) => [
|
|
687
688
|
c.planCardId,
|
|
688
689
|
c.card.id
|
|
@@ -691,12 +692,12 @@ function kt(e) {
|
|
|
691
692
|
for (const c of n.cards) {
|
|
692
693
|
const f = a.get(c.id);
|
|
693
694
|
if (!f) {
|
|
694
|
-
const l =
|
|
695
|
+
const l = ue(
|
|
695
696
|
"missing_card_artifact",
|
|
696
697
|
`Card "${c.title}" was skipped because no generated artifact was supplied.`,
|
|
697
698
|
c.id
|
|
698
699
|
);
|
|
699
|
-
|
|
700
|
+
o.push(l);
|
|
700
701
|
continue;
|
|
701
702
|
}
|
|
702
703
|
r.push(...f.warnings || []);
|
|
@@ -713,7 +714,7 @@ function kt(e) {
|
|
|
713
714
|
}
|
|
714
715
|
if (d.length === 0)
|
|
715
716
|
throw new Error("Dashboard plan did not produce any persistable cards.");
|
|
716
|
-
const { inputs: s, defaultInputValues: u, warnings: h } = Xe(e.plan,
|
|
717
|
+
const { inputs: s, defaultInputValues: u, warnings: h } = Xe(e.plan, i);
|
|
717
718
|
r.push(...h);
|
|
718
719
|
const I = K(
|
|
719
720
|
n.cards.filter((c) => d.some((f) => f.id === c.frameId)).map((c) => ({
|
|
@@ -740,7 +741,7 @@ function kt(e) {
|
|
|
740
741
|
calculatedFields: (y = e.plan.calculatedFields) == null ? void 0 : y.filter((c) => c.scope === "dashboard" && c.field).map((c) => c.field),
|
|
741
742
|
inputs: s,
|
|
742
743
|
...u ? { defaultInputValues: u } : {}
|
|
743
|
-
}, warnings: r, skippedOperations:
|
|
744
|
+
}, warnings: r, skippedOperations: o };
|
|
744
745
|
}
|
|
745
746
|
function x(e, t, n) {
|
|
746
747
|
return n ? { code: e, message: t, cardId: n } : { code: e, message: t };
|
|
@@ -757,14 +758,14 @@ function Ze(e) {
|
|
|
757
758
|
function R(e, t) {
|
|
758
759
|
var n;
|
|
759
760
|
for (const r of e.sheets || [])
|
|
760
|
-
for (const
|
|
761
|
-
const a = (n =
|
|
761
|
+
for (const o of r.frames || []) {
|
|
762
|
+
const a = (n = o.cards) == null ? void 0 : n.find((i) => i.id === t);
|
|
762
763
|
if (a)
|
|
763
|
-
return { sheet: r, frame:
|
|
764
|
+
return { sheet: r, frame: o, card: a };
|
|
764
765
|
}
|
|
765
766
|
return null;
|
|
766
767
|
}
|
|
767
|
-
function
|
|
768
|
+
function fe(e) {
|
|
768
769
|
var n, r;
|
|
769
770
|
const t = (r = (n = e.cards) == null ? void 0 : n[0]) == null ? void 0 : r.type;
|
|
770
771
|
return t === "kpi" ? "kpi" : t === "table" || t === "detailTable" || t === "pivotTable" ? "table" : t === "text" ? "text" : "chart";
|
|
@@ -775,37 +776,37 @@ function et(e) {
|
|
|
775
776
|
(((t = e.layouts) == null ? void 0 : t.lg) || []).map((n, r) => [n.i, r])
|
|
776
777
|
);
|
|
777
778
|
}
|
|
778
|
-
function
|
|
779
|
+
function pe(e, t = /* @__PURE__ */ new Map()) {
|
|
779
780
|
const n = et(e), r = Math.max(
|
|
780
781
|
n.size,
|
|
781
782
|
t.size
|
|
782
|
-
),
|
|
783
|
-
(a,
|
|
783
|
+
), o = (e.frames || []).map(
|
|
784
|
+
(a, i) => ({
|
|
784
785
|
frameId: a.id,
|
|
785
|
-
role:
|
|
786
|
-
priority: t.get(a.id) ?? n.get(a.id) ?? r +
|
|
786
|
+
role: fe(a),
|
|
787
|
+
priority: t.get(a.id) ?? n.get(a.id) ?? r + i
|
|
787
788
|
})
|
|
788
789
|
);
|
|
789
|
-
e.layouts = K(
|
|
790
|
+
e.layouts = K(o);
|
|
790
791
|
}
|
|
791
792
|
function tt(e) {
|
|
792
793
|
return Object.values(e.layouts || {}).some((t) => t.length > 0);
|
|
793
794
|
}
|
|
794
795
|
function nt(e, t) {
|
|
795
796
|
if (!tt(e)) {
|
|
796
|
-
|
|
797
|
+
pe(e);
|
|
797
798
|
return;
|
|
798
799
|
}
|
|
799
800
|
const n = K([
|
|
800
|
-
{ frameId: t.id, role:
|
|
801
|
+
{ frameId: t.id, role: fe(t), priority: 0 }
|
|
801
802
|
]);
|
|
802
803
|
e.layouts ?? (e.layouts = {});
|
|
803
|
-
for (const [r,
|
|
804
|
+
for (const [r, o] of Object.entries(n)) {
|
|
804
805
|
const a = e.layouts[r] || [];
|
|
805
806
|
if (a.some((s) => s.i === t.id))
|
|
806
807
|
continue;
|
|
807
|
-
const
|
|
808
|
-
if (!
|
|
808
|
+
const i = o[0];
|
|
809
|
+
if (!i)
|
|
809
810
|
continue;
|
|
810
811
|
const d = a.reduce(
|
|
811
812
|
(s, u) => Math.max(s, u.y + u.h),
|
|
@@ -813,7 +814,7 @@ function nt(e, t) {
|
|
|
813
814
|
);
|
|
814
815
|
e.layouts[r] = [
|
|
815
816
|
...a,
|
|
816
|
-
{ ...
|
|
817
|
+
{ ...i, y: d }
|
|
817
818
|
];
|
|
818
819
|
}
|
|
819
820
|
}
|
|
@@ -839,23 +840,23 @@ function xt(e) {
|
|
|
839
840
|
t.errors.map((s) => s.message).join(`
|
|
840
841
|
`) || "Dashboard change plan is invalid."
|
|
841
842
|
);
|
|
842
|
-
const n = Ye(e.dashboard), r = [...t.warnings],
|
|
843
|
+
const n = Ye(e.dashboard), r = [...t.warnings], o = [], a = new Map(
|
|
843
844
|
e.cardArtifacts.map((s) => [s.planCardId, s])
|
|
844
|
-
),
|
|
845
|
-
if (!
|
|
845
|
+
), i = Ze(n);
|
|
846
|
+
if (!i)
|
|
846
847
|
throw new Error("Dashboard has no editable dashboard sheet.");
|
|
847
|
-
|
|
848
|
+
i.frames ?? (i.frames = []);
|
|
848
849
|
for (const s of e.changePlan.operations)
|
|
849
850
|
switch (s.kind) {
|
|
850
851
|
case "addCard": {
|
|
851
|
-
if ((
|
|
852
|
+
if ((i.frames || []).reduce(
|
|
852
853
|
(w, v) => {
|
|
853
854
|
var y;
|
|
854
855
|
return w + (((y = v.cards) == null ? void 0 : y.length) || 0);
|
|
855
856
|
},
|
|
856
857
|
0
|
|
857
858
|
) >= B) {
|
|
858
|
-
|
|
859
|
+
o.push(
|
|
859
860
|
x(
|
|
860
861
|
"generated_card_limit_reached",
|
|
861
862
|
`AI refinement is capped at ${B} cards.`,
|
|
@@ -866,7 +867,7 @@ function xt(e) {
|
|
|
866
867
|
}
|
|
867
868
|
const h = a.get(s.card.id);
|
|
868
869
|
if (!h) {
|
|
869
|
-
|
|
870
|
+
o.push(
|
|
870
871
|
x(
|
|
871
872
|
"missing_card_artifact",
|
|
872
873
|
`Card "${s.card.title}" was skipped because no generated artifact was supplied.`,
|
|
@@ -880,7 +881,7 @@ function xt(e) {
|
|
|
880
881
|
cards: [h.card],
|
|
881
882
|
activeCardId: h.card.id
|
|
882
883
|
};
|
|
883
|
-
|
|
884
|
+
i.frames.push(I), nt(i, I);
|
|
884
885
|
break;
|
|
885
886
|
}
|
|
886
887
|
case "addFilterInput": {
|
|
@@ -909,10 +910,10 @@ function xt(e) {
|
|
|
909
910
|
if (s.field.scope === "dashboard" && s.field.field)
|
|
910
911
|
n.calculatedFields ?? (n.calculatedFields = []), n.calculatedFields.push(s.field.field);
|
|
911
912
|
else if (s.field.scope === "sheet" && s.field.field)
|
|
912
|
-
|
|
913
|
+
i.calculatedFields ?? (i.calculatedFields = []), i.calculatedFields.push(s.field.field);
|
|
913
914
|
else if (s.field.scope === "card" && s.field.field) {
|
|
914
915
|
const u = s.field.targetCardId ? R(n, s.field.targetCardId) : null;
|
|
915
|
-
u ? ((d = u.card).calculatedFields ?? (d.calculatedFields = []), u.card.calculatedFields.push(s.field.field)) :
|
|
916
|
+
u ? ((d = u.card).calculatedFields ?? (d.calculatedFields = []), u.card.calculatedFields.push(s.field.field)) : o.push(
|
|
916
917
|
x(
|
|
917
918
|
"missing_calculated_field_target",
|
|
918
919
|
`Calculated field "${s.field.name}" needs a valid target card.`
|
|
@@ -924,7 +925,7 @@ function xt(e) {
|
|
|
924
925
|
case "renameCard": {
|
|
925
926
|
const u = R(n, s.cardId);
|
|
926
927
|
if (!u) {
|
|
927
|
-
|
|
928
|
+
o.push(
|
|
928
929
|
x(
|
|
929
930
|
"card_not_found",
|
|
930
931
|
`Card "${s.cardId}" could not be renamed because it was not found.`,
|
|
@@ -942,7 +943,7 @@ function xt(e) {
|
|
|
942
943
|
const I = s.cardIds[h], w = R(n, I);
|
|
943
944
|
w && u.set(w.frame.id, h);
|
|
944
945
|
}
|
|
945
|
-
|
|
946
|
+
pe(i, u);
|
|
946
947
|
break;
|
|
947
948
|
}
|
|
948
949
|
case "reuseCalculatedField":
|
|
@@ -954,12 +955,12 @@ function xt(e) {
|
|
|
954
955
|
);
|
|
955
956
|
break;
|
|
956
957
|
case "unsupported":
|
|
957
|
-
|
|
958
|
+
o.push(
|
|
958
959
|
x("unsupported_operation", s.reason || s.requestedAction)
|
|
959
960
|
);
|
|
960
961
|
break;
|
|
961
962
|
}
|
|
962
|
-
return { dashboard: n, warnings: r, skippedOperations:
|
|
963
|
+
return { dashboard: n, warnings: r, skippedOperations: o };
|
|
963
964
|
}
|
|
964
965
|
function b(e, t, n) {
|
|
965
966
|
return n ? { code: e, message: t, cardId: n } : { code: e, message: t };
|
|
@@ -967,7 +968,7 @@ function b(e, t, n) {
|
|
|
967
968
|
function F(e, t) {
|
|
968
969
|
return e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || t;
|
|
969
970
|
}
|
|
970
|
-
function
|
|
971
|
+
function he(e, t) {
|
|
971
972
|
if (!t.has(e))
|
|
972
973
|
return t.add(e), e;
|
|
973
974
|
let n = 2, r = `${e}-${n}`;
|
|
@@ -978,7 +979,7 @@ function pe(e, t) {
|
|
|
978
979
|
function T(e) {
|
|
979
980
|
return !!(e && typeof e == "object");
|
|
980
981
|
}
|
|
981
|
-
function
|
|
982
|
+
function me(e) {
|
|
982
983
|
return Array.isArray(e.inputs) ? e.inputs.filter(
|
|
983
984
|
(t) => T(t) && typeof t.id == "string"
|
|
984
985
|
) : [];
|
|
@@ -993,7 +994,7 @@ function J(e) {
|
|
|
993
994
|
(t) => T(t)
|
|
994
995
|
) : [];
|
|
995
996
|
}
|
|
996
|
-
function
|
|
997
|
+
function D(e) {
|
|
997
998
|
if (!Array.isArray(e))
|
|
998
999
|
return [];
|
|
999
1000
|
const t = [];
|
|
@@ -1004,35 +1005,39 @@ function A(e) {
|
|
|
1004
1005
|
return t;
|
|
1005
1006
|
}
|
|
1006
1007
|
function at(e) {
|
|
1007
|
-
var r;
|
|
1008
|
+
var r, o;
|
|
1008
1009
|
if (!e)
|
|
1009
1010
|
return [];
|
|
1010
1011
|
const t = [];
|
|
1011
1012
|
if (z(e.source) && t.push(e.source), e.kind === "metric") {
|
|
1012
|
-
t.push(...
|
|
1013
|
-
const
|
|
1014
|
-
|
|
1015
|
-
...
|
|
1016
|
-
(r = e.filters) == null ? void 0 : r.map((
|
|
1013
|
+
t.push(...D(e.metrics));
|
|
1014
|
+
const a = S(e.dateField);
|
|
1015
|
+
a && t.push(a), t.push(...D(e.dimensions)), t.push(
|
|
1016
|
+
...D(
|
|
1017
|
+
(r = e.filters) == null ? void 0 : r.map((i) => i.field)
|
|
1017
1018
|
)
|
|
1018
1019
|
);
|
|
1019
1020
|
} else if (e.kind === "records") {
|
|
1020
|
-
const
|
|
1021
|
-
|
|
1021
|
+
const a = S(e.dateField);
|
|
1022
|
+
a && t.push(a), t.push(...D(e.fields)), t.push(
|
|
1023
|
+
...D(
|
|
1024
|
+
(o = e.filters) == null ? void 0 : o.map((i) => i.field)
|
|
1025
|
+
)
|
|
1026
|
+
);
|
|
1022
1027
|
} else if (e.kind === "inputOptions") {
|
|
1023
|
-
const
|
|
1024
|
-
i && t.push(i);
|
|
1025
|
-
} else e.kind === "sql" && t.push(...A(e.fields));
|
|
1026
|
-
const n = "inputs" in e && Array.isArray(e.inputs) ? e.inputs : [];
|
|
1027
|
-
for (const i of n) {
|
|
1028
|
-
const a = S(i.field);
|
|
1028
|
+
const a = S(e.field);
|
|
1029
1029
|
a && t.push(a);
|
|
1030
|
+
} else e.kind === "sql" && t.push(...D(e.fields));
|
|
1031
|
+
const n = "inputs" in e && Array.isArray(e.inputs) ? e.inputs : [];
|
|
1032
|
+
for (const a of n) {
|
|
1033
|
+
const i = S(a.field);
|
|
1034
|
+
i && t.push(i);
|
|
1030
1035
|
}
|
|
1031
1036
|
return t;
|
|
1032
1037
|
}
|
|
1033
1038
|
function it(e) {
|
|
1034
1039
|
const t = [];
|
|
1035
|
-
for (const n of
|
|
1040
|
+
for (const n of me(e)) {
|
|
1036
1041
|
const r = S(n.field);
|
|
1037
1042
|
r && t.push(r);
|
|
1038
1043
|
}
|
|
@@ -1045,8 +1050,8 @@ function ot(e) {
|
|
|
1045
1050
|
var n;
|
|
1046
1051
|
const t = [];
|
|
1047
1052
|
for (const r of U(e))
|
|
1048
|
-
for (const
|
|
1049
|
-
z((n =
|
|
1053
|
+
for (const o of J(r))
|
|
1054
|
+
z((n = o.analytics) == null ? void 0 : n.source) && t.push(o.analytics.source);
|
|
1050
1055
|
return t;
|
|
1051
1056
|
}
|
|
1052
1057
|
function st(e, t) {
|
|
@@ -1058,12 +1063,12 @@ function st(e, t) {
|
|
|
1058
1063
|
"No semantic or physical source could be converted into the current dashboard authoring dataset reference."
|
|
1059
1064
|
)
|
|
1060
1065
|
), [];
|
|
1061
|
-
const r = n.every((a) => a.kind === "semantic"),
|
|
1066
|
+
const r = n.every((a) => a.kind === "semantic"), o = Array.from(
|
|
1062
1067
|
new Set(
|
|
1063
1068
|
n.filter((a) => a.kind === "semantic").map((a) => a.domainId)
|
|
1064
1069
|
)
|
|
1065
1070
|
);
|
|
1066
|
-
return n.length > 1 && (!r ||
|
|
1071
|
+
return n.length > 1 && (!r || o.length !== 1) ? (t.push(
|
|
1067
1072
|
b(
|
|
1068
1073
|
"multiple_datasets_out_of_scope",
|
|
1069
1074
|
"The dashboard authoring compiler supports multiple datasets only within one semantic domain; using the first source and deferring the rest."
|
|
@@ -1071,20 +1076,20 @@ function st(e, t) {
|
|
|
1071
1076
|
), [n[0]]) : n;
|
|
1072
1077
|
}
|
|
1073
1078
|
function dt(e, t) {
|
|
1074
|
-
const n = U(e), r =
|
|
1079
|
+
const n = U(e), r = me(e), o = P(it(e)), a = P(
|
|
1075
1080
|
ot(e)
|
|
1076
1081
|
);
|
|
1077
1082
|
return {
|
|
1078
1083
|
sections: n,
|
|
1079
1084
|
inputs: r,
|
|
1080
|
-
sources:
|
|
1085
|
+
sources: o,
|
|
1081
1086
|
primarySources: a,
|
|
1082
1087
|
defaultSource: a.length === 1 ? a[0] : void 0,
|
|
1083
|
-
datasets: st(
|
|
1088
|
+
datasets: st(o, t)
|
|
1084
1089
|
};
|
|
1085
1090
|
}
|
|
1086
1091
|
function ct(e) {
|
|
1087
|
-
return e &&
|
|
1092
|
+
return e && ae(e).ok ? e : void 0;
|
|
1088
1093
|
}
|
|
1089
1094
|
function lt(e) {
|
|
1090
1095
|
var t;
|
|
@@ -1110,7 +1115,7 @@ function ut(e) {
|
|
|
1110
1115
|
return ((t = e.presentation) == null ? void 0 : t.kind) === "kpi" ? "kpi" : ((n = e.presentation) == null ? void 0 : n.kind) === "table" ? "table" : ((r = e.presentation) == null ? void 0 : r.kind) === "text" ? "text" : "chart";
|
|
1111
1116
|
}
|
|
1112
1117
|
function ft(e) {
|
|
1113
|
-
const t =
|
|
1118
|
+
const t = we(e);
|
|
1114
1119
|
switch (t) {
|
|
1115
1120
|
case "not_in":
|
|
1116
1121
|
return "not in";
|
|
@@ -1118,6 +1123,8 @@ function ft(e) {
|
|
|
1118
1123
|
return "not between";
|
|
1119
1124
|
case "contains":
|
|
1120
1125
|
return "like";
|
|
1126
|
+
case "not_contains":
|
|
1127
|
+
return "not like";
|
|
1121
1128
|
default:
|
|
1122
1129
|
return t || "in";
|
|
1123
1130
|
}
|
|
@@ -1129,7 +1136,7 @@ function ht(e) {
|
|
|
1129
1136
|
if (!(!e || e.kind !== "physical"))
|
|
1130
1137
|
return [e.databaseName, e.schemaName, e.tableName].filter(Boolean).join(".");
|
|
1131
1138
|
}
|
|
1132
|
-
function mt(e, t, n, r,
|
|
1139
|
+
function mt(e, t, n, r, o, a) {
|
|
1133
1140
|
if (e.kind !== "filter")
|
|
1134
1141
|
return a.push(
|
|
1135
1142
|
b(
|
|
@@ -1144,12 +1151,12 @@ function mt(e, t, n, r, i, a) {
|
|
|
1144
1151
|
`Filter "${e.label || e.id}" needs a field before the dashboard compiler can materialize it.`
|
|
1145
1152
|
)
|
|
1146
1153
|
), null;
|
|
1147
|
-
const
|
|
1154
|
+
const i = ke({
|
|
1148
1155
|
explicitSource: void 0,
|
|
1149
1156
|
field: e.field,
|
|
1150
1157
|
defaultSource: t,
|
|
1151
1158
|
fallbackSources: n
|
|
1152
|
-
}), d = (
|
|
1159
|
+
}), d = (i == null ? void 0 : i.kind) === "semantic" || (i == null ? void 0 : i.kind) === "physical" ? i.connectionId : void 0;
|
|
1153
1160
|
if (!d)
|
|
1154
1161
|
return a.push(
|
|
1155
1162
|
b(
|
|
@@ -1158,30 +1165,30 @@ function mt(e, t, n, r, i, a) {
|
|
|
1158
1165
|
)
|
|
1159
1166
|
), null;
|
|
1160
1167
|
const h = {
|
|
1161
|
-
id: `filter-${
|
|
1168
|
+
id: `filter-${he(
|
|
1162
1169
|
F(e.id, e.field.name),
|
|
1163
|
-
|
|
1170
|
+
o
|
|
1164
1171
|
)}`,
|
|
1165
1172
|
variableName: e.id,
|
|
1166
1173
|
connectionId: d,
|
|
1167
1174
|
title: e.label,
|
|
1168
1175
|
column: e.field.name,
|
|
1169
1176
|
dataType: pt(e),
|
|
1170
|
-
qualifiedTableName: ht(
|
|
1177
|
+
qualifiedTableName: ht(i),
|
|
1171
1178
|
sql: "",
|
|
1172
1179
|
operation: ft(e.operator),
|
|
1173
1180
|
type: e.multi === !1 ? "single" : "multiple",
|
|
1174
1181
|
location: "dashboard",
|
|
1175
1182
|
displayMode: "toolbar",
|
|
1176
|
-
fieldMeta: (
|
|
1183
|
+
fieldMeta: (i == null ? void 0 : i.kind) === "semantic" ? {
|
|
1177
1184
|
name: e.field.name,
|
|
1178
1185
|
qualifiedFieldName: e.field.name,
|
|
1179
1186
|
dataType: e.field.dataType,
|
|
1180
1187
|
role: e.field.role === "measure" ? "metric" : "groupby"
|
|
1181
1188
|
} : void 0,
|
|
1182
|
-
semanticContext: (
|
|
1183
|
-
semanticDomainId:
|
|
1184
|
-
connectionId:
|
|
1189
|
+
semanticContext: (i == null ? void 0 : i.kind) === "semantic" ? {
|
|
1190
|
+
semanticDomainId: i.domainId,
|
|
1191
|
+
connectionId: i.connectionId
|
|
1185
1192
|
} : void 0
|
|
1186
1193
|
};
|
|
1187
1194
|
return {
|
|
@@ -1199,8 +1206,8 @@ function mt(e, t, n, r, i, a) {
|
|
|
1199
1206
|
function O(e) {
|
|
1200
1207
|
const t = [], n = [];
|
|
1201
1208
|
for (const r of e.viewIds) {
|
|
1202
|
-
const
|
|
1203
|
-
|
|
1209
|
+
const o = e.viewIdToCardId.get(r);
|
|
1210
|
+
o ? t.push(o) : n.push(r);
|
|
1204
1211
|
}
|
|
1205
1212
|
return n.length > 0 && e.warnings.push(
|
|
1206
1213
|
b(
|
|
@@ -1210,7 +1217,7 @@ function O(e) {
|
|
|
1210
1217
|
), Array.from(new Set(t));
|
|
1211
1218
|
}
|
|
1212
1219
|
function gt(e) {
|
|
1213
|
-
var r,
|
|
1220
|
+
var r, o;
|
|
1214
1221
|
if (!e.protocolScope) {
|
|
1215
1222
|
const a = Array.from(new Set(e.boundCardIds));
|
|
1216
1223
|
return a.length > 0 && a.length < e.allCardIds.length ? { kind: "cards", cardIds: a } : void 0;
|
|
@@ -1228,7 +1235,7 @@ function gt(e) {
|
|
|
1228
1235
|
);
|
|
1229
1236
|
return {
|
|
1230
1237
|
kind: "cards",
|
|
1231
|
-
cardIds: e.allCardIds.filter((
|
|
1238
|
+
cardIds: e.allCardIds.filter((i) => !a.has(i))
|
|
1232
1239
|
};
|
|
1233
1240
|
}
|
|
1234
1241
|
if (e.protocolScope.level === "view") {
|
|
@@ -1253,7 +1260,7 @@ function gt(e) {
|
|
|
1253
1260
|
`Filter "${e.inputLabel}" was deferred because section "${e.protocolScope.sectionId}" does not match any materialized cards.`
|
|
1254
1261
|
)
|
|
1255
1262
|
), null;
|
|
1256
|
-
if (!((
|
|
1263
|
+
if (!((o = e.protocolScope.excludeViewIds) != null && o.length))
|
|
1257
1264
|
return { kind: "cards", cardIds: t };
|
|
1258
1265
|
const n = new Set(
|
|
1259
1266
|
O({
|
|
@@ -1270,16 +1277,16 @@ function gt(e) {
|
|
|
1270
1277
|
}
|
|
1271
1278
|
function Dt(e) {
|
|
1272
1279
|
var v, y, c;
|
|
1273
|
-
const t = [], n =
|
|
1280
|
+
const t = [], n = _e(e);
|
|
1274
1281
|
for (const f of n.warnings)
|
|
1275
1282
|
t.push(b(f.code, f.message));
|
|
1276
1283
|
for (const f of n.errors)
|
|
1277
1284
|
t.push(b(f.code, f.message));
|
|
1278
|
-
const r = dt(e, t),
|
|
1285
|
+
const r = dt(e, t), o = [], a = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
|
|
1279
1286
|
let h = 0;
|
|
1280
1287
|
for (const [f, g] of r.sections.entries()) {
|
|
1281
1288
|
const l = typeof g.title == "string" ? g.title : `Section ${f + 1}`, Q = g.id || F(l, `section-${f + 1}`);
|
|
1282
|
-
|
|
1289
|
+
i.set(Q, []);
|
|
1283
1290
|
for (const [X, m] of J(g).entries()) {
|
|
1284
1291
|
const Y = lt(m), V = F(
|
|
1285
1292
|
m.id || `${l}-${m.title || `View ${X + 1}`}`,
|
|
@@ -1305,14 +1312,14 @@ function Dt(e) {
|
|
|
1305
1312
|
);
|
|
1306
1313
|
continue;
|
|
1307
1314
|
}
|
|
1308
|
-
const Z =
|
|
1309
|
-
m.id && a.set(m.id, $), (c =
|
|
1310
|
-
const
|
|
1311
|
-
for (const ee of
|
|
1315
|
+
const Z = he(V, s), $ = `card-${Z}`;
|
|
1316
|
+
m.id && a.set(m.id, $), (c = i.get(Q)) == null || c.push($);
|
|
1317
|
+
const ge = m.analytics && "inputs" in m.analytics ? m.analytics.inputs : void 0;
|
|
1318
|
+
for (const ee of ge || []) {
|
|
1312
1319
|
const te = d.get(ee.inputId) || [];
|
|
1313
1320
|
te.push($), d.set(ee.inputId, te);
|
|
1314
1321
|
}
|
|
1315
|
-
|
|
1322
|
+
o.push({
|
|
1316
1323
|
id: $,
|
|
1317
1324
|
frameId: `frame-${Z}`,
|
|
1318
1325
|
title: m.title,
|
|
@@ -1330,10 +1337,10 @@ function Dt(e) {
|
|
|
1330
1337
|
const g = gt({
|
|
1331
1338
|
protocolScope: f.scope,
|
|
1332
1339
|
inputLabel: f.label,
|
|
1333
|
-
allCardIds:
|
|
1340
|
+
allCardIds: o.map((l) => l.id),
|
|
1334
1341
|
boundCardIds: d.get(f.id) || [],
|
|
1335
1342
|
viewIdToCardId: a,
|
|
1336
|
-
sectionIdToCardIds:
|
|
1343
|
+
sectionIdToCardIds: i,
|
|
1337
1344
|
warnings: t
|
|
1338
1345
|
});
|
|
1339
1346
|
return g === null ? null : mt(
|
|
@@ -1357,7 +1364,7 @@ function Dt(e) {
|
|
|
1357
1364
|
title: e.title,
|
|
1358
1365
|
description: e.description,
|
|
1359
1366
|
kind: "dashboard",
|
|
1360
|
-
cards:
|
|
1367
|
+
cards: o
|
|
1361
1368
|
}
|
|
1362
1369
|
],
|
|
1363
1370
|
filterInputs: I.length ? I : void 0,
|
|
@@ -1366,7 +1373,7 @@ function Dt(e) {
|
|
|
1366
1373
|
}, warnings: t };
|
|
1367
1374
|
}
|
|
1368
1375
|
export {
|
|
1369
|
-
|
|
1376
|
+
be as DASHBOARD_AUTHORING_BREAKPOINTS,
|
|
1370
1377
|
B as DASHBOARD_AUTHORING_MAX_GENERATED_CARDS,
|
|
1371
1378
|
xt as applyDashboardChangePlan,
|
|
1372
1379
|
kt as compileDashboardFromPlan,
|
|
@@ -1375,17 +1382,17 @@ export {
|
|
|
1375
1382
|
St as dashboardAuthoringFieldsReferToSameTarget,
|
|
1376
1383
|
S as dashboardAuthoringSourceFromField,
|
|
1377
1384
|
wt as dashboardAuthoringSourceKey,
|
|
1378
|
-
|
|
1385
|
+
ie as dashboardAuthoringSourcesReferToSameDataset,
|
|
1379
1386
|
Dt as dashboardPlanFromSemaphorDashboardIntent,
|
|
1380
1387
|
Ct as findDashboardAuthoringDatasetForSource,
|
|
1381
|
-
|
|
1388
|
+
Me as getDashboardAuthoringCardSource,
|
|
1382
1389
|
z as isMaterializableDashboardAuthoringSource,
|
|
1383
|
-
|
|
1390
|
+
Se as isSemaphorSourceRef,
|
|
1384
1391
|
P as mergeDashboardAuthoringSources,
|
|
1385
|
-
|
|
1392
|
+
Ce as preferDashboardAuthoringSourceMetadata,
|
|
1386
1393
|
vt as preferredDashboardAuthoringSource,
|
|
1387
|
-
|
|
1388
|
-
|
|
1394
|
+
ke as resolveDashboardAuthoringSource,
|
|
1395
|
+
Ne as validateDashboardAuthoringDatasetScope,
|
|
1389
1396
|
ze as validateDashboardChangePlan,
|
|
1390
1397
|
Pe as validateDashboardPlan
|
|
1391
1398
|
};
|