@agile-team/mach-report 2.5.0 → 2.7.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 (86) hide show
  1. package/README.md +126 -16
  2. package/dist/ReportPreview-BdvoqdOd.cjs +6 -0
  3. package/dist/ReportPreview-COFkbeEM.js +3719 -0
  4. package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
  5. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  6. package/dist/analytics.cjs +1 -0
  7. package/dist/analytics.d.cts +276 -0
  8. package/dist/analytics.d.ts +276 -0
  9. package/dist/analytics.js +223 -0
  10. package/dist/assets-B9qJku3V.js +160 -0
  11. package/dist/assets-RZan7EyL.cjs +1 -0
  12. package/dist/capabilities-joSutDF8.js +63 -0
  13. package/dist/capabilities-xGTpnPjJ.cjs +1 -0
  14. package/dist/designer.cjs +1 -0
  15. package/dist/designer.d.cts +869 -0
  16. package/dist/designer.d.ts +869 -0
  17. package/dist/designer.js +628 -0
  18. package/dist/index.cjs +8 -5
  19. package/dist/index.d.cts +497 -9
  20. package/dist/index.d.ts +497 -9
  21. package/dist/index.js +1088 -1499
  22. package/dist/param-validation-BWNjLcN0.js +116 -0
  23. package/dist/param-validation-CiTxFeZ8.cjs +1 -0
  24. package/dist/pdf.cjs +48 -48
  25. package/dist/pdf.d.cts +119 -1
  26. package/dist/pdf.d.ts +119 -1
  27. package/dist/pdf.js +3932 -3868
  28. package/dist/{plugin-DMPLDpBY.cjs → plugin-9t_ZFwhz.cjs} +1 -1
  29. package/dist/{plugin-DDLcFWlk.js → plugin-s8Ay8kKk.js} +2 -2
  30. package/dist/progress-DD964VAB.js +102 -0
  31. package/dist/progress-KvhwXZ1Q.cjs +1 -0
  32. package/dist/render-plan-CckPEQyf.cjs +1 -0
  33. package/dist/{render-plan-CXBWRog4.js → render-plan-uzZYYSy1.js} +11 -10
  34. package/dist/report-params-B_VCihAh.js +12 -0
  35. package/dist/report-params-CjWrjPl6.cjs +1 -0
  36. package/dist/report-source-BXHNy_AD.js +755 -0
  37. package/dist/report-source-CCAvFE3t.cjs +1 -0
  38. package/dist/server/node.d.cts +320 -0
  39. package/dist/server/node.d.ts +320 -0
  40. package/dist/server-node.cjs +1 -0
  41. package/dist/server-node.js +303 -0
  42. package/dist/server.cjs +1 -0
  43. package/dist/server.d.cts +668 -0
  44. package/dist/server.d.ts +668 -0
  45. package/dist/server.js +245 -0
  46. package/dist/style-CpwiOPyB.cjs +1 -0
  47. package/dist/style-Dv5o_x6b.js +67 -0
  48. package/dist/style.css +1 -1
  49. package/dist/task-events-DQ276fn2.cjs +1 -0
  50. package/dist/task-events-Dpsvf_t2.js +47 -0
  51. package/dist/template-registry-DWExx0gU.cjs +1 -0
  52. package/dist/template-registry-NpOakidD.js +354 -0
  53. package/dist/textwrap-CnGsEum6.cjs +4 -0
  54. package/dist/textwrap-DOl04hCQ.js +110 -0
  55. package/dist/validate-DfHPD8wX.cjs +1 -0
  56. package/dist/validate-S6CgIm5d.js +148 -0
  57. package/dist/vue/async.d.cts +1507 -1538
  58. package/dist/vue/async.d.ts +1507 -1538
  59. package/dist/vue/index.d.cts +2376 -2347
  60. package/dist/vue/index.d.ts +2376 -2347
  61. package/dist/vue-async.cjs +1 -1
  62. package/dist/vue-async.js +3 -3
  63. package/dist/vue.cjs +1 -1
  64. package/dist/vue.js +184 -75
  65. package/dist/worker.cjs +1 -0
  66. package/dist/worker.d.cts +325 -0
  67. package/dist/worker.d.ts +325 -0
  68. package/dist/worker.js +158 -0
  69. package/dist/xlsx/node.d.cts +47 -0
  70. package/dist/xlsx/node.d.ts +47 -0
  71. package/dist/xlsx-node.cjs +221 -0
  72. package/dist/xlsx-node.js +36409 -0
  73. package/dist/xlsx.cjs +20 -20
  74. package/dist/xlsx.d.cts +87 -2
  75. package/dist/xlsx.d.ts +87 -2
  76. package/dist/xlsx.js +5987 -5840
  77. package/package.json +63 -3
  78. package/dist/ReportPreview-CBKLI--k.js +0 -2188
  79. package/dist/ReportPreview-ClM8h0pM.cjs +0 -6
  80. package/dist/grid-geometry-BNIvw52m.cjs +0 -1
  81. package/dist/grid-geometry-C8hGoe9o.js +0 -130
  82. package/dist/render-plan-CCTL4F9v.cjs +0 -1
  83. package/dist/report-params-B3Fia6JO.js +0 -10
  84. package/dist/report-params-D1gZ1DME.cjs +0 -1
  85. package/dist/textwrap-nH0UYU6D.js +0 -108
  86. package/dist/textwrap-oD-t4b4B.cjs +0 -4
