react-semaphor 0.1.603 → 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/activity/index.js +1 -73
- package/dist/analytics-protocol/index.js +1 -1491
- package/dist/appearance/index.js +1 -12
- package/dist/appearance-runtime/index.js +1 -5
- package/dist/assistant-context/index.js +1 -11
- package/dist/assistant-protocol/index.js +1 -152
- package/dist/brand-studio/index.js +3 -1598
- package/dist/briefings/index.js +1 -70
- package/dist/chunks/add-to-dashboard-CEmZUf9o.js +12 -0
- package/dist/chunks/analytics-base-schemas-DMFrDqn_.js +1 -0
- package/dist/chunks/appearance-provider-CfoAVQuG.js +608 -0
- package/dist/chunks/appearance-runtime-provider-Bx8H-moR.js +1 -0
- package/dist/chunks/applied-constraints-CinevlKD.js +1 -0
- package/dist/chunks/assistant-chat-DgUaCE9k.js +51 -0
- package/dist/chunks/attachment-filter-line-C_zHMhGh.js +1 -0
- package/dist/chunks/attribution-BEFSsbNn.js +1 -0
- package/dist/chunks/availability-3AIOf6Z-.js +1 -0
- package/dist/chunks/bookmark-impact-BAtemeyK.js +1 -0
- 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/column-bands-DwxbZ6UI.js +1 -0
- package/dist/chunks/comparison-window-caption-tguyN24S.js +1 -0
- package/dist/chunks/context-CntvtZwC.js +2 -0
- package/dist/chunks/conversation-JMK2kyTK.js +1 -0
- 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/export-file-format-B-wQNHIn.js +4 -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-DViPGDFj.js +1 -0
- package/dist/chunks/index-bkP6SnYu.js +1 -0
- package/dist/chunks/kpi-trend-rule-B87LNzcz.js +1 -0
- package/dist/chunks/layout-grid-CFzqJ7GC.js +6 -0
- 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/normalize-dashboard-for-dirty-check-ILKfqgL3.js +1 -0
- package/dist/chunks/numeric-range-options-C8tr-Bls.js +1 -0
- package/dist/chunks/palette-NvEIuXHN.js +6 -0
- 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-BHQ-ldpW.js +1 -0
- package/dist/chunks/rendered-file-BbvwaU6z.js +1 -0
- package/dist/chunks/report-preferences-dialog-Bseb2Rlg.js +1 -0
- package/dist/chunks/report-runtime-context-Cd1b5pku.js +1 -0
- 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-kYsRugss.js +1 -0
- 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-xaczzWZF.js +2 -0
- package/dist/chunks/token-types-1vzMWjI-.js +1 -0
- package/dist/chunks/validators-Dg2kyF4_.js +1 -0
- package/dist/chunks/variable-draft-B4_xqr4Y.js +1 -0
- package/dist/chunks/visual-choice-DgEFfkE-.js +1 -0
- package/dist/dashboard/index.js +1 -7
- package/dist/dashboard-authoring/index.js +1 -4614
- package/dist/format-utils/index.js +1 -425
- package/dist/index.js +1 -554
- package/dist/layouts/index.js +1 -7
- package/dist/live-channel/index.js +1 -124
- package/dist/pdf-export-policy/index.js +1 -92
- package/dist/pdf-table-layout/index.js +1 -993
- package/dist/report-runtime-context/index.js +1 -9
- package/dist/shared/index.js +1 -6
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -9
- 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 -88
- 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/filter-values/build-card-filter-definition.d.ts +32 -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/query-context/dashboard-filter-mapping-resolution.d.ts +9 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +14 -2
- package/dist/types/lib/stores/explorer-actions.d.ts +7 -10
- package/dist/types/lib/types/common-types.d.ts +1 -2
- package/dist/types/lib/types/semantic-types.d.ts +6 -10
- 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/lib/utils/field-state-calculator.d.ts +7 -19
- 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/calculations/definition.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-base.d.ts +125 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-field-folders.d.ts +55 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-joins.d.ts +114 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-prune.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-catalog.d.ts +60 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-folders.d.ts +180 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/join-reach.d.ts +42 -0
- package/dist/types/shared/dashboard-authoring/card-field-places.d.ts +28 -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 +116 -0
- package/dist/types/shared/dashboard-authoring/field-folders/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-decision.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +7 -1
- 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/outline/outline-filters.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +7 -22
- 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 -285
- package/dist/value-format-preferences/index.js +1 -635
- package/package.json +5 -2
- package/dist/chunks/add-to-dashboard-CFF-wFU-.js +0 -291
- package/dist/chunks/analytics-base-schemas-DsUh5Q3C.js +0 -680
- package/dist/chunks/appearance-context-BwBp25ZG.js +0 -162
- package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +0 -80
- package/dist/chunks/applied-constraints-DU-wndZ7.js +0 -47
- package/dist/chunks/assistant-chat-B6hNQI1t.js +0 -6115
- package/dist/chunks/attribution-BvoKvhcj.js +0 -32
- package/dist/chunks/availability-Bp5Gfu1I.js +0 -44
- package/dist/chunks/bookmark-impact-Ba2PLcGp.js +0 -76
- package/dist/chunks/bookmark-state-n7AaNzR_.js +0 -1667
- package/dist/chunks/brand-BoUV0iHF.js +0 -54
- package/dist/chunks/card-filter-builder-Y22HizVx.js +0 -4069
- package/dist/chunks/column-bands-RdM-kjDe.js +0 -47
- package/dist/chunks/comparison-window-caption-Ck2TIbnR.js +0 -741
- package/dist/chunks/context-UCQ7sere.js +0 -369
- package/dist/chunks/conversation-sQiWYUOb.js +0 -16
- package/dist/chunks/dashboard-BghI99oY.js +0 -14
- package/dist/chunks/dashboard-briefing-launcher-DtBAnGiH.js +0 -4875
- package/dist/chunks/dashboard-controls-CtFXlyjV.js +0 -2290
- package/dist/chunks/dashboard-json-DfGBUtCd.js +0 -66
- package/dist/chunks/dates-BnrXF4bb.js +0 -185
- package/dist/chunks/edit-9df1zOWe.js +0 -226
- package/dist/chunks/edit-dashboard-visual-oxt3x1wb.js +0 -18397
- package/dist/chunks/export-file-format-C-tJsxsf.js +0 -111
- package/dist/chunks/filter-line-Cy5YYqRL.js +0 -703
- package/dist/chunks/filter-reach-copy-CE_ZX147.js +0 -5111
- package/dist/chunks/filter-value-text-fWvSDwkl.js +0 -153
- package/dist/chunks/index-BVKzKl5d.js +0 -90
- package/dist/chunks/index-CV_Kzou0.js +0 -595
- package/dist/chunks/index-D5rxbtS4.js +0 -2795
- package/dist/chunks/layout-grid-9LndRoLa.js +0 -16
- package/dist/chunks/matrix-analytical-definition-CCp48UCw.js +0 -1233
- package/dist/chunks/matrix-member-presentation-zNehruXR.js +0 -391
- package/dist/chunks/matrix-operation-contract-DPBj69D8.js +0 -1413
- package/dist/chunks/metric-comparison-B0FR-Q8I.js +0 -600
- package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +0 -119
- package/dist/chunks/paintbrush-58FQYY-y.js +0 -27
- package/dist/chunks/palette-Be62Tkoa.js +0 -23
- package/dist/chunks/pickers-DkqmtnTL.js +0 -2403
- package/dist/chunks/pivot-result-contract-expectations-BYqAmG9n.js +0 -5092
- package/dist/chunks/pivot-result-identity-CAP4--iq.js +0 -77
- package/dist/chunks/raw-temporal-value-Dg_MTFF7.js +0 -3778
- package/dist/chunks/rendered-file-D8xEuVVx.js +0 -108
- package/dist/chunks/report-preferences-dialog-uJp9GBTM.js +0 -1651
- package/dist/chunks/report-runtime-context-c77_KF9v.js +0 -388
- package/dist/chunks/resolve-dashboard-input-context-Rtl1ffmE.js +0 -25324
- package/dist/chunks/resolver-DG_tfEpt.js +0 -156
- package/dist/chunks/save-C5A0JnEV.js +0 -21
- package/dist/chunks/saved-dashboard-context-tcyTU8jm.js +0 -618
- package/dist/chunks/schema-C9NPiIru.js +0 -2568
- package/dist/chunks/selection-filter-compiler-DNijjI5y.js +0 -150
- package/dist/chunks/semaphor-ready-indicator-FBvunj6S.js +0 -145603
- package/dist/chunks/shelf-drop-preview-context-QKStrcK9.js +0 -2466
- package/dist/chunks/stored-dashboard-CHozcAY9.js +0 -4075
- package/dist/chunks/style-sheet-parts-CDCG-8Ej.js +0 -8681
- package/dist/chunks/table-export-sheet-ZFIvs6Sj.js +0 -949
- package/dist/chunks/token-types-XbM6QByy.js +0 -8
- package/dist/chunks/upload-H15d7uHK.js +0 -15
- package/dist/chunks/validators-Baf3VIf5.js +0 -3686
- package/dist/chunks/variable-draft-C2y8Jp6Z.js +0 -242
- package/dist/chunks/visual-choice-DDfHfHvY.js +0 -172
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NormalizedFilterDashboardInput, TCard } from '../../lib/types/common-types.js';
|
|
2
|
+
import { TFilter } from '../../components/surfboard/filter/types.js';
|
|
3
|
+
import { DashboardFilterCardReachDetail, DashboardRelationshipReachResolver } from '../../lib/query-context/dashboard-filter-mapping-resolution.js';
|
|
4
|
+
/** A filter definition as a dashboard filter reaching every card, the input the decision reads. */
|
|
5
|
+
export declare function filterReachInput(filter: TFilter): NormalizedFilterDashboardInput;
|
|
6
|
+
/** How the filter reaches the card, and whether a reader counts it as reached. */
|
|
7
|
+
export declare function filterReachOnCard(input: NormalizedFilterDashboardInput, card: TCard, options?: {
|
|
8
|
+
relationshipReach?: DashboardRelationshipReachResolver;
|
|
9
|
+
}): DashboardFilterCardReachDetail & {
|
|
10
|
+
reached: boolean;
|
|
11
|
+
};
|
|
@@ -6,6 +6,7 @@ export * from './temporal-bucket-authoring.js';
|
|
|
6
6
|
export * from './canonical-result-keys.js';
|
|
7
7
|
export * from './dashboard-card-source-index.js';
|
|
8
8
|
export * from './document-section-cards.js';
|
|
9
|
+
export * from './sheet-kinds.js';
|
|
9
10
|
export * from './legacy-table-routing.js';
|
|
10
11
|
export * from './semantic-card-domain.js';
|
|
11
12
|
export * from './dashboard-filter-mapping-types.js';
|
|
@@ -67,6 +68,11 @@ export * from './kpi-figure.js';
|
|
|
67
68
|
export * from './kpi-trend-rule.js';
|
|
68
69
|
export * from './kpi-date-context.js';
|
|
69
70
|
export * from './see-records/index.js';
|
|
71
|
+
export * from './card-data-source/index.js';
|
|
72
|
+
export { filterReachInput, filterReachOnCard } from './filter-reach-decision.js';
|
|
73
|
+
export { buildCardFilterDefinition } from '../../lib/filter-values/build-card-filter-definition.js';
|
|
74
|
+
export * from './field-folders/index.js';
|
|
75
|
+
export * from './card-field-places.js';
|
|
70
76
|
export * from './card-settings/index.js';
|
|
71
77
|
export * from './measure-calculations/index.js';
|
|
72
78
|
export { bookmarkImpactSentence, describeBookmarkImpact, type BookmarkImpactItem, } from '../dashboard-viewer/bookmark-impact.js';
|
|
@@ -74,7 +80,7 @@ export { prepareLoadedDashboard } from '../../lib/dashboard-inputs/prepare-loade
|
|
|
74
80
|
export { buildFilterInputFromField, buildFilterInputFromDefinition, applyFilterSettingsChange } from '../../lib/dashboard-inputs/filter-settings.js';
|
|
75
81
|
export { relationshipRouteTarget } from '../../lib/dashboard-inputs/dashboard-filter-value-identity.js';
|
|
76
82
|
export type { FilterSettingsChange, FilterValueEffect } from '../../lib/dashboard-inputs/filter-settings.js';
|
|
77
|
-
export { describeDashboardFilterCardReach, describeDashboardFilterCardReachDetail, type DashboardFilterCardReach, type DashboardFilterCardReachDetail, type DashboardRelationshipReachResolver, } from '../../lib/query-context/dashboard-filter-mapping-resolution.js';
|
|
83
|
+
export { describeDashboardFilterCardReach, describeDashboardFilterCardReachDetail, isFilterCardReached, type DashboardFilterCardReached, type DashboardFilterCardReach, type DashboardFilterCardReachDetail, type DashboardRelationshipReachResolver, } from '../../lib/query-context/dashboard-filter-mapping-resolution.js';
|
|
78
84
|
export { changeCardType, sharedCardPreferences, type CardTypeChange, type CardTypeChangeOptions, } from '../../lib/utils/card-type-change.js';
|
|
79
85
|
export { buildSavedEditorCard } from '../../lib/utils/build-saved-editor-card.js';
|
|
80
86
|
export { getCardDefinition, type AuthoredCardFields } from '../../lib/utils/card-definition.js';
|
|
@@ -47,6 +47,8 @@ export declare function requireCard(dashboard: TDashboard, cardId: string): Fram
|
|
|
47
47
|
export declare function addCard(dashboard: TDashboard, operation: Extract<DashboardOperation, {
|
|
48
48
|
op: 'card.add';
|
|
49
49
|
}>): OperationOutcome;
|
|
50
|
+
/** What an added card shows: a query card's query, a text card's first words (building a report SPEC §4.2). */
|
|
51
|
+
export declare function describeAdded(card: TCard, dashboard: TDashboard): string | undefined;
|
|
50
52
|
/**
|
|
51
53
|
* The sheet after a layout change: the layout engine's frames, and its layouts
|
|
52
54
|
* and customized breakpoints when they changed (responsive layouts SPEC §3.1,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SheetShapeIssueCode } from '../sheet-kinds.js';
|
|
1
2
|
import { DataVariable, EmbeddedFilterDashboardInput, TDashboard, TFrame, TInlineFilter, TextCardRichContent } from '../../../lib/types/common-types.js';
|
|
2
3
|
import { CalculatedFieldOperation } from './calculated-field-operations.js';
|
|
3
4
|
import { DocumentEdit } from '../../../lib/document/document-edits.js';
|
|
@@ -163,8 +164,10 @@ export type DashboardOperation = ({
|
|
|
163
164
|
sheet: {
|
|
164
165
|
id: string;
|
|
165
166
|
title: string;
|
|
166
|
-
kind?: 'document';
|
|
167
|
+
kind?: 'document' | 'table';
|
|
167
168
|
};
|
|
169
|
+
/** A Table sheet's one frame with its card, ids included (table sheets TS-D12); refused without it, and for any other kind. */
|
|
170
|
+
frame?: TFrame;
|
|
168
171
|
} | {
|
|
169
172
|
op: 'sheet.update';
|
|
170
173
|
sheetId: string;
|
|
@@ -274,7 +277,9 @@ export type OperationFailureCode = 'sheet_not_found'
|
|
|
274
277
|
/** A sheet with that id is already on the dashboard (building a report SPEC §4.2). */
|
|
275
278
|
| 'sheet_id_taken'
|
|
276
279
|
/** A document sheet places cards through its document, not its grid. */
|
|
277
|
-
| 'sheet_not_a_grid'
|
|
280
|
+
| 'sheet_not_a_grid'
|
|
281
|
+
/** A Table sheet would break its one-card shape (table sheets SH-1..SH-4, `checkSheetShapes`). */
|
|
282
|
+
| SheetShapeIssueCode | 'frame_id_taken' | 'frame_not_found' | 'card_not_found' | 'filter_not_found' | 'filter_id_taken'
|
|
278
283
|
/** The filter settings or mapping fail the input contract; `details.issues` has the core's issues. */
|
|
279
284
|
| 'filter_invalid'
|
|
280
285
|
/** A requery part compiled for another type than the card's. */
|
|
@@ -142,8 +142,12 @@ export type OutlineVariable = {
|
|
|
142
142
|
export type OutlineSheet = {
|
|
143
143
|
sheetId: string;
|
|
144
144
|
title: string;
|
|
145
|
-
/**
|
|
146
|
-
|
|
145
|
+
/**
|
|
146
|
+
* Cards can be added only to "dashboard" sheets. A "table" sheet holds one
|
|
147
|
+
* table, detail table or Matrix that fills the tab (table sheets TS-D14): its
|
|
148
|
+
* card is changed with card.update; it takes no other card and has no layout.
|
|
149
|
+
*/
|
|
150
|
+
kind: 'dashboard' | 'document' | 'table';
|
|
147
151
|
/** On a Document sheet, its sections' cards (never editable). */
|
|
148
152
|
cards: OutlineCard[];
|
|
149
153
|
/** Document sheets only: the header and footer lines by role, and the text sections, each as runs (DV-D13). */
|
|
@@ -150,6 +150,8 @@ export type OutlinePinnedFilter = {
|
|
|
150
150
|
filterId: string;
|
|
151
151
|
label: string;
|
|
152
152
|
field: string;
|
|
153
|
+
/** The field's dataset: the card's own, one it joins, or a related one (dashboard filter fields DF-D8). */
|
|
154
|
+
datasetName?: string;
|
|
153
155
|
} & ReturnType<typeof readLoadedFilterDefault>;
|
|
154
156
|
export declare function outlinePinnedFilters(card: TCard, calendar?: CalendarContext): OutlinePinnedFilter[];
|
|
155
157
|
/** Every filter on the dashboard, in the filter model's order. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OperationTemporalState } from '../../analytics-protocol/operation-temporal-state.js';
|
|
2
2
|
import { RawTemporalValueMetadata, SemaphorResultColumn } from '../../analytics-protocol/contracts.js';
|
|
3
3
|
import { SeeRecordsColumnRef } from './request.js';
|
|
4
|
+
import { FieldFolder } from '../field-folders/index.js';
|
|
4
5
|
/** One line per record of the grain dataset, or one line per value of a group column. */
|
|
5
6
|
export type SeeRecordsShape = 'rows' | 'groups';
|
|
6
7
|
/**
|
|
@@ -28,28 +29,12 @@ export type SeeRecordsColumn = {
|
|
|
28
29
|
*/
|
|
29
30
|
rawTemporal?: RawTemporalValueMetadata;
|
|
30
31
|
};
|
|
31
|
-
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
path: readonly string[];
|
|
38
|
-
columns: readonly {
|
|
39
|
-
field: string;
|
|
40
|
-
label: string;
|
|
41
|
-
}[];
|
|
42
|
-
/**
|
|
43
|
-
* The folder this one opens from (see-records related columns P2-14): the
|
|
44
|
-
* dataset one step nearer the line on its route, and, when that step joins
|
|
45
|
-
* on one field the parent offers, that field, so the picker nests the
|
|
46
|
-
* folder under it. Absent on the line's own folder.
|
|
47
|
-
*/
|
|
48
|
-
parent?: {
|
|
49
|
-
dataset: string;
|
|
50
|
-
field?: string;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
32
|
+
/**
|
|
33
|
+
* One folder of More columns: a dataset and the fields a list can add from it,
|
|
34
|
+
* nested at the key that reaches it. The shared field folder (one base per
|
|
35
|
+
* card OB-D20), the same the card editor's field list draws.
|
|
36
|
+
*/
|
|
37
|
+
export type SeeRecordsColumnFolder = FieldFolder;
|
|
53
38
|
export type SeeRecordsResult = {
|
|
54
39
|
shape: SeeRecordsShape;
|
|
55
40
|
/** The listed measure's label, then the click's label when it has one. */
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { TCard, TDashboard, TFrame, TSheet } from '../../lib/types/common-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The sheet kinds (table sheets TS-D4, spec 3.1 and 3.2): a grid sheet holds
|
|
4
|
+
* cards on a layout grid, a Document holds sections, and a Table sheet holds
|
|
5
|
+
* one table-family card that fills the tab. A sheet with no kind is a grid
|
|
6
|
+
* sheet. "Is it a grid?" is `isGridSheet`; the Dashboard Inputs scope, which
|
|
7
|
+
* knows only dashboard and document sheets, reads a sheet through
|
|
8
|
+
* `inputScopeKindOf`.
|
|
9
|
+
*/
|
|
10
|
+
export type SheetKind = 'dashboard' | 'document' | 'table';
|
|
11
|
+
export declare const TABLE_SHEET_CARD_TYPES: readonly ["table", "detailTable", "matrixTable"];
|
|
12
|
+
export type TableSheetCardType = (typeof TABLE_SHEET_CARD_TYPES)[number];
|
|
13
|
+
type KindOf = Pick<TSheet, 'kind'> | null | undefined;
|
|
14
|
+
export declare function sheetKindOf(sheet: KindOf): SheetKind;
|
|
15
|
+
export declare function isTableSheet(sheet: KindOf): boolean;
|
|
16
|
+
/** True only for dashboard sheets: the sheets that hold a layout grid and take cards. */
|
|
17
|
+
export declare function isGridSheet(sheet: KindOf): boolean;
|
|
18
|
+
/** The two-value kind Dashboard Inputs scope uses: a Table sheet is in scope as a dashboard sheet (TS-D2). */
|
|
19
|
+
export declare function inputScopeKindOf(sheet: KindOf): 'dashboard' | 'document';
|
|
20
|
+
export declare function isTableSheetCardType(type: string | undefined): type is TableSheetCardType;
|
|
21
|
+
/** The sheet card and its frame; undefined when the sheet is not a Table sheet or has no single card. */
|
|
22
|
+
export declare function tableSheetCard(sheet: TSheet): {
|
|
23
|
+
frame: TFrame;
|
|
24
|
+
card: TCard;
|
|
25
|
+
} | undefined;
|
|
26
|
+
export type SheetShapeIssueCode = 'table_sheet_no_card' | 'table_sheet_extra_card' | 'table_sheet_card_type' | 'table_sheet_layout';
|
|
27
|
+
export type SheetShapeIssue = {
|
|
28
|
+
code: SheetShapeIssueCode;
|
|
29
|
+
sheetId: string;
|
|
30
|
+
/** One plain sentence naming the sheet by title. */
|
|
31
|
+
message: string;
|
|
32
|
+
fix: string;
|
|
33
|
+
};
|
|
34
|
+
/** SH-1..SH-4 for every Table sheet; [] for a dashboard that has none. */
|
|
35
|
+
export declare function checkSheetShapes(dashboard: Pick<TDashboard, 'sheets'>): SheetShapeIssue[];
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { TCard } from '../../lib/types/common-types.js';
|
|
2
|
+
import { Field, GroupByField, PivotByField, AggregateFunction } from '../../lib/types/explorer-types.js';
|
|
3
|
+
import { FieldAvailabilityContext } from '../../lib/utils/field-availability-context.js';
|
|
4
|
+
/**
|
|
5
|
+
* A Table sheet's table as a shape (table sheets TS-D30): every row, one row
|
|
6
|
+
* per group (Flat) or levels that open and close (Collapsible). The author
|
|
7
|
+
* never picks a card type; grouping does it. Every move goes through here and
|
|
8
|
+
* the existing type change, so the sheet, the card editor and an agent's
|
|
9
|
+
* `card.update` build the same card:
|
|
10
|
+
*
|
|
11
|
+
* - every row is a detail table (`detailColumns`);
|
|
12
|
+
* - Flat is a table (`groupByColumns`, `metricColumns`, `pivotByColumns`);
|
|
13
|
+
* - Collapsible is that table changed to a Matrix by `changeCardType`. Its
|
|
14
|
+
* levels, spread fields and measures are then edited in place by the
|
|
15
|
+
* Matrix editor's own writers, so its measure filters, highlights, sorts
|
|
16
|
+
* and display stay; only Flat and Collapsible cross the type boundary,
|
|
17
|
+
* and what doesn't carry is named (TS-D19).
|
|
18
|
+
* - A summary made from every row always has a measure (a count when
|
|
19
|
+
* nothing is a number); a Collapsible one keeps a level and a measure, as
|
|
20
|
+
* a Matrix needs, and one without both shows Flat.
|
|
21
|
+
*
|
|
22
|
+
* Grouping or spreading a table that shows every row makes it a summary: its
|
|
23
|
+
* number columns become measures at their default aggregate (named by
|
|
24
|
+
* `addedMeasureLabel`, TS-D22) and its other columns leave, named in
|
|
25
|
+
* `leftOut` (TS-D31). Removing the last level and the last spread field
|
|
26
|
+
* returns to every row with the levels' and measures' fields as columns.
|
|
27
|
+
*/
|
|
28
|
+
export type TableSheetDisplay = 'rows' | 'flat' | 'collapsible';
|
|
29
|
+
export type ShapeContext = {
|
|
30
|
+
/** The loaded field catalog: a Matrix is built and read against it. */
|
|
31
|
+
readonly catalog: readonly Field[];
|
|
32
|
+
readonly catalogLoading?: boolean;
|
|
33
|
+
/** Mints new column ids (UUIDs for Matrix fields). */
|
|
34
|
+
readonly createId: () => string;
|
|
35
|
+
/**
|
|
36
|
+
* The editor's field availability (which datasets the card can reach): a
|
|
37
|
+
* field the editor would refuse to place is refused here too (Astra 4).
|
|
38
|
+
*/
|
|
39
|
+
readonly availability?: FieldAvailabilityContext;
|
|
40
|
+
/** The folder a related dataset's field sits in: a new level or spread is named after it (`relatedColumnLabel`). */
|
|
41
|
+
readonly relatedFolderLabel?: (field: Field) => string | undefined;
|
|
42
|
+
};
|
|
43
|
+
export type ShapeChange = {
|
|
44
|
+
readonly status: 'changed';
|
|
45
|
+
readonly card: TCard;
|
|
46
|
+
readonly leftOut: readonly string[];
|
|
47
|
+
/** What the Matrix editor's writers say changed with it (a sort or a measure filter that went). */
|
|
48
|
+
readonly notices?: readonly string[];
|
|
49
|
+
} | {
|
|
50
|
+
readonly status: 'unchanged';
|
|
51
|
+
} | {
|
|
52
|
+
readonly status: 'refused';
|
|
53
|
+
readonly reason: 'sql' | 'catalog_loading' | 'not_a_table' | 'last_measure' | 'matrix' | 'unavailable';
|
|
54
|
+
/** The editor's own words, for `matrix` and `unavailable`. */
|
|
55
|
+
readonly message?: string;
|
|
56
|
+
};
|
|
57
|
+
/** Which shape the card is. */
|
|
58
|
+
export declare function tableSheetDisplay(card: Pick<TCard, 'type'>): TableSheetDisplay | undefined;
|
|
59
|
+
export declare function groupRows(card: TCard, picked: Field, ctx: ShapeContext, grain?: GroupByField['granularity']): ShapeChange;
|
|
60
|
+
/** Spread `field`'s values across columns. From every row, the table becomes a summary shown Flat. */
|
|
61
|
+
export declare function spreadAcross(card: TCard, picked: Field, ctx: ShapeContext, grain?: PivotByField['granularity']): ShapeChange;
|
|
62
|
+
/** A column to remove, by id, or by its field when a Matrix was read back as a table (new ids). */
|
|
63
|
+
export type ColumnRef = Pick<Field, 'id' | 'name' | 'qualifiedEntityName'>;
|
|
64
|
+
/** Stop grouping by a level; the last one (with nothing spread) returns to every row. */
|
|
65
|
+
export declare function ungroupRows(card: TCard, level: ColumnRef, ctx: ShapeContext): ShapeChange;
|
|
66
|
+
/** Stop spreading a field across columns; with no level left, back to every row. */
|
|
67
|
+
export declare function unspreadAcross(card: TCard, across: ColumnRef, ctx: ShapeContext): ShapeChange;
|
|
68
|
+
/**
|
|
69
|
+
* Show a summary Flat (one row per group, paged by row) or Collapsible
|
|
70
|
+
* (levels, paged by level); Collapsible needs a level.
|
|
71
|
+
*/
|
|
72
|
+
export declare function showSummaryAs(card: TCard, display: 'flat' | 'collapsible', ctx: ShapeContext): ShapeChange;
|
|
73
|
+
/** Remove a column, a measure or a level from the query (Remove is not Hide, TS-D34). */
|
|
74
|
+
export declare function removeColumn(card: TCard, ref: ColumnRef, ctx: ShapeContext): ShapeChange;
|
|
75
|
+
/**
|
|
76
|
+
* How a measure adds up on each group, as the card editor's aggregate
|
|
77
|
+
* control writes it (`metricAggregatePatch`, a generated label renamed); on
|
|
78
|
+
* a Collapsible table, the Matrix measure's aggregate in place.
|
|
79
|
+
*/
|
|
80
|
+
export declare function setAggregate(card: TCard, measure: ColumnRef, aggregate: AggregateFunction, ctx: ShapeContext): ShapeChange;
|
|
81
|
+
/** A measure as the sheet lists it: its type decides which aggregates it offers. */
|
|
82
|
+
export type ShapeMeasure = {
|
|
83
|
+
ref: ColumnRef;
|
|
84
|
+
label: string;
|
|
85
|
+
aggregate?: string;
|
|
86
|
+
dataType?: string;
|
|
87
|
+
};
|
|
88
|
+
/** The table's measures as the sheet lists them, whatever card type holds them. */
|
|
89
|
+
export declare function readMeasures(card: TCard): ShapeMeasure[];
|
|
90
|
+
/** A level or a spread field as the sheet lists it: how to name it, and how to remove it. */
|
|
91
|
+
export type ShapeItem = {
|
|
92
|
+
readonly ref: ColumnRef;
|
|
93
|
+
readonly label: string;
|
|
94
|
+
readonly grain?: string;
|
|
95
|
+
readonly dataType?: string;
|
|
96
|
+
};
|
|
97
|
+
/** The table's levels (rows) and spread fields (across), whatever card type holds them. */
|
|
98
|
+
export declare function readShape(card: TCard,
|
|
99
|
+
/** The table's fields: with it, a Collapsible level's ref names its dataset (the Matrix resolver). */
|
|
100
|
+
catalog?: readonly Field[]): {
|
|
101
|
+
display: TableSheetDisplay | undefined;
|
|
102
|
+
levels: ShapeItem[];
|
|
103
|
+
across: ShapeItem[];
|
|
104
|
+
};
|
|
105
|
+
/** A column's field by its id: a column showing every row, a level, a spread field or a measure. */
|
|
106
|
+
export declare function shapeField(card: TCard, id: string | undefined): Field | undefined;
|
|
107
|
+
/** The grains a date groups or spreads at on a Table sheet: never by day (TS-D33). */
|
|
108
|
+
export type ShapeGrain = 'year' | 'quarter';
|
|
109
|
+
export declare const SHAPE_GRAINS: readonly ShapeGrain[];
|
|
110
|
+
/**
|
|
111
|
+
* How a field can group rows or spread across columns, the one rule every
|
|
112
|
+
* surface reads (the lanes, a column's menu, a field's ···): a date at each of
|
|
113
|
+
* `SHAPE_GRAINS`, another field as it is (one `undefined`), a number not at all
|
|
114
|
+
* (numbers are the summary's measures, `/design/table-sheet-grouping`).
|
|
115
|
+
*/
|
|
116
|
+
export declare function shapeGrainsFor(field: Pick<Field, 'dataType'>): readonly (ShapeGrain | undefined)[];
|
|
117
|
+
/** `shapeGrainsFor` for each of the table's columns that isn't a measure, by id. */
|
|
118
|
+
export declare function shapeFieldGrains(card: TCard): ReadonlyMap<string, readonly (ShapeGrain | undefined)[]>;
|
|
119
|
+
/**
|
|
120
|
+
* The ids of the table's fields whose cells can be highlighted (TS-D35): its
|
|
121
|
+
* number columns and measures. A spread table's measures are left out: their
|
|
122
|
+
* cells are pivot columns, which a field rule doesn't reach (a highlight there
|
|
123
|
+
* waits for pivot rules on the sheet).
|
|
124
|
+
*/
|
|
125
|
+
export declare function shapeNumberFieldIds(card: TCard): ReadonlySet<string>;
|
|
126
|
+
/** Where a column's field sits on a Flat or every-row table: its shelf and place, as the editor's field settings address it (TS-D35). */
|
|
127
|
+
export type ShapePlacement = {
|
|
128
|
+
readonly zone: 'detailColumns' | 'groupBy' | 'pivotBy' | 'metrics';
|
|
129
|
+
readonly index: number;
|
|
130
|
+
readonly field: Field;
|
|
131
|
+
};
|
|
132
|
+
export declare function shapePlacement(card: TCard, id: string): ShapePlacement | undefined;
|
|
133
|
+
/** A Collapsible table's level or measure by its id, as its settings card names it (TS-D35). */
|
|
134
|
+
export declare function matrixColumnField(card: TCard, id: string): {
|
|
135
|
+
name: string;
|
|
136
|
+
label?: string;
|
|
137
|
+
dataType?: string;
|
|
138
|
+
} | undefined;
|
|
139
|
+
/** A new Table sheet's table: every row, nothing placed yet (TS-D36). */
|
|
140
|
+
export declare function everyRowCard(card: TCard): TCard;
|
|
@@ -54,3 +54,18 @@ export declare function moveTableColumn(input: {
|
|
|
54
54
|
readonly to: TableColumnPlacement;
|
|
55
55
|
readonly pivoted: boolean;
|
|
56
56
|
}): TableColumnMoveResult;
|
|
57
|
+
/**
|
|
58
|
+
* Move left / Move right (table sheets PIN-4): one visible place in the
|
|
59
|
+
* column's area and pin group, through the one move rule. A column at either
|
|
60
|
+
* end of its group, or of its pivot area, stays (`unchanged`). Pinned columns
|
|
61
|
+
* draw first in the order they hold (TS-D18), so a step among pinned columns
|
|
62
|
+
* reorders them and a step never crosses into the unpinned ones.
|
|
63
|
+
*/
|
|
64
|
+
export declare function stepTableColumn(input: {
|
|
65
|
+
readonly order: readonly TableColumnId[];
|
|
66
|
+
readonly visible: readonly TableColumnId[];
|
|
67
|
+
readonly pinned: readonly TableColumnId[];
|
|
68
|
+
readonly columnId: TableColumnId;
|
|
69
|
+
readonly direction: 'left' | 'right';
|
|
70
|
+
readonly pivoted: boolean;
|
|
71
|
+
}): TableColumnMoveResult;
|
|
@@ -60,6 +60,12 @@ export type ViewerTableSettings = {
|
|
|
60
60
|
readonly sort?: readonly TableSortEntry[];
|
|
61
61
|
/** Column widths in whole pixels, only for columns the viewer resized. Unlisted columns keep the author's width. */
|
|
62
62
|
readonly widths?: Readonly<Record<TableColumnId, number>>;
|
|
63
|
+
/**
|
|
64
|
+
* Columns held at the left edge while the table scrolls sideways (table
|
|
65
|
+
* sheets TS-D9, PIN-1). Absent: the author's pins. `[]`: explicitly none.
|
|
66
|
+
* Display only: never the query, the column order or a download.
|
|
67
|
+
*/
|
|
68
|
+
readonly pinned?: readonly TableColumnId[];
|
|
63
69
|
};
|
|
64
70
|
/**
|
|
65
71
|
* An author's stored column order (`tablePrefs.columnOrder`, table column
|
|
@@ -74,8 +80,8 @@ export declare function normalizeTableColumnOrder(value: unknown): TableColumnId
|
|
|
74
80
|
*/
|
|
75
81
|
export declare function normalizeViewerTableSettings(settings: ViewerTableSettings | undefined): ViewerTableSettings | undefined;
|
|
76
82
|
/**
|
|
77
|
-
* The viewer changed the columns themselves: hidden, reordered, renamed
|
|
78
|
-
* resized. A sort alone is not a customization (PLAN B35, CW-D7): it shows by
|
|
83
|
+
* The viewer changed the columns themselves: hidden, reordered, renamed,
|
|
84
|
+
* resized or pinned (PIN-5). A sort alone is not a customization (PLAN B35, CW-D7): it shows by
|
|
79
85
|
* its arrow. The one predicate for "Your columns" and Reset columns.
|
|
80
86
|
*/
|
|
81
87
|
export declare function hasColumnCustomization(settings: ViewerTableSettings | undefined): boolean;
|
|
@@ -133,7 +133,7 @@ export type ColumnNumberStyle = 'decimal' | 'currency' | 'percent' | 'scientific
|
|
|
133
133
|
/** Duration options on a table column (`numberFormat.style: 'duration'`). */
|
|
134
134
|
export type ColumnDurationFormat = Pick<DurationCanonicalFormat, 'inputUnit' | 'outputStyle' | 'largestUnit' | 'smallestUnit' | 'maxUnits'>;
|
|
135
135
|
export interface ColumnSettings {
|
|
136
|
-
type: 'none' | 'text' | 'number' | 'date' | 'badge' | 'link' | 'progress';
|
|
136
|
+
type: 'none' | 'text' | 'mono' | 'number' | 'date' | 'badge' | 'link' | 'progress';
|
|
137
137
|
textAlign?: 'left' | 'center' | 'right';
|
|
138
138
|
width?: number;
|
|
139
139
|
numberFormat?: {
|