@agile-team/mach-report 2.13.0 → 2.15.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 +20 -7
- package/THIRD_PARTY_NOTICES.md +3 -1
- package/dist/ExcelBindingWizard-BKH1nGNS.js +1485 -0
- package/dist/ExcelBindingWizard-Bs43BGNp.cjs +1 -0
- package/dist/ParamEditor-Da4akw6V.cjs +1 -0
- package/dist/ParamEditor-DoAhzJsm.js +594 -0
- package/dist/{ReportBatchPanel-CW2HV9I8.js → ReportBatchPanel-BMf6boMA.js} +39 -39
- package/dist/ReportBatchPanel-wP9m9Pj1.cjs +1 -0
- package/dist/ReportPreview-ChV19HBp.js +4619 -0
- package/dist/ReportPreview-DbLvvOUT.cjs +6 -0
- package/dist/{ReportTemplateLibrary-BZB-XWjj.js → ReportTemplateLibrary-C9wutIiT.js} +1 -1
- package/dist/ReportTemplateLibrary-Sxr3eD0J.cjs +1 -0
- package/dist/RuleEditor-C_Clasvd.js +2037 -0
- package/dist/RuleEditor-XhGHK8DE.cjs +1 -0
- package/dist/TemplateOutlinePanel-D6Bkny59.js +96 -0
- package/dist/TemplateOutlinePanel-JTSR53vJ.cjs +1 -0
- package/dist/TemplateReusePanel-Kx35S0Ql.cjs +1 -0
- package/dist/TemplateReusePanel-rVuK1kTz.js +388 -0
- package/dist/TemplateReviewPanel-B0ar9_zf.js +592 -0
- package/dist/TemplateReviewPanel-Dn6X9UmY.cjs +1 -0
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.d.cts +3 -1
- package/dist/analytics.d.ts +3 -1
- package/dist/analytics.js +154 -60
- package/dist/artifact-integrity.json +135 -0
- package/dist/assets-B9ImAi6_.cjs +1 -0
- package/dist/assets-DEaz4qsp.js +124 -0
- package/dist/batch-BaP6pWDE.cjs +1 -0
- package/dist/batch-BfZHN1do.js +220 -0
- package/dist/batch-CGyt-b2W.js +273 -0
- package/dist/batch-CLpELXBl.cjs +1 -0
- package/dist/capabilities-CAh2Nrue.cjs +1 -0
- package/dist/capabilities-DskCHs3V.js +69 -0
- package/dist/codes.d.cts +2 -0
- package/dist/codes.d.ts +2 -0
- package/dist/{computed-Bvk0W15F.js → computed-C-4C2S5h.js} +3 -3
- package/dist/config-BVsJXSqS.js +842 -0
- package/dist/config-D10us76d.cjs +1 -0
- package/dist/data-explanation-B8MZRYVS.js +16 -0
- package/dist/data-explanation-DE55G30w.cjs +1 -0
- package/dist/designer-2bDlcNXQ.js +5136 -0
- package/dist/designer-BT7XCdbW.cjs +2 -0
- package/dist/designer.cjs +1 -2
- package/dist/designer.d.cts +432 -17
- package/dist/designer.d.ts +432 -17
- package/dist/designer.js +21 -4312
- package/dist/drill-ByJviLXS.js +145 -0
- package/dist/drill-DYTxuL3A.cjs +1 -0
- package/dist/font-loader-B_UkxpzC.cjs +1 -0
- package/dist/font-loader-Q3bQjmrI.js +297 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +239 -5
- package/dist/index.d.ts +239 -5
- package/dist/index.js +939 -893
- package/dist/json-snapshot-DFb2eWkf.js +1416 -0
- package/dist/json-snapshot-WWSGlaHG.cjs +2 -0
- package/dist/licenses/_bwip-js_generic-4.11.4.txt +24 -0
- package/dist/licenses/_fast-csv_format-4.3.5.txt +22 -0
- package/dist/licenses/_fast-csv_parse-4.3.6.txt +22 -0
- package/dist/licenses/_pdf-lib_fontkit-1.1.1.txt +326 -0
- package/dist/licenses/_pdf-lib_standard-fonts-1.0.0.txt +22 -0
- package/dist/licenses/_pdf-lib_upng-1.0.1.txt +22 -0
- package/dist/licenses/_types_node-14.18.63.txt +22 -0
- package/dist/licenses/_types_pako-2.0.3.txt +22 -0
- package/dist/licenses/_types_pegjs-0.10.6.txt +22 -0
- package/dist/licenses/archiver-5.3.2.txt +23 -0
- package/dist/licenses/archiver-utils-2.1.0.txt +23 -0
- package/dist/licenses/archiver-utils-3.0.4.txt +23 -0
- package/dist/licenses/async-3.2.6.txt +20 -0
- package/dist/licenses/balanced-match-1.0.2.txt +22 -0
- package/dist/licenses/base64-js-1.5.1.txt +22 -0
- package/dist/licenses/big-integer-1.6.52.txt +25 -0
- package/dist/licenses/binary-0.3.0.txt +178 -0
- package/dist/licenses/bl-4.1.0.txt +14 -0
- package/dist/licenses/bluebird-3.4.7.txt +22 -0
- package/dist/licenses/brace-expansion-1.1.21.txt +22 -0
- package/dist/licenses/brace-expansion-2.1.7.txt +22 -0
- package/dist/licenses/buffer-5.7.1.txt +22 -0
- package/dist/licenses/buffer-crc32-0.2.13.txt +20 -0
- package/dist/licenses/buffer-indexof-polyfill-1.0.2.txt +23 -0
- package/dist/licenses/buffers-0.1.1.txt +140 -0
- package/dist/licenses/chainsaw-0.1.0.txt +184 -0
- package/dist/licenses/compress-commons-4.1.2.txt +23 -0
- package/dist/licenses/concat-map-0.0.1.txt +19 -0
- package/dist/licenses/core-util-is-1.0.3.txt +20 -0
- package/dist/licenses/crc-32-1.2.2.txt +202 -0
- package/dist/licenses/crc32-stream-4.0.3.txt +23 -0
- package/dist/licenses/dayjs-1.11.23.txt +22 -0
- package/dist/licenses/duplexer2-0.1.4.txt +27 -0
- package/dist/licenses/end-of-stream-1.4.5.txt +22 -0
- package/dist/licenses/exceljs-4.4.0.txt +23 -0
- package/dist/licenses/fast-csv-4.3.6.txt +22 -0
- package/dist/licenses/fast-png-6.4.0.txt +22 -0
- package/dist/licenses/fs-constants-1.0.0.txt +22 -0
- package/dist/licenses/fs.realpath-1.0.0.txt +44 -0
- package/dist/licenses/fstream-1.0.12.txt +16 -0
- package/dist/licenses/glob-7.2.3.txt +22 -0
- package/dist/licenses/graceful-fs-4.2.11.txt +16 -0
- package/dist/licenses/ieee754-1.2.1.txt +12 -0
- package/dist/licenses/immediate-3.0.6.txt +21 -0
- package/dist/licenses/inflight-1.0.6.txt +16 -0
- package/dist/licenses/inherits-2.0.4.txt +17 -0
- package/dist/licenses/iobuffer-5.4.0.txt +23 -0
- package/dist/licenses/isarray-1.0.0.txt +61 -0
- package/dist/licenses/jszip-3.10.2.txt +652 -0
- package/dist/licenses/lazystream-1.0.1.txt +24 -0
- package/dist/licenses/lie-3.3.0.txt +8 -0
- package/dist/licenses/listenercount-1.0.1.txt +6 -0
- package/dist/licenses/lodash.defaults-4.2.0.txt +48 -0
- package/dist/licenses/lodash.difference-4.5.0.txt +48 -0
- package/dist/licenses/lodash.escaperegexp-4.1.2.txt +48 -0
- package/dist/licenses/lodash.flatten-4.4.0.txt +48 -0
- package/dist/licenses/lodash.groupby-4.6.0.txt +48 -0
- package/dist/licenses/lodash.isboolean-3.0.3.txt +23 -0
- package/dist/licenses/lodash.isequal-4.5.0.txt +48 -0
- package/dist/licenses/lodash.isfunction-3.0.9.txt +48 -0
- package/dist/licenses/lodash.isnil-4.0.0.txt +23 -0
- package/dist/licenses/lodash.isplainobject-4.0.6.txt +48 -0
- package/dist/licenses/lodash.isundefined-3.0.1.txt +23 -0
- package/dist/licenses/lodash.union-4.6.0.txt +48 -0
- package/dist/licenses/lodash.uniq-4.5.0.txt +48 -0
- package/dist/licenses/minimatch-3.1.5.txt +16 -0
- package/dist/licenses/minimatch-5.1.9.txt +16 -0
- package/dist/licenses/minimist-1.2.8.txt +19 -0
- package/dist/licenses/mkdirp-0.5.6.txt +22 -0
- package/dist/licenses/node-sql-parser-5.4.0.txt +202 -0
- package/dist/licenses/normalize-path-3.0.0.txt +22 -0
- package/dist/licenses/once-1.4.0.txt +16 -0
- package/dist/licenses/pako-1.0.11.txt +22 -0
- package/dist/licenses/pako-2.2.0.txt +22 -0
- package/dist/licenses/path-is-absolute-1.0.1.txt +22 -0
- package/dist/licenses/pdf-lib-1.17.1.txt +22 -0
- package/dist/licenses/process-nextick-args-2.0.1.txt +20 -0
- package/dist/licenses/readable-stream-2.3.8.txt +48 -0
- package/dist/licenses/readable-stream-3.6.2.txt +48 -0
- package/dist/licenses/readdir-glob-1.1.3.txt +202 -0
- package/dist/licenses/rimraf-2.7.1.txt +16 -0
- package/dist/licenses/safe-buffer-5.1.2.txt +22 -0
- package/dist/licenses/safe-buffer-5.2.1.txt +22 -0
- package/dist/licenses/saxes-5.0.1.txt +397 -0
- package/dist/licenses/setimmediate-1.0.5.txt +21 -0
- package/dist/licenses/string_decoder-1.1.1.txt +49 -0
- package/dist/licenses/string_decoder-1.3.0.txt +49 -0
- package/dist/licenses/tar-stream-2.2.0.txt +22 -0
- package/dist/licenses/tmp-0.2.7.txt +22 -0
- package/dist/licenses/traverse-0.3.9.txt +25 -0
- package/dist/licenses/tslib-1.14.1.txt +13 -0
- package/dist/licenses/unzipper-0.10.14.txt +26 -0
- package/dist/licenses/util-deprecate-1.0.2.txt +25 -0
- package/dist/licenses/uuid-11.1.1.txt +10 -0
- package/dist/licenses/wrappy-1.0.2.txt +16 -0
- package/dist/licenses/xmlchars-2.2.0.txt +19 -0
- package/dist/licenses/zip-stream-4.1.1.txt +23 -0
- package/dist/matrix-CGRGkn5s.js +112 -0
- package/dist/matrix-gEO7ZM_u.cjs +1 -0
- package/dist/media-B7vnpD8k.cjs +1 -0
- package/dist/media-Y90dHK9z.js +70 -0
- package/dist/param-validation-C3HlcLLO.cjs +1 -0
- package/dist/param-validation-Do7Eg8Zv.js +181 -0
- package/dist/pdf-BwNyeGpt.js +36352 -0
- package/dist/pdf-CvvrjPQg.cjs +103 -0
- package/dist/pdf.cjs +1 -101
- package/dist/pdf.d.cts +18 -3
- package/dist/pdf.d.ts +18 -3
- package/dist/pdf.js +9 -36579
- package/dist/plugin-Ca_XZG3l.js +22 -0
- package/dist/{plugin-DzS6pxTA.cjs → plugin-DHO7X8z2.cjs} +1 -1
- package/dist/prepared-CFy9B75C.cjs +1 -0
- package/dist/prepared-ajM-H-9B.js +69 -0
- package/dist/progress-B0ctFpKf.cjs +1 -0
- package/dist/progress-D-OTpEav.js +52 -0
- package/dist/{record-bindings-D-5jQlTj.js → record-bindings-Do_b3h4V.js} +1 -1
- package/dist/{region-binding-workflow-CcUq8W2Q.js → region-binding-workflow-BMhK_TjP.js} +1 -1
- package/dist/{region-binding-workflow-BzfbxRiR.cjs → region-binding-workflow-DIYJdCUr.cjs} +1 -1
- package/dist/{report-params-B44imUd4.js → report-params-B1RzkhJj.js} +1 -1
- package/dist/{report-params-SJfhKgaX.cjs → report-params-WDGrA4oP.cjs} +1 -1
- package/dist/sbom.cdx.json +3982 -0
- package/dist/server/node.d.cts +66 -12
- package/dist/server/node.d.ts +66 -12
- package/dist/server-node.cjs +1 -1
- package/dist/server-node.js +405 -381
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +878 -15
- package/dist/server.d.ts +878 -15
- package/dist/server.js +1034 -534
- package/dist/sha256-ArEYjaTI.cjs +1 -0
- package/dist/sha256-DPEuJ3nh.js +155 -0
- package/dist/style.css +1 -1
- package/dist/template-bindings-C2SpvsMU.js +58 -0
- package/dist/template-bindings-CEtWyiLX.cjs +1 -0
- package/dist/template-catalog-FJE_c9Qe.cjs +1 -0
- package/dist/template-catalog-j2B1MJlL.js +414 -0
- package/dist/template-fragments-BGbQLGlV.js +187 -0
- package/dist/template-fragments-DcKeiylI.cjs +1 -0
- package/dist/template-outline-BwRV_eRo.cjs +1 -0
- package/dist/template-outline-cnWfT_LK.js +88 -0
- package/dist/{template-registry-BjE1VS6g.js → template-registry-BtaKPELV.js} +364 -201
- package/dist/template-registry-Co1zPq5e.cjs +1 -0
- package/dist/textwrap-CWHyzkBH.cjs +4 -0
- package/dist/textwrap-DE1kgcJB.js +110 -0
- package/dist/{tree-CqcQ99NM.js → tree-CjVZLRw7.js} +1 -1
- package/dist/{useLocalDraft-C07SYRnC.js → useLocalDraft-BnhcxXk_.js} +1 -1
- package/dist/{useLocalDraft-Yiw1wFgI.cjs → useLocalDraft-CioIfDb6.cjs} +1 -1
- package/dist/vue/async.d.cts +190 -15
- package/dist/vue/async.d.ts +190 -15
- package/dist/vue/index.d.cts +274 -24
- package/dist/vue/index.d.ts +274 -24
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +5 -5
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +90 -81
- package/dist/{workbook-session-DNa2RHNG.cjs → workbook-session-Bjv1YCRK.cjs} +18 -18
- package/dist/{workbook-session-BPb3TMnT.js → workbook-session-BvToI-Fd.js} +5440 -5288
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +66 -12
- package/dist/worker.d.ts +66 -12
- package/dist/worker.js +61 -56
- package/dist/xlsx-node.cjs +34 -34
- package/dist/xlsx-node.js +878 -870
- package/dist/xlsx.cjs +3 -4
- package/dist/xlsx.d.cts +22 -10
- package/dist/xlsx.d.ts +22 -10
- package/dist/xlsx.js +261 -253
- package/package.json +2 -2
- package/dist/ExcelBindingWizard-CeAf4QSE.js +0 -1465
- package/dist/ExcelBindingWizard-y0mT-AHR.cjs +0 -1
- package/dist/ParamEditor-BLaE5q5W.js +0 -522
- package/dist/ParamEditor-MBBC7lUE.cjs +0 -1
- package/dist/ReportBatchPanel-Fp1ePFag.cjs +0 -1
- package/dist/ReportPreview-BN6fk7Wz.cjs +0 -6
- package/dist/ReportPreview-D2Jkyh1U.js +0 -4243
- package/dist/ReportTemplateLibrary-5fk5CQBO.cjs +0 -1
- package/dist/RuleEditor-ChRzNQuF.cjs +0 -1
- package/dist/RuleEditor-DzAmW5YH.js +0 -2024
- package/dist/TemplateReviewPanel-BKofGrV9.js +0 -222
- package/dist/TemplateReviewPanel-DwtOcLue.cjs +0 -1
- package/dist/assets-C2U-e-Sz.cjs +0 -4
- package/dist/assets-Q0wUwNrV.js +0 -217
- package/dist/batch-Bt3Fd27Z.cjs +0 -1
- package/dist/batch-mRqhhhjt.js +0 -364
- package/dist/capabilities-CK_7hizc.js +0 -63
- package/dist/capabilities-CsZ-pNHR.cjs +0 -1
- package/dist/config-Bb7RiIO5.cjs +0 -1
- package/dist/config-XVwG87IA.js +0 -529
- package/dist/matrix-DVyWiYsd.cjs +0 -1
- package/dist/matrix-yZsGnldA.js +0 -227
- package/dist/page-window-index-CIuT4BAv.js +0 -43
- package/dist/page-window-index-DEjnM6IB.cjs +0 -1
- package/dist/param-validation-BlHHXs6u.js +0 -153
- package/dist/param-validation-DCK039V1.cjs +0 -1
- package/dist/plugin-D4wizDXB.js +0 -22
- package/dist/progress-7OSZbFok.js +0 -39
- package/dist/progress-BnLiS5eH.cjs +0 -1
- package/dist/task-events-DQ276fn2.cjs +0 -1
- package/dist/task-events-Dpsvf_t2.js +0 -47
- package/dist/template-registry-D3SjENi6.cjs +0 -1
- package/dist/template-review-DGwWOoCv.cjs +0 -2
- package/dist/template-review-PgEe_Wr9.js +0 -1742
- package/dist/validate-BJ5HIWY8.cjs +0 -1
- package/dist/validate-DbgEM1Hh.js +0 -163
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { p } from "./template-registry-BtaKPELV.js";
|
|
2
|
+
import { c as S } from "./template-bindings-C2SpvsMU.js";
|
|
3
|
+
import { e as h } from "./style-CQ1PK8ZB.js";
|
|
4
|
+
function m(t) {
|
|
5
|
+
return JSON.parse(JSON.stringify(t));
|
|
6
|
+
}
|
|
7
|
+
function u(t) {
|
|
8
|
+
return {
|
|
9
|
+
...t.repeatDataset ? { repeat: { dataset: t.repeatDataset } } : {},
|
|
10
|
+
pages: [{ widthMm: 4999, heightMm: 4999, components: t.components }]
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function M(t) {
|
|
14
|
+
if (!t.id.trim() || !t.name.trim() || !t.revision.trim())
|
|
15
|
+
throw new Error("Fragment identity, name and revision are required");
|
|
16
|
+
if (!t.components.length || t.components.length > 200)
|
|
17
|
+
throw new RangeError("A fragment must contain 1–200 components");
|
|
18
|
+
p({
|
|
19
|
+
schemaVersion: "1.0",
|
|
20
|
+
id: t.id,
|
|
21
|
+
name: t.name,
|
|
22
|
+
template: u(t)
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function j(t, a, e, n) {
|
|
26
|
+
const r = p(t).template.pages[a];
|
|
27
|
+
if (!r || !e.length || e.some(
|
|
28
|
+
(o) => !Number.isSafeInteger(o) || !r.components[o]
|
|
29
|
+
))
|
|
30
|
+
throw new Error("Select existing components to capture a fragment");
|
|
31
|
+
const s = [...new Set(e)].map(
|
|
32
|
+
(o) => r.components[o]
|
|
33
|
+
), l = Math.min(...s.map((o) => o.leftMm)), i = Math.min(...s.map((o) => o.topMm)), c = {
|
|
34
|
+
...n,
|
|
35
|
+
...t.template.repeat ? { repeatDataset: t.template.repeat.dataset } : {},
|
|
36
|
+
components: m(s).map((o) => ({
|
|
37
|
+
...o,
|
|
38
|
+
leftMm: o.leftMm - l,
|
|
39
|
+
topMm: o.topMm - i
|
|
40
|
+
}))
|
|
41
|
+
};
|
|
42
|
+
return M(c), c;
|
|
43
|
+
}
|
|
44
|
+
function $(t) {
|
|
45
|
+
M(t);
|
|
46
|
+
const a = /* @__PURE__ */ new Map();
|
|
47
|
+
for (const e of S(
|
|
48
|
+
u(t)
|
|
49
|
+
)) {
|
|
50
|
+
const n = a.get(e.dataset) ?? /* @__PURE__ */ new Set();
|
|
51
|
+
for (const r of e.fields)
|
|
52
|
+
!e.generated.has(r.field) && !e.summaries.has(r.field) && n.add(r.field);
|
|
53
|
+
a.set(e.dataset, n);
|
|
54
|
+
}
|
|
55
|
+
return [...a].map(([e, n]) => ({
|
|
56
|
+
dataset: e,
|
|
57
|
+
fields: [...n]
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
function E(t, a, e) {
|
|
61
|
+
const n = a.replace(/^\$\.template\./, "").replace(/\[(\d+)\]/g, ".$1").split(".");
|
|
62
|
+
let r = t;
|
|
63
|
+
for (const s of n.slice(0, -1))
|
|
64
|
+
r = r[s];
|
|
65
|
+
r[n[n.length - 1]] = e;
|
|
66
|
+
}
|
|
67
|
+
function b(t, a, e = {}) {
|
|
68
|
+
const n = u({ ...t, components: a });
|
|
69
|
+
for (const r of S(n)) {
|
|
70
|
+
for (const l of r.fields) {
|
|
71
|
+
const i = e.fields?.[r.dataset]?.[l.field];
|
|
72
|
+
i !== void 0 && E(n, l.path, i);
|
|
73
|
+
}
|
|
74
|
+
const s = e.datasets?.[r.dataset];
|
|
75
|
+
s !== void 0 && E(n, `${r.path}.dataset`, s);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function g(t) {
|
|
79
|
+
if (!t || typeof t != "object") return;
|
|
80
|
+
if (Array.isArray(t)) {
|
|
81
|
+
t.forEach(g);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const a = t;
|
|
85
|
+
for (const e of ["nid", "rkey", "table", "source"]) delete a[e];
|
|
86
|
+
if (a.kind === "list" && delete a.id, a.meta && typeof a.meta == "object")
|
|
87
|
+
for (const e of ["fragment", "labelSource", "record"])
|
|
88
|
+
delete a.meta[e];
|
|
89
|
+
Object.values(a).forEach(g);
|
|
90
|
+
}
|
|
91
|
+
function x(t) {
|
|
92
|
+
const a = new Set(
|
|
93
|
+
t.template.pages.flatMap(
|
|
94
|
+
(n) => n.components.map(
|
|
95
|
+
(r) => r.meta?.fragment?.instance
|
|
96
|
+
)
|
|
97
|
+
)
|
|
98
|
+
);
|
|
99
|
+
let e = 1;
|
|
100
|
+
for (; a.has(`fragment-${e}`); ) e++;
|
|
101
|
+
return `fragment-${e}`;
|
|
102
|
+
}
|
|
103
|
+
function F(t, a, e) {
|
|
104
|
+
const n = e ? t.components.flatMap(
|
|
105
|
+
(s, l) => s.meta?.fragment?.instance === e ? [l] : []
|
|
106
|
+
) : [];
|
|
107
|
+
if (e && !n.length)
|
|
108
|
+
throw new Error("Fragment instance no longer exists");
|
|
109
|
+
const r = n.map((s) => t.components[s]);
|
|
110
|
+
if (r.some(
|
|
111
|
+
(s) => s.meta?.fragment?.id !== a.id
|
|
112
|
+
))
|
|
113
|
+
throw new Error("An upgrade must use the same fragment identity");
|
|
114
|
+
return {
|
|
115
|
+
replacing: n,
|
|
116
|
+
left: r.length ? Math.min(...r.map((s) => s.leftMm)) : t.marginLeftMm ?? 0,
|
|
117
|
+
top: r.length ? Math.min(...r.map((s) => s.topMm)) : t.marginTopMm ?? 0
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function k(t, a) {
|
|
121
|
+
if (a.some(
|
|
122
|
+
(e) => e.leftMm < 0 || e.topMm < 0 || e.leftMm + e.widthMm > t.widthMm + 1e-3 || e.topMm + (e.kind === "list" ? e.rowHeightMm ?? 7 : e.heightMm) > t.heightMm + 1e-3
|
|
123
|
+
))
|
|
124
|
+
throw new Error(
|
|
125
|
+
"Fragment exceeds the target page; choose a larger page or adjust its placement"
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
function v(t, a, e) {
|
|
129
|
+
M(a);
|
|
130
|
+
const n = p(t), r = n.template.pages[e.pageIndex];
|
|
131
|
+
if (!r || r.flow)
|
|
132
|
+
throw new Error("Choose a fixed page before inserting a fragment");
|
|
133
|
+
const s = F(r, a, e.replaceInstance), l = s.replacing, i = e.leftMm ?? s.left, c = e.topMm ?? s.top, o = m(a.components), w = e.replaceInstance ?? x(n);
|
|
134
|
+
if (a.repeatDataset && n.template.repeat?.dataset !== (e.bindings?.datasets?.[a.repeatDataset] ?? a.repeatDataset))
|
|
135
|
+
throw new Error("Bind this label fragment to the current record dataset");
|
|
136
|
+
b(a, o, e.bindings), o.forEach(g), o.forEach((f, d) => {
|
|
137
|
+
f.leftMm += i, f.topMm += c, f.meta = {
|
|
138
|
+
...f.meta,
|
|
139
|
+
fragment: {
|
|
140
|
+
id: a.id,
|
|
141
|
+
revision: a.revision,
|
|
142
|
+
instance: w,
|
|
143
|
+
slot: d
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
}), k(r, o);
|
|
147
|
+
const y = l[0] ?? r.components.length;
|
|
148
|
+
return r.components = r.components.filter(
|
|
149
|
+
(f, d) => !l.includes(d)
|
|
150
|
+
), r.components.splice(y, 0, ...o), {
|
|
151
|
+
document: p(n),
|
|
152
|
+
componentIndices: o.map((f, d) => y + d),
|
|
153
|
+
instance: w
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function B(t, a, e, n) {
|
|
157
|
+
const r = p(t), s = r.template.pages[a];
|
|
158
|
+
if (!s) throw new Error("Page no longer exists");
|
|
159
|
+
for (const l of e) {
|
|
160
|
+
const i = s.components[l];
|
|
161
|
+
if (!i) throw new Error("Component no longer exists");
|
|
162
|
+
i.kind === "list" ? n.target === "header" ? D(i, n.style) : i.columns.forEach((c) => {
|
|
163
|
+
c.style = h(c.style, m(n.style)), n.style.align && (c.align = n.style.align);
|
|
164
|
+
}) : i.style = h(
|
|
165
|
+
i.style,
|
|
166
|
+
m(n.style)
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
return p(r);
|
|
170
|
+
}
|
|
171
|
+
function D(t, a) {
|
|
172
|
+
if (t.headerStyle = h(
|
|
173
|
+
t.headerStyle,
|
|
174
|
+
m(a)
|
|
175
|
+
), t.columns.forEach((e) => {
|
|
176
|
+
e.headerStyle = h(e.headerStyle, m(a)), a.align && (e.headerAlign = a.align);
|
|
177
|
+
}), t.headerGrid)
|
|
178
|
+
for (const e of t.headerGrid.cells)
|
|
179
|
+
for (const n of e)
|
|
180
|
+
n && (n.style = h(n.style, m(a)));
|
|
181
|
+
}
|
|
182
|
+
export {
|
|
183
|
+
B as a,
|
|
184
|
+
$ as b,
|
|
185
|
+
j as c,
|
|
186
|
+
v as i
|
|
187
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const f=require("./template-registry-Co1zPq5e.cjs"),T=require("./template-bindings-CEtWyiLX.cjs"),g=require("./style-UgIJSA1F.cjs");function p(t){return JSON.parse(JSON.stringify(t))}function u(t){return{...t.repeatDataset?{repeat:{dataset:t.repeatDataset}}:{},pages:[{widthMm:4999,heightMm:4999,components:t.components}]}}function y(t){if(!t.id.trim()||!t.name.trim()||!t.revision.trim())throw new Error("Fragment identity, name and revision are required");if(!t.components.length||t.components.length>200)throw new RangeError("A fragment must contain 1–200 components");f.parseReportTemplate({schemaVersion:"1.0",id:t.id,name:t.name,template:u(t)})}function E(t,n,e,a){const r=f.parseReportTemplate(t).template.pages[n];if(!r||!e.length||e.some(o=>!Number.isSafeInteger(o)||!r.components[o]))throw new Error("Select existing components to capture a fragment");const s=[...new Set(e)].map(o=>r.components[o]),l=Math.min(...s.map(o=>o.leftMm)),i=Math.min(...s.map(o=>o.topMm)),m={...a,...t.template.repeat?{repeatDataset:t.template.repeat.dataset}:{},components:p(s).map(o=>({...o,leftMm:o.leftMm-l,topMm:o.topMm-i}))};return y(m),m}function b(t){y(t);const n=new Map;for(const e of T.collectTemplateDatasetBindings(u(t))){const a=n.get(e.dataset)??new Set;for(const r of e.fields)!e.generated.has(r.field)&&!e.summaries.has(r.field)&&a.add(r.field);n.set(e.dataset,a)}return[...n].map(([e,a])=>({dataset:e,fields:[...a]}))}function S(t,n,e){const a=n.replace(/^\$\.template\./,"").replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const s of a.slice(0,-1))r=r[s];r[a[a.length-1]]=e}function F(t,n,e={}){const a=u({...t,components:n});for(const r of T.collectTemplateDatasetBindings(a)){for(const l of r.fields){const i=e.fields?.[r.dataset]?.[l.field];i!==void 0&&S(a,l.path,i)}const s=e.datasets?.[r.dataset];s!==void 0&&S(a,`${r.path}.dataset`,s)}}function h(t){if(!t||typeof t!="object")return;if(Array.isArray(t)){t.forEach(h);return}const n=t;for(const e of["nid","rkey","table","source"])delete n[e];if(n.kind==="list"&&delete n.id,n.meta&&typeof n.meta=="object")for(const e of["fragment","labelSource","record"])delete n.meta[e];Object.values(n).forEach(h)}function D(t){const n=new Set(t.template.pages.flatMap(a=>a.components.map(r=>r.meta?.fragment?.instance)));let e=1;for(;n.has(`fragment-${e}`);)e++;return`fragment-${e}`}function R(t,n,e){const a=e?t.components.flatMap((s,l)=>s.meta?.fragment?.instance===e?[l]:[]):[];if(e&&!a.length)throw new Error("Fragment instance no longer exists");const r=a.map(s=>t.components[s]);if(r.some(s=>s.meta?.fragment?.id!==n.id))throw new Error("An upgrade must use the same fragment identity");return{replacing:a,left:r.length?Math.min(...r.map(s=>s.leftMm)):t.marginLeftMm??0,top:r.length?Math.min(...r.map(s=>s.topMm)):t.marginTopMm??0}}function x(t,n){if(n.some(e=>e.leftMm<0||e.topMm<0||e.leftMm+e.widthMm>t.widthMm+.001||e.topMm+(e.kind==="list"?e.rowHeightMm??7:e.heightMm)>t.heightMm+.001))throw new Error("Fragment exceeds the target page; choose a larger page or adjust its placement")}function k(t,n,e){y(n);const a=f.parseReportTemplate(t),r=a.template.pages[e.pageIndex];if(!r||r.flow)throw new Error("Choose a fixed page before inserting a fragment");const s=R(r,n,e.replaceInstance),l=s.replacing,i=e.leftMm??s.left,m=e.topMm??s.top,o=p(n.components),M=e.replaceInstance??D(a);if(n.repeatDataset&&a.template.repeat?.dataset!==(e.bindings?.datasets?.[n.repeatDataset]??n.repeatDataset))throw new Error("Bind this label fragment to the current record dataset");F(n,o,e.bindings),o.forEach(h),o.forEach((c,d)=>{c.leftMm+=i,c.topMm+=m,c.meta={...c.meta,fragment:{id:n.id,revision:n.revision,instance:M,slot:d}}}),x(r,o);const w=l[0]??r.components.length;return r.components=r.components.filter((c,d)=>!l.includes(d)),r.components.splice(w,0,...o),{document:f.parseReportTemplate(a),componentIndices:o.map((c,d)=>w+d),instance:M}}function C(t,n,e,a){const r=f.parseReportTemplate(t),s=r.template.pages[n];if(!s)throw new Error("Page no longer exists");for(const l of e){const i=s.components[l];if(!i)throw new Error("Component no longer exists");i.kind==="list"?a.target==="header"?I(i,a.style):i.columns.forEach(m=>{m.style=g.mergeComponentStyles(m.style,p(a.style)),a.style.align&&(m.align=a.style.align)}):i.style=g.mergeComponentStyles(i.style,p(a.style))}return f.parseReportTemplate(r)}function I(t,n){if(t.headerStyle=g.mergeComponentStyles(t.headerStyle,p(n)),t.columns.forEach(e=>{e.headerStyle=g.mergeComponentStyles(e.headerStyle,p(n)),n.align&&(e.headerAlign=n.align)}),t.headerGrid)for(const e of t.headerGrid.cells)for(const a of e)a&&(a.style=g.mergeComponentStyles(a.style,p(n)))}exports.applyReportDocumentStyle=C;exports.captureTemplateFragment=E;exports.insertTemplateFragment=k;exports.inspectTemplateFragmentBindings=b;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("./template-bindings-CEtWyiLX.cjs");function $(e){const a=/\.pages\[(\d+)\](?:\.components\[(\d+)\])?/.exec(e);return a?{pageIndex:Number(a[1]),...a[2]===void 0?{}:{componentIndex:Number(a[2])}}:{}}function m(e,a,l){return u.collectTemplateDatasetBindings(e).filter(s=>s.dataset===a).flatMap(s=>s.fields.filter(t=>t.field===l).map(t=>({...t,...$(t.path),dataset:a,kind:/\.computed\[/.test(t.path)?"calculation":/\.columns\[\d+\]\.field$/.test(t.path)?"display":"binding"})))}function g(e,a){const l=e.kind==="list"?e.title||e.dataset:e.binding?.field||e.text||e.nid;return`${e.kind} · ${(l||String(a+1)).replace(/\s+/g," ").slice(0,80)}`}function k(e){const a=u.collectTemplateDatasetBindings(e),l=new Map;for(const t of a)for(const d of t.fields){const c=/^\$\.template\.pages\[\d+\]\.components\[\d+\]/.exec(d.path)?.[0];if(!c)continue;const n=l.get(c)??[];n.push({...d,dataset:t.dataset}),l.set(c,n)}const s=[];return e.pages.forEach((t,d)=>{const c=`$.template.pages[${d}]`;s.push({path:c,pageIndex:d,kind:"page",depth:0,title:typeof t.meta?.title=="string"?t.meta.title:`${d+1} · ${t.widthMm} × ${t.heightMm} mm`}),t.components.forEach((n,p)=>{const o=`${c}.components[${p}]`,f={pageIndex:d,componentIndex:p};s.push({path:o,...f,depth:1,kind:"component",title:g(n,p)}),n.kind==="list"&&(n.columns.forEach((i,h)=>s.push({path:`${o}.columns[${h}].field`,...f,depth:2,kind:"field",title:`${i.header} · ${i.field}`,field:i.field,dataset:n.dataset})),n.computed?.forEach((i,h)=>s.push({path:`${o}.computed[${h}]`,...f,depth:2,kind:"calculation",title:i.field,field:i.field,dataset:n.dataset})));const r=new Set;for(const i of l.get(o)??[])/\.columns\[\d+\]\.field$/.test(i.path)||r.has(i.path)||(r.add(i.path),s.push({...i,...f,depth:2,kind:"binding",title:i.field}))})}),s}exports.collectTemplateOutline=k;exports.inspectTemplateFieldUsage=m;exports.templatePathLocation=$;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { c as u } from "./template-bindings-C2SpvsMU.js";
|
|
2
|
+
function $(e) {
|
|
3
|
+
const s = /\.pages\[(\d+)\](?:\.components\[(\d+)\])?/.exec(e);
|
|
4
|
+
return s ? {
|
|
5
|
+
pageIndex: Number(s[1]),
|
|
6
|
+
...s[2] === void 0 ? {} : { componentIndex: Number(s[2]) }
|
|
7
|
+
} : {};
|
|
8
|
+
}
|
|
9
|
+
function k(e, s, n) {
|
|
10
|
+
return u(e).filter((a) => a.dataset === s).flatMap(
|
|
11
|
+
(a) => a.fields.filter((t) => t.field === n).map((t) => ({
|
|
12
|
+
...t,
|
|
13
|
+
...$(t.path),
|
|
14
|
+
dataset: s,
|
|
15
|
+
kind: /\.computed\[/.test(t.path) ? "calculation" : /\.columns\[\d+\]\.field$/.test(t.path) ? "display" : "binding"
|
|
16
|
+
}))
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function m(e, s) {
|
|
20
|
+
const n = e.kind === "list" ? e.title || e.dataset : e.binding?.field || e.text || e.nid;
|
|
21
|
+
return `${e.kind} · ${(n || String(s + 1)).replace(/\s+/g, " ").slice(0, 80)}`;
|
|
22
|
+
}
|
|
23
|
+
function b(e) {
|
|
24
|
+
const s = u(e), n = /* @__PURE__ */ new Map();
|
|
25
|
+
for (const t of s)
|
|
26
|
+
for (const l of t.fields) {
|
|
27
|
+
const c = /^\$\.template\.pages\[\d+\]\.components\[\d+\]/.exec(
|
|
28
|
+
l.path
|
|
29
|
+
)?.[0];
|
|
30
|
+
if (!c) continue;
|
|
31
|
+
const d = n.get(c) ?? [];
|
|
32
|
+
d.push({ ...l, dataset: t.dataset }), n.set(c, d);
|
|
33
|
+
}
|
|
34
|
+
const a = [];
|
|
35
|
+
return e.pages.forEach((t, l) => {
|
|
36
|
+
const c = `$.template.pages[${l}]`;
|
|
37
|
+
a.push({
|
|
38
|
+
path: c,
|
|
39
|
+
pageIndex: l,
|
|
40
|
+
kind: "page",
|
|
41
|
+
depth: 0,
|
|
42
|
+
title: typeof t.meta?.title == "string" ? t.meta.title : `${l + 1} · ${t.widthMm} × ${t.heightMm} mm`
|
|
43
|
+
}), t.components.forEach((d, h) => {
|
|
44
|
+
const f = `${c}.components[${h}]`, o = { pageIndex: l, componentIndex: h };
|
|
45
|
+
a.push({
|
|
46
|
+
path: f,
|
|
47
|
+
...o,
|
|
48
|
+
depth: 1,
|
|
49
|
+
kind: "component",
|
|
50
|
+
title: m(d, h)
|
|
51
|
+
}), d.kind === "list" && (d.columns.forEach(
|
|
52
|
+
(i, p) => a.push({
|
|
53
|
+
path: `${f}.columns[${p}].field`,
|
|
54
|
+
...o,
|
|
55
|
+
depth: 2,
|
|
56
|
+
kind: "field",
|
|
57
|
+
title: `${i.header} · ${i.field}`,
|
|
58
|
+
field: i.field,
|
|
59
|
+
dataset: d.dataset
|
|
60
|
+
})
|
|
61
|
+
), d.computed?.forEach(
|
|
62
|
+
(i, p) => a.push({
|
|
63
|
+
path: `${f}.computed[${p}]`,
|
|
64
|
+
...o,
|
|
65
|
+
depth: 2,
|
|
66
|
+
kind: "calculation",
|
|
67
|
+
title: i.field,
|
|
68
|
+
field: i.field,
|
|
69
|
+
dataset: d.dataset
|
|
70
|
+
})
|
|
71
|
+
));
|
|
72
|
+
const r = /* @__PURE__ */ new Set();
|
|
73
|
+
for (const i of n.get(f) ?? [])
|
|
74
|
+
/\.columns\[\d+\]\.field$/.test(i.path) || r.has(i.path) || (r.add(i.path), a.push({
|
|
75
|
+
...i,
|
|
76
|
+
...o,
|
|
77
|
+
depth: 2,
|
|
78
|
+
kind: "binding",
|
|
79
|
+
title: i.field
|
|
80
|
+
}));
|
|
81
|
+
});
|
|
82
|
+
}), a;
|
|
83
|
+
}
|
|
84
|
+
export {
|
|
85
|
+
b as c,
|
|
86
|
+
k as i,
|
|
87
|
+
$ as t
|
|
88
|
+
};
|