@@ -1 +1 @@
1
- "use strict";var l=Object.create;var n=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var d=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var m=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of p(e))!h.call(r,c)&&c!==t&&n(r,c,{get:()=>e[c],enumerable:!(o=s(e,c))||o.enumerable});return r};var C=(r,e,t)=>(t=r!=null?l(d(r)):{},m(e||!r||!r.__esModule?n(t,"default",{value:r,enumerable:!0}):t,r));const E=require("vue"),O=require("./report-params-D1gZ1DME.cjs"),_="mach-report/fetcher",f="mach-report/pdf-exporter",P="mach-report/config",u="mach-report/controller",a=E.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./ReportPreview-ClM8h0pM.cjs")).then(r=>r.ReportPreview$1)),T={install(r,e={}){let t=e.fetcher;if(!t&&e.reports){const o=e.reports;let c;t=async R=>(c??=import("@agile-team/mach-report").then(({createReportSource:i})=>i(o)),(await c)(R)),t.getParamDefs=R=>O.getReportParamDefs(o,R)}t&&r.provide(_,t),e.pdfExporter&&r.provide(f,e.pdfExporter),r.provide(P,E.computed(()=>{if(e.pdfFontUrl===void 0)return e.config??null;const o=e.config??{defaults:{},presets:{}};return{...o,defaults:{...o.defaults,pdfFontUrl:e.pdfFontUrl}}})),e.globalComponent!==!1&&!r.component("MachReportPreview")&&r.component("MachReportPreview",a)}};exports.MACH_REPORT_CONFIG_KEY=P;exports.MACH_REPORT_CONTROLLER_KEY=u;exports.MACH_REPORT_FETCHER_KEY=_;exports.MACH_REPORT_PDF_EXPORTER_KEY=f;exports.MachReportPreview=a;exports.machReportPlugin=T;
1
+ "use strict";var l=Object.create;var n=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var d=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var m=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of p(e))!h.call(r,c)&&c!==t&&n(r,c,{get:()=>e[c],enumerable:!(o=s(e,c))||o.enumerable});return r};var C=(r,e,t)=>(t=r!=null?l(d(r)):{},m(e||!r||!r.__esModule?n(t,"default",{value:r,enumerable:!0}):t,r));const E=require("vue"),O=require("./report-params-CjWrjPl6.cjs"),_="mach-report/fetcher",f="mach-report/pdf-exporter",P="mach-report/config",u="mach-report/controller",a=E.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./ReportPreview-BdvoqdOd.cjs")).then(r=>r.ReportPreview$1)),T={install(r,e={}){let t=e.fetcher;if(!t&&e.reports){const o=e.reports;let c;t=async R=>(c??=import("@agile-team/mach-report").then(({createReportSource:i})=>i(o)),(await c)(R)),t.getParamDefs=R=>O.getReportParamDefs(o,R)}t&&r.provide(_,t),e.pdfExporter&&r.provide(f,e.pdfExporter),r.provide(P,E.computed(()=>{if(e.pdfFontUrl===void 0)return e.config??null;const o=e.config??{defaults:{},presets:{}};return{...o,defaults:{...o.defaults,pdfFontUrl:e.pdfFontUrl}}})),e.globalComponent!==!1&&!r.component("MachReportPreview")&&r.component("MachReportPreview",a)}};exports.MACH_REPORT_CONFIG_KEY=P;exports.MACH_REPORT_CONTROLLER_KEY=u;exports.MACH_REPORT_FETCHER_KEY=_;exports.MACH_REPORT_PDF_EXPORTER_KEY=f;exports.MachReportPreview=a;exports.machReportPlugin=T;
@@ -1,6 +1,6 @@
1
1
  import { defineAsyncComponent as a, computed as s } from "vue";
