react-semaphor 0.1.544 → 0.1.545
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 +35 -34
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +2 -2
- package/dist/briefings/index.js +50 -47
- package/dist/chunks/{class-utils-Df1OVOT1.js → _commonjsHelpers-DimLPMtv.js} +124 -98
- package/dist/chunks/{apply-dashboard-operations-Bz4n1Lq6.js → apply-dashboard-operations-CZEMsx8E.js} +778 -958
- package/dist/chunks/{assistant-chat-BNLkCDml.js → assistant-chat-D7sWTypJ.js} +308 -309
- package/dist/chunks/calendar-day-equality-dvoQp1xW.js +410 -0
- package/dist/chunks/{comparison-window-caption-BTkrN3W4.js → comparison-window-caption-D4E6IHPD.js} +56 -55
- package/dist/chunks/{custom-visual-inputs-DUtpYZOk.js → custom-visual-inputs-DLCD9Y5V.js} +8 -2
- package/dist/chunks/{dashboard-g5a4DKWq.js → dashboard-B1tMju0u.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DQ_8O_e2.js → dashboard-briefing-launcher-CePgIu0Z.js} +771 -776
- package/dist/chunks/{dashboard-controls-8RyBTQUO.js → dashboard-controls-Cq05n3e0.js} +28 -28
- package/dist/chunks/{dashboard-json-7qT9jmfL.js → dashboard-json-CoYRPqxx.js} +3 -3
- package/dist/chunks/document-dashboard-inputs-BesAHZvB.js +3112 -0
- package/dist/chunks/{edit-dashboard-visual-BfJwnRIZ.js → edit-dashboard-visual-JPtNfJRb.js} +5624 -5615
- package/dist/chunks/{filter-value-text-CYsVYPuD.js → filter-value-text-ff7osJr7.js} +1 -1
- package/dist/chunks/{index-DkAyQvC6.js → index-DRWiuqyd.js} +378 -333
- package/dist/chunks/{matrix-formatter-CxJLkztA.js → matrix-formatter-DnCyRXJE.js} +13 -13
- package/dist/chunks/{numeric-presentation-DESvLiu9.js → numeric-presentation-7X_IrD58.js} +2571 -2572
- package/dist/chunks/{raw-temporal-presentation-CLiVi90c.js → raw-temporal-presentation-C3mUgnEx.js} +1 -1
- package/dist/chunks/{zoned-wall-clock-MulfA26h.js → relative-date-label-Bk2j94pA.js} +21 -64
- package/dist/chunks/rendered-file-D8xEuVVx.js +108 -0
- package/dist/chunks/{report-preferences-dialog-Df7VpRVW.js → report-preferences-dialog-DUtuUL_5.js} +631 -603
- package/dist/chunks/resolve-dashboard-input-context-DJ2tICwz.js +9415 -0
- package/dist/chunks/{saved-dashboard-context-B-mQ--nV.js → saved-dashboard-context-LrF_kW0l.js} +183 -211
- package/dist/chunks/selection-filter-compiler-BKXmyLrS.js +79 -0
- package/dist/chunks/{semaphor-ready-indicator-DDAxk8us.js → semaphor-ready-indicator-BxF96Yhv.js} +45764 -46519
- package/dist/chunks/{shelf-drop-preview-context-BSRPwaED.js → shelf-drop-preview-context-CNaM_Gmh.js} +885 -866
- package/dist/chunks/{switch-C3jLxlG0.js → switch-uDtPgQlQ.js} +44 -45
- package/dist/chunks/{table-export-sheet-CPfGAQ9X.js → table-export-sheet-YzMioA7Y.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-BxzFviM-.js → use-create-flow-overlay-state-CjB7ig1o.js} +105 -105
- package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +556 -544
- package/dist/data-app-sdk/index.js +1 -1
- package/dist/format-utils/index.js +163 -152
- package/dist/index.js +351 -323
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- 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/surfboard/filter/types.d.ts +0 -14
- 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 +35 -1
- package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +199 -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/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/stores/dashboard-store.d.ts +39 -55
- package/dist/types/lib/stores/editor-store.d.ts +0 -3
- package/dist/types/lib/types/common-types.d.ts +21 -6
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +4 -11
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +12 -12
- 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 +92 -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 +2 -0
- 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/package.json +2 -2
- package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/chunks/calendar-day-equality-BmJAWduY.js +0 -460
- package/dist/chunks/document-dashboard-inputs-BC6p-ESg.js +0 -8087
- package/dist/chunks/document-sheet-utils-Duo9uLoH.js +0 -3619
- package/dist/chunks/sort-target-MT1WK1vX.js +0 -29
- 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
|
@@ -4,7 +4,7 @@ import { TableColumnEditResult } from '../dashboard-viewer/table-view-edit.js';
|
|
|
4
4
|
import { Bookmark } from '../../shared/dashboard-viewer/index.js';
|
|
5
5
|
import { DashboardViewerState } from '../dashboard-viewer/viewer-store-state.js';
|
|
6
6
|
import { ViewerStateClient } from '../dashboard-viewer/viewer-state-client.js';
|
|
7
|
-
import { AuthToken, TBaseQuery, Breakpoint, ControlDefinition, CustomCard, StyleProps, TCard, TDashboard, TEvent, TFrame, TSheet, TStyle, CacheConfig, FilterLayoutSettings, DocumentDefinition, DashboardInput, DashboardInputSlot, DashboardInputValues, DashboardLifecycleEvent } from '../types/common-types.js';
|
|
7
|
+
import { AuthToken, TBaseQuery, Breakpoint, ControlDefinition, CustomCard, StyleProps, TCard, TDashboard, TEvent, TFrame, TSheet, TStyle, CacheConfig, FilterLayoutSettings, DocumentDefinition, DashboardInput, DashboardInputScope, DashboardInputSlot, DashboardInputValues, DashboardLifecycleEvent } from '../types/common-types.js';
|
|
8
8
|
import { TFilter, TFilterValue } from '../../components/surfboard/filter/types.js';
|
|
9
9
|
import { TransientInputContext } from '../dashboard-inputs/transient-input-context.js';
|
|
10
10
|
import { MissingPrintInputs } from '../print/print-inputs.js';
|
|
@@ -15,10 +15,9 @@ import { DashboardControlsModelOptions } from '../controls/control-authoring-typ
|
|
|
15
15
|
import { SemanticExecutionPayload } from '../types/semantic-runtime-types.js';
|
|
16
16
|
import { DocumentPanelTarget } from '../document/document-panel-target.js';
|
|
17
17
|
import { DocumentEdit, DocumentEditResult } from '../document/document-edits.js';
|
|
18
|
+
import { FilterSettingsChange, FilterSettingsSaveResult } from '../dashboard-inputs/filter-settings.js';
|
|
19
|
+
import { FilterRef } from '../../shared/dashboard-authoring/filter-model/index.js';
|
|
18
20
|
import { DashboardInputRuntimeTarget } from '../dashboard-inputs/dashboard-input-values.js';
|
|
19
|
-
import { DashboardFilterMappingAuthoringIssue, DashboardFilterInputAcceptanceResult, DashboardFilterMappingAcceptanceResult, DashboardFilterMappingAuthoringRequest, DashboardFilterMappingDisableResult } from '../dashboard-inputs/dashboard-filter-mapping-authoring.js';
|
|
20
|
-
import { DashboardFilterOptionSource } from '../../shared/dashboard-authoring/index.js';
|
|
21
|
-
import { DashboardFilterAuthoringSettingsUpdate } from '../dashboard-inputs/dashboard-filter-mapping-storage-transition.js';
|
|
22
21
|
import { GlobalDateComparisonSelection } from '../../shared/analytics-protocol/index.js';
|
|
23
22
|
import { CalendarPreferencesResponse, ReportRuntimeContext, ResolvedCalendarPreferenceSources } from '../../shared/report-runtime-context/index.js';
|
|
24
23
|
import { ResolvedValueFormatPreferenceSources, ResolvedValueFormatPreferences } from '../../shared/value-format-preferences/index.js';
|
|
@@ -31,26 +30,6 @@ type AddFrameOptions = {
|
|
|
31
30
|
placement?: DashboardFramePlacement;
|
|
32
31
|
semanticExecutionPayload?: SemanticExecutionPayload;
|
|
33
32
|
};
|
|
34
|
-
export type FilterDashboardInputDefinitionUpdateMetadata = {
|
|
35
|
-
variableName?: string;
|
|
36
|
-
label?: string;
|
|
37
|
-
forceSelection?: boolean;
|
|
38
|
-
exports?: DashboardInput['exports'];
|
|
39
|
-
/**
|
|
40
|
-
* Option source, dependency and population edits for an embedded Input,
|
|
41
|
-
* persisted through the same contract validation as mapped dashboard
|
|
42
|
-
* filters. Presentations that bind an embedded Input (the document input
|
|
43
|
-
* bar) carry these; dashboard-filter references persist through
|
|
44
|
-
* `acceptDashboardFilterInput` and `acceptDashboardFilterMapping` instead.
|
|
45
|
-
*/
|
|
46
|
-
optionSettings?: DashboardFilterAuthoringSettingsUpdate;
|
|
47
|
-
};
|
|
48
|
-
export type FilterDashboardInputDefinitionUpdateResult = {
|
|
49
|
-
ok: true;
|
|
50
|
-
} | {
|
|
51
|
-
ok: false;
|
|
52
|
-
issues: DashboardFilterMappingAuthoringIssue[];
|
|
53
|
-
};
|
|
54
33
|
export type DashboardStore = {
|
|
55
34
|
isDownloadingPdf?: boolean;
|
|
56
35
|
isSessionExpired: boolean;
|
|
@@ -73,11 +52,6 @@ export type DashboardStore = {
|
|
|
73
52
|
* draft-only until the editor Save path applies the current frame.
|
|
74
53
|
*/
|
|
75
54
|
visualEditPendingFrameRewrites: Record<string, TFrame[]>;
|
|
76
|
-
/**
|
|
77
|
-
* Pending dashboard-filter metadata rewrites produced while visual editing.
|
|
78
|
-
* These stay draft-only until the editor Save path applies the current frame.
|
|
79
|
-
*/
|
|
80
|
-
visualEditPendingFilterRewrites: Record<string, TFilter[]>;
|
|
81
55
|
/**
|
|
82
56
|
* Pending dashboard-scoped calculated-field rewrites produced while visual
|
|
83
57
|
* editing. These stay draft-only until the editor Save path applies the
|
|
@@ -99,7 +73,12 @@ export type DashboardStore = {
|
|
|
99
73
|
isVisualEditing: boolean;
|
|
100
74
|
showDashboardJSON: boolean;
|
|
101
75
|
showFilters: boolean;
|
|
102
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Runtime-only values no filter defines: chart clicks on SQL charts and
|
|
78
|
+
* summary chips (one filter model SPEC 5.8). Never saved. Authored filter
|
|
79
|
+
* values are `dashboardInputValues` slots.
|
|
80
|
+
*/
|
|
81
|
+
adHocFilterValues: TFilterValue[];
|
|
103
82
|
/** Runtime-only inline filter values, keyed by cardId. Not persisted with dashboard. */
|
|
104
83
|
inlineFilterValuesMap: Record<string, TFilterValue[]>;
|
|
105
84
|
/** Runtime-only dashboard control values keyed by globally unique controlId. */
|
|
@@ -179,20 +158,25 @@ type Actions = {
|
|
|
179
158
|
setGlobalStyle: (style: TStyle) => void;
|
|
180
159
|
setDashboardInputs: (inputs: DashboardInput[]) => void;
|
|
181
160
|
upsertDashboardInput: (input: DashboardInput) => void;
|
|
182
|
-
updateFilterDashboardInputDefinition: (inputId: string, filter: TFilter, metadata?: FilterDashboardInputDefinitionUpdateMetadata) => FilterDashboardInputDefinitionUpdateResult;
|
|
183
|
-
acceptDashboardFilterInput: (updatedFilter: TFilter, optionSource: DashboardFilterOptionSource | undefined, settings?: DashboardFilterAuthoringSettingsUpdate, inputMetadata?: {
|
|
184
|
-
variableName?: string;
|
|
185
|
-
}) => DashboardFilterInputAcceptanceResult;
|
|
186
161
|
/**
|
|
187
|
-
*
|
|
188
|
-
* definition,
|
|
189
|
-
*
|
|
190
|
-
*
|
|
162
|
+
* Every settings write of a filter (one filter model M4, SPEC 4.5): the
|
|
163
|
+
* definition, label, variable name, keep selection, required, scope, option
|
|
164
|
+
* settings, mapping and value effects, in one write. Nothing is written
|
|
165
|
+
* when the change is refused.
|
|
191
166
|
*/
|
|
192
|
-
|
|
193
|
-
acceptDashboardFilterMapping: (request: DashboardFilterMappingAuthoringRequest, updatedFilter?: TFilter, settings?: DashboardFilterAuthoringSettingsUpdate) => DashboardFilterMappingAcceptanceResult;
|
|
194
|
-
disableDashboardFilterMapping: (filterId: string, updatedFilter?: TFilter, settings?: DashboardFilterAuthoringSettingsUpdate) => DashboardFilterMappingDisableResult;
|
|
167
|
+
saveFilterSettings: (ref: FilterRef, change: FilterSettingsChange) => FilterSettingsSaveResult;
|
|
195
168
|
removeDashboardInput: (inputId: string) => void;
|
|
169
|
+
/**
|
|
170
|
+
* Adds a new filter as an input holding this definition, reaching `scope`
|
|
171
|
+
* (one filter model Phase 5: every filter is an input). One Global Date per
|
|
172
|
+
* dashboard: a second is refused. Returns the new input's id.
|
|
173
|
+
*/
|
|
174
|
+
addFilterInput: (filter: TFilter, scope: DashboardInputScope) => string | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* Removes a filter, whichever input holds it, with its saved and runtime
|
|
177
|
+
* values (one filter model SP-9; from Phase 5 every filter is an input).
|
|
178
|
+
*/
|
|
179
|
+
removeFilterInput: (ref: FilterRef) => void;
|
|
196
180
|
reorderDashboardInputs: (orderedInputIds: string[]) => void;
|
|
197
181
|
setDefaultDashboardInputValues: (values: DashboardInputValues | undefined) => void;
|
|
198
182
|
setDefaultDashboardInputComparisonSelection: (input: Pick<DashboardInput, 'id' | 'runtimeScope'>, target: DashboardInputRuntimeTarget, selection: GlobalDateComparisonSelection | undefined) => void;
|
|
@@ -228,7 +212,14 @@ type Actions = {
|
|
|
228
212
|
dashboardInputGeneratedAt?: string;
|
|
229
213
|
reportContext?: ReportRuntimeContext;
|
|
230
214
|
}) => void;
|
|
215
|
+
/**
|
|
216
|
+
* Loads a dashboard. `filterValues` is a host overlay (one filter model M5):
|
|
217
|
+
* each filter's value becomes its input's slot, under any slots in
|
|
218
|
+
* `options.dashboardInputValues`; a value no filter defines is ad-hoc.
|
|
219
|
+
*/
|
|
231
220
|
setDashboardWithFilterValues: (dashboard: TDashboard, filterValues: TFilterValue[], runtimeOverrides?: Record<string, unknown>, options?: {
|
|
221
|
+
/** Ad-hoc values to load (SPEC 5.8). */
|
|
222
|
+
adHocFilterValues?: TFilterValue[];
|
|
232
223
|
selectedSheetId?: string | null;
|
|
233
224
|
semanticExecutionPayload?: SemanticExecutionPayload;
|
|
234
225
|
dashboardInputValues?: DashboardInputValues;
|
|
@@ -317,9 +308,7 @@ type Actions = {
|
|
|
317
308
|
updateSheetCalculatedFields: (sheetId: string, calculatedFields: Field[]) => void;
|
|
318
309
|
updateDashboardCalculatedFields: (calculatedFields: Field[]) => void;
|
|
319
310
|
setVisualEditPendingFrameRewrites: (sheetId: string, frames: TFrame[]) => void;
|
|
320
|
-
setVisualEditPendingFilterRewrites: (sheetId: string, filters: TFilter[]) => void;
|
|
321
311
|
clearVisualEditPendingFrameRewrites: (sheetId?: string) => void;
|
|
322
|
-
clearVisualEditPendingFilterRewrites: (sheetId?: string) => void;
|
|
323
312
|
updateCard: (sheetId: string, card: TCard) => void;
|
|
324
313
|
updateFrameCard?: (sheetId: string, frameId: string, card: TCard) => void;
|
|
325
314
|
updateCurrentDashboardCard: (card: TCard) => void;
|
|
@@ -330,17 +319,13 @@ type Actions = {
|
|
|
330
319
|
setIsVisualEditing: (editing: boolean) => void;
|
|
331
320
|
setShowFilters: (show: boolean) => void;
|
|
332
321
|
setFilterLayout: (settings: Partial<FilterLayoutSettings>) => void;
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
addOrUpdateFilterValue: (filterValue: TFilterValue) => void;
|
|
341
|
-
addOrUpdateFilterValues: (filterValues: TFilterValue[]) => void;
|
|
342
|
-
removeFilterValues: (filterId: string) => void;
|
|
343
|
-
replaceFilterValue: (filterValue: TFilterValue) => void;
|
|
322
|
+
/** Adds or replaces ad-hoc values by `filterId`; a value with no values removes its entry. */
|
|
323
|
+
addOrUpdateAdHocFilterValues: (filterValues: TFilterValue[]) => void;
|
|
324
|
+
/** Removes every ad-hoc value whose id starts with the prefix: everything one chart added (SPEC 5.8). */
|
|
325
|
+
removeAdHocFilterValues: (idPrefix: string) => void;
|
|
326
|
+
clearAdHocFilterValues: () => void;
|
|
327
|
+
/** Clears every filter's value on every target, and every ad-hoc value (a card popover's Clear all). */
|
|
328
|
+
clearAllFilterValues: () => void;
|
|
344
329
|
setStyle: (style: TStyle) => void;
|
|
345
330
|
getStyle: () => TStyle | undefined;
|
|
346
331
|
setOnSaveFunction: (onSaveFunction: (dashboard: TDashboard) => void) => void;
|
|
@@ -358,7 +343,6 @@ type Actions = {
|
|
|
358
343
|
getCardSheet: (cardId: string) => TSheet | undefined;
|
|
359
344
|
getSelectedSheetLayout: () => ReactGridLayout.Layout[] | undefined;
|
|
360
345
|
getSelectedSheetLayouts: () => ReactGridLayout.Layouts | undefined;
|
|
361
|
-
handleDataPointClickAction: (card: TCard, dataPoint: any) => void;
|
|
362
346
|
addBaseQuery: (baseQuery: TBaseQuery) => void;
|
|
363
347
|
removeBaseQuery: (baseQueryId: string) => void;
|
|
364
348
|
setBaseQueries: (baseQueries: TBaseQuery[]) => void;
|
|
@@ -33,7 +33,6 @@ export type EditorContext = {
|
|
|
33
33
|
documentFilterValues?: TFilterValue[];
|
|
34
34
|
documentControlDefinitions?: ControlDefinition[];
|
|
35
35
|
documentControlValues?: Record<string, unknown>;
|
|
36
|
-
missingRequiredInputLabels?: string[];
|
|
37
36
|
};
|
|
38
37
|
/**
|
|
39
38
|
* Factory function to create empty KPI card configuration
|
|
@@ -71,7 +70,6 @@ export type EditorStore = {
|
|
|
71
70
|
activeTabCardId?: string | null;
|
|
72
71
|
showFilters: boolean;
|
|
73
72
|
applyFilters: boolean;
|
|
74
|
-
filterValues?: TFilterValue[];
|
|
75
73
|
inlineFilterValuesMap: Record<string, TFilterValue[]>;
|
|
76
74
|
queryResultColumns: string[];
|
|
77
75
|
queryResultColumnKeyMap?: QueryColumnKeyMap;
|
|
@@ -183,7 +181,6 @@ type Actions = TableActions & ExplorerActions & {
|
|
|
183
181
|
setCardConfig: (config: CardConfig | undefined) => void;
|
|
184
182
|
setShowFilters: (showFilters: boolean) => void;
|
|
185
183
|
setApplyFilters: (applyFilters: boolean) => void;
|
|
186
|
-
setFilterValues: (filterValues: TFilterValue[]) => void;
|
|
187
184
|
setInlineFilterValuesMap: (map: Record<string, TFilterValue[]>) => void;
|
|
188
185
|
setCardInlineFilterValue: (cardId: string, filterValue: TFilterValue) => void;
|
|
189
186
|
removeCardInlineFilterValue: (cardId: string, filterId: string) => void;
|
|
@@ -138,6 +138,14 @@ export type VisualDisplayPreferences = {
|
|
|
138
138
|
* exactly as today (report attachment delivery RA-D11).
|
|
139
139
|
*/
|
|
140
140
|
delivery?: 'strict';
|
|
141
|
+
/**
|
|
142
|
+
* An emailed card image (PNG exports PN-D13): the card is drawn at the size
|
|
143
|
+
* its saved layout has on a dashboard this many CSS pixels wide, by the
|
|
144
|
+
* dashboard grid's own geometry. Read by `Visual` only.
|
|
145
|
+
*/
|
|
146
|
+
imageLayout?: {
|
|
147
|
+
dashboardWidth: number;
|
|
148
|
+
};
|
|
141
149
|
/**
|
|
142
150
|
* Override specific UI elements visibility
|
|
143
151
|
* These overrides take precedence over the mode presets
|
|
@@ -161,12 +169,6 @@ export type VisualDisplayPreferences = {
|
|
|
161
169
|
* Filter layout settings for controlling how dashboard filters are displayed
|
|
162
170
|
*/
|
|
163
171
|
export type FilterLayoutSettings = {
|
|
164
|
-
/**
|
|
165
|
-
* Display mode for filters
|
|
166
|
-
* - 'canvas': Filters displayed as draggable/resizable cards on the dashboard canvas (default)
|
|
167
|
-
* - 'toolbar': Filters displayed in a compact horizontal toolbar below dashboard controls
|
|
168
|
-
*/
|
|
169
|
-
displayMode?: 'canvas' | 'toolbar';
|
|
170
172
|
/**
|
|
171
173
|
* Whether the toolbar should wrap filters to multiple lines
|
|
172
174
|
* - false: Horizontal scroll when filters overflow (default)
|
|
@@ -931,14 +933,27 @@ export type ControlBinding = {
|
|
|
931
933
|
mapping: Record<string, string>;
|
|
932
934
|
} | CurrencyPresentationBinding;
|
|
933
935
|
export type DashboardInput = FilterDashboardInput | ControlDashboardInput;
|
|
936
|
+
/**
|
|
937
|
+
* Which tabs and cards an input reaches. The one owner of reach; read it only
|
|
938
|
+
* through the scope rule (`doesDashboardInputApplyToTarget`,
|
|
939
|
+
* `isDashboardInputOnTab` in react-semaphor `dashboard-authoring`).
|
|
940
|
+
*/
|
|
934
941
|
export type DashboardInputScope = {
|
|
935
942
|
kind: 'allSheets';
|
|
943
|
+
/** Omitted = tabs of both kinds. */
|
|
936
944
|
sheetKinds?: Array<'dashboard' | 'document'>;
|
|
945
|
+
/** Every allowed tab except these. A tab added later is included. */
|
|
946
|
+
exceptSheetIds?: string[];
|
|
947
|
+
/** Every card on the reached tabs except these. A card added later is included. */
|
|
948
|
+
exceptCardIds?: string[];
|
|
937
949
|
} | {
|
|
938
950
|
kind: 'sheets';
|
|
951
|
+
/** May be empty: the input reaches nothing. */
|
|
939
952
|
sheetIds: string[];
|
|
953
|
+
exceptCardIds?: string[];
|
|
940
954
|
} | {
|
|
941
955
|
kind: 'cards';
|
|
956
|
+
/** May be empty: the input reaches nothing. */
|
|
942
957
|
cardIds: string[];
|
|
943
958
|
} | {
|
|
944
959
|
kind: 'documentSections';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TFilterValue } from '../../components/surfboard/filter/types.js';
|
|
1
|
+
import { TCard, TDashboard } from '../../lib/types/common-types.js';
|
|
3
2
|
import { CardViewStateMap } from '../../lib/dashboard-view-state/index.js';
|
|
4
3
|
import { ControlContractOverrides } from '../../lib/dashboard-inputs/control-contract-overrides.js';
|
|
5
4
|
import { SemanticExecutionPayload } from '../../lib/types/semantic-runtime-types.js';
|
|
6
5
|
import { CalendarContext } from '../report-runtime-context/index.js';
|
|
7
|
-
import {
|
|
6
|
+
import { CardRuntimeValues, StoredCaptureValues } from '../../lib/dashboard-viewer/captured-runtime-values.js';
|
|
8
7
|
import { DashboardCardExecutionSnapshotResult } from '../../lib/query-context/build-dashboard-execution-snapshot.js';
|
|
9
8
|
import { TransientInputContext } from '../../lib/dashboard-inputs/transient-input-context.js';
|
|
10
9
|
import { DashboardCardLocation } from '../dashboard-authoring/document-section-cards.js';
|
|
@@ -26,10 +25,6 @@ export type SavedDashboardPlace = {
|
|
|
26
25
|
/** Drill paths by card. */
|
|
27
26
|
cardViewState?: CardViewStateMap;
|
|
28
27
|
};
|
|
29
|
-
/** The store's input values plus drill paths: what a card's snapshot is built from. */
|
|
30
|
-
export type CardRuntimeValues = ViewerStoreInputValues & {
|
|
31
|
-
cardViewState: CardViewStateMap;
|
|
32
|
-
};
|
|
33
28
|
export declare function projectSavedDashboardContext(input: {
|
|
34
29
|
dashboard: TDashboard;
|
|
35
30
|
place: SavedDashboardPlace;
|
|
@@ -115,11 +110,9 @@ export declare function cardReplayOf(input: {
|
|
|
115
110
|
* contract, and a saved input snapshot. Every field is optional; none at all
|
|
116
111
|
* is a fresh viewer (saved defaults).
|
|
117
112
|
*/
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
controlValues?: Readonly<Record<string, unknown>>;
|
|
113
|
+
/** A scheduled card attachment's saved values, with the host's control contract. */
|
|
114
|
+
export type SavedCardHost = StoredCaptureValues & {
|
|
121
115
|
controlContract?: ControlContractOverrides;
|
|
122
|
-
dashboardInputExecutionSnapshot?: DashboardInputExecutionSnapshot;
|
|
123
116
|
};
|
|
124
117
|
/**
|
|
125
118
|
* A saved card's request as a host opens it: by default a fresh viewer
|
|
@@ -193,10 +193,10 @@ export declare const controlDefinitionExecutionSchema: z.ZodEffects<z.ZodObject<
|
|
|
193
193
|
defaultValue?: unknown;
|
|
194
194
|
showLabel?: boolean | undefined;
|
|
195
195
|
toolbarWidth?: number | undefined;
|
|
196
|
-
placement?: "toolbar" | "card_header" | "advanced" | undefined;
|
|
197
196
|
hidden?: boolean | undefined;
|
|
198
197
|
locked?: boolean | undefined;
|
|
199
198
|
helpText?: string | undefined;
|
|
199
|
+
placement?: "toolbar" | "card_header" | "advanced" | undefined;
|
|
200
200
|
}, {
|
|
201
201
|
type: "number" | "boolean" | "date" | "text" | "enum" | "multi_enum" | "field_selector" | "metric_selector" | "aggregation_selector" | "grain_selector";
|
|
202
202
|
id: string;
|
|
@@ -236,10 +236,10 @@ export declare const controlDefinitionExecutionSchema: z.ZodEffects<z.ZodObject<
|
|
|
236
236
|
defaultValue?: unknown;
|
|
237
237
|
showLabel?: boolean | undefined;
|
|
238
238
|
toolbarWidth?: number | undefined;
|
|
239
|
-
placement?: "toolbar" | "card_header" | "advanced" | undefined;
|
|
240
239
|
hidden?: boolean | undefined;
|
|
241
240
|
locked?: boolean | undefined;
|
|
242
241
|
helpText?: string | undefined;
|
|
242
|
+
placement?: "toolbar" | "card_header" | "advanced" | undefined;
|
|
243
243
|
}>, {
|
|
244
244
|
type: "number" | "boolean" | "date" | "text" | "enum" | "multi_enum" | "field_selector" | "metric_selector" | "aggregation_selector" | "grain_selector";
|
|
245
245
|
id: string;
|
|
@@ -279,10 +279,10 @@ export declare const controlDefinitionExecutionSchema: z.ZodEffects<z.ZodObject<
|
|
|
279
279
|
defaultValue?: unknown;
|
|
280
280
|
showLabel?: boolean | undefined;
|
|
281
281
|
toolbarWidth?: number | undefined;
|
|
282
|
-
placement?: "toolbar" | "card_header" | "advanced" | undefined;
|
|
283
282
|
hidden?: boolean | undefined;
|
|
284
283
|
locked?: boolean | undefined;
|
|
285
284
|
helpText?: string | undefined;
|
|
285
|
+
placement?: "toolbar" | "card_header" | "advanced" | undefined;
|
|
286
286
|
}, {
|
|
287
287
|
type: "number" | "boolean" | "date" | "text" | "enum" | "multi_enum" | "field_selector" | "metric_selector" | "aggregation_selector" | "grain_selector";
|
|
288
288
|
id: string;
|
|
@@ -322,10 +322,10 @@ export declare const controlDefinitionExecutionSchema: z.ZodEffects<z.ZodObject<
|
|
|
322
322
|
defaultValue?: unknown;
|
|
323
323
|
showLabel?: boolean | undefined;
|
|
324
324
|
toolbarWidth?: number | undefined;
|
|
325
|
-
placement?: "toolbar" | "card_header" | "advanced" | undefined;
|
|
326
325
|
hidden?: boolean | undefined;
|
|
327
326
|
locked?: boolean | undefined;
|
|
328
327
|
helpText?: string | undefined;
|
|
328
|
+
placement?: "toolbar" | "card_header" | "advanced" | undefined;
|
|
329
329
|
}>;
|
|
330
330
|
export declare const controlBindingExecutionSchema: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
|
|
331
331
|
controlId: z.ZodString;
|
|
@@ -858,7 +858,6 @@ export declare const controlBindingExecutionSchema: z.ZodDiscriminatedUnion<"tar
|
|
|
858
858
|
}>>;
|
|
859
859
|
}, "strict", z.ZodTypeAny, {
|
|
860
860
|
target: "config_metric_selector";
|
|
861
|
-
controlId: string;
|
|
862
861
|
mapping: Record<string, z.objectOutputType<{
|
|
863
862
|
id: z.ZodString;
|
|
864
863
|
name: z.ZodString;
|
|
@@ -934,10 +933,10 @@ export declare const controlBindingExecutionSchema: z.ZodDiscriminatedUnion<"tar
|
|
|
934
933
|
id: string;
|
|
935
934
|
kind: "matrix_instance";
|
|
936
935
|
}>;
|
|
936
|
+
controlId: string;
|
|
937
937
|
matrixTargetId?: string | undefined;
|
|
938
938
|
}, {
|
|
939
939
|
target: "config_metric_selector";
|
|
940
|
-
controlId: string;
|
|
941
940
|
mapping: Record<string, z.objectInputType<{
|
|
942
941
|
id: z.ZodString;
|
|
943
942
|
name: z.ZodString;
|
|
@@ -1013,6 +1012,7 @@ export declare const controlBindingExecutionSchema: z.ZodDiscriminatedUnion<"tar
|
|
|
1013
1012
|
id: string;
|
|
1014
1013
|
kind: "matrix_instance";
|
|
1015
1014
|
}>;
|
|
1015
|
+
controlId: string;
|
|
1016
1016
|
matrixTargetId?: string | undefined;
|
|
1017
1017
|
}>, z.ZodObject<{
|
|
1018
1018
|
controlId: z.ZodString;
|
|
@@ -1526,7 +1526,6 @@ export declare const controlBindingExecutionSchema: z.ZodDiscriminatedUnion<"tar
|
|
|
1526
1526
|
}>>;
|
|
1527
1527
|
}, "strict", z.ZodTypeAny, {
|
|
1528
1528
|
target: "config_field_selector";
|
|
1529
|
-
controlId: string;
|
|
1530
1529
|
mapping: Record<string, z.objectOutputType<{
|
|
1531
1530
|
id: z.ZodString;
|
|
1532
1531
|
name: z.ZodString;
|
|
@@ -1601,10 +1600,10 @@ export declare const controlBindingExecutionSchema: z.ZodDiscriminatedUnion<"tar
|
|
|
1601
1600
|
id: string;
|
|
1602
1601
|
kind: "matrix_instance";
|
|
1603
1602
|
}>;
|
|
1603
|
+
controlId: string;
|
|
1604
1604
|
matrixTargetId?: string | undefined;
|
|
1605
1605
|
}, {
|
|
1606
1606
|
target: "config_field_selector";
|
|
1607
|
-
controlId: string;
|
|
1608
1607
|
mapping: Record<string, z.objectInputType<{
|
|
1609
1608
|
id: z.ZodString;
|
|
1610
1609
|
name: z.ZodString;
|
|
@@ -1679,6 +1678,7 @@ export declare const controlBindingExecutionSchema: z.ZodDiscriminatedUnion<"tar
|
|
|
1679
1678
|
id: string;
|
|
1680
1679
|
kind: "matrix_instance";
|
|
1681
1680
|
}>;
|
|
1681
|
+
controlId: string;
|
|
1682
1682
|
matrixTargetId?: string | undefined;
|
|
1683
1683
|
}>, z.ZodObject<{
|
|
1684
1684
|
controlId: z.ZodString;
|
|
@@ -1687,13 +1687,13 @@ export declare const controlBindingExecutionSchema: z.ZodDiscriminatedUnion<"tar
|
|
|
1687
1687
|
mapping: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, Record<string, string>>;
|
|
1688
1688
|
}, "strict", z.ZodTypeAny, {
|
|
1689
1689
|
target: "config_aggregation";
|
|
1690
|
-
controlId: string;
|
|
1691
1690
|
mapping: Record<string, string>;
|
|
1691
|
+
controlId: string;
|
|
1692
1692
|
matrixTargetId?: string | undefined;
|
|
1693
1693
|
}, {
|
|
1694
1694
|
target: "config_aggregation";
|
|
1695
|
-
controlId: string;
|
|
1696
1695
|
mapping: Record<string, string>;
|
|
1696
|
+
controlId: string;
|
|
1697
1697
|
matrixTargetId?: string | undefined;
|
|
1698
1698
|
}>, z.ZodObject<{
|
|
1699
1699
|
controlId: z.ZodString;
|
|
@@ -1702,13 +1702,13 @@ export declare const controlBindingExecutionSchema: z.ZodDiscriminatedUnion<"tar
|
|
|
1702
1702
|
mapping: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, Record<string, string>>;
|
|
1703
1703
|
}, "strict", z.ZodTypeAny, {
|
|
1704
1704
|
target: "config_grain";
|
|
1705
|
-
controlId: string;
|
|
1706
1705
|
mapping: Record<string, string>;
|
|
1706
|
+
controlId: string;
|
|
1707
1707
|
matrixTargetId?: string | undefined;
|
|
1708
1708
|
}, {
|
|
1709
1709
|
target: "config_grain";
|
|
1710
|
-
controlId: string;
|
|
1711
1710
|
mapping: Record<string, string>;
|
|
1711
|
+
controlId: string;
|
|
1712
1712
|
matrixTargetId?: string | undefined;
|
|
1713
1713
|
}>, z.ZodObject<{
|
|
1714
1714
|
controlId: z.ZodString;
|
|
@@ -21,6 +21,13 @@ export type NormalizeDashboardInputsResult = {
|
|
|
21
21
|
inputs: NormalizedDashboardInput[];
|
|
22
22
|
issues: DashboardFilterMappingContractIssue[];
|
|
23
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* The one table of allowed scope and runtime-scope combinations (one filter
|
|
26
|
+
* model SPEC 4.2). A per-tab value lives on every tab the input is shown on
|
|
27
|
+
* (`isDashboardInputOnTab`), so a `cards` scope may keep per-tab values.
|
|
28
|
+
*/
|
|
29
|
+
export declare const DASHBOARD_INPUT_RUNTIME_SCOPE_KINDS: Readonly<Record<DashboardInput['runtimeScope'], ReadonlyArray<DashboardInput['scope']['kind']>>>;
|
|
30
|
+
export declare function isAllowedDashboardInputScopeCombination(runtimeScope: DashboardInput['runtimeScope'], scopeKind: DashboardInput['scope']['kind']): boolean;
|
|
24
31
|
export declare function normalizeDashboardInputs({ inputs, dashboardFilters, cards, validateCardTargets, }: {
|
|
25
32
|
inputs: DashboardInput[] | unknown;
|
|
26
33
|
dashboardFilters: TFilter[] | undefined;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { DashboardInputBase, DashboardInputScope, NormalizedDashboardInput, TDashboard } from '../../lib/types/common-types.js';
|
|
2
|
+
import { DashboardInputRuntimeTarget } from '../../lib/dashboard-inputs/dashboard-input-values.js';
|
|
3
|
+
/**
|
|
4
|
+
* The scope rule (one filter model M2): the one interpreter of
|
|
5
|
+
* `DashboardInputScope`. Filters, controls, click-to-filter targets and
|
|
6
|
+
* carried contexts all decide "does this reach that card" here, on the client
|
|
7
|
+
* and on the server.
|
|
8
|
+
*/
|
|
9
|
+
export type ScopedDashboardInputTarget = DashboardInputRuntimeTarget & {
|
|
10
|
+
sheetKind?: 'dashboard' | 'document';
|
|
11
|
+
};
|
|
12
|
+
/** One tab, for "is this input shown in this tab's filter bar". */
|
|
13
|
+
export type DashboardTabTarget = {
|
|
14
|
+
sheetId: string;
|
|
15
|
+
sheetKind: 'dashboard' | 'document';
|
|
16
|
+
/** Every card on the tab: sheet cards, frame cards, section cards. */
|
|
17
|
+
cardIds: ReadonlySet<string>;
|
|
18
|
+
};
|
|
19
|
+
/** Does the input apply to this card, section or tab? */
|
|
20
|
+
export declare function doesDashboardInputApplyToTarget(input: Pick<DashboardInputBase, 'scope' | 'compatibility'>, target: ScopedDashboardInputTarget): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Is the input shown in this tab's filter bar? True when it applies to the
|
|
23
|
+
* tab itself, or to any card on it (a `cards` scope), or, for a
|
|
24
|
+
* `documentSections` scope, when the tab is that Document tab. "The tabs of
|
|
25
|
+
* a per-tab input" always means the tabs where this holds.
|
|
26
|
+
*/
|
|
27
|
+
export declare function isDashboardInputOnTab(input: Pick<DashboardInputBase, 'scope' | 'compatibility'>, tab: DashboardTabTarget): boolean;
|
|
28
|
+
/** The tab targets of a dashboard, by sheet id, memoized per dashboard object. */
|
|
29
|
+
export declare function listDashboardTabTargets(dashboard: Pick<TDashboard, 'sheets'>): ReadonlyMap<string, DashboardTabTarget>;
|
|
30
|
+
/**
|
|
31
|
+
* Every tab, card and Document section an input reaches, as keys
|
|
32
|
+
* (`sheet:<id>`, `card:<id>`, `section:<id>`). A section card is evaluated
|
|
33
|
+
* with its section, as the runtime resolves it. Two inputs overlap when their
|
|
34
|
+
* keys intersect: the one reach behind the overlap rules of filter settings
|
|
35
|
+
* and of the app's save validation (aliases, backing control ids).
|
|
36
|
+
*/
|
|
37
|
+
export declare function listDashboardInputReachKeys(dashboard: Pick<TDashboard, 'sheets'>, input: Pick<DashboardInputBase, 'scope' | 'compatibility'>): Set<string>;
|
|
38
|
+
/**
|
|
39
|
+
* Whether a filter input still applies when a carried context turns the
|
|
40
|
+
* dashboard's own filters off (`resolveContextAwareFilterPolicy`): a filter
|
|
41
|
+
* scoped to specific cards does, a toolbar filter included, and so do the
|
|
42
|
+
* cards' inline filters, which are scoped to their card (SP-12). A mapping
|
|
43
|
+
* never changes the scope, so attaching one never changes survival. The one
|
|
44
|
+
* rule for the compiler, the mapping resolver, the required check and any
|
|
45
|
+
* reader that says which filters a view applies.
|
|
46
|
+
*/
|
|
47
|
+
export declare function doesDashboardInputSurviveCarriedContext(input: Pick<NormalizedDashboardInput, 'kind' | 'scope'>): boolean;
|
|
48
|
+
export type DashboardInputScopeIdChange = {
|
|
49
|
+
removedSheetIds?: ReadonlySet<string>;
|
|
50
|
+
removedCardIds?: ReadonlySet<string>;
|
|
51
|
+
/**
|
|
52
|
+
* Ids given new ids: a card renamed in place, a library visual's ids on its
|
|
53
|
+
* dashboard instance, an authoring plan's ids on the cards it produced. An
|
|
54
|
+
* id the map does not list stays.
|
|
55
|
+
*/
|
|
56
|
+
renamedSheetIds?: ReadonlyMap<string, string>;
|
|
57
|
+
renamedCardIds?: ReadonlyMap<string, string>;
|
|
58
|
+
renamedSectionIds?: ReadonlyMap<string, string>;
|
|
59
|
+
/**
|
|
60
|
+
* `renamedCardIds` lists every card that is kept: a card id it does not
|
|
61
|
+
* list is removed (an authoring plan compiled into cards, some skipped).
|
|
62
|
+
*/
|
|
63
|
+
keepOnlyRenamedCardIds?: boolean;
|
|
64
|
+
copiedTab?: {
|
|
65
|
+
/**
|
|
66
|
+
* 'replace': a filter copied with the tab; every listed id of the copied
|
|
67
|
+
* tab and its cards becomes its copy's id. 'extend': a filter shared with
|
|
68
|
+
* the copy; every listed id stays and its copy's id is added next to it.
|
|
69
|
+
*/
|
|
70
|
+
mode: 'replace' | 'extend';
|
|
71
|
+
sheetIds: ReadonlyMap<string, string>;
|
|
72
|
+
cardIds: ReadonlyMap<string, string>;
|
|
73
|
+
sectionIds: ReadonlyMap<string, string>;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Rewrites the ids a scope names, in the positive lists and both except
|
|
78
|
+
* lists: after tabs or cards are removed, ids are renamed, or a tab is
|
|
79
|
+
* duplicated. The one rewrite of a scope's ids, for inputs and for click to
|
|
80
|
+
* filter targets alike. Lists may become empty; whether an input with an
|
|
81
|
+
* empty scope is kept is the caller's existing rule. Returns the same scope
|
|
82
|
+
* object when nothing changed.
|
|
83
|
+
*/
|
|
84
|
+
export declare function rewriteDashboardInputScopeIds(scope: DashboardInputScope, change: DashboardInputScopeIdChange): DashboardInputScope;
|
|
85
|
+
/**
|
|
86
|
+
* Whether a tab owns an input, so deleting the tab deletes it: its scope
|
|
87
|
+
* names only that tab, only cards on it, or its Document sections. Scope
|
|
88
|
+
* owns an input's lifetime; runtimeScope only owns its value slots.
|
|
89
|
+
*/
|
|
90
|
+
export declare function isDashboardInputOwnedBySheet(scope: DashboardInputScope, sheetId: string, cardIds: ReadonlySet<string>): boolean;
|
|
91
|
+
/** Whether a scope reaches nothing: an empty tab or card list (after ids are removed). */
|
|
92
|
+
export declare function isDashboardInputScopeEmpty(scope: DashboardInputScope): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TFilterValue } from '../../../components/surfboard/filter/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Whether an ad-hoc value belongs to a tab: its id ends with the tab id. With
|
|
4
|
+
* no current tab, no ad-hoc value applies. The one owner of this rule (one
|
|
5
|
+
* filter model SPEC 5.8, P4a-02): the compile, the filter option lists, the
|
|
6
|
+
* summary request and the filter value list call it.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isAdHocFilterValueOnTab(filterId: string, sheetId: string | null | undefined): boolean;
|
|
9
|
+
/** The ad-hoc values of one tab, in list order. */
|
|
10
|
+
export declare function listAdHocFilterValuesOnTab(adHocFilterValues: readonly TFilterValue[] | undefined, sheetId: string | null | undefined): TFilterValue[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TFilter } from '../../../components/surfboard/filter/types.js';
|
|
2
|
+
import { NormalizedFilterDashboardInput, TDashboard } from '../../../lib/types/common-types.js';
|
|
3
|
+
import { FilterInputEntry } from './read-dashboard-filter-model.js';
|
|
4
|
+
/** One definition per filter input, in model order. The same array for the same dashboard object. */
|
|
5
|
+
export declare function listDashboardFilterDefinitions(dashboard: TDashboard): readonly TFilter[];
|
|
6
|
+
/** The dashboard's Global Date filter, whichever input holds it. */
|
|
7
|
+
export declare function getDashboardGlobalDateFilter(dashboard: TDashboard): TFilter | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* The filter inputs the tab-presence rule places on a tab (M2), in model
|
|
10
|
+
* order: what the tab's filter bar shows. `sheetKind` overrides the tab's
|
|
11
|
+
* own kind. None for an unknown tab.
|
|
12
|
+
*/
|
|
13
|
+
export declare function listDashboardFilterInputsOnTab(dashboard: TDashboard, sheetId: string | null | undefined, sheetKind?: 'dashboard' | 'document'): readonly FilterInputEntry[];
|
|
14
|
+
/**
|
|
15
|
+
* A filter hidden from the toolbar and not attached to a visual: a toolbar
|
|
16
|
+
* filter's `hide`, or an input placed `hidden` (OF-D14). The edit-mode strip
|
|
17
|
+
* of hidden filters lists these.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isHiddenFilterInput(input: NormalizedFilterDashboardInput): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Every filter definition the stored template holds, as stored: toolbar
|
|
22
|
+
* filters, stored inputs' filters and prototype Document inputs' filters,
|
|
23
|
+
* rejected inputs included (the model leaves those out). The objects
|
|
24
|
+
* themselves, so a writer of the stored shape (a migration's remap, a demo
|
|
25
|
+
* copy) rewrites them in place on its own copy, and a reader that must see
|
|
26
|
+
* every stored definition (the connections a migration maps) sees what the
|
|
27
|
+
* remap writes (one filter model P4b-02 (f)).
|
|
28
|
+
*/
|
|
29
|
+
export declare function listStoredFilterDefinitions(dashboard: TDashboard): TFilter[];
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { TFilter, TFilterValue } from '../../../components/surfboard/filter/types.js';
|
|
2
|
+
import { DashboardInputValues, NormalizedFilterDashboardInput, TDashboard } from '../../../lib/types/common-types.js';
|
|
3
|
+
import { CalendarContext } from '../../report-runtime-context/index.js';
|
|
4
|
+
import { DashboardInputRuntimeTarget } from '../../../lib/dashboard-inputs/dashboard-input-values.js';
|
|
5
|
+
import { DashboardInputRuntimeValues } from '../../../lib/dashboard-inputs/resolve-dashboard-input-context.js';
|
|
6
|
+
/**
|
|
7
|
+
* M5, the filter value adapters (one filter model SPEC 4.7): they move values
|
|
8
|
+
* between the old filter value list, keyed by `filterId`, and input slots.
|
|
9
|
+
* They decide no precedence.
|
|
10
|
+
*/
|
|
11
|
+
/** A host filter default: a full filter value, or the short `{ filterId, values }` embed form. */
|
|
12
|
+
export type HostFilterValue = TFilterValue | {
|
|
13
|
+
readonly filterId: string;
|
|
14
|
+
readonly values: string[] | number[];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A host value as a filter value of this definition (today's hydration rule).
|
|
18
|
+
* The short embed form names no operation: it takes the filter's own, so the
|
|
19
|
+
* slot passes the input's validation (ledger P4a-03).
|
|
20
|
+
*/
|
|
21
|
+
export declare function hostFilterValueFor(filter: TFilter, hostValue: HostFilterValue, calendar: CalendarContext | null | undefined): TFilterValue;
|
|
22
|
+
/**
|
|
23
|
+
* Host overlay in: each value goes to the input owning its `filterId`, as a
|
|
24
|
+
* runtime slot over saved defaults. A `shared` input gets one slot; a
|
|
25
|
+
* `perSheet` input gets one on every tab the input is on (a host default is
|
|
26
|
+
* dashboard-wide, as today). A value whose `filterId` owns no input, or
|
|
27
|
+
* whose input holds one value per card or section, is dropped and listed.
|
|
28
|
+
* The values that own no input are also returned as they were listed: the
|
|
29
|
+
* caller decides whether they are ad-hoc values (SPEC 5.8, 5.9).
|
|
30
|
+
*/
|
|
31
|
+
export declare function hostFilterValuesToSlots(dashboard: TDashboard, values: readonly HostFilterValue[] | undefined, options: {
|
|
32
|
+
calendar: CalendarContext | null | undefined;
|
|
33
|
+
}): {
|
|
34
|
+
slots: DashboardInputValues;
|
|
35
|
+
adHocFilterValues: TFilterValue[];
|
|
36
|
+
droppedFilterIds: string[];
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* List out, tab-wide: each filter shown on this tab with its effective value
|
|
40
|
+
* (the inputs the tab-presence rule places on it, in model order, each
|
|
41
|
+
* through the hydration owner), followed by the tab's ad-hoc values. Inputs
|
|
42
|
+
* with no value, or cleared, are left out. Used by `onFilterValuesChange`,
|
|
43
|
+
* captures and every reader that reports a tab's filters.
|
|
44
|
+
*/
|
|
45
|
+
export declare function readFilterValueList(params: {
|
|
46
|
+
dashboard: TDashboard;
|
|
47
|
+
runtimeValues: Pick<DashboardInputRuntimeValues, 'dashboardInputValues'>;
|
|
48
|
+
adHocFilterValues: readonly TFilterValue[] | undefined;
|
|
49
|
+
sheetId: string | null | undefined;
|
|
50
|
+
sheetKind: 'dashboard' | 'document';
|
|
51
|
+
calendar: CalendarContext | null;
|
|
52
|
+
}): TFilterValue[];
|
|
53
|
+
/**
|
|
54
|
+
* Every runtime target a filter input holds a value at: one for a `shared`
|
|
55
|
+
* input, each tab it is on for `perSheet`, each card it reaches for
|
|
56
|
+
* `perCard`, each section it reaches for `perDocumentSection`.
|
|
57
|
+
*/
|
|
58
|
+
export declare function listFilterInputValueTargets(dashboard: TDashboard, input: NormalizedFilterDashboardInput): DashboardInputRuntimeTarget[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './read-dashboard-filter-model.js';
|
|
2
|
+
export * from './toolbar-filter-reach.js';
|
|
3
|
+
export { foldPrototypeDocumentInputs } from './prototype-document-inputs.js';
|
|
4
|
+
export * from './filter-values.js';
|
|
5
|
+
export * from './filter-definitions.js';
|
|
6
|
+
export * from './ad-hoc-filter-values.js';
|
|
7
|
+
export { upgradeToStoredDashboard } from './stored-dashboard.js';
|