react-semaphor 0.1.564 → 0.1.566
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/DATA_APP_SDK.md +3 -3
- package/README.md +2 -2
- package/dist/analytics-protocol/index.js +8 -8
- package/dist/assistant-context/index.js +3 -2
- package/dist/brand-studio/index.js +28 -29
- package/dist/briefings/index.js +53 -49
- package/dist/chunks/{assistant-chat-D1BEEHUF.js → assistant-chat-DNKAYSQL.js} +204 -204
- package/dist/chunks/{bookmark-impact-XOsVUAqW.js → bookmark-impact-BeUbq0jc.js} +2 -2
- package/dist/chunks/bookmark-state-ByODVqee.js +1613 -0
- package/dist/chunks/card-filter-builder-SXaRWbKr.js +4100 -0
- package/dist/chunks/{switch-BW4yXSYs.js → code-editor-DJNOsgJH.js} +463 -442
- package/dist/chunks/{comparison-window-caption-D1EUXzaR.js → comparison-window-caption-CMLb3mut.js} +451 -419
- package/dist/chunks/{dashboard-DfYsASNd.js → dashboard-Cni7nGhg.js} +1 -1
- package/dist/chunks/dashboard-briefing-launcher-CXeXRTem.js +4910 -0
- package/dist/chunks/{dashboard-controls-CJ8Dz50D.js → dashboard-controls-CsqKybrf.js} +685 -675
- package/dist/chunks/{dashboard-json-D3uZxGO-.js → dashboard-json-WWmw3Piu.js} +4 -4
- package/dist/chunks/{dates-EvDtT25n.js → dates-DJRUS-he.js} +12 -12
- package/dist/chunks/{edit-dashboard-visual-CgHJXBQv.js → edit-dashboard-visual-BrIEaBhc.js} +7724 -10341
- package/dist/chunks/filter-reach-copy-D5LqgrUf.js +4667 -0
- package/dist/chunks/{filter-value-text-CPwFkrMz.js → filter-value-text-7zhmth1S.js} +2 -2
- package/dist/chunks/{index-CAgf2x4E.js → index-Bq9UbCGk.js} +653 -574
- package/dist/chunks/{layout-grid-BM65viQh.js → layout-grid-0hIlqEtk.js} +1 -1
- package/dist/chunks/{list-filter-BoeLBfL3.js → list-filter-DkgoCeBm.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-hEucouWM.js → matrix-analytical-definition-C9xB_T84.js} +18 -18
- package/dist/chunks/{matrix-card-CCh9JjP1.js → matrix-card-BSUeSXpD.js} +2 -2
- package/dist/chunks/{matrix-member-presentation-DsAUbuoL.js → matrix-member-presentation-DZNgQpUq.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-DsLdFdSa.js → matrix-operation-contract-Eb6elidS.js} +1 -1
- package/dist/chunks/{metric-comparison-Bnso1cm1.js → metric-comparison-ChXUFaZu.js} +1 -1
- package/dist/chunks/{palette-p1XSJFgB.js → palette-4vf2BEEg.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-B53jqszr.js → pivot-result-contract-expectations-Ddh1rNz5.js} +4 -4
- package/dist/chunks/{pivot-result-identity-Dq5jm-EC.js → pivot-result-identity-BlbLrqaC.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-DMqxSU4X.js → report-preferences-dialog-CeHioJwL.js} +122 -131
- package/dist/chunks/{report-runtime-context-BITkNSDa.js → report-runtime-context-DnA_PiKo.js} +1 -1
- package/dist/chunks/resolve-dashboard-input-context-CwS-2r-b.js +21419 -0
- package/dist/chunks/{save-CHV1B1fL.js → save-D6pHmSSP.js} +1 -1
- package/dist/chunks/saved-dashboard-context-c-MZZTx2.js +629 -0
- package/dist/chunks/{selection-reducer-Bz5aywT4.js → selection-reducer-OaJ-N5uN.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-CFeCIuaw.js → semaphor-ready-indicator-B2NpYRE-.js} +81034 -80950
- package/dist/chunks/{shelf-drop-preview-context-cEyVkKTF.js → shelf-drop-preview-context-DM7yypwC.js} +407 -407
- package/dist/chunks/{source-entity-resolution-DdDVXFB8.js → source-entity-resolution-DF6GulDn.js} +1 -1
- package/dist/chunks/stored-dashboard-DTWc2pzt.js +5026 -0
- package/dist/chunks/{table-export-sheet-bSXxGn-v.js → table-export-sheet--DUKWk6o.js} +1 -1
- package/dist/chunks/{temporal-input-presentation-sk9gqLi6.js → temporal-input-presentation--2r9BLr0.js} +392 -377
- package/dist/chunks/{token-types-BUK06hU2.js → token-types-C8JymO8s.js} +1 -1
- package/dist/chunks/{upload-BnmuyPqW.js → upload-Cf3wXZT8.js} +1 -1
- package/dist/chunks/{validators-BIM0FE31.js → validators-wtjw0aw6.js} +7 -7
- package/dist/chunks/variable-draft-DFizFCJu.js +241 -0
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +2324 -1796
- package/dist/data-app-sdk/index.js +4 -4
- package/dist/data-app-sdk-adapters/index.js +2 -2
- package/dist/data-app-sdk-validation/index.js +5 -5
- package/dist/format-utils/index.js +174 -167
- package/dist/index.js +189 -187
- package/dist/pdf-export-policy/index.js +80 -28
- package/dist/pdf-table-layout/index.js +65 -65
- package/dist/report-runtime-context/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
- package/dist/types/briefings/delivery-outcome.d.ts +37 -0
- package/dist/types/briefings/index.d.ts +2 -0
- package/dist/types/briefings/run-outcomes.d.ts +6 -0
- package/dist/types/components/briefings/briefing-author/run-model.d.ts +9 -0
- package/dist/types/components/dashboard-variables/data-variables-menu.d.ts +8 -0
- package/dist/types/components/dashboard-variables/variable-editor-host.d.ts +1 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/index.js +5 -5
- package/dist/types/lib/dashboard-inputs/build-normalized-dashboard-inputs.d.ts +62 -0
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +33 -2
- package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +7 -2
- package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +4 -2
- package/dist/types/lib/dashboard-variables/data-text.d.ts +33 -0
- package/dist/types/lib/dashboard-variables/types.d.ts +207 -0
- package/dist/types/lib/document/document-edits.d.ts +16 -1
- package/dist/types/lib/document/document-panel-target.d.ts +1 -1
- package/dist/types/lib/document/document-section-query-options.d.ts +29 -0
- package/dist/types/lib/document/document-table-data-policy.d.ts +0 -1
- package/dist/types/lib/hooks/use-dashboard-frame-query.d.ts +92 -0
- package/dist/types/lib/query-context/build-card-query-context.d.ts +6 -0
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +15 -3
- package/dist/types/lib/query-context/describe-card-execution-snapshot.d.ts +1 -0
- package/dist/types/lib/query-context/use-semantic-execution-payload-for-cards.d.ts +24 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +36 -0
- package/dist/types/lib/text-variables/temporal-input-text.d.ts +28 -0
- package/dist/types/lib/text-variables/text-variable-types.d.ts +72 -0
- package/dist/types/lib/types/common-types.d.ts +155 -51
- package/dist/types/lib/utils/card-definition.d.ts +2 -2
- package/dist/types/shared/assistant-context/index.d.ts +1 -1
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +51 -1
- package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +7 -1
- package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-highlights.d.ts +10 -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 +1087 -430
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +20 -1
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +40 -40
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +16 -16
- package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/dashboard-filter-sql-subscription.d.ts +24 -0
- package/dist/types/shared/dashboard-authoring/dashboard-filter-targets.d.ts +29 -0
- package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +7 -4
- package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +159 -0
- package/dist/types/shared/dashboard-authoring/dashboard-variable-changes.d.ts +61 -0
- package/dist/types/shared/dashboard-authoring/document-section-cards.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-sentences.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +50 -3
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +48 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +22 -6
- package/dist/types/shared/dashboard-authoring/text-card-words/blocks.d.ts +87 -13
- package/dist/types/shared/dashboard-authoring/text-card-words/chip-colors.d.ts +23 -0
- package/dist/types/shared/dashboard-authoring/text-card-words/index.d.ts +90 -8
- package/dist/types/shared/dashboard-authoring/text-card-words/rich-content.d.ts +31 -3
- package/dist/types/shared/dashboard-authoring/text-card-words/variable-words.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/variable-draft.d.ts +125 -0
- package/dist/types/shared/dashboard-authoring/variable-editability.d.ts +24 -0
- package/dist/types/shared/dashboard-authoring/variable-references.d.ts +39 -0
- package/dist/types/shared/format-utils/document-print.d.ts +4 -2
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/pdf-capacity-lines.d.ts +17 -0
- package/dist/types/shared/format-utils/pdf-delivery.d.ts +8 -1
- package/dist/types/shared/format-utils/pdf-export-policy.d.ts +74 -6
- package/dist/types/shared/format-utils/presentation-execution.d.ts +9 -0
- package/package.json +2 -2
- package/src/data-app-sdk/README.md +3 -3
- package/dist/chunks/bookmark-state-CWeoGbrx.js +0 -743
- package/dist/chunks/braces-DzgoQC64.js +0 -23
- package/dist/chunks/dashboard-briefing-launcher-lvYfJoUQ.js +0 -3878
- package/dist/chunks/filter-reach-copy-Cmb05jlE.js +0 -3965
- package/dist/chunks/global-date-filter-utils-ruJYwjgZ.js +0 -16733
- package/dist/chunks/resolve-dashboard-input-context-i_jCSYae.js +0 -8214
- package/dist/chunks/saved-dashboard-context-Dg3oDmH_.js +0 -564
- package/dist/chunks/use-create-flow-overlay-state-Dl6DCxh8.js +0 -1436
|
@@ -3235,7 +3235,7 @@ export {
|
|
|
3235
3235
|
st as Z,
|
|
3236
3236
|
Ci as _,
|
|
3237
3237
|
pt as a,
|
|
3238
|
-
|
|
3238
|
+
$a as a$,
|
|
3239
3239
|
ot as a0,
|
|
3240
3240
|
j as a1,
|
|
3241
3241
|
ke as a2,
|
|
@@ -3272,7 +3272,7 @@ export {
|
|
|
3272
3272
|
R as aX,
|
|
3273
3273
|
Ra as aY,
|
|
3274
3274
|
L as aZ,
|
|
3275
|
-
|
|
3275
|
+
ja as a_,
|
|
3276
3276
|
oe as aa,
|
|
3277
3277
|
Ft as ab,
|
|
3278
3278
|
Dt as ac,
|
|
@@ -3300,11 +3300,11 @@ export {
|
|
|
3300
3300
|
an as ay,
|
|
3301
3301
|
nn as az,
|
|
3302
3302
|
Ba as b,
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3303
|
+
Yi as b0,
|
|
3304
|
+
le as b1,
|
|
3305
|
+
Ot as b2,
|
|
3306
|
+
we as b3,
|
|
3307
|
+
Ca as b4,
|
|
3308
3308
|
ui as c,
|
|
3309
3309
|
ze as d,
|
|
3310
3310
|
Va as e,
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { c as v, g as N, a as y, b as D } from "./resolve-dashboard-input-context-CwS-2r-b.js";
|
|
2
|
+
import { e as M } from "./validators-wtjw0aw6.js";
|
|
3
|
+
import { g as A, a as q, b as w, c as E } from "./filter-reach-copy-D5LqgrUf.js";
|
|
4
|
+
import { g as L, m as x } from "./matrix-analytical-definition-C9xB_T84.js";
|
|
5
|
+
const O = [
|
|
6
|
+
{
|
|
7
|
+
value: "only",
|
|
8
|
+
label: "The only value",
|
|
9
|
+
hint: "Shows the value when exactly one matches. When more than one matches, readers see nothing."
|
|
10
|
+
},
|
|
11
|
+
{ value: "first", label: "First by…", hint: "Shows the first value by the order you choose." },
|
|
12
|
+
{ value: "list", label: "List", hint: "Shows the distinct values in order, joined with a separator." }
|
|
13
|
+
], k = {
|
|
14
|
+
SUM: { number: "Total", date: "Total", other: "Total" },
|
|
15
|
+
AVG: { number: "Average", date: "Average", other: "Average" },
|
|
16
|
+
MIN: { number: "Lowest", date: "Earliest", other: "Min" },
|
|
17
|
+
MAX: { number: "Highest", date: "Latest", other: "Max" },
|
|
18
|
+
MEDIAN: { number: "Median", date: "Median", other: "Median" },
|
|
19
|
+
COUNT: { number: "Count", date: "Count", other: "Count" },
|
|
20
|
+
DISTINCT: { number: "Count distinct", date: "Count distinct", other: "Count distinct" }
|
|
21
|
+
};
|
|
22
|
+
function h(e) {
|
|
23
|
+
return M(e) === "aggregate";
|
|
24
|
+
}
|
|
25
|
+
function H(e) {
|
|
26
|
+
const t = e == null ? void 0 : e.dataType;
|
|
27
|
+
if (h(e))
|
|
28
|
+
return [
|
|
29
|
+
{ value: "calculation", label: "The calculation’s value", hint: "Shows the calculation over the rows the filters keep; it aggregates itself." }
|
|
30
|
+
];
|
|
31
|
+
const a = y(t), i = a === "number" ? "number" : a === "date" ? "date" : "other", o = [...D(t)];
|
|
32
|
+
return i === "date" && o.push({ value: "MIN", label: "Min" }, { value: "MAX", label: "Max" }), [
|
|
33
|
+
...O,
|
|
34
|
+
...o.map(({ value: l }) => {
|
|
35
|
+
var n, r;
|
|
36
|
+
return {
|
|
37
|
+
value: l,
|
|
38
|
+
label: ((n = k[l]) == null ? void 0 : n[i]) ?? l,
|
|
39
|
+
hint: `Shows the ${(((r = k[l]) == null ? void 0 : r[i]) ?? l).toLowerCase()} of the rows the filters keep.`
|
|
40
|
+
};
|
|
41
|
+
})
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
function z(e) {
|
|
45
|
+
return h(e) ? "calculation" : y(e.dataType) === "number" ? E(y(e.dataType)) : "only";
|
|
46
|
+
}
|
|
47
|
+
function b(e) {
|
|
48
|
+
return e !== "only" && e !== "first" && e !== "list";
|
|
49
|
+
}
|
|
50
|
+
function B(e) {
|
|
51
|
+
return e.mode !== "data" || !e.field || !b(e.get) ? !1 : e.get === "COUNT" || e.get === "DISTINCT" ? !0 : y(e.field.dataType) === "number";
|
|
52
|
+
}
|
|
53
|
+
function G() {
|
|
54
|
+
var e, t;
|
|
55
|
+
return ((t = (e = globalThis.crypto) == null ? void 0 : e.randomUUID) == null ? void 0 : t.call(e).replace(/-/g, "").slice(0, 10)) ?? Math.random().toString(36).slice(2, 12);
|
|
56
|
+
}
|
|
57
|
+
function V() {
|
|
58
|
+
return `var_${G()}`;
|
|
59
|
+
}
|
|
60
|
+
function K() {
|
|
61
|
+
return { id: V(), name: "", mode: "data", sql: "", get: "only", sortDirection: "asc" };
|
|
62
|
+
}
|
|
63
|
+
const _ = {
|
|
64
|
+
id: "catalog",
|
|
65
|
+
name: "catalog",
|
|
66
|
+
label: "catalog",
|
|
67
|
+
derivedLabel: "catalog",
|
|
68
|
+
alias: "catalog",
|
|
69
|
+
sourceField: "catalog",
|
|
70
|
+
source: "catalog",
|
|
71
|
+
qualifiedFieldName: "catalog",
|
|
72
|
+
dataType: "catalog",
|
|
73
|
+
nativeDataType: "catalog",
|
|
74
|
+
description: "catalog",
|
|
75
|
+
qualifiedEntityName: "catalog",
|
|
76
|
+
dateFormat: "catalog",
|
|
77
|
+
customFormat: "catalog",
|
|
78
|
+
granularity: "catalog",
|
|
79
|
+
entityId: "catalog",
|
|
80
|
+
entityName: "catalog",
|
|
81
|
+
entityType: "catalog",
|
|
82
|
+
expression: "catalog",
|
|
83
|
+
calculatedFormula: "catalog",
|
|
84
|
+
derivedField: "catalog",
|
|
85
|
+
format: "catalog",
|
|
86
|
+
semanticTemporalPresentation: "catalog",
|
|
87
|
+
calculationRepresentation: "catalog",
|
|
88
|
+
calculatedFieldOrigin: "catalog",
|
|
89
|
+
labelOrigin: "catalog",
|
|
90
|
+
formatOrigin: "catalog",
|
|
91
|
+
fieldScope: "catalog",
|
|
92
|
+
timeDrillPath: "catalog",
|
|
93
|
+
aliasTemplate: "catalog",
|
|
94
|
+
valueAliases: "catalog",
|
|
95
|
+
isPreAggregated: "catalog",
|
|
96
|
+
role: "shelf",
|
|
97
|
+
aggregate: "shelf",
|
|
98
|
+
aggregateOrigin: "shelf",
|
|
99
|
+
semanticAggregate: "shelf",
|
|
100
|
+
effectiveAggregate: "shelf",
|
|
101
|
+
aggregateSource: "shelf",
|
|
102
|
+
comparison: "shelf",
|
|
103
|
+
comparisonPolarity: "shelf",
|
|
104
|
+
semanticComparisonPolarity: "shelf",
|
|
105
|
+
parameters: "shelf",
|
|
106
|
+
direction: "shelf"
|
|
107
|
+
};
|
|
108
|
+
function T(e) {
|
|
109
|
+
return Object.fromEntries(
|
|
110
|
+
Object.entries(e).filter(([t]) => _[t] !== "shelf")
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
function Q(e) {
|
|
114
|
+
var g, u, m, d, p;
|
|
115
|
+
const { query: t, get: a } = e, i = t.config ?? {}, o = (g = i.metricColumns) == null ? void 0 : g[0], l = (u = i.groupByColumns) == null ? void 0 : u[0], n = (m = i.sortByColumns) == null ? void 0 : m[0], r = n ? T(o && n.id === o.id ? o : n) : void 0, s = (d = t.sql) != null && d.trim() ? t.sql : "";
|
|
116
|
+
return {
|
|
117
|
+
id: e.id,
|
|
118
|
+
name: e.name,
|
|
119
|
+
...e.label ? { label: e.label } : {},
|
|
120
|
+
mode: s ? "sql" : "data",
|
|
121
|
+
dataSource: t.dataSource,
|
|
122
|
+
connectionId: t.connectionId,
|
|
123
|
+
sql: s,
|
|
124
|
+
field: o && a.kind === "aggregate" ? T(o) : l ? T(l) : void 0,
|
|
125
|
+
get: a.kind === "aggregate" ? h(o) ? "calculation" : (o == null ? void 0 : o.aggregate) ?? "SUM" : a.kind,
|
|
126
|
+
sortField: r,
|
|
127
|
+
sortDirection: (n == null ? void 0 : n.direction) ?? "asc",
|
|
128
|
+
...a.kind === "list" ? { listLimit: a.limit, listSeparator: a.separator } : {},
|
|
129
|
+
conditions: i.filters ?? null,
|
|
130
|
+
calculatedFields: t.calculatedFields,
|
|
131
|
+
presentation: e.presentation,
|
|
132
|
+
emptyText: e.emptyText,
|
|
133
|
+
...a.kind === "aggregate" && ((p = o == null ? void 0 : o.comparison) == null ? void 0 : p.mode) === "explicit" ? { comparison: o.comparison } : {}
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function P(e, t) {
|
|
137
|
+
var n;
|
|
138
|
+
const a = t.name.trim();
|
|
139
|
+
if (a) return a;
|
|
140
|
+
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
|
+
N(
|
|
142
|
+
e,
|
|
143
|
+
{ source: "dataVariable", variableId: t.id },
|
|
144
|
+
{ cardInputs: "taken" }
|
|
145
|
+
)
|
|
146
|
+
);
|
|
147
|
+
let l = i;
|
|
148
|
+
for (let r = 2; o.has(l); r += 1) l = `${i}_${r}`;
|
|
149
|
+
return l;
|
|
150
|
+
}
|
|
151
|
+
function Y(e, t) {
|
|
152
|
+
var g, u, m, d, p, f, F, I;
|
|
153
|
+
const a = P(t, e), i = {
|
|
154
|
+
id: e.id,
|
|
155
|
+
name: a,
|
|
156
|
+
...(g = e.label) != null && g.trim() ? { label: e.label.trim() } : {},
|
|
157
|
+
...e.presentation ? { presentation: e.presentation } : {},
|
|
158
|
+
...(u = e.emptyText) != null && u.trim() ? { emptyText: e.emptyText } : {}
|
|
159
|
+
};
|
|
160
|
+
if (e.mode === "sql")
|
|
161
|
+
return {
|
|
162
|
+
...i,
|
|
163
|
+
query: {
|
|
164
|
+
...e.connectionId ? { connectionId: e.connectionId } : {},
|
|
165
|
+
...e.dataSource ? { dataSource: e.dataSource } : {},
|
|
166
|
+
sql: e.sql
|
|
167
|
+
},
|
|
168
|
+
get: e.get === "first" ? { kind: "first" } : { kind: "only" }
|
|
169
|
+
};
|
|
170
|
+
const o = ((m = e.dataSource) == null ? void 0 : m.connectionId) || ((f = (p = (d = e.dataSource) == null ? void 0 : d.selectedEntities) == null ? void 0 : p[0]) == null ? void 0 : f.connectionId), l = {
|
|
171
|
+
...o ? { connectionId: o } : {},
|
|
172
|
+
...e.dataSource ? { dataSource: e.dataSource } : {},
|
|
173
|
+
...(F = e.calculatedFields) != null && F.length ? { calculatedFields: e.calculatedFields } : {},
|
|
174
|
+
config: {
|
|
175
|
+
...e.conditions ? { filters: e.conditions } : {}
|
|
176
|
+
}
|
|
177
|
+
}, n = l.config, r = e.field;
|
|
178
|
+
let s;
|
|
179
|
+
if (!r)
|
|
180
|
+
s = b(e.get) ? { kind: "aggregate" } : { kind: e.get };
|
|
181
|
+
else if (b(e.get)) {
|
|
182
|
+
const { comparison: S, ...c } = C(r, e.get);
|
|
183
|
+
n.metricColumns = [
|
|
184
|
+
((I = e.comparison) == null ? void 0 : I.mode) === "explicit" && e.comparison.spec.kind !== "target" && B(e) ? { ...c, comparison: e.comparison } : c
|
|
185
|
+
], s = { kind: "aggregate" };
|
|
186
|
+
} else if (h(r))
|
|
187
|
+
n.metricColumns = [C(r, "calculation")], s = { kind: "aggregate" };
|
|
188
|
+
else if (n.groupByColumns = [U(r)], e.get === "list" ? s = {
|
|
189
|
+
kind: "list",
|
|
190
|
+
...e.listLimit ? { limit: e.listLimit } : {},
|
|
191
|
+
...e.listSeparator !== void 0 && e.listSeparator !== ", " ? { separator: e.listSeparator } : {}
|
|
192
|
+
} : s = { kind: e.get }, e.get !== "only") {
|
|
193
|
+
const S = e.sortField ?? r;
|
|
194
|
+
if (R(S, r)) {
|
|
195
|
+
const c = n.groupByColumns[0];
|
|
196
|
+
n.sortByColumns = [{ ...c, role: "sortby", direction: e.sortDirection }];
|
|
197
|
+
} else {
|
|
198
|
+
const c = C(S, e.sortDirection === "desc" ? "MAX" : "MIN");
|
|
199
|
+
n.metricColumns = [c], n.sortByColumns = [{ ...c, role: "sortby", direction: e.sortDirection }];
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return { ...i, query: l, get: s };
|
|
203
|
+
}
|
|
204
|
+
function C(e, t) {
|
|
205
|
+
const a = A(e, "metrics", [], q("metrics", e));
|
|
206
|
+
return h(e) || t === "calculation" || !b(t) ? a : {
|
|
207
|
+
...a,
|
|
208
|
+
...x(a, t, "explicit"),
|
|
209
|
+
...L(a, w(e.name, t))
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
function U(e) {
|
|
213
|
+
const t = A(e, "groupBy", [], q("groupBy", e));
|
|
214
|
+
if (e.granularity || !("granularity" in t)) return t;
|
|
215
|
+
const { granularity: a, ...i } = t;
|
|
216
|
+
return i;
|
|
217
|
+
}
|
|
218
|
+
function R(e, t) {
|
|
219
|
+
return e.name === t.name && (e.qualifiedEntityName ?? e.entityName ?? "") === (t.qualifiedEntityName ?? t.entityName ?? "");
|
|
220
|
+
}
|
|
221
|
+
function J(e) {
|
|
222
|
+
var t, a;
|
|
223
|
+
if (e.mode === "sql")
|
|
224
|
+
return e.connectionId ? e.sql.trim() ? void 0 : "Write the SQL that returns the value." : "Choose a connection.";
|
|
225
|
+
if (!((a = (t = e.dataSource) == null ? void 0 : t.selectedEntities) != null && a.length)) return "Choose a source.";
|
|
226
|
+
if (!e.field) return "Choose a field.";
|
|
227
|
+
}
|
|
228
|
+
export {
|
|
229
|
+
_ as S,
|
|
230
|
+
H as a,
|
|
231
|
+
Q as b,
|
|
232
|
+
B as c,
|
|
233
|
+
z as d,
|
|
234
|
+
K as e,
|
|
235
|
+
P as f,
|
|
236
|
+
J as g,
|
|
237
|
+
b as i,
|
|
238
|
+
V as n,
|
|
239
|
+
h as o,
|
|
240
|
+
Y as v
|
|
241
|
+
};
|
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-Cni7nGhg.js";
|
|
2
|
+
import { C as s, E as C } from "../chunks/bookmark-state-ByODVqee.js";
|
|
3
3
|
export {
|
|
4
4
|
s as CONTROL_CARD_DEFAULT_VALUE,
|
|
5
5
|
o as Dashboard,
|