react-semaphor 0.1.604 → 0.1.606
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-fIhJSX6y.js +613 -0
- package/dist/chunks/appearance-runtime-provider-Bx8H-moR.js +1 -0
- package/dist/chunks/{assistant-chat-CjYrwVDa.js → assistant-chat-SBKSrrEA.js} +19 -24
- package/dist/chunks/attachment-filter-line-C_zHMhGh.js +1 -0
- package/dist/chunks/{bookmark-impact-C89zBLq3.js → bookmark-impact-BW30cm5E.js} +1 -1
- package/dist/chunks/bookmark-state-DScd31KT.js +1 -0
- package/dist/chunks/brand-CL5xDiFH.js +1 -0
- package/dist/chunks/card-filter-builder-CzScSOQY.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-Cyhj9EOl.js +1 -0
- package/dist/chunks/dashboard-briefing-launcher-CyOFddmD.js +42 -0
- package/dist/chunks/dashboard-controls-DpADfhr0.js +42 -0
- package/dist/chunks/dashboard-json-4xMChR2q.js +1 -0
- package/dist/chunks/dashboard-temporal-snapshot-w3SMiPKj.js +1 -0
- package/dist/chunks/edit-dashboard-visual-DlvY7au4.js +73 -0
- package/dist/chunks/filter-line-WwUV5JzN.js +1 -0
- package/dist/chunks/filter-reach-preview-DAEIyrEG.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-N1Xkwe_u.js +1 -0
- package/dist/chunks/{layout-grid-BWtlgw0T.js → layout-grid-Dtsioq4h.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-565cA0nh.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-B2ZGPS9t.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-SlAAe4GF.js +8 -0
- package/dist/chunks/resolver-CjsW8Rz0.js +1 -0
- package/dist/chunks/saved-dashboard-context-Bc2SVDr-.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-Bj-cjkz-.js +612 -0
- package/dist/chunks/set-CACXVM2A.js +1 -0
- package/dist/chunks/slider-CWze9OEM.js +4 -0
- package/dist/chunks/stored-dashboard-CcNdU-mG.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-CRbSYdB6.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/measure-calculations/index.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/window-transforms.d.ts +2 -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
package/dist/surfboard/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,R as s,D as o}from"../chunks/report-preferences-dialog-
|
|
1
|
+
import{a,R as s,D as o}from"../chunks/report-preferences-dialog-B2ZGPS9t.js";import{C as f,E as D}from"../chunks/bookmark-state-DScd31KT.js";export{f as CONTROL_CARD_DEFAULT_VALUE,a as DisplayFormatPreferencesFields,D as EMPTY_SELECTION,s as ReportPreferencesDialog,o as Surfboard};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { AppearanceValidationIssue } from '../lib/appearance/types.js';
|
|
1
2
|
import { APPEARANCE_SPEC_VERSION, AppearanceSpec } from '../lib/appearance/index.js';
|
|
2
3
|
type AppearanceMode = 'light' | 'dark' | 'system';
|
|
3
4
|
type AppearanceSchemeName = 'light' | 'dark';
|
|
4
|
-
type AppearanceDensity = 'compact' | 'comfortable' | 'spacious';
|
|
5
5
|
type AppearanceScheme = NonNullable<NonNullable<AppearanceSpec['schemes']>[AppearanceSchemeName]>;
|
|
6
6
|
type AppearanceTokens = NonNullable<AppearanceScheme['tokens']>;
|
|
7
7
|
type AppearanceComponents = NonNullable<AppearanceScheme['components']>;
|
|
8
8
|
type AppearanceColorTokens = NonNullable<AppearanceTokens['color']>;
|
|
9
9
|
type AppearanceTable = NonNullable<AppearanceComponents['table']>;
|
|
10
|
+
type AppearanceDocumentTable = NonNullable<AppearanceComponents['documentTable']>;
|
|
10
11
|
export type BrandStudioDraft = {
|
|
11
12
|
version: typeof APPEARANCE_SPEC_VERSION;
|
|
12
13
|
mode: AppearanceMode;
|
|
@@ -33,19 +34,15 @@ type RequiredBrandStudioComponents = {
|
|
|
33
34
|
card: NonNullable<AppearanceComponents['card']>;
|
|
34
35
|
interactive: NonNullable<AppearanceComponents['interactive']>;
|
|
35
36
|
chart: Required<NonNullable<AppearanceComponents['chart']>>;
|
|
36
|
-
|
|
37
|
+
/**
|
|
38
|
+
* The tables' look as the brand and the defaults set it, nothing filled in: the
|
|
39
|
+
* Tables section reads what renders through `resolveTableStyle` and writes fields
|
|
40
|
+
* here (table style SPEC §2.6), so an untouched save stores nothing for tables.
|
|
41
|
+
*/
|
|
42
|
+
table: AppearanceTable;
|
|
43
|
+
documentTable: AppearanceDocumentTable;
|
|
37
44
|
pagination: NonNullable<AppearanceComponents['pagination']>;
|
|
38
45
|
};
|
|
39
|
-
type RequiredTableAppearance = {
|
|
40
|
-
density: AppearanceDensity;
|
|
41
|
-
container: NonNullable<AppearanceTable['container']>;
|
|
42
|
-
header: Required<NonNullable<AppearanceTable['header']>>;
|
|
43
|
-
row: Required<Omit<NonNullable<AppearanceTable['row']>, 'selectedBackground'>>;
|
|
44
|
-
cell: Required<NonNullable<AppearanceTable['cell']>>;
|
|
45
|
-
subtotal: Required<NonNullable<AppearanceTable['subtotal']>>;
|
|
46
|
-
grandTotal: Required<NonNullable<AppearanceTable['grandTotal']>>;
|
|
47
|
-
pagination: Required<NonNullable<AppearanceTable['pagination']>>;
|
|
48
|
-
};
|
|
49
46
|
type BrandStudioPreset = {
|
|
50
47
|
id: string;
|
|
51
48
|
name: string;
|
|
@@ -74,9 +71,21 @@ type PresetScheme = {
|
|
|
74
71
|
export declare const BRAND_STUDIO_PRESETS: BrandStudioPreset[];
|
|
75
72
|
export declare function createBrandStudioDraft(appearance?: AppearanceSpec | null): BrandStudioDraft;
|
|
76
73
|
export declare function buildAppearanceSpecFromDraft(draft: BrandStudioDraft): AppearanceSpec;
|
|
74
|
+
/** A draft that doesn't validate, carrying the validator's first issue so the editor can name the field. */
|
|
75
|
+
export declare class BrandStudioDraftError extends Error {
|
|
76
|
+
readonly issue: AppearanceValidationIssue;
|
|
77
|
+
constructor(issue: AppearanceValidationIssue);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The draft as the product will draw it once saved: what Save writes (`brandStudioSaveSpec`,
|
|
81
|
+
* sparse), over the defaults, as the runtime loads a saved brand. Every Brand Studio read of
|
|
82
|
+
* what renders goes through this (the Tables controls and preview, the Dashboards controls,
|
|
83
|
+
* the preview pane), so none can show what doesn't save (review hotspot H-BS-1).
|
|
84
|
+
*/
|
|
85
|
+
export declare function resolveBrandStudioDraft(draft: BrandStudioDraft): import('../lib/appearance/index.js').NormalizedAppearanceSpec;
|
|
77
86
|
/**
|
|
78
87
|
* The brand as it is saved: what differs from the defaults, on one path each
|
|
79
|
-
* (dashboard style API-3). A component
|
|
88
|
+
* (dashboard style API-3). A component color the draft only copied from its token
|
|
80
89
|
* on the dashboard canvas or the card frame (the editor's shape fills them) is left
|
|
81
90
|
* to the token, so a later token change still reaches that surface.
|
|
82
91
|
*/
|
|
@@ -84,4 +93,27 @@ export declare function brandStudioSaveSpec(draft: BrandStudioDraft): Appearance
|
|
|
84
93
|
export declare function applyBrandStudioPreset(draft: BrandStudioDraft, presetId: string): BrandStudioDraft;
|
|
85
94
|
export declare function applyBrandStudioColorToken(scheme: RequiredBrandStudioScheme, token: BrandStudioColorToken, value: string): void;
|
|
86
95
|
export declare function applyBrandStudioRadiusToken(scheme: RequiredBrandStudioScheme, token: BrandStudioRadiusToken, value: number): void;
|
|
96
|
+
/** Whether two colors are the same, whatever their notation (`#18181b`, `hsl(240 5.9% 10%)`). */
|
|
97
|
+
export declare function sameColor(a: string | undefined, b: string | undefined): boolean;
|
|
98
|
+
/** The default value of a color token in a scheme, for a color's reset. */
|
|
99
|
+
export declare function defaultColorToken(scheme: AppearanceSchemeName, token: BrandStudioColorToken): string | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* How many settings differ between the draft and the saved brand, for "Save 3
|
|
102
|
+
* changes": the leaves each would save, less a token's copies, with a setting both
|
|
103
|
+
* schemes now share counted once. Undefined while the draft is invalid.
|
|
104
|
+
*/
|
|
105
|
+
export declare function countDraftChanges(draft: BrandStudioDraft, saved: AppearanceSpec | null | undefined): number | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Table colors an earlier Brand Studio copied from the color tokens (table style
|
|
108
|
+
* ledger P3-11): a field it filled, without a control now, equal to one of its
|
|
109
|
+
* scheme's color tokens. They no
|
|
110
|
+
* longer follow the tokens; `followTokenColors` removes them so they do.
|
|
111
|
+
*/
|
|
112
|
+
export declare function copiedTableColors(draft: BrandStudioDraft): Array<{
|
|
113
|
+
scheme: AppearanceSchemeName;
|
|
114
|
+
part: string;
|
|
115
|
+
key: string;
|
|
116
|
+
}>;
|
|
117
|
+
/** The draft with every copied table color removed, so tables follow the color tokens again. */
|
|
118
|
+
export declare function followTokenColors(draft: BrandStudioDraft): BrandStudioDraft;
|
|
87
119
|
export {};
|
|
@@ -2,7 +2,12 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { AppearanceSpec } from '../lib/appearance/index.js';
|
|
3
3
|
export type BrandStudioEditorProps = {
|
|
4
4
|
appearance?: AppearanceSpec | null;
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* `page`: a section list, one section and a live preview side by side (the
|
|
7
|
+
* organization's Brand Studio page). `panel`: a narrow side panel beside a live
|
|
8
|
+
* dashboard, which is the preview (the default).
|
|
9
|
+
*/
|
|
10
|
+
layout?: 'page' | 'panel';
|
|
6
11
|
isLoading?: boolean;
|
|
7
12
|
isSaving?: boolean;
|
|
8
13
|
error?: string | null;
|
|
@@ -12,4 +17,10 @@ export type BrandStudioEditorProps = {
|
|
|
12
17
|
onClearConfig?: () => void | Promise<void>;
|
|
13
18
|
onCancel?: () => void;
|
|
14
19
|
};
|
|
15
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Brand Studio (mock /design/admin/brand-studio): one section at a time, beside a
|
|
22
|
+
* live preview. Brand sets the look in four choices; the other sections fine-tune
|
|
23
|
+
* it. Colors belong to the scheme being edited; every other setting applies to
|
|
24
|
+
* both. Save names how many settings changed.
|
|
25
|
+
*/
|
|
26
|
+
export declare function BrandStudioEditor({ appearance, layout, isLoading, isSaving, error, className, onDraftChange, onSave, onClearConfig, onCancel, }: BrandStudioEditorProps): React.JSX.Element;
|
|
@@ -35,6 +35,7 @@ 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 { isGridSheet, isTableSheet, sheetKindOf } from '../shared/dashboard-authoring/sheet-kinds.js';
|
|
38
39
|
export { ArrangeLayoutButton } from './surfboard/arrange-layout-button.js';
|
|
39
40
|
export { ScreenSizePreviewButton } from './surfboard/screen-size-preview-button.js';
|
|
40
41
|
export { DashboardFavoriteToggle } from './dashboard/favorites/dashboard-favorite-toggle.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ColumnShapes, ColumnHeaderAction } from '../../../../lib/dashboard-viewer/column-header-actions.js';
|
|
2
|
+
import { DataTableRow, ColumnSettings, ColumnSettingsMap } from '../types/data-table.js';
|
|
2
3
|
import { default as React } from 'react';
|
|
3
4
|
import { SortingState, RowSelectionState, VisibilityState, ColumnSizingState } from '@tanstack/react-table';
|
|
4
5
|
import { ComparisonMetadataMap } from '../../../../lib/types/query-types.js';
|
|
@@ -7,13 +8,14 @@ import { RawTemporalValueKind, SemaphorResultColumn } from '../../../../shared/a
|
|
|
7
8
|
import { ConditionalFormattingRenderContext, TableBaseFormatting, TableBaseStyle } from '../../../../lib/table-formatting/index.js';
|
|
8
9
|
import { RawTemporalPresentation } from '../../../../lib/formatters/raw-temporal-presentation.js';
|
|
9
10
|
import { ViewerDataTable } from '../../../../lib/dashboard-viewer/use-table-view.js';
|
|
11
|
+
import { TableView } from '../../../../lib/dashboard-viewer/table-view.js';
|
|
10
12
|
/**
|
|
11
13
|
* A dashboard table seen by a viewer (dashboard bookmarks): the viewer's table
|
|
12
14
|
* settings shape the columns and the sort is controlled by them. Absent in the
|
|
13
15
|
* editor and while the dashboard is edited.
|
|
14
16
|
*/
|
|
15
17
|
export type DataTableViewerContext = ViewerDataTable;
|
|
16
|
-
interface DataTableLogicProps {
|
|
18
|
+
export interface DataTableLogicProps {
|
|
17
19
|
data: any[];
|
|
18
20
|
resultColumns?: SemaphorResultColumn[];
|
|
19
21
|
columnKeyMap?: QueryColumnKeyMap;
|
|
@@ -37,7 +39,6 @@ interface DataTableLogicProps {
|
|
|
37
39
|
onColumnVisibilityChange?: (columnId: string, isVisible: boolean) => void;
|
|
38
40
|
onSortChange?: (sorting: SortingState) => void;
|
|
39
41
|
sortState?: SortingState;
|
|
40
|
-
onColumnOrderChange?: (change: TableColumnOrderChange) => void;
|
|
41
42
|
columnSizing?: ColumnSizingState;
|
|
42
43
|
onColumnSizingChange?: (updater: ColumnSizingState | ((old: ColumnSizingState) => ColumnSizingState)) => void;
|
|
43
44
|
card?: any;
|
|
@@ -50,10 +51,21 @@ interface DataTableLogicProps {
|
|
|
50
51
|
headerWrapText?: boolean;
|
|
51
52
|
appearanceWrapText?: boolean;
|
|
52
53
|
viewerTable?: DataTableViewerContext;
|
|
54
|
+
/**
|
|
55
|
+
* Hold the view's pinned columns at the left edge (table sheets PIN-3): on
|
|
56
|
+
* screen only, never in print or a download's render.
|
|
57
|
+
*/
|
|
58
|
+
pinColumns?: boolean;
|
|
59
|
+
/** An author's Pin or Move from the header menu (the card editor, a Table sheet in edit mode): writes the card. */
|
|
60
|
+
onAuthorColumnHeaderAction?: (outputKey: string, action: ColumnHeaderAction, view: TableView) => void;
|
|
61
|
+
/** The author's menu offers Group rows by, Spread across and Remove (a Table sheet's table, TS-D30), with its date fields. */
|
|
62
|
+
authorShapes?: ColumnShapes;
|
|
63
|
+
/** A Table sheet author's "add a column" control, drawn after the last header and held at the right edge (option C). */
|
|
64
|
+
addColumn?: React.ReactNode;
|
|
53
65
|
}
|
|
54
66
|
export declare function useDataTableLogic(props: DataTableLogicProps): {
|
|
55
67
|
table: import('@tanstack/table-core').Table<any>;
|
|
56
|
-
tableView:
|
|
68
|
+
tableView: TableView;
|
|
57
69
|
columnSettingsToUse: ColumnSettingsMap;
|
|
58
70
|
selectColumnVisible: boolean;
|
|
59
71
|
columnVisibilityToUse: VisibilityState;
|
|
@@ -83,7 +95,7 @@ export declare function useDataTableLogic(props: DataTableLogicProps): {
|
|
|
83
95
|
internalSelectColumnVisible: boolean;
|
|
84
96
|
getRowStyle: (_row: any) => React.CSSProperties;
|
|
85
97
|
setColumnSettingsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
86
|
-
columns: import('@tanstack/table-core').ColumnDef<
|
|
98
|
+
columns: import('@tanstack/table-core').ColumnDef<DataTableRow>[];
|
|
87
99
|
internalColumnVisibility: VisibilityState;
|
|
88
100
|
totalColumns: number;
|
|
89
101
|
totalRows: number;
|
|
@@ -104,4 +116,3 @@ export declare function useDataTableLogic(props: DataTableLogicProps): {
|
|
|
104
116
|
rawTemporalPresentation: RawTemporalPresentation | undefined;
|
|
105
117
|
usesDeclaredSqlRawTemporalPresentation: boolean;
|
|
106
118
|
};
|
|
107
|
-
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { MonospaceLines, StatusTone } from '../../../../shared/dashboard-authoring/card-settings/column-display-values.js';
|
|
1
2
|
import { SeeRecordsOfferFor } from '../../../../lib/see-records/use-see-records-offer.js';
|
|
3
|
+
import { ColumnShapes } from '../../../../lib/dashboard-viewer/column-header-actions.js';
|
|
2
4
|
import { TCard } from '../../../../lib/types/common-types.js';
|
|
3
|
-
import { CSSProperties } from 'react';
|
|
5
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
4
6
|
import { Column, SortingState, ColumnSizingState } from '@tanstack/react-table';
|
|
5
7
|
import { PaginationMetadata, QueryColumnKeyMap } from '../../../../lib/types/explorer-types.js';
|
|
6
8
|
import { Interaction } from '../../../../lib/types/interaction-types.js';
|
|
@@ -12,14 +14,6 @@ import { ConditionalFormattingRenderContext, TableBaseFormatting, TableBaseStyle
|
|
|
12
14
|
import { ColumnTextWrap } from '../../../../lib/table-formatting/table-text-flow.js';
|
|
13
15
|
import { RawTemporalValueKind, SemaphorResultColumn } from '../../../../shared/analytics-protocol/index.js';
|
|
14
16
|
import { TableColumnId } from '../../../../shared/dashboard-viewer/table-settings.js';
|
|
15
|
-
/** A header drag's result, ready for `writeTableColumnOrder(card, order, baseline)`. */
|
|
16
|
-
export type TableColumnOrderChange = {
|
|
17
|
-
readonly order: readonly TableColumnId[];
|
|
18
|
-
readonly baseline: {
|
|
19
|
-
readonly fieldOrder: readonly TableColumnId[];
|
|
20
|
-
readonly pivoted: boolean;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
17
|
export type { ColumnTextWrap } from '../../../../lib/table-formatting/table-text-flow.js';
|
|
24
18
|
export interface LinkFormat {
|
|
25
19
|
urlTemplate: string;
|
|
@@ -27,9 +21,26 @@ export interface LinkFormat {
|
|
|
27
21
|
staticLabel?: string;
|
|
28
22
|
labelColumn?: string;
|
|
29
23
|
openInNewTab: boolean;
|
|
24
|
+
/** An external-link icon after the label (table style TS-D18); off by default. */
|
|
25
|
+
showIcon?: boolean;
|
|
30
26
|
}
|
|
27
|
+
export type { MonospaceLines, StatusTone };
|
|
31
28
|
export interface ColumnSettings {
|
|
32
|
-
|
|
29
|
+
/**
|
|
30
|
+
* How the column shows its values ("Display as", table style TS-D15). `badge` is
|
|
31
|
+
* shown as Status (its saved id kept); `mono` is Monospace. Written for Text,
|
|
32
|
+
* Monospace, Status and Link through `writeColumnDisplay` only.
|
|
33
|
+
*/
|
|
34
|
+
type: 'none' | 'text' | 'mono' | 'number' | 'date' | 'badge' | 'link' | 'progress';
|
|
35
|
+
/** Monospace: lines shown before Show more (default 3); print shows every line (TS-D16). */
|
|
36
|
+
mono?: {
|
|
37
|
+
maxLines: MonospaceLines;
|
|
38
|
+
};
|
|
39
|
+
/** Status: a pill or a dot, and a tone per value; a value with none is grey (TS-D17). */
|
|
40
|
+
badge?: {
|
|
41
|
+
style: 'pill' | 'dot';
|
|
42
|
+
tones: Record<string, StatusTone>;
|
|
43
|
+
};
|
|
33
44
|
inheritMetricFormat?: boolean;
|
|
34
45
|
textAlign: 'left' | 'center' | 'right';
|
|
35
46
|
width: number;
|
|
@@ -69,26 +80,11 @@ export interface ColumnSettings {
|
|
|
69
80
|
linkFormat: LinkFormat;
|
|
70
81
|
}
|
|
71
82
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* the Linear-style spec). Drives row padding, cell font size, and header
|
|
75
|
-
* font size via a shared density spec in DataTable.
|
|
83
|
+
* Whether a table's totals row shows, and each measure's total. How it looks is
|
|
84
|
+
* the theme's (table style TS-D12); a saved look field is never read.
|
|
76
85
|
*/
|
|
77
|
-
export type
|
|
78
|
-
export type TableHeaderStyle = 'plain' | 'filled' | 'accent';
|
|
79
|
-
export type TableGridLines = 'none' | 'outer' | 'inner' | 'horizontal' | 'vertical' | 'top' | 'right' | 'bottom' | 'left' | 'full';
|
|
80
|
-
export type TableTotalsFontWeight = 'normal' | 'medium' | 'semibold' | 'bold';
|
|
81
|
-
/** How the totals row looks. */
|
|
82
|
-
export type TableTotalsRowStyle = {
|
|
86
|
+
export type TableTotalsStylePreferences = {
|
|
83
87
|
enabled?: boolean;
|
|
84
|
-
backgroundColor?: string;
|
|
85
|
-
textColor?: string;
|
|
86
|
-
fontWeight?: TableTotalsFontWeight;
|
|
87
|
-
borderTop?: boolean;
|
|
88
|
-
borderTopStyle?: 'solid' | 'dashed' | 'dotted' | 'double';
|
|
89
|
-
borderTopColor?: string;
|
|
90
|
-
};
|
|
91
|
-
export type TableTotalsStylePreferences = TableTotalsRowStyle & {
|
|
92
88
|
/**
|
|
93
89
|
* Each measure's total, keyed by the measure instance's result alias
|
|
94
90
|
* (`resolveMetricResultAlias`). Missing means overall (table overall totals
|
|
@@ -96,13 +92,14 @@ export type TableTotalsStylePreferences = TableTotalsRowStyle & {
|
|
|
96
92
|
*/
|
|
97
93
|
measures?: Record<string, TableMeasureTotal>;
|
|
98
94
|
};
|
|
95
|
+
/**
|
|
96
|
+
* A table's own display settings (table style TS-D12): Wrap text, which depends
|
|
97
|
+
* on the content (unset follows the theme), and the totals row. Every other look
|
|
98
|
+
* setting is the theme's; saved cards may still hold the old fields (`density`,
|
|
99
|
+
* `headerStyle`, colours, `gridLines`, `stripedRows`, the totals look), which
|
|
100
|
+
* nothing reads (TS-D2, TS-D13).
|
|
101
|
+
*/
|
|
99
102
|
export type TableStylePreferences = {
|
|
100
|
-
headerStyle?: TableHeaderStyle;
|
|
101
|
-
headerBackgroundColor?: string;
|
|
102
|
-
headerTextColor?: string;
|
|
103
|
-
headerWrapText?: boolean;
|
|
104
|
-
stripedRows?: boolean;
|
|
105
|
-
gridLines?: TableGridLines;
|
|
106
103
|
wrapText?: boolean;
|
|
107
104
|
totals?: TableTotalsStylePreferences;
|
|
108
105
|
};
|
|
@@ -115,7 +112,6 @@ export type TablePreferences = {
|
|
|
115
112
|
pageSize?: number;
|
|
116
113
|
enableDevModePagination?: boolean;
|
|
117
114
|
forceClientPagination?: boolean;
|
|
118
|
-
density?: TableDensity;
|
|
119
115
|
tableStyle?: TableStylePreferences;
|
|
120
116
|
/**
|
|
121
117
|
* Viewers may hide, reorder and rename this table's columns for themselves,
|
|
@@ -143,6 +139,14 @@ export type TablePreferences = {
|
|
|
143
139
|
* Unknown ids are ignored on read. Display only: the query never reads it.
|
|
144
140
|
*/
|
|
145
141
|
columnOrder?: TableColumnId[];
|
|
142
|
+
/**
|
|
143
|
+
* The author's pinned columns (table sheets TS-D9): held at the left edge,
|
|
144
|
+
* in the table's column order, while it scrolls sideways. By column id;
|
|
145
|
+
* absent when none. A viewer's own pins replace them. Display only: the
|
|
146
|
+
* query, the column order and downloads never read it. Written only by
|
|
147
|
+
* `writeTableColumnPinned`.
|
|
148
|
+
*/
|
|
149
|
+
pinnedColumns?: TableColumnId[];
|
|
146
150
|
};
|
|
147
151
|
export type PersistedColumnSettings = Omit<Partial<ColumnSettings>, 'numberFormat' | 'dateFormat'> & {
|
|
148
152
|
numberFormat?: Partial<ColumnSettings['numberFormat']>;
|
|
@@ -209,13 +213,12 @@ export interface DataTableProps {
|
|
|
209
213
|
* table settings shape the columns and control the sort.
|
|
210
214
|
*/
|
|
211
215
|
viewerTable?: import('../hooks/use-data-table-logic.js').DataTableViewerContext;
|
|
212
|
-
/**
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
onColumnOrderChange?: (change: TableColumnOrderChange) => void;
|
|
216
|
+
/** An author's Pin or Move from the header menu (table sheets spec M5): the card editor's or a Table sheet's card write. */
|
|
217
|
+
onAuthorColumnHeaderAction?: import('../hooks/use-data-table-logic.js').DataTableLogicProps['onAuthorColumnHeaderAction'];
|
|
218
|
+
/** The author's menu offers Group rows by, Spread across and Remove (a Table sheet's table, TS-D30), with its date fields. */
|
|
219
|
+
authorShapes?: ColumnShapes;
|
|
220
|
+
/** A Table sheet author's "add a column" control at the end of the header row (option C). */
|
|
221
|
+
addColumn?: ReactNode;
|
|
219
222
|
paginationMetadata?: PaginationMetadata;
|
|
220
223
|
onPaginationChange?: (pageIndex: number, pageSize: number) => void;
|
|
221
224
|
isLoading?: boolean;
|
|
@@ -231,9 +234,16 @@ export interface DataTableProps {
|
|
|
231
234
|
seeRecordsOffer?: SeeRecordsOfferFor;
|
|
232
235
|
}
|
|
233
236
|
export interface DataTableColumnSettingsProps {
|
|
237
|
+
/**
|
|
238
|
+
* Whether the column takes Display as (Text, Monospace, Status, Link): false for a
|
|
239
|
+
* measure, by the shared rule an agent's change applies (`columnTakesDisplay`).
|
|
240
|
+
*/
|
|
241
|
+
takesDisplay?: boolean;
|
|
234
242
|
column: Column<any, unknown> | null;
|
|
235
243
|
settings: ColumnSettings;
|
|
236
244
|
onSettingsChange: (settings: ColumnSettings) => void;
|
|
245
|
+
/** The column's values in the loaded rows, for Status colours per value. */
|
|
246
|
+
columnValues?: string[];
|
|
237
247
|
baseStyle?: TableBaseStyle;
|
|
238
248
|
onBaseStyleChange?: (style: TableBaseStyle) => void;
|
|
239
249
|
onApply?: () => void;
|
package/dist/types/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as t,z as r,C as l,E as o,V as i,j as n,c as d,g as m,f as u,b as c,e as E,d as C,a as T,y as p,x as D,o as A,h as I,q as _,w as F,v as S,m as b,n as L,l as f,p as N,k as y,s as R,u as h,i as g,r as x,t as M}from"../chunks/bookmark-state-
|
|
1
|
+
import{B as t,z as r,C as l,E as o,V as i,j as n,c as d,g as m,f as u,b as c,e as E,d as C,a as T,y as p,x as D,o as A,h as I,q as _,w as F,v as S,m as b,n as L,l as f,p as N,k as y,s as R,u as h,i as g,r as x,t as M}from"../chunks/bookmark-state-DScd31KT.js";import{C as V,D as w,L as z,d as U,g as k,e as B,h as K,f as v,c as Y,a as q,i as G,b as P,n as Q,s as W}from"../chunks/validators-Dg2kyF4_.js";import{D as J}from"../chunks/token-types-1vzMWjI-.js";import{r as H,a as Z}from"../chunks/pivot-result-identity-B0eWVMXg.js";import{D as ee}from"../chunks/report-runtime-context-Cd1b5pku.js";const e=["concatenate","conditional-category","date-part","date-difference","null-to-zero","safe-ratio","nested-conditional","membership-test","uppercase","lowercase","trim-whitespace","replace-text","first-characters","character-count","starts-with","number-to-text","start-of-month","start-of-quarter","start-of-year","year-number","add-days","round-number","round-down","round-up","absolute-value","cap-maximum","floor-minimum","fill-blanks","null-if-zero","is-blank"];export{t as BOOKMARK_STATE_VERSION,r as BOOKMARK_VISIBILITIES,V as CALCULATED_FIELD_ENTITY_MARKER,e as CALCULATED_FIELD_TEMPLATE_IDS,l as CONTROL_CARD_DEFAULT_VALUE,w as DATE_FORMAT_VALUES,ee as DEFAULT_CALENDAR_CONTEXT,J as DEFAULT_SEMANTIC_DOMAIN_ACCESS,o as EMPTY_SELECTION,z as LEGACY_CALCULATED_FIELD_ENTITY_MARKER,i as VIEWER_LIMITS,n as VIEWER_TABLE_SETTINGS_VERSION,d as collectDatasetNamesFromExplorerField,m as collectDatasetNamesFromFilterGroup,u as collectExecutionDatasetNamesFromExplorerField,c as collectPreferredDatasetNamesFromExplorerField,E as collectQualifiedDatasetNamesFromExplorerField,C as datasetRefFromSource,T as dependencyDisplayIdentity,U as getCalculatedFieldComputeStage,p as getCustomizableTableCardIds,k as getFieldRuntimeColumnName,D as getSortableTableCardIds,B as hasCalculatedFieldMarker,K as hasCalculatedFormulaInputs,A as hasColumnCustomization,v as hasSyntheticCalculatedFieldOwner,I as humanizeDatasetName,Y as inspectCalculatedField,q as isCalculatedDimension,G as isCalculatedMetric,P as isDerivedField,_ as isEmptyViewerTableSettings,F as isTableCardCustomizable,S as isTableCardSortable,b as measureJsonBytes,Q as normalizeCalculatedFieldRepresentation,L as normalizeTableColumnOrder,f as normalizeViewerTableSettings,N as parseBookmarkState,y as parseTableColumnId,R as parseViewerTableSettings,h as parseViewerTableSettingsMap,g as readBookmarkState,x as resolveFieldDatasetDependencies,H as resolveQueryColumnKeyMapEntry,Z as resolveUniqueQueryColumnKeyMapEntry,W as shouldDropInheritedCalculationAggregate,M as toTableColumnId};
|
|
@@ -12,6 +12,9 @@ export declare const APPEARANCE_ALIASES: readonly [{
|
|
|
12
12
|
}, {
|
|
13
13
|
readonly alias: readonly ["components", "card", "borderRadius"];
|
|
14
14
|
readonly canonical: readonly ["tokens", "radius", "card"];
|
|
15
|
+
}, {
|
|
16
|
+
readonly alias: readonly ["components", "table", "container", "borderRadius"];
|
|
17
|
+
readonly canonical: readonly ["tokens", "radius", "table"];
|
|
15
18
|
}, {
|
|
16
19
|
readonly alias: readonly ["components", "card", "shadow"];
|
|
17
20
|
readonly canonical: readonly ["tokens", "shadow", "card"];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AppearanceDensity, AppearanceScheme } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* What the table `density` shorthand stands for (table style SPEC §2.2, TS-D7):
|
|
4
|
+
* row padding and text sizes. Saved brands and tokens minted by customers'
|
|
5
|
+
* servers may still carry it.
|
|
6
|
+
*/
|
|
7
|
+
export declare const TABLE_DENSITY_SHORTHAND: Record<AppearanceDensity, {
|
|
8
|
+
cellPaddingY: number;
|
|
9
|
+
cellFontSize: number;
|
|
10
|
+
headerFontSize: number;
|
|
11
|
+
}>;
|
|
12
|
+
/**
|
|
13
|
+
* One layer's table components with `density` turned into values: each value the
|
|
14
|
+
* same layer doesn't set is filled from the shorthand, and `density` is removed.
|
|
15
|
+
* Runs per layer before layers merge, so a layer's density beats the layers below
|
|
16
|
+
* it and its own explicit values beat its density.
|
|
17
|
+
*/
|
|
18
|
+
export declare function expandTableDensityShorthand(scheme: AppearanceScheme): AppearanceScheme;
|
|
@@ -5,7 +5,9 @@ export type ResolvedAppearanceMode = 'light' | 'dark';
|
|
|
5
5
|
export type AppearanceDensity = 'compact' | 'comfortable' | 'spacious';
|
|
6
6
|
export type AppearanceColorToken = 'background' | 'foreground' | 'muted' | 'mutedForeground' | 'border' | 'input' | 'primary' | 'primaryForeground' | 'accent' | 'accentForeground'
|
|
7
7
|
/** What a viewer selected to filter by: table rows, matrix cells. */
|
|
8
|
-
| 'selection' | 'card' | 'cardForeground' | 'positive' | 'negative' | 'warning' | 'info' | 'destructive' | 'destructiveForeground'
|
|
8
|
+
| 'selection' | 'card' | 'cardForeground' | 'positive' | 'negative' | 'warning' | 'info' | 'destructive' | 'destructiveForeground'
|
|
9
|
+
/** Link text in table cells (table style TS-D18). */
|
|
10
|
+
| 'link';
|
|
9
11
|
export type AppearanceColorTokens = Partial<Record<AppearanceColorToken, string>>;
|
|
10
12
|
export type AppearanceTokens = {
|
|
11
13
|
color?: AppearanceColorTokens;
|
|
@@ -60,8 +62,24 @@ export type ChartAppearance = {
|
|
|
60
62
|
gridColor?: string;
|
|
61
63
|
axisColor?: string;
|
|
62
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* Which lines a table draws (table style SPEC §1.1): `full` frame, row and column
|
|
67
|
+
* lines; `horizontal` frame and row lines (the default); `vertical` frame and column
|
|
68
|
+
* lines; `inner` row and column lines without a frame; `outer` the frame only; `none`.
|
|
69
|
+
*/
|
|
70
|
+
export type TableBorders = 'full' | 'outer' | 'inner' | 'horizontal' | 'vertical' | 'none';
|
|
71
|
+
export type TableTotalsBorderTop = 'none' | 'solid' | 'dashed' | 'dotted' | 'double';
|
|
72
|
+
/**
|
|
73
|
+
* A table's look in the theme (table style SPEC §1.1). Every table surface reads it
|
|
74
|
+
* through `resolveTableStyle`; nothing on a card or a Document section overrides it.
|
|
75
|
+
*/
|
|
63
76
|
export type TableAppearance = {
|
|
77
|
+
/**
|
|
78
|
+
* Shorthand kept for saved brands and tokens (TS-D7): expanded into cell and header
|
|
79
|
+
* values per layer before layers merge, so no renderer reads it.
|
|
80
|
+
*/
|
|
64
81
|
density?: AppearanceDensity;
|
|
82
|
+
borders?: TableBorders;
|
|
65
83
|
container?: {
|
|
66
84
|
background?: string;
|
|
67
85
|
borderColor?: string;
|
|
@@ -69,14 +87,22 @@ export type TableAppearance = {
|
|
|
69
87
|
shadow?: string;
|
|
70
88
|
};
|
|
71
89
|
header?: {
|
|
90
|
+
/** `transparent` draws no band. */
|
|
72
91
|
background?: string;
|
|
73
92
|
foreground?: string;
|
|
74
93
|
dividerColor?: string;
|
|
75
94
|
fontWeight?: number;
|
|
95
|
+
/** Also sets 0.08em letter spacing. */
|
|
76
96
|
uppercase?: boolean;
|
|
77
97
|
sticky?: boolean;
|
|
98
|
+
/** 9 to 18 px. */
|
|
99
|
+
fontSize?: number;
|
|
100
|
+
/** 0 to 16 px; the header's side padding is `cell.paddingX`. */
|
|
101
|
+
paddingY?: number;
|
|
102
|
+
wrap?: boolean;
|
|
78
103
|
};
|
|
79
104
|
row?: {
|
|
105
|
+
/** A minimum row height, px. Brand Studio no longer writes it; a saved brand has it. */
|
|
80
106
|
height?: number;
|
|
81
107
|
dividerColor?: string;
|
|
82
108
|
zebra?: boolean;
|
|
@@ -85,8 +111,12 @@ export type TableAppearance = {
|
|
|
85
111
|
selectedBackground?: string;
|
|
86
112
|
};
|
|
87
113
|
cell?: {
|
|
114
|
+
/** 0 to 24 px; falls back to `tokens.spacing.tableCellX`. */
|
|
88
115
|
paddingX?: number;
|
|
116
|
+
/** 0 to 16 px; falls back to `tokens.spacing.tableCellY`. */
|
|
89
117
|
paddingY?: number;
|
|
118
|
+
/** 9 to 18 px. */
|
|
119
|
+
fontSize?: number;
|
|
90
120
|
verticalAlign?: 'top' | 'middle' | 'bottom';
|
|
91
121
|
wrap?: 'wrap' | 'nowrap';
|
|
92
122
|
};
|
|
@@ -95,11 +125,13 @@ export type TableAppearance = {
|
|
|
95
125
|
foreground?: string;
|
|
96
126
|
fontWeight?: number;
|
|
97
127
|
};
|
|
128
|
+
/** The table's totals row and Matrix's grand total. */
|
|
98
129
|
grandTotal?: {
|
|
99
130
|
background?: string;
|
|
100
131
|
foreground?: string;
|
|
101
132
|
fontWeight?: number;
|
|
102
133
|
borderColor?: string;
|
|
134
|
+
borderTop?: TableTotalsBorderTop;
|
|
103
135
|
};
|
|
104
136
|
pagination?: {
|
|
105
137
|
background?: string;
|
|
@@ -107,6 +139,11 @@ export type TableAppearance = {
|
|
|
107
139
|
borderColor?: string;
|
|
108
140
|
};
|
|
109
141
|
};
|
|
142
|
+
/** Document tables' own look (TS-D3). */
|
|
143
|
+
export type DocumentTableAppearance = TableAppearance & {
|
|
144
|
+
/** On: Document tables use `components.table`, and every other field here is ignored (TS-INV-4). */
|
|
145
|
+
sameAsDashboards?: boolean;
|
|
146
|
+
};
|
|
110
147
|
export type AppearanceScheme = {
|
|
111
148
|
tokens?: AppearanceTokens;
|
|
112
149
|
components?: {
|
|
@@ -118,6 +155,7 @@ export type AppearanceScheme = {
|
|
|
118
155
|
pivotTable?: TableAppearance;
|
|
119
156
|
matrixTable?: TableAppearance;
|
|
120
157
|
aggregateTable?: TableAppearance;
|
|
158
|
+
documentTable?: DocumentTableAppearance;
|
|
121
159
|
pagination?: BaseSurfaceAppearance;
|
|
122
160
|
};
|
|
123
161
|
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { TCard } from '../types/common-types.js';
|
|
2
|
+
import { ShapeGrain } from '../../shared/dashboard-authoring/table-sheet-shape.js';
|
|
3
|
+
import { TableColumnEdit, TableView } from './table-view.js';
|
|
4
|
+
/**
|
|
5
|
+
* Pin, Unpin, Move left and Move right in a table column's header menu (table
|
|
6
|
+
* sheets spec M5). Who acts decides where it goes: a viewer's edit goes to
|
|
7
|
+
* their own table settings (`computeTableColumnEdit`), an author's to the
|
|
8
|
+
* card through the one writers (`writeTableColumnPinned`,
|
|
9
|
+
* `writeTableColumnOrder`), so the editor, a Table sheet's panel and the MCP
|
|
10
|
+
* store the same card. Pure.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* A drag that carries a table column's field (its id on the card) onto a
|
|
14
|
+
* Table sheet's Group rows by or Columns across (Rohit, 2026-11-15;
|
|
15
|
+
* TS-P6-I4). A Columns panel row carries it; a header doesn't, since a
|
|
16
|
+
* Table sheet's headers reorder from their menu. The drop runs the same
|
|
17
|
+
* shape move as the header menu.
|
|
18
|
+
*/
|
|
19
|
+
export declare const SHAPE_FIELD_DRAG_TYPE = "application/x-table-shape-field";
|
|
20
|
+
export type ColumnHeaderActor =
|
|
21
|
+
/** A viewer, with the card's customization on (TS-D17). */
|
|
22
|
+
{
|
|
23
|
+
kind: 'viewer';
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The card editor, or a Table sheet's authoring session. `shapes` on a Table
|
|
27
|
+
* sheet's table (TS-D30): Group rows by, Spread across and Remove, with the
|
|
28
|
+
* date fields (by id) that group and spread at a grain; Column settings and,
|
|
29
|
+
* for the number fields (by id), Highlight cells (TS-D35).
|
|
30
|
+
*/
|
|
31
|
+
| {
|
|
32
|
+
kind: 'author';
|
|
33
|
+
shapes?: ColumnShapes;
|
|
34
|
+
} | {
|
|
35
|
+
kind: 'none';
|
|
36
|
+
};
|
|
37
|
+
export type ColumnHeaderAction = {
|
|
38
|
+
type: 'pin';
|
|
39
|
+
} | {
|
|
40
|
+
type: 'unpin';
|
|
41
|
+
} | {
|
|
42
|
+
type: 'step';
|
|
43
|
+
direction: 'left' | 'right';
|
|
44
|
+
} | {
|
|
45
|
+
type: 'hide';
|
|
46
|
+
}
|
|
47
|
+
/** Group rows by this column, a date at a grain (TS-D30, TS-D33); the sheet's session does it. */
|
|
48
|
+
| {
|
|
49
|
+
type: 'group';
|
|
50
|
+
grain?: ShapeGrain;
|
|
51
|
+
}
|
|
52
|
+
/** Spread this column's values across columns (TS-D33); the sheet's session does it. */
|
|
53
|
+
| {
|
|
54
|
+
type: 'spread';
|
|
55
|
+
grain?: ShapeGrain;
|
|
56
|
+
}
|
|
57
|
+
/** Take the column out of the query, not only out of sight (TS-D34); the sheet's session does it. */
|
|
58
|
+
| {
|
|
59
|
+
type: 'remove';
|
|
60
|
+
}
|
|
61
|
+
/** The column's field settings, the card editor's own, under its header (TS-D35). */
|
|
62
|
+
| {
|
|
63
|
+
type: 'settings';
|
|
64
|
+
}
|
|
65
|
+
/** The column's highlight rules, the card editor's conditional formatting for this column (TS-D35). */
|
|
66
|
+
| {
|
|
67
|
+
type: 'highlight';
|
|
68
|
+
};
|
|
69
|
+
/** The grains a date groups or spreads at on a Table sheet: never by day (TS-D33). */
|
|
70
|
+
export type { ShapeGrain };
|
|
71
|
+
/**
|
|
72
|
+
* What a Table sheet author's header menu offers for its columns, from the
|
|
73
|
+
* shape owner: how each column groups and spreads (`shapeFieldGrains`), and
|
|
74
|
+
* which can be highlighted (`shapeNumberFieldIds`).
|
|
75
|
+
*/
|
|
76
|
+
export type ColumnShapes = {
|
|
77
|
+
readonly grains: ReadonlyMap<string, readonly (ShapeGrain | undefined)[]>;
|
|
78
|
+
readonly numberFieldIds?: ReadonlySet<string>;
|
|
79
|
+
};
|
|
80
|
+
type Listed = {
|
|
81
|
+
action: ColumnHeaderAction;
|
|
82
|
+
enabled: boolean;
|
|
83
|
+
};
|
|
84
|
+
/** The actions this column's menu shows, each enabled or not (an edge, an unpinnable column). */
|
|
85
|
+
export declare function listColumnHeaderActions(view: TableView, outputKey: string, actor: ColumnHeaderActor): readonly Listed[];
|
|
86
|
+
/** The card field a Table sheet's Group, Spread or Remove acts on: a dimension's field id, or a measure's id. */
|
|
87
|
+
export declare function shapeFieldId(view: TableView, outputKey: string): string | undefined;
|
|
88
|
+
/** The viewer's edit for the action; undefined when it changes nothing. */
|
|
89
|
+
export declare function columnHeaderEdit(view: TableView, outputKey: string, action: ColumnHeaderAction): TableColumnEdit | undefined;
|
|
90
|
+
/** The author's card after the action: their pins, or their column order over the field order. */
|
|
91
|
+
export declare function applyColumnHeaderAction<T extends Pick<TCard, 'preferences'>>(card: T, view: TableView, outputKey: string, action: ColumnHeaderAction): T;
|
|
92
|
+
/**
|
|
93
|
+
* An author's edit from a Table sheet's Columns panel (TS-D23, TS-D24): the
|
|
94
|
+
* panel the viewer edits their own settings with, writing the author's card
|
|
95
|
+
* instead, through the one writers: order (`writeTableColumnOrder`), hidden
|
|
96
|
+
* for everyone (`writeTableColumnSettings`), the header (`planCardLabels`)
|
|
97
|
+
* and pins (`writeTableColumnPinned`). Sort, width and Reset are a viewer's;
|
|
98
|
+
* the card itself comes back for them.
|
|
99
|
+
*/
|
|
100
|
+
export declare function applyAuthorColumnEdit(card: TCard, view: TableView, edit: TableColumnEdit): TCard;
|