@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
|
@@ -0,0 +1,732 @@
|
|
|
1
|
+
import { defineComponent as se, computed as M, openBlock as d, createElementBlock as u, Fragment as L, renderList as U, normalizeStyle as re, createElementVNode as n, toDisplayString as i, ref as T, watch as ie, getCurrentInstance as de, unref as e, normalizeClass as z, createCommentVNode as b, createTextVNode as k, withDirectives as N, mergeProps as D, vModelDynamic as G, vModelText as K, vModelCheckbox as Q, createVNode as le, vModelSelect as ne, nextTick as ue } from "vue";
|
|
2
|
+
import { u as me, h as pe, R as ce, b as ve } from "./ReportParamPanel-mQkeN70Q.js";
|
|
3
|
+
import { _ as oe } from "./_plugin-vue_export-helper-8SL1F89S.js";
|
|
4
|
+
import { validateReportParamDefinitions as be } from "@agile-team/mach-report";
|
|
5
|
+
import { P as ye, u as fe } from "./designer-d6hJS41w.js";
|
|
6
|
+
const he = { class: "mr-param-tree" }, ge = { "aria-hidden": "true" }, _e = ["value", "aria-label", "disabled", "onInput"], Ie = ["value", "aria-label", "disabled", "onInput"], Se = ["aria-label", "disabled", "onClick"], $e = ["aria-label", "disabled", "onClick"], ke = ["disabled"], Oe = /* @__PURE__ */ se({
|
|
7
|
+
__name: "ParamTreeOptionsEditor",
|
|
8
|
+
props: {
|
|
9
|
+
modelValue: {},
|
|
10
|
+
messages: {},
|
|
11
|
+
readonly: { type: Boolean }
|
|
12
|
+
},
|
|
13
|
+
emits: ["update:modelValue"],
|
|
14
|
+
setup(t, { emit: _ }) {
|
|
15
|
+
const $ = t, c = _, I = M(() => {
|
|
16
|
+
const R = [], O = $.modelValue.map((a, y) => ({ item: a, path: [y] }));
|
|
17
|
+
for (let a = 0; a < O.length && R.length < 1e3; a++) {
|
|
18
|
+
const y = O[a];
|
|
19
|
+
R.push(y), y.path.length < 16 && O.splice(a + 1, 0, ...(y.item.children ?? []).map((p, s) => ({ item: p, path: [...y.path, s] })));
|
|
20
|
+
}
|
|
21
|
+
return R;
|
|
22
|
+
});
|
|
23
|
+
function r(R, O, a = "") {
|
|
24
|
+
if ($.readonly) return;
|
|
25
|
+
const y = JSON.parse(JSON.stringify($.modelValue));
|
|
26
|
+
let p = y;
|
|
27
|
+
for (const E of R.slice(0, -1)) p = p[E].children;
|
|
28
|
+
const s = R[R.length - 1], x = p[s];
|
|
29
|
+
if (O === "remove") p.splice(s, 1);
|
|
30
|
+
else if (O === "add") {
|
|
31
|
+
if (I.value.length >= 1e3 || R.length >= 16) return;
|
|
32
|
+
x ? (x.children ??= []).push({ label: "", value: "" }) : y.push({ label: "", value: "" });
|
|
33
|
+
} else x && (x[O] = a);
|
|
34
|
+
c("update:modelValue", y);
|
|
35
|
+
}
|
|
36
|
+
return (R, O) => (d(), u("div", he, [
|
|
37
|
+
(d(!0), u(L, null, U(I.value, (a, y) => (d(), u("div", {
|
|
38
|
+
key: a.path.join("."),
|
|
39
|
+
class: "mr-param-tree__row",
|
|
40
|
+
style: re({ paddingLeft: `${(a.path.length - 1) * 14}px` })
|
|
41
|
+
}, [
|
|
42
|
+
n("span", ge, i(a.path.length > 1 ? "↳" : "•"), 1),
|
|
43
|
+
n("input", {
|
|
44
|
+
value: a.item.value,
|
|
45
|
+
"aria-label": `${t.messages.paramOptionValue} ${y + 1}`,
|
|
46
|
+
disabled: t.readonly,
|
|
47
|
+
onInput: (p) => r(a.path, "value", p.target.value)
|
|
48
|
+
}, null, 40, _e),
|
|
49
|
+
n("input", {
|
|
50
|
+
value: a.item.label,
|
|
51
|
+
"aria-label": `${t.messages.paramOptionLabel} ${y + 1}`,
|
|
52
|
+
disabled: t.readonly,
|
|
53
|
+
onInput: (p) => r(a.path, "label", p.target.value)
|
|
54
|
+
}, null, 40, Ie),
|
|
55
|
+
n("button", {
|
|
56
|
+
type: "button",
|
|
57
|
+
"aria-label": `${t.messages.paramChildAdd} ${y + 1}`,
|
|
58
|
+
disabled: t.readonly || a.path.length >= 16 || I.value.length >= 1e3,
|
|
59
|
+
onClick: (p) => r(a.path, "add")
|
|
60
|
+
}, "+↳", 8, Se),
|
|
61
|
+
n("button", {
|
|
62
|
+
type: "button",
|
|
63
|
+
"aria-label": `${t.messages.paramOptionRemove} ${y + 1}`,
|
|
64
|
+
disabled: t.readonly,
|
|
65
|
+
onClick: (p) => r(a.path, "remove")
|
|
66
|
+
}, "×", 8, $e)
|
|
67
|
+
], 4))), 128)),
|
|
68
|
+
n("button", {
|
|
69
|
+
type: "button",
|
|
70
|
+
disabled: t.readonly || I.value.length >= 1e3,
|
|
71
|
+
onClick: O[0] || (O[0] = (a) => r([t.modelValue.length], "add"))
|
|
72
|
+
}, "+ " + i(t.messages.paramOptionAdd), 9, ke)
|
|
73
|
+
]));
|
|
74
|
+
}
|
|
75
|
+
}), Ve = /* @__PURE__ */ oe(Oe, [["__scopeId", "data-v-fb7ced48"]]), xe = ["text", "number", "date", "month", "year", "dateRange", "select", "multiSelect", "cascader", "numberRange"], Me = { text: "string", number: "string → number", date: "YYYY-MM-DD", month: "YYYY-MM", year: "YYYY", dateRange: "YYYY-MM-DD/YYYY-MM-DD", select: "option.value", multiSelect: 'JSON ["value",…]', cascader: 'JSON ["parent","leaf"]', numberRange: "JSON [minimum,maximum]" };
|
|
76
|
+
function Re(t) {
|
|
77
|
+
if (t.startsWith("远程选项")) return ["optionsSource"];
|
|
78
|
+
if (t.startsWith("联动依赖")) return ["dependsOn"];
|
|
79
|
+
if (/^(默认值|必填参数的默认值)/.test(t)) return ["defaultValue"];
|
|
80
|
+
if (t.includes("参数名")) return ["field"];
|
|
81
|
+
if (t.includes("选项")) return ["options"];
|
|
82
|
+
if (t.startsWith("最小边界")) return ["min", "max"];
|
|
83
|
+
if (t.startsWith("最小长度")) return ["minLength", "maxLength"];
|
|
84
|
+
const _ = /^(minLength|maxLength|minItems|maxItems|min|max) /.exec(t)?.[1];
|
|
85
|
+
return _ ? [_] : ["type"];
|
|
86
|
+
}
|
|
87
|
+
function Ce(t) {
|
|
88
|
+
return JSON.parse(JSON.stringify(t));
|
|
89
|
+
}
|
|
90
|
+
function X(t) {
|
|
91
|
+
return {
|
|
92
|
+
field: t.field,
|
|
93
|
+
label: t.label ?? "",
|
|
94
|
+
type: t.type ?? "text",
|
|
95
|
+
required: t.required === !0,
|
|
96
|
+
placeholder: t.placeholder ?? "",
|
|
97
|
+
defaultEnabled: t.defaultValue !== void 0,
|
|
98
|
+
defaultValue: t.defaultValue ?? "",
|
|
99
|
+
min: t.min === void 0 ? "" : String(t.min),
|
|
100
|
+
max: t.max === void 0 ? "" : String(t.max),
|
|
101
|
+
minLength: t.minLength === void 0 ? "" : String(t.minLength),
|
|
102
|
+
maxLength: t.maxLength === void 0 ? "" : String(t.maxLength),
|
|
103
|
+
minItems: t.minItems === void 0 ? "" : String(t.minItems),
|
|
104
|
+
maxItems: t.maxItems === void 0 ? "" : String(t.maxItems),
|
|
105
|
+
options: t.options ? JSON.parse(JSON.stringify(t.options)) : [],
|
|
106
|
+
optionsMode: t.optionsSource === void 0 ? "static" : "remote",
|
|
107
|
+
optionsSource: t.optionsSource ?? "",
|
|
108
|
+
dependsOn: [...t.dependsOn ?? []]
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function De(t) {
|
|
112
|
+
const _ = { field: t.field, type: t.type };
|
|
113
|
+
t.label && (_.label = t.label), t.placeholder && (_.placeholder = t.placeholder), t.required && (_.required = !0), t.defaultEnabled && (_.defaultValue = t.defaultValue);
|
|
114
|
+
for (const $ of ["min", "max"])
|
|
115
|
+
t[$] !== "" && (_[$] = ["number", "numberRange"].includes(t.type) ? Number(t[$]) : t[$]);
|
|
116
|
+
for (const $ of ["minLength", "maxLength", "minItems", "maxItems"]) t[$] !== "" && (_[$] = Number(t[$]));
|
|
117
|
+
return ["select", "multiSelect", "cascader"].includes(t.type) && t.optionsMode === "remote" ? (_.optionsSource = t.optionsSource.trim(), t.dependsOn.length && (_.dependsOn = [...t.dependsOn])) : ["select", "multiSelect", "cascader"].includes(t.type) && (_.options = JSON.parse(JSON.stringify(t.options))), _;
|
|
118
|
+
}
|
|
119
|
+
function Le(t) {
|
|
120
|
+
const _ = () => JSON.stringify(t.document.template.params ?? []), $ = T(_()), c = T((t.document.template.params ?? []).map(X)), I = T(0), r = T(""), R = M(() => ({ ...ye, ...t.messages })), O = M(() => c.value.map(De)), a = T(JSON.stringify(c.value)), y = M(() => JSON.stringify(c.value) !== a.value), p = M(() => _() !== $.value), s = M(() => be(O.value)), x = M(() => {
|
|
121
|
+
const v = /* @__PURE__ */ new Map();
|
|
122
|
+
for (const f of s.value) {
|
|
123
|
+
const g = Number(f.path.split(".").at(-1)), S = v.get(g) ?? [];
|
|
124
|
+
S.push({ message: f.message, controls: Re(f.message) }), v.set(g, S);
|
|
125
|
+
}
|
|
126
|
+
return v;
|
|
127
|
+
}), E = M(() => x.value.keys().next().value), V = M(() => c.value[I.value]), P = M(() => s.value.filter((v) => v.path === `$.paramDefs.${I.value}`));
|
|
128
|
+
function Y(v) {
|
|
129
|
+
return (x.value.get(I.value) ?? []).filter((f) => f.controls.includes(v)).map((f) => f.message);
|
|
130
|
+
}
|
|
131
|
+
const A = M(() => {
|
|
132
|
+
const v = JSON.parse($.value).map((g) => g.field), f = O.value.map((g) => g.field);
|
|
133
|
+
return { added: f.filter((g) => g && !v.includes(g)), removed: v.filter((g) => !f.includes(g)) };
|
|
134
|
+
});
|
|
135
|
+
function j() {
|
|
136
|
+
$.value = _(), c.value = (t.document.template.params ?? []).map(X), I.value = Math.min(I.value, Math.max(0, c.value.length - 1)), a.value = JSON.stringify(c.value), r.value = "";
|
|
137
|
+
}
|
|
138
|
+
ie(_, () => {
|
|
139
|
+
y.value || j();
|
|
140
|
+
});
|
|
141
|
+
function W() {
|
|
142
|
+
if (t.readonly) return;
|
|
143
|
+
let v = c.value.length + 1;
|
|
144
|
+
for (; c.value.some((f) => f.field === `param${v}`); ) v++;
|
|
145
|
+
c.value.push(X({ field: `param${v}`, type: "text" })), I.value = c.value.length - 1;
|
|
146
|
+
}
|
|
147
|
+
function H() {
|
|
148
|
+
t.readonly || !V.value || (c.value.splice(I.value, 1), I.value = Math.min(I.value, Math.max(0, c.value.length - 1)));
|
|
149
|
+
}
|
|
150
|
+
function w(v) {
|
|
151
|
+
const f = I.value + v;
|
|
152
|
+
if (t.readonly || f < 0 || f >= c.value.length) return;
|
|
153
|
+
const g = c.value.splice(I.value, 1)[0];
|
|
154
|
+
c.value.splice(f, 0, g), I.value = f;
|
|
155
|
+
}
|
|
156
|
+
function q(v) {
|
|
157
|
+
t.readonly || !V.value || (V.value.type === "cascader" && v !== "cascader" && (V.value.options = V.value.options.map((f) => ({ label: f.label, value: f.value }))), V.value.type = v, V.value.min = "", V.value.max = "", V.value.minLength = "", V.value.maxLength = "", V.value.minItems = "", V.value.maxItems = "");
|
|
158
|
+
}
|
|
159
|
+
function C() {
|
|
160
|
+
if (t.readonly || p.value || s.value.length) return !1;
|
|
161
|
+
try {
|
|
162
|
+
return t.accept(Ce(O.value)) ? ($.value = JSON.stringify(O.value), a.value = JSON.stringify(c.value), r.value = "", !0) : (r.value = R.value.paramApplyFailed, !1);
|
|
163
|
+
} catch (v) {
|
|
164
|
+
return r.value = v instanceof Error ? v.message : String(v), !1;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return fe({ key: () => "params", baseline: () => $.value, pending: () => y.value, snapshot: () => JSON.stringify({ rows: c.value, selected: I.value, initial: a.value }), restore(v, f) {
|
|
168
|
+
const g = JSON.parse(v);
|
|
169
|
+
if (!Array.isArray(g.rows) || g.rows.length > 1e3 || typeof g.initial != "string") throw new Error("Invalid parameter draft");
|
|
170
|
+
c.value = g.rows.map((S) => ({ ...S, minItems: S.minItems ?? "", maxItems: S.maxItems ?? "", optionsMode: S.optionsMode ?? "static", optionsSource: S.optionsSource ?? "", dependsOn: S.dependsOn ?? [] })), I.value = Math.max(0, Math.min(g.selected, g.rows.length - 1)), a.value = g.initial, $.value = f;
|
|
171
|
+
} }), { m: R, rows: c, selected: I, current: V, definitions: O, issues: s, issuesByRow: x, firstIssueIndex: E, controlIssues: Y, currentIssues: P, changes: A, pending: y, conflicted: p, error: r, reset: j, add: W, remove: H, move: w, setType: q, apply: C };
|
|
172
|
+
}
|
|
173
|
+
const Ne = ["aria-label"], Ee = { class: "mr-param-editor__directory" }, Ue = ["aria-label"], Ye = ["aria-pressed", "aria-label", "onClick"], Ae = { class: "mr-param-editor__directory-title" }, Je = {
|
|
174
|
+
key: 0,
|
|
175
|
+
class: "mr-param-editor__error-count",
|
|
176
|
+
"aria-hidden": "true"
|
|
177
|
+
}, Te = { key: 0 }, Pe = ["disabled"], je = {
|
|
178
|
+
key: 0,
|
|
179
|
+
class: "mr-param-editor__validation",
|
|
180
|
+
role: "status"
|
|
181
|
+
}, qe = { class: "mr-param-editor__heading" }, Fe = { class: "mr-param-editor__grid" }, Be = ["aria-label", "disabled"], We = ["id"], He = ["aria-label", "disabled"], we = ["value", "aria-label", "disabled"], ze = ["value"], Ge = ["id"], Ke = ["aria-label", "disabled"], Qe = { class: "mr-param-editor__checks" }, Xe = ["disabled"], Ze = ["disabled"], ea = {
|
|
182
|
+
key: 0,
|
|
183
|
+
class: "mr-param-editor__compound-default"
|
|
184
|
+
}, aa = { class: "mr-param-editor__default-label" }, ta = { class: "mr-param-editor__range" }, la = ["value", "aria-label", "disabled"], na = ["value", "aria-label", "disabled"], sa = { key: 2 }, ia = ["aria-label", "disabled"], oa = ["value"], ra = ["value", "aria-label", "type", "min", "max", "step", "disabled"], da = ["id"], ua = ["value", "aria-label", "type", "min", "max", "step", "disabled", "onInput"], ma = ["id"], pa = ["value", "aria-label", "disabled", "onInput"], ca = ["id"], va = {
|
|
185
|
+
key: 0,
|
|
186
|
+
class: "mr-param-editor__hint"
|
|
187
|
+
}, ba = {
|
|
188
|
+
key: 1,
|
|
189
|
+
class: "mr-param-editor__options"
|
|
190
|
+
}, ya = ["aria-label", "disabled"], fa = { value: "static" }, ha = { value: "remote" }, ga = ["aria-label", "disabled"], _a = ["id"], Ia = ["value", "disabled"], Sa = ["id"], $a = { class: "mr-param-editor__hint" }, ka = {
|
|
191
|
+
key: 2,
|
|
192
|
+
class: "mr-param-editor__options"
|
|
193
|
+
}, Oa = { class: "mr-param-editor__option-head" }, Va = ["onUpdate:modelValue", "aria-label", "disabled"], xa = ["onUpdate:modelValue", "aria-label", "disabled"], Ma = ["aria-label", "disabled", "onClick"], Ra = ["id"], Ca = ["disabled"], Da = {
|
|
194
|
+
key: 3,
|
|
195
|
+
class: "mr-param-editor__options"
|
|
196
|
+
}, La = { class: "mr-param-editor__hint" }, Na = ["id"], Ea = {
|
|
197
|
+
key: 4,
|
|
198
|
+
class: "mr-param-editor__grid"
|
|
199
|
+
}, Ua = ["value", "aria-label", "disabled", "onInput"], Ya = ["id"], Aa = { class: "mr-param-editor__row-actions" }, Ja = ["disabled"], Ta = ["disabled"], Pa = ["disabled"], ja = { class: "mr-param-editor__technical" }, qa = {
|
|
200
|
+
key: 2,
|
|
201
|
+
class: "mr-param-editor__empty"
|
|
202
|
+
}, Fa = ["disabled"], Ba = {
|
|
203
|
+
key: 3,
|
|
204
|
+
class: "mr-param-editor__impact"
|
|
205
|
+
}, Wa = { key: 0 }, Ha = { key: 1 }, wa = {
|
|
206
|
+
key: 4,
|
|
207
|
+
class: "mr-param-editor__errors",
|
|
208
|
+
role: "alert"
|
|
209
|
+
}, za = ["disabled"], Ga = ["disabled"], Ka = /* @__PURE__ */ se({
|
|
210
|
+
__name: "ParamEditor",
|
|
211
|
+
props: {
|
|
212
|
+
document: {},
|
|
213
|
+
readonly: { type: Boolean },
|
|
214
|
+
messages: {},
|
|
215
|
+
loadOptions: { type: Function },
|
|
216
|
+
accept: { type: Function }
|
|
217
|
+
},
|
|
218
|
+
emits: ["dirty"],
|
|
219
|
+
setup(t, { expose: _, emit: $ }) {
|
|
220
|
+
const c = t, I = $, r = Le(c), R = me(), O = M(() => c.loadOptions ?? pe(R.value).loadParamOptions), { m: a, rows: y, selected: p, current: s, changes: x, pending: E, conflicted: V, error: P, issues: Y, issuesByRow: A } = r, j = M(() => {
|
|
221
|
+
const m = y.value.filter((o, l) => l !== p.value).map((o) => ({ field: o.field, label: o.label || o.field || a.value.paramUnnamed }));
|
|
222
|
+
for (const o of s.value?.dependsOn ?? []) m.some((l) => l.field === o) || m.push({ field: o, label: `${o} · ${a.value.paramDependencyUnavailable}` });
|
|
223
|
+
return m;
|
|
224
|
+
}), W = M(() => s.value ? [{ ...r.definitions.value[p.value], defaultValue: void 0, required: !1 }] : []), H = M(() => {
|
|
225
|
+
const m = Object.fromEntries(r.definitions.value.map((o) => [o.field, o.defaultValue ?? ""]));
|
|
226
|
+
return s.value && (m[s.value.field] = s.value.defaultValue), m;
|
|
227
|
+
});
|
|
228
|
+
function w(m) {
|
|
229
|
+
s.value && !c.readonly && (s.value.defaultValue = m[s.value.field] ?? "");
|
|
230
|
+
}
|
|
231
|
+
const q = T(), C = `mr-param-${de()?.uid ?? 0}`;
|
|
232
|
+
ie(E, (m) => I("dirty", m), { immediate: !0 });
|
|
233
|
+
function v(m) {
|
|
234
|
+
return { text: a.value.paramText, number: a.value.paramNumber, date: a.value.paramDate, month: a.value.paramMonth, year: a.value.paramYear, dateRange: a.value.paramDateRange, select: a.value.paramSelect, multiSelect: a.value.paramMultiSelect, cascader: a.value.paramCascader, numberRange: a.value.paramNumberRange }[m];
|
|
235
|
+
}
|
|
236
|
+
function f() {
|
|
237
|
+
s.value && !c.readonly && s.value.options.push({ value: "", label: "" });
|
|
238
|
+
}
|
|
239
|
+
function g(m) {
|
|
240
|
+
c.readonly || s.value?.options.splice(m, 1);
|
|
241
|
+
}
|
|
242
|
+
function S(m) {
|
|
243
|
+
const o = r.controlIssues(m).length > 0;
|
|
244
|
+
return { "aria-invalid": o ? "true" : void 0, "aria-describedby": o ? `${C}-${p.value}-${m}` : void 0 };
|
|
245
|
+
}
|
|
246
|
+
function Z(m) {
|
|
247
|
+
return m === "year" ? "number" : m === "dateRange" ? "date" : m === "numberRange" ? "number" : ["date", "month", "number"].includes(m) ? m : "text";
|
|
248
|
+
}
|
|
249
|
+
function ee(m) {
|
|
250
|
+
return m.target.value;
|
|
251
|
+
}
|
|
252
|
+
function F(m, o) {
|
|
253
|
+
s.value && !c.readonly && (s.value[m] = ee(o));
|
|
254
|
+
}
|
|
255
|
+
function B(m) {
|
|
256
|
+
return s.value?.defaultValue.split("/")[m] ?? "";
|
|
257
|
+
}
|
|
258
|
+
function ae(m, o) {
|
|
259
|
+
if (!s.value || c.readonly) return;
|
|
260
|
+
const l = [B(0), B(1)];
|
|
261
|
+
l[m] = ee(o), s.value.defaultValue = l.some(Boolean) ? l.join("/") : "";
|
|
262
|
+
}
|
|
263
|
+
async function te() {
|
|
264
|
+
const m = r.firstIssueIndex.value;
|
|
265
|
+
if (m === void 0) return;
|
|
266
|
+
p.value = m, await ue();
|
|
267
|
+
const o = q.value?.querySelector('[aria-invalid="true"]');
|
|
268
|
+
o?.focus({ preventScroll: !0 }), o?.scrollIntoView?.({ block: "nearest" });
|
|
269
|
+
}
|
|
270
|
+
return _({ pending: E, reset: r.reset, apply: r.apply, locateIssue: te }), (m, o) => (d(), u("section", {
|
|
271
|
+
class: "mr-param-editor",
|
|
272
|
+
"aria-label": e(a).paramsTool
|
|
273
|
+
}, [
|
|
274
|
+
n("aside", Ee, [
|
|
275
|
+
n("header", null, [
|
|
276
|
+
n("strong", null, i(e(a).paramsDirectory), 1),
|
|
277
|
+
n("span", null, i(e(y).length), 1)
|
|
278
|
+
]),
|
|
279
|
+
n("nav", {
|
|
280
|
+
"aria-label": e(a).paramsDirectory
|
|
281
|
+
}, [
|
|
282
|
+
(d(!0), u(L, null, U(e(y), (l, h) => (d(), u("button", {
|
|
283
|
+
key: h,
|
|
284
|
+
type: "button",
|
|
285
|
+
"aria-pressed": e(p) === h,
|
|
286
|
+
"aria-label": `${l.label || l.field || e(a).paramUnnamed}${e(A).get(h)?.length ? ` · ${e(a).paramIssueCount} ${e(A).get(h)?.length}` : ""}`,
|
|
287
|
+
class: z({ "has-errors": e(A).has(h) }),
|
|
288
|
+
onClick: (J) => p.value = h
|
|
289
|
+
}, [
|
|
290
|
+
n("span", Ae, [
|
|
291
|
+
n("strong", null, i(l.label || l.field || e(a).paramUnnamed), 1),
|
|
292
|
+
e(A).has(h) ? (d(), u("span", Je, i(e(A).get(h)?.length), 1)) : b("", !0)
|
|
293
|
+
]),
|
|
294
|
+
n("small", null, [
|
|
295
|
+
k(i(l.field) + " · " + i(v(l.type)), 1),
|
|
296
|
+
l.required ? (d(), u("span", Te, " *")) : b("", !0)
|
|
297
|
+
])
|
|
298
|
+
], 10, Ye))), 128))
|
|
299
|
+
], 8, Ue),
|
|
300
|
+
n("button", {
|
|
301
|
+
type: "button",
|
|
302
|
+
class: "mr-param-editor__add",
|
|
303
|
+
disabled: t.readonly,
|
|
304
|
+
onClick: o[0] || (o[0] = //@ts-ignore
|
|
305
|
+
(...l) => e(r).add && e(r).add(...l))
|
|
306
|
+
}, "+ " + i(e(a).paramAdd), 9, Pe),
|
|
307
|
+
n("p", null, i(e(a).paramsDescription), 1)
|
|
308
|
+
]),
|
|
309
|
+
n("div", {
|
|
310
|
+
ref_key: "main",
|
|
311
|
+
ref: q,
|
|
312
|
+
class: "mr-param-editor__main"
|
|
313
|
+
}, [
|
|
314
|
+
e(Y).length ? (d(), u("div", je, [
|
|
315
|
+
n("span", null, [
|
|
316
|
+
k(i(e(a).paramIssueCount) + " ", 1),
|
|
317
|
+
n("strong", null, i(e(Y).length), 1)
|
|
318
|
+
]),
|
|
319
|
+
n("button", {
|
|
320
|
+
type: "button",
|
|
321
|
+
onClick: te
|
|
322
|
+
}, i(e(a).paramLocateFirst), 1)
|
|
323
|
+
])) : b("", !0),
|
|
324
|
+
e(s) ? (d(), u(L, { key: 1 }, [
|
|
325
|
+
n("header", qe, [
|
|
326
|
+
n("div", null, [
|
|
327
|
+
n("strong", null, i(e(s).label || e(s).field || e(a).paramUnnamed), 1),
|
|
328
|
+
n("small", null, i(v(e(s).type)), 1)
|
|
329
|
+
]),
|
|
330
|
+
n("span", {
|
|
331
|
+
class: z({ "is-pending": e(E) || e(Y).length > 0 })
|
|
332
|
+
}, i(e(Y).length ? e(a).paramInvalid : e(E) ? e(a).paramPending : e(a).paramReady), 3)
|
|
333
|
+
]),
|
|
334
|
+
n("div", Fe, [
|
|
335
|
+
n("label", null, [
|
|
336
|
+
k(i(e(a).paramField), 1),
|
|
337
|
+
N(n("input", D({
|
|
338
|
+
"onUpdate:modelValue": o[1] || (o[1] = (l) => e(s).field = l),
|
|
339
|
+
"aria-label": e(a).paramField,
|
|
340
|
+
disabled: t.readonly,
|
|
341
|
+
autocomplete: "off"
|
|
342
|
+
}, S("field")), null, 16, Be), [
|
|
343
|
+
[G, e(s).field]
|
|
344
|
+
]),
|
|
345
|
+
e(r).controlIssues("field").length ? (d(), u("small", {
|
|
346
|
+
key: 0,
|
|
347
|
+
id: `${C}-${e(p)}-field`,
|
|
348
|
+
class: "mr-param-editor__field-error"
|
|
349
|
+
}, i(e(r).controlIssues("field").join(";")), 9, We)) : b("", !0)
|
|
350
|
+
]),
|
|
351
|
+
n("label", null, [
|
|
352
|
+
k(i(e(a).paramLabel), 1),
|
|
353
|
+
N(n("input", {
|
|
354
|
+
"onUpdate:modelValue": o[2] || (o[2] = (l) => e(s).label = l),
|
|
355
|
+
"aria-label": e(a).paramLabel,
|
|
356
|
+
disabled: t.readonly
|
|
357
|
+
}, null, 8, He), [
|
|
358
|
+
[K, e(s).label]
|
|
359
|
+
])
|
|
360
|
+
]),
|
|
361
|
+
n("label", null, [
|
|
362
|
+
k(i(e(a).paramType), 1),
|
|
363
|
+
n("select", D({
|
|
364
|
+
value: e(s).type,
|
|
365
|
+
"aria-label": e(a).paramType,
|
|
366
|
+
disabled: t.readonly
|
|
367
|
+
}, S("type"), {
|
|
368
|
+
onChange: o[3] || (o[3] = (l) => e(r).setType(l.target.value))
|
|
369
|
+
}), [
|
|
370
|
+
(d(!0), u(L, null, U(e(xe), (l) => (d(), u("option", {
|
|
371
|
+
key: l,
|
|
372
|
+
value: l
|
|
373
|
+
}, i(v(l)), 9, ze))), 128))
|
|
374
|
+
], 16, we),
|
|
375
|
+
e(r).controlIssues("type").length ? (d(), u("small", {
|
|
376
|
+
key: 0,
|
|
377
|
+
id: `${C}-${e(p)}-type`,
|
|
378
|
+
class: "mr-param-editor__field-error"
|
|
379
|
+
}, i(e(r).controlIssues("type").join(";")), 9, Ge)) : b("", !0)
|
|
380
|
+
]),
|
|
381
|
+
n("label", null, [
|
|
382
|
+
k(i(e(a).paramPlaceholder), 1),
|
|
383
|
+
N(n("input", {
|
|
384
|
+
"onUpdate:modelValue": o[4] || (o[4] = (l) => e(s).placeholder = l),
|
|
385
|
+
"aria-label": e(a).paramPlaceholder,
|
|
386
|
+
disabled: t.readonly
|
|
387
|
+
}, null, 8, Ke), [
|
|
388
|
+
[K, e(s).placeholder]
|
|
389
|
+
])
|
|
390
|
+
]),
|
|
391
|
+
n("div", Qe, [
|
|
392
|
+
n("label", null, [
|
|
393
|
+
N(n("input", {
|
|
394
|
+
"onUpdate:modelValue": o[5] || (o[5] = (l) => e(s).required = l),
|
|
395
|
+
type: "checkbox",
|
|
396
|
+
disabled: t.readonly
|
|
397
|
+
}, null, 8, Xe), [
|
|
398
|
+
[Q, e(s).required]
|
|
399
|
+
]),
|
|
400
|
+
k(i(e(a).paramRequired), 1)
|
|
401
|
+
]),
|
|
402
|
+
n("label", null, [
|
|
403
|
+
N(n("input", {
|
|
404
|
+
"onUpdate:modelValue": o[6] || (o[6] = (l) => e(s).defaultEnabled = l),
|
|
405
|
+
type: "checkbox",
|
|
406
|
+
disabled: t.readonly
|
|
407
|
+
}, null, 8, Ze), [
|
|
408
|
+
[Q, e(s).defaultEnabled]
|
|
409
|
+
]),
|
|
410
|
+
k(i(e(a).paramDefaultEnabled), 1)
|
|
411
|
+
])
|
|
412
|
+
]),
|
|
413
|
+
e(s).defaultEnabled ? (d(), u("div", {
|
|
414
|
+
key: 0,
|
|
415
|
+
class: z(["mr-param-editor__default", { "is-range": e(s).type === "dateRange" }])
|
|
416
|
+
}, [
|
|
417
|
+
["multiSelect", "cascader", "numberRange"].includes(e(s).type) ? (d(), u("div", ea, [
|
|
418
|
+
n("span", null, i(e(a).paramDefault), 1),
|
|
419
|
+
le(ce, {
|
|
420
|
+
defs: W.value,
|
|
421
|
+
"model-value": H.value,
|
|
422
|
+
messages: e(ve),
|
|
423
|
+
"load-options": O.value,
|
|
424
|
+
attempted: !1,
|
|
425
|
+
"show-title": !1,
|
|
426
|
+
"show-actions": !1,
|
|
427
|
+
disabled: t.readonly,
|
|
428
|
+
"onUpdate:modelValue": w
|
|
429
|
+
}, null, 8, ["defs", "model-value", "messages", "load-options", "disabled"])
|
|
430
|
+
])) : e(s).type === "dateRange" ? (d(), u(L, { key: 1 }, [
|
|
431
|
+
n("span", aa, i(e(a).paramDefault), 1),
|
|
432
|
+
n("div", ta, [
|
|
433
|
+
n("label", null, [
|
|
434
|
+
k(i(e(a).paramRangeStart), 1),
|
|
435
|
+
n("input", D({
|
|
436
|
+
value: B(0),
|
|
437
|
+
type: "date",
|
|
438
|
+
"aria-label": e(a).paramRangeStart,
|
|
439
|
+
disabled: t.readonly
|
|
440
|
+
}, S("defaultValue"), {
|
|
441
|
+
onInput: o[7] || (o[7] = (l) => ae(0, l))
|
|
442
|
+
}), null, 16, la)
|
|
443
|
+
]),
|
|
444
|
+
o[21] || (o[21] = n("span", { "aria-hidden": "true" }, "—", -1)),
|
|
445
|
+
n("label", null, [
|
|
446
|
+
k(i(e(a).paramRangeEnd), 1),
|
|
447
|
+
n("input", D({
|
|
448
|
+
value: B(1),
|
|
449
|
+
type: "date",
|
|
450
|
+
"aria-label": e(a).paramRangeEnd,
|
|
451
|
+
disabled: t.readonly
|
|
452
|
+
}, S("defaultValue"), {
|
|
453
|
+
onInput: o[8] || (o[8] = (l) => ae(1, l))
|
|
454
|
+
}), null, 16, na)
|
|
455
|
+
])
|
|
456
|
+
])
|
|
457
|
+
], 64)) : (d(), u("label", sa, [
|
|
458
|
+
k(i(e(a).paramDefault), 1),
|
|
459
|
+
e(s).type === "select" && e(s).optionsMode !== "remote" ? N((d(), u("select", D({
|
|
460
|
+
key: 0,
|
|
461
|
+
"onUpdate:modelValue": o[9] || (o[9] = (l) => e(s).defaultValue = l),
|
|
462
|
+
"aria-label": e(a).paramDefault,
|
|
463
|
+
disabled: t.readonly
|
|
464
|
+
}, S("defaultValue")), [
|
|
465
|
+
o[22] || (o[22] = n("option", { value: "" }, null, -1)),
|
|
466
|
+
(d(!0), u(L, null, U(e(s).options, (l, h) => (d(), u("option", {
|
|
467
|
+
key: h,
|
|
468
|
+
value: l.value
|
|
469
|
+
}, i(l.label || l.value), 9, oa))), 128))
|
|
470
|
+
], 16, ia)), [
|
|
471
|
+
[ne, e(s).defaultValue]
|
|
472
|
+
]) : (d(), u("input", D({
|
|
473
|
+
key: 1,
|
|
474
|
+
value: e(s).defaultValue,
|
|
475
|
+
"aria-label": e(a).paramDefault,
|
|
476
|
+
type: Z(e(s).type),
|
|
477
|
+
min: e(s).type === "year" ? 1 : void 0,
|
|
478
|
+
max: e(s).type === "year" ? 9999 : void 0,
|
|
479
|
+
step: e(s).type === "year" ? 1 : "any",
|
|
480
|
+
disabled: t.readonly
|
|
481
|
+
}, S("defaultValue"), {
|
|
482
|
+
onInput: o[10] || (o[10] = (l) => F("defaultValue", l))
|
|
483
|
+
}), null, 16, ra))
|
|
484
|
+
])),
|
|
485
|
+
e(r).controlIssues("defaultValue").length ? (d(), u("small", {
|
|
486
|
+
key: 3,
|
|
487
|
+
id: `${C}-${e(p)}-defaultValue`,
|
|
488
|
+
class: "mr-param-editor__field-error mr-param-editor__errors",
|
|
489
|
+
role: "alert"
|
|
490
|
+
}, i(e(r).controlIssues("defaultValue").join(";")), 9, da)) : b("", !0)
|
|
491
|
+
], 2)) : b("", !0),
|
|
492
|
+
["number", "numberRange", "date", "month", "year", "dateRange"].includes(e(s).type) ? (d(), u(L, { key: 1 }, U(["min", "max"], (l) => n("label", { key: l }, [
|
|
493
|
+
k(i(l === "min" ? e(a).paramMinimum : e(a).paramMaximum), 1),
|
|
494
|
+
n("input", D({
|
|
495
|
+
value: e(s)[l],
|
|
496
|
+
"aria-label": l === "min" ? e(a).paramMinimum : e(a).paramMaximum,
|
|
497
|
+
type: Z(e(s).type),
|
|
498
|
+
min: e(s).type === "year" ? 1 : void 0,
|
|
499
|
+
max: e(s).type === "year" ? 9999 : void 0,
|
|
500
|
+
step: e(s).type === "year" ? 1 : "any",
|
|
501
|
+
disabled: t.readonly
|
|
502
|
+
}, { ref_for: !0 }, S(l), {
|
|
503
|
+
onInput: (h) => F(l, h)
|
|
504
|
+
}), null, 16, ua),
|
|
505
|
+
e(r).controlIssues(l).length ? (d(), u("small", {
|
|
506
|
+
key: 0,
|
|
507
|
+
id: `${C}-${e(p)}-${l}`,
|
|
508
|
+
class: "mr-param-editor__field-error"
|
|
509
|
+
}, i(e(r).controlIssues(l).join(";")), 9, ma)) : b("", !0)
|
|
510
|
+
])), 64)) : b("", !0),
|
|
511
|
+
e(s).type === "text" ? (d(), u(L, { key: 2 }, U(["minLength", "maxLength"], (l) => n("label", { key: l }, [
|
|
512
|
+
k(i(l === "minLength" ? e(a).paramMinLength : e(a).paramMaxLength), 1),
|
|
513
|
+
n("input", D({
|
|
514
|
+
value: e(s)[l],
|
|
515
|
+
type: "number",
|
|
516
|
+
min: "0",
|
|
517
|
+
step: "1",
|
|
518
|
+
"aria-label": l === "minLength" ? e(a).paramMinLength : e(a).paramMaxLength,
|
|
519
|
+
disabled: t.readonly
|
|
520
|
+
}, { ref_for: !0 }, S(l), {
|
|
521
|
+
onInput: (h) => F(l, h)
|
|
522
|
+
}), null, 16, pa),
|
|
523
|
+
e(r).controlIssues(l).length ? (d(), u("small", {
|
|
524
|
+
key: 0,
|
|
525
|
+
id: `${C}-${e(p)}-${l}`,
|
|
526
|
+
class: "mr-param-editor__field-error"
|
|
527
|
+
}, i(e(r).controlIssues(l).join(";")), 9, ca)) : b("", !0)
|
|
528
|
+
])), 64)) : b("", !0)
|
|
529
|
+
]),
|
|
530
|
+
e(s).type === "dateRange" ? (d(), u("p", va, i(e(a).paramRangeHint), 1)) : b("", !0),
|
|
531
|
+
["select", "multiSelect", "cascader"].includes(e(s).type) ? (d(), u("fieldset", ba, [
|
|
532
|
+
n("legend", null, i(e(a).paramOptionsMode), 1),
|
|
533
|
+
n("label", null, [
|
|
534
|
+
k(i(e(a).paramOptionsMode), 1),
|
|
535
|
+
N(n("select", {
|
|
536
|
+
"onUpdate:modelValue": o[11] || (o[11] = (l) => e(s).optionsMode = l),
|
|
537
|
+
"aria-label": e(a).paramOptionsMode,
|
|
538
|
+
disabled: t.readonly
|
|
539
|
+
}, [
|
|
540
|
+
n("option", fa, i(e(a).paramOptionsStatic), 1),
|
|
541
|
+
n("option", ha, i(e(a).paramOptionsRemote), 1)
|
|
542
|
+
], 8, ya), [
|
|
543
|
+
[ne, e(s).optionsMode]
|
|
544
|
+
])
|
|
545
|
+
]),
|
|
546
|
+
e(s).optionsMode === "remote" ? (d(), u(L, { key: 0 }, [
|
|
547
|
+
n("label", null, [
|
|
548
|
+
k(i(e(a).paramOptionsSource), 1),
|
|
549
|
+
N(n("input", D({
|
|
550
|
+
"onUpdate:modelValue": o[12] || (o[12] = (l) => e(s).optionsSource = l),
|
|
551
|
+
"aria-label": e(a).paramOptionsSource,
|
|
552
|
+
disabled: t.readonly
|
|
553
|
+
}, S("optionsSource")), null, 16, ga), [
|
|
554
|
+
[G, e(s).optionsSource]
|
|
555
|
+
])
|
|
556
|
+
]),
|
|
557
|
+
e(r).controlIssues("optionsSource").length ? (d(), u("small", {
|
|
558
|
+
key: 0,
|
|
559
|
+
id: `${C}-${e(p)}-optionsSource`,
|
|
560
|
+
class: "mr-param-editor__field-error"
|
|
561
|
+
}, i(e(r).controlIssues("optionsSource").join(";")), 9, _a)) : b("", !0),
|
|
562
|
+
n("fieldset", D({
|
|
563
|
+
class: "mr-param-editor__dependencies",
|
|
564
|
+
tabindex: "-1"
|
|
565
|
+
}, S("dependsOn")), [
|
|
566
|
+
n("legend", null, i(e(a).paramDependencies), 1),
|
|
567
|
+
(d(!0), u(L, null, U(j.value, (l, h) => (d(), u("label", { key: h }, [
|
|
568
|
+
N(n("input", {
|
|
569
|
+
"onUpdate:modelValue": o[13] || (o[13] = (J) => e(s).dependsOn = J),
|
|
570
|
+
type: "checkbox",
|
|
571
|
+
value: l.field,
|
|
572
|
+
disabled: t.readonly
|
|
573
|
+
}, null, 8, Ia), [
|
|
574
|
+
[Q, e(s).dependsOn]
|
|
575
|
+
]),
|
|
576
|
+
k(i(l.label), 1)
|
|
577
|
+
]))), 128))
|
|
578
|
+
], 16),
|
|
579
|
+
e(r).controlIssues("dependsOn").length ? (d(), u("small", {
|
|
580
|
+
key: 1,
|
|
581
|
+
id: `${C}-${e(p)}-dependsOn`,
|
|
582
|
+
class: "mr-param-editor__field-error"
|
|
583
|
+
}, i(e(r).controlIssues("dependsOn").join(";")), 9, Sa)) : b("", !0),
|
|
584
|
+
n("p", $a, i(e(a).paramRemoteHint), 1)
|
|
585
|
+
], 64)) : b("", !0)
|
|
586
|
+
])) : b("", !0),
|
|
587
|
+
["select", "multiSelect"].includes(e(s).type) && e(s).optionsMode === "static" ? (d(), u("fieldset", ka, [
|
|
588
|
+
n("legend", null, i(e(a).paramOptions), 1),
|
|
589
|
+
n("div", Oa, [
|
|
590
|
+
n("span", null, i(e(a).paramOptionValue), 1),
|
|
591
|
+
n("span", null, i(e(a).paramOptionLabel), 1)
|
|
592
|
+
]),
|
|
593
|
+
(d(!0), u(L, null, U(e(s).options, (l, h) => (d(), u("div", {
|
|
594
|
+
key: h,
|
|
595
|
+
class: "mr-param-editor__option"
|
|
596
|
+
}, [
|
|
597
|
+
N(n("input", D({
|
|
598
|
+
"onUpdate:modelValue": (J) => l.value = J,
|
|
599
|
+
"aria-label": `${e(a).paramOptionValue} ${h + 1}`,
|
|
600
|
+
disabled: t.readonly
|
|
601
|
+
}, { ref_for: !0 }, S("options")), null, 16, Va), [
|
|
602
|
+
[G, l.value]
|
|
603
|
+
]),
|
|
604
|
+
N(n("input", {
|
|
605
|
+
"onUpdate:modelValue": (J) => l.label = J,
|
|
606
|
+
"aria-label": `${e(a).paramOptionLabel} ${h + 1}`,
|
|
607
|
+
disabled: t.readonly
|
|
608
|
+
}, null, 8, xa), [
|
|
609
|
+
[K, l.label]
|
|
610
|
+
]),
|
|
611
|
+
n("button", {
|
|
612
|
+
type: "button",
|
|
613
|
+
"aria-label": `${e(a).paramOptionRemove} ${h + 1}`,
|
|
614
|
+
disabled: t.readonly,
|
|
615
|
+
onClick: (J) => g(h)
|
|
616
|
+
}, "×", 8, Ma)
|
|
617
|
+
]))), 128)),
|
|
618
|
+
e(r).controlIssues("options").length ? (d(), u("small", {
|
|
619
|
+
key: 0,
|
|
620
|
+
id: `${C}-${e(p)}-options`,
|
|
621
|
+
class: "mr-param-editor__field-error"
|
|
622
|
+
}, i(e(r).controlIssues("options").join(";")), 9, Ra)) : b("", !0),
|
|
623
|
+
n("button", {
|
|
624
|
+
type: "button",
|
|
625
|
+
disabled: t.readonly,
|
|
626
|
+
onClick: f
|
|
627
|
+
}, "+ " + i(e(a).paramOptionAdd), 9, Ca)
|
|
628
|
+
])) : b("", !0),
|
|
629
|
+
e(s).type === "cascader" && e(s).optionsMode === "static" ? (d(), u("fieldset", Da, [
|
|
630
|
+
n("legend", null, i(e(a).paramOptions), 1),
|
|
631
|
+
n("p", La, i(e(a).paramTreeHint), 1),
|
|
632
|
+
le(Ve, {
|
|
633
|
+
modelValue: e(s).options,
|
|
634
|
+
"onUpdate:modelValue": o[14] || (o[14] = (l) => e(s).options = l),
|
|
635
|
+
messages: e(a),
|
|
636
|
+
readonly: t.readonly
|
|
637
|
+
}, null, 8, ["modelValue", "messages", "readonly"]),
|
|
638
|
+
e(r).controlIssues("options").length ? (d(), u("small", {
|
|
639
|
+
key: 0,
|
|
640
|
+
id: `${C}-${e(p)}-options`,
|
|
641
|
+
class: "mr-param-editor__field-error"
|
|
642
|
+
}, i(e(r).controlIssues("options").join(";")), 9, Na)) : b("", !0)
|
|
643
|
+
])) : b("", !0),
|
|
644
|
+
e(s).type === "multiSelect" ? (d(), u("div", Ea, [
|
|
645
|
+
(d(), u(L, null, U(["minItems", "maxItems"], (l) => n("label", { key: l }, [
|
|
646
|
+
k(i(l === "minItems" ? e(a).paramMinItems : e(a).paramMaxItems), 1),
|
|
647
|
+
n("input", D({
|
|
648
|
+
value: e(s)[l],
|
|
649
|
+
"aria-label": l === "minItems" ? e(a).paramMinItems : e(a).paramMaxItems,
|
|
650
|
+
type: "number",
|
|
651
|
+
min: "0",
|
|
652
|
+
max: "100",
|
|
653
|
+
step: "1",
|
|
654
|
+
disabled: t.readonly
|
|
655
|
+
}, { ref_for: !0 }, S(l), {
|
|
656
|
+
onInput: (h) => F(l, h)
|
|
657
|
+
}), null, 16, Ua),
|
|
658
|
+
e(r).controlIssues(l).length ? (d(), u("small", {
|
|
659
|
+
key: 0,
|
|
660
|
+
id: `${C}-${e(p)}-${l}`,
|
|
661
|
+
class: "mr-param-editor__field-error"
|
|
662
|
+
}, i(e(r).controlIssues(l).join(";")), 9, Ya)) : b("", !0)
|
|
663
|
+
])), 64))
|
|
664
|
+
])) : b("", !0),
|
|
665
|
+
n("div", Aa, [
|
|
666
|
+
n("button", {
|
|
667
|
+
type: "button",
|
|
668
|
+
disabled: t.readonly || e(p) === 0,
|
|
669
|
+
onClick: o[15] || (o[15] = (l) => e(r).move(-1))
|
|
670
|
+
}, "↑ " + i(e(a).paramMoveUp), 9, Ja),
|
|
671
|
+
n("button", {
|
|
672
|
+
type: "button",
|
|
673
|
+
disabled: t.readonly || e(p) === e(y).length - 1,
|
|
674
|
+
onClick: o[16] || (o[16] = (l) => e(r).move(1))
|
|
675
|
+
}, "↓ " + i(e(a).paramMoveDown), 9, Ta),
|
|
676
|
+
n("button", {
|
|
677
|
+
type: "button",
|
|
678
|
+
class: "is-danger",
|
|
679
|
+
disabled: t.readonly,
|
|
680
|
+
onClick: o[17] || (o[17] = //@ts-ignore
|
|
681
|
+
(...l) => e(r).remove && e(r).remove(...l))
|
|
682
|
+
}, i(e(a).paramRemove), 9, Pa)
|
|
683
|
+
]),
|
|
684
|
+
n("details", ja, [
|
|
685
|
+
n("summary", null, i(e(a).paramWire), 1),
|
|
686
|
+
n("code", null, i(e(Me)[e(s).type]), 1)
|
|
687
|
+
])
|
|
688
|
+
], 64)) : (d(), u("div", qa, [
|
|
689
|
+
n("strong", null, i(e(a).paramEmpty), 1),
|
|
690
|
+
n("p", null, i(e(a).paramEmptyHint), 1),
|
|
691
|
+
n("button", {
|
|
692
|
+
type: "button",
|
|
693
|
+
disabled: t.readonly,
|
|
694
|
+
onClick: o[18] || (o[18] = //@ts-ignore
|
|
695
|
+
(...l) => e(r).add && e(r).add(...l))
|
|
696
|
+
}, "+ " + i(e(a).paramAdd), 9, Fa)
|
|
697
|
+
])),
|
|
698
|
+
e(x).added.length || e(x).removed.length ? (d(), u("aside", Ba, [
|
|
699
|
+
n("strong", null, i(e(a).paramChanges), 1),
|
|
700
|
+
e(x).added.length ? (d(), u("p", Wa, [
|
|
701
|
+
k(i(e(a).paramAdded) + ":", 1),
|
|
702
|
+
n("code", null, i(e(x).added.join(", ")), 1)
|
|
703
|
+
])) : b("", !0),
|
|
704
|
+
e(x).removed.length ? (d(), u("p", Ha, [
|
|
705
|
+
k(i(e(a).paramRemoved) + ":", 1),
|
|
706
|
+
n("code", null, i(e(x).removed.join(", ")), 1)
|
|
707
|
+
])) : b("", !0),
|
|
708
|
+
n("small", null, i(e(a).paramRenameHint), 1)
|
|
709
|
+
])) : b("", !0),
|
|
710
|
+
e(V) || e(P) ? (d(), u("p", wa, i(e(V) ? e(a).paramConflict : e(P)), 1)) : b("", !0),
|
|
711
|
+
n("footer", null, [
|
|
712
|
+
n("button", {
|
|
713
|
+
type: "button",
|
|
714
|
+
disabled: !e(E) && !e(V),
|
|
715
|
+
onClick: o[19] || (o[19] = //@ts-ignore
|
|
716
|
+
(...l) => e(r).reset && e(r).reset(...l))
|
|
717
|
+
}, i(e(a).paramRestore), 9, za),
|
|
718
|
+
n("button", {
|
|
719
|
+
type: "button",
|
|
720
|
+
class: "is-primary",
|
|
721
|
+
disabled: t.readonly || !e(E) || e(V) || !!e(Y).length,
|
|
722
|
+
onClick: o[20] || (o[20] = //@ts-ignore
|
|
723
|
+
(...l) => e(r).apply && e(r).apply(...l))
|
|
724
|
+
}, i(e(a).paramApply), 9, Ga)
|
|
725
|
+
])
|
|
726
|
+
], 512)
|
|
727
|
+
], 8, Ne));
|
|
728
|
+
}
|
|
729
|
+
}), tt = /* @__PURE__ */ oe(Ka, [["__scopeId", "data-v-276b7ccd"]]);
|
|
730
|
+
export {
|
|
731
|
+
tt as default
|
|
732
|
+
};
|