react-semaphor 0.1.514 → 0.1.516
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.cjs +1 -1
- package/dist/analytics-protocol/index.js +226 -225
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +4 -4
- package/dist/briefings/index.cjs +1 -1
- package/dist/briefings/index.js +8 -8
- package/dist/chunks/{calculated-field-identity-BiTGmnST.cjs → calculated-field-identity-5bg9oHTw.cjs} +1 -1
- package/dist/chunks/{calculated-field-identity-DnRd4YIY.js → calculated-field-identity-DzJBs2J8.js} +4 -4
- package/dist/chunks/{card-config-utils-B2cDWQqB.js → card-config-utils-Cxnq2R6z.js} +14 -14
- package/dist/chunks/{card-config-utils-CMO4_zVs.cjs → card-config-utils-z86y6tSq.cjs} +1 -1
- package/dist/chunks/column-bands-CU0byntA.cjs +1 -0
- package/dist/chunks/column-bands-RdM-kjDe.js +47 -0
- package/dist/chunks/{dashboard-briefing-launcher-e3s3MuSs.js → dashboard-briefing-launcher-BCEHJ_eD.js} +15 -12
- package/dist/chunks/{dashboard-briefing-launcher-BzPD50QD.cjs → dashboard-briefing-launcher-CjZ4aE34.cjs} +2 -2
- package/dist/chunks/{dashboard-controls-DAOABnks.js → dashboard-controls-DFfit5KH.js} +12 -12
- package/dist/chunks/{dashboard-controls-DQBfOqmC.cjs → dashboard-controls-f9aJ70Zu.cjs} +1 -1
- package/dist/chunks/{dashboard-date-comparison-definition-D7Bl-YAl.js → dashboard-date-comparison-definition-BqNhECUr.js} +6 -6
- package/dist/chunks/{dashboard-date-comparison-definition-C_w-GO_5.cjs → dashboard-date-comparison-definition-Y6JZwpcr.cjs} +1 -1
- package/dist/chunks/{dashboard-json-S5Eq2GAg.js → dashboard-json-DVtcA02f.js} +7 -7
- package/dist/chunks/{dashboard-json-1jZycd5h.cjs → dashboard-json-deqQC-UR.cjs} +1 -1
- package/dist/chunks/edit-dashboard-visual-DK6lSC_p.cjs +172 -0
- package/dist/chunks/{edit-dashboard-visual-Bkm0ciHG.js → edit-dashboard-visual-lJ6rDH3w.js} +4553 -4542
- package/dist/chunks/{editor-action-buttons-Bvv16QA-.js → editor-action-buttons-Bnxxa439.js} +7 -7
- package/dist/chunks/{editor-action-buttons-B2NCSsDw.cjs → editor-action-buttons-CmDaQbPN.cjs} +1 -1
- package/dist/chunks/{field-aggregations-CzuQKtqx.js → field-aggregations-Dl2A3rbV.js} +461 -358
- package/dist/chunks/field-aggregations-pH_3kymD.cjs +1 -0
- package/dist/chunks/{field-dependencies-DIab72rQ.cjs → field-dependencies-EB485TdB.cjs} +1 -1
- package/dist/chunks/{field-dependencies-DXW4jtvJ.js → field-dependencies-v-lJNzC7.js} +1 -1
- package/dist/chunks/{index-nhUr9xBz.js → index-BVVl2JDK.js} +57955 -54696
- package/dist/chunks/{index-CACdoqu3.js → index-C8w91oj4.js} +61 -51
- package/dist/chunks/index-Cw2ypaFl.cjs +1 -0
- package/dist/chunks/index-DfqMtR9S.cjs +4 -0
- package/dist/chunks/index-UNKSfi7s.cjs +1434 -0
- package/dist/chunks/{index-CnGVjyF8.js → index-ylOpKRDu.js} +877 -849
- package/dist/chunks/{matrix-analytical-definition-Ct5Tu8np.cjs → matrix-analytical-definition-BWd159lN.cjs} +1 -1
- package/dist/chunks/{matrix-analytical-definition-BDAK2aEi.js → matrix-analytical-definition-BimC4XIV.js} +1 -1
- package/dist/chunks/{matrix-card-U4c72doZ.cjs → matrix-card-C2RjEYZ8.cjs} +1 -1
- package/dist/chunks/{matrix-card-DOIeTmjh.js → matrix-card-CIlz0Dnp.js} +2 -2
- package/dist/chunks/{matrix-control-sources-FjxGIbqk.cjs → matrix-control-sources-BvEJF7d3.cjs} +1 -1
- package/dist/chunks/{matrix-control-sources-BxKH2yu2.js → matrix-control-sources-KbZe1gj_.js} +51 -51
- package/dist/chunks/{matrix-definition-CBJW_4ii.cjs → matrix-definition-DanUT11P.cjs} +1 -1
- package/dist/chunks/{matrix-definition-I9rHB9zN.js → matrix-definition-E5gXXSTZ.js} +1 -1
- package/dist/chunks/matrix-formatter-BJTO8ky9.cjs +1 -0
- package/dist/chunks/matrix-formatter-CCXNRt3s.js +341 -0
- package/dist/chunks/{matrix-member-presentation-DO1VSqfh.js → matrix-member-presentation-Bw7-JCrr.js} +64 -64
- package/dist/chunks/matrix-member-presentation-DvXDEo0U.cjs +1 -0
- package/dist/chunks/{matrix-operation-contract-DoiWTUbT.cjs → matrix-operation-contract-0RxoU_M3.cjs} +1 -1
- package/dist/chunks/{matrix-operation-contract-D0HfzwZg.js → matrix-operation-contract-D32U2CSw.js} +19 -19
- package/dist/chunks/{metric-comparison-Dqc7_tnW.js → metric-comparison-BphoJ9bq.js} +1 -1
- package/dist/chunks/{metric-comparison-DBQ3EJTz.cjs → metric-comparison-CUmltzpz.cjs} +1 -1
- package/dist/chunks/pivot-header-presentation-BSZhB1g-.js +661 -0
- package/dist/chunks/pivot-header-presentation-EoUS5ze5.cjs +5 -0
- package/dist/chunks/{pivot-result-identity-8M-bZrw9.js → pivot-result-identity-BzUQiCEV.js} +4 -4
- package/dist/chunks/{pivot-result-identity-uTiylUNr.cjs → pivot-result-identity-gquWljbd.cjs} +1 -1
- package/dist/chunks/pivot-result-lifecycle-gl9cBfB-.cjs +1 -0
- package/dist/chunks/{pivot-result-lifecycle-BeOpjAhg.js → pivot-result-lifecycle-kRhiJkzg.js} +208 -149
- package/dist/chunks/{raw-temporal-DrmCX9Wq.js → raw-temporal-BqOfk-xN.js} +471 -361
- package/dist/chunks/{raw-temporal-contract-CFLGwTiI.js → raw-temporal-contract-BQZIJ1fn.js} +1 -1
- package/dist/chunks/{raw-temporal-contract-DECbTuzA.cjs → raw-temporal-contract-CklMVG_1.cjs} +1 -1
- package/dist/chunks/raw-temporal-eJXecCyJ.cjs +1 -0
- package/dist/chunks/{report-preferences-dialog-B2fzQH1T.js → report-preferences-dialog-CHXPEl7v.js} +6 -6
- package/dist/chunks/{report-preferences-dialog-DcLkVqni.cjs → report-preferences-dialog-Cto0vDwI.cjs} +1 -1
- package/dist/chunks/{report-runtime-context-Cs65Mrxj.js → report-runtime-context-CxIoGyNM.js} +1 -1
- package/dist/chunks/{report-runtime-context-DzvHBPxl.cjs → report-runtime-context-CzSrCBsu.cjs} +1 -1
- package/dist/chunks/{selection-reducer-BIiQXbGM.js → selection-reducer-CvCBQbl2.js} +1 -1
- package/dist/chunks/{selection-reducer-CGKKsaPa.cjs → selection-reducer-Kl22OzIk.cjs} +1 -1
- package/dist/chunks/{semantic-format-BZxJLKvw.js → semantic-format-DwqGYx4V.js} +25 -31
- package/dist/chunks/semantic-format-mVI32OJH.cjs +1 -0
- package/dist/chunks/{source-entity-resolution-D7vnmDwm.js → source-entity-resolution-Bzefiive.js} +7 -7
- package/dist/chunks/{source-entity-resolution-CjbgnwyX.cjs → source-entity-resolution-R46X34SE.cjs} +1 -1
- package/dist/chunks/switch-DNbWXEOP.cjs +134 -0
- package/dist/chunks/{switch-QfKb0Iwe.js → switch-DNv-hVmt.js} +8260 -7659
- package/dist/chunks/{temporal-bucket-B9hMwemw.js → temporal-bucket-DlFuhCnT.js} +6 -6
- package/dist/chunks/{temporal-bucket-contract-IWDgyTMw.js → temporal-bucket-contract-DTLDRzgV.js} +1 -1
- package/dist/chunks/{temporal-bucket-contract-ZctiyXYk.cjs → temporal-bucket-contract-nTv6gvX5.cjs} +1 -1
- package/dist/chunks/{token-types-Dl0hcKBX.js → token-types-BC6RcUY8.js} +1 -1
- package/dist/chunks/{token-types-Ahh5u4iT.cjs → token-types-aWrzwonf.cjs} +1 -1
- package/dist/chunks/{update-policy-COjFudhl.cjs → update-policy-DRDLWe7Y.cjs} +1 -1
- package/dist/chunks/{update-policy-BeQqjupC.js → update-policy-DhAUtiC8.js} +2 -2
- package/dist/chunks/{validators-CkHsAvwB.js → validators-CsdOtZI6.js} +411 -397
- package/dist/chunks/validators-DFeDcdpA.cjs +1 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +233 -227
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +3 -3
- package/dist/data-app-codegen/index.cjs +1 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +1 -1
- package/dist/data-app-codegen-node/index.js +3 -3
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +5 -5
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +2 -2
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +5 -5
- package/dist/format-utils/index.cjs +3 -3
- package/dist/format-utils/index.js +291 -397
- package/dist/index.cjs +1 -1
- package/dist/index.js +15 -15
- package/dist/pdf-table-layout/index.cjs +1 -0
- package/dist/pdf-table-layout/index.js +993 -0
- package/dist/report-runtime-context/index.cjs +1 -1
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/briefings/index.d.ts +1 -1
- package/dist/types/components/document-sheet/document-input-bar.d.ts +1 -3
- package/dist/types/components/document-sheet/document-insert-picker.d.ts +37 -0
- package/dist/types/components/document-sheet/document-kpi-section.d.ts +17 -0
- package/dist/types/components/document-sheet/document-matrix-layout-context.d.ts +10 -0
- package/dist/types/components/document-sheet/document-matrix-section.d.ts +27 -0
- package/dist/types/components/document-sheet/document-measure-layer.d.ts +45 -0
- package/dist/types/components/document-sheet/document-outline.d.ts +7 -1
- package/dist/types/components/document-sheet/document-page-navigation.d.ts +22 -0
- package/dist/types/components/document-sheet/document-page.d.ts +9 -5
- package/dist/types/components/document-sheet/document-panel/document-side-panel.d.ts +36 -0
- package/dist/types/components/document-sheet/document-panel/inputs-panel.d.ts +9 -0
- package/dist/types/components/document-sheet/document-panel/page-panel.d.ts +5 -0
- package/dist/types/components/document-sheet/document-panel/panel-controls.d.ts +14 -0
- package/dist/types/components/document-sheet/document-panel/region-panels.d.ts +11 -0
- package/dist/types/components/document-sheet/document-panel/section-panel.d.ts +25 -0
- package/dist/types/components/document-sheet/document-section-print-boundary.d.ts +9 -0
- package/dist/types/components/document-sheet/document-table-chrome.d.ts +22 -0
- package/dist/types/components/document-sheet/document-table-section.d.ts +3 -7
- package/dist/types/components/document-sheet/document-text-preview-context.d.ts +8 -0
- package/dist/types/components/document-sheet/use-first-fitting-variant.d.ts +18 -0
- package/dist/types/components/editor/editor-main/dashboard-variable-node.d.ts +12 -2
- package/dist/types/components/explorer/chart-configuration/matrix-authoring-controls.d.ts +7 -2
- package/dist/types/components/text-variables/variable-chip-plugin.d.ts +23 -0
- package/dist/types/components/text-variables/variable-chip.d.ts +18 -0
- package/dist/types/components/text-variables/variable-picker.d.ts +27 -0
- package/dist/types/components/visual/aggregated-table/utils/metric-format-resolver.d.ts +3 -3
- package/dist/types/components/visual/data-table/types/data-table.d.ts +4 -1
- package/dist/types/components/visual/pivot-table/utils/pivot-metric-formatting.d.ts +2 -2
- package/dist/types/components/visual/settings/table-presentation-settings.d.ts +27 -1
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +5 -5
- package/dist/types/lib/dashboard-inputs/text-variable-options.d.ts +15 -0
- package/dist/types/lib/document/document-canvas-actions.d.ts +22 -0
- package/dist/types/lib/document/document-edits.d.ts +119 -0
- package/dist/types/lib/document/document-kpi-figure.d.ts +27 -0
- package/dist/types/lib/document/document-kpi-layout.d.ts +29 -0
- package/dist/types/lib/document/document-kpi-section-edits.d.ts +15 -0
- package/dist/types/lib/document/document-matrix-bands.d.ts +66 -0
- package/dist/types/lib/document/document-matrix-print.d.ts +11 -0
- package/dist/types/lib/document/document-pagination.d.ts +56 -3
- package/dist/types/lib/document/document-panel-target.d.ts +19 -0
- package/dist/types/lib/document/document-section-editor.d.ts +8 -7
- package/dist/types/lib/document/document-section-kinds.d.ts +49 -0
- package/dist/types/lib/document/document-section-query-options.d.ts +25 -0
- package/dist/types/lib/document/document-section-render-state.d.ts +26 -0
- package/dist/types/lib/document/document-section-utils.d.ts +11 -4
- package/dist/types/lib/document/document-table-dom.d.ts +4 -6
- package/dist/types/lib/document/document-table-pagination-model.d.ts +0 -5
- package/dist/types/lib/document/document-table-print-model.d.ts +4 -3
- package/dist/types/lib/document/document-table-style.d.ts +15 -4
- package/dist/types/lib/document/document-table-surface.d.ts +15 -0
- package/dist/types/lib/document/document-variables.d.ts +40 -6
- package/dist/types/lib/document/use-document-section-data.d.ts +39 -0
- package/dist/types/lib/document/use-measured-document-table-layout.d.ts +50 -0
- package/dist/types/lib/formatters/kpi-result-values.d.ts +20 -0
- package/dist/types/lib/formatters/metric-formatting.d.ts +3 -3
- package/dist/types/lib/hooks/query-context/use-dashboard-card-execution-snapshot.d.ts +8 -2
- package/dist/types/lib/hooks/use-dashboard-frame-query.d.ts +6 -0
- package/dist/types/lib/hooks/use-dashboard-kpi-actions.d.ts +1 -1
- package/dist/types/lib/hooks/use-document-section-editor.d.ts +2 -2
- package/dist/types/lib/hooks/use-document-section-session.d.ts +36 -0
- package/dist/types/lib/hooks/use-editor-preview.d.ts +17 -0
- package/dist/types/lib/hooks/use-is-editing-card.d.ts +7 -0
- package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +2 -0
- package/dist/types/lib/matrix-table/matrix-card-draft.d.ts +2 -0
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +4 -0
- package/dist/types/lib/matrix-table/matrix-layout-read.d.ts +68 -0
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +8 -1
- package/dist/types/lib/query-context/build-dashboard-frame-base-query-contexts.d.ts +4 -2
- package/dist/types/lib/query-context/card-execution.d.ts +30 -0
- package/dist/types/lib/query-context/document-section-card-query.d.ts +37 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +12 -8
- package/dist/types/lib/stores/editor-store.d.ts +2 -0
- package/dist/types/lib/table-formatting/table-presentation-fields.d.ts +1 -0
- package/dist/types/lib/text-variables/text-variable-types.d.ts +39 -0
- package/dist/types/lib/types/common-types.d.ts +34 -1
- package/dist/types/lib/utils/card-definition.d.ts +2 -0
- package/dist/types/lib/utils/card-utils.d.ts +13 -6
- package/dist/types/lib/utils/date-timezone-utils.d.ts +26 -4
- package/dist/types/pdf-table-layout.d.ts +2 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +45 -0
- package/dist/types/shared/analytics-protocol/matrix-member-presentation.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/document-section-cards.d.ts +56 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +36 -1
- package/dist/types/shared/format-utils/formatters/duration-formatter.d.ts +4 -1
- package/dist/types/shared/format-utils/formatters/index.d.ts +2 -2
- package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +5 -0
- package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +8 -2
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +690 -1
- package/dist/types/shared/format-utils/matrix-print.d.ts +38 -0
- package/dist/types/shared/format-utils/pdf-table-layout/column-bands.d.ts +55 -0
- package/dist/types/shared/format-utils/pdf-table-layout/index.d.ts +6 -0
- package/dist/types/shared/format-utils/pdf-table-layout/page-size.d.ts +7 -0
- package/dist/types/shared/format-utils/pdf-table-layout/table-column-semantics.d.ts +106 -0
- package/dist/types/shared/format-utils/pdf-table-layout/table-column-widths.d.ts +13 -0
- package/dist/types/shared/format-utils/pdf-table-layout/table-page-geometry.d.ts +19 -0
- package/dist/types/shared/format-utils/pdf-table-layout/wide-table-layout.d.ts +46 -0
- package/dist/types/shared/format-utils/presentation-execution.d.ts +17 -2
- package/dist/types/shared/format-utils/table-structure.d.ts +9 -0
- package/dist/types/shared/format-utils/types/format-types.d.ts +16 -1
- package/package.json +6 -1
- package/dist/chunks/edit-dashboard-visual-BwJ2Eljw.cjs +0 -172
- package/dist/chunks/field-aggregations-jSi77h9Z.cjs +0 -1
- package/dist/chunks/index-DhlVxvyI.cjs +0 -4
- package/dist/chunks/index-DrOFJOCq.cjs +0 -1424
- package/dist/chunks/index-F25jnH0p.cjs +0 -1
- package/dist/chunks/matrix-formatter-BLunke3R.js +0 -424
- package/dist/chunks/matrix-formatter-CveLJo6S.cjs +0 -1
- package/dist/chunks/matrix-member-presentation-CFHjdrxT.cjs +0 -1
- package/dist/chunks/pivot-header-presentation-Cxz8-06f.cjs +0 -5
- package/dist/chunks/pivot-header-presentation-Dm9dUQsl.js +0 -415
- package/dist/chunks/pivot-result-lifecycle-BiERyXnS.cjs +0 -1
- package/dist/chunks/raw-temporal-BUeTpG76.cjs +0 -1
- package/dist/chunks/semantic-format-BzH69TRq.cjs +0 -1
- package/dist/chunks/switch--Re1K566.cjs +0 -134
- package/dist/chunks/validators-DVYAnnX0.cjs +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { TChartType } from '../charts/types.js';
|
|
2
|
+
import { DocumentSection, TCard } from '../types/common-types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Author-facing identity of a Document section. It differs from the storage
|
|
5
|
+
* `type`: Table, Pivot and Matrix are all stored as `type: 'table'` and are
|
|
6
|
+
* told apart by `card.type`.
|
|
7
|
+
*/
|
|
8
|
+
export type DocumentSectionKindId = 'text' | 'table' | 'matrix' | 'kpi' | 'spacer' | 'page_break'
|
|
9
|
+
/** Existing sections only. */
|
|
10
|
+
| 'pivot'
|
|
11
|
+
/** Contract-only: not addable, not rendered. */
|
|
12
|
+
| 'chart';
|
|
13
|
+
export type DocumentIdFactory = {
|
|
14
|
+
section(): string;
|
|
15
|
+
card(): string;
|
|
16
|
+
};
|
|
17
|
+
export type DocumentSectionKind = {
|
|
18
|
+
id: DocumentSectionKindId;
|
|
19
|
+
label: string;
|
|
20
|
+
/** Picker copy, one line. */
|
|
21
|
+
description: string;
|
|
22
|
+
group: 'data' | 'content' | 'layout';
|
|
23
|
+
/** Offered when adding a section. */
|
|
24
|
+
addable: boolean;
|
|
25
|
+
/** Card types a section of this kind accepts. Empty for non-data kinds. */
|
|
26
|
+
cardTypes: readonly TChartType[];
|
|
27
|
+
/** A new section with defaults. Data kinds start with a placeholder card and no data source. */
|
|
28
|
+
create(ids: DocumentIdFactory): DocumentSection;
|
|
29
|
+
};
|
|
30
|
+
/** A placeholder KPI card with no data source yet. */
|
|
31
|
+
export declare function createDocumentKpiCard(cardId: string): TCard;
|
|
32
|
+
export declare const DOCUMENT_SECTION_KINDS: Readonly<Record<DocumentSectionKindId, DocumentSectionKind>>;
|
|
33
|
+
/** Author-facing kind of a stored section. */
|
|
34
|
+
export declare function getDocumentSectionKind(section: DocumentSection): DocumentSectionKind;
|
|
35
|
+
/** Whether a section of this kind may hold a card of this type. */
|
|
36
|
+
export declare function documentSectionAcceptsCardType(section: DocumentSection, cardType: TChartType): boolean;
|
|
37
|
+
/** Why a section refuses a card type, or null when it accepts it. */
|
|
38
|
+
export declare function getDocumentSectionCardTypeError(section: DocumentSection, cardType: TChartType): string | null;
|
|
39
|
+
/**
|
|
40
|
+
* The section with `oldCardId` replaced by `card`. Throws when the section
|
|
41
|
+
* does not own `oldCardId`, or its kind does not accept `card.type`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function replaceDocumentSectionCard(section: DocumentSection, oldCardId: string, card: TCard): DocumentSection;
|
|
44
|
+
/** The addable kinds, in registry order, grouped for the insert picker. */
|
|
45
|
+
export declare function getAddableDocumentSectionKindGroups(): {
|
|
46
|
+
kinds: DocumentSectionKind[];
|
|
47
|
+
id: DocumentSectionKind["group"];
|
|
48
|
+
label: string;
|
|
49
|
+
}[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TFilterValue } from '../../components/surfboard/filter/types.js';
|
|
2
|
+
import { DashboardCardQueryOptions } from '../hooks/use-dashboard-frame-query.js';
|
|
3
|
+
import { ControlDefinition, DashboardInputValues } from '../types/common-types.js';
|
|
4
|
+
import { TableTotalsRequest } from '../types/explorer-types.js';
|
|
5
|
+
/** Inputs, filters and controls the Document sheet has already resolved for its sections. */
|
|
6
|
+
export type DocumentSectionRuntime = {
|
|
7
|
+
documentFilterValues: TFilterValue[];
|
|
8
|
+
documentControlDefinitions: ControlDefinition[];
|
|
9
|
+
documentControlValues: Record<string, unknown>;
|
|
10
|
+
documentDashboardInputValues?: DashboardInputValues;
|
|
11
|
+
missingRequiredInputLabels: string[];
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Query options for every card of a Document section, so table and KPI
|
|
15
|
+
* sections run their cards in the same section runtime: section-scoped inputs,
|
|
16
|
+
* document filter and control values, and no carried dashboard context.
|
|
17
|
+
*/
|
|
18
|
+
export declare function buildDocumentSectionQueryOptions({ sectionId, runtime, tableTotalsRequest, }: {
|
|
19
|
+
sectionId: string;
|
|
20
|
+
runtime: Omit<DocumentSectionRuntime, 'missingRequiredInputLabels'>;
|
|
21
|
+
/** Flat-table grand totals; table sections only. */
|
|
22
|
+
tableTotalsRequest?: TableTotalsRequest;
|
|
23
|
+
}): DashboardCardQueryOptions;
|
|
24
|
+
/** The query key marker every Document section query carries. */
|
|
25
|
+
export declare const DOCUMENT_SECTION_QUERY_MARKER = "documentSection";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Print readiness for a Document section. The scheduler's document mode
|
|
3
|
+
* waits while any `data-document-render-loading` marker is present and fails
|
|
4
|
+
* the PDF on `data-document-render-error` or a delivery error code
|
|
5
|
+
* (`semaphor-report-scheduler/pdf-generation/lib/modes/document.js`).
|
|
6
|
+
*
|
|
7
|
+
* - `ready` and `empty` print as they are.
|
|
8
|
+
* - `loading` holds the PDF until the section settles.
|
|
9
|
+
* - `blocked` (required inputs missing, or the section is not configured) and
|
|
10
|
+
* `error` fail the PDF instead of printing an incomplete report.
|
|
11
|
+
*/
|
|
12
|
+
export type DocumentSectionRenderState = 'ready' | 'empty' | 'loading' | 'blocked' | 'error';
|
|
13
|
+
/**
|
|
14
|
+
* One state for a section with several cards: an error or blocked card fails
|
|
15
|
+
* the section, then any loading card holds it, and it is empty only when every
|
|
16
|
+
* card is empty.
|
|
17
|
+
*/
|
|
18
|
+
export declare function summarizeDocumentSectionRenderStates(states: readonly DocumentSectionRenderState[]): DocumentSectionRenderState;
|
|
19
|
+
export type DocumentSectionRenderAttributes = {
|
|
20
|
+
'data-document-render-loading'?: 'true';
|
|
21
|
+
'data-document-render-error'?: 'true';
|
|
22
|
+
'data-semaphor-render-error-code'?: string;
|
|
23
|
+
'data-semaphor-render-error-message'?: string;
|
|
24
|
+
};
|
|
25
|
+
/** The markers for one render state. `error` is the failure, used for delivery error codes. */
|
|
26
|
+
export declare function getDocumentSectionRenderAttributes(state: DocumentSectionRenderState | undefined, error?: unknown): DocumentSectionRenderAttributes;
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { LucideIcon } from 'lucide-react';
|
|
2
|
+
import { DocumentSectionKindId } from './document-section-kinds.js';
|
|
2
3
|
import { DocumentInputDefinition, DocumentSection } from '../types/common-types.js';
|
|
3
4
|
export type DocumentSectionType = DocumentSection['type'];
|
|
4
|
-
|
|
5
|
+
/** Section kinds offered when adding a section (Matrix is stored as a table). */
|
|
6
|
+
export type AddableDocumentSectionType = Exclude<DocumentSectionKindId, 'chart' | 'pivot'>;
|
|
5
7
|
export declare const DOCUMENT_SECTION_LABELS: Record<DocumentSectionType, string>;
|
|
6
|
-
|
|
7
|
-
export declare function documentSectionIcon(type:
|
|
8
|
-
export declare function createDocumentSection(type: AddableDocumentSectionType): DocumentSection;
|
|
8
|
+
/** The icon of a section kind; pass `getDocumentSectionKind(section).id` for a stored section. */
|
|
9
|
+
export declare function documentSectionIcon(type: DocumentSectionKindId): LucideIcon;
|
|
9
10
|
export declare function getDocumentSectionLabel(section: DocumentSection, inputs: DocumentInputDefinition[]): string;
|
|
10
11
|
export declare function getDocumentSectionTitle(section: DocumentSection, inputs: DocumentInputDefinition[]): string;
|
|
11
12
|
export declare function getDocumentSectionSubtitle(section: DocumentSection): string | null;
|
|
13
|
+
/**
|
|
14
|
+
* What a data section reads, for its toolbar label: the dataset of a table
|
|
15
|
+
* section's card, or how many KPIs a KPI section holds. Undefined for other
|
|
16
|
+
* kinds and for a card with no dataset yet (SQL cards name none).
|
|
17
|
+
*/
|
|
18
|
+
export declare function getDocumentSectionDataLabel(section: DocumentSection): string | undefined;
|
|
@@ -10,22 +10,20 @@ export declare function getDocumentTableMeasuredChromeMetrics({ sectionElement,
|
|
|
10
10
|
chromeHeightPx: number;
|
|
11
11
|
trailingChromePx: number;
|
|
12
12
|
};
|
|
13
|
-
export declare function getDocumentPageElement(element: HTMLElement | null): HTMLElement | null;
|
|
14
|
-
export declare function getDocumentPageFooterElement(pageElement: HTMLElement | null): HTMLElement | null;
|
|
15
|
-
export declare function getIntendedDocumentPageBoxHeightPx(pageElement: HTMLElement): number;
|
|
16
|
-
export declare function getDocumentPageBodyBoundaryPx(pageElement: HTMLElement): number;
|
|
17
13
|
export declare function hasMaterialTableLayoutMeasurementChange(previousMeasurement: {
|
|
18
14
|
rowHeightPx: number;
|
|
19
15
|
averageRowHeightPx?: number;
|
|
20
16
|
rowHeightsPx?: Array<number | undefined>;
|
|
21
17
|
chromeHeightPx: number;
|
|
22
18
|
renderedMinHeightPx?: number;
|
|
23
|
-
|
|
19
|
+
columnWidthsPx?: number[];
|
|
20
|
+
matrixFit?: unknown;
|
|
24
21
|
} | null, nextMeasurement: {
|
|
25
22
|
rowHeightPx: number;
|
|
26
23
|
averageRowHeightPx?: number;
|
|
27
24
|
rowHeightsPx?: Array<number | undefined>;
|
|
28
25
|
chromeHeightPx: number;
|
|
29
26
|
renderedMinHeightPx?: number;
|
|
30
|
-
|
|
27
|
+
columnWidthsPx?: number[];
|
|
28
|
+
matrixFit?: unknown;
|
|
31
29
|
}): boolean;
|
|
@@ -55,11 +55,6 @@ export declare function getDocumentTableRowsThatFit({ rowMeasurementState, start
|
|
|
55
55
|
availableHeightPx: number;
|
|
56
56
|
}): number;
|
|
57
57
|
export declare function getDocumentTableEffectiveRowHeightFromState(rowMeasurementState: DocumentTableRowMeasurementState): number;
|
|
58
|
-
export declare function shouldReportDocumentTableLayoutMeasurement(_options: {
|
|
59
|
-
tableSlice?: {
|
|
60
|
-
pageIndex: number;
|
|
61
|
-
} | undefined;
|
|
62
|
-
}): boolean;
|
|
63
58
|
export declare function canUpdateDocumentTableLayoutChrome({ tableSlice, }: {
|
|
64
59
|
tableSlice?: {
|
|
65
60
|
pageIndex: number;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { DOCUMENT_TABLE_PRINT_RENDER_CONTRACT } from './document-visual-render-contract.js';
|
|
2
|
+
import { DocumentMatrixFit } from './document-matrix-bands.js';
|
|
2
3
|
import { DocumentTableSection } from '../types/common-types.js';
|
|
3
4
|
export declare const DOCUMENT_TABLE_DEFAULT_ROW_HEIGHT_PX = 40;
|
|
4
5
|
export declare const DOCUMENT_TABLE_MIN_MEASURED_ROW_HEIGHT_PX = 18;
|
|
5
6
|
export declare const DOCUMENT_TABLE_MIN_RENDERED_SURFACE_HEIGHT_PX = 120;
|
|
6
|
-
export type DocumentTablePrintKind = 'table' | 'pivotTable';
|
|
7
|
+
export type DocumentTablePrintKind = 'table' | 'pivotTable' | 'matrix';
|
|
7
8
|
export type DocumentTableLayoutMeasurement = {
|
|
8
9
|
rowHeightPx: number;
|
|
9
10
|
averageRowHeightPx?: number;
|
|
@@ -14,7 +15,8 @@ export type DocumentTableLayoutMeasurement = {
|
|
|
14
15
|
chromeHeightPx: number;
|
|
15
16
|
renderedMinHeightPx?: number;
|
|
16
17
|
canUpdateLayoutChrome?: boolean;
|
|
17
|
-
|
|
18
|
+
columnWidthsPx?: number[];
|
|
19
|
+
matrixFit?: DocumentMatrixFit;
|
|
18
20
|
};
|
|
19
21
|
export type DocumentTablePrintModel = {
|
|
20
22
|
sectionId: string;
|
|
@@ -34,7 +36,6 @@ export type DocumentTablePrintModel = {
|
|
|
34
36
|
effectiveRowHeightPx: number;
|
|
35
37
|
chromeHeightPx?: number;
|
|
36
38
|
renderedMinHeightPx?: number;
|
|
37
|
-
measuredRowsPerPage?: number;
|
|
38
39
|
renderContract: typeof DOCUMENT_TABLE_PRINT_RENDER_CONTRACT;
|
|
39
40
|
};
|
|
40
41
|
export declare function getDocumentTablePrintModel({ section, totalRowCount, layoutMeasurement, }: {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { TableDensity } from '../../components/visual/data-table/types/data-table.js';
|
|
2
2
|
import { DocumentTableSection } from '../types/common-types.js';
|
|
3
3
|
import { getTableTotalsBorderTopWidthValue, getTableTotalsFontWeightValue, ResolvedTablePresentationStyle } from '../table-formatting/table-presentation-style.js';
|
|
4
|
-
|
|
4
|
+
/** The densities a Document offers: on paper, only a few row heights differ.
|
|
5
|
+
* Stored Spacious and Dense values still print as they are. */
|
|
6
|
+
export declare const DOCUMENT_TABLE_DENSITY_OPTIONS: readonly TableDensity[];
|
|
5
7
|
export declare const DOCUMENT_TABLE_HEADER_STYLE_OPTIONS: readonly ["plain", "filled", "accent"];
|
|
6
8
|
export declare const DOCUMENT_TABLE_GRID_LINE_OPTIONS: readonly ["full", "outer", "inner", "horizontal", "vertical", "top", "right", "bottom", "left", "none"];
|
|
7
9
|
export declare const DOCUMENT_TABLE_DEFAULT_STYLE: {
|
|
@@ -15,14 +17,23 @@ export declare const DOCUMENT_TABLE_DEFAULT_STYLE: {
|
|
|
15
17
|
wrapText: false;
|
|
16
18
|
};
|
|
17
19
|
export declare const DOCUMENT_TABLE_TOTALS_FONT_WEIGHT_OPTIONS: readonly ["normal", "medium", "semibold", "bold"];
|
|
20
|
+
/**
|
|
21
|
+
* A Document table's total prints like a Matrix section's grand total
|
|
22
|
+
* (Plan 2, P1): no tint, semibold, between a firm top rule and a double
|
|
23
|
+
* bottom rule (drawn by the surface). What an author sets still wins, except
|
|
24
|
+
* that the double rule is always the closing one: a double top rule prints
|
|
25
|
+
* single, so the total never sits between two double rules.
|
|
26
|
+
*/
|
|
27
|
+
/** Top-rule styles a Document offers: its closing rule is already double. */
|
|
28
|
+
export declare const DOCUMENT_TABLE_TOTALS_BORDER_STYLE_OPTIONS: readonly ["solid", "dashed", "dotted"];
|
|
18
29
|
export declare const DOCUMENT_TABLE_DEFAULT_TOTALS_STYLE: {
|
|
19
|
-
enabled: false;
|
|
20
30
|
backgroundColor: string;
|
|
31
|
+
fontWeight: "semibold";
|
|
32
|
+
borderTopColor: string;
|
|
33
|
+
enabled: false;
|
|
21
34
|
textColor: string;
|
|
22
|
-
fontWeight: "medium";
|
|
23
35
|
borderTop: true;
|
|
24
36
|
borderTopStyle: "solid";
|
|
25
|
-
borderTopColor: string;
|
|
26
37
|
};
|
|
27
38
|
export type ResolvedDocumentTableStyle = ResolvedTablePresentationStyle;
|
|
28
39
|
export declare function resolveDocumentTableStyle(section: DocumentTableSection): ResolvedDocumentTableStyle;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { ResolvedDocumentTableStyle } from './document-table-style.js';
|
|
3
|
+
/**
|
|
4
|
+
* Light theme tokens for anything drawn on the page. A Document is paper, so
|
|
5
|
+
* its content stays light when the app is in dark mode.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DOCUMENT_TABLE_LIGHT_THEME_STYLE: CSSProperties;
|
|
8
|
+
export declare function getDocumentTableSurfaceClassName(style: ResolvedDocumentTableStyle): string;
|
|
9
|
+
/** The surface's CSS variables: row height, header and totals colors. */
|
|
10
|
+
export declare function getDocumentTableSurfaceStyle({ style, rowHeightPx, isSliced, }: {
|
|
11
|
+
style: ResolvedDocumentTableStyle;
|
|
12
|
+
rowHeightPx: number;
|
|
13
|
+
/** A page slice has no minimum surface height. */
|
|
14
|
+
isSliced: boolean;
|
|
15
|
+
}): CSSProperties;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TFilterValue } from '../../components/surfboard/filter/types.js';
|
|
2
2
|
import { ControlOption, DocumentInputDefinition, DocumentTextInlineFormat, DocumentTextContent, DocumentVariableRef, ResolvedDocumentInput } from '../types/common-types.js';
|
|
3
|
+
import { TextVariableChipFace, TextVariableOption, TextVariableSelection } from '../text-variables/text-variable-types.js';
|
|
3
4
|
export type DocumentTextRenderContext = {
|
|
4
5
|
inputs: DocumentInputDefinition[];
|
|
5
6
|
resolvedInputsById: Record<string, ResolvedDocumentInput>;
|
|
@@ -11,11 +12,6 @@ export type DocumentTextRenderContext = {
|
|
|
11
12
|
timezone?: string;
|
|
12
13
|
generatedAtFormat?: string;
|
|
13
14
|
};
|
|
14
|
-
export type DocumentVariableChoice = {
|
|
15
|
-
label: string;
|
|
16
|
-
token: string;
|
|
17
|
-
ref: DocumentVariableRef;
|
|
18
|
-
};
|
|
19
15
|
export type ParsedDocumentTextContent = {
|
|
20
16
|
content: DocumentTextContent;
|
|
21
17
|
unresolvedTokens: string[];
|
|
@@ -38,12 +34,50 @@ export type RenderedDocumentTextPart = {
|
|
|
38
34
|
type: 'text' | 'variable';
|
|
39
35
|
value: string;
|
|
40
36
|
format?: DocumentTextInlineFormat;
|
|
37
|
+
/** Authoring: how a variable reads as a chip. */
|
|
38
|
+
chip?: TextVariableChipFace;
|
|
41
39
|
};
|
|
42
40
|
export declare function parseDocumentTextContent(value: string, inputs: DocumentInputDefinition[]): ParsedDocumentTextContent;
|
|
43
41
|
export declare function parseDocumentTextContentWithSource(value: string, inputs: DocumentInputDefinition[]): ParsedDocumentTextContentWithSource;
|
|
44
|
-
export declare function getDocumentVariableChoices(inputs: DocumentInputDefinition[]): DocumentVariableChoice[];
|
|
45
42
|
export declare function appendDocumentVariable(content: DocumentTextContent | undefined, ref: DocumentVariableRef): DocumentTextContent;
|
|
46
43
|
export declare function getDocumentVariableLabel(ref: DocumentVariableRef, inputs: DocumentInputDefinition[]): string;
|
|
44
|
+
/** What a reference shows, as the picker names it. */
|
|
45
|
+
export declare function getDocumentVariableSelection(ref: DocumentVariableRef): TextVariableSelection;
|
|
46
|
+
/** The reference a picker selection stands for. */
|
|
47
|
+
export declare function getDocumentVariableRefFromSelection(selection: TextVariableSelection): DocumentVariableRef;
|
|
48
|
+
/** How a reference reads as a chip: the input's name, or Missing input. */
|
|
49
|
+
export declare function getDocumentVariableChipFace(ref: DocumentVariableRef, inputs: DocumentInputDefinition[]): TextVariableChipFace;
|
|
50
|
+
/**
|
|
51
|
+
* The inputs and report values a Document text can show, each part with what
|
|
52
|
+
* it holds now when `context` is given.
|
|
53
|
+
*/
|
|
54
|
+
export declare function getDocumentTextVariableOptions(inputs: DocumentInputDefinition[], context?: DocumentTextRenderContext): TextVariableOption[];
|
|
55
|
+
/**
|
|
56
|
+
* Where a document shows an input: the header, the footer and its text
|
|
57
|
+
* sections, in reading order.
|
|
58
|
+
*/
|
|
59
|
+
export declare function getDocumentInputTextUsage(document: {
|
|
60
|
+
header?: {
|
|
61
|
+
blocks: Array<{
|
|
62
|
+
type: string;
|
|
63
|
+
content?: DocumentTextContent;
|
|
64
|
+
}>;
|
|
65
|
+
};
|
|
66
|
+
footer?: {
|
|
67
|
+
blocks: Array<{
|
|
68
|
+
type: string;
|
|
69
|
+
content?: DocumentTextContent;
|
|
70
|
+
}>;
|
|
71
|
+
};
|
|
72
|
+
sections: Array<{
|
|
73
|
+
type: string;
|
|
74
|
+
content?: DocumentTextContent;
|
|
75
|
+
}>;
|
|
76
|
+
}, inputId: string): {
|
|
77
|
+
header: boolean;
|
|
78
|
+
footer: boolean;
|
|
79
|
+
textSections: number;
|
|
80
|
+
};
|
|
47
81
|
export declare function buildDocumentTextRenderContext({ inputs, filterValuesByInputId, controlValuesByInputId, controlOptionsByInputId, generatedAt, timezone, generatedAtFormat, pageNumber, pageCount, }: {
|
|
48
82
|
inputs: DocumentInputDefinition[];
|
|
49
83
|
filterValuesByInputId: Record<string, TFilterValue | undefined>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DocumentSectionRenderState } from './document-section-render-state.js';
|
|
2
|
+
import { DashboardCardQueryResult } from '../hooks/use-dashboard-frame-query.js';
|
|
3
|
+
import { DocumentKpiSection, TCard } from '../types/common-types.js';
|
|
4
|
+
import { ComparisonMetadataMap } from '../types/query-types.js';
|
|
5
|
+
import { DocumentSectionRuntime } from './document-section-query-options.js';
|
|
6
|
+
export type DocumentCardDataStatus = 'unconfigured'
|
|
7
|
+
/** Waiting for required inputs; the query will not run until they are set. */
|
|
8
|
+
| 'blocked' | 'loading' | 'ready' | 'empty' | 'error';
|
|
9
|
+
export type DocumentCardDataState = {
|
|
10
|
+
cardId: string;
|
|
11
|
+
card: TCard;
|
|
12
|
+
status: DocumentCardDataStatus;
|
|
13
|
+
/** The card query's records, unchanged. Empty unless `ready`. */
|
|
14
|
+
records: Record<string, unknown>[];
|
|
15
|
+
comparisonMetadata?: ComparisonMetadataMap;
|
|
16
|
+
errorMessage?: string;
|
|
17
|
+
/** The query failure, for delivery error attributes. */
|
|
18
|
+
error?: unknown;
|
|
19
|
+
/** `blocked` only: the required inputs to set. */
|
|
20
|
+
missingRequiredInputLabels?: string[];
|
|
21
|
+
};
|
|
22
|
+
/** A card can run once it is set up (the dashboard's own rule: a connection plus SQL or fields). */
|
|
23
|
+
export declare function isDocumentSectionCardRunnable(card: TCard): boolean;
|
|
24
|
+
/** The print readiness a card's data status means. */
|
|
25
|
+
export declare function getDocumentCardRenderState(status: DocumentCardDataStatus): DocumentSectionRenderState;
|
|
26
|
+
/** One card's data state from its query result. Exported for tests. */
|
|
27
|
+
export declare function toDocumentCardDataState(card: TCard, result: Pick<DashboardCardQueryResult, 'data' | 'isPending' | 'isFetching' | 'isError' | 'error' | 'errorMessage' | 'comparisonMetadata' | 'isCurrentQueryResult' | 'missingRequiredInputLabels'>): DocumentCardDataState;
|
|
28
|
+
/**
|
|
29
|
+
* Data for every card of a KPI section, in display order. Each card runs
|
|
30
|
+
* through the dashboard card query in the section's runtime (section-scoped
|
|
31
|
+
* inputs, document filters and controls), so a Document never has its own
|
|
32
|
+
* query path.
|
|
33
|
+
*
|
|
34
|
+
* KPI sections only: table sections acquire their rows through
|
|
35
|
+
* `useDocumentTableRows` (row policy, full-result acquisition for export) and
|
|
36
|
+
* share only the options builder. Reading a table through this hook would
|
|
37
|
+
* print a partial result.
|
|
38
|
+
*/
|
|
39
|
+
export declare function useDocumentSectionData(section: DocumentKpiSection, runtime: Omit<DocumentSectionRuntime, 'missingRequiredInputLabels'>): readonly DocumentCardDataState[];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { DocumentTableSlice } from './document-pagination.js';
|
|
3
|
+
import { DocumentTableLayoutMeasurement } from './document-table-print-model.js';
|
|
4
|
+
export declare function useMeasuredTableLayout({ sectionId, sectionRef, tableSurfaceRef, enabled, measureKey, measurementScale, fallbackRowHeightPx, rowRangeStartIndex, rowRangeEndIndex, totalRowCount, canUpdateLayoutChrome, measureColumnWidths, extraMeasurement, onTableLayoutMeasure, }: {
|
|
5
|
+
sectionId: string;
|
|
6
|
+
sectionRef: RefObject<HTMLDivElement | null>;
|
|
7
|
+
tableSurfaceRef: RefObject<HTMLDivElement | null>;
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
measureKey: string;
|
|
10
|
+
measurementScale: number;
|
|
11
|
+
/** For a drawn row with no layout box (a test DOM). */
|
|
12
|
+
fallbackRowHeightPx: number;
|
|
13
|
+
rowRangeStartIndex: number;
|
|
14
|
+
rowRangeEndIndex: number;
|
|
15
|
+
totalRowCount: number;
|
|
16
|
+
canUpdateLayoutChrome: boolean;
|
|
17
|
+
/** Report the first drawn row's cell widths (Matrix). */
|
|
18
|
+
measureColumnWidths?: boolean;
|
|
19
|
+
/** Reported with the measurement (a Matrix's fit). Keep it stable. */
|
|
20
|
+
extraMeasurement?: Pick<DocumentTableLayoutMeasurement, 'matrixFit'>;
|
|
21
|
+
onTableLayoutMeasure?: (sectionId: string, measurement: DocumentTableLayoutMeasurement) => void;
|
|
22
|
+
}): void;
|
|
23
|
+
/**
|
|
24
|
+
* Measures a Matrix printed in column bands (Plan 2, 2c, B2): every band draws
|
|
25
|
+
* every row, inside a `[data-document-matrix-band]` container under
|
|
26
|
+
* `bandsRef`. A row's height is its tallest across the bands, and the chrome
|
|
27
|
+
* is the tallest band's, so a slice of rows fits the page in every band.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useMeasuredBandedTableLayout({ sectionId, sectionRef, bandsRef, enabled, measureKey, measurementScale, fallbackRowHeightPx, rowCount, extraMeasurement, onTableLayoutMeasure, }: {
|
|
30
|
+
sectionId: string;
|
|
31
|
+
sectionRef: RefObject<HTMLDivElement | null>;
|
|
32
|
+
bandsRef: RefObject<HTMLDivElement | null>;
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
measureKey: string;
|
|
35
|
+
measurementScale: number;
|
|
36
|
+
fallbackRowHeightPx: number;
|
|
37
|
+
rowCount: number;
|
|
38
|
+
/** Reported with the measurement: widths and the fit. Keep it stable. */
|
|
39
|
+
extraMeasurement?: Pick<DocumentTableLayoutMeasurement, 'matrixFit' | 'columnWidthsPx'>;
|
|
40
|
+
onTableLayoutMeasure?: (sectionId: string, measurement: DocumentTableLayoutMeasurement) => void;
|
|
41
|
+
}): void;
|
|
42
|
+
export declare function getMeasurementRowRange({ tableSlice, initialRowsPerPageLimit, totalRowCount, }: {
|
|
43
|
+
tableSlice?: DocumentTableSlice;
|
|
44
|
+
initialRowsPerPageLimit?: number;
|
|
45
|
+
totalRowCount: number;
|
|
46
|
+
}): {
|
|
47
|
+
startIndex: number;
|
|
48
|
+
endIndex: number;
|
|
49
|
+
totalRowCount: number;
|
|
50
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads KPI values out of a card query result. Shared by the dashboard KPI
|
|
3
|
+
* cards and the Document KPI section, so both read the same number from the
|
|
4
|
+
* same result.
|
|
5
|
+
*/
|
|
6
|
+
/** A finite number from a numeric value or a numeric string (thousands commas allowed). */
|
|
7
|
+
export declare function toFiniteKpiNumber(value: unknown): number | null;
|
|
8
|
+
/**
|
|
9
|
+
* SQL-backed KPI: the first row's first displayed numeric column is the
|
|
10
|
+
* current value, the second is the previous value.
|
|
11
|
+
*/
|
|
12
|
+
export declare function readSqlKpiValues(data?: Record<string, unknown>[] | null): {
|
|
13
|
+
current: number | null;
|
|
14
|
+
previous: number | null;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Explorer KPI: the value of a result segment (`current`, `comparison`) for
|
|
18
|
+
* the primary metric. Rows without a `metricId` match any metric.
|
|
19
|
+
*/
|
|
20
|
+
export declare function readKpiSegmentValue(data: Record<string, unknown>[] | null | undefined, segment: string, metricId?: string): number | null;
|
|
@@ -6,7 +6,7 @@ import { CardNumericPresentationContext } from './numeric-presentation.js';
|
|
|
6
6
|
import { RawTemporalValueKind } from '../../shared/format-utils/index.js';
|
|
7
7
|
import { ResolvedValueFormatPreferences } from '../../shared/value-format-preferences/index.js';
|
|
8
8
|
import { MatrixCardCatalog } from '../matrix-table/matrix-card-adapter.js';
|
|
9
|
-
import { NumericCanonicalFormat } from '../../shared/format-utils/types/index.js';
|
|
9
|
+
import { MeasureCanonicalFormat, NumericCanonicalFormat } from '../../shared/format-utils/types/index.js';
|
|
10
10
|
import { ChartNumericPresentationContext } from './chart-numeric-presentation.js';
|
|
11
11
|
type MetricLookup = TableFieldLookup;
|
|
12
12
|
export type PresentationFormatField = Pick<MetricField | DetailField | GroupByField, 'id' | 'name' | 'alias' | 'format' | 'dataType'>;
|
|
@@ -154,7 +154,7 @@ export declare function resolveMetricCanonicalFormat(params: {
|
|
|
154
154
|
columnKeyMap?: QueryColumnKeyMap;
|
|
155
155
|
valueFormatPreferences?: ResolvedValueFormatPreferences | null;
|
|
156
156
|
boundCurrency?: string;
|
|
157
|
-
}):
|
|
157
|
+
}): MeasureCanonicalFormat | undefined;
|
|
158
158
|
export declare function resolveTableColumnCanonicalPresentation(params: {
|
|
159
159
|
card: TCard;
|
|
160
160
|
columnId: string;
|
|
@@ -167,7 +167,7 @@ export declare function resolveTableColumnCanonicalPresentation(params: {
|
|
|
167
167
|
comparisonValueKind?: 'comparison' | 'delta' | 'percent_change' | 'ratio';
|
|
168
168
|
comparisonPrecision?: number;
|
|
169
169
|
presentation: CardNumericPresentationContext;
|
|
170
|
-
}):
|
|
170
|
+
}): MeasureCanonicalFormat | undefined;
|
|
171
171
|
export declare function resolveCurrencyPresentationTargetFormat(params: {
|
|
172
172
|
matrixCatalog?: MatrixCardCatalog;
|
|
173
173
|
card: TCard;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { MatrixCardCatalog } from '../../matrix-table/matrix-card-adapter.js';
|
|
2
2
|
import { TCard } from '../../types/common-types.js';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { DocumentSectionCardRuntime } from '../../query-context/document-section-card-query.js';
|
|
4
|
+
/**
|
|
5
|
+
* Store adapter only: field, input, scope and precision decisions stay in the
|
|
6
|
+
* compiler. A Document section passes its runtime; the editor's preview of a
|
|
7
|
+
* section's card uses the editor's snapshot of the document inputs, as the
|
|
8
|
+
* card's frame query does.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useDashboardCardExecutionSnapshot(card: TCard, matrixCatalog: MatrixCardCatalog, documentSection?: DocumentSectionCardRuntime): import('../../query-context/build-dashboard-execution-snapshot.js').DashboardCardExecutionSnapshotResult;
|
|
@@ -27,6 +27,12 @@ type AdditionalState = {
|
|
|
27
27
|
effectiveCardConfig?: CardConfig;
|
|
28
28
|
resultOwner: TemporalResultOwner;
|
|
29
29
|
isCurrentQueryResult: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Required inputs this card's Document section query is waiting for. When
|
|
32
|
+
* non-empty the query is disabled and will not run until they are set, so
|
|
33
|
+
* a Document renders it as blocked, not loading.
|
|
34
|
+
*/
|
|
35
|
+
missingRequiredInputLabels: string[];
|
|
30
36
|
};
|
|
31
37
|
export type DashboardCardQueryResult = UseQueryResult<any, Error> & AdditionalState;
|
|
32
38
|
export type DashboardCardQueryOptions = {
|
|
@@ -2,7 +2,7 @@ import { TCard } from '../types/common-types.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Hook that provides KPI card actions scoped to visual editor mode.
|
|
4
4
|
*/
|
|
5
|
-
export declare function useDashboardKpiActions(
|
|
5
|
+
export declare function useDashboardKpiActions(card: TCard): {
|
|
6
6
|
setTitle: (title: string) => void;
|
|
7
7
|
setCountryLogo: (countryId: string | null) => void;
|
|
8
8
|
isEditable: boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ControlDefinition, DocumentTableSection } from '../types/common-types.js';
|
|
1
|
+
import { ControlDefinition, DocumentKpiSection, DocumentTableSection } from '../types/common-types.js';
|
|
2
2
|
import { TFilterValue } from '../../components/surfboard/filter/types.js';
|
|
3
|
-
export declare function useDocumentSectionEditor(): (sheetId: string, section: DocumentTableSection, documentFilterValues?: TFilterValue[], documentControlDefinitions?: ControlDefinition[], documentControlValues?: Record<string, unknown>, missingRequiredInputLabels?: string[]) => void;
|
|
3
|
+
export declare function useDocumentSectionEditor(): (sheetId: string, section: DocumentTableSection | DocumentKpiSection, documentFilterValues?: TFilterValue[], documentControlDefinitions?: ControlDefinition[], documentControlValues?: Record<string, unknown>, missingRequiredInputLabels?: string[], cardId?: string) => void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ControlDefinition, DocumentKpiSection, DocumentTableSection, TFrame } from '../types/common-types.js';
|
|
2
|
+
import { TFilterValue } from '../../components/surfboard/filter/types.js';
|
|
3
|
+
export type DocumentSectionCommitResult = {
|
|
4
|
+
ok: true;
|
|
5
|
+
} | {
|
|
6
|
+
ok: false;
|
|
7
|
+
reason: string;
|
|
8
|
+
};
|
|
9
|
+
export type OpenDocumentSectionSession = {
|
|
10
|
+
sheetId: string;
|
|
11
|
+
section: DocumentTableSection | DocumentKpiSection;
|
|
12
|
+
/** The card to edit; required for a KPI section with several cards. */
|
|
13
|
+
cardId?: string;
|
|
14
|
+
documentFilterValues?: TFilterValue[];
|
|
15
|
+
documentControlDefinitions?: ControlDefinition[];
|
|
16
|
+
documentControlValues?: Record<string, unknown>;
|
|
17
|
+
missingRequiredInputLabels?: string[];
|
|
18
|
+
};
|
|
19
|
+
export type DocumentSectionSession = {
|
|
20
|
+
open(target: OpenDocumentSectionSession): void;
|
|
21
|
+
/**
|
|
22
|
+
* Writes the accepted frame's card, and its calculated fields, in one
|
|
23
|
+
* document edit. `acceptedFrame` is the frame Accept built and validated:
|
|
24
|
+
* metadata is resolved for it and it is what is written, as a dashboard
|
|
25
|
+
* visual's save does, so the two always match.
|
|
26
|
+
*/
|
|
27
|
+
commit(acceptedFrame: TFrame): Promise<DocumentSectionCommitResult>;
|
|
28
|
+
discard(): void;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* One editor session on one card of a document section. It opens today's
|
|
32
|
+
* full-screen visual editor on the existing path (`setupEditorWithCard`, so
|
|
33
|
+
* `isVisualEditing` stays the calculated-field draft boundary and query gate),
|
|
34
|
+
* and nothing reaches the dashboard until `commit()`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useDocumentSectionSession(): DocumentSectionSession;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Marks everything below it as the visual editor's preview. Only `<Editor>`
|
|
4
|
+
* provides it. Whether a component is the editor's preview is a fact about
|
|
5
|
+
* where it renders, not a global mode: a Document page stays on screen while
|
|
6
|
+
* one of its cards is open in the editor, and it is a report, not the
|
|
7
|
+
* editor's preview.
|
|
8
|
+
*/
|
|
9
|
+
export declare function EditorPreviewScope({ children }: {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}): import('react').FunctionComponentElement<import('react').ProviderProps<boolean>>;
|
|
12
|
+
/**
|
|
13
|
+
* Whether this component renders inside the visual editor. Visuals, filters
|
|
14
|
+
* and queries read this, never the store's `isVisualEditing`, which only
|
|
15
|
+
* means "the editor UI is open" (tech spec M7).
|
|
16
|
+
*/
|
|
17
|
+
export declare function useIsEditorPreview(): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether this card is the one open in the visual editor. Card-level editing
|
|
3
|
+
* affordances (inline title and description) key on this rather than the
|
|
4
|
+
* global `isVisualEditing`, so a page that shows several cards while one is
|
|
5
|
+
* edited, such as a Document, keeps the others read-only.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useIsEditingCard(cardId: string | undefined): boolean;
|
|
@@ -35,6 +35,7 @@ export declare function prepareMatrixCard(card: TCard, catalog: MatrixCardCatalo
|
|
|
35
35
|
position: "before" | "after";
|
|
36
36
|
label?: string | undefined;
|
|
37
37
|
}>>;
|
|
38
|
+
skipRedundant?: boolean | undefined;
|
|
38
39
|
};
|
|
39
40
|
rows: {
|
|
40
41
|
grand: {
|
|
@@ -47,6 +48,7 @@ export declare function prepareMatrixCard(card: TCard, catalog: MatrixCardCatalo
|
|
|
47
48
|
position: "before" | "after";
|
|
48
49
|
label?: string | undefined;
|
|
49
50
|
}>>;
|
|
51
|
+
skipRedundant?: boolean | undefined;
|
|
50
52
|
};
|
|
51
53
|
};
|
|
52
54
|
layout: {
|
|
@@ -15,6 +15,7 @@ export declare function initializeMatrixCardDraft(card: Pick<TCard, 'config' | '
|
|
|
15
15
|
position: "before" | "after";
|
|
16
16
|
label?: string | undefined;
|
|
17
17
|
}>>;
|
|
18
|
+
skipRedundant?: boolean | undefined;
|
|
18
19
|
};
|
|
19
20
|
rows: {
|
|
20
21
|
grand: {
|
|
@@ -27,6 +28,7 @@ export declare function initializeMatrixCardDraft(card: Pick<TCard, 'config' | '
|
|
|
27
28
|
position: "before" | "after";
|
|
28
29
|
label?: string | undefined;
|
|
29
30
|
}>>;
|
|
31
|
+
skipRedundant?: boolean | undefined;
|
|
30
32
|
};
|
|
31
33
|
};
|
|
32
34
|
layout: {
|
|
@@ -98,6 +98,7 @@ export declare function buildMatrixDeliveryPayload(input: {
|
|
|
98
98
|
position: "before" | "after";
|
|
99
99
|
label?: string | undefined;
|
|
100
100
|
}>>;
|
|
101
|
+
skipRedundant?: boolean | undefined;
|
|
101
102
|
};
|
|
102
103
|
rows: {
|
|
103
104
|
grand: {
|
|
@@ -110,6 +111,7 @@ export declare function buildMatrixDeliveryPayload(input: {
|
|
|
110
111
|
position: "before" | "after";
|
|
111
112
|
label?: string | undefined;
|
|
112
113
|
}>>;
|
|
114
|
+
skipRedundant?: boolean | undefined;
|
|
113
115
|
};
|
|
114
116
|
};
|
|
115
117
|
layout: {
|
|
@@ -448,6 +450,7 @@ export declare function buildMatrixDeliveryPayload(input: {
|
|
|
448
450
|
position: "before" | "after";
|
|
449
451
|
label?: string | undefined;
|
|
450
452
|
}>>;
|
|
453
|
+
skipRedundant?: boolean | undefined;
|
|
451
454
|
};
|
|
452
455
|
rows: {
|
|
453
456
|
grand: {
|
|
@@ -460,6 +463,7 @@ export declare function buildMatrixDeliveryPayload(input: {
|
|
|
460
463
|
position: "before" | "after";
|
|
461
464
|
label?: string | undefined;
|
|
462
465
|
}>>;
|
|
466
|
+
skipRedundant?: boolean | undefined;
|
|
463
467
|
};
|
|
464
468
|
};
|
|
465
469
|
layout: {
|