react-semaphor 0.1.545 → 0.1.547
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 +408 -442
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +100 -76
- package/dist/brand-studio/index.js +4 -4
- package/dist/briefings/index.js +6 -6
- package/dist/chunks/{add-to-dashboard-BuAqfA2Y.js → add-to-dashboard-BQRAAnc3.js} +55 -33
- package/dist/chunks/{analytics-base-schemas-BFAoRlkU.js → analytics-base-schemas-BKs3flFS.js} +2 -2
- package/dist/chunks/applied-constraints-DU-wndZ7.js +47 -0
- package/dist/chunks/{assistant-chat-D7sWTypJ.js → assistant-chat-CK84cPAB.js} +2826 -2595
- package/dist/chunks/{bookmark-state-CXw7lZ50.js → bookmark-state-Cu-a5ie_.js} +8 -15
- package/dist/chunks/comparison-window-caption-C2xF-eWw.js +1433 -0
- package/dist/chunks/{context-ClREvqCZ.js → context-BerEBuFR.js} +11 -6
- package/dist/chunks/custom-visual-inputs-ChL54gGm.js +295 -0
- package/dist/chunks/{dashboard-B1tMju0u.js → dashboard-DCk26-6i.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CePgIu0Z.js → dashboard-briefing-launcher-CQ1eYsGy.js} +1291 -1277
- package/dist/chunks/dashboard-controls-BMeZjF7r.js +2307 -0
- package/dist/chunks/{dashboard-json-CoYRPqxx.js → dashboard-json-BZqCoanC.js} +5 -5
- package/dist/chunks/{document-dashboard-inputs-BesAHZvB.js → document-dashboard-inputs-tYd7ao0o.js} +877 -979
- package/dist/chunks/{edit-dashboard-visual-JPtNfJRb.js → edit-dashboard-visual-Bv3MHM_G.js} +2157 -2243
- package/dist/chunks/filter-reach-copy-CGWsL_ez.js +3480 -0
- package/dist/chunks/{filter-value-text-ff7osJr7.js → filter-value-text-Ddf55Ku1.js} +9 -9
- package/dist/chunks/global-date-filter-utils-BhAu8zIM.js +12137 -0
- package/dist/chunks/index-CtoK1Lgu.js +586 -0
- package/dist/chunks/{index-DRWiuqyd.js → index-DmrLP5Ro.js} +105 -104
- package/dist/chunks/list-filter-DsaTbM3J.js +15 -0
- package/dist/chunks/matrix-analytical-definition-B9vW-osb.js +717 -0
- package/dist/chunks/{matrix-card-DjwWcCo8.js → matrix-card-LiMEipvq.js} +3 -3
- package/dist/chunks/{matrix-formatter-DnCyRXJE.js → matrix-formatter-DWEeC0_c.js} +44 -44
- package/dist/chunks/{matrix-member-presentation-CQGdVks6.js → matrix-member-presentation-DqzG-UhQ.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-8OIO4gob.js → matrix-operation-contract-D6vYkZK4.js} +72 -72
- package/dist/chunks/{metric-comparison-DEwi9uc2.js → metric-comparison-zpGw4lD6.js} +2 -2
- package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +119 -0
- package/dist/chunks/{pivot-header-presentation-DHcx1XGQ.js → pivot-header-presentation-CQnIDtUv.js} +1 -1
- package/dist/chunks/{pivot-result-identity-DJhXXcns.js → pivot-result-identity-C-Q1j1Wb.js} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-DM4CyGKs.js → pivot-result-lifecycle-pwq3b7LC.js} +571 -380
- package/dist/chunks/{raw-temporal-contract-C51YG48G.js → raw-temporal-contract-WuXA8jBP.js} +1 -1
- package/dist/chunks/{raw-temporal-presentation-C3mUgnEx.js → raw-temporal-presentation-DypB7sMX.js} +8 -8
- package/dist/chunks/{report-preferences-dialog-DUtuUL_5.js → report-preferences-dialog-DoVyriYC.js} +154 -155
- package/dist/chunks/{report-runtime-context-Dq8XyODK.js → report-runtime-context-hWiTCzFV.js} +2 -2
- package/dist/chunks/resolve-dashboard-input-context-D0JDUa4h.js +5576 -0
- package/dist/chunks/{saved-dashboard-context-LrF_kW0l.js → saved-dashboard-context-BfAH5j4L.js} +34 -34
- package/dist/chunks/{selection-reducer-Dj_8xD69.js → selection-reducer-CJzkTZio.js} +15 -15
- package/dist/chunks/{semaphor-ready-indicator-BxF96Yhv.js → semaphor-ready-indicator-CRm17oIP.js} +51771 -52574
- package/dist/chunks/{shelf-drop-preview-context-CNaM_Gmh.js → shelf-drop-preview-context-vy6P9THz.js} +7 -7
- package/dist/chunks/{source-entity-resolution-BYn9giz3.js → source-entity-resolution-BIGRvtbG.js} +13 -13
- package/dist/chunks/{switch-uDtPgQlQ.js → switch-CEBOR4n7.js} +3 -3
- package/dist/chunks/{table-export-sheet-YzMioA7Y.js → table-export-sheet-4X9mAG3V.js} +1 -1
- package/dist/chunks/table-settings-WysCBj62.js +614 -0
- package/dist/chunks/{temporal-bucket-D7NBrrtL.js → temporal-bucket-CQOSbv9-.js} +26 -26
- package/dist/chunks/{token-types-DBbZVQsm.js → token-types-BMqRmT-C.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-CjB7ig1o.js → use-create-flow-overlay-state-Csx_Xjsh.js} +101 -101
- package/dist/chunks/{validators-DMHTpf7a.js → validators-C-aOQlTB.js} +713 -658
- package/dist/chunks/{relative-date-label-Bk2j94pA.js → zoned-wall-clock-MulfA26h.js} +64 -21
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1895 -1163
- package/dist/data-app-sdk/index.js +6 -6
- package/dist/data-app-sdk-adapters/index.js +3 -3
- package/dist/data-app-sdk-validation/index.js +14 -14
- package/dist/format-utils/index.js +133 -133
- package/dist/index.js +192 -186
- package/dist/layouts/index.js +5 -242
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/shared/index.js +4 -5
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/surfboard/arrange-layout-button.d.ts +8 -0
- package/dist/types/components/surfboard/filter/types.d.ts +7 -0
- package/dist/types/components/surfboard/screen-size-preview-button.d.ts +10 -0
- package/dist/types/components/visual/matrix-table/matrix-card-view.d.ts +3 -0
- package/dist/types/index.js +6 -6
- package/dist/types/lib/charts/table-chart-types.d.ts +4 -0
- package/dist/types/lib/charts/types.d.ts +2 -2
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +346 -21
- package/dist/types/lib/dashboard-inputs/dashboard-filter-value-identity.d.ts +65 -0
- package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +6 -0
- package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +2 -0
- package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +15 -0
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +3 -3
- package/dist/types/lib/hooks/use-dashboard-card.d.ts +2 -0
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
- package/dist/types/lib/matrix-table/matrix-editor.d.ts +52 -0
- package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +9 -1
- package/dist/types/lib/matrix-table/matrix-runtime.d.ts +5 -1
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +149 -10
- package/dist/types/lib/stores/dashboard-store.d.ts +137 -6
- package/dist/types/lib/types/common-types.d.ts +8 -0
- package/dist/types/lib/types/explorer-types.d.ts +10 -0
- package/dist/types/lib/types/semantic-types.d.ts +84 -0
- package/dist/types/lib/utils/build-saved-editor-card.d.ts +20 -0
- package/dist/types/lib/utils/card-type-change.d.ts +16 -0
- package/dist/types/lib/utils/field-availability-context.d.ts +25 -0
- package/dist/types/lib/utils/field-placement.d.ts +96 -0
- package/dist/types/lib/utils/field-state-calculator.d.ts +161 -0
- package/dist/types/lib/utils/qualified-entity-name.d.ts +2 -0
- package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +57 -1
- package/dist/types/shared/analytics-protocol/field-provenance.d.ts +89 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +2 -0
- package/dist/types/shared/analytics-protocol/query-policies.d.ts +52 -0
- package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/time-window.d.ts +40 -1
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +4 -1
- package/dist/types/shared/assistant-protocol/answer-text.d.ts +20 -0
- package/dist/types/shared/assistant-protocol/context.d.ts +29 -29
- package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
- package/dist/types/shared/assistant-protocol/limits.d.ts +6 -1
- package/dist/types/shared/assistant-protocol/parts.d.ts +43 -3
- package/dist/types/shared/assistant-protocol/request.d.ts +14 -2
- package/dist/types/shared/dashboard-authoring/calculated-field-identity.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +487 -0
- package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +34 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +7886 -0
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +45 -0
- package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +54 -0
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +96 -0
- package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +3 -3
- package/dist/types/shared/dashboard-authoring/column-catalog.d.ts +32 -0
- package/dist/types/shared/dashboard-authoring/contracts.d.ts +0 -55
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +24 -14
- package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +9 -1
- package/dist/types/shared/dashboard-authoring/dashboard-filter-automatic-target.d.ts +4 -4
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +3 -1
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-types.d.ts +27 -1
- package/dist/types/shared/dashboard-authoring/dashboard-filter-value-compatibility.d.ts +12 -3
- package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +26 -0
- package/dist/types/shared/dashboard-authoring/filter-applicability.d.ts +75 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-copy.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-preview.d.ts +97 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +22 -2
- package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +10 -37
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +189 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +101 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +100 -0
- package/dist/types/shared/dashboard-authoring/semantic-auto-join-card.d.ts +22 -0
- package/dist/types/shared/dashboard-authoring/validators.d.ts +1 -2
- package/dist/types/shared/layouts/engine/grid.d.ts +25 -0
- package/dist/types/shared/layouts/engine/index.d.ts +4 -0
- package/dist/types/shared/layouts/engine/sheet-layout.d.ts +7 -0
- package/dist/types/shared/layouts/engine/types.d.ts +125 -0
- package/dist/types/shared/layouts/index.d.ts +1 -2
- package/package.json +2 -2
- package/dist/chunks/apply-dashboard-operations-CZEMsx8E.js +0 -2080
- package/dist/chunks/calendar-day-equality-dvoQp1xW.js +0 -410
- package/dist/chunks/comparison-window-caption-D4E6IHPD.js +0 -1624
- package/dist/chunks/custom-visual-inputs-DLCD9Y5V.js +0 -329
- package/dist/chunks/dashboard-controls-Cq05n3e0.js +0 -2315
- package/dist/chunks/dashboard-filter-value-compatibility-CwQ_iSNb.js +0 -108
- package/dist/chunks/matrix-analytical-definition-C7Gb0e12.js +0 -117
- package/dist/chunks/normalize-dashboard-for-dirty-check-Bk3VYv_q.js +0 -67
- package/dist/chunks/numeric-presentation-7X_IrD58.js +0 -5226
- package/dist/chunks/resolve-dashboard-input-context-DJ2tICwz.js +0 -9415
- package/dist/chunks/stable-serialize-CfqXeiBP.js +0 -6
- package/dist/chunks/table-settings-CLZocegs.js +0 -501
- package/dist/chunks/use-debounced-dirty-check-BwAbnX_5.js +0 -59
- package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +0 -46
- package/dist/types/shared/dashboard-authoring/change-compiler.d.ts +0 -7
- package/dist/types/shared/dashboard-authoring/layout-compiler.d.ts +0 -2
- package/dist/types/shared/layouts/create-frame-layouts.d.ts +0 -27
- package/dist/types/shared/layouts/frame-layouts.d.ts +0 -23
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/table-settings-
|
|
1
|
+
import { a, R as s, D as o } from "../chunks/report-preferences-dialog-DoVyriYC.js";
|
|
2
|
+
import { C as f, E as D } from "../chunks/table-settings-WysCBj62.js";
|
|
3
3
|
export {
|
|
4
4
|
f as CONTROL_CARD_DEFAULT_VALUE,
|
|
5
5
|
a as DisplayFormatPreferencesFields,
|
|
@@ -35,6 +35,8 @@ export { VisualEditingControls } from './editor/editor-main/visual-editing-contr
|
|
|
35
35
|
export { AdvancedModeToggle } from './editor/editor-main/advanced-mode-toggle.js';
|
|
36
36
|
export { AssistantProvider } from './assistant/assistant-provider.js';
|
|
37
37
|
export { AssistantPanel, AssistantToolbarButton } from './assistant/assistant-entry-points.js';
|
|
38
|
+
export { ArrangeLayoutButton } from './surfboard/arrange-layout-button.js';
|
|
39
|
+
export { ScreenSizePreviewButton } from './surfboard/screen-size-preview-button.js';
|
|
38
40
|
export type { AssistantPanelSurface } from './assistant/assistant-entry-points.js';
|
|
39
41
|
export { useAssistant } from './assistant/use-assistant.js';
|
|
40
42
|
export * from '../lib/types/common-types.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arrange in the dashboard toolbar (responsive layouts RL-D13): lays the
|
|
3
|
+
* selected grid sheet out by kind on every screen size, or tidies it in its
|
|
4
|
+
* current order, with Undo on the toast (RL-INV-7). Shown while editing a
|
|
5
|
+
* grid sheet. Reads only the dashboard store, so semaphor-app mounts it in
|
|
6
|
+
* its own toolbar as well as the package's.
|
|
7
|
+
*/
|
|
8
|
+
export declare function ArrangeLayoutButton(): import("react").JSX.Element | null;
|
|
@@ -147,6 +147,13 @@ type BaseFilter = {
|
|
|
147
147
|
* intersects with it (analytics kernel P2a-01).
|
|
148
148
|
*/
|
|
149
149
|
dateOwner?: 'global_date';
|
|
150
|
+
/**
|
|
151
|
+
* Only for a mapping `relationship` target (relationship filter reach,
|
|
152
|
+
* RF-D10): the server resolves exactly these ids or blocks the card.
|
|
153
|
+
*/
|
|
154
|
+
relationshipRoute?: {
|
|
155
|
+
relationshipIds: string[];
|
|
156
|
+
};
|
|
150
157
|
};
|
|
151
158
|
type FilterForString = BaseFilter & {
|
|
152
159
|
operation: 'like' | 'not like';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opens and closes the sheet's screen-size bar (responsive layouts RL-D19,
|
|
3
|
+
* RL-D21). While editing, the bar shows Desktop, Laptop, Tablet, Phone and
|
|
4
|
+
* Small phone and lets Tablet and Phone be customized; while viewing, it is a
|
|
5
|
+
* look-only preview starting at the size the grid shows now. Closed by default.
|
|
6
|
+
* The host places it beside the Activity bell for people who can edit the
|
|
7
|
+
* dashboard. Reads only the dashboard store, so semaphor-app mounts it in its
|
|
8
|
+
* own toolbar too.
|
|
9
|
+
*/
|
|
10
|
+
export declare function ScreenSizePreviewButton(): import("react").JSX.Element | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SemaphorFilterReachEntry } from '../../../shared/analytics-protocol/index.js';
|
|
1
2
|
import { MatrixCardCatalog } from '../../../lib/matrix-table/matrix-card-adapter.js';
|
|
2
3
|
import { TCard, TFrame } from '../../../lib/types/common-types.js';
|
|
3
4
|
import { MatrixDeliveryContext } from '../../../lib/matrix-table/matrix-delivery.js';
|
|
@@ -9,6 +10,8 @@ type Props = {
|
|
|
9
10
|
capabilities?: MatrixInteractionHost['capabilities'];
|
|
10
11
|
onSizingChange?: (sizes: Record<string, number>) => void;
|
|
11
12
|
onDeliveryChange?: (context: MatrixDeliveryContext | undefined) => void;
|
|
13
|
+
/** The latest window's per-filter report, for the card's filter info (relationship filter reach RF-D13). */
|
|
14
|
+
onFilterReachChange?: (filterReach: SemaphorFilterReachEntry[]) => void;
|
|
12
15
|
mode: 'dashboard' | 'expanded' | 'editor';
|
|
13
16
|
};
|
|
14
17
|
/** One renderer adapter for dashboard, editor and expanded hosts. */
|
package/dist/types/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { C as s, E as r, V as l, i as o, c as i, g as n, f as d, b as m, e as u, d as E, a as c, u as p, s as C, h as T, j as D, q as A, o as I, m as _, n as F, p as S, k as b, l as L, r as f, t as N } from "../chunks/table-settings-
|
|
2
|
-
import { C as y, D as M, L as g, P as h, e as x, g as O, j as V, h as k, k as w, d as U, b as B, i as K, c as z, n as v, f as P } from "../chunks/validators-
|
|
3
|
-
import { D as q } from "../chunks/token-types-
|
|
4
|
-
import { B as Q, a as j, p as W, r as J } from "../chunks/bookmark-state-
|
|
5
|
-
import { r as H, a as Z } from "../chunks/pivot-result-identity-
|
|
6
|
-
import { D as ee } from "../chunks/report-runtime-context-
|
|
1
|
+
import { C as s, E as r, V as l, i as o, c as i, g as n, f as d, b as m, e as u, d as E, a as c, u as p, s as C, h as T, j as D, q as A, o as I, m as _, n as F, p as S, k as b, l as L, r as f, t as N } from "../chunks/table-settings-WysCBj62.js";
|
|
2
|
+
import { C as y, D as M, L as g, P as h, e as x, g as O, j as V, h as k, k as w, d as U, b as B, i as K, c as z, n as v, f as P } from "../chunks/validators-C-aOQlTB.js";
|
|
3
|
+
import { D as q } from "../chunks/token-types-BMqRmT-C.js";
|
|
4
|
+
import { B as Q, a as j, p as W, r as J } from "../chunks/bookmark-state-Cu-a5ie_.js";
|
|
5
|
+
import { r as H, a as Z } from "../chunks/pivot-result-identity-C-Q1j1Wb.js";
|
|
6
|
+
import { D as ee } from "../chunks/report-runtime-context-hWiTCzFV.js";
|
|
7
7
|
const e = [
|
|
8
8
|
"concatenate",
|
|
9
9
|
"conditional-category",
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TChartType } from './types.js';
|
|
2
|
+
/** The chart types that render as tables. No runtime imports: server-safe code reads these. */
|
|
3
|
+
export declare const TABLE_CHART_TYPES: readonly ["table", "pivotTable", "aggregateTable", "matrixTable", "detailTable"];
|
|
4
|
+
export declare function isTableChartType(chartType: TChartType | string | undefined | null): boolean;
|
|
@@ -7,6 +7,7 @@ import { SemaphorResultColumn } from '../../shared/analytics-protocol/index.js';
|
|
|
7
7
|
import { PresentationExecutionSnapshot } from '../../shared/format-utils/index.js';
|
|
8
8
|
import { CartesianTemporalPresentation } from '../formatters/cartesian-temporal-presentation.js';
|
|
9
9
|
import { CartesianFieldRoles } from './cartesian-fields.js';
|
|
10
|
+
import { TABLE_CHART_TYPES, isTableChartType } from './table-chart-types.js';
|
|
10
11
|
export type ChartConfigParams = {
|
|
11
12
|
card: TCard;
|
|
12
13
|
data: any[];
|
|
@@ -49,8 +50,7 @@ export type BlurEffectProps = {
|
|
|
49
50
|
blurColor?: string;
|
|
50
51
|
};
|
|
51
52
|
export type TChartType = 'bar' | 'horizontalBar' | 'line' | 'area' | 'stackedArea' | 'combo' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'matrixTable' | 'detailTable' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'bullet' | 'heatmap' | 'treemap' | 'custom';
|
|
52
|
-
export
|
|
53
|
-
export declare function isTableChartType(chartType: TChartType | string | undefined | null): boolean;
|
|
53
|
+
export { TABLE_CHART_TYPES, isTableChartType };
|
|
54
54
|
export declare function isChartJsVisualType(chartType: TChartType | string | undefined | null): boolean;
|
|
55
55
|
export declare const REGULAR_TABLE_SETTINGS_CHART_TYPES: readonly ["table", "matrixTable", "pivotTable", "aggregateTable", "detailTable"];
|
|
56
56
|
export declare function supportsRegularTableSettings(chartType: TChartType | string | undefined | null): boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TFilter } from '../../components/surfboard/filter/types.js';
|
|
2
2
|
import { DashboardInputScope, TCard, TDashboard } from '../types/common-types.js';
|
|
3
|
-
import { DashboardFilterApplication, DashboardFilterCardApplication, DashboardFilterTarget, DashboardFilterTargetField } from '../../shared/dashboard-authoring/index.js';
|
|
3
|
+
import { DashboardFilterApplication, DashboardFilterCardApplication, DashboardFilterRelationshipTarget, DashboardFilterFieldTarget, DashboardFilterTarget, DashboardFilterTargetField, DashboardFilterOptionSource, FilterReachPreviewCard, FilterReachCardPreview, FilterReachPathOption } from '../../shared/dashboard-authoring/index.js';
|
|
4
|
+
import { SemaphorRelationshipRoute, SemaphorSkippedConstraintReason } from '../../shared/analytics-protocol/index.js';
|
|
4
5
|
import { FilterRef, ReachedCard } from '../../shared/dashboard-authoring/filter-model/index.js';
|
|
5
6
|
/**
|
|
6
7
|
* Filter mapping (one filter model M3, SPEC 4.4): the Cards tab of any filter
|
|
@@ -9,19 +10,169 @@ import { FilterRef, ReachedCard } from '../../shared/dashboard-authoring/filter-
|
|
|
9
10
|
*/
|
|
10
11
|
export type DashboardFilterMappingCandidateCatalog = {
|
|
11
12
|
status: 'ready';
|
|
12
|
-
targets:
|
|
13
|
+
targets: DashboardFilterFieldTarget[];
|
|
13
14
|
} | {
|
|
14
15
|
status: 'metadataUnavailable';
|
|
15
16
|
message?: string;
|
|
16
17
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
/**
|
|
19
|
+
* What the author decided for a card, as the draft stands: what Accept saves
|
|
20
|
+
* (relationship filter reach S-D, RF-INV-14). A change staged in this
|
|
21
|
+
* popover, else the card's saved entry, else Auto.
|
|
22
|
+
*/
|
|
23
|
+
export type DashboardFilterCardDecision =
|
|
24
|
+
/** No entry of its own: the card applies the filter on its own field when that is proven, else through the domain's relationships. */
|
|
25
|
+
{
|
|
26
|
+
kind: 'auto';
|
|
27
|
+
} | {
|
|
28
|
+
kind: 'field';
|
|
29
|
+
target: DashboardFilterFieldTarget;
|
|
30
|
+
}
|
|
31
|
+
/** A chosen relationship path (RF-D10). */
|
|
32
|
+
| {
|
|
33
|
+
kind: 'path';
|
|
34
|
+
target: DashboardFilterRelationshipTarget;
|
|
35
|
+
} | {
|
|
36
|
+
kind: 'excluded';
|
|
37
|
+
};
|
|
38
|
+
/** Where a row's decision comes from: a change in this popover, the saved mapping, or neither. */
|
|
39
|
+
export type DashboardFilterDecisionOrigin = 'staged' | 'saved' | 'none';
|
|
40
|
+
/** What runs for a card's decision, as the draft stands (RF-INV-14). */
|
|
41
|
+
export type DashboardFilterCardOutcome =
|
|
42
|
+
/** On a field of the card: the one the author bound, the one Auto proves (or a click borrows), or the one a SQL card takes the value by. */
|
|
43
|
+
{
|
|
44
|
+
kind: 'appliesOnField';
|
|
45
|
+
target: DashboardFilterFieldTarget;
|
|
46
|
+
how: 'bound';
|
|
47
|
+
} | {
|
|
48
|
+
kind: 'appliesOnField';
|
|
49
|
+
target: DashboardFilterFieldTarget;
|
|
50
|
+
how: 'automatic';
|
|
51
|
+
} | {
|
|
52
|
+
kind: 'appliesOnField';
|
|
53
|
+
target: DashboardFilterFieldTarget;
|
|
54
|
+
how: 'sql';
|
|
55
|
+
name: string;
|
|
56
|
+
}
|
|
57
|
+
/** Through the domain's relationships, on the server's route. */
|
|
58
|
+
| {
|
|
59
|
+
kind: 'appliesThroughPath';
|
|
60
|
+
route: SemaphorRelationshipRoute;
|
|
61
|
+
}
|
|
62
|
+
/** The card's query already uses the value's dataset, so no path is needed (ledger R-05). */
|
|
63
|
+
| {
|
|
64
|
+
kind: 'appliesOnOwnData';
|
|
65
|
+
}
|
|
66
|
+
/** Auto, and more than one equally preferred path: the card skips the filter until one is chosen; Accept isn't refused (RF-D28). */
|
|
67
|
+
| {
|
|
68
|
+
kind: 'needsPath';
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Auto, and the card's fields need the author: a same-named field to
|
|
72
|
+
* accept, a SQL card that takes the value by name until a field is
|
|
73
|
+
* chosen, or a choice among fields, which refuses Accept.
|
|
74
|
+
*/
|
|
75
|
+
| {
|
|
76
|
+
kind: 'needsField';
|
|
77
|
+
need: 'accept';
|
|
78
|
+
suggestion: DashboardFilterFieldTarget;
|
|
79
|
+
reason?: SemaphorSkippedConstraintReason;
|
|
80
|
+
} | {
|
|
81
|
+
kind: 'needsField';
|
|
82
|
+
need: 'sqlByName';
|
|
83
|
+
name?: string;
|
|
84
|
+
reason?: SemaphorSkippedConstraintReason;
|
|
85
|
+
} | {
|
|
86
|
+
kind: 'needsField';
|
|
87
|
+
need: 'choose';
|
|
88
|
+
reason?: SemaphorSkippedConstraintReason;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The filter doesn't reach the card, with the server's reason or the
|
|
92
|
+
* card's guidance when there is one. `unmatched`: a field a click carries
|
|
93
|
+
* matches none of the card's fields, so the click drops it (no choice).
|
|
94
|
+
*/
|
|
95
|
+
| {
|
|
96
|
+
kind: 'notApplied';
|
|
97
|
+
reason?: SemaphorSkippedConstraintReason;
|
|
98
|
+
message?: string;
|
|
99
|
+
unmatched?: true;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The decision can't run: a stale field, a path the domain no longer has,
|
|
103
|
+
* a path for another value field. Refuses Accept. `target`: the field that
|
|
104
|
+
* can't run when the decision doesn't name it (a click's borrowed binding).
|
|
105
|
+
*/
|
|
106
|
+
| {
|
|
107
|
+
kind: 'blocked';
|
|
108
|
+
message: string;
|
|
109
|
+
reason?: SemaphorSkippedConstraintReason;
|
|
110
|
+
target?: DashboardFilterFieldTarget;
|
|
20
111
|
} | {
|
|
21
112
|
kind: 'excluded';
|
|
113
|
+
}
|
|
114
|
+
/** Waiting for the server's answer for this decision, or the request failed (ledger R-08). */
|
|
115
|
+
| {
|
|
116
|
+
kind: 'checking';
|
|
117
|
+
failed?: true;
|
|
118
|
+
}
|
|
119
|
+
/** The card's source isn't chosen yet, or its fields couldn't be loaded, which refuses Accept. */
|
|
120
|
+
| {
|
|
121
|
+
kind: 'unavailable';
|
|
122
|
+
cause: 'source' | 'fields';
|
|
123
|
+
message?: string;
|
|
124
|
+
reason?: SemaphorSkippedConstraintReason;
|
|
125
|
+
};
|
|
126
|
+
type OutcomeOf<K extends DashboardFilterCardOutcome['kind']> = Extract<DashboardFilterCardOutcome, {
|
|
127
|
+
kind: K;
|
|
128
|
+
}>;
|
|
129
|
+
/**
|
|
130
|
+
* A card's decision with what can run for it: exactly the pairs `cardRow`
|
|
131
|
+
* makes (RF-INV-14). A row changed after `cardRow` into another pair, such
|
|
132
|
+
* as Automatic with a bound field, doesn't compile (ledger R-27).
|
|
133
|
+
*/
|
|
134
|
+
export type DashboardFilterCardState = {
|
|
135
|
+
decision: Extract<DashboardFilterCardDecision, {
|
|
136
|
+
kind: 'auto';
|
|
137
|
+
}>;
|
|
138
|
+
outcome: Extract<DashboardFilterCardOutcome, {
|
|
139
|
+
kind: 'appliesOnField';
|
|
140
|
+
how: 'automatic' | 'sql';
|
|
141
|
+
}> | OutcomeOf<'appliesThroughPath' | 'appliesOnOwnData' | 'needsPath' | 'needsField' | 'notApplied' | 'blocked' | 'checking' | 'unavailable'>;
|
|
142
|
+
} | {
|
|
143
|
+
decision: Extract<DashboardFilterCardDecision, {
|
|
144
|
+
kind: 'field';
|
|
145
|
+
}>;
|
|
146
|
+
outcome: Extract<DashboardFilterCardOutcome, {
|
|
147
|
+
kind: 'appliesOnField';
|
|
148
|
+
how: 'bound';
|
|
149
|
+
}> | OutcomeOf<'blocked' | 'notApplied' | 'unavailable'>;
|
|
150
|
+
} | {
|
|
151
|
+
decision: Extract<DashboardFilterCardDecision, {
|
|
152
|
+
kind: 'path';
|
|
153
|
+
}>;
|
|
154
|
+
outcome: OutcomeOf<'appliesThroughPath' | 'appliesOnOwnData' | 'checking' | 'blocked' | 'notApplied'>;
|
|
155
|
+
} | {
|
|
156
|
+
decision: Extract<DashboardFilterCardDecision, {
|
|
157
|
+
kind: 'excluded';
|
|
158
|
+
}>;
|
|
159
|
+
outcome: OutcomeOf<'excluded' | 'unavailable' | 'notApplied'>;
|
|
22
160
|
};
|
|
23
|
-
|
|
24
|
-
export type
|
|
161
|
+
/** What a row shows, in the names the Cards tab has always used; read from `presentDashboardFilterMappingRow`. */
|
|
162
|
+
export type DashboardFilterMappingRowState = 'pendingSource' | 'automatic' | 'suggested' | 'needsMapping' | 'mapped' | 'notApplicable' | 'excluded' | 'invalidMapping' | 'metadataUnavailable'
|
|
163
|
+
/** Auto, through the domain's relationships (with a route), or on the card's own data (none). */
|
|
164
|
+
| 'relationship'
|
|
165
|
+
/** Auto, and more than one equally preferred path (P-7, RF-D10). */
|
|
166
|
+
| 'chooseRoute'
|
|
167
|
+
/** Waiting for the server's relationship answer, or it failed. */
|
|
168
|
+
| 'relationshipChecking';
|
|
169
|
+
/**
|
|
170
|
+
* One card in the Cards tab: the author's decision and what runs for it
|
|
171
|
+
* (`DashboardFilterCardState`), made only by `cardRow`. Every reader (the
|
|
172
|
+
* panel, the summary, Accept, the click review) reads these two, through
|
|
173
|
+
* `presentDashboardFilterMappingRow` for display.
|
|
174
|
+
*/
|
|
175
|
+
export type DashboardFilterMappingDraftRow = DashboardFilterCardState & {
|
|
25
176
|
cardId: string;
|
|
26
177
|
/** The panel reads the title and meta line from it. */
|
|
27
178
|
card: TCard;
|
|
@@ -31,13 +182,135 @@ export type DashboardFilterMappingDraftRow = {
|
|
|
31
182
|
/** The section's title, for a card in a Document section. */
|
|
32
183
|
sectionTitle?: string;
|
|
33
184
|
executionKind: 'config' | 'sql' | 'unconfigured';
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
185
|
+
decisionOrigin: DashboardFilterDecisionOrigin;
|
|
186
|
+
/** The card's fields that can take the filter. */
|
|
187
|
+
fields: DashboardFilterFieldTarget[];
|
|
188
|
+
/** The card's equally preferred paths when it has a tie, whatever the decision (RF-D27). */
|
|
189
|
+
paths: FilterReachPathOption[];
|
|
190
|
+
/** The card's saved entry, as saved. */
|
|
37
191
|
persistedApplication?: DashboardFilterCardApplication;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
192
|
+
};
|
|
193
|
+
/** The row's control, as it reads when closed. */
|
|
194
|
+
export type DashboardFilterMappingRowTrigger = {
|
|
195
|
+
kind: 'notApplied';
|
|
196
|
+
}
|
|
197
|
+
/** A field, with "Auto ·" or "Suggested ·" before it. */
|
|
198
|
+
| {
|
|
199
|
+
kind: 'field';
|
|
200
|
+
target: DashboardFilterFieldTarget;
|
|
201
|
+
prefix?: 'Auto' | 'Suggested';
|
|
202
|
+
}
|
|
203
|
+
/** A SQL card's Auto: the field it takes the value by. */
|
|
204
|
+
| {
|
|
205
|
+
kind: 'sqlAuto';
|
|
206
|
+
target: DashboardFilterFieldTarget;
|
|
207
|
+
name: string;
|
|
208
|
+
}
|
|
209
|
+
/** A path in words, with "Auto ·" before it when the domain's relationships chose it. */
|
|
210
|
+
| {
|
|
211
|
+
kind: 'route';
|
|
212
|
+
route: SemaphorRelationshipRoute;
|
|
213
|
+
auto: boolean;
|
|
214
|
+
} | {
|
|
215
|
+
kind: 'checking';
|
|
216
|
+
} | {
|
|
217
|
+
kind: 'text';
|
|
218
|
+
text: string;
|
|
219
|
+
tone: 'muted' | 'strong' | 'attention';
|
|
220
|
+
};
|
|
221
|
+
/**
|
|
222
|
+
* What Automatic does on the card, said under its menu entry: the path or
|
|
223
|
+
* field it uses, that it skips the card until a path is chosen, or that it
|
|
224
|
+
* doesn't reach the card. Absent when not known for the row's decision.
|
|
225
|
+
*/
|
|
226
|
+
export type DashboardFilterAutoDescription = {
|
|
227
|
+
kind: 'skipsUntilPathChosen';
|
|
228
|
+
} | {
|
|
229
|
+
kind: 'route';
|
|
230
|
+
route: SemaphorRelationshipRoute;
|
|
231
|
+
} | {
|
|
232
|
+
kind: 'ownData';
|
|
233
|
+
} | {
|
|
234
|
+
kind: 'field';
|
|
235
|
+
target: DashboardFilterFieldTarget;
|
|
236
|
+
} | {
|
|
237
|
+
kind: 'checking';
|
|
238
|
+
} | {
|
|
239
|
+
kind: 'notApplied';
|
|
240
|
+
reason?: SemaphorSkippedConstraintReason;
|
|
241
|
+
};
|
|
242
|
+
/** A line under the row. */
|
|
243
|
+
export type DashboardFilterMappingRowNote =
|
|
244
|
+
/** A chosen path that can't run: the server's reason, else its message. */
|
|
245
|
+
{
|
|
246
|
+
kind: 'pathBlocked';
|
|
247
|
+
message: string;
|
|
248
|
+
reason?: SemaphorSkippedConstraintReason;
|
|
249
|
+
} | {
|
|
250
|
+
kind: 'fieldBlocked';
|
|
251
|
+
} | {
|
|
252
|
+
kind: 'needsPath';
|
|
253
|
+
} | {
|
|
254
|
+
kind: 'fieldsUnavailable';
|
|
255
|
+
message: string;
|
|
256
|
+
} | {
|
|
257
|
+
kind: 'sqlPinnedSources';
|
|
258
|
+
};
|
|
259
|
+
/**
|
|
260
|
+
* What a row shows, counts as and offers: one reading of its decision and
|
|
261
|
+
* outcome (RF-INV-14). The panel, the popover summary and the click review
|
|
262
|
+
* read rows only through it.
|
|
263
|
+
*/
|
|
264
|
+
export type DashboardFilterMappingRowView = {
|
|
265
|
+
state: DashboardFilterMappingRowState;
|
|
266
|
+
/** The status column of the table review. */
|
|
267
|
+
label: string;
|
|
268
|
+
tone: 'quiet' | 'review' | 'warning' | 'invalid';
|
|
269
|
+
/** How the row counts in the summary; none while its source or the server's answer is pending. */
|
|
270
|
+
count?: 'covered' | 'review' | 'excluded' | 'invalid';
|
|
271
|
+
/** Counted to review or invalid. */
|
|
272
|
+
attention: boolean;
|
|
273
|
+
/** Accept is refused while the row stands: a decision that can't run, a field to choose, fields not loaded. */
|
|
274
|
+
blocksAccept: boolean;
|
|
275
|
+
/** A menu, or a control that only says why there is nothing to choose. */
|
|
276
|
+
control: {
|
|
277
|
+
kind: 'menu';
|
|
278
|
+
} | {
|
|
279
|
+
kind: 'static';
|
|
280
|
+
text: string;
|
|
281
|
+
offerFieldsRetry: boolean;
|
|
282
|
+
};
|
|
283
|
+
trigger: DashboardFilterMappingRowTrigger;
|
|
284
|
+
border: 'default' | 'review' | 'invalid' | 'dashed';
|
|
285
|
+
note?: DashboardFilterMappingRowNote;
|
|
286
|
+
/**
|
|
287
|
+
* The menu, in order: Auto, the tie's paths, the card's fields, "Don't
|
|
288
|
+
* apply", and "Check relationships again" while a check failed. The
|
|
289
|
+
* decision is the one checked entry; picking it again changes nothing.
|
|
290
|
+
*/
|
|
291
|
+
menu: {
|
|
292
|
+
auto: {
|
|
293
|
+
label: string;
|
|
294
|
+
checked: boolean;
|
|
295
|
+
description?: DashboardFilterAutoDescription;
|
|
296
|
+
};
|
|
297
|
+
paths: Array<{
|
|
298
|
+
path: FilterReachPathOption;
|
|
299
|
+
checked: boolean;
|
|
300
|
+
}>;
|
|
301
|
+
/** The field a `field` decision binds, as the card lists it. */
|
|
302
|
+
checkedField?: DashboardFilterFieldTarget;
|
|
303
|
+
/**
|
|
304
|
+
* The field Auto proves on this card: picking it keeps Auto, so a filter
|
|
305
|
+
* with no mapping isn't mapped by confirming what already applies.
|
|
306
|
+
*/
|
|
307
|
+
autoField?: DashboardFilterFieldTarget;
|
|
308
|
+
excludedChecked: boolean;
|
|
309
|
+
/** "Check relationships again" (ledger R-08). */
|
|
310
|
+
offerRetry: boolean;
|
|
311
|
+
};
|
|
312
|
+
/** The row involves the domain's relationships, so "Manage relationships" helps. */
|
|
313
|
+
throughRelationships: boolean;
|
|
41
314
|
};
|
|
42
315
|
export type DashboardFilterMappingGroup = {
|
|
43
316
|
sheetId: string;
|
|
@@ -99,6 +372,11 @@ export type DashboardFilterMappingRequest = {
|
|
|
99
372
|
stagedDefinition?: TFilter;
|
|
100
373
|
/** The scope being edited, if changed; otherwise the saved scope, unnarrowed (OF-D8). */
|
|
101
374
|
stagedScope?: DashboardInputScope;
|
|
375
|
+
/**
|
|
376
|
+
* The Option Source being edited: undefined keeps the saved one, null drops
|
|
377
|
+
* it. The filter's value is judged by it, as the runtime will (ledger R-04).
|
|
378
|
+
*/
|
|
379
|
+
stagedOptionSource?: DashboardFilterOptionSource | null;
|
|
102
380
|
candidatesByCardId: Record<string, DashboardFilterMappingCandidateCatalog | undefined>;
|
|
103
381
|
/** Grounded field that supplies the current filter value. */
|
|
104
382
|
selectionField?: Pick<DashboardFilterTargetField, 'name' | 'sourceField'> & Partial<Pick<DashboardFilterTargetField, 'source'>>;
|
|
@@ -111,22 +389,32 @@ export type DashboardFilterMappingRequest = {
|
|
|
111
389
|
selectionDataType?: string;
|
|
112
390
|
/** Re-check saved targets after the option value field changed. */
|
|
113
391
|
revalidatePersistedTargets?: boolean;
|
|
114
|
-
decisionsByCardId?: Record<string,
|
|
392
|
+
decisionsByCardId?: Record<string, DashboardFilterCardDecision | undefined>;
|
|
393
|
+
/**
|
|
394
|
+
* The server's relationship preview per card (`POST /api/v1/filter-reach`,
|
|
395
|
+
* relationship filter reach Phase 3). The draft never resolves routes.
|
|
396
|
+
*/
|
|
397
|
+
relationshipPreviewsByCardId?: Record<string, FilterReachCardPreview | undefined>;
|
|
398
|
+
/**
|
|
399
|
+
* The server preview could not be read. Cards waiting on it say so instead
|
|
400
|
+
* of checking forever; nothing is saved for them, so Accept is not blocked
|
|
401
|
+
* (ledger R-08).
|
|
402
|
+
*/
|
|
403
|
+
relationshipPreviewFailed?: boolean;
|
|
115
404
|
/** Test seam for new binding ids; production uses opaque random UUIDs. */
|
|
116
405
|
createId?: () => string;
|
|
117
406
|
};
|
|
118
407
|
/**
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
* whether an author needs to act.
|
|
408
|
+
* The Cards tab's counts, from each row's view: the one reading every
|
|
409
|
+
* surface uses to decide whether the author needs to act.
|
|
122
410
|
*/
|
|
123
411
|
export declare function summarizeDashboardFilterMappingRows(rows: DashboardFilterMappingDraftRow[]): DashboardFilterMappingStatusSummary;
|
|
124
412
|
/**
|
|
125
413
|
* One Cards row for a source-qualified value field that is not a toolbar
|
|
126
414
|
* filter, such as a field a click carries. It is the same decision chain the
|
|
127
|
-
* toolbar filter's rows go through (`
|
|
128
|
-
*
|
|
129
|
-
*
|
|
415
|
+
* toolbar filter's rows go through (`cardRow`), so automatic, suggested,
|
|
416
|
+
* mapped, excluded and needs-mapping mean the same thing on every authoring
|
|
417
|
+
* surface. Equality is the only operation a click applies.
|
|
130
418
|
*/
|
|
131
419
|
export declare function buildDashboardFilterMappingDraftRowForValueField(params: {
|
|
132
420
|
card: TCard;
|
|
@@ -136,10 +424,47 @@ export declare function buildDashboardFilterMappingDraftRowForValueField(params:
|
|
|
136
424
|
sectionTitle?: string;
|
|
137
425
|
valueField: DashboardFilterTargetField;
|
|
138
426
|
catalog: DashboardFilterMappingCandidateCatalog | undefined;
|
|
139
|
-
decision
|
|
427
|
+
/** The click's own decision for the card: its binding, "Don't apply", or none (Auto). */
|
|
428
|
+
decision?: DashboardFilterCardDecision;
|
|
140
429
|
persistedApplication?: DashboardFilterCardApplication;
|
|
141
430
|
/** Bindings already accepted elsewhere for this value field, offered as inherited matches. */
|
|
142
431
|
acceptedTargets?: DashboardFilterTarget[];
|
|
432
|
+
/** A filter's binding Auto applies first (`cardRow`'s `borrowedTarget`). */
|
|
433
|
+
borrowedTarget?: DashboardFilterFieldTarget;
|
|
434
|
+
/** What a card with no matching field gets (`cardRow`'s `unmatchedField`). */
|
|
435
|
+
unmatchedField?: 'choose' | 'notApplied';
|
|
143
436
|
}): DashboardFilterMappingDraftRow;
|
|
437
|
+
/** The decision that saves a target the author picked: a field, or a path. */
|
|
438
|
+
export declare function dashboardFilterCardDecisionForTarget(target: DashboardFilterTarget): DashboardFilterCardDecision;
|
|
439
|
+
/**
|
|
440
|
+
* A card's decision as the draft stands, and where it comes from: a change
|
|
441
|
+
* staged in this popover, else the saved entry, else Auto. The rows and the
|
|
442
|
+
* preview's card list both read it here.
|
|
443
|
+
*/
|
|
444
|
+
export declare function draftCardDecision(staged: DashboardFilterCardDecision | undefined, persisted: DashboardFilterCardApplication | undefined): {
|
|
445
|
+
decision: DashboardFilterCardDecision;
|
|
446
|
+
origin: DashboardFilterDecisionOrigin;
|
|
447
|
+
};
|
|
448
|
+
/**
|
|
449
|
+
* What a row shows, counts as and offers, read from its decision and
|
|
450
|
+
* outcome only (relationship filter reach S-D, RF-INV-14).
|
|
451
|
+
*/
|
|
452
|
+
export declare function presentDashboardFilterMappingRow(row: DashboardFilterMappingDraftRow): DashboardFilterMappingRowView;
|
|
144
453
|
/** The one entry point of M3 (SPEC 4.4). Pure. */
|
|
145
454
|
export declare function draftDashboardFilterMapping(request: DashboardFilterMappingRequest): DashboardFilterMappingDraftResult;
|
|
455
|
+
/**
|
|
456
|
+
* The cards in a staged filter's scope whose relationship reach the server
|
|
457
|
+
* preview should resolve, each with the route the draft runs it with (ledger
|
|
458
|
+
* R-02): cards with a chosen route, staged or saved, and cards the card
|
|
459
|
+
* target decision runs through the domain's relationships when unmapped (row
|
|
460
|
+
* 7r). Empty when there are none, so no preview is requested.
|
|
461
|
+
*/
|
|
462
|
+
export declare function listRelationshipPreviewCards(params: {
|
|
463
|
+
ref: FilterRef;
|
|
464
|
+
dashboard: TDashboard;
|
|
465
|
+
stagedDefinition?: TFilter;
|
|
466
|
+
stagedScope?: DashboardInputScope;
|
|
467
|
+
stagedOptionSource?: DashboardFilterOptionSource | null;
|
|
468
|
+
decisionsByCardId?: Record<string, DashboardFilterCardDecision | undefined>;
|
|
469
|
+
}): FilterReachPreviewCard[];
|
|
470
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { TFilter, TFilterValue } from '../../components/surfboard/filter/types.js';
|
|
2
|
+
import { NormalizedFilterDashboardInput } from '../types/common-types.js';
|
|
3
|
+
import { DashboardFilterLogicalValueField, DashboardFilterOptionSource, DashboardFilterRelationshipTarget, DashboardFilterTargetField, DashboardFilterTargetSource } from '../../shared/dashboard-authoring/index.js';
|
|
4
|
+
import { SemaphorConnectionCapabilities } from '../../shared/analytics-protocol/index.js';
|
|
5
|
+
export type DashboardFilterSourceResolutionContext = {
|
|
6
|
+
connectionType?: string;
|
|
7
|
+
capabilities?: Pick<SemaphorConnectionCapabilities, 'dialect' | 'prefixLevels'>;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Resolves the concrete source carried by an Option Source field, falling
|
|
11
|
+
* back to the Option Source declaration for older field refs that omit it.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveDashboardFilterOptionFieldSource(field: DashboardFilterOptionSource['valueField'], fallbackSource: DashboardFilterOptionSource['source']): DashboardFilterTargetSource;
|
|
14
|
+
export declare function resolveDashboardFilterBackingSourceResolution(filter: TFilter, context?: DashboardFilterSourceResolutionContext): import('../../shared/analytics-protocol/index.js').SemaphorSourceEntityResolution<Record<string, unknown>>;
|
|
15
|
+
/** Resolves the one source that owns an ordinary dashboard filter field. */
|
|
16
|
+
export declare function resolveDashboardFilterBackingSource(filter: TFilter, context?: DashboardFilterSourceResolutionContext): DashboardFilterTargetSource | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Metadata authoring may inspect a complete persisted qualified source even
|
|
19
|
+
* when stale selected-entity inventory no longer contains it. Runtime source
|
|
20
|
+
* resolution remains fail-closed through resolveDashboardFilterBackingSource.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveDashboardFilterMappingCandidateSource(filter: TFilter, context?: DashboardFilterSourceResolutionContext): DashboardFilterTargetSource | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Resolves every proven identity by which the selected filter field may map.
|
|
25
|
+
* A physical dataset selected within a semantic domain legitimately has both
|
|
26
|
+
* a physical backing identity and a semantic projection; the consuming card
|
|
27
|
+
* chooses the identity present in its own executable-source inventory.
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveDashboardFilterMappingSources(filter: TFilter): DashboardFilterTargetSource[];
|
|
30
|
+
/**
|
|
31
|
+
* Authoring counterpart to resolveDashboardFilterMappingSources. It may carry
|
|
32
|
+
* a complete qualified backing candidate when persisted entity inventory is
|
|
33
|
+
* stale, while the semantic projection still requires a resolved entity.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveDashboardFilterMappingCandidateSources(filter: TFilter, context?: DashboardFilterSourceResolutionContext): DashboardFilterTargetSource[];
|
|
36
|
+
/** Resolves the ordinary filter field used as the pre-Option-Source value key. */
|
|
37
|
+
export declare function deriveDashboardFilterLogicalSelectionField(filter: TFilter): Pick<DashboardFilterTargetField, 'name'> | undefined;
|
|
38
|
+
/** The filter's logical value field: its Option Source's value field, else its own field. */
|
|
39
|
+
export declare function filterInputLogicalValueField(input: NormalizedFilterDashboardInput, filterValue?: TFilterValue): DashboardFilterLogicalValueField | undefined;
|
|
40
|
+
/** The sources a filter's values belong to: its Option Source's, else its own field's. */
|
|
41
|
+
export declare function filterInputValueSources(input: NormalizedFilterDashboardInput): DashboardFilterTargetSource[];
|
|
42
|
+
/**
|
|
43
|
+
* The source-qualified fields whose values a toolbar filter holds. A filter
|
|
44
|
+
* with an option source has exactly one; an ordinary filter has one per
|
|
45
|
+
* source it is proven to address.
|
|
46
|
+
*/
|
|
47
|
+
export declare function dashboardFilterInputValueFields(input: NormalizedFilterDashboardInput): DashboardFilterTargetField[];
|
|
48
|
+
/**
|
|
49
|
+
* Whether an author-chosen relationship route (RF-D10) still ends at the
|
|
50
|
+
* filter's value field: the field the filter's values belong to (its Option
|
|
51
|
+
* Source's value field when it has one). A route chosen for another field,
|
|
52
|
+
* as after the Option Source moves to another dataset, can't run and is stale
|
|
53
|
+
* until chosen again. The card target decision, the Cards tab draft and save
|
|
54
|
+
* validation all ask here (relationship filter reach ledger R-12).
|
|
55
|
+
*/
|
|
56
|
+
export declare function relationshipTargetFollowsValueField(input: NormalizedFilterDashboardInput, target: DashboardFilterRelationshipTarget): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* The target that saves an author's choice of a relationship route (RF-D10):
|
|
59
|
+
* the route's ids and the filter's value field as its semantic dataset in the
|
|
60
|
+
* card's domain, the field `relationshipTargetFollowsValueField` checks. A
|
|
61
|
+
* value field can also have a physical identity (a physical dataset in a
|
|
62
|
+
* semantic domain); the route ends at the semantic one. The server preview
|
|
63
|
+
* builds the Cards tab's choices here (ledger R-16).
|
|
64
|
+
*/
|
|
65
|
+
export declare function relationshipRouteTarget(input: NormalizedFilterDashboardInput, domainId: string, relationshipIds: readonly string[]): DashboardFilterRelationshipTarget | undefined;
|
|
@@ -80,3 +80,9 @@ export declare function removeDashboardInputSlotsById(values: DashboardInputValu
|
|
|
80
80
|
* are the stored slots, read without building the model.
|
|
81
81
|
*/
|
|
82
82
|
export declare function savedDefaultInputValues(dashboard: Pick<TDashboard, 'defaultInputValues' | 'defaultFilterValues'>): DashboardInputValues | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Every value an input holds, saved or live, removed: its shared slot and its
|
|
85
|
+
* slot on every sheet, card and Document section. Shared by the store's
|
|
86
|
+
* input removal and the dashboard reducer's `filter.remove`.
|
|
87
|
+
*/
|
|
88
|
+
export declare function removeDashboardInputFromValues(values: DashboardInputValues | undefined, inputId: string): DashboardInputValues;
|
|
@@ -108,6 +108,8 @@ export declare function buildFilterInputFromField(params: {
|
|
|
108
108
|
scope: DashboardInputScope;
|
|
109
109
|
existingInputs: readonly DashboardInput[];
|
|
110
110
|
createId?: () => string;
|
|
111
|
+
/** The filter's label (and variable name); default the field's label. */
|
|
112
|
+
label?: string;
|
|
111
113
|
}): EmbeddedFilterDashboardInput;
|
|
112
114
|
/**
|
|
113
115
|
* A new filter input holding this definition (one filter model Phase 5):
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TDashboard } from '../types/common-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* A saved dashboard as it enters a runtime (one filter model SPEC 5.1): the
|
|
4
|
+
* filter model's stored shape, every filter an embedded input, when the
|
|
5
|
+
* model reads it without issues; otherwise the template as received, read
|
|
6
|
+
* tolerantly (rejected inputs left out) and refused on save. Then the
|
|
7
|
+
* Include / Exclude repair. Loading never throws on model issues.
|
|
8
|
+
*
|
|
9
|
+
* The one entry for every runtime: the client load (`useDashboard`), the
|
|
10
|
+
* store's replace and load (`setDashboard`, `setDashboardWithFilterValues`)
|
|
11
|
+
* and the server's saved-dashboard reader, so they all hold the same shape.
|
|
12
|
+
* The same object when nothing changes. Alias-based text is bound to stable
|
|
13
|
+
* input ids before the upgrade (`upgradeToStoredDashboard`, ledger P5-11).
|
|
14
|
+
*/
|
|
15
|
+
export declare function prepareLoadedDashboard<TDashboardShape extends TDashboard>(dashboard: TDashboardShape): TDashboardShape;
|