@agile-team/mach-report 2.11.2 → 2.13.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 +30 -5
- package/THIRD_PARTY_NOTICES.md +270 -0
- package/dist/{ExcelBindingWizard-LWX6G1A2.js → ExcelBindingWizard-CeAf4QSE.js} +2 -2
- package/dist/{ExcelBindingWizard-a4kslPHF.cjs → ExcelBindingWizard-y0mT-AHR.cjs} +1 -1
- package/dist/{ReportBatchPanel-B5ClP9tm.js → ReportBatchPanel-CW2HV9I8.js} +1 -1
- package/dist/{ReportBatchPanel-Dc-SDkYA.cjs → ReportBatchPanel-Fp1ePFag.cjs} +1 -1
- package/dist/ReportPreview-BN6fk7Wz.cjs +6 -0
- package/dist/ReportPreview-D2Jkyh1U.js +4243 -0
- package/dist/{RuleEditor-C2QsOHOs.cjs → RuleEditor-ChRzNQuF.cjs} +1 -1
- package/dist/{RuleEditor-D9wQHrkf.js → RuleEditor-DzAmW5YH.js} +1 -1
- package/dist/analytics.d.cts +28 -0
- package/dist/analytics.d.ts +28 -0
- package/dist/assets-C2U-e-Sz.cjs +4 -0
- package/dist/assets-Q0wUwNrV.js +217 -0
- package/dist/code-options-BKXXY7NI.js +18 -0
- package/dist/code-options-BUTChiZZ.cjs +1 -0
- package/dist/codes.cjs +9 -0
- package/dist/codes.d.cts +223 -0
- package/dist/codes.d.ts +223 -0
- package/dist/codes.js +26917 -0
- package/dist/config-Bb7RiIO5.cjs +1 -0
- package/dist/{config-B612mw0x.js → config-XVwG87IA.js} +4 -0
- package/dist/designer.cjs +2 -2
- package/dist/designer.d.cts +283 -0
- package/dist/designer.d.ts +283 -0
- package/dist/designer.js +2852 -2010
- package/dist/grid-strokes-Cr7DwUux.cjs +1 -0
- package/dist/grid-strokes-DyyG1q_o.js +53 -0
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +105 -1
- package/dist/index.d.ts +105 -1
- package/dist/index.js +488 -439
- package/dist/pdf.cjs +76 -59
- package/dist/pdf.d.cts +51 -0
- package/dist/pdf.d.ts +51 -0
- package/dist/pdf.js +32128 -32048
- package/dist/{plugin-Cd5G2QQn.js → plugin-D4wizDXB.js} +1 -1
- package/dist/{plugin-BDTU4D94.cjs → plugin-DzS6pxTA.cjs} +1 -1
- package/dist/record-bindings-By_UKZ2g.cjs +1 -0
- package/dist/{list-cell-ClFra1zS.js → record-bindings-D-5jQlTj.js} +67 -44
- package/dist/{region-binding-workflow-DhQvu1co.cjs → region-binding-workflow-BzfbxRiR.cjs} +1 -1
- package/dist/{region-binding-workflow-CXDmt9Bs.js → region-binding-workflow-CcUq8W2Q.js} +1 -1
- package/dist/server/node.d.cts +52 -1
- package/dist/server/node.d.ts +52 -1
- package/dist/server-node.cjs +1 -1
- package/dist/server-node.js +239 -210
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +95 -3
- package/dist/server.d.ts +95 -3
- package/dist/server.js +457 -434
- package/dist/style.css +1 -1
- package/dist/{template-registry-WNXdkiET.js → template-registry-BjE1VS6g.js} +221 -157
- package/dist/template-registry-D3SjENi6.cjs +1 -0
- package/dist/template-review-DGwWOoCv.cjs +2 -0
- package/dist/{template-review-BdcXSYbx.js → template-review-PgEe_Wr9.js} +792 -666
- package/dist/validate-BJ5HIWY8.cjs +1 -0
- package/dist/validate-DbgEM1Hh.js +163 -0
- package/dist/vue/async.d.cts +125 -2
- package/dist/vue/async.d.ts +125 -2
- package/dist/vue/index.d.cts +121 -8
- package/dist/vue/index.d.ts +121 -8
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +5 -5
- package/dist/{workbook-session-BKOTwcoq.js → workbook-session-BPb3TMnT.js} +1 -1
- package/dist/{workbook-session-CLYLhZWu.cjs → workbook-session-DNa2RHNG.cjs} +1 -1
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +52 -1
- package/dist/worker.d.ts +52 -1
- package/dist/worker.js +2 -2
- package/dist/xlsx.cjs +1 -1
- package/dist/xlsx.d.cts +40 -0
- package/dist/xlsx.d.ts +40 -0
- package/dist/xlsx.js +3 -3
- package/package.json +16 -3
- package/dist/ReportPreview-DWXROHBP.cjs +0 -6
- package/dist/ReportPreview-DiNXhQI0.js +0 -4138
- package/dist/assets-Bu6UohJx.cjs +0 -1
- package/dist/assets-DegqDNqY.js +0 -160
- package/dist/config-BRoLo2oj.cjs +0 -1
- package/dist/list-cell-BuYn4tGF.cjs +0 -1
- package/dist/template-registry-ukBGlm8N.cjs +0 -1
- package/dist/template-review-BXp2oyqg.cjs +0 -1
- package/dist/textwrap-CWHyzkBH.cjs +0 -4
- package/dist/textwrap-DE1kgcJB.js +0 -110
- package/dist/validate-7s0yn6ii.js +0 -148
- package/dist/validate-DsRiNw8h.cjs +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -113,6 +113,18 @@ export declare function cloneReportTemplate(document: ReportTemplateDocument, id
|
|
|
113
113
|
name: string;
|
|
114
114
|
}): ReportTemplateDocument;
|
|
115
115
|
|
|
116
|
+
/** Serializable symbol settings. Encoders remain in the optional /codes entry. */
|
|
117
|
+
export declare interface CodeOptions {
|
|
118
|
+
/** Explicit content, including an empty value, takes precedence over legacy fallbackText. */
|
|
119
|
+
value?: string;
|
|
120
|
+
symbology?: "code128" | "code39" | "ean13" | "ean8";
|
|
121
|
+
errorCorrection?: "L" | "M" | "Q" | "H";
|
|
122
|
+
/** White modules around a symbol: QR >=4, linear >=10, EAN >=11. */
|
|
123
|
+
quietZoneModules?: number;
|
|
124
|
+
/** Human-readable content below a linear barcode. */
|
|
125
|
+
showText?: boolean;
|
|
126
|
+
}
|
|
127
|
+
|
|
116
128
|
/**
|
|
117
129
|
* 列值格式化(声明式、JSON 可序列化)。
|
|
118
130
|
* 在 paginate 的 cellText 出口统一消费:格式化发生在进 RenderPlan 之前,
|
|
@@ -139,6 +151,20 @@ export declare type ColumnFormat = {
|
|
|
139
151
|
/** 同一字段契约生成列语义和表头,业务侧无需复制另一份字段清单。 */
|
|
140
152
|
export declare function columnsFromContract(contract: DatasetContract, overrides?: Record<string, Partial<TableTemplateColumn>>): TableTemplateColumn[];
|
|
141
153
|
|
|
154
|
+
/** A literal own field of the current label record; expressions and paths are not evaluated. */
|
|
155
|
+
export declare interface ComponentBinding {
|
|
156
|
+
field: string;
|
|
157
|
+
format?: ValueFormat;
|
|
158
|
+
prefix?: string;
|
|
159
|
+
suffix?: string;
|
|
160
|
+
emptyText?: string;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export declare interface ComponentBindingContext {
|
|
164
|
+
dataset?: string;
|
|
165
|
+
rowIndex?: number;
|
|
166
|
+
}
|
|
167
|
+
|
|
142
168
|
export declare interface ComponentImageContext {
|
|
143
169
|
readonly component: Readonly<PlanComponent>;
|
|
144
170
|
readonly pageIndex: number;
|
|
@@ -219,6 +245,9 @@ export declare function createCanvasPager(plan: RenderPlan, options?: CanvasPage
|
|
|
219
245
|
/** 兼容旧 API:默认启发式测量 */
|
|
220
246
|
export declare function createHeuristicMeasurer(): TextMeasurer;
|
|
221
247
|
|
|
248
|
+
/** One declaration covers record binding, fixed paper size, copies and ordered multi-face labels. */
|
|
249
|
+
export declare function createLabelTemplate(options: LabelTemplateOptions): ReportTemplate;
|
|
250
|
+
|
|
222
251
|
/** Local catalog reference; an enterprise host supplies the same search/get contract with server filtering. */
|
|
223
252
|
export declare function createLocalTemplateCatalog(input: LocalTemplateCatalogItem[]): ReportTemplateCatalogProvider;
|
|
224
253
|
|
|
@@ -323,12 +352,22 @@ export declare const DEFAULT_FONT_FAMILY = "\"Microsoft YaHei\", sans-serif";
|
|
|
323
352
|
/** 默认字号(pt) */
|
|
324
353
|
export declare const DEFAULT_FONT_PT = 10.5;
|
|
325
354
|
|
|
355
|
+
/** Labels are bounded even when a host omits its normal report page budget. */
|
|
356
|
+
export declare const DEFAULT_LABEL_PAGE_LIMIT = 10000;
|
|
357
|
+
|
|
326
358
|
/** 默认描边色 */
|
|
327
359
|
export declare const DEFAULT_STROKE_COLOR = "#333333";
|
|
328
360
|
|
|
329
361
|
/** 默认文本色 */
|
|
330
362
|
export declare const DEFAULT_TEXT_COLOR = "#000000";
|
|
331
363
|
|
|
364
|
+
/**
|
|
365
|
+
* Flat label integration for the same Vue/Node source pipeline: template + rows/load.
|
|
366
|
+
* It maps the one dataset and optional contract without caching or converting business values.
|
|
367
|
+
* Dynamic templates and multiple datasets continue to use defineReport.
|
|
368
|
+
*/
|
|
369
|
+
export declare function defineLabelReport(options: LabelReportDefinitionOptions): ReportDefinition;
|
|
370
|
+
|
|
332
371
|
/** 类型推导业务接口的响应,包内完成字段映射后交给同一分页流程。 */
|
|
333
372
|
export declare function defineReport<TData>(definition: ReportDefinitionOptions<TData>): ReportDefinition;
|
|
334
373
|
|
|
@@ -480,6 +519,36 @@ export declare function isReportYear(value: string): boolean;
|
|
|
480
519
|
|
|
481
520
|
export declare function isRichText(comp: PlanComponent): boolean;
|
|
482
521
|
|
|
522
|
+
declare interface LabelReportDefinitionBase extends Pick<ReportDefinition, "params" | "pagination" | "dataValidation"> {
|
|
523
|
+
/** An existing fixed label template. Its repeat.dataset supplies the dataset name. */
|
|
524
|
+
template: ReportTemplate;
|
|
525
|
+
/** The single label dataset's contract; no dataset-name wrapper is needed. */
|
|
526
|
+
dataSchema?: DatasetContract;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
export declare type LabelReportDefinitionOptions = LabelReportDefinitionBase & ({
|
|
530
|
+
rows: LabelReportRows;
|
|
531
|
+
load?: never;
|
|
532
|
+
} | {
|
|
533
|
+
rows?: never;
|
|
534
|
+
load: (context: ReportLoadContext) => LabelReportRows | Promise<LabelReportRows>;
|
|
535
|
+
});
|
|
536
|
+
|
|
537
|
+
/** Named business row interfaces and readonly arrays need no index signature or conversion. */
|
|
538
|
+
export declare type LabelReportRows = readonly object[];
|
|
539
|
+
|
|
540
|
+
export declare interface LabelTemplateOptions extends ReportTemplateRepeat {
|
|
541
|
+
widthMm?: number;
|
|
542
|
+
heightMm?: number;
|
|
543
|
+
params?: ReportParamDef[];
|
|
544
|
+
/** A single face. Mutually exclusive with pages. */
|
|
545
|
+
components?: TemplateComponent[];
|
|
546
|
+
pages?: LabelTemplatePage[];
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
/** Each face inherits the label size; declare several faces for front/back or companion labels. */
|
|
550
|
+
export declare type LabelTemplatePage = Pick<TemplatePage, "components" | "meta"> & Partial<Pick<TemplatePage, "widthMm" | "heightMm">>;
|
|
551
|
+
|
|
483
552
|
/** 默认行高倍数(基线距 = 字号 × 该系数) */
|
|
484
553
|
export declare const LINE_HEIGHT = 1.35;
|
|
485
554
|
|
|
@@ -798,6 +867,10 @@ export declare function parseReportDateRange(value: string): ReportDateRange | u
|
|
|
798
867
|
export declare function parseReportTemplate(input: unknown): ReportTemplateDocument;
|
|
799
868
|
|
|
800
869
|
export declare interface PlanComponent {
|
|
870
|
+
/** Optional QR/barcode encoding configuration; no encoder is loaded by the core. */
|
|
871
|
+
code?: CodeOptions;
|
|
872
|
+
/** Template-only binding; resolved and removed before constructing the output plan. */
|
|
873
|
+
binding?: ComponentBinding;
|
|
801
874
|
/** Template page furniture repeats per page and reserves its vertical band. */
|
|
802
875
|
pageAnchor?: "header" | "footer";
|
|
803
876
|
kind: ComponentKind;
|
|
@@ -923,6 +996,14 @@ export declare function renderPlanToImages(plan: RenderPlan, options?: ImageRend
|
|
|
923
996
|
/** 模板存储文档版本;与渲染计划版本独立演进。 */
|
|
924
997
|
export declare const REPORT_TEMPLATE_DOCUMENT_VERSION = "1.0";
|
|
925
998
|
|
|
999
|
+
export declare class ReportBindingError extends Error {
|
|
1000
|
+
readonly path: string;
|
|
1001
|
+
readonly rowIndex?: number | undefined;
|
|
1002
|
+
readonly field?: string | undefined;
|
|
1003
|
+
readonly code = "report-binding";
|
|
1004
|
+
constructor(path: string, message: string, rowIndex?: number | undefined, field?: string | undefined);
|
|
1005
|
+
}
|
|
1006
|
+
|
|
926
1007
|
export declare class ReportCalculationError extends Error {
|
|
927
1008
|
readonly code: ReportCalculationErrorCode;
|
|
928
1009
|
constructor(code: ReportCalculationErrorCode);
|
|
@@ -1334,7 +1415,7 @@ export declare class ReportSourceError extends Error {
|
|
|
1334
1415
|
export declare interface ReportTaskEvent {
|
|
1335
1416
|
taskId: string;
|
|
1336
1417
|
correlationId?: string;
|
|
1337
|
-
stage: "query" | "validate" | "layout" | "encode";
|
|
1418
|
+
stage: "query" | "validate" | "layout" | "assets" | "encode";
|
|
1338
1419
|
status: "started" | "completed" | "failed";
|
|
1339
1420
|
reportId?: string;
|
|
1340
1421
|
completed?: number;
|
|
@@ -1353,6 +1434,8 @@ export declare interface ReportTemplate {
|
|
|
1353
1434
|
schemaVersion?: string;
|
|
1354
1435
|
/** 参数定义(可选;宿主也可经 ReportPreview 的 paramDefs prop 提供,prop 优先) */
|
|
1355
1436
|
params?: ReportParamDef[];
|
|
1437
|
+
/** Fixed label pages repeat in record → copy → template-page order. */
|
|
1438
|
+
repeat?: ReportTemplateRepeat;
|
|
1356
1439
|
pages: TemplatePage[];
|
|
1357
1440
|
}
|
|
1358
1441
|
|
|
@@ -1476,6 +1559,16 @@ export declare interface ReportTemplateRegistry {
|
|
|
1476
1559
|
remove(id: string): boolean;
|
|
1477
1560
|
}
|
|
1478
1561
|
|
|
1562
|
+
/** Every record emits its copies, each containing all template pages in their original order. */
|
|
1563
|
+
export declare interface ReportTemplateRepeat {
|
|
1564
|
+
dataset: string;
|
|
1565
|
+
rowKey?: string;
|
|
1566
|
+
/** Whole copies per record, 1..1000. The field value must be a number, never a numeric string. */
|
|
1567
|
+
copies?: number | {
|
|
1568
|
+
field: string;
|
|
1569
|
+
};
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1479
1572
|
export declare interface ReportTemplateReview {
|
|
1480
1573
|
ok: boolean;
|
|
1481
1574
|
changes?: ReportTemplateDiff;
|
|
@@ -1497,6 +1590,8 @@ export declare interface ReportTemplateReviewIssue {
|
|
|
1497
1590
|
pageIndex?: number;
|
|
1498
1591
|
componentIndex?: number;
|
|
1499
1592
|
field?: string;
|
|
1593
|
+
/** Original structured output finding, retained for trusted publication resource handling. */
|
|
1594
|
+
diagnostic?: OutputDiagnostic;
|
|
1500
1595
|
}
|
|
1501
1596
|
|
|
1502
1597
|
export declare interface ReportTemplateReviewOptions {
|
|
@@ -1547,6 +1642,9 @@ export declare interface ReportTemplateVersion {
|
|
|
1547
1642
|
*/
|
|
1548
1643
|
export declare function resolveBoxBorders(style: Pick<ComponentStyle, "borderTop" | "borderRight" | "borderBottom" | "borderLeft"> | undefined): BoxBorders;
|
|
1549
1644
|
|
|
1645
|
+
/** The shared binding semantics for actual pagination and designer samples; never evaluates code. */
|
|
1646
|
+
export declare function resolveComponentBinding(binding: ComponentBinding, row: Record<string, unknown>, context?: ComponentBindingContext): string;
|
|
1647
|
+
|
|
1550
1648
|
/** 解析后的字号(px 值已按 dpi 换算;pt 值供 PDF 使用) */
|
|
1551
1649
|
export declare interface ResolvedFontSize {
|
|
1552
1650
|
fontSizePt: number;
|
|
@@ -1680,6 +1778,9 @@ export declare class TemplateBuilder {
|
|
|
1680
1778
|
readonly pages: TemplatePage[];
|
|
1681
1779
|
private pending;
|
|
1682
1780
|
private templateParams;
|
|
1781
|
+
private templateRepeat;
|
|
1782
|
+
/** Fixed label pages repeat in record → copy → template-page order. */
|
|
1783
|
+
repeat(options: ReportTemplateRepeat): this;
|
|
1683
1784
|
/**
|
|
1684
1785
|
* 声明报表参数(链式,可放在 .page() 前后任意位置):
|
|
1685
1786
|
* 渲染组件据此自动生成查询面板(也可由 paramDefs prop 提供,prop 优先)。
|
|
@@ -1841,6 +1942,9 @@ export declare interface ValidationResult {
|
|
|
1841
1942
|
warnings: ValidationError[];
|
|
1842
1943
|
}
|
|
1843
1944
|
|
|
1945
|
+
/** The same declarative formatting used by list columns, before any output backend. */
|
|
1946
|
+
export declare type ValueFormat = ColumnFormat;
|
|
1947
|
+
|
|
1844
1948
|
/**
|
|
1845
1949
|
* 文本折行:
|
|
1846
1950
|
* - CJK 字符任意位置可断(与既有行为一致)
|