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
package/dist/surfboard/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a, R as s, D as o } from "../chunks/report-preferences-dialog-
|
|
1
|
+
import { a, R as s, D as o } from "../chunks/report-preferences-dialog-DUtuUL_5.js";
|
|
2
2
|
import { C as f, E as D } from "../chunks/table-settings-CLZocegs.js";
|
|
3
3
|
export {
|
|
4
4
|
f as CONTROL_CARD_DEFAULT_VALUE,
|
|
@@ -4,7 +4,7 @@ import { BriefingAttachmentFormat } from './index.js';
|
|
|
4
4
|
* RA-D14). The app decides the code and writes the customer line; the run
|
|
5
5
|
* card reads both back from the run.
|
|
6
6
|
*/
|
|
7
|
-
export declare const BRIEFING_ATTACHMENT_OMISSION_CODES: readonly ["PDF_ROW_LIMIT_EXCEEDED", "PDF_SIZE_LIMIT_EXCEEDED", "TABLE_COMPLETENESS_UNVERIFIED", "CARD_QUERY_FAILED", "RENDER_NOT_READY", "RENDER_TIMED_OUT", "EXPORT_JOB_FAILED", "ATTACHMENT_UNAVAILABLE", "EXCEL_LIMIT_EXCEEDED", "EXPORT_ROW_LIMIT_EXCEEDED", "EXPORT_COUNT_UNAVAILABLE", "EXPORT_NO_ROWS"];
|
|
7
|
+
export declare const BRIEFING_ATTACHMENT_OMISSION_CODES: readonly ["PDF_ROW_LIMIT_EXCEEDED", "PDF_SIZE_LIMIT_EXCEEDED", "TABLE_COMPLETENESS_UNVERIFIED", "CARD_QUERY_FAILED", "RENDER_NOT_READY", "RENDER_TIMED_OUT", "EXPORT_JOB_FAILED", "ATTACHMENT_UNAVAILABLE", "EXCEL_LIMIT_EXCEEDED", "EXPORT_ROW_LIMIT_EXCEEDED", "EXPORT_COUNT_UNAVAILABLE", "EXPORT_NO_ROWS", "IMAGE_TOO_LARGE"];
|
|
8
8
|
export type BriefingAttachmentOmissionCode = (typeof BRIEFING_ATTACHMENT_OMISSION_CODES)[number];
|
|
9
9
|
/** One left-out attachment, as recorded on the run and read by every channel. */
|
|
10
10
|
export type BriefingOmittedAttachment = {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BriefingAttachment, BriefingAttachmentFormat } from './index.js';
|
|
2
|
+
import { ExportFileFormat } from '../shared/format-utils/exporters/export-file-format.js';
|
|
2
3
|
import { TCard } from '../lib/types/common-types.js';
|
|
3
4
|
export type BriefingCardAttachmentCapability = {
|
|
4
5
|
formats: BriefingAttachmentFormat[];
|
|
@@ -11,19 +12,45 @@ export declare function getBriefingCardAttachmentCapability(card: TCard): Briefi
|
|
|
11
12
|
* every row up to the export cap.
|
|
12
13
|
*/
|
|
13
14
|
export declare function isBriefingTableExportCardType(cardType: string | undefined): boolean;
|
|
15
|
+
/** How a run makes an attachment (PNG exports SPEC §2.7). */
|
|
16
|
+
export type BriefingAttachmentProduction =
|
|
17
|
+
/** Drawn by the renderer from the print view (PDF, PNG, and CSV of a card that is not a table or Matrix). */
|
|
18
|
+
{
|
|
19
|
+
kind: 'rendered';
|
|
20
|
+
format: 'pdf' | 'png' | 'csv';
|
|
21
|
+
}
|
|
22
|
+
/** A Matrix card's PDF, built from the Matrix capture. */
|
|
23
|
+
| {
|
|
24
|
+
kind: 'matrix_pdf';
|
|
25
|
+
}
|
|
26
|
+
/** A background export job: CSV and Excel of Table, Detail Table and Matrix cards. */
|
|
27
|
+
| {
|
|
28
|
+
kind: 'export_job';
|
|
29
|
+
format: ExportFileFormat;
|
|
30
|
+
};
|
|
14
31
|
/**
|
|
15
|
-
*
|
|
16
|
-
* (
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
32
|
+
* How the run makes this attachment. The only place that decides it: a PNG
|
|
33
|
+
* is always rendered (a Matrix PNG too), a Matrix PDF comes from the Matrix
|
|
34
|
+
* capture, and a data file (CSV or Excel) of a Matrix with its capture, a
|
|
35
|
+
* Table or a Detail Table is a background export job (Excel exports SPEC
|
|
36
|
+
* §3.4, §3.5). Read by preparation, release, delivery access, the page route
|
|
37
|
+
* and the renderer adapter alike, so they always agree.
|
|
20
38
|
*/
|
|
39
|
+
export declare function briefingAttachmentProduction(attachment: BriefingAttachment): BriefingAttachmentProduction;
|
|
40
|
+
/** Attachments a background export job makes before a run is finalized. */
|
|
21
41
|
export declare function briefingAttachmentNeedsExportJob(attachment: BriefingAttachment): boolean;
|
|
42
|
+
export type BriefingAttachmentFileTraits = {
|
|
43
|
+
label: string;
|
|
44
|
+
extension: string;
|
|
45
|
+
contentType: string;
|
|
46
|
+
};
|
|
47
|
+
/** An attachment file's name, extension and content type: rendered files and data files have one owner each. */
|
|
48
|
+
export declare function briefingAttachmentFileTraits(format: BriefingAttachmentFormat): BriefingAttachmentFileTraits;
|
|
22
49
|
export declare function getBriefingCardAttachmentFormats(input: {
|
|
23
50
|
cardType: string;
|
|
24
51
|
allowDownload?: boolean;
|
|
25
52
|
}): BriefingAttachmentFormat[];
|
|
26
|
-
/** The name customers read for an attachment format: PDF, CSV or Excel. */
|
|
53
|
+
/** The name customers read for an attachment format: PDF, PNG image, CSV or Excel. */
|
|
27
54
|
export declare function briefingAttachmentFormatLabel(format: BriefingAttachmentFormat): string;
|
|
28
55
|
export declare function getDefaultBriefingCardAttachmentFormat(input: {
|
|
29
56
|
cardType: string;
|
|
@@ -2,11 +2,10 @@ import { NumericCanonicalFormat, NumericPresentationTarget, PresentationExecutio
|
|
|
2
2
|
import { BriefingAppearanceSpec, BriefingFragments, BriefingThemeOverrides } from './presentation-contract.js';
|
|
3
3
|
import { MatrixConfig } from '../shared/analytics-protocol/index.js';
|
|
4
4
|
import { CsvEncoding } from '../shared/format-utils/exporters/csv-utils.js';
|
|
5
|
-
import { ExportFileFormat } from '../shared/format-utils/exporters/export-file-format.js';
|
|
6
5
|
export { captureMatrixExport, buildMatrixDeliveryEnvelope, matrixDeliveryPayloadSchema, matrixDeliveryQuerySchema, type MatrixLayoutReadResult } from '../shared/dashboard-authoring/matrix-delivery.js';
|
|
7
6
|
export declare const BRIEFING_KIND: "BRIEFING";
|
|
8
7
|
export { DEFAULT_BRIEFING_SCHEDULE, briefingScheduleMonths, briefingScheduleDayOccurs, briefingScheduleShortMonths, buildBriefingScheduleExpr, canonicalBriefingMonthDays, describeBriefingSchedule, isValidBriefingTimezone, nextBriefingScheduleDates, parseBriefingScheduleExpr, type BriefingScheduleFrequency, type BriefingScheduleMonthDay, type BriefingScheduleMonthInterval, type BriefingScheduleMonthlyOn, type BriefingScheduleOrdinal, type BriefingScheduleViewModel, } from './schedule.js';
|
|
9
|
-
export { briefingAttachmentFormatLabel, briefingAttachmentNeedsExportJob, getBriefingCardAttachmentCapability, getBriefingCardAttachmentFormats, getDefaultBriefingCardAttachmentFormat, isBriefingTableExportCardType, type BriefingCardAttachmentCapability, } from './attachments.js';
|
|
8
|
+
export { briefingAttachmentFileTraits, briefingAttachmentFormatLabel, briefingAttachmentNeedsExportJob, briefingAttachmentProduction, type BriefingAttachmentFileTraits, type BriefingAttachmentProduction, getBriefingCardAttachmentCapability, getBriefingCardAttachmentFormats, getDefaultBriefingCardAttachmentFormat, isBriefingTableExportCardType, type BriefingCardAttachmentCapability, } from './attachments.js';
|
|
10
9
|
export { BRIEFING_ATTACHMENT_OMISSION_CODES, isBriefingAttachmentOmissionCode, readBriefingOmittedAttachments, type BriefingAttachmentOmissionCode, type BriefingOmittedAttachment, } from './attachment-outcomes.js';
|
|
11
10
|
export { canCreateBriefingForUser, type BriefingUiUser } from './capabilities.js';
|
|
12
11
|
export { getBriefingCreationIntents, type BriefingAuthorIntent, } from './creation.js';
|
|
@@ -167,8 +166,9 @@ export type BriefingContentDocument = {
|
|
|
167
166
|
summary?: string;
|
|
168
167
|
blocks: BriefingContentBlock[];
|
|
169
168
|
};
|
|
170
|
-
/** A rendered PDF, or a data file (CSV or Excel)
|
|
171
|
-
export
|
|
169
|
+
/** A rendered PDF or PNG image, or a data file (CSV or Excel, `ExportFileFormat`). */
|
|
170
|
+
export declare const BRIEFING_ATTACHMENT_FORMATS: readonly ["pdf", "png", "csv", "xlsx"];
|
|
171
|
+
export type BriefingAttachmentFormat = (typeof BRIEFING_ATTACHMENT_FORMATS)[number];
|
|
172
172
|
export type BriefingPdfPageSize = 'letter' | 'legal' | 'a4' | 'a3' | 'tabloid';
|
|
173
173
|
export type BriefingPdfOrientation = 'portrait' | 'landscape';
|
|
174
174
|
export type BriefingCsvDelimiter = ',' | ';' | '\t';
|
|
@@ -222,7 +222,8 @@ export type BriefingAttachment = (BriefingAttachmentBase & {
|
|
|
222
222
|
type: 'dashboard_sheet';
|
|
223
223
|
dashboardId: string;
|
|
224
224
|
sheetId: string;
|
|
225
|
-
|
|
225
|
+
/** A sheet prints as a PDF or a PNG image of the whole sheet. */
|
|
226
|
+
format: 'pdf' | 'png';
|
|
226
227
|
}) | (BriefingAttachmentBase & {
|
|
227
228
|
type: 'document_sheet';
|
|
228
229
|
dashboardId: string;
|
|
@@ -45,13 +45,6 @@ export type FixedDayDefaultDateFilter = {
|
|
|
45
45
|
date: string;
|
|
46
46
|
};
|
|
47
47
|
export type DefaultDateFilter = RelativeDateFilter | FixedMonthDefaultDateFilter | FixedDayDefaultDateFilter;
|
|
48
|
-
/**
|
|
49
|
-
* Display mode for individual filters
|
|
50
|
-
* - 'canvas': Filter displayed as a draggable card on the dashboard canvas
|
|
51
|
-
* - 'toolbar': Filter displayed in the compact toolbar
|
|
52
|
-
* - 'inherit': Use the dashboard's filterLayout.displayMode setting (default)
|
|
53
|
-
*/
|
|
54
|
-
export type FilterDisplayMode = 'canvas' | 'toolbar' | 'inherit';
|
|
55
48
|
export type FilterKind = 'field' | 'global-date';
|
|
56
49
|
/**
|
|
57
50
|
* Target column configuration for multi-field filters.
|
|
@@ -133,13 +126,6 @@ export type TFilter = {
|
|
|
133
126
|
* Defaults vary by filter type (160px for dropdowns, 220px for date ranges, etc.)
|
|
134
127
|
*/
|
|
135
128
|
toolbarWidth?: number;
|
|
136
|
-
/**
|
|
137
|
-
* Display mode for this filter
|
|
138
|
-
* - 'canvas': Always show as draggable card on canvas
|
|
139
|
-
* - 'toolbar': Always show in toolbar
|
|
140
|
-
* - 'inherit': Use dashboard's filterLayout.displayMode setting (default)
|
|
141
|
-
*/
|
|
142
|
-
displayMode?: FilterDisplayMode;
|
|
143
129
|
};
|
|
144
130
|
export type Operation = '=' | '>' | '<' | '>=' | '<=' | '!=' | 'in' | 'not in' | 'like' | 'not like' | 'between' | 'not between' | 'is null' | 'is not null';
|
|
145
131
|
type BaseFilter = {
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { TFilter } from '../../components/surfboard/filter/types.js';
|
|
2
|
-
import { DashboardInputScope,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { DashboardInputScope, TCard, TDashboard } from '../types/common-types.js';
|
|
3
|
+
import { DashboardFilterApplication, DashboardFilterCardApplication, DashboardFilterTarget, DashboardFilterTargetField } from '../../shared/dashboard-authoring/index.js';
|
|
4
|
+
import { FilterRef, ReachedCard } from '../../shared/dashboard-authoring/filter-model/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Filter mapping (one filter model M3, SPEC 4.4): the Cards tab of any filter
|
|
7
|
+
* input. `draftDashboardFilterMapping` builds the rows from the cards the
|
|
8
|
+
* input reaches and, with them, exactly what Accept would save. Pure.
|
|
9
|
+
*/
|
|
5
10
|
export type DashboardFilterMappingCandidateCatalog = {
|
|
6
11
|
status: 'ready';
|
|
7
12
|
targets: DashboardFilterTarget[];
|
|
@@ -18,7 +23,13 @@ export type DashboardFilterMappingDraftDecision = {
|
|
|
18
23
|
export type DashboardFilterMappingDraftStatus = 'pendingSource' | 'automatic' | 'suggested' | 'needsMapping' | 'mapped' | 'notApplicable' | 'excluded' | 'invalidMapping' | 'metadataUnavailable';
|
|
19
24
|
export type DashboardFilterMappingDraftRow = {
|
|
20
25
|
cardId: string;
|
|
26
|
+
/** The panel reads the title and meta line from it. */
|
|
27
|
+
card: TCard;
|
|
21
28
|
sheetId: string;
|
|
29
|
+
sheetKind: 'dashboard' | 'document';
|
|
30
|
+
sectionId?: string;
|
|
31
|
+
/** The section's title, for a card in a Document section. */
|
|
32
|
+
sectionTitle?: string;
|
|
22
33
|
executionKind: 'config' | 'sql' | 'unconfigured';
|
|
23
34
|
status: DashboardFilterMappingDraftStatus;
|
|
24
35
|
candidates: DashboardFilterTarget[];
|
|
@@ -28,27 +39,28 @@ export type DashboardFilterMappingDraftRow = {
|
|
|
28
39
|
guidanceMessage?: string;
|
|
29
40
|
automaticFieldName?: string;
|
|
30
41
|
};
|
|
31
|
-
export type
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
kind: 'allSheets' | 'sheets';
|
|
36
|
-
}>;
|
|
42
|
+
export type DashboardFilterMappingGroup = {
|
|
43
|
+
sheetId: string;
|
|
44
|
+
sheetTitle: string;
|
|
45
|
+
sheetKind: 'dashboard' | 'document';
|
|
37
46
|
rows: DashboardFilterMappingDraftRow[];
|
|
38
47
|
};
|
|
39
|
-
export type
|
|
40
|
-
export type
|
|
41
|
-
code:
|
|
48
|
+
export type DashboardFilterMappingIssueCode = 'inputNotFound' | 'globalDateUnsupported' | 'unsupportedOuterScope' | 'unsupportedRuntimeScope' | 'missingDecision' | 'invalidTarget' | 'metadataUnavailable';
|
|
49
|
+
export type DashboardFilterMappingIssue = {
|
|
50
|
+
code: DashboardFilterMappingIssueCode;
|
|
42
51
|
message: string;
|
|
43
|
-
|
|
52
|
+
ref: FilterRef;
|
|
53
|
+
/** Set once the ref resolved. */
|
|
54
|
+
inputId?: string;
|
|
44
55
|
cardId?: string;
|
|
45
56
|
};
|
|
46
|
-
|
|
57
|
+
/** What Accept would save, computed with the rows. */
|
|
58
|
+
export type DashboardFilterMappingAcceptance = {
|
|
47
59
|
ok: true;
|
|
48
|
-
|
|
60
|
+
application: DashboardFilterApplication;
|
|
49
61
|
} | {
|
|
50
62
|
ok: false;
|
|
51
|
-
issues:
|
|
63
|
+
issues: DashboardFilterMappingIssue[];
|
|
52
64
|
};
|
|
53
65
|
export type DashboardFilterMappingStatusSummary = {
|
|
54
66
|
coveredCount: number;
|
|
@@ -57,65 +69,58 @@ export type DashboardFilterMappingStatusSummary = {
|
|
|
57
69
|
invalidCount: number;
|
|
58
70
|
attentionCount: number;
|
|
59
71
|
};
|
|
60
|
-
|
|
61
|
-
* One presentation-neutral projection of authoritative Cards-tab rows.
|
|
62
|
-
* Consumers must not independently reinterpret draft statuses when deciding
|
|
63
|
-
* whether an author needs to act.
|
|
64
|
-
*/
|
|
65
|
-
export declare function summarizeDashboardFilterMappingRows(rows: DashboardFilterMappingDraftRow[]): DashboardFilterMappingStatusSummary;
|
|
66
|
-
export type DashboardFilterMappingAcceptanceResult = {
|
|
67
|
-
ok: true;
|
|
68
|
-
draft: DashboardFilterMappingDraft;
|
|
69
|
-
input: ReferencedFilterDashboardInput;
|
|
70
|
-
} | {
|
|
71
|
-
ok: false;
|
|
72
|
-
draft?: DashboardFilterMappingDraft;
|
|
73
|
-
issues: DashboardFilterMappingAuthoringIssue[];
|
|
74
|
-
};
|
|
75
|
-
export type DashboardFilterMappingDisableResult = {
|
|
76
|
-
ok: true;
|
|
72
|
+
export type DashboardFilterMappingDraft = {
|
|
77
73
|
inputId: string;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
filterId: string;
|
|
75
|
+
/** The scope the rows were computed with: the staged scope, else the saved one. Accept never changes it (S-5). */
|
|
76
|
+
scope: Exclude<DashboardInputScope, {
|
|
77
|
+
kind: 'documentSections';
|
|
78
|
+
}>;
|
|
79
|
+
/** The cards the rows were built for; the catalogs hook fetches metadata for exactly these. */
|
|
80
|
+
cards: readonly ReachedCard[];
|
|
81
|
+
/** One group per reached tab, in dashboard tab order; rows in `cards` order. */
|
|
82
|
+
groups: DashboardFilterMappingGroup[];
|
|
83
|
+
summary: DashboardFilterMappingStatusSummary;
|
|
84
|
+
acceptance: DashboardFilterMappingAcceptance;
|
|
81
85
|
};
|
|
82
|
-
export type
|
|
86
|
+
export type DashboardFilterMappingDraftResult = {
|
|
83
87
|
ok: true;
|
|
84
|
-
|
|
85
|
-
created: boolean;
|
|
88
|
+
draft: DashboardFilterMappingDraft;
|
|
86
89
|
} | {
|
|
87
90
|
ok: false;
|
|
88
|
-
issues:
|
|
91
|
+
issues: DashboardFilterMappingIssue[];
|
|
89
92
|
};
|
|
90
|
-
export type
|
|
91
|
-
|
|
93
|
+
export type DashboardFilterMappingRequest = {
|
|
94
|
+
/** The filter. Chips pass `{ inputId }`, a toolbar filter's compatibility id included. */
|
|
95
|
+
ref: FilterRef;
|
|
96
|
+
/** The dashboard as saved. */
|
|
97
|
+
dashboard: TDashboard;
|
|
98
|
+
/** The definition being edited, if changed. */
|
|
99
|
+
stagedDefinition?: TFilter;
|
|
100
|
+
/** The scope being edited, if changed; otherwise the saved scope, unnarrowed (OF-D8). */
|
|
101
|
+
stagedScope?: DashboardInputScope;
|
|
92
102
|
candidatesByCardId: Record<string, DashboardFilterMappingCandidateCatalog | undefined>;
|
|
93
103
|
/** Grounded field that supplies the current filter value. */
|
|
94
104
|
selectionField?: Pick<DashboardFilterTargetField, 'name' | 'sourceField'> & Partial<Pick<DashboardFilterTargetField, 'source'>>;
|
|
95
105
|
/**
|
|
96
|
-
* Strictly proven identities eligible for Auto.
|
|
97
|
-
*
|
|
98
|
-
* explicit empty array is authoritative and must not fall back to a
|
|
99
|
-
* candidate-only selectionField source.
|
|
106
|
+
* Strictly proven identities eligible for Auto. An explicit empty array is
|
|
107
|
+
* authoritative and must not fall back to a candidate-only selectionField source.
|
|
100
108
|
*/
|
|
101
109
|
automaticSelectionSources?: DashboardFilterTargetField['source'][];
|
|
102
110
|
/** Datatype of the raw selection value, which may differ from the label. */
|
|
103
111
|
selectionDataType?: string;
|
|
104
|
-
/**
|
|
105
|
-
* Re-check saved targets against selectionField after the author changes
|
|
106
|
-
* the raw Option Value identity. Explicit draft decisions still win.
|
|
107
|
-
*/
|
|
112
|
+
/** Re-check saved targets after the option value field changed. */
|
|
108
113
|
revalidatePersistedTargets?: boolean;
|
|
109
114
|
decisionsByCardId?: Record<string, DashboardFilterMappingDraftDecision | undefined>;
|
|
110
|
-
/**
|
|
111
|
-
outerScope?: DashboardFilterMappingDraft['outerScope'];
|
|
112
|
-
/** Test seam; production callers use opaque random UUIDs. */
|
|
115
|
+
/** Test seam for new binding ids; production uses opaque random UUIDs. */
|
|
113
116
|
createId?: () => string;
|
|
114
117
|
};
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
118
|
+
/**
|
|
119
|
+
* One presentation-neutral projection of authoritative Cards-tab rows.
|
|
120
|
+
* Consumers must not independently reinterpret draft statuses when deciding
|
|
121
|
+
* whether an author needs to act.
|
|
122
|
+
*/
|
|
123
|
+
export declare function summarizeDashboardFilterMappingRows(rows: DashboardFilterMappingDraftRow[]): DashboardFilterMappingStatusSummary;
|
|
119
124
|
/**
|
|
120
125
|
* One Cards row for a source-qualified value field that is not a toolbar
|
|
121
126
|
* filter, such as a field a click carries. It is the same decision chain the
|
|
@@ -124,8 +129,11 @@ export declare function buildDashboardFilterMappingOuterScope(params: {
|
|
|
124
129
|
* authoring surface. Equality is the only operation a click applies.
|
|
125
130
|
*/
|
|
126
131
|
export declare function buildDashboardFilterMappingDraftRowForValueField(params: {
|
|
127
|
-
card:
|
|
132
|
+
card: TCard;
|
|
128
133
|
sheetId: string;
|
|
134
|
+
sheetKind: 'dashboard' | 'document';
|
|
135
|
+
sectionId?: string;
|
|
136
|
+
sectionTitle?: string;
|
|
129
137
|
valueField: DashboardFilterTargetField;
|
|
130
138
|
catalog: DashboardFilterMappingCandidateCatalog | undefined;
|
|
131
139
|
decision?: DashboardFilterMappingDraftDecision;
|
|
@@ -133,27 +141,5 @@ export declare function buildDashboardFilterMappingDraftRowForValueField(params:
|
|
|
133
141
|
/** Bindings already accepted elsewhere for this value field, offered as inherited matches. */
|
|
134
142
|
acceptedTargets?: DashboardFilterTarget[];
|
|
135
143
|
}): DashboardFilterMappingDraftRow;
|
|
136
|
-
/** The
|
|
137
|
-
export declare function
|
|
138
|
-
export declare function acceptDashboardFilterInputDraft(params: {
|
|
139
|
-
dashboard: Pick<TDashboard, 'filters' | 'sheets' | 'inputs'>;
|
|
140
|
-
updatedFilter: TFilter;
|
|
141
|
-
optionSource?: DashboardFilterOptionSource;
|
|
142
|
-
/** Option dependency policy to persist; omitted keeps the existing one. */
|
|
143
|
-
optionPolicy?: DashboardFilterOptionPolicy;
|
|
144
|
-
inputMetadata?: {
|
|
145
|
-
variableName?: string;
|
|
146
|
-
forceSelection?: boolean;
|
|
147
|
-
};
|
|
148
|
-
createId?: () => string;
|
|
149
|
-
}): DashboardFilterInputAcceptanceResult;
|
|
150
|
-
export declare function buildDashboardFilterMappingDraft(params: {
|
|
151
|
-
dashboard: Pick<TDashboard, 'filters' | 'sheets' | 'inputs'>;
|
|
152
|
-
request: DashboardFilterMappingAuthoringRequest;
|
|
153
|
-
}): DashboardFilterMappingDraftResult;
|
|
154
|
-
export declare function acceptDashboardFilterMappingDraft(params: {
|
|
155
|
-
dashboard: Pick<TDashboard, 'filters' | 'sheets' | 'inputs'>;
|
|
156
|
-
request: DashboardFilterMappingAuthoringRequest;
|
|
157
|
-
updatedFilter?: TFilter;
|
|
158
|
-
}): DashboardFilterMappingAcceptanceResult;
|
|
159
|
-
export declare function findMappedDashboardFilterInput(dashboard: Pick<TDashboard, 'inputs'>, filterId: string): ReferencedFilterDashboardInput | undefined;
|
|
144
|
+
/** The one entry point of M3 (SPEC 4.4). Pure. */
|
|
145
|
+
export declare function draftDashboardFilterMapping(request: DashboardFilterMappingRequest): DashboardFilterMappingDraftResult;
|
|
@@ -108,12 +108,4 @@ export declare function createExplicitDashboardInputTargetContext(params: {
|
|
|
108
108
|
controls?: DashboardInputTargetContext['controls'];
|
|
109
109
|
target?: NormalizedFilterDashboardInput;
|
|
110
110
|
}): DashboardInputTargetContext;
|
|
111
|
-
/**
|
|
112
|
-
* Applicability for option peers. A card-local or section-local target sees
|
|
113
|
-
* exactly what applies to it. A sheet-level target additionally sees the
|
|
114
|
-
* Inputs local to cards or sections on that sheet, the same rule the toolbar
|
|
115
|
-
* uses to decide what a sheet presents, so option narrowing and presentation
|
|
116
|
-
* agree on what "on this sheet" means.
|
|
117
|
-
*/
|
|
118
|
-
export declare function doesDashboardInputApplyToTargetScope(input: Pick<NormalizedDashboardInput, 'scope' | 'compatibility'>, scope: DashboardInputTargetScope, sheetLocalCardIds: ReadonlySet<string>): boolean;
|
|
119
111
|
export declare function describeInput(input: Pick<NormalizedDashboardInput, 'id' | 'label'> & Partial<Pick<NormalizedFilterDashboardInput, 'filter'>>): string;
|
|
@@ -18,8 +18,27 @@ export declare function setDashboardInputRuntimeSlot(values: DashboardInputValue
|
|
|
18
18
|
*/
|
|
19
19
|
export declare function materializeDashboardInputRuntimeSlot(input: NormalizedDashboardInput, slot: DashboardInputSlot | undefined): DashboardInputSlot | undefined;
|
|
20
20
|
export declare function removeDashboardInputRuntimeSlot(values: DashboardInputValues, input: Pick<DashboardInput, 'id' | 'runtimeScope'>, target: DashboardInputRuntimeTarget): DashboardInputValues;
|
|
21
|
+
/**
|
|
22
|
+
* Whether a filter input holds an active value on a tab, as its chip shows
|
|
23
|
+
* it: its slot for the tab, the saved default included. The one rule both
|
|
24
|
+
* filter bars (the toolbar and a Document's input bar) count and clear by
|
|
25
|
+
* for Clear all. It reads the slot directly, so a filter scoped to specific
|
|
26
|
+
* cards on the tab counts although it applies to no tab-level target.
|
|
27
|
+
*/
|
|
28
|
+
export declare function hasActiveFilterInputValueOnTab(params: {
|
|
29
|
+
dashboard: Pick<TDashboard, 'defaultInputValues' | 'defaultFilterValues'>;
|
|
30
|
+
input: NormalizedDashboardInput;
|
|
31
|
+
runtimeValues?: DashboardInputValues;
|
|
32
|
+
sheetId: string | null | undefined;
|
|
33
|
+
calendar: CalendarContext | null;
|
|
34
|
+
}): boolean;
|
|
21
35
|
export declare function hydrateAuthoredDashboardInputSlot(params: {
|
|
22
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Saved defaults come from the filter model (SPEC 5.2), so a toolbar
|
|
38
|
+
* filter's `defaultFilterValues` entry counts. A caller with only stored
|
|
39
|
+
* slot defaults may pass just those.
|
|
40
|
+
*/
|
|
41
|
+
dashboard: Pick<TDashboard, 'defaultInputValues' | 'defaultFilterValues'>;
|
|
23
42
|
input: NormalizedDashboardInput;
|
|
24
43
|
runtimeValues?: DashboardInputValues;
|
|
25
44
|
target: DashboardInputRuntimeTarget;
|
|
@@ -46,3 +65,18 @@ export declare function createFilterDashboardInputSlot(filterValue: TFilterValue
|
|
|
46
65
|
export declare function createControlDashboardInputSlot(value: unknown): DashboardInputSlot | undefined;
|
|
47
66
|
export declare function cloneDashboardInputValues(values: DashboardInputValues | undefined): DashboardInputValues;
|
|
48
67
|
export declare function compactDashboardInputValues(values: DashboardInputValues): DashboardInputValues;
|
|
68
|
+
/**
|
|
69
|
+
* `over`'s slots win; a slot it does not have keeps `base`'s. A slot of `over`
|
|
70
|
+
* that holds only a comparison choice keeps `base`'s value under it, as the
|
|
71
|
+
* old filter value list and the comparison slot stayed apart. `base` itself
|
|
72
|
+
* when `over` is empty.
|
|
73
|
+
*/
|
|
74
|
+
export declare function overlayDashboardInputValues(base: DashboardInputValues, over: DashboardInputValues): DashboardInputValues;
|
|
75
|
+
/** The values without any slot of these inputs, on every target. `values` itself when none is held. */
|
|
76
|
+
export declare function removeDashboardInputSlotsById(values: DashboardInputValues, inputIds: ReadonlySet<string>): DashboardInputValues;
|
|
77
|
+
/**
|
|
78
|
+
* The saved defaults the runtime reads (SPEC 5.2): the filter model's, which
|
|
79
|
+
* hold owned `defaultFilterValues` entries as slots. With no such entry they
|
|
80
|
+
* are the stored slots, read without building the model.
|
|
81
|
+
*/
|
|
82
|
+
export declare function savedDefaultInputValues(dashboard: Pick<TDashboard, 'defaultInputValues' | 'defaultFilterValues'>): DashboardInputValues | undefined;
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { TFilter, TFilterValue } from '../../components/surfboard/filter/types.js';
|
|
2
|
+
import { DashboardInput, DashboardInputScope, DashboardInputValues, EmbeddedFilterDashboardInput, TDashboard } from '../types/common-types.js';
|
|
3
|
+
import { GlobalDateComparisonSelection } from '../../shared/analytics-protocol/index.js';
|
|
4
|
+
import { CalendarContext } from '../../shared/report-runtime-context/index.js';
|
|
5
|
+
import { DashboardFilterMappingContractIssue, DashboardFilterOptionDependencies, DashboardFilterOptionPopulation, DashboardFilterOptionSource } from '../../shared/dashboard-authoring/index.js';
|
|
6
|
+
import { FilterRef } from '../../shared/dashboard-authoring/filter-model/index.js';
|
|
7
|
+
import { DataSource, Field } from '../types/explorer-types.js';
|
|
8
|
+
import { DashboardFilterMappingDraft, DashboardFilterMappingIssue } from './dashboard-filter-mapping-authoring.js';
|
|
9
|
+
import { DashboardInputRuntimeTarget } from './dashboard-input-values.js';
|
|
10
|
+
import { DefaultsCalendar } from '../utils/filter-default-value-utils.js';
|
|
11
|
+
/**
|
|
12
|
+
* Filter settings (one filter model M4, SPEC 4.5): every settings write of a
|
|
13
|
+
* filter input, in one transaction. `applyFilterSettingsChange` is the pure
|
|
14
|
+
* core (the next dashboard, with saved defaults, and the runtime value
|
|
15
|
+
* effects); the store's `saveFilterSettings` applies both in one write with
|
|
16
|
+
* `applyFilterValueEffects`. Every filter is an input that holds its own
|
|
17
|
+
* definition (Phase 5), so there is one storage row: the input and its slots.
|
|
18
|
+
*/
|
|
19
|
+
/** Every authorable setting. `undefined` = unchanged; `null` = remove. */
|
|
20
|
+
export type FilterSettingsChange = {
|
|
21
|
+
/** Column, title, operator, defaults, presentation fields. Reach fields in it are ignored. */
|
|
22
|
+
definition?: TFilter;
|
|
23
|
+
label?: string;
|
|
24
|
+
variableName?: string;
|
|
25
|
+
forceSelection?: boolean;
|
|
26
|
+
requiredAtExecution?: boolean;
|
|
27
|
+
scope?: DashboardInputScope;
|
|
28
|
+
optionSource?: DashboardFilterOptionSource | null;
|
|
29
|
+
optionDependencies?: DashboardFilterOptionDependencies | null;
|
|
30
|
+
optionPopulation?: DashboardFilterOptionPopulation | null;
|
|
31
|
+
/** Save a draft's acceptance, or remove the mapping. */
|
|
32
|
+
mapping?: {
|
|
33
|
+
kind: 'save';
|
|
34
|
+
draft: DashboardFilterMappingDraft;
|
|
35
|
+
} | {
|
|
36
|
+
kind: 'remove';
|
|
37
|
+
};
|
|
38
|
+
/** Value effects the author asked for, at one runtime target. */
|
|
39
|
+
values?: {
|
|
40
|
+
/** The default this target loads changed; its runtime slot resets to the default. */
|
|
41
|
+
defaultChanged?: boolean;
|
|
42
|
+
/** Global Date and date filters: the saved comparison selection (`null` removes it). */
|
|
43
|
+
defaultComparisonSelection?: GlobalDateComparisonSelection | null;
|
|
44
|
+
/** The option value field changed; stored selections no longer mean the same values. */
|
|
45
|
+
selectionIdentityChanged?: boolean;
|
|
46
|
+
target: DashboardInputRuntimeTarget;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export type FilterSettingsIssue = DashboardFilterMappingIssue | {
|
|
50
|
+
code: 'invalidSettings';
|
|
51
|
+
message: string;
|
|
52
|
+
ref: FilterRef;
|
|
53
|
+
inputId?: string;
|
|
54
|
+
contractIssue?: DashboardFilterMappingContractIssue;
|
|
55
|
+
};
|
|
56
|
+
export type FilterValueEffect = {
|
|
57
|
+
kind: 'resetToDefault';
|
|
58
|
+
inputId: string;
|
|
59
|
+
target: DashboardInputRuntimeTarget;
|
|
60
|
+
filterValue?: TFilterValue;
|
|
61
|
+
} | {
|
|
62
|
+
kind: 'clear';
|
|
63
|
+
inputId: string;
|
|
64
|
+
target: DashboardInputRuntimeTarget;
|
|
65
|
+
} | {
|
|
66
|
+
kind: 'setDefaultComparison';
|
|
67
|
+
inputId: string;
|
|
68
|
+
target: DashboardInputRuntimeTarget;
|
|
69
|
+
}
|
|
70
|
+
/** A scope change: drop the live slot of a target the input no longer reaches. */
|
|
71
|
+
| {
|
|
72
|
+
kind: 'dropTargetSlot';
|
|
73
|
+
inputId: string;
|
|
74
|
+
target: DashboardInputRuntimeTarget;
|
|
75
|
+
};
|
|
76
|
+
export type FilterSettingsChangeResult = {
|
|
77
|
+
ok: true;
|
|
78
|
+
dashboard: TDashboard;
|
|
79
|
+
inputId: string;
|
|
80
|
+
valueEffects: FilterValueEffect[];
|
|
81
|
+
} | {
|
|
82
|
+
ok: false;
|
|
83
|
+
issues: FilterSettingsIssue[];
|
|
84
|
+
};
|
|
85
|
+
export type FilterSettingsSaveResult = {
|
|
86
|
+
ok: true;
|
|
87
|
+
inputId: string;
|
|
88
|
+
} | {
|
|
89
|
+
ok: false;
|
|
90
|
+
issues: FilterSettingsIssue[];
|
|
91
|
+
};
|
|
92
|
+
export type FilterSettingsContext = {
|
|
93
|
+
/** The report calendar defaults resolve in; null only before the report context loads. */
|
|
94
|
+
calendar: CalendarContext | null;
|
|
95
|
+
};
|
|
96
|
+
/** The effective forceSelection for a filter (moved unchanged from the authoring policy). */
|
|
97
|
+
export declare function resolveFilterInputForceSelection(requested: boolean | undefined, filter: TFilter | undefined, timezone?: string): true | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* A new filter from a catalog field (SPEC 4.5): one shared value for every
|
|
100
|
+
* target it reaches (OF-D18), its placement derived from the definition
|
|
101
|
+
* (S-7), and a variable name unique against the existing inputs.
|
|
102
|
+
*/
|
|
103
|
+
export declare function buildFilterInputFromField(params: {
|
|
104
|
+
field: Field;
|
|
105
|
+
dataSource?: DataSource | null;
|
|
106
|
+
connectionId?: string;
|
|
107
|
+
connectionType?: string;
|
|
108
|
+
scope: DashboardInputScope;
|
|
109
|
+
existingInputs: readonly DashboardInput[];
|
|
110
|
+
createId?: () => string;
|
|
111
|
+
}): EmbeddedFilterDashboardInput;
|
|
112
|
+
/**
|
|
113
|
+
* A new filter input holding this definition (one filter model Phase 5):
|
|
114
|
+
* every new filter, from a catalog field or the toolbar's field picker, or
|
|
115
|
+
* the Global Date. One shared value for every target it reaches (OF-D18), its
|
|
116
|
+
* placement derived from the definition (S-7), a variable name unique against
|
|
117
|
+
* the existing inputs, and no reach fields (reach is the scope).
|
|
118
|
+
*/
|
|
119
|
+
export declare function buildFilterInputFromDefinition(params: {
|
|
120
|
+
filter: TFilter;
|
|
121
|
+
label?: string;
|
|
122
|
+
scope: DashboardInputScope;
|
|
123
|
+
existingInputs: readonly DashboardInput[];
|
|
124
|
+
createId?: () => string;
|
|
125
|
+
}): EmbeddedFilterDashboardInput;
|
|
126
|
+
/** The pure core (SPEC 4.5). Never partially applies. */
|
|
127
|
+
export declare function applyFilterSettingsChange(dashboard: TDashboard, ref: FilterRef, change: FilterSettingsChange, context?: FilterSettingsContext): FilterSettingsChangeResult;
|
|
128
|
+
/**
|
|
129
|
+
* Applies the core's value effects to the store's input values, in the same
|
|
130
|
+
* write as the dashboard (SPEC 4.5 rule 4). `before` is the dashboard the
|
|
131
|
+
* change was made on.
|
|
132
|
+
*/
|
|
133
|
+
export declare function applyFilterValueEffects(params: {
|
|
134
|
+
dashboardInputValues: DashboardInputValues;
|
|
135
|
+
effects: readonly FilterValueEffect[];
|
|
136
|
+
before: TDashboard;
|
|
137
|
+
after: TDashboard;
|
|
138
|
+
calendar: CalendarContext | null;
|
|
139
|
+
}): DashboardInputValues;
|
|
140
|
+
export type DashboardFilterStorageState = {
|
|
141
|
+
dashboardInputValues: DashboardInputValues;
|
|
142
|
+
defaultInputValues?: DashboardInputValues;
|
|
143
|
+
};
|
|
144
|
+
export type DashboardFilterAuthoringSettingsUpdate = {
|
|
145
|
+
forceSelection?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* The caller changed the default its target loads. Filter settings start
|
|
148
|
+
* from the target's saved default (`resolveAuthoredFilterDefaultFields`),
|
|
149
|
+
* which can differ from the definition for a scoped Input or an overlay
|
|
150
|
+
* entry, so they say so; callers that start from the definition leave it
|
|
151
|
+
* unset and the owner compares definitions. Also resets a saved slot that
|
|
152
|
+
* has no backing default.
|
|
153
|
+
*/
|
|
154
|
+
defaultValueChanged?: boolean;
|
|
155
|
+
defaultComparisonChanged?: boolean;
|
|
156
|
+
defaultComparisonSelection?: GlobalDateComparisonSelection;
|
|
157
|
+
target?: DashboardInputRuntimeTarget;
|
|
158
|
+
optionSourceChanged?: boolean;
|
|
159
|
+
optionSource?: DashboardFilterOptionSource;
|
|
160
|
+
/** Authored option dependency policy edit; undefined value restores the
|
|
161
|
+
* dashboard default (omitted, meaning All applicable). */
|
|
162
|
+
optionDependenciesChanged?: boolean;
|
|
163
|
+
optionDependencies?: DashboardFilterOptionDependencies;
|
|
164
|
+
optionPopulationChanged?: boolean;
|
|
165
|
+
optionPopulation?: DashboardFilterOptionPopulation;
|
|
166
|
+
/** Raw selection identity changed; the previous runtime value is invalid. */
|
|
167
|
+
selectionIdentityChanged?: boolean;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* Callers submit edits; the owner decides whether defaults must be reseeded.
|
|
171
|
+
* A default change (values, date window or mode) writes the target's saved
|
|
172
|
+
* default and live value; the definition, which the caller submits whole,
|
|
173
|
+
* holds the last authored default.
|
|
174
|
+
*/
|
|
175
|
+
export declare function resolveFilterAuthoringSettings(previous: TFilter | undefined, filter: TFilter, settings: DashboardFilterAuthoringSettingsUpdate | undefined, target: DashboardInputRuntimeTarget, calendar?: DefaultsCalendar): {
|
|
176
|
+
target: DashboardInputRuntimeTarget;
|
|
177
|
+
defaultValueChanged: boolean;
|
|
178
|
+
defaultFilterValue: TFilterValue | undefined;
|
|
179
|
+
forceSelection?: boolean;
|
|
180
|
+
defaultComparisonChanged?: boolean;
|
|
181
|
+
defaultComparisonSelection?: GlobalDateComparisonSelection;
|
|
182
|
+
optionSourceChanged?: boolean;
|
|
183
|
+
optionSource?: DashboardFilterOptionSource;
|
|
184
|
+
optionDependenciesChanged?: boolean;
|
|
185
|
+
optionDependencies?: DashboardFilterOptionDependencies;
|
|
186
|
+
optionPopulationChanged?: boolean;
|
|
187
|
+
optionPopulation?: DashboardFilterOptionPopulation;
|
|
188
|
+
selectionIdentityChanged?: boolean;
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Applies Basic-tab default edits to the same storage transaction that changes
|
|
192
|
+
* mapped participation. This keeps the authoritative filter, mapped input, and
|
|
193
|
+
* its runtime/default slots from becoming observable in mixed states.
|
|
194
|
+
*/
|
|
195
|
+
export declare function applyFilterAuthoringSettingsToStorage(params: {
|
|
196
|
+
state: DashboardFilterStorageState;
|
|
197
|
+
input: Pick<DashboardInput, 'id' | 'runtimeScope'>;
|
|
198
|
+
settings?: ReturnType<typeof resolveFilterAuthoringSettings>;
|
|
199
|
+
}): DashboardFilterStorageState;
|
|
@@ -3,12 +3,17 @@ import { CardViewStateMap } from '../dashboard-view-state/index.js';
|
|
|
3
3
|
import { TFilterValue } from '../../components/surfboard/filter/types.js';
|
|
4
4
|
import { DashboardInputValues, NormalizedDashboardInput, ResolvedDashboardInput, ResolvedDashboardInputContext, TCard, TDashboard } from '../types/common-types.js';
|
|
5
5
|
import { DashboardInputRuntimeTarget } from './dashboard-input-values.js';
|
|
6
|
-
import { doesDashboardInputApplyToTarget } from '
|
|
6
|
+
import { doesDashboardInputApplyToTarget } from '../../shared/dashboard-authoring/dashboard-input-scope.js';
|
|
7
7
|
import { TransientInputContext } from './transient-input-context.js';
|
|
8
8
|
export { doesDashboardInputApplyToTarget };
|
|
9
9
|
export type DashboardInputRuntimeValues = {
|
|
10
10
|
dashboardInputValues?: DashboardInputValues;
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Runtime-only values no filter defines (chart clicks, summary chips; one
|
|
13
|
+
* filter model SPEC 5.8). Input resolution never reads them; authored filter
|
|
14
|
+
* values are slots.
|
|
15
|
+
*/
|
|
16
|
+
adHocFilterValues?: TFilterValue[];
|
|
12
17
|
controlValues?: Record<string, unknown>;
|
|
13
18
|
inlineFilterValuesMap?: Record<string, TFilterValue[] | undefined>;
|
|
14
19
|
cardControlValuesMap?: Record<string, Record<string, unknown>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SelectionField, SelectionInputValue } from '../../shared/analytics-protocol/selection-contract.js';
|
|
2
2
|
import { DashboardFilterTarget } from '../../shared/dashboard-authoring/index.js';
|
|
3
|
-
import { ScopedDashboardInputTarget } from '
|
|
3
|
+
import { ScopedDashboardInputTarget } from '../../shared/dashboard-authoring/dashboard-input-scope.js';
|
|
4
4
|
import { NormalizedFilterDashboardInput, SelectionDashboardInput, TCard } from '../types/common-types.js';
|
|
5
5
|
import { FilterCondition } from '../types/explorer-types.js';
|
|
6
6
|
export type SelectionSkipReason =
|