react-semaphor 0.1.582 → 0.1.584
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 +183 -178
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +7 -7
- package/dist/briefings/index.js +4 -4
- package/dist/chunks/aggregate-measure-field-DsFXETpI.js +22 -0
- package/dist/chunks/{assistant-chat-CVtxjVEH.js → assistant-chat-nmycV1Se.js} +12 -12
- package/dist/chunks/{bookmark-impact-BDSeeRy7.js → bookmark-impact-CI3gmxi0.js} +2 -2
- package/dist/chunks/{bookmark-state-BEl_G9vr.js → bookmark-state-D9-RFkDg.js} +22 -22
- package/dist/chunks/{card-filter-builder-CMZ5nwdC.js → card-filter-builder-C7QyPqRy.js} +145 -145
- package/dist/chunks/{comparison-window-caption-sRFtnX1q.js → comparison-window-caption-BAnsTI8y.js} +291 -305
- package/dist/chunks/{dashboard-briefing-launcher-C9wf8KhD.js → dashboard-briefing-launcher-DXs0XA1O.js} +13 -13
- package/dist/chunks/{dashboard-controls-PDb9Gap5.js → dashboard-controls-6Zoo8d8Y.js} +84 -84
- package/dist/chunks/{dashboard-BNn7fpDY.js → dashboard-inJy_V78.js} +1 -1
- package/dist/chunks/{dashboard-json-CvtVy2UH.js → dashboard-json-D5eJhVA9.js} +4 -4
- package/dist/chunks/{dates-B42fboJU.js → dates-B3_GWc_Y.js} +8 -8
- package/dist/chunks/{edit-dashboard-visual-Cat0RWPp.js → edit-dashboard-visual-DR03SYeW.js} +17 -17
- package/dist/chunks/{filter-reach-copy-C-RH1rVx.js → filter-reach-copy-CZwzrxBp.js} +1403 -1240
- package/dist/chunks/{filter-value-text-DXGYypEd.js → filter-value-text-DtOvqcjn.js} +8 -8
- package/dist/chunks/{index-JWLo4R_t.js → index-BgT1L0p5.js} +5 -5
- package/dist/chunks/{layout-grid-8rR-LPTk.js → layout-grid-9nSS2SL-.js} +1 -1
- package/dist/chunks/{list-filter-C1-uTgjR.js → list-filter-CfMPI6v4.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-dkS8szLM.js → matrix-analytical-definition-Cs2v43FM.js} +3 -3
- package/dist/chunks/{matrix-member-presentation-DRa-9e6Q.js → matrix-member-presentation-BKDyxJho.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-DCVinw1o.js → matrix-operation-contract-BM5TveR3.js} +153 -147
- package/dist/chunks/{metric-comparison-n9NsIa-2.js → metric-comparison-Be4uS3Ql.js} +1 -1
- package/dist/chunks/{paintbrush-aR17Z3C9.js → paintbrush-LzAje2ff.js} +1 -1
- package/dist/chunks/{palette-a5FCZKFI.js → palette-DicJG0TC.js} +1 -1
- package/dist/chunks/{pivot-header-presentation-MvvlxtIB.js → pivot-header-presentation-uH06jiZD.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-8tuNjRvG.js → pivot-result-contract-expectations-DvZY4eJM.js} +779 -765
- package/dist/chunks/{pivot-result-identity-B89X5xjb.js → pivot-result-identity-BZexMfmL.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-CwbsD6t6.js → report-preferences-dialog-DWeVe2so.js} +171 -170
- package/dist/chunks/{report-runtime-context-BhPzLTbS.js → report-runtime-context-NlOXwyRB.js} +1 -1
- package/dist/chunks/{resolve-dashboard-input-context-6FP1-7aU.js → resolve-dashboard-input-context-uATCuOP7.js} +5083 -4973
- package/dist/chunks/{save-D985VvYp.js → save-0wu1Z1U7.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-D2G0uLji.js → saved-dashboard-context-DSVV9iqW.js} +6 -6
- package/dist/chunks/selection-filter-compiler-BReJy-uv.js +92 -0
- package/dist/chunks/{semaphor-ready-indicator-UhNS27Gy.js → semaphor-ready-indicator-B9vvRMnJ.js} +46773 -45614
- package/dist/chunks/{shelf-drop-preview-context-DPksW68k.js → shelf-drop-preview-context-BHOnp5Bo.js} +5 -5
- package/dist/chunks/{stored-dashboard-KpTy4umJ.js → stored-dashboard-xc5iidHL.js} +210 -221
- package/dist/chunks/{style-sheet-parts-C7qGZuH1.js → style-sheet-parts-_dGSFzDi.js} +2 -2
- package/dist/chunks/{table-export-sheet-wBkk17aa.js → table-export-sheet-Cv_94obr.js} +1 -1
- package/dist/chunks/{token-types-iKMplaBL.js → token-types-DEe_FP4l.js} +1 -1
- package/dist/chunks/{upload-CiGNKJ_0.js → upload-CtyOkU_B.js} +1 -1
- package/dist/chunks/{validators-B8fpdinG.js → validators-CJ8Jh0E8.js} +2 -2
- package/dist/chunks/{variable-draft-CP5I66_J.js → variable-draft-C3CjhsJQ.js} +4 -4
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1391 -1364
- package/dist/format-utils/index.js +140 -140
- package/dist/index.js +234 -231
- package/dist/report-runtime-context/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/ui-custom/date-range-presets.d.ts +7 -0
- package/dist/types/components/visual/data-table/types/data-table.d.ts +3 -0
- package/dist/types/components/visual/matrix-table/matrix-interaction-actions.d.ts +24 -3
- package/dist/types/index.js +5 -5
- package/dist/types/lib/hooks/interactions/use-drill-actions.d.ts +1 -1
- package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +9 -0
- package/dist/types/lib/matrix-table/matrix-runtime.d.ts +8 -3
- package/dist/types/lib/query-context/compile-selection-filters.d.ts +1 -5
- package/dist/types/lib/see-records/click.d.ts +79 -0
- package/dist/types/lib/see-records/see-records-offer.d.ts +25 -0
- package/dist/types/lib/see-records/use-see-records-offer.d.ts +16 -0
- package/dist/types/lib/types/common-types.d.ts +6 -0
- package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +7 -0
- package/dist/types/shared/analytics-protocol/aggregate-measure-field.d.ts +13 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +1 -0
- package/dist/types/shared/analytics-protocol/selection-filter-compiler.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/see-records/availability.d.ts +30 -0
- package/dist/types/shared/dashboard-authoring/see-records/click.d.ts +37 -0
- package/dist/types/shared/dashboard-authoring/see-records/index.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/see-records/limits.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/see-records/measure-kind.d.ts +46 -0
- package/dist/types/shared/dashboard-authoring/see-records/request.d.ts +28 -0
- package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +61 -0
- package/dist/types/shared/usage-events/envelope.d.ts +4 -4
- package/package.json +1 -1
- package/dist/chunks/selection-filter-compiler-CUDRnUxc.js +0 -80
package/dist/surfboard/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a, R as s, D as o } from "../chunks/report-preferences-dialog-
|
|
2
|
-
import { C as f, E as D } from "../chunks/bookmark-state-
|
|
1
|
+
import { a, R as s, D as o } from "../chunks/report-preferences-dialog-DWeVe2so.js";
|
|
2
|
+
import { C as f, E as D } from "../chunks/bookmark-state-D9-RFkDg.js";
|
|
3
3
|
export {
|
|
4
4
|
f as CONTROL_CARD_DEFAULT_VALUE,
|
|
5
5
|
a as DisplayFormatPreferencesFields,
|
|
@@ -19,4 +19,11 @@ export declare function resolveCalendarDayRange(date: string, timezone: string):
|
|
|
19
19
|
* silently widening the filter.
|
|
20
20
|
*/
|
|
21
21
|
export declare const isSingleDayDefaultDateFilter: (value: DefaultDateFilter | undefined) => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* True when a default is one whole calendar month (a fixed month, "This
|
|
24
|
+
* month" or "Last month"), making it a valid default for Month Picker
|
|
25
|
+
* (`dateSelectionMode: 'months'`) filters, whose control shows one month: any
|
|
26
|
+
* other window would filter on dates the control doesn't show.
|
|
27
|
+
*/
|
|
28
|
+
export declare const isSingleMonthDefaultDateFilter: (value: DefaultDateFilter | undefined) => boolean;
|
|
22
29
|
export declare function resolveDefaultDateFilterForDefaults(meta: DefaultDateFilter, calendar: string | DefaultDateCalendar, weekStart?: WeekStart): [Date, Date] | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SeeRecordsOfferFor } from '../../../../lib/see-records/use-see-records-offer.js';
|
|
1
2
|
import { TCard } from '../../../../lib/types/common-types.js';
|
|
2
3
|
import { CSSProperties } from 'react';
|
|
3
4
|
import { Column, SortingState, ColumnSizingState } from '@tanstack/react-table';
|
|
@@ -192,6 +193,8 @@ export interface DataTableProps {
|
|
|
192
193
|
x: number;
|
|
193
194
|
y: number;
|
|
194
195
|
}) => void;
|
|
196
|
+
/** See records for a clicked number (see-records TECH-SPEC 3); absent where no list opens. */
|
|
197
|
+
seeRecordsOffer?: SeeRecordsOfferFor;
|
|
195
198
|
}
|
|
196
199
|
export interface DataTableColumnSettingsProps {
|
|
197
200
|
column: Column<any, unknown> | null;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { MatrixInteractionInput, MatrixInteraction } from '../../../lib/interactions/get-click-context-from-matrix.js';
|
|
2
|
+
import { MatrixPath, MatrixSpec } from '../../../shared/analytics-protocol/index.js';
|
|
3
|
+
import { SeeRecordsOffer } from '../../../lib/see-records/see-records-offer.js';
|
|
2
4
|
export type MatrixSelectionSource = 'rowMembers' | 'columnMembers' | 'cells';
|
|
3
5
|
export type MatrixInteractionHost = Pick<MatrixInteractionInput, 'resolveField' | 'capabilities'> & {
|
|
4
6
|
canDispatch?: (mode: 'clickFilter' | 'drillToDetail', context: NonNullable<MatrixInteraction['context']>) => boolean;
|
|
@@ -20,14 +22,33 @@ export type MatrixInteractionHost = Pick<MatrixInteractionInput, 'resolveField'
|
|
|
20
22
|
*/
|
|
21
23
|
isSelected?: (context: NonNullable<MatrixInteraction['context']>) => boolean;
|
|
22
24
|
drill: (context: NonNullable<MatrixInteraction['context']>, measure: NonNullable<MatrixInteraction['measure']>) => void;
|
|
25
|
+
/**
|
|
26
|
+
* See records for one value, given the request the cells on screen
|
|
27
|
+
* answered (undefined while they are updating). Absent where no list opens.
|
|
28
|
+
*/
|
|
29
|
+
seeRecords?: (value: {
|
|
30
|
+
spec: MatrixSpec;
|
|
31
|
+
interaction: MatrixInteraction;
|
|
32
|
+
rowPath: MatrixPath;
|
|
33
|
+
columnPath: MatrixPath;
|
|
34
|
+
measureId: string;
|
|
35
|
+
shownValue?: number;
|
|
36
|
+
}, source: Record<string, unknown> | undefined) => SeeRecordsOffer;
|
|
37
|
+
};
|
|
38
|
+
/** What the grid reads for See records as a menu opens: the cells' request and the value. */
|
|
39
|
+
export type MatrixSeeRecordsRead = {
|
|
40
|
+
readSource: () => Record<string, unknown> | undefined;
|
|
41
|
+
shownValue?: number;
|
|
23
42
|
};
|
|
24
43
|
/** The host adapts Matrix gestures to selection and drill callbacks; it owns no query or permission policy. */
|
|
25
|
-
export declare function MatrixInteractionActions({ input, host, }: {
|
|
44
|
+
export declare function MatrixInteractionActions({ input, host, seeRecords, }: {
|
|
26
45
|
input: Omit<MatrixInteractionInput, 'resolveField' | 'capabilities'>;
|
|
27
46
|
host?: MatrixInteractionHost;
|
|
47
|
+
seeRecords?: MatrixSeeRecordsRead;
|
|
28
48
|
}): import("react").JSX.Element | null;
|
|
29
|
-
/**
|
|
30
|
-
export declare function MatrixCellDrillAction({ input, host, }: {
|
|
49
|
+
/** A cell's right-click: its one records item (SR-D23). */
|
|
50
|
+
export declare function MatrixCellDrillAction({ input, host, seeRecords, }: {
|
|
31
51
|
input: Omit<MatrixInteractionInput, 'resolveField' | 'capabilities'>;
|
|
32
52
|
host?: MatrixInteractionHost;
|
|
53
|
+
seeRecords?: MatrixSeeRecordsRead;
|
|
33
54
|
}): import("react").JSX.Element | null;
|
package/dist/types/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { B as t, y as r, C as l, E as o, V as i, j as n, c as d, g as m, f as u, b as c, e as E, d as C, a as T, x as p, w as D, l as A, h as I, o as _, v as F, u as S, m as b, n as L, p as f, k as N, q as y, s as R, i as h, r as g, t as x } from "../chunks/bookmark-state-
|
|
2
|
-
import { C as O, D as V, L as w, d as U, g as k,
|
|
3
|
-
import { D as j } from "../chunks/token-types-
|
|
4
|
-
import { r as X, a as H } from "../chunks/pivot-result-identity-
|
|
5
|
-
import { D as $ } from "../chunks/report-runtime-context-
|
|
1
|
+
import { B as t, y as r, C as l, E as o, V as i, j as n, c as d, g as m, f as u, b as c, e as E, d as C, a as T, x as p, w as D, l as A, h as I, o as _, v as F, u as S, m as b, n as L, p as f, k as N, q as y, s as R, i as h, r as g, t as x } from "../chunks/bookmark-state-D9-RFkDg.js";
|
|
2
|
+
import { C as O, D as V, L as w, d as U, g as k, h as z, e as B, f as K, c as v, a as Y, i as q, b as G, n as P, s as Q } from "../chunks/validators-CJ8Jh0E8.js";
|
|
3
|
+
import { D as j } from "../chunks/token-types-DEe_FP4l.js";
|
|
4
|
+
import { r as X, a as H } from "../chunks/pivot-result-identity-BZexMfmL.js";
|
|
5
|
+
import { D as $ } from "../chunks/report-runtime-context-NlOXwyRB.js";
|
|
6
6
|
const e = [
|
|
7
7
|
"concatenate",
|
|
8
8
|
"conditional-category",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SeeRecordsOffer } from '../see-records/see-records-offer.js';
|
|
1
2
|
import { TCard } from '../types/index.js';
|
|
2
3
|
import { QueryColumnKeyMap, CardConfig, Field } from '../types/explorer-types.js';
|
|
3
4
|
import { ClickedMetricValue, ClickFilterCondition } from '../types/interaction-types.js';
|
|
@@ -9,6 +10,14 @@ export interface ClickContextResult {
|
|
|
9
10
|
metrics?: ClickedMetricValue[];
|
|
10
11
|
/** The dimension column under the pointer, when the visual has cells. */
|
|
11
12
|
clickedField?: Field;
|
|
13
|
+
/**
|
|
14
|
+
* The result column the clicked mark draws (a chart series' key in the
|
|
15
|
+
* records). See records names the clicked measure from it through the
|
|
16
|
+
* result's own identity, never the browser's config (ledger IN-13).
|
|
17
|
+
*/
|
|
18
|
+
resultColumnKey?: string;
|
|
19
|
+
/** What the click site offers for See records; a menu opened from this context shows it. */
|
|
20
|
+
seeRecords?: SeeRecordsOffer;
|
|
12
21
|
}
|
|
13
22
|
export declare function getClickContextFromChartJs({ resolvedCardConfig, card, records, chart, clickEvent, columnKeyMap, resultColumns, valueFormatPreferences, }: {
|
|
14
23
|
resolvedCardConfig: CardConfig;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SemaphorFilterReachEntry, MatrixAxis, MatrixCoordinate, MatrixPath, MatrixSort, MatrixViewState } from '../../shared/analytics-protocol/index.js';
|
|
1
|
+
import { SemaphorFilterReachEntry, MatrixAxis, MatrixCoordinate, MatrixPath, MatrixSort, MatrixViewState, OperationTemporalState } from '../../shared/analytics-protocol/index.js';
|
|
2
2
|
import { QueryClient } from '@tanstack/react-query';
|
|
3
3
|
import { MatrixCellAddress, MatrixCellState, MatrixDatasetRetention, MatrixRuntimeInput, MatrixRuntimeSnapshot, MatrixViewport, MatrixVisibleCoverage, MatrixWindowExecutor } from './matrix-runtime-types.js';
|
|
4
4
|
/** Owns acquisition, errors, generation fencing and retention for exactly one card. */
|
|
@@ -69,14 +69,19 @@ export declare class MatrixRuntimeController {
|
|
|
69
69
|
private acceptChoices;
|
|
70
70
|
retry: (retryKey: string) => void;
|
|
71
71
|
readCell: (coordinate: MatrixCellAddress) => MatrixCellState;
|
|
72
|
+
/** Which filters the latest window's source applied, and why not, as the server reported it. */
|
|
73
|
+
readFilterReach: () => SemaphorFilterReachEntry[];
|
|
74
|
+
/**
|
|
75
|
+
* The state the cells on screen ran on: absent until the acquisition's first
|
|
76
|
+
* response reports one, and again once a reload starts (see-records SR-D38).
|
|
77
|
+
*/
|
|
78
|
+
readTemporalState: () => OperationTemporalState | undefined;
|
|
72
79
|
/**
|
|
73
80
|
* Whether every visible axis item and cell of the current generation is
|
|
74
81
|
* loaded. A pure read over the slice `plan()` loads; it never schedules work.
|
|
75
82
|
* Value, null and empty cells are complete; unloaded and loading cells, axis
|
|
76
83
|
* pages still loading, and queued or active work are not.
|
|
77
84
|
*/
|
|
78
|
-
/** Which filters the latest window's source applied, and why not, as the server reported it. */
|
|
79
|
-
readFilterReach: () => SemaphorFilterReachEntry[];
|
|
80
85
|
readVisibleCoverage: () => MatrixVisibleCoverage;
|
|
81
86
|
/** Used by explicit refresh/retry integrations; latest-issued response wins. */
|
|
82
87
|
refetchCell: (coordinate: MatrixCoordinate) => void;
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ClickFilterCondition } from '../types/interaction-types.js';
|
|
3
|
-
export { compileSelectionFilterGroup, selectionFilterGroupKey, type SelectionFilterSource, } from '../../shared/analytics-protocol/selection-filter-compiler.js';
|
|
4
|
-
/** A dashboard click condition as an explorer filter condition. */
|
|
5
|
-
export declare function toFilterCondition(condition: ClickFilterCondition, id: string): FilterCondition;
|
|
1
|
+
export { compileSelectionFilterGroup, selectionFilterGroupKey, toFilterCondition, type SelectionFilterSource, } from '../../shared/analytics-protocol/selection-filter-compiler.js';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Row } from '@tanstack/react-table';
|
|
2
|
+
import { SemaphorResultColumn } from '../../shared/analytics-protocol/contracts.js';
|
|
3
|
+
import { SeeRecordsClick } from '../../shared/dashboard-authoring/see-records/index.js';
|
|
4
|
+
import { MatrixPath, MatrixSpec } from '../../shared/analytics-protocol/index.js';
|
|
5
|
+
import { MatrixInteraction } from '../interactions/get-click-context-from-matrix.js';
|
|
6
|
+
import { KpiNumberIdentity } from '../../shared/dashboard-authoring/kpi-figure.js';
|
|
7
|
+
import { TableColumnTotal } from '../../shared/dashboard-authoring/measure-calculations/table-column-total.js';
|
|
8
|
+
import { QueryColumnKeyMap } from '../../shared/format-utils/pivot-result-identity.js';
|
|
9
|
+
import { RawTemporalPresentation } from '../formatters/raw-temporal-presentation.js';
|
|
10
|
+
import { TCard } from '../types/common-types.js';
|
|
11
|
+
import { CardConfig } from '../types/explorer-types.js';
|
|
12
|
+
import { ComparisonMetadataMap } from '../types/query-types.js';
|
|
13
|
+
import { ClickContextResult } from '../interactions/get-click-context-from-chartjs.js';
|
|
14
|
+
import { RegularTableTemporalPresentation } from '../formatters/regular-table-temporal-presentation.js';
|
|
15
|
+
/** What a renderer knows about its result, for naming the clicked measure. */
|
|
16
|
+
export type SeeRecordsResultIdentity = {
|
|
17
|
+
columnKeyMap?: QueryColumnKeyMap;
|
|
18
|
+
resultColumns?: readonly SemaphorResultColumn[];
|
|
19
|
+
comparisonMetadata?: ComparisonMetadataMap;
|
|
20
|
+
};
|
|
21
|
+
export type SeeRecordsClickInput = ({
|
|
22
|
+
kind: 'tableCell';
|
|
23
|
+
card: TCard;
|
|
24
|
+
resolvedCardConfig: CardConfig;
|
|
25
|
+
row: Row<unknown>;
|
|
26
|
+
/** The clicked cell's column: its result key. */
|
|
27
|
+
columnId: string;
|
|
28
|
+
temporalPresentation?: RegularTableTemporalPresentation;
|
|
29
|
+
rawTemporalPresentation?: RawTemporalPresentation;
|
|
30
|
+
shownValue?: number;
|
|
31
|
+
} & SeeRecordsResultIdentity) | ({
|
|
32
|
+
kind: 'tableTotals';
|
|
33
|
+
card: TCard;
|
|
34
|
+
resolvedCardConfig: CardConfig;
|
|
35
|
+
columnId: string;
|
|
36
|
+
total?: TableColumnTotal;
|
|
37
|
+
shownValue?: number;
|
|
38
|
+
} & SeeRecordsResultIdentity)
|
|
39
|
+
/** One of a KPI's numbers, by its own result row (`readKpiNumber`): never its comparison (SR-D28). */
|
|
40
|
+
| {
|
|
41
|
+
kind: 'kpi';
|
|
42
|
+
card: TCard;
|
|
43
|
+
number: KpiNumberIdentity;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A Matrix value: the conditions the Matrix's own interaction stated for its
|
|
47
|
+
* row and column paths (`prepareMatrixInteraction`), and the measure it holds.
|
|
48
|
+
*/
|
|
49
|
+
| {
|
|
50
|
+
kind: 'matrixValue';
|
|
51
|
+
card: TCard;
|
|
52
|
+
spec: MatrixSpec;
|
|
53
|
+
interaction: MatrixInteraction;
|
|
54
|
+
rowPath: MatrixPath;
|
|
55
|
+
columnPath: MatrixPath;
|
|
56
|
+
measureId: string;
|
|
57
|
+
shownValue?: number;
|
|
58
|
+
} | ({
|
|
59
|
+
kind: 'chartMark';
|
|
60
|
+
card: TCard;
|
|
61
|
+
/** The config the chart drew: its groupings are what a mark sits under. */
|
|
62
|
+
resolvedCardConfig: CardConfig;
|
|
63
|
+
/** The chart's own click context, as `getClickContextFromChartJs` built it. */
|
|
64
|
+
context: ClickContextResult;
|
|
65
|
+
shownValue?: number;
|
|
66
|
+
} & SeeRecordsResultIdentity);
|
|
67
|
+
export type SeeRecordsClickCapture = {
|
|
68
|
+
ok: true;
|
|
69
|
+
click: SeeRecordsClick;
|
|
70
|
+
} | {
|
|
71
|
+
ok: false;
|
|
72
|
+
message: string;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* The measure a result column holds, by the result's own identity: a pivoted
|
|
76
|
+
* column's `pivotIdentity`, else the column key map's metric entry for the key.
|
|
77
|
+
*/
|
|
78
|
+
export declare function resultMeasureId(columnKey: string, identity: SeeRecordsResultIdentity): string | undefined;
|
|
79
|
+
export declare function seeRecordsClickFrom(input: SeeRecordsClickInput): SeeRecordsClickCapture;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TCard } from '../types/common-types.js';
|
|
2
|
+
import { SeeRecordsClickInput } from './click.js';
|
|
3
|
+
export type SeeRecordsOffer = {
|
|
4
|
+
status: 'hidden';
|
|
5
|
+
} | {
|
|
6
|
+
status: 'disabled';
|
|
7
|
+
message: string;
|
|
8
|
+
} | {
|
|
9
|
+
status: 'enabled';
|
|
10
|
+
open: () => void;
|
|
11
|
+
};
|
|
12
|
+
export declare const SEE_RECORDS_LABEL = "See records";
|
|
13
|
+
export declare const SEE_RECORDS_HIDDEN: SeeRecordsOffer;
|
|
14
|
+
export declare function resolveSeeRecordsOffer(input: {
|
|
15
|
+
click: SeeRecordsClickInput;
|
|
16
|
+
card: TCard;
|
|
17
|
+
dashboardId: string;
|
|
18
|
+
frameId: string;
|
|
19
|
+
/** The frame query's own flag: the rows on screen answer the current request (SR-D38). */
|
|
20
|
+
isCurrentQueryResult: boolean;
|
|
21
|
+
/** The request those rows answered. */
|
|
22
|
+
queryRequestPayload: Record<string, unknown> | undefined;
|
|
23
|
+
}): SeeRecordsOffer;
|
|
24
|
+
/** A click that does nothing today runs See records when it is offered (SR-D10). Returns whether it opened. */
|
|
25
|
+
export declare function runSeeRecordsOffer(offer: SeeRecordsOffer | undefined): boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TCard } from '../types/common-types.js';
|
|
2
|
+
import { SeeRecordsClickInput } from './click.js';
|
|
3
|
+
import { SeeRecordsOffer } from './see-records-offer.js';
|
|
4
|
+
/** The rows on screen and the request they answered, when a site reads them as its menu opens. */
|
|
5
|
+
export type SeeRecordsFrameState = {
|
|
6
|
+
isCurrentQueryResult: boolean;
|
|
7
|
+
queryRequestPayload: Record<string, unknown> | undefined;
|
|
8
|
+
};
|
|
9
|
+
/** A site that reads its frame state per click (a Matrix's runtime) passes it; others use the hook's. */
|
|
10
|
+
export type SeeRecordsOfferFor = (input: SeeRecordsClickInput, frame?: SeeRecordsFrameState) => SeeRecordsOffer;
|
|
11
|
+
export declare function useSeeRecordsOffer(input: {
|
|
12
|
+
card: TCard;
|
|
13
|
+
frameId: string | undefined;
|
|
14
|
+
isCurrentQueryResult: boolean;
|
|
15
|
+
queryRequestPayload: Record<string, unknown> | undefined;
|
|
16
|
+
}): SeeRecordsOfferFor | undefined;
|
|
@@ -1377,6 +1377,12 @@ export type TCard = {
|
|
|
1377
1377
|
clickToFilter?: ClickToFilterSettings;
|
|
1378
1378
|
/** Receiver side. false = this card ignores selections from every source card. Default true. */
|
|
1379
1379
|
respondsToSelections?: boolean;
|
|
1380
|
+
/**
|
|
1381
|
+
* false hides See records on this card: no list icon, menu item or plain
|
|
1382
|
+
* click opens its numbers' records. Absent means on. Presentation only, not
|
|
1383
|
+
* access (see-records SR-D4, SR-D16).
|
|
1384
|
+
*/
|
|
1385
|
+
seeRecords?: false;
|
|
1380
1386
|
/**
|
|
1381
1387
|
* Set only on a data variable's projected card, never stored: the variable
|
|
1382
1388
|
* it runs (data variables DV-D9, P3b-03). The browser's comparison rule
|
|
@@ -61,6 +61,13 @@ export type ScannedAggregateExpression = {
|
|
|
61
61
|
* FILTER and OVER suffixes, and the input tokens outside them.
|
|
62
62
|
*/
|
|
63
63
|
export declare function scanAggregateExpression(expression: string, resolvedInputTokens?: ReadonlySet<string>): ScannedAggregateExpression;
|
|
64
|
+
/**
|
|
65
|
+
* The row value one aggregate call reads: its single argument, without a
|
|
66
|
+
* DISTINCT. The one cut the compiler's measure-filter rewrite and See
|
|
67
|
+
* records' row expression share. Undefined when the call has no single row
|
|
68
|
+
* argument: several arguments, a FILTER (it narrows the rows) or an OVER.
|
|
69
|
+
*/
|
|
70
|
+
export declare function aggregateCallOperand(expression: string, call: ScannedAggregateCall): string | undefined;
|
|
64
71
|
/** A unit of an expression skeleton: an aggregate call or an input token. */
|
|
65
72
|
export type SkeletonUnit = {
|
|
66
73
|
kind: 'call';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AggregateFunction, Field, MetricField } from '../../lib/types/explorer-types.js';
|
|
2
|
+
export type AggregateMeasureFieldLike = Partial<Pick<Field, 'entityName' | 'entityId'>> & {
|
|
3
|
+
aggregate?: AggregateFunction | string;
|
|
4
|
+
isPreAggregated?: boolean;
|
|
5
|
+
expression?: string;
|
|
6
|
+
calculatedFormula?: MetricField['calculatedFormula'];
|
|
7
|
+
};
|
|
8
|
+
/** The field aggregates itself: an aggregate, pre-aggregation, an aggregate expression, or aggregate inputs. */
|
|
9
|
+
export declare function hasAggregateMeasureSemantics(field: AggregateMeasureFieldLike | null | undefined): boolean;
|
|
10
|
+
/** A metric-role field that aggregates: one with aggregate semantics, or a calculated field. */
|
|
11
|
+
export declare function isAggregateMetricRoleField(field: (AggregateMeasureFieldLike & {
|
|
12
|
+
role?: string;
|
|
13
|
+
}) | null | undefined): boolean;
|
|
@@ -20,6 +20,7 @@ export * from './dashboard-date-comparison-definition.js';
|
|
|
20
20
|
export * from './dashboard-input-contract.js';
|
|
21
21
|
export * from './selection-contract.js';
|
|
22
22
|
export * from './selection-filter-compiler.js';
|
|
23
|
+
export * from './aggregate-measure-field.js';
|
|
23
24
|
export * from './temporal-context.js';
|
|
24
25
|
export * from './temporal-bucket-contract.js';
|
|
25
26
|
export * from './raw-temporal-contract.js';
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { FilterCondition, FilterGroup } from '../../lib/types/explorer-types.js';
|
|
2
|
+
import { ClickFilterCondition } from '../../lib/types/interaction-types.js';
|
|
3
|
+
/** A dashboard click condition as an explorer filter condition. */
|
|
4
|
+
export declare function toFilterCondition(condition: ClickFilterCondition, id: string): FilterCondition;
|
|
2
5
|
/** One source selection already projected into executable filter conditions. */
|
|
3
6
|
export type SelectionFilterSource = {
|
|
4
7
|
sourceCardId: string;
|
|
@@ -95,4 +95,10 @@ export declare function writeComparisonPresentation(preferences: TCardPreference
|
|
|
95
95
|
* (RC-D16), as the panel's "Inherit Global Date comparison" switch writes it:
|
|
96
96
|
* `false` stored, `true` the key removed.
|
|
97
97
|
*/
|
|
98
|
+
/**
|
|
99
|
+
* Whether viewers can open the records behind a card's numbers (see-records
|
|
100
|
+
* SR-D4): `false` stored, `true` the key removed. The Interactions sheet and
|
|
101
|
+
* the MCP both write through this.
|
|
102
|
+
*/
|
|
103
|
+
export declare function writeSeeRecords<T extends Pick<TCard, 'seeRecords'>>(card: T, on: boolean): T;
|
|
98
104
|
export declare function writeInheritComparison(preferences: TCardPreferences | undefined, inherit: boolean): TCardPreferences;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TCard } from '../../../lib/types/common-types.js';
|
|
2
2
|
import { CardType } from '../changes/card-types.js';
|
|
3
|
-
export type SettingName = 'columns.label' | 'columns.format' | 'columns.hidden' | 'columns.width' | 'orientation' | 'stack' | 'donut' | 'totals' | 'dataLabels' | 'legend' | 'axes' | 'highlights' | 'columns.polarity' | 'comparisonDisplay' | 'inheritComparison' | 'band';
|
|
3
|
+
export type SettingName = 'columns.label' | 'columns.format' | 'columns.hidden' | 'columns.width' | 'orientation' | 'stack' | 'donut' | 'totals' | 'dataLabels' | 'legend' | 'axes' | 'highlights' | 'columns.polarity' | 'comparisonDisplay' | 'inheritComparison' | 'band' | 'seeRecords';
|
|
4
4
|
export declare const SETTINGS_BY_KIND: Readonly<Record<CardType, readonly SettingName[]>>;
|
|
5
5
|
export type CardSettingsKind = {
|
|
6
6
|
type: CardType;
|
|
@@ -10,7 +10,7 @@ export { carryColumnSettings } from './carry-column-settings.js';
|
|
|
10
10
|
export { confirmClassFor, type ConfirmClass } from './confirm-class.js';
|
|
11
11
|
export { writeColumnFormat, withFormatOverride } from './column-format-write.js';
|
|
12
12
|
export { writeColumnPolarity } from './column-polarity-write.js';
|
|
13
|
-
export { writeComparisonDisplay, writeComparisonPresentation, writeInheritComparison } from './card-display-write.js';
|
|
13
|
+
export { writeComparisonDisplay, writeComparisonPresentation, writeInheritComparison, writeSeeRecords } from './card-display-write.js';
|
|
14
14
|
export type { ResolvedCardSettings, ResolvedColumnSettings, ResolvedComparisonDisplay } from './resolved.js';
|
|
15
15
|
export { SETTINGS_BY_KIND, cardSettingsKind, type CardSettingsKind, type SettingName } from './card-kinds.js';
|
|
16
16
|
export type { AxisInput, CardSettingsInput, ColumnSettingsInput, ComparisonDisplayInput, DashboardUpdateChange, FormatInput, FormatPatch, HighlightAddChange, HighlightColor, HighlightCondition, HighlightRemoveChange, HighlightStyleInput, LegendPosition, Polarity, } from './inputs.js';
|
|
@@ -76,6 +76,8 @@ export type CardSettingsInput = {
|
|
|
76
76
|
inheritComparison?: boolean;
|
|
77
77
|
/** A KPI's band (KPI tile layout KL-D29): `trend` needs a Trend By; `automatic` follows the summary and target. */
|
|
78
78
|
band?: 'automatic' | 'trend' | 'none';
|
|
79
|
+
/** false: viewers can't open the records behind the card's numbers; true removes the stored opt-out (see-records SR-D4). */
|
|
80
|
+
seeRecords?: boolean;
|
|
79
81
|
};
|
|
80
82
|
/** The filter operators (CA-D11): formatting and filtering share one condition language. */
|
|
81
83
|
export type HighlightCondition = {
|
|
@@ -53,4 +53,6 @@ export type ResolvedCardSettings = {
|
|
|
53
53
|
inheritComparison?: boolean;
|
|
54
54
|
/** A KPI's band (KL-D29); null returns it to Automatic. */
|
|
55
55
|
band?: 'trend' | 'none' | null;
|
|
56
|
+
/** Whether viewers can open the records behind the card's numbers (see-records SR-D4). */
|
|
57
|
+
seeRecords?: boolean;
|
|
56
58
|
};
|
|
@@ -119,6 +119,7 @@ export declare const CARD_KEY_CLASSES: {
|
|
|
119
119
|
readonly linkedInteractionTargetOverrides: "presentation";
|
|
120
120
|
readonly clickToFilter: "presentation";
|
|
121
121
|
readonly respondsToSelections: "presentation";
|
|
122
|
+
readonly seeRecords: "presentation";
|
|
122
123
|
readonly dataVariableId: "presentation";
|
|
123
124
|
readonly linkedClickToFilterOverrides: "presentation";
|
|
124
125
|
readonly paginationConfig: "presentation";
|
|
@@ -1446,9 +1446,9 @@ export declare const conditionalRuleSchema: z.ZodObject<{
|
|
|
1446
1446
|
italic?: boolean | undefined;
|
|
1447
1447
|
fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
|
|
1448
1448
|
backgroundColor?: string | undefined;
|
|
1449
|
+
textColor?: string | undefined;
|
|
1449
1450
|
textDecoration?: "none" | "underline" | "line-through" | undefined;
|
|
1450
1451
|
icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
|
|
1451
|
-
textColor?: string | undefined;
|
|
1452
1452
|
}, {
|
|
1453
1453
|
dataBar?: {
|
|
1454
1454
|
color: string;
|
|
@@ -1457,9 +1457,9 @@ export declare const conditionalRuleSchema: z.ZodObject<{
|
|
|
1457
1457
|
italic?: boolean | undefined;
|
|
1458
1458
|
fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
|
|
1459
1459
|
backgroundColor?: string | undefined;
|
|
1460
|
+
textColor?: string | undefined;
|
|
1460
1461
|
textDecoration?: "none" | "underline" | "line-through" | undefined;
|
|
1461
1462
|
icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
|
|
1462
|
-
textColor?: string | undefined;
|
|
1463
1463
|
}>>;
|
|
1464
1464
|
}, "strict", z.ZodTypeAny, {
|
|
1465
1465
|
id: string;
|
|
@@ -1726,9 +1726,9 @@ export declare const conditionalRuleSchema: z.ZodObject<{
|
|
|
1726
1726
|
italic?: boolean | undefined;
|
|
1727
1727
|
fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
|
|
1728
1728
|
backgroundColor?: string | undefined;
|
|
1729
|
+
textColor?: string | undefined;
|
|
1729
1730
|
textDecoration?: "none" | "underline" | "line-through" | undefined;
|
|
1730
1731
|
icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
|
|
1731
|
-
textColor?: string | undefined;
|
|
1732
1732
|
} | undefined;
|
|
1733
1733
|
enabled?: boolean | undefined;
|
|
1734
1734
|
}, {
|
|
@@ -1996,9 +1996,9 @@ export declare const conditionalRuleSchema: z.ZodObject<{
|
|
|
1996
1996
|
italic?: boolean | undefined;
|
|
1997
1997
|
fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
|
|
1998
1998
|
backgroundColor?: string | undefined;
|
|
1999
|
+
textColor?: string | undefined;
|
|
1999
2000
|
textDecoration?: "none" | "underline" | "line-through" | undefined;
|
|
2000
2001
|
icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
|
|
2001
|
-
textColor?: string | undefined;
|
|
2002
2002
|
} | undefined;
|
|
2003
2003
|
enabled?: boolean | undefined;
|
|
2004
2004
|
}>;
|
|
@@ -3380,9 +3380,9 @@ export declare const cardConditionalFormattingSchema: z.ZodObject<{
|
|
|
3380
3380
|
italic?: boolean | undefined;
|
|
3381
3381
|
fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
|
|
3382
3382
|
backgroundColor?: string | undefined;
|
|
3383
|
+
textColor?: string | undefined;
|
|
3383
3384
|
textDecoration?: "none" | "underline" | "line-through" | undefined;
|
|
3384
3385
|
icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
|
|
3385
|
-
textColor?: string | undefined;
|
|
3386
3386
|
}, {
|
|
3387
3387
|
dataBar?: {
|
|
3388
3388
|
color: string;
|
|
@@ -3391,9 +3391,9 @@ export declare const cardConditionalFormattingSchema: z.ZodObject<{
|
|
|
3391
3391
|
italic?: boolean | undefined;
|
|
3392
3392
|
fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
|
|
3393
3393
|
backgroundColor?: string | undefined;
|
|
3394
|
+
textColor?: string | undefined;
|
|
3394
3395
|
textDecoration?: "none" | "underline" | "line-through" | undefined;
|
|
3395
3396
|
icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
|
|
3396
|
-
textColor?: string | undefined;
|
|
3397
3397
|
}>>;
|
|
3398
3398
|
}, "strict", z.ZodTypeAny, {
|
|
3399
3399
|
id: string;
|
|
@@ -3660,9 +3660,9 @@ export declare const cardConditionalFormattingSchema: z.ZodObject<{
|
|
|
3660
3660
|
italic?: boolean | undefined;
|
|
3661
3661
|
fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
|
|
3662
3662
|
backgroundColor?: string | undefined;
|
|
3663
|
+
textColor?: string | undefined;
|
|
3663
3664
|
textDecoration?: "none" | "underline" | "line-through" | undefined;
|
|
3664
3665
|
icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
|
|
3665
|
-
textColor?: string | undefined;
|
|
3666
3666
|
} | undefined;
|
|
3667
3667
|
enabled?: boolean | undefined;
|
|
3668
3668
|
}, {
|
|
@@ -3930,9 +3930,9 @@ export declare const cardConditionalFormattingSchema: z.ZodObject<{
|
|
|
3930
3930
|
italic?: boolean | undefined;
|
|
3931
3931
|
fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
|
|
3932
3932
|
backgroundColor?: string | undefined;
|
|
3933
|
+
textColor?: string | undefined;
|
|
3933
3934
|
textDecoration?: "none" | "underline" | "line-through" | undefined;
|
|
3934
3935
|
icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
|
|
3935
|
-
textColor?: string | undefined;
|
|
3936
3936
|
} | undefined;
|
|
3937
3937
|
enabled?: boolean | undefined;
|
|
3938
3938
|
}>, "many">;
|
|
@@ -4203,9 +4203,9 @@ export declare const cardConditionalFormattingSchema: z.ZodObject<{
|
|
|
4203
4203
|
italic?: boolean | undefined;
|
|
4204
4204
|
fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
|
|
4205
4205
|
backgroundColor?: string | undefined;
|
|
4206
|
+
textColor?: string | undefined;
|
|
4206
4207
|
textDecoration?: "none" | "underline" | "line-through" | undefined;
|
|
4207
4208
|
icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
|
|
4208
|
-
textColor?: string | undefined;
|
|
4209
4209
|
} | undefined;
|
|
4210
4210
|
enabled?: boolean | undefined;
|
|
4211
4211
|
}[];
|
|
@@ -4476,9 +4476,9 @@ export declare const cardConditionalFormattingSchema: z.ZodObject<{
|
|
|
4476
4476
|
italic?: boolean | undefined;
|
|
4477
4477
|
fontWeight?: "bold" | "medium" | "normal" | "semibold" | undefined;
|
|
4478
4478
|
backgroundColor?: string | undefined;
|
|
4479
|
+
textColor?: string | undefined;
|
|
4479
4480
|
textDecoration?: "none" | "underline" | "line-through" | undefined;
|
|
4480
4481
|
icon?: "warning" | "arrowUp" | "arrowDown" | "check" | "x" | undefined;
|
|
4481
|
-
textColor?: string | undefined;
|
|
4482
4482
|
} | undefined;
|
|
4483
4483
|
enabled?: boolean | undefined;
|
|
4484
4484
|
}[];
|
|
@@ -56,6 +56,7 @@ export * from './card-formats/sql-date-pattern.js';
|
|
|
56
56
|
export * from './retired-presentation-fields.js';
|
|
57
57
|
export * from './conditional-formatting/index.js';
|
|
58
58
|
export * from './kpi-figure.js';
|
|
59
|
+
export * from './see-records/index.js';
|
|
59
60
|
export * from './card-settings/index.js';
|
|
60
61
|
export * from './measure-calculations/index.js';
|
|
61
62
|
export { bookmarkImpactSentence, describeBookmarkImpact, type BookmarkImpactItem, } from '../dashboard-viewer/bookmark-impact.js';
|
|
@@ -144,6 +144,17 @@ export type KpiFigure = {
|
|
|
144
144
|
type KpiRecords = readonly Record<string, unknown>[] | null | undefined;
|
|
145
145
|
/** A finite number from a numeric value or a numeric string (thousands commas allowed). */
|
|
146
146
|
export declare function toFiniteKpiNumber(value: unknown): number | null;
|
|
147
|
+
/**
|
|
148
|
+
* One number a config KPI shows, as its result row names it: the measure id
|
|
149
|
+
* the server wrote and the row's value. Only a measure's current value is a
|
|
150
|
+
* number of its own; its comparison and trend are not (see-records SR-D28, SR-D33).
|
|
151
|
+
*/
|
|
152
|
+
export type KpiNumberIdentity = {
|
|
153
|
+
metricId: string;
|
|
154
|
+
value: number | null;
|
|
155
|
+
};
|
|
156
|
+
/** The measure's current-value row, or undefined when the response has none. */
|
|
157
|
+
export declare function readKpiNumber(records: KpiRecords, measure: Pick<MetricField, 'id' | 'name'>): KpiNumberIdentity | undefined;
|
|
147
158
|
/** A SQL KPI's result keys: its first numeric column is the value, the second the prior. */
|
|
148
159
|
export declare function sqlKpiResultKeys(records: KpiRecords): KpiFigure['resultKeys'];
|
|
149
160
|
/**
|
|
@@ -7,6 +7,7 @@ import { DashboardFilterBoundCardApplication } from '../dashboard-filter-mapping
|
|
|
7
7
|
import { Field } from '../../../lib/types/explorer-types.js';
|
|
8
8
|
import { TChartType } from '../../../lib/charts/types.js';
|
|
9
9
|
import { CalendarContext } from '../../report-runtime-context/index.js';
|
|
10
|
+
import { DashboardRelationshipReachResolver } from '../../../lib/query-context/dashboard-filter-mapping-resolution.js';
|
|
10
11
|
import { CardQueryPart, StatedLabel } from '../changes/card-query-part.js';
|
|
11
12
|
import { FramePlacement } from '../../layouts/index.js';
|
|
12
13
|
import { DashboardStyle } from '../dashboard-style/index.js';
|
|
@@ -205,6 +206,12 @@ export type DashboardOperation = ({
|
|
|
205
206
|
export type OperationContext = {
|
|
206
207
|
/** The report calendar; filter defaults resolve in it. A proposal's has a fixed anchor (DE-D59). */
|
|
207
208
|
calendar: CalendarContext | null;
|
|
209
|
+
/**
|
|
210
|
+
* The server's relationship reach (RF-D15), for the resolver's dry run only:
|
|
211
|
+
* a filter's sentence then counts the cards the relationships carry it to.
|
|
212
|
+
* Never stored with a proposal; without it those cards read as decided when they run.
|
|
213
|
+
*/
|
|
214
|
+
relationshipReach?: DashboardRelationshipReachResolver;
|
|
208
215
|
};
|
|
209
216
|
/** What `variable.update` changes: each field as stored, or `null` to clear an optional one. */
|
|
210
217
|
export type VariablePatch = {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TCard } from '../../../lib/types/common-types.js';
|
|
2
|
+
import { FilterGroup } from '../../../lib/types/explorer-types.js';
|
|
3
|
+
import { SeeRecordsClick } from './click.js';
|
|
4
|
+
export type SeeRecordsUnavailableReason = 'switched_off' | 'sql_card' | 'unsupported_visual' | 'table_calculation' | 'comparison_value' | 'total_under_measure_filter' | 'measure_not_listable' | 'card_updating' | 'records_repeat';
|
|
5
|
+
/** The viewer's words for each reason, used by the browser and by the server's refusals. */
|
|
6
|
+
export declare const SEE_RECORDS_MESSAGES: Record<SeeRecordsUnavailableReason, string>;
|
|
7
|
+
export type SeeRecordsAvailability = {
|
|
8
|
+
available: true;
|
|
9
|
+
} | {
|
|
10
|
+
available: false;
|
|
11
|
+
reason: SeeRecordsUnavailableReason;
|
|
12
|
+
message: string;
|
|
13
|
+
};
|
|
14
|
+
/** The card fields availability reads. */
|
|
15
|
+
export type SeeRecordsCard = Pick<TCard, 'type' | 'config' | 'sql' | 'python' | 'seeRecords'>;
|
|
16
|
+
/** A measure filter in a table's own filters: a condition on a measure that aggregates (SR-D17). */
|
|
17
|
+
export declare function hasSeeRecordsMeasureFilter(group: FilterGroup | undefined): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The card's part of the check, before any click: whether the card offers
|
|
20
|
+
* See records at all (the Interactions preview reads it), and why not.
|
|
21
|
+
*/
|
|
22
|
+
export declare function seeRecordsCardAvailability(card: SeeRecordsCard, frame: {
|
|
23
|
+
isCurrentQueryResult: boolean;
|
|
24
|
+
}): SeeRecordsAvailability;
|
|
25
|
+
/** The browser's check, on the saved card and the frame's result: show, hide or disable the offer. */
|
|
26
|
+
export declare function seeRecordsAvailability(card: SeeRecordsCard, click: SeeRecordsClick, frame: {
|
|
27
|
+
isCurrentQueryResult: boolean;
|
|
28
|
+
}): SeeRecordsAvailability;
|
|
29
|
+
/** Whether a reason hides the offer rather than disabling it (SR-INV-5). */
|
|
30
|
+
export declare function seeRecordsReasonHidesOffer(reason: SeeRecordsUnavailableReason): boolean;
|