2
- import { g as m } from "./report-params-B3Fia6JO.js";
3
- const p = "mach-report/fetcher", l = "mach-report/pdf-exporter", R = "mach-report/config", h = "mach-report/controller", d = a(() => import("./ReportPreview-CBKLI--k.js").then((r) => r.w)), _ = {
2
+ import { g as m } from "./report-params-B_VCihAh.js";
3
+ const p = "mach-report/fetcher", l = "mach-report/pdf-exporter", R = "mach-report/config", h = "mach-report/controller", d = a(() => import("./ReportPreview-COFkbeEM.js").then((r) => r.z)), _ = {
4
4
  install(r, e = {}) {
5
5
  let t = e.fetcher;
6
6
  if (!t && e.reports) {
@@ -0,0 +1,102 @@
1
+ function C(t, n) {
2
+ const s = t.length;
3
+ if (s === 0) return [];
4
+ const u = t.reduce((c, l) => c + l, 0), h = u > 0 && n > 0 ? n / u : 1, a = [];
5
+ let i = 0;
6
+ for (let c = 0; c < s; c++) {
7
+ const l = Math.max(0, t[c] * h);
8
+ a.push({ pos: i, size: l }), i += l;
9
+ }
10
+ return a;
11
+ }
12
+ function k(t, n, s) {
13
+ return t?.length ? C(t, n) : Array.from({ length: s }, (u, h) => ({
14
+ pos: n * h / s,
15
+ size: n / s
16
+ }));
17
+ }
18
+ function B(t, n, s) {
19
+ const u = t.cells ?? [], h = Math.max(u.length, 1), a = t.colWidthsMm?.length ?? Math.max(1, ...u.map((o) => Array.isArray(o) ? o.length : 0)), i = k(t.colWidthsMm, n, a), c = (o) => o <= 0 ? 0 : o >= a ? i[i.length - 1].pos + i[i.length - 1].size : i[o].pos, l = k(t.rowHeightsMm, s, h), w = (o) => o <= 0 ? 0 : o >= h ? l[l.length - 1].pos + l[l.length - 1].size : l[o].pos, y = /* @__PURE__ */ new Set(), E = (o, r) => `${o}:${r}`, M = [], x = /* @__PURE__ */ new Set(), A = /* @__PURE__ */ new Set(), P = (o, r) => `v${o}:${r}`, S = (o, r) => `h${o}:${r}`;
20
+ u.forEach((o, r) => {
21
+ if (!Array.isArray(o)) return;
22
+ let e = 0;
23
+ for (const p of o) {
24
+ for (; e < a && y.has(E(r, e)); ) e++;
25
+ if (e >= a) break;
26
+ const L = Math.max(1, Math.min(p?.colSpan ?? 1, a - e)), T = Math.max(1, p?.rowSpan ?? 1), b = Math.min(h, r + T), m = Math.min(a, e + L);
27
+ for (let f = r; f < b; f++)
28
+ for (let d = e; d < m; d++)
29
+ y.add(E(f, d));
30
+ for (let f = e + 1; f < m; f++)
31
+ for (let d = r; d < b; d++) x.add(P(f, d));
32
+ for (let f = r + 1; f < b; f++)
33
+ for (let d = e; d < m; d++) A.add(S(f, d));
34
+ const O = c(e), $ = w(r);
35
+ M.push({
36
+ ri: r,
37
+ ci: e,
38
+ cell: p ?? {},
39
+ xMm: O,
40
+ yMm: $,
41
+ widthMm: c(m) - O,
42
+ heightMm: w(b) - $
43
+ }), e = m;
44
+ }
45
+ });
46
+ const v = [];
47
+ for (let o = 1; o < a; o++) {
48
+ let r = -1;
49
+ for (let e = 0; e <= h; e++) {
50
+ const p = e < h && !x.has(P(o, e));
51
+ p && r < 0 && (r = e), !p && r >= 0 && (v.push({ kind: "v", pos: c(o), from: w(r), to: w(e) }), r = -1);
52
+ }
53
+ }
54
+ for (let o = 1; o < h; o++) {
55
+ let r = -1;
56
+ for (let e = 0; e <= a; e++) {
57
+ const p = e < a && !A.has(S(o, e));
58
+ p && r < 0 && (r = e), !p && r >= 0 && (v.push({ kind: "h", pos: w(o), from: c(r), to: c(e) }), r = -1);
59
+ }
60
+ }
61
+ return { columns: i, rows: l, cells: M, edges: v };
62
+ }
63
+ function g(t) {
64
+ if (t?.aborted) throw t.reason ?? new DOMException("The operation was aborted.", "AbortError");
65
+ }
66
+ function D(t, n, s) {
67
+ g(t.signal);
68
+ try {
69
+ t.onProgress?.(n, s);
70
+ } catch {
71
+ }
72
+ g(t.signal);
73
+ }
74
+ function K(t, n) {
75
+ const s = Promise.resolve(t);
76
+ return n?.aborted ? (s.catch(() => {
77
+ }), Promise.reject(n.reason ?? new DOMException("The operation was aborted.", "AbortError"))) : n ? new Promise((u, h) => {
78
+ const a = () => n.removeEventListener("abort", i), i = () => {
79
+ a(), h(n.reason ?? new DOMException("The operation was aborted.", "AbortError"));
80
+ };
81
+ n.addEventListener("abort", i, { once: !0 }), s.then((c) => {
82
+ a(), u(c);
83
+ }, (c) => {
84
+ a(), h(c);
85
+ }), n.aborted && i();
86
+ }) : s;
87
+ }
88
+ function W(t, n) {
89
+ const s = () => n.abort(t?.reason);
90
+ return t?.addEventListener("abort", s, { once: !0 }), t?.aborted && s(), () => t?.removeEventListener("abort", s);
91
+ }
92
+ async function z(t, n, s) {
93
+ D(t, n, s), (t.signal || t.onProgress) && await new Promise((u) => setTimeout(u, 0)), g(t.signal);
94
+ }
95
+ export {
96
+ g as a,
97
+ W as f,
98
+ D as n,
99
+ z as o,
100
+ B as r,
101
+ K as w
102
+ };
@@ -0,0 +1 @@
1
+ "use strict";function D(t,n){const s=t.length;if(s===0)return[];const h=t.reduce((a,l)=>a+l,0),u=h>0&&n>0?n/h:1,c=[];let i=0;for(let a=0;a<s;a++){const l=Math.max(0,t[a]*u);c.push({pos:i,size:l}),i+=l}return c}function L(t,n,s){return t?.length?D(t,n):Array.from({length:s},(h,u)=>({pos:n*u/s,size:n/s}))}function B(t,n,s){const h=t.cells??[],u=Math.max(h.length,1),c=t.colWidthsMm?.length??Math.max(1,...h.map(o=>Array.isArray(o)?o.length:0)),i=L(t.colWidthsMm,n,c),a=o=>o<=0?0:o>=c?i[i.length-1].pos+i[i.length-1].size:i[o].pos,l=L(t.rowHeightsMm,s,u),w=o=>o<=0?0:o>=u?l[l.length-1].pos+l[l.length-1].size:l[o].pos,g=new Set,A=(o,r)=>`${o}:${r}`,E=[],M=new Set,O=new Set,x=(o,r)=>`v${o}:${r}`,P=(o,r)=>`h${o}:${r}`;h.forEach((o,r)=>{if(!Array.isArray(o))return;let e=0;for(const p of o){for(;e<c&&g.has(A(r,e));)e++;if(e>=c)break;const C=Math.max(1,Math.min(p?.colSpan??1,c-e)),T=Math.max(1,p?.rowSpan??1),b=Math.min(u,r+T),m=Math.min(c,e+C);for(let f=r;f<b;f++)for(let d=e;d<m;d++)g.add(A(f,d));for(let f=e+1;f<m;f++)for(let d=r;d<b;d++)M.add(x(f,d));for(let f=r+1;f<b;f++)for(let d=e;d<m;d++)O.add(P(f,d));const S=a(e),k=w(r);E.push({ri:r,ci:e,cell:p??{},xMm:S,yMm:k,widthMm:a(m)-S,heightMm:w(b)-k}),e=m}});const y=[];for(let o=1;o<c;o++){let r=-1;for(let e=0;e<=u;e++){const p=e<u&&!M.has(x(o,e));p&&r<0&&(r=e),!p&&r>=0&&(y.push({kind:"v",pos:a(o),from:w(r),to:w(e)}),r=-1)}}for(let o=1;o<u;o++){let r=-1;for(let e=0;e<=c;e++){const p=e<c&&!O.has(P(o,e));p&&r<0&&(r=e),!p&&r>=0&&(y.push({kind:"h",pos:w(o),from:a(r),to:a(e)}),r=-1)}}return{columns:i,rows:l,cells:E,edges:y}}function v(t){if(t?.aborted)throw t.reason??new DOMException("The operation was aborted.","AbortError")}function $(t,n,s){v(t.signal);try{t.onProgress?.(n,s)}catch{}v(t.signal)}function F(t,n){const s=Promise.resolve(t);return n?.aborted?(s.catch(()=>{}),Promise.reject(n.reason??new DOMException("The operation was aborted.","AbortError"))):n?new Promise((h,u)=>{const c=()=>n.removeEventListener("abort",i),i=()=>{c(),u(n.reason??new DOMException("The operation was aborted.","AbortError"))};n.addEventListener("abort",i,{once:!0}),s.then(a=>{c(),h(a)},a=>{c(),u(a)}),n.aborted&&i()}):s}function G(t,n){const s=()=>n.abort(t?.reason);return t?.addEventListener("abort",s,{once:!0}),t?.aborted&&s(),()=>t?.removeEventListener("abort",s)}async function K(t,n,s){$(t,n,s),(t.signal||t.onProgress)&&await new Promise(h=>setTimeout(h,0)),v(t.signal)}exports.assertOutputActive=v;exports.forwardOutputAbort=G;exports.notifyOutputProgress=$;exports.outputCheckpoint=K;exports.resolveGridLayout=B;exports.waitForOutput=F;
@@ -0,0 +1 @@
1
+ "use strict";const T='"Microsoft YaHei", sans-serif';const n="#333333",t="#000000",_="1.0.0-mach",A=_;function L(E){return(E.kind==="image"||E.kind==="barcode"||E.kind==="qrcode"||E.kind==="chart")&&!!E.imageData}function i(E){return E.kind==="text"&&Array.isArray(E.richParagraphs)&&E.richParagraphs.length>0}exports.DEFAULT_BORDER_PT=.75;exports.DEFAULT_FONT_FAMILY=T;exports.DEFAULT_FONT_PT=10.5;exports.DEFAULT_STROKE_COLOR=n;exports.DEFAULT_TEXT_COLOR=t;exports.LINE_HEIGHT=1.35;exports.RENDER_PLAN_SCHEMA_VERSION=A;exports.SCHEMA_VERSION_MACH=_;exports.isImageBackedComponent=L;exports.isRichText=i;
@@ -1,18 +1,19 @@
1
- const s = 1.35, t = 10.5, r = 0.75, i = "#333333", E = "#000000", n = "1.0.0-mach", _ = n;
2
- function e(a) {
1
+ const n = 1.35, t = 10.5, r = '"Microsoft YaHei", sans-serif', i = 0.75, e = "#333333", E = "#000000", s = "1.0.0-mach", _ = s;
2
+ function c(a) {
3
3
  return (a.kind === "image" || a.kind === "barcode" || a.kind === "qrcode" || a.kind === "chart") && !!a.imageData;
4
4
  }
5
- function c(a) {
5
+ function T(a) {
6
6
  return a.kind === "text" && Array.isArray(a.richParagraphs) && a.richParagraphs.length > 0;
7
7
  }
8
8
  export {
9
- t as D,
10
- s as L,
9
+ r as D,
10
+ n as L,
11
11
  _ as R,
12
- n as S,
12
+ s as S,
13
13
  E as a,
14
- c as b,
15
- r as c,
16
- i as d,
17
- e as i
14
+ T as b,
15
+ i as c,
16
+ t as d,
17
+ e,
18
+ c as i
18
19
  };
@@ -0,0 +1,12 @@
1
+ import { v as f, R as l } from "./param-validation-BWNjLcN0.js";
2
+ function m(e, s) {
3
+ const a = /* @__PURE__ */ new Set();
4
+ return s.flatMap((r) => {
5
+ const t = Object.prototype.hasOwnProperty.call(e, r) ? e[r] : void 0, n = t?.params ?? (typeof t?.template == "function" ? [] : t?.template.params) ?? [], o = f(n);
6
+ if (o.length) throw new l(o);
7
+ return n.filter((i) => a.has(i.field) ? !1 : (a.add(i.field), !0));
8
+ });
9
+ }
10
+ export {
11
+ m as g
12
+ };
@@ -0,0 +1 @@
1
+ "use strict";const s=require("./param-validation-CiTxFeZ8.cjs");function l(e,f){const a=new Set;return f.flatMap(r=>{const t=Object.prototype.hasOwnProperty.call(e,r)?e[r]:void 0,n=t?.params??(typeof t?.template=="function"?[]:t?.template.params)??[],i=s.validateReportParamDefinitions(n);if(i.length)throw new s.ReportParamValidationError(i);return n.filter(o=>a.has(o.field)?!1:(a.add(o.field),!0))})}exports.getReportParamDefs=l;