react-semaphor 0.1.598 → 0.1.600
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.js +336 -333
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +5 -5
- package/dist/brand-studio/index.js +8 -8
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/{add-to-dashboard-C86FsM8D.js → add-to-dashboard-ClhEIFst.js} +1 -1
- package/dist/chunks/{analytics-base-schemas-8wz9vqn_.js → analytics-base-schemas-DevrgqQb.js} +67 -60
- package/dist/chunks/{assistant-chat-DrI442Ld.js → assistant-chat-BULOkG9j.js} +88 -89
- package/dist/chunks/{bookmark-impact-C6uWtNWF.js → bookmark-impact-kdvXke8n.js} +3 -3
- package/dist/chunks/{bookmark-state-BfeKmj5s.js → bookmark-state-h1OLXVjE.js} +153 -153
- package/dist/chunks/{card-filter-builder-CSKCSpNo.js → card-filter-builder-CSCdSQQy.js} +1035 -1063
- package/dist/chunks/{comparison-window-caption-3bum5j00.js → comparison-window-caption-DJDwP9XO.js} +6 -6
- package/dist/chunks/{context-CVXTFljo.js → context-BJoEFgNl.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-C2AuKs10.js → dashboard-briefing-launcher-9YwUclHA.js} +255 -255
- package/dist/chunks/{dashboard-controls-BSbhyIkY.js → dashboard-controls-O6PNXMCp.js} +85 -85
- package/dist/chunks/{dashboard-json-Bd1rxD3y.js → dashboard-json-Bxf91TYq.js} +5 -5
- package/dist/chunks/{dashboard-PYd63LbL.js → dashboard-y9ON19ge.js} +1 -1
- package/dist/chunks/dates-DPTbpNxK.js +164 -0
- package/dist/chunks/{edit-dashboard-visual-D_0ZiWev.js → edit-dashboard-visual-CKwaW8H_.js} +5489 -5435
- package/dist/chunks/{filter-line-BdLyPYjH.js → filter-line-Dkg3yuOX.js} +6 -6
- package/dist/chunks/{filter-reach-copy-Dxn-mTuG.js → filter-reach-copy-ClzNcNhP.js} +1740 -1643
- package/dist/chunks/{filter-value-text-C6g-nDUW.js → filter-value-text-CXyuLW9Q.js} +4 -4
- package/dist/chunks/{index-BHSDE54O.js → index-CRo5--Y6.js} +7 -7
- package/dist/chunks/{layout-grid-CYR-LVpl.js → layout-grid-DSrBSfPM.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-C0IGLTZH.js → matrix-analytical-definition-i9PQY066.js} +443 -394
- package/dist/chunks/{matrix-member-presentation-D5BIYuy5.js → matrix-member-presentation-B_2beBc0.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-RckfqkQm.js → matrix-operation-contract-DdK0J_KU.js} +36 -36
- package/dist/chunks/{metric-comparison-DsE8wdRh.js → metric-comparison-Bhz0V841.js} +2 -2
- package/dist/chunks/{paintbrush-xDDRjIyF.js → paintbrush-1UiU-uTz.js} +1 -1
- package/dist/chunks/{palette-CbOgFCy2.js → palette-DFIFf_-m.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-Cnq55Uno.js → pivot-result-contract-expectations-Dk7WFR_u.js} +8 -8
- package/dist/chunks/{pivot-result-identity-b4-ugQhm.js → pivot-result-identity-CzzrJpEm.js} +1 -1
- package/dist/chunks/{raw-temporal-value-B9W38mi3.js → raw-temporal-value-BLvdaMng.js} +2 -2
- package/dist/chunks/{report-preferences-dialog-DTu3a7ce.js → report-preferences-dialog-DiDsYpng.js} +14 -14
- package/dist/chunks/{report-runtime-context-BvJkcbar.js → report-runtime-context-CEGluufW.js} +2 -2
- package/dist/chunks/{resolve-dashboard-input-context-Bw-DesV2.js → resolve-dashboard-input-context-BAv33KGg.js} +11811 -11331
- package/dist/chunks/{save-BgvAsp6X.js → save-CWQ02kHo.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-BFh0oOnF.js → saved-dashboard-context-CvzYqADe.js} +97 -97
- package/dist/chunks/{selection-filter-compiler-DHYsq3yM.js → selection-filter-compiler-SwrBvyyJ.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-WvgHMnj8.js → semaphor-ready-indicator-1PRI9Yh2.js} +59336 -58569
- package/dist/chunks/{shelf-drop-preview-context-D6HgYFJp.js → shelf-drop-preview-context-BLk5Nc6K.js} +6 -6
- package/dist/chunks/{stored-dashboard-vlG0Knxi.js → stored-dashboard-xhYYKBsO.js} +1200 -1183
- package/dist/chunks/{style-sheet-parts-ClmvtkSC.js → style-sheet-parts-BX7d7-2-.js} +198 -198
- package/dist/chunks/{table-export-sheet-Bv6tVuMu.js → table-export-sheet-BWSVTclx.js} +1 -1
- package/dist/chunks/{token-types-eMdcuB6j.js → token-types-CnlEiAdS.js} +1 -1
- package/dist/chunks/{upload-ClUeK8F0.js → upload-DsqUSS8l.js} +1 -1
- package/dist/chunks/{validators-DwhBEvnh.js → validators-D2Hm57lJ.js} +23 -13
- package/dist/chunks/{variable-draft-CauoSBN0.js → variable-draft-DcKj8T1b.js} +4 -4
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +2497 -2549
- package/dist/format-utils/index.js +14 -14
- package/dist/index.js +48 -48
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/surfboard/filter/types.d.ts +13 -1
- package/dist/types/components/visual/data-table/hooks/use-data-table-logic.d.ts +0 -2
- package/dist/types/components/visual/data-table/types/data-table.d.ts +14 -21
- package/dist/types/index.js +5 -5
- package/dist/types/lib/dashboard-view-state/card-view-state.d.ts +11 -1
- package/dist/types/lib/dashboard-view-state/drill-path.d.ts +7 -0
- package/dist/types/lib/dashboard-viewer/table-view.d.ts +20 -0
- package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +8 -0
- package/dist/types/lib/matrix-table/matrix-runtime.d.ts +1 -0
- package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +2 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +3 -1
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +64 -0
- package/dist/types/shared/analytics-protocol/catalog-source-address.d.ts +16 -0
- package/dist/types/shared/analytics-protocol/column-filter-id.d.ts +4 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +26 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +12 -1
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +8 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +3 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +29 -1
- package/dist/types/shared/usage-events/attribution.d.ts +2 -2
- package/dist/types/shared/usage-events/envelope.d.ts +2 -2
- package/dist/usage-events/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/aggregate-measure-field-DtKcEjG5.js +0 -22
- package/dist/chunks/dates-DHMCf-F7.js +0 -115
- package/dist/chunks/list-filter-B67GsjTw.js +0 -15
package/dist/chunks/{saved-dashboard-context-BFh0oOnF.js → saved-dashboard-context-CvzYqADe.js}
RENAMED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
var Z = Object.defineProperty;
|
|
2
2
|
var Q = (e, t, a) => t in e ? Z(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
3
|
var F = (e, t, a) => Q(e, typeof t != "symbol" ? t + "" : t, a);
|
|
4
|
-
import { D as S, F as U, G as K, H as W } from "./bookmark-state-
|
|
5
|
-
import { s as X,
|
|
6
|
-
import { c as
|
|
7
|
-
import { f as g, A as P, c as
|
|
8
|
-
import { a as
|
|
9
|
-
import { r as
|
|
10
|
-
import { b as
|
|
11
|
-
import { i as
|
|
12
|
-
function
|
|
4
|
+
import { D as S, F as U, G as K, H as W } from "./bookmark-state-h1OLXVjE.js";
|
|
5
|
+
import { s as X, k as Y, n as ee, m as te, o as ae, p as re, q as ne, t as se, u as oe, v as ie, w as j, x as de, y as le, z as ce } from "./resolve-dashboard-input-context-BAv33KGg.js";
|
|
6
|
+
import { c as ue, e as L, b as me, d as fe, p as q, f as he, g as pe, r as _, i as O, j as be, m as ge, k as Ce } from "./stored-dashboard-xhYYKBsO.js";
|
|
7
|
+
import { f as g, A as P, c as Ie, d as ye, e as M } from "./context-BJoEFgNl.js";
|
|
8
|
+
import { a as ve, T as xe, P as Ve, o as I, d as B, b as w } from "./filter-value-text-CXyuLW9Q.js";
|
|
9
|
+
import { r as Se, aa as $e } from "./validators-D2Hm57lJ.js";
|
|
10
|
+
import { b as ke } from "./metric-comparison-Bhz0V841.js";
|
|
11
|
+
import { i as qe } from "./matrix-analytical-definition-i9PQY066.js";
|
|
12
|
+
function _e(e) {
|
|
13
13
|
const t = e.qualifiedFieldName || e.name;
|
|
14
14
|
return e.label && e.label !== t ? `${e.label} (field ${t})` : t;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function we(e, t = {}) {
|
|
17
17
|
if (!e) return [];
|
|
18
18
|
const a = N(e, t);
|
|
19
19
|
return a.length === 0 ? [] : e.logicalOperator === "AND" && !e.negate ? a : [z(e, a)];
|
|
@@ -25,7 +25,7 @@ function N(e, t) {
|
|
|
25
25
|
const s = z(r, n);
|
|
26
26
|
return [n.length > 1 && !r.negate ? { ...s, text: `(${s.text})` } : s];
|
|
27
27
|
});
|
|
28
|
-
return [...e.conditions.map((r) =>
|
|
28
|
+
return [...e.conditions.map((r) => De(r, t)), ...a];
|
|
29
29
|
}
|
|
30
30
|
function z(e, t) {
|
|
31
31
|
const a = t.map((r) => r.text).join(e.logicalOperator === "OR" ? " or " : " and ");
|
|
@@ -34,20 +34,20 @@ function z(e, t) {
|
|
|
34
34
|
omittedValues: t.reduce((r, n) => r + n.omittedValues, 0)
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function De(e, t) {
|
|
38
38
|
const a = Array.isArray(e.value) ? e.value : [e.value];
|
|
39
|
-
return
|
|
40
|
-
subject:
|
|
39
|
+
return ve({
|
|
40
|
+
subject: _e(e.field),
|
|
41
41
|
operator: e.operator,
|
|
42
42
|
values: a,
|
|
43
|
-
reading:
|
|
44
|
-
relative:
|
|
43
|
+
reading: Fe(e),
|
|
44
|
+
relative: Se(e.relativeMeta),
|
|
45
45
|
latestValue: e.latestValue,
|
|
46
46
|
shownAs: e.label
|
|
47
47
|
}, t);
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
return e.temporalBucket ? { kind: "bucket", bucket: e.temporalBucket } :
|
|
49
|
+
function Fe(e) {
|
|
50
|
+
return e.temporalBucket ? { kind: "bucket", bucket: e.temporalBucket } : $e(e.field.dataType) ? xe : Ve;
|
|
51
51
|
}
|
|
52
52
|
function H(e) {
|
|
53
53
|
if (e.kind === "target") return `a target of ${e.targetValue}`;
|
|
@@ -57,11 +57,11 @@ function H(e) {
|
|
|
57
57
|
].filter(Boolean);
|
|
58
58
|
return r.length ? `${a}, ${r.join(", ")}` : a;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Me(e) {
|
|
61
61
|
return (e == null ? void 0 : e.kind) === "field_date" ? `the ${JSON.stringify(e.label)} filter` : "the dashboard date";
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
const a = t.source === "explicit" ? "set on the measure" : `from the dashboard date comparison on ${
|
|
63
|
+
function Ae(e, t) {
|
|
64
|
+
const a = t.source === "explicit" ? "set on the measure" : `from the dashboard date comparison on ${Me(t.owner)}`;
|
|
65
65
|
return `${e} is compared with ${H(t.spec)} (${a})`;
|
|
66
66
|
}
|
|
67
67
|
function k(e) {
|
|
@@ -77,21 +77,21 @@ function A(e, t) {
|
|
|
77
77
|
return a = Math.imul(a ^ a >>> 16, 2246822507) ^ Math.imul(r ^ r >>> 13, 3266489909), r = Math.imul(r ^ r >>> 16, 2246822507) ^ Math.imul(a ^ a >>> 13, 3266489909), 4294967296 * (2097151 & r) + (a >>> 0);
|
|
78
78
|
}
|
|
79
79
|
const h = P;
|
|
80
|
-
function
|
|
80
|
+
function Re(e, t, a) {
|
|
81
81
|
var y;
|
|
82
82
|
const r = t !== "pending" && (t == null ? void 0 : t.status) === "ready" ? t : void 0, n = Te(e, t);
|
|
83
83
|
if (n) {
|
|
84
|
-
const v = t !== "pending" && (t == null ? void 0 : t.status) === "blocked" ?
|
|
84
|
+
const v = t !== "pending" && (t == null ? void 0 : t.status) === "blocked" ? Ee(t) : void 0, $ = v ? g(v, h.textChars) : void 0;
|
|
85
85
|
return {
|
|
86
86
|
// A card that runs but is not described still changes when it runs differently.
|
|
87
|
-
fingerprint: k(r ?
|
|
87
|
+
fingerprint: k(r ? R(r, a.calendar) : { reason: n, message: $ }),
|
|
88
88
|
description: { status: "not_described", reason: n, ...$ ? { message: $ } : {} }
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
const s = r, l = s.queryContext, m =
|
|
91
|
+
const s = r, l = s.queryContext, m = Le(s), o = Be(s, a), c = ze(s), i = Oe(s), u = l.drillSteps.map((v) => g(
|
|
92
92
|
`${JSON.stringify(v.label)} (then by ${v.toField.label || v.toField.name})`,
|
|
93
93
|
h.textChars
|
|
94
|
-
)), d = (y = s.card.sql) == null ? void 0 : y.trim(), b = d ?
|
|
94
|
+
)), d = (y = s.card.sql) == null ? void 0 : y.trim(), b = d ? He(s) : [], f = {
|
|
95
95
|
fields: I(m.length, h.cardFields),
|
|
96
96
|
filters: I(o.length, h.cardFilters),
|
|
97
97
|
controls: I(c.length, h.cardControls),
|
|
@@ -100,7 +100,7 @@ function Ae(e, t, a) {
|
|
|
100
100
|
comparisons: I(i.length, h.cardFields)
|
|
101
101
|
}, p = Object.fromEntries(Object.entries(f).filter(([, v]) => v > 0));
|
|
102
102
|
return {
|
|
103
|
-
fingerprint: k(
|
|
103
|
+
fingerprint: k(R(s, a.calendar)),
|
|
104
104
|
description: {
|
|
105
105
|
status: "described",
|
|
106
106
|
fields: m.slice(0, h.cardFields),
|
|
@@ -125,26 +125,26 @@ function Te(e, t) {
|
|
|
125
125
|
if (t === "pending") return "snapshot_pending";
|
|
126
126
|
if ((t == null ? void 0 : t.status) !== "ready") return "snapshot_blocked";
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function Ee(e) {
|
|
129
129
|
if (e.message) return e.message;
|
|
130
130
|
const t = e.mappingDispositions.flatMap((a) => a.status === "block" ? [`${a.inputId} (${a.reason})`] : []);
|
|
131
131
|
return t.length ? `dashboard inputs that cannot apply to this card: ${t.join(", ")}` : void 0;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
return
|
|
133
|
+
function R(e, t) {
|
|
134
|
+
return ue(e.card, e.queryContext, t).queryInputIdentity;
|
|
135
135
|
}
|
|
136
|
-
const
|
|
136
|
+
const je = [
|
|
137
137
|
["row", "rows"],
|
|
138
138
|
["column", "columns"],
|
|
139
139
|
["measure", "metrics"],
|
|
140
140
|
["detail", "details"]
|
|
141
141
|
];
|
|
142
|
-
function
|
|
142
|
+
function Le(e) {
|
|
143
143
|
const { fields: t } = te({
|
|
144
144
|
type: e.card.type,
|
|
145
145
|
config: e.queryContext.finalConfig
|
|
146
146
|
});
|
|
147
|
-
return
|
|
147
|
+
return je.flatMap(([a, r]) => t[r].map((n) => {
|
|
148
148
|
const s = n.aggregate, l = n.grainMode ?? n.granularity;
|
|
149
149
|
return {
|
|
150
150
|
role: a,
|
|
@@ -155,39 +155,39 @@ function je(e) {
|
|
|
155
155
|
};
|
|
156
156
|
}));
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function Oe(e) {
|
|
159
159
|
const t = e.queryContext;
|
|
160
160
|
return (t.finalConfig.metricColumns ?? []).flatMap((a) => {
|
|
161
|
-
const r =
|
|
161
|
+
const r = ke({
|
|
162
162
|
metricComparison: a.comparison,
|
|
163
163
|
globalDateComparison: t.globalDateComparison
|
|
164
164
|
});
|
|
165
|
-
return r ? [g(
|
|
165
|
+
return r ? [g(Ae(Pe(a.label || a.name), r), h.textChars)] : [];
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function Pe(e) {
|
|
169
169
|
return JSON.stringify(e);
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
const a = e.queryContext, r = { maxListedValues: h.inputValues, timeZone: t.tz }, n = e.card
|
|
171
|
+
function Be(e, { calendar: t }) {
|
|
172
|
+
const a = e.queryContext, r = { maxListedValues: h.inputValues, timeZone: t.tz }, n = ae(e.card), s = new Set(n.map((i) => i.id)), l = new Map(
|
|
173
173
|
[...a.queryFilterDefinitions, ...n].map((i) => [i.id, i.title])
|
|
174
174
|
), m = a.cardFilterValues.map((i) => {
|
|
175
175
|
const u = l.get(i.filterId) || i.name, d = i.dateOwner === "global_date" ? `${u} (the dashboard date, on this card's field ${i.name})` : `${u} (field ${i.name})`, b = B(i, d, r);
|
|
176
176
|
return {
|
|
177
177
|
// A click that reaches the card through relationships is the click it
|
|
178
178
|
// is, not an input (click relationship reach CR-D15).
|
|
179
|
-
origin:
|
|
179
|
+
origin: qe(i.filterId) ? "selection" : s.has(i.filterId) ? "card_input" : "dashboard_input",
|
|
180
180
|
text: g(b.text, h.textChars),
|
|
181
181
|
...b.omittedValues ? { omittedValues: b.omittedValues } : {}
|
|
182
182
|
};
|
|
183
|
-
}), o = a.resolvedFilterParts, c = [["card", o.authored], ["drill", o.drill], ["selection", o.selections]].flatMap(([i, u]) =>
|
|
183
|
+
}), o = a.resolvedFilterParts, c = [["card", o.authored], ["drill", o.drill], ["selection", o.selections]].flatMap(([i, u]) => we(u, r).map((d) => ({
|
|
184
184
|
origin: i,
|
|
185
185
|
text: g(d.text, h.textChars),
|
|
186
186
|
...d.omittedValues ? { omittedValues: d.omittedValues } : {}
|
|
187
187
|
})));
|
|
188
188
|
return [...m, ...c];
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function Ne(e) {
|
|
191
191
|
const t = e.queryContext, a = L({
|
|
192
192
|
sql: e.card.sql,
|
|
193
193
|
controlBindings: t.controlBindings
|
|
@@ -201,14 +201,14 @@ function Be(e) {
|
|
|
201
201
|
sqlParameterIds: a.filter((s) => s.controlId === n).map((s) => s.paramId)
|
|
202
202
|
}));
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function ze(e) {
|
|
205
205
|
const t = e.queryContext, a = new Map(
|
|
206
206
|
[...t.controlDefinitions, ...t.cardControlDefinitions].map((r) => [r.id, r])
|
|
207
207
|
);
|
|
208
|
-
return
|
|
208
|
+
return Ne(e).map(({ id: r, bindings: n, sqlParameterIds: s }) => {
|
|
209
209
|
var o;
|
|
210
210
|
const l = t.controlValues[r], m = /* @__PURE__ */ new Set([
|
|
211
|
-
...n.filter((c) => c.target !== "sql_param").map((c) =>
|
|
211
|
+
...n.filter((c) => c.target !== "sql_param").map((c) => Je(c, l)),
|
|
212
212
|
...s.map((c) => `SQL parameter ${c}`)
|
|
213
213
|
]);
|
|
214
214
|
return {
|
|
@@ -220,7 +220,7 @@ function Ne(e) {
|
|
|
220
220
|
};
|
|
221
221
|
});
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function He(e) {
|
|
224
224
|
const t = e.queryContext;
|
|
225
225
|
return L({ sql: e.card.sql, controlBindings: t.controlBindings }).map((a) => ({
|
|
226
226
|
name: g(a.paramId, h.labelChars),
|
|
@@ -230,7 +230,7 @@ function ze(e) {
|
|
|
230
230
|
)
|
|
231
231
|
}));
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function Je(e, t) {
|
|
234
234
|
const a = typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? String(t) : void 0;
|
|
235
235
|
switch (e.target) {
|
|
236
236
|
case "sql_param":
|
|
@@ -257,11 +257,11 @@ class V extends Error {
|
|
|
257
257
|
this.name = "AssistantContextSourceError", this.code = a;
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
const C = P,
|
|
261
|
-
function
|
|
260
|
+
const C = P, Ge = "Untitled";
|
|
261
|
+
function Ze(e) {
|
|
262
262
|
var f;
|
|
263
263
|
if (e.surface === "none")
|
|
264
|
-
return
|
|
264
|
+
return T({
|
|
265
265
|
version: M,
|
|
266
266
|
surface: "none",
|
|
267
267
|
otherSheets: [],
|
|
@@ -278,12 +278,12 @@ function Ge(e) {
|
|
|
278
278
|
"card_not_on_sheet",
|
|
279
279
|
`card ${e.selectedCard.cardId} is not on sheet ${a}`
|
|
280
280
|
);
|
|
281
|
-
const u = s ?
|
|
281
|
+
const u = s ? Ke(e, s, m) : [], d = {
|
|
282
282
|
otherSheets: I(l.length, C.otherSheets),
|
|
283
283
|
activeInputs: I(u.length, C.activeInputs),
|
|
284
284
|
cards: I(m.length, C.summaryCards)
|
|
285
285
|
}, b = Object.fromEntries(Object.entries(d).filter(([, p]) => p > 0));
|
|
286
|
-
return
|
|
286
|
+
return T({
|
|
287
287
|
version: M,
|
|
288
288
|
surface: e.editing ? "editor" : "dashboard",
|
|
289
289
|
dashboard: {
|
|
@@ -295,25 +295,25 @@ function Ge(e) {
|
|
|
295
295
|
otherSheets: l.slice(0, C.otherSheets).map((p) => ({ id: p.id, title: x(p.title) })),
|
|
296
296
|
activeInputs: u.slice(0, C.activeInputs),
|
|
297
297
|
cards: o.map((p) => J(p.card)),
|
|
298
|
-
...i && e.selectedCard ? { selectedCard:
|
|
298
|
+
...i && e.selectedCard ? { selectedCard: Qe(i, e.selectedCard.snapshot, r) } : {},
|
|
299
299
|
...e.editing ? { editing: e.editing } : {},
|
|
300
300
|
...Object.keys(b).length ? { omitted: b } : {},
|
|
301
301
|
timeZone: r.tz
|
|
302
302
|
});
|
|
303
303
|
}
|
|
304
|
-
function
|
|
305
|
-
return { ...J(e), ...
|
|
304
|
+
function Qe(e, t, a) {
|
|
305
|
+
return { ...J(e), ...Re(e, t, { calendar: a }) };
|
|
306
306
|
}
|
|
307
|
-
function
|
|
308
|
-
const t =
|
|
309
|
-
if (t > C.contextBytes) throw new
|
|
307
|
+
function T(e) {
|
|
308
|
+
const t = Ie(e);
|
|
309
|
+
if (t > C.contextBytes) throw new ye(t);
|
|
310
310
|
return e;
|
|
311
311
|
}
|
|
312
312
|
function x(e) {
|
|
313
|
-
return g((e == null ? void 0 : e.trim()) ||
|
|
313
|
+
return g((e == null ? void 0 : e.trim()) || Ge, C.labelChars);
|
|
314
314
|
}
|
|
315
315
|
function J(e) {
|
|
316
|
-
const t =
|
|
316
|
+
const t = Ue(e);
|
|
317
317
|
return {
|
|
318
318
|
id: e.id,
|
|
319
319
|
title: x(e.title),
|
|
@@ -321,9 +321,9 @@ function J(e) {
|
|
|
321
321
|
...t ? { source: t } : {}
|
|
322
322
|
};
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function Ue(e) {
|
|
325
325
|
var a;
|
|
326
|
-
const t =
|
|
326
|
+
const t = oe(e);
|
|
327
327
|
if (t.kind === "config")
|
|
328
328
|
return t.executableSources.length === 1 ? t.executableSources[0] : void 0;
|
|
329
329
|
if (t.kind === "sql") {
|
|
@@ -331,8 +331,8 @@ function Qe(e) {
|
|
|
331
331
|
return r ? { kind: "sql", connectionId: r } : void 0;
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
|
-
function
|
|
335
|
-
const { dashboard: r } = e, n = t.kind === "document" ? "document" : "dashboard", s = n === "document" ? void 0 : e.transientContexts, { shouldApplyDashboardFilters: l } =
|
|
334
|
+
function Ke(e, t, a) {
|
|
335
|
+
const { dashboard: r } = e, n = t.kind === "document" ? "document" : "dashboard", s = n === "document" ? void 0 : e.transientContexts, { shouldApplyDashboardFilters: l } = me(s), m = (u, d) => re({
|
|
336
336
|
dashboard: r,
|
|
337
337
|
sheetId: t.id,
|
|
338
338
|
card: u,
|
|
@@ -344,11 +344,11 @@ function Ue(e, t, a) {
|
|
|
344
344
|
u.inputs.forEach((d, b) => {
|
|
345
345
|
if (E(d)) return;
|
|
346
346
|
const f = u.resolvedInputs[b], p = o.get(d.id) ?? { input: d };
|
|
347
|
-
!p.resolved && f &&
|
|
347
|
+
!p.resolved && f && We(f) && (p.resolved = f), o.set(d.id, p);
|
|
348
348
|
});
|
|
349
349
|
};
|
|
350
350
|
c(m(null));
|
|
351
|
-
let i =
|
|
351
|
+
let i = ne(r).filter((u) => {
|
|
352
352
|
var d;
|
|
353
353
|
return !E(u) && !((d = o.get(u.id)) != null && d.resolved);
|
|
354
354
|
});
|
|
@@ -369,7 +369,7 @@ function Ue(e, t, a) {
|
|
|
369
369
|
}
|
|
370
370
|
return [...o.values()].flatMap((u) => {
|
|
371
371
|
if (!u.resolved) return [];
|
|
372
|
-
const d = u.input.kind === "filter" && !l && !K(u.input), b =
|
|
372
|
+
const d = u.input.kind === "filter" && !l && !K(u.input), b = Xe(u, e.calendar.tz, d);
|
|
373
373
|
return b ? [b] : [];
|
|
374
374
|
});
|
|
375
375
|
}
|
|
@@ -378,16 +378,16 @@ function E(e) {
|
|
|
378
378
|
const t = (a = e.compatibility) == null ? void 0 : a.source;
|
|
379
379
|
return t === "cardInlineFilter" || t === "cardControl";
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function We(e) {
|
|
382
382
|
if (e.kind === "filter") return !!e.filterValue;
|
|
383
383
|
const t = e.controlValue;
|
|
384
384
|
return t == null ? !1 : typeof t == "string" ? t.trim().length > 0 : Array.isArray(t) ? t.length > 0 : !0;
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function Xe(e, t, a) {
|
|
387
387
|
const { input: r, resolved: n } = e, s = x(r.label), l = {
|
|
388
388
|
inputId: r.id,
|
|
389
389
|
label: s,
|
|
390
|
-
...r.kind === "filter" &&
|
|
390
|
+
...r.kind === "filter" && se(r.filter) ? { globalDate: !0 } : {}
|
|
391
391
|
};
|
|
392
392
|
if (r.runtimeScope === "perCard" || r.runtimeScope === "perDocumentSection")
|
|
393
393
|
return { ...l, value: { kind: "varies" } };
|
|
@@ -416,21 +416,21 @@ function We(e, t, a) {
|
|
|
416
416
|
}
|
|
417
417
|
};
|
|
418
418
|
}
|
|
419
|
-
function
|
|
420
|
-
return
|
|
419
|
+
function ft(e) {
|
|
420
|
+
return Ye(e).context;
|
|
421
421
|
}
|
|
422
|
-
function
|
|
423
|
-
const { place: t, calendar: a } = e, r = q(e.dashboard), n =
|
|
422
|
+
function Ye(e) {
|
|
423
|
+
const { place: t, calendar: a } = e, r = q(e.dashboard), n = be({ dashboard: r, host: {}, calendar: a, materializeInputs: !1 }), s = {
|
|
424
424
|
..._({ dashboard: r, capture: {}, calendar: a }).runtimeValues,
|
|
425
425
|
cardViewState: t.cardViewState ?? {}
|
|
426
|
-
}, l = t.cardId ?
|
|
426
|
+
}, l = t.cardId ? tt(r, t.cardId) : void 0, m = l ? G({
|
|
427
427
|
dashboard: r,
|
|
428
428
|
location: l,
|
|
429
429
|
runtimeValues: s,
|
|
430
430
|
semanticExecutionPayload: e.semanticExecutionPayload,
|
|
431
431
|
calendar: a,
|
|
432
432
|
withRequest: !0
|
|
433
|
-
}) : void 0, o =
|
|
433
|
+
}) : void 0, o = Ze({
|
|
434
434
|
surface: "dashboard",
|
|
435
435
|
dashboard: r,
|
|
436
436
|
// A sheet that does not hold the card is refused by the projection.
|
|
@@ -444,10 +444,10 @@ function Xe(e) {
|
|
|
444
444
|
return {
|
|
445
445
|
context: o,
|
|
446
446
|
openDashboard: r,
|
|
447
|
-
...o.selectedCard && m !== void 0 ? { cardReplay:
|
|
447
|
+
...o.selectedCard && m !== void 0 ? { cardReplay: et({ dashboard: r, cardId: o.selectedCard.id, snapshot: m }) } : {}
|
|
448
448
|
};
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function et(e) {
|
|
451
451
|
const t = e.dashboard ? S(e.dashboard).find((r) => r.cardId === e.cardId) : void 0, a = D({
|
|
452
452
|
card: e.card ?? (t == null ? void 0 : t.card),
|
|
453
453
|
snapshot: e.snapshot,
|
|
@@ -461,14 +461,14 @@ function Ye(e) {
|
|
|
461
461
|
}
|
|
462
462
|
};
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function tt(e, t) {
|
|
465
465
|
const a = S(e).find((r) => r.cardId === t);
|
|
466
466
|
if (!a)
|
|
467
467
|
throw new V("card_not_found", `card ${t} is not on dashboard ${e.id}`);
|
|
468
468
|
return a;
|
|
469
469
|
}
|
|
470
470
|
function G(e) {
|
|
471
|
-
const { dashboard: t, location: a, runtimeValues: r } = e, n = a.kind === "documentSectionCard" ?
|
|
471
|
+
const { dashboard: t, location: a, runtimeValues: r } = e, n = a.kind === "documentSectionCard" ? at(t, a) : void 0;
|
|
472
472
|
return O({
|
|
473
473
|
dashboard: t,
|
|
474
474
|
cardId: a.cardId,
|
|
@@ -503,15 +503,15 @@ function D(e) {
|
|
|
503
503
|
if (t.matrix) return { status: "unavailable", reason: "matrix" };
|
|
504
504
|
if (!t.request) return { status: "unavailable", reason: "no_query" };
|
|
505
505
|
try {
|
|
506
|
-
const { connectionId: r, requestPayloadBase: n } =
|
|
506
|
+
const { connectionId: r, requestPayloadBase: n } = fe(t.card, t.request);
|
|
507
507
|
return { status: "ready", request: { cardId: t.card.id, connectionId: r, payload: n } };
|
|
508
508
|
} catch {
|
|
509
509
|
return { status: "unavailable", reason: "no_query" };
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function ht(e) {
|
|
513
513
|
const { calendar: t } = e, a = e.host ?? {}, r = q(
|
|
514
|
-
a.controlContract ?
|
|
514
|
+
a.controlContract ? he(pe(e.dashboard), {
|
|
515
515
|
controlContractOverrides: a.controlContract,
|
|
516
516
|
cardId: e.cardId
|
|
517
517
|
}) : e.dashboard
|
|
@@ -539,7 +539,7 @@ function ft(e) {
|
|
|
539
539
|
...o.message ? { message: o.message } : {}
|
|
540
540
|
};
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function at(e, t) {
|
|
543
543
|
var r, n, s;
|
|
544
544
|
const a = (r = e.sheets) == null ? void 0 : r.find((l) => l.id === t.sheetId);
|
|
545
545
|
if ((s = (n = a == null ? void 0 : a.document) == null ? void 0 : n.inputs) != null && s.length && j(e, t.sheetId).length === 0)
|
|
@@ -555,7 +555,7 @@ function tt(e, t) {
|
|
|
555
555
|
documentControlValues: {}
|
|
556
556
|
};
|
|
557
557
|
}
|
|
558
|
-
function
|
|
558
|
+
function pt(e) {
|
|
559
559
|
const { calendar: t } = e, a = q(e.dashboard), r = a.variables ?? [], n = r.find((f) => f.name === e.name) ?? r.find((f) => f.id === e.name);
|
|
560
560
|
if (!n)
|
|
561
561
|
return { status: "refused", reason: "variable_unknown", message: `No variable named ${e.name} on this dashboard.`, available: r.map((f) => f.name) };
|
|
@@ -569,7 +569,7 @@ function ht(e) {
|
|
|
569
569
|
};
|
|
570
570
|
const l = W(a, n.id);
|
|
571
571
|
if ((l == null ? void 0 : l.kind) !== "variable") return { status: "refused", reason: "broken", message: `${n.name} has no card to run.` };
|
|
572
|
-
const m =
|
|
572
|
+
const m = ie(s) && s.document ? s.document : void 0, o = rt(a, s.id, !!m, e.inputs ?? {}, t);
|
|
573
573
|
if (!o.ok) return { status: "refused", reason: "broken", message: o.message };
|
|
574
574
|
const { runtimeValues: c, transientContexts: i } = _({ dashboard: a, capture: o.capture, calendar: t }), u = m ? { sheetId: s.id, sectionId: void 0, documentFilterValues: [], documentControlDefinitions: [], documentControlValues: {} } : void 0, d = O({
|
|
575
575
|
dashboard: a,
|
|
@@ -594,39 +594,39 @@ function ht(e) {
|
|
|
594
594
|
const b = D({ card: l.card, snapshot: d, documentSection: !1 });
|
|
595
595
|
return b.status !== "ready" ? { status: "refused", reason: "broken", message: b.message ?? `${n.name} has no query to run.` } : { status: "ready", variable: n, place: m ? "document" : "sheet", request: b.request };
|
|
596
596
|
}
|
|
597
|
-
function
|
|
597
|
+
function rt(e, t, a, r, n) {
|
|
598
598
|
const s = Object.keys(r);
|
|
599
599
|
if (!s.length) return { ok: !0, capture: {} };
|
|
600
600
|
if (!a) return { ok: !1, message: "Values are given for a Document's inputs; at a tab the variable runs with the saved defaults." };
|
|
601
601
|
const l = j(e, t), m = new Map(l.map((i) => [i.variableName, i])), o = s.filter((i) => !m.has(i));
|
|
602
602
|
if (o.length)
|
|
603
603
|
return { ok: !1, message: `This Document has no input named ${o.join(", ")}; its inputs are ${[...m.keys()].join(", ") || "none"}.` };
|
|
604
|
-
let c =
|
|
604
|
+
let c = ge(e, { adHocFilterValues: [], controlOverrides: void 0, dashboardInputValues: {} }, n);
|
|
605
605
|
for (const [i, u] of Object.entries(r)) {
|
|
606
606
|
const d = m.get(i);
|
|
607
607
|
let b;
|
|
608
608
|
if (d.kind === "control")
|
|
609
|
-
b =
|
|
609
|
+
b = ce(u);
|
|
610
610
|
else {
|
|
611
611
|
const f = Array.isArray(u) ? u : [u];
|
|
612
612
|
if (!f.every((y) => typeof y == "string" || typeof y == "number" || typeof y == "boolean"))
|
|
613
613
|
return { ok: !1, message: `${i} takes a value or a list of values.` };
|
|
614
614
|
const p = f.every((y) => typeof y == "number") ? f : f.map(String);
|
|
615
|
-
b =
|
|
615
|
+
b = de(Ce(d.filter, { filterId: d.filter.id, values: p }, n));
|
|
616
616
|
}
|
|
617
617
|
if (!b) return { ok: !1, message: `${i} has no usable value.` };
|
|
618
|
-
c =
|
|
618
|
+
c = le(c, d, { sheetId: t }, b);
|
|
619
619
|
}
|
|
620
620
|
return { ok: !0, capture: { dashboardInputExecutionSnapshot: { mode: "document", sheetId: t, dashboardInputValues: c } } };
|
|
621
621
|
}
|
|
622
622
|
export {
|
|
623
623
|
V as A,
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
624
|
+
et as a,
|
|
625
|
+
ht as b,
|
|
626
|
+
pt as c,
|
|
627
627
|
D as d,
|
|
628
|
-
|
|
629
|
-
|
|
628
|
+
ft as e,
|
|
629
|
+
Ye as f,
|
|
630
630
|
G as g,
|
|
631
|
-
|
|
631
|
+
Ze as p
|
|
632
632
|
};
|
package/dist/chunks/{selection-filter-compiler-DHYsq3yM.js → selection-filter-compiler-SwrBvyyJ.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as d } from "./matrix-analytical-definition-
|
|
1
|
+
import { i as d } from "./matrix-analytical-definition-i9PQY066.js";
|
|
2
2
|
function m(e, t) {
|
|
3
3
|
var a, l;
|
|
4
4
|
const n = e.name.split(".").pop(), r = (a = e.fieldMeta) == null ? void 0 : a.qualifiedFieldName, i = !!(t.qualifiedFieldName && (r || e.name) === t.qualifiedFieldName), o = !((l = t.qualifiedFieldName) != null && l.includes(".")) && n === t.name;
|