react-semaphor 0.1.559 → 0.1.561
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 +389 -378
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +5 -5
- package/dist/brand-studio/index.js +9 -9
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/analytics-base-schemas-CB3oFAXk.js +658 -0
- package/dist/chunks/{assistant-chat-B_4bVE6I.js → assistant-chat-DiVHY3Hw.js} +209 -211
- package/dist/chunks/bookmark-impact-CR09dpkn.js +75 -0
- package/dist/chunks/bookmark-state-BusLpkb7.js +743 -0
- package/dist/chunks/{braces-Rdxa3H-s.js → braces-u8VorWJc.js} +1 -1
- package/dist/chunks/{comparison-window-caption-CKzQ5LcF.js → comparison-window-caption-DDsIWJYT.js} +201 -201
- package/dist/chunks/{context-DVy4HOU0.js → context-TUjw9eqr.js} +1 -1
- package/dist/chunks/{custom-visual-inputs-zVa9wX_o.js → custom-visual-inputs-DfolidZ9.js} +1 -1
- package/dist/chunks/{dashboard-BziwOVpZ.js → dashboard-BRdZBPqr.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CbeNR-YI.js → dashboard-briefing-launcher-CgvTLndW.js} +1163 -1178
- package/dist/chunks/{dashboard-controls-RD6UJs1r.js → dashboard-controls-B4vfSzTF.js} +877 -941
- package/dist/chunks/{dashboard-json-DGpv17vL.js → dashboard-json-Y3MF59g7.js} +5 -5
- package/dist/chunks/document-dashboard-inputs-CvBbFTUA.js +1718 -0
- package/dist/chunks/{edit-dashboard-visual-AQ2pQkFp.js → edit-dashboard-visual-DwjZcxj-.js} +9080 -9354
- package/dist/chunks/filter-reach-copy-bijwf_-b.js +3596 -0
- package/dist/chunks/{filter-value-text-B4l-xqJT.js → filter-value-text-DFnhwuEW.js} +3 -3
- package/dist/chunks/global-date-filter-utils-BXgCpvQM.js +15142 -0
- package/dist/chunks/{index-B1Xr7W24.js → index-ClwbY3BL.js} +648 -674
- package/dist/chunks/{layout-grid-Bbz3zKif.js → layout-grid-CtvCBfOm.js} +1 -1
- package/dist/chunks/{list-filter-3sbH0Uy1.js → list-filter-BklYgciR.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-CEe3PGEo.js → matrix-analytical-definition-pU51-JmY.js} +4 -4
- package/dist/chunks/{matrix-card-BRNGb1C4.js → matrix-card-CUorIB7Q.js} +3 -3
- package/dist/chunks/{matrix-member-presentation-CEegvTqg.js → matrix-member-presentation-Df5UgCGN.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-COxrfQTS.js → matrix-operation-contract-BSiGEXVC.js} +221 -214
- package/dist/chunks/{metric-comparison-DQx-uX__.js → metric-comparison-95aC0uEO.js} +6 -6
- package/dist/chunks/{model-change-CJEj3ZD6.js → model-change-B5wQhg5G.js} +1 -1
- package/dist/chunks/{palette-DMJtp3Vn.js → palette-DTnMhipt.js} +1 -1
- package/dist/chunks/pivot-result-contract-expectations-Bo-86vwS.js +56 -0
- package/dist/chunks/{pivot-result-identity-CAj8SiRL.js → pivot-result-identity-olvXJoB9.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-0sc8B1lh.js → report-preferences-dialog-C2YUIwKG.js} +55 -55
- package/dist/chunks/{report-runtime-context-bYoExeWr.js → report-runtime-context-DoIUr3MP.js} +2 -2
- package/dist/chunks/resolve-dashboard-input-context-q_iiNXE1.js +6503 -0
- package/dist/chunks/{save-DSb1jTtG.js → save-DH4RyrnG.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-BQWM3ldX.js → saved-dashboard-context-8jqfI7hI.js} +59 -59
- package/dist/chunks/{selection-reducer-DSzMWb4x.js → selection-reducer-CV7K4FI6.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-Bz14Oma5.js → semaphor-ready-indicator-E2XWyibu.js} +40105 -41658
- package/dist/chunks/{shelf-drop-preview-context-DBHAkgch.js → shelf-drop-preview-context-C29EUzDp.js} +570 -570
- package/dist/chunks/{source-entity-resolution-BOrmNCEM.js → source-entity-resolution-BXI3nQ5Z.js} +1 -1
- package/dist/chunks/{switch-Dq8XPFpT.js → switch-balDSHc7.js} +3 -3
- package/dist/chunks/{table-export-sheet-C_RvEUyO.js → table-export-sheet-CK8tvh4d.js} +1 -1
- package/dist/chunks/temporal-input-presentation-B77JsAzU.js +5002 -0
- package/dist/chunks/{token-types-LCYMJ3pa.js → token-types-DhYH5YKb.js} +1 -1
- package/dist/chunks/{upload-Dr_WAxHQ.js → upload-Ufj8vjyn.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-BK3YFkfc.js → use-create-flow-overlay-state-9WsnzEO5.js} +6 -6
- package/dist/chunks/{validators-C87JPd-_.js → validators-BtaCFIEB.js} +1206 -1579
- package/dist/chunks/{zoned-wall-clock-E35Frf9v.js → zoned-wall-clock-CGLVI40Q.js} +1 -1
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +2713 -1459
- package/dist/data-app-sdk/index.js +20 -20
- package/dist/data-app-sdk-adapters/index.js +3 -3
- package/dist/data-app-sdk-validation/index.js +10 -10
- package/dist/format-utils/index.js +262 -256
- package/dist/index.js +214 -215
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/dashboard/summary-number-formatter.d.ts +6 -0
- package/dist/types/components/editor/editor-aside/utils.d.ts +1 -1
- package/dist/types/components/visual/data-table/types/data-table.d.ts +5 -20
- package/dist/types/index.js +50 -51
- package/dist/types/lib/formatters/canonical-format-adapter.d.ts +2 -29
- package/dist/types/lib/formatters/kpi-number-formatter.d.ts +41 -0
- package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +0 -2
- package/dist/types/lib/formatters/table-column-settings.d.ts +47 -0
- package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +10 -188
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +16 -372
- package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
- package/dist/types/lib/stores/editor-store.d.ts +48 -10
- package/dist/types/lib/stores/table-actions.d.ts +9 -5
- package/dist/types/lib/table-formatting/index.d.ts +0 -2
- package/dist/types/lib/table-formatting/table-conditional-formatting-range-source.d.ts +3 -2
- package/dist/types/lib/table-formatting/table-conditional-formatting-range.d.ts +3 -2
- package/dist/types/lib/table-formatting/table-formatting-normalize.d.ts +1 -2
- package/dist/types/lib/table-formatting/table-formatting-render-model.d.ts +9 -0
- package/dist/types/lib/table-formatting/table-formatting-types.d.ts +5 -95
- package/dist/types/lib/table-formatting/table-presentation-fields.d.ts +35 -0
- package/dist/types/lib/types/common-types.d.ts +40 -47
- package/dist/types/lib/types/explorer-types.d.ts +11 -43
- package/dist/types/lib/utils/card-config-utils.d.ts +8 -0
- package/dist/types/lib/utils/card-definition.d.ts +9 -187
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +169 -513
- package/dist/types/shared/analytics-protocol/contracts.d.ts +32 -9
- package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +108 -980
- package/dist/types/shared/analytics-protocol/field-validation.d.ts +1 -0
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +281 -4624
- package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +20 -20
- package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +18 -18
- package/dist/types/shared/analytics-protocol/matrix-path-contract.d.ts +40 -40
- package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +3 -203
- package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +12 -0
- package/dist/types/shared/analytics-protocol/scalar-value.d.ts +8 -8
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -0
- package/dist/types/shared/assistant-protocol/context.d.ts +69 -69
- package/dist/types/shared/dashboard-authoring/canonical-result-keys.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +4 -1
- package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/card-formats/upgrade-card-formats.d.ts +57 -0
- package/dist/types/shared/dashboard-authoring/card-settings/apply-card-settings.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +52 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/card-settings/carry-column-settings.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-format-write.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-names.d.ts +51 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-sources.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/card-settings/confirm-class.d.ts +9 -0
- package/dist/types/shared/dashboard-authoring/card-settings/highlight-inputs.d.ts +19 -0
- package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +102 -0
- package/dist/types/shared/dashboard-authoring/card-settings/read-card-settings.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-highlights.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-settings.d.ts +59 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +40 -0
- package/dist/types/shared/dashboard-authoring/card-settings/views.d.ts +28 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +32 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +555 -38
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +27 -8
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +25 -1
- package/dist/types/shared/dashboard-authoring/conditional-formatting/editable.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/evaluate.d.ts +16 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/index.d.ts +9 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/resolve-card-column-ref.d.ts +17 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/retain.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +4499 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/store.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/types.d.ts +151 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/upgrade.d.ts +35 -0
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +62 -62
- package/dist/types/shared/dashboard-authoring/index.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +123 -0
- package/dist/types/shared/dashboard-authoring/matrix-authoring.d.ts +4 -5
- package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +24 -736
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +21 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +10 -4
- package/dist/types/shared/dashboard-authoring/retired-presentation-fields.d.ts +31 -0
- package/dist/types/shared/dashboard-authoring/upgrade-card-presentation.d.ts +14 -0
- package/dist/types/shared/dashboard-viewer/bookmark-impact.d.ts +33 -0
- package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +13 -2
- package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +16 -0
- package/dist/types/shared/format-utils/index.d.ts +2 -0
- package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +10 -366
- package/dist/types/shared/format-utils/raw-temporal.d.ts +31 -1
- package/dist/types/shared/format-utils/resolve-column-format.d.ts +43 -0
- package/dist/types/shared/format-utils/retired-format-adapters.d.ts +68 -0
- package/dist/types/shared/format-utils/semantic-format.d.ts +5 -1
- package/dist/types/shared/format-utils/stored-value-format.d.ts +16 -0
- package/dist/types/shared/format-utils/types/format-types.d.ts +10 -12
- package/package.json +2 -2
- package/dist/chunks/analytics-base-schemas-BUFUoO6G.js +0 -472
- package/dist/chunks/bookmark-state-ssqrs5oP.js +0 -111
- package/dist/chunks/document-dashboard-inputs-ChVkcBuu.js +0 -3010
- package/dist/chunks/editor-draft-sync-BN5qYHPF.js +0 -15
- package/dist/chunks/filter-reach-copy-B5Y7FHzg.js +0 -3411
- package/dist/chunks/global-date-filter-utils-DBzEOX9M.js +0 -12222
- package/dist/chunks/pivot-result-contract-expectations-DOYhqeZb.js +0 -1926
- package/dist/chunks/raw-temporal-presentation-BmT7z6NH.js +0 -584
- package/dist/chunks/resolve-dashboard-input-context-B_C_VAJH.js +0 -5520
- package/dist/chunks/table-settings-DXj_zXwS.js +0 -637
- package/dist/chunks/temporal-input-presentation-AhLSkGPf.js +0 -2939
- package/dist/types/lib/table-formatting/table-conditional-formatting-evaluator.d.ts +0 -9
- package/dist/types/lib/table-formatting/table-formatting-validation.d.ts +0 -12
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Problems and warnings for dashboard changes (MCP dashboard editing SPEC
|
|
3
|
-
* 3.2). One shape for both: a refusal lists problems, a proposal carries
|
|
4
|
-
* warnings. Messages are one sentence a person can read and never name the
|
|
5
|
-
* product; `fix` tells the agent what to do next.
|
|
6
|
-
*/
|
|
1
|
+
import { ProposedChange } from './dashboard-change.js';
|
|
7
2
|
export type ChangeProblemCode = 'invalid_change' | 'invalid_change_target' | 'copy_required' | 'not_permitted' | 'dashboard_not_found' | 'card_not_found' | 'filter_not_found' | 'sheet_not_found' | 'sheet_required' | 'sheet_not_a_grid' | 'field_not_found'
|
|
8
3
|
/**
|
|
9
4
|
* The card's datasets aren't joined by the domain's relationships, so the
|
|
@@ -14,7 +9,25 @@ export type ChangeProblemCode = 'invalid_change' | 'invalid_change_target' | 'co
|
|
|
14
9
|
/** filter.update or filter.bind on a filter the outline marks read only. */
|
|
15
10
|
| 'filter_not_editable'
|
|
16
11
|
/** The changed dashboard fails the save's own validation (propose or apply). */
|
|
17
|
-
| 'document_invalid'
|
|
12
|
+
| 'document_invalid'
|
|
13
|
+
/** A setting the card's kind doesn't take (SPEC 3.4). */
|
|
14
|
+
| 'setting_not_for_card'
|
|
15
|
+
/** No column of the card has that name. */
|
|
16
|
+
| 'column_not_found'
|
|
17
|
+
/** The name matches two columns. */
|
|
18
|
+
| 'column_ambiguous'
|
|
19
|
+
/** A SQL table's result columns couldn't be read to check a column name. */
|
|
20
|
+
| 'columns_unavailable'
|
|
21
|
+
/** A format that fails the stored format's schema, has nothing to merge onto, or doesn't fit the column's data. */
|
|
22
|
+
| 'format_invalid'
|
|
23
|
+
/** A date format finer than the column's grain. */
|
|
24
|
+
| 'date_finer_than_grain'
|
|
25
|
+
/** Not a theme color name or `#rrggbb`. */
|
|
26
|
+
| 'color_unknown'
|
|
27
|
+
/** No highlight rule on the card has that id. */
|
|
28
|
+
| 'highlight_not_found'
|
|
29
|
+
/** A width, range or title that can't be stored, or two labels for one column. */
|
|
30
|
+
| 'value_invalid';
|
|
18
31
|
export type ChangeWarningCode =
|
|
19
32
|
/** In-scope cards the filter doesn't reach. */
|
|
20
33
|
'filter_not_reaching_cards'
|
|
@@ -37,7 +50,9 @@ export type ChangeWarningCode =
|
|
|
37
50
|
* dashboard already fails the save's own check, so the change wasn't
|
|
38
51
|
* checked against it; the person's Save reports what it finds.
|
|
39
52
|
*/
|
|
40
|
-
| 'document_not_checked'
|
|
53
|
+
| 'document_not_checked'
|
|
54
|
+
/** A change removes something viewers' bookmarks or remembered table settings use (card appearance CA-D17). */
|
|
55
|
+
| 'viewer_settings_affected';
|
|
41
56
|
export type ChangeDiagnostic = {
|
|
42
57
|
code: ChangeProblemCode | ChangeWarningCode;
|
|
43
58
|
/** One sentence, safe to show an end user. */
|
|
@@ -48,4 +63,8 @@ export type ChangeDiagnostic = {
|
|
|
48
63
|
fix?: string;
|
|
49
64
|
/** E.g. `{ sheets }`, `{ available }`, `{ suggestedFields }`. */
|
|
50
65
|
details?: Record<string, unknown>;
|
|
66
|
+
/** What this card or setting accepts, in the input words (card appearance CA-D9). */
|
|
67
|
+
allowed?: readonly string[];
|
|
68
|
+
/** A change the agent can send as written (CA-D9). */
|
|
69
|
+
suggestedChange?: ProposedChange;
|
|
51
70
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TDashboard } from '../../../lib/types/common-types.js';
|
|
1
|
+
import { TCard, TDashboard } from '../../../lib/types/common-types.js';
|
|
2
2
|
import { DataSource, Field } from '../../../lib/types/explorer-types.js';
|
|
3
3
|
import { TChartType } from '../../../lib/charts/types.js';
|
|
4
4
|
import { CalendarContext } from '../../report-runtime-context/index.js';
|
|
@@ -7,6 +7,7 @@ import { DashboardOperation, OperationContext, OperationDescription } from '../o
|
|
|
7
7
|
import { CardQueryPart } from './card-query-part.js';
|
|
8
8
|
import { FieldRef, MetricCardQuery, RecordsCardQuery } from './dashboard-change.js';
|
|
9
9
|
import { ChangeDiagnostic } from './diagnostics.js';
|
|
10
|
+
import { ModelFormats } from '../../format-utils/resolve-column-format.js';
|
|
10
11
|
/**
|
|
11
12
|
* Public dashboard changes to resolved operations (MCP dashboard editing SPEC
|
|
12
13
|
* 3.7, DE-D48). Every rule the schema can't state lives here; everything that
|
|
@@ -66,6 +67,25 @@ export type ChangeServices = {
|
|
|
66
67
|
* RF-D15). Without one, those cards read as decided when they run.
|
|
67
68
|
*/
|
|
68
69
|
relationshipReach?: DashboardRelationshipReachResolver;
|
|
70
|
+
/**
|
|
71
|
+
* A SQL card's result keys, read by running it on this dashboard (card
|
|
72
|
+
* appearance SPEC 5, V-9); null when it can't run or returns no rows.
|
|
73
|
+
* Called only when a change names a SQL card's columns.
|
|
74
|
+
*/
|
|
75
|
+
readSqlResultColumns?(input: {
|
|
76
|
+
cardId: string;
|
|
77
|
+
dashboard: TDashboard;
|
|
78
|
+
}): Promise<readonly string[] | null>;
|
|
79
|
+
/**
|
|
80
|
+
* The model format each of a card's columns shows, by column id (a config
|
|
81
|
+
* field's id, a Matrix level's or measure's), as the query gives it to the
|
|
82
|
+
* renderer: a config card's `modelFormats` (CF-D23), a Matrix's bound
|
|
83
|
+
* catalog formats. Called only when a change states a format; null when it
|
|
84
|
+
* can't be read (card appearance ledger P2-20).
|
|
85
|
+
*/
|
|
86
|
+
readModelFormats?(input: {
|
|
87
|
+
card: TCard;
|
|
88
|
+
}): Promise<ModelFormats | null>;
|
|
69
89
|
};
|
|
70
90
|
export type ChangeRef = {
|
|
71
91
|
ref: string;
|
|
@@ -73,6 +93,8 @@ export type ChangeRef = {
|
|
|
73
93
|
id: string;
|
|
74
94
|
title: string;
|
|
75
95
|
changeIndex: number;
|
|
96
|
+
/** A highlight rule a `highlight.add` made, minted at resolve (card appearance SPEC 5); never in a sentence (S-10). */
|
|
97
|
+
ruleId?: string;
|
|
76
98
|
};
|
|
77
99
|
export type ChangeResolution = {
|
|
78
100
|
ok: true;
|
|
@@ -84,6 +106,8 @@ export type ChangeResolution = {
|
|
|
84
106
|
/** Handle or existing id to final id, in change order; a handle-less card.add gets $card_1, $card_2... */
|
|
85
107
|
refs: ChangeRef[];
|
|
86
108
|
descriptions: OperationDescription[];
|
|
109
|
+
/** The dry run detached a library visual (`DashboardOperationResult.detaches`). */
|
|
110
|
+
detaches: boolean;
|
|
87
111
|
/** Cards whose query part or type changed, and added cards, in change order: the preview runs the first five. */
|
|
88
112
|
changedCardIds: string[];
|
|
89
113
|
/** Every capability the resolution relied on (DE-D60). */
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CardColumnRef, ConditionalRule } from './types.js';
|
|
2
|
+
/** One string per reference; `parseColumnRefKey` reads it back. */
|
|
3
|
+
export declare function columnRefKey(ref: CardColumnRef): string;
|
|
4
|
+
/** The reference a key names, or undefined for any other string (a draft's placeholder). */
|
|
5
|
+
export declare function parseColumnRefKey(key: string): CardColumnRef | undefined;
|
|
6
|
+
/** A rule with each column named another way. */
|
|
7
|
+
export declare function mapRuleColumns<A, B>(rule: ConditionalRule<A>, map: (column: A) => B): ConditionalRule<B>;
|
|
8
|
+
/** Stored rules as an editor edits them. */
|
|
9
|
+
export declare function toEditableRules(rules: readonly ConditionalRule[]): ConditionalRule<string>[];
|
|
10
|
+
/**
|
|
11
|
+
* Editor rules as stored rules. A rule whose condition names no column (a
|
|
12
|
+
* draft) is left out; a styled column that names none is dropped.
|
|
13
|
+
*/
|
|
14
|
+
export declare function fromEditableRules(rules: readonly ConditionalRule<string>[]): ConditionalRule[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ConditionalFormattingRange, ConditionalFormattingResult } from '../../../lib/table-formatting/table-formatting-types.js';
|
|
2
|
+
import { ResolvedConditionalRule, TablePart } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The styles one cell takes from a card's rules, resolved to result keys
|
|
5
|
+
* (`resolveConditionalRules`). Later rules win where styles overlap. Rules
|
|
6
|
+
* with a Matrix scope are evaluated by the Matrix adapter, which strips the
|
|
7
|
+
* scope first.
|
|
8
|
+
*/
|
|
9
|
+
export declare function evaluateConditionalRules(args: {
|
|
10
|
+
rules: readonly ResolvedConditionalRule[];
|
|
11
|
+
row: Record<string, unknown>;
|
|
12
|
+
rowIndex: number;
|
|
13
|
+
columnKey: string;
|
|
14
|
+
range: ConditionalFormattingRange;
|
|
15
|
+
tablePart: TablePart;
|
|
16
|
+
}): ConditionalFormattingResult;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './types.js';
|
|
2
|
+
export * from './schema.js';
|
|
3
|
+
export * from './resolve-card-column-ref.js';
|
|
4
|
+
export * from './evaluate.js';
|
|
5
|
+
export * from './upgrade.js';
|
|
6
|
+
export * from './store.js';
|
|
7
|
+
export * from './editable.js';
|
|
8
|
+
export * from './retain.js';
|
|
9
|
+
export * from './kpi.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TCard } from '../../../lib/types/common-types.js';
|
|
2
|
+
export type KpiValueStyle = {
|
|
3
|
+
color?: string;
|
|
4
|
+
backgroundColor?: string;
|
|
5
|
+
};
|
|
6
|
+
/** The colors the card's rules give this value. */
|
|
7
|
+
export declare function resolveKpiValueStyle(card: Pick<TCard, 'sql' | 'config' | 'preferences'>, value: unknown): KpiValueStyle;
|
package/dist/types/shared/dashboard-authoring/conditional-formatting/resolve-card-column-ref.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TCard } from '../../../lib/types/common-types.js';
|
|
2
|
+
import { CardColumnRef, CardOutputColumns, ConditionalRule, ResolvedConditionalRule } from './types.js';
|
|
3
|
+
/** The current result key a reference names, or undefined when the column is gone. */
|
|
4
|
+
export declare function resolveCardColumnRef(ref: CardColumnRef, columns: CardOutputColumns): string | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* A card's rules with every reference resolved, ready for
|
|
7
|
+
* `evaluateConditionalRules`. A rule whose condition column is gone, or whose
|
|
8
|
+
* styled columns are all gone, is left out: it has nothing to apply to.
|
|
9
|
+
*/
|
|
10
|
+
export declare function resolveConditionalRules(rules: readonly ConditionalRule[], columns: CardOutputColumns): ResolvedConditionalRule[];
|
|
11
|
+
/**
|
|
12
|
+
* The reference a writer stores for a result key a renderer or editor shows:
|
|
13
|
+
* the inverse of `resolveCardColumnRef` over the same columns, in the kinds
|
|
14
|
+
* the card's rules accept (`acceptedColumnRefKinds`). Undefined when the key
|
|
15
|
+
* names no such column.
|
|
16
|
+
*/
|
|
17
|
+
export declare function cardColumnRefForKey(card: TCard, key: string, columns: CardOutputColumns): CardColumnRef | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TCard } from '../../../lib/types/common-types.js';
|
|
2
|
+
export type DroppedConditionalRule = {
|
|
3
|
+
ruleId: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
reason: string;
|
|
6
|
+
};
|
|
7
|
+
/** `after` with its rules retained, and the rules it dropped. */
|
|
8
|
+
export declare function retainConditionalRules(input: {
|
|
9
|
+
before: TCard;
|
|
10
|
+
after: TCard;
|
|
11
|
+
}): {
|
|
12
|
+
card: TCard;
|
|
13
|
+
dropped: DroppedConditionalRule[];
|
|
14
|
+
};
|