@agile-team/mach-report 2.10.0 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/README.md +6 -2
  2. package/dist/ExcelBindingWizard-CjIiVox-.cjs +1 -0
  3. package/dist/ExcelBindingWizard-Dxm-K5HL.js +1240 -0
  4. package/dist/ParamEditor-D-Hf5xfO.cjs +1 -0
  5. package/dist/ParamEditor-DRGxzxeO.js +381 -0
  6. package/dist/ReportBatchPanel-BYgg0EDB.cjs +1 -0
  7. package/dist/ReportBatchPanel-Bby5yLzU.js +287 -0
  8. package/dist/ReportPreview-DWXROHBP.cjs +6 -0
  9. package/dist/ReportPreview-DiNXhQI0.js +4138 -0
  10. package/dist/ReportTemplateLibrary-C6CO7YCT.cjs +1 -0
  11. package/dist/ReportTemplateLibrary-DfzDXRvr.js +260 -0
  12. package/dist/RuleEditor-C2QsOHOs.cjs +1 -0
  13. package/dist/RuleEditor-D9wQHrkf.js +2024 -0
  14. package/dist/TemplateReviewPanel-BKofGrV9.js +222 -0
  15. package/dist/TemplateReviewPanel-DwtOcLue.cjs +1 -0
  16. package/dist/analytics.cjs +1 -1
  17. package/dist/analytics.d.cts +2 -0
  18. package/dist/analytics.d.ts +2 -0
  19. package/dist/analytics.js +29 -29
  20. package/dist/batch-Bt3Fd27Z.cjs +1 -0
  21. package/dist/batch-mRqhhhjt.js +364 -0
  22. package/dist/computed-Bvk0W15F.js +521 -0
  23. package/dist/computed-CGV2a809.cjs +1 -0
  24. package/dist/config-B612mw0x.js +525 -0
  25. package/dist/config-BRoLo2oj.cjs +1 -0
  26. package/dist/designer.cjs +2 -2
  27. package/dist/designer.d.cts +659 -9
  28. package/dist/designer.d.ts +659 -9
  29. package/dist/designer.js +2030 -1824
  30. package/dist/index.cjs +8 -8
  31. package/dist/index.d.cts +147 -3
  32. package/dist/index.d.ts +147 -3
  33. package/dist/index.js +639 -592
  34. package/dist/injection-keys-Db_DyLkm.cjs +1 -0
  35. package/dist/injection-keys-e85udZCp.js +7 -0
  36. package/dist/list-cell-BuYn4tGF.cjs +1 -0
  37. package/dist/{list-cell-Dxyi7DOw.js → list-cell-ClFra1zS.js} +54 -40
  38. package/dist/matrix-DVyWiYsd.cjs +1 -0
  39. package/dist/matrix-yZsGnldA.js +227 -0
  40. package/dist/param-validation-BlHHXs6u.js +153 -0
  41. package/dist/param-validation-DCK039V1.cjs +1 -0
  42. package/dist/pdf.cjs +25 -25
  43. package/dist/pdf.d.cts +3 -0
  44. package/dist/pdf.d.ts +3 -0
  45. package/dist/pdf.js +677 -677
  46. package/dist/plugin-BDTU4D94.cjs +1 -0
  47. package/dist/plugin-Cd5G2QQn.js +22 -0
  48. package/dist/region-binding-workflow-CXDmt9Bs.js +977 -0
  49. package/dist/region-binding-workflow-DhQvu1co.cjs +3 -0
  50. package/dist/{report-params-B_VCihAh.js → report-params-B44imUd4.js} +1 -1
  51. package/dist/{report-params-CjWrjPl6.cjs → report-params-SJfhKgaX.cjs} +1 -1
  52. package/dist/server/node.d.cts +5 -2
  53. package/dist/server/node.d.ts +5 -2
  54. package/dist/server-node.cjs +1 -1
  55. package/dist/server-node.js +87 -87
  56. package/dist/server.cjs +1 -1
  57. package/dist/server.d.cts +201 -2
  58. package/dist/server.d.ts +201 -2
  59. package/dist/server.js +557 -658
  60. package/dist/style.css +1 -1
  61. package/dist/template-registry-WNXdkiET.js +506 -0
  62. package/dist/template-registry-ukBGlm8N.cjs +1 -0
  63. package/dist/template-review-BXp2oyqg.cjs +1 -0
  64. package/dist/template-review-BdcXSYbx.js +1616 -0
  65. package/dist/tree-BX380Rr7.cjs +1 -0
  66. package/dist/tree-CqcQ99NM.js +172 -0
  67. package/dist/{validate-UUy9yP4K.js → validate-7s0yn6ii.js} +44 -44
  68. package/dist/validate-DsRiNw8h.cjs +1 -0
  69. package/dist/vue/async.d.cts +93 -4
  70. package/dist/vue/async.d.ts +93 -4
  71. package/dist/vue/index.d.cts +145 -7
  72. package/dist/vue/index.d.ts +145 -7
  73. package/dist/vue-async.cjs +1 -1
  74. package/dist/vue-async.js +5 -5
  75. package/dist/vue.cjs +1 -1
  76. package/dist/vue.js +116 -113
  77. package/dist/{workbook-session-B-bW5_yR.js → workbook-session-BKOTwcoq.js} +1 -1
  78. package/dist/{workbook-session-D7RtdNo0.cjs → workbook-session-CLYLhZWu.cjs} +1 -1
  79. package/dist/worker.cjs +1 -1
  80. package/dist/worker.d.cts +5 -2
  81. package/dist/worker.d.ts +5 -2
  82. package/dist/worker.js +1 -1
  83. package/dist/xlsx.cjs +3 -3
  84. package/dist/xlsx.d.cts +129 -2
  85. package/dist/xlsx.d.ts +129 -2
  86. package/dist/xlsx.js +336 -242
  87. package/package.json +1 -1
  88. package/dist/ExcelBindingWizard-CF7RplWm.cjs +0 -1
  89. package/dist/ExcelBindingWizard-qhwEderR.js +0 -842
  90. package/dist/ReportPreview-BE1tCHqE.js +0 -4604
  91. package/dist/ReportPreview-QKRKQOe3.cjs +0 -6
  92. package/dist/RuleEditor-BA36yIV6.js +0 -1723
  93. package/dist/RuleEditor-CczJ6mJm.cjs +0 -1
  94. package/dist/TemplateReviewPanel-CHi4Alqa.cjs +0 -1
  95. package/dist/TemplateReviewPanel-Dz0G5o83.js +0 -217
  96. package/dist/binding-preview-BWsdf_z2.cjs +0 -2
  97. package/dist/binding-preview-DILq0-0f.js +0 -649
  98. package/dist/decimal-CI1OAczk.js +0 -87
  99. package/dist/decimal-CQA0xJex.cjs +0 -1
  100. package/dist/list-cell-CyM1ZlRN.cjs +0 -1
  101. package/dist/matrix-BbXarwyk.js +0 -661
  102. package/dist/matrix-Cm65WLLP.cjs +0 -1
  103. package/dist/param-validation-BWNjLcN0.js +0 -116
  104. package/dist/param-validation-CiTxFeZ8.cjs +0 -1
  105. package/dist/plugin-CThk42vJ.cjs +0 -1
  106. package/dist/plugin-tGn7-5oF.js +0 -25
  107. package/dist/template-registry-CGWTLtIA.cjs +0 -1
  108. package/dist/template-registry-DzlQs3OF.js +0 -434
  109. package/dist/template-review-D1RoNCPw.cjs +0 -1
  110. package/dist/template-review-fnteXRng.js +0 -1473
  111. package/dist/validate-Bf6ccFr2.cjs +0 -1
