@robosystems/report-components 0.2.0 → 0.2.2
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/adapters/index.d.ts +1 -1
- package/dist/adapters/index.js +1 -1
- package/dist/{chunk-POSLHOTN.js → chunk-RQXAMFTZ.js} +201 -31
- package/dist/chunk-RQXAMFTZ.js.map +1 -0
- package/dist/{index-D6FzPTm5.d.ts → index-BS6_6h3l.d.ts} +162 -1
- package/dist/index.d.ts +92 -29
- package/dist/index.js +701 -182
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-POSLHOTN.js.map +0 -1
|
@@ -15,6 +15,14 @@ import { Store } from 'n3';
|
|
|
15
15
|
*/
|
|
16
16
|
type PeriodType = 'instant' | 'duration';
|
|
17
17
|
type BalanceType = 'debit' | 'credit';
|
|
18
|
+
/**
|
|
19
|
+
* How a numeric fact is formatted and whether it may be rescaled. Monetary values
|
|
20
|
+
* take the unit's currency symbol and honor the section scale; per-share amounts
|
|
21
|
+
* and share counts are never rescaled (an EPS of 4.93 stays 4.93 under "in
|
|
22
|
+
* millions"); percentages render with a `%` suffix. Absent → the formatter falls
|
|
23
|
+
* back to `monetary ? 'monetary' : 'other'`.
|
|
24
|
+
*/
|
|
25
|
+
type NumericKind = 'monetary' | 'perShare' | 'shares' | 'percent' | 'pure' | 'integer' | 'other';
|
|
18
26
|
/** A reportable concept (a taxonomy element). */
|
|
19
27
|
interface ElementInfo {
|
|
20
28
|
/** Full element IRI — the join key used everywhere. */
|
|
@@ -27,6 +35,18 @@ interface ElementInfo {
|
|
|
27
35
|
periodType: PeriodType | null;
|
|
28
36
|
abstract: boolean;
|
|
29
37
|
monetary: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Finer numeric classification driving format + scale (per-share and share
|
|
40
|
+
* counts opt out of rescaling). Optional; when absent the formatter falls back
|
|
41
|
+
* to `monetary ? 'monetary' : 'other'`.
|
|
42
|
+
*/
|
|
43
|
+
numericKind?: NumericKind;
|
|
44
|
+
/**
|
|
45
|
+
* Value domain (`rs:itemType`): `textBlock` / `monetary` / `shares` / `decimal`
|
|
46
|
+
* / `date` / `boolean` / `string`. `textBlock` marks an element whose facts are
|
|
47
|
+
* rendered HTML disclosures — orthogonal to elementType's structural role.
|
|
48
|
+
*/
|
|
49
|
+
itemType?: string;
|
|
30
50
|
}
|
|
31
51
|
/** A reporting period — an instant (balance sheet) or a duration (flows). */
|
|
32
52
|
interface PeriodInfo {
|
|
@@ -45,6 +65,12 @@ interface UnitInfo {
|
|
|
45
65
|
measure: string;
|
|
46
66
|
/** Short display label, e.g. `USD`. */
|
|
47
67
|
label: string;
|
|
68
|
+
/**
|
|
69
|
+
* Currency symbol for a monetary unit (`$`, `€`, `£`, `¥`), else null — a share
|
|
70
|
+
* or pure unit has none. Lets the renderer stop hard-coding `$` for non-USD.
|
|
71
|
+
* Optional; when absent the formatter derives it from `measure`.
|
|
72
|
+
*/
|
|
73
|
+
symbol?: string | null;
|
|
48
74
|
}
|
|
49
75
|
/** The reporting entity. */
|
|
50
76
|
interface EntityInfo {
|
|
@@ -53,6 +79,28 @@ interface EntityInfo {
|
|
|
53
79
|
legalName: string | null;
|
|
54
80
|
country: string | null;
|
|
55
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* One dimensional qualifier on a fact: an axis pinned to a member. A fact's full
|
|
84
|
+
* dimensional coordinate is an ordered list of these (one per axis); an empty
|
|
85
|
+
* list is the consolidated total. Explicit dimensions name a `member`; typed
|
|
86
|
+
* dimensions carry a `typedValue` instead. This is the only multi-valued fact
|
|
87
|
+
* aspect, and it is what separates otherwise-identical facts (same element +
|
|
88
|
+
* period) into distinct pivot cells — so it is part of a fact's identity.
|
|
89
|
+
*/
|
|
90
|
+
interface DimensionQualifier {
|
|
91
|
+
/** Axis element IRI/qname, e.g. `us-gaap:StatementEquityComponentsAxis`. */
|
|
92
|
+
axis: string;
|
|
93
|
+
/** Member element IRI/qname (explicit), or null for a typed dimension. */
|
|
94
|
+
member: string | null;
|
|
95
|
+
/** Human axis label, e.g. `Equity Components`. */
|
|
96
|
+
axisLabel: string;
|
|
97
|
+
/** Human member label, e.g. `Common Stock`. */
|
|
98
|
+
memberLabel: string;
|
|
99
|
+
/** Explicit (member drawn from a domain) vs typed (an arbitrary value). */
|
|
100
|
+
explicit: boolean;
|
|
101
|
+
/** The typed-dimension value, present when `!explicit`. */
|
|
102
|
+
typedValue?: string | null;
|
|
103
|
+
}
|
|
56
104
|
/** A single reported value. */
|
|
57
105
|
interface Fact {
|
|
58
106
|
id: string;
|
|
@@ -74,6 +122,13 @@ interface Fact {
|
|
|
74
122
|
* (the cover, narrative disclosures) render their content instead of a blank.
|
|
75
123
|
*/
|
|
76
124
|
textValue?: string | null;
|
|
125
|
+
/**
|
|
126
|
+
* The fact's dimensional coordinate — one qualifier per axis, ordered by axis.
|
|
127
|
+
* Absent/empty means a consolidated (undimensioned) fact. Part of the fact's
|
|
128
|
+
* identity: the pivot engine keys cells by `(element, period, dimensions)`, so
|
|
129
|
+
* segment/component breakdowns no longer overwrite the consolidated total.
|
|
130
|
+
*/
|
|
131
|
+
dimensions?: DimensionQualifier[];
|
|
77
132
|
}
|
|
78
133
|
/** A calculation arc: `parent` (subtotal) rolls up `child * weight`. */
|
|
79
134
|
interface CalcAssociation {
|
|
@@ -169,6 +224,112 @@ interface Statement {
|
|
|
169
224
|
columns: StatementColumn[];
|
|
170
225
|
rows: StatementRow[];
|
|
171
226
|
}
|
|
227
|
+
/**
|
|
228
|
+
* A reference to one fact aspect, for assigning it a pivot role. `concept`,
|
|
229
|
+
* `period`, `entity`, `unit` are the single-valued builtins; `dim:<axisIri>`
|
|
230
|
+
* names a dimensional axis. String-form so a config round-trips through JSON or
|
|
231
|
+
* a UI control (e.g. `dim:us-gaap:StatementEquityComponentsAxis`).
|
|
232
|
+
*/
|
|
233
|
+
type AspectKey = 'concept' | 'period' | 'entity' | 'unit' | `dim:${string}`;
|
|
234
|
+
/** Display scale for monetary values; `auto` infers from the facts' decimals. */
|
|
235
|
+
type Scale = 'auto' | 'ones' | 'thousands' | 'millions' | 'billions';
|
|
236
|
+
/**
|
|
237
|
+
* A pivot configuration: which aspects lay out as rows, which as columns, and
|
|
238
|
+
* which are held fixed as slicers. `defaultPivotConfig` derives one per section
|
|
239
|
+
* (concept→rows, period + multi-member dimensions→columns, entity + single-member
|
|
240
|
+
* dimensions→slicers); a caller may override any of it.
|
|
241
|
+
*/
|
|
242
|
+
interface PivotConfig {
|
|
243
|
+
rows: AspectKey[];
|
|
244
|
+
columns: AspectKey[];
|
|
245
|
+
slicers: AspectKey[];
|
|
246
|
+
scale: Scale;
|
|
247
|
+
/** Emit abstract concept rows as group headers (default true). */
|
|
248
|
+
showAbstracts: boolean;
|
|
249
|
+
/**
|
|
250
|
+
* Drop a period column with fewer than two populated facts when the densest
|
|
251
|
+
* period has several (default true). This removes lone stragglers — e.g. an
|
|
252
|
+
* equity opening balance that leaked into the balance-sheet factset — without
|
|
253
|
+
* ever touching a real comparative period (which repeats many line items).
|
|
254
|
+
* Metadata-safe: unlike the old fact filter, cells still own their own facts.
|
|
255
|
+
*/
|
|
256
|
+
dropSparsePeriods?: boolean;
|
|
257
|
+
}
|
|
258
|
+
/** An aspect held fixed for the whole table, rendered as a header bar. */
|
|
259
|
+
interface PivotSlicer {
|
|
260
|
+
aspect: AspectKey;
|
|
261
|
+
/** e.g. `Reporting Entity` or `Equity Components [Axis]`. */
|
|
262
|
+
label: string;
|
|
263
|
+
/** e.g. `NVIDIA CORP`, `Consolidated`, `USD`. */
|
|
264
|
+
valueLabel: string;
|
|
265
|
+
}
|
|
266
|
+
/** One leaf column — a single combination of the column aspects. */
|
|
267
|
+
interface PivotColumn {
|
|
268
|
+
/** Stable key: signature of this column's coordinate. */
|
|
269
|
+
key: string;
|
|
270
|
+
/** The period, when period is a column aspect (else null). */
|
|
271
|
+
period: PeriodInfo | null;
|
|
272
|
+
/** The member coordinate, when dimensions are column aspects (else empty). */
|
|
273
|
+
members: DimensionQualifier[];
|
|
274
|
+
/** Leaf header label (a date, a member name, …). */
|
|
275
|
+
label: string;
|
|
276
|
+
}
|
|
277
|
+
/** A column-header cell spanning one level of the (possibly nested) column tree. */
|
|
278
|
+
interface PivotColumnHeader {
|
|
279
|
+
label: string;
|
|
280
|
+
/** colspan across leaf columns. */
|
|
281
|
+
span: number;
|
|
282
|
+
}
|
|
283
|
+
/** One value in a pivot row, plus the fact behind it (for inspection / footing). */
|
|
284
|
+
interface PivotCell {
|
|
285
|
+
value: number | null;
|
|
286
|
+
fact: Fact | null;
|
|
287
|
+
/** Raw string for a non-numeric fact, when `value` is null. */
|
|
288
|
+
textValue?: string | null;
|
|
289
|
+
}
|
|
290
|
+
/** One rendered pivot line. */
|
|
291
|
+
interface PivotRow {
|
|
292
|
+
/** Stable key: element id + dimensional signature (when dims are on rows). */
|
|
293
|
+
key: string;
|
|
294
|
+
element: ElementInfo;
|
|
295
|
+
/** Indent depth in the concept tree — drives indentation. */
|
|
296
|
+
depth: number;
|
|
297
|
+
/** A concept header row (abstract) — carries no values. */
|
|
298
|
+
header: boolean;
|
|
299
|
+
/** A calculation parent (roll-up) — rendered emphasized. */
|
|
300
|
+
isSubtotal: boolean;
|
|
301
|
+
/** The member coordinate, when dimensions are row aspects (else empty). */
|
|
302
|
+
members: DimensionQualifier[];
|
|
303
|
+
/** One cell per leaf column, aligned by index (empty for header rows). */
|
|
304
|
+
cells: PivotCell[];
|
|
305
|
+
}
|
|
306
|
+
/** Resolved display scale + a caption for the section header. */
|
|
307
|
+
interface ResolvedScale {
|
|
308
|
+
/** Divide monetary values by this (1 for ones, 1e6 for millions). */
|
|
309
|
+
factor: number;
|
|
310
|
+
/** `millions`, `thousands`, `billions`, or '' when unscaled. */
|
|
311
|
+
label: string;
|
|
312
|
+
/** Header caption, e.g. `In millions, except per-share amounts`, or null. */
|
|
313
|
+
caption: string | null;
|
|
314
|
+
}
|
|
315
|
+
/** A fully pivoted section — the render input, and the raw fact table's source. */
|
|
316
|
+
interface PivotTable {
|
|
317
|
+
ib: InformationBlock;
|
|
318
|
+
blockType: string;
|
|
319
|
+
title: string;
|
|
320
|
+
structureName: string | null;
|
|
321
|
+
/** Aspects held fixed for the whole table, shown as header bars. */
|
|
322
|
+
slicers: PivotSlicer[];
|
|
323
|
+
/** Column header rows, outermost level first (period over members). */
|
|
324
|
+
columnHeaders: PivotColumnHeader[][];
|
|
325
|
+
/** Leaf columns; row cells align to these by index. */
|
|
326
|
+
columns: PivotColumn[];
|
|
327
|
+
rows: PivotRow[];
|
|
328
|
+
/** Resolved display scale (factor + caption). */
|
|
329
|
+
scale: ResolvedScale;
|
|
330
|
+
/** The configuration this table was built from (default, unless overridden). */
|
|
331
|
+
config: PivotConfig;
|
|
332
|
+
}
|
|
172
333
|
|
|
173
334
|
/** Injected transport — runs a read-only Cypher query and returns its rows. */
|
|
174
335
|
type SecQuery = (cypher: string, params?: Record<string, unknown>) => Promise<Array<Record<string, unknown>>>;
|
|
@@ -269,4 +430,4 @@ declare function jsonldFileAdapter(doc: string | object, source?: string): Repor
|
|
|
269
430
|
/** Traverse a populated quad `Store` into the normalized report model. */
|
|
270
431
|
declare function parseStore(store: Store): NormalizedReport;
|
|
271
432
|
|
|
272
|
-
export { type BalanceType as B, type CalcAssociation as C, type ElementInfo as E, type Fact as F, type InformationBlock as I, type
|
|
433
|
+
export { type AspectKey as A, type BalanceType as B, type CalcAssociation as C, type DimensionQualifier as D, type ElementInfo as E, type Fact as F, parseJsonld as G, parseStore as H, type InformationBlock as I, parseStructureDefinition as J, type NumericKind as N, type PeriodInfo as P, type ReportAdapter as R, type Scale as S, type UnitInfo as U, type NormalizedReport as a, type PivotConfig as b, type PivotTable as c, type PivotRow as d, type CypherAdapterConfig as e, type EntityInfo as f, type PeriodType as g, type PivotCell as h, type PivotColumn as i, type PivotColumnHeader as j, type PivotSlicer as k, type PresAssociation as l, type ResolvedScale as m, type RowCell as n, type SecQuery as o, type SecReportShell as p, type SecSection as q, type Statement as r, type StatementColumn as s, type StatementRow as t, type StructureInfo as u, cypherAdapter as v, fetchSecReportShell as w, fetchSecSection as x, jsonldFileAdapter as y, mergeSecSections as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PeriodInfo, E as ElementInfo,
|
|
2
|
-
export { B as BalanceType, C as CalcAssociation,
|
|
1
|
+
import { N as NumericKind, P as PeriodInfo, E as ElementInfo, a as NormalizedReport, I as InformationBlock, b as PivotConfig, c as PivotTable, d as PivotRow, U as UnitInfo } from './index-BS6_6h3l.js';
|
|
2
|
+
export { A as AspectKey, B as BalanceType, C as CalcAssociation, e as CypherAdapterConfig, D as DimensionQualifier, f as EntityInfo, F as Fact, g as PeriodType, h as PivotCell, i as PivotColumn, j as PivotColumnHeader, k as PivotSlicer, l as PresAssociation, R as ReportAdapter, m as ResolvedScale, n as RowCell, S as Scale, o as SecQuery, p as SecReportShell, q as SecSection, r as Statement, s as StatementColumn, t as StatementRow, u as StructureInfo, v as cypherAdapter, w as fetchSecReportShell, x as fetchSecSection, y as jsonldFileAdapter, z as mergeSecSections, G as parseJsonld, H as parseStore, J as parseStructureDefinition } from './index-BS6_6h3l.js';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import 'n3';
|
|
5
5
|
|
|
@@ -54,8 +54,72 @@ declare function formatMoney(value: number | null | undefined, opts?: {
|
|
|
54
54
|
}): string;
|
|
55
55
|
/** `2024-03-31` → `Mar 31, 2024`. Falls back to the raw string if unparseable. */
|
|
56
56
|
declare function formatDate(iso: string | null | undefined): string;
|
|
57
|
+
/**
|
|
58
|
+
* Humanize an ISO-8601 duration value (`P10Y` → "10 years", `P1Y6M` → "1 year 6
|
|
59
|
+
* months", `P30D` → "30 days"), or null when the string is not a duration — so a
|
|
60
|
+
* non-numeric fact that happens to start with "P" (a company name) is untouched.
|
|
61
|
+
* XBRL `durationItemType` facts (debt maturities, lease terms) arrive as these
|
|
62
|
+
* strings in the text path.
|
|
63
|
+
*/
|
|
64
|
+
declare function humanizeDuration(value: string | null | undefined): string | null;
|
|
57
65
|
/** A human description of a period — "As of …" for instants, a span for durations. */
|
|
58
66
|
declare function formatPeriod(period: PeriodInfo): string;
|
|
67
|
+
/** The effective numeric kind of an element (explicit, else derived from monetary). */
|
|
68
|
+
declare function numericKindOf(el: ElementInfo): NumericKind;
|
|
69
|
+
/**
|
|
70
|
+
* A display prefix for a monetary unit measure (`iso4217:USD` → `$`), else null.
|
|
71
|
+
* Unknown currencies fall back to their code (`CHF `, `SEK `) rather than a wrong
|
|
72
|
+
* dollar sign — this is what fixes non-USD facts rendering as `$`.
|
|
73
|
+
*/
|
|
74
|
+
declare function currencySymbolFor(measure: string | null | undefined): string | null;
|
|
75
|
+
interface ValueFormat {
|
|
76
|
+
/** Drives symbol, scaling opt-out, and decimal places. Defaults to `monetary`. */
|
|
77
|
+
numericKind?: NumericKind;
|
|
78
|
+
/** Currency symbol for monetary/per-share values (from the fact's unit). */
|
|
79
|
+
symbol?: string | null;
|
|
80
|
+
/** Divide monetary values by this (e.g. 1e6 to show millions); default 1. */
|
|
81
|
+
scaleFactor?: number;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Format a fact value for display: accounting style (negatives in parentheses,
|
|
85
|
+
* em-dash for absent), the fact's own currency symbol (never a hard-coded `$`),
|
|
86
|
+
* and the section scale — with per-share amounts and share counts never rescaled
|
|
87
|
+
* (an EPS of 4.93 stays 4.93 under "in millions"). A `percent` fact stores a
|
|
88
|
+
* decimal fraction, so it is scaled ×100 and suffixed with `%` (0.10 → 10%); a
|
|
89
|
+
* `pure` fact is a bare ratio, shown as a plain decimal (no `%`).
|
|
90
|
+
*/
|
|
91
|
+
declare function formatValue(value: number | null | undefined, fmt?: ValueFormat): string;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Derive the default pivot for a section from the aspects its facts actually
|
|
95
|
+
* carry: concept on rows, period on columns, entity a slicer, and each dimension
|
|
96
|
+
* axis on columns when it has more than one member (a real breakdown) or a slicer
|
|
97
|
+
* when it has just one (diced to a single member, e.g. `Consolidated [Domain]`).
|
|
98
|
+
*/
|
|
99
|
+
declare function defaultPivotConfig(model: NormalizedReport, ib: InformationBlock): PivotConfig;
|
|
100
|
+
/**
|
|
101
|
+
* Move every dimension axis to one side of the pivot — the toggle behind a
|
|
102
|
+
* "dimensions as rows / columns" control. Concept stays on rows and period on
|
|
103
|
+
* columns; only `dim:*` aspects move. Rows (nested breakdowns) is the default;
|
|
104
|
+
* columns gives the side-by-side matrix (equity components across the top).
|
|
105
|
+
*/
|
|
106
|
+
declare function pivotDimensionsOn(config: PivotConfig, placement: 'rows' | 'columns'): PivotConfig;
|
|
107
|
+
/**
|
|
108
|
+
* Pivot one section into a `PivotTable`. Pass `config` to override the default
|
|
109
|
+
* arrangement (e.g. move a high-arity axis from columns to rows).
|
|
110
|
+
*/
|
|
111
|
+
declare function buildPivot(model: NormalizedReport, ib: InformationBlock, config?: PivotConfig): PivotTable;
|
|
112
|
+
/** Section metadata (id + display title) for a report, in canonical order. */
|
|
113
|
+
declare function reportSections(model: NormalizedReport): Array<{
|
|
114
|
+
id: string;
|
|
115
|
+
title: string;
|
|
116
|
+
}>;
|
|
117
|
+
/**
|
|
118
|
+
* Pivot every section of a report, in canonical block order. `configFor` may
|
|
119
|
+
* transform each section's default config before it is built — e.g. to apply a
|
|
120
|
+
* "dimensions as rows / columns" toggle across the whole report.
|
|
121
|
+
*/
|
|
122
|
+
declare function buildPivots(model: NormalizedReport, configFor?: (ib: InformationBlock, defaultConfig: PivotConfig) => PivotConfig): PivotTable[];
|
|
59
123
|
|
|
60
124
|
interface OrderEntry {
|
|
61
125
|
order: number;
|
|
@@ -64,26 +128,20 @@ interface OrderEntry {
|
|
|
64
128
|
/**
|
|
65
129
|
* Post-order the presentation arcs of one structure → `{element: {order, depth}}`.
|
|
66
130
|
* Roots (a `from` that is never a `to`) are visited by their subtree's leading
|
|
67
|
-
* arc order
|
|
68
|
-
*
|
|
131
|
+
* arc order. Retained as a reusable utility; the pivot engine builds its own
|
|
132
|
+
* pre-order tree (it needs abstract headers), but external callers may still want
|
|
133
|
+
* a flat order map.
|
|
69
134
|
*/
|
|
70
135
|
declare function presentationOrder(model: NormalizedReport, structureId: string): Map<string, OrderEntry>;
|
|
71
136
|
/** Concepts that are calculation parents — the authoritative subtotal set. */
|
|
72
137
|
declare function calcSubtotals(model: NormalizedReport): Set<string>;
|
|
73
|
-
/** Section metadata (id + display title) for a report, in canonical order. */
|
|
74
|
-
declare function reportSections(model: NormalizedReport): Array<{
|
|
75
|
-
id: string;
|
|
76
|
-
title: string;
|
|
77
|
-
}>;
|
|
78
138
|
/**
|
|
79
139
|
* Narrow a whole report to a single section (one Information Block) so it can be
|
|
80
|
-
* rendered on its own. `
|
|
81
|
-
* restricting to one yields exactly that section —
|
|
82
|
-
* networks stay intact because
|
|
140
|
+
* rendered on its own. `buildPivots` only iterates `informationBlocks`, so
|
|
141
|
+
* restricting to one yields exactly that section — facts, structures, and
|
|
142
|
+
* networks stay intact because the pivot filters them by the block.
|
|
83
143
|
*/
|
|
84
144
|
declare function sliceReportSection(model: NormalizedReport, informationBlockId: string): NormalizedReport;
|
|
85
|
-
/** Reconstruct every statement in the report, in canonical block order. */
|
|
86
|
-
declare function buildStatements(model: NormalizedReport): Statement[];
|
|
87
145
|
interface FootTerm {
|
|
88
146
|
element: ElementInfo;
|
|
89
147
|
weight: number;
|
|
@@ -102,9 +160,10 @@ interface FootCheck {
|
|
|
102
160
|
/**
|
|
103
161
|
* Foot a subtotal live: sum its calculation children (× weight) and compare to
|
|
104
162
|
* its reported value, e.g. `13,550 + 900 = 14,450 ✓`. Returns `null` when the
|
|
105
|
-
* element is not a calculation parent (nothing to foot).
|
|
163
|
+
* element is not a calculation parent (nothing to foot). Values are read from the
|
|
164
|
+
* consolidated (undimensioned) row for each concept.
|
|
106
165
|
*/
|
|
107
|
-
declare function footCheck(model: NormalizedReport,
|
|
166
|
+
declare function footCheck(model: NormalizedReport, table: PivotTable, elementId: string, columnIndex: number): FootCheck | null;
|
|
108
167
|
|
|
109
168
|
interface ExternalTextBlockProps {
|
|
110
169
|
url: string;
|
|
@@ -113,34 +172,38 @@ declare function ExternalTextBlock({ url }: ExternalTextBlockProps): react.JSX.E
|
|
|
113
172
|
|
|
114
173
|
interface FactInspectorProps {
|
|
115
174
|
report: NormalizedReport;
|
|
116
|
-
|
|
117
|
-
row:
|
|
175
|
+
table: PivotTable;
|
|
176
|
+
row: PivotRow;
|
|
118
177
|
columnIndex: number;
|
|
119
178
|
onClose?: () => void;
|
|
120
|
-
currencySymbol?: string;
|
|
121
179
|
}
|
|
122
|
-
declare function FactInspector({ report,
|
|
180
|
+
declare function FactInspector({ report, table, row, columnIndex, onClose }: FactInspectorProps): react.JSX.Element;
|
|
123
181
|
|
|
124
182
|
interface ReportViewProps {
|
|
125
183
|
report: NormalizedReport;
|
|
126
|
-
currencySymbol?: string;
|
|
127
184
|
/** Disable the click-to-inspect fact panel (render-only). */
|
|
128
185
|
inspect?: boolean;
|
|
186
|
+
/** Initial placement for dimension breakdowns (default `rows`). */
|
|
187
|
+
dimensionAxis?: 'rows' | 'columns';
|
|
129
188
|
}
|
|
130
|
-
declare function ReportView({ report,
|
|
189
|
+
declare function ReportView({ report, inspect, dimensionAxis }: ReportViewProps): react.JSX.Element;
|
|
131
190
|
|
|
132
191
|
interface StatementTableProps {
|
|
133
|
-
|
|
192
|
+
table: PivotTable;
|
|
193
|
+
/** The report's units, to resolve each cell's currency symbol. */
|
|
194
|
+
units?: Record<string, UnitInfo>;
|
|
134
195
|
/** Called when a value cell is clicked — drives fact inspection. */
|
|
135
|
-
onCellClick?: (row:
|
|
136
|
-
/** Currency symbol for values (default `$`). */
|
|
137
|
-
currencySymbol?: string;
|
|
196
|
+
onCellClick?: (row: PivotRow, columnIndex: number) => void;
|
|
138
197
|
/** The currently-selected cell, highlighted. */
|
|
139
198
|
selected?: {
|
|
140
|
-
|
|
199
|
+
rowKey: string;
|
|
141
200
|
columnIndex: number;
|
|
142
201
|
} | null;
|
|
202
|
+
/** Current dimension placement — set with `onDimensionPlacementChange` to show the toggle. */
|
|
203
|
+
dimensionPlacement?: 'rows' | 'columns';
|
|
204
|
+
/** Setter for the dimension placement; when provided (and the section is dimensional), a rows/columns toggle renders below the slicers. */
|
|
205
|
+
onDimensionPlacementChange?: (placement: 'rows' | 'columns') => void;
|
|
143
206
|
}
|
|
144
|
-
declare function StatementTable({
|
|
207
|
+
declare function StatementTable({ table, units, onCellClick, selected, dimensionPlacement, onDimensionPlacementChange, }: StatementTableProps): react.JSX.Element;
|
|
145
208
|
|
|
146
|
-
export { BLOCK_ORDER, BLOCK_TITLES, ElementInfo, ExternalTextBlock, type ExternalTextBlockProps, FactInspector, type FactInspectorProps, type FootCheck, type FootTerm, NS, NormalizedReport, PeriodInfo, ReportView, type ReportViewProps,
|
|
209
|
+
export { BLOCK_ORDER, BLOCK_TITLES, ElementInfo, ExternalTextBlock, type ExternalTextBlockProps, FactInspector, type FactInspectorProps, type FootCheck, type FootTerm, InformationBlock, NS, NormalizedReport, NumericKind, PeriodInfo, PivotConfig, PivotRow, PivotTable, ReportView, type ReportViewProps, StatementTable, type StatementTableProps, UnitInfo, type ValueFormat, buildPivot, buildPivots, calcSubtotals, currencySymbolFor, defaultPivotConfig, footCheck, formatDate, formatMoney, formatPeriod, formatValue, humanize, humanizeDuration, isExternalFactUrl, numericKindOf, pivotDimensionsOn, presentationOrder, qname, reportSections, sliceReportSection };
|