@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,592 @@
|
|
|
1
|
+
import { shallowRef as q, ref as C, computed as P, watch as H, onBeforeUnmount as re, toRaw as ne, defineComponent as se, openBlock as r, createElementBlock as n, toDisplayString as t, createCommentVNode as v, Fragment as N, createElementVNode as l, createVNode as X, unref as s, createTextVNode as R, withDirectives as U, isRef as L, vModelSelect as oe, renderList as B, vModelText as Y, vModelCheckbox as Z, normalizeClass as K, createBlock as ue } from "vue";
|
|
2
|
+
import { reviewReportTemplateAsync as ie, paginateTemplate as ce } from "@agile-team/mach-report";
|
|
3
|
+
import { T as Q } from "./designer-2bDlcNXQ.js";
|
|
4
|
+
import { ReportPreview as ee } from "@agile-team/mach-report/vue";
|
|
5
|
+
import { c as de } from "./template-bindings-C2SpvsMU.js";
|
|
6
|
+
import { _ as le } from "./_plugin-vue_export-helper-8SL1F89S.js";
|
|
7
|
+
function ve(o, d = () => o.fixtures) {
|
|
8
|
+
const i = q(), u = q([]), e = C("20"), c = C(!1), g = C(!1), m = C(!1), _ = C(""), h = q(), w = C(!1), M = q(), b = P(
|
|
9
|
+
() => new Set(
|
|
10
|
+
o.document.template.pages.flatMap((f) => f.components).flatMap(
|
|
11
|
+
(f) => f.kind === "list" && f.tree ? [f.dataset] : []
|
|
12
|
+
)
|
|
13
|
+
)
|
|
14
|
+
), A = P(() => b.value.size > 0);
|
|
15
|
+
let k = 0, p;
|
|
16
|
+
function j() {
|
|
17
|
+
k++, p?.abort(), p = void 0, g.value = !1, w.value = !1, h.value = void 0, m.value = !!i.value, _.value = "";
|
|
18
|
+
}
|
|
19
|
+
for (const f of [() => o.document, () => o.previous])
|
|
20
|
+
H(
|
|
21
|
+
f,
|
|
22
|
+
() => {
|
|
23
|
+
c.value = !1, j();
|
|
24
|
+
},
|
|
25
|
+
{ deep: !0, flush: "sync" }
|
|
26
|
+
);
|
|
27
|
+
for (const f of [
|
|
28
|
+
() => o.datasets,
|
|
29
|
+
() => o.dataSchemas,
|
|
30
|
+
() => o.formats,
|
|
31
|
+
d
|
|
32
|
+
])
|
|
33
|
+
H(f, j, { deep: !0, flush: "sync" });
|
|
34
|
+
H([e, c], j, { flush: "sync" }), re(() => {
|
|
35
|
+
k++, p?.abort();
|
|
36
|
+
});
|
|
37
|
+
const z = P(
|
|
38
|
+
() => i.value?.issues.filter((f) => f.severity === "error").length ?? 0
|
|
39
|
+
);
|
|
40
|
+
function F() {
|
|
41
|
+
p?.abort(), p = new AbortController();
|
|
42
|
+
const f = ++k, $ = p;
|
|
43
|
+
g.value = !0, _.value = "", w.value = !1, h.value = void 0, J(f, $);
|
|
44
|
+
}
|
|
45
|
+
async function J(f, $) {
|
|
46
|
+
try {
|
|
47
|
+
const x = Number(e.value), G = Object.fromEntries(
|
|
48
|
+
Object.entries(o.datasets ?? {}).map(([O, S]) => [
|
|
49
|
+
O,
|
|
50
|
+
x < 0 || b.value.has(O) ? S : S.slice(0, x)
|
|
51
|
+
])
|
|
52
|
+
), V = d(), T = V?.length ? [...V] : x === 0 ? [] : [{ name: e.value, datasets: G }], D = await ie(o.document, {
|
|
53
|
+
previous: o.previous,
|
|
54
|
+
dataSchemas: o.dataSchemas,
|
|
55
|
+
formats: o.formats,
|
|
56
|
+
allowBreakingChanges: c.value,
|
|
57
|
+
...!V?.length && A.value && x > 0 ? { maxSampleRows: x } : {},
|
|
58
|
+
fixtures: T,
|
|
59
|
+
signal: $.signal,
|
|
60
|
+
onProgress: (O) => {
|
|
61
|
+
f === k && (h.value = O);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
if (f !== k) return;
|
|
65
|
+
i.value = D, m.value = !1, u.value = T, M.value = {
|
|
66
|
+
requested: e.value,
|
|
67
|
+
rows: D.samples.reduce((O, S) => O + S.rows, 0),
|
|
68
|
+
datasets: new Set(
|
|
69
|
+
T.flatMap((O) => Object.keys(O.datasets))
|
|
70
|
+
).size,
|
|
71
|
+
formats: [...o.formats ?? []]
|
|
72
|
+
};
|
|
73
|
+
} catch (x) {
|
|
74
|
+
f === k && !$.signal.aborted && (_.value = x instanceof Error ? x.message : String(x));
|
|
75
|
+
} finally {
|
|
76
|
+
f === k && (g.value = !1, p = void 0);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function W() {
|
|
80
|
+
k++, p?.abort(), p = void 0, g.value = !1, w.value = !0, h.value = void 0;
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
report: i,
|
|
84
|
+
sampleSize: e,
|
|
85
|
+
acknowledged: c,
|
|
86
|
+
running: g,
|
|
87
|
+
stale: m,
|
|
88
|
+
failure: _,
|
|
89
|
+
checkedScope: M,
|
|
90
|
+
checkedFixtures: u,
|
|
91
|
+
hasTree: A,
|
|
92
|
+
errors: z,
|
|
93
|
+
run: F,
|
|
94
|
+
cancel: W,
|
|
95
|
+
progress: h,
|
|
96
|
+
cancelled: w
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function me(o) {
|
|
100
|
+
const d = Object.getPrototypeOf(o);
|
|
101
|
+
if (d !== Object.prototype && d !== Array.prototype && d !== null)
|
|
102
|
+
throw new Error("Sample data must contain plain JSON objects");
|
|
103
|
+
if (Object.getOwnPropertySymbols(o).length)
|
|
104
|
+
throw new Error("Sample data must not contain symbols");
|
|
105
|
+
if (Array.isArray(o) && Object.keys(o).length !== o.length)
|
|
106
|
+
throw new Error("Sample arrays must not contain holes or extra properties");
|
|
107
|
+
}
|
|
108
|
+
function pe(o) {
|
|
109
|
+
let d = 0, i = 0;
|
|
110
|
+
const u = /* @__PURE__ */ new Set();
|
|
111
|
+
function e(c, g) {
|
|
112
|
+
if (++d > 1e5 || g > 32)
|
|
113
|
+
throw new RangeError("Sample data exceeds the capture budget");
|
|
114
|
+
if (typeof c == "string") {
|
|
115
|
+
if (i += c.length, i > 2e6)
|
|
116
|
+
throw new RangeError("Sample text exceeds the capture budget");
|
|
117
|
+
return c;
|
|
118
|
+
}
|
|
119
|
+
if (c === null || typeof c == "boolean" || typeof c == "number" && Number.isFinite(c)) return c;
|
|
120
|
+
if (!c || typeof c != "object")
|
|
121
|
+
throw new Error("Sample data must contain plain JSON values");
|
|
122
|
+
const m = ne(c);
|
|
123
|
+
if (u.has(m))
|
|
124
|
+
throw new Error("Sample data must not contain cycles");
|
|
125
|
+
me(m), u.add(m);
|
|
126
|
+
const _ = Array.isArray(m) ? [] : /* @__PURE__ */ Object.create(null);
|
|
127
|
+
for (const h of Object.keys(m)) {
|
|
128
|
+
const w = Object.getOwnPropertyDescriptor(m, h);
|
|
129
|
+
if (w.get || w.set || ["__proto__", "constructor", "prototype"].includes(h))
|
|
130
|
+
throw new Error("Sample data must not contain getters or unsafe keys");
|
|
131
|
+
_[h] = e(
|
|
132
|
+
w.value,
|
|
133
|
+
g + 1
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
return u.delete(m), _;
|
|
137
|
+
}
|
|
138
|
+
return e(o, 0);
|
|
139
|
+
}
|
|
140
|
+
function fe(o, d = () => Q) {
|
|
141
|
+
const i = C([]), u = C(""), e = C(!1), c = C(""), g = C({}), m = P(() => [...o.fixtures ?? [], ...i.value]);
|
|
142
|
+
function _() {
|
|
143
|
+
c.value = "";
|
|
144
|
+
try {
|
|
145
|
+
if (!e.value) throw new Error(d().sampleConsentMissing);
|
|
146
|
+
if (!u.value.trim()) throw new Error(d().sampleNameMissing);
|
|
147
|
+
if (m.value.length >= 20) throw new Error(d().sampleLimit);
|
|
148
|
+
if (m.value.some((M) => M.name === u.value.trim()))
|
|
149
|
+
throw new Error(d().sampleNameDuplicate);
|
|
150
|
+
const w = pe(o.datasets ?? {});
|
|
151
|
+
if (Object.values(w).reduce((M, b) => M + b.length, 0) > 1e3)
|
|
152
|
+
throw new Error(d().sampleRowsLimit);
|
|
153
|
+
i.value.push({
|
|
154
|
+
name: u.value.trim(),
|
|
155
|
+
datasets: w,
|
|
156
|
+
...Object.keys(g.value).length ? { params: { ...g.value } } : {}
|
|
157
|
+
}), u.value = "", e.value = !1;
|
|
158
|
+
} catch (w) {
|
|
159
|
+
c.value = w instanceof Error ? w.message : String(w);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function h(w) {
|
|
163
|
+
i.value.splice(w, 1);
|
|
164
|
+
}
|
|
165
|
+
return { fixtures: i, name: u, consent: e, failure: c, params: g, suite: m, capture: _, remove: h };
|
|
166
|
+
}
|
|
167
|
+
function te(o, d) {
|
|
168
|
+
const i = ce(o.template, d.datasets, {
|
|
169
|
+
maxPages: 100,
|
|
170
|
+
maxCells: 25e4
|
|
171
|
+
}), u = [
|
|
172
|
+
...new Set(
|
|
173
|
+
de(o.template).flatMap(
|
|
174
|
+
(e) => e.fields.map((c) => `${e.dataset}.${c.field}`)
|
|
175
|
+
)
|
|
176
|
+
)
|
|
177
|
+
];
|
|
178
|
+
return {
|
|
179
|
+
pages: i.plan.pages.length,
|
|
180
|
+
dimensions: [
|
|
181
|
+
...new Set(
|
|
182
|
+
i.plan.pages.map(
|
|
183
|
+
(e) => `${e.pageWidthMm} × ${e.pageHeightMm} mm`
|
|
184
|
+
)
|
|
185
|
+
)
|
|
186
|
+
],
|
|
187
|
+
fields: u,
|
|
188
|
+
fetcher: async () => i.plan
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
function he(o, d, i) {
|
|
192
|
+
const u = te(o, d), e = i ? te(i, d) : void 0, c = new Set(e?.fields), g = new Set(u.fields);
|
|
193
|
+
return {
|
|
194
|
+
current: u,
|
|
195
|
+
previous: e,
|
|
196
|
+
addedFields: u.fields.filter((m) => !c.has(m)),
|
|
197
|
+
removedFields: e?.fields.filter((m) => !g.has(m)) ?? []
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
const we = ["aria-label"], ge = {
|
|
201
|
+
key: 0,
|
|
202
|
+
role: "alert"
|
|
203
|
+
}, ye = { class: "mr-fixture-previews" }, be = { key: 0 }, _e = /* @__PURE__ */ se({
|
|
204
|
+
__name: "TemplateFixtureComparison",
|
|
205
|
+
props: {
|
|
206
|
+
document: {},
|
|
207
|
+
previous: {},
|
|
208
|
+
fixture: {},
|
|
209
|
+
messages: {}
|
|
210
|
+
},
|
|
211
|
+
setup(o) {
|
|
212
|
+
const d = o, i = P(() => ({ ...Q, ...d.messages })), u = P(() => {
|
|
213
|
+
try {
|
|
214
|
+
return {
|
|
215
|
+
result: he(
|
|
216
|
+
d.document,
|
|
217
|
+
d.fixture,
|
|
218
|
+
d.previous
|
|
219
|
+
)
|
|
220
|
+
};
|
|
221
|
+
} catch (e) {
|
|
222
|
+
return { error: e instanceof Error ? e.message : String(e) };
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
return (e, c) => (r(), n("section", {
|
|
226
|
+
class: "mr-fixture-comparison",
|
|
227
|
+
"aria-label": i.value.compare
|
|
228
|
+
}, [
|
|
229
|
+
u.value.error ? (r(), n("p", ge, t(u.value.error), 1)) : v("", !0),
|
|
230
|
+
u.value.result ? (r(), n(N, { key: 1 }, [
|
|
231
|
+
l("dl", null, [
|
|
232
|
+
l("dt", null, t(i.value.pages), 1),
|
|
233
|
+
l("dd", null, t(u.value.result.previous?.pages ?? "—") + " → " + t(u.value.result.current.pages), 1),
|
|
234
|
+
l("dt", null, t(i.value.dimensions), 1),
|
|
235
|
+
l("dd", null, t(u.value.result.previous?.dimensions.join(" / ") ?? "—") + " → " + t(u.value.result.current.dimensions.join(" / ")), 1),
|
|
236
|
+
l("dt", null, t(i.value.fieldsAdded), 1),
|
|
237
|
+
l("dd", null, t(u.value.result.addedFields.join("、") || "—"), 1),
|
|
238
|
+
l("dt", null, t(i.value.fieldsRemoved), 1),
|
|
239
|
+
l("dd", null, t(u.value.result.removedFields.join("、") || "—"), 1)
|
|
240
|
+
]),
|
|
241
|
+
l("div", ye, [
|
|
242
|
+
u.value.result.previous ? (r(), n("article", be, [
|
|
243
|
+
l("h4", null, t(i.value.baselinePreview), 1),
|
|
244
|
+
X(s(ee), {
|
|
245
|
+
"report-id": "baseline",
|
|
246
|
+
fetcher: u.value.result.previous.fetcher,
|
|
247
|
+
"show-params": !1,
|
|
248
|
+
"show-export": !1,
|
|
249
|
+
"show-print": !1,
|
|
250
|
+
"show-pdf-window": !1,
|
|
251
|
+
editable: !1,
|
|
252
|
+
"excel-import": !1,
|
|
253
|
+
height: "400px"
|
|
254
|
+
}, null, 8, ["fetcher"])
|
|
255
|
+
])) : v("", !0),
|
|
256
|
+
l("article", null, [
|
|
257
|
+
l("h4", null, t(i.value.draftPreview), 1),
|
|
258
|
+
X(s(ee), {
|
|
259
|
+
"report-id": "draft",
|
|
260
|
+
fetcher: u.value.result.current.fetcher,
|
|
261
|
+
"show-params": !1,
|
|
262
|
+
"show-export": !1,
|
|
263
|
+
"show-print": !1,
|
|
264
|
+
"show-pdf-window": !1,
|
|
265
|
+
editable: !1,
|
|
266
|
+
"excel-import": !1,
|
|
267
|
+
height: "400px"
|
|
268
|
+
}, null, 8, ["fetcher"])
|
|
269
|
+
])
|
|
270
|
+
])
|
|
271
|
+
], 64)) : v("", !0)
|
|
272
|
+
], 8, we));
|
|
273
|
+
}
|
|
274
|
+
}), ke = /* @__PURE__ */ le(_e, [["__scopeId", "data-v-211ee4bf"]]), xe = ["aria-label", "aria-busy"], Se = {
|
|
275
|
+
key: 0,
|
|
276
|
+
role: "status"
|
|
277
|
+
}, Ce = ["disabled"], Ee = {
|
|
278
|
+
key: 0,
|
|
279
|
+
class: "mr-review-stale",
|
|
280
|
+
role: "status"
|
|
281
|
+
}, je = { class: "mr-review-controls" }, Fe = ["aria-label", "disabled"], Oe = { value: "0" }, Te = { value: "20" }, Re = { value: "100" }, Ne = { value: "-1" }, Me = {
|
|
282
|
+
key: 0,
|
|
283
|
+
class: "mr-review-note"
|
|
284
|
+
}, Pe = { class: "mr-review-fixtures" }, $e = { class: "mr-review-note" }, Ve = { key: 0 }, Ae = ["disabled", "onClick"], De = { class: "mr-review-fixture-form" }, Ue = ["placeholder", "disabled"], Be = { key: 0 }, ze = ["onUpdate:modelValue", "placeholder", "disabled"], Ie = { class: "mr-review-consent" }, qe = ["disabled"], Le = ["disabled"], He = {
|
|
285
|
+
key: 1,
|
|
286
|
+
role: "alert",
|
|
287
|
+
class: "is-error"
|
|
288
|
+
}, Je = {
|
|
289
|
+
key: 1,
|
|
290
|
+
class: "mr-review-note"
|
|
291
|
+
}, We = {
|
|
292
|
+
key: 2,
|
|
293
|
+
class: "is-error",
|
|
294
|
+
role: "alert"
|
|
295
|
+
}, Ge = {
|
|
296
|
+
key: 3,
|
|
297
|
+
class: "mr-review-stale",
|
|
298
|
+
role: "status"
|
|
299
|
+
}, Ke = {
|
|
300
|
+
key: 4,
|
|
301
|
+
class: "mr-review-note"
|
|
302
|
+
}, Qe = {
|
|
303
|
+
key: 0,
|
|
304
|
+
class: "mr-review-summary",
|
|
305
|
+
role: "status"
|
|
306
|
+
}, Xe = {
|
|
307
|
+
key: 0,
|
|
308
|
+
class: "mr-review-note"
|
|
309
|
+
}, Ye = {
|
|
310
|
+
key: 1,
|
|
311
|
+
class: "mr-review-note"
|
|
312
|
+
}, Ze = {
|
|
313
|
+
key: 2,
|
|
314
|
+
class: "mr-review-list"
|
|
315
|
+
}, et = { key: 0 }, tt = ["onClick"], st = {
|
|
316
|
+
key: 3,
|
|
317
|
+
class: "mr-review-note"
|
|
318
|
+
}, lt = {
|
|
319
|
+
key: 4,
|
|
320
|
+
class: "mr-review-ack"
|
|
321
|
+
}, at = {
|
|
322
|
+
key: 0,
|
|
323
|
+
class: "mr-review-note"
|
|
324
|
+
}, rt = {
|
|
325
|
+
key: 1,
|
|
326
|
+
class: "mr-review-list"
|
|
327
|
+
}, nt = ["onClick"], ot = {
|
|
328
|
+
key: 0,
|
|
329
|
+
class: "mr-review-scope"
|
|
330
|
+
}, ut = { key: 0 }, it = ["disabled", "onClick"], ct = { class: "mr-review-note" }, dt = /* @__PURE__ */ se({
|
|
331
|
+
__name: "TemplateReviewPanel",
|
|
332
|
+
props: {
|
|
333
|
+
document: {},
|
|
334
|
+
previous: {},
|
|
335
|
+
datasets: {},
|
|
336
|
+
dataSchemas: {},
|
|
337
|
+
formats: {},
|
|
338
|
+
fixtures: {},
|
|
339
|
+
messages: {}
|
|
340
|
+
},
|
|
341
|
+
emits: ["locate"],
|
|
342
|
+
setup(o, { emit: d }) {
|
|
343
|
+
const i = o, u = d, e = P(() => ({ ...Q, ...i.messages })), {
|
|
344
|
+
name: c,
|
|
345
|
+
consent: g,
|
|
346
|
+
failure: m,
|
|
347
|
+
params: _,
|
|
348
|
+
suite: h,
|
|
349
|
+
capture: w,
|
|
350
|
+
remove: M
|
|
351
|
+
} = fe(i, () => e.value), {
|
|
352
|
+
report: b,
|
|
353
|
+
sampleSize: A,
|
|
354
|
+
acknowledged: k,
|
|
355
|
+
running: p,
|
|
356
|
+
stale: j,
|
|
357
|
+
failure: z,
|
|
358
|
+
checkedScope: F,
|
|
359
|
+
checkedFixtures: J,
|
|
360
|
+
hasTree: W,
|
|
361
|
+
errors: f,
|
|
362
|
+
run: $,
|
|
363
|
+
cancel: x,
|
|
364
|
+
cancelled: G,
|
|
365
|
+
progress: V
|
|
366
|
+
} = ve(i, () => h.value), T = C(), D = P(
|
|
367
|
+
() => J.value.find((S) => S.name === T.value)
|
|
368
|
+
);
|
|
369
|
+
H(j, (S) => {
|
|
370
|
+
S && (T.value = void 0);
|
|
371
|
+
});
|
|
372
|
+
function O(S) {
|
|
373
|
+
const y = /\.pages\[(\d+)\]\.components\[(\d+)\]/.exec(S);
|
|
374
|
+
u("locate", {
|
|
375
|
+
path: S,
|
|
376
|
+
...y ? { pageIndex: Number(y[1]), componentIndex: Number(y[2]) } : {}
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
return (S, y) => (r(), n("section", {
|
|
380
|
+
class: "mr-template-review",
|
|
381
|
+
"aria-label": e.value.title,
|
|
382
|
+
"aria-busy": s(p)
|
|
383
|
+
}, [
|
|
384
|
+
l("header", null, [
|
|
385
|
+
l("strong", null, t(e.value.title), 1),
|
|
386
|
+
s(p) && s(V) ? (r(), n("span", Se, t(s(V).completed) + " / " + t(s(V).total) + " " + t(e.value.progress), 1)) : v("", !0),
|
|
387
|
+
s(p) ? (r(), n("button", {
|
|
388
|
+
key: 1,
|
|
389
|
+
type: "button",
|
|
390
|
+
onClick: y[0] || (y[0] = //@ts-ignore
|
|
391
|
+
(...a) => s(x) && s(x)(...a))
|
|
392
|
+
}, t(e.value.cancel), 1)) : v("", !0),
|
|
393
|
+
l("button", {
|
|
394
|
+
type: "button",
|
|
395
|
+
disabled: s(p),
|
|
396
|
+
onClick: y[1] || (y[1] = //@ts-ignore
|
|
397
|
+
(...a) => s($) && s($)(...a))
|
|
398
|
+
}, t(s(p) ? e.value.running : e.value.run), 9, Ce)
|
|
399
|
+
]),
|
|
400
|
+
s(G) ? (r(), n("p", Ee, t(e.value.cancelled), 1)) : v("", !0),
|
|
401
|
+
l("div", je, [
|
|
402
|
+
l("label", null, [
|
|
403
|
+
R(t(e.value.samples), 1),
|
|
404
|
+
U(l("select", {
|
|
405
|
+
"onUpdate:modelValue": y[2] || (y[2] = (a) => L(A) ? A.value = a : null),
|
|
406
|
+
"aria-label": e.value.samples,
|
|
407
|
+
disabled: s(p) || !!s(h).length
|
|
408
|
+
}, [
|
|
409
|
+
l("option", Oe, t(e.value.none), 1),
|
|
410
|
+
l("option", Te, t(e.value.first20), 1),
|
|
411
|
+
l("option", Re, t(e.value.first100), 1),
|
|
412
|
+
l("option", Ne, t(e.value.all), 1)
|
|
413
|
+
], 8, Fe), [
|
|
414
|
+
[oe, s(A)]
|
|
415
|
+
])
|
|
416
|
+
]),
|
|
417
|
+
s(h).length ? (r(), n("span", Me, t(e.value.namedFixtures) + " · " + t(s(h).length), 1)) : v("", !0)
|
|
418
|
+
]),
|
|
419
|
+
l("details", Pe, [
|
|
420
|
+
l("summary", null, [
|
|
421
|
+
R(t(e.value.namedFixtures) + " ", 1),
|
|
422
|
+
l("small", null, t(s(h).length) + " / 20", 1)
|
|
423
|
+
]),
|
|
424
|
+
l("p", $e, t(e.value.fixtureHint), 1),
|
|
425
|
+
s(h).length ? (r(), n("ul", Ve, [
|
|
426
|
+
(r(!0), n(N, null, B(s(h), (a, E) => (r(), n("li", {
|
|
427
|
+
key: a.name
|
|
428
|
+
}, [
|
|
429
|
+
l("strong", null, t(a.name), 1),
|
|
430
|
+
l("span", null, t(Object.values(a.datasets).reduce(
|
|
431
|
+
(I, ae) => I + ae.length,
|
|
432
|
+
0
|
|
433
|
+
)) + " " + t(e.value.rows), 1),
|
|
434
|
+
E >= (o.fixtures?.length ?? 0) ? (r(), n("button", {
|
|
435
|
+
key: 0,
|
|
436
|
+
type: "button",
|
|
437
|
+
disabled: s(p),
|
|
438
|
+
onClick: (I) => s(M)(E - (o.fixtures?.length ?? 0))
|
|
439
|
+
}, t(e.value.remove), 9, Ae)) : v("", !0)
|
|
440
|
+
]))), 128))
|
|
441
|
+
])) : v("", !0),
|
|
442
|
+
l("div", De, [
|
|
443
|
+
l("label", null, [
|
|
444
|
+
R(t(e.value.fixtureName), 1),
|
|
445
|
+
U(l("input", {
|
|
446
|
+
"onUpdate:modelValue": y[3] || (y[3] = (a) => L(c) ? c.value = a : null),
|
|
447
|
+
placeholder: e.value.fixturePlaceholder,
|
|
448
|
+
disabled: s(p)
|
|
449
|
+
}, null, 8, Ue), [
|
|
450
|
+
[Y, s(c)]
|
|
451
|
+
])
|
|
452
|
+
]),
|
|
453
|
+
o.document.template.params?.length ? (r(), n("details", Be, [
|
|
454
|
+
l("summary", null, t(e.value.parameters), 1),
|
|
455
|
+
(r(!0), n(N, null, B(o.document.template.params, (a) => (r(), n("label", {
|
|
456
|
+
key: a.field
|
|
457
|
+
}, [
|
|
458
|
+
R(t(a.label ?? a.field), 1),
|
|
459
|
+
U(l("input", {
|
|
460
|
+
"onUpdate:modelValue": (E) => s(_)[a.field] = E,
|
|
461
|
+
placeholder: a.defaultValue,
|
|
462
|
+
disabled: s(p)
|
|
463
|
+
}, null, 8, ze), [
|
|
464
|
+
[Y, s(_)[a.field]]
|
|
465
|
+
])
|
|
466
|
+
]))), 128))
|
|
467
|
+
])) : v("", !0),
|
|
468
|
+
l("label", Ie, [
|
|
469
|
+
U(l("input", {
|
|
470
|
+
"onUpdate:modelValue": y[4] || (y[4] = (a) => L(g) ? g.value = a : null),
|
|
471
|
+
type: "checkbox",
|
|
472
|
+
disabled: s(p)
|
|
473
|
+
}, null, 8, qe), [
|
|
474
|
+
[Z, s(g)]
|
|
475
|
+
]),
|
|
476
|
+
R(t(e.value.deidentified), 1)
|
|
477
|
+
]),
|
|
478
|
+
l("button", {
|
|
479
|
+
type: "button",
|
|
480
|
+
disabled: s(p) || !s(g) || !s(c).trim() || s(h).length >= 20,
|
|
481
|
+
onClick: y[5] || (y[5] = //@ts-ignore
|
|
482
|
+
(...a) => s(w) && s(w)(...a))
|
|
483
|
+
}, t(e.value.capture), 9, Le),
|
|
484
|
+
s(m) ? (r(), n("p", He, t(s(m)), 1)) : v("", !0)
|
|
485
|
+
])
|
|
486
|
+
]),
|
|
487
|
+
s(W) ? (r(), n("p", Je, t(e.value.treeHint), 1)) : v("", !0),
|
|
488
|
+
s(z) ? (r(), n("p", We, t(s(z)), 1)) : v("", !0),
|
|
489
|
+
s(j) ? (r(), n("p", Ge, t(e.value.stale), 1)) : v("", !0),
|
|
490
|
+
s(b) ? (r(), n(N, { key: 5 }, [
|
|
491
|
+
s(j) ? v("", !0) : (r(), n("div", Qe, [
|
|
492
|
+
l("span", {
|
|
493
|
+
class: K({ "is-error": s(f) })
|
|
494
|
+
}, t(s(f)) + " " + t(e.value.errors), 3),
|
|
495
|
+
l("span", null, t(s(b).issues.length - s(f)) + " " + t(e.value.warnings), 1)
|
|
496
|
+
])),
|
|
497
|
+
l("section", null, [
|
|
498
|
+
l("h3", null, [
|
|
499
|
+
R(t(e.value.changes) + " ", 1),
|
|
500
|
+
l("small", null, t(s(b).changes?.totalChanges ?? 0), 1)
|
|
501
|
+
]),
|
|
502
|
+
o.previous ? s(b).changes?.totalChanges ? (r(), n("ol", Ze, [
|
|
503
|
+
(r(!0), n(N, null, B(s(b).changes?.changes, (a, E) => (r(), n("li", { key: E }, [
|
|
504
|
+
l("div", null, [
|
|
505
|
+
l("span", null, t(e.value.categories[a.category]) + " · " + t(e.value.kinds[a.kind]), 1),
|
|
506
|
+
a.breaking ? (r(), n("b", et, t(e.value.breaking), 1)) : v("", !0),
|
|
507
|
+
l("button", {
|
|
508
|
+
type: "button",
|
|
509
|
+
onClick: (I) => O(a.path)
|
|
510
|
+
}, t(e.value.locate), 9, tt)
|
|
511
|
+
]),
|
|
512
|
+
l("code", null, t(a.path), 1),
|
|
513
|
+
l("dl", null, [
|
|
514
|
+
a.before !== void 0 ? (r(), n(N, { key: 0 }, [
|
|
515
|
+
l("dt", null, t(e.value.before), 1),
|
|
516
|
+
l("dd", null, t(a.before), 1)
|
|
517
|
+
], 64)) : v("", !0),
|
|
518
|
+
a.after !== void 0 ? (r(), n(N, { key: 1 }, [
|
|
519
|
+
l("dt", null, t(e.value.after), 1),
|
|
520
|
+
l("dd", null, t(a.after), 1)
|
|
521
|
+
], 64)) : v("", !0)
|
|
522
|
+
])
|
|
523
|
+
]))), 128))
|
|
524
|
+
])) : (r(), n("p", Ye, t(e.value.noChanges), 1)) : (r(), n("p", Xe, t(e.value.baseline), 1)),
|
|
525
|
+
s(b).changes?.truncated ? (r(), n("p", st, t(e.value.truncated), 1)) : v("", !0),
|
|
526
|
+
s(b).changes?.breakingChanges ? (r(), n("label", lt, [
|
|
527
|
+
U(l("input", {
|
|
528
|
+
"onUpdate:modelValue": y[6] || (y[6] = (a) => L(k) ? k.value = a : null),
|
|
529
|
+
type: "checkbox"
|
|
530
|
+
}, null, 512), [
|
|
531
|
+
[Z, s(k)]
|
|
532
|
+
]),
|
|
533
|
+
R(t(e.value.acknowledge), 1)
|
|
534
|
+
])) : v("", !0)
|
|
535
|
+
]),
|
|
536
|
+
l("section", null, [
|
|
537
|
+
l("h3", null, t(e.value.issues), 1),
|
|
538
|
+
s(b).issues.length ? (r(), n("ol", rt, [
|
|
539
|
+
(r(!0), n(N, null, B(s(b).issues, (a, E) => (r(), n("li", { key: E }, [
|
|
540
|
+
l("div", null, [
|
|
541
|
+
l("span", {
|
|
542
|
+
class: K({ "is-error": a.severity === "error" })
|
|
543
|
+
}, t(a.severity === "error" ? e.value.errors : e.value.warnings), 3),
|
|
544
|
+
l("button", {
|
|
545
|
+
type: "button",
|
|
546
|
+
onClick: (I) => u("locate", a)
|
|
547
|
+
}, t(e.value.locate), 9, nt)
|
|
548
|
+
]),
|
|
549
|
+
l("p", null, t(a.message), 1),
|
|
550
|
+
l("code", null, t(a.path), 1)
|
|
551
|
+
]))), 128))
|
|
552
|
+
])) : (r(), n("p", at, t(e.value.noIssues), 1))
|
|
553
|
+
]),
|
|
554
|
+
s(b).samples.length ? (r(), n("section", {
|
|
555
|
+
key: 1,
|
|
556
|
+
class: K({ "is-stale": s(j) })
|
|
557
|
+
}, [
|
|
558
|
+
l("h3", null, t(e.value.results), 1),
|
|
559
|
+
s(F) ? (r(), n("p", ot, [
|
|
560
|
+
R(t(e.value.scope) + " · " + t(s(h).length ? e.value.namedFixtures : s(F).requested === "-1" ? e.value.all : s(F).requested === "0" ? e.value.none : s(F).requested + " " + e.value.rows) + " · " + t(s(F).datasets) + " " + t(e.value.datasets) + " · " + t(s(F).rows) + " " + t(e.value.rows), 1),
|
|
561
|
+
s(F).formats.length ? (r(), n("span", ut, " · " + t(s(F).formats.join(" / ")), 1)) : v("", !0)
|
|
562
|
+
])) : v("", !0),
|
|
563
|
+
(r(!0), n(N, null, B(s(b).samples, (a) => (r(), n("div", {
|
|
564
|
+
key: a.name,
|
|
565
|
+
class: "mr-review-sample"
|
|
566
|
+
}, [
|
|
567
|
+
l("p", null, [
|
|
568
|
+
l("strong", null, t(a.name), 1),
|
|
569
|
+
R(" · " + t(a.rows) + " " + t(e.value.rows) + " · " + t(a.pages) + " " + t(e.value.pages) + " · " + t(s(b).issues.filter((E) => E.fixture === a.name).length) + " " + t(e.value.issues), 1)
|
|
570
|
+
]),
|
|
571
|
+
l("button", {
|
|
572
|
+
type: "button",
|
|
573
|
+
disabled: s(j) || s(p),
|
|
574
|
+
onClick: (E) => T.value = T.value === a.name ? void 0 : a.name
|
|
575
|
+
}, t(T.value === a.name ? e.value.closeCompare : e.value.compare), 9, it)
|
|
576
|
+
]))), 128))
|
|
577
|
+
], 2)) : v("", !0),
|
|
578
|
+
D.value && !s(j) ? (r(), ue(ke, {
|
|
579
|
+
key: 2,
|
|
580
|
+
document: o.document,
|
|
581
|
+
previous: o.previous,
|
|
582
|
+
fixture: D.value,
|
|
583
|
+
messages: o.messages
|
|
584
|
+
}, null, 8, ["document", "previous", "fixture", "messages"])) : v("", !0),
|
|
585
|
+
l("p", ct, t(e.value.checked), 1)
|
|
586
|
+
], 64)) : (r(), n("p", Ke, t(e.value.empty), 1))
|
|
587
|
+
], 8, xe));
|
|
588
|
+
}
|
|
589
|
+
}), gt = /* @__PURE__ */ le(dt, [["__scopeId", "data-v-0a5dda64"]]);
|
|
590
|
+
export {
|
|
591
|
+
gt as default
|
|
592
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),A=require("@agile-team/mach-report"),j=require("./designer-BT7XCdbW.cjs"),O=require("@agile-team/mach-report/vue"),L=require("./template-bindings-CEtWyiLX.cjs"),$=require("./_plugin-vue_export-helper-BLmdZLlg.cjs");function z(n,s=()=>n.fixtures){const o=e.shallowRef(),r=e.shallowRef([]),t=e.ref("20"),a=e.ref(!1),p=e.ref(!1),i=e.ref(!1),g=e.ref(""),d=e.shallowRef(),m=e.ref(!1),D=e.shallowRef(),v=e.computed(()=>new Set(n.document.template.pages.flatMap(u=>u.components).flatMap(u=>u.kind==="list"&&u.tree?[u.dataset]:[]))),B=e.computed(()=>v.value.size>0);let y=0,c;function S(){y++,c?.abort(),c=void 0,p.value=!1,m.value=!1,d.value=void 0,i.value=!!o.value,g.value=""}for(const u of[()=>n.document,()=>n.previous])e.watch(u,()=>{a.value=!1,S()},{deep:!0,flush:"sync"});for(const u of[()=>n.datasets,()=>n.dataSchemas,()=>n.formats,s])e.watch(u,S,{deep:!0,flush:"sync"});e.watch([t,a],S,{flush:"sync"}),e.onBeforeUnmount(()=>{y++,c?.abort()});const C=e.computed(()=>o.value?.issues.filter(u=>u.severity==="error").length??0);function w(){c?.abort(),c=new AbortController;const u=++y,_=c;p.value=!0,g.value="",m.value=!1,d.value=void 0,F(u,_)}async function F(u,_){try{const k=Number(t.value),M=Object.fromEntries(Object.entries(n.datasets??{}).map(([V,h])=>[V,k<0||v.value.has(V)?h:h.slice(0,k)])),b=s(),N=b?.length?[...b]:k===0?[]:[{name:t.value,datasets:M}],x=await A.reviewReportTemplateAsync(n.document,{previous:n.previous,dataSchemas:n.dataSchemas,formats:n.formats,allowBreakingChanges:a.value,...!b?.length&&B.value&&k>0?{maxSampleRows:k}:{},fixtures:N,signal:_.signal,onProgress:V=>{u===y&&(d.value=V)}});if(u!==y)return;o.value=x,i.value=!1,r.value=N,D.value={requested:t.value,rows:x.samples.reduce((V,h)=>V+h.rows,0),datasets:new Set(N.flatMap(V=>Object.keys(V.datasets))).size,formats:[...n.formats??[]]}}catch(k){u===y&&!_.signal.aborted&&(g.value=k instanceof Error?k.message:String(k))}finally{u===y&&(p.value=!1,c=void 0)}}function R(){y++,c?.abort(),c=void 0,p.value=!1,m.value=!0,d.value=void 0}return{report:o,sampleSize:t,acknowledged:a,running:p,stale:i,failure:g,checkedScope:D,checkedFixtures:r,hasTree:B,errors:C,run:w,cancel:R,progress:d,cancelled:m}}function I(n){const s=Object.getPrototypeOf(n);if(s!==Object.prototype&&s!==Array.prototype&&s!==null)throw new Error("Sample data must contain plain JSON objects");if(Object.getOwnPropertySymbols(n).length)throw new Error("Sample data must not contain symbols");if(Array.isArray(n)&&Object.keys(n).length!==n.length)throw new Error("Sample arrays must not contain holes or extra properties")}function U(n){let s=0,o=0;const r=new Set;function t(a,p){if(++s>1e5||p>32)throw new RangeError("Sample data exceeds the capture budget");if(typeof a=="string"){if(o+=a.length,o>2e6)throw new RangeError("Sample text exceeds the capture budget");return a}if(a===null||typeof a=="boolean"||typeof a=="number"&&Number.isFinite(a))return a;if(!a||typeof a!="object")throw new Error("Sample data must contain plain JSON values");const i=e.toRaw(a);if(r.has(i))throw new Error("Sample data must not contain cycles");I(i),r.add(i);const g=Array.isArray(i)?[]:Object.create(null);for(const d of Object.keys(i)){const m=Object.getOwnPropertyDescriptor(i,d);if(m.get||m.set||["__proto__","constructor","prototype"].includes(d))throw new Error("Sample data must not contain getters or unsafe keys");g[d]=t(m.value,p+1)}return r.delete(i),g}return t(n,0)}function H(n,s=()=>j.TEMPLATE_REVIEW_MESSAGES){const o=e.ref([]),r=e.ref(""),t=e.ref(!1),a=e.ref(""),p=e.ref({}),i=e.computed(()=>[...n.fixtures??[],...o.value]);function g(){a.value="";try{if(!t.value)throw new Error(s().sampleConsentMissing);if(!r.value.trim())throw new Error(s().sampleNameMissing);if(i.value.length>=20)throw new Error(s().sampleLimit);if(i.value.some(D=>D.name===r.value.trim()))throw new Error(s().sampleNameDuplicate);const m=U(n.datasets??{});if(Object.values(m).reduce((D,v)=>D+v.length,0)>1e3)throw new Error(s().sampleRowsLimit);o.value.push({name:r.value.trim(),datasets:m,...Object.keys(p.value).length?{params:{...p.value}}:{}}),r.value="",t.value=!1}catch(m){a.value=m instanceof Error?m.message:String(m)}}function d(m){o.value.splice(m,1)}return{fixtures:o,name:r,consent:t,failure:a,params:p,suite:i,capture:g,remove:d}}function P(n,s){const o=A.paginateTemplate(n.template,s.datasets,{maxPages:100,maxCells:25e4}),r=[...new Set(L.collectTemplateDatasetBindings(n.template).flatMap(t=>t.fields.map(a=>`${t.dataset}.${a.field}`)))];return{pages:o.plan.pages.length,dimensions:[...new Set(o.plan.pages.map(t=>`${t.pageWidthMm} × ${t.pageHeightMm} mm`))],fields:r,fetcher:async()=>o.plan}}function W(n,s,o){const r=P(n,s),t=o?P(o,s):void 0,a=new Set(t?.fields),p=new Set(r.fields);return{current:r,previous:t,addedFields:r.fields.filter(i=>!a.has(i)),removedFields:t?.fields.filter(i=>!p.has(i))??[]}}const G=["aria-label"],J={key:0,role:"alert"},K={class:"mr-fixture-previews"},Q={key:0},X=e.defineComponent({__name:"TemplateFixtureComparison",props:{document:{},previous:{},fixture:{},messages:{}},setup(n){const s=n,o=e.computed(()=>({...j.TEMPLATE_REVIEW_MESSAGES,...s.messages})),r=e.computed(()=>{try{return{result:W(s.document,s.fixture,s.previous)}}catch(t){return{error:t instanceof Error?t.message:String(t)}}});return(t,a)=>(e.openBlock(),e.createElementBlock("section",{class:"mr-fixture-comparison","aria-label":o.value.compare},[r.value.error?(e.openBlock(),e.createElementBlock("p",J,e.toDisplayString(r.value.error),1)):e.createCommentVNode("",!0),r.value.result?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("dl",null,[e.createElementVNode("dt",null,e.toDisplayString(o.value.pages),1),e.createElementVNode("dd",null,e.toDisplayString(r.value.result.previous?.pages??"—")+" → "+e.toDisplayString(r.value.result.current.pages),1),e.createElementVNode("dt",null,e.toDisplayString(o.value.dimensions),1),e.createElementVNode("dd",null,e.toDisplayString(r.value.result.previous?.dimensions.join(" / ")??"—")+" → "+e.toDisplayString(r.value.result.current.dimensions.join(" / ")),1),e.createElementVNode("dt",null,e.toDisplayString(o.value.fieldsAdded),1),e.createElementVNode("dd",null,e.toDisplayString(r.value.result.addedFields.join("、")||"—"),1),e.createElementVNode("dt",null,e.toDisplayString(o.value.fieldsRemoved),1),e.createElementVNode("dd",null,e.toDisplayString(r.value.result.removedFields.join("、")||"—"),1)]),e.createElementVNode("div",K,[r.value.result.previous?(e.openBlock(),e.createElementBlock("article",Q,[e.createElementVNode("h4",null,e.toDisplayString(o.value.baselinePreview),1),e.createVNode(e.unref(O.ReportPreview),{"report-id":"baseline",fetcher:r.value.result.previous.fetcher,"show-params":!1,"show-export":!1,"show-print":!1,"show-pdf-window":!1,editable:!1,"excel-import":!1,height:"400px"},null,8,["fetcher"])])):e.createCommentVNode("",!0),e.createElementVNode("article",null,[e.createElementVNode("h4",null,e.toDisplayString(o.value.draftPreview),1),e.createVNode(e.unref(O.ReportPreview),{"report-id":"draft",fetcher:r.value.result.current.fetcher,"show-params":!1,"show-export":!1,"show-print":!1,"show-pdf-window":!1,editable:!1,"excel-import":!1,height:"400px"},null,8,["fetcher"])])])],64)):e.createCommentVNode("",!0)],8,G))}}),Y=$._export_sfc(X,[["__scopeId","data-v-211ee4bf"]]),Z=["aria-label","aria-busy"],ee={key:0,role:"status"},te=["disabled"],le={key:0,class:"mr-review-stale",role:"status"},ne={class:"mr-review-controls"},re=["aria-label","disabled"],oe={value:"0"},ae={value:"20"},se={value:"100"},ie={value:"-1"},ce={key:0,class:"mr-review-note"},ue={class:"mr-review-fixtures"},de={class:"mr-review-note"},me={key:0},pe=["disabled","onClick"],fe={class:"mr-review-fixture-form"},ve=["placeholder","disabled"],ge={key:0},ye=["onUpdate:modelValue","placeholder","disabled"],ke={class:"mr-review-consent"},he=["disabled"],Ee=["disabled"],Se={key:1,role:"alert",class:"is-error"},we={key:1,class:"mr-review-note"},Ve={key:2,class:"is-error",role:"alert"},Ne={key:3,class:"mr-review-stale",role:"status"},De={key:4,class:"mr-review-note"},_e={key:0,class:"mr-review-summary",role:"status"},be={key:0,class:"mr-review-note"},Be={key:1,class:"mr-review-note"},xe={key:2,class:"mr-review-list"},Ce={key:0},Te=["onClick"],Fe={key:3,class:"mr-review-note"},Re={key:4,class:"mr-review-ack"},Me={key:0,class:"mr-review-note"},je={key:1,class:"mr-review-list"},Oe=["onClick"],Pe={key:0,class:"mr-review-scope"},Ae={key:0},$e=["disabled","onClick"],qe={class:"mr-review-note"},Le=e.defineComponent({__name:"TemplateReviewPanel",props:{document:{},previous:{},datasets:{},dataSchemas:{},formats:{},fixtures:{},messages:{}},emits:["locate"],setup(n,{emit:s}){const o=n,r=s,t=e.computed(()=>({...j.TEMPLATE_REVIEW_MESSAGES,...o.messages})),{name:a,consent:p,failure:i,params:g,suite:d,capture:m,remove:D}=H(o,()=>t.value),{report:v,sampleSize:B,acknowledged:y,running:c,stale:S,failure:C,checkedScope:w,checkedFixtures:F,hasTree:R,errors:u,run:_,cancel:k,cancelled:M,progress:b}=z(o,()=>d.value),N=e.ref(),x=e.computed(()=>F.value.find(h=>h.name===N.value));e.watch(S,h=>{h&&(N.value=void 0)});function V(h){const f=/\.pages\[(\d+)\]\.components\[(\d+)\]/.exec(h);r("locate",{path:h,...f?{pageIndex:Number(f[1]),componentIndex:Number(f[2])}:{}})}return(h,f)=>(e.openBlock(),e.createElementBlock("section",{class:"mr-template-review","aria-label":t.value.title,"aria-busy":e.unref(c)},[e.createElementVNode("header",null,[e.createElementVNode("strong",null,e.toDisplayString(t.value.title),1),e.unref(c)&&e.unref(b)?(e.openBlock(),e.createElementBlock("span",ee,e.toDisplayString(e.unref(b).completed)+" / "+e.toDisplayString(e.unref(b).total)+" "+e.toDisplayString(t.value.progress),1)):e.createCommentVNode("",!0),e.unref(c)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",onClick:f[0]||(f[0]=(...l)=>e.unref(k)&&e.unref(k)(...l))},e.toDisplayString(t.value.cancel),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",disabled:e.unref(c),onClick:f[1]||(f[1]=(...l)=>e.unref(_)&&e.unref(_)(...l))},e.toDisplayString(e.unref(c)?t.value.running:t.value.run),9,te)]),e.unref(M)?(e.openBlock(),e.createElementBlock("p",le,e.toDisplayString(t.value.cancelled),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ne,[e.createElementVNode("label",null,[e.createTextVNode(e.toDisplayString(t.value.samples),1),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":f[2]||(f[2]=l=>e.isRef(B)?B.value=l:null),"aria-label":t.value.samples,disabled:e.unref(c)||!!e.unref(d).length},[e.createElementVNode("option",oe,e.toDisplayString(t.value.none),1),e.createElementVNode("option",ae,e.toDisplayString(t.value.first20),1),e.createElementVNode("option",se,e.toDisplayString(t.value.first100),1),e.createElementVNode("option",ie,e.toDisplayString(t.value.all),1)],8,re),[[e.vModelSelect,e.unref(B)]])]),e.unref(d).length?(e.openBlock(),e.createElementBlock("span",ce,e.toDisplayString(t.value.namedFixtures)+" · "+e.toDisplayString(e.unref(d).length),1)):e.createCommentVNode("",!0)]),e.createElementVNode("details",ue,[e.createElementVNode("summary",null,[e.createTextVNode(e.toDisplayString(t.value.namedFixtures)+" ",1),e.createElementVNode("small",null,e.toDisplayString(e.unref(d).length)+" / 20",1)]),e.createElementVNode("p",de,e.toDisplayString(t.value.fixtureHint),1),e.unref(d).length?(e.openBlock(),e.createElementBlock("ul",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),(l,E)=>(e.openBlock(),e.createElementBlock("li",{key:l.name},[e.createElementVNode("strong",null,e.toDisplayString(l.name),1),e.createElementVNode("span",null,e.toDisplayString(Object.values(l.datasets).reduce((T,q)=>T+q.length,0))+" "+e.toDisplayString(t.value.rows),1),E>=(n.fixtures?.length??0)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:e.unref(c),onClick:T=>e.unref(D)(E-(n.fixtures?.length??0))},e.toDisplayString(t.value.remove),9,pe)):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",fe,[e.createElementVNode("label",null,[e.createTextVNode(e.toDisplayString(t.value.fixtureName),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[3]||(f[3]=l=>e.isRef(a)?a.value=l:null),placeholder:t.value.fixturePlaceholder,disabled:e.unref(c)},null,8,ve),[[e.vModelText,e.unref(a)]])]),n.document.template.params?.length?(e.openBlock(),e.createElementBlock("details",ge,[e.createElementVNode("summary",null,e.toDisplayString(t.value.parameters),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.document.template.params,l=>(e.openBlock(),e.createElementBlock("label",{key:l.field},[e.createTextVNode(e.toDisplayString(l.label??l.field),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":E=>e.unref(g)[l.field]=E,placeholder:l.defaultValue,disabled:e.unref(c)},null,8,ye),[[e.vModelText,e.unref(g)[l.field]]])]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("label",ke,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[4]||(f[4]=l=>e.isRef(p)?p.value=l:null),type:"checkbox",disabled:e.unref(c)},null,8,he),[[e.vModelCheckbox,e.unref(p)]]),e.createTextVNode(e.toDisplayString(t.value.deidentified),1)]),e.createElementVNode("button",{type:"button",disabled:e.unref(c)||!e.unref(p)||!e.unref(a).trim()||e.unref(d).length>=20,onClick:f[5]||(f[5]=(...l)=>e.unref(m)&&e.unref(m)(...l))},e.toDisplayString(t.value.capture),9,Ee),e.unref(i)?(e.openBlock(),e.createElementBlock("p",Se,e.toDisplayString(e.unref(i)),1)):e.createCommentVNode("",!0)])]),e.unref(R)?(e.openBlock(),e.createElementBlock("p",we,e.toDisplayString(t.value.treeHint),1)):e.createCommentVNode("",!0),e.unref(C)?(e.openBlock(),e.createElementBlock("p",Ve,e.toDisplayString(e.unref(C)),1)):e.createCommentVNode("",!0),e.unref(S)?(e.openBlock(),e.createElementBlock("p",Ne,e.toDisplayString(t.value.stale),1)):e.createCommentVNode("",!0),e.unref(v)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.unref(S)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",_e,[e.createElementVNode("span",{class:e.normalizeClass({"is-error":e.unref(u)})},e.toDisplayString(e.unref(u))+" "+e.toDisplayString(t.value.errors),3),e.createElementVNode("span",null,e.toDisplayString(e.unref(v).issues.length-e.unref(u))+" "+e.toDisplayString(t.value.warnings),1)])),e.createElementVNode("section",null,[e.createElementVNode("h3",null,[e.createTextVNode(e.toDisplayString(t.value.changes)+" ",1),e.createElementVNode("small",null,e.toDisplayString(e.unref(v).changes?.totalChanges??0),1)]),n.previous?e.unref(v).changes?.totalChanges?(e.openBlock(),e.createElementBlock("ol",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v).changes?.changes,(l,E)=>(e.openBlock(),e.createElementBlock("li",{key:E},[e.createElementVNode("div",null,[e.createElementVNode("span",null,e.toDisplayString(t.value.categories[l.category])+" · "+e.toDisplayString(t.value.kinds[l.kind]),1),l.breaking?(e.openBlock(),e.createElementBlock("b",Ce,e.toDisplayString(t.value.breaking),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",onClick:T=>V(l.path)},e.toDisplayString(t.value.locate),9,Te)]),e.createElementVNode("code",null,e.toDisplayString(l.path),1),e.createElementVNode("dl",null,[l.before!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("dt",null,e.toDisplayString(t.value.before),1),e.createElementVNode("dd",null,e.toDisplayString(l.before),1)],64)):e.createCommentVNode("",!0),l.after!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("dt",null,e.toDisplayString(t.value.after),1),e.createElementVNode("dd",null,e.toDisplayString(l.after),1)],64)):e.createCommentVNode("",!0)])]))),128))])):(e.openBlock(),e.createElementBlock("p",Be,e.toDisplayString(t.value.noChanges),1)):(e.openBlock(),e.createElementBlock("p",be,e.toDisplayString(t.value.baseline),1)),e.unref(v).changes?.truncated?(e.openBlock(),e.createElementBlock("p",Fe,e.toDisplayString(t.value.truncated),1)):e.createCommentVNode("",!0),e.unref(v).changes?.breakingChanges?(e.openBlock(),e.createElementBlock("label",Re,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[6]||(f[6]=l=>e.isRef(y)?y.value=l:null),type:"checkbox"},null,512),[[e.vModelCheckbox,e.unref(y)]]),e.createTextVNode(e.toDisplayString(t.value.acknowledge),1)])):e.createCommentVNode("",!0)]),e.createElementVNode("section",null,[e.createElementVNode("h3",null,e.toDisplayString(t.value.issues),1),e.unref(v).issues.length?(e.openBlock(),e.createElementBlock("ol",je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v).issues,(l,E)=>(e.openBlock(),e.createElementBlock("li",{key:E},[e.createElementVNode("div",null,[e.createElementVNode("span",{class:e.normalizeClass({"is-error":l.severity==="error"})},e.toDisplayString(l.severity==="error"?t.value.errors:t.value.warnings),3),e.createElementVNode("button",{type:"button",onClick:T=>r("locate",l)},e.toDisplayString(t.value.locate),9,Oe)]),e.createElementVNode("p",null,e.toDisplayString(l.message),1),e.createElementVNode("code",null,e.toDisplayString(l.path),1)]))),128))])):(e.openBlock(),e.createElementBlock("p",Me,e.toDisplayString(t.value.noIssues),1))]),e.unref(v).samples.length?(e.openBlock(),e.createElementBlock("section",{key:1,class:e.normalizeClass({"is-stale":e.unref(S)})},[e.createElementVNode("h3",null,e.toDisplayString(t.value.results),1),e.unref(w)?(e.openBlock(),e.createElementBlock("p",Pe,[e.createTextVNode(e.toDisplayString(t.value.scope)+" · "+e.toDisplayString(e.unref(d).length?t.value.namedFixtures:e.unref(w).requested==="-1"?t.value.all:e.unref(w).requested==="0"?t.value.none:e.unref(w).requested+" "+t.value.rows)+" · "+e.toDisplayString(e.unref(w).datasets)+" "+e.toDisplayString(t.value.datasets)+" · "+e.toDisplayString(e.unref(w).rows)+" "+e.toDisplayString(t.value.rows),1),e.unref(w).formats.length?(e.openBlock(),e.createElementBlock("span",Ae," · "+e.toDisplayString(e.unref(w).formats.join(" / ")),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v).samples,l=>(e.openBlock(),e.createElementBlock("div",{key:l.name,class:"mr-review-sample"},[e.createElementVNode("p",null,[e.createElementVNode("strong",null,e.toDisplayString(l.name),1),e.createTextVNode(" · "+e.toDisplayString(l.rows)+" "+e.toDisplayString(t.value.rows)+" · "+e.toDisplayString(l.pages)+" "+e.toDisplayString(t.value.pages)+" · "+e.toDisplayString(e.unref(v).issues.filter(E=>E.fixture===l.name).length)+" "+e.toDisplayString(t.value.issues),1)]),e.createElementVNode("button",{type:"button",disabled:e.unref(S)||e.unref(c),onClick:E=>N.value=N.value===l.name?void 0:l.name},e.toDisplayString(N.value===l.name?t.value.closeCompare:t.value.compare),9,$e)]))),128))],2)):e.createCommentVNode("",!0),x.value&&!e.unref(S)?(e.openBlock(),e.createBlock(Y,{key:2,document:n.document,previous:n.previous,fixture:x.value,messages:n.messages},null,8,["document","previous","fixture","messages"])):e.createCommentVNode("",!0),e.createElementVNode("p",qe,e.toDisplayString(t.value.checked),1)],64)):(e.openBlock(),e.createElementBlock("p",De,e.toDisplayString(t.value.empty),1))],8,Z))}}),ze=$._export_sfc(Le,[["__scopeId","data-v-0a5dda64"]]);exports.default=ze;
|
package/dist/analytics.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./computed-CGV2a809.cjs"),y=require("./matrix-gEO7ZM_u.cjs"),b=["#2563eb","#0d9488","#d97706","#7c3aed","#dc2626","#0284c7"];function D(e){if(e.type!=="bar"&&e.type!=="line")throw new Error("图表 type 应为 bar 或 line");if(!Array.isArray(e.categories)||!Array.isArray(e.series)||!e.categories.length||e.categories.length>200||!e.series.length||e.series.length>12)throw new Error("图表支持 1–200 个分类、1–12 个系列;大数据应先聚合");if(e.categories.some(t=>typeof t!="string"))throw new Error("图表分类应为字符串");F(e);for(const t of e.series)A(t,e.categories.length)}function F(e){for(const t of["leftMm","topMm","widthMm","heightMm"])if(!Number.isFinite(e[t])||e[t]<0)throw new Error(`${t} 应为有限非负数`);if(e.widthMm<45||e.heightMm<35)throw new Error("图表至少需要 45×35mm");if(!Number.isFinite(e.leftMm+e.widthMm)||!Number.isFinite(e.topMm+e.heightMm))throw new Error("图表几何范围溢出")}function A(e,t){if(!e||typeof e.name!="string"||!Array.isArray(e.values)||e.values.length!==t||e.values.some(r=>r!==null&&!Number.isFinite(r)))throw new Error("图表系列应提供名称及逐分类的有限数字或 null");if(e.color!==void 0&&!/^#[\da-f]{6}$/i.test(e.color))throw new Error("图表颜色应为 #RRGGBB")}function v(e,t,r,n,i,c=.8){return{kind:"line",leftMm:Math.min(e,r),topMm:Math.min(t,n),widthMm:Math.abs(r-e),heightMm:Math.abs(n-t),lineDirection:n<t?"up":"down",style:{lineColor:i,lineWidthPt:c}}}function g(e,t,r,n,i="center"){return{kind:"text",text:e,leftMm:t,topMm:r,widthMm:n,heightMm:5,style:{fontSize:8,color:"#475569",align:i,verticalAlign:"middle"}}}function C(e){return Number(e.toPrecision(5)).toString()}function R(e){let t=0,r=0;for(const s of e.series)for(const u of s.values)u!==null&&(t=Math.min(t,u),r=Math.max(r,u));t===r&&(r=t+1);const n=e.leftMm+13,i=e.topMm+8,c=e.widthMm-17,l=e.heightMm-23,o=Math.max(Math.abs(t),Math.abs(r),1),m=t/o,d=r/o-m;return{left:n,top:i,width:c,height:l,min:t,max:r,y:s=>i+l*(1-(s/o-m)/d)}}function O(e,t){const r=[];e.title&&r.push({...g(e.title,e.leftMm,e.topMm,e.widthMm),style:{fontSize:10,bold:!0,align:"left"}});for(let c=0;c<=4;c++){const l=c/4,o=t.min*(1-l)+t.max*l,m=t.y(o);r.push(v(t.left,m,t.left+t.width,m,"#e2e8f0",.4),g(C(o),e.leftMm,m-2.5,11,"right"))}r.push(v(t.left,t.top,t.left,t.top+t.height,"#94a3b8"));const n=Math.max(1,Math.ceil(e.categories.length/Math.max(1,Math.floor(t.width/14))));e.categories.forEach((c,l)=>{l%n===0&&r.push(g(c,t.left+(l+.5)*t.width/e.categories.length-7,t.top+t.height+1,14))});const i=t.width/e.series.length;return e.series.forEach((c,l)=>{r.push({...g(c.name,t.left+l*i,e.topMm+e.heightMm-5,i),style:{fontSize:8,color:c.color??b[l%b.length],align:"center"}})}),r}function S(e,t,r,n){const i=[],c=r.color??b[n%b.length],l=t.width/e.categories.length,o=l*.75/e.series.length;let m;return r.values.forEach((d,s)=>{if(d===null){m=void 0;return}const u=t.left+(s+.5)*l,a=t.y(d);e.type==="bar"?i.push({kind:"rect",leftMm:t.left+s*l+l*.125+n*o,topMm:Math.min(a,t.y(0)),widthMm:o,heightMm:Math.abs(t.y(0)-a),style:{backgroundColor:c,borderTop:!1,borderRight:!1,borderBottom:!1,borderLeft:!1}}):(m&&i.push(v(m.x,m.y,u,a,c,1.2)),i.push({kind:"ellipse",leftMm:u-.7,topMm:a-.7,widthMm:1.4,heightMm:1.4,style:{backgroundColor:c,borderColor:c}}),m={x:u,y:a}),e.showValues&&i.push({...g(C(d),u-l/2,Math.max(t.top,a-5),l),style:{fontSize:7,color:c,align:"center"}})}),i}function L(e){D(e);const t=R(e);return[...O(e,t),...e.series.flatMap((r,n)=>S(e,t,r,n))]}function w(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function x(e){if(e==null)return"null";if(typeof e!="string"&&typeof e!="boolean"&&!(typeof e=="number"&&Number.isFinite(e)))throw new Error("交叉表维度应为字符串、布尔、有限数字或空值");return JSON.stringify([typeof e,e])}function E(e){return e==null?"":String(e)}function M(e,t){const r=e??t;if(!Number.isInteger(r)||r<1)throw new Error("交叉表预算应为正整数");return r}function N(e,t,r,n){const i=r?1:0;if((e+i)*(t+1+i)>n)throw new Error("交叉表输出单元格超出 maxCells 预算,请减少维度或服务端预聚合")}function T(e,t){if(!Array.isArray(e))throw new Error("交叉表数据应为对象数组");const r=t.aggregate??"sum";if(!["sum","count","avg","min","max","weightedAvg"].includes(r))throw new Error("未知交叉表聚合类型");if(!t.rowField||!t.columnField||r!=="count"&&!t.valueField)throw new Error("交叉表需要明确的行维度、列维度和度量字段");if(e.length>M(t.maxInputRows,1e5))throw new Error("交叉表输入超出预算,请在服务端预聚合");const n=M(t.maxRows,1e3),i=M(t.maxColumns,200),c=M(t.maxCells,2e6),l={op:r,field:r==="count"&&t.countMode!=="nonNull"?void 0:t.valueField,weightField:t.weightField,numeric:t.numeric,digits:t.digits};h.createAggregateAccumulator(l);const{groups:o,columns:m,columnTotals:d,totals:s}=y.accumulatePivotRows(e,{row:a=>({key:x(w(a,t.rowField)),label:E(w(a,t.rowField))}),column:a=>({key:x(w(a,t.columnField)),label:E(w(a,t.columnField))}),measures:[l],totals:t.totals,check:(a,f)=>{if(a>n||f>i)throw new Error("交叉表维度数量超出预算");N(a,f,t.totals,c)}}),u={columns:[{header:t.rowHeader??t.rowField,field:"rowLabel",semanticRole:"dimension"},...[...m.values()].map((a,f)=>({header:a,field:`c${f}`,semanticRole:"measure"}))],rows:[...o.values()].map(a=>({rowLabel:a.label,...Object.fromEntries([...m.keys()].map((f,k)=>[`c${k}`,a.cells.get(f)?.[0]?.value()??(r==="count"?0:null)])),...t.totals?{total:a.totals[0].value()}:{}}))};return t.totals&&(u.columns.push({header:"合计",field:"total",semanticRole:"measure"}),e.length&&u.rows.push({rowLabel:"合计",...Object.fromEntries([...m.keys()].map((a,f)=>[`c${f}`,d.get(a)?.[0]?.value()??(r==="count"?0:null)])),total:s[0].value()})),u}exports.addDecimal=h.addDecimal;exports.aggregateRows=h.aggregateRows;exports.compareDecimal=h.compareDecimal;exports.computeDataset=h.computeDataset;exports.createAggregateAccumulator=h.createAggregateAccumulator;exports.decimalDigits=h.decimalDigits;exports.divideDecimal=h.divideDecimal;exports.formatDecimal=h.formatDecimal;exports.getComputationMetadata=h.getComputationMetadata;exports.multiplyDecimal=h.multiplyDecimal;exports.parseDecimal=h.parseDecimal;exports.printDecimal=h.printDecimal;exports.validateComputedFields=h.validateComputedFields;exports.createMatrixTable=y.createMatrixTable;exports.estimateMatrixTable=y.estimateMatrixTable;exports.validateMatrixOptions=y.validateMatrixOptions;exports.createChartComponents=L;exports.createCrossTable=T;
|