@@ -0,0 +1,287 @@
1
+ import { ref as _, computed as k, watch as H, onBeforeUnmount as J, defineComponent as Q, openBlock as f, createElementBlock as b, unref as a, createElementVNode as o, toDisplayString as c, Fragment as z, renderList as W, normalizeClass as X, createVNode as Y, createCommentVNode as I, nextTick as G } from "vue";
2
+ import { a as Z, R as ee } from "./config-B612mw0x.js";
3
+ import { validateReportParams as j } from "@agile-team/mach-report";
4
+ import { i as te, r as ae } from "./batch-mRqhhhjt.js";
5
+ import { REPORT_BATCH_MESSAGES as ne } from "./designer.js";
6
+ import { _ as le } from "./_plugin-vue_export-helper-8SL1F89S.js";
7
+ function se(n) {
8
+ const d = {};
9
+ return !n || typeof n != "object" || (typeof n.instanceId == "string" && n.instanceId.length > 0 && n.instanceId.length <= 512 && (d.instanceId = n.instanceId), typeof n.label == "string" && (d.label = n.label.slice(0, 512))), d;
10
+ }
11
+ function ie(n) {
12
+ return Object.fromEntries((Array.isArray(n) ? n : []).filter((d) => d && typeof d.field == "string").map((d) => [d.field, d.defaultValue ?? ""]));
13
+ }
14
+ function q(n) {
15
+ return (n instanceof Error ? n.message : String(n)).slice(0, 1e3);
16
+ }
17
+ function re(n) {
18
+ try {
19
+ return { cases: te(n.initialCases ?? [], n.maxCases ?? 100), error: "" };
20
+ } catch (d) {
21
+ return { cases: [], error: q(d) };
22
+ }
23
+ }
24
+ function ce(n) {
25
+ let d = 0;
26
+ const P = (t) => ({ key: ++d, item: { id: t.id, params: { ...t.params } }, status: "pending" }), M = re(n), u = _(M.cases.map(P)), l = _(!1), m = _(!1), A = _(!1), v = _(M.error), $ = _(), E = _({ completed: 0, total: 0, failed: 0, cancelled: 0 }), x = k(() => ({ ...ne, ...n.messages })), y = k(() => u.value.map((t) => j(n.paramDefs, t.item.params))), V = k(() => u.value.filter((t) => t.status === "failed").length), C = k(() => n.maxCases ?? 100);
27
+ let g, i = 0;
28
+ function S(t = ie(n.paramDefs)) {
29
+ let e = d + 1;
30
+ for (; u.value.some((s) => s.item.id === `case-${e}`); ) e++;
31
+ return { id: `case-${e}`, params: { ...t } };
32
+ }
33
+ function R(t) {
34
+ if (!(n.readonly || l.value)) {
35
+ if (u.value.length >= C.value) {
36
+ v.value = x.value.batchLimit.replace("{count}", String(C.value));
37
+ return;
38
+ }
39
+ u.value.push(P(S(t?.item.params))), v.value = "";
40
+ }
41
+ }
42
+ function K(t) {
43
+ !l.value && !n.readonly && (u.value = u.value.filter((e) => e.key !== t));
44
+ }
45
+ function L(t, e) {
46
+ if (l.value || n.readonly) return;
47
+ const s = u.value.find((r) => r.key === t);
48
+ s && (s.item.params = { ...e }, s.status = "pending", delete s.receipt, delete s.error);
49
+ }
50
+ function N() {
51
+ l.value && (m.value = !0, g?.abort());
52
+ }
53
+ function T(t) {
54
+ return u.value.filter((e) => !t || e.status === "failed");
55
+ }
56
+ function U(t) {
57
+ const e = t.map((r) => j(n.paramDefs, r.item.params)), s = e.findIndex((r) => !r.ok);
58
+ if (s >= 0) {
59
+ $.value = t[s].key, v.value = x.value.batchInvalid;
60
+ return;
61
+ }
62
+ return t.map((r, D) => ({ id: r.item.id, params: { ...e[D].values } }));
63
+ }
64
+ function O(t, e) {
65
+ t.status = e.status, e.status === "completed" && (t.receipt = e.value), e.status === "failed" && (t.error = e.error.message.slice(0, 1e3));
66
+ }
67
+ async function w(t, e, s, r, D) {
68
+ r === i && (t.status = "running");
69
+ try {
70
+ const h = se(await D(e, s));
71
+ return r === i && (t.receipt = h, t.status = "completed"), h;
72
+ } catch (h) {
73
+ throw r === i && (t.status = s.signal.aborted ? "cancelled" : "failed", t.error = q(h)), h;
74
+ }
75
+ }
76
+ async function p(t = !1) {
77
+ if (n.readonly || l.value) return;
78
+ const e = T(t);
79
+ if (!e.length) return;
80
+ A.value = !0, v.value = "", $.value = void 0;
81
+ const s = U(e);
82
+ if (!s) return;
83
+ const r = ++i, D = n.execute;
84
+ g = new AbortController(), l.value = !0, m.value = !1, E.value = { completed: 0, total: e.length, failed: 0, cancelled: 0 };
85
+ for (const h of e)
86
+ h.status = "pending", delete h.receipt, delete h.error;
87
+ try {
88
+ const h = await ae(s, (B, F) => w(e[F.index], B, F, r, D), {
89
+ concurrency: n.concurrency,
90
+ maxCases: C.value,
91
+ signal: g.signal,
92
+ onProgress: (B) => {
93
+ r === i && (E.value = B);
94
+ }
95
+ });
96
+ r === i && h.forEach((B, F) => O(e[F], B));
97
+ } catch (h) {
98
+ r === i && (v.value = q(h));
99
+ } finally {
100
+ r === i && (l.value = !1, m.value = !1, g = void 0);
101
+ }
102
+ }
103
+ return H(() => [JSON.stringify(n.paramDefs), n.execute, n.readonly, n.concurrency, n.maxCases], () => {
104
+ l.value && (N(), v.value = x.value.batchChanged);
105
+ }), J(() => {
106
+ i++, g?.abort();
107
+ }), { m: x, rows: u, validations: y, running: l, cancelling: m, attempted: A, error: v, progress: E, failures: V, maximum: C, invalidKey: $, add: R, remove: K, setParams: L, cancel: N, run: p };
108
+ }
109
+ const oe = ["aria-label", "aria-busy"], ue = { class: "mr-batch__heading" }, de = ["disabled"], me = {
110
+ key: 0,
111
+ class: "mr-batch__empty"
112
+ }, ve = {
113
+ key: 1,
114
+ class: "mr-batch__rows"
115
+ }, fe = {
116
+ class: "mr-batch__status",
117
+ role: "status"
118
+ }, be = { class: "mr-batch__row-actions" }, he = ["aria-label", "disabled", "onClick"], pe = ["aria-label", "disabled", "onClick"], ye = {
119
+ key: 0,
120
+ class: "mr-batch__row-error",
121
+ role: "alert"
122
+ }, ge = {
123
+ key: 1,
124
+ class: "mr-batch__receipt"
125
+ }, _e = ["onClick"], ke = {
126
+ key: 2,
127
+ class: "mr-batch__error",
128
+ role: "alert"
129
+ }, Ce = {
130
+ class: "mr-batch__progress",
131
+ "aria-live": "polite"
132
+ }, xe = ["value", "max", "aria-label"], Se = { key: 1 }, Re = { class: "mr-batch__actions" }, $e = ["disabled"], Ie = ["disabled"], Pe = ["disabled"], Ee = ["aria-label"], De = ["disabled"], Be = ["disabled"], Me = /* @__PURE__ */ Q({
133
+ __name: "ReportBatchPanel",
134
+ props: {
135
+ paramDefs: {},
136
+ execute: { type: Function },
137
+ initialCases: {},
138
+ readonly: { type: Boolean },
139
+ concurrency: {},
140
+ maxCases: {},
141
+ messages: {},
142
+ paramMessages: {}
143
+ },
144
+ emits: ["open-instance"],
145
+ setup(n, { emit: d }) {
146
+ const P = n, M = d, u = ce(P), { m: l, rows: m, validations: A, running: v, cancelling: $, attempted: E, error: x, progress: y, failures: V, maximum: C } = u, g = _(), i = _(1), S = 10, R = k(() => Math.max(1, Math.ceil(m.value.length / S))), K = k(() => m.value.slice((i.value - 1) * S, i.value * S).map((p, t) => ({ row: p, index: (i.value - 1) * S + t }))), L = k(() => l.value.batchPage.replace("{page}", String(i.value)).replace("{pages}", String(R.value)).replace("{total}", String(m.value.length)));
147
+ H(R, (p) => {
148
+ i.value = Math.min(i.value, p);
149
+ });
150
+ const N = k(() => ({ ...Z, ...P.paramMessages })), T = k(() => l.value.batchProgress.replace("{completed}", String(y.value.completed)).replace("{total}", String(y.value.total)).replace("{failed}", String(y.value.failed)).replace("{cancelled}", String(y.value.cancelled)));
151
+ function U(p) {
152
+ return { pending: l.value.batchPending, running: l.value.batchRunning, completed: l.value.batchCompleted, failed: l.value.batchFailed, cancelled: l.value.batchCancelled }[p.status];
153
+ }
154
+ async function O(p) {
155
+ const t = m.value.length;
156
+ u.add(p), m.value.length !== t && (i.value = R.value, await G(), g.value?.querySelector(".mr-batch__row:last-child .mrp-param-input")?.focus());
157
+ }
158
+ async function w(p = !1) {
159
+ const t = u.run(p);
160
+ if (u.invalidKey.value !== void 0) {
161
+ const e = m.value.findIndex((s) => s.key === u.invalidKey.value);
162
+ i.value = Math.max(1, Math.floor(e / S) + 1), await G(), g.value?.querySelector('[aria-invalid="true"]')?.focus();
163
+ }
164
+ await t;
165
+ }
166
+ return (p, t) => (f(), b("section", {
167
+ ref_key: "root",
168
+ ref: g,
169
+ class: "mr-batch",
170
+ "aria-label": a(l).batchTitle,
171
+ "aria-busy": a(v)
172
+ }, [
173
+ o("header", ue, [
174
+ o("div", null, [
175
+ o("strong", null, c(a(l).batchTitle), 1),
176
+ o("p", null, c(a(l).batchDescription), 1)
177
+ ]),
178
+ o("button", {
179
+ type: "button",
180
+ disabled: n.readonly || a(v) || a(m).length >= a(C),
181
+ onClick: t[0] || (t[0] = (e) => O())
182
+ }, "+ " + c(a(l).batchAdd), 9, de)
183
+ ]),
184
+ a(m).length ? (f(), b("div", ve, [
185
+ (f(!0), b(z, null, W(K.value, ({ row: e, index: s }) => (f(), b("article", {
186
+ key: e.key,
187
+ class: X(["mr-batch__row", `is-${e.status}`])
188
+ }, [
189
+ o("header", null, [
190
+ o("div", null, [
191
+ o("strong", null, c(a(l).batchCase) + " " + c(s + 1), 1),
192
+ o("span", fe, c(U(e)), 1)
193
+ ]),
194
+ o("div", be, [
195
+ o("button", {
196
+ type: "button",
197
+ "aria-label": `${a(l).batchDuplicate} ${s + 1}`,
198
+ disabled: n.readonly || a(v) || a(m).length >= a(C),
199
+ onClick: (r) => O(e)
200
+ }, c(a(l).batchDuplicate), 9, he),
201
+ o("button", {
202
+ type: "button",
203
+ "aria-label": `${a(l).batchRemove} ${s + 1}`,
204
+ disabled: n.readonly || a(v),
205
+ onClick: (r) => a(u).remove(e.key)
206
+ }, "×", 8, pe)
207
+ ])
208
+ ]),
209
+ Y(ee, {
210
+ defs: n.paramDefs,
211
+ "model-value": e.item.params,
212
+ messages: N.value,
213
+ attempted: a(E),
214
+ issues: a(A)[s]?.issues,
215
+ "show-actions": !1,
216
+ "show-title": !1,
217
+ disabled: n.readonly || a(v),
218
+ "onUpdate:modelValue": (r) => a(u).setParams(e.key, r)
219
+ }, null, 8, ["defs", "model-value", "messages", "attempted", "issues", "disabled", "onUpdate:modelValue"]),
220
+ e.status === "failed" && e.error ? (f(), b("p", ye, c(e.error), 1)) : I("", !0),
221
+ e.status === "completed" ? (f(), b("div", ge, [
222
+ o("span", null, c(e.receipt?.label || (e.receipt?.instanceId ? e.receipt.instanceId : a(l).batchNoInstance)), 1),
223
+ e.receipt?.instanceId ? (f(), b("button", {
224
+ key: 0,
225
+ type: "button",
226
+ onClick: (r) => M("open-instance", { ...e.receipt })
227
+ }, c(a(l).batchOpen) + " ↗", 9, _e)) : I("", !0)
228
+ ])) : I("", !0)
229
+ ], 2))), 128))
230
+ ])) : (f(), b("div", me, c(a(l).batchEmpty), 1)),
231
+ a(x) ? (f(), b("p", ke, c(a(x)), 1)) : I("", !0),
232
+ o("footer", null, [
233
+ o("div", Ce, [
234
+ a(y).total ? (f(), b(z, { key: 0 }, [
235
+ o("progress", {
236
+ value: a(y).completed,
237
+ max: a(y).total,
238
+ "aria-label": T.value
239
+ }, null, 8, xe),
240
+ o("span", null, c(T.value), 1)
241
+ ], 64)) : (f(), b("span", Se, c(a(m).length) + " / " + c(a(C)), 1))
242
+ ]),
243
+ o("div", Re, [
244
+ a(V) && !a(v) ? (f(), b("button", {
245
+ key: 0,
246
+ type: "button",
247
+ disabled: n.readonly,
248
+ onClick: t[1] || (t[1] = (e) => w(!0))
249
+ }, c(a(l).batchRetry) + " (" + c(a(V)) + ")", 9, $e)) : I("", !0),
250
+ a(v) ? (f(), b("button", {
251
+ key: 1,
252
+ type: "button",
253
+ disabled: a($),
254
+ onClick: t[2] || (t[2] = //@ts-ignore
255
+ (...e) => a(u).cancel && a(u).cancel(...e))
256
+ }, c(a($) ? a(l).batchCancelling : a(l).batchCancel), 9, Ie)) : (f(), b("button", {
257
+ key: 2,
258
+ type: "button",
259
+ class: "is-primary",
260
+ disabled: n.readonly || !a(m).length,
261
+ onClick: t[3] || (t[3] = (e) => w())
262
+ }, c(a(l).batchRun), 9, Pe))
263
+ ]),
264
+ R.value > 1 ? (f(), b("nav", {
265
+ key: 0,
266
+ class: "mr-batch__pagination",
267
+ "aria-label": a(l).batchPages
268
+ }, [
269
+ o("span", null, c(L.value), 1),
270
+ o("button", {
271
+ type: "button",
272
+ disabled: i.value <= 1,
273
+ onClick: t[4] || (t[4] = (e) => i.value--)
274
+ }, c(a(l).batchPrevious), 9, De),
275
+ o("button", {
276
+ type: "button",
277
+ disabled: i.value >= R.value,
278
+ onClick: t[5] || (t[5] = (e) => i.value++)
279
+ }, c(a(l).batchNext), 9, Be)
280
+ ], 8, Ee)) : I("", !0)
281
+ ])
282
+ ], 8, oe));
283
+ }
284
+ }), Fe = /* @__PURE__ */ le(Me, [["__scopeId", "data-v-eea7fd86"]]);
285
+ export {
286
+ Fe as default
287
+ };