react-semaphor 0.1.604 → 0.1.605
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 +1 -1
- package/dist/appearance/index.js +1 -1
- package/dist/appearance-runtime/index.js +1 -1
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +1 -1
- package/dist/brand-studio/index.js +3 -8
- package/dist/briefings/index.js +1 -1
- package/dist/chunks/{add-to-dashboard-DeHEBEqG.js → add-to-dashboard-CEmZUf9o.js} +1 -1
- package/dist/chunks/{analytics-base-schemas-BREc5WGv.js → analytics-base-schemas-DMFrDqn_.js} +1 -1
- package/dist/chunks/appearance-provider-CfoAVQuG.js +608 -0
- package/dist/chunks/appearance-runtime-provider-Bx8H-moR.js +1 -0
- package/dist/chunks/{assistant-chat-CjYrwVDa.js → assistant-chat-DgUaCE9k.js} +19 -24
- package/dist/chunks/attachment-filter-line-C_zHMhGh.js +1 -0
- package/dist/chunks/{bookmark-impact-C89zBLq3.js → bookmark-impact-BAtemeyK.js} +1 -1
- package/dist/chunks/bookmark-state-DScd31KT.js +1 -0
- package/dist/chunks/brand-C9APUFaP.js +1 -0
- package/dist/chunks/card-filter-builder-ClWrXB7P.js +11 -0
- package/dist/chunks/comparison-window-caption-tguyN24S.js +1 -0
- package/dist/chunks/{context-ALdccLHw.js → context-CntvtZwC.js} +1 -1
- package/dist/chunks/dashboard-ChIcbVTx.js +1 -0
- package/dist/chunks/dashboard-briefing-launcher-CwMlhkxV.js +42 -0
- package/dist/chunks/dashboard-controls-UCSAFCGA.js +42 -0
- package/dist/chunks/dashboard-json-B120hYDa.js +1 -0
- package/dist/chunks/dashboard-temporal-snapshot-BFJKbp_6.js +1 -0
- package/dist/chunks/edit-dashboard-visual-DvHp03h_.js +73 -0
- package/dist/chunks/filter-line-WwUV5JzN.js +1 -0
- package/dist/chunks/filter-reach-preview-C5M5_hf_.js +1 -0
- package/dist/chunks/filter-value-text-DqTHe_vu.js +1 -0
- package/dist/chunks/{index-BE1DfxNs.js → index-bkP6SnYu.js} +1 -1
- package/dist/chunks/kpi-trend-rule-B87LNzcz.js +1 -0
- package/dist/chunks/{layout-grid-BWtlgw0T.js → layout-grid-CFzqJ7GC.js} +1 -1
- package/dist/chunks/matrix-analytical-definition-5T-2euHZ.js +1 -0
- package/dist/chunks/matrix-member-presentation-vVAv-aqg.js +1 -0
- package/dist/chunks/matrix-operation-contract-CWvcEsQ0.js +1 -0
- package/dist/chunks/numeric-range-options-C8tr-Bls.js +1 -0
- package/dist/chunks/{palette-BzC-CGOc.js → palette-NvEIuXHN.js} +1 -1
- package/dist/chunks/pivot-result-contract-expectations-BNWhS8mv.js +1 -0
- package/dist/chunks/pivot-result-identity-B0eWVMXg.js +1 -0
- package/dist/chunks/{raw-temporal-value-DeyEhL0S.js → raw-temporal-value-BHQ-ldpW.js} +1 -1
- package/dist/chunks/report-preferences-dialog-Bseb2Rlg.js +1 -0
- package/dist/chunks/{report-runtime-context-BWzIHCKK.js → report-runtime-context-Cd1b5pku.js} +1 -1
- package/dist/chunks/resolve-dashboard-input-context-BDY7KwRe.js +8 -0
- package/dist/chunks/resolver-CjsW8Rz0.js +1 -0
- package/dist/chunks/saved-dashboard-context-C3lWc4Dx.js +1 -0
- package/dist/chunks/schema-O1Y3WTGF.js +4 -0
- package/dist/chunks/{selection-filter-compiler-CCoCD25M.js → selection-filter-compiler-kYsRugss.js} +1 -1
- package/dist/chunks/semaphor-ready-indicator-BQarSo6S.js +612 -0
- package/dist/chunks/set-6mOnfQeH.js +1 -0
- package/dist/chunks/slider-BPnHdMGq.js +4 -0
- package/dist/chunks/stored-dashboard-DfrxDLhR.js +1 -0
- package/dist/chunks/{table-export-sheet-rC5pKmXg.js → table-export-sheet-xaczzWZF.js} +1 -1
- package/dist/chunks/{token-types-Bj9iMy0w.js → token-types-1vzMWjI-.js} +1 -1
- package/dist/chunks/{validators-CqV3Yka1.js → validators-Dg2kyF4_.js} +1 -1
- package/dist/chunks/{variable-draft-DJrfUyhv.js → variable-draft-B4_xqr4Y.js} +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +1 -1
- package/dist/format-utils/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/report-runtime-context/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/brand-studio/brand-studio-draft.d.ts +45 -13
- package/dist/types/brand-studio/brand-studio-editor.d.ts +13 -2
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/visual/data-table/hooks/use-data-table-logic.d.ts +17 -6
- package/dist/types/components/visual/data-table/types/data-table.d.ts +52 -42
- package/dist/types/index.js +1 -1
- package/dist/types/lib/appearance/aliases.d.ts +3 -0
- package/dist/types/lib/appearance/index.d.ts +1 -0
- package/dist/types/lib/appearance/table-density.d.ts +18 -0
- package/dist/types/lib/appearance/types.d.ts +39 -1
- package/dist/types/lib/dashboard-viewer/column-header-actions.d.ts +100 -0
- package/dist/types/lib/dashboard-viewer/table-view-edit.d.ts +0 -27
- package/dist/types/lib/dashboard-viewer/table-view.d.ts +26 -2
- package/dist/types/lib/dashboard-viewer/use-table-view.d.ts +2 -0
- package/dist/types/lib/hooks/use-add-new-frame.d.ts +7 -0
- package/dist/types/lib/hooks/use-dashboard-card.d.ts +4 -0
- package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +8 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +14 -2
- package/dist/types/lib/stores/explorer-actions.d.ts +0 -4
- package/dist/types/lib/types/common-types.d.ts +1 -2
- package/dist/types/lib/utils/card-config-utils.d.ts +13 -0
- package/dist/types/lib/utils/field-placement.d.ts +17 -0
- package/dist/types/shared/analytics-protocol/analytics-refusal.d.ts +21 -1
- package/dist/types/shared/analytics-protocol/field-provenance.d.ts +7 -4
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-folders.d.ts +48 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +2 -8
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/column-display-values.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-display.d.ts +52 -0
- package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +9 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/card-settings/table-viewer-switches.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/card-settings/views.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +132 -3
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +3 -1
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/conditional-formatting/store.d.ts +10 -1
- package/dist/types/shared/dashboard-authoring/field-aggregations.d.ts +9 -2
- package/dist/types/shared/dashboard-authoring/field-folders/field-folders.d.ts +8 -7
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/operations/card-operations.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +7 -2
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +6 -2
- package/dist/types/shared/dashboard-authoring/sheet-kinds.d.ts +36 -0
- package/dist/types/shared/dashboard-authoring/table-sheet-shape.d.ts +140 -0
- package/dist/types/shared/dashboard-viewer/table-column-move.d.ts +15 -0
- package/dist/types/shared/dashboard-viewer/table-settings.d.ts +8 -2
- package/dist/types/shared/format-utils/types/format-types.d.ts +1 -1
- package/dist/usage-events/index.js +1 -1
- package/package.json +2 -2
- package/dist/chunks/appearance-context-BqBZrijL.js +0 -1
- package/dist/chunks/appearance-runtime-provider-DmbCrOOG.js +0 -1
- package/dist/chunks/bookmark-state-69YYnRql.js +0 -1
- package/dist/chunks/brand-DCaZyRt6.js +0 -1
- package/dist/chunks/card-filter-builder-CTp6RAz1.js +0 -17
- package/dist/chunks/comparison-window-caption-C312mn3s.js +0 -1
- package/dist/chunks/dashboard-BX28ld6s.js +0 -1
- package/dist/chunks/dashboard-briefing-launcher-qo7GH4EO.js +0 -37
- package/dist/chunks/dashboard-controls-DhRjB7MA.js +0 -42
- package/dist/chunks/dashboard-json-9cHzhSjC.js +0 -1
- package/dist/chunks/dates-D-KP8G-z.js +0 -1
- package/dist/chunks/edit-DEAK0UZo.js +0 -1
- package/dist/chunks/edit-dashboard-visual-Duq_QkB_.js +0 -93
- package/dist/chunks/filter-line-CwQrqORc.js +0 -1
- package/dist/chunks/filter-reach-preview-gixPFlZj.js +0 -1
- package/dist/chunks/filter-value-text-B3tXakhd.js +0 -1
- package/dist/chunks/index-B-VF1ogs.js +0 -1
- package/dist/chunks/matrix-analytical-definition-CtFqWyCK.js +0 -1
- package/dist/chunks/matrix-member-presentation-Q0MCJ-YK.js +0 -1
- package/dist/chunks/matrix-operation-contract-D1RC1bfi.js +0 -1
- package/dist/chunks/metric-comparison-DEZYXROZ.js +0 -1
- package/dist/chunks/paintbrush-BjS3SbrH.js +0 -6
- package/dist/chunks/pickers-DuBrUht0.js +0 -1
- package/dist/chunks/pivot-result-contract-expectations-DTQAgr4n.js +0 -1
- package/dist/chunks/pivot-result-identity-DTNCB--h.js +0 -1
- package/dist/chunks/report-preferences-dialog-B_gUmCzG.js +0 -1
- package/dist/chunks/resolve-dashboard-input-context-B-TtRqxu.js +0 -8
- package/dist/chunks/resolver-AN9ChBfZ.js +0 -1
- package/dist/chunks/save-DdFUZcbi.js +0 -6
- package/dist/chunks/saved-dashboard-context-BAJ5tWiq.js +0 -1
- package/dist/chunks/schema-MC0cQSAb.js +0 -4
- package/dist/chunks/semaphor-ready-indicator-DzjorP3t.js +0 -999
- package/dist/chunks/set-DuJfGkbY.js +0 -1
- package/dist/chunks/shelf-drop-preview-context-BlLJ5RsT.js +0 -6
- package/dist/chunks/stored-dashboard-Ctcpkllg.js +0 -1
- package/dist/chunks/style-sheet-parts-BRGt9O05.js +0 -178
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ViewerTableSettings } from '../../shared/dashboard-viewer/table-settings.js';
|
|
2
|
-
import { TableColumnMoveResult } from '../../shared/dashboard-viewer/table-column-move.js';
|
|
3
2
|
import { TableColumnEdit, TableView } from './table-view.js';
|
|
4
3
|
export type TableColumnEditResult = {
|
|
5
4
|
readonly settings: ViewerTableSettings | undefined;
|
|
@@ -13,29 +12,3 @@ export type TableColumnEditResult = {
|
|
|
13
12
|
* for columns this result does not show (a drill can hide them) are kept.
|
|
14
13
|
*/
|
|
15
14
|
export declare function computeTableColumnEdit(view: TableView, edit: TableColumnEdit, stored?: ViewerTableSettings | undefined): TableColumnEditResult;
|
|
16
|
-
/**
|
|
17
|
-
* Where a header drop lands, as the table draws it (table column order
|
|
18
|
-
* TCO-D8, ledger P2-01): a measure's comparison column has no place of its
|
|
19
|
-
* own, so a drop on it, or after the measure, lands after the measure's last
|
|
20
|
-
* comparison column. Any other drop lands where it was made.
|
|
21
|
-
*/
|
|
22
|
-
export declare function resolveHeaderDropTarget(view: TableView, target: {
|
|
23
|
-
readonly outputKey: string;
|
|
24
|
-
readonly side: 'before' | 'after';
|
|
25
|
-
}): {
|
|
26
|
-
outputKey: string;
|
|
27
|
-
side: 'before' | 'after';
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* The author's header drag (table column order TCO-D7, TCO-D9): the column
|
|
31
|
-
* dragged by its header and the header it lands on, by output key, as the
|
|
32
|
-
* move rule decides it over the author's arrangement. Only a movable column
|
|
33
|
-
* moves. It lands on another movable column, or after a measure by way of
|
|
34
|
-
* the measure's comparison column (TCO-D8). The editor stores a successful
|
|
35
|
-
* move with `writeTableColumnOrder` against `view.author.fieldOrder`.
|
|
36
|
-
*/
|
|
37
|
-
export declare function resolveHeaderColumnMove(view: TableView, drag: {
|
|
38
|
-
readonly outputKey: string;
|
|
39
|
-
readonly targetOutputKey: string;
|
|
40
|
-
readonly side: 'before' | 'after';
|
|
41
|
-
}): TableColumnMoveResult;
|
|
@@ -3,6 +3,7 @@ import { CardConfig, DetailField, GroupByField, MetricField, QueryColumnKeyMap }
|
|
|
3
3
|
import { ComparisonMetadataMap } from '../types/query-types.js';
|
|
4
4
|
import { SemaphorResultColumn } from '../../shared/analytics-protocol/index.js';
|
|
5
5
|
import { TableColumnId, ViewerTableSettings } from '../../shared/dashboard-viewer/table-settings.js';
|
|
6
|
+
import { TableColumnPlacement } from '../../shared/dashboard-viewer/table-column-move.js';
|
|
6
7
|
export type TableResultShape = {
|
|
7
8
|
/** Output keys present in the result rows, in transport order. */
|
|
8
9
|
readonly keys: readonly string[];
|
|
@@ -31,6 +32,12 @@ export type TableViewInput = {
|
|
|
31
32
|
readonly settings?: ViewerTableSettings;
|
|
32
33
|
/** Default `screen`. */
|
|
33
34
|
readonly projection?: TableViewProjection;
|
|
35
|
+
/**
|
|
36
|
+
* Who the panel is for. Default `viewer`. An author's panel (a Table sheet's
|
|
37
|
+
* Columns, TS-D24) is offered whatever the viewers' switch says: the switch
|
|
38
|
+
* says what viewers may change, not the author.
|
|
39
|
+
*/
|
|
40
|
+
readonly audience?: 'viewer' | 'author';
|
|
34
41
|
};
|
|
35
42
|
export type TableViewColumn = {
|
|
36
43
|
readonly outputKey: string;
|
|
@@ -52,6 +59,10 @@ export type TableViewColumn = {
|
|
|
52
59
|
* another column in its area. Comparison columns move with their measure.
|
|
53
60
|
*/
|
|
54
61
|
readonly movable: boolean;
|
|
62
|
+
/** Held at the left edge on screen (table sheets PIN-1); a comparison column with its measure. */
|
|
63
|
+
readonly pinned: boolean;
|
|
64
|
+
/** Can be pinned (PIN-2): an addressable base column; in a pivoted table, a row dimension only. */
|
|
65
|
+
readonly pinnable: boolean;
|
|
55
66
|
};
|
|
56
67
|
/** A base column with an id: the columns a viewer's sort and widths address. */
|
|
57
68
|
export declare function isAddressableBaseColumn(column: Pick<TableViewColumn, 'part' | 'columnId'>): column is Pick<TableViewColumn, 'part'> & {
|
|
@@ -124,19 +135,32 @@ export type TableView = {
|
|
|
124
135
|
readonly author: {
|
|
125
136
|
readonly order: readonly TableColumnId[];
|
|
126
137
|
readonly fieldOrder: readonly TableColumnId[];
|
|
138
|
+
/** The author's pins this result can show (PIN-1): a viewer's equal to these are not stored. */
|
|
139
|
+
readonly pinned: readonly TableColumnId[];
|
|
127
140
|
};
|
|
128
141
|
/** Pivot rule A applies to moves (TCO-D6): see `isPivotedTableCard`. */
|
|
129
142
|
readonly pivoted: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* The output keys held at the left edge, in view column order (PIN-3): what
|
|
145
|
+
* the table pins. Screen projection only; `[]` for export and print. Pins
|
|
146
|
+
* never reorder `columns` or `visibleKeys`.
|
|
147
|
+
*/
|
|
148
|
+
readonly pinnedKeys: readonly string[];
|
|
130
149
|
};
|
|
131
150
|
export type TableColumnEdit = {
|
|
132
151
|
readonly type: 'hide' | 'show';
|
|
133
152
|
readonly columnId: TableColumnId;
|
|
134
153
|
}
|
|
135
|
-
/** `
|
|
154
|
+
/** To a placement, as the one move rule takes it (`{ before: null }`: the end). */
|
|
136
155
|
| {
|
|
137
156
|
readonly type: 'move';
|
|
138
157
|
readonly columnId: TableColumnId;
|
|
139
|
-
readonly
|
|
158
|
+
readonly to: TableColumnPlacement;
|
|
159
|
+
}
|
|
160
|
+
/** Held at the left edge, or let go (table sheets PIN-1). */
|
|
161
|
+
| {
|
|
162
|
+
readonly type: 'pin' | 'unpin';
|
|
163
|
+
readonly columnId: TableColumnId;
|
|
140
164
|
}
|
|
141
165
|
/** An empty name or the author's label clears the rename. */
|
|
142
166
|
| {
|
|
@@ -28,6 +28,8 @@ export declare function useTableView(card: TCard, result: TableResultShape | und
|
|
|
28
28
|
*/
|
|
29
29
|
export type ViewerDataTable = ExportViewerTable & {
|
|
30
30
|
readonly view?: TableView;
|
|
31
|
+
/** A viewer's column edit from the table itself (its header menu: pin, move): into their settings, never the dashboard. */
|
|
32
|
+
readonly edit?: (edit: TableColumnEdit) => void;
|
|
31
33
|
};
|
|
32
34
|
/**
|
|
33
35
|
* The sizing props a viewer's table takes (`TableVisual`'s controlled
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { TFrame } from '../types/common-types.js';
|
|
2
|
+
import { DatabaseEntityReference } from '../types/explorer-types.js';
|
|
2
3
|
export declare function useAddNewFrame(): {
|
|
3
4
|
handleAddNewFrame: (options?: {
|
|
4
5
|
openVisualEditor?: boolean;
|
|
5
6
|
sheetId?: string;
|
|
6
7
|
}) => Promise<TFrame | undefined>;
|
|
8
|
+
handleAddTableSheet: (input: {
|
|
9
|
+
title: string;
|
|
10
|
+
source?: DatabaseEntityReference;
|
|
11
|
+
}) => string | undefined;
|
|
12
|
+
/** The source a new card starts on unless one is picked: the dialog's first check (TS-D25). */
|
|
13
|
+
newCardSource: DatabaseEntityReference | undefined;
|
|
7
14
|
canAddFrame: boolean;
|
|
8
15
|
};
|
|
@@ -5,6 +5,8 @@ export declare function useCard(cardId: string): {
|
|
|
5
5
|
card: TCard;
|
|
6
6
|
isPending: boolean;
|
|
7
7
|
isError: boolean;
|
|
8
|
+
/** The query's error, for an author's error surface (a Table sheet, TS-D23). */
|
|
9
|
+
errorMessage: string;
|
|
8
10
|
isLoading: boolean;
|
|
9
11
|
isFetching: boolean;
|
|
10
12
|
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
@@ -26,6 +28,8 @@ export declare function useCard(cardId: string): {
|
|
|
26
28
|
export declare function useDashboardCard(card: TCard): {
|
|
27
29
|
isPending: boolean;
|
|
28
30
|
isError: boolean;
|
|
31
|
+
/** The query's error, for an author's error surface (a Table sheet, TS-D23). */
|
|
32
|
+
errorMessage: string;
|
|
29
33
|
isLoading: boolean;
|
|
30
34
|
isFetching: boolean;
|
|
31
35
|
fetchStatus: import('@tanstack/query-core').FetchStatus;
|
|
@@ -18,6 +18,14 @@ export interface ClickContextResult {
|
|
|
18
18
|
resultColumnKey?: string;
|
|
19
19
|
/** What the click site offers for See records; a menu opened from this context shows it. */
|
|
20
20
|
seeRecords?: SeeRecordsOffer;
|
|
21
|
+
/**
|
|
22
|
+
* A table cell's text and its row's, for Copy value and Copy row: a right-click
|
|
23
|
+
* on a cell opens the card's menu with them first (table style TS-D19).
|
|
24
|
+
*/
|
|
25
|
+
copy?: {
|
|
26
|
+
value: string;
|
|
27
|
+
row?: string;
|
|
28
|
+
};
|
|
21
29
|
}
|
|
22
30
|
export declare function getClickContextFromChartJs({ resolvedCardConfig, card, records, chart, clickEvent, columnKeyMap, resultColumns, valueFormatPreferences, }: {
|
|
23
31
|
resolvedCardConfig: CardConfig;
|
|
@@ -84,6 +84,14 @@ export type UndoProposalResult = {
|
|
|
84
84
|
reason: 'changed_since' | 'not_found' | 'not_editable';
|
|
85
85
|
};
|
|
86
86
|
/** Arrange from the toolbar (responsive layouts SPEC §6.4, RL-D13). */
|
|
87
|
+
/** 'editor': the card editor's Accept. 'sheet': a Table sheet's authoring session (TS-D6). */
|
|
88
|
+
export type FrameCommitOrigin = 'editor' | 'sheet';
|
|
89
|
+
export type AddFrameResult = {
|
|
90
|
+
ok: true;
|
|
91
|
+
} | {
|
|
92
|
+
ok: false;
|
|
93
|
+
reason: string;
|
|
94
|
+
};
|
|
87
95
|
export type ArrangeSheetResult = {
|
|
88
96
|
ok: true;
|
|
89
97
|
} | {
|
|
@@ -399,7 +407,8 @@ type Actions = {
|
|
|
399
407
|
setDashboardDescription: (description: string) => void;
|
|
400
408
|
setDashboardExportDefaults: (exportDefaults: TDashboard['exportDefaults']) => void;
|
|
401
409
|
setSheets: (sheets: TSheet[]) => void;
|
|
402
|
-
|
|
410
|
+
/** Adds a sheet through the reducer; false when it refuses (a Table sheet without its frame). */
|
|
411
|
+
addSheet: (sheet: TSheet) => boolean;
|
|
403
412
|
duplicateSheet: (sheetId: string) => string | null;
|
|
404
413
|
deleteSheet: (sheetId: string) => void;
|
|
405
414
|
setSheetTitle: (sheetId: string, title: string) => void;
|
|
@@ -476,9 +485,12 @@ type Actions = {
|
|
|
476
485
|
clearAllInlineFilterValues: () => void;
|
|
477
486
|
setInlineFilterValuesMap: (map: Record<string, TFilterValue[]>) => void;
|
|
478
487
|
setCardInlineFilterDefaultValues: (sheetId: string, cardId: string, filterId: string, defaultValues: (string | number)[] | undefined) => void;
|
|
479
|
-
|
|
488
|
+
/** Adds a card's frame through the reducer; a refusal (a Document or a Table sheet) says why. */
|
|
489
|
+
addFrame: (sheetId: string, frame: TFrame, options?: AddFrameOptions) => AddFrameResult;
|
|
480
490
|
updateFrame: (sheetId: string, frame: TFrame, options?: {
|
|
481
491
|
semanticExecutionPayload?: SemanticExecutionPayload;
|
|
492
|
+
/** Where the commit comes from; without one it is a plain frame write that refuses quietly. */
|
|
493
|
+
origin?: FrameCommitOrigin;
|
|
482
494
|
}) => void;
|
|
483
495
|
updateDashboardCalculatedFields: (calculatedFields: Field[]) => void;
|
|
484
496
|
/** Whether the field changes a Document section card's edit made would apply with that card committed; asked before writing it. */
|
|
@@ -29,16 +29,12 @@ export interface ExplorerActions {
|
|
|
29
29
|
updateCardConfig: (cardId: string, config: Partial<CardConfig>) => void;
|
|
30
30
|
updateRowLimit: (cardId: string, rowLimit: number) => void;
|
|
31
31
|
addGroupByColumn: (cardId: string, column: GroupByField) => void;
|
|
32
|
-
removeGroupByColumn: (cardId: string, columnId: string) => void;
|
|
33
32
|
updateGroupByColumn: (cardId: string, columnId: string, updates: Partial<GroupByField>) => void;
|
|
34
33
|
addMetricColumn: (cardId: string, column: MetricField) => void;
|
|
35
|
-
removeMetricColumn: (cardId: string, columnId: string) => void;
|
|
36
34
|
updateMetricColumn: (cardId: string, columnId: string, updates: Partial<MetricField>) => void;
|
|
37
35
|
addPivotByColumn: (cardId: string, column: PivotByField) => void;
|
|
38
|
-
removePivotByColumn: (cardId: string, columnId: string) => void;
|
|
39
36
|
updatePivotByColumn: (cardId: string, columnId: string, updates: Partial<PivotByField>) => void;
|
|
40
37
|
addSortByColumn: (cardId: string, column: SortByField) => void;
|
|
41
|
-
removeSortByColumn: (cardId: string, columnId: string) => void;
|
|
42
38
|
updateSortByColumn: (cardId: string, columnId: string, updates: Partial<SortByField>) => void;
|
|
43
39
|
updateFilters: (cardId: string, filters: FilterGroup) => void;
|
|
44
40
|
clearFilters: (cardId: string) => void;
|
|
@@ -1543,7 +1543,6 @@ export type DocumentTableSection = {
|
|
|
1543
1543
|
totalsRow?: boolean;
|
|
1544
1544
|
columnFormatting?: Record<string, unknown>;
|
|
1545
1545
|
repeatHeaderOnPageBreak?: boolean;
|
|
1546
|
-
rowHeightPx?: number;
|
|
1547
1546
|
/** Print nothing, and take no space, while the result is empty (Plan 2). */
|
|
1548
1547
|
hideWhenEmpty?: boolean;
|
|
1549
1548
|
/** Matrix sections only: how the Document prints the Matrix (Plan 2). */
|
|
@@ -1612,7 +1611,7 @@ export type DocumentDefinition = {
|
|
|
1612
1611
|
};
|
|
1613
1612
|
export type TSheet = {
|
|
1614
1613
|
id: string;
|
|
1615
|
-
kind?: 'dashboard' | 'document';
|
|
1614
|
+
kind?: 'dashboard' | 'document' | 'table';
|
|
1616
1615
|
title?: string;
|
|
1617
1616
|
description?: string;
|
|
1618
1617
|
layout?: ReactGridLayout.Layout[];
|
|
@@ -59,6 +59,19 @@ export declare function convertMatrixRepresentation(card: TCard, nextType: TCard
|
|
|
59
59
|
createId?: () => string): MatrixRepresentationChange;
|
|
60
60
|
/** The switch reads the catalog only when it has something to carry. */
|
|
61
61
|
export declare function matrixSwitchNeedsCatalog(card: TCard, nextType: TCard['type']): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Each shelf field that carries goes through the drop a drag uses, in shelf
|
|
64
|
+
* order, keeping its aggregate and date grain. The Matrix catalog is the
|
|
65
|
+
* carried fields themselves, as for a drop with no loaded source list.
|
|
66
|
+
*/
|
|
67
|
+
/**
|
|
68
|
+
* A count of rows (`COUNT(*)`): no catalog field, so a type change carries it
|
|
69
|
+
* by name, as the query contract reads it (the flat builder's generated
|
|
70
|
+
* count, the Matrix binding's `resolveCountStar`).
|
|
71
|
+
*/
|
|
72
|
+
export declare const isRowCountField: (field: Pick<Field, "name"> & {
|
|
73
|
+
aggregate?: string;
|
|
74
|
+
}) => boolean;
|
|
62
75
|
/** Replacing the base dataset starts a new definition; metadata refresh does not. */
|
|
63
76
|
export declare function withAuthoredCardDataSource(card: TCard, dataSource: DataSource): Partial<TCard>;
|
|
64
77
|
export declare function getAuthoredCardJoinPlan(card: Pick<TCard, 'type' | 'config'>): JoinPlan | undefined;
|
|
@@ -70,6 +70,12 @@ export type FieldPlacementContext = {
|
|
|
70
70
|
matrixCatalog: MatrixCardCatalog;
|
|
71
71
|
/** A string exactly when `needsNewFieldId` is true. */
|
|
72
72
|
newFieldId: string | null;
|
|
73
|
+
/**
|
|
74
|
+
* The folder a field from a related dataset sits in, as the field list
|
|
75
|
+
* names it ("Organization"); undefined for the card's own dataset. A new
|
|
76
|
+
* column from there is named after it (`relatedColumnLabel`).
|
|
77
|
+
*/
|
|
78
|
+
relatedFolderLabel?: (field: Field) => string | undefined;
|
|
73
79
|
};
|
|
74
80
|
/** Reserved id for standard-card previews. Never matches a minted id and never reaches the store. */
|
|
75
81
|
export declare const PLACEMENT_PREVIEW_FIELD_ID = "__placement-preview__";
|
|
@@ -89,6 +95,17 @@ export declare function needsNewFieldId(cardType: TCard['type'] | undefined, pla
|
|
|
89
95
|
* shelf identity resolved and a label defaulted from the name.
|
|
90
96
|
*/
|
|
91
97
|
export declare function readStandardShelf(config: CardConfig | undefined, zone: ContainerId): Field[];
|
|
98
|
+
/**
|
|
99
|
+
* Take placements off their shelves: the one rule for removing a field from
|
|
100
|
+
* a standard card, for the editor's shelves and a Table sheet alike (Astra 3).
|
|
101
|
+
* Each placement leaves its shelf (by its index there); a removed field's
|
|
102
|
+
* sorts leave with it unless another placement of the same field stays (a
|
|
103
|
+
* detail table may hold one field twice, DT-D4; review R2-02). Pure.
|
|
104
|
+
*/
|
|
105
|
+
export declare function withoutShelfPlacements(config: CardConfig, removals: ReadonlyArray<{
|
|
106
|
+
zone: ShelfZone;
|
|
107
|
+
index: number;
|
|
108
|
+
}>): CardConfig;
|
|
92
109
|
export declare function evaluateStandardPlacement(card: TCard, placement: FieldPlacement, context: FieldPlacementContext): FieldPlacementOutcome;
|
|
93
110
|
/** The one evaluation. Dispatches on card type. Side-effect-free. */
|
|
94
111
|
export declare function evaluateFieldPlacement(card: TCard, placement: FieldPlacement, context: FieldPlacementContext): FieldPlacementOutcome;
|
|
@@ -29,4 +29,24 @@ export declare function analyticsRefusal(code: AnalyticsRefusalCode, message: st
|
|
|
29
29
|
}): AnalyticsRefusal;
|
|
30
30
|
/** Reads a refusal carried on a value (an error, a result, a response). */
|
|
31
31
|
export declare function readAnalyticsRefusal(value: unknown): AnalyticsRefusal | undefined;
|
|
32
|
-
|
|
32
|
+
/**
|
|
33
|
+
* What an `unsafe_join` refusal is about, in the model's own words (labels,
|
|
34
|
+
* never dataset names or SQL), so the copy can name the measure and the fix
|
|
35
|
+
* (Rohit, 2026-11-15). The planner attaches it as `details.subject`.
|
|
36
|
+
*/
|
|
37
|
+
export type UnsafeJoinSubject = {
|
|
38
|
+
/** The measure as the card names it ("Count of Name"). */
|
|
39
|
+
measure: string;
|
|
40
|
+
aggregate?: string;
|
|
41
|
+
/** The dataset the measure counts or adds up ("Organizations"). */
|
|
42
|
+
measureDataset: string;
|
|
43
|
+
/** The dataset the query is based on ("Dashboard Requests"). */
|
|
44
|
+
baseDataset: string;
|
|
45
|
+
};
|
|
46
|
+
export declare function readUnsafeJoinSubject(details: Record<string, unknown> | undefined): UnsafeJoinSubject | undefined;
|
|
47
|
+
/** The one wording of a measure that would count related rows more than once, for every surface. */
|
|
48
|
+
export declare function unsafeJoinCopy(subject: UnsafeJoinSubject): {
|
|
49
|
+
message: string;
|
|
50
|
+
nextStep: string;
|
|
51
|
+
};
|
|
52
|
+
export declare function publicAnalyticsRefusal(refusal: Pick<AnalyticsRefusal, 'code'> & Partial<Pick<AnalyticsRefusal, 'status' | 'retryable' | 'details'>>): AnalyticsRefusal;
|
|
@@ -28,11 +28,14 @@ export type LabelProvenance = {
|
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
30
30
|
* The aggregate a measure gets when nobody chooses one, the one rule the
|
|
31
|
-
* editor (a field dropped on the measures),
|
|
32
|
-
* reader share: the semantic model's,
|
|
33
|
-
* known) and
|
|
31
|
+
* editor (a field dropped on the measures), a Table sheet, an agent's card
|
|
32
|
+
* change, the governed compiler and every reader share: the semantic model's,
|
|
33
|
+
* else SUM for a number (or a type not known) and the count of distinct values
|
|
34
|
+
* for anything else (Rohit, 2026-11-15: "how many statuses" is 3, not 10,000;
|
|
35
|
+
* it is also the only count that stays right across a join). A count of rows
|
|
36
|
+
* is asked for as such (`__count`, `COUNT(*)`).
|
|
34
37
|
*/
|
|
35
|
-
export declare function defaultMetricAggregate<A extends string>(semanticAggregate: A | undefined, dataType?: string): A | 'SUM' | '
|
|
38
|
+
export declare function defaultMetricAggregate<A extends string>(semanticAggregate: A | undefined, dataType?: string): A | 'SUM' | 'DISTINCT';
|
|
36
39
|
/**
|
|
37
40
|
* The compiler's record of a measure's aggregate: the aggregate it runs, and
|
|
38
41
|
* whether that is the default or an override. Asking for SUM on a SUM measure
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { TCard } from '../../../lib/types/common-types.js';
|
|
2
2
|
import { DataSource, DatabaseEntityReference, Field } from '../../../lib/types/explorer-types.js';
|
|
3
|
+
import { CardFieldFolder } from './card-field-folders.js';
|
|
4
|
+
import { JoinReach } from './join-reach.js';
|
|
5
|
+
import { FieldFolderColumn } from '../field-folders/index.js';
|
|
3
6
|
type Entity = DatabaseEntityReference;
|
|
4
7
|
/** How one card is reached from a folder's dataset. */
|
|
5
8
|
export type FilterFolderCard = {
|
|
@@ -129,4 +132,49 @@ export declare function filterReachLine(input: {
|
|
|
129
132
|
/** A key field's label on the card's base. */
|
|
130
133
|
keyLabel?: (baseLabel: string, field: string) => string;
|
|
131
134
|
}): string;
|
|
135
|
+
/**
|
|
136
|
+
* Which base each related dataset's folder hangs under in a filter picker
|
|
137
|
+
* (filter picker folder tree): each dataset once, under the base that reaches
|
|
138
|
+
* it in the fewest steps, then the first base (bases in the picker's order,
|
|
139
|
+
* most cards first). The editor's field list draws each base's tree
|
|
140
|
+
* (`cardFieldFolders`); this only says which base's tree shows a dataset. A
|
|
141
|
+
* base is never placed under another base. `reachOf` is the domain's reach
|
|
142
|
+
* (the joinability response) from a base. Pure.
|
|
143
|
+
*/
|
|
144
|
+
export declare function filterFolderPlacement(input: {
|
|
145
|
+
/** The datasets the picker's cards are built on, in the picker's order. */
|
|
146
|
+
bases: readonly string[];
|
|
147
|
+
/** The related datasets the server says a filter on reaches a card. */
|
|
148
|
+
datasets: readonly string[];
|
|
149
|
+
reachOf: (base: string) => readonly {
|
|
150
|
+
dataset: string;
|
|
151
|
+
steps: readonly unknown[];
|
|
152
|
+
}[];
|
|
153
|
+
}): Map<string, string>;
|
|
154
|
+
/**
|
|
155
|
+
* A filter picker's folders as trees, already resolved (filter picker folder
|
|
156
|
+
* tree; Astra's follow-up, ledger P8-20): one tree per base, each dataset
|
|
157
|
+
* where its key is (`cardFieldFolders` over the domain's reach, named after
|
|
158
|
+
* the key), showing only what the server offers, each dataset once
|
|
159
|
+
* (`filterFolderPlacement`). No card is involved: which folders a filter can
|
|
160
|
+
* use is the server's answer over every card, so one card's own joins never
|
|
161
|
+
* hide a dataset another card reaches. What no tree draws comes back as
|
|
162
|
+
* `loose`, listed after the trees. Pure.
|
|
163
|
+
*/
|
|
164
|
+
export declare function filterFieldTrees<C extends FieldFolderColumn>(input: {
|
|
165
|
+
/** The datasets the picker's cards are built on, in the picker's order. */
|
|
166
|
+
bases: readonly string[];
|
|
167
|
+
/** Every dataset the server says a filter on reaches a card, bases included. */
|
|
168
|
+
offered: readonly string[];
|
|
169
|
+
/** The domain's reach from a base (the joinability response). */
|
|
170
|
+
reachOf: (base: string) => readonly JoinReach[];
|
|
171
|
+
columnsOf: (dataset: string) => readonly C[];
|
|
172
|
+
labelOf: (dataset: string) => string;
|
|
173
|
+
}): {
|
|
174
|
+
trees: Array<{
|
|
175
|
+
base: string;
|
|
176
|
+
folders: CardFieldFolder<C>[];
|
|
177
|
+
}>;
|
|
178
|
+
loose: string[];
|
|
179
|
+
};
|
|
132
180
|
export {};
|
|
@@ -46,19 +46,13 @@ export declare function writeKpiTrendGrain<T extends Pick<TCard, 'config'>>(card
|
|
|
46
46
|
* and each named measure's total, keyed by its result alias. Overall is the
|
|
47
47
|
* default, so a measure set to it is removed, and an emptied map with it;
|
|
48
48
|
* measures the change doesn't name keep their setting. The table settings,
|
|
49
|
-
* Document sections and the MCP write totals here
|
|
50
|
-
*
|
|
49
|
+
* Document sections and the MCP write totals here. The row's look is the
|
|
50
|
+
* theme's (table style TS-D12).
|
|
51
51
|
*/
|
|
52
52
|
export declare function writeTableTotals(preferences: TCardPreferences | undefined, change: {
|
|
53
53
|
row?: boolean;
|
|
54
54
|
measures?: Record<string, TableMeasureTotal>;
|
|
55
55
|
}): TCardPreferences;
|
|
56
|
-
/** The stored totals' measure settings, for a style reset that rebuilds the totals row's look. */
|
|
57
|
-
export declare function keptMeasureTotals(totals: {
|
|
58
|
-
measures?: Record<string, TableMeasureTotal>;
|
|
59
|
-
} | undefined): {
|
|
60
|
-
measures?: Record<string, TableMeasureTotal>;
|
|
61
|
-
};
|
|
62
56
|
/**
|
|
63
57
|
* A chart's data labels shown or hidden, and their own format, onto the
|
|
64
58
|
* stored config filled with the chart's defaults, as the data labels panel
|
|
@@ -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' | 'trend' | 'trendGrain' | 'seeRecords' | 'columnOrder' | 'columnFilters' | 'tableSearch';
|
|
3
|
+
export type SettingName = 'columns.label' | 'columns.format' | 'columns.hidden' | 'columns.pinned' | 'columns.width' | 'columns.display' | 'orientation' | 'stack' | 'donut' | 'totals' | 'dataLabels' | 'legend' | 'axes' | 'highlights' | 'columns.polarity' | 'comparisonDisplay' | 'trend' | 'trendGrain' | 'seeRecords' | 'columnOrder' | 'columnFilters' | 'tableSearch';
|
|
4
4
|
export declare const SETTINGS_BY_KIND: Readonly<Record<CardType, readonly SettingName[]>>;
|
|
5
5
|
export type CardSettingsKind = {
|
|
6
6
|
type: CardType;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** A Status value's colour, by name: resolved through the theme's colours, never stored as a colour (table style TS-D17). */
|
|
2
|
+
export type StatusTone = 'green' | 'red' | 'amber' | 'blue' | 'grey';
|
|
3
|
+
export declare const STATUS_TONES: readonly StatusTone[];
|
|
4
|
+
/** Monospace lines shown before Show more (TS-D16). */
|
|
5
|
+
export type MonospaceLines = 2 | 3 | 5 | 'all';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { TCard } from '../../../lib/types/common-types.js';
|
|
2
|
+
import { PersistedColumnSettings } from '../../../components/visual/data-table/types/data-table.js';
|
|
3
|
+
import { MonospaceLines, StatusTone } from './column-display-values.js';
|
|
4
|
+
import { ColumnSettingsRole } from './views.js';
|
|
5
|
+
export type { MonospaceLines, StatusTone } from './column-display-values.js';
|
|
6
|
+
export type ColumnDisplayInput = {
|
|
7
|
+
as: 'text';
|
|
8
|
+
} | {
|
|
9
|
+
as: 'monospace';
|
|
10
|
+
lines?: MonospaceLines;
|
|
11
|
+
}
|
|
12
|
+
/** `shape`: a pill or a dot (stored as `badge.style`). */
|
|
13
|
+
| {
|
|
14
|
+
as: 'status';
|
|
15
|
+
shape?: 'pill' | 'dot';
|
|
16
|
+
colors?: Record<string, StatusTone>;
|
|
17
|
+
} | {
|
|
18
|
+
as: 'link';
|
|
19
|
+
/** A URL template: `{value}` is the cell, `{Column}` another column's value. */
|
|
20
|
+
address: string;
|
|
21
|
+
label?: 'value' | {
|
|
22
|
+
text: string;
|
|
23
|
+
} | {
|
|
24
|
+
column: string;
|
|
25
|
+
};
|
|
26
|
+
icon?: boolean;
|
|
27
|
+
newTab?: boolean;
|
|
28
|
+
};
|
|
29
|
+
export declare const MONOSPACE_LINES: readonly MonospaceLines[];
|
|
30
|
+
export declare const DEFAULT_MONOSPACE_LINES: MonospaceLines;
|
|
31
|
+
/** The column's Display as from its stored settings; undefined when it shows automatically or as a number, date or progress. */
|
|
32
|
+
export declare function readColumnDisplay(entry: PersistedColumnSettings | undefined): ColumnDisplayInput | undefined;
|
|
33
|
+
/** The stored entry with a Display as written, or removed (`null`: back to automatic). Other settings are kept. */
|
|
34
|
+
export declare function writeColumnDisplayEntry(entry: PersistedColumnSettings | undefined, display: ColumnDisplayInput | null): PersistedColumnSettings;
|
|
35
|
+
/** The card with a column's Display as written, by the column's result key. */
|
|
36
|
+
export declare function writeColumnDisplay<T extends Pick<TCard, 'preferences'>>(card: T, resultKey: string, display: ColumnDisplayInput | null): T;
|
|
37
|
+
/** A Link address's `{placeholders}`, other than `{value}`. */
|
|
38
|
+
export declare function linkAddressColumns(address: string): string[];
|
|
39
|
+
/** How a Display as reads back (SPEC §2.7): "as monospace, up to 3 lines". */
|
|
40
|
+
export declare function columnDisplayWords(display: ColumnDisplayInput | null): string;
|
|
41
|
+
/**
|
|
42
|
+
* Whether a column takes Display as (Text, Monospace, Status, Link): text columns do; a
|
|
43
|
+
* measure keeps its number format and its total (review P4-R3). The one rule the editor's
|
|
44
|
+
* column panel and an agent's change both apply (authoring parity).
|
|
45
|
+
*/
|
|
46
|
+
export declare function columnTakesDisplay(role: ColumnSettingsRole): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Whether a table card's column, by its result key, takes Display as: its role as the
|
|
49
|
+
* card's named columns give it, the same naming an agent's change reads. A column the
|
|
50
|
+
* naming doesn't list (a SQL column before its result arrives) takes it.
|
|
51
|
+
*/
|
|
52
|
+
export declare function cardColumnTakesDisplay(card: TCard, resultKey: string): boolean;
|
|
@@ -11,6 +11,7 @@ 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
13
|
export { writeComparisonDisplay, writeComparisonPresentation, writeInheritComparison, writeSeeRecords, writeTableColumnFilters, writeTableSearch } from './card-display-write.js';
|
|
14
|
+
export { readTableViewerSwitch, tableViewerSwitches, writeTableViewerSwitch, type TableViewerSwitch } from './table-viewer-switches.js';
|
|
14
15
|
export type { ResolvedCardSettings, ResolvedColumnSettings, ResolvedComparisonDisplay } from './resolved.js';
|
|
15
16
|
export { SETTINGS_BY_KIND, cardSettingsKind, type CardSettingsKind, type SettingName } from './card-kinds.js';
|
|
16
17
|
export type { AxisInput, CardSettingsInput, ColumnSettingsInput, ComparisonDisplayInput, DashboardUpdateChange, FormatInput, FormatPatch, HighlightAddChange, HighlightColor, HighlightCondition, HighlightRemoveChange, HighlightStyleInput, LegendPosition, Polarity, } from './inputs.js';
|
|
@@ -2,6 +2,7 @@ import { KpiTrendGrain } from '../kpi-trend-rule.js';
|
|
|
2
2
|
import { MetricComparisonPolarity } from '../../analytics-protocol/metric-comparison.js';
|
|
3
3
|
import { TableColumnTotal } from '../measure-calculations/table-column-total.js';
|
|
4
4
|
import { SemaphorDateValueFormat, SemaphorDurationValueFormat, SemaphorNumericValueFormat, SemaphorValueFormat, TemporalBucketFormat } from '../../analytics-protocol/contracts.js';
|
|
5
|
+
import { ColumnDisplayInput } from './column-display.js';
|
|
5
6
|
/**
|
|
6
7
|
* CA-D18: a whole stored format (it has `type`), or a patch without `type`,
|
|
7
8
|
* merged onto the column's effective format (CF-D20).
|
|
@@ -17,12 +18,20 @@ export type ColumnSettingsInput = {
|
|
|
17
18
|
label?: string | null;
|
|
18
19
|
/** Hidden for everyone (CA-D16); it still computes, sorts and filters. */
|
|
19
20
|
hidden?: boolean;
|
|
21
|
+
/** Held at the left edge of the table (table sheets TS-D9); pinned columns draw in the table's column order. */
|
|
22
|
+
pinned?: boolean;
|
|
20
23
|
/** Table column width in pixels; null returns it to automatic. */
|
|
21
24
|
width?: number | null;
|
|
22
25
|
/** Null removes the card's override, so the column follows the model. */
|
|
23
26
|
format?: FormatInput | null;
|
|
24
27
|
/** The card's own polarity; null removes it. Refused where the model sets a different one (RC-D3). */
|
|
25
28
|
polarity?: Polarity | null;
|
|
29
|
+
/**
|
|
30
|
+
* How a table column shows its values (Display as, table style TS-D20): plain
|
|
31
|
+
* text, monospace, a status with a colour per value, or a link. Null returns the
|
|
32
|
+
* column to its automatic display.
|
|
33
|
+
*/
|
|
34
|
+
display?: ColumnDisplayInput | null;
|
|
26
35
|
/** Read-only facts from the outline, accepted back unchanged (CA-INV-1). */
|
|
27
36
|
field?: string;
|
|
28
37
|
role?: string;
|
|
@@ -5,14 +5,18 @@ import { AxisConfigKey, CardVariant } from './card-display-write.js';
|
|
|
5
5
|
import { ComparisonDisplayInput, LegendPosition, Polarity } from './inputs.js';
|
|
6
6
|
import { TableMeasureTotal } from '../measure-calculations/table-column-total.js';
|
|
7
7
|
import { TableColumnId } from '../../dashboard-viewer/table-settings.js';
|
|
8
|
+
import { ColumnDisplayInput } from './column-display.js';
|
|
8
9
|
export type ResolvedColumnSettings = {
|
|
9
10
|
column: CardColumnRef;
|
|
10
11
|
hidden?: boolean;
|
|
11
12
|
width?: number | null;
|
|
13
|
+
pinned?: boolean;
|
|
12
14
|
/** Whole and validated; null removes the override. */
|
|
13
15
|
format?: SemaphorValueFormat | null;
|
|
14
16
|
/** The card's own polarity; null removes it (RC-D3). */
|
|
15
17
|
polarity?: Polarity | null;
|
|
18
|
+
/** Display as, checked; null returns the column to automatic (table style TS-D20). */
|
|
19
|
+
display?: ColumnDisplayInput | null;
|
|
16
20
|
};
|
|
17
21
|
/** Only the comparison display fields that change; precision null removes the stored precision (RC-D4). */
|
|
18
22
|
export type ResolvedComparisonDisplay = {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TCard, TCardPreferences } from '../../../lib/types/common-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* What viewers may change on a table (PLAN B1, table column filters TCF-D6):
|
|
4
|
+
* customize its columns, filter them from their headers, search it. One owner
|
|
5
|
+
* of which switch a card takes and of each write, for the table settings in
|
|
6
|
+
* the card editor and a Table sheet's settings menu (table sheets TS-D11).
|
|
7
|
+
* Absent means on; only `false` is stored.
|
|
8
|
+
*/
|
|
9
|
+
export type TableViewerSwitch = 'columns' | 'columnFilters' | 'search';
|
|
10
|
+
type SwitchCard = Pick<TCard, 'type' | 'preferences' | 'sql' | 'python' | 'config'>;
|
|
11
|
+
/** The switches this card takes, in menu order: columns on tables and detail tables; filters and search where the card's kind takes them. */
|
|
12
|
+
export declare function tableViewerSwitches(card: SwitchCard): TableViewerSwitch[];
|
|
13
|
+
export declare function readTableViewerSwitch(preferences: TCardPreferences | undefined, which: TableViewerSwitch): boolean;
|
|
14
|
+
export declare function writeTableViewerSwitch(preferences: TCardPreferences | undefined, which: TableViewerSwitch, on: boolean): TCardPreferences;
|
|
15
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SemaphorValueFormat } from '../../analytics-protocol/contracts.js';
|
|
2
2
|
import { CardSettingsInput, HighlightStyleInput, Polarity } from './inputs.js';
|
|
3
|
+
import { ColumnDisplayInput } from './column-display.js';
|
|
3
4
|
export type ColumnSettingsRole = 'measure' | 'dimension' | 'detail' | 'result' | 'value';
|
|
4
5
|
export type ColumnSettingsView = {
|
|
5
6
|
/** The column's field; absent for SQL result columns. Read-only. */
|
|
@@ -8,10 +9,14 @@ export type ColumnSettingsView = {
|
|
|
8
9
|
label: string;
|
|
9
10
|
hidden?: true;
|
|
10
11
|
width?: number;
|
|
12
|
+
/** Held at the left edge of the table for everyone, until a viewer pins their own (table sheets TS-D9). */
|
|
13
|
+
pinned?: true;
|
|
11
14
|
/** The card's override only; absent when the column follows the model. */
|
|
12
15
|
format?: SemaphorValueFormat;
|
|
13
16
|
/** Shown when the card or the model sets it; absent means higher is better (RC-D3). */
|
|
14
17
|
polarity?: Polarity;
|
|
18
|
+
/** How the column shows its values, when the card sets Text, Monospace, Status or Link (table style TS-D20). */
|
|
19
|
+
display?: ColumnDisplayInput;
|
|
15
20
|
/** What the column takes from the model (CA-D5); 'polarity' when the model sets it. Read-only. */
|
|
16
21
|
inherits?: Array<'label' | 'format' | 'polarity'>;
|
|
17
22
|
};
|
|
@@ -42,6 +42,12 @@ export type CardQueryPart = {
|
|
|
42
42
|
statedLabels?: ColumnKey[];
|
|
43
43
|
/** What a change to a stored card states (DE-D61); absent, the part states everything. */
|
|
44
44
|
change?: QueryChange;
|
|
45
|
+
/**
|
|
46
|
+
* The folder each related dataset sits in, by dataset, as the editor's field
|
|
47
|
+
* list names it ("Organization"): an added column from there is named after
|
|
48
|
+
* it (`relatedColumnLabel`), as the editor's placement names it.
|
|
49
|
+
*/
|
|
50
|
+
relatedFolderLabels?: Readonly<Record<string, string>>;
|
|
45
51
|
};
|
|
46
52
|
/** The parts of a card's query a `card.update` can state. */
|
|
47
53
|
export declare const QUERY_ASPECTS: readonly ["measures", "groupings", "columns", "filters", "order", "limit"];
|