@agile-team/mach-report 2.9.1 → 2.11.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 +11 -7
- package/dist/ExcelBindingWizard-CjIiVox-.cjs +1 -0
- package/dist/ExcelBindingWizard-Dxm-K5HL.js +1240 -0
- package/dist/ParamEditor-D-Hf5xfO.cjs +1 -0
- package/dist/ParamEditor-DRGxzxeO.js +381 -0
- package/dist/ReportBatchPanel-BYgg0EDB.cjs +1 -0
- package/dist/ReportBatchPanel-Bby5yLzU.js +287 -0
- package/dist/ReportPreview-DWXROHBP.cjs +6 -0
- package/dist/ReportPreview-DiNXhQI0.js +4138 -0
- package/dist/ReportTemplateLibrary-C6CO7YCT.cjs +1 -0
- package/dist/ReportTemplateLibrary-DfzDXRvr.js +260 -0
- package/dist/RuleEditor-C2QsOHOs.cjs +1 -0
- package/dist/RuleEditor-D9wQHrkf.js +2024 -0
- package/dist/TemplateReviewPanel-BKofGrV9.js +222 -0
- package/dist/TemplateReviewPanel-DwtOcLue.cjs +1 -0
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.d.cts +4 -0
- package/dist/analytics.d.ts +4 -0
- package/dist/analytics.js +40 -39
- package/dist/{assets-ahTRUXRk.cjs → assets-Bu6UohJx.cjs} +1 -1
- package/dist/{assets-DDsfEi8R.js → assets-DegqDNqY.js} +1 -1
- package/dist/batch-Bt3Fd27Z.cjs +1 -0
- package/dist/batch-mRqhhhjt.js +364 -0
- package/dist/{capabilities-Cm9hZ3uV.js → capabilities-CK_7hizc.js} +16 -16
- package/dist/capabilities-CsZ-pNHR.cjs +1 -0
- package/dist/computed-Bvk0W15F.js +521 -0
- package/dist/computed-CGV2a809.cjs +1 -0
- package/dist/config-B612mw0x.js +525 -0
- package/dist/config-BRoLo2oj.cjs +1 -0
- package/dist/designer.cjs +2 -2
- package/dist/designer.d.cts +695 -50
- package/dist/designer.d.ts +695 -50
- package/dist/designer.js +2213 -1748
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +205 -6
- package/dist/index.d.ts +205 -6
- package/dist/index.js +808 -1033
- package/dist/injection-keys-Db_DyLkm.cjs +1 -0
- package/dist/injection-keys-e85udZCp.js +7 -0
- package/dist/list-cell-BuYn4tGF.cjs +1 -0
- package/dist/list-cell-ClFra1zS.js +173 -0
- package/dist/matrix-DVyWiYsd.cjs +1 -0
- package/dist/matrix-yZsGnldA.js +227 -0
- package/dist/param-validation-BlHHXs6u.js +153 -0
- package/dist/param-validation-DCK039V1.cjs +1 -0
- package/dist/pdf.cjs +49 -49
- package/dist/pdf.d.cts +31 -1
- package/dist/pdf.d.ts +31 -1
- package/dist/pdf.js +4797 -4650
- package/dist/plugin-BDTU4D94.cjs +1 -0
- package/dist/plugin-Cd5G2QQn.js +22 -0
- package/dist/region-binding-workflow-CXDmt9Bs.js +977 -0
- package/dist/region-binding-workflow-DhQvu1co.cjs +3 -0
- package/dist/{report-params-B_VCihAh.js → report-params-B44imUd4.js} +1 -1
- package/dist/{report-params-CjWrjPl6.cjs → report-params-SJfhKgaX.cjs} +1 -1
- package/dist/server/node.d.cts +48 -5
- package/dist/server/node.d.ts +48 -5
- package/dist/server-node.cjs +1 -1
- package/dist/server-node.js +503 -317
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +252 -4
- package/dist/server.d.ts +252 -4
- package/dist/server.js +567 -469
- package/dist/style.css +1 -1
- package/dist/template-registry-WNXdkiET.js +506 -0
- package/dist/template-registry-ukBGlm8N.cjs +1 -0
- package/dist/template-review-BXp2oyqg.cjs +1 -0
- package/dist/template-review-BdcXSYbx.js +1616 -0
- package/dist/tree-BX380Rr7.cjs +1 -0
- package/dist/tree-CqcQ99NM.js +172 -0
- package/dist/useLocalDraft-C07SYRnC.js +11 -0
- package/dist/useLocalDraft-Yiw1wFgI.cjs +1 -0
- package/dist/{validate-DWPF7icl.js → validate-7s0yn6ii.js} +26 -26
- package/dist/validate-DsRiNw8h.cjs +1 -0
- package/dist/vue/async.d.cts +118 -6
- package/dist/vue/async.d.ts +118 -6
- package/dist/vue/index.d.cts +177 -11
- package/dist/vue/index.d.ts +177 -11
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +5 -5
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +116 -113
- package/dist/{import-template-CNMLJSQw.js → workbook-session-BKOTwcoq.js} +4290 -4227
- package/dist/{import-template-CpxunKVp.cjs → workbook-session-CLYLhZWu.cjs} +17 -17
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +9 -2
- package/dist/worker.d.ts +9 -2
- package/dist/worker.js +1 -1
- package/dist/xlsx.cjs +4 -2
- package/dist/xlsx.d.cts +159 -3
- package/dist/xlsx.d.ts +159 -3
- package/dist/xlsx.js +354 -192
- package/package.json +1 -1
- package/dist/ExcelBindingWizard-DiaxvWpQ.cjs +0 -1
- package/dist/ExcelBindingWizard-RLJIXKKG.js +0 -816
- package/dist/ReportPreview-B5ZNEasW.js +0 -4439
- package/dist/ReportPreview-DRtVPUYo.cjs +0 -6
- package/dist/RuleEditor-CskN5Fr3.cjs +0 -1
- package/dist/RuleEditor-CtJFzKuY.js +0 -1578
- package/dist/TemplateReviewPanel-C_Lmzis6.cjs +0 -1
- package/dist/TemplateReviewPanel-Cn32OY4_.js +0 -173
- package/dist/binding-preview-B5834rml.cjs +0 -2
- package/dist/binding-preview-ChXjN5L5.js +0 -649
- package/dist/capabilities-DYzWL7KS.cjs +0 -1
- package/dist/matrix-CNPDJxED.js +0 -745
- package/dist/matrix-Div9Ilh3.cjs +0 -1
- package/dist/param-validation-BWNjLcN0.js +0 -116
- package/dist/param-validation-CiTxFeZ8.cjs +0 -1
- package/dist/plugin-BWwIgZXV.js +0 -25
- package/dist/plugin-Dg-J1Rbm.cjs +0 -1
- package/dist/template-registry-CHMYZ7SD.cjs +0 -1
- package/dist/template-registry-R61AMCr0.js +0 -433
- package/dist/template-review-hvWWQFsi.js +0 -1027
- package/dist/template-review-jEcOfmGr.cjs +0 -1
- package/dist/validate-BDiMqkJC.cjs +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -108,6 +108,11 @@ export declare type ClassKey = "root" | "page" | "comp" | "text" | "lines" | "li
|
|
|
108
108
|
|
|
109
109
|
export declare function classOf(key: ClassKey, options?: RenderOptions): string;
|
|
110
110
|
|
|
111
|
+
export declare function cloneReportTemplate(document: ReportTemplateDocument, identity: {
|
|
112
|
+
id: string;
|
|
113
|
+
name: string;
|
|
114
|
+
}): ReportTemplateDocument;
|
|
115
|
+
|
|
111
116
|
/**
|
|
112
117
|
* 列值格式化(声明式、JSON 可序列化)。
|
|
113
118
|
* 在 paginate 的 cellText 出口统一消费:格式化发生在进 RenderPlan 之前,
|
|
@@ -170,6 +175,15 @@ export declare interface ComponentStyle {
|
|
|
170
175
|
rotateDeg?: number;
|
|
171
176
|
}
|
|
172
177
|
|
|
178
|
+
declare interface ComputedDatasetOptions {
|
|
179
|
+
fields: readonly ComputedField[];
|
|
180
|
+
formula?: FormulaAdapter;
|
|
181
|
+
maxRows?: number;
|
|
182
|
+
maxCells?: number;
|
|
183
|
+
signal?: AbortSignal;
|
|
184
|
+
onError?: "throw" | "null";
|
|
185
|
+
}
|
|
186
|
+
|
|
173
187
|
declare interface ComputedField extends ExpressionOptions {
|
|
174
188
|
field: string;
|
|
175
189
|
expression: ReportExpression | string;
|
|
@@ -205,6 +219,13 @@ export declare function createCanvasPager(plan: RenderPlan, options?: CanvasPage
|
|
|
205
219
|
/** 兼容旧 API:默认启发式测量 */
|
|
206
220
|
export declare function createHeuristicMeasurer(): TextMeasurer;
|
|
207
221
|
|
|
222
|
+
/** Local catalog reference; an enterprise host supplies the same search/get contract with server filtering. */
|
|
223
|
+
export declare function createLocalTemplateCatalog(input: Array<{
|
|
224
|
+
document: ReportTemplateDocument;
|
|
225
|
+
category?: string;
|
|
226
|
+
tags?: string[];
|
|
227
|
+
}>): ReportTemplateCatalogProvider;
|
|
228
|
+
|
|
208
229
|
/** 单进程参考适配器;多实例服务请实现具备数据库事务/CAS 的持久化适配器。 */
|
|
209
230
|
export declare function createMemoryTemplateStore(): ReportTemplateStore;
|
|
210
231
|
|
|
@@ -221,6 +242,13 @@ export declare function createReportCellEditBatch(plan: RenderPlan, inputs: read
|
|
|
221
242
|
/** Operation-scoped index: avoids repeated geometry work without caching mutable plans globally. */
|
|
222
243
|
export declare function createReportCellResolver(plan: RenderPlan): (address: ReportCellAddress) => ReportCellContext | null;
|
|
223
244
|
|
|
245
|
+
/** Optional standalone entry; normal createReportSource/createLocalFetcher already register it. */
|
|
246
|
+
export declare function createReportEditSession(options: {
|
|
247
|
+
template: ReportTemplate;
|
|
248
|
+
datasets: DatasetRows;
|
|
249
|
+
pagination?: PaginateOptions;
|
|
250
|
+
}): ReportEditSession;
|
|
251
|
+
|
|
224
252
|
/**
|
|
225
253
|
* 框架无关的报表数据源:注册一次模板与取数,包内完成分页、校验、按 ID 顺序合并。
|
|
226
254
|
* 不缓存业务结果、不推断接口包装、不自动重试;鉴权与完整数据范围由宿主决定。
|
|
@@ -255,8 +283,16 @@ export declare function createTemplateManager(store: ReportTemplateStore, option
|
|
|
255
283
|
/** 存储无关的模板目录;后台 CRUD、权限、发布审批与持久化由宿主接入。 */
|
|
256
284
|
export declare function createTemplateRegistry(documents?: readonly ReportTemplateDocument[]): ReportTemplateRegistry;
|
|
257
285
|
|
|
286
|
+
/** O(n) identity index, iterative bounded traversal, no input mutation or recursive stack. */
|
|
287
|
+
export declare function createTreeTable(input: readonly DataRow[], options: TreeTableOptions, execution?: {
|
|
288
|
+
signal?: AbortSignal;
|
|
289
|
+
computed?: ComputedDatasetOptions;
|
|
290
|
+
}): TreeTable;
|
|
291
|
+
|
|
258
292
|
export declare const CSS_DPI = 96;
|
|
259
293
|
|
|
294
|
+
declare type DataRow = Record<string, unknown>;
|
|
295
|
+
|
|
260
296
|
export declare interface DatasetContract {
|
|
261
297
|
fields: readonly ReportFieldContract[];
|
|
262
298
|
rowKey?: string;
|
|
@@ -312,7 +348,6 @@ export declare function diffReportTemplates(previous: ReportTemplateDocument, ne
|
|
|
312
348
|
maxChanges?: number;
|
|
313
349
|
}): ReportTemplateDiff;
|
|
314
350
|
|
|
315
|
-
/** Conservative cell allocation estimate; relation validation rejects duplicate master keys before rendering. */
|
|
316
351
|
export declare function estimateListLayoutCells(list: ListComponent, datasets: DatasetRows, options?: Pick<PaginateOptions, "formula" | "signal">): number;
|
|
317
352
|
|
|
318
353
|
/**
|
|
@@ -338,6 +373,8 @@ export declare function formatReportCellEdit(context: ReportCellContext, value:
|
|
|
338
373
|
/** TSV with Excel-compatible quoting; quoted line breaks remain inside their cells. */
|
|
339
374
|
export declare function formatReportClipboard(rows: readonly (readonly string[])[]): string;
|
|
340
375
|
|
|
376
|
+
export declare function formatReportDateRange(range: ReportDateRange): string;
|
|
377
|
+
|
|
341
378
|
/**
|
|
342
379
|
* 应用格式化。非数值/无法解析时原样返回基础文本(降级不报错):
|
|
343
380
|
* - number:digits 小数位 + 可选千分位(12,345.60;thousands 默认 false)
|
|
@@ -359,6 +396,8 @@ declare type Geometry = Partial<Pick<PlanComponent, "leftMm" | "topMm" | "widthM
|
|
|
359
396
|
|
|
360
397
|
export declare function getReportCellContext(plan: RenderPlan, address: ReportCellAddress): ReportCellContext | null;
|
|
361
398
|
|
|
399
|
+
export declare function getReportEditSession(plan: RenderPlan): ReportEditSession | undefined;
|
|
400
|
+
|
|
362
401
|
export declare interface GridCell {
|
|
363
402
|
text?: string;
|
|
364
403
|
rawText?: string;
|
|
@@ -366,11 +405,15 @@ export declare interface GridCell {
|
|
|
366
405
|
value?: string | number | boolean | null;
|
|
367
406
|
/** Excel 数字格式(例如 #,##0.00 / 0.00%),不改变 text。 */
|
|
368
407
|
numberFormat?: string;
|
|
408
|
+
/** Physical left inset for hierarchical labels; raw value stays unchanged. */
|
|
409
|
+
indentMm?: number;
|
|
369
410
|
/** 编辑输入类型;省略时只按原始值推断,数字字符串不会被转换为数值。 */
|
|
370
411
|
valueType?: "text" | "number" | "boolean";
|
|
371
412
|
/** 单元格级编辑控制;预览仍需显式开启 editing。 */
|
|
372
413
|
editable?: boolean;
|
|
373
414
|
source?: ReportCellSource;
|
|
415
|
+
/** SDK 派生结果不映射业务来源,始终只读(包括覆盖同名源字段的计算)。 */
|
|
416
|
+
derived?: boolean;
|
|
374
417
|
/** Excel 公式保留元数据;当前引擎不计算公式,公式格始终只读。 */
|
|
375
418
|
formula?: string;
|
|
376
419
|
children?: PlanComponent[];
|
|
@@ -435,6 +478,10 @@ export declare function isImageBackedComponent(comp: PlanComponent): boolean;
|
|
|
435
478
|
|
|
436
479
|
export declare function isReportDate(value: string): boolean;
|
|
437
480
|
|
|
481
|
+
export declare function isReportMonth(value: string): boolean;
|
|
482
|
+
|
|
483
|
+
export declare function isReportYear(value: string): boolean;
|
|
484
|
+
|
|
438
485
|
export declare function isRichText(comp: PlanComponent): boolean;
|
|
439
486
|
|
|
440
487
|
/** 默认行高倍数(基线距 = 字号 × 该系数) */
|
|
@@ -471,6 +518,8 @@ export declare interface ListColumn {
|
|
|
471
518
|
|
|
472
519
|
export declare interface ListComponent {
|
|
473
520
|
kind: "list";
|
|
521
|
+
/** Opaque serializable layout annotations; interpreted only by explicit optional adapters. */
|
|
522
|
+
meta?: Record<string, unknown>;
|
|
474
523
|
id?: string;
|
|
475
524
|
/** 宽表标记用于连续 Excel;不改变低层列表的列宽和分页算法。 */
|
|
476
525
|
layout?: "page" | "wide";
|
|
@@ -480,6 +529,10 @@ export declare interface ListComponent {
|
|
|
480
529
|
topMm: number;
|
|
481
530
|
widthMm: number;
|
|
482
531
|
dataset: string;
|
|
532
|
+
/** Headerless record/region bindings do not allocate a synthetic list header. */
|
|
533
|
+
header?: boolean;
|
|
534
|
+
/** A fixed record region rejects multiple rows instead of dropping source data. */
|
|
535
|
+
cardinality?: "record";
|
|
483
536
|
/** 数据集中稳定业务主键的字段名;省略时编辑仅有计划内坐标。 */
|
|
484
537
|
rowKey?: string;
|
|
485
538
|
revisionField?: string;
|
|
@@ -506,6 +559,8 @@ export declare interface ListComponent {
|
|
|
506
559
|
computed?: ComputedField[];
|
|
507
560
|
/** Dynamic pivot of the current source dataset, with read-only derived identities. */
|
|
508
561
|
matrix?: MatrixTableOptions;
|
|
562
|
+
/** Full ordered hierarchy; source parent values and descendant-leaf rollups are explicit. */
|
|
563
|
+
tree?: TreeTableOptions;
|
|
509
564
|
/** Explicit row visibility; hidden rows do not participate in summaries. */
|
|
510
565
|
rowVisibleWhen?: StyleRule["when"];
|
|
511
566
|
/** Master/detail relation is keyed by business identity, never by display row index. */
|
|
@@ -519,6 +574,9 @@ export declare interface ListDetail {
|
|
|
519
574
|
parentKey: string;
|
|
520
575
|
foreignKey: string;
|
|
521
576
|
rowKey?: string;
|
|
577
|
+
/** 子表独立的并发契约;省略时不继承主表字段。 */
|
|
578
|
+
revisionField?: string;
|
|
579
|
+
sourceTokenField?: string;
|
|
522
580
|
columns: ListColumn[];
|
|
523
581
|
rowHeightMm?: number;
|
|
524
582
|
header?: boolean;
|
|
@@ -727,6 +785,9 @@ export declare function parseReportCellInput(context: ReportCellContext, input:
|
|
|
727
785
|
/** Bounded parser for clipboard data; invalid quotes are rejected before edits are built. */
|
|
728
786
|
export declare function parseReportClipboard(text: string, maxCells?: number): string[][];
|
|
729
787
|
|
|
788
|
+
/** Only complete, ordered, real calendar dates are accepted; there is no timezone conversion. */
|
|
789
|
+
export declare function parseReportDateRange(value: string): ReportDateRange | undefined;
|
|
790
|
+
|
|
730
791
|
/** 校验文件 JSON 文本或接口返回的未知对象,返回独立模板快照。 */
|
|
731
792
|
export declare function parseReportTemplate(input: unknown): ReportTemplateDocument;
|
|
732
793
|
|
|
@@ -772,6 +833,7 @@ export declare interface PlanGrid {
|
|
|
772
833
|
}
|
|
773
834
|
|
|
774
835
|
export declare interface PlanPage {
|
|
836
|
+
meta?: Record<string, unknown>;
|
|
775
837
|
/** wide 表示完整自然列宽;页面仅为预览的垂直窗口分段。 */
|
|
776
838
|
layout?: "page" | "wide";
|
|
777
839
|
pageWidthMm: number;
|
|
@@ -807,6 +869,12 @@ export declare function ptToPx(pt: number, dpi?: number): number;
|
|
|
807
869
|
|
|
808
870
|
export declare function pxToMm(value: number, dpi?: number): number;
|
|
809
871
|
|
|
872
|
+
/** Registers only context references/fingerprint. Read-only loads never deep-copy data or reflow. */
|
|
873
|
+
export declare function registerReportEditSession(initial: RenderPlan, registration: ReportEditSessionRegistration): ReportEditSession;
|
|
874
|
+
|
|
875
|
+
/** Reflow changes coordinates; history targets are resolved by business source every time. */
|
|
876
|
+
export declare function relocateReportCellEdits(plan: RenderPlan, edits: readonly ReportCellEdit[], value: "previousValue" | "value"): ReportCellInput[];
|
|
877
|
+
|
|
810
878
|
export declare const RENDER_PLAN_SCHEMA_VERSION = "1.0.0-mach";
|
|
811
879
|
|
|
812
880
|
export declare function renderComponent(comp: PlanComponent, dpi: number, options: RenderOptions, doc: Document): HTMLElement;
|
|
@@ -820,6 +888,8 @@ export declare function renderPage(page: PlanPage, dpi: number, options: RenderO
|
|
|
820
888
|
|
|
821
889
|
export declare interface RenderPlan {
|
|
822
890
|
schemaVersion: string;
|
|
891
|
+
/** 编辑需要模板重算上下文;跨 Worker/JSON 保留要求,但不声明本地会话可用。 */
|
|
892
|
+
requiresRecalculation?: boolean;
|
|
823
893
|
pages: PlanPage[];
|
|
824
894
|
}
|
|
825
895
|
|
|
@@ -902,7 +972,7 @@ export declare class ReportCellEditError extends Error {
|
|
|
902
972
|
constructor(code: ReportCellEditErrorCode);
|
|
903
973
|
}
|
|
904
974
|
|
|
905
|
-
export declare type ReportCellEditErrorCode = "missing" | "readonly" | "number" | "boolean" | "conflict" | "duplicate" | "limit" | "atomic" | "clipboard";
|
|
975
|
+
export declare type ReportCellEditErrorCode = "missing" | "readonly" | "number" | "boolean" | "conflict" | "duplicate" | "limit" | "atomic" | "clipboard" | "recalculation";
|
|
906
976
|
|
|
907
977
|
export declare function reportCellEditKey(edit: Pick<ReportCellEdit, "address" | "source" | "table">): string;
|
|
908
978
|
|
|
@@ -950,7 +1020,7 @@ export declare interface ReportCellInput {
|
|
|
950
1020
|
value: ReportCellValue;
|
|
951
1021
|
}
|
|
952
1022
|
|
|
953
|
-
export declare type ReportCellReadOnlyReason = "cell" | "formula" | "complex" | "structure";
|
|
1023
|
+
export declare type ReportCellReadOnlyReason = "cell" | "formula" | "complex" | "structure" | "derived";
|
|
954
1024
|
|
|
955
1025
|
/** 可持久化的业务身份与计划坐标独立;权限及并发校验仍由业务服务器执行。 */
|
|
956
1026
|
export declare interface ReportCellSource {
|
|
@@ -973,6 +1043,12 @@ export declare type ReportCellValue = string | number | boolean | null;
|
|
|
973
1043
|
|
|
974
1044
|
export declare type ReportCellValueType = NonNullable<GridCell["valueType"]>;
|
|
975
1045
|
|
|
1046
|
+
/** Wire values deliberately remain strings in browsers, Workers and backend runtimes. */
|
|
1047
|
+
export declare interface ReportDateRange {
|
|
1048
|
+
start: string;
|
|
1049
|
+
end: string;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
976
1052
|
export declare interface ReportDefinition {
|
|
977
1053
|
/** 静态模板或宿主提供的异步模板加载器;动态模板默认每次重新读取,不缓存版本。 */
|
|
978
1054
|
template: ReportTemplate | ReportTemplateLoader;
|
|
@@ -1015,6 +1091,10 @@ export declare interface ReportEditConflict {
|
|
|
1015
1091
|
revision?: string | number;
|
|
1016
1092
|
}
|
|
1017
1093
|
|
|
1094
|
+
export declare interface ReportEditPreparationOptions {
|
|
1095
|
+
signal?: AbortSignal;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1018
1098
|
export declare interface ReportEditResult {
|
|
1019
1099
|
/** A successful result may advance concurrency tokens for the affected dataset. */
|
|
1020
1100
|
revision?: string | number;
|
|
@@ -1023,6 +1103,22 @@ export declare interface ReportEditResult {
|
|
|
1023
1103
|
conflicts?: readonly ReportEditConflict[];
|
|
1024
1104
|
}
|
|
1025
1105
|
|
|
1106
|
+
export declare interface ReportEditSession {
|
|
1107
|
+
readonly plan: RenderPlan;
|
|
1108
|
+
prepare(plan: RenderPlan, batch: ReportEditBatch, options?: ReportEditPreparationOptions): Promise<ReportPreparedEdit>;
|
|
1109
|
+
prepareHistory(plan: RenderPlan, edits: readonly ReportCellEdit[], value: "previousValue" | "value", requestId: string, options?: ReportEditPreparationOptions): Promise<ReportHistoryPreparation>;
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
declare interface ReportEditSessionPart {
|
|
1113
|
+
template: ReportTemplate;
|
|
1114
|
+
datasets: DatasetRows;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
export declare interface ReportEditSessionRegistration {
|
|
1118
|
+
parts: readonly ReportEditSessionPart[];
|
|
1119
|
+
rebuild(parts: readonly ReportEditSessionPart[], signal?: AbortSignal): Promise<RenderPlan>;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1026
1122
|
declare type ReportExpression = {
|
|
1027
1123
|
field: string;
|
|
1028
1124
|
} | {
|
|
@@ -1066,6 +1162,20 @@ export declare interface ReportFieldContract {
|
|
|
1066
1162
|
unit?: string;
|
|
1067
1163
|
}
|
|
1068
1164
|
|
|
1165
|
+
export declare interface ReportFlowBand {
|
|
1166
|
+
/** Exact stable component IDs. Static components use nid, lists use id. */
|
|
1167
|
+
componentIds: string[];
|
|
1168
|
+
/** Source-template coordinates; following bands keep their original gap. */
|
|
1169
|
+
topMm: number;
|
|
1170
|
+
heightMm: number;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
export declare interface ReportHistoryPreparation {
|
|
1174
|
+
batch: ReportEditBatch;
|
|
1175
|
+
prepared: ReportPreparedEdit;
|
|
1176
|
+
contexts: readonly ReportCellContext[];
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1069
1179
|
/** 取数与排版共同使用的请求上下文;取消只影响本次调用。 */
|
|
1070
1180
|
export declare interface ReportLoadContext {
|
|
1071
1181
|
reportId: string;
|
|
@@ -1075,13 +1185,17 @@ export declare interface ReportLoadContext {
|
|
|
1075
1185
|
|
|
1076
1186
|
export declare function reportOutputDiagnostics(plan: RenderPlan, format: OutputFormat, options: OutputDiagnosticOptions): OutputDiagnostic[];
|
|
1077
1187
|
|
|
1188
|
+
export declare interface ReportPageFlow {
|
|
1189
|
+
bands: ReportFlowBand[];
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1078
1192
|
/** 报表参数定义(声明式,模板自描述参数面:渲染组件据此生成查询面板) */
|
|
1079
1193
|
export declare interface ReportParamDef {
|
|
1080
1194
|
/** 参数名(传入 params,与数据集 SQL #{field} 绑定对应) */
|
|
1081
1195
|
field: string;
|
|
1082
1196
|
/** 显示名(缺省用 field) */
|
|
1083
1197
|
label?: string;
|
|
1084
|
-
type?: "text" | "number" | "date" | "select";
|
|
1198
|
+
type?: "text" | "number" | "date" | "month" | "year" | "dateRange" | "select";
|
|
1085
1199
|
/** select 选项 */
|
|
1086
1200
|
options?: Array<{
|
|
1087
1201
|
label: string;
|
|
@@ -1090,7 +1204,7 @@ export declare interface ReportParamDef {
|
|
|
1090
1204
|
defaultValue?: string;
|
|
1091
1205
|
required?: boolean;
|
|
1092
1206
|
placeholder?: string;
|
|
1093
|
-
/**
|
|
1207
|
+
/** 数字上下界;日期/月/年使用对应规范字符串;dateRange 对两端使用 YYYY-MM-DD 边界(含边界)。 */
|
|
1094
1208
|
min?: number | string;
|
|
1095
1209
|
max?: number | string;
|
|
1096
1210
|
minLength?: number;
|
|
@@ -1124,6 +1238,13 @@ export declare class ReportParamValidationError extends Error {
|
|
|
1124
1238
|
constructor(issues: readonly ReportParamIssue[]);
|
|
1125
1239
|
}
|
|
1126
1240
|
|
|
1241
|
+
export declare interface ReportPreparedEdit {
|
|
1242
|
+
/** Calculated preview; no source/session state changes until commit succeeds. */
|
|
1243
|
+
readonly plan: RenderPlan;
|
|
1244
|
+
/** Call after persistence. A stale or repeated commit fails instead of publishing mixed state. */
|
|
1245
|
+
commit(result?: void | ReportEditResult): RenderPlan;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1127
1248
|
/** 查询是唯一基础能力;权限、HTTP、数据库和事务都留在宿主适配器内。 */
|
|
1128
1249
|
export declare interface ReportProvider {
|
|
1129
1250
|
query(context: ReportLoadContext): ReportQueryResult | Promise<ReportQueryResult>;
|
|
@@ -1229,6 +1350,38 @@ export declare interface ReportTemplate {
|
|
|
1229
1350
|
pages: TemplatePage[];
|
|
1230
1351
|
}
|
|
1231
1352
|
|
|
1353
|
+
export declare interface ReportTemplateCatalogEntry extends ReportTemplateSummary {
|
|
1354
|
+
category?: string;
|
|
1355
|
+
tags?: string[];
|
|
1356
|
+
updatedAt?: string;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
export declare interface ReportTemplateCatalogPage {
|
|
1360
|
+
items: ReportTemplateCatalogEntry[];
|
|
1361
|
+
next?: string;
|
|
1362
|
+
categories?: Array<{
|
|
1363
|
+
id: string;
|
|
1364
|
+
label: string;
|
|
1365
|
+
count?: number;
|
|
1366
|
+
}>;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
/** Discovery metadata is separate from executable templates and from enterprise account authorization. */
|
|
1370
|
+
export declare interface ReportTemplateCatalogProvider {
|
|
1371
|
+
search(request: ReportTemplateCatalogQuery): Promise<ReportTemplateCatalogPage>;
|
|
1372
|
+
get(id: string, context: {
|
|
1373
|
+
signal?: AbortSignal;
|
|
1374
|
+
}): Promise<ReportTemplateDocument | undefined>;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
export declare interface ReportTemplateCatalogQuery {
|
|
1378
|
+
query?: string;
|
|
1379
|
+
category?: string;
|
|
1380
|
+
cursor?: string;
|
|
1381
|
+
limit?: number;
|
|
1382
|
+
signal?: AbortSignal;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1232
1385
|
export declare interface ReportTemplateChange {
|
|
1233
1386
|
kind: "added" | "removed" | "modified" | "moved";
|
|
1234
1387
|
category: "metadata" | "structure" | "binding" | "calculation" | "format";
|
|
@@ -1322,7 +1475,7 @@ export declare interface ReportTemplateReview {
|
|
|
1322
1475
|
}
|
|
1323
1476
|
|
|
1324
1477
|
export declare interface ReportTemplateReviewIssue {
|
|
1325
|
-
code: "template" | "compatibility" | "dataset" | "field" | "sample" | "layout" | "output";
|
|
1478
|
+
code: "template" | "compatibility" | "dataset" | "field" | "sample" | "layout" | "output" | "params";
|
|
1326
1479
|
severity: "error" | "warning";
|
|
1327
1480
|
path: string;
|
|
1328
1481
|
message: string;
|
|
@@ -1559,6 +1712,9 @@ export declare interface TemplatePage {
|
|
|
1559
1712
|
marginLeftMm?: number;
|
|
1560
1713
|
marginRightMm?: number;
|
|
1561
1714
|
components: TemplateComponent[];
|
|
1715
|
+
/** Explicit vertical bands preserve source gaps as dynamic regions expand. */
|
|
1716
|
+
flow?: ReportPageFlow;
|
|
1717
|
+
meta?: Record<string, unknown>;
|
|
1562
1718
|
}
|
|
1563
1719
|
|
|
1564
1720
|
export declare interface TemplateStoreWriteOptions {
|
|
@@ -1591,6 +1747,46 @@ export declare function toExcelNumberFormat(format?: ColumnFormat): string | und
|
|
|
1591
1747
|
|
|
1592
1748
|
export declare function toNumber(value: unknown): number | null;
|
|
1593
1749
|
|
|
1750
|
+
export declare interface TreeRow {
|
|
1751
|
+
row: DataRow;
|
|
1752
|
+
original: DataRow;
|
|
1753
|
+
key: string | number;
|
|
1754
|
+
depth: number;
|
|
1755
|
+
hasChildren: boolean;
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
export declare class TreeRowLimitError extends Error {
|
|
1759
|
+
readonly limit: number;
|
|
1760
|
+
readonly code = "tree-row-limit";
|
|
1761
|
+
constructor(limit: number);
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
export declare interface TreeTable {
|
|
1765
|
+
rows: DataRow[];
|
|
1766
|
+
entries: TreeRow[];
|
|
1767
|
+
leaves: DataRow[];
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
/** A serialized tree contract. Sibling and root order follow input order. */
|
|
1771
|
+
export declare interface TreeTableOptions {
|
|
1772
|
+
input: "flat" | "nested";
|
|
1773
|
+
idField: string;
|
|
1774
|
+
/** Flat roots have null/undefined parent values. */
|
|
1775
|
+
parentField?: string;
|
|
1776
|
+
/** Nested child arrays, defaults to children. Every node still needs an ID. */
|
|
1777
|
+
childrenField?: string;
|
|
1778
|
+
labelField: string;
|
|
1779
|
+
indentMm?: number;
|
|
1780
|
+
orphan?: "error" | "root";
|
|
1781
|
+
/** Source preserves parent values; leaf-aggregate derives only parents from descendant leaves. */
|
|
1782
|
+
parentValues?: "source" | "leaf-aggregate";
|
|
1783
|
+
aggregates?: AggregateDefinition[];
|
|
1784
|
+
maxRows?: number;
|
|
1785
|
+
maxDepth?: number;
|
|
1786
|
+
/** Bounded leaf-to-ancestor aggregate work; default one million. */
|
|
1787
|
+
maxAggregationVisits?: number;
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1594
1790
|
export declare function validateComponent(comp: unknown, path: string, errors: ValidationError[], warnings?: ValidationError[]): void;
|
|
1595
1791
|
|
|
1596
1792
|
/** 浏览器/Node共用的只读值校验;返回精确路径,不以0或空数组掩盖接口结构错误。 */
|
|
@@ -1617,6 +1813,9 @@ export declare function validateReportTemplate(input: unknown): ValidationResult
|
|
|
1617
1813
|
|
|
1618
1814
|
export declare function validateReportTemplateDocument(input: unknown): ValidationResult;
|
|
1619
1815
|
|
|
1816
|
+
/** Validates runtime inputs too, so direct core calls cannot bypass template checks. */
|
|
1817
|
+
export declare function validateTreeOptions(options: TreeTableOptions): void;
|
|
1818
|
+
|
|
1620
1819
|
export declare interface ValidationError {
|
|
1621
1820
|
path: string;
|
|
1622
1821
|
message: string;
|