react-semaphor 0.1.544 → 0.1.546
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 +405 -441
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +100 -76
- package/dist/brand-studio/index.js +5 -5
- package/dist/briefings/index.js +55 -52
- package/dist/chunks/{class-utils-Df1OVOT1.js → _commonjsHelpers-DimLPMtv.js} +124 -98
- package/dist/chunks/{add-to-dashboard-BuAqfA2Y.js → add-to-dashboard-BQRAAnc3.js} +55 -33
- package/dist/chunks/{analytics-base-schemas-BFAoRlkU.js → analytics-base-schemas-BKs3flFS.js} +2 -2
- package/dist/chunks/{assistant-chat-BNLkCDml.js → assistant-chat-BPXhulAx.js} +2792 -2562
- package/dist/chunks/{bookmark-state-CXw7lZ50.js → bookmark-state-C4vetoa0.js} +7 -8
- package/dist/chunks/column-catalog-BYnochWQ.js +3363 -0
- package/dist/chunks/comparison-window-caption-C2xF-eWw.js +1433 -0
- package/dist/chunks/{context-ClREvqCZ.js → context-BerEBuFR.js} +11 -6
- package/dist/chunks/custom-visual-inputs-CkJW9pBS.js +295 -0
- package/dist/chunks/{dashboard-g5a4DKWq.js → dashboard-C3CoKbGY.js} +1 -1
- package/dist/chunks/dashboard-briefing-launcher-Be4h-7My.js +3734 -0
- package/dist/chunks/dashboard-controls-bxPrlSyp.js +2307 -0
- package/dist/chunks/{dashboard-json-7qT9jmfL.js → dashboard-json-BrjxIiRt.js} +6 -6
- package/dist/chunks/document-dashboard-inputs-CRVHpIHp.js +3010 -0
- package/dist/chunks/{edit-dashboard-visual-BfJwnRIZ.js → edit-dashboard-visual-DYYYDjY6.js} +5986 -6063
- package/dist/chunks/{filter-value-text-CYsVYPuD.js → filter-value-text-Ddf55Ku1.js} +8 -8
- package/dist/chunks/global-date-filter-utils-9d6m9-FE.js +11859 -0
- package/dist/chunks/index-CtoK1Lgu.js +586 -0
- package/dist/chunks/{index-DkAyQvC6.js → index-DkQkMKa1.js} +385 -339
- package/dist/chunks/list-filter-DsaTbM3J.js +15 -0
- package/dist/chunks/matrix-analytical-definition-B9vW-osb.js +717 -0
- package/dist/chunks/{matrix-card-DjwWcCo8.js → matrix-card-LiMEipvq.js} +3 -3
- package/dist/chunks/{matrix-formatter-CxJLkztA.js → matrix-formatter-DWEeC0_c.js} +55 -55
- package/dist/chunks/{matrix-member-presentation-CQGdVks6.js → matrix-member-presentation-DqzG-UhQ.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-8OIO4gob.js → matrix-operation-contract-D6vYkZK4.js} +72 -72
- package/dist/chunks/{metric-comparison-DEwi9uc2.js → metric-comparison-zpGw4lD6.js} +2 -2
- package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +119 -0
- package/dist/chunks/{pivot-header-presentation-DHcx1XGQ.js → pivot-header-presentation-CQnIDtUv.js} +1 -1
- package/dist/chunks/{pivot-result-identity-DJhXXcns.js → pivot-result-identity-C-Q1j1Wb.js} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-DM4CyGKs.js → pivot-result-lifecycle-pwq3b7LC.js} +571 -380
- package/dist/chunks/{raw-temporal-contract-C51YG48G.js → raw-temporal-contract-WuXA8jBP.js} +1 -1
- package/dist/chunks/{raw-temporal-presentation-CLiVi90c.js → raw-temporal-presentation-CBzrDOjM.js} +8 -8
- package/dist/chunks/rendered-file-D8xEuVVx.js +108 -0
- package/dist/chunks/{report-preferences-dialog-Df7VpRVW.js → report-preferences-dialog-4QEZWe5U.js} +637 -610
- package/dist/chunks/{report-runtime-context-Dq8XyODK.js → report-runtime-context-hWiTCzFV.js} +2 -2
- package/dist/chunks/resolve-dashboard-input-context-UpK_LBpL.js +5677 -0
- package/dist/chunks/{saved-dashboard-context-B-mQ--nV.js → saved-dashboard-context-D_I3Lxk0.js} +184 -212
- package/dist/chunks/selection-filter-compiler-BKXmyLrS.js +79 -0
- package/dist/chunks/{selection-reducer-Dj_8xD69.js → selection-reducer-CJzkTZio.js} +15 -15
- package/dist/chunks/{semaphor-ready-indicator-DDAxk8us.js → semaphor-ready-indicator-4zpRHE-X.js} +56832 -59068
- package/dist/chunks/{shelf-drop-preview-context-BSRPwaED.js → shelf-drop-preview-context-Cfw7TRAx.js} +890 -871
- package/dist/chunks/{source-entity-resolution-BYn9giz3.js → source-entity-resolution-BIGRvtbG.js} +13 -13
- package/dist/chunks/{switch-C3jLxlG0.js → switch-CEBOR4n7.js} +47 -48
- package/dist/chunks/{table-export-sheet-CPfGAQ9X.js → table-export-sheet-4X9mAG3V.js} +1 -1
- package/dist/chunks/table-settings-CunhoDUi.js +605 -0
- package/dist/chunks/{temporal-bucket-D7NBrrtL.js → temporal-bucket-CQOSbv9-.js} +26 -26
- package/dist/chunks/{token-types-DBbZVQsm.js → token-types-BMqRmT-C.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-BxzFviM-.js → use-create-flow-overlay-state-DZBZiiD-.js} +83 -83
- package/dist/chunks/{validators-DMHTpf7a.js → validators-C-aOQlTB.js} +713 -658
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1800 -1135
- package/dist/data-app-sdk/index.js +6 -6
- package/dist/data-app-sdk-adapters/index.js +3 -3
- package/dist/data-app-sdk-validation/index.js +14 -14
- package/dist/format-utils/index.js +198 -187
- package/dist/index.js +359 -325
- package/dist/layouts/index.js +5 -242
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/shared/index.js +4 -5
- 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/attachments.d.ts +33 -6
- package/dist/types/briefings/index.d.ts +6 -5
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/surfboard/arrange-layout-button.d.ts +8 -0
- package/dist/types/components/surfboard/filter/types.d.ts +0 -14
- package/dist/types/components/surfboard/screen-size-preview-button.d.ts +7 -0
- package/dist/types/index.js +6 -6
- package/dist/types/lib/charts/table-chart-types.d.ts +4 -0
- package/dist/types/lib/charts/types.d.ts +2 -2
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +68 -82
- package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +0 -8
- package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +41 -1
- package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +201 -0
- package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +15 -0
- package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +7 -2
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +1 -1
- package/dist/types/lib/dashboard-viewer/captured-runtime-values.d.ts +40 -0
- package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +16 -16
- package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +11 -9
- package/dist/types/lib/download-pdf.d.ts +75 -1
- package/dist/types/lib/hooks/use-date-filter.d.ts +5 -0
- package/dist/types/lib/hooks/use-text-filter.d.ts +5 -0
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +5 -4
- package/dist/types/lib/matrix-table/matrix-editor.d.ts +52 -0
- package/dist/types/lib/query-context/assemble-card-query.d.ts +158 -0
- package/dist/types/lib/query-context/build-card-query-context.d.ts +3 -3
- package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +15 -6
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +11 -13
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +22 -12
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +69 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +159 -56
- package/dist/types/lib/stores/editor-store.d.ts +0 -3
- package/dist/types/lib/types/common-types.d.ts +29 -6
- package/dist/types/lib/types/explorer-types.d.ts +10 -0
- package/dist/types/lib/types/semantic-types.d.ts +84 -0
- package/dist/types/lib/utils/build-saved-editor-card.d.ts +20 -0
- package/dist/types/lib/utils/card-type-change.d.ts +16 -0
- package/dist/types/lib/utils/field-availability-context.d.ts +25 -0
- package/dist/types/lib/utils/field-placement.d.ts +96 -0
- package/dist/types/lib/utils/field-state-calculator.d.ts +161 -0
- package/dist/types/lib/utils/qualified-entity-name.d.ts +2 -0
- package/dist/types/shared/analytics-protocol/field-provenance.d.ts +89 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +2 -0
- package/dist/types/shared/analytics-protocol/query-policies.d.ts +52 -0
- package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/time-window.d.ts +40 -1
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -12
- package/dist/types/shared/assistant-protocol/answer-text.d.ts +20 -0
- package/dist/types/shared/assistant-protocol/context.d.ts +21 -21
- package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
- package/dist/types/shared/assistant-protocol/limits.d.ts +6 -1
- package/dist/types/shared/assistant-protocol/parts.d.ts +43 -3
- package/dist/types/shared/assistant-protocol/request.d.ts +14 -2
- package/dist/types/shared/dashboard-authoring/calculated-field-identity.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +487 -0
- package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +34 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +7886 -0
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +43 -0
- package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +54 -0
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +89 -0
- package/dist/types/shared/dashboard-authoring/column-catalog.d.ts +32 -0
- package/dist/types/shared/dashboard-authoring/contracts.d.ts +0 -55
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +16 -6
- package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +9 -1
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +118 -0
- package/dist/types/shared/dashboard-authoring/filter-applicability.d.ts +75 -0
- package/dist/types/shared/dashboard-authoring/filter-model/ad-hoc-filter-values.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/filter-model/filter-definitions.d.ts +29 -0
- package/dist/types/shared/dashboard-authoring/filter-model/filter-values.d.ts +58 -0
- package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/filter-model/prototype-document-inputs.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +78 -0
- package/dist/types/shared/dashboard-authoring/filter-model/stored-dashboard.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/filter-model/toolbar-filter-reach.d.ts +23 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +20 -2
- package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +10 -37
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +189 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +94 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +78 -0
- package/dist/types/shared/dashboard-authoring/validators.d.ts +1 -2
- package/dist/types/shared/format-utils/exporters/index.d.ts +2 -0
- package/dist/types/shared/format-utils/exporters/rendered-file.d.ts +106 -0
- package/dist/types/shared/layouts/engine/grid.d.ts +25 -0
- package/dist/types/shared/layouts/engine/index.d.ts +4 -0
- package/dist/types/shared/layouts/engine/sheet-layout.d.ts +7 -0
- package/dist/types/shared/layouts/engine/types.d.ts +125 -0
- package/dist/types/shared/layouts/index.d.ts +1 -2
- package/package.json +2 -2
- package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/chunks/apply-dashboard-operations-Bz4n1Lq6.js +0 -2260
- package/dist/chunks/calendar-day-equality-BmJAWduY.js +0 -460
- package/dist/chunks/comparison-window-caption-BTkrN3W4.js +0 -1623
- package/dist/chunks/custom-visual-inputs-DUtpYZOk.js +0 -323
- package/dist/chunks/dashboard-briefing-launcher-DQ_8O_e2.js +0 -3725
- package/dist/chunks/dashboard-controls-8RyBTQUO.js +0 -2315
- package/dist/chunks/dashboard-filter-value-compatibility-CwQ_iSNb.js +0 -108
- package/dist/chunks/document-dashboard-inputs-BC6p-ESg.js +0 -8087
- package/dist/chunks/document-sheet-utils-Duo9uLoH.js +0 -3619
- package/dist/chunks/matrix-analytical-definition-C7Gb0e12.js +0 -117
- package/dist/chunks/normalize-dashboard-for-dirty-check-Bk3VYv_q.js +0 -67
- package/dist/chunks/numeric-presentation-DESvLiu9.js +0 -5227
- package/dist/chunks/sort-target-MT1WK1vX.js +0 -29
- package/dist/chunks/stable-serialize-CfqXeiBP.js +0 -6
- package/dist/chunks/table-settings-CLZocegs.js +0 -501
- package/dist/chunks/use-debounced-dirty-check-BwAbnX_5.js +0 -59
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +0 -88
- package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +0 -10
- package/dist/types/shared/dashboard-authoring/change-compiler.d.ts +0 -7
- package/dist/types/shared/dashboard-authoring/layout-compiler.d.ts +0 -2
- package/dist/types/shared/layouts/create-frame-layouts.d.ts +0 -27
- package/dist/types/shared/layouts/frame-layouts.d.ts +0 -23
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { r as d } from "./metric-comparison-DEwi9uc2.js";
|
|
2
|
-
function s(n, i) {
|
|
3
|
-
return d({ ...n, role: i });
|
|
4
|
-
}
|
|
5
|
-
function m(n, i) {
|
|
6
|
-
if (i.id) {
|
|
7
|
-
const e = [];
|
|
8
|
-
n.forEach(
|
|
9
|
-
({ fields: a }, f) => a.forEach((l, r) => {
|
|
10
|
-
l.id === i.id && e.push({ group: f, index: r });
|
|
11
|
-
})
|
|
12
|
-
);
|
|
13
|
-
const t = i.alias ? e.find(
|
|
14
|
-
({ group: a, index: f }) => s(n[a].fields[f], n[a].role) === i.alias
|
|
15
|
-
) : void 0;
|
|
16
|
-
if (t) return t;
|
|
17
|
-
if (e.length === 1) return e[0];
|
|
18
|
-
}
|
|
19
|
-
for (let e = 0; e < n.length; e += 1) {
|
|
20
|
-
const t = n[e].fields.findIndex(
|
|
21
|
-
(a) => a.name === i.name && a.entityName === i.entityName && (a.alias === i.alias || !i.alias)
|
|
22
|
-
);
|
|
23
|
-
if (t !== -1) return { group: e, index: t };
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export {
|
|
27
|
-
m as f,
|
|
28
|
-
s
|
|
29
|
-
};
|
|
@@ -1,501 +0,0 @@
|
|
|
1
|
-
import { k as R } from "./validators-DMHTpf7a.js";
|
|
2
|
-
import { z as u } from "zod";
|
|
3
|
-
const F = 8, T = 6, I = Object.freeze([]);
|
|
4
|
-
function j(e) {
|
|
5
|
-
switch (e.type) {
|
|
6
|
-
case "table":
|
|
7
|
-
case "chart":
|
|
8
|
-
return e.card ? [e.card] : I;
|
|
9
|
-
case "kpi":
|
|
10
|
-
return Array.isArray(e.cards) ? e.cards : I;
|
|
11
|
-
default:
|
|
12
|
-
return I;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function ne(e, t) {
|
|
16
|
-
switch (e.type) {
|
|
17
|
-
case "table":
|
|
18
|
-
case "chart": {
|
|
19
|
-
if (!e.card) return e;
|
|
20
|
-
const r = t(e.card);
|
|
21
|
-
return r === e.card ? e : { ...e, card: r };
|
|
22
|
-
}
|
|
23
|
-
case "kpi": {
|
|
24
|
-
if (!Array.isArray(e.cards)) return e;
|
|
25
|
-
const r = e.cards.map(t);
|
|
26
|
-
return r.every((a, n) => a === e.cards[n]) ? e : { ...e, cards: r };
|
|
27
|
-
}
|
|
28
|
-
default:
|
|
29
|
-
return e;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
function O(e) {
|
|
33
|
-
var r;
|
|
34
|
-
const t = [];
|
|
35
|
-
for (const a of e.sheets || []) {
|
|
36
|
-
const n = a.id;
|
|
37
|
-
for (const i of a.cards || [])
|
|
38
|
-
t.push({ kind: "sheetCard", sheetId: n, cardId: i.id, card: i });
|
|
39
|
-
for (const i of a.frames || [])
|
|
40
|
-
for (const s of i.cards || [])
|
|
41
|
-
t.push({
|
|
42
|
-
kind: "frameCard",
|
|
43
|
-
sheetId: n,
|
|
44
|
-
frameId: i.id,
|
|
45
|
-
cardId: s.id,
|
|
46
|
-
card: s
|
|
47
|
-
});
|
|
48
|
-
for (const i of ((r = a.document) == null ? void 0 : r.sections) || [])
|
|
49
|
-
for (const s of j(i))
|
|
50
|
-
t.push({
|
|
51
|
-
kind: "documentSectionCard",
|
|
52
|
-
sheetId: n,
|
|
53
|
-
sectionId: i.id,
|
|
54
|
-
cardId: s.id,
|
|
55
|
-
card: s
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
return t;
|
|
59
|
-
}
|
|
60
|
-
function S(e) {
|
|
61
|
-
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
62
|
-
}
|
|
63
|
-
function ie(e) {
|
|
64
|
-
if (!S(e))
|
|
65
|
-
return [{ path: "", message: "must be an object." }];
|
|
66
|
-
const t = [];
|
|
67
|
-
e.title !== void 0 && typeof e.title != "string" && t.push({ path: "title", message: "must be a string." });
|
|
68
|
-
const r = e.cards;
|
|
69
|
-
if (!Array.isArray(r))
|
|
70
|
-
t.push({ path: "cards", message: "must be an array of KPI cards." });
|
|
71
|
-
else {
|
|
72
|
-
(r.length < 1 || r.length > F) && t.push({
|
|
73
|
-
path: "cards",
|
|
74
|
-
message: `must hold 1 to ${F} KPI cards.`
|
|
75
|
-
});
|
|
76
|
-
const n = /* @__PURE__ */ new Set();
|
|
77
|
-
r.forEach((i, s) => {
|
|
78
|
-
if (!S(i)) {
|
|
79
|
-
t.push({ path: `cards[${s}]`, message: "must be a card." });
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
typeof i.id != "string" || !i.id ? t.push({
|
|
83
|
-
path: `cards[${s}].id`,
|
|
84
|
-
message: "must be a non-empty string."
|
|
85
|
-
}) : n.has(i.id) ? t.push({
|
|
86
|
-
path: `cards[${s}].id`,
|
|
87
|
-
message: `duplicates card id '${i.id}'.`
|
|
88
|
-
}) : n.add(i.id), i.type !== "kpi" && t.push({ path: `cards[${s}].type`, message: "must be 'kpi'." });
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
const a = e.kpi;
|
|
92
|
-
return S(a) ? (a.layout !== "tiles" && a.layout !== "lines" ? t.push({
|
|
93
|
-
path: "kpi.layout",
|
|
94
|
-
message: "must be 'tiles' or 'lines'."
|
|
95
|
-
}) : a.layout === "tiles" && Array.isArray(r) && r.length > T && t.push({
|
|
96
|
-
path: "kpi.layout",
|
|
97
|
-
message: `must be 'lines' for more than ${T} KPI cards.`
|
|
98
|
-
}), a.columns !== void 0 && a.columns !== 1 && a.columns !== 2 && t.push({ path: "kpi.columns", message: "must be 1 or 2." })) : t.push({ path: "kpi", message: "must be an object." }), t;
|
|
99
|
-
}
|
|
100
|
-
const B = ["new", "edit", "delete", "create", "update", "remove"];
|
|
101
|
-
function M(e, t) {
|
|
102
|
-
return (e.sheets || []).flatMap(
|
|
103
|
-
(r) => O({ sheets: [r] }).filter(t).map((a) => ({
|
|
104
|
-
card: a.card,
|
|
105
|
-
sheet: r,
|
|
106
|
-
...a.kind === "frameCard" && { frameId: a.frameId },
|
|
107
|
-
...a.kind === "documentSectionCard" && {
|
|
108
|
-
sectionId: a.sectionId
|
|
109
|
-
}
|
|
110
|
-
}))
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
function m(e) {
|
|
114
|
-
return M(e, (t) => t.kind !== "documentSectionCard");
|
|
115
|
-
}
|
|
116
|
-
function se(e) {
|
|
117
|
-
return [
|
|
118
|
-
...m(e),
|
|
119
|
-
...M(e, (t) => t.kind === "documentSectionCard")
|
|
120
|
-
];
|
|
121
|
-
}
|
|
122
|
-
function oe(e) {
|
|
123
|
-
return m(e).map((t) => t.card);
|
|
124
|
-
}
|
|
125
|
-
function de(e, t, r) {
|
|
126
|
-
return r && t === r ? !0 : !O(e).some(
|
|
127
|
-
(a) => a.cardId === t
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
function ce(e) {
|
|
131
|
-
return !e || e.trim().length === 0 ? { isValid: !1, error: "Card ID cannot be empty" } : e.length < 3 ? { isValid: !1, error: "Card ID must be at least 3 characters" } : e.length > 50 ? { isValid: !1, error: "Card ID must be less than 50 characters" } : /^[a-zA-Z0-9-_]+$/.test(e) ? /^[a-zA-Z0-9]/.test(e) ? B.includes(e.toLowerCase()) ? {
|
|
132
|
-
isValid: !1,
|
|
133
|
-
error: `"${e}" is a reserved keyword and cannot be used`
|
|
134
|
-
} : { isValid: !0 } : {
|
|
135
|
-
isValid: !1,
|
|
136
|
-
error: "Card ID must start with a letter or number"
|
|
137
|
-
} : {
|
|
138
|
-
isValid: !1,
|
|
139
|
-
error: "Card ID can only contain letters, numbers, hyphens, and underscores"
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
function ue(e, t) {
|
|
143
|
-
var r;
|
|
144
|
-
return (r = P(e, t)) == null ? void 0 : r.card;
|
|
145
|
-
}
|
|
146
|
-
function P(e, t) {
|
|
147
|
-
for (const r of m(e))
|
|
148
|
-
if (r.card.id === t)
|
|
149
|
-
return r;
|
|
150
|
-
}
|
|
151
|
-
function le(e, t) {
|
|
152
|
-
for (const r of e.sheets || [])
|
|
153
|
-
for (const a of r.frames || [])
|
|
154
|
-
for (const n of a.cards || [])
|
|
155
|
-
if (n.id === t)
|
|
156
|
-
return { card: n, sheet: r };
|
|
157
|
-
}
|
|
158
|
-
const h = {
|
|
159
|
-
includeMetricFilterDatasets: !0,
|
|
160
|
-
preferQualifiedIdentity: !1
|
|
161
|
-
};
|
|
162
|
-
function q(e) {
|
|
163
|
-
if (!e) return;
|
|
164
|
-
if (e.kind === "semantic")
|
|
165
|
-
return { entityName: e.datasetName, entityId: e.datasetId, label: e.label };
|
|
166
|
-
const t = [e.databaseName, e.schemaName, e.tableName].filter((r) => !!(r && r.trim())).join(".");
|
|
167
|
-
return {
|
|
168
|
-
entityName: e.tableName,
|
|
169
|
-
qualifiedEntityName: t.includes(".") ? t : void 0,
|
|
170
|
-
label: e.label
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
function z(e) {
|
|
174
|
-
var r;
|
|
175
|
-
const t = q(e.source);
|
|
176
|
-
return t ? `${(r = e.source) == null ? void 0 : r.kind}:${t.qualifiedEntityName || t.entityName}` : "";
|
|
177
|
-
}
|
|
178
|
-
function K(e) {
|
|
179
|
-
return [
|
|
180
|
-
e.id,
|
|
181
|
-
e.qualifiedEntityName,
|
|
182
|
-
e.entityId,
|
|
183
|
-
e.entityName,
|
|
184
|
-
e.qualifiedFieldName,
|
|
185
|
-
e.name,
|
|
186
|
-
// Source-only fields from different datasets can otherwise share a key
|
|
187
|
-
// and the second dataset would be silently dropped.
|
|
188
|
-
z(e)
|
|
189
|
-
].join("|");
|
|
190
|
-
}
|
|
191
|
-
function U(e) {
|
|
192
|
-
return [e.entityName, e.qualifiedEntityName || "", e.entityId || ""].join("|");
|
|
193
|
-
}
|
|
194
|
-
function fe(e) {
|
|
195
|
-
return e.entityName || e.qualifiedEntityName || "";
|
|
196
|
-
}
|
|
197
|
-
function Q(e) {
|
|
198
|
-
var t, r;
|
|
199
|
-
return !!(e.expression || e.derivedField || (r = (t = e.calculatedFormula) == null ? void 0 : t.inputFields) != null && r.length);
|
|
200
|
-
}
|
|
201
|
-
function G(e) {
|
|
202
|
-
return R(e) ? !0 : e.entityName || e.qualifiedEntityName ? !1 : !e.source || Q(e);
|
|
203
|
-
}
|
|
204
|
-
function g(e, t) {
|
|
205
|
-
const r = U(t);
|
|
206
|
-
e.found.has(r) || e.found.set(r, t);
|
|
207
|
-
}
|
|
208
|
-
function p(e, t) {
|
|
209
|
-
var l, v, k;
|
|
210
|
-
if (!e) return;
|
|
211
|
-
const r = K(e);
|
|
212
|
-
if (t.visitedFields.has(r)) return;
|
|
213
|
-
t.visitedFields.add(r);
|
|
214
|
-
const a = G(e);
|
|
215
|
-
if (!a) {
|
|
216
|
-
const f = !e.entityName && !e.qualifiedEntityName ? q(e.source) : void 0;
|
|
217
|
-
g(
|
|
218
|
-
t,
|
|
219
|
-
f || {
|
|
220
|
-
// May be empty for qualified-only metadata; identity then comes from
|
|
221
|
-
// `qualifiedEntityName` (see `identityFor` and the calculator).
|
|
222
|
-
entityName: e.entityName || "",
|
|
223
|
-
entityId: e.entityId,
|
|
224
|
-
qualifiedEntityName: e.qualifiedEntityName,
|
|
225
|
-
label: e.source && e.source.kind === "semantic" ? e.source.label : void 0
|
|
226
|
-
}
|
|
227
|
-
);
|
|
228
|
-
}
|
|
229
|
-
t.includeMetricFilterDatasets && "parameters" in e && ((l = e.parameters) != null && l.filters) && E(e.parameters.filters, t);
|
|
230
|
-
const n = (v = e.calculatedFormula) == null ? void 0 : v.inputFields, i = !!(n && n.length > 0);
|
|
231
|
-
i && n.forEach((f) => p(f, t));
|
|
232
|
-
let s = !1, o = !1;
|
|
233
|
-
const d = i || (k = e.derivedField) == null ? void 0 : k.inputs;
|
|
234
|
-
if (d && Object.keys(d).length > 0)
|
|
235
|
-
for (const f of Object.values(d)) {
|
|
236
|
-
const c = f.field.source;
|
|
237
|
-
if (!c) {
|
|
238
|
-
i || (o = !0);
|
|
239
|
-
continue;
|
|
240
|
-
}
|
|
241
|
-
if (c.kind === "sql") {
|
|
242
|
-
o = !0;
|
|
243
|
-
continue;
|
|
244
|
-
}
|
|
245
|
-
if (c.kind === "semantic")
|
|
246
|
-
g(t, {
|
|
247
|
-
entityName: c.datasetName,
|
|
248
|
-
entityId: c.datasetId,
|
|
249
|
-
label: c.label
|
|
250
|
-
});
|
|
251
|
-
else {
|
|
252
|
-
const D = [c.databaseName, c.schemaName, c.tableName].filter((w) => !!(w && w.trim())).join(".");
|
|
253
|
-
g(t, {
|
|
254
|
-
entityName: c.tableName,
|
|
255
|
-
qualifiedEntityName: D.includes(".") ? D : void 0,
|
|
256
|
-
label: c.label
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
s = !0;
|
|
260
|
-
}
|
|
261
|
-
o && (t.complete = !1), a && !i && !s && (t.complete = !1);
|
|
262
|
-
}
|
|
263
|
-
function E(e, t) {
|
|
264
|
-
if (e && !t.visitedGroups.has(e.id)) {
|
|
265
|
-
t.visitedGroups.add(e.id);
|
|
266
|
-
for (const r of e.conditions || [])
|
|
267
|
-
p(r.field, t);
|
|
268
|
-
for (const r of e.groups || [])
|
|
269
|
-
E(r, t);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
function b(e, t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set()) {
|
|
273
|
-
return {
|
|
274
|
-
found: /* @__PURE__ */ new Map(),
|
|
275
|
-
complete: !0,
|
|
276
|
-
visitedFields: t,
|
|
277
|
-
visitedGroups: r,
|
|
278
|
-
includeMetricFilterDatasets: e
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
function N(e, t) {
|
|
282
|
-
var a;
|
|
283
|
-
const r = (a = e.qualifiedEntityName) != null && a.includes(".") ? e.qualifiedEntityName : void 0;
|
|
284
|
-
return t === "qualifiedOnly" ? r : t === "preferQualified" ? r || e.entityName || void 0 : e.entityName || void 0;
|
|
285
|
-
}
|
|
286
|
-
function me(e) {
|
|
287
|
-
const t = b(!1);
|
|
288
|
-
return p(e, t), { datasets: Array.from(t.found.values()), complete: t.complete };
|
|
289
|
-
}
|
|
290
|
-
function V(e, t, r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), n = h) {
|
|
291
|
-
const i = { ...h, ...n }, s = b(i.includeMetricFilterDatasets, r, a);
|
|
292
|
-
p(e, s), s.found.forEach((o) => {
|
|
293
|
-
const d = N(o, i.preferQualifiedIdentity ? "preferQualified" : "name");
|
|
294
|
-
d && t.add(d);
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
function pe(e, t) {
|
|
298
|
-
V(e, t, /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), {
|
|
299
|
-
preferQualifiedIdentity: !0
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
function ye(e, t, r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set()) {
|
|
303
|
-
const n = b(!0, r, a);
|
|
304
|
-
p(e, n), n.found.forEach((i) => {
|
|
305
|
-
const s = N(i, "qualifiedOnly");
|
|
306
|
-
s && t.add(s);
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
function he(e, t, r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set()) {
|
|
310
|
-
V(e, t, r, a, {
|
|
311
|
-
includeMetricFilterDatasets: !1
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
function be(e, t, r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), n = h) {
|
|
315
|
-
const i = { ...h, ...n }, s = b(i.includeMetricFilterDatasets, r, a);
|
|
316
|
-
E(e, s), s.found.forEach((o) => {
|
|
317
|
-
const d = N(o, i.preferQualifiedIdentity ? "preferQualified" : "name");
|
|
318
|
-
d && t.add(d);
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
function Ie(e, t) {
|
|
322
|
-
return t != null && t[e] ? t[e] : (e.includes(".") ? e.slice(e.lastIndexOf(".") + 1) : e).replace(/[_-]+/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\s+/g, " ").trim().replace(/\b\w/g, (a) => a.toUpperCase());
|
|
323
|
-
}
|
|
324
|
-
const Se = {
|
|
325
|
-
database: null,
|
|
326
|
-
schema: null,
|
|
327
|
-
table: null
|
|
328
|
-
}, ge = "__card_default__", L = {
|
|
329
|
-
bookmarksPerViewerPerDashboard: 20,
|
|
330
|
-
bookmarkNameMaxChars: 100,
|
|
331
|
-
columnLabelMaxChars: 120,
|
|
332
|
-
tableSettingsMaxBytes: 65536,
|
|
333
|
-
rememberedTableSettingsMaxBytes: 262144,
|
|
334
|
-
bookmarkStateMaxBytes: 65536
|
|
335
|
-
}, W = 1;
|
|
336
|
-
function Ce(e) {
|
|
337
|
-
return new TextEncoder().encode(JSON.stringify(e ?? null)).length;
|
|
338
|
-
}
|
|
339
|
-
function J(e) {
|
|
340
|
-
const t = encodeURIComponent;
|
|
341
|
-
switch (e.kind) {
|
|
342
|
-
case "dimension":
|
|
343
|
-
return `dim:${e.role}:${t(e.fieldId)}`;
|
|
344
|
-
case "metric":
|
|
345
|
-
return `metric:${t(e.metricId)}:${t(
|
|
346
|
-
e.metricAlias
|
|
347
|
-
)}`;
|
|
348
|
-
case "result":
|
|
349
|
-
return `result:${t(e.key)}`;
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
function y(e) {
|
|
353
|
-
if (e)
|
|
354
|
-
try {
|
|
355
|
-
return decodeURIComponent(e);
|
|
356
|
-
} catch {
|
|
357
|
-
return;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
function Y(e) {
|
|
361
|
-
if (typeof e != "string") return;
|
|
362
|
-
const t = e.split(":");
|
|
363
|
-
let r;
|
|
364
|
-
if (t[0] === "dim" && t.length === 3) {
|
|
365
|
-
const a = t[1], n = y(t[2]);
|
|
366
|
-
(a === "detail" || a === "groupby") && n && (r = { kind: "dimension", role: a, fieldId: n });
|
|
367
|
-
} else if (t[0] === "metric" && t.length === 3) {
|
|
368
|
-
const a = y(t[1]), n = y(t[2]);
|
|
369
|
-
a && n && (r = { kind: "metric", metricId: a, metricAlias: n });
|
|
370
|
-
} else if (t[0] === "result" && t.length === 2) {
|
|
371
|
-
const a = y(t[1]);
|
|
372
|
-
a && (r = { kind: "result", key: a });
|
|
373
|
-
}
|
|
374
|
-
return r && J(r) === e ? r : void 0;
|
|
375
|
-
}
|
|
376
|
-
function C(e) {
|
|
377
|
-
return typeof e == "string" && Y(e) !== void 0;
|
|
378
|
-
}
|
|
379
|
-
const A = u.array(u.string()).max(2e3), Z = u.object({
|
|
380
|
-
order: A.optional(),
|
|
381
|
-
hidden: A.optional(),
|
|
382
|
-
labels: u.record(u.string(), u.string().max(L.columnLabelMaxChars)).optional(),
|
|
383
|
-
sort: u.array(
|
|
384
|
-
u.object({
|
|
385
|
-
columnId: u.string(),
|
|
386
|
-
direction: u.enum(["asc", "desc"])
|
|
387
|
-
}).strict()
|
|
388
|
-
).max(2e3).optional()
|
|
389
|
-
}).strict();
|
|
390
|
-
function _(e) {
|
|
391
|
-
const t = /* @__PURE__ */ new Set(), r = [];
|
|
392
|
-
for (const a of e)
|
|
393
|
-
!C(a) || t.has(a) || (t.add(a), r.push(a));
|
|
394
|
-
return r;
|
|
395
|
-
}
|
|
396
|
-
function $(e) {
|
|
397
|
-
if (!e) return;
|
|
398
|
-
const t = e.order ? _(e.order) : void 0, r = e.hidden ? _(e.hidden) : void 0, a = Object.entries(e.labels ?? {}).flatMap(
|
|
399
|
-
([o, d]) => {
|
|
400
|
-
const l = typeof d == "string" ? d.trim() : "";
|
|
401
|
-
return C(o) && l ? [
|
|
402
|
-
[
|
|
403
|
-
o,
|
|
404
|
-
l.slice(0, L.columnLabelMaxChars)
|
|
405
|
-
]
|
|
406
|
-
] : [];
|
|
407
|
-
}
|
|
408
|
-
), n = /* @__PURE__ */ new Set(), i = e.sort ? e.sort.filter((o) => !C(o.columnId) || n.has(o.columnId) ? !1 : (n.add(o.columnId), !0)) : void 0, s = {};
|
|
409
|
-
return t != null && t.length && (s.order = t), r != null && r.length && (s.hidden = r), a.length && (s.labels = Object.fromEntries(a)), i && (s.sort = i.map(({ columnId: o, direction: d }) => ({
|
|
410
|
-
columnId: o,
|
|
411
|
-
direction: d
|
|
412
|
-
}))), Object.keys(s).length ? s : void 0;
|
|
413
|
-
}
|
|
414
|
-
function X(e) {
|
|
415
|
-
return $(e) === void 0;
|
|
416
|
-
}
|
|
417
|
-
function H(e, t) {
|
|
418
|
-
if (t !== W)
|
|
419
|
-
return {
|
|
420
|
-
ok: !1,
|
|
421
|
-
error: `Unsupported table settings version ${t}.`
|
|
422
|
-
};
|
|
423
|
-
const r = Z.safeParse(e);
|
|
424
|
-
return r.success ? {
|
|
425
|
-
ok: !0,
|
|
426
|
-
value: $(r.data) ?? {}
|
|
427
|
-
} : { ok: !1, error: "Table settings are invalid." };
|
|
428
|
-
}
|
|
429
|
-
function Ee(e, t, r) {
|
|
430
|
-
if (!e || typeof e != "object" || Array.isArray(e)) return {};
|
|
431
|
-
const a = {};
|
|
432
|
-
for (const [n, i] of Object.entries(
|
|
433
|
-
e
|
|
434
|
-
)) {
|
|
435
|
-
if (!r.has(n)) continue;
|
|
436
|
-
const s = H(i, t);
|
|
437
|
-
s.ok && !X(s.value) && (a[n] = s.value);
|
|
438
|
-
}
|
|
439
|
-
return a;
|
|
440
|
-
}
|
|
441
|
-
const ee = /* @__PURE__ */ new Set([
|
|
442
|
-
"table",
|
|
443
|
-
"detailTable"
|
|
444
|
-
]);
|
|
445
|
-
function x(e) {
|
|
446
|
-
return ee.has(e.type);
|
|
447
|
-
}
|
|
448
|
-
function te(e) {
|
|
449
|
-
var t, r;
|
|
450
|
-
return x(e) && ((r = (t = e.preferences) == null ? void 0 : t.tablePrefs) == null ? void 0 : r.allowViewerColumnCustomization) !== !1;
|
|
451
|
-
}
|
|
452
|
-
function Ne(e) {
|
|
453
|
-
return new Set(
|
|
454
|
-
m(e).filter(({ card: t }) => x(t)).map(({ card: t }) => t.id)
|
|
455
|
-
);
|
|
456
|
-
}
|
|
457
|
-
function ve(e) {
|
|
458
|
-
return new Set(
|
|
459
|
-
m(e).filter(({ card: t }) => te(t)).map(({ card: t }) => t.id)
|
|
460
|
-
);
|
|
461
|
-
}
|
|
462
|
-
export {
|
|
463
|
-
P as A,
|
|
464
|
-
ue as B,
|
|
465
|
-
ge as C,
|
|
466
|
-
F as D,
|
|
467
|
-
Se as E,
|
|
468
|
-
oe as F,
|
|
469
|
-
m as G,
|
|
470
|
-
se as H,
|
|
471
|
-
de as I,
|
|
472
|
-
ce as J,
|
|
473
|
-
le as K,
|
|
474
|
-
L as V,
|
|
475
|
-
fe as a,
|
|
476
|
-
pe as b,
|
|
477
|
-
V as c,
|
|
478
|
-
q as d,
|
|
479
|
-
ye as e,
|
|
480
|
-
he as f,
|
|
481
|
-
be as g,
|
|
482
|
-
Ie as h,
|
|
483
|
-
W as i,
|
|
484
|
-
X as j,
|
|
485
|
-
H as k,
|
|
486
|
-
Ee as l,
|
|
487
|
-
Ce as m,
|
|
488
|
-
$ as n,
|
|
489
|
-
x as o,
|
|
490
|
-
Y as p,
|
|
491
|
-
te as q,
|
|
492
|
-
me as r,
|
|
493
|
-
Ne as s,
|
|
494
|
-
J as t,
|
|
495
|
-
ve as u,
|
|
496
|
-
O as v,
|
|
497
|
-
T as w,
|
|
498
|
-
j as x,
|
|
499
|
-
ne as y,
|
|
500
|
-
ie as z
|
|
501
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { useState as C, useRef as m, useEffect as h, useCallback as W } from "react";
|
|
2
|
-
const j = (n) => JSON.stringify(n, (e, r) => !r || typeof r != "object" || Array.isArray(r) ? r : Object.keys(r).sort().reduce((c, l) => (c[l] = r[l], c), {}));
|
|
3
|
-
function O(n, e, r = 300, c = 1e3, l) {
|
|
4
|
-
const [D, f] = C(!1), [I, o] = C(!1), d = m(null), t = m(0), T = m(n), w = m(e), u = l || j;
|
|
5
|
-
h(() => {
|
|
6
|
-
t.current += 1;
|
|
7
|
-
const a = t.current, k = T.current !== n, R = w.current !== e;
|
|
8
|
-
if (T.current = n, w.current = e, e === null) {
|
|
9
|
-
const i = window.setTimeout(() => {
|
|
10
|
-
a === t.current && (f(!1), o(!1));
|
|
11
|
-
}, 0);
|
|
12
|
-
return () => clearTimeout(i);
|
|
13
|
-
}
|
|
14
|
-
if (R && !k) {
|
|
15
|
-
const i = window.setTimeout(() => {
|
|
16
|
-
if (a === t.current) {
|
|
17
|
-
const s = u(n), y = u(e);
|
|
18
|
-
f(s !== y), o(!1);
|
|
19
|
-
}
|
|
20
|
-
}, 0);
|
|
21
|
-
return () => clearTimeout(i);
|
|
22
|
-
}
|
|
23
|
-
const g = k ? window.setTimeout(() => {
|
|
24
|
-
a === t.current && o(!0);
|
|
25
|
-
}, 0) : null, z = setTimeout(() => {
|
|
26
|
-
const i = window.requestIdleCallback || ((s) => window.setTimeout(
|
|
27
|
-
() => s({
|
|
28
|
-
didTimeout: !1,
|
|
29
|
-
timeRemaining: () => 50
|
|
30
|
-
}),
|
|
31
|
-
1
|
|
32
|
-
));
|
|
33
|
-
d.current = i(
|
|
34
|
-
(s) => {
|
|
35
|
-
if (s.timeRemaining() > 0 || s.didTimeout) {
|
|
36
|
-
if (a !== t.current) return;
|
|
37
|
-
const y = u(n), P = u(e);
|
|
38
|
-
f(y !== P), o(!1);
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
{ timeout: c }
|
|
42
|
-
);
|
|
43
|
-
}, r);
|
|
44
|
-
return () => {
|
|
45
|
-
g !== null && clearTimeout(g), clearTimeout(z), d.current !== null && ((window.cancelIdleCallback || window.clearTimeout)(d.current), d.current = null);
|
|
46
|
-
};
|
|
47
|
-
}, [n, e, r, c, u]);
|
|
48
|
-
const b = W(() => {
|
|
49
|
-
f(!1), o(!1);
|
|
50
|
-
}, []);
|
|
51
|
-
return {
|
|
52
|
-
isDirty: e === null ? !1 : D,
|
|
53
|
-
isDirtyPending: e === null ? !1 : I,
|
|
54
|
-
resetDirty: b
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
export {
|
|
58
|
-
O as u
|
|
59
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { TFilter, TFilterValue } from '../../components/surfboard/filter/types.js';
|
|
2
|
-
import { DashboardInput, DashboardInputValues } from '../types/common-types.js';
|
|
3
|
-
import { DashboardInputRuntimeTarget } from './dashboard-input-values.js';
|
|
4
|
-
import { DefaultsCalendar } from '../utils/filter-default-value-utils.js';
|
|
5
|
-
import { GlobalDateComparisonSelection } from '../../shared/analytics-protocol/index.js';
|
|
6
|
-
import { DashboardFilterOptionDependencies, DashboardFilterOptionPopulation, DashboardFilterOptionSource } from '../../shared/dashboard-authoring/index.js';
|
|
7
|
-
export type DashboardFilterStorageState = {
|
|
8
|
-
filterValues?: TFilterValue[];
|
|
9
|
-
defaultFilterValues?: TFilterValue[];
|
|
10
|
-
dashboardInputValues: DashboardInputValues;
|
|
11
|
-
defaultInputValues?: DashboardInputValues;
|
|
12
|
-
};
|
|
13
|
-
export type DashboardFilterAuthoringSettingsUpdate = {
|
|
14
|
-
forceSelection?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* The caller changed the default its target loads. Filter settings start
|
|
17
|
-
* from the target's saved default (`resolveAuthoredFilterDefaultFields`),
|
|
18
|
-
* which can differ from the definition for a scoped Input or an overlay
|
|
19
|
-
* entry, so they say so; callers that start from the definition leave it
|
|
20
|
-
* unset and the owner compares definitions. Also resets a saved slot that
|
|
21
|
-
* has no backing default.
|
|
22
|
-
*/
|
|
23
|
-
defaultValueChanged?: boolean;
|
|
24
|
-
defaultComparisonChanged?: boolean;
|
|
25
|
-
defaultComparisonSelection?: GlobalDateComparisonSelection;
|
|
26
|
-
target?: DashboardInputRuntimeTarget;
|
|
27
|
-
optionSourceChanged?: boolean;
|
|
28
|
-
optionSource?: DashboardFilterOptionSource;
|
|
29
|
-
/** Authored option dependency policy edit; undefined value restores the
|
|
30
|
-
* dashboard default (omitted, meaning All applicable). */
|
|
31
|
-
optionDependenciesChanged?: boolean;
|
|
32
|
-
optionDependencies?: DashboardFilterOptionDependencies;
|
|
33
|
-
optionPopulationChanged?: boolean;
|
|
34
|
-
optionPopulation?: DashboardFilterOptionPopulation;
|
|
35
|
-
/** Raw selection identity changed; the previous runtime value is invalid. */
|
|
36
|
-
selectionIdentityChanged?: boolean;
|
|
37
|
-
};
|
|
38
|
-
/** Persisted option policy carried by a filter Input. */
|
|
39
|
-
export type DashboardFilterOptionPolicy = {
|
|
40
|
-
optionDependencies?: DashboardFilterOptionDependencies;
|
|
41
|
-
optionPopulation?: DashboardFilterOptionPopulation;
|
|
42
|
-
};
|
|
43
|
-
/** Resolves the policy an authoring transaction should persist. */
|
|
44
|
-
export declare function resolveFilterOptionPolicy(current: DashboardFilterOptionPolicy | undefined, settings: DashboardFilterAuthoringSettingsUpdate | undefined): DashboardFilterOptionPolicy;
|
|
45
|
-
export declare function hasFilterOptionPolicy(policy: DashboardFilterOptionPolicy | undefined): boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Callers submit edits; the owner decides whether defaults must be reseeded.
|
|
48
|
-
* A default change (values, date window or mode) writes the target's saved
|
|
49
|
-
* default and live value; the definition, which the caller submits whole,
|
|
50
|
-
* holds the last authored default.
|
|
51
|
-
*/
|
|
52
|
-
export declare function resolveFilterAuthoringSettings(previous: TFilter | undefined, filter: TFilter, settings: DashboardFilterAuthoringSettingsUpdate | undefined, target: DashboardInputRuntimeTarget, calendar?: DefaultsCalendar): {
|
|
53
|
-
target: DashboardInputRuntimeTarget;
|
|
54
|
-
defaultValueChanged: boolean;
|
|
55
|
-
defaultFilterValue: TFilterValue | undefined;
|
|
56
|
-
forceSelection?: boolean;
|
|
57
|
-
defaultComparisonChanged?: boolean;
|
|
58
|
-
defaultComparisonSelection?: GlobalDateComparisonSelection;
|
|
59
|
-
optionSourceChanged?: boolean;
|
|
60
|
-
optionSource?: DashboardFilterOptionSource;
|
|
61
|
-
optionDependenciesChanged?: boolean;
|
|
62
|
-
optionDependencies?: DashboardFilterOptionDependencies;
|
|
63
|
-
optionPopulationChanged?: boolean;
|
|
64
|
-
optionPopulation?: DashboardFilterOptionPopulation;
|
|
65
|
-
selectionIdentityChanged?: boolean;
|
|
66
|
-
};
|
|
67
|
-
export declare function moveOrdinaryFilterStorageToMappedInput(params: {
|
|
68
|
-
state: DashboardFilterStorageState;
|
|
69
|
-
input: Pick<DashboardInput, 'id' | 'runtimeScope'>;
|
|
70
|
-
filter: TFilter;
|
|
71
|
-
}): DashboardFilterStorageState;
|
|
72
|
-
export declare function moveMappedInputStorageToOrdinaryFilter(params: {
|
|
73
|
-
state: DashboardFilterStorageState;
|
|
74
|
-
input: Pick<DashboardInput, 'id' | 'runtimeScope'>;
|
|
75
|
-
filter: TFilter;
|
|
76
|
-
}): DashboardFilterStorageState;
|
|
77
|
-
/**
|
|
78
|
-
* Applies Basic-tab default edits to the same storage transaction that changes
|
|
79
|
-
* mapped participation. This keeps the authoritative filter, mapped input, and
|
|
80
|
-
* its runtime/default slots from becoming observable in mixed states.
|
|
81
|
-
*/
|
|
82
|
-
export declare function applyFilterAuthoringSettingsToStorage(params: {
|
|
83
|
-
state: DashboardFilterStorageState;
|
|
84
|
-
input: Pick<DashboardInput, 'id' | 'runtimeScope'>;
|
|
85
|
-
filterId: string;
|
|
86
|
-
storage: 'mapped' | 'ordinary';
|
|
87
|
-
settings?: ReturnType<typeof resolveFilterAuthoringSettings>;
|
|
88
|
-
}): DashboardFilterStorageState;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { DashboardInputBase } from '../types/common-types.js';
|
|
2
|
-
import { DashboardInputRuntimeTarget } from './dashboard-input-values.js';
|
|
3
|
-
export type ScopedDashboardInputTarget = DashboardInputRuntimeTarget & {
|
|
4
|
-
sheetKind?: 'dashboard' | 'document';
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* The one interpreter of `DashboardInputScope`. Filters, controls, and
|
|
8
|
-
* click-to-filter targets all decide "does this reach that card" here.
|
|
9
|
-
*/
|
|
10
|
-
export declare function doesDashboardInputApplyToTarget(input: Pick<DashboardInputBase, 'scope' | 'compatibility'>, target: ScopedDashboardInputTarget): boolean;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DashboardChangeCompileResult, DashboardChangePlan, GeneratedDashboardCardArtifact } from './contracts.js';
|
|
2
|
-
import { TDashboard } from '../../lib/types/index.js';
|
|
3
|
-
export declare function applyDashboardChangePlan(input: {
|
|
4
|
-
dashboard: TDashboard;
|
|
5
|
-
changePlan: DashboardChangePlan;
|
|
6
|
-
cardArtifacts: GeneratedDashboardCardArtifact[];
|
|
7
|
-
}): DashboardChangeCompileResult;
|