react-semaphor 0.1.558 → 0.1.560
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics-protocol/index.js +368 -358
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +5 -5
- package/dist/brand-studio/index.js +9 -9
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/analytics-base-schemas-CHLxsPfX.js +630 -0
- package/dist/chunks/{assistant-chat-BCWoP6Rf.js → assistant-chat-Bu2fFm_I.js} +206 -207
- package/dist/chunks/{bookmark-state-PjQpxbG7.js → bookmark-state-BFY9oNmr.js} +3 -3
- package/dist/chunks/{braces-D5Ucy7q1.js → braces-Da41xfUd.js} +1 -1
- package/dist/chunks/{comparison-window-caption-Dc7BaCMz.js → comparison-window-caption-4FNkMrzE.js} +213 -213
- package/dist/chunks/{context-DVy4HOU0.js → context-BgPDzLHZ.js} +1 -1
- package/dist/chunks/{custom-visual-inputs-B-DLRGrV.js → custom-visual-inputs-Dz-enUNR.js} +1 -1
- package/dist/chunks/{dashboard-wK6Bai4V.js → dashboard-_MeBuy67.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-Coqghdn6.js → dashboard-briefing-launcher-CEi4Pr_v.js} +1152 -1166
- package/dist/chunks/{dashboard-controls-BYWSM2RM.js → dashboard-controls-Bi7fyG-4.js} +98 -98
- package/dist/chunks/{dashboard-json-pPTB5gj0.js → dashboard-json-B1mU_OMa.js} +5 -5
- package/dist/chunks/{document-dashboard-inputs-PY_7Xm55.js → document-dashboard-inputs-CkWfDB8c.js} +64 -64
- package/dist/chunks/{edit-dashboard-visual-BODxuUeq.js → edit-dashboard-visual-0CJN31Y3.js} +8274 -8514
- package/dist/chunks/filter-reach-copy-BF4w4kI2.js +3738 -0
- package/dist/chunks/{filter-value-text-CUBpotVN.js → filter-value-text-CRC-K_l_.js} +3 -3
- package/dist/chunks/{global-date-filter-utils-BsFqnnbA.js → global-date-filter-utils-D8365uPH.js} +4088 -3416
- package/dist/chunks/{index-DP_wQl0v.js → index-DtHidOPV.js} +579 -604
- package/dist/chunks/{layout-grid-CkoXmv0L.js → layout-grid-BvsH4RY2.js} +1 -1
- package/dist/chunks/{list-filter-B4i25kuc.js → list-filter-Dg0otx5E.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-4GTUDheD.js → matrix-analytical-definition-CM18W8w6.js} +41 -41
- package/dist/chunks/{matrix-card-fS_4O7zA.js → matrix-card-HPskLaPy.js} +3 -3
- package/dist/chunks/{matrix-member-presentation-Dj7HaAHC.js → matrix-member-presentation-Bbrfrke4.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-CpgLZ7E5.js → matrix-operation-contract-WPv4R-H_.js} +130 -130
- package/dist/chunks/{metric-comparison-C8LY7GG5.js → metric-comparison-ljMKYZKa.js} +2 -2
- package/dist/chunks/{model-change-CJEj3ZD6.js → model-change-Ccn1zaxl.js} +1 -1
- package/dist/chunks/{palette-stlpjVk4.js → palette-Bsh376zO.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-DMk-mKhG.js → pivot-result-contract-expectations-Bl5suy4-.js} +602 -696
- package/dist/chunks/{pivot-result-identity-CrQ54Xbj.js → pivot-result-identity-vS9TSh4f.js} +1 -1
- package/dist/chunks/{raw-temporal-presentation-BI2z2LlB.js → raw-temporal-presentation-BHm7s-hz.js} +230 -274
- package/dist/chunks/{report-preferences-dialog-Dc-YyVwf.js → report-preferences-dialog-BV8L0SeS.js} +55 -55
- package/dist/chunks/{report-runtime-context-CohdtiMg.js → report-runtime-context-BZQh9ywy.js} +2 -2
- package/dist/chunks/{resolve-dashboard-input-context-BZYI1hB0.js → resolve-dashboard-input-context-CAMiWvyR.js} +2021 -2239
- package/dist/chunks/{save-C1dgxgAu.js → save-B5EAsgQF.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-CIBoMq46.js → saved-dashboard-context-n2Wn11cV.js} +57 -57
- package/dist/chunks/{selection-reducer-_d6aKJnj.js → selection-reducer-D0YnaAD9.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-ERTLU7B4.js → semaphor-ready-indicator-XLBLOJ2V.js} +38446 -39176
- package/dist/chunks/{shelf-drop-preview-context-fEnx6iL_.js → shelf-drop-preview-context-DHMa54a-.js} +570 -570
- package/dist/chunks/source-entity-resolution-dUG5VWRm.js +607 -0
- package/dist/chunks/{switch-BqUan2mN.js → switch-ByxH4M7t.js} +3 -3
- package/dist/chunks/{table-export-sheet-CTCTA_bd.js → table-export-sheet-C_GdeTYU.js} +1 -1
- package/dist/chunks/{table-settings-DF1gdVQR.js → table-settings-Imz0FgWi.js} +8 -8
- package/dist/chunks/{temporal-input-presentation-DoSniQj1.js → temporal-input-presentation-uvNK_tM0.js} +1109 -820
- package/dist/chunks/{token-types-DFyLflLY.js → token-types-CQtXUVMy.js} +1 -1
- package/dist/chunks/{upload-DcoyjkRV.js → upload-wbR-NVzq.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-xhb9YFg-.js → use-create-flow-overlay-state-CEBaLOKC.js} +6 -6
- package/dist/chunks/validators-CXTneCA4.js +3453 -0
- package/dist/chunks/{zoned-wall-clock-E35Frf9v.js → zoned-wall-clock-B1n_WjW3.js} +1 -1
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +2207 -1496
- package/dist/data-app-sdk/index.js +20 -20
- package/dist/data-app-sdk-adapters/index.js +3 -3
- package/dist/data-app-sdk-validation/index.js +6 -6
- package/dist/format-utils/index.js +181 -176
- package/dist/index.js +22 -22
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/editor/editor-aside/utils.d.ts +1 -1
- package/dist/types/components/visual/data-table/types/data-table.d.ts +5 -20
- package/dist/types/index.js +6 -6
- package/dist/types/lib/formatters/canonical-format-adapter.d.ts +2 -29
- package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +0 -2
- package/dist/types/lib/formatters/table-column-settings.d.ts +47 -0
- package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +10 -188
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +16 -372
- package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
- package/dist/types/lib/stores/editor-store.d.ts +39 -9
- package/dist/types/lib/stores/table-actions.d.ts +9 -3
- package/dist/types/lib/table-formatting/index.d.ts +0 -2
- package/dist/types/lib/table-formatting/table-conditional-formatting-range-source.d.ts +3 -2
- package/dist/types/lib/table-formatting/table-conditional-formatting-range.d.ts +3 -2
- package/dist/types/lib/table-formatting/table-formatting-normalize.d.ts +1 -2
- package/dist/types/lib/table-formatting/table-formatting-render-model.d.ts +9 -0
- package/dist/types/lib/table-formatting/table-formatting-types.d.ts +5 -95
- package/dist/types/lib/table-formatting/table-presentation-fields.d.ts +35 -0
- package/dist/types/lib/types/common-types.d.ts +40 -47
- package/dist/types/lib/types/explorer-types.d.ts +13 -44
- package/dist/types/lib/utils/card-config-utils.d.ts +9 -1
- package/dist/types/lib/utils/card-definition.d.ts +9 -187
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +159 -513
- package/dist/types/shared/analytics-protocol/contracts.d.ts +32 -9
- package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +108 -980
- package/dist/types/shared/analytics-protocol/field-validation.d.ts +1 -0
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +281 -4624
- package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +20 -20
- package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +18 -18
- package/dist/types/shared/analytics-protocol/matrix-path-contract.d.ts +40 -40
- package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +3 -203
- package/dist/types/shared/analytics-protocol/scalar-value.d.ts +8 -8
- package/dist/types/shared/analytics-protocol/source-capabilities.d.ts +21 -0
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -0
- package/dist/types/shared/assistant-protocol/context.d.ts +69 -69
- package/dist/types/shared/dashboard-authoring/canonical-result-keys.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +4 -1
- package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/card-formats/upgrade-card-formats.d.ts +57 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +24 -24
- package/dist/types/shared/dashboard-authoring/conditional-formatting/editable.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/evaluate.d.ts +16 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/index.d.ts +9 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/resolve-card-column-ref.d.ts +17 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/retain.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +4499 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/store.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/types.d.ts +151 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/upgrade.d.ts +35 -0
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +62 -62
- package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/legacy-table-routing.d.ts +4 -2
- package/dist/types/shared/dashboard-authoring/matrix-authoring.d.ts +4 -5
- package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +24 -736
- package/dist/types/shared/dashboard-authoring/retired-presentation-fields.d.ts +31 -0
- package/dist/types/shared/dashboard-authoring/upgrade-card-presentation.d.ts +14 -0
- package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +5 -1
- package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +16 -0
- package/dist/types/shared/format-utils/index.d.ts +2 -0
- package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +10 -366
- package/dist/types/shared/format-utils/raw-temporal.d.ts +15 -1
- package/dist/types/shared/format-utils/resolve-column-format.d.ts +43 -0
- package/dist/types/shared/format-utils/retired-format-adapters.d.ts +68 -0
- package/dist/types/shared/format-utils/semantic-format.d.ts +5 -1
- package/dist/types/shared/format-utils/stored-value-format.d.ts +16 -0
- package/dist/types/shared/format-utils/types/format-types.d.ts +10 -12
- package/package.json +1 -1
- package/dist/chunks/analytics-base-schemas-BUFUoO6G.js +0 -472
- package/dist/chunks/editor-draft-sync-BN5qYHPF.js +0 -15
- package/dist/chunks/filter-reach-copy-BvJH9JO-.js +0 -3411
- package/dist/chunks/source-entity-resolution-DXW1HpKf.js +0 -816
- package/dist/chunks/validators-hmfNNQz8.js +0 -3595
- package/dist/types/lib/table-formatting/table-conditional-formatting-evaluator.d.ts +0 -9
- package/dist/types/lib/table-formatting/table-formatting-validation.d.ts +0 -12
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TCard } from '../../lib/types/common-types.js';
|
|
2
|
+
export type RetiredPresentationField = {
|
|
3
|
+
/** Where the field is, e.g. `sheets[id=s1].frames[id=f1].cards[id=c1].preferences.formatNumber`. */
|
|
4
|
+
path: string;
|
|
5
|
+
/** The retired field's name, e.g. `formatNumber`. */
|
|
6
|
+
field: string;
|
|
7
|
+
/** What to write instead. */
|
|
8
|
+
replacement: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Whether a stored record holds a key, whatever its value (`null`, `{}` and
|
|
12
|
+
* `[]` included): what the save check refuses, and so what the upgrades must
|
|
13
|
+
* clear (column formats ledger P5-18).
|
|
14
|
+
*/
|
|
15
|
+
export declare function hasStoredKey(record: unknown, key: string): boolean;
|
|
16
|
+
/** Every retired presentation field on one card; `at` is the card's path. */
|
|
17
|
+
export declare function findRetiredCardPresentationFields(card: TCard, at: string): RetiredPresentationField[];
|
|
18
|
+
/** Every retired presentation field in a dashboard template or a library visual frame. */
|
|
19
|
+
export declare function findRetiredPresentationFields(template: unknown): RetiredPresentationField[];
|
|
20
|
+
export type PresentationStoreIssue = {
|
|
21
|
+
code: 'retired_presentation_field' | 'invalid_conditional_formatting';
|
|
22
|
+
path: string;
|
|
23
|
+
message: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* What the save check refuses in a dashboard template or a library visual
|
|
27
|
+
* frame (column formats CF-D8, conditional formatting store CR-D9): every
|
|
28
|
+
* retired presentation field, and a rule store whose shape is wrong or whose
|
|
29
|
+
* rules name a column the card doesn't have. Empty when the template saves.
|
|
30
|
+
*/
|
|
31
|
+
export declare function checkPresentationStores(template: unknown): PresentationStoreIssue[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TCard } from '../../lib/types/common-types.js';
|
|
2
|
+
import { UpgradeCardFormatsOptions, UpgradeCardFormatsResult } from './card-formats/upgrade-card-formats.js';
|
|
3
|
+
import { UpgradeConditionalFormattingResult } from './conditional-formatting/upgrade.js';
|
|
4
|
+
export type UpgradeCardPresentationOptions = UpgradeCardFormatsOptions & {
|
|
5
|
+
/** One part only; omitted, both. */
|
|
6
|
+
only?: 'formats' | 'rules';
|
|
7
|
+
};
|
|
8
|
+
export type UpgradeCardPresentationResult = {
|
|
9
|
+
/** The input card itself when nothing changed. */
|
|
10
|
+
card: TCard;
|
|
11
|
+
formats?: UpgradeCardFormatsResult;
|
|
12
|
+
rules?: UpgradeConditionalFormattingResult;
|
|
13
|
+
};
|
|
14
|
+
export declare function upgradeCardPresentation(card: TCard, options?: UpgradeCardPresentationOptions): UpgradeCardPresentationResult;
|
|
@@ -29,7 +29,11 @@ export declare function matrixLevelLabels(input: {
|
|
|
29
29
|
visible: boolean;
|
|
30
30
|
total: boolean;
|
|
31
31
|
}>;
|
|
32
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Shared viewer/export adapter: a Matrix measure's or level's format, its
|
|
34
|
+
* override, else its catalog (model) format, in the one precedence
|
|
35
|
+
* (`pickColumnFormat`). Arithmetic, precision and temporal rules stay shared.
|
|
36
|
+
*/
|
|
33
37
|
export declare function resolveMatrixValueFormat(override: SemaphorValueFormat | undefined, semantic: SemaphorValueFormat | undefined): import('../semantic-format.js').AdaptedCanonicalFormatSpec | undefined;
|
|
34
38
|
/** One card's prepared formats: every Matrix surface (screen, Layout CSV, Flat CSV, PDF) formats through it. */
|
|
35
39
|
export type MatrixFormatting = ReturnType<typeof prepareMatrixFormatting>;
|
|
@@ -20,6 +20,22 @@ export declare function formatPercent(value: NumericValue | null | undefined, op
|
|
|
20
20
|
* Format a number in scientific notation
|
|
21
21
|
*/
|
|
22
22
|
export declare function formatScientific(value: NumericValue | null | undefined, options?: NumberFormatOptions): string;
|
|
23
|
+
/**
|
|
24
|
+
* What `signDisplay` (column formats CF-D16) does to a value: `never` drops
|
|
25
|
+
* its sign, `always` and `exceptZero` put a plus before a positive one;
|
|
26
|
+
* absent means `auto`. The one sign rule for every number formatter.
|
|
27
|
+
*/
|
|
28
|
+
export declare function applySignDisplay(value: NumericValue, signDisplay: NumericCanonicalFormat['signDisplay']): {
|
|
29
|
+
value: NumericValue;
|
|
30
|
+
plus: boolean;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The format a change between two values shows with (a comparison's
|
|
34
|
+
* difference, a KPI's delta): its measure's, without the measure's
|
|
35
|
+
* `signDisplay`, which describes the values, not a change. The surface that
|
|
36
|
+
* shows the change puts its direction on it, once (column formats ledger P5-46).
|
|
37
|
+
*/
|
|
38
|
+
export declare function changeFormat<T extends object | undefined>(format: T): T;
|
|
23
39
|
export declare function formatNumericCanonical(value: number | ExactNumericValue | null | undefined, format: NumericCanonicalFormat): string;
|
|
24
40
|
/**
|
|
25
41
|
* Formats a table measure value with its resolved format: numeric styles go
|
|
@@ -25,6 +25,7 @@ export type * from './table-structure.js';
|
|
|
25
25
|
export * from './pdf-export-policy.js';
|
|
26
26
|
export * from './pdf-delivery.js';
|
|
27
27
|
export * from './numeric-presentation.js';
|
|
28
|
+
export { pickColumnFormat, resolveColumnFormat, withLiveModelFormats, type ColumnFormatSource, type FormatSurface, type ModelFormats, type ResolvedColumnFormat, } from './resolve-column-format.js';
|
|
28
29
|
export * from './presentation-execution.js';
|
|
29
30
|
export * from './temporal-bucket-format-policy.js';
|
|
30
31
|
export * from './temporal-bucket.js';
|
|
@@ -38,6 +39,7 @@ export { describeFilterValueInFullDetail, type FullDetailFilterValue, } from './
|
|
|
38
39
|
export { describeConditionInFullDetail, type FilterClauseText } from './filter-detail.js';
|
|
39
40
|
export { formatCanonicalComparisonRange } from '../../lib/utils/comparison-window-caption.js';
|
|
40
41
|
export { PDF_GROUP_CONTINUATION_CLASS } from './grouped-table-presentation.js';
|
|
42
|
+
export { toStoredValueFormat } from './stored-value-format.js';
|
|
41
43
|
export { SEMAPHOR_GENERATED_COUNT_METRIC_ID } from '../analytics-protocol/contracts.js';
|
|
42
44
|
export { resolveMetricResultAlias } from '../analytics-protocol/metric-comparison.js';
|
|
43
45
|
export * from './pivot-header-presentation.js';
|
|
@@ -133,186 +133,8 @@ export declare function buildMatrixPrintTable(input: {
|
|
|
133
133
|
};
|
|
134
134
|
levelLabels: Readonly<Record<string, string>>;
|
|
135
135
|
measureLabels: Readonly<Record<string, string>>;
|
|
136
|
-
levelFormats: Readonly<Record<string, import('../analytics-protocol/index.js').
|
|
137
|
-
|
|
138
|
-
pattern?: string | undefined;
|
|
139
|
-
locale?: string | undefined;
|
|
140
|
-
prefix?: string | undefined;
|
|
141
|
-
suffix?: string | undefined;
|
|
142
|
-
relative?: boolean | undefined;
|
|
143
|
-
timezone?: string | undefined;
|
|
144
|
-
sourceTimezone?: string | undefined;
|
|
145
|
-
} | {
|
|
146
|
-
type: "duration";
|
|
147
|
-
prefix?: string | undefined;
|
|
148
|
-
suffix?: string | undefined;
|
|
149
|
-
negativeStyle?: "minus" | "parentheses" | undefined;
|
|
150
|
-
inputUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
|
|
151
|
-
outputStyle?: "compact" | "digital" | "long" | undefined;
|
|
152
|
-
largestUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
|
|
153
|
-
smallestUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
|
|
154
|
-
maxUnits?: number | undefined;
|
|
155
|
-
} | {
|
|
156
|
-
type: "string";
|
|
157
|
-
prefix?: string | undefined;
|
|
158
|
-
suffix?: string | undefined;
|
|
159
|
-
} | {
|
|
160
|
-
type: "number" | "currency" | "percent" | "percentage" | "scientific";
|
|
161
|
-
currency?: string | undefined;
|
|
162
|
-
minimumFractionDigits?: number | undefined;
|
|
163
|
-
maximumFractionDigits?: number | undefined;
|
|
164
|
-
useGrouping?: boolean | undefined;
|
|
165
|
-
prefix?: string | undefined;
|
|
166
|
-
suffix?: string | undefined;
|
|
167
|
-
negativeStyle?: "minus" | "parentheses" | undefined;
|
|
168
|
-
compact?: boolean | undefined;
|
|
169
|
-
scale?: number | undefined;
|
|
170
|
-
percentValueMode?: "fraction" | "whole" | undefined;
|
|
171
|
-
}>>;
|
|
172
|
-
measureFormats: Readonly<Record<string, import('../analytics-protocol/index.js').TemporalBucketFormat | {
|
|
173
|
-
type: "date" | "datetime";
|
|
174
|
-
pattern?: string | undefined;
|
|
175
|
-
locale?: string | undefined;
|
|
176
|
-
prefix?: string | undefined;
|
|
177
|
-
suffix?: string | undefined;
|
|
178
|
-
relative?: boolean | undefined;
|
|
179
|
-
timezone?: string | undefined;
|
|
180
|
-
sourceTimezone?: string | undefined;
|
|
181
|
-
} | {
|
|
182
|
-
type: "duration";
|
|
183
|
-
prefix?: string | undefined;
|
|
184
|
-
suffix?: string | undefined;
|
|
185
|
-
negativeStyle?: "minus" | "parentheses" | undefined;
|
|
186
|
-
inputUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
|
|
187
|
-
outputStyle?: "compact" | "digital" | "long" | undefined;
|
|
188
|
-
largestUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
|
|
189
|
-
smallestUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
|
|
190
|
-
maxUnits?: number | undefined;
|
|
191
|
-
} | {
|
|
192
|
-
type: "string";
|
|
193
|
-
prefix?: string | undefined;
|
|
194
|
-
suffix?: string | undefined;
|
|
195
|
-
} | {
|
|
196
|
-
type: "number" | "currency" | "percent" | "percentage" | "scientific";
|
|
197
|
-
currency?: string | undefined;
|
|
198
|
-
minimumFractionDigits?: number | undefined;
|
|
199
|
-
maximumFractionDigits?: number | undefined;
|
|
200
|
-
useGrouping?: boolean | undefined;
|
|
201
|
-
prefix?: string | undefined;
|
|
202
|
-
suffix?: string | undefined;
|
|
203
|
-
negativeStyle?: "minus" | "parentheses" | undefined;
|
|
204
|
-
compact?: boolean | undefined;
|
|
205
|
-
scale?: number | undefined;
|
|
206
|
-
percentValueMode?: "fraction" | "whole" | undefined;
|
|
207
|
-
}>>;
|
|
208
|
-
conditionalFormatting?: {
|
|
209
|
-
version: 1;
|
|
210
|
-
rules: {
|
|
211
|
-
id: string;
|
|
212
|
-
target: {
|
|
213
|
-
level: "row" | "cell";
|
|
214
|
-
matrix?: {
|
|
215
|
-
axis: "columns" | "rows";
|
|
216
|
-
levelId?: string | undefined;
|
|
217
|
-
oppositePath?: {
|
|
218
|
-
member: {
|
|
219
|
-
value: string | number | boolean | {
|
|
220
|
-
value: string;
|
|
221
|
-
type: "integer" | "decimal";
|
|
222
|
-
kind: "exact_number";
|
|
223
|
-
} | null;
|
|
224
|
-
kind: "value";
|
|
225
|
-
} | {
|
|
226
|
-
kind: "others";
|
|
227
|
-
rankingId: string;
|
|
228
|
-
};
|
|
229
|
-
levelId: string;
|
|
230
|
-
}[] | undefined;
|
|
231
|
-
} | undefined;
|
|
232
|
-
columnIds?: string[] | undefined;
|
|
233
|
-
conditionColumnId?: string | undefined;
|
|
234
|
-
applyToColumnIds?: string[] | undefined;
|
|
235
|
-
tableParts?: ("subtotal" | "body" | "header" | "footer" | "grandTotal")[] | undefined;
|
|
236
|
-
rowRoles?: ("member" | "subtotal" | "grand_total" | "others")[] | undefined;
|
|
237
|
-
depth?: number | undefined;
|
|
238
|
-
includeTotals?: boolean | undefined;
|
|
239
|
-
includeSubtotals?: boolean | undefined;
|
|
240
|
-
};
|
|
241
|
-
condition: {
|
|
242
|
-
value: string | number | boolean | {
|
|
243
|
-
value: string;
|
|
244
|
-
type: "integer" | "decimal";
|
|
245
|
-
kind: "exact_number";
|
|
246
|
-
} | null;
|
|
247
|
-
kind: "comparison";
|
|
248
|
-
operator: "eq" | "neq" | "gt" | "gte" | "lt" | "lte";
|
|
249
|
-
columnId: string;
|
|
250
|
-
} | {
|
|
251
|
-
kind: "between";
|
|
252
|
-
columnId: string;
|
|
253
|
-
min: string | number | boolean | {
|
|
254
|
-
value: string;
|
|
255
|
-
type: "integer" | "decimal";
|
|
256
|
-
kind: "exact_number";
|
|
257
|
-
} | null;
|
|
258
|
-
max: string | number | boolean | {
|
|
259
|
-
value: string;
|
|
260
|
-
type: "integer" | "decimal";
|
|
261
|
-
kind: "exact_number";
|
|
262
|
-
} | null;
|
|
263
|
-
inclusive?: boolean | undefined;
|
|
264
|
-
} | {
|
|
265
|
-
kind: "blank";
|
|
266
|
-
columnId: string;
|
|
267
|
-
isBlank: boolean;
|
|
268
|
-
} | {
|
|
269
|
-
value: string;
|
|
270
|
-
kind: "contains";
|
|
271
|
-
columnId: string;
|
|
272
|
-
exact?: boolean | undefined;
|
|
273
|
-
caseSensitive?: boolean | undefined;
|
|
274
|
-
} | {
|
|
275
|
-
kind: "topBottom";
|
|
276
|
-
count: number;
|
|
277
|
-
columnId: string;
|
|
278
|
-
direction: "top" | "bottom";
|
|
279
|
-
} | {
|
|
280
|
-
kind: "colorScale";
|
|
281
|
-
columnId: string;
|
|
282
|
-
range: "auto" | "manual";
|
|
283
|
-
colors: {
|
|
284
|
-
min: string;
|
|
285
|
-
max: string;
|
|
286
|
-
mid?: string | undefined;
|
|
287
|
-
};
|
|
288
|
-
min?: number | undefined;
|
|
289
|
-
max?: number | undefined;
|
|
290
|
-
mid?: number | undefined;
|
|
291
|
-
} | {
|
|
292
|
-
kind: "dataBar";
|
|
293
|
-
columnId: string;
|
|
294
|
-
range: "auto" | "manual";
|
|
295
|
-
color: string;
|
|
296
|
-
min?: number | undefined;
|
|
297
|
-
max?: number | undefined;
|
|
298
|
-
showValue?: boolean | undefined;
|
|
299
|
-
};
|
|
300
|
-
name?: string | undefined;
|
|
301
|
-
enabled?: boolean | undefined;
|
|
302
|
-
style?: {
|
|
303
|
-
dataBar?: {
|
|
304
|
-
color: string;
|
|
305
|
-
showValue: boolean;
|
|
306
|
-
} | undefined;
|
|
307
|
-
backgroundColor?: string | undefined;
|
|
308
|
-
textColor?: string | undefined;
|
|
309
|
-
fontWeight?: "normal" | "medium" | "semibold" | "bold" | undefined;
|
|
310
|
-
italic?: boolean | undefined;
|
|
311
|
-
textDecoration?: "none" | "underline" | "line-through" | undefined;
|
|
312
|
-
icon?: "arrowUp" | "arrowDown" | "warning" | "check" | "x" | undefined;
|
|
313
|
-
} | undefined;
|
|
314
|
-
}[];
|
|
315
|
-
} | undefined;
|
|
136
|
+
levelFormats: Readonly<Record<string, import('../analytics-protocol/index.js').SemaphorValueFormat>>;
|
|
137
|
+
measureFormats: Readonly<Record<string, import('../analytics-protocol/index.js').SemaphorValueFormat>>;
|
|
316
138
|
};
|
|
317
139
|
mode: "layout";
|
|
318
140
|
format: "csv" | "xlsx" | "pdf";
|
|
@@ -328,11 +150,11 @@ export declare function buildMatrixPrintTable(input: {
|
|
|
328
150
|
kind: "physical";
|
|
329
151
|
connectionId: string;
|
|
330
152
|
tableName: string;
|
|
153
|
+
dialect?: "postgres" | "mysql" | "mssql" | "snowflake" | "clickhouse" | "bigquery" | "redshift" | "duckdb" | "sqlite" | "unknown" | undefined;
|
|
331
154
|
label?: string | undefined;
|
|
332
155
|
connectionType?: string | undefined;
|
|
333
156
|
databaseName?: string | undefined;
|
|
334
157
|
schemaName?: string | undefined;
|
|
335
|
-
dialect?: "postgres" | "mysql" | "mssql" | "snowflake" | "clickhouse" | "bigquery" | "redshift" | "duckdb" | "sqlite" | "unknown" | undefined;
|
|
336
158
|
};
|
|
337
159
|
columns: readonly import('../analytics-protocol/index.js').MatrixLevel[];
|
|
338
160
|
measures: readonly ({
|
|
@@ -374,8 +196,8 @@ export declare function buildMatrixPrintTable(input: {
|
|
|
374
196
|
parent: readonly {
|
|
375
197
|
member: {
|
|
376
198
|
value: string | number | boolean | {
|
|
377
|
-
value: string;
|
|
378
199
|
type: "integer" | "decimal";
|
|
200
|
+
value: string;
|
|
379
201
|
kind: "exact_number";
|
|
380
202
|
} | null;
|
|
381
203
|
kind: "value";
|
|
@@ -407,8 +229,8 @@ export declare function buildMatrixPrintTable(input: {
|
|
|
407
229
|
path: readonly {
|
|
408
230
|
member: {
|
|
409
231
|
value: string | number | boolean | {
|
|
410
|
-
value: string;
|
|
411
232
|
type: "integer" | "decimal";
|
|
233
|
+
value: string;
|
|
412
234
|
kind: "exact_number";
|
|
413
235
|
} | null;
|
|
414
236
|
kind: "value";
|
|
@@ -427,8 +249,8 @@ export declare function buildMatrixPrintTable(input: {
|
|
|
427
249
|
path: readonly {
|
|
428
250
|
member: {
|
|
429
251
|
value: string | number | boolean | {
|
|
430
|
-
value: string;
|
|
431
252
|
type: "integer" | "decimal";
|
|
253
|
+
value: string;
|
|
432
254
|
kind: "exact_number";
|
|
433
255
|
} | null;
|
|
434
256
|
kind: "value";
|
|
@@ -486,186 +308,8 @@ export declare function buildMatrixPrintTable(input: {
|
|
|
486
308
|
};
|
|
487
309
|
levelLabels: Readonly<Record<string, string>>;
|
|
488
310
|
measureLabels: Readonly<Record<string, string>>;
|
|
489
|
-
levelFormats: Readonly<Record<string, import('../analytics-protocol/index.js').
|
|
490
|
-
|
|
491
|
-
pattern?: string | undefined;
|
|
492
|
-
locale?: string | undefined;
|
|
493
|
-
prefix?: string | undefined;
|
|
494
|
-
suffix?: string | undefined;
|
|
495
|
-
relative?: boolean | undefined;
|
|
496
|
-
timezone?: string | undefined;
|
|
497
|
-
sourceTimezone?: string | undefined;
|
|
498
|
-
} | {
|
|
499
|
-
type: "duration";
|
|
500
|
-
prefix?: string | undefined;
|
|
501
|
-
suffix?: string | undefined;
|
|
502
|
-
negativeStyle?: "minus" | "parentheses" | undefined;
|
|
503
|
-
inputUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
|
|
504
|
-
outputStyle?: "compact" | "digital" | "long" | undefined;
|
|
505
|
-
largestUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
|
|
506
|
-
smallestUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
|
|
507
|
-
maxUnits?: number | undefined;
|
|
508
|
-
} | {
|
|
509
|
-
type: "string";
|
|
510
|
-
prefix?: string | undefined;
|
|
511
|
-
suffix?: string | undefined;
|
|
512
|
-
} | {
|
|
513
|
-
type: "number" | "currency" | "percent" | "percentage" | "scientific";
|
|
514
|
-
currency?: string | undefined;
|
|
515
|
-
minimumFractionDigits?: number | undefined;
|
|
516
|
-
maximumFractionDigits?: number | undefined;
|
|
517
|
-
useGrouping?: boolean | undefined;
|
|
518
|
-
prefix?: string | undefined;
|
|
519
|
-
suffix?: string | undefined;
|
|
520
|
-
negativeStyle?: "minus" | "parentheses" | undefined;
|
|
521
|
-
compact?: boolean | undefined;
|
|
522
|
-
scale?: number | undefined;
|
|
523
|
-
percentValueMode?: "fraction" | "whole" | undefined;
|
|
524
|
-
}>>;
|
|
525
|
-
measureFormats: Readonly<Record<string, import('../analytics-protocol/index.js').TemporalBucketFormat | {
|
|
526
|
-
type: "date" | "datetime";
|
|
527
|
-
pattern?: string | undefined;
|
|
528
|
-
locale?: string | undefined;
|
|
529
|
-
prefix?: string | undefined;
|
|
530
|
-
suffix?: string | undefined;
|
|
531
|
-
relative?: boolean | undefined;
|
|
532
|
-
timezone?: string | undefined;
|
|
533
|
-
sourceTimezone?: string | undefined;
|
|
534
|
-
} | {
|
|
535
|
-
type: "duration";
|
|
536
|
-
prefix?: string | undefined;
|
|
537
|
-
suffix?: string | undefined;
|
|
538
|
-
negativeStyle?: "minus" | "parentheses" | undefined;
|
|
539
|
-
inputUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
|
|
540
|
-
outputStyle?: "compact" | "digital" | "long" | undefined;
|
|
541
|
-
largestUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
|
|
542
|
-
smallestUnit?: "second" | "minute" | "hour" | "day" | "millisecond" | undefined;
|
|
543
|
-
maxUnits?: number | undefined;
|
|
544
|
-
} | {
|
|
545
|
-
type: "string";
|
|
546
|
-
prefix?: string | undefined;
|
|
547
|
-
suffix?: string | undefined;
|
|
548
|
-
} | {
|
|
549
|
-
type: "number" | "currency" | "percent" | "percentage" | "scientific";
|
|
550
|
-
currency?: string | undefined;
|
|
551
|
-
minimumFractionDigits?: number | undefined;
|
|
552
|
-
maximumFractionDigits?: number | undefined;
|
|
553
|
-
useGrouping?: boolean | undefined;
|
|
554
|
-
prefix?: string | undefined;
|
|
555
|
-
suffix?: string | undefined;
|
|
556
|
-
negativeStyle?: "minus" | "parentheses" | undefined;
|
|
557
|
-
compact?: boolean | undefined;
|
|
558
|
-
scale?: number | undefined;
|
|
559
|
-
percentValueMode?: "fraction" | "whole" | undefined;
|
|
560
|
-
}>>;
|
|
561
|
-
conditionalFormatting?: {
|
|
562
|
-
version: 1;
|
|
563
|
-
rules: {
|
|
564
|
-
id: string;
|
|
565
|
-
target: {
|
|
566
|
-
level: "row" | "cell";
|
|
567
|
-
matrix?: {
|
|
568
|
-
axis: "columns" | "rows";
|
|
569
|
-
levelId?: string | undefined;
|
|
570
|
-
oppositePath?: {
|
|
571
|
-
member: {
|
|
572
|
-
value: string | number | boolean | {
|
|
573
|
-
value: string;
|
|
574
|
-
type: "integer" | "decimal";
|
|
575
|
-
kind: "exact_number";
|
|
576
|
-
} | null;
|
|
577
|
-
kind: "value";
|
|
578
|
-
} | {
|
|
579
|
-
kind: "others";
|
|
580
|
-
rankingId: string;
|
|
581
|
-
};
|
|
582
|
-
levelId: string;
|
|
583
|
-
}[] | undefined;
|
|
584
|
-
} | undefined;
|
|
585
|
-
columnIds?: string[] | undefined;
|
|
586
|
-
conditionColumnId?: string | undefined;
|
|
587
|
-
applyToColumnIds?: string[] | undefined;
|
|
588
|
-
tableParts?: ("subtotal" | "body" | "header" | "footer" | "grandTotal")[] | undefined;
|
|
589
|
-
rowRoles?: ("member" | "subtotal" | "grand_total" | "others")[] | undefined;
|
|
590
|
-
depth?: number | undefined;
|
|
591
|
-
includeTotals?: boolean | undefined;
|
|
592
|
-
includeSubtotals?: boolean | undefined;
|
|
593
|
-
};
|
|
594
|
-
condition: {
|
|
595
|
-
value: string | number | boolean | {
|
|
596
|
-
value: string;
|
|
597
|
-
type: "integer" | "decimal";
|
|
598
|
-
kind: "exact_number";
|
|
599
|
-
} | null;
|
|
600
|
-
kind: "comparison";
|
|
601
|
-
operator: "eq" | "neq" | "gt" | "gte" | "lt" | "lte";
|
|
602
|
-
columnId: string;
|
|
603
|
-
} | {
|
|
604
|
-
kind: "between";
|
|
605
|
-
columnId: string;
|
|
606
|
-
min: string | number | boolean | {
|
|
607
|
-
value: string;
|
|
608
|
-
type: "integer" | "decimal";
|
|
609
|
-
kind: "exact_number";
|
|
610
|
-
} | null;
|
|
611
|
-
max: string | number | boolean | {
|
|
612
|
-
value: string;
|
|
613
|
-
type: "integer" | "decimal";
|
|
614
|
-
kind: "exact_number";
|
|
615
|
-
} | null;
|
|
616
|
-
inclusive?: boolean | undefined;
|
|
617
|
-
} | {
|
|
618
|
-
kind: "blank";
|
|
619
|
-
columnId: string;
|
|
620
|
-
isBlank: boolean;
|
|
621
|
-
} | {
|
|
622
|
-
value: string;
|
|
623
|
-
kind: "contains";
|
|
624
|
-
columnId: string;
|
|
625
|
-
exact?: boolean | undefined;
|
|
626
|
-
caseSensitive?: boolean | undefined;
|
|
627
|
-
} | {
|
|
628
|
-
kind: "topBottom";
|
|
629
|
-
count: number;
|
|
630
|
-
columnId: string;
|
|
631
|
-
direction: "top" | "bottom";
|
|
632
|
-
} | {
|
|
633
|
-
kind: "colorScale";
|
|
634
|
-
columnId: string;
|
|
635
|
-
range: "auto" | "manual";
|
|
636
|
-
colors: {
|
|
637
|
-
min: string;
|
|
638
|
-
max: string;
|
|
639
|
-
mid?: string | undefined;
|
|
640
|
-
};
|
|
641
|
-
min?: number | undefined;
|
|
642
|
-
max?: number | undefined;
|
|
643
|
-
mid?: number | undefined;
|
|
644
|
-
} | {
|
|
645
|
-
kind: "dataBar";
|
|
646
|
-
columnId: string;
|
|
647
|
-
range: "auto" | "manual";
|
|
648
|
-
color: string;
|
|
649
|
-
min?: number | undefined;
|
|
650
|
-
max?: number | undefined;
|
|
651
|
-
showValue?: boolean | undefined;
|
|
652
|
-
};
|
|
653
|
-
name?: string | undefined;
|
|
654
|
-
enabled?: boolean | undefined;
|
|
655
|
-
style?: {
|
|
656
|
-
dataBar?: {
|
|
657
|
-
color: string;
|
|
658
|
-
showValue: boolean;
|
|
659
|
-
} | undefined;
|
|
660
|
-
backgroundColor?: string | undefined;
|
|
661
|
-
textColor?: string | undefined;
|
|
662
|
-
fontWeight?: "normal" | "medium" | "semibold" | "bold" | undefined;
|
|
663
|
-
italic?: boolean | undefined;
|
|
664
|
-
textDecoration?: "none" | "underline" | "line-through" | undefined;
|
|
665
|
-
icon?: "arrowUp" | "arrowDown" | "warning" | "check" | "x" | undefined;
|
|
666
|
-
} | undefined;
|
|
667
|
-
}[];
|
|
668
|
-
} | undefined;
|
|
311
|
+
levelFormats: Readonly<Record<string, import('../analytics-protocol/index.js').SemaphorValueFormat>>;
|
|
312
|
+
measureFormats: Readonly<Record<string, import('../analytics-protocol/index.js').SemaphorValueFormat>>;
|
|
669
313
|
};
|
|
670
314
|
mode: "flat";
|
|
671
315
|
format: "csv" | "xlsx";
|
|
@@ -681,11 +325,11 @@ export declare function buildMatrixPrintTable(input: {
|
|
|
681
325
|
kind: "physical";
|
|
682
326
|
connectionId: string;
|
|
683
327
|
tableName: string;
|
|
328
|
+
dialect?: "postgres" | "mysql" | "mssql" | "snowflake" | "clickhouse" | "bigquery" | "redshift" | "duckdb" | "sqlite" | "unknown" | undefined;
|
|
684
329
|
label?: string | undefined;
|
|
685
330
|
connectionType?: string | undefined;
|
|
686
331
|
databaseName?: string | undefined;
|
|
687
332
|
schemaName?: string | undefined;
|
|
688
|
-
dialect?: "postgres" | "mysql" | "mssql" | "snowflake" | "clickhouse" | "bigquery" | "redshift" | "duckdb" | "sqlite" | "unknown" | undefined;
|
|
689
333
|
};
|
|
690
334
|
columns: readonly import('../analytics-protocol/index.js').MatrixLevel[];
|
|
691
335
|
measures: readonly ({
|
|
@@ -727,8 +371,8 @@ export declare function buildMatrixPrintTable(input: {
|
|
|
727
371
|
parent: readonly {
|
|
728
372
|
member: {
|
|
729
373
|
value: string | number | boolean | {
|
|
730
|
-
value: string;
|
|
731
374
|
type: "integer" | "decimal";
|
|
375
|
+
value: string;
|
|
732
376
|
kind: "exact_number";
|
|
733
377
|
} | null;
|
|
734
378
|
kind: "value";
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
import { ExportWallClock } from './exporters/export-cells.js';
|
|
2
2
|
import { CalendarContext } from '../report-runtime-context/report-runtime-context.js';
|
|
3
|
-
import { RawTemporalValueKind, RawTemporalValueMetadata } from '../analytics-protocol/contracts.js';
|
|
3
|
+
import { RawDatePreset, RawTemporalValueKind, RawTemporalValueMetadata } from '../analytics-protocol/contracts.js';
|
|
4
4
|
import { parseRawTemporalValueMetadata, validateRawTemporalResultColumn } from '../analytics-protocol/raw-temporal-contract.js';
|
|
5
5
|
import { LocaleStyle, ResolvedValueFormatPreferences } from '../value-format-preferences/index.js';
|
|
6
6
|
import { RawTemporalFormat, RawTemporalPatternDialect } from './types/format-types.js';
|
|
7
7
|
export type { RawTemporalFormat, RawTemporalPatternDialect };
|
|
8
|
+
/**
|
|
9
|
+
* A stored raw date format's presentation (column formats CF-D4, CF-D16): its
|
|
10
|
+
* preset, its pattern in its dialect (unnamed means Semaphor tokens), else
|
|
11
|
+
* automatic. The one mapping for every raw date reader: detail columns and
|
|
12
|
+
* Matrix levels (ledger P5-44).
|
|
13
|
+
*/
|
|
14
|
+
export declare function storedRawDatePresentation(format: {
|
|
15
|
+
pattern?: string;
|
|
16
|
+
dialect?: RawTemporalPatternDialect;
|
|
17
|
+
preset?: RawDatePreset;
|
|
18
|
+
}): RawTemporalFormat['presentation'];
|
|
8
19
|
export { parseRawTemporalValueMetadata, validateRawTemporalResultColumn, type RawTemporalValueKind, type RawTemporalValueMetadata, };
|
|
9
20
|
export type ResolvedTemporalStyleSet = {
|
|
10
21
|
dateStyle: LocaleStyle;
|
|
@@ -26,6 +37,9 @@ export type ResolvedRawTemporalFormat = {
|
|
|
26
37
|
mode: 'pattern';
|
|
27
38
|
dialect: RawTemporalPatternDialect;
|
|
28
39
|
pattern: string;
|
|
40
|
+
} | {
|
|
41
|
+
mode: 'preset';
|
|
42
|
+
preset: RawDatePreset;
|
|
29
43
|
};
|
|
30
44
|
};
|
|
31
45
|
export type RawTemporalFormatResult = {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { TCard } from '../../lib/types/common-types.js';
|
|
2
|
+
import { Field } from '../../lib/types/explorer-types.js';
|
|
3
|
+
import { SemaphorValueFormat } from '../analytics-protocol/contracts.js';
|
|
4
|
+
import { CardColumnRef } from '../dashboard-authoring/conditional-formatting/types.js';
|
|
5
|
+
/** Where a format shows. Only chart surfaces have a `valueFormat` of their own. */
|
|
6
|
+
export type FormatSurface = 'tableCell' | 'tableTotal' | 'kpiValue' | 'kpiDelta' | 'valueAxis' | 'tooltip' | 'dataLabel' | 'pieLabel' | 'export';
|
|
7
|
+
export type ColumnFormatSource = 'surface' | 'override' | 'model' | 'snapshot' | 'automatic';
|
|
8
|
+
export type ResolvedColumnFormat = {
|
|
9
|
+
/** The stored format to present; absent when the source is `automatic`. */
|
|
10
|
+
format?: SemaphorValueFormat;
|
|
11
|
+
source: ColumnFormatSource;
|
|
12
|
+
};
|
|
13
|
+
/** Live model formats by card field id, as the query response carries them (CF-D23). */
|
|
14
|
+
export type ModelFormats = Readonly<Record<string, SemaphorValueFormat>>;
|
|
15
|
+
type FormatCard = Pick<TCard, 'config' | 'preferences'>;
|
|
16
|
+
/** A card column by id, from every list a format can sit on. */
|
|
17
|
+
export declare function findCardColumn(card: FormatCard, fieldId: string): Field | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The one precedence (CF-D5), over the formats a caller found for a column:
|
|
20
|
+
* the surface's own, the card's override, the live model format, a snapshot;
|
|
21
|
+
* else automatic. `resolveColumnFormat` finds them on a card; the Matrix
|
|
22
|
+
* formatter, which holds a presentation and a catalog rather than a card,
|
|
23
|
+
* passes its own.
|
|
24
|
+
*/
|
|
25
|
+
export declare function pickColumnFormat(candidates: {
|
|
26
|
+
surface?: SemaphorValueFormat;
|
|
27
|
+
override?: SemaphorValueFormat;
|
|
28
|
+
model?: SemaphorValueFormat;
|
|
29
|
+
snapshot?: SemaphorValueFormat;
|
|
30
|
+
}): ResolvedColumnFormat;
|
|
31
|
+
export declare function resolveColumnFormat(input: {
|
|
32
|
+
card: FormatCard;
|
|
33
|
+
column: CardColumnRef;
|
|
34
|
+
/** Where it shows; absent when only the column's own format is asked for. */
|
|
35
|
+
surface?: FormatSurface;
|
|
36
|
+
modelFormats?: ModelFormats;
|
|
37
|
+
/** A Matrix measure's or level's catalog format, its model format. */
|
|
38
|
+
catalogFormat?: SemaphorValueFormat;
|
|
39
|
+
}): ResolvedColumnFormat;
|
|
40
|
+
export declare function withLiveModelFormats<T extends NonNullable<TCard['config']>>(config: T | undefined, result: {
|
|
41
|
+
modelFormats?: ModelFormats;
|
|
42
|
+
} | undefined): T | undefined;
|
|
43
|
+
export {};
|