@agile-team/mach-report 1.2.2 → 2.1.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.
Files changed (88) hide show
  1. package/LICENSE +2 -4
  2. package/LICENSING.md +15 -0
  3. package/README.md +240 -92
  4. package/dist/ReportPreview-Dwdsyk9b.js +1558 -0
  5. package/dist/ReportPreview-VHAIfsz1.cjs +6 -0
  6. package/dist/index.cjs +5 -5
  7. package/dist/index.d.cts +738 -14
  8. package/dist/index.d.ts +738 -14
  9. package/dist/index.js +858 -805
  10. package/dist/pdf.cjs +47 -47
  11. package/dist/pdf.d.cts +155 -6
  12. package/dist/pdf.d.ts +155 -6
  13. package/dist/pdf.js +3542 -3466
  14. package/dist/plugin-Bl00j_CP.cjs +1 -0
  15. package/dist/plugin-DVScnZ4C.js +25 -0
  16. package/dist/report-params-BB85g7mg.js +10 -0
  17. package/dist/report-params-D1NeY-eR.cjs +1 -0
  18. package/dist/sql.cjs +65 -64
  19. package/dist/sql.d.cts +109 -5
  20. package/dist/sql.d.ts +109 -5
  21. package/dist/sql.js +7947 -7922
  22. package/dist/style-CFZ-HE2s.cjs +3 -0
  23. package/dist/{style-6ihHKVCM.js → style-DnmtG7Gl.js} +69 -81
  24. package/dist/style.css +1 -1
  25. package/dist/vue/async.d.cts +769 -335
  26. package/dist/vue/async.d.ts +769 -335
  27. package/dist/vue/index.d.cts +1321 -14
  28. package/dist/vue/index.d.ts +1321 -14
  29. package/dist/vue-async.cjs +1 -1
  30. package/dist/vue-async.js +11 -12
  31. package/dist/vue.cjs +1 -1
  32. package/dist/vue.js +130 -50
  33. package/dist/xlsx.cjs +20 -20
  34. package/dist/xlsx.d.cts +2292 -5
  35. package/dist/xlsx.d.ts +2292 -5
  36. package/dist/xlsx.js +5452 -5443
  37. package/package.json +7 -13
  38. package/dist/ReportPreview-CJLvkTVn.cjs +0 -6
  39. package/dist/ReportPreview-mZiGtf0L.js +0 -1231
  40. package/dist/builder/template-builder.d.ts +0 -69
  41. package/dist/compat/jh4j-template.d.ts +0 -12
  42. package/dist/defaults.d.ts +0 -27
  43. package/dist/format.d.ts +0 -48
  44. package/dist/layout/paginate.d.ts +0 -97
  45. package/dist/layout/textwrap.d.ts +0 -36
  46. package/dist/manager/api.d.ts +0 -45
  47. package/dist/manager/index.d.ts +0 -2
  48. package/dist/manager/types.d.ts +0 -50
  49. package/dist/manager.cjs +0 -1
  50. package/dist/manager.d.cts +0 -5
  51. package/dist/manager.d.ts +0 -5
  52. package/dist/manager.js +0 -104
  53. package/dist/pdf/font-loader.d.ts +0 -6
  54. package/dist/pdf/index.d.ts +0 -2
  55. package/dist/pdf/render-pdf.d.ts +0 -25
  56. package/dist/plugin-C4qpbdMJ.cjs +0 -1
  57. package/dist/plugin-DcmAPK_K.js +0 -85
  58. package/dist/render/canvas.d.ts +0 -76
  59. package/dist/render/dom.d.ts +0 -10
  60. package/dist/render/grid-geometry.d.ts +0 -41
  61. package/dist/render/style.d.ts +0 -33
  62. package/dist/render/window.d.ts +0 -23
  63. package/dist/schema/render-plan.d.ts +0 -96
  64. package/dist/schema/validate.d.ts +0 -15
  65. package/dist/sql/ast-check.d.ts +0 -14
  66. package/dist/sql/compile.d.ts +0 -31
  67. package/dist/sql/expr.d.ts +0 -21
  68. package/dist/sql/index.d.ts +0 -4
  69. package/dist/sql/tokenizer.d.ts +0 -25
  70. package/dist/style-Xq08-IsV.cjs +0 -3
  71. package/dist/units.d.ts +0 -11
  72. package/dist/vue/ReportParamPanel.d.ts +0 -19
  73. package/dist/vue/ReportPreview.d.ts +0 -209
  74. package/dist/vue/ReportToolbar.d.ts +0 -42
  75. package/dist/vue/adapters.d.ts +0 -40
  76. package/dist/vue/composables/useHighlight.d.ts +0 -8
  77. package/dist/vue/composables/usePageWindow.d.ts +0 -25
  78. package/dist/vue/composables/usePrintExport.d.ts +0 -40
  79. package/dist/vue/composables/useReportSearch.d.ts +0 -73
  80. package/dist/vue/composables/useZoom.d.ts +0 -15
  81. package/dist/vue/config.d.ts +0 -108
  82. package/dist/vue/controller.d.ts +0 -29
  83. package/dist/vue/errors.d.ts +0 -16
  84. package/dist/vue/injection-keys.d.ts +0 -14
  85. package/dist/vue/local-adapter.d.ts +0 -12
  86. package/dist/vue/pdf-exporter.d.ts +0 -13
  87. package/dist/vue/plugin.d.ts +0 -354
  88. package/dist/xlsx/render-xlsx.d.ts +0 -20
