@agile-team/mach-report 2.16.0 → 2.18.0
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/README.md +25 -12
- package/dist/{ExcelBindingWizard-CP6h2x1f.cjs → ExcelBindingWizard-Czn3C2yE.cjs} +1 -1
- package/dist/{ExcelBindingWizard-HhB3hAJE.js → ExcelBindingWizard-DMGZj6I6.js} +3 -3
- package/dist/ParamEditor-KzDQvbHY.js +732 -0
- package/dist/ParamEditor-oDfD8LgE.cjs +1 -0
- package/dist/{ReportBatchPanel-ruxcbfY6.js → ReportBatchPanel-BJK7PvZ4.js} +39 -39
- package/dist/ReportBatchPanel-DnmNRssu.cjs +1 -0
- package/dist/ReportParamPanel-mQkeN70Q.js +1020 -0
- package/dist/ReportParamPanel-sOANVRz-.cjs +1 -0
- package/dist/ReportPreview-BxWWTUL5.js +5583 -0
- package/dist/ReportPreview-Yf99omi3.cjs +6 -0
- package/dist/{ReportTemplateLibrary-DcwrH-63.js → ReportTemplateLibrary-BFjB08Wu.js} +1 -1
- package/dist/{ReportTemplateLibrary-BDlNT8JN.cjs → ReportTemplateLibrary-BO42QnWd.cjs} +1 -1
- package/dist/RuleEditor-CqxT1a-W.js +2337 -0
- package/dist/RuleEditor-D7YWigD9.cjs +1 -0
- package/dist/{TemplateOutlinePanel-CGrT5DFN.cjs → TemplateOutlinePanel-B0XX350V.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-SXCjaPKR.js → TemplateOutlinePanel-zG0DrsIB.js} +2 -2
- package/dist/{TemplateReusePanel-6Z3wRFz8.cjs → TemplateReusePanel-BD0HSKp_.cjs} +1 -1
- package/dist/{TemplateReusePanel-lHLOS9Wn.js → TemplateReusePanel-Czwe5GbC.js} +2 -2
- package/dist/{TemplateReviewPanel-Dpk7sLcF.cjs → TemplateReviewPanel-CA5sdffM.cjs} +1 -1
- package/dist/{TemplateReviewPanel-CJ9PLc48.js → TemplateReviewPanel-NhmQI65C.js} +2 -2
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.d.cts +163 -42
- package/dist/analytics.d.ts +163 -42
- package/dist/analytics.js +76 -141
- package/dist/artifact-integrity.json +110 -108
- package/dist/assets-2eC3mOcV.js +232 -0
- package/dist/assets-B0Hxn4l6.cjs +1 -0
- package/dist/{auto-uVBjX1j5.cjs → auto-B0EZFIK1.cjs} +1 -1
- package/dist/{auto-YR7a4BtF.js → auto-BlchZ1b8.js} +10 -10
- package/dist/{batch-WzDIXJAt.js → batch-DGCt44XM.js} +1 -1
- package/dist/{batch-z6Aw5GEY.cjs → batch-DYcokH4v.cjs} +1 -1
- package/dist/charts-Dlv8j2AG.js +141 -0
- package/dist/charts-aCtoswXq.cjs +1 -0
- package/dist/codes.cjs +9 -9
- package/dist/codes.d.cts +54 -0
- package/dist/codes.d.ts +54 -0
- package/dist/codes.js +12097 -13668
- package/dist/column-visual-BpgQVWwT.js +238 -0
- package/dist/column-visual-CtYxnBCP.cjs +1 -0
- package/dist/component-tree-6TV7W6Yj.cjs +1 -0
- package/dist/component-tree-CvW4lzpv.js +67 -0
- package/dist/computed-4TnxzgIh.cjs +1 -0
- package/dist/computed-C8NRZQss.js +739 -0
- package/dist/data-bar-Ce38juRZ.cjs +1 -0
- package/dist/data-bar-PtjXhMgN.js +9 -0
- package/dist/dataset-DL83majE.js +161 -0
- package/dist/dataset-IrlXbUvh.cjs +1 -0
- package/dist/designer--TKECSEc.cjs +2 -0
- package/dist/designer-d6hJS41w.js +5683 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +835 -45
- package/dist/designer.d.ts +835 -45
- package/dist/designer.js +23 -20
- package/dist/{encoding-BYF9ZTl9.cjs → encoding-B--eZpp1.cjs} +1 -1
- package/dist/{encoding-BOGq4qYL.js → encoding-mctOLocI.js} +2 -2
- package/dist/{font-loader-EKLzOJxf.cjs → font-loader-DBBJ5KE9.cjs} +1 -1
- package/dist/{font-loader-CzI1GuBc.js → font-loader-DW8tIaNp.js} +1 -1
- package/dist/index-CPh6tqge.js +1575 -0
- package/dist/index-CUNw7dL9.cjs +1 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +534 -16
- package/dist/index.d.ts +534 -16
- package/dist/index.js +1393 -955
- package/dist/json-snapshot-By4ZVVUt.js +1967 -0
- package/dist/json-snapshot-jiXff4lc.cjs +2 -0
- package/dist/matrix-0hywp0-F.cjs +1 -0
- package/dist/matrix-Dy-tyY7E.js +381 -0
- package/dist/param-validation-C-8sRJLq.cjs +1 -0
- package/dist/param-validation-CnDEd2l-.js +333 -0
- package/dist/{pdf-DJ5S6ukC.js → pdf-CKROKygt.js} +1845 -1845
- package/dist/{pdf-ByVCb1i6.cjs → pdf-DqyxJ96U.cjs} +47 -47
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.d.cts +66 -0
- package/dist/pdf.d.ts +66 -0
- package/dist/pdf.js +2 -2
- package/dist/{plugin-C2j5_mhx.js → plugin-ByjF2kiV.js} +5 -5
- package/dist/{plugin-Dr39GBRG.cjs → plugin-DM1M2wlI.cjs} +1 -1
- package/dist/prefill-B8H9qwE4.js +371 -0
- package/dist/prefill-D7EswyTI.cjs +1 -0
- package/dist/{prepared-DqtpvRTn.js → prepared-BE-4jfX5.js} +2 -2
- package/dist/{prepared-DdrjLC7L.cjs → prepared-CGVphji3.cjs} +1 -1
- package/dist/{protocol-BzwMP4Vw.cjs → protocol-ByRVzzQG.cjs} +1 -1
- package/dist/{protocol-kt4Iy6-3.js → protocol-Cr81vFSQ.js} +3 -3
- package/dist/{record-bindings-CZWBJ1fU.js → record-bindings-DEJtmo3p.js} +67 -107
- package/dist/record-bindings-ehjnCDHt.cjs +1 -0
- package/dist/{region-binding-workflow-CWNvIjkV.js → region-binding-workflow-CBg0l_tj.js} +2 -2
- package/dist/{region-binding-workflow-CqSMxQ4p.cjs → region-binding-workflow-D05tOYn3.cjs} +1 -1
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/{report-params-B1RzkhJj.js → report-params-D9tBuM9B.js} +1 -1
- package/dist/{report-params-WDGrA4oP.cjs → report-params-VTg8MoCp.cjs} +1 -1
- package/dist/runtime-CDA6d263.cjs +1 -0
- package/dist/runtime-CEMvybO7.js +170 -0
- package/dist/sbom.cdx.json +1 -1
- package/dist/server/node.d.cts +121 -7
- package/dist/server/node.d.ts +121 -7
- package/dist/server-node.cjs +4 -4
- package/dist/server-node.js +3446 -2115
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +417 -29
- package/dist/server.d.ts +417 -29
- package/dist/server.js +787 -544
- package/dist/sha256-BDQ1Qk7A.js +158 -0
- package/dist/sha256-DgZAKXqI.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/template-bindings-Cg5oBLFT.cjs +1 -0
- package/dist/template-bindings-TKnXM7ll.js +62 -0
- package/dist/{template-catalog-BtR2JmCL.js → template-catalog-CmbWOJqy.js} +16 -16
- package/dist/template-catalog-Utu4GP09.cjs +1 -0
- package/dist/{template-fragments-BVsbxs4a.cjs → template-fragments-C_zSHJAa.cjs} +1 -1
- package/dist/{template-fragments-By0aZC1D.js → template-fragments-DWgo9tlZ.js} +2 -2
- package/dist/{template-outline-BwRV_eRo.cjs → template-outline-DWkzZXVC.cjs} +1 -1
- package/dist/{template-outline-cnWfT_LK.js → template-outline-DiADphlq.js} +1 -1
- package/dist/{template-registry-Cw3vRTX2.js → template-registry-BIhIHOab.js} +319 -314
- package/dist/template-registry-DzWswQI5.cjs +1 -0
- package/dist/vue/async.d.cts +636 -35
- package/dist/vue/async.d.ts +636 -35
- package/dist/vue/index.d.cts +746 -67
- package/dist/vue/index.d.ts +746 -67
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +94 -89
- package/dist/{workbook-session-Cbts-22R.cjs → workbook-session-B94EwVa_.cjs} +1 -1
- package/dist/{workbook-session-BeSO8PFB.js → workbook-session-BoScoOg-.js} +2 -2
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +75 -7
- package/dist/worker.d.ts +75 -7
- package/dist/worker.js +4 -4
- package/dist/xlsx.cjs +4 -4
- package/dist/xlsx.d.cts +208 -15
- package/dist/xlsx.d.ts +208 -15
- package/dist/xlsx.js +288 -252
- package/package.json +1 -1
- package/dist/ParamEditor-CUQLgoxa.cjs +0 -1
- package/dist/ParamEditor-OKesP_nO.js +0 -594
- package/dist/ReportBatchPanel-cZCAMAwH.cjs +0 -1
- package/dist/ReportPreview-BcDKCLiK.js +0 -4834
- package/dist/ReportPreview-Bk9nLfO9.cjs +0 -6
- package/dist/RuleEditor-BX5S8RSF.cjs +0 -1
- package/dist/RuleEditor-CGl9XY2s.js +0 -2037
- package/dist/assets-CqIbfbTr.js +0 -126
- package/dist/assets-e4YSke8n.cjs +0 -1
- package/dist/capabilities-DDwXr_cA.js +0 -103
- package/dist/capabilities-DNLyZdNw.cjs +0 -1
- package/dist/component-tree-Ca6YYfHq.js +0 -61
- package/dist/component-tree-DkGLEfZC.cjs +0 -1
- package/dist/computed-C-4C2S5h.js +0 -521
- package/dist/computed-CGV2a809.cjs +0 -1
- package/dist/config-Dg_o8e7m.cjs +0 -1
- package/dist/config-XQ4qrQ7Q.js +0 -844
- package/dist/dataset-BkRmwgeJ.cjs +0 -1
- package/dist/dataset-H5pFuQGU.js +0 -121
- package/dist/designer-BfQSahxq.js +0 -5163
- package/dist/designer-CPPdeM5_.cjs +0 -2
- package/dist/diagnostic-notification-B9K9We3h.cjs +0 -1
- package/dist/diagnostic-notification-qGAYZdkB.js +0 -7
- package/dist/drill-CsdjgkRM.cjs +0 -1
- package/dist/drill-DIGsZfyB.js +0 -145
- package/dist/json-snapshot-D6ioHth9.js +0 -1702
- package/dist/json-snapshot-DknkjvxP.cjs +0 -2
- package/dist/matrix-CGRGkn5s.js +0 -112
- package/dist/matrix-gEO7ZM_u.cjs +0 -1
- package/dist/param-validation-C3HlcLLO.cjs +0 -1
- package/dist/param-validation-Do7Eg8Zv.js +0 -181
- package/dist/record-bindings-DUX1VMlR.cjs +0 -1
- package/dist/runtime-BjKBI530.js +0 -168
- package/dist/runtime-CBFEPKEs.cjs +0 -1
- package/dist/sha256-BshdOkCC.cjs +0 -1
- package/dist/sha256-DTG-Gq8i.js +0 -157
- package/dist/template-bindings-C2SpvsMU.js +0 -58
- package/dist/template-bindings-CEtWyiLX.cjs +0 -1
- package/dist/template-catalog-C2NLdrwB.cjs +0 -1
- package/dist/template-registry-C62vpv4a.cjs +0 -1
- package/dist/tree-BX380Rr7.cjs +0 -1
- package/dist/tree-CjVZLRw7.js +0 -172
package/dist/analytics.d.cts
CHANGED
|
@@ -62,6 +62,23 @@ declare type ColumnFormat = {
|
|
|
62
62
|
pattern?: string;
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
+
declare type ColumnVisual = {
|
|
66
|
+
/** Defaults to the column field; never changes the cell's raw value or business identity. */
|
|
67
|
+
field?: string;
|
|
68
|
+
/** Numeric text requires explicit opt-in; formatting an identifier does not turn it into a measure. */
|
|
69
|
+
numeric?: "number" | "decimal";
|
|
70
|
+
min?: number;
|
|
71
|
+
max?: number;
|
|
72
|
+
} & ({
|
|
73
|
+
kind: "colorScale";
|
|
74
|
+
lowColor?: string;
|
|
75
|
+
highColor?: string;
|
|
76
|
+
} | {
|
|
77
|
+
kind: "dataBar";
|
|
78
|
+
color?: string;
|
|
79
|
+
negativeColor?: string;
|
|
80
|
+
});
|
|
81
|
+
|
|
65
82
|
export declare function compareDecimal(a: DecimalValue, b: DecimalValue): number;
|
|
66
83
|
|
|
67
84
|
/** A literal own field of the current label record; expressions and paths are not evaluated. */
|
|
@@ -153,7 +170,10 @@ export declare function createChartComponents(options: ReportChartOptions): Plan
|
|
|
153
170
|
export declare function createCrossTable(input: readonly Record<string, unknown>[], options: CrossTableOptions): CrossTableResult;
|
|
154
171
|
|
|
155
172
|
/** Multi-measure pivot shares dimensions and original rows; weighted totals never average averages. */
|
|
156
|
-
export declare function createMatrixTable(input: readonly Record<string, unknown>[], options: MatrixTableOptions):
|
|
173
|
+
export declare function createMatrixTable(input: readonly Record<string, unknown>[], options: MatrixTableOptions): MatrixTableResult;
|
|
174
|
+
|
|
175
|
+
/** One bounded scan, shared aggregate semantics; labels never coerce identifier source values. */
|
|
176
|
+
export declare function createReportChartData(rows: readonly Record<string, unknown>[], binding: ReportChartBinding, signal?: AbortSignal): ReportChartData;
|
|
157
177
|
|
|
158
178
|
export declare interface CrossTableOptions {
|
|
159
179
|
rowField: string;
|
|
@@ -221,38 +241,8 @@ export declare function getComputationMetadata(fields?: readonly {
|
|
|
221
241
|
type: string;
|
|
222
242
|
label?: string;
|
|
223
243
|
}[];
|
|
224
|
-
functions: readonly [
|
|
225
|
-
|
|
226
|
-
readonly minArgs: 2;
|
|
227
|
-
readonly maxArgs: 256;
|
|
228
|
-
readonly input: "numeric";
|
|
229
|
-
readonly output: "numeric";
|
|
230
|
-
}, {
|
|
231
|
-
readonly name: "subtract";
|
|
232
|
-
readonly minArgs: 2;
|
|
233
|
-
readonly maxArgs: 2;
|
|
234
|
-
readonly input: "numeric";
|
|
235
|
-
readonly output: "numeric";
|
|
236
|
-
}, {
|
|
237
|
-
readonly name: "multiply";
|
|
238
|
-
readonly minArgs: 2;
|
|
239
|
-
readonly maxArgs: 256;
|
|
240
|
-
readonly input: "numeric";
|
|
241
|
-
readonly output: "numeric";
|
|
242
|
-
}, {
|
|
243
|
-
readonly name: "divide";
|
|
244
|
-
readonly minArgs: 2;
|
|
245
|
-
readonly maxArgs: 2;
|
|
246
|
-
readonly input: "numeric";
|
|
247
|
-
readonly output: "numeric";
|
|
248
|
-
}, {
|
|
249
|
-
readonly name: "coalesce";
|
|
250
|
-
readonly minArgs: 2;
|
|
251
|
-
readonly maxArgs: 256;
|
|
252
|
-
readonly input: "scalar";
|
|
253
|
-
readonly output: "scalar";
|
|
254
|
-
}];
|
|
255
|
-
operations: readonly ["add", "subtract", "multiply", "divide", "coalesce"];
|
|
244
|
+
functions: readonly ReportExpressionFunction[];
|
|
245
|
+
operations: ReportExpressionOperation[];
|
|
256
246
|
aggregates: readonly ["sum", "count", "avg", "min", "max", "weightedAvg"];
|
|
257
247
|
scopes: readonly ["row", "group", "dataset"];
|
|
258
248
|
numericModes: readonly ["number", "decimal"];
|
|
@@ -268,6 +258,12 @@ export declare function getComputationMetadata(fields?: readonly {
|
|
|
268
258
|
};
|
|
269
259
|
|
|
270
260
|
declare interface GridCell {
|
|
261
|
+
/** Resolved visual only. Original value, text, editability and source are unchanged. */
|
|
262
|
+
dataBar?: {
|
|
263
|
+
start: number;
|
|
264
|
+
end: number;
|
|
265
|
+
color: string;
|
|
266
|
+
};
|
|
271
267
|
/** Styled cell content; text remains a plain-text fallback. Imported rich cells are read-only. */
|
|
272
268
|
richParagraphs?: RichParagraph[];
|
|
273
269
|
text?: string;
|
|
@@ -311,6 +307,8 @@ declare interface ListColumn {
|
|
|
311
307
|
format?: ColumnFormat;
|
|
312
308
|
/** 条件格式规则(声明式,命中合并进单元格样式;如负数红字) */
|
|
313
309
|
rules?: StyleRule[];
|
|
310
|
+
/** Optional resolved color scale or value-preserving data bar. */
|
|
311
|
+
visual?: ColumnVisual;
|
|
314
312
|
/** 内容列编辑控制;仍需由预览显式开启 editing,不影响表头/小计只读规则。 */
|
|
315
313
|
editable?: boolean;
|
|
316
314
|
/** 空值列或特殊数据类型可显式声明编辑输入类型。 */
|
|
@@ -322,6 +320,58 @@ declare interface ListColumn {
|
|
|
322
320
|
visibleWhen?: StyleRule["when"];
|
|
323
321
|
}
|
|
324
322
|
|
|
323
|
+
export declare interface MatrixAxisOptions {
|
|
324
|
+
/** Display names in the same outer-to-inner order as the dimension fields. */
|
|
325
|
+
labels?: readonly string[];
|
|
326
|
+
/** Per-level sibling order; omitted levels retain first-seen order. */
|
|
327
|
+
sort?: readonly MatrixDimensionOrder[];
|
|
328
|
+
/** One-based prefix depths. Leaf depths are not subtotals. */
|
|
329
|
+
subtotals?: readonly number[];
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export declare interface MatrixColumnMember extends MatrixDimensionMember {
|
|
333
|
+
field: string;
|
|
334
|
+
measure: number;
|
|
335
|
+
measureField: string;
|
|
336
|
+
valueField: string;
|
|
337
|
+
operation: AggregateOperation;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export declare interface MatrixDimensionMember {
|
|
341
|
+
/** Typed field/value identity, independent of labels, source order and display indices. */
|
|
342
|
+
key: string;
|
|
343
|
+
kind: "member" | "subtotal" | "total";
|
|
344
|
+
depth: number;
|
|
345
|
+
/** Prefix predicates. Empty for grand totals; never business write identities. */
|
|
346
|
+
fields: string[];
|
|
347
|
+
values: MatrixDimensionValue[];
|
|
348
|
+
labels: string[];
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export declare type MatrixDimensionOrder = "source" | "asc" | "desc";
|
|
352
|
+
|
|
353
|
+
export declare type MatrixDimensionValue = string | number | boolean | null;
|
|
354
|
+
|
|
355
|
+
export declare interface MatrixHierarchyOptions {
|
|
356
|
+
row?: MatrixAxisOptions;
|
|
357
|
+
column?: MatrixAxisOptions;
|
|
358
|
+
/** Only null/missing values use this label; empty strings and zero stay distinct. */
|
|
359
|
+
emptyLabel?: string;
|
|
360
|
+
subtotalLabel?: string;
|
|
361
|
+
totalLabel?: string;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export declare interface MatrixTableMetadata {
|
|
365
|
+
rowFields: string[];
|
|
366
|
+
rowLabels: string[];
|
|
367
|
+
columnFields: string[];
|
|
368
|
+
columnLabels: string[];
|
|
369
|
+
/** Aligned with result.rows. */
|
|
370
|
+
rows: MatrixDimensionMember[];
|
|
371
|
+
/** Measure columns only, addressed by their generated field. */
|
|
372
|
+
columns: MatrixColumnMember[];
|
|
373
|
+
}
|
|
374
|
+
|
|
325
375
|
export declare interface MatrixTableOptions {
|
|
326
376
|
rowFields: readonly string[];
|
|
327
377
|
columnFields: readonly string[];
|
|
@@ -336,6 +386,16 @@ export declare interface MatrixTableOptions {
|
|
|
336
386
|
maxColumns?: number;
|
|
337
387
|
maxInputRows?: number;
|
|
338
388
|
maxCells?: number;
|
|
389
|
+
/** Opt-in hierarchical dimensions, physical merged headers and prefix subtotals. */
|
|
390
|
+
hierarchy?: MatrixHierarchyOptions;
|
|
391
|
+
/** Hierarchical aggregate work, checked before measure reads; default 10 million updates. */
|
|
392
|
+
maxAggregateUpdates?: number;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export declare interface MatrixTableResult extends CrossTableResult {
|
|
396
|
+
/** Present only for opt-in hierarchy; the paginator supplies final physical widths/styles. */
|
|
397
|
+
headerGrid?: PlanGrid;
|
|
398
|
+
metadata?: MatrixTableMetadata;
|
|
339
399
|
}
|
|
340
400
|
|
|
341
401
|
export declare interface MatrixTableShape {
|
|
@@ -349,6 +409,8 @@ export declare function multiplyDecimal(a: DecimalValue, b: DecimalValue): Decim
|
|
|
349
409
|
export declare function parseDecimal(input: unknown): DecimalValue;
|
|
350
410
|
|
|
351
411
|
declare interface PlanComponent {
|
|
412
|
+
/** Template-only aggregate binding, expanded into shared primitives during layout. */
|
|
413
|
+
chartBinding?: ReportChartBinding;
|
|
352
414
|
/** Optional QR/barcode encoding configuration; no encoder is loaded by the core. */
|
|
353
415
|
code?: CodeOptions;
|
|
354
416
|
/** Template-only binding; resolved and removed before constructing the output plan. */
|
|
@@ -417,8 +479,31 @@ declare interface ReportCellSource {
|
|
|
417
479
|
sourceToken?: string;
|
|
418
480
|
}
|
|
419
481
|
|
|
482
|
+
/** Serializable binding; data and authorization continue to come from the existing report source. */
|
|
483
|
+
export declare interface ReportChartBinding {
|
|
484
|
+
dataset: string;
|
|
485
|
+
categoryField: string;
|
|
486
|
+
measures: readonly ReportChartMeasure[];
|
|
487
|
+
type: ReportChartOptions["type"];
|
|
488
|
+
sort?: "asc" | "desc";
|
|
489
|
+
title?: string;
|
|
490
|
+
showValues?: boolean;
|
|
491
|
+
maxRows?: number;
|
|
492
|
+
maxCategories?: number;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
export declare interface ReportChartData {
|
|
496
|
+
categories: string[];
|
|
497
|
+
series: ReportChartSeries[];
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
export declare interface ReportChartMeasure extends AggregateRequest {
|
|
501
|
+
label?: string;
|
|
502
|
+
color?: string;
|
|
503
|
+
}
|
|
504
|
+
|
|
420
505
|
export declare interface ReportChartOptions {
|
|
421
|
-
type: "bar" | "line";
|
|
506
|
+
type: "bar" | "line" | "stackedBar" | "percentBar";
|
|
422
507
|
categories: readonly string[];
|
|
423
508
|
series: readonly ReportChartSeries[];
|
|
424
509
|
leftMm: number;
|
|
@@ -435,6 +520,17 @@ export declare interface ReportChartSeries {
|
|
|
435
520
|
color?: string;
|
|
436
521
|
}
|
|
437
522
|
|
|
523
|
+
declare interface ReportComparison {
|
|
524
|
+
field: string;
|
|
525
|
+
op: ">" | ">=" | "<" | "<=" | "==" | "!=" | "between" | "contains" | "isNull" | "isNotNull";
|
|
526
|
+
/** Legacy scalar thresholds remain supported. Use right for field-to-field comparisons. */
|
|
527
|
+
value?: ReportPredicateScalar;
|
|
528
|
+
right?: ReportPredicateOperand;
|
|
529
|
+
values?: readonly [ReportPredicateScalar, ReportPredicateScalar];
|
|
530
|
+
numeric?: "number" | "decimal";
|
|
531
|
+
valueType?: "number" | "decimal" | "text" | "date" | "boolean";
|
|
532
|
+
}
|
|
533
|
+
|
|
438
534
|
export declare type ReportExpression = {
|
|
439
535
|
field: string;
|
|
440
536
|
} | {
|
|
@@ -444,10 +540,39 @@ export declare type ReportExpression = {
|
|
|
444
540
|
field?: string;
|
|
445
541
|
weightField?: string;
|
|
446
542
|
} | {
|
|
447
|
-
op:
|
|
543
|
+
op: ReportExpressionOperation;
|
|
544
|
+
/** Required for if; args are [then, else], and only the selected branch is evaluated. */
|
|
545
|
+
condition?: ReportPredicate;
|
|
448
546
|
args: readonly ReportExpression[];
|
|
449
547
|
};
|
|
450
548
|
|
|
549
|
+
declare interface ReportExpressionFunction {
|
|
550
|
+
readonly name: ReportExpressionOperation;
|
|
551
|
+
readonly minArgs: number;
|
|
552
|
+
readonly maxArgs: number;
|
|
553
|
+
readonly input: string;
|
|
554
|
+
readonly output: string;
|
|
555
|
+
readonly example: string;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
declare type ReportExpressionOperation = "add" | "subtract" | "multiply" | "divide" | "coalesce" | "if" | "round" | "abs" | "concat" | "trim" | "upper" | "lower" | "dateYear" | "dateMonth" | "dateDay";
|
|
559
|
+
|
|
560
|
+
declare type ReportPredicate = ReportComparison | {
|
|
561
|
+
all: readonly ReportPredicate[];
|
|
562
|
+
} | {
|
|
563
|
+
any: readonly ReportPredicate[];
|
|
564
|
+
} | {
|
|
565
|
+
not: ReportPredicate;
|
|
566
|
+
};
|
|
567
|
+
|
|
568
|
+
declare type ReportPredicateOperand = {
|
|
569
|
+
field: string;
|
|
570
|
+
} | {
|
|
571
|
+
value: ReportPredicateScalar;
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
declare type ReportPredicateScalar = string | number | boolean | null;
|
|
575
|
+
|
|
451
576
|
declare interface RichParagraph {
|
|
452
577
|
segments: RichSegment[];
|
|
453
578
|
align?: ComponentStyle["align"];
|
|
@@ -466,13 +591,7 @@ declare interface RichSegment {
|
|
|
466
591
|
|
|
467
592
|
/** 条件格式规则求值(声明式,见 ListColumn.rules) */
|
|
468
593
|
declare interface StyleRule {
|
|
469
|
-
when:
|
|
470
|
-
field: string;
|
|
471
|
-
op: ">" | ">=" | "<" | "<=" | "==" | "!=";
|
|
472
|
-
value: number | string;
|
|
473
|
-
/** Explicit decimal comparisons retain decimal thresholds as text. */
|
|
474
|
-
numeric?: "number" | "decimal";
|
|
475
|
-
};
|
|
594
|
+
when: ReportPredicate;
|
|
476
595
|
/** 命中时合并进单元格样式(color/bold/backgroundColor 等) */
|
|
477
596
|
style: Record<string, unknown>;
|
|
478
597
|
}
|
|
@@ -489,6 +608,8 @@ export declare function validateComputedFields(definitions: readonly ComputedFie
|
|
|
489
608
|
|
|
490
609
|
export declare function validateMatrixOptions(options: MatrixTableOptions): void;
|
|
491
610
|
|
|
611
|
+
export declare function validateReportChartBinding(binding: ReportChartBinding): void;
|
|
612
|
+
|
|
492
613
|
/** The same declarative formatting used by list columns, before any output backend. */
|
|
493
614
|
declare type ValueFormat = ColumnFormat;
|
|
494
615
|
|
package/dist/analytics.d.ts
CHANGED
|
@@ -62,6 +62,23 @@ declare type ColumnFormat = {
|
|
|
62
62
|
pattern?: string;
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
+
declare type ColumnVisual = {
|
|
66
|
+
/** Defaults to the column field; never changes the cell's raw value or business identity. */
|
|
67
|
+
field?: string;
|
|
68
|
+
/** Numeric text requires explicit opt-in; formatting an identifier does not turn it into a measure. */
|
|
69
|
+
numeric?: "number" | "decimal";
|
|
70
|
+
min?: number;
|
|
71
|
+
max?: number;
|
|
72
|
+
} & ({
|
|
73
|
+
kind: "colorScale";
|
|
74
|
+
lowColor?: string;
|
|
75
|
+
highColor?: string;
|
|
76
|
+
} | {
|
|
77
|
+
kind: "dataBar";
|
|
78
|
+
color?: string;
|
|
79
|
+
negativeColor?: string;
|
|
80
|
+
});
|
|
81
|
+
|
|
65
82
|
export declare function compareDecimal(a: DecimalValue, b: DecimalValue): number;
|
|
66
83
|
|
|
67
84
|
/** A literal own field of the current label record; expressions and paths are not evaluated. */
|
|
@@ -153,7 +170,10 @@ export declare function createChartComponents(options: ReportChartOptions): Plan
|
|
|
153
170
|
export declare function createCrossTable(input: readonly Record<string, unknown>[], options: CrossTableOptions): CrossTableResult;
|
|
154
171
|
|
|
155
172
|
/** Multi-measure pivot shares dimensions and original rows; weighted totals never average averages. */
|
|
156
|
-
export declare function createMatrixTable(input: readonly Record<string, unknown>[], options: MatrixTableOptions):
|
|
173
|
+
export declare function createMatrixTable(input: readonly Record<string, unknown>[], options: MatrixTableOptions): MatrixTableResult;
|
|
174
|
+
|
|
175
|
+
/** One bounded scan, shared aggregate semantics; labels never coerce identifier source values. */
|
|
176
|
+
export declare function createReportChartData(rows: readonly Record<string, unknown>[], binding: ReportChartBinding, signal?: AbortSignal): ReportChartData;
|
|
157
177
|
|
|
158
178
|
export declare interface CrossTableOptions {
|
|
159
179
|
rowField: string;
|
|
@@ -221,38 +241,8 @@ export declare function getComputationMetadata(fields?: readonly {
|
|
|
221
241
|
type: string;
|
|
222
242
|
label?: string;
|
|
223
243
|
}[];
|
|
224
|
-
functions: readonly [
|
|
225
|
-
|
|
226
|
-
readonly minArgs: 2;
|
|
227
|
-
readonly maxArgs: 256;
|
|
228
|
-
readonly input: "numeric";
|
|
229
|
-
readonly output: "numeric";
|
|
230
|
-
}, {
|
|
231
|
-
readonly name: "subtract";
|
|
232
|
-
readonly minArgs: 2;
|
|
233
|
-
readonly maxArgs: 2;
|
|
234
|
-
readonly input: "numeric";
|
|
235
|
-
readonly output: "numeric";
|
|
236
|
-
}, {
|
|
237
|
-
readonly name: "multiply";
|
|
238
|
-
readonly minArgs: 2;
|
|
239
|
-
readonly maxArgs: 256;
|
|
240
|
-
readonly input: "numeric";
|
|
241
|
-
readonly output: "numeric";
|
|
242
|
-
}, {
|
|
243
|
-
readonly name: "divide";
|
|
244
|
-
readonly minArgs: 2;
|
|
245
|
-
readonly maxArgs: 2;
|
|
246
|
-
readonly input: "numeric";
|
|
247
|
-
readonly output: "numeric";
|
|
248
|
-
}, {
|
|
249
|
-
readonly name: "coalesce";
|
|
250
|
-
readonly minArgs: 2;
|
|
251
|
-
readonly maxArgs: 256;
|
|
252
|
-
readonly input: "scalar";
|
|
253
|
-
readonly output: "scalar";
|
|
254
|
-
}];
|
|
255
|
-
operations: readonly ["add", "subtract", "multiply", "divide", "coalesce"];
|
|
244
|
+
functions: readonly ReportExpressionFunction[];
|
|
245
|
+
operations: ReportExpressionOperation[];
|
|
256
246
|
aggregates: readonly ["sum", "count", "avg", "min", "max", "weightedAvg"];
|
|
257
247
|
scopes: readonly ["row", "group", "dataset"];
|
|
258
248
|
numericModes: readonly ["number", "decimal"];
|
|
@@ -268,6 +258,12 @@ export declare function getComputationMetadata(fields?: readonly {
|
|
|
268
258
|
};
|
|
269
259
|
|
|
270
260
|
declare interface GridCell {
|
|
261
|
+
/** Resolved visual only. Original value, text, editability and source are unchanged. */
|
|
262
|
+
dataBar?: {
|
|
263
|
+
start: number;
|
|
264
|
+
end: number;
|
|
265
|
+
color: string;
|
|
266
|
+
};
|
|
271
267
|
/** Styled cell content; text remains a plain-text fallback. Imported rich cells are read-only. */
|
|
272
268
|
richParagraphs?: RichParagraph[];
|
|
273
269
|
text?: string;
|
|
@@ -311,6 +307,8 @@ declare interface ListColumn {
|
|
|
311
307
|
format?: ColumnFormat;
|
|
312
308
|
/** 条件格式规则(声明式,命中合并进单元格样式;如负数红字) */
|
|
313
309
|
rules?: StyleRule[];
|
|
310
|
+
/** Optional resolved color scale or value-preserving data bar. */
|
|
311
|
+
visual?: ColumnVisual;
|
|
314
312
|
/** 内容列编辑控制;仍需由预览显式开启 editing,不影响表头/小计只读规则。 */
|
|
315
313
|
editable?: boolean;
|
|
316
314
|
/** 空值列或特殊数据类型可显式声明编辑输入类型。 */
|
|
@@ -322,6 +320,58 @@ declare interface ListColumn {
|
|
|
322
320
|
visibleWhen?: StyleRule["when"];
|
|
323
321
|
}
|
|
324
322
|
|
|
323
|
+
export declare interface MatrixAxisOptions {
|
|
324
|
+
/** Display names in the same outer-to-inner order as the dimension fields. */
|
|
325
|
+
labels?: readonly string[];
|
|
326
|
+
/** Per-level sibling order; omitted levels retain first-seen order. */
|
|
327
|
+
sort?: readonly MatrixDimensionOrder[];
|
|
328
|
+
/** One-based prefix depths. Leaf depths are not subtotals. */
|
|
329
|
+
subtotals?: readonly number[];
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export declare interface MatrixColumnMember extends MatrixDimensionMember {
|
|
333
|
+
field: string;
|
|
334
|
+
measure: number;
|
|
335
|
+
measureField: string;
|
|
336
|
+
valueField: string;
|
|
337
|
+
operation: AggregateOperation;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export declare interface MatrixDimensionMember {
|
|
341
|
+
/** Typed field/value identity, independent of labels, source order and display indices. */
|
|
342
|
+
key: string;
|
|
343
|
+
kind: "member" | "subtotal" | "total";
|
|
344
|
+
depth: number;
|
|
345
|
+
/** Prefix predicates. Empty for grand totals; never business write identities. */
|
|
346
|
+
fields: string[];
|
|
347
|
+
values: MatrixDimensionValue[];
|
|
348
|
+
labels: string[];
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export declare type MatrixDimensionOrder = "source" | "asc" | "desc";
|
|
352
|
+
|
|
353
|
+
export declare type MatrixDimensionValue = string | number | boolean | null;
|
|
354
|
+
|
|
355
|
+
export declare interface MatrixHierarchyOptions {
|
|
356
|
+
row?: MatrixAxisOptions;
|
|
357
|
+
column?: MatrixAxisOptions;
|
|
358
|
+
/** Only null/missing values use this label; empty strings and zero stay distinct. */
|
|
359
|
+
emptyLabel?: string;
|
|
360
|
+
subtotalLabel?: string;
|
|
361
|
+
totalLabel?: string;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export declare interface MatrixTableMetadata {
|
|
365
|
+
rowFields: string[];
|
|
366
|
+
rowLabels: string[];
|
|
367
|
+
columnFields: string[];
|
|
368
|
+
columnLabels: string[];
|
|
369
|
+
/** Aligned with result.rows. */
|
|
370
|
+
rows: MatrixDimensionMember[];
|
|
371
|
+
/** Measure columns only, addressed by their generated field. */
|
|
372
|
+
columns: MatrixColumnMember[];
|
|
373
|
+
}
|
|
374
|
+
|
|
325
375
|
export declare interface MatrixTableOptions {
|
|
326
376
|
rowFields: readonly string[];
|
|
327
377
|
columnFields: readonly string[];
|
|
@@ -336,6 +386,16 @@ export declare interface MatrixTableOptions {
|
|
|
336
386
|
maxColumns?: number;
|
|
337
387
|
maxInputRows?: number;
|
|
338
388
|
maxCells?: number;
|
|
389
|
+
/** Opt-in hierarchical dimensions, physical merged headers and prefix subtotals. */
|
|
390
|
+
hierarchy?: MatrixHierarchyOptions;
|
|
391
|
+
/** Hierarchical aggregate work, checked before measure reads; default 10 million updates. */
|
|
392
|
+
maxAggregateUpdates?: number;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export declare interface MatrixTableResult extends CrossTableResult {
|
|
396
|
+
/** Present only for opt-in hierarchy; the paginator supplies final physical widths/styles. */
|
|
397
|
+
headerGrid?: PlanGrid;
|
|
398
|
+
metadata?: MatrixTableMetadata;
|
|
339
399
|
}
|
|
340
400
|
|
|
341
401
|
export declare interface MatrixTableShape {
|
|
@@ -349,6 +409,8 @@ export declare function multiplyDecimal(a: DecimalValue, b: DecimalValue): Decim
|
|
|
349
409
|
export declare function parseDecimal(input: unknown): DecimalValue;
|
|
350
410
|
|
|
351
411
|
declare interface PlanComponent {
|
|
412
|
+
/** Template-only aggregate binding, expanded into shared primitives during layout. */
|
|
413
|
+
chartBinding?: ReportChartBinding;
|
|
352
414
|
/** Optional QR/barcode encoding configuration; no encoder is loaded by the core. */
|
|
353
415
|
code?: CodeOptions;
|
|
354
416
|
/** Template-only binding; resolved and removed before constructing the output plan. */
|
|
@@ -417,8 +479,31 @@ declare interface ReportCellSource {
|
|
|
417
479
|
sourceToken?: string;
|
|
418
480
|
}
|
|
419
481
|
|
|
482
|
+
/** Serializable binding; data and authorization continue to come from the existing report source. */
|
|
483
|
+
export declare interface ReportChartBinding {
|
|
484
|
+
dataset: string;
|
|
485
|
+
categoryField: string;
|
|
486
|
+
measures: readonly ReportChartMeasure[];
|
|
487
|
+
type: ReportChartOptions["type"];
|
|
488
|
+
sort?: "asc" | "desc";
|
|
489
|
+
title?: string;
|
|
490
|
+
showValues?: boolean;
|
|
491
|
+
maxRows?: number;
|
|
492
|
+
maxCategories?: number;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
export declare interface ReportChartData {
|
|
496
|
+
categories: string[];
|
|
497
|
+
series: ReportChartSeries[];
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
export declare interface ReportChartMeasure extends AggregateRequest {
|
|
501
|
+
label?: string;
|
|
502
|
+
color?: string;
|
|
503
|
+
}
|
|
504
|
+
|
|
420
505
|
export declare interface ReportChartOptions {
|
|
421
|
-
type: "bar" | "line";
|
|
506
|
+
type: "bar" | "line" | "stackedBar" | "percentBar";
|
|
422
507
|
categories: readonly string[];
|
|
423
508
|
series: readonly ReportChartSeries[];
|
|
424
509
|
leftMm: number;
|
|
@@ -435,6 +520,17 @@ export declare interface ReportChartSeries {
|
|
|
435
520
|
color?: string;
|
|
436
521
|
}
|
|
437
522
|
|
|
523
|
+
declare interface ReportComparison {
|
|
524
|
+
field: string;
|
|
525
|
+
op: ">" | ">=" | "<" | "<=" | "==" | "!=" | "between" | "contains" | "isNull" | "isNotNull";
|
|
526
|
+
/** Legacy scalar thresholds remain supported. Use right for field-to-field comparisons. */
|
|
527
|
+
value?: ReportPredicateScalar;
|
|
528
|
+
right?: ReportPredicateOperand;
|
|
529
|
+
values?: readonly [ReportPredicateScalar, ReportPredicateScalar];
|
|
530
|
+
numeric?: "number" | "decimal";
|
|
531
|
+
valueType?: "number" | "decimal" | "text" | "date" | "boolean";
|
|
532
|
+
}
|
|
533
|
+
|
|
438
534
|
export declare type ReportExpression = {
|
|
439
535
|
field: string;
|
|
440
536
|
} | {
|
|
@@ -444,10 +540,39 @@ export declare type ReportExpression = {
|
|
|
444
540
|
field?: string;
|
|
445
541
|
weightField?: string;
|
|
446
542
|
} | {
|
|
447
|
-
op:
|
|
543
|
+
op: ReportExpressionOperation;
|
|
544
|
+
/** Required for if; args are [then, else], and only the selected branch is evaluated. */
|
|
545
|
+
condition?: ReportPredicate;
|
|
448
546
|
args: readonly ReportExpression[];
|
|
449
547
|
};
|
|
450
548
|
|
|
549
|
+
declare interface ReportExpressionFunction {
|
|
550
|
+
readonly name: ReportExpressionOperation;
|
|
551
|
+
readonly minArgs: number;
|
|
552
|
+
readonly maxArgs: number;
|
|
553
|
+
readonly input: string;
|
|
554
|
+
readonly output: string;
|
|
555
|
+
readonly example: string;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
declare type ReportExpressionOperation = "add" | "subtract" | "multiply" | "divide" | "coalesce" | "if" | "round" | "abs" | "concat" | "trim" | "upper" | "lower" | "dateYear" | "dateMonth" | "dateDay";
|
|
559
|
+
|
|
560
|
+
declare type ReportPredicate = ReportComparison | {
|
|
561
|
+
all: readonly ReportPredicate[];
|
|
562
|
+
} | {
|
|
563
|
+
any: readonly ReportPredicate[];
|
|
564
|
+
} | {
|
|
565
|
+
not: ReportPredicate;
|
|
566
|
+
};
|
|
567
|
+
|
|
568
|
+
declare type ReportPredicateOperand = {
|
|
569
|
+
field: string;
|
|
570
|
+
} | {
|
|
571
|
+
value: ReportPredicateScalar;
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
declare type ReportPredicateScalar = string | number | boolean | null;
|
|
575
|
+
|
|
451
576
|
declare interface RichParagraph {
|
|
452
577
|
segments: RichSegment[];
|
|
453
578
|
align?: ComponentStyle["align"];
|
|
@@ -466,13 +591,7 @@ declare interface RichSegment {
|
|
|
466
591
|
|
|
467
592
|
/** 条件格式规则求值(声明式,见 ListColumn.rules) */
|
|
468
593
|
declare interface StyleRule {
|
|
469
|
-
when:
|
|
470
|
-
field: string;
|
|
471
|
-
op: ">" | ">=" | "<" | "<=" | "==" | "!=";
|
|
472
|
-
value: number | string;
|
|
473
|
-
/** Explicit decimal comparisons retain decimal thresholds as text. */
|
|
474
|
-
numeric?: "number" | "decimal";
|
|
475
|
-
};
|
|
594
|
+
when: ReportPredicate;
|
|
476
595
|
/** 命中时合并进单元格样式(color/bold/backgroundColor 等) */
|
|
477
596
|
style: Record<string, unknown>;
|
|
478
597
|
}
|
|
@@ -489,6 +608,8 @@ export declare function validateComputedFields(definitions: readonly ComputedFie
|
|
|
489
608
|
|
|
490
609
|
export declare function validateMatrixOptions(options: MatrixTableOptions): void;
|
|
491
610
|
|
|
611
|
+
export declare function validateReportChartBinding(binding: ReportChartBinding): void;
|
|
612
|
+
|
|
492
613
|
/** The same declarative formatting used by list columns, before any output backend. */
|
|
493
614
|
declare type ValueFormat = ColumnFormat;
|
|
494
615
|
|