@agile-team/mach-report 2.22.0 → 2.23.1
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 +8 -6
- package/dist/ExcelBindingWizard-BrTmdo7f.cjs +1 -0
- package/dist/ExcelBindingWizard-CcDMLO8Q.js +1486 -0
- package/dist/ParamEditor-BGjovFUe.js +737 -0
- package/dist/ParamEditor-CeNp4_zQ.cjs +1 -0
- package/dist/ReportBatchPanel-CHxBtG9R.cjs +1 -0
- package/dist/ReportBatchPanel-CJB67WNd.js +351 -0
- package/dist/ReportLabelStudio-Tplc1TLJ.js +784 -0
- package/dist/ReportLabelStudio-g8PkqJWn.cjs +1 -0
- package/dist/ReportParamPanel-C7fZTllk.cjs +1 -0
- package/dist/{ReportParamPanel-BHSKVL8k.js → ReportParamPanel-GI43aGa0.js} +146 -127
- package/dist/ReportPreview-BoGBGyRr.cjs +6 -0
- package/dist/ReportPreview-QLONCyci.js +6257 -0
- package/dist/ReportTemplateLibrary-BFQIX0sg.cjs +1 -0
- package/dist/ReportTemplateLibrary-KqX4E2sN.js +312 -0
- package/dist/RuleEditor-BZUP9yvL.cjs +1 -0
- package/dist/RuleEditor-OPX1awrH.js +2342 -0
- package/dist/TemplateOutlinePanel-CVYKVLv_.cjs +1 -0
- package/dist/TemplateOutlinePanel-DQS-eOs6.js +97 -0
- package/dist/TemplateReusePanel-CY6O93Zk.cjs +1 -0
- package/dist/TemplateReusePanel-DKXiFTyB.js +389 -0
- package/dist/TemplateReviewPanel-DbeNC8Ms.cjs +1 -0
- package/dist/TemplateReviewPanel-Dijwm9YE.js +593 -0
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.js +26 -26
- package/dist/artifact-integrity.json +106 -104
- package/dist/assets-D2gHc4Mz.cjs +1 -0
- package/dist/assets-T_gDeFaz.js +132 -0
- package/dist/auto-BB99S802.js +257 -0
- package/dist/auto-BrPWo7Xm.cjs +1 -0
- package/dist/capabilities-DiBj4Qgl.cjs +1 -0
- package/dist/capabilities-pg7j7VLT.js +106 -0
- package/dist/charts-Cjw5AYkg.cjs +1 -0
- package/dist/{charts-Dlv8j2AG.js → charts-CxJZ0XaY.js} +1 -1
- package/dist/computed-DK6BruFz.cjs +1 -0
- package/dist/{computed-C8NRZQss.js → computed-f3pOqWLX.js} +381 -301
- package/dist/data-bar-CeZuFmYl.cjs +1 -0
- package/dist/{data-bar-8baGYEZ9.js → data-bar-IkI6VvMQ.js} +1 -1
- package/dist/designer-BZoVWTgl.js +7172 -0
- package/dist/designer-zS2uKJmY.cjs +2 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +105 -45
- package/dist/designer.d.ts +105 -45
- package/dist/designer.js +4 -4
- package/dist/dom-ChE5D-L-.cjs +1 -0
- package/dist/dom-JWrchIre.js +452 -0
- package/dist/dom-cell-address-DLD1mkTB.cjs +1 -0
- package/dist/dom-cell-address-Fn-8nk7D.js +11 -0
- package/dist/{encoding-ncQAvyOv.cjs → encoding-7lquyj0w.cjs} +1 -1
- package/dist/{encoding-DbnhbwI8.js → encoding-CEd-dq9A.js} +2 -2
- package/dist/{font-loader-Di0lQKFf.js → font-loader-CNWXomuV.js} +1 -1
- package/dist/{font-loader-BB372_XN.cjs → font-loader-D8pI87fL.cjs} +1 -1
- package/dist/grid-strokes-Be24LGuV.cjs +1 -0
- package/dist/grid-strokes-EoY66L2f.js +53 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +944 -1259
- package/dist/{json-snapshot-DvQbZlD7.js → json-snapshot-BRnzKudk.js} +763 -776
- package/dist/json-snapshot-DNiIbpOr.cjs +2 -0
- package/dist/matrix-B8QWbsGM.cjs +1 -0
- package/dist/matrix-C6e_r_vp.js +302 -0
- package/dist/{pdf-DmlnL5eB.js → pdf-CJToa81Z.js} +20 -20
- package/dist/{pdf-CARdBcuw.cjs → pdf-DpMkW72B.cjs} +42 -42
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.js +2 -2
- package/dist/{plugin-AcAQ2m9X.cjs → plugin-BWTp-X7b.cjs} +1 -1
- package/dist/{plugin-w5Nyt08U.js → plugin-_BkUVc2z.js} +1 -1
- package/dist/{prefill-BXBxx5We.js → prefill-CWGdnqQd.js} +21 -21
- package/dist/prefill-PaAy6wLk.cjs +1 -0
- package/dist/prepared-CJy_qk7d.js +94 -0
- package/dist/prepared-D0yCSxSO.cjs +1 -0
- package/dist/progress-ByiOxUD3.js +250 -0
- package/dist/progress-WomPRP3B.cjs +1 -0
- package/dist/{protocol-fjaeKkjf.js → protocol-BG16rz6D.js} +3 -3
- package/dist/{protocol-C9ZaylID.cjs → protocol-wzhl1Fim.cjs} +1 -1
- package/dist/record-bindings-DatJZv_e.js +200 -0
- package/dist/record-bindings-MBxbeBsi.cjs +1 -0
- package/dist/{region-binding-workflow-aA8nxmkZ.js → region-binding-workflow-DjrXuR1q.js} +2 -2
- package/dist/{region-binding-workflow-BiJQ7NU6.cjs → region-binding-workflow-l7NGfagJ.cjs} +2 -2
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/rich-text-layout-Ciwa6D2o.js +52 -0
- package/dist/rich-text-layout-DK7A_a5r.cjs +3 -0
- package/dist/runtime-DYMOS_gz.cjs +1 -0
- package/dist/{runtime-BTtpjF3D.js → runtime-PiCax9zQ.js} +52 -51
- package/dist/sbom.cdx.json +1 -1
- package/dist/server-node.cjs +5 -5
- package/dist/server-node.js +1676 -1619
- package/dist/server.cjs +1 -1
- package/dist/server.js +24 -24
- package/dist/style.css +1 -1
- package/dist/{template-catalog-JSxSqk5y.js → template-catalog-CRuZL3pi.js} +17 -17
- package/dist/template-catalog-DtrtT1FY.cjs +1 -0
- package/dist/{template-fragments-D2JFj7Du.js → template-fragments-CPpGpQoz.js} +12 -12
- package/dist/template-fragments-GVjpew_q.cjs +1 -0
- package/dist/template-registry-DI59PXVK.cjs +1 -0
- package/dist/{template-registry-Do1Uav2Z.js → template-registry-O0hNIOfB.js} +17 -17
- package/dist/{template-serialization-CU4n_Miu.js → template-serialization-CWmHq7lX.js} +1 -1
- package/dist/{template-serialization-CgqBo6s-.cjs → template-serialization-CqQY4zDg.cjs} +1 -1
- package/dist/textwrap-D4ZksyMK.js +111 -0
- package/dist/textwrap-DEHqAjKZ.cjs +4 -0
- package/dist/vue/async.d.cts +31 -0
- package/dist/vue/async.d.ts +31 -0
- package/dist/vue/index.d.cts +32 -1
- package/dist/vue/index.d.ts +32 -1
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +52 -47
- package/dist/{workbook-session-BvEBRRMz.cjs → workbook-session-C6-SrnCT.cjs} +4 -4
- package/dist/{workbook-session-f0wVlzst.js → workbook-session-C9ZmCBwY.js} +15 -16
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +4 -4
- package/dist/xlsx.cjs +4 -4
- package/dist/xlsx.js +184 -179
- package/package.json +1 -1
- package/dist/ExcelBindingWizard-CW79I6Gl.cjs +0 -1
- package/dist/ExcelBindingWizard-CZyppD7I.js +0 -1485
- package/dist/ParamEditor-CiYCJI0b.cjs +0 -1
- package/dist/ParamEditor-DQit-Gdf.js +0 -732
- package/dist/ReportBatchPanel-DKTpV7MU.js +0 -350
- package/dist/ReportBatchPanel-Db6TAfG5.cjs +0 -1
- package/dist/ReportLabelStudio-B0i9ohQj.cjs +0 -1
- package/dist/ReportLabelStudio-BYnRqmje.js +0 -780
- package/dist/ReportParamPanel-lngONOEz.cjs +0 -1
- package/dist/ReportPreview-BDgKssYR.js +0 -5887
- package/dist/ReportPreview-Dw-4icG6.cjs +0 -6
- package/dist/ReportTemplateLibrary-BZuKn0YK.js +0 -311
- package/dist/ReportTemplateLibrary-DEXH07ND.cjs +0 -1
- package/dist/RuleEditor-CIQn547x.js +0 -2341
- package/dist/RuleEditor-zSUmPjKa.cjs +0 -1
- package/dist/TemplateOutlinePanel-B5SfGYVN.cjs +0 -1
- package/dist/TemplateOutlinePanel-D0PgOSQE.js +0 -96
- package/dist/TemplateReusePanel-BKlAEF8-.js +0 -388
- package/dist/TemplateReusePanel-DAy_Hwqz.cjs +0 -1
- package/dist/TemplateReviewPanel-CowmHaQQ.cjs +0 -1
- package/dist/TemplateReviewPanel-div-EH_m.js +0 -592
- package/dist/assets-CxHunY_9.js +0 -232
- package/dist/assets-vbjAGgk8.cjs +0 -1
- package/dist/auto-DcUHlKob.cjs +0 -1
- package/dist/auto-moShblh1.js +0 -240
- package/dist/charts-aCtoswXq.cjs +0 -1
- package/dist/component-tree-1_QCiQJX.js +0 -67
- package/dist/component-tree-BjZIp6w9.cjs +0 -1
- package/dist/computed-4TnxzgIh.cjs +0 -1
- package/dist/data-bar-YltqGTaC.cjs +0 -1
- package/dist/designer-B7jJeAeG.js +0 -6914
- package/dist/designer-BWQVpJeN.cjs +0 -2
- package/dist/grid-geometry-D3SJgWFv.js +0 -136
- package/dist/grid-geometry-D8ReblRV.cjs +0 -1
- package/dist/json-snapshot-nyV63AbB.cjs +0 -2
- package/dist/matrix-0hywp0-F.cjs +0 -1
- package/dist/matrix-Dy-tyY7E.js +0 -381
- package/dist/prefill-DUvejVt1.cjs +0 -1
- package/dist/prepared-YXy-fVLw.cjs +0 -1
- package/dist/prepared-rXCKqdHY.js +0 -88
- package/dist/progress-B0ctFpKf.cjs +0 -1
- package/dist/progress-Hc2vxoCs.js +0 -52
- package/dist/record-bindings-Ct1HkPrc.cjs +0 -1
- package/dist/record-bindings-VZGS-Qd8.js +0 -155
- package/dist/rich-text-layout-K48VHUoW.cjs +0 -3
- package/dist/rich-text-layout-wxBhnAS7.js +0 -102
- package/dist/runtime-Dq0LUsyS.cjs +0 -1
- package/dist/template-catalog-CLAM4w7H.cjs +0 -1
- package/dist/template-fragments-Ca25Jt7e.cjs +0 -1
- package/dist/template-outline-CDWXptuj.js +0 -88
- package/dist/template-outline-K4jGhATu.cjs +0 -1
- package/dist/template-registry-CWnuGqyP.cjs +0 -1
- package/dist/textwrap-CkGjRFT3.js +0 -110
- package/dist/textwrap-OTOUMr4f.cjs +0 -4
|
@@ -0,0 +1,593 @@
|
|
|
1
|
+
import { shallowRef as J, ref as C, computed as $, watch as G, onBeforeUnmount as ne, toRaw as oe, defineComponent as le, openBlock as r, createElementBlock as n, toDisplayString as t, createCommentVNode as p, Fragment as R, createElementVNode as l, createVNode as Y, unref as s, normalizeStyle as ue, createTextVNode as T, withDirectives as B, isRef as W, vModelSelect as ie, renderList as I, vModelText as Z, vModelCheckbox as ee, normalizeClass as Q, createBlock as ce } from "vue";
|
|
2
|
+
import { reviewReportTemplateAsync as de, paginateTemplate as me } from "@agile-team/mach-report";
|
|
3
|
+
import { T as X, u as ve } from "./designer-BZoVWTgl.js";
|
|
4
|
+
import { ReportPreview as te } from "@agile-team/mach-report/vue";
|
|
5
|
+
import { b as pe } from "./template-serialization-CWmHq7lX.js";
|
|
6
|
+
import { _ as ae } from "./_plugin-vue_export-helper-8SL1F89S.js";
|
|
7
|
+
function fe(o, m = () => o.fixtures) {
|
|
8
|
+
const c = J(), u = J([]), i = C("20"), e = C(!1), h = C(!1), v = C(!1), k = C(""), b = J(), d = C(!1), O = J(), D = $(
|
|
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
|
+
), y = $(() => D.value.size > 0);
|
|
15
|
+
let x = 0, _;
|
|
16
|
+
function g() {
|
|
17
|
+
x++, _?.abort(), _ = void 0, h.value = !1, d.value = !1, b.value = void 0, v.value = !!c.value, k.value = "";
|
|
18
|
+
}
|
|
19
|
+
for (const f of [() => o.document, () => o.previous])
|
|
20
|
+
G(
|
|
21
|
+
f,
|
|
22
|
+
() => {
|
|
23
|
+
e.value = !1, g();
|
|
24
|
+
},
|
|
25
|
+
{ deep: !0, flush: "sync" }
|
|
26
|
+
);
|
|
27
|
+
for (const f of [
|
|
28
|
+
() => o.datasets,
|
|
29
|
+
() => o.dataSchemas,
|
|
30
|
+
() => o.formats,
|
|
31
|
+
m
|
|
32
|
+
])
|
|
33
|
+
G(f, g, { deep: !0, flush: "sync" });
|
|
34
|
+
G([i, e], g, { flush: "sync" }), ne(() => {
|
|
35
|
+
x++, _?.abort();
|
|
36
|
+
});
|
|
37
|
+
const N = $(
|
|
38
|
+
() => c.value?.issues.filter((f) => f.severity === "error").length ?? 0
|
|
39
|
+
);
|
|
40
|
+
function q() {
|
|
41
|
+
_?.abort(), _ = new AbortController();
|
|
42
|
+
const f = ++x, M = _;
|
|
43
|
+
h.value = !0, k.value = "", d.value = !1, b.value = void 0, F(f, M);
|
|
44
|
+
}
|
|
45
|
+
async function F(f, M) {
|
|
46
|
+
try {
|
|
47
|
+
const S = Number(i.value), L = Object.fromEntries(
|
|
48
|
+
Object.entries(o.datasets ?? {}).map(([E, U]) => [
|
|
49
|
+
E,
|
|
50
|
+
S < 0 || D.value.has(E) ? U : U.slice(0, S)
|
|
51
|
+
])
|
|
52
|
+
), z = m(), V = z?.length ? [...z] : S === 0 ? [] : [{ name: i.value, datasets: L }], P = await de(o.document, {
|
|
53
|
+
previous: o.previous,
|
|
54
|
+
dataSchemas: o.dataSchemas,
|
|
55
|
+
formats: o.formats,
|
|
56
|
+
allowBreakingChanges: e.value,
|
|
57
|
+
...!z?.length && y.value && S > 0 ? { maxSampleRows: S } : {},
|
|
58
|
+
fixtures: V,
|
|
59
|
+
signal: M.signal,
|
|
60
|
+
onProgress: (E) => {
|
|
61
|
+
f === x && (b.value = E);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
if (f !== x) return;
|
|
65
|
+
c.value = P, v.value = !1, u.value = V, O.value = {
|
|
66
|
+
requested: i.value,
|
|
67
|
+
rows: P.samples.reduce((E, U) => E + U.rows, 0),
|
|
68
|
+
datasets: new Set(
|
|
69
|
+
V.flatMap((E) => Object.keys(E.datasets))
|
|
70
|
+
).size,
|
|
71
|
+
formats: [...o.formats ?? []]
|
|
72
|
+
};
|
|
73
|
+
} catch (S) {
|
|
74
|
+
f === x && !M.signal.aborted && (k.value = S instanceof Error ? S.message : String(S));
|
|
75
|
+
} finally {
|
|
76
|
+
f === x && (h.value = !1, _ = void 0);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function K() {
|
|
80
|
+
x++, _?.abort(), _ = void 0, h.value = !1, d.value = !0, b.value = void 0;
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
report: c,
|
|
84
|
+
sampleSize: i,
|
|
85
|
+
acknowledged: e,
|
|
86
|
+
running: h,
|
|
87
|
+
stale: v,
|
|
88
|
+
failure: k,
|
|
89
|
+
checkedScope: O,
|
|
90
|
+
checkedFixtures: u,
|
|
91
|
+
hasTree: y,
|
|
92
|
+
errors: N,
|
|
93
|
+
run: q,
|
|
94
|
+
cancel: K,
|
|
95
|
+
progress: b,
|
|
96
|
+
cancelled: d
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function he(o) {
|
|
100
|
+
const m = Object.getPrototypeOf(o);
|
|
101
|
+
if (m !== Object.prototype && m !== Array.prototype && m !== 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 we(o) {
|
|
109
|
+
let m = 0, c = 0;
|
|
110
|
+
const u = /* @__PURE__ */ new Set();
|
|
111
|
+
function i(e, h) {
|
|
112
|
+
if (++m > 1e5 || h > 32)
|
|
113
|
+
throw new RangeError("Sample data exceeds the capture budget");
|
|
114
|
+
if (typeof e == "string") {
|
|
115
|
+
if (c += e.length, c > 2e6)
|
|
116
|
+
throw new RangeError("Sample text exceeds the capture budget");
|
|
117
|
+
return e;
|
|
118
|
+
}
|
|
119
|
+
if (e === null || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e)) return e;
|
|
120
|
+
if (!e || typeof e != "object")
|
|
121
|
+
throw new Error("Sample data must contain plain JSON values");
|
|
122
|
+
const v = oe(e);
|
|
123
|
+
if (u.has(v))
|
|
124
|
+
throw new Error("Sample data must not contain cycles");
|
|
125
|
+
he(v), u.add(v);
|
|
126
|
+
const k = Array.isArray(v) ? [] : /* @__PURE__ */ Object.create(null);
|
|
127
|
+
for (const b of Object.keys(v)) {
|
|
128
|
+
const d = Object.getOwnPropertyDescriptor(v, b);
|
|
129
|
+
if (d.get || d.set || ["__proto__", "constructor", "prototype"].includes(b))
|
|
130
|
+
throw new Error("Sample data must not contain getters or unsafe keys");
|
|
131
|
+
k[b] = i(
|
|
132
|
+
d.value,
|
|
133
|
+
h + 1
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
return u.delete(v), k;
|
|
137
|
+
}
|
|
138
|
+
return i(o, 0);
|
|
139
|
+
}
|
|
140
|
+
function ge(o, m = () => X) {
|
|
141
|
+
const c = C([]), u = C(""), i = C(!1), e = C(""), h = C({}), v = $(() => [...o.fixtures ?? [], ...c.value]);
|
|
142
|
+
function k() {
|
|
143
|
+
e.value = "";
|
|
144
|
+
try {
|
|
145
|
+
if (!i.value) throw new Error(m().sampleConsentMissing);
|
|
146
|
+
if (!u.value.trim()) throw new Error(m().sampleNameMissing);
|
|
147
|
+
if (v.value.length >= 20) throw new Error(m().sampleLimit);
|
|
148
|
+
if (v.value.some((O) => O.name === u.value.trim()))
|
|
149
|
+
throw new Error(m().sampleNameDuplicate);
|
|
150
|
+
const d = we(o.datasets ?? {});
|
|
151
|
+
if (Object.values(d).reduce((O, D) => O + D.length, 0) > 1e3)
|
|
152
|
+
throw new Error(m().sampleRowsLimit);
|
|
153
|
+
c.value.push({
|
|
154
|
+
name: u.value.trim(),
|
|
155
|
+
datasets: d,
|
|
156
|
+
...Object.keys(h.value).length ? { params: { ...h.value } } : {}
|
|
157
|
+
}), u.value = "", i.value = !1;
|
|
158
|
+
} catch (d) {
|
|
159
|
+
e.value = d instanceof Error ? d.message : String(d);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function b(d) {
|
|
163
|
+
c.value.splice(d, 1);
|
|
164
|
+
}
|
|
165
|
+
return { fixtures: c, name: u, consent: i, failure: e, params: h, suite: v, capture: k, remove: b };
|
|
166
|
+
}
|
|
167
|
+
function se(o, m) {
|
|
168
|
+
const c = me(o.template, m.datasets, {
|
|
169
|
+
maxPages: 100,
|
|
170
|
+
maxCells: 25e4
|
|
171
|
+
}), u = [
|
|
172
|
+
...new Set(
|
|
173
|
+
pe(o.template).flatMap(
|
|
174
|
+
(i) => i.fields.map((e) => `${i.dataset}.${e.field}`)
|
|
175
|
+
)
|
|
176
|
+
)
|
|
177
|
+
];
|
|
178
|
+
return {
|
|
179
|
+
pages: c.plan.pages.length,
|
|
180
|
+
dimensions: [
|
|
181
|
+
...new Set(
|
|
182
|
+
c.plan.pages.map(
|
|
183
|
+
(i) => `${i.pageWidthMm} × ${i.pageHeightMm} mm`
|
|
184
|
+
)
|
|
185
|
+
)
|
|
186
|
+
],
|
|
187
|
+
fields: u,
|
|
188
|
+
fetcher: async () => c.plan
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
function ye(o, m, c) {
|
|
192
|
+
const u = se(o, m), i = c ? se(c, m) : void 0, e = new Set(i?.fields), h = new Set(u.fields);
|
|
193
|
+
return {
|
|
194
|
+
current: u,
|
|
195
|
+
previous: i,
|
|
196
|
+
addedFields: u.fields.filter((v) => !e.has(v)),
|
|
197
|
+
removedFields: i?.fields.filter((v) => !h.has(v)) ?? []
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
const be = ["aria-label"], _e = {
|
|
201
|
+
key: 0,
|
|
202
|
+
role: "alert"
|
|
203
|
+
}, ke = { class: "mr-fixture-previews" }, xe = { key: 0 }, Se = /* @__PURE__ */ le({
|
|
204
|
+
__name: "TemplateFixtureComparison",
|
|
205
|
+
props: {
|
|
206
|
+
document: {},
|
|
207
|
+
previous: {},
|
|
208
|
+
fixture: {},
|
|
209
|
+
messages: {}
|
|
210
|
+
},
|
|
211
|
+
setup(o) {
|
|
212
|
+
const m = o, c = $(() => ({ ...X, ...m.messages })), u = $(() => {
|
|
213
|
+
try {
|
|
214
|
+
return {
|
|
215
|
+
result: ye(
|
|
216
|
+
m.document,
|
|
217
|
+
m.fixture,
|
|
218
|
+
m.previous
|
|
219
|
+
)
|
|
220
|
+
};
|
|
221
|
+
} catch (i) {
|
|
222
|
+
return { error: i instanceof Error ? i.message : String(i) };
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
return (i, e) => (r(), n("section", {
|
|
226
|
+
class: "mr-fixture-comparison",
|
|
227
|
+
"aria-label": c.value.compare
|
|
228
|
+
}, [
|
|
229
|
+
u.value.error ? (r(), n("p", _e, t(u.value.error), 1)) : p("", !0),
|
|
230
|
+
u.value.result ? (r(), n(R, { key: 1 }, [
|
|
231
|
+
l("dl", null, [
|
|
232
|
+
l("dt", null, t(c.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(c.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(c.value.fieldsAdded), 1),
|
|
237
|
+
l("dd", null, t(u.value.result.addedFields.join("、") || "—"), 1),
|
|
238
|
+
l("dt", null, t(c.value.fieldsRemoved), 1),
|
|
239
|
+
l("dd", null, t(u.value.result.removedFields.join("、") || "—"), 1)
|
|
240
|
+
]),
|
|
241
|
+
l("div", ke, [
|
|
242
|
+
u.value.result.previous ? (r(), n("article", xe, [
|
|
243
|
+
l("h4", null, t(c.value.baselinePreview), 1),
|
|
244
|
+
Y(s(te), {
|
|
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
|
+
])) : p("", !0),
|
|
256
|
+
l("article", null, [
|
|
257
|
+
l("h4", null, t(c.value.draftPreview), 1),
|
|
258
|
+
Y(s(te), {
|
|
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)) : p("", !0)
|
|
272
|
+
], 8, be));
|
|
273
|
+
}
|
|
274
|
+
}), Ce = /* @__PURE__ */ ae(Se, [["__scopeId", "data-v-6409d556"]]), Ee = ["aria-label", "aria-busy"], je = {
|
|
275
|
+
key: 0,
|
|
276
|
+
role: "status"
|
|
277
|
+
}, Fe = ["disabled"], Oe = {
|
|
278
|
+
key: 0,
|
|
279
|
+
class: "mr-review-stale",
|
|
280
|
+
role: "status"
|
|
281
|
+
}, Te = { class: "mr-review-controls" }, Re = ["aria-label", "disabled"], Ne = { value: "0" }, Me = { value: "20" }, Pe = { value: "100" }, $e = { value: "-1" }, Ve = {
|
|
282
|
+
key: 0,
|
|
283
|
+
class: "mr-review-note"
|
|
284
|
+
}, Ae = { class: "mr-review-fixtures" }, De = { class: "mr-review-note" }, Ue = { key: 0 }, ze = ["disabled", "onClick"], Be = { class: "mr-review-fixture-form" }, Ie = ["placeholder", "disabled"], qe = { key: 0 }, Le = ["onUpdate:modelValue", "placeholder", "disabled"], He = { class: "mr-review-consent" }, Je = ["disabled"], We = ["disabled"], Ge = {
|
|
285
|
+
key: 1,
|
|
286
|
+
role: "alert",
|
|
287
|
+
class: "is-error"
|
|
288
|
+
}, Ke = {
|
|
289
|
+
key: 1,
|
|
290
|
+
class: "mr-review-note"
|
|
291
|
+
}, Qe = {
|
|
292
|
+
key: 2,
|
|
293
|
+
class: "is-error",
|
|
294
|
+
role: "alert"
|
|
295
|
+
}, Xe = {
|
|
296
|
+
key: 3,
|
|
297
|
+
class: "mr-review-stale",
|
|
298
|
+
role: "status"
|
|
299
|
+
}, Ye = {
|
|
300
|
+
key: 4,
|
|
301
|
+
class: "mr-review-note"
|
|
302
|
+
}, Ze = {
|
|
303
|
+
key: 0,
|
|
304
|
+
class: "mr-review-summary",
|
|
305
|
+
role: "status"
|
|
306
|
+
}, et = {
|
|
307
|
+
key: 0,
|
|
308
|
+
class: "mr-review-note"
|
|
309
|
+
}, tt = {
|
|
310
|
+
key: 1,
|
|
311
|
+
class: "mr-review-note"
|
|
312
|
+
}, st = {
|
|
313
|
+
key: 2,
|
|
314
|
+
class: "mr-review-list"
|
|
315
|
+
}, lt = { key: 0 }, at = ["onClick"], rt = {
|
|
316
|
+
key: 3,
|
|
317
|
+
class: "mr-review-note"
|
|
318
|
+
}, nt = {
|
|
319
|
+
key: 4,
|
|
320
|
+
class: "mr-review-ack"
|
|
321
|
+
}, ot = {
|
|
322
|
+
key: 0,
|
|
323
|
+
class: "mr-review-note"
|
|
324
|
+
}, ut = {
|
|
325
|
+
key: 1,
|
|
326
|
+
class: "mr-review-list"
|
|
327
|
+
}, it = ["onClick"], ct = {
|
|
328
|
+
key: 0,
|
|
329
|
+
class: "mr-review-scope"
|
|
330
|
+
}, dt = { key: 0 }, mt = ["disabled", "onClick"], vt = { class: "mr-review-note" }, pt = /* @__PURE__ */ le({
|
|
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: m }) {
|
|
343
|
+
const c = ve(), u = o, i = m, e = $(() => ({ ...X, ...u.messages })), {
|
|
344
|
+
name: h,
|
|
345
|
+
consent: v,
|
|
346
|
+
failure: k,
|
|
347
|
+
params: b,
|
|
348
|
+
suite: d,
|
|
349
|
+
capture: O,
|
|
350
|
+
remove: D
|
|
351
|
+
} = ge(u, () => e.value), {
|
|
352
|
+
report: y,
|
|
353
|
+
sampleSize: x,
|
|
354
|
+
acknowledged: _,
|
|
355
|
+
running: g,
|
|
356
|
+
stale: N,
|
|
357
|
+
failure: q,
|
|
358
|
+
checkedScope: F,
|
|
359
|
+
checkedFixtures: K,
|
|
360
|
+
hasTree: f,
|
|
361
|
+
errors: M,
|
|
362
|
+
run: S,
|
|
363
|
+
cancel: L,
|
|
364
|
+
cancelled: z,
|
|
365
|
+
progress: V
|
|
366
|
+
} = fe(u, () => d.value), P = C(), E = $(
|
|
367
|
+
() => K.value.find((A) => A.name === P.value)
|
|
368
|
+
);
|
|
369
|
+
G(N, (A) => {
|
|
370
|
+
A && (P.value = void 0);
|
|
371
|
+
});
|
|
372
|
+
function U(A) {
|
|
373
|
+
const w = /\.pages\[(\d+)\]\.components\[(\d+)\]/.exec(A);
|
|
374
|
+
i("locate", {
|
|
375
|
+
path: A,
|
|
376
|
+
...w ? { pageIndex: Number(w[1]), componentIndex: Number(w[2]) } : {}
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
return (A, w) => (r(), n("section", {
|
|
380
|
+
class: "mr-template-review",
|
|
381
|
+
style: ue(s(c)),
|
|
382
|
+
"aria-label": e.value.title,
|
|
383
|
+
"aria-busy": s(g)
|
|
384
|
+
}, [
|
|
385
|
+
l("header", null, [
|
|
386
|
+
l("strong", null, t(e.value.title), 1),
|
|
387
|
+
s(g) && s(V) ? (r(), n("span", je, t(s(V).completed) + " / " + t(s(V).total) + " " + t(e.value.progress), 1)) : p("", !0),
|
|
388
|
+
s(g) ? (r(), n("button", {
|
|
389
|
+
key: 1,
|
|
390
|
+
type: "button",
|
|
391
|
+
onClick: w[0] || (w[0] = //@ts-ignore
|
|
392
|
+
(...a) => s(L) && s(L)(...a))
|
|
393
|
+
}, t(e.value.cancel), 1)) : p("", !0),
|
|
394
|
+
l("button", {
|
|
395
|
+
type: "button",
|
|
396
|
+
disabled: s(g),
|
|
397
|
+
onClick: w[1] || (w[1] = //@ts-ignore
|
|
398
|
+
(...a) => s(S) && s(S)(...a))
|
|
399
|
+
}, t(s(g) ? e.value.running : e.value.run), 9, Fe)
|
|
400
|
+
]),
|
|
401
|
+
s(z) ? (r(), n("p", Oe, t(e.value.cancelled), 1)) : p("", !0),
|
|
402
|
+
l("div", Te, [
|
|
403
|
+
l("label", null, [
|
|
404
|
+
T(t(e.value.samples), 1),
|
|
405
|
+
B(l("select", {
|
|
406
|
+
"onUpdate:modelValue": w[2] || (w[2] = (a) => W(x) ? x.value = a : null),
|
|
407
|
+
"aria-label": e.value.samples,
|
|
408
|
+
disabled: s(g) || !!s(d).length
|
|
409
|
+
}, [
|
|
410
|
+
l("option", Ne, t(e.value.none), 1),
|
|
411
|
+
l("option", Me, t(e.value.first20), 1),
|
|
412
|
+
l("option", Pe, t(e.value.first100), 1),
|
|
413
|
+
l("option", $e, t(e.value.all), 1)
|
|
414
|
+
], 8, Re), [
|
|
415
|
+
[ie, s(x)]
|
|
416
|
+
])
|
|
417
|
+
]),
|
|
418
|
+
s(d).length ? (r(), n("span", Ve, t(e.value.namedFixtures) + " · " + t(s(d).length), 1)) : p("", !0)
|
|
419
|
+
]),
|
|
420
|
+
l("details", Ae, [
|
|
421
|
+
l("summary", null, [
|
|
422
|
+
T(t(e.value.namedFixtures) + " ", 1),
|
|
423
|
+
l("small", null, t(s(d).length) + " / 20", 1)
|
|
424
|
+
]),
|
|
425
|
+
l("p", De, t(e.value.fixtureHint), 1),
|
|
426
|
+
s(d).length ? (r(), n("ul", Ue, [
|
|
427
|
+
(r(!0), n(R, null, I(s(d), (a, j) => (r(), n("li", {
|
|
428
|
+
key: a.name
|
|
429
|
+
}, [
|
|
430
|
+
l("strong", null, t(a.name), 1),
|
|
431
|
+
l("span", null, t(Object.values(a.datasets).reduce(
|
|
432
|
+
(H, re) => H + re.length,
|
|
433
|
+
0
|
|
434
|
+
)) + " " + t(e.value.rows), 1),
|
|
435
|
+
j >= (o.fixtures?.length ?? 0) ? (r(), n("button", {
|
|
436
|
+
key: 0,
|
|
437
|
+
type: "button",
|
|
438
|
+
disabled: s(g),
|
|
439
|
+
onClick: (H) => s(D)(j - (o.fixtures?.length ?? 0))
|
|
440
|
+
}, t(e.value.remove), 9, ze)) : p("", !0)
|
|
441
|
+
]))), 128))
|
|
442
|
+
])) : p("", !0),
|
|
443
|
+
l("div", Be, [
|
|
444
|
+
l("label", null, [
|
|
445
|
+
T(t(e.value.fixtureName), 1),
|
|
446
|
+
B(l("input", {
|
|
447
|
+
"onUpdate:modelValue": w[3] || (w[3] = (a) => W(h) ? h.value = a : null),
|
|
448
|
+
placeholder: e.value.fixturePlaceholder,
|
|
449
|
+
disabled: s(g)
|
|
450
|
+
}, null, 8, Ie), [
|
|
451
|
+
[Z, s(h)]
|
|
452
|
+
])
|
|
453
|
+
]),
|
|
454
|
+
o.document.template.params?.length ? (r(), n("details", qe, [
|
|
455
|
+
l("summary", null, t(e.value.parameters), 1),
|
|
456
|
+
(r(!0), n(R, null, I(o.document.template.params, (a) => (r(), n("label", {
|
|
457
|
+
key: a.field
|
|
458
|
+
}, [
|
|
459
|
+
T(t(a.label ?? a.field), 1),
|
|
460
|
+
B(l("input", {
|
|
461
|
+
"onUpdate:modelValue": (j) => s(b)[a.field] = j,
|
|
462
|
+
placeholder: a.defaultValue,
|
|
463
|
+
disabled: s(g)
|
|
464
|
+
}, null, 8, Le), [
|
|
465
|
+
[Z, s(b)[a.field]]
|
|
466
|
+
])
|
|
467
|
+
]))), 128))
|
|
468
|
+
])) : p("", !0),
|
|
469
|
+
l("label", He, [
|
|
470
|
+
B(l("input", {
|
|
471
|
+
"onUpdate:modelValue": w[4] || (w[4] = (a) => W(v) ? v.value = a : null),
|
|
472
|
+
type: "checkbox",
|
|
473
|
+
disabled: s(g)
|
|
474
|
+
}, null, 8, Je), [
|
|
475
|
+
[ee, s(v)]
|
|
476
|
+
]),
|
|
477
|
+
T(t(e.value.deidentified), 1)
|
|
478
|
+
]),
|
|
479
|
+
l("button", {
|
|
480
|
+
type: "button",
|
|
481
|
+
disabled: s(g) || !s(v) || !s(h).trim() || s(d).length >= 20,
|
|
482
|
+
onClick: w[5] || (w[5] = //@ts-ignore
|
|
483
|
+
(...a) => s(O) && s(O)(...a))
|
|
484
|
+
}, t(e.value.capture), 9, We),
|
|
485
|
+
s(k) ? (r(), n("p", Ge, t(s(k)), 1)) : p("", !0)
|
|
486
|
+
])
|
|
487
|
+
]),
|
|
488
|
+
s(f) ? (r(), n("p", Ke, t(e.value.treeHint), 1)) : p("", !0),
|
|
489
|
+
s(q) ? (r(), n("p", Qe, t(s(q)), 1)) : p("", !0),
|
|
490
|
+
s(N) ? (r(), n("p", Xe, t(e.value.stale), 1)) : p("", !0),
|
|
491
|
+
s(y) ? (r(), n(R, { key: 5 }, [
|
|
492
|
+
s(N) ? p("", !0) : (r(), n("div", Ze, [
|
|
493
|
+
l("span", {
|
|
494
|
+
class: Q({ "is-error": s(M) })
|
|
495
|
+
}, t(s(M)) + " " + t(e.value.errors), 3),
|
|
496
|
+
l("span", null, t(s(y).issues.length - s(M)) + " " + t(e.value.warnings), 1)
|
|
497
|
+
])),
|
|
498
|
+
l("section", null, [
|
|
499
|
+
l("h3", null, [
|
|
500
|
+
T(t(e.value.changes) + " ", 1),
|
|
501
|
+
l("small", null, t(s(y).changes?.totalChanges ?? 0), 1)
|
|
502
|
+
]),
|
|
503
|
+
o.previous ? s(y).changes?.totalChanges ? (r(), n("ol", st, [
|
|
504
|
+
(r(!0), n(R, null, I(s(y).changes?.changes, (a, j) => (r(), n("li", { key: j }, [
|
|
505
|
+
l("div", null, [
|
|
506
|
+
l("span", null, t(e.value.categories[a.category]) + " · " + t(e.value.kinds[a.kind]), 1),
|
|
507
|
+
a.breaking ? (r(), n("b", lt, t(e.value.breaking), 1)) : p("", !0),
|
|
508
|
+
l("button", {
|
|
509
|
+
type: "button",
|
|
510
|
+
onClick: (H) => U(a.path)
|
|
511
|
+
}, t(e.value.locate), 9, at)
|
|
512
|
+
]),
|
|
513
|
+
l("code", null, t(a.path), 1),
|
|
514
|
+
l("dl", null, [
|
|
515
|
+
a.before !== void 0 ? (r(), n(R, { key: 0 }, [
|
|
516
|
+
l("dt", null, t(e.value.before), 1),
|
|
517
|
+
l("dd", null, t(a.before), 1)
|
|
518
|
+
], 64)) : p("", !0),
|
|
519
|
+
a.after !== void 0 ? (r(), n(R, { key: 1 }, [
|
|
520
|
+
l("dt", null, t(e.value.after), 1),
|
|
521
|
+
l("dd", null, t(a.after), 1)
|
|
522
|
+
], 64)) : p("", !0)
|
|
523
|
+
])
|
|
524
|
+
]))), 128))
|
|
525
|
+
])) : (r(), n("p", tt, t(e.value.noChanges), 1)) : (r(), n("p", et, t(e.value.baseline), 1)),
|
|
526
|
+
s(y).changes?.truncated ? (r(), n("p", rt, t(e.value.truncated), 1)) : p("", !0),
|
|
527
|
+
s(y).changes?.breakingChanges ? (r(), n("label", nt, [
|
|
528
|
+
B(l("input", {
|
|
529
|
+
"onUpdate:modelValue": w[6] || (w[6] = (a) => W(_) ? _.value = a : null),
|
|
530
|
+
type: "checkbox"
|
|
531
|
+
}, null, 512), [
|
|
532
|
+
[ee, s(_)]
|
|
533
|
+
]),
|
|
534
|
+
T(t(e.value.acknowledge), 1)
|
|
535
|
+
])) : p("", !0)
|
|
536
|
+
]),
|
|
537
|
+
l("section", null, [
|
|
538
|
+
l("h3", null, t(e.value.issues), 1),
|
|
539
|
+
s(y).issues.length ? (r(), n("ol", ut, [
|
|
540
|
+
(r(!0), n(R, null, I(s(y).issues, (a, j) => (r(), n("li", { key: j }, [
|
|
541
|
+
l("div", null, [
|
|
542
|
+
l("span", {
|
|
543
|
+
class: Q({ "is-error": a.severity === "error" })
|
|
544
|
+
}, t(a.severity === "error" ? e.value.errors : e.value.warnings), 3),
|
|
545
|
+
l("button", {
|
|
546
|
+
type: "button",
|
|
547
|
+
onClick: (H) => i("locate", a)
|
|
548
|
+
}, t(e.value.locate), 9, it)
|
|
549
|
+
]),
|
|
550
|
+
l("p", null, t(a.message), 1),
|
|
551
|
+
l("code", null, t(a.path), 1)
|
|
552
|
+
]))), 128))
|
|
553
|
+
])) : (r(), n("p", ot, t(e.value.noIssues), 1))
|
|
554
|
+
]),
|
|
555
|
+
s(y).samples.length ? (r(), n("section", {
|
|
556
|
+
key: 1,
|
|
557
|
+
class: Q({ "is-stale": s(N) })
|
|
558
|
+
}, [
|
|
559
|
+
l("h3", null, t(e.value.results), 1),
|
|
560
|
+
s(F) ? (r(), n("p", ct, [
|
|
561
|
+
T(t(e.value.scope) + " · " + t(s(d).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),
|
|
562
|
+
s(F).formats.length ? (r(), n("span", dt, " · " + t(s(F).formats.join(" / ")), 1)) : p("", !0)
|
|
563
|
+
])) : p("", !0),
|
|
564
|
+
(r(!0), n(R, null, I(s(y).samples, (a) => (r(), n("div", {
|
|
565
|
+
key: a.name,
|
|
566
|
+
class: "mr-review-sample"
|
|
567
|
+
}, [
|
|
568
|
+
l("p", null, [
|
|
569
|
+
l("strong", null, t(a.name), 1),
|
|
570
|
+
T(" · " + t(a.rows) + " " + t(e.value.rows) + " · " + t(a.pages) + " " + t(e.value.pages) + " · " + t(s(y).issues.filter((j) => j.fixture === a.name).length) + " " + t(e.value.issues), 1)
|
|
571
|
+
]),
|
|
572
|
+
l("button", {
|
|
573
|
+
type: "button",
|
|
574
|
+
disabled: s(N) || s(g),
|
|
575
|
+
onClick: (j) => P.value = P.value === a.name ? void 0 : a.name
|
|
576
|
+
}, t(P.value === a.name ? e.value.closeCompare : e.value.compare), 9, mt)
|
|
577
|
+
]))), 128))
|
|
578
|
+
], 2)) : p("", !0),
|
|
579
|
+
E.value && !s(N) ? (r(), ce(Ce, {
|
|
580
|
+
key: 2,
|
|
581
|
+
document: o.document,
|
|
582
|
+
previous: o.previous,
|
|
583
|
+
fixture: E.value,
|
|
584
|
+
messages: o.messages
|
|
585
|
+
}, null, 8, ["document", "previous", "fixture", "messages"])) : p("", !0),
|
|
586
|
+
l("p", vt, t(e.value.checked), 1)
|
|
587
|
+
], 64)) : (r(), n("p", Ye, t(e.value.empty), 1))
|
|
588
|
+
], 12, Ee));
|
|
589
|
+
}
|
|
590
|
+
}), _t = /* @__PURE__ */ ae(pt, [["__scopeId", "data-v-87b76c26"]]);
|
|
591
|
+
export {
|
|
592
|
+
_t as default
|
|
593
|
+
};
|
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 r=require("./computed-DK6BruFz.cjs"),v=require("./charts-Cjw5AYkg.cjs"),n=require("./matrix-B8QWbsGM.cjs");function o(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}function w(t){if(t==null)return"null";if(typeof t!="string"&&typeof t!="boolean"&&!(typeof t=="number"&&Number.isFinite(t)))throw new Error("交叉表维度应为字符串、布尔、有限数字或空值");return JSON.stringify([typeof t,t])}function f(t){return t==null?"":String(t)}function m(t,e){const l=t??e;if(!Number.isInteger(l)||l<1)throw new Error("交叉表预算应为正整数");return l}function p(t,e,l,u){const c=l?1:0;if((t+c)*(e+1+c)>u)throw new Error("交叉表输出单元格超出 maxCells 预算,请减少维度或服务端预聚合")}function x(t,e){if(!Array.isArray(t))throw new Error("交叉表数据应为对象数组");const l=e.aggregate??"sum";if(!["sum","count","avg","min","max","weightedAvg"].includes(l))throw new Error("未知交叉表聚合类型");if(!e.rowField||!e.columnField||l!=="count"&&!e.valueField)throw new Error("交叉表需要明确的行维度、列维度和度量字段");if(t.length>m(e.maxInputRows,1e5))throw new Error("交叉表输入超出预算,请在服务端预聚合");const u=m(e.maxRows,1e3),c=m(e.maxColumns,200),h=m(e.maxCells,2e6),g={op:l,field:l==="count"&&e.countMode!=="nonNull"?void 0:e.valueField,weightField:e.weightField,numeric:e.numeric,digits:e.digits};r.createAggregateAccumulator(g);const{groups:b,columns:s,columnTotals:D,totals:y}=n.accumulatePivotRows(t,{row:a=>({key:w(o(a,e.rowField)),label:f(o(a,e.rowField))}),column:a=>({key:w(o(a,e.columnField)),label:f(o(a,e.columnField))}),measures:[g],totals:e.totals,check:(a,i)=>{if(a>u||i>c)throw new Error("交叉表维度数量超出预算");p(a,i,e.totals,h)}}),d={columns:[{header:e.rowHeader??e.rowField,field:"rowLabel",semanticRole:"dimension"},...[...s.values()].map((a,i)=>({header:a,field:`c${i}`,semanticRole:"measure"}))],rows:[...b.values()].map(a=>({rowLabel:a.label,...Object.fromEntries([...s.keys()].map((i,C)=>[`c${C}`,a.cells.get(i)?.[0]?.value()??(l==="count"?0:null)])),...e.totals?{total:a.totals[0].value()}:{}}))};return e.totals&&(d.columns.push({header:"合计",field:"total",semanticRole:"measure"}),t.length&&d.rows.push({rowLabel:"合计",...Object.fromEntries([...s.keys()].map((a,i)=>[`c${i}`,D.get(a)?.[0]?.value()??(l==="count"?0:null)])),total:y[0].value()})),d}exports.addDecimal=r.addDecimal;exports.aggregateRows=r.aggregateRows;exports.compareDecimal=r.compareDecimal;exports.computeDataset=r.computeDataset;exports.createAggregateAccumulator=r.createAggregateAccumulator;exports.createReportChartData=r.createReportChartData;exports.decimalDigits=r.decimalDigits;exports.divideDecimal=r.divideDecimal;exports.formatDecimal=r.formatDecimal;exports.getComputationMetadata=r.getComputationMetadata;exports.multiplyDecimal=r.multiplyDecimal;exports.parseDecimal=r.parseDecimal;exports.printDecimal=r.printDecimal;exports.validateComputedFields=r.validateComputedFields;exports.validateReportChartBinding=r.validateReportChartBinding;exports.createChartComponents=v.createChartComponents;exports.createMatrixTable=n.createMatrixTable;exports.estimateMatrixTable=n.estimateMatrixTable;exports.validateMatrixOptions=n.validateMatrixOptions;exports.createCrossTable=x;
|
package/dist/analytics.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { c as
|
|
4
|
-
import { a as
|
|
5
|
-
import { c as Q } from "./
|
|
1
|
+
import { c as x } from "./computed-f3pOqWLX.js";
|
|
2
|
+
import { a as p, b as O, d as L, e as A, f as M, g as j, h as N, i as T, j as $, m as I, p as P, k as S, v as B, l as H } from "./computed-f3pOqWLX.js";
|
|
3
|
+
import { c as q } from "./charts-CxJZ0XaY.js";
|
|
4
|
+
import { a as F } from "./matrix-C6e_r_vp.js";
|
|
5
|
+
import { c as G, e as K, v as Q } from "./matrix-C6e_r_vp.js";
|
|
6
6
|
function o(a, e) {
|
|
7
7
|
return Object.prototype.hasOwnProperty.call(a, e) ? a[e] : void 0;
|
|
8
8
|
}
|
|
@@ -44,8 +44,8 @@ function E(a, e) {
|
|
|
44
44
|
numeric: e.numeric,
|
|
45
45
|
digits: e.digits
|
|
46
46
|
};
|
|
47
|
-
|
|
48
|
-
const { groups: g, columns: s, columnTotals: h, totals: b } =
|
|
47
|
+
x(u);
|
|
48
|
+
const { groups: g, columns: s, columnTotals: h, totals: b } = F(a, {
|
|
49
49
|
row: (t) => ({ key: d(o(t, e.rowField)), label: f(o(t, e.rowField)) }),
|
|
50
50
|
column: (t) => ({ key: d(o(t, e.columnField)), label: f(o(t, e.columnField)) }),
|
|
51
51
|
measures: [u],
|
|
@@ -96,24 +96,24 @@ function E(a, e) {
|
|
|
96
96
|
})), n;
|
|
97
97
|
}
|
|
98
98
|
export {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
p as addDecimal,
|
|
100
|
+
O as aggregateRows,
|
|
101
|
+
L as compareDecimal,
|
|
102
|
+
A as computeDataset,
|
|
103
|
+
x as createAggregateAccumulator,
|
|
104
|
+
q as createChartComponents,
|
|
105
105
|
E as createCrossTable,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
106
|
+
G as createMatrixTable,
|
|
107
|
+
M as createReportChartData,
|
|
108
|
+
j as decimalDigits,
|
|
109
|
+
N as divideDecimal,
|
|
110
|
+
K as estimateMatrixTable,
|
|
111
|
+
T as formatDecimal,
|
|
112
|
+
$ as getComputationMetadata,
|
|
113
|
+
I as multiplyDecimal,
|
|
114
|
+
P as parseDecimal,
|
|
115
|
+
S as printDecimal,
|
|
116
|
+
B as validateComputedFields,
|
|
117
|
+
Q as validateMatrixOptions,
|
|
118
|
+
H as validateReportChartBinding
|
|
119
119
|
};
|