react-semaphor 0.1.587 → 0.1.588
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 +341 -338
- 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-DhP8wVtM.js → add-to-dashboard-C86FsM8D.js} +1 -1
- package/dist/chunks/{aggregate-measure-field-DsFXETpI.js → aggregate-measure-field-BrkXsSJp.js} +2 -2
- package/dist/chunks/{analytics-base-schemas-BaIQrEzX.js → analytics-base-schemas-8wz9vqn_.js} +173 -165
- package/dist/chunks/{assistant-chat-pfJK-T0b.js → assistant-chat-BeM6joPc.js} +19 -18
- package/dist/chunks/{bookmark-impact-BSpGQL1M.js → bookmark-impact-B7pbMx2e.js} +2 -2
- package/dist/chunks/{bookmark-state-CL4WEpgB.js → bookmark-state-Bn7k3ttp.js} +5 -5
- package/dist/chunks/{card-filter-builder-C8PbhHjq.js → card-filter-builder-DmodrhyI.js} +81 -81
- package/dist/chunks/{comparison-window-caption-CoART8BC.js → comparison-window-caption-fqijZdVd.js} +451 -395
- package/dist/chunks/{context-BTLBjQNh.js → context-CVXTFljo.js} +1 -1
- package/dist/chunks/{dashboard-CVj1oMoW.js → dashboard-Tu5wT0Cw.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-TqA58rKz.js → dashboard-briefing-launcher-D8jMxIJo.js} +249 -265
- package/dist/chunks/{dashboard-controls-DQ8FsxAz.js → dashboard-controls-uzeAIEkM.js} +65 -65
- package/dist/chunks/{dashboard-json-DM88pmk2.js → dashboard-json-i5rpFNCg.js} +5 -5
- package/dist/chunks/dates-BunbHJH0.js +115 -0
- package/dist/chunks/{edit-dashboard-visual-BpRnU_6G.js → edit-dashboard-visual-BpEK_Sls.js} +2357 -2344
- package/dist/chunks/{filter-line-Cu2u1K36.js → filter-line-Dza3ee4w.js} +5 -5
- package/dist/chunks/{filter-reach-copy-0Xp97cLk.js → filter-reach-copy-D5AmDHda.js} +944 -942
- package/dist/chunks/{filter-value-text-xefXzZlf.js → filter-value-text-DQw4v3nC.js} +6 -6
- package/dist/chunks/{index-D_QSeVKy.js → index-dGxJTaP1.js} +39 -39
- package/dist/chunks/{layout-grid-9nSS2SL-.js → layout-grid-XCYphks2.js} +1 -1
- package/dist/chunks/{list-filter-CfMPI6v4.js → list-filter-DGV3fqqv.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-DOVSFFuf.js → matrix-analytical-definition-SN0JUJVk.js} +3 -3
- package/dist/chunks/{matrix-member-presentation-BKDyxJho.js → matrix-member-presentation-DVBJR0MA.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-BM5TveR3.js → matrix-operation-contract-JSmproo9.js} +15 -15
- package/dist/chunks/{metric-comparison-ZmurmEIs.js → metric-comparison-xE_J6hkg.js} +2 -2
- package/dist/chunks/{paintbrush-LzAje2ff.js → paintbrush-DEEZXhDj.js} +1 -1
- package/dist/chunks/{palette-DicJG0TC.js → palette-Bgy0H-Nt.js} +1 -1
- package/dist/chunks/{pivot-header-presentation-CdeTU96P.js → pivot-header-presentation-D-DfPAjb.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-Bx_BCu-7.js → pivot-result-contract-expectations-DbBahmgc.js} +545 -536
- package/dist/chunks/{pivot-result-identity-Bvs6Uq3v.js → pivot-result-identity-CUsMt_4r.js} +1 -1
- package/dist/chunks/{raw-temporal-value-DH-feMc2.js → raw-temporal-value-BnGCWJAL.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-CXKmWyLm.js → report-preferences-dialog-CTM0xfd0.js} +14 -14
- package/dist/chunks/{report-runtime-context-NlOXwyRB.js → report-runtime-context-CrOgmuxO.js} +2 -2
- package/dist/chunks/{resolve-dashboard-input-context-zEXuitoF.js → resolve-dashboard-input-context-DFBIngUZ.js} +5617 -5485
- package/dist/chunks/{save-0wu1Z1U7.js → save-xnRCvMeA.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-Cll5LipJ.js → saved-dashboard-context-DKMTP9ib.js} +17 -17
- package/dist/chunks/selection-filter-compiler-DkIjp1yH.js +131 -0
- package/dist/chunks/{semaphor-ready-indicator-Bnj3H0Dm.js → semaphor-ready-indicator-zU9reNmX.js} +45952 -45617
- package/dist/chunks/{shelf-drop-preview-context-B8rmn6BD.js → shelf-drop-preview-context-R9sf4oDX.js} +6 -6
- package/dist/chunks/{stored-dashboard-CURqJgoa.js → stored-dashboard-CksluF2S.js} +1539 -1404
- package/dist/chunks/{style-sheet-parts-_dGSFzDi.js → style-sheet-parts-D7NbsFL0.js} +3 -3
- package/dist/chunks/{table-export-sheet-Dmtqi5NV.js → table-export-sheet-ClSgERQC.js} +1 -1
- package/dist/chunks/{token-types-DEe_FP4l.js → token-types-DTocOcwt.js} +1 -1
- package/dist/chunks/{upload-CtyOkU_B.js → upload-BXGgYS4g.js} +1 -1
- package/dist/chunks/{validators-CJ8Jh0E8.js → validators-CrYXNnNE.js} +51 -49
- package/dist/chunks/{variable-draft-DIv-9y6Q.js → variable-draft-rbtGPvmX.js} +16 -14
- package/dist/chunks/visual-choice-DDfHfHvY.js +172 -0
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +821 -791
- package/dist/format-utils/index.js +162 -158
- package/dist/index.js +21 -21
- 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/index.js +5 -5
- package/dist/types/lib/dashboard-view-state/card-view-state.d.ts +39 -2
- package/dist/types/lib/dashboard-view-state/date-zoom.d.ts +65 -0
- package/dist/types/lib/dashboard-view-state/grain-pick.d.ts +38 -0
- package/dist/types/lib/dashboard-view-state/index.d.ts +2 -0
- package/dist/types/lib/formatters/grouped-temporal-presentation.d.ts +6 -2
- package/dist/types/lib/hooks/interactions/use-drill-actions.d.ts +1 -1
- package/dist/types/lib/interactions/get-click-context-from-table.d.ts +2 -2
- package/dist/types/lib/query-context/assemble-card-query.d.ts +2 -1
- package/dist/types/lib/query-context/build-card-query-context.d.ts +15 -1
- package/dist/types/lib/query-context/describe-card-execution-snapshot.d.ts +3 -0
- package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +14 -1
- package/dist/types/lib/stores/dashboard-store.d.ts +7 -1
- package/dist/types/lib/types/explorer-types.d.ts +13 -0
- package/dist/types/lib/utils/card-config-utils.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +32 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +30 -0
- package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/automatic-grain.d.ts +77 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +13 -8
- package/dist/types/shared/dashboard-authoring/control-value-resolution.d.ts +24 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/kpi-trend-rule.d.ts +6 -29
- package/dist/types/shared/dashboard-authoring/variable-draft.d.ts +1 -0
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/partial-period.d.ts +40 -0
- package/dist/types/shared/format-utils/temporal-bucket.d.ts +11 -0
- package/dist/types/shared/usage-events/details.d.ts +2 -2
- package/dist/usage-events/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/dates-5z3b9Loo.js +0 -136
- package/dist/chunks/selection-filter-compiler-BReJy-uv.js +0 -92
- package/dist/chunks/visual-choice-BBPizkRo.js +0 -206
|
@@ -2,9 +2,9 @@ import { jsx as v, jsxs as re, Fragment as xt } from "react/jsx-runtime";
|
|
|
2
2
|
import * as l from "react";
|
|
3
3
|
import ke, { forwardRef as jn, createElement as In, useLayoutEffect as cs, useState as ro, useRef as vn, useMemo as us, useId as ds, useImperativeHandle as fs } from "react";
|
|
4
4
|
import { b as ps, c as ee, d as me, g as hs } from "./pickers-DkqmtnTL.js";
|
|
5
|
-
import "./validators-
|
|
6
|
-
import "./matrix-operation-contract-
|
|
7
|
-
import "./analytics-base-schemas-
|
|
5
|
+
import "./validators-CrYXNnNE.js";
|
|
6
|
+
import "./matrix-operation-contract-JSmproo9.js";
|
|
7
|
+
import "./analytics-base-schemas-8wz9vqn_.js";
|
|
8
8
|
import "../value-format-preferences/index.js";
|
|
9
9
|
import * as Gt from "react-dom";
|
|
10
10
|
import gs from "react-dom";
|
|
@@ -2,7 +2,7 @@ var ft = Object.defineProperty;
|
|
|
2
2
|
var ht = (e, t, r) => t in e ? ft(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var ne = (e, t, r) => ht(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
4
|
import { z as S } from "zod";
|
|
5
|
-
import { e as ct } from "./comparison-window-caption-
|
|
5
|
+
import { e as ct } from "./comparison-window-caption-fqijZdVd.js";
|
|
6
6
|
var E = Uint8Array, I = Uint16Array, pe = Int32Array, xe = new E([
|
|
7
7
|
0,
|
|
8
8
|
0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as Oe,
|
|
1
|
+
import { M as Oe, z as K, y as qt, E as Bt, F as Wt, H as Ut, J as Vt, x as Ht, h as tt, j as pe, k as zt, o as Gt, b as Qt, d as Xt } from "./analytics-base-schemas-8wz9vqn_.js";
|
|
2
2
|
import { z as a } from "zod";
|
|
3
3
|
function Kt(e) {
|
|
4
4
|
return typeof e == "string" || typeof e == "number" && Number.isFinite(e) || typeof e == "boolean";
|
|
@@ -52,7 +52,7 @@ const ii = {
|
|
|
52
52
|
month: 120,
|
|
53
53
|
quarter: 40,
|
|
54
54
|
year: 10
|
|
55
|
-
}, E = a.enum(["day", "week", "month", "quarter", "year"]), ni = a.enum(["minute", "hour"]), ai = a.enum(["minute", "hour", "day", "week", "month", "quarter", "year"]), fe = a.number().int().positive(), Z = a.number().int(),
|
|
55
|
+
}, E = a.enum(["day", "week", "month", "quarter", "year"]), ni = a.enum(["minute", "hour"]), ai = a.enum(["minute", "hour", "day", "week", "month", "quarter", "year"]), fe = a.number().int().positive(), Z = a.number().int(), D = {
|
|
56
56
|
lastSubDay: a.object({
|
|
57
57
|
mode: a.literal("last"),
|
|
58
58
|
n: fe,
|
|
@@ -126,20 +126,20 @@ function ri(e) {
|
|
|
126
126
|
}
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
|
-
const t =
|
|
129
|
+
const t = D.lastSubDay.safeParse(e), i = t.success ? t : D.last.safeParse(e);
|
|
130
130
|
if (i.success) {
|
|
131
131
|
const { n: r, unit: l, complete: c, relativeTo: m } = i.data, u = m ?? "now";
|
|
132
132
|
return c ? { kind: "periods", unit: l, from: -r, to: -1, anchor: u } : { kind: "rolling", unit: l, n: r, anchor: u };
|
|
133
133
|
}
|
|
134
|
-
const n =
|
|
134
|
+
const n = D.this.safeParse(e);
|
|
135
135
|
if (n.success) {
|
|
136
136
|
const { unit: r, toDate: l, boundary: c } = n.data;
|
|
137
137
|
return he.check(n.data) ? c ? { kind: "monthDay", day: c === "first_day" ? "first" : "last" } : { kind: "periods", unit: r, from: 0, to: 0, ...l ? { toDate: !0 } : {}, anchor: "now" } : void 0;
|
|
138
138
|
}
|
|
139
|
-
const o =
|
|
139
|
+
const o = D.previous.safeParse(e);
|
|
140
140
|
if (o.success)
|
|
141
141
|
return { kind: "periods", unit: o.data.unit, from: -1, to: -1, anchor: "now" };
|
|
142
|
-
const s =
|
|
142
|
+
const s = D.between.safeParse(e);
|
|
143
143
|
if (s.success) {
|
|
144
144
|
const { unit: r, from: l, to: c } = s.data;
|
|
145
145
|
return { kind: "periods", unit: r, from: l, to: c, anchor: "now" };
|
|
@@ -305,14 +305,14 @@ function dt(e) {
|
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
const lt = "Not a relative date window", pi = a.union([
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
308
|
+
D.lastSubDay.strict(),
|
|
309
|
+
D.last.strict(),
|
|
310
|
+
D.this.strict().refine(he.check, {
|
|
311
311
|
message: he.message,
|
|
312
312
|
path: ["boundary"]
|
|
313
313
|
}),
|
|
314
|
-
|
|
315
|
-
|
|
314
|
+
D.previous.strict(),
|
|
315
|
+
D.between.strict(),
|
|
316
316
|
at,
|
|
317
317
|
B.rolling.strict(),
|
|
318
318
|
B.monthDay.strict()
|
|
@@ -560,11 +560,11 @@ function d(e, t, i) {
|
|
|
560
560
|
function h(e) {
|
|
561
561
|
return typeof e == "string" && e.trim().length > 0;
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function $i(e) {
|
|
564
564
|
const t = /* @__PURE__ */ new Set();
|
|
565
|
-
return
|
|
565
|
+
return Di(e, (i) => (t.add(i), `{${i}}`)), Array.from(t);
|
|
566
566
|
}
|
|
567
|
-
function
|
|
567
|
+
function Di(e, t) {
|
|
568
568
|
let i = "", n = 0, o = 0;
|
|
569
569
|
for (; o < e.length; ) {
|
|
570
570
|
const s = e[o];
|
|
@@ -883,7 +883,7 @@ function Ae(e) {
|
|
|
883
883
|
t
|
|
884
884
|
);
|
|
885
885
|
}), h(e.expression) && g(e.inputs)) {
|
|
886
|
-
const n =
|
|
886
|
+
const n = $i(
|
|
887
887
|
e.expression
|
|
888
888
|
), o = new Set(n), s = Object.keys(e.inputs).filter(
|
|
889
889
|
(r) => h(r)
|
|
@@ -921,13 +921,13 @@ function Ae(e) {
|
|
|
921
921
|
)
|
|
922
922
|
), { ok: t.length === 0, errors: t, warnings: [] };
|
|
923
923
|
}
|
|
924
|
-
const Y = a.string().min(1).refine((e) => e.trim().length > 0, "Must not be blank."),
|
|
924
|
+
const Y = a.string().min(1).refine((e) => e.trim().length > 0, "Must not be blank."), $e = a.union([
|
|
925
925
|
Bt.extend({ domainId: Y, datasetName: Y }).strict(),
|
|
926
926
|
Wt.extend({ connectionId: Y, tableName: Y }).strict()
|
|
927
927
|
]), mt = Ut.extend({
|
|
928
928
|
name: Y,
|
|
929
|
-
source:
|
|
930
|
-
}).strict(),
|
|
929
|
+
source: $e.optional()
|
|
930
|
+
}).strict(), De = Vt.extend({
|
|
931
931
|
format: Ht.optional(),
|
|
932
932
|
inputs: a.record(
|
|
933
933
|
a.object({
|
|
@@ -945,7 +945,7 @@ const Y = a.string().min(1).refine((e) => e.trim().length > 0, "Must not be blan
|
|
|
945
945
|
message: n.message
|
|
946
946
|
});
|
|
947
947
|
}), Yi = mt.extend({
|
|
948
|
-
derivedField:
|
|
948
|
+
derivedField: De.optional()
|
|
949
949
|
}).strict();
|
|
950
950
|
function xe(e) {
|
|
951
951
|
return typeof e == "string" ? e.trim().toLowerCase() : "";
|
|
@@ -1316,10 +1316,10 @@ function Aa(e) {
|
|
|
1316
1316
|
const { representation: t } = It(e);
|
|
1317
1317
|
return t === "physical" ? e : { ...e, calculationRepresentation: t };
|
|
1318
1318
|
}
|
|
1319
|
-
function
|
|
1319
|
+
function $a(e) {
|
|
1320
1320
|
return It(e).computeStage;
|
|
1321
1321
|
}
|
|
1322
|
-
function
|
|
1322
|
+
function Da(e, t) {
|
|
1323
1323
|
return e === "aggregate" && t === "default";
|
|
1324
1324
|
}
|
|
1325
1325
|
function xa(e) {
|
|
@@ -1614,7 +1614,7 @@ const k = a.string().min(1), Ue = a.enum(["groupby", "metric", "sortby", "pivotb
|
|
|
1614
1614
|
entityType: kt,
|
|
1615
1615
|
alias: a.string().optional(),
|
|
1616
1616
|
sourceField: a.string().optional(),
|
|
1617
|
-
source:
|
|
1617
|
+
source: $e.optional(),
|
|
1618
1618
|
nativeDataType: a.string().optional(),
|
|
1619
1619
|
description: a.string().optional(),
|
|
1620
1620
|
qualifiedEntityName: a.string().optional(),
|
|
@@ -1628,13 +1628,15 @@ const k = a.string().min(1), Ue = a.enum(["groupby", "metric", "sortby", "pivotb
|
|
|
1628
1628
|
labelOrigin: a.enum(["semantic", "override"]).optional(),
|
|
1629
1629
|
formatOrigin: a.enum(["semantic", "override"]).optional(),
|
|
1630
1630
|
expression: a.string().optional(),
|
|
1631
|
-
derivedField:
|
|
1631
|
+
derivedField: De.optional(),
|
|
1632
1632
|
format: K.optional(),
|
|
1633
1633
|
semanticTemporalPresentation: a.object({
|
|
1634
1634
|
granularity: pe,
|
|
1635
1635
|
format: zt
|
|
1636
1636
|
}).strict().optional(),
|
|
1637
1637
|
aggregate: tt.optional(),
|
|
1638
|
+
/** DG-D1: Automatic grain on a Group by date. */
|
|
1639
|
+
grainMode: a.literal("automatic").optional(),
|
|
1638
1640
|
fieldScope: a.enum(["card", "sheet", "dashboard", "domain"]).optional(),
|
|
1639
1641
|
calculatedFormula: a.object({
|
|
1640
1642
|
operation: a.enum([
|
|
@@ -1756,22 +1758,22 @@ const k = a.string().min(1), Ue = a.enum(["groupby", "metric", "sortby", "pivotb
|
|
|
1756
1758
|
"MIN",
|
|
1757
1759
|
"MAX",
|
|
1758
1760
|
"MEDIAN"
|
|
1759
|
-
]),
|
|
1761
|
+
]), $t = Yi.omit({
|
|
1760
1762
|
aggregate: !0
|
|
1761
1763
|
}), hn = {
|
|
1762
1764
|
id: S,
|
|
1763
|
-
field:
|
|
1765
|
+
field: $t,
|
|
1764
1766
|
grain: pe.optional()
|
|
1765
1767
|
}, be = a.object(hn).strict(), gn = a.object({
|
|
1766
1768
|
id: S,
|
|
1767
1769
|
kind: a.literal("aggregate"),
|
|
1768
|
-
field:
|
|
1770
|
+
field: $t,
|
|
1769
1771
|
aggregate: fn
|
|
1770
1772
|
}).strict(), yn = a.object({
|
|
1771
1773
|
id: S,
|
|
1772
1774
|
kind: a.literal("calculated"),
|
|
1773
|
-
definition:
|
|
1774
|
-
}).strict(),
|
|
1775
|
+
definition: De
|
|
1776
|
+
}).strict(), Dt = a.discriminatedUnion("kind", [gn, yn]), _n = a.discriminatedUnion("kind", [
|
|
1775
1777
|
a.object({ kind: a.literal("member") }).strict(),
|
|
1776
1778
|
a.object({
|
|
1777
1779
|
kind: a.literal("measure"),
|
|
@@ -1811,10 +1813,10 @@ const k = a.string().min(1), Ue = a.enum(["groupby", "metric", "sortby", "pivotb
|
|
|
1811
1813
|
const i = e.operator === "between" || e.operator === "not between";
|
|
1812
1814
|
i !== Array.isArray(e.value) ? _(t, ["value"], i ? "A range condition needs a low and a high bound." : "A comparison needs one number.") : i && e.value[0] > e.value[1] && _(t, ["value"], "The low bound must not exceed the high bound.");
|
|
1813
1815
|
}), Ft = a.object({
|
|
1814
|
-
source:
|
|
1816
|
+
source: $e,
|
|
1815
1817
|
rows: a.array(be).min(1).readonly(),
|
|
1816
1818
|
columns: a.array(be).readonly(),
|
|
1817
|
-
measures: a.array(
|
|
1819
|
+
measures: a.array(Dt).min(1).readonly(),
|
|
1818
1820
|
filters: At.optional(),
|
|
1819
1821
|
joinPlan: cn.optional(),
|
|
1820
1822
|
relationshipHint: a.object({ relationshipIds: a.array(mn).optional() }).strict().optional(),
|
|
@@ -1985,11 +1987,11 @@ function Nt(e, t) {
|
|
|
1985
1987
|
}
|
|
1986
1988
|
const H = Ft.superRefine(Nt), Sn = Ft.extend({
|
|
1987
1989
|
rows: a.array(be).readonly(),
|
|
1988
|
-
measures: a.array(
|
|
1990
|
+
measures: a.array(Dt).readonly()
|
|
1989
1991
|
}), wn = Sn.superRefine(Nt), kn = H.innerType().extend({ kind: a.literal("matrix") }), An = kn.superRefine(({ kind: e, ...t }, i) => {
|
|
1990
1992
|
const n = H.safeParse(t);
|
|
1991
1993
|
n.success || n.error.issues.forEach((o) => i.addIssue(o));
|
|
1992
|
-
}),
|
|
1994
|
+
}), $n = "{member}", Ve = a.object({
|
|
1993
1995
|
visible: a.boolean(),
|
|
1994
1996
|
position: a.enum(["before", "after"]),
|
|
1995
1997
|
/** As written; a subtotal's `{member}` becomes its member's name. */
|
|
@@ -2002,7 +2004,7 @@ const H = Ft.superRefine(Nt), Sn = Ft.extend({
|
|
|
2002
2004
|
* exactly one child shows no subtotal. Off when absent.
|
|
2003
2005
|
*/
|
|
2004
2006
|
skipRedundant: a.boolean().optional()
|
|
2005
|
-
}).strict(),
|
|
2007
|
+
}).strict(), Dn = {
|
|
2006
2008
|
layout: a.discriminatedUnion("kind", [
|
|
2007
2009
|
a.object({ kind: a.literal("compact") }).strict(),
|
|
2008
2010
|
a.object({ kind: a.literal("tabular"), repeatLabels: a.boolean() }).strict()
|
|
@@ -2013,7 +2015,7 @@ const H = Ft.superRefine(Nt), Sn = Ft.extend({
|
|
|
2013
2015
|
levelFormats: a.record(S, K).readonly(),
|
|
2014
2016
|
measureFormats: a.record(S, K).readonly(),
|
|
2015
2017
|
totals: a.object({ rows: He, columns: He }).strict()
|
|
2016
|
-
}, Te = a.object(
|
|
2018
|
+
}, Te = a.object(Dn).strict(), xn = a.object({
|
|
2017
2019
|
depth: a.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
2018
2020
|
overrides: a.array(
|
|
2019
2021
|
a.object({ path: N, expanded: a.boolean() }).strict()
|
|
@@ -2058,7 +2060,7 @@ function re(e, t) {
|
|
|
2058
2060
|
);
|
|
2059
2061
|
for (const u of ["rows", "columns"]) {
|
|
2060
2062
|
(m = n.totals[u].grand.label) != null && m.includes(
|
|
2061
|
-
|
|
2063
|
+
$n
|
|
2062
2064
|
) && _(
|
|
2063
2065
|
t,
|
|
2064
2066
|
["presentation", "totals", u, "grand", "label"],
|
|
@@ -2127,21 +2129,21 @@ function Wa(e) {
|
|
|
2127
2129
|
return e && "id" in e ? e.id : void 0;
|
|
2128
2130
|
}
|
|
2129
2131
|
const Yn = "SUM";
|
|
2130
|
-
function
|
|
2132
|
+
function $(e) {
|
|
2131
2133
|
return typeof e == "string" && e.trim().length > 0;
|
|
2132
2134
|
}
|
|
2133
2135
|
function P(e) {
|
|
2134
|
-
return
|
|
2136
|
+
return $(e) ? e.trim().toLowerCase() : "";
|
|
2135
2137
|
}
|
|
2136
2138
|
function Ua(e) {
|
|
2137
|
-
const t =
|
|
2139
|
+
const t = $(e.id) ? e.id.trim() : void 0;
|
|
2138
2140
|
if (!t) return;
|
|
2139
|
-
const i = P(t), n =
|
|
2141
|
+
const i = P(t), n = $(e.table) ? e.table.trim() : void 0;
|
|
2140
2142
|
if (!(i === P(e.name) || n && i === P(n)))
|
|
2141
2143
|
return t;
|
|
2142
2144
|
}
|
|
2143
2145
|
function R(e) {
|
|
2144
|
-
const t =
|
|
2146
|
+
const t = $(e.datasetId) ? e.datasetId.trim() : void 0;
|
|
2145
2147
|
if (t)
|
|
2146
2148
|
return P(t) === P(e.datasetName) ? void 0 : t;
|
|
2147
2149
|
}
|
|
@@ -2154,7 +2156,7 @@ function Tt(e) {
|
|
|
2154
2156
|
};
|
|
2155
2157
|
}
|
|
2156
2158
|
function Va(e) {
|
|
2157
|
-
return e ? e.kind === "semantic" ? !!(
|
|
2159
|
+
return e ? e.kind === "semantic" ? !!($(e.domainId) && ($(e.datasetId) || $(e.datasetName))) : e.kind === "physical" ? $(e.connectionId) && $(e.tableName) : $(e.connectionId) : !1;
|
|
2158
2160
|
}
|
|
2159
2161
|
function ve(e) {
|
|
2160
2162
|
if (!e)
|
|
@@ -3535,7 +3537,7 @@ export {
|
|
|
3535
3537
|
H as J,
|
|
3536
3538
|
Ve as K,
|
|
3537
3539
|
Xi as L,
|
|
3538
|
-
|
|
3540
|
+
$n as M,
|
|
3539
3541
|
Te as N,
|
|
3540
3542
|
ze as O,
|
|
3541
3543
|
se as P,
|
|
@@ -3543,7 +3545,7 @@ export {
|
|
|
3543
3545
|
Pa as R,
|
|
3544
3546
|
Rn as S,
|
|
3545
3547
|
Ba as T,
|
|
3546
|
-
|
|
3548
|
+
$e as U,
|
|
3547
3549
|
Kt as V,
|
|
3548
3550
|
Zt as W,
|
|
3549
3551
|
ne as X,
|
|
@@ -3619,13 +3621,13 @@ export {
|
|
|
3619
3621
|
ya as b0,
|
|
3620
3622
|
wn as b1,
|
|
3621
3623
|
qa as b2,
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
+
De as b3,
|
|
3625
|
+
Di as b4,
|
|
3624
3626
|
Ue as b5,
|
|
3625
3627
|
ga as b6,
|
|
3626
3628
|
Jt as b7,
|
|
3627
3629
|
It as c,
|
|
3628
|
-
|
|
3630
|
+
$a as d,
|
|
3629
3631
|
xa as e,
|
|
3630
3632
|
_e as f,
|
|
3631
3633
|
Ki as g,
|
|
@@ -3640,12 +3642,12 @@ export {
|
|
|
3640
3642
|
Qa as p,
|
|
3641
3643
|
At as q,
|
|
3642
3644
|
F as r,
|
|
3643
|
-
|
|
3645
|
+
Da as s,
|
|
3644
3646
|
Ia as t,
|
|
3645
3647
|
Ee as u,
|
|
3646
3648
|
fn as v,
|
|
3647
|
-
|
|
3649
|
+
$t as w,
|
|
3648
3650
|
be as x,
|
|
3649
|
-
|
|
3651
|
+
Dt as y,
|
|
3650
3652
|
Qi as z
|
|
3651
3653
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as v, g as
|
|
2
|
-
import { d as
|
|
3
|
-
import { g as A, a as q, b as w, c as E } from "./filter-reach-copy-
|
|
4
|
-
import { g as L, m as x } from "./matrix-analytical-definition-
|
|
1
|
+
import { c as v, g as M, a as y, b as N } from "./resolve-dashboard-input-context-DFBIngUZ.js";
|
|
2
|
+
import { d as D } from "./validators-CrYXNnNE.js";
|
|
3
|
+
import { g as A, a as q, b as w, c as E } from "./filter-reach-copy-D5AmDHda.js";
|
|
4
|
+
import { g as L, m as x } from "./matrix-analytical-definition-SN0JUJVk.js";
|
|
5
5
|
const O = [
|
|
6
6
|
{
|
|
7
7
|
value: "only",
|
|
@@ -20,7 +20,7 @@ const O = [
|
|
|
20
20
|
DISTINCT: { number: "Count distinct", date: "Count distinct", other: "Count distinct" }
|
|
21
21
|
};
|
|
22
22
|
function h(e) {
|
|
23
|
-
return
|
|
23
|
+
return D(e) === "aggregate";
|
|
24
24
|
}
|
|
25
25
|
function H(e) {
|
|
26
26
|
const t = e == null ? void 0 : e.dataType;
|
|
@@ -28,7 +28,7 @@ function H(e) {
|
|
|
28
28
|
return [
|
|
29
29
|
{ value: "calculation", label: "The calculation’s value", hint: "Shows the calculation over the rows the filters keep; it aggregates itself." }
|
|
30
30
|
];
|
|
31
|
-
const a = y(t), i = a === "number" ? "number" : a === "date" ? "date" : "other", o = [...
|
|
31
|
+
const a = y(t), i = a === "number" ? "number" : a === "date" ? "date" : "other", o = [...N(t)];
|
|
32
32
|
return i === "date" && o.push({ value: "MIN", label: "Min" }, { value: "MAX", label: "Max" }), [
|
|
33
33
|
...O,
|
|
34
34
|
...o.map(({ value: l }) => {
|
|
@@ -103,7 +103,9 @@ const _ = {
|
|
|
103
103
|
comparisonPolarity: "shelf",
|
|
104
104
|
semanticComparisonPolarity: "shelf",
|
|
105
105
|
parameters: "shelf",
|
|
106
|
-
direction: "shelf"
|
|
106
|
+
direction: "shelf",
|
|
107
|
+
grainMode: "shelf"
|
|
108
|
+
// chart-date-grain DG-D1: a Group by's setting, never the catalog field's
|
|
107
109
|
};
|
|
108
110
|
function T(e) {
|
|
109
111
|
return Object.fromEntries(
|
|
@@ -138,7 +140,7 @@ function P(e, t) {
|
|
|
138
140
|
const a = t.name.trim();
|
|
139
141
|
if (a) return a;
|
|
140
142
|
const i = (n = t.label) != null && n.trim() ? v(t.label) : t.field ? v(t.field.name || t.field.label) : t.mode === "sql" ? "sql_value" : "variable", o = new Set(
|
|
141
|
-
|
|
143
|
+
M(
|
|
142
144
|
e,
|
|
143
145
|
{ source: "dataVariable", variableId: t.id },
|
|
144
146
|
{ cardInputs: "taken" }
|
|
@@ -149,7 +151,7 @@ function P(e, t) {
|
|
|
149
151
|
return l;
|
|
150
152
|
}
|
|
151
153
|
function Y(e, t) {
|
|
152
|
-
var g, u, m, d, p,
|
|
154
|
+
var g, u, m, d, p, C, F, I;
|
|
153
155
|
const a = P(t, e), i = {
|
|
154
156
|
id: e.id,
|
|
155
157
|
name: a,
|
|
@@ -167,7 +169,7 @@ function Y(e, t) {
|
|
|
167
169
|
},
|
|
168
170
|
get: e.get === "first" ? { kind: "first" } : { kind: "only" }
|
|
169
171
|
};
|
|
170
|
-
const o = ((m = e.dataSource) == null ? void 0 : m.connectionId) || ((
|
|
172
|
+
const o = ((m = e.dataSource) == null ? void 0 : m.connectionId) || ((C = (p = (d = e.dataSource) == null ? void 0 : d.selectedEntities) == null ? void 0 : p[0]) == null ? void 0 : C.connectionId), l = {
|
|
171
173
|
...o ? { connectionId: o } : {},
|
|
172
174
|
...e.dataSource ? { dataSource: e.dataSource } : {},
|
|
173
175
|
...(F = e.calculatedFields) != null && F.length ? { calculatedFields: e.calculatedFields } : {},
|
|
@@ -179,12 +181,12 @@ function Y(e, t) {
|
|
|
179
181
|
if (!r)
|
|
180
182
|
s = b(e.get) ? { kind: "aggregate" } : { kind: e.get };
|
|
181
183
|
else if (b(e.get)) {
|
|
182
|
-
const { comparison: S, ...c } =
|
|
184
|
+
const { comparison: S, ...c } = f(r, e.get);
|
|
183
185
|
n.metricColumns = [
|
|
184
186
|
((I = e.comparison) == null ? void 0 : I.mode) === "explicit" && e.comparison.spec.kind !== "target" && B(e) ? { ...c, comparison: e.comparison } : c
|
|
185
187
|
], s = { kind: "aggregate" };
|
|
186
188
|
} else if (h(r))
|
|
187
|
-
n.metricColumns = [
|
|
189
|
+
n.metricColumns = [f(r, "calculation")], s = { kind: "aggregate" };
|
|
188
190
|
else if (n.groupByColumns = [U(r)], e.get === "list" ? s = {
|
|
189
191
|
kind: "list",
|
|
190
192
|
...e.listLimit ? { limit: e.listLimit } : {},
|
|
@@ -195,13 +197,13 @@ function Y(e, t) {
|
|
|
195
197
|
const c = n.groupByColumns[0];
|
|
196
198
|
n.sortByColumns = [{ ...c, role: "sortby", direction: e.sortDirection }];
|
|
197
199
|
} else {
|
|
198
|
-
const c =
|
|
200
|
+
const c = f(S, e.sortDirection === "desc" ? "MAX" : "MIN");
|
|
199
201
|
n.metricColumns = [c], n.sortByColumns = [{ ...c, role: "sortby", direction: e.sortDirection }];
|
|
200
202
|
}
|
|
201
203
|
}
|
|
202
204
|
return { ...i, query: l, get: s };
|
|
203
205
|
}
|
|
204
|
-
function
|
|
206
|
+
function f(e, t) {
|
|
205
207
|
const a = A(e, "metrics", [], q("metrics", e));
|
|
206
208
|
return h(e) || t === "calculation" || !b(t) ? a : {
|
|
207
209
|
...a,
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
const B = ["number", "line", "bar", "stackedBar", "table"], A = {
|
|
2
|
+
/** Fewest points on a line. */
|
|
3
|
+
lineMinPoints: 2,
|
|
4
|
+
/** Most measures on one line chart. */
|
|
5
|
+
lineMaxMeasures: 3,
|
|
6
|
+
/**
|
|
7
|
+
* Categories (or time points) on a bar chart. Up to `barDefaultMaxCategories`
|
|
8
|
+
* a category breakdown opens as bars; past it, up to `barMaxCategories`, it
|
|
9
|
+
* opens as a table with bars in the toggle and on request; past that, a
|
|
10
|
+
* table only.
|
|
11
|
+
*/
|
|
12
|
+
barMinCategories: 2,
|
|
13
|
+
barDefaultMaxCategories: 12,
|
|
14
|
+
barMaxCategories: 30,
|
|
15
|
+
/** Series a bar with series shows, at least and at most. */
|
|
16
|
+
seriesMin: 2,
|
|
17
|
+
seriesMax: 6
|
|
18
|
+
}, d = { kind: "table", encodings: {} }, M = {
|
|
19
|
+
number: "a single number",
|
|
20
|
+
line: "a line chart",
|
|
21
|
+
bar: "a bar chart",
|
|
22
|
+
stackedBar: "a stacked bar chart",
|
|
23
|
+
table: "a table"
|
|
24
|
+
};
|
|
25
|
+
function U(e, r) {
|
|
26
|
+
const { options: s, reason: n } = S(e), a = e.governed ? s : [...s.filter((c) => c.kind === "table"), ...s.filter((c) => c.kind !== "table")], o = a.map((c) => c.kind);
|
|
27
|
+
if (r === void 0)
|
|
28
|
+
return { ok: !0, visual: a[0], eligible: o, reason: e.governed ? n : `Advanced SQL opens as a table. ${n}` };
|
|
29
|
+
const t = a.find((c) => c.kind === r);
|
|
30
|
+
return t ? { ok: !0, visual: t, eligible: o, reason: n } : {
|
|
31
|
+
ok: !1,
|
|
32
|
+
code: "kind_not_eligible",
|
|
33
|
+
eligible: o,
|
|
34
|
+
message: `${D(M[r])} does not fit this result: ${L(n)}. It can be shown as ${o.map((c) => M[c]).join(" or ")}.`
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function S(e) {
|
|
38
|
+
const r = (i) => ({ options: [d], reason: i });
|
|
39
|
+
if (!e.complete) return r("Part of the question could not be answered");
|
|
40
|
+
if (e.truncated || e.records.length < e.rowCount) return r("The result has more rows than are kept");
|
|
41
|
+
if (e.records.length === 0) return r("The result has no rows");
|
|
42
|
+
const s = (i) => e.columns.filter((u) => I(u, e.governed) === i).map((u) => u.key), n = s("time"), a = s("dimension"), o = s("measure");
|
|
43
|
+
if (s("other").length) return r("A column cannot be charted");
|
|
44
|
+
if (o.length === 0) return r("The result has no measure");
|
|
45
|
+
if (!e.records.every((i) => o.every((u) => _(i[u]))))
|
|
46
|
+
return r("A measure has values that are not numbers");
|
|
47
|
+
const t = e.records.length, {
|
|
48
|
+
lineMinPoints: c,
|
|
49
|
+
lineMaxMeasures: f,
|
|
50
|
+
barMinCategories: l,
|
|
51
|
+
barDefaultMaxCategories: O,
|
|
52
|
+
barMaxCategories: h,
|
|
53
|
+
seriesMin: x,
|
|
54
|
+
seriesMax: p
|
|
55
|
+
} = A;
|
|
56
|
+
if (t === 1 && e.columns.length === 1)
|
|
57
|
+
return { options: [{ kind: "number", encodings: { y: o } }, d], reason: "One value" };
|
|
58
|
+
if (n.length === 1 && a.length === 0 && o.length <= f) {
|
|
59
|
+
if (t < c || !$(e.records, n)) return r("The time column does not form a series");
|
|
60
|
+
if (!T(e.records, n[0])) return r("The rows are not in time order");
|
|
61
|
+
const i = { x: n[0], y: o };
|
|
62
|
+
return {
|
|
63
|
+
options: [
|
|
64
|
+
{ kind: "line", encodings: i },
|
|
65
|
+
...t <= h ? [{ kind: "bar", encodings: i }] : [],
|
|
66
|
+
d
|
|
67
|
+
],
|
|
68
|
+
reason: `A time column and ${y(o.length, "measure")} over ${t} points`
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if (a.length === 1 && n.length === 0 && o.length === 1) {
|
|
72
|
+
if (!$(e.records, a)) return r("A category value repeats");
|
|
73
|
+
if (t < l) return r(`One category with ${y(t, "value")}`);
|
|
74
|
+
if (t > h)
|
|
75
|
+
return r(`One category with ${t} values, more than a bar chart shows (${h})`);
|
|
76
|
+
const i = { kind: "bar", encodings: { x: a[0], y: o } };
|
|
77
|
+
return t <= O ? { options: [i, d], reason: `One category with ${y(t, "value")} and one measure` } : { options: [d, i], reason: `One category with ${t} values: a table first, bars when asked` };
|
|
78
|
+
}
|
|
79
|
+
const b = [...n, ...a];
|
|
80
|
+
if (b.length === 2 && o.length === 1) {
|
|
81
|
+
const [i, u] = b, v = n.includes(i);
|
|
82
|
+
if (v && !T(e.records, i)) return r("The rows are not in time order");
|
|
83
|
+
const g = C(e.records, i), m = C(e.records, u);
|
|
84
|
+
if (!$(e.records, b)) return r("A pair of grouping values repeats");
|
|
85
|
+
if (g < (v ? c : l) || m < x)
|
|
86
|
+
return r("Two groupings with too few values to chart");
|
|
87
|
+
if (m > p)
|
|
88
|
+
return r(`${m} series, more than a chart tells apart (${p})`);
|
|
89
|
+
const w = { x: i, y: o, series: u }, k = g <= h ? [
|
|
90
|
+
{ kind: "bar", encodings: w },
|
|
91
|
+
...e.governed && V(e.columns, o[0]) ? [{ kind: "stackedBar", encodings: w }] : []
|
|
92
|
+
] : [];
|
|
93
|
+
return v ? {
|
|
94
|
+
options: [{ kind: "line", encodings: w }, ...k, d],
|
|
95
|
+
reason: `A time column with ${m} series over ${g} points`
|
|
96
|
+
} : k.length === 0 ? r(`${g} values on the axis, more than a bar chart shows (${h})`) : {
|
|
97
|
+
options: [d, ...k],
|
|
98
|
+
reason: `Two groupings (${g} by ${m}) and one measure`
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
return r("The result does not have a chart shape");
|
|
102
|
+
}
|
|
103
|
+
function I(e, r) {
|
|
104
|
+
if (r) {
|
|
105
|
+
if (e.temporalBucket || e.role === "date") return "time";
|
|
106
|
+
if (e.role === "measure") return "measure";
|
|
107
|
+
if (e.role === "dimension" || e.role === "id") return "dimension";
|
|
108
|
+
}
|
|
109
|
+
switch (e.dataType) {
|
|
110
|
+
case "date":
|
|
111
|
+
case "datetime":
|
|
112
|
+
return "time";
|
|
113
|
+
case "string":
|
|
114
|
+
return "dimension";
|
|
115
|
+
case "number":
|
|
116
|
+
return "measure";
|
|
117
|
+
default:
|
|
118
|
+
return "other";
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
const N = /^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[+-]\d{2}:?\d{2})?$/;
|
|
122
|
+
function T(e, r) {
|
|
123
|
+
let s, n;
|
|
124
|
+
const a = /* @__PURE__ */ new Set();
|
|
125
|
+
for (const o of e) {
|
|
126
|
+
const t = o[r], c = typeof t == "string" ? N.exec(t) : null;
|
|
127
|
+
if (!c) return !1;
|
|
128
|
+
if (a.has(t)) continue;
|
|
129
|
+
a.add(t);
|
|
130
|
+
const f = c[1] !== void 0;
|
|
131
|
+
if (n === void 0 && (n = f), f !== n) return !1;
|
|
132
|
+
const l = f ? Date.parse(t.replace(" ", "T")) : t;
|
|
133
|
+
if (typeof l == "number" && Number.isNaN(l) || s !== void 0 && l <= s) return !1;
|
|
134
|
+
s = l;
|
|
135
|
+
}
|
|
136
|
+
return !0;
|
|
137
|
+
}
|
|
138
|
+
function V(e, r) {
|
|
139
|
+
var n;
|
|
140
|
+
const s = (n = e.find((a) => a.key === r)) == null ? void 0 : n.aggregate;
|
|
141
|
+
return s === "SUM" || s === "COUNT";
|
|
142
|
+
}
|
|
143
|
+
function _(e) {
|
|
144
|
+
return e == null || typeof e == "number" && Number.isFinite(e);
|
|
145
|
+
}
|
|
146
|
+
function $(e, r) {
|
|
147
|
+
const s = /* @__PURE__ */ new Set();
|
|
148
|
+
for (const n of e) {
|
|
149
|
+
const a = JSON.stringify(r.map((o) => n[o] ?? null));
|
|
150
|
+
if (s.has(a)) return !1;
|
|
151
|
+
s.add(a);
|
|
152
|
+
}
|
|
153
|
+
return !0;
|
|
154
|
+
}
|
|
155
|
+
function C(e, r) {
|
|
156
|
+
return new Set(e.map((s) => JSON.stringify(s[r] ?? null))).size;
|
|
157
|
+
}
|
|
158
|
+
function y(e, r) {
|
|
159
|
+
return e === 1 ? `one ${r}` : `${e} ${r}s`;
|
|
160
|
+
}
|
|
161
|
+
function D(e) {
|
|
162
|
+
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
163
|
+
}
|
|
164
|
+
function L(e) {
|
|
165
|
+
return e.charAt(0).toLowerCase() + e.slice(1);
|
|
166
|
+
}
|
|
167
|
+
export {
|
|
168
|
+
B as V,
|
|
169
|
+
A as a,
|
|
170
|
+
U as c,
|
|
171
|
+
I as v
|
|
172
|
+
};
|
package/dist/dashboard/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as o } from "../chunks/dashboard-
|
|
2
|
-
import { C as s, E as C } from "../chunks/bookmark-state-
|
|
1
|
+
import { D as o } from "../chunks/dashboard-Tu5wT0Cw.js";
|
|
2
|
+
import { C as s, E as C } from "../chunks/bookmark-state-Bn7k3ttp.js";
|
|
3
3
|
export {
|
|
4
4
|
s as CONTROL_CARD_DEFAULT_VALUE,
|
|
5
5
|
o as Dashboard,
|