@agile-team/mach-report 2.16.0 → 2.18.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 +25 -12
- package/dist/{ExcelBindingWizard-CP6h2x1f.cjs → ExcelBindingWizard-Czn3C2yE.cjs} +1 -1
- package/dist/{ExcelBindingWizard-HhB3hAJE.js → ExcelBindingWizard-DMGZj6I6.js} +3 -3
- package/dist/ParamEditor-KzDQvbHY.js +732 -0
- package/dist/ParamEditor-oDfD8LgE.cjs +1 -0
- package/dist/{ReportBatchPanel-ruxcbfY6.js → ReportBatchPanel-BJK7PvZ4.js} +39 -39
- package/dist/ReportBatchPanel-DnmNRssu.cjs +1 -0
- package/dist/ReportParamPanel-mQkeN70Q.js +1020 -0
- package/dist/ReportParamPanel-sOANVRz-.cjs +1 -0
- package/dist/ReportPreview-BxWWTUL5.js +5583 -0
- package/dist/ReportPreview-Yf99omi3.cjs +6 -0
- package/dist/{ReportTemplateLibrary-DcwrH-63.js → ReportTemplateLibrary-BFjB08Wu.js} +1 -1
- package/dist/{ReportTemplateLibrary-BDlNT8JN.cjs → ReportTemplateLibrary-BO42QnWd.cjs} +1 -1
- package/dist/RuleEditor-CqxT1a-W.js +2337 -0
- package/dist/RuleEditor-D7YWigD9.cjs +1 -0
- package/dist/{TemplateOutlinePanel-CGrT5DFN.cjs → TemplateOutlinePanel-B0XX350V.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-SXCjaPKR.js → TemplateOutlinePanel-zG0DrsIB.js} +2 -2
- package/dist/{TemplateReusePanel-6Z3wRFz8.cjs → TemplateReusePanel-BD0HSKp_.cjs} +1 -1
- package/dist/{TemplateReusePanel-lHLOS9Wn.js → TemplateReusePanel-Czwe5GbC.js} +2 -2
- package/dist/{TemplateReviewPanel-Dpk7sLcF.cjs → TemplateReviewPanel-CA5sdffM.cjs} +1 -1
- package/dist/{TemplateReviewPanel-CJ9PLc48.js → TemplateReviewPanel-NhmQI65C.js} +2 -2
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.d.cts +163 -42
- package/dist/analytics.d.ts +163 -42
- package/dist/analytics.js +76 -141
- package/dist/artifact-integrity.json +110 -108
- package/dist/assets-2eC3mOcV.js +232 -0
- package/dist/assets-B0Hxn4l6.cjs +1 -0
- package/dist/{auto-uVBjX1j5.cjs → auto-B0EZFIK1.cjs} +1 -1
- package/dist/{auto-YR7a4BtF.js → auto-BlchZ1b8.js} +10 -10
- package/dist/{batch-WzDIXJAt.js → batch-DGCt44XM.js} +1 -1
- package/dist/{batch-z6Aw5GEY.cjs → batch-DYcokH4v.cjs} +1 -1
- package/dist/charts-Dlv8j2AG.js +141 -0
- package/dist/charts-aCtoswXq.cjs +1 -0
- package/dist/codes.cjs +9 -9
- package/dist/codes.d.cts +54 -0
- package/dist/codes.d.ts +54 -0
- package/dist/codes.js +12097 -13668
- package/dist/column-visual-BpgQVWwT.js +238 -0
- package/dist/column-visual-CtYxnBCP.cjs +1 -0
- package/dist/component-tree-6TV7W6Yj.cjs +1 -0
- package/dist/component-tree-CvW4lzpv.js +67 -0
- package/dist/computed-4TnxzgIh.cjs +1 -0
- package/dist/computed-C8NRZQss.js +739 -0
- package/dist/data-bar-Ce38juRZ.cjs +1 -0
- package/dist/data-bar-PtjXhMgN.js +9 -0
- package/dist/dataset-DL83majE.js +161 -0
- package/dist/dataset-IrlXbUvh.cjs +1 -0
- package/dist/designer--TKECSEc.cjs +2 -0
- package/dist/designer-d6hJS41w.js +5683 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +835 -45
- package/dist/designer.d.ts +835 -45
- package/dist/designer.js +23 -20
- package/dist/{encoding-BYF9ZTl9.cjs → encoding-B--eZpp1.cjs} +1 -1
- package/dist/{encoding-BOGq4qYL.js → encoding-mctOLocI.js} +2 -2
- package/dist/{font-loader-EKLzOJxf.cjs → font-loader-DBBJ5KE9.cjs} +1 -1
- package/dist/{font-loader-CzI1GuBc.js → font-loader-DW8tIaNp.js} +1 -1
- package/dist/index-CPh6tqge.js +1575 -0
- package/dist/index-CUNw7dL9.cjs +1 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +534 -16
- package/dist/index.d.ts +534 -16
- package/dist/index.js +1393 -955
- package/dist/json-snapshot-By4ZVVUt.js +1967 -0
- package/dist/json-snapshot-jiXff4lc.cjs +2 -0
- package/dist/matrix-0hywp0-F.cjs +1 -0
- package/dist/matrix-Dy-tyY7E.js +381 -0
- package/dist/param-validation-C-8sRJLq.cjs +1 -0
- package/dist/param-validation-CnDEd2l-.js +333 -0
- package/dist/{pdf-DJ5S6ukC.js → pdf-CKROKygt.js} +1845 -1845
- package/dist/{pdf-ByVCb1i6.cjs → pdf-DqyxJ96U.cjs} +47 -47
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.d.cts +66 -0
- package/dist/pdf.d.ts +66 -0
- package/dist/pdf.js +2 -2
- package/dist/{plugin-C2j5_mhx.js → plugin-ByjF2kiV.js} +5 -5
- package/dist/{plugin-Dr39GBRG.cjs → plugin-DM1M2wlI.cjs} +1 -1
- package/dist/prefill-B8H9qwE4.js +371 -0
- package/dist/prefill-D7EswyTI.cjs +1 -0
- package/dist/{prepared-DqtpvRTn.js → prepared-BE-4jfX5.js} +2 -2
- package/dist/{prepared-DdrjLC7L.cjs → prepared-CGVphji3.cjs} +1 -1
- package/dist/{protocol-BzwMP4Vw.cjs → protocol-ByRVzzQG.cjs} +1 -1
- package/dist/{protocol-kt4Iy6-3.js → protocol-Cr81vFSQ.js} +3 -3
- package/dist/{record-bindings-CZWBJ1fU.js → record-bindings-DEJtmo3p.js} +67 -107
- package/dist/record-bindings-ehjnCDHt.cjs +1 -0
- package/dist/{region-binding-workflow-CWNvIjkV.js → region-binding-workflow-CBg0l_tj.js} +2 -2
- package/dist/{region-binding-workflow-CqSMxQ4p.cjs → region-binding-workflow-D05tOYn3.cjs} +1 -1
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/{report-params-B1RzkhJj.js → report-params-D9tBuM9B.js} +1 -1
- package/dist/{report-params-WDGrA4oP.cjs → report-params-VTg8MoCp.cjs} +1 -1
- package/dist/runtime-CDA6d263.cjs +1 -0
- package/dist/runtime-CEMvybO7.js +170 -0
- package/dist/sbom.cdx.json +1 -1
- package/dist/server/node.d.cts +121 -7
- package/dist/server/node.d.ts +121 -7
- package/dist/server-node.cjs +4 -4
- package/dist/server-node.js +3446 -2115
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +417 -29
- package/dist/server.d.ts +417 -29
- package/dist/server.js +787 -544
- package/dist/sha256-BDQ1Qk7A.js +158 -0
- package/dist/sha256-DgZAKXqI.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/template-bindings-Cg5oBLFT.cjs +1 -0
- package/dist/template-bindings-TKnXM7ll.js +62 -0
- package/dist/{template-catalog-BtR2JmCL.js → template-catalog-CmbWOJqy.js} +16 -16
- package/dist/template-catalog-Utu4GP09.cjs +1 -0
- package/dist/{template-fragments-BVsbxs4a.cjs → template-fragments-C_zSHJAa.cjs} +1 -1
- package/dist/{template-fragments-By0aZC1D.js → template-fragments-DWgo9tlZ.js} +2 -2
- package/dist/{template-outline-BwRV_eRo.cjs → template-outline-DWkzZXVC.cjs} +1 -1
- package/dist/{template-outline-cnWfT_LK.js → template-outline-DiADphlq.js} +1 -1
- package/dist/{template-registry-Cw3vRTX2.js → template-registry-BIhIHOab.js} +319 -314
- package/dist/template-registry-DzWswQI5.cjs +1 -0
- package/dist/vue/async.d.cts +636 -35
- package/dist/vue/async.d.ts +636 -35
- package/dist/vue/index.d.cts +746 -67
- package/dist/vue/index.d.ts +746 -67
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +94 -89
- package/dist/{workbook-session-Cbts-22R.cjs → workbook-session-B94EwVa_.cjs} +1 -1
- package/dist/{workbook-session-BeSO8PFB.js → workbook-session-BoScoOg-.js} +2 -2
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +75 -7
- package/dist/worker.d.ts +75 -7
- package/dist/worker.js +4 -4
- package/dist/xlsx.cjs +4 -4
- package/dist/xlsx.d.cts +208 -15
- package/dist/xlsx.d.ts +208 -15
- package/dist/xlsx.js +288 -252
- package/package.json +1 -1
- package/dist/ParamEditor-CUQLgoxa.cjs +0 -1
- package/dist/ParamEditor-OKesP_nO.js +0 -594
- package/dist/ReportBatchPanel-cZCAMAwH.cjs +0 -1
- package/dist/ReportPreview-BcDKCLiK.js +0 -4834
- package/dist/ReportPreview-Bk9nLfO9.cjs +0 -6
- package/dist/RuleEditor-BX5S8RSF.cjs +0 -1
- package/dist/RuleEditor-CGl9XY2s.js +0 -2037
- package/dist/assets-CqIbfbTr.js +0 -126
- package/dist/assets-e4YSke8n.cjs +0 -1
- package/dist/capabilities-DDwXr_cA.js +0 -103
- package/dist/capabilities-DNLyZdNw.cjs +0 -1
- package/dist/component-tree-Ca6YYfHq.js +0 -61
- package/dist/component-tree-DkGLEfZC.cjs +0 -1
- package/dist/computed-C-4C2S5h.js +0 -521
- package/dist/computed-CGV2a809.cjs +0 -1
- package/dist/config-Dg_o8e7m.cjs +0 -1
- package/dist/config-XQ4qrQ7Q.js +0 -844
- package/dist/dataset-BkRmwgeJ.cjs +0 -1
- package/dist/dataset-H5pFuQGU.js +0 -121
- package/dist/designer-BfQSahxq.js +0 -5163
- package/dist/designer-CPPdeM5_.cjs +0 -2
- package/dist/diagnostic-notification-B9K9We3h.cjs +0 -1
- package/dist/diagnostic-notification-qGAYZdkB.js +0 -7
- package/dist/drill-CsdjgkRM.cjs +0 -1
- package/dist/drill-DIGsZfyB.js +0 -145
- package/dist/json-snapshot-D6ioHth9.js +0 -1702
- package/dist/json-snapshot-DknkjvxP.cjs +0 -2
- package/dist/matrix-CGRGkn5s.js +0 -112
- package/dist/matrix-gEO7ZM_u.cjs +0 -1
- package/dist/param-validation-C3HlcLLO.cjs +0 -1
- package/dist/param-validation-Do7Eg8Zv.js +0 -181
- package/dist/record-bindings-DUX1VMlR.cjs +0 -1
- package/dist/runtime-BjKBI530.js +0 -168
- package/dist/runtime-CBFEPKEs.cjs +0 -1
- package/dist/sha256-BshdOkCC.cjs +0 -1
- package/dist/sha256-DTG-Gq8i.js +0 -157
- package/dist/template-bindings-C2SpvsMU.js +0 -58
- package/dist/template-bindings-CEtWyiLX.cjs +0 -1
- package/dist/template-catalog-C2NLdrwB.cjs +0 -1
- package/dist/template-registry-C62vpv4a.cjs +0 -1
- package/dist/tree-BX380Rr7.cjs +0 -1
- package/dist/tree-CjVZLRw7.js +0 -172
|
@@ -1,594 +0,0 @@
|
|
|
1
|
-
import { ref as T, computed as R, watch as Z, defineComponent as ee, getCurrentInstance as ae, openBlock as d, createElementBlock as u, unref as e, createElementVNode as n, toDisplayString as o, Fragment as C, renderList as A, normalizeClass as W, createCommentVNode as h, createTextVNode as k, withDirectives as V, mergeProps as I, vModelDynamic as H, vModelText as z, vModelCheckbox as G, vModelSelect as X, nextTick as te } from "vue";
|
|
2
|
-
import { validateReportParamDefinitions as le } from "@agile-team/mach-report";
|
|
3
|
-
import { P as ne, u as oe } from "./designer-BfQSahxq.js";
|
|
4
|
-
import { _ as re } from "./_plugin-vue_export-helper-8SL1F89S.js";
|
|
5
|
-
const ie = ["text", "number", "date", "month", "year", "dateRange", "select"], se = { text: "string", number: "string → number", date: "YYYY-MM-DD", month: "YYYY-MM", year: "YYYY", dateRange: "YYYY-MM-DD/YYYY-MM-DD", select: "option.value" };
|
|
6
|
-
function de(a) {
|
|
7
|
-
if (a.startsWith("远程选项")) return ["optionsSource"];
|
|
8
|
-
if (a.startsWith("联动依赖")) return ["dependsOn"];
|
|
9
|
-
if (/^(默认值|必填参数的默认值)/.test(a)) return ["defaultValue"];
|
|
10
|
-
if (a.includes("参数名")) return ["field"];
|
|
11
|
-
if (a.includes("选项")) return ["options"];
|
|
12
|
-
if (a.startsWith("最小边界")) return ["min", "max"];
|
|
13
|
-
if (a.startsWith("最小长度")) return ["minLength", "maxLength"];
|
|
14
|
-
const b = /^(minLength|maxLength|min|max) /.exec(a)?.[1];
|
|
15
|
-
return b ? [b] : ["type"];
|
|
16
|
-
}
|
|
17
|
-
function ue(a) {
|
|
18
|
-
return JSON.parse(JSON.stringify(a));
|
|
19
|
-
}
|
|
20
|
-
function K(a) {
|
|
21
|
-
return {
|
|
22
|
-
field: a.field,
|
|
23
|
-
label: a.label ?? "",
|
|
24
|
-
type: a.type ?? "text",
|
|
25
|
-
required: a.required === !0,
|
|
26
|
-
placeholder: a.placeholder ?? "",
|
|
27
|
-
defaultEnabled: a.defaultValue !== void 0,
|
|
28
|
-
defaultValue: a.defaultValue ?? "",
|
|
29
|
-
min: a.min === void 0 ? "" : String(a.min),
|
|
30
|
-
max: a.max === void 0 ? "" : String(a.max),
|
|
31
|
-
minLength: a.minLength === void 0 ? "" : String(a.minLength),
|
|
32
|
-
maxLength: a.maxLength === void 0 ? "" : String(a.maxLength),
|
|
33
|
-
options: a.options ? a.options.map((b) => ({ ...b })) : [],
|
|
34
|
-
optionsMode: a.optionsSource === void 0 ? "static" : "remote",
|
|
35
|
-
optionsSource: a.optionsSource ?? "",
|
|
36
|
-
dependsOn: [...a.dependsOn ?? []]
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
function me(a) {
|
|
40
|
-
const b = { field: a.field, type: a.type };
|
|
41
|
-
a.label && (b.label = a.label), a.placeholder && (b.placeholder = a.placeholder), a.required && (b.required = !0), a.defaultEnabled && (b.defaultValue = a.defaultValue);
|
|
42
|
-
for (const _ of ["min", "max"])
|
|
43
|
-
a[_] !== "" && (b[_] = a.type === "number" ? Number(a[_]) : a[_]);
|
|
44
|
-
for (const _ of ["minLength", "maxLength"]) a[_] !== "" && (b[_] = Number(a[_]));
|
|
45
|
-
return a.type === "select" && a.optionsMode === "remote" ? (b.optionsSource = a.optionsSource.trim(), a.dependsOn.length && (b.dependsOn = [...a.dependsOn])) : a.type === "select" && (b.options = a.options.map((_) => ({ ..._ }))), b;
|
|
46
|
-
}
|
|
47
|
-
function pe(a) {
|
|
48
|
-
const b = () => JSON.stringify(a.document.template.params ?? []), _ = T(b()), c = T((a.document.template.params ?? []).map(K)), M = T(0), s = T(""), l = R(() => ({ ...ne, ...a.messages })), D = R(() => c.value.map(me)), g = T(JSON.stringify(c.value)), i = R(() => JSON.stringify(c.value) !== g.value), E = R(() => b() !== _.value), $ = R(() => le(D.value)), Y = R(() => {
|
|
49
|
-
const p = /* @__PURE__ */ new Map();
|
|
50
|
-
for (const v of $.value) {
|
|
51
|
-
const y = Number(v.path.split(".").at(-1)), L = p.get(y) ?? [];
|
|
52
|
-
L.push({ message: v.message, controls: de(v.message) }), p.set(y, L);
|
|
53
|
-
}
|
|
54
|
-
return p;
|
|
55
|
-
}), j = R(() => Y.value.keys().next().value), O = R(() => c.value[M.value]), U = R(() => $.value.filter((p) => p.path === `$.paramDefs.${M.value}`));
|
|
56
|
-
function w(p) {
|
|
57
|
-
return (Y.value.get(M.value) ?? []).filter((v) => v.controls.includes(p)).map((v) => v.message);
|
|
58
|
-
}
|
|
59
|
-
const J = R(() => {
|
|
60
|
-
const p = JSON.parse(_.value).map((y) => y.field), v = D.value.map((y) => y.field);
|
|
61
|
-
return { added: v.filter((y) => y && !p.includes(y)), removed: p.filter((y) => !v.includes(y)) };
|
|
62
|
-
});
|
|
63
|
-
function x() {
|
|
64
|
-
_.value = b(), c.value = (a.document.template.params ?? []).map(K), M.value = Math.min(M.value, Math.max(0, c.value.length - 1)), g.value = JSON.stringify(c.value), s.value = "";
|
|
65
|
-
}
|
|
66
|
-
Z(b, () => {
|
|
67
|
-
i.value || x();
|
|
68
|
-
});
|
|
69
|
-
function P() {
|
|
70
|
-
if (a.readonly) return;
|
|
71
|
-
let p = c.value.length + 1;
|
|
72
|
-
for (; c.value.some((v) => v.field === `param${p}`); ) p++;
|
|
73
|
-
c.value.push(K({ field: `param${p}`, type: "text" })), M.value = c.value.length - 1;
|
|
74
|
-
}
|
|
75
|
-
function F() {
|
|
76
|
-
a.readonly || !O.value || (c.value.splice(M.value, 1), M.value = Math.min(M.value, Math.max(0, c.value.length - 1)));
|
|
77
|
-
}
|
|
78
|
-
function B(p) {
|
|
79
|
-
const v = M.value + p;
|
|
80
|
-
if (a.readonly || v < 0 || v >= c.value.length) return;
|
|
81
|
-
const y = c.value.splice(M.value, 1)[0];
|
|
82
|
-
c.value.splice(v, 0, y), M.value = v;
|
|
83
|
-
}
|
|
84
|
-
function S(p) {
|
|
85
|
-
a.readonly || !O.value || (O.value.type = p, O.value.min = "", O.value.max = "", O.value.minLength = "", O.value.maxLength = "");
|
|
86
|
-
}
|
|
87
|
-
function q() {
|
|
88
|
-
if (a.readonly || E.value || $.value.length) return !1;
|
|
89
|
-
try {
|
|
90
|
-
return a.accept(ue(D.value)) ? (_.value = JSON.stringify(D.value), g.value = JSON.stringify(c.value), s.value = "", !0) : (s.value = l.value.paramApplyFailed, !1);
|
|
91
|
-
} catch (p) {
|
|
92
|
-
return s.value = p instanceof Error ? p.message : String(p), !1;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return oe({ key: () => "params", baseline: () => _.value, pending: () => i.value, snapshot: () => JSON.stringify({ rows: c.value, selected: M.value, initial: g.value }), restore(p, v) {
|
|
96
|
-
const y = JSON.parse(p);
|
|
97
|
-
if (!Array.isArray(y.rows) || y.rows.length > 1e3 || typeof y.initial != "string") throw new Error("Invalid parameter draft");
|
|
98
|
-
c.value = y.rows.map((L) => ({ ...L, optionsMode: L.optionsMode ?? "static", optionsSource: L.optionsSource ?? "", dependsOn: L.dependsOn ?? [] })), M.value = Math.max(0, Math.min(y.selected, y.rows.length - 1)), g.value = y.initial, _.value = v;
|
|
99
|
-
} }), { m: l, rows: c, selected: M, current: O, definitions: D, issues: $, issuesByRow: Y, firstIssueIndex: j, controlIssues: w, currentIssues: U, changes: J, pending: i, conflicted: E, error: s, reset: x, add: P, remove: F, move: B, setType: S, apply: q };
|
|
100
|
-
}
|
|
101
|
-
const ce = ["aria-label"], ye = { class: "mr-param-editor__directory" }, ve = ["aria-label"], be = ["aria-pressed", "aria-label", "onClick"], fe = { class: "mr-param-editor__directory-title" }, he = {
|
|
102
|
-
key: 0,
|
|
103
|
-
class: "mr-param-editor__error-count",
|
|
104
|
-
"aria-hidden": "true"
|
|
105
|
-
}, ge = { key: 0 }, _e = ["disabled"], ke = {
|
|
106
|
-
key: 0,
|
|
107
|
-
class: "mr-param-editor__validation",
|
|
108
|
-
role: "status"
|
|
109
|
-
}, Me = { class: "mr-param-editor__heading" }, Oe = { class: "mr-param-editor__grid" }, Se = ["aria-label", "disabled"], xe = ["id"], $e = ["aria-label", "disabled"], Ve = ["value", "aria-label", "disabled"], Ie = ["value"], Re = ["id"], De = ["aria-label", "disabled"], Le = { class: "mr-param-editor__checks" }, Ce = ["disabled"], Ee = ["disabled"], Ye = { class: "mr-param-editor__default-label" }, Ue = { class: "mr-param-editor__range" }, Ne = ["value", "aria-label", "disabled"], Ae = ["value", "aria-label", "disabled"], Te = { key: 1 }, Pe = ["aria-label", "disabled"], je = ["value"], Je = ["value", "aria-label", "type", "min", "max", "step", "disabled"], qe = ["id"], we = ["value", "aria-label", "type", "min", "max", "step", "disabled", "onInput"], Fe = ["id"], Be = ["value", "aria-label", "disabled", "onInput"], We = ["id"], He = {
|
|
110
|
-
key: 0,
|
|
111
|
-
class: "mr-param-editor__hint"
|
|
112
|
-
}, ze = {
|
|
113
|
-
key: 1,
|
|
114
|
-
class: "mr-param-editor__options"
|
|
115
|
-
}, Ge = ["aria-label", "disabled"], Ke = { value: "static" }, Qe = { value: "remote" }, Xe = ["aria-label", "disabled"], Ze = ["id"], ea = ["value", "disabled"], aa = ["id"], ta = { class: "mr-param-editor__hint" }, la = {
|
|
116
|
-
key: 2,
|
|
117
|
-
class: "mr-param-editor__options"
|
|
118
|
-
}, na = { class: "mr-param-editor__option-head" }, oa = ["onUpdate:modelValue", "aria-label", "disabled"], ra = ["onUpdate:modelValue", "aria-label", "disabled"], ia = ["aria-label", "disabled", "onClick"], sa = ["id"], da = ["disabled"], ua = { class: "mr-param-editor__row-actions" }, ma = ["disabled"], pa = ["disabled"], ca = ["disabled"], ya = { class: "mr-param-editor__technical" }, va = {
|
|
119
|
-
key: 2,
|
|
120
|
-
class: "mr-param-editor__empty"
|
|
121
|
-
}, ba = ["disabled"], fa = {
|
|
122
|
-
key: 3,
|
|
123
|
-
class: "mr-param-editor__impact"
|
|
124
|
-
}, ha = { key: 0 }, ga = { key: 1 }, _a = {
|
|
125
|
-
key: 4,
|
|
126
|
-
class: "mr-param-editor__errors",
|
|
127
|
-
role: "alert"
|
|
128
|
-
}, ka = ["disabled"], Ma = ["disabled"], Oa = /* @__PURE__ */ ee({
|
|
129
|
-
__name: "ParamEditor",
|
|
130
|
-
props: {
|
|
131
|
-
document: {},
|
|
132
|
-
readonly: { type: Boolean },
|
|
133
|
-
messages: {},
|
|
134
|
-
accept: { type: Function }
|
|
135
|
-
},
|
|
136
|
-
emits: ["dirty"],
|
|
137
|
-
setup(a, { expose: b, emit: _ }) {
|
|
138
|
-
const c = a, M = _, s = pe(c), { m: l, rows: D, selected: g, current: i, changes: E, pending: $, conflicted: Y, error: j, issues: O, issuesByRow: U } = s, w = R(() => {
|
|
139
|
-
const m = D.value.filter((r, t) => t !== g.value).map((r) => ({ field: r.field, label: r.label || r.field || l.value.paramUnnamed }));
|
|
140
|
-
for (const r of i.value?.dependsOn ?? []) m.some((t) => t.field === r) || m.push({ field: r, label: `${r} · ${l.value.paramDependencyUnavailable}` });
|
|
141
|
-
return m;
|
|
142
|
-
}), J = T(), x = `mr-param-${ae()?.uid ?? 0}`;
|
|
143
|
-
Z($, (m) => M("dirty", m), { immediate: !0 });
|
|
144
|
-
function P(m) {
|
|
145
|
-
return { text: l.value.paramText, number: l.value.paramNumber, date: l.value.paramDate, month: l.value.paramMonth, year: l.value.paramYear, dateRange: l.value.paramDateRange, select: l.value.paramSelect }[m];
|
|
146
|
-
}
|
|
147
|
-
function F() {
|
|
148
|
-
i.value && !c.readonly && i.value.options.push({ value: "", label: "" });
|
|
149
|
-
}
|
|
150
|
-
function B(m) {
|
|
151
|
-
c.readonly || i.value?.options.splice(m, 1);
|
|
152
|
-
}
|
|
153
|
-
function S(m) {
|
|
154
|
-
const r = s.controlIssues(m).length > 0;
|
|
155
|
-
return { "aria-invalid": r ? "true" : void 0, "aria-describedby": r ? `${x}-${g.value}-${m}` : void 0 };
|
|
156
|
-
}
|
|
157
|
-
function q(m) {
|
|
158
|
-
return m === "year" ? "number" : m === "dateRange" ? "date" : ["date", "month", "number"].includes(m) ? m : "text";
|
|
159
|
-
}
|
|
160
|
-
function p(m) {
|
|
161
|
-
return m.target.value;
|
|
162
|
-
}
|
|
163
|
-
function v(m, r) {
|
|
164
|
-
i.value && !c.readonly && (i.value[m] = p(r));
|
|
165
|
-
}
|
|
166
|
-
function y(m) {
|
|
167
|
-
return i.value?.defaultValue.split("/")[m] ?? "";
|
|
168
|
-
}
|
|
169
|
-
function L(m, r) {
|
|
170
|
-
if (!i.value || c.readonly) return;
|
|
171
|
-
const t = [y(0), y(1)];
|
|
172
|
-
t[m] = p(r), i.value.defaultValue = t.some(Boolean) ? t.join("/") : "";
|
|
173
|
-
}
|
|
174
|
-
async function Q() {
|
|
175
|
-
const m = s.firstIssueIndex.value;
|
|
176
|
-
if (m === void 0) return;
|
|
177
|
-
g.value = m, await te();
|
|
178
|
-
const r = J.value?.querySelector('[aria-invalid="true"]');
|
|
179
|
-
r?.focus({ preventScroll: !0 }), r?.scrollIntoView?.({ block: "nearest" });
|
|
180
|
-
}
|
|
181
|
-
return b({ pending: $, reset: s.reset, apply: s.apply, locateIssue: Q }), (m, r) => (d(), u("section", {
|
|
182
|
-
class: "mr-param-editor",
|
|
183
|
-
"aria-label": e(l).paramsTool
|
|
184
|
-
}, [
|
|
185
|
-
n("aside", ye, [
|
|
186
|
-
n("header", null, [
|
|
187
|
-
n("strong", null, o(e(l).paramsDirectory), 1),
|
|
188
|
-
n("span", null, o(e(D).length), 1)
|
|
189
|
-
]),
|
|
190
|
-
n("nav", {
|
|
191
|
-
"aria-label": e(l).paramsDirectory
|
|
192
|
-
}, [
|
|
193
|
-
(d(!0), u(C, null, A(e(D), (t, f) => (d(), u("button", {
|
|
194
|
-
key: f,
|
|
195
|
-
type: "button",
|
|
196
|
-
"aria-pressed": e(g) === f,
|
|
197
|
-
"aria-label": `${t.label || t.field || e(l).paramUnnamed}${e(U).get(f)?.length ? ` · ${e(l).paramIssueCount} ${e(U).get(f)?.length}` : ""}`,
|
|
198
|
-
class: W({ "has-errors": e(U).has(f) }),
|
|
199
|
-
onClick: (N) => g.value = f
|
|
200
|
-
}, [
|
|
201
|
-
n("span", fe, [
|
|
202
|
-
n("strong", null, o(t.label || t.field || e(l).paramUnnamed), 1),
|
|
203
|
-
e(U).has(f) ? (d(), u("span", he, o(e(U).get(f)?.length), 1)) : h("", !0)
|
|
204
|
-
]),
|
|
205
|
-
n("small", null, [
|
|
206
|
-
k(o(t.field) + " · " + o(P(t.type)), 1),
|
|
207
|
-
t.required ? (d(), u("span", ge, " *")) : h("", !0)
|
|
208
|
-
])
|
|
209
|
-
], 10, be))), 128))
|
|
210
|
-
], 8, ve),
|
|
211
|
-
n("button", {
|
|
212
|
-
type: "button",
|
|
213
|
-
class: "mr-param-editor__add",
|
|
214
|
-
disabled: a.readonly,
|
|
215
|
-
onClick: r[0] || (r[0] = //@ts-ignore
|
|
216
|
-
(...t) => e(s).add && e(s).add(...t))
|
|
217
|
-
}, "+ " + o(e(l).paramAdd), 9, _e),
|
|
218
|
-
n("p", null, o(e(l).paramsDescription), 1)
|
|
219
|
-
]),
|
|
220
|
-
n("div", {
|
|
221
|
-
ref_key: "main",
|
|
222
|
-
ref: J,
|
|
223
|
-
class: "mr-param-editor__main"
|
|
224
|
-
}, [
|
|
225
|
-
e(O).length ? (d(), u("div", ke, [
|
|
226
|
-
n("span", null, [
|
|
227
|
-
k(o(e(l).paramIssueCount) + " ", 1),
|
|
228
|
-
n("strong", null, o(e(O).length), 1)
|
|
229
|
-
]),
|
|
230
|
-
n("button", {
|
|
231
|
-
type: "button",
|
|
232
|
-
onClick: Q
|
|
233
|
-
}, o(e(l).paramLocateFirst), 1)
|
|
234
|
-
])) : h("", !0),
|
|
235
|
-
e(i) ? (d(), u(C, { key: 1 }, [
|
|
236
|
-
n("header", Me, [
|
|
237
|
-
n("div", null, [
|
|
238
|
-
n("strong", null, o(e(i).label || e(i).field || e(l).paramUnnamed), 1),
|
|
239
|
-
n("small", null, o(P(e(i).type)), 1)
|
|
240
|
-
]),
|
|
241
|
-
n("span", {
|
|
242
|
-
class: W({ "is-pending": e($) || e(O).length > 0 })
|
|
243
|
-
}, o(e(O).length ? e(l).paramInvalid : e($) ? e(l).paramPending : e(l).paramReady), 3)
|
|
244
|
-
]),
|
|
245
|
-
n("div", Oe, [
|
|
246
|
-
n("label", null, [
|
|
247
|
-
k(o(e(l).paramField), 1),
|
|
248
|
-
V(n("input", I({
|
|
249
|
-
"onUpdate:modelValue": r[1] || (r[1] = (t) => e(i).field = t),
|
|
250
|
-
"aria-label": e(l).paramField,
|
|
251
|
-
disabled: a.readonly,
|
|
252
|
-
autocomplete: "off"
|
|
253
|
-
}, S("field")), null, 16, Se), [
|
|
254
|
-
[H, e(i).field]
|
|
255
|
-
]),
|
|
256
|
-
e(s).controlIssues("field").length ? (d(), u("small", {
|
|
257
|
-
key: 0,
|
|
258
|
-
id: `${x}-${e(g)}-field`,
|
|
259
|
-
class: "mr-param-editor__field-error"
|
|
260
|
-
}, o(e(s).controlIssues("field").join(";")), 9, xe)) : h("", !0)
|
|
261
|
-
]),
|
|
262
|
-
n("label", null, [
|
|
263
|
-
k(o(e(l).paramLabel), 1),
|
|
264
|
-
V(n("input", {
|
|
265
|
-
"onUpdate:modelValue": r[2] || (r[2] = (t) => e(i).label = t),
|
|
266
|
-
"aria-label": e(l).paramLabel,
|
|
267
|
-
disabled: a.readonly
|
|
268
|
-
}, null, 8, $e), [
|
|
269
|
-
[z, e(i).label]
|
|
270
|
-
])
|
|
271
|
-
]),
|
|
272
|
-
n("label", null, [
|
|
273
|
-
k(o(e(l).paramType), 1),
|
|
274
|
-
n("select", I({
|
|
275
|
-
value: e(i).type,
|
|
276
|
-
"aria-label": e(l).paramType,
|
|
277
|
-
disabled: a.readonly
|
|
278
|
-
}, S("type"), {
|
|
279
|
-
onChange: r[3] || (r[3] = (t) => e(s).setType(t.target.value))
|
|
280
|
-
}), [
|
|
281
|
-
(d(!0), u(C, null, A(e(ie), (t) => (d(), u("option", {
|
|
282
|
-
key: t,
|
|
283
|
-
value: t
|
|
284
|
-
}, o(P(t)), 9, Ie))), 128))
|
|
285
|
-
], 16, Ve),
|
|
286
|
-
e(s).controlIssues("type").length ? (d(), u("small", {
|
|
287
|
-
key: 0,
|
|
288
|
-
id: `${x}-${e(g)}-type`,
|
|
289
|
-
class: "mr-param-editor__field-error"
|
|
290
|
-
}, o(e(s).controlIssues("type").join(";")), 9, Re)) : h("", !0)
|
|
291
|
-
]),
|
|
292
|
-
n("label", null, [
|
|
293
|
-
k(o(e(l).paramPlaceholder), 1),
|
|
294
|
-
V(n("input", {
|
|
295
|
-
"onUpdate:modelValue": r[4] || (r[4] = (t) => e(i).placeholder = t),
|
|
296
|
-
"aria-label": e(l).paramPlaceholder,
|
|
297
|
-
disabled: a.readonly
|
|
298
|
-
}, null, 8, De), [
|
|
299
|
-
[z, e(i).placeholder]
|
|
300
|
-
])
|
|
301
|
-
]),
|
|
302
|
-
n("div", Le, [
|
|
303
|
-
n("label", null, [
|
|
304
|
-
V(n("input", {
|
|
305
|
-
"onUpdate:modelValue": r[5] || (r[5] = (t) => e(i).required = t),
|
|
306
|
-
type: "checkbox",
|
|
307
|
-
disabled: a.readonly
|
|
308
|
-
}, null, 8, Ce), [
|
|
309
|
-
[G, e(i).required]
|
|
310
|
-
]),
|
|
311
|
-
k(o(e(l).paramRequired), 1)
|
|
312
|
-
]),
|
|
313
|
-
n("label", null, [
|
|
314
|
-
V(n("input", {
|
|
315
|
-
"onUpdate:modelValue": r[6] || (r[6] = (t) => e(i).defaultEnabled = t),
|
|
316
|
-
type: "checkbox",
|
|
317
|
-
disabled: a.readonly
|
|
318
|
-
}, null, 8, Ee), [
|
|
319
|
-
[G, e(i).defaultEnabled]
|
|
320
|
-
]),
|
|
321
|
-
k(o(e(l).paramDefaultEnabled), 1)
|
|
322
|
-
])
|
|
323
|
-
]),
|
|
324
|
-
e(i).defaultEnabled ? (d(), u("div", {
|
|
325
|
-
key: 0,
|
|
326
|
-
class: W(["mr-param-editor__default", { "is-range": e(i).type === "dateRange" }])
|
|
327
|
-
}, [
|
|
328
|
-
e(i).type === "dateRange" ? (d(), u(C, { key: 0 }, [
|
|
329
|
-
n("span", Ye, o(e(l).paramDefault), 1),
|
|
330
|
-
n("div", Ue, [
|
|
331
|
-
n("label", null, [
|
|
332
|
-
k(o(e(l).paramRangeStart), 1),
|
|
333
|
-
n("input", I({
|
|
334
|
-
value: y(0),
|
|
335
|
-
type: "date",
|
|
336
|
-
"aria-label": e(l).paramRangeStart,
|
|
337
|
-
disabled: a.readonly
|
|
338
|
-
}, S("defaultValue"), {
|
|
339
|
-
onInput: r[7] || (r[7] = (t) => L(0, t))
|
|
340
|
-
}), null, 16, Ne)
|
|
341
|
-
]),
|
|
342
|
-
r[20] || (r[20] = n("span", { "aria-hidden": "true" }, "—", -1)),
|
|
343
|
-
n("label", null, [
|
|
344
|
-
k(o(e(l).paramRangeEnd), 1),
|
|
345
|
-
n("input", I({
|
|
346
|
-
value: y(1),
|
|
347
|
-
type: "date",
|
|
348
|
-
"aria-label": e(l).paramRangeEnd,
|
|
349
|
-
disabled: a.readonly
|
|
350
|
-
}, S("defaultValue"), {
|
|
351
|
-
onInput: r[8] || (r[8] = (t) => L(1, t))
|
|
352
|
-
}), null, 16, Ae)
|
|
353
|
-
])
|
|
354
|
-
])
|
|
355
|
-
], 64)) : (d(), u("label", Te, [
|
|
356
|
-
k(o(e(l).paramDefault), 1),
|
|
357
|
-
e(i).type === "select" && e(i).optionsMode !== "remote" ? V((d(), u("select", I({
|
|
358
|
-
key: 0,
|
|
359
|
-
"onUpdate:modelValue": r[9] || (r[9] = (t) => e(i).defaultValue = t),
|
|
360
|
-
"aria-label": e(l).paramDefault,
|
|
361
|
-
disabled: a.readonly
|
|
362
|
-
}, S("defaultValue")), [
|
|
363
|
-
r[21] || (r[21] = n("option", { value: "" }, null, -1)),
|
|
364
|
-
(d(!0), u(C, null, A(e(i).options, (t, f) => (d(), u("option", {
|
|
365
|
-
key: f,
|
|
366
|
-
value: t.value
|
|
367
|
-
}, o(t.label || t.value), 9, je))), 128))
|
|
368
|
-
], 16, Pe)), [
|
|
369
|
-
[X, e(i).defaultValue]
|
|
370
|
-
]) : (d(), u("input", I({
|
|
371
|
-
key: 1,
|
|
372
|
-
value: e(i).defaultValue,
|
|
373
|
-
"aria-label": e(l).paramDefault,
|
|
374
|
-
type: q(e(i).type),
|
|
375
|
-
min: e(i).type === "year" ? 1 : void 0,
|
|
376
|
-
max: e(i).type === "year" ? 9999 : void 0,
|
|
377
|
-
step: e(i).type === "year" ? 1 : "any",
|
|
378
|
-
disabled: a.readonly
|
|
379
|
-
}, S("defaultValue"), {
|
|
380
|
-
onInput: r[10] || (r[10] = (t) => v("defaultValue", t))
|
|
381
|
-
}), null, 16, Je))
|
|
382
|
-
])),
|
|
383
|
-
e(s).controlIssues("defaultValue").length ? (d(), u("small", {
|
|
384
|
-
key: 2,
|
|
385
|
-
id: `${x}-${e(g)}-defaultValue`,
|
|
386
|
-
class: "mr-param-editor__field-error mr-param-editor__errors",
|
|
387
|
-
role: "alert"
|
|
388
|
-
}, o(e(s).controlIssues("defaultValue").join(";")), 9, qe)) : h("", !0)
|
|
389
|
-
], 2)) : h("", !0),
|
|
390
|
-
["number", "date", "month", "year", "dateRange"].includes(e(i).type) ? (d(), u(C, { key: 1 }, A(["min", "max"], (t) => n("label", { key: t }, [
|
|
391
|
-
k(o(t === "min" ? e(l).paramMinimum : e(l).paramMaximum), 1),
|
|
392
|
-
n("input", I({
|
|
393
|
-
value: e(i)[t],
|
|
394
|
-
"aria-label": t === "min" ? e(l).paramMinimum : e(l).paramMaximum,
|
|
395
|
-
type: q(e(i).type),
|
|
396
|
-
min: e(i).type === "year" ? 1 : void 0,
|
|
397
|
-
max: e(i).type === "year" ? 9999 : void 0,
|
|
398
|
-
step: e(i).type === "year" ? 1 : "any",
|
|
399
|
-
disabled: a.readonly
|
|
400
|
-
}, { ref_for: !0 }, S(t), {
|
|
401
|
-
onInput: (f) => v(t, f)
|
|
402
|
-
}), null, 16, we),
|
|
403
|
-
e(s).controlIssues(t).length ? (d(), u("small", {
|
|
404
|
-
key: 0,
|
|
405
|
-
id: `${x}-${e(g)}-${t}`,
|
|
406
|
-
class: "mr-param-editor__field-error"
|
|
407
|
-
}, o(e(s).controlIssues(t).join(";")), 9, Fe)) : h("", !0)
|
|
408
|
-
])), 64)) : h("", !0),
|
|
409
|
-
e(i).type === "text" ? (d(), u(C, { key: 2 }, A(["minLength", "maxLength"], (t) => n("label", { key: t }, [
|
|
410
|
-
k(o(t === "minLength" ? e(l).paramMinLength : e(l).paramMaxLength), 1),
|
|
411
|
-
n("input", I({
|
|
412
|
-
value: e(i)[t],
|
|
413
|
-
type: "number",
|
|
414
|
-
min: "0",
|
|
415
|
-
step: "1",
|
|
416
|
-
"aria-label": t === "minLength" ? e(l).paramMinLength : e(l).paramMaxLength,
|
|
417
|
-
disabled: a.readonly
|
|
418
|
-
}, { ref_for: !0 }, S(t), {
|
|
419
|
-
onInput: (f) => v(t, f)
|
|
420
|
-
}), null, 16, Be),
|
|
421
|
-
e(s).controlIssues(t).length ? (d(), u("small", {
|
|
422
|
-
key: 0,
|
|
423
|
-
id: `${x}-${e(g)}-${t}`,
|
|
424
|
-
class: "mr-param-editor__field-error"
|
|
425
|
-
}, o(e(s).controlIssues(t).join(";")), 9, We)) : h("", !0)
|
|
426
|
-
])), 64)) : h("", !0)
|
|
427
|
-
]),
|
|
428
|
-
e(i).type === "dateRange" ? (d(), u("p", He, o(e(l).paramRangeHint), 1)) : h("", !0),
|
|
429
|
-
e(i).type === "select" ? (d(), u("fieldset", ze, [
|
|
430
|
-
n("legend", null, o(e(l).paramOptionsMode), 1),
|
|
431
|
-
n("label", null, [
|
|
432
|
-
k(o(e(l).paramOptionsMode), 1),
|
|
433
|
-
V(n("select", {
|
|
434
|
-
"onUpdate:modelValue": r[11] || (r[11] = (t) => e(i).optionsMode = t),
|
|
435
|
-
"aria-label": e(l).paramOptionsMode,
|
|
436
|
-
disabled: a.readonly
|
|
437
|
-
}, [
|
|
438
|
-
n("option", Ke, o(e(l).paramOptionsStatic), 1),
|
|
439
|
-
n("option", Qe, o(e(l).paramOptionsRemote), 1)
|
|
440
|
-
], 8, Ge), [
|
|
441
|
-
[X, e(i).optionsMode]
|
|
442
|
-
])
|
|
443
|
-
]),
|
|
444
|
-
e(i).optionsMode === "remote" ? (d(), u(C, { key: 0 }, [
|
|
445
|
-
n("label", null, [
|
|
446
|
-
k(o(e(l).paramOptionsSource), 1),
|
|
447
|
-
V(n("input", I({
|
|
448
|
-
"onUpdate:modelValue": r[12] || (r[12] = (t) => e(i).optionsSource = t),
|
|
449
|
-
"aria-label": e(l).paramOptionsSource,
|
|
450
|
-
disabled: a.readonly
|
|
451
|
-
}, S("optionsSource")), null, 16, Xe), [
|
|
452
|
-
[H, e(i).optionsSource]
|
|
453
|
-
])
|
|
454
|
-
]),
|
|
455
|
-
e(s).controlIssues("optionsSource").length ? (d(), u("small", {
|
|
456
|
-
key: 0,
|
|
457
|
-
id: `${x}-${e(g)}-optionsSource`,
|
|
458
|
-
class: "mr-param-editor__field-error"
|
|
459
|
-
}, o(e(s).controlIssues("optionsSource").join(";")), 9, Ze)) : h("", !0),
|
|
460
|
-
n("fieldset", I({
|
|
461
|
-
class: "mr-param-editor__dependencies",
|
|
462
|
-
tabindex: "-1"
|
|
463
|
-
}, S("dependsOn")), [
|
|
464
|
-
n("legend", null, o(e(l).paramDependencies), 1),
|
|
465
|
-
(d(!0), u(C, null, A(w.value, (t, f) => (d(), u("label", { key: f }, [
|
|
466
|
-
V(n("input", {
|
|
467
|
-
"onUpdate:modelValue": r[13] || (r[13] = (N) => e(i).dependsOn = N),
|
|
468
|
-
type: "checkbox",
|
|
469
|
-
value: t.field,
|
|
470
|
-
disabled: a.readonly
|
|
471
|
-
}, null, 8, ea), [
|
|
472
|
-
[G, e(i).dependsOn]
|
|
473
|
-
]),
|
|
474
|
-
k(o(t.label), 1)
|
|
475
|
-
]))), 128))
|
|
476
|
-
], 16),
|
|
477
|
-
e(s).controlIssues("dependsOn").length ? (d(), u("small", {
|
|
478
|
-
key: 1,
|
|
479
|
-
id: `${x}-${e(g)}-dependsOn`,
|
|
480
|
-
class: "mr-param-editor__field-error"
|
|
481
|
-
}, o(e(s).controlIssues("dependsOn").join(";")), 9, aa)) : h("", !0),
|
|
482
|
-
n("p", ta, o(e(l).paramRemoteHint), 1)
|
|
483
|
-
], 64)) : h("", !0)
|
|
484
|
-
])) : h("", !0),
|
|
485
|
-
e(i).type === "select" && e(i).optionsMode === "static" ? (d(), u("fieldset", la, [
|
|
486
|
-
n("legend", null, o(e(l).paramOptions), 1),
|
|
487
|
-
n("div", na, [
|
|
488
|
-
n("span", null, o(e(l).paramOptionValue), 1),
|
|
489
|
-
n("span", null, o(e(l).paramOptionLabel), 1)
|
|
490
|
-
]),
|
|
491
|
-
(d(!0), u(C, null, A(e(i).options, (t, f) => (d(), u("div", {
|
|
492
|
-
key: f,
|
|
493
|
-
class: "mr-param-editor__option"
|
|
494
|
-
}, [
|
|
495
|
-
V(n("input", I({
|
|
496
|
-
"onUpdate:modelValue": (N) => t.value = N,
|
|
497
|
-
"aria-label": `${e(l).paramOptionValue} ${f + 1}`,
|
|
498
|
-
disabled: a.readonly
|
|
499
|
-
}, { ref_for: !0 }, S("options")), null, 16, oa), [
|
|
500
|
-
[H, t.value]
|
|
501
|
-
]),
|
|
502
|
-
V(n("input", {
|
|
503
|
-
"onUpdate:modelValue": (N) => t.label = N,
|
|
504
|
-
"aria-label": `${e(l).paramOptionLabel} ${f + 1}`,
|
|
505
|
-
disabled: a.readonly
|
|
506
|
-
}, null, 8, ra), [
|
|
507
|
-
[z, t.label]
|
|
508
|
-
]),
|
|
509
|
-
n("button", {
|
|
510
|
-
type: "button",
|
|
511
|
-
"aria-label": `${e(l).paramOptionRemove} ${f + 1}`,
|
|
512
|
-
disabled: a.readonly,
|
|
513
|
-
onClick: (N) => B(f)
|
|
514
|
-
}, "×", 8, ia)
|
|
515
|
-
]))), 128)),
|
|
516
|
-
e(s).controlIssues("options").length ? (d(), u("small", {
|
|
517
|
-
key: 0,
|
|
518
|
-
id: `${x}-${e(g)}-options`,
|
|
519
|
-
class: "mr-param-editor__field-error"
|
|
520
|
-
}, o(e(s).controlIssues("options").join(";")), 9, sa)) : h("", !0),
|
|
521
|
-
n("button", {
|
|
522
|
-
type: "button",
|
|
523
|
-
disabled: a.readonly,
|
|
524
|
-
onClick: F
|
|
525
|
-
}, "+ " + o(e(l).paramOptionAdd), 9, da)
|
|
526
|
-
])) : h("", !0),
|
|
527
|
-
n("div", ua, [
|
|
528
|
-
n("button", {
|
|
529
|
-
type: "button",
|
|
530
|
-
disabled: a.readonly || e(g) === 0,
|
|
531
|
-
onClick: r[14] || (r[14] = (t) => e(s).move(-1))
|
|
532
|
-
}, "↑ " + o(e(l).paramMoveUp), 9, ma),
|
|
533
|
-
n("button", {
|
|
534
|
-
type: "button",
|
|
535
|
-
disabled: a.readonly || e(g) === e(D).length - 1,
|
|
536
|
-
onClick: r[15] || (r[15] = (t) => e(s).move(1))
|
|
537
|
-
}, "↓ " + o(e(l).paramMoveDown), 9, pa),
|
|
538
|
-
n("button", {
|
|
539
|
-
type: "button",
|
|
540
|
-
class: "is-danger",
|
|
541
|
-
disabled: a.readonly,
|
|
542
|
-
onClick: r[16] || (r[16] = //@ts-ignore
|
|
543
|
-
(...t) => e(s).remove && e(s).remove(...t))
|
|
544
|
-
}, o(e(l).paramRemove), 9, ca)
|
|
545
|
-
]),
|
|
546
|
-
n("details", ya, [
|
|
547
|
-
n("summary", null, o(e(l).paramWire), 1),
|
|
548
|
-
n("code", null, o(e(se)[e(i).type]), 1)
|
|
549
|
-
])
|
|
550
|
-
], 64)) : (d(), u("div", va, [
|
|
551
|
-
n("strong", null, o(e(l).paramEmpty), 1),
|
|
552
|
-
n("p", null, o(e(l).paramEmptyHint), 1),
|
|
553
|
-
n("button", {
|
|
554
|
-
type: "button",
|
|
555
|
-
disabled: a.readonly,
|
|
556
|
-
onClick: r[17] || (r[17] = //@ts-ignore
|
|
557
|
-
(...t) => e(s).add && e(s).add(...t))
|
|
558
|
-
}, "+ " + o(e(l).paramAdd), 9, ba)
|
|
559
|
-
])),
|
|
560
|
-
e(E).added.length || e(E).removed.length ? (d(), u("aside", fa, [
|
|
561
|
-
n("strong", null, o(e(l).paramChanges), 1),
|
|
562
|
-
e(E).added.length ? (d(), u("p", ha, [
|
|
563
|
-
k(o(e(l).paramAdded) + ":", 1),
|
|
564
|
-
n("code", null, o(e(E).added.join(", ")), 1)
|
|
565
|
-
])) : h("", !0),
|
|
566
|
-
e(E).removed.length ? (d(), u("p", ga, [
|
|
567
|
-
k(o(e(l).paramRemoved) + ":", 1),
|
|
568
|
-
n("code", null, o(e(E).removed.join(", ")), 1)
|
|
569
|
-
])) : h("", !0),
|
|
570
|
-
n("small", null, o(e(l).paramRenameHint), 1)
|
|
571
|
-
])) : h("", !0),
|
|
572
|
-
e(Y) || e(j) ? (d(), u("p", _a, o(e(Y) ? e(l).paramConflict : e(j)), 1)) : h("", !0),
|
|
573
|
-
n("footer", null, [
|
|
574
|
-
n("button", {
|
|
575
|
-
type: "button",
|
|
576
|
-
disabled: !e($) && !e(Y),
|
|
577
|
-
onClick: r[18] || (r[18] = //@ts-ignore
|
|
578
|
-
(...t) => e(s).reset && e(s).reset(...t))
|
|
579
|
-
}, o(e(l).paramRestore), 9, ka),
|
|
580
|
-
n("button", {
|
|
581
|
-
type: "button",
|
|
582
|
-
class: "is-primary",
|
|
583
|
-
disabled: a.readonly || !e($) || e(Y) || !!e(O).length,
|
|
584
|
-
onClick: r[19] || (r[19] = //@ts-ignore
|
|
585
|
-
(...t) => e(s).apply && e(s).apply(...t))
|
|
586
|
-
}, o(e(l).paramApply), 9, Ma)
|
|
587
|
-
])
|
|
588
|
-
], 512)
|
|
589
|
-
], 8, ce));
|
|
590
|
-
}
|
|
591
|
-
}), Ia = /* @__PURE__ */ re(Oa, [["__scopeId", "data-v-b005b287"]]);
|
|
592
|
-
export {
|
|
593
|
-
Ia as default
|
|
594
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),j=require("./config-Dg_o8e7m.cjs"),H=require("@agile-team/mach-report"),J=require("./batch-z6Aw5GEY.cjs"),z=require("./designer-CPPdeM5_.cjs"),G=require("./_plugin-vue_export-helper-BLmdZLlg.cjs");function Q(a){const f={};return!a||typeof a!="object"||(typeof a.instanceId=="string"&&a.instanceId.length>0&&a.instanceId.length<=512&&(f.instanceId=a.instanceId),typeof a.label=="string"&&(f.label=a.label.slice(0,512))),f}function W(a){return Object.fromEntries((Array.isArray(a)?a:[]).filter(f=>f&&typeof f.field=="string").map(f=>[f.field,f.defaultValue??""]))}function U(a){return(a instanceof Error?a.message:String(a)).slice(0,1e3)}function X(a){try{return{cases:J.snapshotReportBatchCases(a.initialCases??[],a.maxCases??100),error:""}}catch(f){return{cases:[],error:U(f)}}}function Y(a){let f=0;const D=n=>({key:++f,item:{id:n.id,params:{...n.params}},status:"pending"}),N=X(a),y=new Set(N.cases.map(n=>n.id));let r=N.cases.length+1;const i=e.ref(N.cases.map(D)),h=e.ref(!1),b=e.ref(!1),x=e.ref(!1),_=e.ref(N.error),V=e.ref(),g=e.ref({completed:0,total:0,failed:0,cancelled:0}),E=e.computed(()=>({...z.REPORT_BATCH_MESSAGES,...a.messages})),R=e.computed(()=>i.value.map(n=>H.validateReportParams(a.paramDefs,n.item.params))),q=e.computed(()=>i.value.filter(n=>n.status==="failed").length),$=e.computed(()=>i.value.filter(n=>n.status==="pending"||n.status==="cancelled").length),P=e.computed(()=>i.value.filter(n=>n.status==="cancelled").length),p=e.computed(()=>a.maxCases??100);let k,d=0;function I(n=W(a.paramDefs)){for(;y.has(`case-${r}`);)r++;return{id:`case-${r++}`,params:{...n}}}function M(n){if(a.readonly||h.value)return;if(i.value.length>=p.value){_.value=E.value.batchLimit.replace("{count}",String(p.value));return}const s=D(I(n?.item.params));return i.value.push(s),_.value="",s}function A(n){!h.value&&!a.readonly&&(i.value=i.value.filter(s=>s.key!==n))}function S(n,s){if(h.value||a.readonly)return;const o=i.value.find(u=>u.key===n);!o||o.status==="completed"||JSON.stringify(o.item.params)===JSON.stringify(s)||(o.item=o.submitted?I(s):{...o.item,params:{...s}},o.submitted=!1,o.status="pending",delete o.receipt,delete o.error)}function B(){h.value&&(b.value=!0,k?.abort())}function O(n){return i.value.filter(s=>n?s.status==="failed":s.status==="pending"||s.status==="cancelled")}function K(n){const s=n.map(u=>H.validateReportParams(a.paramDefs,u.item.params)),o=s.findIndex(u=>!u.ok);if(o>=0){V.value=n[o].key,_.value=E.value.batchInvalid;return}return n.map((u,C)=>({id:u.item.id,params:{...s[C].values}}))}function L(n,s){n.status=s.status,s.status==="completed"&&(n.receipt=s.value),s.status==="failed"&&(n.error=s.error.message.slice(0,1e3))}async function T(n,s,o,u,C){u===d&&(n.status="running");try{const m=Q(await C(s,o));return u===d&&(n.receipt=m,n.status="completed"),m}catch(m){throw u===d&&(n.status=o.signal.aborted?"cancelled":"failed",n.error=U(m)),m}}async function w(n=!1){if(a.readonly||h.value)return;const s=O(n);if(!s.length)return;x.value=!0,_.value="",V.value=void 0;const o=K(s);if(!o)return;const u=++d,C=a.execute;k=new AbortController,h.value=!0,b.value=!1,g.value={completed:0,total:s.length,failed:0,cancelled:0};for(const m of s)m.status="pending",m.submitted=!0,delete m.receipt,delete m.error;try{const m=await J.runReportBatch(o,(c,l)=>T(s[l.index],c,l,u,C),{concurrency:a.concurrency,maxCases:p.value,signal:k.signal,onProgress:c=>{u===d&&(g.value=c)}});u===d&&m.forEach((c,l)=>L(s[l],c))}catch(m){u===d&&(_.value=U(m))}finally{u===d&&(h.value=!1,b.value=!1,k=void 0)}}return e.watch(()=>[JSON.stringify(a.paramDefs),a.execute,a.readonly,a.concurrency,a.maxCases],()=>{h.value&&(B(),_.value=E.value.batchChanged)}),e.onBeforeUnmount(()=>{d++,k?.abort()}),{m:E,rows:i,validations:R,running:h,cancelling:b,attempted:x,error:_,progress:g,failures:q,unfinished:$,cancelled:P,maximum:p,invalidKey:V,add:M,remove:A,setParams:S,cancel:B,run:w}}const Z=["aria-label","aria-busy"],ee={class:"mr-batch__heading"},te=["disabled"],ae={key:0,class:"mr-batch__toolbar"},ne=["aria-label"],le=["aria-pressed","onClick"],re=["disabled"],se={key:1,class:"mr-batch__empty"},ce={key:2,class:"mr-batch__empty"},oe={key:3,class:"mr-batch__rows"},ie=["data-batch-key","aria-label"],ue={class:"mr-batch__status",role:"status"},de={class:"mr-batch__row-actions"},me=["aria-label","disabled","onClick"],fe=["aria-label","disabled","onClick"],pe={key:0,class:"mr-batch__hint"},be={key:1,class:"mr-batch__row-error",role:"alert"},ve={key:2,class:"mr-batch__receipt"},ye=["title"],he=["onClick"],ge={key:4,class:"mr-batch__error",role:"alert"},ke={class:"mr-batch__progress","aria-live":"polite"},_e=["value","max","aria-label"],Ee={key:1},Se={class:"mr-batch__actions"},Be=["disabled"],Ce=["disabled"],Ne=["disabled"],Ve=["aria-label"],De=["disabled"],xe=["disabled"],Re=e.defineComponent({__name:"ReportBatchPanel",props:{paramDefs:{},execute:{type:Function},initialCases:{},readonly:{type:Boolean},concurrency:{},maxCases:{},messages:{},paramMessages:{}},emits:["open-instance"],setup(a,{emit:f}){const D=a,N=f,y=Y(D),{m:r,rows:i,validations:h,running:b,cancelling:x,attempted:_,error:V,progress:g,failures:E,unfinished:R,cancelled:q,maximum:$}=y,P=e.ref(),p=e.ref(1),k=10,d=e.ref("all"),I=e.ref(),M=e.ref(),A=e.computed(()=>i.value.map((c,l)=>({row:c,index:l}))),S=e.computed(()=>A.value.filter(({row:c})=>d.value==="all"||c.status===d.value)),B=e.computed(()=>Math.max(1,Math.ceil(S.value.length/k))),O=e.computed(()=>S.value.slice((p.value-1)*k,p.value*k)),K=e.computed(()=>r.value.batchPage.replace("{page}",String(p.value)).replace("{pages}",String(B.value)).replace("{total}",String(S.value.length)));e.watch(B,c=>{p.value=Math.min(p.value,c)}),e.watch(d,()=>{p.value=1});const L=e.computed(()=>({...j.DEFAULT_MESSAGES,...D.paramMessages})),T=e.computed(()=>r.value.batchProgress.replace("{completed}",String(g.value.completed)).replace("{total}",String(g.value.total)).replace("{failed}",String(g.value.failed)).replace("{cancelled}",String(g.value.cancelled))),w=e.computed(()=>{const c={all:i.value.length,pending:0,running:0,completed:0,failed:0,cancelled:0};for(const l of i.value)c[l.status]++;return Object.keys(c).filter(l=>l!=="running"||b.value||c.running>0||d.value==="running").map(l=>({value:l,count:c[l],label:l==="all"?r.value.batchAll:n({status:l})}))});function n(c){return{pending:r.value.batchPending,running:r.value.batchRunning,completed:r.value.batchCompleted,failed:r.value.batchFailed,cancelled:r.value.batchCancelled}[c.status]}async function s(c){const l=y.add(c);l&&(await u(l.key,"all"),o(l.key)?.querySelector(".mrp-param-input")?.focus())}function o(c){return P.value?.querySelector(`[data-batch-key="${c}"]`)}async function u(c,l){d.value=l,await e.nextTick();const t=S.value.findIndex(({row:v})=>v.key===c);t<0||(p.value=Math.floor(t/k)+1,I.value=c,await e.nextTick())}async function C(){const c=i.value.filter(v=>v.status==="failed"),l=c.findIndex(v=>v.key===M.value),t=c[(l+1)%c.length];t&&(M.value=t.key,await u(t.key,"failed"),o(t.key)?.focus())}async function m(c=!1){const l=y.run(c);if(y.invalidKey.value!==void 0){const t=y.invalidKey.value;await u(t,"all"),o(t)?.querySelector('[aria-invalid="true"]')?.focus()}await l}return(c,l)=>(e.openBlock(),e.createElementBlock("section",{ref_key:"root",ref:P,class:"mr-batch","aria-label":e.unref(r).batchTitle,"aria-busy":e.unref(b)},[e.createElementVNode("header",ee,[e.createElementVNode("div",null,[e.createElementVNode("strong",null,e.toDisplayString(e.unref(r).batchTitle),1),e.createElementVNode("p",null,e.toDisplayString(e.unref(r).batchDescription),1)]),e.createElementVNode("button",{type:"button",disabled:a.readonly||e.unref(b)||e.unref(i).length>=e.unref($),onClick:l[0]||(l[0]=t=>s())},"+ "+e.toDisplayString(e.unref(r).batchAdd),9,te)]),e.unref(i).length?(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",{class:"mr-batch__filters",role:"group","aria-label":e.unref(r).batchFilter},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,t=>(e.openBlock(),e.createElementBlock("button",{key:t.value,type:"button","aria-pressed":d.value===t.value,onClick:v=>d.value=t.value},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),e.createElementVNode("span",null,e.toDisplayString(t.count),1)],8,le))),128))],8,ne),e.unref(E)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"mr-batch__next-failure",disabled:e.unref(b),onClick:C},e.toDisplayString(e.unref(r).batchNextFailure)+" ↓",9,re)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.unref(i).length?S.value.length?(e.openBlock(),e.createElementBlock("div",oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,({row:t,index:v})=>(e.openBlock(),e.createElementBlock("article",{key:t.key,class:e.normalizeClass(["mr-batch__row",[`is-${t.status}`,{"is-located":t.key===I.value}]]),"data-batch-key":t.key,tabindex:"-1","aria-label":`${e.unref(r).batchCase} ${v+1} · ${n(t)}`},[e.createElementVNode("header",null,[e.createElementVNode("div",null,[e.createElementVNode("strong",null,e.toDisplayString(e.unref(r).batchCase)+" "+e.toDisplayString(v+1),1),e.createElementVNode("span",ue,e.toDisplayString(n(t)),1)]),e.createElementVNode("div",de,[e.createElementVNode("button",{type:"button","aria-label":`${t.status==="completed"?e.unref(r).batchDuplicateCompleted:e.unref(r).batchDuplicate} ${v+1}`,disabled:a.readonly||e.unref(b)||e.unref(i).length>=e.unref($),onClick:F=>s(t)},e.toDisplayString(t.status==="completed"?e.unref(r).batchDuplicateCompleted:e.unref(r).batchDuplicate),9,me),e.createElementVNode("button",{type:"button","aria-label":`${e.unref(r).batchRemove} ${v+1}`,disabled:a.readonly||e.unref(b),onClick:F=>e.unref(y).remove(t.key)},"×",8,fe)])]),e.createVNode(j.ReportParamPanel,{defs:a.paramDefs,"model-value":t.item.params,messages:L.value,attempted:e.unref(_),issues:e.unref(h)[v]?.issues,"show-actions":!1,"show-title":!1,disabled:a.readonly||e.unref(b)||t.status==="completed","onUpdate:modelValue":F=>e.unref(y).setParams(t.key,F)},null,8,["defs","model-value","messages","attempted","issues","disabled","onUpdate:modelValue"]),t.status==="completed"?(e.openBlock(),e.createElementBlock("p",pe,e.toDisplayString(e.unref(r).batchCompletedHint),1)):e.createCommentVNode("",!0),t.status==="failed"&&t.error?(e.openBlock(),e.createElementBlock("p",be,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0),t.status==="completed"?(e.openBlock(),e.createElementBlock("div",ve,[e.createElementVNode("span",{title:t.receipt?.label||t.receipt?.instanceId},e.toDisplayString(t.receipt?.label||(t.receipt?.instanceId?t.receipt.instanceId:e.unref(r).batchNoInstance)),9,ye),t.receipt?.instanceId?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",onClick:F=>N("open-instance",{...t.receipt})},e.toDisplayString(e.unref(r).batchOpen)+" ↗",9,he)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,ie))),128))])):(e.openBlock(),e.createElementBlock("div",ce,e.toDisplayString(e.unref(r).batchNoMatches),1)):(e.openBlock(),e.createElementBlock("div",se,e.toDisplayString(e.unref(r).batchEmpty),1)),e.unref(V)?(e.openBlock(),e.createElementBlock("p",ge,e.toDisplayString(e.unref(V)),1)):e.createCommentVNode("",!0),e.createElementVNode("footer",null,[e.createElementVNode("div",ke,[e.unref(g).total?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("progress",{value:e.unref(g).completed,max:e.unref(g).total,"aria-label":T.value},null,8,_e),e.createElementVNode("span",null,e.toDisplayString(T.value),1)],64)):(e.openBlock(),e.createElementBlock("span",Ee,e.toDisplayString(e.unref(i).length)+" / "+e.toDisplayString(e.unref($)),1))]),e.createElementVNode("div",Se,[e.unref(E)&&!e.unref(b)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:a.readonly,onClick:l[1]||(l[1]=t=>m(!0))},e.toDisplayString(e.unref(r).batchRetry)+" ("+e.toDisplayString(e.unref(E))+")",9,Be)):e.createCommentVNode("",!0),e.unref(b)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",disabled:e.unref(x),onClick:l[2]||(l[2]=(...t)=>e.unref(y).cancel&&e.unref(y).cancel(...t))},e.toDisplayString(e.unref(x)?e.unref(r).batchCancelling:e.unref(r).batchCancel),9,Ce)):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"is-primary",disabled:a.readonly||!e.unref(R),onClick:l[3]||(l[3]=t=>m())},[e.createTextVNode(e.toDisplayString(e.unref(q)?e.unref(r).batchContinue:e.unref(r).batchRun),1),e.unref(R)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(" ("+e.toDisplayString(e.unref(R))+")",1)],64)):e.createCommentVNode("",!0)],8,Ne))]),B.value>1?(e.openBlock(),e.createElementBlock("nav",{key:0,class:"mr-batch__pagination","aria-label":e.unref(r).batchPages},[e.createElementVNode("span",null,e.toDisplayString(K.value),1),e.createElementVNode("button",{type:"button",disabled:p.value<=1,onClick:l[4]||(l[4]=t=>p.value--)},e.toDisplayString(e.unref(r).batchPrevious),9,De),e.createElementVNode("button",{type:"button",disabled:p.value>=B.value,onClick:l[5]||(l[5]=t=>p.value++)},e.toDisplayString(e.unref(r).batchNext),9,xe)],8,Ve)):e.createCommentVNode("",!0)])],8,Z))}}),$e=G._export_sfc(Re,[["__scopeId","data-v-45980136"]]);exports.default=$e;
|