@@ -1,354 +0,0 @@
1
- import { App } from 'vue';
2
- import { PlanFetcher, HostRequest } from './adapters';
3
- import { PdfExporter } from './pdf-exporter';
4
- import { MachReportConfig } from './config';
5
- /**
6
- * 全局组件(懒加载分片:首次渲染才拉取组件与引擎依赖,
7
- * 与局部 import 等价——首屏敏感页面零额外成本)
8
- */
9
- export declare const MachReportPreview: {
10
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
11
- tempId: {
12
- type: import('vue').PropType<string | string[] | null>;
13
- default: null;
14
- };
15
- furnitureTempId: {
16
- type: StringConstructor;
17
- default: string;
18
- };
19
- params: {
20
- type: import('vue').PropType<Record<string, string>>;
21
- default: () => {};
22
- };
23
- height: {
24
- type: StringConstructor;
25
- default: string;
26
- };
27
- autoLoad: {
28
- type: BooleanConstructor;
29
- default: boolean;
30
- };
31
- showExport: {
32
- type: BooleanConstructor;
33
- default: undefined;
34
- };
35
- showPrint: {
36
- type: BooleanConstructor;
37
- default: undefined;
38
- };
39
- showPdfWindow: {
40
- type: BooleanConstructor;
41
- default: undefined;
42
- };
43
- gapPx: {
44
- type: NumberConstructor;
45
- default: undefined;
46
- };
47
- messages: {
48
- type: import('vue').PropType<Partial<import('./config').MachReportMessages>>;
49
- default: undefined;
50
- };
51
- preset: {
52
- type: StringConstructor;
53
- default: undefined;
54
- };
55
- debug: {
56
- type: BooleanConstructor;
57
- default: boolean;
58
- };
59
- paramDefs: {
60
- type: import('vue').PropType<import('..').ReportParamDef[] | undefined>;
61
- default: undefined;
62
- };
63
- showParams: {
64
- type: BooleanConstructor;
65
- default: undefined;
66
- };
67
- fetcher: {
68
- type: import('vue').PropType<PlanFetcher | null>;
69
- default: null;
70
- };
71
- }>> & Readonly<{
72
- onError?: ((message: string, detail?: {
73
- code: string;
74
- cause?: unknown;
75
- } | undefined) => any) | undefined;
76
- onLoaded?: ((pageCount: number) => any) | undefined;
77
- onWarning?: ((message: string) => any) | undefined;
78
- }>, {
79
- reload: () => Promise<void>;
80
- print: () => Promise<void>;
81
- exportAs: (format: string) => void;
82
- openPdfWindow: () => void;
83
- gotoPage: (n: number) => void;
84
- setParams: (values: Record<string, string>, opts?: {
85
- reload?: boolean;
86
- }) => void;
87
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
88
- error: (message: string, detail?: {
89
- code: string;
90
- cause?: unknown;
91
- } | undefined) => any;
92
- loaded: (pageCount: number) => any;
93
- warning: (message: string) => any;
94
- }, import('vue').PublicProps, {
95
- height: string;
96
- gapPx: number;
97
- params: Record<string, string>;
98
- furnitureTempId: string;
99
- tempId: string | string[] | null;
100
- debug: boolean;
101
- showExport: boolean;
102
- showPrint: boolean;
103
- showPdfWindow: boolean;
104
- showParams: boolean;
105
- messages: Partial<import('./config').MachReportMessages>;
106
- autoLoad: boolean;
107
- preset: string;
108
- paramDefs: import('..').ReportParamDef[] | undefined;
109
- fetcher: PlanFetcher | null;
110
- }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
111
- viewportRef: HTMLDivElement;
112
- containerRef: HTMLDivElement;
113
- thumbsRef: HTMLElement;
114
- }, HTMLDivElement, import('vue').ComponentProvideOptions, {
115
- P: {};
116
- B: {};
117
- D: {};
118
- C: {};
119
- M: {};
120
- Defaults: {};
121
- }, Readonly<import('vue').ExtractPropTypes<{
122
- tempId: {
123
- type: import('vue').PropType<string | string[] | null>;
124
- default: null;
125
- };
126
- furnitureTempId: {
127
- type: StringConstructor;
128
- default: string;
129
- };
130
- params: {
131
- type: import('vue').PropType<Record<string, string>>;
132
- default: () => {};
133
- };
134
- height: {
135
- type: StringConstructor;
136
- default: string;
137
- };
138
- autoLoad: {
139
- type: BooleanConstructor;
140
- default: boolean;
141
- };
142
- showExport: {
143
- type: BooleanConstructor;
144
- default: undefined;
145
- };
146
- showPrint: {
147
- type: BooleanConstructor;
148
- default: undefined;
149
- };
150
- showPdfWindow: {
151
- type: BooleanConstructor;
152
- default: undefined;
153
- };
154
- gapPx: {
155
- type: NumberConstructor;
156
- default: undefined;
157
- };
158
- messages: {
159
- type: import('vue').PropType<Partial<import('./config').MachReportMessages>>;
160
- default: undefined;
161
- };
162
- preset: {
163
- type: StringConstructor;
164
- default: undefined;
165
- };
166
- debug: {
167
- type: BooleanConstructor;
168
- default: boolean;
169
- };
170
- paramDefs: {
171
- type: import('vue').PropType<import('..').ReportParamDef[] | undefined>;
172
- default: undefined;
173
- };
174
- showParams: {
175
- type: BooleanConstructor;
176
- default: undefined;
177
- };
178
- fetcher: {
179
- type: import('vue').PropType<PlanFetcher | null>;
180
- default: null;
181
- };
182
- }>> & Readonly<{
183
- onError?: ((message: string, detail?: {
184
- code: string;
185
- cause?: unknown;
186
- } | undefined) => any) | undefined;
187
- onLoaded?: ((pageCount: number) => any) | undefined;
188
- onWarning?: ((message: string) => any) | undefined;
189
- }>, {
190
- reload: () => Promise<void>;
191
- print: () => Promise<void>;
192
- exportAs: (format: string) => void;
193
- openPdfWindow: () => void;
194
- gotoPage: (n: number) => void;
195
- setParams: (values: Record<string, string>, opts?: {
196
- reload?: boolean;
197
- }) => void;
198
- }, {}, {}, {}, {
199
- height: string;
200
- gapPx: number;
201
- params: Record<string, string>;
202
- furnitureTempId: string;
203
- tempId: string | string[] | null;
204
- debug: boolean;
205
- showExport: boolean;
206
- showPrint: boolean;
207
- showPdfWindow: boolean;
208
- showParams: boolean;
209
- messages: Partial<import('./config').MachReportMessages>;
210
- autoLoad: boolean;
211
- preset: string;
212
- paramDefs: import('..').ReportParamDef[] | undefined;
213
- fetcher: PlanFetcher | null;
214
- }>;
215
- __isFragment?: never;
216
- __isTeleport?: never;
217
- __isSuspense?: never;
218
- } & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
219
- tempId: {
220
- type: import('vue').PropType<string | string[] | null>;
221
- default: null;
222
- };
223
- furnitureTempId: {
224
- type: StringConstructor;
225
- default: string;
226
- };
227
- params: {
228
- type: import('vue').PropType<Record<string, string>>;
229
- default: () => {};
230
- };
231
- height: {
232
- type: StringConstructor;
233
- default: string;
234
- };
235
- autoLoad: {
236
- type: BooleanConstructor;
237
- default: boolean;
238
- };
239
- showExport: {
240
- type: BooleanConstructor;
241
- default: undefined;
242
- };
243
- showPrint: {
244
- type: BooleanConstructor;
245
- default: undefined;
246
- };
247
- showPdfWindow: {
248
- type: BooleanConstructor;
249
- default: undefined;
250
- };
251
- gapPx: {
252
- type: NumberConstructor;
253
- default: undefined;
254
- };
255
- messages: {
256
- type: import('vue').PropType<Partial<import('./config').MachReportMessages>>;
257
- default: undefined;
258
- };
259
- preset: {
260
- type: StringConstructor;
261
- default: undefined;
262
- };
263
- debug: {
264
- type: BooleanConstructor;
265
- default: boolean;
266
- };
267
- paramDefs: {
268
- type: import('vue').PropType<import('..').ReportParamDef[] | undefined>;
269
- default: undefined;
270
- };
271
- showParams: {
272
- type: BooleanConstructor;
273
- default: undefined;
274
- };
275
- fetcher: {
276
- type: import('vue').PropType<PlanFetcher | null>;
277
- default: null;
278
- };
279
- }>> & Readonly<{
280
- onError?: ((message: string, detail?: {
281
- code: string;
282
- cause?: unknown;
283
- } | undefined) => any) | undefined;
284
- onLoaded?: ((pageCount: number) => any) | undefined;
285
- onWarning?: ((message: string) => any) | undefined;
286
- }>, {
287
- reload: () => Promise<void>;
288
- print: () => Promise<void>;
289
- exportAs: (format: string) => void;
290
- openPdfWindow: () => void;
291
- gotoPage: (n: number) => void;
292
- setParams: (values: Record<string, string>, opts?: {
293
- reload?: boolean;
294
- }) => void;
295
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
296
- error: (message: string, detail?: {
297
- code: string;
298
- cause?: unknown;
299
- } | undefined) => any;
300
- loaded: (pageCount: number) => any;
301
- warning: (message: string) => any;
302
- }, string, {
303
- height: string;
304
- gapPx: number;
305
- params: Record<string, string>;
306
- furnitureTempId: string;
307
- tempId: string | string[] | null;
308
- debug: boolean;
309
- showExport: boolean;
310
- showPrint: boolean;
311
- showPdfWindow: boolean;
312
- showParams: boolean;
313
- messages: Partial<import('./config').MachReportMessages>;
314
- autoLoad: boolean;
315
- preset: string;
316
- paramDefs: import('..').ReportParamDef[] | undefined;
317
- fetcher: PlanFetcher | null;
318
- }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
319
- $slots: {
320
- default?(_: {}): any;
321
- };
322
- });
323
- export interface MachReportPluginOptions {
324
- /**
325
- * 数据面(全部可选——零配置时用全局 fetch 同源直连):
326
- * - request:宿主 http 客户端(axios 风格签名)
327
- * - fetcher:完整 PlanFetcher(自定义数据面/本地模板,优先级最高)
328
- */
329
- request?: HostRequest;
330
- baseUrl?: string;
331
- fetcher?: PlanFetcher;
332
- /** 应用级配置中心(defaults/presets/文案/主题),见 defineMachReportConfig */
333
- config?: MachReportConfig;
334
- /** PDF 导出字体 URL(默认 /simhei.ttf;'' 跳过字体) */
335
- pdfFontUrl?: string;
336
- /** 自定义 PDF 导出器(缺省用懒加载引擎 /pdf 子路径的默认实现) */
337
- pdfExporter?: PdfExporter;
338
- /** 注册全局组件 <MachReportPreview>(默认 true;懒加载分片不影响首屏) */
339
- globalComponent?: boolean;
340
- }
341
- /**
342
- * Vue 插件(零配置可用,对齐 mach-table 的快速集成体验):
343
- *
344
- * ```ts
345
- * app.use(machReportPlugin) // 同源 jh4j 部署,零胶水
346
- * app.use(machReportPlugin, { baseUrl: "/sub/mach-report" })
347
- * app.use(machReportPlugin, { request: axios, config: defineMachReportConfig({...}) })
348
- * ```
349
- *
350
- * 之后业务模板直接写 `<MachReportPreview temp-id="X" />`。
351
- */
352
- export declare const machReportPlugin: {
353
- install(app: App, options?: MachReportPluginOptions): void;
354
- };
@@ -1,20 +0,0 @@
1
- import { default as ExcelJS } from 'exceljs';
2
- import { RenderPlan } from '../schema/render-plan';
3
- /**
4
- * RenderPlan → xlsx 导出(B 端第二出口,对齐家族 @agile-team/mach-table-xlsx 路线):
5
- * - 网格组件 → 真表格:列宽(mm→Excel 宽度)、行高(mm→pt)、colSpan/rowSpan 合并、
6
- * 加粗/对齐/底色/字号直译(resolveGridLayout 复用单真相源几何)
7
- * - 文本组件 → 合并标题行(顺序流式输出,保字号/加粗/对齐;非像素级定位,
8
- * 目标是"财务能直接用的对账表"而非复刻版面)
9
- * - 图片/条码/图表跳过并计入 warnings(与 PDF 保真告警同口径)
10
- */
11
- export interface XlsxRenderOptions {
12
- /** 工作表命名(默认 "Sheet1" 起序) */
13
- sheetName?: (pageIndex: number) => string;
14
- }
15
- export interface XlsxRenderResult {
16
- workbook: ExcelJS.Workbook;
17
- buffer: ExcelJS.Buffer;
18
- warnings: string[];
19
- }
20
- export declare function renderPlanToXlsx(plan: RenderPlan, options?: XlsxRenderOptions): Promise<XlsxRenderResult>;